Commit aae65f05 authored by Simon Morlat's avatar Simon Morlat

Fix an issue with basic chatroom not created as they should be because contact...

Fix an issue with basic chatroom not created as they should be because contact address (gruu address) was used instead of SIP identity.
Fix unreliable tests, fix conference event package parser tests (version id was not set).
parent c2e428ea
......@@ -62,7 +62,7 @@ static IdentityAddress getDefaultLocalAddress(const shared_ptr<Core> &core, cons
IdentityAddress localAddress;
if (proxy) {
char *identity = linphone_address_as_string(linphone_proxy_config_get_contact(proxy));
char *identity = linphone_address_as_string(linphone_proxy_config_get_identity_address(proxy));
localAddress = IdentityAddress(identity);
bctbx_free(identity);
} else
......
......@@ -1197,8 +1197,8 @@ void no_auto_answer_on_fake_call_with_replaces_header (void) {
LinphoneCall *call1 = linphone_core_invite_address_with_params(marie1->lc, pauline->identity, params);
linphone_call_params_unref(params);
BC_ASSERT_PTR_NOT_NULL(call1);
BC_ASSERT_TRUE(wait_for_list(lcs, &pauline->stat.number_of_LinphoneCallIncomingReceived, 1, 2000));
BC_ASSERT_TRUE(wait_for_list(lcs, &marie1->stat.number_of_LinphoneCallOutgoingRinging, 1, 2000));
BC_ASSERT_TRUE(wait_for_list(lcs, &pauline->stat.number_of_LinphoneCallIncomingReceived, 1, 3000));
BC_ASSERT_TRUE(wait_for_list(lcs, &marie1->stat.number_of_LinphoneCallOutgoingRinging, 1, 3000));
reset_counters(&marie1->stat);
reset_counters(&marie2->stat);
......@@ -1220,9 +1220,16 @@ void no_auto_answer_on_fake_call_with_replaces_header (void) {
linphone_call_params_unref(params);
BC_ASSERT_PTR_NOT_NULL(call2);
BC_ASSERT_EQUAL(marie2->stat.number_of_LinphoneCallOutgoingProgress, 1, int, "%d");
BC_ASSERT_TRUE(wait_for_list(lcs, &pauline->stat.number_of_LinphoneCallIncomingReceived, 1, 2000));
BC_ASSERT_TRUE(wait_for_list(lcs, &marie2->stat.number_of_LinphoneCallOutgoingRinging, 1, 2000));
BC_ASSERT_TRUE(wait_for_list(lcs, &pauline->stat.number_of_LinphoneCallIncomingReceived, 1, 3000));
BC_ASSERT_TRUE(wait_for_list(lcs, &marie2->stat.number_of_LinphoneCallOutgoingRinging, 1, 3000));
BC_ASSERT_FALSE(wait_for_list(lcs, &pauline->stat.number_of_LinphoneCallConnected, 1, 2000));
linphone_call_terminate(call1);
linphone_call_terminate(call2);
BC_ASSERT_TRUE(wait_for_list(lcs, &pauline->stat.number_of_LinphoneCallReleased, 1, 3000));
BC_ASSERT_TRUE(wait_for_list(lcs, &marie1->stat.number_of_LinphoneCallReleased, 1, 3000));
BC_ASSERT_TRUE(wait_for_list(lcs, &marie2->stat.number_of_LinphoneCallReleased, 1, 3000));
linphone_core_manager_destroy(marie1);
linphone_core_manager_destroy(marie2);
......
......@@ -2819,7 +2819,7 @@ static void call_established_with_rejected_info(void) {
im1 = linphone_core_create_info_message(pauline->lc);
linphone_call_send_info_message(linphone_core_get_current_call(pauline->lc),im1);
wait_for_until(marie->lc,pauline->lc,&dummy,1,1000); /*just to sleep while iterating 1s*/
wait_for_until(marie->lc,pauline->lc,&dummy,1,3000); /*just to sleep while iterating 1s*/
linphone_info_message_unref(im1);
sal_enable_unconditional_answer(linphone_core_get_sal(marie->lc),FALSE);
......
......@@ -148,7 +148,7 @@ static const char *participant_added_notify = \
" <conference-info"\
" xmlns=\"urn:ietf:params:xml:ns:conference-info\""\
" entity=\"%s\""\
" state=\"partial\" version=\"1\">"\
" state=\"partial\" version=\"2\">"\
" <!--"\
" CONFERENCE INFO"\
" -->"\
......@@ -205,7 +205,7 @@ static const char *participant_not_added_notify = \
" <conference-info"\
" xmlns=\"urn:ietf:params:xml:ns:conference-info\""\
" entity=\"%s\""\
" state=\"partial\" version=\"1\">"\
" state=\"partial\" version=\"2\">"\
" <!--"\
" CONFERENCE INFO"\
" -->"\
......@@ -262,7 +262,7 @@ static const char *participant_deleted_notify = \
" <conference-info"\
" xmlns=\"urn:ietf:params:xml:ns:conference-info\""\
" entity=\"%s\""\
" state=\"partial\" version=\"1\">"\
" state=\"partial\" version=\"2\">"\
" <!--"\
" CONFERENCE INFO"\
" -->"\
......@@ -319,7 +319,7 @@ static const char *participant_admined_notify = \
" <conference-info"\
" xmlns=\"urn:ietf:params:xml:ns:conference-info\""\
" entity=\"%s\""\
" state=\"partial\" version=\"1\">"\
" state=\"partial\" version=\"2\">"\
" <!--"\
" CONFERENCE INFO"\
" -->"\
......@@ -380,7 +380,7 @@ static const char *participant_unadmined_notify = \
" <conference-info"\
" xmlns=\"urn:ietf:params:xml:ns:conference-info\""\
" entity=\"%s\""\
" state=\"partial\" version=\"1\">"\
" state=\"partial\" version=\"2\">"\
" <!--"\
" CONFERENCE INFO"\
" -->"\
......
......@@ -1065,6 +1065,7 @@ static void dos_module_trigger(void) {
reset_counters(&pauline->stat);
chat_msg = linphone_chat_room_create_message(chat_room, passmsg);
linphone_chat_message_send(chat_msg);
linphone_chat_message_unref(chat_msg);
BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneMessageReceived, 1));
BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneMessageReceived, 1, int, "%d");
if (marie->stat.last_received_chat_message) {
......
......@@ -2859,6 +2859,7 @@ static void group_chat_room_migrate_from_basic_to_client_fail (void) {
BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneChatRoomStateCreated, initialPaulineStats.number_of_LinphoneChatRoomStateCreated + 1, 3000));
BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneChatRoomConferenceJoined, initialPaulineStats.number_of_LinphoneChatRoomConferenceJoined + 1, 3000));
if (paulineCr) {
BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneMessageReceived, 1, 3000));
BC_ASSERT_TRUE(linphone_chat_room_get_capabilities(paulineCr) & LinphoneChatRoomCapabilitiesConference);
BC_ASSERT_EQUAL(linphone_chat_room_get_nb_participants(paulineCr), 1, int, "%d");
BC_ASSERT_EQUAL(linphone_chat_room_get_history_size(paulineCr), 5, int, "%d");
......
......@@ -1499,18 +1499,19 @@ void crash_during_file_transfer(void) {
linphone_core_manager_restart(marie, TRUE);
LinphoneChatRoom *marie_room = linphone_core_get_chat_room(marie->lc, pauline->identity);
bctbx_list_t *msg_list_2 = linphone_chat_room_get_history(marie_room,1);
BC_ASSERT_PTR_NOT_NULL(msg_list_2);
LinphoneChatMessage *recv_msg = (LinphoneChatMessage *)msg_list_2->data;
LinphoneChatMessageCbs *cbs = linphone_chat_message_get_callbacks(recv_msg);
linphone_chat_message_cbs_set_msg_state_changed(cbs, liblinphone_tester_chat_message_msg_state_changed);
linphone_chat_message_cbs_set_file_transfer_recv(cbs, file_transfer_received);
linphone_chat_message_cbs_set_file_transfer_progress_indication(cbs, file_transfer_progress_indication);
linphone_chat_message_download_file(recv_msg);
/* wait for a long time in case the DNS SRV resolution takes times - it should be immediate though */
if (BC_ASSERT_TRUE(wait_for_until(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneFileTransferDownloadSuccessful,1,55000))) {
BC_ASSERT_PTR_NULL(linphone_chat_message_get_external_body_url(recv_msg));
if (BC_ASSERT_PTR_NOT_NULL(msg_list_2)){
LinphoneChatMessage *recv_msg = (LinphoneChatMessage *)msg_list_2->data;
LinphoneChatMessageCbs *cbs = linphone_chat_message_get_callbacks(recv_msg);
linphone_chat_message_cbs_set_msg_state_changed(cbs, liblinphone_tester_chat_message_msg_state_changed);
linphone_chat_message_cbs_set_file_transfer_recv(cbs, file_transfer_received);
linphone_chat_message_cbs_set_file_transfer_progress_indication(cbs, file_transfer_progress_indication);
linphone_chat_message_download_file(recv_msg);
/* wait for a long time in case the DNS SRV resolution takes times - it should be immediate though */
if (BC_ASSERT_TRUE(wait_for_until(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneFileTransferDownloadSuccessful,1,55000))) {
BC_ASSERT_PTR_NULL(linphone_chat_message_get_external_body_url(recv_msg));
}
bctbx_list_free_with_data(msg_list_2, (bctbx_list_free_func)linphone_chat_message_unref);
}
bctbx_list_free_with_data(msg_list_2, (bctbx_list_free_func)linphone_chat_message_unref);
}
}
......
......@@ -25,6 +25,8 @@
#include <bctoolbox/tester.h>
#include "tester_utils.h"
#define SKIP_PULSEAUDIO 1
#if _WIN32
#define unlink _unlink
#endif
......
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