From: Yann Collet Date: Tue, 12 Mar 2024 00:57:57 +0000 (-0700) Subject: add tests inspired from #2927 X-Git-Tag: v1.5.6^2~40^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3948%2Fhead;p=thirdparty%2Fzstd.git add tests inspired from #2927 centered around -T# and --fast=# arguments --- diff --git a/tests/playTests.sh b/tests/playTests.sh index bf5fba89b..2c9f791f9 100755 --- a/tests/playTests.sh +++ b/tests/playTests.sh @@ -326,6 +326,51 @@ if [ "$isWindows" = false ] && [ "$UNAME" != "AIX" ]; then fi fi +println "\n===> multiple_thread test " + +datagen > tmp +println "test : single-thread " +zstd --fast --single-thread tmp -o tmpMT0 +println "test : one worker thread (default)" +zstd --fast -T1 tmp -o tmpMT1 +println "test : two worker threads " +zstd --fast -T2 tmp -o tmpMT2 +println "test : 16-thread " +zstd --fast -T16 tmp -o tmpMT3 +println "test : 127-thread " +zstd --fast -T127 tmp -o tmpMT4 +println "test : 128-thread " +zstd --fast -T128 tmp -o tmpMT5 +println "test : max allowed numeric value is 4294967295 " +zstd --fast -4294967295 tmp -o tmpMT6 +println "test : numeric value overflows 32-bit unsigned int " +zstd --fast -4294967296 tmp -o tmptest9 && die "max allowed numeric value is 4294967295" + +datagen > tmp +println "test : basic compression " +zstd -f tmp # trivial compression case, creates tmp.zst +println "test : basic decompression" +zstd -d -f -T1 tmp.zst +println "note : decompression does not support -T mode, but execution support" +rm -rf tmpMT* + +println "\n===> --fast_argument test " +datagen > tmp +println "test : basic compression " +zstd -f tmp # trivial compression case, creates tmp.zst +println "test: --fast=1" +zstd --fast=1 -f tmp +println "test: --fast=99" +zstd --fast=99 -f tmp +println "test: Invalid value -- negative number" +zstd --fast=-1 -f tmp && die "error: Invalid value -- negative number" +println "test: Invalid value -- zero" +zstd --fast=0 -f tmp && die "error: Invalid value -- 0 number" +println "test: max allowed numeric argument of --fast is 4294967295" +zstd --fast=4294967295 -f tmp +println "test: numeric value overflows 32-bit unsigned int " +zstd --fast=4294967296 -f tmp && die "max allowed argument of --fast is 4294967295" + println "\n===> --exclude-compressed flag" rm -rf precompressedFilterTestDir mkdir -p precompressedFilterTestDir