From: Nick Terrell Date: Wed, 14 Nov 2018 21:53:14 +0000 (-0800) Subject: [tests] Add rsyncable tests X-Git-Tag: v1.3.8~46^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71fe78cbf93a5dbeb7ca0ec1d3641e13d6a8692f;p=thirdparty%2Fzstd.git [tests] Add rsyncable tests --- diff --git a/tests/playTests.sh b/tests/playTests.sh index f35f5fee6..99609a5ea 100755 --- a/tests/playTests.sh +++ b/tests/playTests.sh @@ -836,6 +836,12 @@ $ECHO "===> test: --adapt must fail on incoherent bounds " ./datagen > tmp $ZSTD -f -vv --adapt=min=10,max=9 tmp && die "--adapt must fail on incoherent bounds" +$ECHO "\n===> rsyncable mode " +roundTripTest -g10M " --rsyncable" +roundTripTest -g10M " --rsyncable -B100K" +$ECHO "===> test: --rsyncable must fail with --single-thread" +$ZSTD -f -vv --rsyncable --single-thread tmp && die "--rsyncable must fail with --single-thread" + if [ "$1" != "--test-large-data" ]; then $ECHO "Skipping large data tests" diff --git a/tests/zstreamtest.c b/tests/zstreamtest.c index f47451a3c..2e076d7b7 100644 --- a/tests/zstreamtest.c +++ b/tests/zstreamtest.c @@ -1915,6 +1915,8 @@ static int fuzzerTests_newAPI(U32 seed, U32 nbTests, unsigned startTest, CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_jobSize, (U32)FUZ_rLogLength(&lseed, jobLog), opaqueAPI) ); } } + /* Enable rsyncable mode 1 in 4 times. */ + setCCtxParameter(zc, cctxParams, ZSTD_p_rsyncable, (FUZ_rand(&lseed) % 4 == 0), opaqueAPI); if (FUZ_rand(&lseed) & 1) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_forceMaxWindow, FUZ_rand(&lseed) & 1, opaqueAPI) );