]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Add tests
authorElliot Gorokhovsky <embg@fb.com>
Wed, 22 Jun 2022 21:05:23 +0000 (17:05 -0400)
committerElliot Gorokhovsky <embg@fb.com>
Wed, 22 Jun 2022 21:05:23 +0000 (17:05 -0400)
tests/fuzz/zstd_helpers.c
tests/fuzzer.c

index f66579754ffcd854729e9106cf301b590b61f560..4f8727df96a4747e2e0c32446744d8d3b967da9a 100644 (file)
@@ -98,6 +98,7 @@ void FUZZ_setRandomParameters(ZSTD_CCtx *cctx, size_t srcSize, FUZZ_dataProducer
     setRand(cctx, ZSTD_c_forceAttachDict, 0, 2, producer);
     setRand(cctx, ZSTD_c_useBlockSplitter, 0, 2, producer);
     setRand(cctx, ZSTD_c_deterministicRefPrefix, 0, 1, producer);
+    setRand(cctx, ZSTD_c_prefetchCDictTables, 0, 2, producer);
     if (FUZZ_dataProducer_uint32Range(producer, 0, 1) == 0) {
       setRand(cctx, ZSTD_c_srcSizeHint, ZSTD_SRCSIZEHINT_MIN, 2 * srcSize, producer);
     }
index 71356d53dbce026bf908ddc31aff61ef4f167c17..81c2d9dba22e70a4ecb1ab483da4698639fec65c 100644 (file)
@@ -2041,6 +2041,7 @@ static int basicUnitTests(U32 const seed, double compressibility)
                 CHECK_Z( ZSTD_CCtx_setParameter(ctxOrig, ZSTD_c_compressionLevel, l) );
                 CHECK_Z( ZSTD_CCtx_setParameter(ctxOrig, ZSTD_c_enableDedicatedDictSearch, 0) );
                 CHECK_Z( ZSTD_CCtx_setParameter(ctxOrig, ZSTD_c_forceAttachDict, ZSTD_dictForceAttach) );
+                CHECK_Z( ZSTD_CCtx_setParameter(ctxOrig, ZSTD_c_prefetchCDictTables, seed % 3) );
                 wdict_cSize = ZSTD_compress2(ctxOrig, compressedBuffer, compressedBufferSize, contentStart, contentSize);
                 if (wdict_cSize > target_wdict_cSize[l]) {
                     DISPLAYLEVEL(1, "error : compression with dictionary and compress2 at level %i worse than expected (%u > %u) \n",