IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 8, 2008, 11:30:10 AM (18 years ago)
Author:
eugene
Message:

minor fixes to tests to improve speed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.basic/test/if.sh

    r14176 r16894  
    1313 test11
    1414 test12
     15 test13a
    1516 test13
    16 # test14
     17 test14
    1718end
    1819
     
    201202end
    202203
     204
     205# check memleaks
     206macro test13a
     207
     208 local a b i N
     209
     210 list word -x "ps -p $PID -o rss"
     211 $startmem = $word:1
     212
     213 output /dev/null
     214 $a = 1
     215 for i 0 1000
     216   if ($a == 1)
     217    echo "run"   
     218   end
     219 end   
     220 output stdout
     221 
     222 list word -x "ps -p $PID -o rss"
     223 $endmem = $word:1
     224
     225 if ({$endmem - $startmem} < 10)
     226   $PASS = 1
     227 else
     228   $PASS = 0
     229   echo "growth: {$endmem-$startmem}"
     230   echo "kB/loop: {($endmem-$startmem)/1000}"
     231 end
     232end
    203233
    204234# check memleaks
     
    213243 $a = 1
    214244 $b = 2
    215  for i 0 10000
     245 for i 0 1000
    216246   if (($a == 1) && ($b == 2))
    217247    echo "run"   
     
    228258   $PASS = 0
    229259   echo "growth: {$endmem-$startmem}"
    230    echo "kB/loop: {($endmem-$startmem)/10000}"
    231  end
    232 end
    233 
    234 # memory test using break
     260   echo "kB/loop: {($endmem-$startmem)/1000}"
     261 end
     262end
     263
     264# memory test using continue
    235265macro test14
    236266
     
    243273 $a = 1
    244274 $b = 2
    245  for i 0 10000
     275 for i 0 1000
    246276   if (($a == 1) && ($b == 2))
    247     break
     277    continue
    248278    echo "run"   
    249279   end
     
    259289   $PASS = 0
    260290   echo "growth: {$endmem-$startmem}"
    261    echo "kB/loop: {($endmem-$startmem)/10000}"
    262  end
    263 end
     291   echo "kB/loop: {($endmem-$startmem)/1000}"
     292 end
     293end
     294
     295# memory test using continue
     296macro test15
     297
     298 local a b i N bool
     299
     300 list word -x "ps -p $PID -o rss"
     301 $startmem = $word:1
     302
     303 output /dev/null
     304 $a = 1
     305 $b = 2
     306 for i 0 1000
     307   $bool = (($a == 1) && ($b == 2))
     308 end   
     309 output stdout
     310 
     311 list word -x "ps -p $PID -o rss"
     312 $endmem = $word:1
     313
     314 if ({$endmem - $startmem} < 10)
     315   $PASS = 1
     316 else
     317   $PASS = 0
     318   echo "growth: {$endmem-$startmem}"
     319   echo "kB/loop: {($endmem-$startmem)/1000}"
     320 end
     321end
Note: See TracChangeset for help on using the changeset viewer.