chiark / gitweb /
Update copyright notices
[vbig.git] / t-args
1 #! /bin/sh
2 #
3 # This file is part of vbig.
4 # Copyright (C) 2014 Richard Kettlewell
5 #
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 #
19 set -e
20 rm -f testoutput testexpect
21
22 echo 'ERROR: invalid size: Numerical result out of range' > testexpect
23 if ./vbig testfile 9223372036854775808 2>testoutput; then
24   echo >&2 ERROR: unexpectedly succeeded
25   exit 1
26 fi
27 diff -u testexpect testoutput
28
29 echo 'ERROR: invalid size' > testexpect
30 if ./vbig testfile 9007199254740992K 2>testoutput; then
31   echo >&2 ERROR: unexpectedly succeeded
32   exit 1
33 fi
34 diff -u testexpect testoutput
35
36 if ./vbig testfile 8796093022208G 2>testoutput; then
37   echo >&2 ERROR: unexpectedly succeeded
38   exit 1
39 fi
40 diff -u testexpect testoutput
41
42 echo 'ERROR: invalid scale' > testexpect
43 if ./vbig testfile 1T 2>testoutput; then
44   echo >&2 ERROR: unexpectedly succeeded
45   exit 1
46 fi
47 diff -u testexpect testoutput
48
49 if ./vbig testfile 1KK 2>testoutput; then
50   echo >&2 ERROR: unexpectedly succeeded
51   exit 1
52 fi
53 diff -u testexpect testoutput
54
55
56 rm -f testoutput testexpect