From: <wt...@ke...> - 2008-02-27 11:04:19
|
CVS Root: /cvs/gstreamer Module: gst-plugins-base Changes by: wtay Date: Wed Feb 27 2008 10:55:17 UTC Log message: * tests/check/libs/rtp.c: (GST_START_TEST): Add check for RTP buffer defaults, padding and marker bit API. Modified files: . : ChangeLog tests/check/libs: rtp.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ChangeLog.diff?r1=1.3775&r2=1.3776 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/tests/check/libs/rtp.c.diff?r1=1.4&r2=1.5 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-base/ChangeLog,v retrieving revision 1.3775 retrieving revision 1.3776 diff -u -d -r1.3775 -r1.3776 --- ChangeLog 27 Feb 2008 10:42:07 -0000 1.3775 +++ ChangeLog 27 Feb 2008 10:55:01 -0000 1.3776 @@ -1,3 +1,8 @@ +2008-02-27 Wim Taymans <wim...@co...> + + * tests/check/libs/rtp.c: (GST_START_TEST): + Add check for RTP buffer defaults, padding and marker bit API. 2008-02-27 Sebastian Dröge <sl...@ci...> * gst-libs/gst/cdda/sha1.c: (sha_transform): Index: rtp.c RCS file: /cvs/gstreamer/gst-plugins-base/tests/check/libs/rtp.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- rtp.c 1 Feb 2008 11:09:16 -0000 1.4 +++ rtp.c 27 Feb 2008 10:55:03 -0000 1.5 @@ -40,13 +40,38 @@ fail_unless_equals_int (GST_BUFFER_SIZE (buf), RTP_HEADER_LEN + 16 + 4); data = GST_BUFFER_DATA (buf); + /* check defaults */ + fail_unless_equals_int (gst_rtp_buffer_get_version (buf), 2); + fail_unless (gst_rtp_buffer_get_padding (buf) == FALSE); + fail_unless (gst_rtp_buffer_get_extension (buf) == FALSE); + fail_unless_equals_int (gst_rtp_buffer_get_csrc_count (buf), 0); + fail_unless (gst_rtp_buffer_get_marker (buf) == FALSE); + fail_unless (gst_rtp_buffer_get_payload_type (buf) == 0); + fail_unless_equals_int (GST_READ_UINT16_BE (data), 0x8000); /* check version in bitfield */ gst_rtp_buffer_set_version (buf, 3); fail_unless_equals_int (gst_rtp_buffer_get_version (buf), 3); fail_unless_equals_int ((data[0] & 0xC0) >> 6, 3); - gst_rtp_buffer_set_version (buf, 0); - fail_unless_equals_int (gst_rtp_buffer_get_version (buf), 0); - fail_unless_equals_int ((data[0] & 0xC0) >> 6, 0); + gst_rtp_buffer_set_version (buf, 2); + fail_unless_equals_int ((data[0] & 0xC0) >> 6, 2); + /* check padding bit */ + gst_rtp_buffer_set_padding (buf, TRUE); + fail_unless (gst_rtp_buffer_get_padding (buf) == TRUE); + fail_unless_equals_int ((data[0] & 0x20) >> 5, 1); + gst_rtp_buffer_set_padding (buf, FALSE); + fail_unless_equals_int ((data[0] & 0x20) >> 5, 0); + /* check marker bit */ + gst_rtp_buffer_set_marker (buf, TRUE); + fail_unless (gst_rtp_buffer_get_marker (buf) == TRUE); + fail_unless_equals_int ((data[1] & 0x80) >> 7, 1); + gst_rtp_buffer_set_marker (buf, FALSE); + fail_unless_equals_int ((data[1] & 0x80) >> 7, 0); /* check sequence offset */ gst_rtp_buffer_set_seq (buf, 0xF2C9); |