IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 30, 2006, 9:02:30 AM (20 years ago)
Author:
eugene
Message:

updated tests from mark pitts

File:
1 edited

Legend:

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

    r9197 r10311  
    1212 test10
    1313 test11
     14 test12
     15 test13
     16 test14
    1417end
    1518
     
    168171
    169172
     173# basic logical test
     174macro test11
     175
     176 local a b
     177
     178 $a = 1
     179 $b = 2
     180
     181 if (($a <= 0) || ($b >= 3))
     182   $PASS = 0
     183 else
     184   $PASS = 1
     185 end
     186end
     187
     188
     189# basic logical test
     190macro test12
     191
     192 local a
     193
     194 $a = 1
     195
     196 if ($a != 1)
     197   $PASS = 0
     198 else
     199   $PASS = 1
     200 end
     201end
     202
     203
    170204# check memleaks
    171 macro test11
     205macro test13
    172206
    173207 local a b i N
     
    197231 end
    198232end
     233
     234# memory test using break
     235macro test14
     236
     237 local a b i N
     238
     239 list word -x "ps -p $PID -o rss"
     240 $startmem = $word:1
     241
     242 output /dev/null
     243 $a = 1
     244 $b = 2
     245 for i 0 10000
     246   if (($a == 1) && ($b == 2))
     247    break
     248    echo "run"   
     249   end
     250 end   
     251 output stdout
     252 
     253 list word -x "ps -p $PID -o rss"
     254 $endmem = $word:1
     255
     256 if ({$endmem - $startmem} < 10)
     257   $PASS = 1
     258 else
     259   $PASS = 0
     260   echo "growth: {$endmem-$startmem}"
     261   echo "kB/loop: {($endmem-$startmem)/10000}"
     262 end
     263end
Note: See TracChangeset for help on using the changeset viewer.