mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-20 04:28:10 +00:00
Added import friends from vcards test
This commit is contained in:
parent
698c3e55cd
commit
8c823fc039
4 changed files with 49 additions and 4 deletions
|
|
@ -212,7 +212,7 @@ int linphone_friend_set_name(LinphoneFriend *lf, const char *name){
|
|||
LinphoneAddress *fr = lf->uri;
|
||||
LinphoneVCard *vcard = NULL;
|
||||
|
||||
if (fr == NULL){
|
||||
if (fr == NULL) {
|
||||
ms_error("linphone_friend_set_address() must be called before linphone_friend_set_name().");
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ RCFILES = \
|
|||
|
||||
IMAGE_FILES = images/nowebcamCIF.jpg
|
||||
|
||||
COMMON_FILE = common/bc_completion
|
||||
COMMON_FILE = common/bc_completion common/vcards.vcf
|
||||
|
||||
EXTRA_DIST = tester_hosts\
|
||||
messages.db\
|
||||
|
|
|
|||
22
tester/common/vcards.vcf
Normal file
22
tester/common/vcards.vcf
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
BEGIN:VCARD
|
||||
VERSION:4.0
|
||||
KIND:individual
|
||||
FN:Sylvain Berfini
|
||||
N:Berfini;Sylvain;Pascal;;
|
||||
GENDER:M
|
||||
IMPP;PREF=1;TYPE=work:sip:sylvain@sip.linphone.org
|
||||
END:VCARD
|
||||
BEGIN:VCARD
|
||||
VERSION:4.0
|
||||
KIND:individual
|
||||
FN:François Grisez
|
||||
N:Grisez;François;;;
|
||||
IMPP;TYPE=work:sip:francois@sip.linphone.org
|
||||
END:VCARD
|
||||
BEGIN:VCARD
|
||||
VERSION:4.0
|
||||
KIND:individual
|
||||
FN:Margaux Clerc
|
||||
GENDER:F
|
||||
IMPP:sip:margaux@sip.linphone.org
|
||||
END:VCARD
|
||||
|
|
@ -16,13 +16,36 @@
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "linphonecore.h"
|
||||
#include "private.h"
|
||||
#include "liblinphone_tester.h"
|
||||
|
||||
test_t vcard_tests[] = {
|
||||
static void linphone_vcard_import_friends_test(void) {
|
||||
LinphoneCoreManager* manager = linphone_core_manager_new2("empty_rc", FALSE);
|
||||
const MSList *friends = linphone_core_get_friend_list(manager->lc);
|
||||
int count = 0;
|
||||
BC_ASSERT_EQUAL(ms_list_size(friends), 0, int, "%d");
|
||||
|
||||
count = linphone_core_import_friends_from_vcard4_file(manager->lc, bc_tester_res("common/vcards.vcf"));
|
||||
BC_ASSERT_EQUAL(count, 3, int, "%d");
|
||||
friends = linphone_core_get_friend_list(manager->lc);
|
||||
BC_ASSERT_EQUAL(ms_list_size(friends), 3, int, "%d");
|
||||
|
||||
linphone_core_manager_destroy(manager);
|
||||
}
|
||||
|
||||
static void linphone_vcard_export_friends_test(void) {
|
||||
|
||||
}
|
||||
|
||||
static void linphone_vcard_create_edit_friends_test(void) {
|
||||
|
||||
}
|
||||
|
||||
test_t vcard_tests[] = {
|
||||
{ "Import friends from vCards", linphone_vcard_import_friends_test },
|
||||
{ "Export friends to vCards", linphone_vcard_export_friends_test },
|
||||
{ "Create and edit friends' vCards", linphone_vcard_create_edit_friends_test },
|
||||
};
|
||||
|
||||
test_suite_t vcard_test_suite = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue