From: Tim-Philipp Müller Date: Sat, 7 Dec 2019 14:36:36 +0000 (+0000) Subject: tests: oggmux: check vorbisenc + theoraenc availability at runtime X-Git-Tag: 1.19.3~511^2~838 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2b99761dcf16c027c031be0c97abe01c5aa7075e;p=platform%2Fupstream%2Fgstreamer.git tests: oggmux: check vorbisenc + theoraenc availability at runtime HAVE_VORBIS was used but never set, so only 3 out of 7 tests actually ran. Drop now-unused HAVE_THEORA define. --- diff --git a/ext/theora/meson.build b/ext/theora/meson.build index 0949924a57..c0dba1bdd2 100644 --- a/ext/theora/meson.build +++ b/ext/theora/meson.build @@ -5,7 +5,6 @@ theora_sources = [ theoradec_dep = dependency('theoradec', version : '>=1.1', required : get_option('theora')) theoraenc_dep = dependency('theoraenc', version : '>=1.1', required : get_option('theora')) -core_conf.set('HAVE_THEORA', theoradec_dep.found() and theoraenc_dep.found()) theora_deps = [] if theoradec_dep.found() or theoraenc_dep.found() diff --git a/tests/check/pipelines/oggmux.c b/tests/check/pipelines/oggmux.c index 37037d83a2..1259fefbaa 100644 --- a/tests/check/pipelines/oggmux.c +++ b/tests/check/pipelines/oggmux.c @@ -46,7 +46,6 @@ typedef struct ChainCodec codec; } ChainState; -#if (defined (HAVE_THEORA) || defined (HAVE_VORBIS)) static ogg_sync_state oggsync; static GHashTable *eos_chain_states; static gulong probe_id; @@ -310,9 +309,7 @@ test_pipeline (const char *pipeline) gst_object_unref (pad); gst_object_unref (bin); } -#endif -#ifdef HAVE_VORBIS GST_START_TEST (test_vorbis) { test_pipeline @@ -344,9 +341,7 @@ GST_START_TEST (test_vorbis_oggmux_unlinked) } GST_END_TEST; -#endif -#ifdef HAVE_THEORA GST_START_TEST (test_theora) { test_pipeline @@ -354,9 +349,7 @@ GST_START_TEST (test_theora) } GST_END_TEST; -#endif -#if (defined (HAVE_THEORA) && defined (HAVE_VORBIS)) GST_START_TEST (test_theora_vorbis) { test_pipeline @@ -374,7 +367,6 @@ GST_START_TEST (test_vorbis_theora) } GST_END_TEST; -#endif GST_START_TEST (test_simple_cleanup) { @@ -406,23 +398,35 @@ GST_END_TEST; static Suite * oggmux_suite (void) { + gboolean have_vorbisenc; + gboolean have_theoraenc; + Suite *s = suite_create ("oggmux"); TCase *tc_chain = tcase_create ("general"); + have_vorbisenc = + gst_registry_check_feature_version (gst_registry_get (), "vorbisenc", + GST_VERSION_MAJOR, GST_VERSION_MINOR, 0); + + have_theoraenc = + gst_registry_check_feature_version (gst_registry_get (), "theoraenc", + GST_VERSION_MAJOR, GST_VERSION_MINOR, 0); + suite_add_tcase (s, tc_chain); -#ifdef HAVE_VORBIS - tcase_add_test (tc_chain, test_vorbis); - tcase_add_test (tc_chain, test_vorbis_oggmux_unlinked); -#endif -#ifdef HAVE_THEORA - tcase_add_test (tc_chain, test_theora); -#endif + if (have_vorbisenc) { + tcase_add_test (tc_chain, test_vorbis); + tcase_add_test (tc_chain, test_vorbis_oggmux_unlinked); + } -#if (defined (HAVE_THEORA) && defined (HAVE_VORBIS)) - tcase_add_test (tc_chain, test_vorbis_theora); - tcase_add_test (tc_chain, test_theora_vorbis); -#endif + if (have_theoraenc) { + tcase_add_test (tc_chain, test_theora); + } + + if (have_vorbisenc && have_theoraenc) { + tcase_add_test (tc_chain, test_vorbis_theora); + tcase_add_test (tc_chain, test_theora_vorbis); + } tcase_add_test (tc_chain, test_simple_cleanup); tcase_add_test (tc_chain, test_request_pad_cleanup);