summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 79020de)
raw | patch | inline | side by side (parent: 79020de)
author | Stefan Kost <ensonic@users.sourceforge.net> | |
Thu, 20 Sep 2007 11:47:52 +0000 (11:47 +0000) | ||
committer | Stefan Kost <ensonic@users.sourceforge.net> | |
Thu, 20 Sep 2007 11:47:52 +0000 (11:47 +0000) |
Original commit message from CVS:
* gst/iec958/ac3iec.c:
Chainup in finalize.
* tests/check/Makefile.am:
* tests/check/generic/states.c:
Improved state change unit test.
* gst/iec958/ac3iec.c:
Chainup in finalize.
* tests/check/Makefile.am:
* tests/check/generic/states.c:
Improved state change unit test.
ChangeLog | patch | blob | history | |
gst/iec958/ac3iec.c | patch | blob | history | |
tests/check/Makefile.am | patch | blob | history | |
tests/check/generic/states.c | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index 4937ba2bae7fc9237d4462dc060751f0e070cc1f..3edea5d8eac376a54b2c93a7608513ce4fed0324 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2007-09-20 Stefan Kost <ensonic@users.sf.net>
+
+ * gst/iec958/ac3iec.c:
+ Chainup in finalize.
+
+ * tests/check/Makefile.am:
+ * tests/check/generic/states.c:
+ Improved state change unit test.
+
2007-09-19 Stefan Kost <ensonic@users.sf.net>
* docs/plugins/.cvsignore:
diff --git a/gst/iec958/ac3iec.c b/gst/iec958/ac3iec.c
index 921cd1ae532a493f7bb2cb1ed5473f22e88700ce..716a56ec563b8f70811e87ef727da34651a2e5c1 100644 (file)
--- a/gst/iec958/ac3iec.c
+++ b/gst/iec958/ac3iec.c
AC3IEC *ac3iec = AC3IEC (object);
g_free (ac3iec->padder);
+
+ G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
index 07faf440151a4a5469f3355239add37aef19e6e9..14e0029dd2d3865c6648e6e9df21eece9acb2b63 100644 (file)
--- a/tests/check/Makefile.am
+++ b/tests/check/Makefile.am
include $(top_srcdir)/common/check.mak
-CHECK_REGISTRY = $(top_builddir)/tests/check/test-registry.xml
+CHECK_REGISTRY = $(top_builddir)/tests/check/test-registry.reg
REGISTRY_ENVIRONMENT = \
GST_REGISTRY=$(CHECK_REGISTRY)
TESTS_ENVIRONMENT = \
$(REGISTRY_ENVIRONMENT) \
GST_PLUGIN_SYSTEM_PATH= \
- GST_PLUGIN_PATH=$(top_builddir)/gst:$(top_builddir)/ext:$(GST_PLUGINS_DIR)
+ GST_PLUGIN_PATH=$(top_builddir)/gst:$(top_builddir)/ext:$(GST_PLUGINS_DIR) \
+ STATE_IGNORE_ELEMENTS="siddec"
# ths core dumps of some machines have PIDs appended
-CLEANFILES = core.* test-registry.xml
+CLEANFILES = core.* test-registry.*
clean-local: clean-local-check
index c13f3dd7dc391fa7b468fef87e58bea1abd16987..62f557a8e6436b771d2023640be0c904c1837773 100644 (file)
#include <gst/check/gstcheck.h>
-GST_START_TEST (test_state_changes)
+static GList *elements = NULL;
+
+static void
+setup ()
{
- GstElement *element;
GList *features, *f;
GList *plugins, *p;
gchar **ignorelist = NULL;
const gchar *STATE_IGNORE_ELEMENTS = NULL;
- GST_DEBUG ("testing elements from source %s", PACKAGE);
+ GST_DEBUG ("getting elements for package %s", PACKAGE);
STATE_IGNORE_ELEMENTS = g_getenv ("STATE_IGNORE_ELEMENTS");
if (STATE_IGNORE_ELEMENTS) {
GST_DEBUG ("Will ignore element factories: '%s'", STATE_IGNORE_ELEMENTS);
continue;
}
- GST_DEBUG ("testing element %s", name);
- element = gst_element_factory_make (name, name);
- fail_if (element == NULL, "Could not make element from factory %s", 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_DEBUG ("adding element %s", name);
+ elements = g_list_prepend (elements, (gpointer) g_strdup (name));
}
gst_plugin_feature_list_free (features);
}
g_strfreev (ignorelist);
}
+static void
+teardown ()
+{
+ GList *e;
+
+ for (e = elements; e; e = e->next) {
+ g_free (e->data);
+ }
+ g_list_free (elements);
+ elements = NULL;
+}
+
+
+GST_START_TEST (test_state_changes_up_and_down_seq)
+{
+ GstElement *element;
+ GList *e;
+
+ for (e = elements; e; e = e->next) {
+ const gchar *name = e->data;
+
+ GST_INFO ("testing element %s", name);
+ element = gst_element_factory_make (name, name);
+ fail_if (element == NULL, "Could not make element from factory %s", 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_END_TEST;
+
+GST_START_TEST (test_state_changes_up_seq)
+{
+ GstElement *element;
+ GList *e;
+
+ for (e = elements; e; e = e->next) {
+ const gchar *name = e->data;
+
+ GST_INFO ("testing element %s", name);
+ element = gst_element_factory_make (name, name);
+ fail_if (element == NULL, "Could not make element from factory %s", 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_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_object_unref (GST_OBJECT (element));
+ }
+}
+
+GST_END_TEST;
+
+GST_START_TEST (test_state_changes_down_seq)
+{
+ GstElement *element;
+ GList *e;
+
+ for (e = elements; e; e = e->next) {
+ const gchar *name = e->data;
+
+ GST_INFO ("testing element %s", name);
+ element = gst_element_factory_make (name, name);
+ fail_if (element == NULL, "Could not make element from factory %s", 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_PLAYING);
+
+ gst_element_set_state (element, GST_STATE_PAUSED);
+ 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_object_unref (GST_OBJECT (element));
+ }
+}
+
GST_END_TEST;
Suite *
TCase *tc_chain = tcase_create ("general");
suite_add_tcase (s, tc_chain);
- tcase_add_test (tc_chain, test_state_changes);
+ tcase_add_checked_fixture (tc_chain, setup, teardown);
+ tcase_add_test (tc_chain, test_state_changes_up_and_down_seq);
+ tcase_add_test (tc_chain, test_state_changes_up_seq);
+ tcase_add_test (tc_chain, test_state_changes_down_seq);
return s;
}