diff options
author | Pádraig Brady <P@draigBrady.com> | 2008-12-12 10:25:34 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2009-01-03 15:10:42 +0000 |
commit | 99be9078383e7fc95bf84b42ea6a0e50afbe6ff4 (patch) | |
tree | 7dd1a2fc5b09c15d720881d2dccb5672db641c1c /tests/misc/split-fail | |
parent | 1ead0858263428d36a193f400fed24bf9635268a (diff) | |
download | coreutils-99be9078383e7fc95bf84b42ea6a0e50afbe6ff4.tar.xz |
tests: refactor to use the new getlimits utility
* tests/Coreutils.pm: Add function to make limits available
* tests/test-lib.sh: ditto
* tests/misc/join: Check for both SIZE_OFLOW and UINTMAX_OFLOW
rather than using arbitrary 2^128
* tests/misc/sort: ditto
* tests/misc/uniq: ditto
* tests/misc/printf: Check for both INT_OFLOW and INT_UFLOW
rather than using arbitrary -2^31
* tests/misc/seq-long-double: Check for INTMAX_OFLOW
rather than using arbitrary 2^63
* tests/misc/split-fail: Check --lines --bytes and --line-bytes
options limits on all platforms. Note getlimits obviates the
need to use expr to check if 32 bit integers are supported,
which I think was invalid anyway as expr now supports bignum?
* tests/misc/test: Check for UINTMAX_OFLOW rather than
using arbitrary 2^64 and 2^128. Check for INTMAX_UFLOW
rather than using arbitrary -2^64
* tests/misc/timeout-parameters: Check for UINT_OFLOW
rather than using arbitrary 2^32
* tests/misc/truncate-overflow: Don't depend on truncate
to determine if we're on a 32 or 64 bit platform and
instead use the various OFF_T limits
* tests/misc/sort-merge: Check for UINTMAX_OFLOW
rather than using arbitrary 2^64+1
* tests/misc/unexpand: ditto
Diffstat (limited to 'tests/misc/split-fail')
-rwxr-xr-x | tests/misc/split-fail | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/tests/misc/split-fail b/tests/misc/split-fail index 0680891b6..7e56a257a 100755 --- a/tests/misc/split-fail +++ b/tests/misc/split-fail @@ -22,6 +22,7 @@ if test "$VERBOSE" = yes; then fi . $srcdir/test-lib.sh +getlimits_ touch in || framework_failure @@ -44,19 +45,9 @@ split -1 in 2> /dev/null || fail=1 # Then make sure that -0 evokes a failure. split -0 in 2> /dev/null && fail=1 -# Ensure that split --lines=N and --bytes=N work for N=2^32, -# assuming our host supports integers that wide. -if _4gb=`expr 4294967296 + 0 2>/dev/null`; then - split --lines=$_4gb in || fail=1 - split --bytes=$_4gb in || fail=1 -fi - -# Currently (coreutils-5.0.1) split --line-bytes=M fails -# with `invalid number of bytes' for M=2^32 or larger. Actually, -# the limit is SIZE_MAX, which is 2^32 on 32-bit systems. -# On 64-bit systems, there's no problem with a count of 2^32, -# So disable this test in order to avoid the `failure' on 64-bit systems. -#split --line-bytes=$_4gb 2> /dev/null in && fail=1 +split --lines=$UINTMAX_MAX in || fail=1 +split --bytes=$UINTMAX_MAX in || fail=1 +split --line-bytes=$SIZE_OFLOW 2> /dev/null in && fail=1 # Make sure that a huge obsolete option evokes the right failure. split -99999999999999999991 2> out && fail=1 |