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