]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fixed fifo test
authorYann Collet <cyan@fb.com>
Tue, 26 Nov 2019 22:18:09 +0000 (14:18 -0800)
committerYann Collet <cyan@fb.com>
Tue, 26 Nov 2019 22:18:09 +0000 (14:18 -0800)
tests/playTests.sh

index 38582f079feee330e5e68023e42ed5c44a7f44d2..d306a41c22397f2b499a8933a47eb64fd8588393 100755 (executable)
@@ -114,6 +114,7 @@ else
 fi
 
 
+
 println "\n===>  simple tests "
 
 ./datagen > tmp
@@ -335,8 +336,20 @@ $ZSTD -f tmp1 notHere tmp2 && die "missing file not detected!"
 rm tmp*
 
 
-if [ -n "$DEVNULLRIGHTS" ]
-then
+if [ "$isWindows" = false ] ; then
+    println "\n===>  zstd fifo named pipe test "
+    echo "Hello World!" > tmp_original
+    mkfifo tmp_named_pipe
+    # note : fifo test doesn't work in combination with `dd` or `cat`
+    echo "Hello World!" > tmp_named_pipe &
+    $ZSTD tmp_named_pipe -o tmp_compressed
+    $ZSTD -d -o tmp_decompressed tmp_compressed
+    $DIFF -s tmp_original tmp_decompressed
+    rm -rf tmp*
+fi
+
+
+if [ -n "$DEVNULLRIGHTS" ] ; then
     # these tests requires sudo rights, which is uncommon.
     # they are only triggered if DEVNULLRIGHTS macro is defined.
     println "\n===> checking /dev/null permissions are unaltered "
@@ -1259,18 +1272,4 @@ test -f dictionary
 rm -f tmp* dictionary
 
 
-if [ "$isWindows" = false ] ; then
-
-println "\n===>  zstd fifo named pipe test "
-dd bs=1 count=10 if=/dev/zero of=tmp_original
-mkfifo named_pipe
-dd bs=1 count=10 if=/dev/zero of=named_pipe &
-$ZSTD named_pipe -o tmp_compressed
-$ZSTD -d -o tmp_decompressed tmp_compressed
-$DIFF -s tmp_original tmp_decompressed
-rm -rf tmp*
-rm -rf named_pipe
-
-fi
-
 rm -f tmp*