tester: do not use BC_ASSERT_*_FATAL macros anymore

parent 2f5bff8c
......@@ -308,7 +308,7 @@ if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
set(BcToolbox_FIND_COMPONENTS tester)
include("${EP_bctoolbox_CONFIG_DIR}/BcToolboxConfig.cmake")
else()
find_package(BcToolbox REQUIRED OPTIONAL_COMPONENTS tester)
find_package(BcToolbox 0.0.3 REQUIRED OPTIONAL_COMPONENTS tester)
endif()
include_directories(
......
......@@ -38,7 +38,7 @@ if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
include("${EP_bctoolbox_CONFIG_DIR}/BcToolboxConfig.cmake")
else()
find_package(ORTP REQUIRED)
find_package(BcToolbox REQUIRED COMPONENTS core)
find_package(BcToolbox 0.0.3 REQUIRED COMPONENTS core)
endif()
find_package(Matroska2)
if(@ENABLE_ZRTP@)
......
......@@ -249,9 +249,9 @@ void start_adaptive_stream(MSFormatType type, stream_manager_t ** pmarielle, str
/* Disable avpf. */
pt = rtp_profile_get_payload(&rtp_profile, VP8_PAYLOAD_TYPE);
BC_ASSERT_PTR_NOT_NULL_FATAL(pt);
payload_type_unset_flag(pt, PAYLOAD_TYPE_RTCP_FEEDBACK_ENABLED);
if (BC_ASSERT_PTR_NOT_NULL(pt)) {
payload_type_unset_flag(pt, PAYLOAD_TYPE_RTCP_FEEDBACK_ENABLED);
}
media_stream_enable_adaptive_bitrate_control(marielle_ms,TRUE);
media_stream_set_adaptive_bitrate_algorithm(marielle_ms, MSQosAnalyzerAlgorithmStateful);
......
......@@ -261,11 +261,11 @@ static void encrypted_audio_stream_base( bool_t change_ssrc,
const char *aes_128_bits_send_key = "d0RmdmcmVCspeEc3QGZiNWpVLFJhQX1cfHAwJSoj";
const char *aes_128_bits_send_key_2 = "eCYF4nYyCvmCpFWjUeDaxI2GWp2BzCRlIPfg52Te";
const char *aes_128_bits_recv_key = "6jCLmtRkVW9E/BUuJtYj/R2z6+4iEe06/DWohQ9F";
const char *aes_256_bits_send_key = "nJNTwiMkyAu8zs0MWUiSQbnBL4M+xkWTYgrVLR2eFwZyO+ca2UqBy2Uh9pVRbA==";
const char *aes_256_bits_send_key_2 = "N3vq6TMfvtyYpqGaEi9vAHMCzgWJvaD1PIfwEYtdEgI2ACezZo2vpOdV2YWEcQ==";
const char *aes_256_bits_recv_key = "UKg69sFLbrA7d0hEVKMtT83R3GR3sjhE0XMqNBbQ+axoDWMP5dQNfjNuSQQHbw==";
const char *send_key = NULL;
const char *send_key_2 = NULL;
const char *recv_key = NULL;
......@@ -279,21 +279,18 @@ static void encrypted_audio_stream_base( bool_t change_ssrc,
send_key_2 = aes_128_bits_send_key_2;
recv_key = aes_128_bits_recv_key;
break;
case MS_AES_256_SHA1_32:
case MS_AES_256_SHA1_80:
send_key = aes_256_bits_send_key;
send_key_2 = aes_256_bits_send_key_2;
recv_key = aes_256_bits_recv_key;
break;
default:
default:
BC_FAIL("Unsupported suite");
BC_ASSERT_FATAL(FALSE);
break;
return;
}
if (ms_srtp_supported()) {
reset_stats(&marielle_stats);
reset_stats(&margaux_stats);
......@@ -407,7 +404,7 @@ static void encrypted_audio_stream_base( bool_t change_ssrc,
, NULL
, 0)
,0, int, "%d");
BC_ASSERT_FATAL(ms_media_stream_sessions_set_srtp_send_key_b64(&(marielle->ms.sessions), suite, send_key) == 0);
BC_ASSERT(ms_media_stream_sessions_set_srtp_send_key_b64(&(marielle->ms.sessions), suite, send_key) == 0);
ms_filter_add_notify_callback(marielle->soundread, notify_cb, &marielle_stats,TRUE);
......
......@@ -72,7 +72,7 @@ static MSTicker * create_ticker(void) {
void ms_tester_create_ticker(void) {
BC_ASSERT_PTR_NULL(ms_tester_ticker);
ms_tester_ticker = create_ticker();
BC_ASSERT_PTR_NOT_NULL_FATAL(ms_tester_ticker);
BC_ASSERT_PTR_NOT_NULL(ms_tester_ticker);
}
void ms_tester_destroy_ticker(void) {
......@@ -86,14 +86,14 @@ void ms_tester_destroy_ticker(void) {
if (filter_mask & mask) { \
BC_ASSERT_PTR_NULL(filter); \
filter = ms_factory_create_filter(factory, id); \
BC_ASSERT_PTR_NOT_NULL_FATAL(filter); \
BC_ASSERT_PTR_NOT_NULL(filter); \
}
void ms_tester_create_filter(MSFilter **filter, MSFilterId id, MSFactory *f) {
BC_ASSERT_PTR_NOT_NULL(filter);
BC_ASSERT_PTR_NULL(*filter);
*filter = ms_factory_create_filter(f, id);
BC_ASSERT_PTR_NOT_NULL_FATAL(*filter);
BC_ASSERT_PTR_NOT_NULL(*filter);
}
void ms_tester_create_filters(unsigned int filter_mask, MSFactory * f) {
......@@ -114,12 +114,12 @@ void ms_tester_create_filters(unsigned int filter_mask, MSFactory * f) {
if (filter_mask & FILTER_MASK_ENCODER) {
BC_ASSERT_PTR_NULL(ms_tester_encoder);
ms_tester_encoder = ms_factory_create_encoder(f, ms_tester_codec_mime);
BC_ASSERT_PTR_NOT_NULL_FATAL(ms_tester_encoder);
BC_ASSERT_PTR_NOT_NULL(ms_tester_encoder);
}
if (filter_mask & FILTER_MASK_DECODER) {
BC_ASSERT_PTR_NULL(ms_tester_decoder);
ms_tester_decoder = ms_factory_create_decoder(f, ms_tester_codec_mime);
BC_ASSERT_PTR_NOT_NULL_FATAL(ms_tester_decoder);
BC_ASSERT_PTR_NOT_NULL(ms_tester_decoder);
}
CREATE_FILTER(FILTER_MASK_RTPRECV, ms_tester_rtprecv, f, MS_RTP_RECV_ID);
CREATE_FILTER(FILTER_MASK_RTPSEND, ms_tester_rtpsend, f ,MS_RTP_SEND_ID);
......@@ -128,25 +128,25 @@ void ms_tester_create_filters(unsigned int filter_mask, MSFactory * f) {
BC_ASSERT_PTR_NULL(ms_tester_soundwrite);
snd_manager = ms_factory_get_snd_card_manager(f);
playcard = ms_snd_card_manager_get_default_playback_card(snd_manager);
BC_ASSERT_PTR_NOT_NULL_FATAL(playcard);
BC_ASSERT_PTR_NOT_NULL(playcard);
ms_tester_soundwrite = ms_snd_card_create_writer(playcard);
BC_ASSERT_PTR_NOT_NULL_FATAL(ms_tester_soundwrite);
BC_ASSERT_PTR_NOT_NULL(ms_tester_soundwrite);
}
if (filter_mask & FILTER_MASK_SOUNDREAD) {
BC_ASSERT_PTR_NULL(ms_tester_soundread);
snd_manager = ms_factory_get_snd_card_manager(f);
captcard = ms_snd_card_manager_get_default_capture_card(snd_manager);
BC_ASSERT_PTR_NOT_NULL_FATAL(captcard);
BC_ASSERT_PTR_NOT_NULL(captcard);
ms_tester_soundread = ms_snd_card_create_reader(captcard);
BC_ASSERT_PTR_NOT_NULL_FATAL(ms_tester_soundread);
BC_ASSERT_PTR_NOT_NULL(ms_tester_soundread);
}
if (filter_mask & FILTER_MASK_VIDEOCAPTURE) {
BC_ASSERT_PTR_NULL(ms_tester_videocapture);
cam_manager = ms_factory_get_web_cam_manager(f);
camera = ms_web_cam_manager_get_default_cam(cam_manager);
BC_ASSERT_PTR_NOT_NULL_FATAL(camera);
BC_ASSERT_PTR_NOT_NULL(camera);
ms_tester_videocapture = ms_web_cam_create_reader(camera);
BC_ASSERT_PTR_NOT_NULL_FATAL(ms_tester_videocapture);
BC_ASSERT_PTR_NOT_NULL(ms_tester_videocapture);
}
}
......
......@@ -126,7 +126,7 @@ static void codecs_manager_test_all_combinations(const CodecsManager *cm, CodecM
static int tester_before_all(void) {
_factory = ms_factory_new_with_voip();
ms_factory_create_filter(_factory, TRUE);
ortp_init();
rtp_profile_set_payload(&rtp_profile, VP8_PAYLOAD_TYPE, &payload_type_vp8);
......@@ -296,8 +296,9 @@ static void create_video_stream(video_stream_tester_t *vst, int payload_type) {
video_stream_set_event_callback(vst->vs, video_stream_event_cb, vst);
if (vst->vconf) {
PayloadType *pt = rtp_profile_get_payload(&rtp_profile, payload_type);
BC_ASSERT_PTR_NOT_NULL_FATAL(pt);
pt->normal_bitrate = vst->vconf->required_bitrate;
if (BC_ASSERT_PTR_NOT_NULL(pt)) {
pt->normal_bitrate = vst->vconf->required_bitrate;
}
video_stream_set_fps(vst->vs, vst->vconf->fps);
video_stream_set_sent_video_size(vst->vs, vst->vconf->vsize);
}
......@@ -317,11 +318,12 @@ static void init_video_streams(video_stream_tester_t *vst1, video_stream_tester_
/* Enable/disable avpf. */
pt = rtp_profile_get_payload(&rtp_profile, payload_type);
BC_ASSERT_PTR_NOT_NULL_FATAL(pt);
if (avpf == TRUE) {
payload_type_set_flag(pt, PAYLOAD_TYPE_RTCP_FEEDBACK_ENABLED);
} else {
payload_type_unset_flag(pt, PAYLOAD_TYPE_RTCP_FEEDBACK_ENABLED);
if (BC_ASSERT_PTR_NOT_NULL(pt)) {
if (avpf == TRUE) {
payload_type_set_flag(pt, PAYLOAD_TYPE_RTCP_FEEDBACK_ENABLED);
} else {
payload_type_unset_flag(pt, PAYLOAD_TYPE_RTCP_FEEDBACK_ENABLED);
}
}
/* Configure network simulator. */
......@@ -344,9 +346,8 @@ static void uninit_video_streams(video_stream_tester_t *vst1, video_stream_teste
PayloadType *vst2_pt;
vst1_pt = rtp_profile_get_payload(&rtp_profile, vst1->payload_type);
BC_ASSERT_PTR_NOT_NULL_FATAL(vst1_pt);
vst2_pt = rtp_profile_get_payload(&rtp_profile, vst2->payload_type);
BC_ASSERT_PTR_NOT_NULL_FATAL(vst2_pt);
if (!BC_ASSERT_PTR_NOT_NULL(vst1_pt) || !BC_ASSERT_PTR_NOT_NULL(vst2_pt)) return;
rtcp_send_bandwidth = rtp_session_get_rtcp_send_bandwidth(vst1->vs->ms.sessions.rtp_session);
ms_message("vst1: rtcp_send_bandwidth=%f, payload_type_bitrate=%d, rtcp_target_bandwidth=%f",
......@@ -501,7 +502,7 @@ static void avpf_video_stream_base(int payload_type) {
OrtpNetworkSimulatorParams params = { 0 };
bool_t supported;
int dummy = 0;
switch(payload_type) {
case VP8_PAYLOAD_TYPE:
supported = ms_factory_codec_supported(_factory, "vp8");
......@@ -513,7 +514,7 @@ static void avpf_video_stream_base(int payload_type) {
supported = FALSE;
break;
}
if (supported) {
params.enabled = TRUE;
params.loss_rate = 5.;
......@@ -521,9 +522,9 @@ static void avpf_video_stream_base(int payload_type) {
init_video_streams(marielle, margaux, TRUE, FALSE, &params,payload_type);
BC_ASSERT_TRUE(wait_for_until_with_parse_events(&marielle->vs->ms, &margaux->vs->ms, &marielle->stats.number_of_SR, 2, 15000, event_queue_cb, &marielle->stats, event_queue_cb, &margaux->stats));
if (payload_type == VP8_PAYLOAD_TYPE) {
BC_ASSERT_TRUE(wait_for_until_with_parse_events(&marielle->vs->ms, &margaux->vs->ms, &marielle->stats.number_of_sent_SLI, 1, 5000, event_queue_cb, &marielle->stats, event_queue_cb, &margaux->stats));
BC_ASSERT_TRUE(wait_for_until_with_parse_events(&marielle->vs->ms, &margaux->vs->ms, &marielle->stats.number_of_sent_RPSI, 1, 15000, event_queue_cb, &marielle->stats, event_queue_cb, &margaux->stats));
......@@ -533,9 +534,9 @@ static void avpf_video_stream_base(int payload_type) {
params.enabled = FALSE;
rtp_session_enable_network_simulation(marielle->vs->ms.sessions.rtp_session, &params);
rtp_session_enable_network_simulation(margaux->vs->ms.sessions.rtp_session, &params);
wait_for_until_with_parse_events(&marielle->vs->ms, &margaux->vs->ms, &dummy, 1, 1000, event_queue_cb, &marielle->stats, event_queue_cb, &margaux->stats);
// wait for all packets reception before closing streams
if (payload_type == VP8_PAYLOAD_TYPE) {
BC_ASSERT_TRUE(wait_for_until_with_parse_events(&marielle->vs->ms, &margaux->vs->ms, &margaux->vs->ms_video_stat.counter_rcvd_rpsi , marielle->stats.number_of_sent_RPSI, 10000, event_queue_cb, &marielle->stats, event_queue_cb, &margaux->stats));
......@@ -551,16 +552,16 @@ static void avpf_video_stream_base(int payload_type) {
BC_ASSERT_EQUAL(margaux->vs->ms_video_stat.counter_rcvd_sli , marielle->stats.number_of_sent_SLI, int, "%d");
BC_ASSERT_EQUAL(margaux->vs->ms_video_stat.counter_rcvd_rpsi , marielle->stats.number_of_sent_RPSI, int, "%d");
BC_ASSERT_EQUAL(margaux->vs->ms_video_stat.counter_rcvd_pli , marielle->stats.number_of_sent_PLI, int, "%d");
BC_ASSERT_EQUAL(marielle->vs->ms_video_stat.counter_rcvd_sli , margaux->stats.number_of_sent_SLI, int, "%d");
BC_ASSERT_EQUAL(marielle->vs->ms_video_stat.counter_rcvd_rpsi , margaux->stats.number_of_sent_RPSI, int, "%d");
BC_ASSERT_EQUAL(marielle->vs->ms_video_stat.counter_rcvd_pli , margaux->stats.number_of_sent_PLI, int, "%d");
uninit_video_streams(marielle, margaux);
} else {
ms_error("Codec is not supported!");
}
video_stream_tester_destroy(marielle);
video_stream_tester_destroy(margaux);
}
......
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