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
This commit is contained in:
Thomas Vander Stichele 2005-11-16 18:19:11 +00:00
parent 77c0003ad8
commit 494dc46f17
4 changed files with 91 additions and 45 deletions

View file

@ -1,3 +1,9 @@
2005-11-16 Thomas Vander Stichele <thomas at apestaart dot org>
* 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 <msmith@fluendo.com> 2005-11-16 Michael Smith <msmith@fluendo.com>
* ext/ogg/gstoggmux.c: (gst_ogg_mux_clear), (gst_ogg_mux_reset), * ext/ogg/gstoggmux.c: (gst_ogg_mux_clear), (gst_ogg_mux_reset),

View file

@ -20,6 +20,10 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <unistd.h> #include <unistd.h>
#include <gst/check/gstcheck.h> #include <gst/check/gstcheck.h>
@ -28,14 +32,29 @@ GST_START_TEST (test_state_changes)
{ {
GstElement *element; GstElement *element;
GList *features, *f; GList *features, *f;
GList *plugins, *p;
features = gst_registry_get_feature_list (gst_registry_get_default (), GST_DEBUG ("testing elements from source %s", PACKAGE);
GST_TYPE_ELEMENT_FACTORY);
plugins = gst_registry_get_plugin_list (gst_registry_get_default ());
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) { for (f = features; f; f = f->next) {
GstPluginFeature *feature = f->data; GstPluginFeature *feature = f->data;
const gchar *name = gst_plugin_feature_get_name (feature); const gchar *name = gst_plugin_feature_get_name (feature);
if (!GST_IS_ELEMENT_FACTORY (feature))
continue;
GST_DEBUG ("testing element %s", name); GST_DEBUG ("testing element %s", name);
element = gst_element_factory_make (name, name); element = gst_element_factory_make (name, name);
if (GST_IS_PIPELINE (element)) { if (GST_IS_PIPELINE (element)) {
@ -55,6 +74,7 @@ GST_START_TEST (test_state_changes)
gst_element_set_state (element, GST_STATE_NULL); gst_element_set_state (element, GST_STATE_NULL);
gst_object_unref (GST_OBJECT (element)); gst_object_unref (GST_OBJECT (element));
} }
}
} }
GST_END_TEST; GST_END_TEST;

2
common

@ -1 +1 @@
Subproject commit 3aa0adc0cc4539ec9bb62ccf6d535240dad19e58 Subproject commit ea1409191cc1e71273b2dbdd94e7ab5fc5a60a51

View file

@ -20,6 +20,10 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <unistd.h> #include <unistd.h>
#include <gst/check/gstcheck.h> #include <gst/check/gstcheck.h>
@ -28,14 +32,29 @@ GST_START_TEST (test_state_changes)
{ {
GstElement *element; GstElement *element;
GList *features, *f; GList *features, *f;
GList *plugins, *p;
features = gst_registry_get_feature_list (gst_registry_get_default (), GST_DEBUG ("testing elements from source %s", PACKAGE);
GST_TYPE_ELEMENT_FACTORY);
plugins = gst_registry_get_plugin_list (gst_registry_get_default ());
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) { for (f = features; f; f = f->next) {
GstPluginFeature *feature = f->data; GstPluginFeature *feature = f->data;
const gchar *name = gst_plugin_feature_get_name (feature); const gchar *name = gst_plugin_feature_get_name (feature);
if (!GST_IS_ELEMENT_FACTORY (feature))
continue;
GST_DEBUG ("testing element %s", name); GST_DEBUG ("testing element %s", name);
element = gst_element_factory_make (name, name); element = gst_element_factory_make (name, name);
if (GST_IS_PIPELINE (element)) { if (GST_IS_PIPELINE (element)) {
@ -55,6 +74,7 @@ GST_START_TEST (test_state_changes)
gst_element_set_state (element, GST_STATE_NULL); gst_element_set_state (element, GST_STATE_NULL);
gst_object_unref (GST_OBJECT (element)); gst_object_unref (GST_OBJECT (element));
} }
}
} }
GST_END_TEST; GST_END_TEST;