tester: add non-regression check for memory leaks

parent 7d1ef882
mediastreamer2 @ f21cca03
Subproject commit fad8cfc6cba8ffde7027811565510c33a0602c3b
Subproject commit f21cca039d1b00ca4d25c083c5bb38d798eb146f
......@@ -5821,7 +5821,11 @@ static void call_logs_sqlite_storage(void) {
call_id = linphone_call_log_get_call_id(call_log);
BC_ASSERT_PTR_NOT_NULL(call_id);
BC_ASSERT_PTR_NOT_NULL(linphone_core_find_call_log_from_call_id(marie->lc, call_id));
{
LinphoneCallLog* find_call_log = linphone_core_find_call_log_from_call_id(marie->lc, call_id);
BC_ASSERT_PTR_NOT_NULL(find_call_log);
if (find_call_log) linphone_call_log_unref(find_call_log);
}
BC_ASSERT_TRUE(linphone_address_equal(
linphone_call_log_get_remote_address(call_log),
......@@ -6027,7 +6031,7 @@ test_t call_tests[] = {
TEST_NO_TAG("Cancelled ringing call", cancelled_ringing_call),
TEST_NO_TAG("Call busy when calling self", call_busy_when_calling_self),
TEST_NO_TAG("Simple call", simple_call),
TEST_NO_TAG("Call terminated automatically by linphone_core_destroy", automatic_call_termination),
TEST_ONE_TAG("Call terminated automatically by linphone_core_destroy", automatic_call_termination, "LeaksMemory"),
TEST_NO_TAG("Call with http proxy", call_with_http_proxy),
TEST_NO_TAG("Call with timeouted bye", call_with_timeouted_bye),
TEST_NO_TAG("Direct call over IPv6", direct_call_over_ipv6),
......
......@@ -149,6 +149,19 @@ int bc_tester_suite_index(const char *suite_name) {
return -1;
}
int bc_tester_test_index(test_suite_t *suite, const char *test_name) {
int i;
for (i = 0; i < suite->nb_tests; i++) {
if (strcmp(test_name, suite->tests[i].name) == 0) {
return i;
}
}
return -1;
}
int bc_tester_nb_suites(void) {
return nb_test_suites;
}
......@@ -247,7 +260,11 @@ static void test_complete_message_handler(const CU_pTest pTest, const CU_pSuite
free(result);
if (test_suite[suite_index]->after_each) {
test_suite[suite_index]->after_each();
int err = test_suite[suite_index]->after_each();
//if test passed but not after_each, count it as failure
if (err && !pFailure) {
CU_get_run_summary()->nTestsFailed++;
}
}
//insert empty line
bc_tester_printf(bc_printf_verbosity_info,"");
......@@ -703,3 +720,12 @@ const char * bc_tester_current_suite_name(void) {
const char * bc_tester_current_test_name(void) {
return bc_current_test_name;
}
const char ** bc_tester_current_test_tags(void) {
if (bc_current_suite_name && bc_current_test_name) {
int suite_index = bc_tester_suite_index(bc_current_suite_name);
int test_index = bc_tester_test_index(test_suite[suite_index], bc_current_test_name);
return test_suite[suite_index]->tests[test_index].tags;
}
return NULL;
}
......@@ -63,7 +63,7 @@ typedef struct {
before_all; /*function invoked before running the suite. If not returning 0, suite is not launched. */
pre_post_function_t after_all; /*function invoked at the end of the suite, even if some tests failed. */
test_function_t before_each; /*function invoked before each test within this suite. */
test_function_t after_each; /*function invoked after each test within this suite, even if it failed. */
pre_post_function_t after_each; /*function invoked after each test within this suite, even if it failed. */
int nb_tests; /* number of tests */
test_t *tests; /* tests within this suite */
} test_suite_t;
......@@ -103,6 +103,7 @@ int bc_tester_run_tests(const char *suite_name, const char *test_name, const cha
int bc_tester_suite_index(const char *suite_name);
const char * bc_tester_current_suite_name(void);
const char * bc_tester_current_test_name(void);
const char ** bc_tester_current_test_tags(void);
char* bc_sprintfva(const char* format, va_list args);
char* bc_sprintf(const char* format, ...);
......
......@@ -55,9 +55,9 @@ FILE *sip_start(const char *senario, const char* dest_username, LinphoneAddress*
else
dest = ms_strdup_printf("%s",linphone_address_get_domain(dest_addres));
//until errors logs are handled correctly and stop breaks output, they will be DISABLED
command = ms_strdup_printf(SIPP_COMMAND" -sf %s -s %s %s -trace_err -trace_msg -rtp_echo -m 1 -d 1000",senario,dest_username,dest);
command = ms_strdup_printf(SIPP_COMMAND" -sf %s -s %s %s -trace_err -trace_msg -rtp_echo -m 1 -d 1000 2>/dev/null",senario,dest_username,dest);
ms_message("Starting sipp commad [%s]",command);
ms_message("Starting sipp command [%s]",command);
file = popen(command, "r");
ms_free(command);
ms_free(dest);
......@@ -74,9 +74,9 @@ static FILE *sip_start_recv(const char *senario) {
FILE *file;
//until errors logs are handled correctly and stop breaks output, they will be DISABLED
command = ms_strdup_printf(SIPP_COMMAND" -sf %s -trace_err -trace_msg -rtp_echo -m 1 -d 1000",senario);
command = ms_strdup_printf(SIPP_COMMAND" -sf %s -trace_err -trace_msg -rtp_echo -m 1 -d 1000 2>/dev/null",senario);
ms_message("Starting sipp commad [%s]",command);
ms_message("Starting sipp command [%s]",command);
file = popen(command, "r");
ms_free(command);
return file;
......
......@@ -359,15 +359,15 @@ static void publish_without_expires(void){
}
test_t event_tests[] = {
TEST_NO_TAG("Subscribe declined", subscribe_test_declined),
TEST_NO_TAG("Subscribe terminated by subscriber", subscribe_test_terminated_by_subscriber),
TEST_NO_TAG("Subscribe with custom headers", subscribe_test_with_custom_header),
TEST_NO_TAG("Subscribe refreshed", subscribe_test_refreshed),
TEST_NO_TAG("Subscribe manually refreshed", subscribe_test_manually_refreshed),
TEST_NO_TAG("Subscribe terminated by notifier", subscribe_test_terminated_by_notifier),
TEST_NO_TAG("Publish", publish_test),
TEST_NO_TAG("Publish without expires", publish_without_expires),
TEST_NO_TAG("Publish without automatic refresh",publish_no_auto_test)
TEST_ONE_TAG("Subscribe declined", subscribe_test_declined, "LeaksMemory"),
TEST_ONE_TAG("Subscribe terminated by subscriber", subscribe_test_terminated_by_subscriber, "LeaksMemory"),
TEST_ONE_TAG("Subscribe with custom headers", subscribe_test_with_custom_header, "LeaksMemory"),
TEST_ONE_TAG("Subscribe refreshed", subscribe_test_refreshed, "LeaksMemory"),
TEST_ONE_TAG("Subscribe manually refreshed", subscribe_test_manually_refreshed, "LeaksMemory"),
TEST_ONE_TAG("Subscribe terminated by notifier", subscribe_test_terminated_by_notifier, "LeaksMemory"),
TEST_ONE_TAG("Publish", publish_test, "LeaksMemory"),
TEST_ONE_TAG("Publish without expires", publish_without_expires, "LeaksMemory"),
TEST_ONE_TAG("Publish without automatic refresh",publish_no_auto_test, "LeaksMemory")
};
test_suite_t event_test_suite = {"Event", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each,
......
......@@ -73,11 +73,11 @@ static void message_forking(void) {
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneMessageReceived,1,3000));
BC_ASSERT_TRUE(wait_for_list(lcs,&marie2->stat.number_of_LinphoneMessageReceived,1,1000));
BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneMessageDelivered,1,1000));
/*wait a bit that 200Ok for MESSAGE are sent to server before shuting down the cores, because otherwise Flexisip will consider the messages
* as not delivered and will expedite them in the next test, after receiving the REGISTER from marie's instances*/
wait_for_list(lcs, NULL, 0, 2000);
BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageInProgress,1, int, "%d");
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(marie2);
......@@ -97,7 +97,7 @@ static void message_forking_with_unreachable_recipients(void) {
lcs=ms_list_append(lcs,pauline->lc);
lcs=ms_list_append(lcs,marie2->lc);
lcs=ms_list_append(lcs,marie3->lc);
/*the following lines are to workaround a problem with messages sent by a previous test (Message forking) that arrive together with REGISTER responses,
* because the ForkMessageContext is not terminated at flexisip side if Message forking test is passing fast*/
wait_for_list(lcs,NULL,0,1000);
......@@ -153,7 +153,7 @@ static void message_forking_with_all_recipients_unreachable(void) {
marie2->stat.number_of_LinphoneMessageReceived = 0;
marie3->stat.number_of_LinphoneMessageReceived = 0;
/*All marie's device go offline*/
linphone_core_set_network_reachable(marie->lc,FALSE);
linphone_core_set_network_reachable(marie2->lc,FALSE);
......@@ -919,31 +919,31 @@ static void test_subscribe_notify_with_sipp_publisher(void) {
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
/*just to get an identity*/
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LpConfig *pauline_lp = linphone_core_get_config(pauline->lc);
char* lf_identity=linphone_address_as_string_uri_only(marie->identity);
LinphoneFriend *lf = linphone_core_create_friend_with_address(pauline->lc,lf_identity);
ms_free(lf_identity);
lp_config_set_int(pauline_lp,"sip","subscribe_expires",5);
linphone_core_add_friend(pauline->lc,lf);
/*wait for subscribe acknowledgment*/
wait_for_until(pauline->lc,pauline->lc,&pauline->stat.number_of_NotifyReceived,1,2000);
BC_ASSERT_EQUAL(LinphoneStatusOffline,linphone_friend_get_status(lf), int, "%d");
scen = bc_tester_res("sipp/simple_publish.xml");
sipp_out = sip_start(scen, linphone_address_get_username(marie->identity), marie->identity);
if (sipp_out) {
/*wait for marie status*/
wait_for_until(pauline->lc,pauline->lc,&pauline->stat.number_of_NotifyReceived,2,3000);
BC_ASSERT_EQUAL(LinphoneStatusOnline,linphone_friend_get_status(lf), int, "%d");
pclose(sipp_out);
}
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline);
#endif
......@@ -955,23 +955,23 @@ static void test_subscribe_notify_with_sipp_publisher_double_publish(void) {
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
/*just to get an identity*/
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LpConfig *pauline_lp = linphone_core_get_config(pauline->lc);
char* lf_identity=linphone_address_as_string_uri_only(marie->identity);
LinphoneFriend *lf = linphone_core_create_friend_with_address(pauline->lc,lf_identity);
ms_free(lf_identity);
lp_config_set_int(pauline_lp,"sip","subscribe_expires",5);
linphone_core_add_friend(pauline->lc,lf);
/*wait for subscribe acknowledgment*/
wait_for_until(pauline->lc,pauline->lc,&pauline->stat.number_of_NotifyReceived,1,2000);
BC_ASSERT_EQUAL(LinphoneStatusOffline,linphone_friend_get_status(lf), int, "%d");
scen = bc_tester_res("sipp/double_publish_with_error.xml");
sipp_out = sip_start(scen, linphone_address_get_username(marie->identity), marie->identity);
if (sipp_out) {
/*wait for marie status*/
wait_for_until(pauline->lc,pauline->lc,&pauline->stat.number_of_NotifyReceived,2,3000);
......@@ -979,7 +979,7 @@ static void test_subscribe_notify_with_sipp_publisher_double_publish(void) {
pclose(sipp_out);
BC_ASSERT_EQUAL(pauline->stat.number_of_NotifyReceived,2,int, "%d");
}
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline);
#endif
......@@ -988,7 +988,7 @@ static void test_subscribe_notify_with_sipp_publisher_double_publish(void) {
static void test_publish_unpublish(void) {
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneProxyConfig* proxy;
proxy = linphone_core_get_default_proxy_config(marie->lc);
linphone_proxy_config_edit(proxy);
linphone_proxy_config_enable_publish(proxy,TRUE);
......@@ -1005,7 +1005,7 @@ static void test_list_subscribe (void) {
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc");
LinphoneCoreManager* laure = linphone_core_manager_new( "laure_rc");
char *list = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<resource-lists xmlns=\"urn:ietf:params:xml:ns:resource-lists\"\n"
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n"
......@@ -1014,8 +1014,8 @@ static void test_list_subscribe (void) {
"\t<entry uri=\"%s\" />\n"
"</list>\n"
"</resource-lists>\n";
LinphoneEvent *lev;
MSList* lcs=ms_list_append(NULL,marie->lc);
char * pauline_uri=linphone_address_as_string_uri_only(pauline->identity);
......@@ -1025,29 +1025,29 @@ static void test_list_subscribe (void) {
LinphoneAddress *list_name = linphone_address_new("sip:mescops@sip.example.org");
LinphoneProxyConfig* proxy_config;
int dummy=0;
ms_free(pauline_uri);
ms_free(laure_uri);
lcs=ms_list_append(lcs,pauline->lc);
lcs=ms_list_append(lcs,laure->lc);
linphone_content_set_type(content,"application");
linphone_content_set_subtype(content,"resource-lists+xml");
linphone_content_set_buffer(content,subscribe_content,strlen(subscribe_content));
lev=linphone_core_create_subscribe(marie->lc,list_name,"presence",60);
linphone_event_add_custom_header(lev,"Supported","eventlist");
linphone_event_add_custom_header(lev,"Accept","application/pidf+xml, application/rlmi+xml");
linphone_event_add_custom_header(lev,"Content-Disposition", "recipient-list");
linphone_event_add_custom_header(lev,"Require", "recipient-list-subscribe");
linphone_event_send_subscribe(lev,content);
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneSubscriptionOutgoingInit,1,1000));
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneSubscriptionActive,1,5000));
/*make sure marie receives first notification before terminating*/
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_NotifyReceived,1,5000));
/*dummy wait to avoid derred notify*/
......@@ -1056,22 +1056,22 @@ static void test_list_subscribe (void) {
linphone_proxy_config_edit(proxy_config);
linphone_proxy_config_enable_publish(proxy_config,TRUE);
linphone_proxy_config_done(proxy_config);
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_NotifyReceived,2,5000));
proxy_config = linphone_core_get_default_proxy_config(laure->lc);
linphone_proxy_config_edit(proxy_config);
linphone_proxy_config_enable_publish(proxy_config,TRUE);
linphone_proxy_config_done(proxy_config);
/*make sure notify is not sent "imadiatly but defered*/
BC_ASSERT_FALSE(wait_for_list(lcs,&marie->stat.number_of_NotifyReceived,3,1000));
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_NotifyReceived,3,5000));
linphone_event_terminate(lev);
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneSubscriptionTerminated,1,5000));
ms_free(subscribe_content);
linphone_address_destroy(list_name);
linphone_content_unref(content);
......@@ -1082,7 +1082,7 @@ static void test_list_subscribe (void) {
test_t flexisip_tests[] = {
TEST_NO_TAG("Subscribe forking", subscribe_forking),
TEST_ONE_TAG("Subscribe forking", subscribe_forking, "LeaksMemory"),
TEST_NO_TAG("Message forking", message_forking),
TEST_NO_TAG("Message forking with unreachable recipients", message_forking_with_unreachable_recipients),
TEST_NO_TAG("Message forking with all recipients unreachable", message_forking_with_all_recipients_unreachable),
......@@ -1096,15 +1096,15 @@ test_t flexisip_tests[] = {
TEST_NO_TAG("Call forking not responded", call_forking_not_responded),
TEST_NO_TAG("Early-media call forking", early_media_call_forking),
TEST_NO_TAG("Call with sips", call_with_sips),
TEST_NO_TAG("Call with sips not achievable", call_with_sips_not_achievable),
TEST_ONE_TAG("Call with sips not achievable", call_with_sips_not_achievable, "LeaksMemory"),
TEST_NO_TAG("Call with ipv6", call_with_ipv6),
TEST_NO_TAG("Subscribe Notify with sipp publisher", test_subscribe_notify_with_sipp_publisher),
TEST_NO_TAG("Subscribe Notify with sipp double publish", test_subscribe_notify_with_sipp_publisher_double_publish),
TEST_NO_TAG("Publish/unpublish", test_publish_unpublish),
TEST_NO_TAG("List subscribe", test_list_subscribe),
TEST_NO_TAG("File transfer message rcs to external body client", file_transfer_message_rcs_to_external_body_client),
TEST_NO_TAG("File transfer message external body to rcs client", file_transfer_message_external_body_to_rcs_client),
TEST_NO_TAG("File transfer message external body to external body client", file_transfer_message_external_body_to_external_body_client),
TEST_ONE_TAG("List subscribe", test_list_subscribe, "LeaksMemory"),
TEST_ONE_TAG("File transfer message rcs to external body client", file_transfer_message_rcs_to_external_body_client, "LeaksMemory"),
TEST_ONE_TAG("File transfer message external body to rcs client", file_transfer_message_external_body_to_rcs_client, "LeaksMemory"),
TEST_ONE_TAG("File transfer message external body to external body client", file_transfer_message_external_body_to_external_body_client, "LeaksMemory"),
TEST_NO_TAG("DoS module trigger by sending a lot of chat messages", dos_module_trigger)
};
......
......@@ -356,7 +356,7 @@ int linphone_core_manager_get_mean_audio_up_bw(const LinphoneCoreManager *mgr);
void video_call_base_2(LinphoneCoreManager* pauline,LinphoneCoreManager* marie, bool_t using_policy,LinphoneMediaEncryption mode, bool_t callee_video_enabled, bool_t caller_video_enabled);
void liblinphone_tester_before_each(void);
void liblinphone_tester_after_each(void);
int liblinphone_tester_after_each(void);
void liblinphone_tester_init(void(*ftester_printf)(int level, const char *fmt, va_list args));
void liblinphone_tester_uninit(void);
int liblinphone_tester_set_log_file(const char *filename);
......
......@@ -321,7 +321,7 @@ test_t log_collection_tests[] = {
TEST_NO_TAG("Collect files filled when enabled", collect_files_filled),
TEST_NO_TAG("Logs collected into small file", collect_files_small_size),
TEST_NO_TAG("Logs collected when decreasing max size", collect_files_changing_size),
TEST_NO_TAG("Upload collected traces", upload_collected_traces)
TEST_ONE_TAG("Upload collected traces", upload_collected_traces, "MemoryLeaks")
};
test_suite_t log_collection_test_suite = {"LogCollection", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each,
......
......@@ -1241,7 +1241,7 @@ static void history_count(void) {
messages=linphone_chat_room_get_history(chatroom,0);
BC_ASSERT_EQUAL(linphone_chat_room_get_history_size(chatroom), 1270, int, "%d");
BC_ASSERT_EQUAL(ms_list_size(messages), 1270, int, "%d");
/*check the second most recent msg*/
BC_ASSERT_PTR_NOT_NULL(messages);
if (messages){
......@@ -1250,7 +1250,7 @@ static void history_count(void) {
BC_ASSERT_STRING_EQUAL(linphone_chat_message_get_text((LinphoneChatMessage *)messages->next->data), "Fore and aft follow each other.");
}
}
ms_list_free_with_data(messages, (void (*)(void*))linphone_chat_message_unref);
/*test offset+limit: retrieve the 42th latest msg only and check its content*/
......@@ -1706,7 +1706,7 @@ void file_transfer_with_http_proxy(void) {
test_t message_tests[] = {
TEST_NO_TAG("Text message", text_message),
TEST_NO_TAG("Text message within call dialog", text_message_within_call_dialog),
TEST_ONE_TAG("Text message within call dialog", text_message_within_call_dialog, "MemoryLeaks"),
TEST_NO_TAG("Text message with credentials from auth callback", text_message_with_credential_from_auth_callback),
TEST_NO_TAG("Text message with privacy", text_message_with_privacy),
TEST_NO_TAG("Text message compatibility mode", text_message_compatibility_mode),
......@@ -1717,9 +1717,9 @@ test_t message_tests[] = {
TEST_NO_TAG("Transfer message with http proxy", file_transfer_with_http_proxy),
TEST_NO_TAG("Transfer message with upload io error", transfer_message_with_upload_io_error),
TEST_NO_TAG("Transfer message with download io error", transfer_message_with_download_io_error),
TEST_NO_TAG("Transfer message upload cancelled", transfer_message_upload_cancelled),
TEST_ONE_TAG("Transfer message upload cancelled", transfer_message_upload_cancelled, "MemoryLeaks"),
TEST_NO_TAG("Transfer message download cancelled", transfer_message_download_cancelled),
TEST_NO_TAG("Transfer message using external body url", file_transfer_using_external_body_url),
TEST_ONE_TAG("Transfer message using external body url", file_transfer_using_external_body_url, "MemoryLeaks"),
TEST_NO_TAG("Transfer 2 messages simultaneously", file_transfer_2_messages_simultaneously),
TEST_NO_TAG("Text message denied", text_message_denied),
TEST_NO_TAG("Info message", info_message),
......@@ -1738,17 +1738,17 @@ test_t message_tests[] = {
TEST_NO_TAG("History count", history_count),
#endif
TEST_NO_TAG("Text status after destroying chat room", text_status_after_destroying_chat_room),
TEST_NO_TAG("Transfer not sent if invalid url", file_transfer_not_sent_if_invalid_url),
TEST_NO_TAG("Transfer not sent if host not found", file_transfer_not_sent_if_host_not_found),
TEST_NO_TAG("Transfer not sent if url moved permanently", file_transfer_not_sent_if_url_moved_permanently),
TEST_NO_TAG("Transfer io error after destroying chatroom", file_transfer_io_error_after_destroying_chatroom),
TEST_ONE_TAG("Transfer not sent if invalid url", file_transfer_not_sent_if_invalid_url, "MemoryLeaks"),
TEST_ONE_TAG("Transfer not sent if host not found", file_transfer_not_sent_if_host_not_found, "MemoryLeaks"),
TEST_ONE_TAG("Transfer not sent if url moved permanently", file_transfer_not_sent_if_url_moved_permanently, "MemoryLeaks"),
TEST_ONE_TAG("Transfer io error after destroying chatroom", file_transfer_io_error_after_destroying_chatroom, "MemoryLeaks"),
TEST_NO_TAG("Real Time Text message", real_time_text_message),
TEST_NO_TAG("Real Time Text conversation", real_time_text_conversation),
TEST_NO_TAG("Real Time Text without audio", real_time_text_without_audio),
TEST_NO_TAG("Real Time Text with srtp", real_time_text_srtp),
TEST_NO_TAG("Real Time Text with ice", real_time_text_ice),
TEST_NO_TAG("Real Time Text message compatibility crlf", real_time_text_message_compat_crlf),
TEST_NO_TAG("Real Time Text message compatibility lf", real_time_text_message_compat_lf),
TEST_ONE_TAG("Real Time Text message compatibility crlf", real_time_text_message_compat_crlf, "MemoryLeaks"),
TEST_ONE_TAG("Real Time Text message compatibility lf", real_time_text_message_compat_lf, "MemoryLeaks"),
TEST_NO_TAG("Real Time Text message with accented characters", real_time_text_message_accented_chars),
TEST_NO_TAG("Real Time Text offer answer with different payload numbers (sender side)", real_time_text_message_different_text_codecs_payload_numbers_sender_side),
TEST_NO_TAG("Real Time Text offer answer with different payload numbers (receiver side)", real_time_text_message_different_text_codecs_payload_numbers_receiver_side),
......
......@@ -100,7 +100,7 @@ static void call_waiting_indication_with_param(bool_t enable_caller_privacy) {
BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallEnd,1,10000));
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallEnd,1,10000));
BC_ASSERT_TRUE(wait_for_list(lcs,&laure->stat.number_of_LinphoneCallEnd,1,10000));
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline);
linphone_core_manager_destroy(laure);
......@@ -120,33 +120,33 @@ static void second_call_rejection(bool_t second_without_audio){
LinphoneCall *pauline_call;
LinphoneCallParams *params;
LinphoneCall *marie_call;
/*start a call to pauline*/
linphone_core_invite_address(marie->lc, pauline->identity);
BC_ASSERT_TRUE(wait_for(marie->lc
,pauline->lc
,&marie->stat.number_of_LinphoneCallOutgoingRinging
,1));
/*attempt to send a second call while the first one is not answered.
* It must be rejected by the core, since the audio resources are already engaged for the first call*/
params = linphone_core_create_call_params(marie->lc, NULL);
linphone_call_params_enable_audio(params, !second_without_audio);
marie_call = linphone_core_invite_with_params(marie->lc, "sip:laure_non_exstent@test.linphone.org", params);
linphone_call_params_destroy(params);
if (second_without_audio){
BC_ASSERT_PTR_NOT_NULL(marie_call);
BC_ASSERT_TRUE(wait_for(marie->lc
,pauline->lc
,&marie->stat.number_of_LinphoneCallError
,1));
}else{
BC_ASSERT_PTR_NULL(marie_call);
}
pauline_call = linphone_core_get_current_call(pauline->lc);
BC_ASSERT_PTR_NOT_NULL(pauline_call);
if (pauline_call){
......@@ -253,7 +253,7 @@ static void simple_conference_base(LinphoneCoreManager* marie, LinphoneCoreManag
lcs=ms_list_append(lcs,pauline->lc);
lcs=ms_list_append(lcs,laure->lc);
if(focus) lcs=ms_list_append(lcs,focus->lc);
is_remote_conf = (strcmp(lp_config_get_string(marie->lc->config, "misc", "conference_type", "local"), "remote") == 0);
if(is_remote_conf) BC_ASSERT_PTR_NOT_NULL(focus);
......@@ -299,7 +299,7 @@ static void simple_conference_base(LinphoneCoreManager* marie, LinphoneCoreManag
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneTransferCallConnected,initial_marie_stat.number_of_LinphoneTransferCallConnected+2,5000));
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallEnd,initial_marie_stat.number_of_LinphoneCallEnd+2,5000));
}
BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallStreamsRunning,initial_pauline_stat.number_of_LinphoneCallStreamsRunning+1,5000));
BC_ASSERT_TRUE(wait_for_list(lcs,&laure->stat.number_of_LinphoneCallStreamsRunning,initial_laure_stat.number_of_LinphoneCallStreamsRunning+1,2000));
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallStreamsRunning,initial_marie_stat.number_of_LinphoneCallStreamsRunning+2,3000));
......@@ -338,12 +338,12 @@ static void simple_conference_base(LinphoneCoreManager* marie, LinphoneCoreManag
BC_ASSERT_EQUAL(ms_list_size(participants), 2, int, "%d");
ms_list_free_with_data(participants, (void(*)(void *))linphone_address_destroy);
}
linphone_core_terminate_conference(marie->lc);
BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallEnd,is_remote_conf?2:1,10000));
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallEnd,is_remote_conf?3:1,10000));
BC_ASSERT_TRUE(wait_for_list(lcs,&laure->stat.number_of_LinphoneCallEnd,is_remote_conf?2:1,10000));
end:
ms_list_free(lcs);
}
......@@ -637,7 +637,7 @@ static void eject_from_3_participants_conference(LinphoneCoreManager *marie, Lin
is_remote_conf = (strcmp(lp_config_get_string(marie->lc->config, "misc", "conference_type", "local"), "remote") == 0);
if(is_remote_conf) BC_ASSERT_PTR_NOT_NULL(focus);
BC_ASSERT_TRUE(call(marie,pauline));
marie_call_pauline=linphone_core_get_current_call(marie->lc);
pauline_called_by_marie=linphone_core_get_current_call(pauline->lc);
......@@ -653,14 +653,14 @@ static void eject_from_3_participants_conference(LinphoneCoreManager *marie, Lin
BC_ASSERT_PTR_NOT_NULL_FATAL(marie_call_laure);
linphone_core_add_to_conference(marie->lc,marie_call_laure);
if(!is_remote_conf) BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallUpdating,initial_marie_stat.number_of_LinphoneCallUpdating+1,5000));
else {
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneTransferCallConnected,initial_marie_stat.number_of_LinphoneTransferCallConnected+1,5000));
BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallEnd,initial_marie_stat.number_of_LinphoneCallEnd+1,5000));
BC_ASSERT_TRUE(wait_for_list(lcs,&laure->stat.number_of_LinphoneCallEnd,initial_laure_stat.number_of_LinphoneCallEnd+1,5000));
}
BC_ASSERT_PTR_NOT_NULL(linphone_core_get_conference(marie->lc));
linphone_core_add_to_conference(marie->lc,marie_call_pauline);
......@@ -699,7 +699,7 @@ static void eject_from_3_participants_conference(LinphoneCoreManager *marie, Lin
} else {
BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallEnd,initial_pauline_stat.number_of_LinphoneCallEnd+2,5000));
}
if(!is_remote_conf) {
end_call(laure, marie);
end_call(pauline, marie);
......@@ -808,7 +808,7 @@ static void eject_from_4_participants_conference(void) {
linphone_core_manager_destroy(laure);
linphone_core_manager_destroy(michelle);
}
void simple_remote_conference(void) {
LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
......@@ -822,10 +822,10 @@ void simple_remote_conference(void) {
const char *focus_uri = linphone_proxy_config_get_identity(focus_proxy_config);
int laure_n_register = laure->stat.number_of_LinphoneRegistrationOk;
MSList *lcs = NULL;
lp_config_set_string(marie_config, "misc", "conference_type", "remote");
lp_config_set_string(marie_config, "misc", "conference_focus_addr", focus_uri);
linphone_proxy_config_edit(laure_proxy_config);
linphone_proxy_config_set_route(laure_proxy_config, laure_proxy_uri);
linphone_proxy_config_done(laure_proxy_config);
......@@ -834,7 +834,7 @@ void simple_remote_conference(void) {
ms_list_free(lcs);
simple_conference_base(marie, pauline, laure, (LinphoneCoreManager *)focus);
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline);
linphone_core_manager_destroy(laure);
......@@ -853,10 +853,10 @@ void simple_remote_conference_shut_down_focus(void) {
const char *focus_uri = linphone_proxy_config_get_identity(focus_proxy_config);
int laure_n_register = laure->stat.number_of_LinphoneRegistrationOk;
MSList *lcs = NULL;
lp_config_set_string(marie_config, "misc", "conference_type", "remote");
lp_config_set_string(marie_config, "misc", "conference_focus_addr", focus_uri);
linphone_proxy_config_edit(laure_proxy_config);
linphone_proxy_config_set_route(laure_proxy_config,