fix crashing test

This commit is contained in:
Simon Morlat 2015-04-09 23:04:23 +02:00
parent 40f82acc4d
commit 8352e97861

View file

@ -1907,7 +1907,7 @@ end:
static void video_call_with_early_media_no_matching_audio_codecs(void) {
LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
LinphoneCoreManager *pauline = linphone_core_manager_new("pauline_rc");
LinphoneCall *out_call;
LinphoneCall *out_call, *pauline_call;
LinphoneVideoPolicy vpol={0};
linphone_core_enable_video_capture(marie->lc, TRUE);
@ -1929,17 +1929,20 @@ static void video_call_with_early_media_no_matching_audio_codecs(void) {
CU_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallIncomingReceived, 1));
CU_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallOutgoingRinging, 1));
linphone_core_accept_early_media(pauline->lc,linphone_core_get_current_call(pauline->lc));
pauline_call = linphone_core_get_current_call(pauline->lc);
if (!pauline_call) goto end;
linphone_core_accept_early_media(pauline->lc, pauline_call);
CU_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallIncomingEarlyMedia, 1));
CU_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallOutgoingEarlyMedia, 1));
/*audio stream shall not have been requested to start*/
CU_ASSERT_PTR_NULL(linphone_core_get_current_call(pauline->lc)->audiostream->soundread);
CU_ASSERT_PTR_NULL(pauline_call->audiostream->soundread);
CU_ASSERT_TRUE(linphone_call_params_video_enabled(linphone_call_get_current_params(out_call))==TRUE);
CU_ASSERT_TRUE(linphone_call_params_video_enabled(linphone_call_get_current_params(linphone_core_get_current_call(pauline->lc)))==TRUE);
CU_ASSERT_TRUE(linphone_call_params_video_enabled(linphone_call_get_current_params(pauline_call))==TRUE);
linphone_core_accept_call(pauline->lc, linphone_core_get_current_call(pauline->lc));
linphone_core_accept_call(pauline->lc, pauline_call);
CU_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallStreamsRunning, 1));
CU_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallStreamsRunning, 1));
@ -1949,6 +1952,7 @@ static void video_call_with_early_media_no_matching_audio_codecs(void) {
CU_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallEnd, 1));
CU_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallEnd, 1));
end:
linphone_call_unref(out_call);
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline);