From e001715b3d3e4c8bb8a99b928b9e8614d4b63f42 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Mon, 11 May 2020 20:35:47 -0700 Subject: [PATCH] fixed asan test --- tests/fuzzer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/fuzzer.c b/tests/fuzzer.c index 8bc27c0b..9b01bc94 100644 --- a/tests/fuzzer.c +++ b/tests/fuzzer.c @@ -1087,7 +1087,6 @@ static int basicUnitTests(U32 const seed, double compressibility) ZSTD_DCtx* const staticDCtx = ZSTD_initStaticDCtx(staticDCtxBuffer, staticDCtxSize); DISPLAYLEVEL(4, "Full CCtx size = %u, ", (U32)staticCCtxSize); DISPLAYLEVEL(4, "CCtx for 32 KB = %u, ", (U32)smallCCtxSize); - assert(staticCCtxSize > smallCCtxSize * ZSTD_WORKSPACETOOLARGE_FACTOR); /* ensure size down scenario */ if ((staticCCtx==NULL) || (staticDCtx==NULL)) goto _output_error; DISPLAYLEVEL(3, "OK \n"); @@ -1108,7 +1107,8 @@ static int basicUnitTests(U32 const seed, double compressibility) DISPLAYLEVEL(3, "test%3i : resize context to full CCtx size : ", testNb++); staticCCtx = ZSTD_initStaticCStream(staticCCtxBuffer, staticCCtxSize); - if ((void*)staticCCtx != staticCCtxBuffer) goto _output_error; + DISPLAYLEVEL(4, "staticCCtxBuffer = %p, staticCCtx = %p , ", staticCCtxBuffer, staticCCtx); + if (staticCCtx == NULL) goto _output_error; DISPLAYLEVEL(3, "OK \n"); DISPLAYLEVEL(3, "test%3i : compress large input with static CCtx : ", testNb++); @@ -1120,6 +1120,7 @@ static int basicUnitTests(U32 const seed, double compressibility) DISPLAYLEVEL(3, "test%3i : compress small input often enough to trigger context reduce : ", testNb++); { int nbc; + assert(staticCCtxSize > smallCCtxSize * ZSTD_WORKSPACETOOLARGE_FACTOR); /* ensure size down scenario */ assert(CNBuffSize > smallInSize + ZSTD_WORKSPACETOOLARGE_MAXDURATION + 3); for (nbc=0; nbc