add a check for a ghostpad that doesn't have a target being linked

Original commit message from CVS:
add a check for a ghostpad that doesn't have a target being linked
This commit is contained in:
Thomas Vander Stichele 2005-09-06 18:18:48 +00:00
parent 8061aed180
commit ac6df74ba4
2 changed files with 66 additions and 6 deletions

View file

@ -110,6 +110,35 @@ GST_START_TEST (test_remove2)
GST_END_TEST;
#if 0
/* test if a ghost pad without a target can be linked
*
*/
GST_START_TEST (test_ghost_pad_notarget)
{
GstElement *b1, *b2, *sink;
GstPad *srcpad, *sinkpad;
GstPadLinkReturn ret;
b1 = gst_element_factory_make ("pipeline", NULL);
b2 = gst_element_factory_make ("bin", NULL);
sink = gst_element_factory_make ("fakesink", NULL);
fail_unless (gst_bin_add (GST_BIN (b1), sink));
fail_unless (gst_bin_add (GST_BIN (b1), b2));
srcpad = gst_ghost_pad_new_notarget ("src", GST_PAD_SRC);
fail_unless (srcpad != NULL);
sinkpad = gst_element_get_pad (sink, "sink");
fail_unless (sinkpad != NULL);
ret = gst_pad_link (srcpad, sinkpad);
fail_unless (ret == GST_PAD_LINK_OK);
}
GST_END_TEST;
#endif
/* test if linking fails over different bins using a pipeline
* like this:
*
@ -270,6 +299,7 @@ gst_ghost_pad_suite (void)
tcase_add_test (tc_chain, test_remove2);
tcase_add_test (tc_chain, test_link);
tcase_add_test (tc_chain, test_ghost_pads);
/* tcase_add_test (tc_chain, test_ghost_pad_notarget); */
return s;
}

View file

@ -110,6 +110,35 @@ GST_START_TEST (test_remove2)
GST_END_TEST;
#if 0
/* test if a ghost pad without a target can be linked
*
*/
GST_START_TEST (test_ghost_pad_notarget)
{
GstElement *b1, *b2, *sink;
GstPad *srcpad, *sinkpad;
GstPadLinkReturn ret;
b1 = gst_element_factory_make ("pipeline", NULL);
b2 = gst_element_factory_make ("bin", NULL);
sink = gst_element_factory_make ("fakesink", NULL);
fail_unless (gst_bin_add (GST_BIN (b1), sink));
fail_unless (gst_bin_add (GST_BIN (b1), b2));
srcpad = gst_ghost_pad_new_notarget ("src", GST_PAD_SRC);
fail_unless (srcpad != NULL);
sinkpad = gst_element_get_pad (sink, "sink");
fail_unless (sinkpad != NULL);
ret = gst_pad_link (srcpad, sinkpad);
fail_unless (ret == GST_PAD_LINK_OK);
}
GST_END_TEST;
#endif
/* test if linking fails over different bins using a pipeline
* like this:
*
@ -270,6 +299,7 @@ gst_ghost_pad_suite (void)
tcase_add_test (tc_chain, test_remove2);
tcase_add_test (tc_chain, test_link);
tcase_add_test (tc_chain, test_ghost_pads);
/* tcase_add_test (tc_chain, test_ghost_pad_notarget); */
return s;
}