From ce4e1389cc38c3c26f40ecef9c4fa6438411fa90 Mon Sep 17 00:00:00 2001 From: Alexey Tourbin Date: Fri, 27 Apr 2018 07:06:37 +0300 Subject: fuzzer.c: enabled ring buffer tests for decompress_fast Ring buffer tests were performed only with LZ4_decompress_safe_continue, leaving my buggy changes to LZ4_decompress_safe_continue undetected. The tests are now replicated and performed in a similar manner for both LZ4_decompress_safe_continue and LZ4_decompress_safe_continue (except for the small buffer case where only one function can be tested, because part of the dictionary is overwritten with the output). I also updated function names in the messages (changed them to the actual ones). The error was reported for LZ4_decompress_safe(), which I found misleading. --- tests/fuzzer.c | 121 ++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 81 insertions(+), 40 deletions(-) diff --git a/tests/fuzzer.c b/tests/fuzzer.c index 244cc4f..cadda21 100644 --- a/tests/fuzzer.c +++ b/tests/fuzzer.c @@ -914,8 +914,8 @@ static void FUZ_unitTests(int compressionLevel) /* ring buffer test */ { XXH64_state_t xxhOrig; - XXH64_state_t xxhNew; - LZ4_streamDecode_t decodeState; + XXH64_state_t xxhNewSafe, xxhNewFast; + LZ4_streamDecode_t decodeStateSafe, decodeStateFast; const U32 maxMessageSizeLog = 10; const U32 maxMessageSizeMask = (1<