c***********************************************************************
c  Description: Test cases for M$FFTSIZE_BEST and M$FFTSIZE_VALID
c
c  Author : cberster   XM410
c  Version: $Id: test_ffts.cc
c***********************************************************************

	program test_ffts

	implicit none

	include 'primitive.inc'
        include 'assert.inc'

	integer*4	rcflag,searchdir,result,result1
	integer*4       testResult1,testResult2,counter,x,i
        integer*4       len
        parameter       (len=6)
	integer*4       inputs(len)
	integer*4       expectedValid(len)
        integer*4       expectedBest(len)
	DATA (inputs(x), x=1,len,1) /1,2,375,1024,1025,2096/
	DATA (expectedValid(x), x=1,len,1) /2,2,384,1024,1024,2048/
	DATA (expectedBest(x), x=1,len,1) /1,2,375,1024,1025,2100/

	call M$CHECKIN
	call ASSERT_AUTOINIT('DEBUG','STAT')

        rcflag  = 0
        searchdir = 0

        do i = 1, len
          testResult1 = M$FFTSIZE_VALID (inputs(i),rcflag,searchdir)
!          write (*,*) 'inputs = ',inputs(i),'expectedValid = ',
!     &     expectedValid(i),'testResult1 = ',testResult1
!          write (*,*) ' '
          call ASSERT('Testing M$FFTSIZE_VALID ',
     &      (testResult1 .eq. expectedValid(i)))
        enddo

        call M$PAUSE(Mc.pause)

        do i = 1, len
          testResult2 = M$FFTSIZE_BEST (inputs(i),rcflag,searchdir)
!          write (*,*) 'inputs = ',inputs(i),'expectedBest = ',
!     &     expectedBest(i),'testResult2 = ',testResult2
!          write (*,*) ' '
          call ASSERT('Testing M$FFTSIZE_BEST ',
     &      (testResult2 .eq. expectedBest(i)))
        enddo

c
c close and return
c

	call M$RETURN
        call ASSERT_AUTOREPORT()
	end

c**********************************************************************c
c       Include assertion facility.
c**********************************************************************c
        include 'assert.for'
