hush: add a leak test which currently fails
authorDenis Vlasenko <vda.linux@googlemail.com>
Wed, 8 Apr 2009 12:11:23 +0000 (12:11 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Wed, 8 Apr 2009 12:11:23 +0000 (12:11 -0000)
shell/hush_test/hush-z_slow/leak_var3.right [new file with mode: 0644]
shell/hush_test/hush-z_slow/leak_var3.tests [new file with mode: 0755]

diff --git a/shell/hush_test/hush-z_slow/leak_var3.right b/shell/hush_test/hush-z_slow/leak_var3.right
new file mode 100644 (file)
index 0000000..c6f0334
--- /dev/null
@@ -0,0 +1,3 @@
+Warm up
+Measuring memory leak...
+Ok
diff --git a/shell/hush_test/hush-z_slow/leak_var3.tests b/shell/hush_test/hush-z_slow/leak_var3.tests
new file mode 100755 (executable)
index 0000000..9554c42
--- /dev/null
@@ -0,0 +1,41 @@
+# Was seen leaking on NOMMU build
+
+echo "Warm up"
+i=1; t=1; export t
+while test $i != 400; do
+    t=valueA_$i true
+    : $((i++))
+done
+
+memleak
+echo "Measuring memory leak..."
+
+# Please copy the entire block from above verbatim
+i=1; t=1; export t
+while test $i != 400; do
+    t=valueA_$i true
+    : $((i++))
+done
+i=1; t=1; export t
+while test $i != 400; do
+    t=valueA_$i true
+    : $((i++))
+done
+i=1; t=1; export t
+while test $i != 400; do
+    t=valueA_$i true
+    : $((i++))
+done
+i=1; t=1; export t
+while test $i != 400; do
+    t=valueA_$i true
+    : $((i++))
+done
+
+memleak
+kb=$?
+if test $kb -le 4; then
+    echo Ok #$kb
+else
+    echo "Bad: $kb kb (or more) leaked"
+fi