mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 23:18:52 +00:00
codify design+behaviour in testsuite after discussion
Original commit message from CVS: codify design+behaviour in testsuite after discussion
This commit is contained in:
parent
361d0f2922
commit
0f69c8a186
3 changed files with 25 additions and 30 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2005-09-12 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
|
* check/gst/gstpipeline.c: (GST_START_TEST), (gst_pipeline_suite):
|
||||||
|
codify design+behaviour in testsuite after discussion
|
||||||
|
|
||||||
2005-09-12 Thomas Vander Stichele <thomas at apestaart dot org>
|
2005-09-12 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
* docs/gst/tmpl/gstelement.sgml:
|
* docs/gst/tmpl/gstelement.sgml:
|
||||||
|
|
|
@ -41,8 +41,7 @@ pop_messages (GstBus * bus, int count)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* FIXME: even though this is a pathological case, it would make sense
|
/* an empty pipeline can go to PLAYING in one go */
|
||||||
* to have it return ASYNC as well */
|
|
||||||
GST_START_TEST (test_async_state_change_empty)
|
GST_START_TEST (test_async_state_change_empty)
|
||||||
{
|
{
|
||||||
GstPipeline *pipeline;
|
GstPipeline *pipeline;
|
||||||
|
@ -51,18 +50,14 @@ GST_START_TEST (test_async_state_change_empty)
|
||||||
fail_unless (pipeline != NULL, "Could not create pipeline");
|
fail_unless (pipeline != NULL, "Could not create pipeline");
|
||||||
g_object_set (G_OBJECT (pipeline), "play-timeout", 0LL, NULL);
|
g_object_set (G_OBJECT (pipeline), "play-timeout", 0LL, NULL);
|
||||||
|
|
||||||
/*
|
|
||||||
fail_unless_equals_int (gst_element_set_state (GST_ELEMENT (pipeline),
|
fail_unless_equals_int (gst_element_set_state (GST_ELEMENT (pipeline),
|
||||||
GST_STATE_PLAYING), GST_STATE_CHANGE_ASYNC);
|
GST_STATE_PLAYING), GST_STATE_CHANGE_SUCCESS);
|
||||||
*/
|
|
||||||
|
|
||||||
gst_object_unref (pipeline);
|
gst_object_unref (pipeline);
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
/* FIXME: this is less of a pathological case, it would make sense
|
|
||||||
* to have it return ASYNC as well */
|
|
||||||
GST_START_TEST (test_async_state_change_fake_ready)
|
GST_START_TEST (test_async_state_change_fake_ready)
|
||||||
{
|
{
|
||||||
GstPipeline *pipeline;
|
GstPipeline *pipeline;
|
||||||
|
@ -78,10 +73,8 @@ GST_START_TEST (test_async_state_change_fake_ready)
|
||||||
gst_bin_add_many (GST_BIN (pipeline), src, sink, NULL);
|
gst_bin_add_many (GST_BIN (pipeline), src, sink, NULL);
|
||||||
gst_element_link (src, sink);
|
gst_element_link (src, sink);
|
||||||
|
|
||||||
/*
|
|
||||||
fail_unless_equals_int (gst_element_set_state (GST_ELEMENT (pipeline),
|
fail_unless_equals_int (gst_element_set_state (GST_ELEMENT (pipeline),
|
||||||
GST_STATE_READY), GST_STATE_CHANGE_ASYNC);
|
GST_STATE_READY), GST_STATE_CHANGE_SUCCESS);
|
||||||
*/
|
|
||||||
|
|
||||||
gst_object_unref (pipeline);
|
gst_object_unref (pipeline);
|
||||||
}
|
}
|
||||||
|
@ -89,13 +82,11 @@ GST_START_TEST (test_async_state_change_fake_ready)
|
||||||
GST_END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
GST_START_TEST (test_async_state_change_fake)
|
GST_START_TEST (test_async_state_change_fake)
|
||||||
{
|
{
|
||||||
GstPipeline *pipeline;
|
GstPipeline *pipeline;
|
||||||
GstElement *src, *sink;
|
GstElement *src, *sink;
|
||||||
GstBus *bus;
|
GstBus *bus;
|
||||||
GstMessageType type;
|
|
||||||
|
|
||||||
pipeline = GST_PIPELINE (gst_pipeline_new (NULL));
|
pipeline = GST_PIPELINE (gst_pipeline_new (NULL));
|
||||||
fail_unless (pipeline != NULL, "Could not create pipeline");
|
fail_unless (pipeline != NULL, "Could not create pipeline");
|
||||||
|
@ -112,10 +103,15 @@ GST_START_TEST (test_async_state_change_fake)
|
||||||
fail_unless_equals_int (gst_element_set_state (GST_ELEMENT (pipeline),
|
fail_unless_equals_int (gst_element_set_state (GST_ELEMENT (pipeline),
|
||||||
GST_STATE_PLAYING), GST_STATE_CHANGE_ASYNC);
|
GST_STATE_PLAYING), GST_STATE_CHANGE_ASYNC);
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/* FIXME: Wim is implementing a set_state_async, which will
|
||||||
|
* spawn a thread and make sure the pipeline gets to the
|
||||||
|
* requested final state, or errors out before */
|
||||||
gst_bin_watch_for_state_change (GST_BIN (pipeline));
|
gst_bin_watch_for_state_change (GST_BIN (pipeline));
|
||||||
|
|
||||||
while ((type = gst_bus_poll (bus, GST_MESSAGE_STATE_CHANGED, -1))) {
|
while ((type = gst_bus_poll (bus, GST_MESSAGE_STATE_CHANGED, -1))) {
|
||||||
GstMessage *message;
|
GstMessage *message;
|
||||||
|
GstMessageType type;
|
||||||
GstState old, new;
|
GstState old, new;
|
||||||
GstState state, pending;
|
GstState state, pending;
|
||||||
GstStateChange ret;
|
GstStateChange ret;
|
||||||
|
@ -133,11 +129,12 @@ GST_START_TEST (test_async_state_change_fake)
|
||||||
ret = gst_element_get_state (GST_ELEMENT (pipeline), &state, &pending,
|
ret = gst_element_get_state (GST_ELEMENT (pipeline), &state, &pending,
|
||||||
&timeval);
|
&timeval);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
gst_object_unref (pipeline);
|
gst_object_unref (pipeline);
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_END_TEST;
|
GST_END_TEST;
|
||||||
#endif
|
|
||||||
|
|
||||||
Suite *
|
Suite *
|
||||||
gst_pipeline_suite (void)
|
gst_pipeline_suite (void)
|
||||||
|
@ -148,9 +145,7 @@ gst_pipeline_suite (void)
|
||||||
suite_add_tcase (s, tc_chain);
|
suite_add_tcase (s, tc_chain);
|
||||||
tcase_add_test (tc_chain, test_async_state_change_empty);
|
tcase_add_test (tc_chain, test_async_state_change_empty);
|
||||||
tcase_add_test (tc_chain, test_async_state_change_fake_ready);
|
tcase_add_test (tc_chain, test_async_state_change_fake_ready);
|
||||||
#if 0
|
|
||||||
tcase_add_test (tc_chain, test_async_state_change_fake);
|
tcase_add_test (tc_chain, test_async_state_change_fake);
|
||||||
#endif
|
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,8 +41,7 @@ pop_messages (GstBus * bus, int count)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* FIXME: even though this is a pathological case, it would make sense
|
/* an empty pipeline can go to PLAYING in one go */
|
||||||
* to have it return ASYNC as well */
|
|
||||||
GST_START_TEST (test_async_state_change_empty)
|
GST_START_TEST (test_async_state_change_empty)
|
||||||
{
|
{
|
||||||
GstPipeline *pipeline;
|
GstPipeline *pipeline;
|
||||||
|
@ -51,18 +50,14 @@ GST_START_TEST (test_async_state_change_empty)
|
||||||
fail_unless (pipeline != NULL, "Could not create pipeline");
|
fail_unless (pipeline != NULL, "Could not create pipeline");
|
||||||
g_object_set (G_OBJECT (pipeline), "play-timeout", 0LL, NULL);
|
g_object_set (G_OBJECT (pipeline), "play-timeout", 0LL, NULL);
|
||||||
|
|
||||||
/*
|
|
||||||
fail_unless_equals_int (gst_element_set_state (GST_ELEMENT (pipeline),
|
fail_unless_equals_int (gst_element_set_state (GST_ELEMENT (pipeline),
|
||||||
GST_STATE_PLAYING), GST_STATE_CHANGE_ASYNC);
|
GST_STATE_PLAYING), GST_STATE_CHANGE_SUCCESS);
|
||||||
*/
|
|
||||||
|
|
||||||
gst_object_unref (pipeline);
|
gst_object_unref (pipeline);
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
/* FIXME: this is less of a pathological case, it would make sense
|
|
||||||
* to have it return ASYNC as well */
|
|
||||||
GST_START_TEST (test_async_state_change_fake_ready)
|
GST_START_TEST (test_async_state_change_fake_ready)
|
||||||
{
|
{
|
||||||
GstPipeline *pipeline;
|
GstPipeline *pipeline;
|
||||||
|
@ -78,10 +73,8 @@ GST_START_TEST (test_async_state_change_fake_ready)
|
||||||
gst_bin_add_many (GST_BIN (pipeline), src, sink, NULL);
|
gst_bin_add_many (GST_BIN (pipeline), src, sink, NULL);
|
||||||
gst_element_link (src, sink);
|
gst_element_link (src, sink);
|
||||||
|
|
||||||
/*
|
|
||||||
fail_unless_equals_int (gst_element_set_state (GST_ELEMENT (pipeline),
|
fail_unless_equals_int (gst_element_set_state (GST_ELEMENT (pipeline),
|
||||||
GST_STATE_READY), GST_STATE_CHANGE_ASYNC);
|
GST_STATE_READY), GST_STATE_CHANGE_SUCCESS);
|
||||||
*/
|
|
||||||
|
|
||||||
gst_object_unref (pipeline);
|
gst_object_unref (pipeline);
|
||||||
}
|
}
|
||||||
|
@ -89,13 +82,11 @@ GST_START_TEST (test_async_state_change_fake_ready)
|
||||||
GST_END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
GST_START_TEST (test_async_state_change_fake)
|
GST_START_TEST (test_async_state_change_fake)
|
||||||
{
|
{
|
||||||
GstPipeline *pipeline;
|
GstPipeline *pipeline;
|
||||||
GstElement *src, *sink;
|
GstElement *src, *sink;
|
||||||
GstBus *bus;
|
GstBus *bus;
|
||||||
GstMessageType type;
|
|
||||||
|
|
||||||
pipeline = GST_PIPELINE (gst_pipeline_new (NULL));
|
pipeline = GST_PIPELINE (gst_pipeline_new (NULL));
|
||||||
fail_unless (pipeline != NULL, "Could not create pipeline");
|
fail_unless (pipeline != NULL, "Could not create pipeline");
|
||||||
|
@ -112,10 +103,15 @@ GST_START_TEST (test_async_state_change_fake)
|
||||||
fail_unless_equals_int (gst_element_set_state (GST_ELEMENT (pipeline),
|
fail_unless_equals_int (gst_element_set_state (GST_ELEMENT (pipeline),
|
||||||
GST_STATE_PLAYING), GST_STATE_CHANGE_ASYNC);
|
GST_STATE_PLAYING), GST_STATE_CHANGE_ASYNC);
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/* FIXME: Wim is implementing a set_state_async, which will
|
||||||
|
* spawn a thread and make sure the pipeline gets to the
|
||||||
|
* requested final state, or errors out before */
|
||||||
gst_bin_watch_for_state_change (GST_BIN (pipeline));
|
gst_bin_watch_for_state_change (GST_BIN (pipeline));
|
||||||
|
|
||||||
while ((type = gst_bus_poll (bus, GST_MESSAGE_STATE_CHANGED, -1))) {
|
while ((type = gst_bus_poll (bus, GST_MESSAGE_STATE_CHANGED, -1))) {
|
||||||
GstMessage *message;
|
GstMessage *message;
|
||||||
|
GstMessageType type;
|
||||||
GstState old, new;
|
GstState old, new;
|
||||||
GstState state, pending;
|
GstState state, pending;
|
||||||
GstStateChange ret;
|
GstStateChange ret;
|
||||||
|
@ -133,11 +129,12 @@ GST_START_TEST (test_async_state_change_fake)
|
||||||
ret = gst_element_get_state (GST_ELEMENT (pipeline), &state, &pending,
|
ret = gst_element_get_state (GST_ELEMENT (pipeline), &state, &pending,
|
||||||
&timeval);
|
&timeval);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
gst_object_unref (pipeline);
|
gst_object_unref (pipeline);
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_END_TEST;
|
GST_END_TEST;
|
||||||
#endif
|
|
||||||
|
|
||||||
Suite *
|
Suite *
|
||||||
gst_pipeline_suite (void)
|
gst_pipeline_suite (void)
|
||||||
|
@ -148,9 +145,7 @@ gst_pipeline_suite (void)
|
||||||
suite_add_tcase (s, tc_chain);
|
suite_add_tcase (s, tc_chain);
|
||||||
tcase_add_test (tc_chain, test_async_state_change_empty);
|
tcase_add_test (tc_chain, test_async_state_change_empty);
|
||||||
tcase_add_test (tc_chain, test_async_state_change_fake_ready);
|
tcase_add_test (tc_chain, test_async_state_change_fake_ready);
|
||||||
#if 0
|
|
||||||
tcase_add_test (tc_chain, test_async_state_change_fake);
|
tcase_add_test (tc_chain, test_async_state_change_fake);
|
||||||
#endif
|
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue