Skip to content

Commit 839aa84

Browse files
committed
registrar: Adjust get_branch() usage to new code
1 parent 7223b84 commit 839aa84

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

dset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ int append_msg_branch(struct msg_branch *branch)
272272
if (dsct && !dsct->enabled)
273273
return -1;
274274

275-
if (dsct==NULL && _dst_malloc(&dsct)==0 )
275+
if (dsct==NULL && _dst_malloc(&dsct)<0 )
276276
return -1;
277277

278278
idx = dsct->nr_branches;

modules/registrar/test/test.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ static void test_lookup(void)
121121
/* test the "r" flag (branch lookup) */
122122
{
123123
str aor2 = str_init("bob"), aor3 = str_init("carol");
124+
struct msg_branch branch;
124125

125126
ul.lock_udomain(d, &aor2);
126127
ok(ul.insert_urecord(d, &aor2, &r, 0) == 0, "create AoR 2");
@@ -134,16 +135,18 @@ static void test_lookup(void)
134135
ul.unlock_udomain(d, &aor3);
135136

136137
/* ensure the AoR expansion process doesn't stop on a non-existing AoR */
137-
str ruri1 = str_init("sip:[email protected]");
138-
ok(append_branch(NULL, &ruri1, NULL, NULL, 1, 0, NULL) == 1, "append AoR-2");
138+
memset(&branch, 0, sizeof branch);
139+
branch.uri = str_init("sip:[email protected]");
140+
branch.q = 1;
141+
ok(append_msg_branch(&branch) == 1, "append AoR-2");
139142

140-
str ruri2 = str_init("sip:[email protected]");
141-
ok(append_branch(NULL, &ruri2, NULL, NULL, 1, 0, NULL) == 1, "append AoR-3");
143+
branch.uri = str_init("sip:[email protected]");
144+
ok(append_msg_branch(&branch) == 1, "append AoR-3");
142145

143146
set_ruri(&msg, &aor_ruri);
144147
flags.flags = REG_BRANCH_AOR_LOOKUP_FLAG;
145148
ok(reg_lookup(&msg, d, &flags, NULL) == LOOKUP_OK, "lookup-8");
146-
ok(get_nr_branches() == 1, "get-nr-branches");
149+
ok(get_dset_size() == 1, "get-nr-branches");
147150
}
148151
}
149152

0 commit comments

Comments
 (0)