Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
80556d0a
Commit
80556d0a
authored
Aug 01, 2018
by
Benjamin REIS
Browse files
test multiple bodyless list subscription
parent
20ad0af6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
9 deletions
+56
-9
tester/presence_server_tester.c
tester/presence_server_tester.c
+56
-9
No files found.
tester/presence_server_tester.c
View file @
80556d0a
...
...
@@ -1749,23 +1749,69 @@ static void simple_bodyless_list_subscription(void) {
LinphoneCoreManager
*
marie
=
linphone_core_manager_new
(
"marie_rc"
);
LinphoneFriendList
*
friendList
=
linphone_core_create_friend_list
(
marie
->
lc
);
linphone_core_add_friend_list
(
marie
->
lc
,
friendList
);
linphone_friend_list_set_rls_uri
(
friendList
,
"sip:
rl
s@sip.example.org"
);
linphone_friend_list_set_rls_uri
(
friendList
,
"sip:
friend
s@sip
open
.example.org"
);
linphone_friend_list_set_display_name
(
friendList
,
"Friends"
);
linphone_friend_list_set_subscription_bodyless
(
friendList
,
TRUE
);
linphone_friend_list_update_subscriptions
(
friendList
);
BC_ASSERT_TRUE
(
wait_for_until
(
marie
->
lc
,
NULL
,
&
marie
->
stat
.
number_of_NotifyPresenceReceived
,
2
,
4
000
));
BC_ASSERT_
PTR_NOT_NULL
(
linphone_friend_list_
find
_friend
_by_uri
(
friendList
,
"sip:nom1@sipopen.example.org"
)
);
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:
nom2
@sipopen.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:
nom3
@sipopen.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:
nom4
@sipopen.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:
nom5
@sipopen.example.org"
));
BC_ASSERT_PTR_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:
nom6
@sipopen.example.org"
));
BC_ASSERT_TRUE
(
wait_for_until
(
marie
->
lc
,
NULL
,
&
marie
->
stat
.
number_of_NotifyPresenceReceived
,
4
,
2
000
));
BC_ASSERT_
EQUAL
(
bctbx_list_size
(
linphone_friend_list_
get
_friend
s
(
friendList
)),
4
,
int
,
"%d"
);
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:
friend1
@sipopen.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:
friend2
@sipopen.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:
friend3
@sipopen.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:
friend4
@sipopen.example.org"
));
BC_ASSERT_PTR_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:
friend5
@sipopen.example.org"
));
linphone_friend_list_unref
(
friendList
);
linphone_core_manager_destroy
(
marie
);
}
static
void
multiple_bodyless_list_subscription
(
void
)
{
LinphoneCoreManager
*
marie
=
linphone_core_manager_new
(
"marie_rc"
);
LinphoneFriendList
*
friendList
=
linphone_core_create_friend_list
(
marie
->
lc
);
LinphoneFriendList
*
buddyList
=
linphone_core_create_friend_list
(
marie
->
lc
);
LinphoneFriendList
*
broList
=
linphone_core_create_friend_list
(
marie
->
lc
);
int
dummy
=
0
;
linphone_core_add_friend_list
(
marie
->
lc
,
friendList
);
linphone_friend_list_set_rls_uri
(
friendList
,
"sip:friends@sipopen.example.org"
);
linphone_friend_list_set_display_name
(
friendList
,
"Friends"
);
linphone_friend_list_set_subscription_bodyless
(
friendList
,
TRUE
);
linphone_core_add_friend_list
(
marie
->
lc
,
buddyList
);
linphone_friend_list_set_rls_uri
(
buddyList
,
"sip:buddies@sipopen.example.org"
);
linphone_friend_list_set_display_name
(
buddyList
,
"Buddies"
);
linphone_friend_list_set_subscription_bodyless
(
buddyList
,
TRUE
);
linphone_core_add_friend_list
(
marie
->
lc
,
broList
);
linphone_friend_list_set_rls_uri
(
broList
,
"sip:bros@sipopen.example.org"
);
linphone_friend_list_set_display_name
(
broList
,
"Bros"
);
linphone_friend_list_set_subscription_bodyless
(
broList
,
TRUE
);
wait_for_until
(
marie
->
lc
,
NULL
,
&
dummy
,
1
,
4000
);
BC_ASSERT_EQUAL
(
bctbx_list_size
(
linphone_friend_list_get_friends
(
friendList
)),
4
,
int
,
"%d"
);
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend1@sipopen.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend2@sipopen.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend3@sipopen.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend4@sipopen.example.org"
));
BC_ASSERT_PTR_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend5@sipopen.example.org"
));
BC_ASSERT_EQUAL
(
bctbx_list_size
(
linphone_friend_list_get_friends
(
buddyList
)),
3
,
int
,
"%d"
);
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
buddyList
,
"sip:buddy1@sipopen.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
buddyList
,
"sip:buddy2@sipopen.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
buddyList
,
"sip:buddy3@sipopen.example.org"
));
BC_ASSERT_PTR_NULL
(
linphone_friend_list_find_friend_by_uri
(
buddyList
,
"sip:buddy4@sipopen.example.org"
));
BC_ASSERT_EQUAL
(
bctbx_list_size
(
linphone_friend_list_get_friends
(
broList
)),
1
,
int
,
"%d"
);
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
broList
,
"sip:bro@sipopen.example.org"
));
BC_ASSERT_PTR_NULL
(
linphone_friend_list_find_friend_by_uri
(
broList
,
"sip:bro2@sipopen.example.org"
));
linphone_friend_list_unref
(
friendList
);
linphone_friend_list_unref
(
buddyList
);
linphone_friend_list_unref
(
broList
);
linphone_core_manager_destroy
(
marie
);
}
test_t
presence_server_tests
[]
=
{
TEST_NO_TAG
(
"Simple Publish"
,
simple_publish
),
TEST_NO_TAG
(
"Publish with 2 identities"
,
publish_with_dual_identity
),
...
...
@@ -1797,6 +1843,7 @@ test_t presence_server_tests[] = {
TEST_NO_TAG
(
"Extended notify only when subscribe then unsubscribe then re-subscribe"
,
extended_notify_sub_unsub_sub
),
TEST_NO_TAG
(
"Extended notify only when subscribe then unsubscribe then re-subscribe 2"
,
extended_notify_sub_unsub_sub2
),
TEST_ONE_TAG
(
"Simple bodyless list subscription"
,
simple_bodyless_list_subscription
,
"bodyless"
),
TEST_ONE_TAG
(
"Multiple bodyless list subscription"
,
multiple_bodyless_list_subscription
,
"bodyless"
),
};
test_suite_t
presence_server_test_suite
=
{
"Presence using server"
,
NULL
,
NULL
,
liblinphone_tester_before_each
,
liblinphone_tester_after_each
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment