Commit dc9e64a2 authored by Ghislain MARY's avatar Ghislain MARY

Fix memory leak in external body url message test.

parent 03130daa
...@@ -168,6 +168,7 @@ typedef struct _stats { ...@@ -168,6 +168,7 @@ typedef struct _stats {
int number_of_LinphoneMessageDelivered; int number_of_LinphoneMessageDelivered;
int number_of_LinphoneMessageNotDelivered; int number_of_LinphoneMessageNotDelivered;
int number_of_LinphoneMessageFileTransferDone; int number_of_LinphoneMessageFileTransferDone;
int number_of_LinphoneMessageFileTransferError;
int number_of_LinphoneMessageDeliveredToUser; int number_of_LinphoneMessageDeliveredToUser;
int number_of_LinphoneMessageDisplayed; int number_of_LinphoneMessageDisplayed;
int number_of_LinphoneIsComposingActiveReceived; int number_of_LinphoneIsComposingActiveReceived;
......
...@@ -190,6 +190,7 @@ void liblinphone_tester_chat_message_msg_state_changed(LinphoneChatMessage *msg, ...@@ -190,6 +190,7 @@ void liblinphone_tester_chat_message_msg_state_changed(LinphoneChatMessage *msg,
return; return;
case LinphoneChatMessageStateFileTransferError: case LinphoneChatMessageStateFileTransferError:
counters->number_of_LinphoneMessageNotDelivered++; counters->number_of_LinphoneMessageNotDelivered++;
counters->number_of_LinphoneMessageFileTransferError++;
return; return;
case LinphoneChatMessageStateFileTransferDone: case LinphoneChatMessageStateFileTransferDone:
counters->number_of_LinphoneMessageFileTransferDone++; counters->number_of_LinphoneMessageFileTransferDone++;
...@@ -698,10 +699,13 @@ static void file_transfer_using_external_body_url(void) { ...@@ -698,10 +699,13 @@ static void file_transfer_using_external_body_url(void) {
BC_ASSERT_TRUE(wait_for(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneMessageReceived, 1)); BC_ASSERT_TRUE(wait_for(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneMessageReceived, 1));
if (marie->stat.last_received_chat_message) { if (marie->stat.last_received_chat_message) {
cbs = linphone_chat_message_get_callbacks(marie->stat.last_received_chat_message);
linphone_chat_message_cbs_set_msg_state_changed(cbs, liblinphone_tester_chat_message_msg_state_changed);
linphone_chat_message_download_file(marie->stat.last_received_chat_message); linphone_chat_message_download_file(marie->stat.last_received_chat_message);
} }
BC_ASSERT_TRUE(wait_for(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneMessageExtBodyReceived, 1)); BC_ASSERT_TRUE(wait_for(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneMessageExtBodyReceived, 1));
BC_ASSERT_TRUE(wait_for(pauline->lc, marie->lc, &pauline->stat.number_of_LinphoneMessageInProgress, 1)); BC_ASSERT_TRUE(wait_for(pauline->lc, marie->lc, &pauline->stat.number_of_LinphoneMessageDelivered, 1));
BC_ASSERT_TRUE(wait_for(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneMessageFileTransferError, 1));
linphone_core_manager_destroy(pauline); linphone_core_manager_destroy(pauline);
linphone_core_manager_destroy(marie); linphone_core_manager_destroy(marie);
} }
......
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