From: Antonio Ospite Date: Wed, 6 Mar 2019 18:19:03 +0000 (+0100) Subject: test: rtpbin_buffer_list: make check_packet more flexible X-Git-Tag: 1.16.2~89 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5567066bff82f2d345af18d1adffbb74f0007fc2;p=platform%2Fupstream%2Fgst-plugins-good.git test: rtpbin_buffer_list: make check_packet more flexible Make it possible to differentiate between the position in the list and the packet index in the global structures in check_packet, in some future case the list may change, in case some element removes a buffer from the list, and the two indices may not coincide. --- diff --git a/tests/check/elements/rtpbin_buffer_list.c b/tests/check/elements/rtpbin_buffer_list.c index c83d0fd..d241c6b 100644 --- a/tests/check/elements/rtpbin_buffer_list.c +++ b/tests/check/elements/rtpbin_buffer_list.c @@ -210,20 +210,20 @@ check_payload (GstBuffer * buffer, guint index) } static void -check_packet (GstBufferList * list, guint index) +check_packet (GstBufferList * list, guint list_index, guint packet_index) { GstBuffer *buffer; fail_unless (list != NULL); - fail_unless ((buffer = gst_buffer_list_get (list, index)) != NULL); + fail_unless ((buffer = gst_buffer_list_get (list, list_index)) != NULL); fail_unless (gst_buffer_n_memory (buffer) == 2); fail_unless (GST_BUFFER_TIMESTAMP (buffer) == GST_BUFFER_TIMESTAMP (original_buffer)); - check_header (buffer, index); - check_payload (buffer, index); + check_header (buffer, packet_index); + check_payload (buffer, packet_index); } /* @@ -257,10 +257,10 @@ sink_chain_list (GstPad * pad, GstObject * parent, GstBufferList * list) fail_unless (gst_buffer_list_length (list) == 2); fail_unless (gst_buffer_list_get (list, 0)); - check_packet (list, 0); + check_packet (list, 0, 0); fail_unless (gst_buffer_list_get (list, 1)); - check_packet (list, 1); + check_packet (list, 1, 1); gst_buffer_list_unref (list);