summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTim Zakian <2895723+tzakian@users.noreply.github.com>2019-01-09 18:49:49 (GMT)
committerTim Zakian <2895723+tzakian@users.noreply.github.com>2019-01-09 18:49:49 (GMT)
commit81937422514f5b6847d1a99cd5315449ec59566e (patch)
treef7fd4d6b2c5c28540dfb3444ffb58406eea9dbbb /tests
parentd6eac9c5cf376570595e07115304fbbbdeb32a06 (diff)
downloadlz4-81937422514f5b6847d1a99cd5315449ec59566e.zip
lz4-81937422514f5b6847d1a99cd5315449ec59566e.tar.gz
lz4-81937422514f5b6847d1a99cd5315449ec59566e.tar.bz2
Make LZ4F_getBlockSize public and publis in experimental section
Diffstat (limited to 'tests')
-rw-r--r--tests/frametest.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/frametest.c b/tests/frametest.c
index b93f4fe..75fd062 100644
--- a/tests/frametest.c
+++ b/tests/frametest.c
@@ -658,6 +658,28 @@ int basicTests(U32 seed, double compressibility)
CHECK( LZ4F_freeCompressionContext(cctx) ); cctx = NULL;
}
+ DISPLAYLEVEL(3, "getBlockSize test: \n");
+ { size_t result;
+ for (unsigned blockSizeID = 4; blockSizeID < 8; ++blockSizeID) {
+ result = LZ4F_getBlockSize(blockSizeID);
+ CHECK(result);
+ DISPLAYLEVEL(3, "Returned block size of %zu bytes for blockID %u \n",
+ result, blockSizeID);
+ }
+
+ /* Test an invalid input that's too large */
+ result = LZ4F_getBlockSize(8);
+ if(!LZ4F_isError(result) ||
+ LZ4F_getErrorCode(result) != LZ4F_ERROR_maxBlockSize_invalid)
+ goto _output_error;
+
+ /* Test an invalid input that's too small */
+ result = LZ4F_getBlockSize(3);
+ if(!LZ4F_isError(result) ||
+ LZ4F_getErrorCode(result) != LZ4F_ERROR_maxBlockSize_invalid)
+ goto _output_error;
+ }
+
DISPLAYLEVEL(3, "Skippable frame test : \n");
{ size_t decodedBufferSize = COMPRESSIBLE_NOISE_LENGTH;