summaryrefslogtreecommitdiffstats
path: root/tests/fuzzer.c
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2018-09-05 18:25:10 (GMT)
committerYann Collet <cyan@fb.com>2018-09-05 18:25:10 (GMT)
commit30f6f34328733ec4e74c78c06f667810db0417df (patch)
treee3e3bc01eb3e85cef21de88a0d87c80ff4dc81c8 /tests/fuzzer.c
parent52cce3056227188cedcd36f35a03924425dc14c9 (diff)
downloadlz4-30f6f34328733ec4e74c78c06f667810db0417df.zip
lz4-30f6f34328733ec4e74c78c06f667810db0417df.tar.gz
lz4-30f6f34328733ec4e74c78c06f667810db0417df.tar.bz2
removed one assert() condition
which is not correct when using LZ4_HC with dictionary and starting from a low address (<0x10000).
Diffstat (limited to 'tests/fuzzer.c')
-rw-r--r--tests/fuzzer.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/fuzzer.c b/tests/fuzzer.c
index 5a92f8f..6c79515 100644
--- a/tests/fuzzer.c
+++ b/tests/fuzzer.c
@@ -323,12 +323,17 @@ static int FUZ_test(U32 seed, U32 nbCycles, const U32 startCycle, const double c
int result = 0;
unsigned cycleNb;
-# define FUZ_CHECKTEST(cond, ...) if (cond) { printf("Test %u : ", testNb); printf(__VA_ARGS__); \
- printf(" (seed %u, cycle %u) \n", seed, cycleNb); goto _output_error; }
+# define FUZ_CHECKTEST(cond, ...) \
+ if (cond) { \
+ printf("Test %u : ", testNb); printf(__VA_ARGS__); \
+ printf(" (seed %u, cycle %u) \n", seed, cycleNb); \
+ goto _output_error; \
+ }
+
# define FUZ_DISPLAYTEST(...) { \
testNb++; \
if (g_displayLevel>=4) { \
- printf("\r%4u - %2u ", cycleNb, testNb); \
+ printf("\r%4u - %2u :", cycleNb, testNb); \
printf(" " __VA_ARGS__); \
printf(" "); \
fflush(stdout); \
@@ -805,7 +810,7 @@ static int FUZ_test(U32 seed, U32 nbCycles, const U32 startCycle, const double c
FUZ_CHECKTEST(ret>=0, "LZ4_decompress_safe_usingDict should have failed : not enough output size (-1 byte)");
FUZ_CHECKTEST(decodedBuffer[blockSize-1], "LZ4_decompress_safe_usingDict overrun specified output buffer size");
- FUZ_DISPLAYTEST();
+ FUZ_DISPLAYTEST("LZ4_decompress_safe_usingDict with a too small output buffer");
{ U32 const missingBytes = (FUZ_rand(&randState) & 0xF) + 2;
if ((U32)blockSize > missingBytes) {
decodedBuffer[blockSize-missingBytes] = 0;
@@ -815,7 +820,7 @@ static int FUZ_test(U32 seed, U32 nbCycles, const U32 startCycle, const double c
} }
/* Compress HC using External dictionary */
- FUZ_DISPLAYTEST();
+ FUZ_DISPLAYTEST("LZ4_compress_HC_continue with an external dictionary");
dict -= (FUZ_rand(&randState) & 7); /* even bigger separation */
if (dict < (char*)CNBuffer) dict = (char*)CNBuffer;
LZ4_resetStreamHC (&LZ4dictHC, compressionLevel);