Commit f79dc78c authored by jehan's avatar jehan

add test for re-invite with 200ok losses

parent 9eacaae8
...@@ -1374,7 +1374,7 @@ static void call_with_custom_sdp_attributes(void) { ...@@ -1374,7 +1374,7 @@ static void call_with_custom_sdp_attributes(void) {
linphone_core_manager_destroy(pauline); linphone_core_manager_destroy(pauline);
} }
void call_paused_resumed_base(bool_t multicast) { void call_paused_resumed_base(bool_t multicast, bool_t with_retransmition) {
LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc");
LinphoneCall* call_pauline; LinphoneCall* call_pauline;
...@@ -1391,8 +1391,18 @@ void call_paused_resumed_base(bool_t multicast) { ...@@ -1391,8 +1391,18 @@ void call_paused_resumed_base(bool_t multicast) {
wait_for_until(pauline->lc, marie->lc, NULL, 5, 3000); wait_for_until(pauline->lc, marie->lc, NULL, 5, 3000);
if (with_retransmition) {
sal_set_send_error(marie->lc->sal,1500); /*to trash 200ok without generating error*/
}
linphone_core_pause_call(pauline->lc,call_pauline); linphone_core_pause_call(pauline->lc,call_pauline);
BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallPausing,1)); BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallPausing,1));
if (with_retransmition) {
BC_ASSERT_FALSE(wait_for_until(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallPaused,1,1000));
sal_set_send_error(marie->lc->sal,0); /*to trash 200ok without generating error*/
}
BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneCallPausedByRemote,1)); BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneCallPausedByRemote,1));
BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallPaused,1)); BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallPaused,1));
...@@ -1415,8 +1425,13 @@ end: ...@@ -1415,8 +1425,13 @@ end:
linphone_core_manager_destroy(marie); linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline); linphone_core_manager_destroy(pauline);
} }
static void call_paused_resumed(void) { static void call_paused_resumed(void) {
call_paused_resumed_base(FALSE); call_paused_resumed_base(FALSE,FALSE);
}
static void call_paused_resumed_with_sip_packets_losses(void) {
call_paused_resumed_base(FALSE,TRUE);
} }
static void call_paused_by_both(void) { static void call_paused_by_both(void) {
...@@ -6181,6 +6196,7 @@ test_t call_tests[] = { ...@@ -6181,6 +6196,7 @@ test_t call_tests[] = {
TEST_NO_TAG("Call without SDP", call_with_no_sdp), TEST_NO_TAG("Call without SDP", call_with_no_sdp),
TEST_NO_TAG("Call without SDP and ACK without SDP", call_with_no_sdp_ack_without_sdp), TEST_NO_TAG("Call without SDP and ACK without SDP", call_with_no_sdp_ack_without_sdp),
TEST_NO_TAG("Call paused resumed", call_paused_resumed), TEST_NO_TAG("Call paused resumed", call_paused_resumed),
TEST_NO_TAG("Call paused resumed with sip packets looses", call_paused_resumed_with_sip_packets_losses),
#ifdef VIDEO_ENABLED #ifdef VIDEO_ENABLED
TEST_NO_TAG("Call paused resumed with video", call_paused_resumed_with_video), TEST_NO_TAG("Call paused resumed with video", call_paused_resumed_with_video),
TEST_NO_TAG("Call paused resumed with video no sdp ack", call_paused_resumed_with_no_sdp_ack), TEST_NO_TAG("Call paused resumed with video no sdp ack", call_paused_resumed_with_no_sdp_ack),
......
...@@ -336,7 +336,7 @@ void account_manager_destroy(void); ...@@ -336,7 +336,7 @@ void account_manager_destroy(void);
LinphoneCore* configure_lc_from(LinphoneCoreVTable* v_table, const char* path, const char* file, void* user_data); LinphoneCore* configure_lc_from(LinphoneCoreVTable* v_table, const char* path, const char* file, void* user_data);
void liblinphone_tester_enable_ipv6(bool_t enabled); void liblinphone_tester_enable_ipv6(bool_t enabled);
void linphone_call_iframe_decoded_cb(LinphoneCall *call,void * user_data); void linphone_call_iframe_decoded_cb(LinphoneCall *call,void * user_data);
void call_paused_resumed_base(bool_t multicast); void call_paused_resumed_base(bool_t multicast,bool_t with_losses);
void simple_call_base(bool_t enable_multicast_recv_side); void simple_call_base(bool_t enable_multicast_recv_side);
void call_base_with_configfile(LinphoneMediaEncryption mode, bool_t enable_video,bool_t enable_relay,LinphoneFirewallPolicy policy,bool_t enable_tunnel, const char *marie_rc, const char *pauline_rc); void call_base_with_configfile(LinphoneMediaEncryption mode, bool_t enable_video,bool_t enable_relay,LinphoneFirewallPolicy policy,bool_t enable_tunnel, const char *marie_rc, const char *pauline_rc);
void call_base(LinphoneMediaEncryption mode, bool_t enable_video,bool_t enable_relay,LinphoneFirewallPolicy policy,bool_t enable_tunnel); void call_base(LinphoneMediaEncryption mode, bool_t enable_video,bool_t enable_relay,LinphoneFirewallPolicy policy,bool_t enable_tunnel);
......
...@@ -69,7 +69,7 @@ static void call_multicast(void) { ...@@ -69,7 +69,7 @@ static void call_multicast(void) {
call_multicast_base(FALSE); call_multicast_base(FALSE);
} }
static void multicast_audio_with_pause_resume(void) { static void multicast_audio_with_pause_resume(void) {
call_paused_resumed_base(TRUE); call_paused_resumed_base(TRUE,FALSE);
} }
#ifdef VIDEO_ENABLED #ifdef VIDEO_ENABLED
static void call_multicast_video(void) { static void call_multicast_video(void) {
......
...@@ -183,7 +183,7 @@ static void simple_publish_with_expire(int expires) { ...@@ -183,7 +183,7 @@ static void simple_publish_with_expire(int expires) {
BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishOk,4)); BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishOk,4));
linphone_core_manager_destroy(marie); linphone_core_manager_destroy(marie);
/*fixme we should wait untill 200ok*/BC_ASSERT_EQUAL(marie->stat.number_of_LinphonePublishCleared,2,int,"%i"); /*fixme we should wait untill 200okBC_ASSERT_EQUAL(marie->stat.number_of_LinphonePublishCleared,2,int,"%i");*/
BC_ASSERT_EQUAL(marie->stat.number_of_LinphonePublishOk,4,int,"%i"); BC_ASSERT_EQUAL(marie->stat.number_of_LinphonePublishOk,4,int,"%i");
} }
......
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