Commit 5850d560 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller

tests/check/: Don't use GST_PLUGIN_DEFINE_STATIC, it's not portable and will...

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).
parent 032e0645
2007-12-21 Tim-Philipp Müller <tim at centricular dot net>
* 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 <tim at centricular dot net>
* gst/playback/gststreamselector.c: (gst_selector_pad_event):
......@@ -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 */
......
......@@ -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)
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