IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40772


Ignore:
Timestamp:
Jun 1, 2019, 10:28:14 AM (7 years ago)
Author:
eugene
Message:

adding tests for mem leaks

Location:
branches/eam_branches/ohana.20190329/src/opihi
Files:
8 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20190329/src/opihi/cmd.basic/test/if.sh

    r16894 r40772  
    320320 end
    321321end
     322
     323# check memleaks
     324macro memtest1
     325
     326 local a b i N
     327
     328 $i = 0
     329 $a = 1
     330
     331 memory check
     332 output /dev/null
     333 for i 0 1000
     334   if ($a == 1)
     335    echo "run"   
     336   end
     337 end   
     338 output stdout
     339 memory check
     340end
     341
     342# check memleaks
     343macro memtest2
     344
     345 local a b i N
     346
     347 $i = 0
     348 $a = 1
     349 $b = 2
     350
     351 memory check
     352 output /dev/null
     353 for i 0 1000
     354   if (($a == 1) && ($b == 2))
     355    echo "run"   
     356   end
     357 end   
     358 output stdout
     359 memory check
     360end
     361
     362# memory test using continue
     363macro memtest3
     364
     365 local a b i N
     366
     367 $i = 0
     368 $a = 1
     369 $b = 2
     370
     371 memory check
     372 output /dev/null
     373 for i 0 1000
     374   if (($a == 1) && ($b == 2))
     375    continue
     376    echo "run"   
     377   end
     378 end   
     379 output stdout
     380 memory check
     381end
     382
     383# memory test using continue
     384macro memtest4
     385
     386 local a b i N bool
     387
     388
     389 $i = 0
     390 $a = 1
     391 $b = 2
     392 $bool = 0
     393
     394 memory check
     395 output /dev/null
     396 for i 0 1000
     397   $bool = (($a == 1) && ($b == 2))
     398 end   
     399 output stdout
     400 memory check
     401end
  • branches/eam_branches/ohana.20190329/src/opihi/cmd.basic/test/macro.sh

    r10311 r40772  
    77# Is the macro working?
    88macro test_prep
     9 $test_var1 = check1
     10 $test_var2 = check2
     11 $var_count = $0
     12end
     13
     14# Is the macro working?
     15macro test_local
     16 local test_var test_var2 var_count
     17
    918 $test_var1 = check1
    1019 $test_var2 = check2
     
    4756 end
    4857end
     58
     59# Memory Test for macro
     60macro memtest2
     61
     62 $i = 0
     63 test_prep
     64
     65 memory check
     66 for i 0 10000
     67  test_prep
     68 end   
     69 memory check
     70 
     71end
     72
     73# Memory Test for macro
     74macro memtest3
     75
     76 $i = 0
     77 test_local
     78
     79 memory check
     80 for i 0 10000
     81  test_local
     82 end   
     83 memory check
     84 
     85end
  • branches/eam_branches/ohana.20190329/src/opihi/cmd.data/test/cut.sh

    r16056 r40772  
    3737 end
    3838end
     39
     40macro memtest1
     41
     42 $i = 0
     43 mcreate tim 100 100
     44 cut tim xdir imx X 40 4 60 6
     45 # do one to set up memory that should stay used
     46
     47 memory check
     48 for i 0 100
     49   cut tim xdir imx X 40 4 60 6
     50 end
     51 memory check
     52   
     53 for i 0 100
     54   cut tim xdir imx y 40 4 60 6
     55 end
     56 memory check
     57   
     58 for i 0 100
     59   cut -median tim xdir imx X 40 4 60 6
     60 end
     61 memory check
     62   
     63 for i 0 100
     64   cut -median tim xdir imx y 40 4 60 6
     65 end
     66 memory check
     67   
     68 for i 0 100
     69   cut -mean tim xdir imx X 40 4 60 6
     70 end
     71 memory check
     72   
     73 for i 0 100
     74   cut -mean tim xdir imx y 40 4 60 6
     75 end
     76 memory check
     77   
     78end
  • branches/eam_branches/ohana.20190329/src/opihi/cmd.data/test/vsigmoid.sh

    r40752 r40772  
    217217 end
    218218end
     219
     220macro memtest1
     221
     222 create x -10 10 0.1
     223 set y = 0 + 5 / (1 + exp((x - 3)/4))
     224
     225 $C0 = 1
     226 $C1 = 2
     227 $C2 = 10
     228 $C3 = 1
     229 set dy = sqrt(y)
     230 set yfit = zero(y)
     231
     232 $i = 0
     233
     234 memory check
     235 for i 0 1000
     236   vsigmoid -q x y dy yfit
     237 end
     238 memory check
     239   
     240end
     241
     242macro memtest2
     243
     244 create x -10 10 0.1
     245 set y = 0 + 5 / (1 + exp((x - 3)/4))
     246
     247 $C0 = 1
     248 $C1 = 2
     249 $C2 = 10
     250 $C3 = 1
     251 set dy = sqrt(y)
     252 set yfit = zero(y)
     253
     254 $i = 0
     255
     256 memory check
     257 for i 0 1000
     258   vsigmoid -q -r x y dy yfit
     259 end
     260 memory check
     261   
     262end
     263
  • branches/eam_branches/ohana.20190329/src/opihi/mana/deimos_mkobj.c

    r40662 r40772  
    8686    Nwave = atoi (argv[N]);
    8787    remove_argument (N, &argc, argv);
     88  }
     89
     90  int VERBOSE = FALSE;
     91  if ((N = get_argument (argc, argv, "-v"))) {
     92    remove_argument (N, &argc, argv);
     93    VERBOSE = TRUE;
    8894  }
    8995
     
    200206      dxr = 1 - dxf;
    201207      Npof += dxi;
    202       if (iy % 200 == 0) { fprintf (stderr, "%d : %f : %d : %f %f\n", iy, dx, dxi, dxf, dxr); }
     208      if (VERBOSE && (iy % 200 == 0)) { gprint (GP_ERR, "%d : %f : %d : %f %f\n", iy, dx, dxi, dxf, dxr); }
    203209    }
    204210
Note: See TracChangeset for help on using the changeset viewer.