fprintf-posix: Check against memory leak fixed on 2009-12-15.
[gnulib.git] / tests / test-fprintf-posix3.sh
diff --git a/tests/test-fprintf-posix3.sh b/tests/test-fprintf-posix3.sh
new file mode 100755 (executable)
index 0000000..6a6976d
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+# Test against a memory leak.
+
+(./test-fprintf-posix3${EXEEXT} 0
+ result=$?
+ if test $result != 77 && test $result != 78; then result=1; fi
+ exit $result
+) 2>/dev/null
+malloc_result=$?
+if test $malloc_result = 77; then
+  echo "Skipping test: getrlimit and setrlimit don't work"
+  exit 77
+fi
+
+./test-fprintf-posix3${EXEEXT} 1 > /dev/null
+result=$?
+if test $result = 77; then
+  echo "Skipping test: getrlimit and setrlimit don't work"
+  exit 77
+fi
+if test $result != 0; then
+  exit 1
+fi
+
+if test $malloc_result = 78; then
+  echo "Skipping test: getrlimit and setrlimit don't work"
+  exit 77
+fi
+
+exit 0