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>
* ext/ogg/gstoggmux.c: (gst_ogg_mux_clear), (gst_ogg_mux_reset),

View file

@ -20,6 +20,10 @@
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <unistd.h>
#include <gst/check/gstcheck.h>
@ -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));
}
}

2
common

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

View file

@ -20,6 +20,10 @@
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <unistd.h>
#include <gst/check/gstcheck.h>
@ -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));
}
}