From 68ce96a9e402c3e21990db318436b24d5ebbb901 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Fri, 24 Jan 2014 12:36:59 -0300 Subject: [PATCH] tests: h264parse: fix tests after leading 0x00 removal Commit 6af387cd5ab2c946025e5499903e75ee87b063a9 made h264parse strip a leading 0x00 byte from some output scenarios. This broke tests as bs_to_nal test expects one more byte on the output. Fix this by comparing the output with the expected stripped version, too. --- tests/check/elements/h264parse.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/check/elements/h264parse.c b/tests/check/elements/h264parse.c index 3df62f0308..bb5bfbaa65 100644 --- a/tests/check/elements/h264parse.c +++ b/tests/check/elements/h264parse.c @@ -126,8 +126,16 @@ verify_buffer (buffer_verify_data_s * vdata, GstBuffer * buffer) gst_buffer_map (buffer, &map, GST_MAP_READ); fail_unless (map.size > 4); - /* only need to check avc output case */ - if (GST_READ_UINT32_BE (map.data) == 0x01) { + /* only need to check avc and bs-to-nal output case */ + if (GST_READ_UINT24_BE (map.data) == 0x01) { + /* in bs-to-nal, a leading 0x00 is stripped from output */ + fail_unless (gst_buffer_get_size (buffer) == + vdata->data_to_verify_size - 1); + fail_unless (gst_buffer_memcmp (buffer, 0, vdata->data_to_verify + 1, + vdata->data_to_verify_size - 1) == 0); + return TRUE; + } else if (GST_READ_UINT32_BE (map.data) == 0x01) { + /* this is not avc, use default tests from parser.c */ gst_buffer_unmap (buffer, &map); return FALSE; }