1 # "Check many leaks" test #2
2 # Cramming all kinds of weird commands in here.
3 # As you find leaks, please create separate, small test
5 # Narrowing down the leak using this large test may be difficult.
6 # It is intended to be a blanket "is everything ok?" test
10 export dev_null="/dev/null"
12 echo hi1 $local_var `echo ho` >>/dev/null
13 echo hi2 $local_var </dev/null | echo 2>&- | cat 1<>/dev/null
14 { echo hi4 $local_var `echo ho` 1<>/dev/null; }
15 ( echo hi4 $local_var `echo ho` 1<>/dev/null )
16 if echo $local_var; false
20 else cat 0<>$dev_null 1<>"$dev_null"
23 if echo $local_var; then cat <<HERE
28 while { echo $dev_null >>$dev_null; }; do cat <"$dev_null"; break; done
29 ( until { echo $dev_null >>$dev_null | false; }; do cat <"$dev_null"; break; done ) <$dev_null
35 echo "Measuring memory leak..."
36 # Please copy the entire block from above verbatim
38 export dev_null="/dev/null"
40 echo hi1 $local_var `echo ho` >>/dev/null
41 echo hi2 $local_var </dev/null | echo 2>&- | cat 1<>/dev/null
42 { echo hi4 $local_var `echo ho` 1<>/dev/null; }
43 ( echo hi4 $local_var `echo ho` 1<>/dev/null )
44 if echo $local_var; false
48 else cat 0<>$dev_null 1<>"$dev_null"
51 if echo $local_var; then cat <<HERE
56 while { echo $dev_null >>$dev_null; }; do cat <"$dev_null"; break; done
57 ( until { echo $dev_null >>$dev_null | false; }; do cat <"$dev_null"; break; done ) <$dev_null
64 export dev_null="/dev/null"
66 echo hi1 $local_var `echo ho` >>/dev/null
67 echo hi2 $local_var </dev/null | echo 2>&- | cat 1<>/dev/null
68 { echo hi4 $local_var `echo ho` 1<>/dev/null; }
69 ( echo hi4 $local_var `echo ho` 1<>/dev/null )
70 if echo $local_var; false
74 else cat 0<>$dev_null 1<>"$dev_null"
77 if echo $local_var; then cat <<HERE
82 while { echo $dev_null >>$dev_null; }; do cat <"$dev_null"; break; done
83 ( until { echo $dev_null >>$dev_null | false; }; do cat <"$dev_null"; break; done ) <$dev_null
89 if test $kb -le 4; then
92 echo "Bad: $kb kb (or more) leaked"