From 22bef18b96f50029c7ec5a52bf422326d69f0d1f Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Wed, 29 Feb 2012 21:39:44 +0100 Subject: [PATCH] test: improve adder test on event handling Use new consitency checker api to test event handling in more detail. --- tests/check/elements/adder.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/tests/check/elements/adder.c b/tests/check/elements/adder.c index a6cba90f1..fe3432c68 100644 --- a/tests/check/elements/adder.c +++ b/tests/check/elements/adder.c @@ -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)); } -- 2.34.1