From: Sebastian Dröge Date: Tue, 12 Oct 2010 08:28:33 +0000 (+0200) Subject: flacparse: Adjust unit tests to new flacparse behaviour X-Git-Tag: RELEASE-0.10.29~322 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=46ea4eaa1f2cde7797a4741779a5ad22ac917bc9;p=platform%2Fupstream%2Fgst-plugins-good.git 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. --- diff --git a/tests/check/elements/flacparse.c b/tests/check/elements/flacparse.c index 1875435..0c25bc6 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;