summaryrefslogtreecommitdiffstats
path: root/tests/fuzzer.c
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2019-01-09 21:38:33 (GMT)
committerYann Collet <cyan@fb.com>2019-01-09 21:38:33 (GMT)
commitbaed01a9c7703a6d8a68f45b2948a1e84de555e1 (patch)
treec9375ff0f623978b1d4d3f79a21d27570407d20d /tests/fuzzer.c
parentfbebf0345dde5855837460593df0f84931b20fc4 (diff)
downloadlz4-baed01a9c7703a6d8a68f45b2948a1e84de555e1.zip
lz4-baed01a9c7703a6d8a68f45b2948a1e84de555e1.tar.gz
lz4-baed01a9c7703a6d8a68f45b2948a1e84de555e1.tar.bz2
fixed long sequence overflow test
Diffstat (limited to 'tests/fuzzer.c')
-rw-r--r--tests/fuzzer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/fuzzer.c b/tests/fuzzer.c
index 56535b7..573703c 100644
--- a/tests/fuzzer.c
+++ b/tests/fuzzer.c
@@ -1108,8 +1108,10 @@ static void FUZ_unitTests(int compressionLevel)
LZ4_resetStreamHC(&sHC, 3);
assert(blockSize < INT_MAX);
srcSize = (int)blockSize;
+ assert(targetSize < INT_MAX);
result = LZ4_compress_HC_destSize(&sHC, block, dstBlock, &srcSize, (int)targetSize, 3);
- FUZ_CHECKTEST(result!=0, "LZ4_compress_HC_destSize() : compression must fail !");
+ DISPLAYLEVEL(4, "cSize=%i; readSize=%i; ", result, srcSize);
+ FUZ_CHECKTEST(result!=4116, "LZ4_compress_HC_destSize() : compression must fill dstBuffer completely, but no more !");
FUZ_CHECKTEST(((char*)dstBlock)[targetSize] != sentinel, "LZ4_compress_HC_destSize()")
LZ4_resetStreamHC(&sHC, 3); /* make sure the context is clean after the test */