mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
why does this test fail ?
Original commit message from CVS: why does this test fail ?
This commit is contained in:
parent
b2117398c7
commit
ec4e865fba
2 changed files with 32 additions and 6 deletions
|
@ -33,6 +33,7 @@ main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
GstElement *pipeline = NULL;
|
GstElement *pipeline = NULL;
|
||||||
GstElement *src, *sink;
|
GstElement *src, *sink;
|
||||||
|
gint retval = 0;
|
||||||
|
|
||||||
/* init */
|
/* init */
|
||||||
gst_init (&argc, &argv);
|
gst_init (&argc, &argv);
|
||||||
|
@ -56,7 +57,13 @@ main (int argc, char *argv[])
|
||||||
/* connect */
|
/* connect */
|
||||||
g_print ("Connecting elements\n");
|
g_print ("Connecting elements\n");
|
||||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||||
gst_bin_iterate (GST_BIN (pipeline));
|
|
||||||
|
/* we expect this to give an error */
|
||||||
|
if (gst_bin_iterate (GST_BIN (pipeline)) != FALSE)
|
||||||
|
{
|
||||||
|
g_warning ("Iterating a bin with unconnected elements should return FALSE !\n");
|
||||||
|
retval = 1;
|
||||||
|
}
|
||||||
|
|
||||||
gst_pad_connect (gst_element_get_pad (src, "src"),
|
gst_pad_connect (gst_element_get_pad (src, "src"),
|
||||||
gst_element_get_pad (sink, "sink"));
|
gst_element_get_pad (sink, "sink"));
|
||||||
|
@ -64,9 +71,15 @@ main (int argc, char *argv[])
|
||||||
/* set to play */
|
/* set to play */
|
||||||
g_print ("Doing 1 iteration\n");
|
g_print ("Doing 1 iteration\n");
|
||||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||||
gst_bin_iterate (GST_BIN (pipeline));
|
|
||||||
|
/* we expect this to work */
|
||||||
|
if (gst_bin_iterate (GST_BIN (pipeline)) != TRUE)
|
||||||
|
{
|
||||||
|
g_error ("Iterating a bin with connected elements should return TRUE !\n");
|
||||||
|
retval = 1;
|
||||||
|
}
|
||||||
|
|
||||||
g_print ("Done !\n");
|
g_print ("Done !\n");
|
||||||
return 0;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
GstElement *pipeline = NULL;
|
GstElement *pipeline = NULL;
|
||||||
GstElement *src, *sink;
|
GstElement *src, *sink;
|
||||||
|
gint retval = 0;
|
||||||
|
|
||||||
/* init */
|
/* init */
|
||||||
gst_init (&argc, &argv);
|
gst_init (&argc, &argv);
|
||||||
|
@ -56,7 +57,13 @@ main (int argc, char *argv[])
|
||||||
/* connect */
|
/* connect */
|
||||||
g_print ("Connecting elements\n");
|
g_print ("Connecting elements\n");
|
||||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||||
gst_bin_iterate (GST_BIN (pipeline));
|
|
||||||
|
/* we expect this to give an error */
|
||||||
|
if (gst_bin_iterate (GST_BIN (pipeline)) != FALSE)
|
||||||
|
{
|
||||||
|
g_warning ("Iterating a bin with unconnected elements should return FALSE !\n");
|
||||||
|
retval = 1;
|
||||||
|
}
|
||||||
|
|
||||||
gst_pad_connect (gst_element_get_pad (src, "src"),
|
gst_pad_connect (gst_element_get_pad (src, "src"),
|
||||||
gst_element_get_pad (sink, "sink"));
|
gst_element_get_pad (sink, "sink"));
|
||||||
|
@ -64,9 +71,15 @@ main (int argc, char *argv[])
|
||||||
/* set to play */
|
/* set to play */
|
||||||
g_print ("Doing 1 iteration\n");
|
g_print ("Doing 1 iteration\n");
|
||||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||||
gst_bin_iterate (GST_BIN (pipeline));
|
|
||||||
|
/* we expect this to work */
|
||||||
|
if (gst_bin_iterate (GST_BIN (pipeline)) != TRUE)
|
||||||
|
{
|
||||||
|
g_error ("Iterating a bin with connected elements should return TRUE !\n");
|
||||||
|
retval = 1;
|
||||||
|
}
|
||||||
|
|
||||||
g_print ("Done !\n");
|
g_print ("Done !\n");
|
||||||
return 0;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue