diff options
author | Edward Hervey <edward.hervey@collabora.co.uk> | 2011-01-31 16:05:34 +0100 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2011-02-09 11:01:15 +0100 |
commit | 1c91a255a57653b5964469c786ff4094818292fd (patch) | |
tree | 8b269a5f77357cd6427ac7023fdc364177561193 | |
parent | 07767da07a7f26b77bae2d73d59875e23f4b8037 (diff) |
check: More debugging and state checking
-rw-r--r-- | tests/check/gnl/gnlcomposition.c | 6 | ||||
-rw-r--r-- | tests/check/gnl/gnloperation.c | 24 |
2 files changed, 27 insertions, 3 deletions
diff --git a/tests/check/gnl/gnlcomposition.c b/tests/check/gnl/gnlcomposition.c index 7115a8d..cb91a0f 100644 --- a/tests/check/gnl/gnlcomposition.c +++ b/tests/check/gnl/gnlcomposition.c @@ -363,14 +363,18 @@ GST_START_TEST (test_no_more_pads_race) gst_bin_add (GST_BIN (composition), source1); g_object_connect (composition, "signal::pad-added", on_composition_pad_added_cb, fakesink, NULL); g_object_connect (composition, "signal::pad-removed", on_composition_pad_removed_cb, NULL, NULL); + GST_DEBUG ("Adding composition to pipeline"); + gst_bin_add_many (GST_BIN (pipeline), composition, fakesink, NULL); + GST_DEBUG ("Setting pipeline to PAUSED"); + fail_if (gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PAUSED) == GST_STATE_CHANGE_FAILURE); message = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ASYNC_DONE | GST_MESSAGE_ERROR); if (GST_MESSAGE_TYPE (message) == GST_MESSAGE_ERROR) { @@ -379,12 +383,14 @@ GST_START_TEST (test_no_more_pads_race) gst_message_parse_error (message, &error, &debug); fail_if (TRUE, "error: %s - %s", error->message, debug); } gst_message_unref (message); + GST_DEBUG ("Adding second source"); + /* FIXME: maybe slow down the videotestsrc steaming thread */ gst_bin_add (GST_BIN (composition), source2); message = gst_bus_timed_pop_filtered (bus, 1 * GST_SECOND, GST_MESSAGE_ERROR); if (message) { if (GST_MESSAGE_TYPE (message) == GST_MESSAGE_ERROR) { diff --git a/tests/check/gnl/gnloperation.c b/tests/check/gnl/gnloperation.c index ec6ce89..25d25cd 100644 --- a/tests/check/gnl/gnloperation.c +++ b/tests/check/gnl/gnloperation.c @@ -13,12 +13,20 @@ GST_START_TEST (test_simple_operation) GstPad *sinkpad; pipeline = gst_pipeline_new ("test_pipeline"); comp = gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); + /* TOPOLOGY + * + * 0 1 2 3 4 5 | Priority + * ---------------------------------------------------------------------------- + * [-- oper --] | 0 + * [------------- source -------------] | 1 + * */ + /* source Start : 0s Duration : 3s Priority : 1 */ @@ -1019,21 +1027,26 @@ GST_START_TEST (test_complex_operations) break; } gst_mini_object_unref (GST_MINI_OBJECT (message)); } } - GST_DEBUG ("Setting pipeline to NULL"); + GST_DEBUG ("Setting pipeline to READY"); fail_if (gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_READY) == GST_STATE_CHANGE_FAILURE); fail_if (collect->expected_segments != NULL); GST_DEBUG ("Resetted pipeline to READY"); + /* Elements should all be in the READY state */ + check_state_simple (source1, GST_STATE_READY); + check_state_simple (source2, GST_STATE_READY); + check_state_simple (oper, GST_STATE_READY); + /* Expected segments */ collect->expected_segments = g_list_append (collect->expected_segments, segment_new (1.0, GST_FORMAT_TIME, 0, 2 * GST_SECOND, 0)); collect->expected_segments = g_list_append (collect->expected_segments, segment_new (1.0, GST_FORMAT_TIME, 0 * GST_SECOND, 2 * GST_SECOND, 2 * GST_SECOND)); @@ -1252,20 +1265,25 @@ GST_START_TEST (test_complex_operations_bis) break; } gst_mini_object_unref (GST_MINI_OBJECT (message)); } } - GST_DEBUG ("Setting pipeline to NULL"); + GST_DEBUG ("Setting pipeline to READY"); fail_if (gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_READY) == GST_STATE_CHANGE_FAILURE); fail_if (collect->expected_segments != NULL); - GST_DEBUG ("Resetted pipeline to READY"); + GST_DEBUG ("Resetted pipeline to READY, checking state of elements"); + + /* Elements should all be in the READY state */ + check_state_simple (source1, GST_STATE_READY); + check_state_simple (source2, GST_STATE_READY); + check_state_simple (oper, GST_STATE_READY); /* Expected segments */ collect->expected_segments = g_list_append (collect->expected_segments, segment_new (1.0, GST_FORMAT_TIME, 0, 2 * GST_SECOND, 0)); collect->expected_segments = g_list_append (collect->expected_segments, segment_new (1.0, GST_FORMAT_TIME, |