File: test3

package info (click to toggle)
par2cmdline 0.6.11-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,388 kB
  • ctags: 955
  • sloc: cpp: 8,941; sh: 3,797; makefile: 89
file content (39 lines) | stat: -rwxr-xr-x 1,177 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh

cd $(dirname $0)

testname=$(basename $0)
rm -f $testname.log

mkdir run$testname && cd run$testname || { echo "ERROR: Could not change to test directory" ; exit 1; } >&2

tar -xf ../flatdata.tar.gz || { echo "ERROR: Could not extract data test files" ; exit 1; } >&2
tar -xf ../flatdata-par1files.tar.gz || { echo "ERROR: Could not extract par test files" ; exit 1; } >&2

cp test-0.data test-0.data.orig
cp test-1.data test-1.data.orig
cp test-2.data test-2.data.orig
cp test-3.data test-3.data.orig
cp test-4.data test-4.data.orig
cp test-5.data test-5.data.orig
cp test-6.data test-6.data.orig
cp test-7.data test-7.data.orig
cp test-8.data test-8.data.orig
cp test-9.data test-9.data.orig

banner="Repairing two files using PAR 1.0 data"
dashes=`echo "$banner" | sed s/./-/g`

echo $dashes
echo $banner
echo $dashes

rm -f test-1.data test-3.data
../../par2 r testdata.par > ../$testname.log || { echo "ERROR: Reconstruction of two files using PAR 1.0 failed" ; exit 1; } >&2
cmp -s test-1.data test-1.data.orig && cmp -s test-3.data test-3.data.orig || { echo "ERROR: Repaired files do not match originals" ; exit 1; } >&2

cd ..
rm -rf run$testname

exit 0;