From: senhuang42 Date: Wed, 30 Sep 2020 17:25:02 +0000 (-0400) Subject: Add unit tests into playTests.sh X-Git-Tag: v1.4.7~57^2~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cfd2aec1b71cb8d34ab3926a2150be8147d869b9;p=thirdparty%2Fzstd.git Add unit tests into playTests.sh --- diff --git a/tests/playTests.sh b/tests/playTests.sh index 7f75d8506..ee3ef42f0 100755 --- a/tests/playTests.sh +++ b/tests/playTests.sh @@ -1207,6 +1207,7 @@ roundTripTest -g1000K "1 --single-thread --long" roundTripTest -g517K "6 --single-thread --long" roundTripTest -g516K "16 --single-thread --long" roundTripTest -g518K "19 --single-thread --long" +roundTripTest -g2M "22 --single-thread --ultra --long" fileRoundTripTest -g5M "3 --single-thread --long" @@ -1216,6 +1217,7 @@ then println "\n===> zstdmt round-trip tests " roundTripTest -g4M "1 -T0" roundTripTest -g8M "3 -T2" + roundTripTest -g8M "3 -T0 --long" roundTripTest -g8000K "2 --threads=2" fileRoundTripTest -g4M "19 -T2 -B1M" @@ -1334,6 +1336,33 @@ roundTripTest -g1M -P50 "1 --single-thread --long=29" " --long=28 --memory=512MB roundTripTest -g1M -P50 "1 --single-thread --long=29" " --zstd=wlog=28 --memory=512MB" +println "\n===> zstd long distance matching with optimal parser compressed size tests " +optCSize16=$(datagen -g511K | zstd -16 -c | wc -c) +longCSize16=$(datagen -g511K | zstd -16 --long -c | wc -c) +optCSize19=$(datagen -g2M | zstd -19 -c | wc -c) +longCSize19=$(datagen -g2M | zstd -19 --long -c | wc -c) +optCSize19wlog23=$(datagen -g2M | zstd -19 -c --zstd=wlog=23 | wc -c) +longCSize19wlog23=$(datagen -g2M | zstd -19 -c --long=23 | wc -c) +optCSize19wlog27=$(datagen -g5M | zstd -19 -c --zstd=wlog=27 | wc -c) +longCSize19wlog27=$(datagen -g5M | zstd -19 -c --long=27 | wc -c) +optCSize22=$(datagen -g900K | zstd -22 --ultra -c | wc -c) +longCSize22=$(datagen -g900K | zstd -22 --ultra --long -c | wc -c) +if [ "$longCSize16" -gt "$optCSize16" ]; then + echo using --long on compression level 16 should not cause compressed size regression + exit 1 +elif [ "$longCSize19" -gt "$optCSize19" ]; then + echo using --long on compression level 19 should not cause compressed size regression + exit 1 +elif [ "$longCSize19wlog23" -gt "$optCSize19wlog23" ]; then + echo using --long on compression level 19 with wLog=23 should not cause compressed size regression + exit 1 +elif [ "$longCSize19wlog27" -gt "$optCSize19wlog27" ]; then + echo using --long on compression level 19 with wLog=27 should not cause compressed size regression + exit 1 +elif [ "$longCSize22" -gt "$optCSize22" ]; then + echo using --long on compression level 22 should not cause compressed size regression + exit 1 +fi if [ "$1" != "--test-large-data" ]; then