summaryrefslogtreecommitdiffstats
path: root/tests/fuzzer.c
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2019-04-05 19:54:13 (GMT)
committerYann Collet <cyan@fb.com>2019-04-05 19:56:26 (GMT)
commit2ece0d83809849e68e9c194ff3d340982b527256 (patch)
tree2f2692d37b98224bef70a1184c8511555e66b5f2 /tests/fuzzer.c
parent2a94faf462c53feb864c4ae4e857c4870a948da0 (diff)
downloadlz4-2ece0d83809849e68e9c194ff3d340982b527256.zip
lz4-2ece0d83809849e68e9c194ff3d340982b527256.tar.gz
lz4-2ece0d83809849e68e9c194ff3d340982b527256.tar.bz2
created LZ4_initStream()
- promoted LZ4_resetStream_fast() to stable - moved LZ4_resetStream() into deprecate, but without triggering a compiler warning - update all sources to no longer rely on LZ4_resetStream() note : LZ4_initStream() proposal is slightly different : it's able to initialize any buffer, provided that it's large enough. To this end, it accepts a void*, and returns an LZ4_stream_t*.
Diffstat (limited to 'tests/fuzzer.c')
-rw-r--r--tests/fuzzer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/fuzzer.c b/tests/fuzzer.c
index 1efe322..d899cef 100644
--- a/tests/fuzzer.c
+++ b/tests/fuzzer.c
@@ -641,7 +641,7 @@ static int FUZ_test(U32 seed, U32 nbCycles, const U32 startCycle, const double c
/* Compress using dictionary */
FUZ_DISPLAYTEST("test LZ4_compress_fast_continue() with dictionary of size %i", dictSize);
{ LZ4_stream_t LZ4_stream;
- LZ4_resetStream(&LZ4_stream);
+ LZ4_initStream(&LZ4_stream, sizeof(LZ4_stream));
LZ4_compress_fast_continue (&LZ4_stream, dict, compressedBuffer, dictSize, (int)compressedBufferSize, 1); /* Just to fill hash tables */
blockContinueCompressedSize = LZ4_compress_fast_continue (&LZ4_stream, block, compressedBuffer, blockSize, (int)compressedBufferSize, 1);
FUZ_CHECKTEST(blockContinueCompressedSize==0, "LZ4_compress_fast_continue failed");
@@ -742,7 +742,7 @@ static int FUZ_test(U32 seed, U32 nbCycles, const U32 startCycle, const double c
FUZ_DISPLAYTEST("LZ4_compress_fast_continue() after LZ4_attach_dictionary()");
LZ4_loadDict(&LZ4dict, dict, dictSize);
- LZ4_resetStream(&LZ4_stream);
+ LZ4_initStream(&LZ4_stream, sizeof(LZ4_stream));
LZ4_attach_dictionary(&LZ4_stream, &LZ4dict);
blockContinueCompressedSize = LZ4_compress_fast_continue(&LZ4_stream, block, compressedBuffer, blockSize, (int)compressedBufferSize, 1);
FUZ_CHECKTEST(blockContinueCompressedSize==0, "LZ4_compress_fast_continue using extDictCtx failed");
@@ -1000,7 +1000,7 @@ static void FUZ_unitTests(int compressionLevel)
/* simple compression test */
crcOrig = XXH64(testInput, testCompressedSize, 0);
- LZ4_resetStream(&streamingState);
+ LZ4_initStream(&streamingState, sizeof(streamingState));
result = LZ4_compress_fast_continue(&streamingState, testInput, testCompressed, testCompressedSize, testCompressedSize-1, 1);
FUZ_CHECKTEST(result==0, "LZ4_compress_fast_continue() compression failed!");
FUZ_CHECKTEST(streamingState.internal_donotuse.dirty, "context should be clean")