IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 12, 2007, 2:26:24 PM (19 years ago)
Author:
eugene
Message:

added tests from Mark Pitts

File:
1 edited

Legend:

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

    r10647 r14176  
    88 memtest1
    99 memtest2
    10  memtest2a
    1110 memtest3
    1211end
     
    1514macro test1
    1615
     16  $PASS = 0
     17
    1718  local i
    1819
     
    3132macro test2
    3233
     34  $PASS = 0
     35
    3336  local i
    3437
     
    4750# do we loop up in small steps correctly?
    4851macro test3
     52
     53  $PASS = 0
    4954
    5055  local i N
     
    6873macro test4
    6974
     75  $PASS = 0
     76
    7077  local i N
    7178
     
    8794# do we break from a loop correctly
    8895macro test5
     96
     97  $PASS = 0
    8998
    9099  break -auto off
     
    112121macro memtest1
    113122
     123 $PASS = 0
     124
    114125 local i N
    115126
     
    136147macro memtest2
    137148
     149 $PASS = 0
     150
    138151 local i N
    139152
     
    163176end
    164177
    165 # check memleaks with many loop lines
    166 macro memtest2a
    167 
    168  local i N
    169 
    170  list word -x "ps -p $PID -o rss"
    171  $startmem = $word:1
    172 
    173  output /dev/null
    174  for i 0 10000
    175   echo "test line in loop"
    176   echo "test line in loop"
    177  end   
    178  output stdout
    179  
    180  list word -x "ps -p $PID -o rss"
    181  $endmem = $word:1
    182 
    183  $PASS = 1
    184 
    185  if ($endmem - $startmem > 10)
    186    $PASS = 0
    187    echo "growth: {$endmem-$startmem}"
    188    echo "kB/loop: {($endmem-$startmem)/10000}"
    189  end
    190 end
    191 
    192 # check memleaks with many loop lines
    193 macro memtest2b
    194 
    195  local i N
    196 
    197  list word -x "ps -p $PID -o rss"
    198  $startmem = $word:1
    199 
    200  output /dev/null
    201  for i 0 1000
    202   exec echo "test line in loop" > /dev/null
    203   exec echo "test line in loop" > /dev/null
    204  end   
    205  output stdout
    206  
    207  list word -x "ps -p $PID -o rss"
    208  $endmem = $word:1
    209 
    210  $PASS = 1
    211 
    212  if ($endmem - $startmem > 10)
    213    $PASS = 0
    214    echo "growth: {$endmem-$startmem}"
    215    echo "kB/loop: {($endmem-$startmem)/1000}"
    216  end
    217 end
    218 
    219178# check memleaks on break
    220179macro memtest3
     180
     181 $PASS = 0
    221182
    222183 local i N
     
    254215 end
    255216end
    256 
Note: See TracChangeset for help on using the changeset viewer.