diff options
author | Christopher Harvie <charvie@psdtechnologies.com> | 2020-05-14 03:01:43 (GMT) |
---|---|---|
committer | Christopher Harvie <charvie@psdtechnologies.com> | 2020-05-14 03:01:43 (GMT) |
commit | 2a7203c05d58e3094df7c173226f5127e15970ad (patch) | |
tree | 394050ce7ebbcbd3215ff796f2de658563b0045d /tests | |
parent | 57c35511d4a0053576468a23837de43fc293d923 (diff) | |
download | lz4-2a7203c05d58e3094df7c173226f5127e15970ad.zip lz4-2a7203c05d58e3094df7c173226f5127e15970ad.tar.gz lz4-2a7203c05d58e3094df7c173226f5127e15970ad.tar.bz2 |
add tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/frametest.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/frametest.c b/tests/frametest.c index 1b932e4..f891530 100644 --- a/tests/frametest.c +++ b/tests/frametest.c @@ -200,6 +200,24 @@ int basicTests(U32 seed, double compressibility) DISPLAYLEVEL(3, " %u \n", (U32)cBound); } + /* LZ4F_compressBound() : special case : automatic flushing enabled */ + DISPLAYLEVEL(3, "LZ4F_compressBound(1 KB, autoFlush=1) = "); + { size_t cBound; + LZ4F_preferences_t autoFlushPrefs; + memset(&autoFlushPrefs, 0, sizeof(autoFlushPrefs)); + autoFlushPrefs.autoFlush = 1; + cBound = LZ4F_compressBound(1 KB, &autoFlushPrefs); + if (cBound > 64 KB) goto _output_error; + DISPLAYLEVEL(3, " %u \n", (U32)cBound); + } + + /* LZ4F_compressBound() : special case : automatic flushing disabled */ + DISPLAYLEVEL(3, "LZ4F_compressBound(1 KB, autoFlush=0) = "); + { size_t const cBound = LZ4F_compressBound(1 KB, &prefs); + if (cBound < 64 KB) goto _output_error; + DISPLAYLEVEL(3, " %u \n", (U32)cBound); + } + /* Special case : null-content frame */ testSize = 0; DISPLAYLEVEL(3, "LZ4F_compressFrame, compress null content : "); |