summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2018-09-08 01:22:01 (GMT)
committerYann Collet <cyan@fb.com>2018-09-08 01:22:01 (GMT)
commite22bb8007432d42cda4c83daeb9e97ea15b7ef67 (patch)
tree8ecba17ab8e5e1c61a5609b9c4ff1c163359aada /tests
parenteaed9ea4a15934e59f74902f0ed692a07151579d (diff)
downloadlz4-e22bb8007432d42cda4c83daeb9e97ea15b7ef67.zip
lz4-e22bb8007432d42cda4c83daeb9e97ea15b7ef67.tar.gz
lz4-e22bb8007432d42cda4c83daeb9e97ea15b7ef67.tar.bz2
fixed fuzzer test
and removed one blind copy, since there is no more guarantee that at least 4 bytes are still available in output buffer
Diffstat (limited to 'tests')
-rw-r--r--tests/fuzzer.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/fuzzer.c b/tests/fuzzer.c
index bdb7841..d6a5f51 100644
--- a/tests/fuzzer.c
+++ b/tests/fuzzer.c
@@ -582,11 +582,12 @@ static int FUZ_test(U32 seed, U32 nbCycles, const U32 startCycle, const double c
FUZ_DISPLAYTEST("test LZ4_decompress_safe_partial");
{ size_t const missingBytes = FUZ_rand(&randState) % blockSize;
int const targetSize = (int)(blockSize - missingBytes);
- char const sentinel = compressedBuffer[targetSize] = block[targetSize] ^ 0x5A;
+ char const sentinel = decodedBuffer[targetSize] = block[targetSize] ^ 0x5A;
+ assert(decodedBuffer[targetSize] == sentinel);
int const decResult = LZ4_decompress_safe_partial(compressedBuffer, decodedBuffer, compressedSize, targetSize, blockSize);
- FUZ_CHECKTEST(decResult<0, "LZ4_decompress_safe_partial failed despite valid input data");
+ FUZ_CHECKTEST(decResult<0, "LZ4_decompress_safe_partial failed despite valid input data (error:%i)", decResult);
FUZ_CHECKTEST(decResult != targetSize, "LZ4_decompress_safe_partial did not regenerated required amount of data (%i < %i <= %i)", decResult, targetSize, blockSize);
- FUZ_CHECKTEST(compressedBuffer[targetSize] != sentinel, "LZ4_decompress_safe_partial overwrite beyond requested size (though %i <= %i <= %i)", decResult, targetSize, blockSize);
+ FUZ_CHECKTEST(decodedBuffer[targetSize] != sentinel, "LZ4_decompress_safe_partial overwrite beyond requested size (though %i <= %i <= %i)", decResult, targetSize, blockSize);
}
/* Test Compression with limited output size */