diff options
author | Yann Collet <cyan@fb.com> | 2019-04-05 19:54:13 (GMT) |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2019-04-05 19:56:26 (GMT) |
commit | 2ece0d83809849e68e9c194ff3d340982b527256 (patch) | |
tree | 2f2692d37b98224bef70a1184c8511555e66b5f2 /tests | |
parent | 2a94faf462c53feb864c4ae4e857c4870a948da0 (diff) | |
download | lz4-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')
-rw-r--r-- | tests/fullbench.c | 4 | ||||
-rw-r--r-- | tests/fuzzer.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/fullbench.c b/tests/fullbench.c index faa50cb..61d6b78 100644 --- a/tests/fullbench.c +++ b/tests/fullbench.c @@ -161,12 +161,12 @@ static size_t BMK_findMaxMem(U64 requiredMem) static LZ4_stream_t LZ4_stream; static void local_LZ4_resetDictT(void) { - LZ4_resetStream(&LZ4_stream); + LZ4_initStream(&LZ4_stream, sizeof(LZ4_stream)); } static void local_LZ4_createStream(void) { - LZ4_resetStream(&LZ4_stream); + LZ4_initStream(&LZ4_stream, sizeof(LZ4_stream)); } static int local_LZ4_saveDict(const char* in, char* out, int inSize) 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") |