Skip to content

Commit 332260c

Browse files
committed
added more tests
1 parent c8456af commit 332260c

File tree

1 file changed

+27
-11
lines changed

1 file changed

+27
-11
lines changed

test/tests.f90

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -258,22 +258,30 @@ subroutine fptest6()
258258

259259
implicit none
260260

261-
integer, parameter :: nfunc = 5
261+
integer, parameter :: nfunc = 12
262262
character (len=*), dimension(nfunc), parameter :: func = [ '-1.0*x ', &
263263
'-sqrt(x) ', &
264264
'a*COS(b*x)+5 ', &
265265
'a*COS(b*x)+5.0 ', &
266-
'exp(x)-abs(x)+log(1.0)+log10(1.0)' ]
267-
integer, parameter :: nvar = 3
266+
'exp(x)-abs(x)+log(1.0)+log10(1.0)',&
267+
'sinh(x) ', &
268+
'cosh(x) ', &
269+
'tanh(x) ', &
270+
'tan(x) ', &
271+
'asin(y) ', &
272+
'acos(y) ', &
273+
'atan(y) ' ]
274+
integer, parameter :: nvar = 4
268275
character (len=*), dimension(nvar), parameter :: var = [ 'x', &
269276
'a', &
270-
'b' ]
271-
real(wp), dimension(nvar), parameter :: val = [ 2.0_wp, 3.0_wp, 4.0_wp ]
277+
'b', &
278+
'y' ]
279+
real(wp), dimension(nvar), parameter :: val = [ 2.0_wp, 3.0_wp, 4.0_wp, 0.1_wp ]
272280

273281
type(fparser_array) :: parser
274282
real(wp),dimension(nfunc) :: res
275283
integer :: i !! counter
276-
real(wp) :: x,a,b
284+
real(wp) :: x,a,b,y
277285

278286
write(*,*) ''
279287
write(*,*) ' Test 6'
@@ -293,11 +301,19 @@ subroutine fptest6()
293301
x = val(1)
294302
a = val(2)
295303
b = val(3)
296-
call compare(func(1), -1.0_wp*x, res(1))
297-
call compare(func(2), -sqrt(x), res(2))
298-
call compare(func(3), a*cos(b*x)+5, res(3))
299-
call compare(func(4), a*cos(b*x)+5.0, res(4))
300-
call compare(func(5), exp(x)-abs(x)+log(1.0)+log10(1.0), res(5))
304+
y = val(4)
305+
call compare(func(1), -1.0_wp*x, res(1))
306+
call compare(func(2), -sqrt(x), res(2))
307+
call compare(func(3), a*cos(b*x)+5, res(3))
308+
call compare(func(4), a*cos(b*x)+5.0, res(4))
309+
call compare(func(5), exp(x)-abs(x)+log(1.0)+log10(1.0), res(5))
310+
call compare(func(6), sinh(x), res(6))
311+
call compare(func(7), cosh(x), res(7))
312+
call compare(func(8), tanh(x), res(8))
313+
call compare(func(9), tan(x), res(9))
314+
call compare(func(10), asin(y), res(10))
315+
call compare(func(11), acos(y), res(11))
316+
call compare(func(12), atan(y), res(12))
301317
end if
302318

303319
end subroutine fptest6

0 commit comments

Comments
 (0)