#! /bin/sh # # This file is part of vbig. # Copyright (C) 2014 Richard Kettlewell # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # set -e rm -f testoutput testexpect case $(uname -s) in *BSD ) ERANGE="Result too large" ;; * ) ERANGE="Numerical result out of range" ;; esac echo "ERROR: invalid size: ${ERANGE}" > testexpect if ./vbig testfile 9223372036854775808 2>testoutput; then echo >&2 ERROR: unexpectedly succeeded exit 1 fi diff -u testexpect testoutput echo 'ERROR: invalid size' > testexpect if ./vbig testfile 9007199254740992K 2>testoutput; then echo >&2 ERROR: unexpectedly succeeded exit 1 fi diff -u testexpect testoutput if ./vbig testfile 8796093022208G 2>testoutput; then echo >&2 ERROR: unexpectedly succeeded exit 1 fi diff -u testexpect testoutput echo 'ERROR: invalid scale' > testexpect if ./vbig testfile 1T 2>testoutput; then echo >&2 ERROR: unexpectedly succeeded exit 1 fi diff -u testexpect testoutput if ./vbig testfile 1KK 2>testoutput; then echo >&2 ERROR: unexpectedly succeeded exit 1 fi diff -u testexpect testoutput rm -f testoutput testexpect