Konstantin Tokarev | d66db2f | 2015-12-08 18:11:10 +0300 | [diff] [blame^] | 1 | #!/bin/sh -e |
| 2 | |
| 3 | die() { |
| 4 | echo "$@" 1>&2 |
| 5 | exit 1 |
| 6 | } |
| 7 | |
| 8 | echo "\n**** frame concatenation **** " |
| 9 | |
| 10 | echo "hello " > hello.tmp |
| 11 | echo "world!" > world.tmp |
| 12 | cat hello.tmp world.tmp > helloworld.tmp |
| 13 | $ZSTD hello.tmp > hello.zstd |
| 14 | $ZSTD world.tmp > world.zstd |
| 15 | cat hello.zstd world.zstd > helloworld.zstd |
| 16 | $ZSTD -df helloworld.zstd > result.tmp |
| 17 | cat result.tmp |
| 18 | sdiff helloworld.tmp result.tmp |
| 19 | rm *.tmp *.zstd |
| 20 | |
| 21 | echo frame concatenation test completed |
| 22 | |
| 23 | echo "**** flush write error test **** " |
| 24 | |
| 25 | echo foo | $ZSTD > /dev/full && die "write error not detected!" |
| 26 | echo foo | $ZSTD | $ZSTD -d > /dev/full && die "write error not detected!" |
| 27 | |
| 28 | echo "**** zstd round-trip tests **** " |
| 29 | ./datagen | md5sum > tmp1 |
| 30 | ./datagen | $ZSTD -v | $ZSTD -d | md5sum > tmp2 |
| 31 | diff tmp1 tmp2 |
| 32 | ./datagen | $ZSTD -6 -v | $ZSTD -d | md5sum > tmp2 |
| 33 | diff tmp1 tmp2 |
| 34 | ./datagen -g270000000 | md5sum > tmp1 |
| 35 | ./datagen -g270000000 | $ZSTD -v | $ZSTD -d | md5sum > tmp2 |
| 36 | diff tmp1 tmp2 |
| 37 | ./datagen -g270000000 | $ZSTD -v2 | $ZSTD -d | md5sum > tmp2 |
| 38 | diff tmp1 tmp2 |
| 39 | ./datagen -g270000000 | $ZSTD -v3 | $ZSTD -d | md5sum > tmp2 |
| 40 | diff tmp1 tmp2 |
| 41 | ./datagen -g140000000 -P60| md5sum > tmp1 |
| 42 | ./datagen -g140000000 -P60 | $ZSTD -v4 | $ZSTD -d | md5sum > tmp2 |
| 43 | diff tmp1 tmp2 |
| 44 | ./datagen -g140000000 -P60 | $ZSTD -v5 | $ZSTD -d | md5sum > tmp2 |
| 45 | diff tmp1 tmp2 |
| 46 | ./datagen -g140000000 -P60 | $ZSTD -v6 | $ZSTD -d | md5sum > tmp2 |
| 47 | diff tmp1 tmp2 |
| 48 | ./datagen -g70000000 -P70 | md5sum > tmp1 |
| 49 | ./datagen -g70000000 -P70 | $ZSTD -v7 | $ZSTD -d | md5sum > tmp2 |
| 50 | diff tmp1 tmp2 |
| 51 | ./datagen -g70000000 -P70 | $ZSTD -v8 | $ZSTD -d | md5sum > tmp2 |
| 52 | diff tmp1 tmp2 |
| 53 | ./datagen -g70000000 -P70 | $ZSTD -v9 | $ZSTD -d | md5sum > tmp2 |
| 54 | diff tmp1 tmp2 |
| 55 | ./datagen -g35000000 -P75 | md5sum > tmp1 |
| 56 | ./datagen -g35000000 -P75 | $ZSTD -v10 | $ZSTD -d | md5sum > tmp2 |
| 57 | diff tmp1 tmp2 |
| 58 | ./datagen -g35000000 -P75 | $ZSTD -v11 | $ZSTD -d | md5sum > tmp2 |
| 59 | diff tmp1 tmp2 |
| 60 | ./datagen -g35000000 -P75 | $ZSTD -v12 | $ZSTD -d | md5sum > tmp2 |
| 61 | diff tmp1 tmp2 |
| 62 | |