diff options
author | Thomas Vander Stichele <thomas@apestaart.org> | 2005-09-23 11:41:30 +0000 |
---|---|---|
committer | Thomas Vander Stichele <thomas@apestaart.org> | 2005-09-23 11:41:30 +0000 |
commit | 6570aadc78d403f27aeb8f13d819628ade443860 (patch) | |
tree | a99a5fd46c63c806d341e1d5e7c6eb4f2107d823 /testsuite/states | |
parent | 62d1f4c8cae5b0602a87a995670f8b80cca046a9 (diff) |
put back source in registry. add checks for find_plugin.
Original commit message from CVS:
* check/gst/.cvsignore:
* check/gst/gstplugin.c: (GST_START_TEST), (gst_plugin_suite):
* gst/gstregistryxml.c: (load_plugin),
(gst_registry_xml_save_plugin):
put back source in registry. add checks for find_plugin.
* testsuite/states/bin.c: (assert_state), (empty_bin),
(test_adding_one_element), (main):
* testsuite/states/locked.c: (main):
some compile/run fixes
Diffstat (limited to 'testsuite/states')
-rw-r--r-- | testsuite/states/bin.c | 24 | ||||
-rw-r--r-- | testsuite/states/locked.c | 3 |
2 files changed, 16 insertions, 11 deletions
diff --git a/testsuite/states/bin.c b/testsuite/states/bin.c index efcc727cb..44af618d9 100644 --- a/testsuite/states/bin.c +++ b/testsuite/states/bin.c @@ -26,7 +26,10 @@ static void assert_state (GstElement * element, GstState state) { - if (gst_element_get_state (element) != state) { + GstState current, pending; + + gst_element_get_state (element, ¤t, &pending, NULL); + if (current != state) { g_printerr ("%s: state is %s instead of %s", GST_OBJECT_NAME (element), gst_element_state_get_name (GST_STATE (element)), @@ -59,15 +62,16 @@ empty_bin (gchar * bin_name) * GST_STATE_CHANGE_ASYNC */ GstElement *bin = gst_element_factory_make (bin_name, NULL); + g_assert (bin); /* obvious */ assert_state (bin, GST_STATE_NULL); /* see above */ - assert_state_change (bin, GST_STATE_READY, GST_STATE_CHANGE_ASYNC, - GST_STATE_NULL); - assert_state_change (bin, GST_STATE_PAUSED, GST_STATE_CHANGE_ASYNC, - GST_STATE_NULL); - assert_state_change (bin, GST_STATE_PLAYING, GST_STATE_CHANGE_ASYNC, - GST_STATE_NULL); + assert_state_change (bin, GST_STATE_READY, GST_STATE_CHANGE_SUCCESS, + GST_STATE_READY); + assert_state_change (bin, GST_STATE_PAUSED, GST_STATE_CHANGE_SUCCESS, + GST_STATE_PAUSED); + assert_state_change (bin, GST_STATE_PLAYING, GST_STATE_CHANGE_SUCCESS, + GST_STATE_PLAYING); } static void @@ -79,9 +83,10 @@ test_adding_one_element (GstElement * bin) GST_STATE_PLAYING, GST_STATE_PAUSED, GST_STATE_READY, GST_STATE_NULL }; GstElement *test = gst_element_factory_make ("identity", NULL); - GstState bin_state = gst_element_get_state (bin); + GstState bin_state; gint i; + gst_element_get_state (bin, &bin_state, NULL, NULL); g_assert (test); gst_object_ref (test); assert_state (test, GST_STATE_NULL); @@ -142,12 +147,11 @@ main (gint argc, gchar * argv[]) /* test behaviour of empty bins */ empty_bin ("bin"); - empty_bin ("thread"); empty_bin ("pipeline"); + g_print ("how far\n"); /* test behaviour of adding/removing elements to/from all core bin types */ test_element_in_bin ("bin"); - test_element_in_bin ("thread"); test_element_in_bin ("pipeline"); return 0; diff --git a/testsuite/states/locked.c b/testsuite/states/locked.c index 94ee30cfb..899ce63fd 100644 --- a/testsuite/states/locked.c +++ b/testsuite/states/locked.c @@ -52,7 +52,8 @@ main (gint argc, gchar * argv[]) loop = g_main_loop_new (NULL, FALSE); bus = gst_element_get_bus (pipeline); - gst_bus_add_watch (bus, (GstBusHandler) message_received, pipeline); + gst_bus_add_watch (bus, GST_MESSAGE_EOS, (GstBusFunc) message_received, + (gpointer) pipeline); gst_object_unref (bus); fakesrc1 = gst_element_factory_make ("fakesrc", "fakesrc1"); |