openat: don’t close (-1)
[gnulib.git] / tests / test-dprintf-posix2.sh
blob2827f4a209210fa06ba2e6e2260bea6ae3f5ee6e
1 #!/bin/sh
3 # Test against a memory leak.
5 (${CHECKER} ./test-dprintf-posix2${EXEEXT} 0
6 result=$?
7 if test $result != 77 && test $result != 78 && test $result != 79 && test $result != 80 && test $result != 81; then result=1; fi
8 exit $result
9 ) 2>/dev/null
10 malloc_result=$?
11 if test $malloc_result = 77; then
12 echo "Skipping test: no way to determine address space size"
13 exit 77
15 if test $malloc_result = 78; then
16 echo "Skipping test: cannot trust address space size on this platform"
17 exit 77
19 if test $malloc_result = 79; then
20 echo "Skipping test: cannot trust address space size when running under QEMU"
21 exit 77
23 if test $malloc_result = 80; then
24 echo "Skipping test: address sanitizer's malloc behaves differently"
25 exit 77
28 ${CHECKER} ./test-dprintf-posix2${EXEEXT} 1 > /dev/null
29 result=$?
30 if test $result = 77; then
31 echo "Skipping test: no way to determine address space size"
32 exit 77
34 if test $result != 0; then
35 exit 1
38 if test $malloc_result = 81; then
39 echo "Skipping test: get_rusage_as() doesn't work"
40 exit 77
43 exit 0