]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
zstreamtest uses random overlapLog for fuzzing
authorYann Collet <cyan@fb.com>
Mon, 30 Jan 2017 20:46:35 +0000 (12:46 -0800)
committerYann Collet <cyan@fb.com>
Mon, 30 Jan 2017 20:46:35 +0000 (12:46 -0800)
tests/zstreamtest.c

index bef8734c7f866d2c2a9095e8e8223ee25300eebb..c053172e92e4afa984af30364bb50c6f09a2c285 100644 (file)
@@ -834,9 +834,10 @@ static int fuzzerTests_MT(U32 seed, U32 nbTests, unsigned startTest, double comp
                 DISPLAYLEVEL(5, "Init with windowLog = %u \n", params.cParams.windowLog);
                 params.fParams.checksumFlag = FUZ_rand(&lseed) & 1;
                 params.fParams.noDictIDFlag = FUZ_rand(&lseed) & 1;
-                {   size_t const initError = ZSTDMT_initCStream_advanced(zc, dict, dictSize, params, pledgedSrcSize);
-                    CHECK (ZSTD_isError(initError),"ZSTDMT_initCStream_advanced error : %s", ZSTD_getErrorName(initError));
-        }   }   }
+                { size_t const initError = ZSTDMT_initCStream_advanced(zc, dict, dictSize, params, pledgedSrcSize);
+                  CHECK (ZSTD_isError(initError),"ZSTDMT_initCStream_advanced error : %s", ZSTD_getErrorName(initError)); }
+                ZSTDMT_setMTCtxParameter(zc, ZSTDMT_p_overlapSectionLog, FUZ_rand(&lseed) % 12);
+        }   }
 
         /* multi-segments compression test */
         XXH64_reset(&xxhState, 0);