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
c23f39da
Commit
c23f39da
authored
Apr 22, 2016
by
Sylvain Berfini
🐮
Browse files
Clean contacts on server after latest CardDAV test
parent
ade92fb2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
tester/vcard_tester.c
tester/vcard_tester.c
+19
-3
No files found.
tester/vcard_tester.c
View file @
c23f39da
...
...
@@ -721,6 +721,7 @@ static void carddav_server_to_client_and_client_to_sever_sync(void) {
LinphoneFriend
*
lf1
=
linphone_friend_new_from_vcard
(
lvc1
);
LinphoneVcard
*
lvc2
=
linphone_vcard_new_from_vcard4_buffer
(
"BEGIN:VCARD
\r\n
VERSION:4.0
\r\n
FN:Ghislain Mary
\r\n
IMPP;TYPE=work:sip:ghislain@sip.linphone.org
\r\n
END:VCARD
\r\n
"
);
LinphoneFriend
*
lf2
=
linphone_friend_new_from_vcard
(
lvc2
);
MSList
*
friends
=
NULL
,
*
friends_iterator
=
NULL
;
linphone_friend_list_cbs_set_user_data
(
cbs
,
stats
);
linphone_friend_list_cbs_set_contact_created
(
cbs
,
carddav_contact_created
);
...
...
@@ -731,14 +732,29 @@ static void carddav_server_to_client_and_client_to_sever_sync(void) {
linphone_friend_list_set_uri
(
lfl
,
CARDDAV_SERVER
);
linphone_friend_list_add_friend
(
lfl
,
lf1
);
linphone_friend_unref
(
lf1
);
linphone_friend_list_synchronize_friends_from_server
(
lfl
);
linphone_friend_list_add_friend
(
lfl
,
lf2
);
linphone_friend_unref
(
lf2
);
wait_for_until
(
manager
->
lc
,
NULL
,
&
stats
->
sync_done_count
,
3
,
15000
);
BC_ASSERT_EQUAL
(
stats
->
sync_done_count
,
3
,
int
,
"%i"
);
stats
->
sync_done_count
=
0
;
friends
=
ms_list_copy
(
lfl
->
friends
);
friends_iterator
=
friends
;
while
(
friends_iterator
)
{
LinphoneFriend
*
lf
=
(
LinphoneFriend
*
)
friends_iterator
->
data
;
if
(
lf
&&
strcmp
(
linphone_friend_get_name
(
lf
),
"Sylvain Berfini"
)
!=
0
)
{
linphone_friend_list_remove_friend
(
lfl
,
lf
);
wait_for_until
(
manager
->
lc
,
NULL
,
&
stats
->
sync_done_count
,
1
,
5000
);
BC_ASSERT_EQUAL
(
stats
->
sync_done_count
,
1
,
int
,
"%i"
);
stats
->
sync_done_count
=
0
;
}
friends_iterator
=
ms_list_next
(
friends_iterator
);
}
ms_list_free
(
friends
);
ms_free
(
stats
);
linphone_friend_unref
(
lf1
);
linphone_friend_unref
(
lf2
);
linphone_friend_list_unref
(
lfl
);
linphone_core_manager_destroy
(
manager
);
}
...
...
@@ -765,8 +781,8 @@ test_t vcard_tests[] = {
{
"CardDAV synchronization 3"
,
carddav_sync_3
},
{
"CardDAV synchronization 4"
,
carddav_sync_4
},
{
"CardDAV integration"
,
carddav_integration
},
{
"CardDAV client to server and server to client sync"
,
carddav_server_to_client_and_client_to_sever_sync
},
{
"CardDAV multiple synchronizations"
,
carddav_multiple_sync
},
{
"CardDAV client to server and server to client sync"
,
carddav_server_to_client_and_client_to_sever_sync
},
#else
{
"Dummy test"
,
dummy_test
}
#endif
...
...
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