tester: iterate every 20 ms loops instead of 100 ms to speedup tests

parent 03d71b27
mediastreamer2 @ 80b70c52
Subproject commit 4554bf8680bc3d37b1fa876ce7e73a1aaf007a94
Subproject commit 80b70c52a4dbf7d1d1df8319a96159e769b46139
......@@ -244,10 +244,10 @@ bool_t call_with_params2(LinphoneCoreManager* caller_mgr
while (caller_mgr->stat.number_of_LinphoneCallOutgoingRinging!=(initial_caller.number_of_LinphoneCallOutgoingRinging + 1)
&& caller_mgr->stat.number_of_LinphoneCallOutgoingEarlyMedia!=(initial_caller.number_of_LinphoneCallOutgoingEarlyMedia +1)
&& retry++ <20) {
&& retry++ < 100) {
linphone_core_iterate(caller_mgr->lc);
linphone_core_iterate(callee_mgr->lc);
ms_usleep(100000);
ms_usleep(20000);
}
......@@ -2495,12 +2495,12 @@ void call_base_with_configfile(LinphoneMediaEncryption mode, bool_t enable_video
linphone_tunnel_add_server(linphone_core_get_tunnel(marie->lc),tunnel_config);
linphone_tunnel_enable_sip(linphone_core_get_tunnel(marie->lc),FALSE);
linphone_tunnel_set_mode(linphone_core_get_tunnel(marie->lc),LinphoneTunnelModeEnable);
for (i=0;i<10;i++) {
for (i=0;i<100;i++) {
if (linphone_tunnel_connected(linphone_core_get_tunnel(marie->lc))) {
break;
}
linphone_core_iterate(marie->lc);
ms_usleep(200000);
ms_usleep(20000);
}
BC_ASSERT_TRUE(linphone_tunnel_connected(linphone_core_get_tunnel(marie->lc)));
......@@ -2524,7 +2524,7 @@ void call_base_with_configfile(LinphoneMediaEncryption mode, bool_t enable_video
&& linphone_core_get_media_encryption(pauline->lc) == LinphoneMediaEncryptionZRTP) {
/*wait for SAS*/
int i;
for (i=0;i<10;i++) {
for (i=0;i<100;i++) {
if (linphone_call_get_authentication_token(linphone_core_get_current_call(pauline->lc))
&&
linphone_call_get_authentication_token(linphone_core_get_current_call(marie->lc))) {
......@@ -2536,7 +2536,7 @@ void call_base_with_configfile(LinphoneMediaEncryption mode, bool_t enable_video
}
linphone_core_iterate(marie->lc);
linphone_core_iterate(pauline->lc);
ms_usleep(200000);
ms_usleep(20000);
}
}
......
......@@ -174,9 +174,9 @@ static void test_complete_message_handler(const CU_pTest pTest,
char result[2048];
char buffer[2048];
CU_pFailureRecord pFailure = pFailureList;
snprintf(result, sizeof(result), "Suite [%s] Test [%s]", pSuite->pName, pTest->pName);
snprintf(result, sizeof(result), "Suite [%s] Test [%s] %s in %lu secs"
, pSuite->pName, pTest->pName, pFailure?"failed":"passed",(unsigned long)(time(NULL) - test_start_time));
if (pFailure) {
strncat(result, " failed:", strlen(" failed:"));
for (i = 1 ; (NULL != pFailure) ; pFailure = pFailure->pNext, i++) {
snprintf(buffer, sizeof(buffer), "\n %d. %s:%u - %s", i,
(NULL != pFailure->strFileName) ? pFailure->strFileName : "",
......@@ -184,10 +184,8 @@ static void test_complete_message_handler(const CU_pTest pTest,
(NULL != pFailure->strCondition) ? pFailure->strCondition : "");
strncat(result, buffer, strlen(buffer));
}
} else {
strncat(result, " passed", strlen(" passed"));
}
bc_tester_printf(bc_printf_verbosity_info,"%s in %lu sec\n", result, (unsigned long)(time(NULL) - test_start_time));
bc_tester_printf(bc_printf_verbosity_info,"%s\n", result);
}
#endif
......
......@@ -894,7 +894,7 @@ static void dos_module_trigger(void) {
char msg[128];
sprintf(msg, "Flood message number %i", i);
linphone_chat_room_send_message(chat_room, msg);
ms_usleep(100000);
ms_usleep(10000);
i++;
} while (i < number_of_messge_to_send);
// At this point we should be banned for a minute
......
......@@ -25,6 +25,8 @@ const char* phone_normalization(LinphoneProxyConfig *proxy, const char* in) {
}
static void phone_normalization_without_proxy() {
BC_ASSERT_TRUE(0);
BC_ASSERT_STRING_EQUAL(phone_normalization(NULL, "012 345 6789"), "0123456789");
BC_ASSERT_STRING_EQUAL(phone_normalization(NULL, "+33123456789"), "+33123456789");
BC_ASSERT_STRING_EQUAL(phone_normalization(NULL, "+33012345678"), "+33012345678");
......
......@@ -112,7 +112,7 @@ static void register_with_refresh_base_3(LinphoneCore* lc
linphone_core_set_default_proxy(lc,proxy_cfg);
while (counters->number_of_LinphoneRegistrationOk<1+(refresh!=0)
&& retry++ <(110 /*only wait 11 s if final state is progress*/+(expected_final_state==LinphoneRegistrationProgress?0:200))) {
&& retry++ <(1100 /*only wait 11 s if final state is progress*/+(expected_final_state==LinphoneRegistrationProgress?0:2000))) {
linphone_core_iterate(lc);
if (counters->number_of_auth_info_requested>0 && linphone_proxy_config_get_state(proxy_cfg) == LinphoneRegistrationFailed && late_auth_info) {
if (!linphone_core_get_auth_info_list(lc)) {
......@@ -124,7 +124,7 @@ static void register_with_refresh_base_3(LinphoneCore* lc
if (linphone_proxy_config_get_error(proxy_cfg) == LinphoneReasonBadCredentials
|| (counters->number_of_auth_info_requested>2 &&linphone_proxy_config_get_error(proxy_cfg) == LinphoneReasonUnauthorized)) /*no need to continue if auth cannot be found*/
break; /*no need to continue*/
ms_usleep(100000);
ms_usleep(10000);
}
BC_ASSERT_EQUAL(linphone_proxy_config_is_registered(proxy_cfg),(expected_final_state == LinphoneRegistrationOk), int, "%d");
BC_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationNone,0, int, "%d");
......@@ -170,9 +170,9 @@ static void register_with_refresh_with_send_error() {
register_with_refresh_base(lcm->lc,TRUE,auth_domain,route);
/*simultate a network error*/
sal_set_send_error(lcm->lc->sal, -1);
while (counters->number_of_LinphoneRegistrationProgress<2 && retry++ <20) {
while (counters->number_of_LinphoneRegistrationProgress<2 && retry++ <200) {
linphone_core_iterate(lcm->lc);
ms_usleep(100000);
ms_usleep(10000);
}
BC_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationFailed,0, int, "%d");
BC_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationProgress,2, int, "%d");
......
......@@ -175,10 +175,10 @@ static bool_t video_call_with_params(LinphoneCoreManager* caller_mgr, LinphoneCo
while (caller_mgr->stat.number_of_LinphoneCallOutgoingRinging != (initial_caller.number_of_LinphoneCallOutgoingRinging + 1)
&& caller_mgr->stat.number_of_LinphoneCallOutgoingEarlyMedia != (initial_caller.number_of_LinphoneCallOutgoingEarlyMedia + 1)
&& retry++ < 20) {
&& retry++ < 200) {
linphone_core_iterate(caller_mgr->lc);
linphone_core_iterate(callee_mgr->lc);
ms_usleep(100000);
ms_usleep(10000);
}
BC_ASSERT_TRUE((caller_mgr->stat.number_of_LinphoneCallOutgoingRinging == initial_caller.number_of_LinphoneCallOutgoingRinging + 1)
......
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