Merge pull request #3948 from facebook/tests_2927

add tests inspired from #2927
This commit is contained in:
Yann Collet
2024-03-12 09:43:59 -07:00
committed by GitHub
+45
View File
@@ -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