fix test
a margin of 4 is insufficient to guarantee compression success.
This commit is contained in:
+2
-1
@@ -884,7 +884,8 @@ static int basicUnitTests(U32 seed, double compressibility, int bigTests)
|
|||||||
DISPLAYLEVEL(3, "test%3i : ZSTD_compress2() uses stable input and output : ", testNb++);
|
DISPLAYLEVEL(3, "test%3i : ZSTD_compress2() uses stable input and output : ", testNb++);
|
||||||
CHECK_Z(cSize = ZSTD_compress2(cctx, compressedBuffer, compressedBufferSize, CNBuffer, CNBufferSize));
|
CHECK_Z(cSize = ZSTD_compress2(cctx, compressedBuffer, compressedBufferSize, CNBuffer, CNBufferSize));
|
||||||
CHECK(!(cSize < ZSTD_compressBound(CNBufferSize)), "cSize too large for test");
|
CHECK(!(cSize < ZSTD_compressBound(CNBufferSize)), "cSize too large for test");
|
||||||
CHECK_Z(cSize = ZSTD_compress2(cctx, compressedBuffer, cSize + 4, CNBuffer, CNBufferSize));
|
/* check that compression fits with just a 8-bytes margin */
|
||||||
|
CHECK_Z(cSize = ZSTD_compress2(cctx, compressedBuffer, cSize+8, CNBuffer, CNBufferSize));
|
||||||
CHECK_Z(cctxSize1 = ZSTD_sizeof_CCtx(cctx));
|
CHECK_Z(cctxSize1 = ZSTD_sizeof_CCtx(cctx));
|
||||||
/* @cctxSize2 : sizeof_CCtx when doing full streaming (no stable in/out) */
|
/* @cctxSize2 : sizeof_CCtx when doing full streaming (no stable in/out) */
|
||||||
{ ZSTD_CCtx* const cctx2 = ZSTD_createCCtx();
|
{ ZSTD_CCtx* const cctx2 = ZSTD_createCCtx();
|
||||||
|
|||||||
Reference in New Issue
Block a user