startmacro
!
!  Macro to test ramp
!
! DEPENDENCIES: SEDIT, STATISTICS
!
! This test makes sure all types can create a ramp from
! (-x,-x) to (+x,+x) and produces a file of the correct
! statistics
!
call test_basic_ramp

endmacro

!**********************************
procedure test_basic_ramp
  result T:truth {}
  result truth.nels 7.0
  result truth.mean 0.0
  result truth.max 3.0
  result truth.min -3.0
  result truth.sdev 2.0
  result S:types "SB,SI,SL,SF,SD"
  do i 1 5
    sedit/onebase types format "ELEM" ^i
    sedit/onebase format format LOCASE
    result testfile "temp_testramp_^format"

    RAMP,OUT=^testfile,FORM=SD,ELEM=truth.nels,DATASTART=truth.min,START=truth.min
    STATISTICS,IN=^testfile,MEAN=mean,SDEV=sdev,ELEM=nels,MAX=max,MIN=min,
    assert/text="^{reg.main.name} format=^format - MEAN " mean EQ truth.mean
    assert/text="^{reg.main.name} format=^format - SDEV " sdev EQ truth.sdev
    assert/text="^{reg.main.name} format=^format - ELEM " nels EQ truth.nels
    assert/text="^{reg.main.name} format=^format - MAX  " max  EQ truth.max
    assert/text="^{reg.main.name} format=^format - MIN  " min  EQ truth.min

    erase "^testfile"
  enddo

return
