annotate tests/test-xstrtoimax.sh @ 12839:c6d23570567d

Work around getdelim() bug on FreeBSD 8.0.
author Bruno Haible <bruno@clisp.org>
date Sun, 31 Jan 2010 17:43:25 +0100
parents 44e4e306d7c5
children 1e97362a0b84
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9141
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
1 #!/bin/sh
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
2
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
3 tmpfiles=""
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
4 trap 'rm -fr $tmpfiles' 1 2 3 15
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
5
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
6 tmpfiles="t-xstrtoimax.tmp t-xstrtoimax.xo"
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
7 : > t-xstrtoimax.tmp
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
8 too_big=99999999999999999999999999999999999999999999999999999999999999999999
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
9 result=0
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
10
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
11 # test xstrtoimax
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
12 ./test-xstrtoimax${EXEEXT} 1 >> t-xstrtoimax.tmp 2>&1 || result=1
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
13 ./test-xstrtoimax${EXEEXT} -1 >> t-xstrtoimax.tmp 2>&1 || result=1
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
14 ./test-xstrtoimax${EXEEXT} 1k >> t-xstrtoimax.tmp 2>&1 || result=1
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
15 ./test-xstrtoimax${EXEEXT} ${too_big}h >> t-xstrtoimax.tmp 2>&1 && result=1
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
16 ./test-xstrtoimax${EXEEXT} $too_big >> t-xstrtoimax.tmp 2>&1 && result=1
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
17 ./test-xstrtoimax${EXEEXT} x >> t-xstrtoimax.tmp 2>&1 && result=1
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
18 ./test-xstrtoimax${EXEEXT} 9x >> t-xstrtoimax.tmp 2>&1 && result=1
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
19 ./test-xstrtoimax${EXEEXT} 010 >> t-xstrtoimax.tmp 2>&1 || result=1
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
20 ./test-xstrtoimax${EXEEXT} MiB >> t-xstrtoimax.tmp 2>&1 || result=1
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
21
9975
44e4e306d7c5 Work around limitation of an old 'tr' program on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 9958
diff changeset
22 # Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
44e4e306d7c5 Work around limitation of an old 'tr' program on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 9958
diff changeset
23 # does not understand '\r'.
44e4e306d7c5 Work around limitation of an old 'tr' program on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 9958
diff changeset
24 if echo solaris | tr -d '\r' | grep solais > /dev/null; then
44e4e306d7c5 Work around limitation of an old 'tr' program on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 9958
diff changeset
25 cr='\015'
44e4e306d7c5 Work around limitation of an old 'tr' program on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 9958
diff changeset
26 else
44e4e306d7c5 Work around limitation of an old 'tr' program on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 9958
diff changeset
27 cr='\r'
44e4e306d7c5 Work around limitation of an old 'tr' program on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 9958
diff changeset
28 fi
44e4e306d7c5 Work around limitation of an old 'tr' program on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 9958
diff changeset
29
9141
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
30 # normalize output
9975
44e4e306d7c5 Work around limitation of an old 'tr' program on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 9958
diff changeset
31 LC_ALL=C tr -d "$cr" < t-xstrtoimax.tmp > t-xstrtoimax.xo
9141
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
32 mv t-xstrtoimax.xo t-xstrtoimax.tmp
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
33
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
34 # compare expected output
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
35 cat > t-xstrtoimax.xo <<EOF
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
36 1->1 ()
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
37 -1->-1 ()
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
38 1k->1024 ()
9144
4df785011e4c * tests/test-xstrtoimax.sh (t-xstrtoimax.xo): Likewise.
Paul Eggert <eggert@cs.ucla.edu>
parents: 9141
diff changeset
39 invalid suffix in X argument \`${too_big}h'
4df785011e4c * tests/test-xstrtoimax.sh (t-xstrtoimax.xo): Likewise.
Paul Eggert <eggert@cs.ucla.edu>
parents: 9141
diff changeset
40 X argument \`$too_big' too large
4df785011e4c * tests/test-xstrtoimax.sh (t-xstrtoimax.xo): Likewise.
Paul Eggert <eggert@cs.ucla.edu>
parents: 9141
diff changeset
41 invalid X argument \`x'
4df785011e4c * tests/test-xstrtoimax.sh (t-xstrtoimax.xo): Likewise.
Paul Eggert <eggert@cs.ucla.edu>
parents: 9141
diff changeset
42 invalid suffix in X argument \`9x'
9141
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
43 010->8 ()
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
44 MiB->1048576 ()
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
45 EOF
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
46
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
47 diff t-xstrtoimax.xo t-xstrtoimax.tmp || result=1
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
48
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
49 rm -fr $tmpfiles
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
50
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
51 exit $result