From aad1cc0715349b777b62bfec997f46d71a7f10d5 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Sun, 9 Aug 2015 17:22:15 +0200 Subject: [PATCH] robustize tests --- tester/Makefile.am | 4 +++- tester/offeranswer_tester.c | 17 +++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/tester/Makefile.am b/tester/Makefile.am index 8c489b96e..c3c3552b1 100644 --- a/tester/Makefile.am +++ b/tester/Makefile.am @@ -42,7 +42,9 @@ liblinphonetester_la_LDFLAGS= -no-undefined liblinphonetester_la_LIBADD= ../coreapi/liblinphone.la $(CUNIT_LIBS) AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/coreapi -I$(top_srcdir)/tester/common -AM_CFLAGS = -DBC_CONFIG_FILE=\"config.h\" $(STRICT_OPTIONS) $(STRICT_OPTIONS_CC) -DIN_LINPHONE $(ORTP_CFLAGS) $(MEDIASTREAMER_CFLAGS) $(CUNIT_CFLAGS) $(BELLESIP_CFLAGS) $(LIBXML2_CFLAGS) $(SQLITE3_CFLAGS) +AM_CFLAGS = -DBC_CONFIG_FILE=\"config.h\" $(STRICT_OPTIONS) $(STRICT_OPTIONS_CC) \ + -DIN_LINPHONE $(ORTP_CFLAGS) $(MEDIASTREAMER_CFLAGS) $(CUNIT_CFLAGS) \ + $(BELLESIP_CFLAGS) $(LIBXML2_CFLAGS) $(SQLITE3_CFLAGS) if BUILD_GTK_UI diff --git a/tester/offeranswer_tester.c b/tester/offeranswer_tester.c index 923635108..b433bda5c 100644 --- a/tester/offeranswer_tester.c +++ b/tester/offeranswer_tester.c @@ -343,19 +343,20 @@ static void compatible_avpf_features(void) { LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc"); LinphoneCoreManager *pauline = linphone_core_manager_new("pauline_tcp_rc"); LinphonePayloadType *lpt; + bool_t call_ok; if (configure_core_for_avpf_and_video(marie->lc) == NULL) goto end; lpt = configure_core_for_avpf_and_video(pauline->lc); - BC_ASSERT_TRUE(call(marie, pauline)); + BC_ASSERT_TRUE((call_ok=call(marie, pauline))); + if (!call_ok) goto end; + BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallStreamsRunning, 1)); BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallStreamsRunning, 1)); check_avpf_features(marie->lc, lpt->avpf.features); check_avpf_features(pauline->lc, lpt->avpf.features); - linphone_core_terminate_all_calls(marie->lc); - BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallEnd, 1)); - BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallEnd, 1)); + end_call(marie,pauline); end: linphone_core_manager_destroy(pauline); linphone_core_manager_destroy(marie); @@ -365,20 +366,20 @@ static void incompatible_avpf_features(void) { LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc"); LinphoneCoreManager *pauline = linphone_core_manager_new("pauline_tcp_rc"); LinphonePayloadType *lpt; + bool_t call_ok; if (configure_core_for_avpf_and_video(marie->lc) == NULL) goto end; lpt = configure_core_for_avpf_and_video(pauline->lc); lpt->avpf.features = PAYLOAD_TYPE_AVPF_NONE; - BC_ASSERT_TRUE(call(marie, pauline)); + BC_ASSERT_TRUE(call_ok=call(marie, pauline)); + if (!call_ok) goto end; BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallStreamsRunning, 1)); BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallStreamsRunning, 1)); check_avpf_features(marie->lc, PAYLOAD_TYPE_AVPF_NONE); check_avpf_features(pauline->lc, PAYLOAD_TYPE_AVPF_NONE); - linphone_core_terminate_all_calls(marie->lc); - BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallEnd, 1)); - BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallEnd, 1)); + end_call(marie,pauline); end: linphone_core_manager_destroy(pauline); linphone_core_manager_destroy(marie);