Commit 6e8212cd authored by Sylvain Berfini's avatar Sylvain Berfini
Browse files

Improved message tester to not use number_of_LinphoneMessageExtBodyReceived...

Improved message tester to not use number_of_LinphoneMessageExtBodyReceived anymore when it should not
parent 7cfc1b80
......@@ -241,6 +241,8 @@ typedef struct _stats {
int number_of_rtcp_received;
int number_of_video_windows_created;
int number_of_LinphoneFileTransferDownloadSuccessful;
}stats;
......@@ -329,5 +331,6 @@ void simple_call_base(bool_t enable_multicast_recv_side);
void call_base(LinphoneMediaEncryption mode, bool_t enable_video,bool_t enable_relay,LinphoneFirewallPolicy policy,bool_t enable_tunnel);
bool_t call_with_caller_params(LinphoneCoreManager* caller_mgr,LinphoneCoreManager* callee_mgr, const LinphoneCallParams *params);
bool_t pause_call_1(LinphoneCoreManager* mgr_1,LinphoneCall* call_1,LinphoneCoreManager* mgr_2,LinphoneCall* call_2);
bool_t compare_files(const char *path1, const char *path2);
#endif /* LIBLINPHONE_TESTER_H_ */
......@@ -78,7 +78,7 @@ void file_transfer_received(LinphoneChatMessage *message, const LinphoneContent*
if (linphone_buffer_is_empty(buffer)) { /* tranfer complete */
stats* counters = get_stats(lc);
counters->number_of_LinphoneMessageExtBodyReceived++;
counters->number_of_LinphoneFileTransferDownloadSuccessful++;
fclose(file);
} else { /* store content on a file*/
if (fwrite(linphone_buffer_get_content(buffer),linphone_buffer_get_size(buffer),1,file)==-1){
......@@ -406,7 +406,7 @@ static void text_message_with_external_body(void) {
linphone_core_manager_destroy(pauline);
}
static bool_t compare_files(const char *path1, const char *path2) {
bool_t compare_files(const char *path1, const char *path2) {
bool_t res;
size_t size1;
size_t size2;
......@@ -494,11 +494,11 @@ static void file_transfer_message(void) {
linphone_chat_message_cbs_set_file_transfer_recv(cbs, file_transfer_received);
linphone_chat_message_download_file(marie->stat.last_received_chat_message);
}
CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneMessageExtBodyReceived,1));
CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneFileTransferDownloadSuccessful,1));
CU_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageInProgress,1);
CU_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageDelivered,1);
CU_ASSERT_EQUAL(marie->stat.number_of_LinphoneMessageExtBodyReceived,1);
CU_ASSERT_EQUAL(marie->stat.number_of_LinphoneFileTransferDownloadSuccessful,1);
CU_ASSERT_TRUE(compare_files(send_filepath, receive_filepath));
linphone_content_unref(content);
......@@ -560,11 +560,11 @@ static void small_file_transfer_message(void) {
linphone_chat_message_cbs_set_file_transfer_recv(cbs, file_transfer_received);
linphone_chat_message_download_file(marie->stat.last_received_chat_message);
}
CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneMessageExtBodyReceived,1));
CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneFileTransferDownloadSuccessful,1));
CU_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageInProgress,1);
CU_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageDelivered,1);
CU_ASSERT_EQUAL(marie->stat.number_of_LinphoneMessageExtBodyReceived,1);
CU_ASSERT_EQUAL(marie->stat.number_of_LinphoneFileTransferDownloadSuccessful,1);
linphone_content_unref(content);
linphone_core_manager_destroy(marie);
......@@ -624,7 +624,7 @@ static void file_transfer_message_io_error_upload(void) {
CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneMessageNotDelivered,1));
CU_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageNotDelivered,1);
CU_ASSERT_EQUAL(marie->stat.number_of_LinphoneMessageExtBodyReceived,0);
CU_ASSERT_EQUAL(marie->stat.number_of_LinphoneFileTransferDownloadSuccessful,0);
sal_set_send_error(pauline->lc->sal, 0);
......@@ -694,7 +694,7 @@ static void file_transfer_message_io_error_download(void) {
CU_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageInProgress,1);
CU_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageDelivered,1);
CU_ASSERT_EQUAL(marie->stat.number_of_LinphoneMessageNotDelivered,1);
CU_ASSERT_EQUAL(marie->stat.number_of_LinphoneMessageExtBodyReceived,0);
CU_ASSERT_EQUAL(marie->stat.number_of_LinphoneFileTransferDownloadSuccessful,0);
sal_set_recv_error(marie->lc->sal, 0);
linphone_core_manager_destroy(marie);
......@@ -755,7 +755,7 @@ static void file_transfer_message_upload_cancelled(void) {
CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneMessageNotDelivered,1));
CU_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageNotDelivered,1);
CU_ASSERT_EQUAL(marie->stat.number_of_LinphoneMessageExtBodyReceived,0);
CU_ASSERT_EQUAL(marie->stat.number_of_LinphoneFileTransferDownloadSuccessful,0);
linphone_content_unref(content);
linphone_core_manager_destroy(marie);
......@@ -818,7 +818,7 @@ static void file_transfer_message_download_cancelled(void) {
CU_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageInProgress,1);
CU_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageDelivered,1);
CU_ASSERT_EQUAL(marie->stat.number_of_LinphoneMessageExtBodyReceived,0);
CU_ASSERT_EQUAL(marie->stat.number_of_LinphoneFileTransferDownloadSuccessful,0);
CU_ASSERT_EQUAL(marie->stat.number_of_LinphoneMessageNotDelivered,1);
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