From 2e24acaa5bb92ab3833b789c34796d9c1ef870ce Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 27 Oct 2008 10:33:20 +0000 Subject: [PATCH] tests/check/elements/icydemux.c: Add some refcount check Original commit message from CVS: * tests/check/elements/icydemux.c: (icydemux_found_pad): Add some refcount check * tests/check/elements/rtp-payloading.c: (rtp_pipeline_run): Don't ignore the result of write(), fixes a compiler warning for me. * tests/icles/videobox-test.c: (main): Make the output a little more pretty. --- ChangeLog | 11 +++++++++++ tests/check/elements/icydemux.c | 8 ++++++++ tests/check/elements/rtp-payloading.c | 4 +++- tests/icles/videobox-test.c | 2 +- 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b3a81fa0d3..3f2ac9767d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-10-27 Wim Taymans + + * tests/check/elements/icydemux.c: (icydemux_found_pad): + Add some refcount check + + * tests/check/elements/rtp-payloading.c: (rtp_pipeline_run): + Don't ignore the result of write(), fixes a compiler warning for me. + + * tests/icles/videobox-test.c: (main): + Make the output a little more pretty. + 2008-10-27 Stefan Kost * ext/esd/esdmon.c: diff --git a/tests/check/elements/icydemux.c b/tests/check/elements/icydemux.c index 9cfe3aae17..e1686c8a13 100644 --- a/tests/check/elements/icydemux.c +++ b/tests/check/elements/icydemux.c @@ -75,6 +75,8 @@ typefind_succeed (GstTypeFind * tf, gpointer private) static void icydemux_found_pad (GstElement * src, GstPad * pad, gpointer data) { + GST_DEBUG ("got new pad %" GST_PTR_FORMAT, pad); + /* Turns out that this asserts a refcount which is wrong for this * case (adding the pad from a pad-added callback), so just do the same * thing inline... */ @@ -84,6 +86,12 @@ icydemux_found_pad (GstElement * src, GstPad * pad, gpointer data) srcpad = gst_element_get_static_pad (icydemux, "src"); fail_if (srcpad == NULL, "Failed to get srcpad from icydemux"); gst_pad_set_chain_function (sinkpad, gst_check_chain_func); + + GST_DEBUG ("checking srcpad %p refcount", srcpad); + /* 1 from element, 1 from signal, 1 from us */ + ASSERT_OBJECT_REFCOUNT (srcpad, "srcpad", 3); + + GST_DEBUG ("linking srcpad"); fail_unless (gst_pad_link (srcpad, sinkpad) == GST_PAD_LINK_OK, "Failed to link pads"); gst_object_unref (srcpad); diff --git a/tests/check/elements/rtp-payloading.c b/tests/check/elements/rtp-payloading.c index 6706044003..92fa875f44 100644 --- a/tests/check/elements/rtp-payloading.c +++ b/tests/check/elements/rtp-payloading.c @@ -251,12 +251,14 @@ rtp_pipeline_run (rtp_pipeline * p) for (i = 0; i < LOOP_COUNT; i++) { const char *frame_data_pointer = p->frame_data; + int res; int frame_count = p->frame_count; /* Write in to the pipe. */ while (frame_count > 0) { - write (p->fd[1], frame_data_pointer, p->frame_data_size); + res = write (p->fd[1], frame_data_pointer, p->frame_data_size); + frame_data_pointer += p->frame_data_size; frame_count--; } diff --git a/tests/icles/videobox-test.c b/tests/icles/videobox-test.c index 708439aba2..49697df986 100644 --- a/tests/icles/videobox-test.c +++ b/tests/icles/videobox-test.c @@ -85,7 +85,7 @@ main (int argc, char **argv) ldir = rdir = 10; for (round = 0; round < MAX_ROUND; round++) { - g_print ("box to %d %d %d %d (%d/%d) \r", top, bottom, left, right, + g_print ("box to %4d %4d %4d %4d (%d/%d) \r", top, bottom, left, right, round, MAX_ROUND); g_object_set (box, "top", top, "bottom", bottom, "left", left, "right",