From 46ea4eaa1f2cde7797a4741779a5ad22ac917bc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 12 Oct 2010 10:28:33 +0200 Subject: [PATCH] flacparse: Adjust unit tests to new flacparse behaviour Garbage after frames is now included in the frames because flacparse has no easy way to detect the real end of a frame. Decoders are expected to everything after the frame because only decoding the bitstream will reveal the real end of the frame. Fixes bug #631814. --- tests/check/elements/flacparse.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/check/elements/flacparse.c b/tests/check/elements/flacparse.c index 1875435dee..0c25bc6f58 100644 --- a/tests/check/elements/flacparse.c +++ b/tests/check/elements/flacparse.c @@ -142,8 +142,19 @@ GST_END_TEST; GST_START_TEST (test_parse_flac_drain_garbage) { + /* We always output the after frame garbage too because we + * have no way of detecting it + */ +#if 0 gst_parser_test_drain_garbage (flac_frame, sizeof (flac_frame), garbage_frame, sizeof (garbage_frame)); +#endif + guint8 frame[sizeof (flac_frame) + sizeof (garbage_frame)]; + + memcpy (frame, flac_frame, sizeof (flac_frame)); + memcpy (frame + sizeof (flac_frame), garbage_frame, sizeof (garbage_frame)); + + gst_parser_test_drain_single (frame, sizeof (frame)); } GST_END_TEST; @@ -159,8 +170,20 @@ GST_END_TEST; GST_START_TEST (test_parse_flac_skip_garbage) { + /* We always include the garbage into the frame because + * we have no easy way for finding the real end of the + * frame. The decoder will later skip the garbage + */ +#if 0 gst_parser_test_skip_garbage (flac_frame, sizeof (flac_frame), garbage_frame, sizeof (garbage_frame)); +#endif + guint8 frame[sizeof (flac_frame) + sizeof (garbage_frame)]; + + memcpy (frame, flac_frame, sizeof (flac_frame)); + memcpy (frame + sizeof (flac_frame), garbage_frame, sizeof (garbage_frame)); + + gst_parser_test_normal (frame, sizeof (frame)); } GST_END_TEST;