Lines Matching full:zstd
19 zstd() { function
50 println "roundTripTest: datagen $1 $proba | zstd -v$cLevel | zstd -d$dLevel"
52 datagen $1 $proba | zstd --ultra -v$cLevel | zstd -d$dLevel | $MD5SUM > tmp2
71 … println "fileRoundTripTest: datagen $1 $local_p > tmp && zstd -v$local_c -c tmp | zstd -d$local_d"
74 zstd --ultra -v$local_c -c tmp | zstd -d$local_d | $MD5SUM > tmp.md5.2
165 ZSTD_BIN="$PRGDIR/zstd"
178 …BIN" ] || die "zstd not found at $ZSTD_BIN! \n Please define ZSTD_BIN pointing to the zstd binary.…
179 …EN_BIN pointing to the datagen binary. You might also consider rebuilding zstd tests following the…
182 if echo hello | zstd -v -T2 2>&1 > $INTOVOID | $GREP -q 'multi-threading is disabled'
190 zstd -vvV
195 zstd -h
196 zstd -H
197 zstd -V
199 zstd -f tmp # trivial compression case, creates tmp.zst
200 zstd -f -z tmp
201 zstd -f -k tmp
202 zstd -f -C tmp
204 zstd -df tmp.zst # trivial decompression case (overwrites tmp)
206 zstd -99 -f tmp # too large compression level, automatic sized down
207 zstd -5000000000 -f tmp && die "too large numeric value : must fail"
209 zstd --fast -f tmp # == -1
210 zstd --fast=3 -f tmp # == -3
211 zstd --fast=200000 -f tmp # too low compression level, automatic fixed
212 zstd --fast=5000000000 -f tmp && die "too large numeric value : must fail"
213 zstd -c --fast=0 tmp > $INTOVOID && die "--fast must not accept value 0"
215 zstd --fast=9999999999 -f tmp && die "should have refused numeric value"
218 ZSTD_CLEVEL=12 zstd -f tmp # positive compression level
219 ZSTD_CLEVEL=-12 zstd -f tmp # negative compression level
220 ZSTD_CLEVEL=+12 zstd -f tmp # valid: verbose '+' sign
221 ZSTD_CLEVEL='' zstd -f tmp # empty env var, warn and revert to default setting
222 ZSTD_CLEVEL=- zstd -f tmp # malformed env var, warn and revert to default setting
223 ZSTD_CLEVEL=a zstd -f tmp # malformed env var, warn and revert to default setting
224 ZSTD_CLEVEL=+a zstd -f tmp # malformed env var, warn and revert to default setting
225 ZSTD_CLEVEL=3a7 zstd -f tmp # malformed env var, warn and revert to default setting
226 ZSTD_CLEVEL=50000000000 zstd -f tmp # numeric value too large, warn and revert to default setting
228 ZSTD_CLEVEL=12 zstd --fast=3 -f tmp # overridden by command line option
235 zstd tmp -c > tmpCompressed
236 zstd tmp --stdout > tmpCompressed # long command format
240 zstd tmp -o tmpCompressed
244 zstd tmp -fo tmpCompressed
248 zstd tmp -c > tmpCompressed -o tmpOut
251 zstd tmp -o tmpOut -c > tmpCompressed
256 zstd tmp2 -fo && die "-o must be followed by filename "
258 println bob | zstd | zstd -d
261 println bob | zstd && die "should have refused : compressed data to terminal"
262 println "test : compressed data from terminal (a hang here is a test fail, zstd is wrongly waiting …
263 zstd -d > $INTOVOID && die "should have refused : compressed data from terminal"
266 println -n '' | zstd - --stdout | zstd -d --stdout
269 zstd tmp1 -c | wc -c | $GREP "14"
270 zstd < tmp1 | wc -c | $GREP "14"
272 zstd -d tmpCompressed && die "wrong suffix error not detected!"
273 zstd -df tmp && die "should have refused : wrong extension"
275 zstd -d tmpCompressed -c > tmpResult # decompression using stdout
276 zstd --decompress tmpCompressed -c > tmpResult
277 zstd --decompress tmpCompressed --stdout > tmpResult
279 zstd -dc < tmp.zst > $INTOVOID # combine decompression, stdin & stdout
280 zstd -dc - < tmp.zst > $INTOVOID
281 zstd -d < tmp.zst > $INTOVOID # implicit stdout when stdin is used
282 zstd -d - < tmp.zst > $INTOVOID
285 zstd -f tmplimit
286 zstd -d -f tmplimit.zst -M2K -c > $INTOVOID && die "decompression needs more memory than allowed"
287 zstd -d -f tmplimit.zst --memlimit=2K -c > $INTOVOID && die "decompression needs more memory than a…
288 zstd -d -f tmplimit.zst --memory=2K -c > $INTOVOID && die "decompression needs more memory than all…
289 zstd -d -f tmplimit.zst --memlimit-decompress=2K -c > $INTOVOID && die "decompression needs more me…
292 zstd -q tmp && die "overwrite check failed!"
294 zstd -q -f tmp
295 zstd -q --force tmp
301 zstd -q tmpro && die "should have refused to overwrite read-only file"
302 zstd -q -f tmpro
304 zstd tmpro -c --no-progress | zstd -d -f -o "$INTOVOID" --no-progress
305 zstd tmpro -cv --no-progress | zstd -dv -f -o "$INTOVOID" --no-progress
307 zstd tmpro -c | zstd -d -f -o "$INTOVOID" --progress 2>&1 | $GREP '[A-Za-z0-9._ ]*: [0-9]* bytes'
308 zstd tmpro -c | zstd -d -f -q -o "$INTOVOID" --progress 2>&1 | $GREP '[A-Za-z0-9._ ]*: [0-9]* bytes'
309 zstd tmpro -c | zstd -d -f -v -o "$INTOVOID" 2>&1 | $GREP '[A-Za-z0-9._ ]*: [0-9]* bytes'
312 zstd tmp -fo tmp && die "zstd compression overwrote the input file"
313 zstd tmp.zst -dfo tmp.zst && die "zstd decompression overwrote the input file"
315 zstd nothere && die "zstd hasn't detected that input file does not exist"
317 zstd tmp -c --no-compress-literals -1 | zstd -t
318 zstd tmp -c --no-compress-literals --fast=1 | zstd -t
319 zstd tmp -c --no-compress-literals -19 | zstd -t
320 zstd tmp -c --compress-literals -1 | zstd -t
321 zstd tmp -c --compress-literals --fast=1 | zstd -t
322 zstd tmp -c --compress-literals -19 | zstd -t
323 zstd -b --fast=1 -i0e1 tmp --compress-literals
324 zstd -b --fast=1 -i0e1 tmp --no-compress-literals
326 zstd -f tmp -o tmp_corrupt.zst --check
327 zstd -f tmp -o tmp.zst --no-check
329 zstd -d -f tmp_corrupt.zst --no-check
330 zstd -d -f tmp_corrupt.zst --check --no-check # final flag overrides
331 zstd -d -f tmp.zst --no-check
336 readelf -lW "$ZSTD_BIN" | $GREP 'GNU_STACK .* RW ' || die "zstd binary has executable stack!"
344 zstd --fast --single-thread tmp -o tmpMT0
346 zstd --fast -T1 tmp -o tmpMT1
348 zstd --fast -T2 tmp -o tmpMT2
350 zstd --fast -T16 tmp -o tmpMT3
352 zstd --fast -T127 tmp -o tmpMT4
354 zstd --fast -T128 tmp -o tmpMT5
356 zstd --fast -4294967295 tmp -o tmpMT6
358 zstd --fast -4294967296 tmp -o tmptest9 && die "max allowed numeric value is 4294967295"
362 zstd -f tmp # trivial compression case, creates tmp.zst
364 zstd -d -f -T1 tmp.zst
371 zstd -f tmp # trivial compression case, creates tmp.zst
373 zstd --fast=1 -f tmp
375 zstd --fast=99 -f tmp
377 zstd --fast=-1 -f tmp && die "error: Invalid value -- negative number"
379 zstd --fast=0 -f tmp && die "error: Invalid value -- 0 number"
381 zstd --fast=4294967295 -f tmp
383 zstd --fast=4294967296 -f tmp && die "max allowed argument of --fast is 4294967295"
390 zstd --exclude-compressed --long --rm -r precompressedFilterTestDir
393 zstd --exclude-compressed --long --rm -r precompressedFilterTestDir
405 zstd --exclude-compressed --long --rm -r precompressedFilterTestDir
406 # zstd should compress input.zstbar
409 zstd --long --rm -r precompressedFilterTestDir
418 zstd --exclude-compressed --long --rm -r precompressedFilterTestDir
422 zstd --long --rm -r precompressedFilterTestDir
434 zstd tmpPrompt -f
435 zstd < tmpPrompt -o tmpPrompt.zst && die "should have aborted immediately and failed to overwrite"
436 zstd < tmpPrompt -o tmpPrompt.zst -f # should successfully overwrite with -f
437 zstd -q -d -f tmpPrompt.zst -o tmpPromptRegenerated
440 echo 'yes' | zstd tmpPrompt -v -o tmpPrompt.zst # accept piped "y" input to force overwrite when u…
441 echo 'yes' | zstd < tmpPrompt -v -o tmpPrompt.zst && die "should have aborted immediately and faile…
442 zstd tmpPrompt - < tmpPrompt -o tmpPromp.zst --rm && die "should have aborted immediately and faile…
449 zstd -c -r < tmp > tmp.zst
453 zstd -r tmpEmptyDir
458 zstd -f --rm tmp
460 zstd -f -d --rm tmp.zst
464 zstd --rm tmp -c > $INTOVOID
466 zstd --rm tmp --stdout > $INTOVOID
468 zstd -f --rm tmp -c > $INTOVOID
470 zstd -f tmp -c > $INTOVOID --rm
474 zstd --rm tmp tmp2 -c > $INTOVOID
478 echo 'y' | zstd -v tmp tmp2 -o tmp3.zst --rm # prompt for confirmation
481 zstd -f tmp tmp2 -o tmp3.zst --rm # just warns, no prompt
484 zstd -q tmp tmp2 -o tmp3.zst --rm && die "should refuse to concatenate"
487 zstd --rm tmp2 -o tmp2.zst
493 zstd --rm tmp2 -c > $INTOVOID -o tmp2.zst
498 zstd -v --rm tmp2 -o tmp2.zst -c > tmp3.zst
503 zstd tmp -f -o "$DEVDEVICE" 2>tmplog > "$INTOVOID"
506 zstd tmp -f -o "$INTOVOID" 2>&1 | $GREP "Refusing to remove non-regular file" && die
508 println a | zstd --rm > $INTOVOID # --rm should remain silent
510 zstd -f tmp && die "tmp not present : should have failed"
514 zstd -d -f tmp.zst && die "attempt to decompress a non existing file"
519 zstd -f tmp && die "attempt to compress a non existing file"
526 # older versions of zstd cli are not able to decode such corner case.
527 # As a consequence, the zstd cli do not generate them, to maintain compatibility with older version…
529 zstd -d -o tmp1 "$TESTDIR/golden-decompression/rle-first-block.zst"
533 zstd -d -o tmp2 "$TESTDIR/golden-decompression/empty-block.zst"
536 zstd -t "$TESTDIR/golden-decompression/zeroSeq_2B.zst"
538 zstd -t "$TESTDIR/golden-decompression-errors/zeroSeq_extraneous.zst" && die "invalid Sequences sec…
545 zstd tmp1 tmp2 -o "$INTOVOID" -f
546 zstd tmp1 tmp2 -c | zstd -t
547 echo 'y' | zstd -v tmp1 tmp2 -o tmp.zst
550 zstd tmp1 tmp2
551 zstd -t tmp1.zst tmp2.zst
552 zstd -dc tmp1.zst tmp2.zst
553 zstd tmp1.zst tmp2.zst -o "$INTOVOID" -f
554 echo 'y' | zstd -v -d tmp1.zst tmp2.zst -o tmp
556 zstd tmp1 tmp2 -f -o tmpexists
557 zstd tmp1 tmp2 -q -o tmpexists && die "should have refused to overwrite"
561 echo 'y' | zstd -v tmp_rm1 tmp_rm2 -v -o tmp_rm3.zst
565 echo 'Y' | zstd -v -d tmp_rm3.zst tmp_rm4.zst -v -o tmp_rm_out --rm
569 zstd tmpexists1 tmpexists -c --rm -f > $INTOVOID
581 zstd -f tmp*
587 zstd -df ./*.zst
592 zstd -c tmp1 tmp2 tmp3 > tmpall
596 zstd -dc tmpall* > tmpdec
599 zstd -f tmp1 notHere tmp2 && die "missing file not detected!"
604 println "\n===> zstd fifo named pipe test "
609 zstd tmp_named_pipe -o tmp_compressed
610 zstd -d -o tmp_decompressed tmp_compressed
615 println "\n===> zstd created file permissions tests"
628 zstd -f tmp1 -o tmp1.zst
631 zstd -f -d tmp1.zst -o tmp1.out
639 zstd -f tmp1 -o tmp1.zst
642 zstd -f -d tmp1.zst -o tmp1
648 zstd -f -o tmp1.zst < tmp1
651 zstd -f -d -o tmp1.out < tmp1.zst
657 zstd -f tmp1 tmp2 -o tmp1.zst
661 zstd -f -d tmp1.zst tmp2.zst -o tmp1.out
670 zstd -f tmp1 -o tmp1.zst
676 zstd -f -d tmp1.zst -o tmp1.out
685 zstd -f -o tmp1.zst < tmp1
689 zstd -f -d -o tmp1.out < tmp1.zst
703 zstd tmp -f -o tmp.zst
713 println "\n===> checking that zstd can read from a block device"
720 zstd -d tmp.img.zst -o tmp.img.copy
726 println "\n===> zstd created file timestamp tests"
730 zstd -f tmp -o tmp.zst
733 zstd -f -d tmp.zst -o tmp.out
746 zstd tmp1 tmpInputTestDir/we/must/go/deeper/tmp2 --output-dir-flat tmpOutDir
751 zstd tmpOutDir -r -d --output-dir-flat tmpOutDirDecomp
755 zstd tmpOutDir -r -d --output-dir-flat=tmpOutDirDecomp
765 zstd tmp1 -r tmpInputTestDir --output-dir-mirror tmpOutDir
770 …zstd -r tmpInputTestDir/we/.../..must/../..mustgo/deeper.. --output-dir-mirror non-exist && die "…
771 …zstd -r tmpInputTestDir/we/.../..must/deeper../.. --output-dir-mirror non-exist && die "input can…
772 …zstd -r ../tests/tmpInputTestDir/we/.../..must/deeper.. --output-dir-mirror non-exist && die "inp…
776 zstd -r tmpInputTestDir/we/.../..must/go/deeper.. --output-dir-mirror tmpout
780 zstd tmpOutDir -r -d --output-dir-mirror tmpOutDirDecomp
785 …zstd -r tmpOutDir/tmpInputTestDir/we/.../..must/../..must --output-dir-mirror non-exist && die "i…
797 zstd -f --filelist=tmp_fileList
802 zstd -f --filelist tmp_fileList
809 zstd -f --filelist=tmp_symLink
819 zstd -f --filelist=tmp_fileList --filelist=tmp_fileList2
829 zstd -d -f --filelist=tmpZst
837 zstd -d -f --filelist=tmpZst --filelist=tmpZst2
845 zstd -qq -f --filelist=tmp_badList && die "should have failed : file name length is too long" # pr…
849 zstd -qq -f --filelist=tmp_badList && die "should have failed : list is text garbage" # printing v…
853 zstd -qq -f --filelist=tmp_badList && die "should have failed : list is binary garbage" # let's av…
858 zstd -f tmp1 --filelist=tmpList --filelist=tmpList tmp2 tmp3 # can trigger an overflow of internal…
864 zstd -f tmp_contentsize
865 zstd -lv tmp_contentsize.zst | $GREP "Decompressed Size:"
866 zstd -f --no-content-size tmp_contentsize
867 zstd -lv tmp_contentsize.zst | $GREP "Decompressed Size:" && die
868 zstd -f --content-size tmp_contentsize
869 zstd -lv tmp_contentsize.zst | $GREP "Decompressed Size:"
870 zstd -f --content-size --no-content-size tmp_contentsize
871 zstd -lv tmp_contentsize.zst | $GREP "Decompressed Size:" && die
876 zstd --show-default-cparams -f tmp
877 zstd --show-default-cparams -d tmp.zst && die "error: can't use --show-default-cparams in decompres…
885 zstd --show-default-cparams -f -r tmp_files
890 zstd -vv tmp 2>&1 | \
891 $GREP -q -- "--zstd=wlog=[0-9]*,clog=[0-9]*,hlog=[0-9]*,slog=[0-9]*,mml=[0-9]*,tlen=[0-9]*,strat=[0…
895 println "Hello world!" | zstd --zstd=windowLog=21, - -o tmp.zst && die "wrong parameters not d…
896 println "Hello world!" | zstd --zstd=windowLo=21 - -o tmp.zst && die "wrong parameters not d…
897 println "Hello world!" | zstd --zstd=windowLog=21,slog - -o tmp.zst && die "wrong parameters not d…
898 println "Hello world!" | zstd --zstd=strategy=10 - -o tmp.zst && die "parameter out of bound…
901 roundTripTest -g512K " --zstd=mml=3,tlen=48,strat=6"
902 roundTripTest -g512K " --zstd=strat=6,wlog=23,clog=23,hlog=22,slog=6"
903 roundTripTest -g512K " --zstd=windowLog=23,chainLog=23,hashLog=22,searchLog=6,minMatch=3,targetLeng…
904 roundTripTest -g512K " --single-thread --long --zstd=ldmHashLog=20,ldmMinMatch=64,ldmBucketSizeLog=…
905 roundTripTest -g512K " --single-thread --long --zstd=lhlog=20,lmml=64,lblog=1,lhrlog=7"
906 roundTripTest -g64K "19 --zstd=strat=9" # btultra2
910 println "Hello world 1!" | zstd -df
911 println "Hello world 2!" | zstd -dcf
913 zstd -dcf tmp1
914 println "" | zstd -df > tmp1
917 println "1" | zstd -df > tmp1
920 println "12" | zstd -df > tmp1
930 zstd -c hello.tmp > hello.zst
931 zstd -c world.tmp > world.zst
932 zstd -c hello.tmp world.tmp > helloworld.zst
933 zstd -dc helloworld.zst > result.tmp
936 zstd -dc helloworld.zst > result.tmp
940 zstd -c hello.tmp > hello.zst --no-check
941 zstd -c world.tmp > world.zst --no-check
942 cat hello.zst world.zst > helloworld.zstd
943 zstd -dc helloworld.zst > result.tmp
961 rm -f ./*.tmp ./*.zstd
968 println "println foo | zstd > /dev/full"
969 println foo | zstd > /dev/full && die "write error not detected!"
970 println "println foo | zstd | zstd -d > /dev/full"
971 println foo | zstd | zstd -d > /dev/full && die "write error not detected!"
984 zstd world.tmp hello.tmp || true
987 zstd world.tmp || true
989 zstd world.tmp world2.tmp || true
992 zstd world.tmp hello.tmp -f
1002 zstd tmpSparse -c | zstd -dv -o tmpSparseRegen
1004 zstd tmpSparse -c | zstd -dv --sparse -c > tmpOutSparse
1006 zstd tmpSparse -c | zstd -dv --no-sparse -c > tmpOutNoSparse
1009 datagen -s1 -g1200007 -P100 | zstd | zstd -dv --sparse -c > tmpSparseOdd # Odd size file (to not …
1013 println "Hello World 1 !" | zstd | zstd -d -c
1014 println "Hello World 2 !" | zstd | zstd -d | cat
1018 zstd -v -f tmpSparse1M -o tmpSparseCompressed
1019 zstd -d -v -f tmpSparseCompressed -o tmpSparseRegenerated
1020 zstd -d -v -f tmpSparseCompressed -c >> tmpSparseRegenerated
1030 file_size=$(zstd -14 -f tmp -o tmp.zst && wc -c < tmp.zst)
1031 stream_size=$(cat tmp | zstd -14 --stream-size=11000 | wc -c)
1036 cat tmp | zstd -14 -f tmp -o tmp.zst --stream-size=11000
1037 zstd -df tmp.zst -o tmp_decompress
1040 cat tmp | zstd -14 -f -o tmp.zst --stream-size=11001 && die "should fail with incorrect stream size"
1042 println "\n===> zstd zero weight dict test "
1045 zstd -D "$TESTDIR/dict-files/zero-weight-dict" tmp_input
1046 zstd -D "$TESTDIR/dict-files/zero-weight-dict" -d tmp_input.zst -o tmp_decomp
1050 println "\n===> zstd (valid) zero weight dict test "
1054 zstd -D "$TESTDIR/dict-files/zero-weight-dict" tmp_input
1055 zstd -D "$TESTDIR/dict-files/zero-weight-dict" -d tmp_input.zst -o tmp_decomp
1065 file_size=$(zstd -14 -f tmp -o tmp.zst && wc -c < tmp.zst)
1066 stream_size=$(cat tmp | zstd -14 --size-hint=11000 | wc -c)
1071 cat tmp | zstd -14 -f -o tmp.zst --size-hint=11000
1072 zstd -df tmp.zst -o tmp_decompress
1075 cat tmp | zstd -14 -f -D tmpDict --size-hint=11000 | zstd -t -D tmpDict
1077 zstd -14 -f -D tmpDict --size-hint=11000 tmp tmp2
1078 zstd -14 -f -o tmp1_.zst -D tmpDict --size-hint=11000 tmp
1079 zstd -14 -f -o tmp2_.zst -D tmpDict --size-hint=11000 tmp2
1083 cat tmp | zstd -14 -f --size-hint=11050 | zstd -t # slightly too high
1084 cat tmp | zstd -14 -f --size-hint=10950 | zstd -t # slightly too low
1085 cat tmp | zstd -14 -f --size-hint=22000 | zstd -t # considerably too high
1086 cat tmp | zstd -14 -f --size-hint=5500 | zstd -t # considerably too low
1088 cat tmp | zstd -14 -f --size-hint=11K | zstd -t
1089 cat tmp | zstd -14 -f --size-hint=11KB | zstd -t
1090 cat tmp | zstd -14 -f --size-hint=11KiB | zstd -t
1091 cat tmp | zstd -14 -f --size-hint=1M | zstd -t
1092 cat tmp | zstd -14 -f --size-hint=1MB | zstd -t
1093 cat tmp | zstd -14 -f --size-hint=1MiB | zstd -t
1100 zstd --train -B2K tmpCorpusHighCompress -o tmpDictHighCompress
1101 zstd --train -B2K tmpCorpusLowCompress -o tmpDictLowCompress
1106 datagen -g1M | zstd -D tmpDict | zstd -D tmpDict -dvq | $MD5SUM > tmp2
1110 zstd --train "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpDict
1113 zstd -f tmpDict -D tmpDict && die "compression error not detected!"
1115 zstd -f tmp -D tmpDict
1116 zstd -d tmp.zst -D tmpDict -fo result
1119 zstd -6f tmp -D tmpDict --zstd=clog=25,hlog=23
1121 zstd -f tmp -D tmpDict --zstd=strategy=6
1122 zstd -d tmp.zst -D tmpDict -fo result
1126 cat tmpDict | zstd -f tmp -D /proc/self/fd/0 && die "Piped dictionary should fail!"
1127 cat tmpDict | zstd -d tmp.zst -D /proc/self/fd/0 -f && die "Piped dictionary should fail!"
1132 datagen -g5M | zstd -T2 -D tmpDict | zstd -t -D tmpDict # fails with v1.3.2
1135 zstd --train "$TESTDIR"/*.c "$PRGDIR"/*.c "$PRGDIR"/*.h -o tmpDictC
1136 zstd -d tmp.zst -D tmpDictC -fo result && die "wrong dictionary not detected!"
1138 zstd --train "$TESTDIR"/*.c "$PRGDIR"/*.c --dictID=1 -o tmpDict1
1141 zstd --train "$TESTDIR"/*.c "$PRGDIR"/*.c --dictID -o 1 tmpDict1 && die "wrong order : --dictID mus…
1143 zstd --train "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpDict2 --maxdict=4K -v
1145 zstd --train "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpDict3 --maxdict=1K -v
1147 zstd --train "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpDict3 --maxdict -v 4K && die "wrong order : --maxdi…
1149 zstd -f tmp -D tmpDict1 --no-dictID
1150 zstd -d tmp.zst -D tmpDict -fo result
1159 zstd -f --rm dirTestDict/* -D tmpDictC
1160 zstd -d --rm dirTestDict/*.zst -D tmpDictC # note : use internal checksum by default
1168 zstd --train-legacy -q tmp && die "Dictionary training should fail : not enough input source"
1170 zstd --train-legacy -q tmp && die "Dictionary training should fail : source is pure noise"
1173 zstd -o tmpDict --train "$TESTDIR"/*.c "$PRGDIR"/*.c
1175 zstd --train "$TESTDIR"/*.c "$PRGDIR"/*.c
1180 zstd --train -T0 "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpDict
1186 zstd --train -B2K tmpCorpusHighCompress -o tmpDictHighCompress --memory=10K && die "Dictionary trai…
1187 zstd --train -B2K tmpCorpusHighCompress -o tmpDictHighCompress --memory=5MB 2> zstTrainWithMemLimit…
1196 zstd --train-fastcover=k=46,d=8,f=15,split=80 "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpDict
1198 zstd -f tmp -D tmpDict
1199 zstd -d tmp.zst -D tmpDict -fo result
1202 zstd --train-fastcover=k=56,d=8 "$TESTDIR"/*.c "$PRGDIR"/*.c "$PRGDIR"/*.h -o tmpDictC
1203 zstd -d tmp.zst -D tmpDictC -fo result && die "wrong dictionary not detected!"
1204 zstd --train-fastcover=k=56,d=8 && die "Create dictionary without input file"
1206 zstd --train-fastcover=k=46,d=8,f=15,split=80 "$TESTDIR"/*.c "$PRGDIR"/*.c --dictID=1 -o tmpDict1
1209 zstd --train-fastcover=steps=1,shrink "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpShrinkDict
1210 zstd --train-fastcover=steps=1,shrink=1 "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpShrinkDict1
1211 zstd --train-fastcover=steps=1,shrink=5 "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpShrinkDict2
1212 zstd --train-fastcover=shrink=5,steps=1 "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpShrinkDict3
1214 zstd --train-fastcover=steps=1 "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpDict2 --maxdict=4K
1216 zstd --train-fastcover=k=56,d=8,split=100 -r "$TESTDIR"/*.c "$PRGDIR"/*.c
1218 zstd --train-fastcover=k=56,d=8,f=16 -r "$TESTDIR"/*.c "$PRGDIR"/*.c
1219 zstd --train-fastcover=k=56,d=8,accel=15 -r "$TESTDIR"/*.c "$PRGDIR"/*.c && die "Created dictionary…
1221 zstd --train-fastcover=k=56,d=8,accel=2 -r "$TESTDIR"/*.c "$PRGDIR"/*.c
1223 zstd --train-fastcover=k=56,d=8,accel=10 -r "$TESTDIR"/*.c "$PRGDIR"/*.c
1225 zstd --train-fastcover -T4 -r "$TESTDIR"/*.c "$PRGDIR"/*.c
1228 zstd -o tmpDict --train-fastcover=k=56,d=8 "$TESTDIR"/*.c "$PRGDIR"/*.c
1230 zstd --train-fastcover=k=56,d=8 "$TESTDIR"/*.c "$PRGDIR"/*.c
1240 zstd --train-legacy=selectivity=8 "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpDict
1242 zstd -f tmp -D tmpDict
1243 zstd -d tmp.zst -D tmpDict -fo result
1245 zstd --train-legacy=s=8 && die "Create dictionary without input files (should error)"
1247 zstd --train-legacy=s=5 "$TESTDIR"/*.c "$PRGDIR"/*.c "$PRGDIR"/*.h -o tmpDictC
1248 zstd -d tmp.zst -D tmpDictC -fo result && die "wrong dictionary not detected!"
1250 zstd --train-legacy -s5 "$TESTDIR"/*.c "$PRGDIR"/*.c --dictID=1 -o tmpDict1
1253 zstd --train-legacy -s9 "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpDict2 --maxdict=4K
1256 zstd -o tmpDict --train-legacy "$TESTDIR"/*.c "$PRGDIR"/*.c
1258 zstd --train-legacy "$TESTDIR"/*.c "$PRGDIR"/*.c
1267 zstd tmp1
1268 zstd -t tmp1.zst
1269 zstd --test tmp1.zst
1271 zstd -t ./*.zst
1273 zstd -t ./* && die "bad files not detected !"
1274 zstd -t tmp1 && die "bad file not detected !"
1276 zstd -t tmp2.zst && die "bad file not detected !"
1278 zstd -t tmp3 && die "bad file not detected !" # detects 0-sized files as bad
1280 zstd -t --rm tmp1.zst
1283 zstd -t tmp1.zst tmp2.zst --rm
1287 zstd -t tmpSplit.* && die "bad file not detected !"
1288 datagen | zstd -c | zstd -t
1293 zstd -t -r "$TESTDIR/golden-decompression"
1294 zstd -c -r "$TESTDIR/golden-compression" | zstd -t
1295 zstd -D "$TESTDIR/golden-dictionaries/http-dict-missing-symbols" "$TESTDIR/golden-compression/http"…
1302 zstd -bi0 tmp1
1304 zstd -i0b0e3 tmp1
1306 zstd -bi0 --fast tmp1
1308 zstd -rqi0b1e2 tmp1
1310 zstd -f tmp1
1311 zstd -b -d -i0 tmp1.zst
1313 zstd -b -d -i0 tmp1 && die "invalid .zst data => benchmark should have failed"
1316 zstd --format=gzip -V || GZIPMODE=0
1318 println "benchmark mode is only compatible with zstd"
1319 zstd --format=gzip -b tmp1 && die "-b should be incompatible with gzip format!"
1322 println "\n===> zstd compatibility tests "
1326 zstd --format=zstd -f tmp
1333 zstd --format=gzip -V || GZIPMODE=0
1340 zstd --format=gzip -f tmp
1343 zstd -d -f -v tmp.gz
1357 zstd -f --format=gzip tmp
1358 zstd -f tmp
1359 cat tmp.gz tmp.zst tmp.gz tmp.zst | zstd -d -f -o tmp
1360 truncateLastByte tmp.gz | zstd -t > $INTOVOID && die "incomplete frame not detected !"
1369 zstd --format=gzip --format=zstd -f tmp
1376 zstd --format=xz -V || LZMAMODE=0
1382 println "Testing zstd xz and lzma support"
1384 zstd --format=lzma -f tmp
1385 zstd --format=xz -f tmp
1390 zstd -d -f -v tmp.xz
1391 zstd -d -f -v tmp.lzma
1423 zstd -f --format=xz tmp
1424 zstd -f --format=lzma tmp
1425 zstd -f tmp
1426 cat tmp.xz tmp.lzma tmp.zst tmp.lzma tmp.xz tmp.zst | zstd -d -f -o tmp
1427 truncateLastByte tmp.xz | zstd -t > $INTOVOID && die "incomplete frame not detected !"
1428 truncateLastByte tmp.lzma | zstd -t > $INTOVOID && die "incomplete frame not detected !"
1437 zstd --format=lz4 -V || LZ4MODE=0
1444 zstd --format=lz4 -f tmp
1447 zstd -d -f -v tmp.lz4
1460 zstd -f --format=lz4 tmp
1461 zstd -f tmp
1462 cat tmp.lz4 tmp.zst tmp.lz4 tmp.zst | zstd -d -f -o tmp
1463 truncateLastByte tmp.lz4 | zstd -t > $INTOVOID && die "incomplete frame not detected !"
1472 ! zstd -d tmp.abc 2> tmplg
1488 zstd tmp1 -o tmp1.zstd
1489 zstd -d -f tmp1.zstd # support .zstd suffix even though it's not the default suffix
1493 rm -f tmp tmp.tar tmp.tzst tmp.tgz tmp.txz tmp.tlz4 tmp1.zstd
1497 zstd tmp.tar -o tmp.tzst
1499 zstd -d tmp.tzst
1505 zstd -d tmp.tgz
1511 tar -f - -c tmp | zstd --format=xz > tmp.txz
1512 zstd -d tmp.txz
1518 tar -f - -c tmp | zstd --format=lz4 > tmp.tlz4
1519 zstd -d tmp.tlz4
1525 ! zstd -d tmp.t
1526 ! zstd -d tmp.tz
1527 ! zstd -d tmp.tzs
1530 println "\n===> zstd round-trip tests "
1543 println "\n===> zstd long distance matching round-trip tests "
1570 ZSTD_NBTHREADS=-3 zstd -f mt_tmp # negative value, warn and revert to default setting
1571 ZSTD_NBTHREADS='' zstd -f mt_tmp # empty env var, warn and revert to default setting
1572 ZSTD_NBTHREADS=- zstd -f mt_tmp # malformed env var, warn and revert to default setting
1573 ZSTD_NBTHREADS=a zstd -f mt_tmp # malformed env var, warn and revert to default setting
1574 ZSTD_NBTHREADS=+a zstd -f mt_tmp # malformed env var, warn and revert to default setting
1575 ZSTD_NBTHREADS=3a7 zstd -f mt_tmp # malformed env var, warn and revert to default setting
1576 …ZSTD_NBTHREADS=50000000000 zstd -f mt_tmp # numeric value too large, warn and revert to default se…
1577 ZSTD_NBTHREADS=2 zstd -f mt_tmp # correct usage
1578 ZSTD_NBTHREADS=1 zstd -f mt_tmp # correct usage: single thread
1585 refSize=$(zstd tmp -6 -c --zstd=wlog=18 | wc -c)
1586 ov9Size=$(zstd tmp -6 -c --zstd=wlog=18,ovlog=9 | wc -c)
1587 ov1Size=$(zstd tmp -6 -c --zstd=wlog=18,ovlog=1 | wc -c)
1607 println "\n===> zstd --list/-l single frame tests "
1611 zstd tmp*
1612 zstd -l ./*.zst
1613 zstd -lv ./*.zst | $GREP "Decompressed Size:" # check that decompressed size is present in header
1614 zstd --list ./*.zst
1615 zstd --list -v ./*.zst
1617 println "\n===> zstd --list/-l multiple frame tests "
1620 zstd -l ./*.zst
1621 zstd -lv ./*.zst
1623 println "\n===> zstd --list/-l error detection tests "
1624 zstd -l tmp1 tmp1.zst && die "-l must fail on non-zstd file"
1625 zstd --list tmp* && die "-l must fail on non-zstd file"
1626 zstd -lv tmp1* && die "-l must fail on non-zstd file"
1627 zstd --list -v tmp2 tmp12.zst && die "-l must fail on non-zstd file"
1634 zstd -f $TEST_DATA_FILE -o $FULL_COMPRESSED_FILE
1636 zstd --list $TRUNCATED_COMPRESSED_FILE && die "-l must fail on truncated file"
1642 println "\n===> zstd --list/-l errors when presented with stdin / no files"
1643 zstd -l && die "-l must fail on empty list of files"
1644 zstd -l - && die "-l does not work on stdin"
1645 zstd -l < tmp1.zst && die "-l does not work on stdin"
1646 zstd -l - < tmp1.zst && die "-l does not work on stdin"
1647 zstd -l - tmp1.zst && die "-l does not work on stdin"
1648 zstd -l - tmp1.zst < tmp1.zst && die "-l does not work on stdin"
1649 zstd -l tmp1.zst < tmp2.zst # this will check tmp1.zst, but not tmp2.zst, which is not an error : z…
1651 println "\n===> zstd --list/-l test with null files "
1653 zstd tmp5
1654 zstd -l tmp5.zst
1655 zstd -l tmp5* && die "-l must fail on non-zstd file"
1656 zstd -lv tmp5.zst | $GREP "Decompressed Size: 0 B (0 B)" # check that 0 size is present in header
1657 zstd -lv tmp5* && die "-l must fail on non-zstd file"
1659 println "\n===> zstd --list/-l test with no content size field "
1660 datagen -g513K | zstd > tmp6.zst
1661 zstd -l tmp6.zst
1662 zstd -lv tmp6.zst | $GREP "Decompressed Size:" && die "Field :Decompressed Size: should not be ava…
1664 println "\n===> zstd --list/-l test with no checksum "
1665 zstd -f --no-check tmp1
1666 zstd -l tmp1.zst
1667 zstd -lv tmp1.zst
1669 println "\n===> zstd trace tests "
1670 zstd -f --trace tmp.trace tmp1
1671 zstd -f --trace tmp.trace tmp1 tmp2 tmp3
1672 zstd -f --trace tmp.trace tmp1 tmp2 tmp3 -o /dev/null
1673 zstd -f --trace tmp.trace tmp1 tmp2 tmp3 --single-thread
1674 zstd -f --trace tmp.trace -D tmp1 tmp2 tmp3 -o /dev/null
1675 zstd -f --trace tmp.trace -D tmp1 tmp2 tmp3 -o /dev/null --single-thread
1676 zstd --trace tmp.trace -t tmp1.zst
1677 zstd --trace tmp.trace -t tmp1.zst tmp2.zst
1678 zstd -f --trace tmp.trace -d tmp1.zst
1679 zstd -f --trace tmp.trace -d tmp1.zst tmp2.zst tmp3.zst
1680 zstd -D tmp1 tmp2 -c | zstd --trace tmp.trace -t -D tmp1
1681 zstd -b1e10i0 --trace tmp.trace tmp1
1682 zstd -b1e10i0 --trace tmp.trace tmp1 tmp2 tmp3
1687 println "\n===> zstd long distance matching tests "
1692 roundTripTest -g1M -P50 "1 --single-thread --long=29 --zstd=wlog=28" " --memory=256MB"
1694 roundTripTest -g1M -P50 "1 --single-thread --long=29" " --zstd=wlog=28 --memory=512MB"
1698 println "\n===> zstd long distance matching with optimal parser compressed size tests "
1699 optCSize16=$(datagen -g511K | zstd -16 -c | wc -c)
1700 longCSize16=$(datagen -g511K | zstd -16 --long -c | wc -c)
1701 optCSize19=$(datagen -g2M | zstd -19 -c | wc -c)
1702 longCSize19=$(datagen -g2M | zstd -19 --long -c | wc -c)
1703 optCSize19wlog23=$(datagen -g2M | zstd -19 -c --zstd=wlog=23 | wc -c)
1704 longCSize19wlog23=$(datagen -g2M | zstd -19 -c --long=23 | wc -c)
1717 println "\n===> zstd asyncio tests "
1721 datagen -g2M -s$2 | zstd -1 --format=$1 >> tmp_compressed.zst
1735 testAsyncIO zstd
1736 addTwoFrames zstd
1750 zstd -d tmp_compressed.zst --asyncio -c | $MD5SUM > tmp1
1753 zstd -d tmp_compressed.zst --no-asyncio -c | $MD5SUM > tmp1
1773 zstd --adapt= tmp && die "invalid compression parameter"
1774 zstd -f -vv --adapt=min=10,max=9 tmp && die "--adapt must fail on incoherent bounds"
1780 zstd -f -vv --rsyncable --single-thread tmp && die "--rsyncable must fail with --single-thread"
1786 zstd --patch-from=tmp_dict tmp_patch -o tmp_patch_diff
1787 zstd -d --patch-from=tmp_dict tmp_patch_diff -o tmp_patch_recon
1791 zstd -f --patch-from tmp_dict tmp_patch -o tmp_patch_diff
1792 zstd -df --patch-from tmp_dict tmp_patch_diff -o tmp_patch_recon
1801 zstd --patch-from=tmp_dict -r tmp_dir && die
1813 zstd -15 --patch-from=tmp_dict tmp_patch 2>&1 | $GREP "long mode automatically triggered"
1819 zstd --long=30 -1f --patch-from tmp_dict tmp_patch
1820 zstd --long=30 -df --patch-from tmp_dict tmp_patch.zst -o tmp_patch_recon
1827 cat tmp_patch | zstd -f --patch-from=tmp_dict -c -o tmp_patch_diff && die
1828 cat tmp_patch | zstd -f --patch-from=tmp_dict --stream-size=1000 -c -o tmp_patch_diff
1857 roundTripTest -g5000000000 -P99 "1 --zstd=wlog=25"
1858 roundTripTest -g3700000000 -P0 "1 --zstd=strategy=6,wlog=25" # ensure btlazy2 can survive an over…
1863 println "\n===> zstd long, long distance matching round-trip tests "
1870 roundTripTest -g600M -P50 "1 --single-thread --long --zstd=wlog=29,clog=28"
1881 # Exposes the bug in https://github.com/facebook/zstd/pull/1678
1884 # roundTripTest -g10G -P99 "1 -T1 --long=31 --zstd=clog=27 --fast=1000"
1895 zstd --train-cover=k=46,d=8,split=80 "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpDict
1897 zstd -f tmp -D tmpDict
1898 zstd -f tmp -D tmpDict --patch-from=tmpDict && die "error: can't use -D and --patch-from=#at the sa…
1899 zstd -d tmp.zst -D tmpDict -fo result
1901 zstd --train-cover=k=56,d=8 && die "Create dictionary without input file (should error)"
1903 zstd --train-cover=k=56,d=8 "$TESTDIR"/*.c "$PRGDIR"/*.c "$PRGDIR"/*.h -o tmpDictC
1904 zstd -d tmp.zst -D tmpDictC -fo result && die "wrong dictionary not detected!"
1906 zstd --train-cover=steps=256,shrink "$TESTDIR"/*.c "$PRGDIR"/*.c --dictID=1 -o tmpShrinkDict
1907 zstd --train-cover=steps=256,shrink=1 "$TESTDIR"/*.c "$PRGDIR"/*.c --dictID=1 -o tmpShrinkDict1
1908 zstd --train-cover=steps=256,shrink=5 "$TESTDIR"/*.c "$PRGDIR"/*.c --dictID=1 -o tmpShrinkDict2
1909 zstd --train-cover=shrink=5,steps=256 "$TESTDIR"/*.c "$PRGDIR"/*.c --dictID=1 -o tmpShrinkDict3
1911 zstd --train-cover=k=46,d=8,split=80 "$TESTDIR"/*.c "$PRGDIR"/*.c --dictID=1 -o tmpDict1
1914 zstd --train-cover=steps=8 "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpDict2 --maxdict=4K
1916 zstd --train-cover=split=90 -r "$TESTDIR"/*.c "$PRGDIR"/*.c
1917 zstd --train-cover=split=80 -r "$TESTDIR"/*.c "$PRGDIR"/*.c
1919 zstd --train-cover=split=100 -r "$TESTDIR"/*.c "$PRGDIR"/*.c
1922 zstd -o tmpDict --train-cover "$TESTDIR"/*.c "$PRGDIR"/*.c
1924 zstd --train-cover "$TESTDIR"/*.c "$PRGDIR"/*.c