From 3ac3ddcda2cc382945546af1919f0fcfedaff9d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Turnel?= Date: Tue, 12 Sep 2017 12:03:37 +0200 Subject: [PATCH] Fix the test for a high bandwidth with a callback --- tester/call_video_tester.c | 13 +++++++------ tester/liblinphone_tester.h | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tester/call_video_tester.c b/tester/call_video_tester.c index e6634b7c9..e22a39828 100644 --- a/tester/call_video_tester.c +++ b/tester/call_video_tester.c @@ -2006,7 +2006,7 @@ static void video_call_with_thin_congestion(void){ static void on_tmmbr_received(LinphoneCall *call, int stream_index, int tmmbr) { if (stream_index == call->main_video_stream_index) { stats* stat = get_stats(call->core); - stat->last_tmmbr_value_received = tmmbr; + stat->tmmbr_received_from_cb = tmmbr; } } @@ -2023,7 +2023,7 @@ static void call_created(LinphoneCore *lc, LinphoneCall *call){ * It checks that after a few seconds marie received a TMMBR with the approximate value corresponding to the new bandwidth. * **/ -static void video_call_with_high_bandwith_available(void) { +static void video_call_with_high_bandwidth_available(void) { LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc"); LinphoneCoreManager *pauline = linphone_core_manager_new("pauline_rc"); LinphoneVideoPolicy pol = {0}; @@ -2051,13 +2051,14 @@ static void video_call_with_high_bandwith_available(void) { linphone_core_set_network_simulator_params(marie->lc, &simparams); linphone_core_cbs_set_call_created(core_cbs, call_created); + linphone_core_add_callbacks(marie->lc, core_cbs); if (BC_ASSERT_TRUE(call(marie, pauline))){ /*wait a little in order to have traffic*/ - BC_ASSERT_TRUE(wait_for_until(marie->lc, pauline->lc, NULL, 5, 10000)); + BC_ASSERT_TRUE(wait_for_until(marie->lc, pauline->lc, NULL, 5, 50000)); - BC_ASSERT_GREATER((float)marie->stat.last_tmmbr_value_received, 1030000.f, float, "%f"); - BC_ASSERT_LOWER((float)marie->stat.last_tmmbr_value_received, 970000.f, float, "%f"); + BC_ASSERT_GREATER((float)marie->stat.tmmbr_received_from_cb, 850000.f, float, "%f"); + BC_ASSERT_LOWER((float)marie->stat.tmmbr_received_from_cb, 1150000.f, float, "%f"); end_call(marie, pauline); } @@ -2135,7 +2136,7 @@ test_t call_video_tests[] = { TEST_NO_TAG("Video call with no audio and no video codec", video_call_with_no_audio_and_no_video_codec), TEST_NO_TAG("Call with early media and no SDP in 200 Ok with video", call_with_early_media_and_no_sdp_in_200_with_video), TEST_NO_TAG("Video call with thin congestion", video_call_with_thin_congestion), - TEST_NO_TAG("Video call with high bandwith available", video_call_with_high_bandwith_available) + TEST_NO_TAG("Video call with high bandwidth available", video_call_with_high_bandwith_available) }; test_suite_t call_video_test_suite = {"Video Call", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each, diff --git a/tester/liblinphone_tester.h b/tester/liblinphone_tester.h index 95c034e24..c48a37e3f 100644 --- a/tester/liblinphone_tester.h +++ b/tester/liblinphone_tester.h @@ -267,6 +267,7 @@ typedef struct _stats { int number_of_rtcp_generic_nack; int number_of_tmmbr_received; int last_tmmbr_value_received; + int tmmbr_received_from_cb; }stats;