From 5850d560217b08c4c49d749728b2883d55eadf57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 21 Dec 2007 22:46:56 +0000 Subject: [PATCH] tests/check/: Don't use GST_PLUGIN_DEFINE_STATIC, it's not portable and will be deprecated in the future (see #498924). Original commit message from CVS: * tests/check/elements/playbin.c: (test_sink_usage_video_only_stream), (test_suburi_error_unknowntype), (test_suburi_error_invalidfile), (test_suburi_error_wrongproto), (test_missing_primary_decoder): * tests/check/libs/cddabasesrc.c: (GST_START_TEST), (GST_START_TEST), (cddabasesrc_suite): Don't use GST_PLUGIN_DEFINE_STATIC, it's not portable and will be deprecated in the future (see #498924). --- ChangeLog | 10 +++++++++ tests/check/elements/playbin.c | 39 +++++++++++++++------------------ tests/check/libs/cddabasesrc.c | 40 ++++++---------------------------- 3 files changed, 35 insertions(+), 54 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6226377447..872e2a67e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-12-21 Tim-Philipp Müller + + * tests/check/elements/playbin.c: (test_sink_usage_video_only_stream), + (test_suburi_error_unknowntype), (test_suburi_error_invalidfile), + (test_suburi_error_wrongproto), (test_missing_primary_decoder): + * tests/check/libs/cddabasesrc.c: (GST_START_TEST), (GST_START_TEST), + (cddabasesrc_suite): + Don't use GST_PLUGIN_DEFINE_STATIC, it's not portable and will be + deprecated in the future (see #498924). + 2007-12-21 Tim-Philipp Müller * gst/playback/gststreamselector.c: (gst_selector_pad_event): diff --git a/tests/check/elements/playbin.c b/tests/check/elements/playbin.c index d9978bb751..df7b782b15 100644 --- a/tests/check/elements/playbin.c +++ b/tests/check/elements/playbin.c @@ -28,6 +28,9 @@ #ifndef GST_DISABLE_REGISTRY +static GType gst_red_video_src_get_type (void); +static GType gst_codec_src_get_type (void); + #define DEFINE_TEST(func) \ static void func (void); \ \ @@ -47,6 +50,9 @@ DEFINE_TEST (test_sink_usage_video_only_stream) GstElement *playbin, *fakevideosink, *fakeaudiosink; GstState cur_state, pending_state; + fail_unless (gst_element_register (NULL, "redvideosrc", GST_RANK_PRIMARY, + gst_red_video_src_get_type ())); + playbin = gst_element_factory_make ("playbin", "playbin"); fail_unless (playbin != NULL, "Failed to create playbin element"); @@ -96,6 +102,9 @@ DEFINE_TEST (test_suburi_error_unknowntype) { GstElement *playbin, *fakesink; + fail_unless (gst_element_register (NULL, "redvideosrc", GST_RANK_PRIMARY, + gst_red_video_src_get_type ())); + playbin = gst_element_factory_make ("playbin", "playbin"); fail_unless (playbin != NULL, "Failed to create playbin element"); @@ -127,6 +136,9 @@ DEFINE_TEST (test_suburi_error_invalidfile) { GstElement *playbin, *fakesink; + fail_unless (gst_element_register (NULL, "redvideosrc", GST_RANK_PRIMARY, + gst_red_video_src_get_type ())); + playbin = gst_element_factory_make ("playbin", "playbin"); fail_unless (playbin != NULL, "Failed to create playbin element"); @@ -157,6 +169,9 @@ DEFINE_TEST (test_suburi_error_wrongproto) { GstElement *playbin, *fakesink; + fail_unless (gst_element_register (NULL, "redvideosrc", GST_RANK_PRIMARY, + gst_red_video_src_get_type ())); + playbin = gst_element_factory_make ("playbin", "playbin"); fail_unless (playbin != NULL, "Failed to create playbin element"); @@ -319,6 +334,9 @@ DEFINE_TEST (test_missing_primary_decoder) GError *err = NULL; GstBus *bus; + fail_unless (gst_element_register (NULL, "codecsrc", GST_RANK_PRIMARY, + gst_codec_src_get_type ())); + playbin = create_playbin ("codec://"); fail_unless_equals_int (gst_element_set_state (playbin, GST_STATE_READY), @@ -570,27 +588,6 @@ gst_codec_src_init (GstCodecSrc * src, GstCodecSrcClass * klass) { } -static gboolean -plugin_init (GstPlugin * plugin) -{ - if (!gst_element_register (plugin, "redvideosrc", GST_RANK_PRIMARY, - gst_red_video_src_get_type ())) { - return FALSE; - } - if (!gst_element_register (plugin, "codecsrc", GST_RANK_PRIMARY, - gst_codec_src_get_type ())) { - return FALSE; - } - return TRUE; -} - -GST_PLUGIN_DEFINE_STATIC - (GST_VERSION_MAJOR, - GST_VERSION_MINOR, - "playbin-test-elements", - "static elements for the playbin unit test", - plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN); - #endif /* GST_DISABLE_REGISTRY */ diff --git a/tests/check/libs/cddabasesrc.c b/tests/check/libs/cddabasesrc.c index 8173c5092a..0daf49965c 100644 --- a/tests/check/libs/cddabasesrc.c +++ b/tests/check/libs/cddabasesrc.c @@ -270,28 +270,14 @@ gst_cd_foo_src_read_sector (GstCddaBaseSrc * cddabasesrc, gint sector) return buf; } -static gboolean -plugin_init (GstPlugin * plugin) -{ - if (!gst_element_register (plugin, "cdfoosrc", GST_RANK_SECONDARY, - GST_TYPE_CD_FOO_SRC)) - return FALSE; - - return TRUE; -} - - -GST_PLUGIN_DEFINE_STATIC (GST_VERSION_MAJOR, - GST_VERSION_MINOR, - "cdfoosrc", - "Read audio from CD", - plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN); - GST_START_TEST (test_discid_calculations) { GstElement *foosrc; gint i; + fail_unless (gst_element_register (NULL, "cdfoosrc", GST_RANK_SECONDARY, + GST_TYPE_CD_FOO_SRC)); + foosrc = gst_element_factory_make ("cdfoosrc", "cdfoosrc"); for (i = 0; i < G_N_ELEMENTS (test_discs); ++i) { @@ -316,6 +302,9 @@ GST_START_TEST (test_buffer_timestamps) GstPad *sinkpad; gint i; + fail_unless (gst_element_register (NULL, "cdfoosrc", GST_RANK_SECONDARY, + GST_TYPE_CD_FOO_SRC)); + pipeline = gst_pipeline_new ("pipeline"); foosrc = gst_element_factory_make ("cdfoosrc", "cdfoosrc"); fakesink = gst_element_factory_make ("fakesink", "fakesink"); @@ -372,19 +361,4 @@ cddabasesrc_suite (void) return s; } -int -main (int argc, char **argv) -{ - int nf; - - Suite *s = cddabasesrc_suite (); - SRunner *sr = srunner_create (s); - - gst_check_init (&argc, &argv); - - srunner_run_all (sr, CK_NORMAL); - nf = srunner_ntests_failed (sr); - srunner_free (sr); - - return nf; -} +GST_CHECK_MAIN (cddabasesrc)