Commit 8c823fc0 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Added import friends from vcards test

parent 698c3e55
......@@ -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\
......
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 = {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment