Changeset 9472
- Timestamp:
- Oct 10, 2006, 1:21:20 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/cmd.basic/test/for.sh (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.basic/test/for.sh
r9197 r9472 6 6 test4 7 7 test5 8 memtest1 9 memtest2 10 memtest3 8 11 end 9 12 … … 81 84 end 82 85 86 # do we break from a loop correctly 87 macro test5 88 89 break -auto off 90 91 local i N 92 93 $N = 0 94 for i 0 100 95 $N = $N + 1 96 if ($i == 30) 97 break 98 end 99 end 100 101 if (($i != 30) || ($N != 31)) 102 $PASS = 0 103 echo "i: $i" 104 echo "N: $N" 105 end 106 end 107 83 108 # check memleaks 84 macro test5109 macro memtest1 85 110 86 111 local i N … … 104 129 end 105 130 end 131 132 # check memleaks with many loop lines 133 macro memtest2 134 135 local i N 136 137 list word -x "ps -p $PID -o rss" 138 $startmem = $word:1 139 140 output /dev/null 141 for i 0 10000 142 echo "test line in loop" 143 echo "test line in loop" 144 echo "test line in loop" 145 echo "test line in loop" 146 echo "test line in loop" 147 end 148 output stdout 149 150 list word -x "ps -p $PID -o rss" 151 $endmem = $word:1 152 153 if ($endmem - $startmem > 10) 154 $PASS = 0 155 echo "growth: {$endmem-$startmem}" 156 echo "kB/loop: {($endmem-$startmem)/10000}" 157 end 158 end 159 160 # check memleaks on break 161 macro memtest3 162 163 local i N 164 165 break -auto off 166 167 list word -x "ps -p $PID -o rss" 168 $startmem = $word:1 169 170 for i 0 10000 171 for j 0 5 172 break 173 echo "test line in loop" 174 echo "test line in loop" 175 echo "test line in loop" 176 echo "test line in loop" 177 echo "test line in loop" 178 end 179 end 180 181 list word -x "ps -p $PID -o rss" 182 $endmem = $word:1 183 184 if ($i != 9999) 185 $PASS = 0 186 echo "break jumped outer loop: i = $i" 187 end 188 189 if ($endmem - $startmem > 10) 190 $PASS = 0 191 echo "growth: {$endmem-$startmem}" 192 echo "kB/loop: {($endmem-$startmem)/10000}" 193 end 194 end 195
Note:
See TracChangeset
for help on using the changeset viewer.
