diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-11-23 12:50:54 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-11-23 12:50:54 +0000 |
commit | f962a0354e2426ef9781df97e4b02b32e438783c (patch) | |
tree | 4e0b3363932fbc0a30d5242b58ca5a0fea48d2a8 /shell/hush_test | |
parent | f23c3f95e88302923147f159115180da7cf0344e (diff) | |
download | busybox-w32-f962a0354e2426ef9781df97e4b02b32e438783c.tar.gz busybox-w32-f962a0354e2426ef9781df97e4b02b32e438783c.tar.bz2 busybox-w32-f962a0354e2426ef9781df97e4b02b32e438783c.zip |
hush: plug memory leak
Diffstat (limited to 'shell/hush_test')
-rwxr-xr-x | shell/hush_test/hush-z_slow/leak_var.tests | 56 | ||||
-rwxr-xr-x | shell/hush_test/run-all | 1 |
2 files changed, 40 insertions, 17 deletions
diff --git a/shell/hush_test/hush-z_slow/leak_var.tests b/shell/hush_test/hush-z_slow/leak_var.tests index d3ca25908..388d6a734 100755 --- a/shell/hush_test/hush-z_slow/leak_var.tests +++ b/shell/hush_test/hush-z_slow/leak_var.tests | |||
@@ -1,24 +1,46 @@ | |||
1 | pid=$$ | 1 | pid=$$ |
2 | 2 | ||
3 | # Warm up | 3 | # Warm up |
4 | unset t | ||
5 | t=111111111111111111111111111111111111111111111111111111111111111111111111 | ||
6 | export t | ||
7 | unset t | ||
8 | t=111111111111111111111111111111111111111111111111111111111111111111111111 | ||
9 | export t | ||
10 | unset t | ||
11 | t=111111111111111111111111111111111111111111111111111111111111111111111111 | ||
12 | export t | ||
13 | unset t | ||
14 | t=111111111111111111111111111111111111111111111111111111111111111111111111 | ||
15 | export t | ||
16 | unset t | ||
17 | t=111111111111111111111111111111111111111111111111111111111111111111111111 | ||
18 | export t | ||
19 | i=1 | ||
20 | if test $i = 1111111111111111111111111111111111111111111111; then i=2; fi | ||
21 | beg=`ps -o pid,vsz | grep "^ *$pid "` | 4 | beg=`ps -o pid,vsz | grep "^ *$pid "` |
5 | i=1 | ||
6 | while test $i != X; do | ||
7 | unset t | ||
8 | t=111111111111111111111111111111111111111111111111111111111111111111111111 | ||
9 | export t | ||
10 | unset t | ||
11 | t=111111111111111111111111111111111111111111111111111111111111111111111111 | ||
12 | export t | ||
13 | unset t | ||
14 | t=111111111111111111111111111111111111111111111111111111111111111111111111 | ||
15 | export t | ||
16 | unset t | ||
17 | t=111111111111111111111111111111111111111111111111111111111111111111111111 | ||
18 | export t | ||
19 | unset t | ||
20 | t=111111111111111111111111111111111111111111111111111111111111111111111111 | ||
21 | export t | ||
22 | i=1$i | ||
23 | if test $i = 1111111111111111111111111111111111111111111111; then i=2; fi | ||
24 | if test $i = 1111111111111111111111111111111111111111111112; then i=3; fi | ||
25 | if test $i = 1111111111111111111111111111111111111111111113; then i=4; fi | ||
26 | if test $i = 1111111111111111111111111111111111111111111114; then i=5; fi | ||
27 | if test $i = 1111111111111111111111111111111111111111111115; then i=6; fi | ||
28 | if test $i = 1111111111111111111111111111111111111111111116; then i=7; fi | ||
29 | if test $i = 1111111111111111111111111111111111111111111117; then i=8; fi | ||
30 | if test $i = 1111111111111111111111111111111111111111111118; then i=9; fi | ||
31 | if test $i = 1111111111111111111111111111111111111111111119; then i=a; fi | ||
32 | if test $i = 111111111111111111111111111111111111111111111a; then i=b; fi | ||
33 | if test $i = 111111111111111111111111111111111111111111111b; then i=c; fi | ||
34 | if test $i = 111111111111111111111111111111111111111111111c; then i=d; fi | ||
35 | if test $i = 111111111111111111111111111111111111111111111d; then i=e; fi | ||
36 | if test $i = 111111111111111111111111111111111111111111111e; then i=f; fi | ||
37 | if test $i = 111111111111111111111111111111111111111111111f; then i=g; fi | ||
38 | if test $i = 111111111111111111111111111111111111111111111g; then i=h; fi | ||
39 | if test $i = 111111111111111111111111111111111111111111111h; then i=i; fi | ||
40 | if test $i = 111111111111111111111111111111111111111111111i; then i=j; fi | ||
41 | if test $i = 111111111111111111111111111111111111111111111j; then i=X; fi | ||
42 | done | ||
43 | end=`ps -o pid,vsz | grep "^ *$pid "` | ||
22 | 44 | ||
23 | echo "Measuring memory leak..." | 45 | echo "Measuring memory leak..." |
24 | beg=`ps -o pid,vsz | grep "^ *$pid "` | 46 | beg=`ps -o pid,vsz | grep "^ *$pid "` |
diff --git a/shell/hush_test/run-all b/shell/hush_test/run-all index ec8323008..0d40ae6df 100755 --- a/shell/hush_test/run-all +++ b/shell/hush_test/run-all | |||
@@ -31,6 +31,7 @@ do_test() | |||
31 | test -x "$x" || continue | 31 | test -x "$x" || continue |
32 | name="${x%%.tests}" | 32 | name="${x%%.tests}" |
33 | test -f "$name.right" || continue | 33 | test -f "$name.right" || continue |
34 | # echo Running test: "$name.right" | ||
34 | { | 35 | { |
35 | "$THIS_SH" "./$x" >"$name.xx" 2>&1 | 36 | "$THIS_SH" "./$x" >"$name.xx" 2>&1 |
36 | diff -u "$name.xx" "$name.right" >"../$1-$x.fail" && rm -f "$name.xx" "../$1-$x.fail" | 37 | diff -u "$name.xx" "$name.right" >"../$1-$x.fail" && rm -f "$name.xx" "../$1-$x.fail" |