summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2016-12-21 13:18:01 (GMT)
committerYann Collet <cyan@fb.com>2016-12-21 13:18:01 (GMT)
commit7cf0bb97b2a988cb17435780d19e145147dd9f70 (patch)
tree0c6395e78803ccca8f4ea31be5b2fda3367d98d5 /tests
parent385cb4f539134b3cb855a29eef99a4a876f728d2 (diff)
downloadlz4-7cf0bb97b2a988cb17435780d19e145147dd9f70.zip
lz4-7cf0bb97b2a988cb17435780d19e145147dd9f70.tar.gz
lz4-7cf0bb97b2a988cb17435780d19e145147dd9f70.tar.bz2
LZ4F_compressBound(0) provides upper bound for LZ4F_flush() and LZ4F_compressEnd() [#290, suggested by @vtermanis]
Diffstat (limited to 'tests')
-rw-r--r--tests/frametest.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/frametest.c b/tests/frametest.c
index a99728f..fd07377 100644
--- a/tests/frametest.c
+++ b/tests/frametest.c
@@ -204,6 +204,13 @@ int basicTests(U32 seed, double compressibility)
FUZ_fillCompressibleNoiseBuffer(CNBuffer, COMPRESSIBLE_NOISE_LENGTH, compressibility, &randState);
crcOrig = XXH64(CNBuffer, COMPRESSIBLE_NOISE_LENGTH, 1);
+ /* LZ4F_compressBound() : special case : srcSize == 0 */
+ DISPLAYLEVEL(3, "LZ4F_compressBound(0) = ");
+ { size_t const cBound = LZ4F_compressBound(0, NULL);
+ 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 : \n");