annotate tests/test-xstrtol.sh @ 9958:3e7edaaecea2

Fix test failures on mingw.
author Bruno Haible <bruno@clisp.org>
date Tue, 22 Apr 2008 00:43:52 +0200
parents 4290c9101f09
children 44e4e306d7c5
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-xstrtol.tmp t-xstrtol.xo"
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
7 : > t-xstrtol.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 xstrtol
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
12 ./test-xstrtol${EXEEXT} 1 >> t-xstrtol.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-xstrtol${EXEEXT} -1 >> t-xstrtol.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-xstrtol${EXEEXT} 1k >> t-xstrtol.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-xstrtol${EXEEXT} ${too_big}h >> t-xstrtol.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-xstrtol${EXEEXT} $too_big >> t-xstrtol.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-xstrtol${EXEEXT} x >> t-xstrtol.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-xstrtol${EXEEXT} 9x >> t-xstrtol.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-xstrtol${EXEEXT} 010 >> t-xstrtol.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 # suffix without integer is valid
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
21 ./test-xstrtol${EXEEXT} MiB >> t-xstrtol.tmp 2>&1 || result=1
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
22
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
23 # test xstrtoul
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
24 ./test-xstrtoul${EXEEXT} 1 >> t-xstrtol.tmp 2>&1 || result=1
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
25 ./test-xstrtoul${EXEEXT} -1 >> t-xstrtol.tmp 2>&1 && result=1
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
26 ./test-xstrtoul${EXEEXT} 1k >> t-xstrtol.tmp 2>&1 || result=1
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
27 ./test-xstrtoul${EXEEXT} ${too_big}h >> t-xstrtol.tmp 2>&1 && result=1
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
28 ./test-xstrtoul${EXEEXT} $too_big >> t-xstrtol.tmp 2>&1 && result=1
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
29 ./test-xstrtoul${EXEEXT} x >> t-xstrtol.tmp 2>&1 && result=1
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
30 ./test-xstrtoul${EXEEXT} 9x >> t-xstrtol.tmp 2>&1 && result=1
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
31 ./test-xstrtoul${EXEEXT} 010 >> t-xstrtol.tmp 2>&1 || result=1
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
32 ./test-xstrtoul${EXEEXT} MiB >> t-xstrtol.tmp 2>&1 || result=1
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 # normalize output
9958
3e7edaaecea2 Fix test failures on mingw.
Bruno Haible <bruno@clisp.org>
parents: 9143
diff changeset
35 LC_ALL=C tr -d '\r' < t-xstrtol.tmp > t-xstrtol.xo
9141
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
36 mv t-xstrtol.xo t-xstrtol.tmp
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
37
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
38 # compare expected output
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
39 cat > t-xstrtol.xo <<EOF
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
40 1->1 ()
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
41 -1->-1 ()
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
42 1k->1024 ()
9143
4290c9101f09 * NEWS: In xstrtol, remove STRTOL_FATAL_ERROR and add xstrtol_fatal.
Paul Eggert <eggert@cs.ucla.edu>
parents: 9141
diff changeset
43 invalid suffix in X argument \`${too_big}h'
4290c9101f09 * NEWS: In xstrtol, remove STRTOL_FATAL_ERROR and add xstrtol_fatal.
Paul Eggert <eggert@cs.ucla.edu>
parents: 9141
diff changeset
44 X argument \`$too_big' too large
4290c9101f09 * NEWS: In xstrtol, remove STRTOL_FATAL_ERROR and add xstrtol_fatal.
Paul Eggert <eggert@cs.ucla.edu>
parents: 9141
diff changeset
45 invalid X argument \`x'
4290c9101f09 * NEWS: In xstrtol, remove STRTOL_FATAL_ERROR and add xstrtol_fatal.
Paul Eggert <eggert@cs.ucla.edu>
parents: 9141
diff changeset
46 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
47 010->8 ()
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
48 MiB->1048576 ()
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
49 1->1 ()
9143
4290c9101f09 * NEWS: In xstrtol, remove STRTOL_FATAL_ERROR and add xstrtol_fatal.
Paul Eggert <eggert@cs.ucla.edu>
parents: 9141
diff changeset
50 invalid X argument \`-1'
9141
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
51 1k->1024 ()
9143
4290c9101f09 * NEWS: In xstrtol, remove STRTOL_FATAL_ERROR and add xstrtol_fatal.
Paul Eggert <eggert@cs.ucla.edu>
parents: 9141
diff changeset
52 invalid suffix in X argument \`${too_big}h'
4290c9101f09 * NEWS: In xstrtol, remove STRTOL_FATAL_ERROR and add xstrtol_fatal.
Paul Eggert <eggert@cs.ucla.edu>
parents: 9141
diff changeset
53 X argument \`$too_big' too large
4290c9101f09 * NEWS: In xstrtol, remove STRTOL_FATAL_ERROR and add xstrtol_fatal.
Paul Eggert <eggert@cs.ucla.edu>
parents: 9141
diff changeset
54 invalid X argument \`x'
4290c9101f09 * NEWS: In xstrtol, remove STRTOL_FATAL_ERROR and add xstrtol_fatal.
Paul Eggert <eggert@cs.ucla.edu>
parents: 9141
diff changeset
55 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
56 010->8 ()
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
57 MiB->1048576 ()
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
58 EOF
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
59
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
60 diff t-xstrtol.xo t-xstrtol.tmp || result=1
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
61
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
62 rm -fr $tmpfiles
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
63
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
64 exit $result