3 # This file is part of vbig.
4 # Copyright (C) 2014 Richard Kettlewell
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.
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.
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/>.
20 rm -f testoutput testexpect
24 ERANGE="Result too large"
27 ERANGE="Numerical result out of range"
31 echo "ERROR: invalid size: ${ERANGE}" > testexpect
32 if ./vbig testfile 9223372036854775808 2>testoutput; then
33 echo >&2 ERROR: unexpectedly succeeded
36 diff -u testexpect testoutput
38 echo 'ERROR: invalid size' > testexpect
39 if ./vbig testfile 9007199254740992K 2>testoutput; then
40 echo >&2 ERROR: unexpectedly succeeded
43 diff -u testexpect testoutput
45 if ./vbig testfile 8796093022208G 2>testoutput; then
46 echo >&2 ERROR: unexpectedly succeeded
49 diff -u testexpect testoutput
51 echo 'ERROR: invalid scale' > testexpect
52 if ./vbig testfile 1T 2>testoutput; then
53 echo >&2 ERROR: unexpectedly succeeded
56 diff -u testexpect testoutput
58 if ./vbig testfile 1KK 2>testoutput; then
59 echo >&2 ERROR: unexpectedly succeeded
62 diff -u testexpect testoutput
65 rm -f testoutput testexpect