source: MondoRescue/branches/2.2.9/mindi-busybox/shell/hush_test/hush-leak/leak_argv1.tests@ 2725

Last change on this file since 2725 was 2725, checked in by Bruno Cornec, 13 years ago
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
  • Property svn:executable set to *
File size: 3.5 KB
Line 
1# Warm up
2i=1
3while test $i != X; do
4 set -- a b c d e f g h i j k l m n o p q r s t u v w x y z
5 shift
6 shift 2
7 shift 5
8 shift 11
9 set -- A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
10 shift 3
11 shift 7
12 i=1$i
13 if test $i = 1111111111111111111111111111111111111111111111; then i=2; fi
14 if test $i = 1111111111111111111111111111111111111111111112; then i=3; fi
15 if test $i = 1111111111111111111111111111111111111111111113; then i=4; fi
16 if test $i = 1111111111111111111111111111111111111111111114; then i=5; fi
17 if test $i = 1111111111111111111111111111111111111111111115; then i=6; fi
18 if test $i = 1111111111111111111111111111111111111111111116; then i=7; fi
19 if test $i = 1111111111111111111111111111111111111111111117; then i=8; fi
20 if test $i = 1111111111111111111111111111111111111111111118; then i=9; fi
21 if test $i = 1111111111111111111111111111111111111111111119; then i=a; fi
22 if test $i = 111111111111111111111111111111111111111111111a; then i=b; fi
23 if test $i = 111111111111111111111111111111111111111111111b; then i=c; fi
24 if test $i = 111111111111111111111111111111111111111111111c; then i=d; fi
25 if test $i = 111111111111111111111111111111111111111111111d; then i=e; fi
26 if test $i = 111111111111111111111111111111111111111111111e; then i=f; fi
27 if test $i = 111111111111111111111111111111111111111111111f; then i=g; fi
28 if test $i = 111111111111111111111111111111111111111111111g; then i=h; fi
29 if test $i = 111111111111111111111111111111111111111111111h; then i=i; fi
30 if test $i = 111111111111111111111111111111111111111111111i; then i=j; fi
31 if test $i = 111111111111111111111111111111111111111111111j; then i=X; fi
32done
33
34unset i
35set --
36memleak
37
38echo "Measuring memory leak..."
39i=1
40while test $i != X; do
41 set -- a b c d e f g h i j k l m n o p q r s t u v w x y z
42 shift
43 shift 2
44 shift 5
45 shift 11
46 set -- A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
47 shift 3
48 shift 7
49 i=1$i
50 if test $i = 1111111111111111111111111111111111111111111111; then i=2; fi
51 if test $i = 1111111111111111111111111111111111111111111112; then i=3; fi
52 if test $i = 1111111111111111111111111111111111111111111113; then i=4; fi
53 if test $i = 1111111111111111111111111111111111111111111114; then i=5; fi
54 if test $i = 1111111111111111111111111111111111111111111115; then i=6; fi
55 if test $i = 1111111111111111111111111111111111111111111116; then i=7; fi
56 if test $i = 1111111111111111111111111111111111111111111117; then i=8; fi
57 if test $i = 1111111111111111111111111111111111111111111118; then i=9; fi
58 if test $i = 1111111111111111111111111111111111111111111119; then i=a; fi
59 if test $i = 111111111111111111111111111111111111111111111a; then i=b; fi
60 if test $i = 111111111111111111111111111111111111111111111b; then i=c; fi
61 if test $i = 111111111111111111111111111111111111111111111c; then i=d; fi
62 if test $i = 111111111111111111111111111111111111111111111d; then i=e; fi
63 if test $i = 111111111111111111111111111111111111111111111e; then i=f; fi
64 if test $i = 111111111111111111111111111111111111111111111f; then i=g; fi
65 if test $i = 111111111111111111111111111111111111111111111g; then i=h; fi
66 if test $i = 111111111111111111111111111111111111111111111h; then i=i; fi
67 if test $i = 111111111111111111111111111111111111111111111i; then i=j; fi
68 if test $i = 111111111111111111111111111111111111111111111j; then i=X; fi
69done
70
71unset i
72set --
73memleak
74
75kb=$?
76if test $kb -le 4; then
77 echo Ok #$kb
78else
79 echo "Bad: $kb kb leaked"
80fi
Note: See TracBrowser for help on using the repository browser.