+2005-08-24 Thomas Vander Stichele <thomas at apestaart dot org>
+
+ * check/Makefile.am:
+ * check/generic/states.c: (GST_START_TEST), (states_suite), (main):
+ add a test that does a bunch of state changes on elements
+ needs some fixing for valgrind
+ * check/states/sinks.c: (gst_object_suite):
+ whitespace
+ * gst/gstcaps.h:
+ add prototype for gst_caps_is_equal_fixed
+ * gst/gstplugin.c:
+ * gst/gstregistrypool.c:
+ doc fixes
+
2005-08-24 Andy Wingo <wingo@pobox.com>
* gst/gstquery.c (gst_query_new_convert): Spew if we try to
pipelines/simple_launch_lines \
pipelines/cleanup \
states/sinks \
+ generic/states \
gst-libs/controller \
gst-libs/gdp
# valgrind testing
# these just need valgrind fixing, period
TESTS_TO_FIX = \
+ generic/states \
gst-libs/controller \
pipelines/cleanup \
pipelines/simple_launch_lines
--- /dev/null
+/* GStreamer
+ *
+ * unit test for state changes on all elements
+ *
+ * Copyright (C) <2005> Thomas Vander Stichele <thomas at apestaart dot org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <unistd.h>
+
+#include <gst/check/gstcheck.h>
+
+GST_START_TEST (test_state_changes)
+{
+ GstElement *element;
+ GList *features, *f;
+
+ features = gst_registry_pool_feature_list (GST_TYPE_ELEMENT_FACTORY);
+
+ for (f = features; f; f = f->next) {
+ GstPluginFeature *feature = f->data;
+ const gchar *name = gst_plugin_feature_get_name (feature);
+
+ GST_DEBUG ("testing element %s", name);
+ element = gst_element_factory_make (name, 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;
+
+Suite *
+states_suite (void)
+{
+ Suite *s = suite_create ("states");
+ TCase *tc_chain = tcase_create ("general");
+
+ suite_add_tcase (s, tc_chain);
+ tcase_add_test (tc_chain, test_state_changes);
+
+ return s;
+}
+
+int
+main (int argc, char **argv)
+{
+ int nf;
+
+ Suite *s = states_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;
+}
fail_unless (pending == GST_STATE_VOID_PENDING, "not playing");
}
-GST_END_TEST
+GST_END_TEST;
+
+
/* test: try changing state of sinks */
- Suite * gst_object_suite (void)
+Suite *
+gst_object_suite (void)
{
Suite *s = suite_create ("Sinks");
TCase *tc_chain = tcase_create ("general");
- /* turn off timeout */
- tcase_set_timeout (tc_chain, 60);
-
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_sink);
tcase_add_test (tc_chain, test_src_sink);
const GstCaps *superset);
gboolean gst_caps_is_equal (const GstCaps *caps1,
const GstCaps *caps2);
+gboolean gst_caps_is_equal_fixed (const GstCaps * caps1,
+ const GstCaps * caps2);
+
/* operations */
GstCaps * gst_caps_intersect (const GstCaps *caps1,
* @user_data: user data passed to the filter function
*
* Runs a filter against all plugin features and returns a GList with
- * the results. If the first flag is set, only the first match is
+ * the results. If the first flag is set, only the first match is
* returned (as a list with a single object).
*
* Returns: a GList of features, g_list_free after use.
}
/**
- * gst_plugin_list_feature_list:
- * @list: a list of plugins to query
- * @filter: the filter to use
+ * gst_plugin_list_feature_filter:
+ * @list: a #GList of plugins to query
+ * @filter: the filter function to use
* @first: only return first match
* @user_data: user data passed to the filter function
*
* Runs a filter against all plugin features of the plugins in the given
- * list and returns a GList with the results.
- * If the first flag is set, only the first match is
+ * list and returns a GList with the results.
+ * If the first flag is set, only the first match is
* returned (as a list with a single object).
*
* Returns: a GList of features, g_list_free after use.
* 2000 Wim Taymans <wtay@chello.be>
*
* gstregistry.c: handle registry
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* gst_registry_pool_plugin_list:
*
* Get a list of all plugins in the pool.
- *
- * Returns: a GList of plugins, g_list_free after use.
+ *
+ * Returns: a newly allocated GList of #GstPlugin.
*/
GList *
gst_registry_pool_plugin_list (void)
* @user_data: user data passed to the filter function
*
* Runs a filter against all plugins in all registries and returns a GList with
- * the results. If the first flag is set, only the first match is
+ * the results. If the first flag is set, only the first match is
* returned (as a list with a single object).
*
- * Returns: a GList of plugins, g_list_free after use.
+ * Returns: a newly allocated GList of #GstPlugin.
*/
GList *
gst_registry_pool_plugin_filter (GstPluginFilter filter, gboolean first,
* @type: the type of the features to list.
*
* Get a list of all pluginfeatures of the given type in the pool.
- *
- * Returns: a GList of pluginfeatures, g_list_free after use.
+ *
+ * Returns: a newly allocated #GList of #GstPluginFeature.
*/
GList *
gst_registry_pool_feature_list (GType type)
pipelines/simple_launch_lines \
pipelines/cleanup \
states/sinks \
+ generic/states \
gst-libs/controller \
gst-libs/gdp
# valgrind testing
# these just need valgrind fixing, period
TESTS_TO_FIX = \
+ generic/states \
gst-libs/controller \
pipelines/cleanup \
pipelines/simple_launch_lines
fail_unless (pending == GST_STATE_VOID_PENDING, "not playing");
}
-GST_END_TEST
+GST_END_TEST;
+
+
/* test: try changing state of sinks */
- Suite * gst_object_suite (void)
+Suite *
+gst_object_suite (void)
{
Suite *s = suite_create ("Sinks");
TCase *tc_chain = tcase_create ("general");
- /* turn off timeout */
- tcase_set_timeout (tc_chain, 60);
-
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_sink);
tcase_add_test (tc_chain, test_src_sink);
--- /dev/null
+/* GStreamer
+ *
+ * unit test for state changes on all elements
+ *
+ * Copyright (C) <2005> Thomas Vander Stichele <thomas at apestaart dot org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <unistd.h>
+
+#include <gst/check/gstcheck.h>
+
+GST_START_TEST (test_state_changes)
+{
+ GstElement *element;
+ GList *features, *f;
+
+ features = gst_registry_pool_feature_list (GST_TYPE_ELEMENT_FACTORY);
+
+ for (f = features; f; f = f->next) {
+ GstPluginFeature *feature = f->data;
+ const gchar *name = gst_plugin_feature_get_name (feature);
+
+ GST_DEBUG ("testing element %s", name);
+ element = gst_element_factory_make (name, 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;
+
+Suite *
+states_suite (void)
+{
+ Suite *s = suite_create ("states");
+ TCase *tc_chain = tcase_create ("general");
+
+ suite_add_tcase (s, tc_chain);
+ tcase_add_test (tc_chain, test_state_changes);
+
+ return s;
+}
+
+int
+main (int argc, char **argv)
+{
+ int nf;
+
+ Suite *s = states_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;
+}