File: zip.at

package info (click to toggle)
pspp 0.8.4-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 35,692 kB
  • ctags: 20,600
  • sloc: ansic: 218,288; sh: 12,890; xml: 11,342; perl: 715; lisp: 597; makefile: 157
file content (43 lines) | stat: -rw-r--r-- 742 bytes parent folder | download | duplicates (4)
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
40
41
42
43
AT_BANNER([zip])

AT_SETUP([Basic zip - unzip test])
AT_KEYWORDS([compression])

AT_CHECK([dnl
here=`pwd`
dir1=$here/original
dir2=$here/recovered

mkdir -p $dir1

# Generate files of differing sizes with random data in them
names=""
s=1;
while test $s -le 8192 ; do
	name=$dir1/$s
	dd if=/dev/urandom of=$name count=1 bs=$s 2> /dev/null
	s=$(($s * 2));
	bn=`basename $name`;
        names="$names $bn";
done

(cd $dir1 && $abs_top_builddir/tests/libpspp/zip-test w foo.zip $names)


mkdir -p $dir2
cp $dir1/foo.zip $dir2
cd $dir2 
$abs_top_builddir/tests/libpspp/zip-test r foo.zip $names

# Compare the files to their originals
for f in $names; do
 diff $dir1/$f $dir2/$f;
 if test $? -ne 0 ; then exit 1; fi;
done

exit 0
])


AT_CLEANUP