]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
stronger dictionary compression tests
authorYann Collet <yann.collet.73@gmail.com>
Wed, 15 Jun 2016 17:02:11 +0000 (19:02 +0200)
committerYann Collet <yann.collet.73@gmail.com>
Wed, 15 Jun 2016 17:02:11 +0000 (19:02 +0200)
programs/playTests.sh

index 3be4c7775bfaaaf18902c33afb1cd93bacf93e4a..6dafb630a3b15848819ab7aaecaa9002cf2aa0bc 100755 (executable)
@@ -139,22 +139,32 @@ $ECHO "\n**** dictionary tests **** "
 ./datagen -g1M | $MD5SUM > tmp1
 ./datagen -g1M | $ZSTD -D tmpDict | $ZSTD -D tmpDict -dvq | $MD5SUM > tmp2
 diff -q tmp1 tmp2
-$ECHO "Create first dictionary"
+$ECHO "Create first dictionary"
 $ZSTD --train *.c -o tmpDict
 cp zstdcli.c tmp
 $ZSTD -f tmp -D tmpDict
 $ZSTD -d tmp.zst -D tmpDict -of result
 diff zstdcli.c result
-$ECHO "Create second (different) dictionary"
+$ECHO "Create second (different) dictionary"
 $ZSTD --train *.c *.h -o tmpDictC
 $ZSTD -d tmp.zst -D tmpDictC -of result && die "wrong dictionary not detected!"
-$ECHO "Create dictionary with short dictID"
+$ECHO "Create dictionary with short dictID"
 $ZSTD --train *.c --dictID 1 -o tmpDict1
 cmp tmpDict tmpDict1 && die "dictionaries should have different ID !"
-$ECHO "Compress without dictID"
+$ECHO "Compress without dictID"
 $ZSTD -f tmp -D tmpDict1 --no-dictID
 $ZSTD -d tmp.zst -D tmpDict -of result
 diff zstdcli.c result
+$ECHO "- Compress multiple files with dictionary"
+cat *.c *.h | $MD5SUM > tmp1
+rm -rf dirTestDict
+mkdir dirTestDict
+cp *.c dirTestDict
+cp *.h dirTestDict
+$ZSTD -f dirTestDict/* -D tmpDictC
+$ZSTD -d dirTestDict/*.zst -D tmpDictC -c | $MD5SUM > tmp2
+diff -q tmp1 tmp2
+rm -rf dirTestDict
 rm tmp*