From: senhuang42 Date: Wed, 28 Oct 2020 21:49:54 +0000 (-0400) Subject: Un-mix declarations and code X-Git-Tag: v1.4.7~40^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7198ebb21301a8665cd36db46a3c049ba1d4026b;p=thirdparty%2Fzstd.git Un-mix declarations and code --- diff --git a/tests/fuzzer.c b/tests/fuzzer.c index c2f5d5707..1297b61b5 100644 --- a/tests/fuzzer.c +++ b/tests/fuzzer.c @@ -721,20 +721,21 @@ static int basicUnitTests(U32 const seed, double compressibility) DISPLAYLEVEL(3, "test%3i : LDM + opt parser with small uncompressible block ", testNb++); { ZSTD_CCtx* cctx = ZSTD_createCCtx(); ZSTD_DCtx* dctx = ZSTD_createDCtx(); - if (!cctx || !dctx) { - DISPLAY("Not enough memory, aborting\n"); - testResult = 1; - goto _end; - } size_t const srcSize = 300 KB; size_t const flushSize = 128 KB + 5; size_t const dstSize = ZSTD_compressBound(srcSize); - char* src = CNBuffer; - char* dst = compressedBuffer; + char* src = (char*)CNBuffer; + char* dst = (char*)compressedBuffer; ZSTD_outBuffer out = { dst, dstSize, 0 }; ZSTD_inBuffer in = { src, flushSize, 0 }; + if (!cctx || !dctx) { + DISPLAY("Not enough memory, aborting\n"); + testResult = 1; + goto _end; + } + RDG_genBuffer(src, srcSize, 0.5, 0.5, seed); /* Force an LDM to exist that crosses block boundary into uncompressible block */ memcpy(src + 125 KB, src, 3 KB + 5);