IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16894


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

minor fixes to tests to improve speed

Location:
trunk/Ohana/src/opihi/cmd.basic/test
Files:
4 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
  • trunk/Ohana/src/opihi/cmd.basic/test/list.sh

    r16059 r16894  
    117117 $startmem = $word:1
    118118
    119  for i 0 1000
     119 for i 0 100
    120120  list check3 -x "ls /dev/null"
    121121 end   
     
    129129   $PASS = 0
    130130   echo "growth: {$endmem-$startmem}"
    131    echo "kB/loop: {($endmem-$startmem)/1000}"
     131   echo "kB/loop: {($endmem-$startmem)/100}"
    132132 end
    133133
     
    153153 $startmem = $word:1
    154154
    155  for i 0 1000
     155 for i 0 100
    156156  list check4 -x "cat list_test.txt"
    157157 end   
     
    165165   $PASS = 0
    166166   echo "growth: {$endmem-$startmem}"
    167    echo "kB/loop: {($endmem-$startmem)/1000}"
     167   echo "kB/loop: {($endmem-$startmem)/100}"
    168168 end
    169169
  • trunk/Ohana/src/opihi/cmd.basic/test/output.sh

    r16059 r16894  
    4545
    4646 output /dev/null
    47  for i 0 1000
     47 for i 0 100
    4848  output testout.txt
    4949  echo "This is a test."
     
    5959   $PASS = 0
    6060   echo "growth: {$endmem-$startmem}"
    61    echo "kB/loop: {($endmem-$startmem)/1000}"
     61   echo "kB/loop: {($endmem-$startmem)/100}"
    6262 end
    6363end
  • trunk/Ohana/src/opihi/cmd.basic/test/variable.sh

    r10311 r16894  
    240240 $PASS = 1
    241241
    242  if (($?i == 1) || ($?N == 1))
     242 # a slightly weak test: depends on no prior macros defining variables
     243 # with the names below
     244 if (($?very_obscure_name == 1) || ($?another_obscure_name == 1))
    243245  $PASS = 0
    244246 end
Note: See TracChangeset for help on using the changeset viewer.