23 $ECHO "roundTripTest: ./datagen $1 $proba | $ZSTD -v$cLevel | $ZSTD -d$dLevel"
24 ./datagen $1 $proba | $MD5SUM > tmp1
25 ./datagen $1 $proba | $ZSTD --ultra -v$cLevel | $ZSTD -d$dLevel | $MD5SUM > tmp2
43 rm -f tmp.zstd tmp.md5.1 tmp.md5.2
44 $ECHO "fileRoundTripTest: ./datagen $1 $local_p > tmp && $ZSTD -v$local_c -c tmp | $ZSTD -d$local_d"
45 ./datagen $1 $local_p > tmp
46 < tmp $MD5SUM > tmp.md5.1
47 $ZSTD --ultra -v$local_c -c tmp | $ZSTD -d$local_d | $MD5SUM > tmp.md5.2
48 $DIFF -q tmp.md5.1 tmp.md5.2
52 if [ -t 0 ] && [ -t 1 ]
70 Darwin) MD5SUM="md5 -r" ;;
71 FreeBSD) MD5SUM="gmd5sum" ;;
77 SunOS) DIFF="gdiff" ;;
82 Darwin) ECHO="echo" ;;
85 $ECHO "\nStarting playTests.sh isWindows=$isWindows ZSTD='$ZSTD'"
87 [ -n "$ZSTD" ] || die "ZSTD variable must be defined!"
89 if [ -n "$(echo hello | $ZSTD -v -T2 2>&1 > $INTOVOID | grep 'multi-threading is disabled')" ]
96 $ECHO "\n===> simple tests "
99 $ECHO "test : basic compression "
100 $ZSTD -f tmp # trivial compression case, creates tmp.zst
101 $ECHO "test : basic decompression"
102 $ZSTD -df tmp.zst # trivial decompression case (overwrites tmp)
103 $ECHO "test : too large compression level (must fail)"
104 $ZSTD -99 -f tmp # too large compression level, automatic sized down
105 $ECHO "test : compress to stdout"
106 $ZSTD tmp -c > tmpCompressed
107 $ZSTD tmp --stdout > tmpCompressed # long command format
108 $ECHO "test : compress to named file"
110 $ZSTD tmp -o tmpCompressed
111 test -f tmpCompressed # file must be created
112 $ECHO "test : -o must be followed by filename (must fail)"
113 $ZSTD tmp -of tmpCompressed && die "-o must be followed by filename "
114 $ECHO "test : force write, correct order"
115 $ZSTD tmp -fo tmpCompressed
116 $ECHO "test : forgotten argument"
118 $ZSTD tmp2 -fo && die "-o must be followed by filename "
119 $ECHO "test : implied stdout when input is stdin"
120 $ECHO bob | $ZSTD | $ZSTD -d
121 if [ "$isTerminal" = true ]; then
122 $ECHO "test : compressed data to terminal"
123 $ECHO bob | $ZSTD && die "should have refused : compressed data to terminal"
124 $ECHO "test : compressed data from terminal (a hang here is a test fail, zstd is wrongly waiting on data from terminal)"
125 $ZSTD -d > $INTOVOID && die "should have refused : compressed data from terminal"
127 $ECHO "test : null-length file roundtrip"
128 $ECHO -n '' | $ZSTD - --stdout | $ZSTD -d --stdout
129 $ECHO "test : ensure small file doesn't add 3-bytes null block"
131 $ZSTD tmp1 -c | wc -c | grep "14"
132 $ZSTD < tmp1 | wc -c | grep "14"
133 $ECHO "test : decompress file with wrong suffix (must fail)"
134 $ZSTD -d tmpCompressed && die "wrong suffix error not detected!"
135 $ZSTD -df tmp && die "should have refused : wrong extension"
136 $ECHO "test : decompress into stdout"
137 $ZSTD -d tmpCompressed -c > tmpResult # decompression using stdout
138 $ZSTD --decompress tmpCompressed -c > tmpResult
139 $ZSTD --decompress tmpCompressed --stdout > tmpResult
140 $ECHO "test : decompress from stdin into stdout"
141 $ZSTD -dc < tmp.zst > $INTOVOID # combine decompression, stdin & stdout
142 $ZSTD -dc - < tmp.zst > $INTOVOID
143 $ZSTD -d < tmp.zst > $INTOVOID # implicit stdout when stdin is used
144 $ZSTD -d - < tmp.zst > $INTOVOID
145 $ECHO "test : impose memory limitation (must fail)"
146 $ZSTD -d -f tmp.zst -M2K -c > $INTOVOID && die "decompression needs more memory than allowed"
147 $ZSTD -d -f tmp.zst --memlimit=2K -c > $INTOVOID && die "decompression needs more memory than allowed" # long command
148 $ZSTD -d -f tmp.zst --memory=2K -c > $INTOVOID && die "decompression needs more memory than allowed" # long command
149 $ZSTD -d -f tmp.zst --memlimit-decompress=2K -c > $INTOVOID && die "decompression needs more memory than allowed" # long command
150 $ECHO "test : overwrite protection"
151 $ZSTD -q tmp && die "overwrite check failed!"
152 $ECHO "test : force overwrite"
155 $ECHO "test : overwrite readonly file"
156 rm -f tmpro tmpro.zst
157 $ECHO foo > tmpro.zst
160 $ZSTD -q tmpro && die "should have refused to overwrite read-only file"
162 rm -f tmpro tmpro.zst
163 $ECHO "test : file removal"
165 test ! -f tmp # tmp should no longer be present
166 $ZSTD -f -d --rm tmp.zst
167 test ! -f tmp.zst # tmp.zst should no longer be present
168 $ECHO "test : should quietly not remove non-regular file"
170 $ZSTD tmp -f -o "$DEVDEVICE" 2>tmplog > "$INTOVOID"
171 grep -v "Refusing to remove non-regular file" tmplog
173 $ZSTD tmp -f -o "$INTONULL" 2>&1 | grep -v "Refusing to remove non-regular file"
174 $ECHO "test : --rm on stdin"
175 $ECHO a | $ZSTD --rm > $INTOVOID # --rm should remain silent
177 $ZSTD -f tmp && die "tmp not present : should have failed"
178 test ! -f tmp.zst # tmp.zst should not be created
180 $ECHO "test : compress multiple files"
183 $ZSTD tmp1 tmp2 -o "$INTOVOID"
184 $ZSTD tmp1 tmp2 -c | $ZSTD -t
185 $ZSTD tmp1 tmp2 -o tmp.zst
189 $ZSTD -t tmp1.zst tmp2.zst
190 $ZSTD -dc tmp1.zst tmp2.zst
191 $ZSTD tmp1.zst tmp2.zst -o "$INTOVOID"
192 $ZSTD -d tmp1.zst tmp2.zst -o tmp
197 $ECHO "\n===> Advanced compression parameters "
198 $ECHO "Hello world!" | $ZSTD --zstd=windowLog=21, - -o tmp.zst && die "wrong parameters not detected!"
199 $ECHO "Hello world!" | $ZSTD --zstd=windowLo=21 - -o tmp.zst && die "wrong parameters not detected!"
200 $ECHO "Hello world!" | $ZSTD --zstd=windowLog=21,slog - -o tmp.zst && die "wrong parameters not detected!"
201 test ! -f tmp.zst # tmp.zst should not be created
203 roundTripTest -g512K " --zstd=slen=3,tlen=48,strat=6"
204 roundTripTest -g512K " --zstd=strat=6,wlog=23,clog=23,hlog=22,slog=6"
205 roundTripTest -g512K " --zstd=windowLog=23,chainLog=23,hashLog=22,searchLog=6,searchLength=3,targetLength=48,strategy=6"
206 roundTripTest -g512K " --long --zstd=ldmHashLog=20,ldmSearchLength=64,ldmBucketSizeLog=1,ldmHashEveryLog=7"
207 roundTripTest -g512K " --long --zstd=ldmhlog=20,ldmslen=64,ldmblog=1,ldmhevery=7"
208 roundTripTest -g512K 19
211 $ECHO "\n===> Pass-Through mode "
212 $ECHO "Hello world 1!" | $ZSTD -df
213 $ECHO "Hello world 2!" | $ZSTD -dcf
214 $ECHO "Hello world 3!" > tmp1
218 $ECHO "\n===> frame concatenation "
220 $ECHO "hello " > hello.tmp
221 $ECHO "world!" > world.tmp
222 cat hello.tmp world.tmp > helloworld.tmp
223 $ZSTD -c hello.tmp > hello.zstd
224 $ZSTD -c world.tmp > world.zstd
225 cat hello.zstd world.zstd > helloworld.zstd
226 $ZSTD -dc helloworld.zstd > result.tmp
228 $DIFF helloworld.tmp result.tmp
229 $ECHO "frame concatenation without checksum"
230 $ZSTD -c hello.tmp > hello.zstd --no-check
231 $ZSTD -c world.tmp > world.zstd --no-check
232 cat hello.zstd world.zstd > helloworld.zstd
233 $ZSTD -dc helloworld.zstd > result.tmp
235 $DIFF helloworld.tmp result.tmp
237 $ECHO "frame concatenation tests completed"
240 if [ "$isWindows" = false ] && [ "$UNAME" != 'SunOS' ] ; then
241 $ECHO "\n**** flush write error test **** "
243 $ECHO "$ECHO foo | $ZSTD > /dev/full"
244 $ECHO foo | $ZSTD > /dev/full && die "write error not detected!"
245 $ECHO "$ECHO foo | $ZSTD | $ZSTD -d > /dev/full"
246 $ECHO foo | $ZSTD | $ZSTD -d > /dev/full && die "write error not detected!"
249 $ECHO "\n===> symbolic link test "
251 rm -f hello.tmp world.tmp hello.tmp.zst world.tmp.zst
252 $ECHO "hello world" > hello.tmp
253 ln -s hello.tmp world.tmp
254 $ZSTD world.tmp hello.tmp
255 test -f hello.tmp.zst # regular file should have been compressed!
256 test ! -f world.tmp.zst # symbolic link should not have been compressed!
257 $ZSTD world.tmp hello.tmp -f
258 test -f world.tmp.zst # symbolic link should have been compressed with --force
259 rm -f hello.tmp world.tmp hello.tmp.zst world.tmp.zst
264 $ECHO "\n===> test sparse file support "
266 ./datagen -g5M -P100 > tmpSparse
267 $ZSTD tmpSparse -c | $ZSTD -dv -o tmpSparseRegen
268 $DIFF -s tmpSparse tmpSparseRegen
269 $ZSTD tmpSparse -c | $ZSTD -dv --sparse -c > tmpOutSparse
270 $DIFF -s tmpSparse tmpOutSparse
271 $ZSTD tmpSparse -c | $ZSTD -dv --no-sparse -c > tmpOutNoSparse
272 $DIFF -s tmpSparse tmpOutNoSparse
273 ls -ls tmpSparse* # look at file size and block size on disk
274 ./datagen -s1 -g1200007 -P100 | $ZSTD | $ZSTD -dv --sparse -c > tmpSparseOdd # Odd size file (to not finish on an exact nb of blocks)
275 ./datagen -s1 -g1200007 -P100 | $DIFF -s - tmpSparseOdd
276 ls -ls tmpSparseOdd # look at file size and block size on disk
277 $ECHO "\n Sparse Compatibility with Console :"
278 $ECHO "Hello World 1 !" | $ZSTD | $ZSTD -d -c
279 $ECHO "Hello World 2 !" | $ZSTD | $ZSTD -d | cat
280 $ECHO "\n Sparse Compatibility with Append :"
281 ./datagen -P100 -g1M > tmpSparse1M
282 cat tmpSparse1M tmpSparse1M > tmpSparse2M
283 $ZSTD -v -f tmpSparse1M -o tmpSparseCompressed
284 $ZSTD -d -v -f tmpSparseCompressed -o tmpSparseRegenerated
285 $ZSTD -d -v -f tmpSparseCompressed -c >> tmpSparseRegenerated
286 ls -ls tmpSparse* # look at file size and block size on disk
287 $DIFF tmpSparse2M tmpSparseRegenerated
291 $ECHO "\n===> multiple files tests "
293 ./datagen -s1 > tmp1 2> $INTOVOID
294 ./datagen -s2 -g100K > tmp2 2> $INTOVOID
295 ./datagen -s3 -g1M > tmp3 2> $INTOVOID
296 $ECHO "compress tmp* : "
300 $ECHO "decompress tmp* : "
303 $ECHO "compress tmp* into stdout > tmpall : "
304 $ZSTD -c tmp1 tmp2 tmp3 > tmpall
305 ls -ls tmp* # check size of tmpall (should be tmp1.zst + tmp2.zst + tmp3.zst)
306 $ECHO "decompress tmpall* into stdout > tmpdec : "
308 $ZSTD -dc tmpall* > tmpdec
309 ls -ls tmp* # check size of tmpdec (should be 2*(tmp1 + tmp2 + tmp3))
310 $ECHO "compress multiple files including a missing one (notHere) : "
311 $ZSTD -f tmp1 notHere tmp2 && die "missing file not detected!"
314 $ECHO "\n===> dictionary tests "
316 $ECHO "- test with raw dict (content only) "
318 ./datagen -g1M | $MD5SUM > tmp1
319 ./datagen -g1M | $ZSTD -D tmpDict | $ZSTD -D tmpDict -dvq | $MD5SUM > tmp2
321 $ECHO "- Create first dictionary "
322 TESTFILE=../programs/zstdcli.c
323 $ZSTD --train *.c ../programs/*.c -o tmpDict
325 $ZSTD -f tmp -D tmpDict
326 $ZSTD -d tmp.zst -D tmpDict -fo result
327 $DIFF $TESTFILE result
330 $ECHO "- Test dictionary compression with multithreading "
331 ./datagen -g5M | $ZSTD -T2 -D tmpDict | $ZSTD -t -D tmpDict # fails with v1.3.2
333 $ECHO "- Create second (different) dictionary "
334 $ZSTD --train *.c ../programs/*.c ../programs/*.h -o tmpDictC
335 $ZSTD -d tmp.zst -D tmpDictC -fo result && die "wrong dictionary not detected!"
336 $ECHO "- Create dictionary with short dictID"
337 $ZSTD --train *.c ../programs/*.c --dictID=1 -o tmpDict1
338 cmp tmpDict tmpDict1 && die "dictionaries should have different ID !"
339 $ECHO "- Create dictionary with wrong dictID parameter order (must fail)"
340 $ZSTD --train *.c ../programs/*.c --dictID -o 1 tmpDict1 && die "wrong order : --dictID must be followed by argument "
341 $ECHO "- Create dictionary with size limit"
342 $ZSTD --train *.c ../programs/*.c -o tmpDict2 --maxdict=4K -v
343 $ECHO "- Create dictionary with small size limit"
344 $ZSTD --train *.c ../programs/*.c -o tmpDict3 --maxdict=1K -v
345 $ECHO "- Create dictionary with wrong parameter order (must fail)"
346 $ZSTD --train *.c ../programs/*.c -o tmpDict3 --maxdict -v 4K && die "wrong order : --maxdict must be followed by argument "
347 $ECHO "- Compress without dictID"
348 $ZSTD -f tmp -D tmpDict1 --no-dictID
349 $ZSTD -d tmp.zst -D tmpDict -fo result
350 $DIFF $TESTFILE result
351 $ECHO "- Compress with wrong argument order (must fail)"
352 $ZSTD tmp -Df tmpDict1 -c > $INTOVOID && die "-D must be followed by dictionary name "
353 $ECHO "- Compress multiple files with dictionary"
357 cp ../programs/*.c dirTestDict
358 cp ../programs/*.h dirTestDict
359 $MD5SUM dirTestDict/* > tmph1
360 $ZSTD -f --rm dirTestDict/* -D tmpDictC
361 $ZSTD -d --rm dirTestDict/*.zst -D tmpDictC # note : use internal checksum by default
363 Darwin) $ECHO "md5sum -c not supported on OS-X : test skipped" ;; # not compatible with OS-X's md5
364 *) $MD5SUM -c tmph1 ;;
367 $ECHO "- dictionary builder on bogus input"
368 $ECHO "Hello World" > tmp
369 $ZSTD --train-legacy -q tmp && die "Dictionary training should fail : not enough input source"
370 ./datagen -P0 -g10M > tmp
371 $ZSTD --train-legacy -q tmp && die "Dictionary training should fail : source is pure noise"
375 $ECHO "\n===> cover dictionary builder : advanced options "
377 TESTFILE=../programs/zstdcli.c
379 $ECHO "- Create first dictionary"
380 $ZSTD --train-cover=k=46,d=8 *.c ../programs/*.c -o tmpDict
382 $ZSTD -f tmp -D tmpDict
383 $ZSTD -d tmp.zst -D tmpDict -fo result
384 $DIFF $TESTFILE result
385 $ECHO "- Create second (different) dictionary"
386 $ZSTD --train-cover=k=56,d=8 *.c ../programs/*.c ../programs/*.h -o tmpDictC
387 $ZSTD -d tmp.zst -D tmpDictC -fo result && die "wrong dictionary not detected!"
388 $ECHO "- Create dictionary with short dictID"
389 $ZSTD --train-cover=k=46,d=8 *.c ../programs/*.c --dictID=1 -o tmpDict1
390 cmp tmpDict tmpDict1 && die "dictionaries should have different ID !"
391 $ECHO "- Create dictionary with size limit"
392 $ZSTD --train-cover=steps=8 *.c ../programs/*.c -o tmpDict2 --maxdict=4K
395 $ECHO "\n===> legacy dictionary builder "
397 TESTFILE=../programs/zstdcli.c
399 $ECHO "- Create first dictionary"
400 $ZSTD --train-legacy=selectivity=8 *.c ../programs/*.c -o tmpDict
402 $ZSTD -f tmp -D tmpDict
403 $ZSTD -d tmp.zst -D tmpDict -fo result
404 $DIFF $TESTFILE result
405 $ECHO "- Create second (different) dictionary"
406 $ZSTD --train-legacy=s=5 *.c ../programs/*.c ../programs/*.h -o tmpDictC
407 $ZSTD -d tmp.zst -D tmpDictC -fo result && die "wrong dictionary not detected!"
408 $ECHO "- Create dictionary with short dictID"
409 $ZSTD --train-legacy -s5 *.c ../programs/*.c --dictID=1 -o tmpDict1
410 cmp tmpDict tmpDict1 && die "dictionaries should have different ID !"
411 $ECHO "- Create dictionary with size limit"
412 $ZSTD --train-legacy -s9 *.c ../programs/*.c -o tmpDict2 --maxdict=4K
416 $ECHO "\n===> integrity tests "
418 $ECHO "test one file (tmp1.zst) "
422 $ZSTD --test tmp1.zst
423 $ECHO "test multiple files (*.zst) "
425 $ECHO "test bad files (*) "
426 $ZSTD -t * && die "bad files not detected !"
427 $ZSTD -t tmp1 && die "bad file not detected !"
429 $ZSTD -t tmp2.zst && die "bad file not detected !"
431 $ZSTD -t tmp3 && die "bad file not detected !" # detects 0-sized files as bad
432 $ECHO "test --rm and --test combined "
433 $ZSTD -t --rm tmp1.zst
434 test -f tmp1.zst # check file is still present
435 split -b16384 tmp1.zst tmpSplit.
436 $ZSTD -t tmpSplit.* && die "bad file not detected !"
437 ./datagen | $ZSTD -c | $ZSTD -t
441 $ECHO "\n===> golden files tests "
444 $ZSTD -c -r files | $ZSTD -t
447 $ECHO "\n===> benchmark mode tests "
449 $ECHO "bench one file"
452 $ECHO "bench multiple levels"
454 $ECHO "with recursive and quiet modes"
458 $ECHO "\n===> gzip compatibility tests "
461 $ZSTD --format=gzip -V || GZIPMODE=0
462 if [ $GZIPMODE -eq 1 ]; then
463 $ECHO "gzip support detected"
466 if [ $GZIPEXE -eq 1 ]; then
468 $ZSTD --format=gzip -f tmp
471 $ZSTD -d -f -v tmp.gz
474 $ECHO "gzip binary not detected"
477 $ECHO "gzip mode not supported"
481 $ECHO "\n===> gzip frame tests "
483 if [ $GZIPMODE -eq 1 ]; then
485 $ZSTD -f --format=gzip tmp
487 cat tmp.gz tmp.zst tmp.gz tmp.zst | $ZSTD -d -f -o tmp
488 head -c -1 tmp.gz | $ZSTD -t > $INTOVOID && die "incomplete frame not detected !"
491 $ECHO "gzip mode not supported"
495 $ECHO "\n===> xz compatibility tests "
498 $ZSTD --format=xz -V || LZMAMODE=0
499 if [ $LZMAMODE -eq 1 ]; then
500 $ECHO "xz support detected"
502 xz -V && lzma -V || XZEXE=0
503 if [ $XZEXE -eq 1 ]; then
504 $ECHO "Testing zstd xz and lzma support"
506 $ZSTD --format=lzma -f tmp
507 $ZSTD --format=xz -f tmp
511 lzma -f -k --lzma1 tmp
512 $ZSTD -d -f -v tmp.xz
513 $ZSTD -d -f -v tmp.lzma
515 $ECHO "Creating symlinks"
520 $ECHO "Testing xz and lzma symlinks"
526 $ECHO "Testing unxz and unlzma symlinks"
531 rm xz unxz lzma unlzma
534 $ECHO "xz binary not detected"
537 $ECHO "xz mode not supported"
541 $ECHO "\n===> xz frame tests "
543 if [ $LZMAMODE -eq 1 ]; then
545 $ZSTD -f --format=xz tmp
546 $ZSTD -f --format=lzma tmp
548 cat tmp.xz tmp.lzma tmp.zst tmp.lzma tmp.xz tmp.zst | $ZSTD -d -f -o tmp
549 head -c -1 tmp.xz | $ZSTD -t > $INTOVOID && die "incomplete frame not detected !"
550 head -c -1 tmp.lzma | $ZSTD -t > $INTOVOID && die "incomplete frame not detected !"
553 $ECHO "xz mode not supported"
556 $ECHO "\n===> lz4 compatibility tests "
559 $ZSTD --format=lz4 -V || LZ4MODE=0
560 if [ $LZ4MODE -eq 1 ]; then
561 $ECHO "lz4 support detected"
564 if [ $LZ4EXE -eq 1 ]; then
566 $ZSTD --format=lz4 -f tmp
569 $ZSTD -d -f -v tmp.lz4
572 $ECHO "lz4 binary not detected"
575 $ECHO "lz4 mode not supported"
579 $ECHO "\n===> lz4 frame tests "
581 if [ $LZ4MODE -eq 1 ]; then
583 $ZSTD -f --format=lz4 tmp
585 cat tmp.lz4 tmp.zst tmp.lz4 tmp.zst | $ZSTD -d -f -o tmp
586 head -c -1 tmp.lz4 | $ZSTD -t > $INTOVOID && die "incomplete frame not detected !"
589 $ECHO "lz4 mode not supported"
592 $ECHO "\n===> zstd round-trip tests "
595 roundTripTest -g15K # TableID==3
596 roundTripTest -g127K # TableID==2
597 roundTripTest -g255K # TableID==1
598 roundTripTest -g522K # TableID==0
599 roundTripTest -g519K 6 # greedy, hash chain
600 roundTripTest -g517K 16 # btlazy2
601 roundTripTest -g516K 19 # btopt
603 fileRoundTripTest -g500K
605 $ECHO "\n===> zstd long distance matching round-trip tests "
606 roundTripTest -g0 "2 --long"
607 roundTripTest -g1000K "1 --long"
608 roundTripTest -g517K "6 --long"
609 roundTripTest -g516K "16 --long"
610 roundTripTest -g518K "19 --long"
611 fileRoundTripTest -g5M "3 --long"
616 $ECHO "\n===> zstdmt round-trip tests "
617 roundTripTest -g4M "1 -T0"
618 roundTripTest -g8M "3 -T2"
619 roundTripTest -g8000K "2 --threads=2"
620 fileRoundTripTest -g4M "19 -T2 -B1M"
622 $ECHO "\n===> zstdmt long distance matching round-trip tests "
623 roundTripTest -g8M "3 --long -T2"
625 $ECHO "\n===> no multithreading, skipping zstdmt tests "
630 $ECHO "\n===> zstd --list/-l single frame tests "
636 $ZSTD -lv *.zst | grep "Decompressed Size:" # check that decompressed size is present in header
638 $ZSTD --list -v *.zst
640 $ECHO "\n===> zstd --list/-l multiple frame tests "
641 cat tmp1.zst tmp2.zst > tmp12.zst
642 cat tmp12.zst tmp3.zst > tmp123.zst
646 $ECHO "\n===> zstd --list/-l error detection tests "
647 ! $ZSTD -l tmp1 tmp1.zst
650 ! $ZSTD --list -v tmp2 tmp12.zst
652 $ECHO "\n===> zstd --list/-l test with null files "
657 $ZSTD -lv tmp5.zst | grep "Decompressed Size: 0.00 KB (0 B)" # check that 0 size is present in header
660 $ECHO "\n===> zstd --list/-l test with no content size field "
661 ./datagen -g513K | $ZSTD > tmp6.zst
663 ! $ZSTD -lv tmp6.zst | grep "Decompressed Size:" # must NOT be present in header
665 $ECHO "\n===> zstd --list/-l test with no checksum "
666 $ZSTD -f --no-check tmp1
673 $ECHO "\n===> zstd long distance matching tests "
674 roundTripTest -g0 " --long"
675 roundTripTest -g9M "2 --long"
676 # Test parameter parsing
677 roundTripTest -g1M -P50 "1 --long=29" " --memory=512MB"
678 roundTripTest -g1M -P50 "1 --long=29 --zstd=wlog=28" " --memory=256MB"
679 roundTripTest -g1M -P50 "1 --long=29" " --long=28 --memory=512MB"
680 roundTripTest -g1M -P50 "1 --long=29" " --zstd=wlog=28 --memory=512MB"
683 if [ "$1" != "--test-large-data" ]; then
684 $ECHO "Skipping large data tests"
688 $ECHO "\n===> large files tests "
690 roundTripTest -g270000000 1
691 roundTripTest -g250000000 2
692 roundTripTest -g230000000 3
694 roundTripTest -g140000000 -P60 4
695 roundTripTest -g130000000 -P62 5
696 roundTripTest -g120000000 -P65 6
698 roundTripTest -g70000000 -P70 7
699 roundTripTest -g60000000 -P71 8
700 roundTripTest -g50000000 -P73 9
702 roundTripTest -g35000000 -P75 10
703 roundTripTest -g30000000 -P76 11
704 roundTripTest -g25000000 -P78 12
706 roundTripTest -g18000013 -P80 13
707 roundTripTest -g18000014 -P80 14
708 roundTripTest -g18000015 -P81 15
709 roundTripTest -g18000016 -P84 16
710 roundTripTest -g18000017 -P88 17
711 roundTripTest -g18000018 -P94 18
712 roundTripTest -g18000019 -P96 19
714 roundTripTest -g5000000000 -P99 1
716 fileRoundTripTest -g4193M -P99 1
719 $ECHO "\n===> zstd long, long distance matching round-trip tests "
720 roundTripTest -g270000000 "1 --long"
721 roundTripTest -g130000000 -P60 "5 --long"
722 roundTripTest -g35000000 -P70 "8 --long"
723 roundTripTest -g18000001 -P80 "18 --long"
724 # Test large window logs
725 roundTripTest -g700M -P50 "1 --long=29"
726 roundTripTest -g600M -P50 "1 --long --zstd=wlog=29,clog=28"
731 $ECHO "\n===> zstdmt long round-trip tests "
732 roundTripTest -g80000000 -P99 "19 -T2" " "
733 roundTripTest -g5000000000 -P99 "1 -T2" " "
734 roundTripTest -g500000000 -P97 "1 -T999" " "
735 fileRoundTripTest -g4103M -P98 " -T0" " "
736 roundTripTest -g400000000 -P97 "1 --long=24 -T2" " "
738 $ECHO "\n**** no multithreading, skipping zstdmt tests **** "