From 99be9078383e7fc95bf84b42ea6a0e50afbe6ff4 Mon Sep 17 00:00:00 2001 From: Pádraig Brady
Date: Fri, 12 Dec 2008 10:25:34 +0000 Subject: 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 --- tests/misc/uniq | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tests/misc/uniq') diff --git a/tests/misc/uniq b/tests/misc/uniq index 0350864c0..a7717448f 100755 --- a/tests/misc/uniq +++ b/tests/misc/uniq @@ -18,6 +18,8 @@ use strict; +my $limits = getlimits (); + my $prog = 'uniq'; my $try = "Try \`$prog --help' for more information.\n"; @@ -192,10 +194,11 @@ my @Tests = . $try}], # Check that -d and -u suppress all output, as POSIX requires. ['120', qw(-d -u), {IN=>"a\na\n\b"}, {OUT=>""}], - ['121', qw(-d -u -w340282366920938463463374607431768211456), {IN=>"a\na\n\b"}, {OUT=>""}], + ['121', "-d -u -w$limits->{'UINTMAX_OFLOW'}", {IN=>"a\na\n\b"}, {OUT=>""}], + ['122', "-d -u -w$limits->{'SIZE_OFLOW'}", {IN=>"a\na\n\b"}, {OUT=>""}], # Check that --zero-terminated is synonymous with -z. - ['122', '--zero-terminated', {IN=>"a\na\nb"}, {OUT=>"a\na\nb\0"}], - ['123', '--zero-terminated', {IN=>"a\0a\0b"}, {OUT=>"a\0b\0"}], + ['123', '--zero-terminated', {IN=>"a\na\nb"}, {OUT=>"a\na\nb\0"}], + ['124', '--zero-terminated', {IN=>"a\0a\0b"}, {OUT=>"a\0b\0"}], ); # Set _POSIX2_VERSION=199209 in the environment of each obs-plus* test. -- cgit v1.2.3-70-g09d2