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/test | |
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/test')
-rwxr-xr-x | tests/misc/test | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/misc/test b/tests/misc/test index 43db2e1a5..ec34f1dd9 100755 --- a/tests/misc/test +++ b/tests/misc/test @@ -17,6 +17,8 @@ use strict; +my $limits = getlimits (); + my $prog = 'test'; # Turn off localization of executable's output. @@ -156,19 +158,19 @@ my @Tests = ['eq-3', qw(0 -eq 00)], ['eq-4', qw(8 -eq 9), {EXIT=>1}], ['eq-5', qw(1 -eq 0), {EXIT=>1}], - ['eq-6', qw(340282366920938463463374607431768211456 -eq 0), {EXIT=>1}], + ['eq-6', "$limits->{'UINTMAX_OFLOW'} -eq 0", {EXIT=>1}], ['gt-1', qw(5 -gt 5), {EXIT=>1}], ['gt-2', qw(5 -gt 4)], ['gt-3', qw(4 -gt 5), {EXIT=>1}], ['gt-4', qw(-1 -gt -2)], - ['gt-5', qw(18446744073709551616 -gt -18446744073709551616)], + ['gt-5', "$limits->{'UINTMAX_OFLOW'} -gt $limits->{'INTMAX_UFLOW'}"], ['lt-1', qw(5 -lt 5), {EXIT=>1}], ['lt-2', qw(5 -lt 4), {EXIT=>1}], ['lt-3', qw(4 -lt 5)], ['lt-4', qw(-1 -lt -2), {EXIT=>1}], - ['lt-5', qw(-18446744073709551616 -lt 18446744073709551616)], + ['lt-5', "$limits->{'INTMAX_UFLOW'} -lt $limits->{'UINTMAX_OFLOW'}"], ['inv-1', qw(0x0 -eq 00), {EXIT=>2}, {ERR=>"$prog: invalid integer `0x0'\n"}], |