aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-01-12 06:47:39 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-01-12 06:47:39 +0100
commit385cc59117f2788d24d2cd75fd58f7ff044d501c (patch)
tree39eac0ffef23597671466a3399077c9d4269445a /shell/hush_test
parent65d722bb0d0e822db014a742da4c9c2c111131f0 (diff)
downloadbusybox-w32-385cc59117f2788d24d2cd75fd58f7ff044d501c.tar.gz
busybox-w32-385cc59117f2788d24d2cd75fd58f7ff044d501c.tar.bz2
busybox-w32-385cc59117f2788d24d2cd75fd58f7ff044d501c.zip
hush: plug a memory leak
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush_test')
-rw-r--r--shell/hush_test/hush-z_slow/leak_empty_tick.right3
-rwxr-xr-xshell/hush_test/hush-z_slow/leak_empty_tick.tests28
2 files changed, 31 insertions, 0 deletions
diff --git a/shell/hush_test/hush-z_slow/leak_empty_tick.right b/shell/hush_test/hush-z_slow/leak_empty_tick.right
new file mode 100644
index 000000000..c6f0334f3
--- /dev/null
+++ b/shell/hush_test/hush-z_slow/leak_empty_tick.right
@@ -0,0 +1,3 @@
1Warm up
2Measuring memory leak...
3Ok
diff --git a/shell/hush_test/hush-z_slow/leak_empty_tick.tests b/shell/hush_test/hush-z_slow/leak_empty_tick.tests
new file mode 100755
index 000000000..ae3757969
--- /dev/null
+++ b/shell/hush_test/hush-z_slow/leak_empty_tick.tests
@@ -0,0 +1,28 @@
1echo "Warm up"
2i=1
3while test $i != 9; do
4 `true`
5 : $((i++))
6done
7
8memleak
9
10echo "Measuring memory leak..."
11i=1
12while test $i != 199; do
13 `true`
14 : $((i++))
15done
16i=1
17while test $i != 199; do
18 `true`
19 : $((i++))
20done
21
22memleak
23kb=$?
24if test $kb -le 4; then
25 echo Ok #$kb
26else
27 echo "Bad: $kb kb (or more) leaked"
28fi