diff options
author | Yann Collet <cyan@fb.com> | 2017-08-10 07:48:19 (GMT) |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2017-08-10 07:48:19 (GMT) |
commit | d8aafe2c52b4b16da9e8d289ad9bdb04b0bc4a05 (patch) | |
tree | 09cf791f84355170306b98a771d9978555f2b55d /tests | |
parent | ca2fb166ab650835c71099842b646d388cebb3ac (diff) | |
download | lz4-d8aafe2c52b4b16da9e8d289ad9bdb04b0bc4a05.zip lz4-d8aafe2c52b4b16da9e8d289ad9bdb04b0bc4a05.tar.gz lz4-d8aafe2c52b4b16da9e8d289ad9bdb04b0bc4a05.tar.bz2 |
dictionary compression correctly uses compression level
Not obvious : copying the state was copying cdict's compression level
Diffstat (limited to 'tests')
-rw-r--r-- | tests/frametest.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/frametest.c b/tests/frametest.c index 1ee0d96..4723aac 100644 --- a/tests/frametest.c +++ b/tests/frametest.c @@ -508,6 +508,30 @@ int basicTests(U32 seed, double compressibility) DISPLAYLEVEL(3, "%u bytes \n", (unsigned)cSizeWithDict); if (cSizeWithDict >= cSizeNoDict) goto _output_error; /* must be more efficient */ + DISPLAYLEVEL(3, "LZ4F_compressFrame_usingCDict, with dict, negative level : "); + { size_t cSizeLevelMax; + LZ4F_preferences_t cParams; + memset(&cParams, 0, sizeof(cParams)); + cParams.compressionLevel = -3; + CHECK_V(cSizeLevelMax, + LZ4F_compressFrame_usingCDict(compressedBuffer, dstCapacity, + CNBuffer, dictSize, + cdict, &cParams) ); + DISPLAYLEVEL(3, "%u bytes \n", (unsigned)cSizeLevelMax); + } + + DISPLAYLEVEL(3, "LZ4F_compressFrame_usingCDict, with dict, level max : "); + { size_t cSizeLevelMax; + LZ4F_preferences_t cParams; + memset(&cParams, 0, sizeof(cParams)); + cParams.compressionLevel = LZ4F_compressionLevel_max(); + CHECK_V(cSizeLevelMax, + LZ4F_compressFrame_usingCDict(compressedBuffer, dstCapacity, + CNBuffer, dictSize, + cdict, &cParams) ); + DISPLAYLEVEL(3, "%u bytes \n", (unsigned)cSizeLevelMax); + } + LZ4F_freeCDict(cdict); } |