Commit 6df0e77d authored by Gautier Pelloux-Prayer's avatar Gautier Pelloux-Prayer
Browse files

run adaptive tests only if codecs are supported and add error messages on...

run adaptive tests only if codecs are supported and add error messages on wrong test/suite arguments
parent b2e6833f
......@@ -161,6 +161,7 @@ static void stream_manager_start( stream_manager_t * mgr
,const char* player_file
,const char* recorder_file) {
media_stream_set_target_network_bitrate(&mgr->stream->ms,target_bitrate);
CU_ASSERT_EQUAL(audio_stream_start_full(mgr->stream
, &rtp_profile
, "127.0.0.1"
......@@ -271,11 +272,17 @@ static void adaptive_audio_stream(int codec_payload, int initial_bitrate,int tar
}
static void adaptive_opus_audio_stream() {
adaptive_audio_stream(OPUS_PAYLOAD_TYPE, 32000, EDGE_BW, 7);
bool_t supported = ms_filter_codec_supported("opus");
if( supported ) {
adaptive_audio_stream(OPUS_PAYLOAD_TYPE, 32000, EDGE_BW, 7);
}
}
static void adaptive_speek16_audio_stream() {
adaptive_audio_stream(SPEEX16_PAYLOAD_TYPE, 32000, EDGE_BW, 7);
bool_t supported = ms_filter_codec_supported("speex");
if( supported ) {
adaptive_audio_stream(SPEEX16_PAYLOAD_TYPE, 32000, EDGE_BW, 7);
}
}
static void adaptative_isac16_audio_stream() {
......
......@@ -72,6 +72,20 @@ static int test_suite_index(const char *suite_name) {
return -1;
}
static void list_suite_tests(const char *suite_name) {
int j;
for( j = 0; j < mediastreamer2_tester_nb_tests(suite_name); j++) {
const char *test_name = mediastreamer2_tester_test_name(suite_name, j);
fprintf(stdout, "%s\n", test_name);
}
}
static void list_suites() {
int j;
for(j = 0; j < mediastreamer2_tester_nb_test_suites(); j++) {
const char *suite_name = mediastreamer2_tester_test_suite_name(j);
fprintf(stdout, "%s\n", suite_name);
}
}
int mediastreamer2_tester_nb_test_suites(void) {
return nb_test_suites;
......@@ -126,11 +140,22 @@ int mediastreamer2_tester_run_tests(const char *suite_name, const char *test_nam
CU_pSuite suite;
CU_basic_set_mode(CU_BRM_VERBOSE);
suite=CU_get_suite(suite_name);
if (test_name) {
if (!suite) {
ms_error("Could not find suite '%s'. Available suites are:", suite_name);
list_suites();
} else if (test_name) {
CU_pTest test=CU_get_test_by_name(test_name, suite);
CU_basic_run_test(suite, test);
} else
if (!test) {
ms_error("Could not find test '%s' in suite '%s'. Available tests are:", test_name, suite_name);
// do not use suite_name here, since this method is case sentisitive
list_suite_tests(suite->pName);
} else {
CU_ErrorCode err= CU_basic_run_test(suite, test);
if (err != CUE_SUCCESS) ms_error("CU_basic_run_test error %d", err);
}
} else {
CU_basic_run_suite(suite);
}
} else
#endif
{
......@@ -201,20 +226,12 @@ int main (int argc, char *argv[]) {
CHECK_ARG("--suite", ++i, argc);
suite_name = argv[i];
} else if (strcmp(argv[i],"--list-suites")==0){
int j;
for(j = 0; j < mediastreamer2_tester_nb_test_suites(); j++) {
suite_name = mediastreamer2_tester_test_suite_name(j);
fprintf(stdout, "%s\n", suite_name);
}
list_suites();
return 0;
} else if (strcmp(argv[i],"--list-tests")==0){
int j;
CHECK_ARG("--list-tests", ++i, argc);
suite_name = argv[i];
for( j = 0; j < mediastreamer2_tester_nb_tests(suite_name); j++) {
test_name = mediastreamer2_tester_test_name(suite_name, j);
fprintf(stdout, "%s\n", test_name);
}
list_suite_tests(suite_name);
return 0;
}
#endif
......
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