summaryrefslogtreecommitdiffhomepage
path: root/shell/hush_test/hush-z_slow/leak_heredoc1.tests
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2009-04-09 14:15:57 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2009-04-09 14:15:57 +0000
commit1943aec2ec390d9fda159aa0412362780ec83f09 (patch)
treeec9ddd365d2232d9fb621b79000cbf20f1410cda /shell/hush_test/hush-z_slow/leak_heredoc1.tests
parentefea9d2819165b414b81a47c8227ae007bd5382a (diff)
hush: plug the leak of expanded heredoc
Diffstat (limited to 'shell/hush_test/hush-z_slow/leak_heredoc1.tests')
-rwxr-xr-xshell/hush_test/hush-z_slow/leak_heredoc1.tests34
1 files changed, 34 insertions, 0 deletions
diff --git a/shell/hush_test/hush-z_slow/leak_heredoc1.tests b/shell/hush_test/hush-z_slow/leak_heredoc1.tests
new file mode 100755
index 000000000..26cbb28a4
--- /dev/null
+++ b/shell/hush_test/hush-z_slow/leak_heredoc1.tests
@@ -0,0 +1,34 @@
+echo "Warm up"
+i=1
+while test $i != 99; do
+ : <<HERE
+Hello $i `echo builtin_$i`
+HERE
+ : $((i++))
+done
+
+memleak
+
+echo "Measuring memory leak..."
+i=1
+while test $i != 99; do
+ : <<HERE
+Hello $i `echo builtin_$i`
+HERE
+ : $((i++))
+done
+i=1
+while test $i != 99; do
+ : <<HERE
+Hello $i `echo builtin_$i`
+HERE
+ : $((i++))
+done
+
+memleak
+kb=$?
+if test $kb -le 4; then
+ echo Ok #$kb
+else
+ echo "Bad: $kb kb (or more) leaked"
+fi