Updating Magic Search tests

This commit is contained in:
Erwan Croze 2018-05-17 14:21:06 +02:00
parent 01cb565ec6
commit 64fc28497f

View file

@ -661,12 +661,47 @@ static void search_friend_with_phone_number(void) {
linphone_magic_search_reset_search_cache(magicSearch);
resultList = linphone_magic_search_get_contact_list_from_filter(magicSearch, "5", "");
if (BC_ASSERT_PTR_NOT_NULL(resultList)) {
BC_ASSERT_EQUAL(bctbx_list_size(resultList), 2, int, "%d");
_check_friend_result_list(manager->lc, resultList, 0, sFriends[11], NULL);//"sip:+33655667788@sip.example.org"
_check_friend_result_list(manager->lc, resultList, 1, sFriends[5], NULL);//"sip:marie@sip.example.org"
bctbx_list_free_with_data(resultList, (bctbx_list_free_func)linphone_magic_search_unref);
}
resultList = linphone_magic_search_get_contact_list_from_filter(magicSearch, "55", "");
if (BC_ASSERT_PTR_NOT_NULL(resultList)) {
BC_ASSERT_EQUAL(bctbx_list_size(resultList), 2, int, "%d");
_check_friend_result_list(manager->lc, resultList, 0, sFriends[11], NULL);//"sip:+33655667788@sip.example.org"
_check_friend_result_list(manager->lc, resultList, 1, sFriends[5], NULL);//"sip:marie@sip.example.org"
bctbx_list_free_with_data(resultList, (bctbx_list_free_func)linphone_magic_search_unref);
}
resultList = linphone_magic_search_get_contact_list_from_filter(magicSearch, "556", "");
if (BC_ASSERT_PTR_NOT_NULL(resultList)) {
BC_ASSERT_EQUAL(bctbx_list_size(resultList), 2, int, "%d");
_check_friend_result_list(manager->lc, resultList, 0, sFriends[11], NULL);//"sip:+33655667788@sip.example.org"
_check_friend_result_list(manager->lc, resultList, 1, sFriends[5], NULL);//"sip:marie@sip.example.org"
bctbx_list_free_with_data(resultList, (bctbx_list_free_func)linphone_magic_search_unref);
}
resultList = linphone_magic_search_get_contact_list_from_filter(magicSearch, "5566", "");
if (BC_ASSERT_PTR_NOT_NULL(resultList)) {
BC_ASSERT_EQUAL(bctbx_list_size(resultList), 2, int, "%d");
_check_friend_result_list(manager->lc, resultList, 0, sFriends[11], NULL);//"sip:+33655667788@sip.example.org"
_check_friend_result_list(manager->lc, resultList, 2, sFriends[5], NULL);//"sip:marie@sip.example.org"
_check_friend_result_list(manager->lc, resultList, 1, sFriends[5], NULL);//"sip:marie@sip.example.org"
bctbx_list_free_with_data(resultList, (bctbx_list_free_func)linphone_magic_search_unref);
}
resultList = linphone_magic_search_get_contact_list_from_filter(magicSearch, "55667", "");
if (BC_ASSERT_PTR_NOT_NULL(resultList)) {
BC_ASSERT_EQUAL(bctbx_list_size(resultList), 1, int, "%d");
_check_friend_result_list(manager->lc, resultList, 0, sFriends[11], NULL);//"sip:+33655667788@sip.example.org"
bctbx_list_free_with_data(resultList, (bctbx_list_free_func)linphone_magic_search_unref);
}