From 494dc46f172ea0ee22c34b62d6d4a21c3e07eea8 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Wed, 16 Nov 2005 18:19:11 +0000 Subject: [PATCH] check/generic/states.c: fix the test so that it only checks for elements that are part of this source module Original commit message from CVS: * check/generic/states.c: (GST_START_TEST): fix the test so that it only checks for elements that are part of this source module --- ChangeLog | 6 ++++ check/generic/states.c | 64 +++++++++++++++++++++++------------- common | 2 +- tests/check/generic/states.c | 64 +++++++++++++++++++++++------------- 4 files changed, 91 insertions(+), 45 deletions(-) diff --git a/ChangeLog b/ChangeLog index 88a60b5086..8f467cb90c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-11-16 Thomas Vander Stichele + + * check/generic/states.c: (GST_START_TEST): + fix the test so that it only checks for elements that are part of + this source module + 2005-11-16 Michael Smith * ext/ogg/gstoggmux.c: (gst_ogg_mux_clear), (gst_ogg_mux_reset), diff --git a/check/generic/states.c b/check/generic/states.c index 6b2540f401..8739d5eedb 100644 --- a/check/generic/states.c +++ b/check/generic/states.c @@ -20,6 +20,10 @@ * Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include #include @@ -28,32 +32,48 @@ GST_START_TEST (test_state_changes) { GstElement *element; GList *features, *f; + GList *plugins, *p; - features = gst_registry_get_feature_list (gst_registry_get_default (), - GST_TYPE_ELEMENT_FACTORY); + GST_DEBUG ("testing elements from source %s", PACKAGE); - for (f = features; f; f = f->next) { - GstPluginFeature *feature = f->data; - const gchar *name = gst_plugin_feature_get_name (feature); + plugins = gst_registry_get_plugin_list (gst_registry_get_default ()); - GST_DEBUG ("testing element %s", name); - element = gst_element_factory_make (name, name); - if (GST_IS_PIPELINE (element)) { - GST_DEBUG ("element %s is a pipeline", name); + for (p = plugins; p; p = p->next) { + GstPlugin *plugin = p->data; + + if (strcmp (gst_plugin_get_source (plugin), PACKAGE) != 0) + continue; + + features = + gst_registry_get_feature_list_by_plugin (gst_registry_get_default (), + gst_plugin_get_name (plugin)); + + for (f = features; f; f = f->next) { + GstPluginFeature *feature = f->data; + const gchar *name = gst_plugin_feature_get_name (feature); + + if (!GST_IS_ELEMENT_FACTORY (feature)) + continue; + + GST_DEBUG ("testing element %s", name); + element = gst_element_factory_make (name, name); + if (GST_IS_PIPELINE (element)) { + GST_DEBUG ("element %s is a pipeline", name); + } + + gst_element_set_state (element, GST_STATE_READY); + gst_element_set_state (element, GST_STATE_PAUSED); + gst_element_set_state (element, GST_STATE_PLAYING); + gst_element_set_state (element, GST_STATE_PAUSED); + gst_element_set_state (element, GST_STATE_READY); + gst_element_set_state (element, GST_STATE_NULL); + gst_element_set_state (element, GST_STATE_PAUSED); + gst_element_set_state (element, GST_STATE_READY); + gst_element_set_state (element, GST_STATE_PLAYING); + gst_element_set_state (element, GST_STATE_PAUSED); + gst_element_set_state (element, GST_STATE_NULL); + gst_object_unref (GST_OBJECT (element)); } - - gst_element_set_state (element, GST_STATE_READY); - gst_element_set_state (element, GST_STATE_PAUSED); - gst_element_set_state (element, GST_STATE_PLAYING); - gst_element_set_state (element, GST_STATE_PAUSED); - gst_element_set_state (element, GST_STATE_READY); - gst_element_set_state (element, GST_STATE_NULL); - gst_element_set_state (element, GST_STATE_PAUSED); - gst_element_set_state (element, GST_STATE_READY); - gst_element_set_state (element, GST_STATE_PLAYING); - gst_element_set_state (element, GST_STATE_PAUSED); - gst_element_set_state (element, GST_STATE_NULL); - gst_object_unref (GST_OBJECT (element)); } } diff --git a/common b/common index 3aa0adc0cc..ea1409191c 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 3aa0adc0cc4539ec9bb62ccf6d535240dad19e58 +Subproject commit ea1409191cc1e71273b2dbdd94e7ab5fc5a60a51 diff --git a/tests/check/generic/states.c b/tests/check/generic/states.c index 6b2540f401..8739d5eedb 100644 --- a/tests/check/generic/states.c +++ b/tests/check/generic/states.c @@ -20,6 +20,10 @@ * Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include #include @@ -28,32 +32,48 @@ GST_START_TEST (test_state_changes) { GstElement *element; GList *features, *f; + GList *plugins, *p; - features = gst_registry_get_feature_list (gst_registry_get_default (), - GST_TYPE_ELEMENT_FACTORY); + GST_DEBUG ("testing elements from source %s", PACKAGE); - for (f = features; f; f = f->next) { - GstPluginFeature *feature = f->data; - const gchar *name = gst_plugin_feature_get_name (feature); + plugins = gst_registry_get_plugin_list (gst_registry_get_default ()); - GST_DEBUG ("testing element %s", name); - element = gst_element_factory_make (name, name); - if (GST_IS_PIPELINE (element)) { - GST_DEBUG ("element %s is a pipeline", name); + for (p = plugins; p; p = p->next) { + GstPlugin *plugin = p->data; + + if (strcmp (gst_plugin_get_source (plugin), PACKAGE) != 0) + continue; + + features = + gst_registry_get_feature_list_by_plugin (gst_registry_get_default (), + gst_plugin_get_name (plugin)); + + for (f = features; f; f = f->next) { + GstPluginFeature *feature = f->data; + const gchar *name = gst_plugin_feature_get_name (feature); + + if (!GST_IS_ELEMENT_FACTORY (feature)) + continue; + + GST_DEBUG ("testing element %s", name); + element = gst_element_factory_make (name, name); + if (GST_IS_PIPELINE (element)) { + GST_DEBUG ("element %s is a pipeline", name); + } + + gst_element_set_state (element, GST_STATE_READY); + gst_element_set_state (element, GST_STATE_PAUSED); + gst_element_set_state (element, GST_STATE_PLAYING); + gst_element_set_state (element, GST_STATE_PAUSED); + gst_element_set_state (element, GST_STATE_READY); + gst_element_set_state (element, GST_STATE_NULL); + gst_element_set_state (element, GST_STATE_PAUSED); + gst_element_set_state (element, GST_STATE_READY); + gst_element_set_state (element, GST_STATE_PLAYING); + gst_element_set_state (element, GST_STATE_PAUSED); + gst_element_set_state (element, GST_STATE_NULL); + gst_object_unref (GST_OBJECT (element)); } - - gst_element_set_state (element, GST_STATE_READY); - gst_element_set_state (element, GST_STATE_PAUSED); - gst_element_set_state (element, GST_STATE_PLAYING); - gst_element_set_state (element, GST_STATE_PAUSED); - gst_element_set_state (element, GST_STATE_READY); - gst_element_set_state (element, GST_STATE_NULL); - gst_element_set_state (element, GST_STATE_PAUSED); - gst_element_set_state (element, GST_STATE_READY); - gst_element_set_state (element, GST_STATE_PLAYING); - gst_element_set_state (element, GST_STATE_PAUSED); - gst_element_set_state (element, GST_STATE_NULL); - gst_object_unref (GST_OBJECT (element)); } }