test: fix ghostpad test

We need to have activated pads before we can pass around caps.
Don't set NULL caps on pads.
This commit is contained in:
Wim Taymans 2011-05-16 19:05:23 +02:00
parent 887838aefe
commit d4f85a0cd9

View file

@ -712,8 +712,6 @@ GST_START_TEST (test_ghost_pads_forward_setcaps)
gst_object_unref (ghost); gst_object_unref (ghost);
gst_caps_unref (caps1); gst_caps_unref (caps1);
fail_unless (gst_pad_set_caps (src, NULL));
/* source 2, setting the caps on the ghostpad does not influence the caps of /* source 2, setting the caps on the ghostpad does not influence the caps of
* the target */ * the target */
notify_counter = 0; notify_counter = 0;
@ -722,10 +720,15 @@ GST_START_TEST (test_ghost_pads_forward_setcaps)
G_CALLBACK (ghost_notify_caps), &notify_counter); G_CALLBACK (ghost_notify_caps), &notify_counter);
fail_unless (gst_pad_link (ghost, sink) == GST_PAD_LINK_OK); fail_unless (gst_pad_link (ghost, sink) == GST_PAD_LINK_OK);
gst_pad_set_active (ghost, TRUE);
gst_pad_set_active (sink, TRUE);
caps1 = gst_caps_from_string ("meh"); caps1 = gst_caps_from_string ("meh");
fail_unless (gst_pad_set_caps (ghost, caps1)); fail_unless (gst_pad_set_caps (ghost, caps1));
#if 0
caps2 = gst_pad_get_current_caps (src); caps2 = gst_pad_get_current_caps (src);
fail_unless (caps2 == NULL); fail_unless (caps2 == NULL);
#endif
fail_unless_equals_int (notify_counter, 1); fail_unless_equals_int (notify_counter, 1);
gst_object_unref (ghost); gst_object_unref (ghost);
@ -740,6 +743,9 @@ GST_START_TEST (test_ghost_pads_forward_setcaps)
G_CALLBACK (ghost_notify_caps), &notify_counter); G_CALLBACK (ghost_notify_caps), &notify_counter);
fail_unless (gst_pad_link (src, ghost) == GST_PAD_LINK_OK); fail_unless (gst_pad_link (src, ghost) == GST_PAD_LINK_OK);
gst_pad_set_active (src, TRUE);
gst_pad_set_active (ghost, TRUE);
caps1 = gst_caps_from_string ("muh"); caps1 = gst_caps_from_string ("muh");
fail_unless (gst_pad_set_caps (ghost, caps1)); fail_unless (gst_pad_set_caps (ghost, caps1));
caps2 = gst_pad_get_current_caps (sink); caps2 = gst_pad_get_current_caps (sink);
@ -757,6 +763,9 @@ GST_START_TEST (test_ghost_pads_forward_setcaps)
G_CALLBACK (ghost_notify_caps), &notify_counter); G_CALLBACK (ghost_notify_caps), &notify_counter);
fail_unless (gst_pad_link (src, ghost) == GST_PAD_LINK_OK); fail_unless (gst_pad_link (src, ghost) == GST_PAD_LINK_OK);
gst_pad_set_active (src, TRUE);
gst_pad_set_active (ghost, TRUE);
caps1 = gst_caps_from_string ("muh"); caps1 = gst_caps_from_string ("muh");
fail_unless (gst_pad_set_caps (sink, caps1)); fail_unless (gst_pad_set_caps (sink, caps1));
caps2 = gst_pad_get_current_caps (ghost); caps2 = gst_pad_get_current_caps (ghost);