usleep tests: Avoid failure due to known Cygwin 3.5.3 bug.
[gnulib.git] / tests / test-xstrtoumax.sh
blob5faca6a4398f1cfc79e21bd0d49563b52f653f30
1 #!/bin/sh
2 : "${srcdir=.}"
3 . "$srcdir/init.sh"; path_prepend_ .
5 too_big=99999999999999999999999999999999999999999999999999999999999999999999
6 result=0
8 # test xstrtoumax
9 ${CHECKER} test-xstrtoumax 1 >> out 2>&1 || result=1
10 ${CHECKER} test-xstrtoumax -1 >> out 2>&1 && result=1
11 ${CHECKER} test-xstrtoumax 1k >> out 2>&1 || result=1
12 ${CHECKER} test-xstrtoumax ${too_big}h >> out 2>&1 && result=1
13 ${CHECKER} test-xstrtoumax $too_big >> out 2>&1 && result=1
14 ${CHECKER} test-xstrtoumax x >> out 2>&1 && result=1
15 ${CHECKER} test-xstrtoumax 9x >> out 2>&1 && result=1
16 ${CHECKER} test-xstrtoumax 010 >> out 2>&1 || result=1
17 ${CHECKER} test-xstrtoumax MiB >> out 2>&1 || result=1
19 # Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
20 # does not understand '\r'.
21 if echo solaris | tr -d '\r' | grep solais > /dev/null; then
22 cr='\015'
23 else
24 cr='\r'
27 # normalize output
28 LC_ALL=C tr -d "$cr" < out > k
29 mv k out
31 # compare expected output
32 cat > exp <<EOF
33 1->1 ()
34 invalid X argument '-1'
35 1k->1024 ()
36 invalid suffix in X argument '${too_big}h'
37 X argument '$too_big' too large
38 invalid X argument 'x'
39 invalid suffix in X argument '9x'
40 010->8 ()
41 MiB->1048576 ()
42 EOF
44 compare exp out || result=1
46 Exit $result