]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
playTests updated with Pass-Through mode
authorinikep <inikep@gmail.com>
Tue, 24 May 2016 16:22:38 +0000 (18:22 +0200)
committerinikep <inikep@gmail.com>
Tue, 24 May 2016 16:22:38 +0000 (18:22 +0200)
programs/tests/playTests.bat
programs/tests/playTestsMSYS.sh

index edbbcb340d59796bd62850e213e1fb22fa089ebc..5f7ebd68573893c40e7e60663eb8bf1b9826c7d0 100644 (file)
@@ -31,9 +31,11 @@ REM %ZSTD% -d  - < tmp.zst > NUL
 %ZSTD% -q -f tmp
 %ZSTD% -q --force tmp
 %ZSTD% -df tmp && (echo should have refused : wrong extension && exit /b 1)
-cp tmp tmp2.zst
-%ZSTD% -df tmp2.zst && (echo should have failed : wrong format && exit /b 1)
-rm tmp2.zst
+
+echo. && echo **** Pass-Through mode ****
+echo "Hello world !" | %ZSTD% -df
+echo "Hello world !" | %ZSTD% -dcf
+
 
 echo. && echo **** frame concatenation ****
 
@@ -48,7 +50,7 @@ cat result.tmp
 fc /b helloworld.tmp result.tmp
 rm *.tmp *.zstd
 
-echo frame concatenation test completed
+echo frame concatenation tests completed
 
 
 REM echo. && echo **** flush write error test ****
index 4289977a0d146b2a79b1b36ac8f5c013416f3b81..3d5a0e842d9c39a03a673c23e8aef45f8d53ff5c 100755 (executable)
@@ -47,9 +47,12 @@ $ZSTD -q tmp && die "overwrite check failed!"
 $ZSTD -q -f tmp
 $ZSTD -q --force tmp
 $ZSTD -df tmp && die "should have refused : wrong extension"
-cp tmp tmp2.zst
-$ZSTD -df tmp2.zst && die "should have failed : wrong format"
-rm tmp2.zst
+
+
+echo -e "\n**** Pass-Through mode **** "
+echo "Hello world !" | $ZSTD -df
+echo "Hello world !" | $ZSTD -dcf
+
 
 echo -e "\n**** frame concatenation **** "
 
@@ -64,7 +67,34 @@ cat result.tmp
 fc helloworld.tmp result.tmp
 rm ./*.tmp ./*.zstd
 
-echo frame concatenation test completed
+echo frame concatenation tests completed
+
+
+echo -e "\n**** test sparse file support **** "
+
+./datagen -g5M  -P100 > tmpSparse
+$ZSTD tmpSparse -c | $ZSTD -dv -o tmpSparseRegen
+fc tmpSparse tmpSparseRegen
+$ZSTD tmpSparse -c | $ZSTD -dv --sparse -c > tmpOutSparse
+fc tmpSparse tmpOutSparse
+$ZSTD tmpSparse -c | $ZSTD -dv --no-sparse -c > tmpOutNoSparse
+fc tmpSparse tmpOutNoSparse
+ls -ls tmpSparse*
+./datagen -s1 -g1200007 -P100 | $ZSTD | $ZSTD -dv --sparse -c > tmpSparseOdd   # Odd size file (to not finish on an exact nb of blocks)
+./datagen -s1 -g1200007 -P100 | fc - tmpSparseOdd
+ls -ls tmpSparseOdd
+echo -e "\n Sparse Compatibility with Console :"
+echo "Hello World 1 !" | $ZSTD | $ZSTD -d -c
+echo "Hello World 2 !" | $ZSTD | $ZSTD -d | cat
+echo -e "\n Sparse Compatibility with Append :"
+./datagen -P100 -g1M > tmpSparse1M
+cat tmpSparse1M tmpSparse1M > tmpSparse2M
+$ZSTD -v -f tmpSparse1M -o tmpSparseCompressed
+$ZSTD -d -v -f tmpSparseCompressed -o tmpSparseRegenerated
+$ZSTD -d -v -f tmpSparseCompressed -c >> tmpSparseRegenerated
+ls -ls tmpSparse*
+fc tmpSparse2M tmpSparseRegenerated
+
 
 
 echo -e "\n**** dictionary tests **** "