test: improve adder test on event handling

Use new consitency checker api to test event handling in more detail.
This commit is contained in:
Stefan Sauer 2012-02-29 21:39:44 +01:00
parent ce1b1d82e3
commit 22bef18b96

View file

@ -101,8 +101,8 @@ GST_START_TEST (test_event)
GstBus *bus;
GstEvent *seek_event;
gboolean res;
GstPad *srcpad;
GstStreamConsistency *consist;
GstPad *srcpad, *sinkpad;
GstStreamConsistency *chk_1, *chk_2, *chk_3;
GST_INFO ("preparing test");
@ -130,7 +130,22 @@ GST_START_TEST (test_event)
fail_unless (res == TRUE, NULL);
srcpad = gst_element_get_static_pad (adder, "src");
consist = gst_consistency_checker_new (srcpad);
chk_3 = gst_consistency_checker_new (srcpad);
gst_object_unref (srcpad);
/* create consistency checkers for the pads */
srcpad = gst_element_get_static_pad (src1, "src");
chk_1 = gst_consistency_checker_new (srcpad);
sinkpad = gst_pad_get_peer (srcpad);
gst_consistency_checker_add_pad (chk_3, sinkpad);
gst_object_unref (sinkpad);
gst_object_unref (srcpad);
srcpad = gst_element_get_static_pad (src2, "src");
chk_2 = gst_consistency_checker_new (srcpad);
sinkpad = gst_pad_get_peer (srcpad);
gst_consistency_checker_add_pad (chk_3, sinkpad);
gst_object_unref (sinkpad);
gst_object_unref (srcpad);
seek_event = gst_event_new_seek (1.0, GST_FORMAT_TIME,
@ -174,7 +189,9 @@ GST_START_TEST (test_event)
/* cleanup */
g_main_loop_unref (main_loop);
gst_consistency_checker_free (consist);
gst_consistency_checker_free (chk_1);
gst_consistency_checker_free (chk_2);
gst_consistency_checker_free (chk_3);
gst_object_unref (G_OBJECT (bus));
gst_object_unref (G_OBJECT (bin));
}