summaryrefslogtreecommitdiff
path: root/tests/misc/sort-discrim
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2012-03-16 11:23:13 +0000
committerPádraig Brady <P@draigBrady.com>2012-03-17 09:39:13 +0000
commiteb7ef0148ad1e38b99191de7d28db84dd94f5c35 (patch)
treedb430c1263404f029fc4abb20b39192debdc0268 /tests/misc/sort-discrim
parentae7b1c383f370ba6e08bf84a263c829a1ee5d7ab (diff)
downloadcoreutils-eb7ef0148ad1e38b99191de7d28db84dd94f5c35.tar.xz
tests: fix sort-discrim to work without GMP
* tests/misc/sort-discrim: The expr limit is intmax_t without GMP.
Diffstat (limited to 'tests/misc/sort-discrim')
-rwxr-xr-xtests/misc/sort-discrim54
1 files changed, 28 insertions, 26 deletions
diff --git a/tests/misc/sort-discrim b/tests/misc/sort-discrim
index 720d819d4..14ae6cc86 100755
--- a/tests/misc/sort-discrim
+++ b/tests/misc/sort-discrim
@@ -42,38 +42,40 @@ compare out exp || fail=1
# looks at the number plus two decimal digits, but if -h is
# used it looks at one decimal place plus a 4-bit SI prefix value.
# In both cases, there's an extra factor of 2 for the sign.
-max_int200=$(expr $UINTMAX_MAX / 200) &&
-max_frac200=$(printf '%.2d' $(expr $UINTMAX_MAX / 2 % 100)) &&
-max_int320=$(expr $UINTMAX_MAX / 320) &&
-max_frac320=$(expr $UINTMAX_MAX / 32 % 10) &&
+# Note INTMAX_MAX is used below as that's that largest number
+# expr can handle on all systems (without GMP).
+max_int100=$(expr $INTMAX_MAX / 100) &&
+max_frac100=$(printf '%.2d' $(expr $INTMAX_MAX % 100)) &&
+max_int160=$(expr $INTMAX_MAX / 160) &&
+max_frac160=$(expr $INTMAX_MAX / 16 % 10) &&
{ printf -- "\
-$UINTMAX_OFLOW
-$UINTMAX_MAX
- -${max_int200}0.1
- -${max_int200}0
- -${max_int200}0.0
- -${max_int320}0.1
- -${max_int320}0
- -${max_int320}0.0
- -$max_int200.${max_frac200}1
- -$max_int200.$max_frac200
- -$max_int320.${max_frac320}1
- -$max_int320.$max_frac320
+ -${max_int100}0.1
+ -${max_int100}0
+ -${max_int100}0.0
+ -${max_int160}0.1
+ -${max_int160}0
+ -${max_int160}0.0
+ -$max_int100.${max_frac100}1
+ -$max_int100.$max_frac100
+ -$max_int160.${max_frac160}1
+ -$max_int160.$max_frac160
" &&
seq -- -10 .001 10 &&
printf "\
- $max_int320
- $max_int320.$max_frac320
- $max_int320.${max_frac320}1
- $max_int200
- $max_int200.$max_frac200
- $max_int200.${max_frac200}1
- ${max_int320}0
- ${max_int320}0.0
- ${max_int320}0.1
- ${max_int200}0
- ${max_int200}0.0
- ${max_int200}0.1
+ $max_int160
+ $max_int160.$max_frac160
+ $max_int160.${max_frac160}1
+ $max_int100
+ $max_int100.$max_frac100
+ $max_int100.${max_frac100}1
+ ${max_int160}0
+ ${max_int160}0.0
+ ${max_int160}0.1
+ ${max_int100}0
+ ${max_int100}0.0
+ ${max_int100}0.1
$UINTMAX_MAX
$UINTMAX_OFLOW
"