1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017 Free Software Foundation, Inc.
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation, either version 3 of the License, or
7 dnl (at your option) any later version.
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 dnl GNU General Public License for more details.
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
19 AT_SETUP([basic zip - unzip test])
20 AT_KEYWORDS([compression])
27 # Generate files of differing sizes with random data in them
30 while test $s -le 8192 ; do
32 dd if=/dev/urandom of=$name count=1 bs=$s 2> /dev/null
38 AT_CHECK([cd $dir1 && zip-test w foo.zip $names])
40 # If zipinfo is installed, make sure it can read the zipfile.
41 if (zipinfo -v) >/dev/null 2>&1; then
42 AT_CHECK([zipinfo $dir1/foo.zip], [0], [ignore])
46 cp $dir1/foo.zip $dir2
49 AT_CHECK([zip-test r foo.zip $names])
52 # Compare the files to their originals
54 diff $dir1/$f $dir2/$f;
55 if test $? -ne 0 ; then exit 1; fi;
61 AT_SETUP([zip to pipe])
62 AT_KEYWORDS([compression])
69 # Generate files of differing sizes with random data in them
72 while test $s -le 8192 ; do
74 dd if=/dev/urandom of=$name count=1 bs=$s 2> /dev/null
80 # The pipe through "cat" below is essential because it makes the
81 # output file un-seekable.
82 AT_CHECK([cd $dir1 && zip-test w - $names | cat > foo.zip])
84 # If zipinfo is installed, make sure it can read the zipfile.
85 if (zipinfo -v) >/dev/null 2>&1; then
86 AT_CHECK([zipinfo $dir1/foo.zip], [0], [ignore])
90 cp $dir1/foo.zip $dir2
93 AT_CHECK([zip-test r foo.zip $names])
96 # Compare the files to their originals
98 diff $dir1/$f $dir2/$f;
99 if test $? -ne 0 ; then exit 1; fi;