]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
[test][dictBuilder] Add multithreaded tests 1748/head
authorNick Terrell <terrelln@fb.com>
Tue, 27 Aug 2019 01:32:08 +0000 (18:32 -0700)
committerNick Terrell <terrelln@fb.com>
Tue, 27 Aug 2019 01:32:08 +0000 (18:32 -0700)
tests/playTests.sh

index ad096fdddbdf8a9eb781f78792f57ed7a77acbf5..19fc514f696c971a212fe14271ca9e1e163b6c82 100755 (executable)
@@ -526,6 +526,15 @@ $ZSTD -o tmpDict --train "$TESTDIR"/*.c "$PRGDIR"/*.c
 test -f tmpDict
 $ZSTD --train "$TESTDIR"/*.c "$PRGDIR"/*.c
 test -f dictionary
+println "- Test dictionary training fails"
+echo "000000000000000000000000000000000" > tmpz
+$ZSTD --train tmpz tmpz tmpz tmpz tmpz tmpz tmpz tmpz tmpz && die "Dictionary training should fail : source is all zeros"
+if [ -n "$hasMT" ]
+then
+  $ZSTD --train -T0 tmpz tmpz tmpz tmpz tmpz tmpz tmpz tmpz tmpz && die "Dictionary training should fail : source is all zeros"
+  println "- Create dictionary with multithreading enabled"
+  $ZSTD --train -T0 "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpDict
+fi
 rm tmp* dictionary