Skip to content

Commit c7342ed

Browse files
committed
Add threshold in tests.
1 parent 2e30c5a commit c7342ed

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

test/math/test_stdlib_math.fypp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ contains
4747

4848
!> Tests for deg2rad/rad2deg
4949
#:for k1 in REAL_KINDS
50-
, new_unittest("deg2rad-${k1}$", test_deg2rad_${k1}$) &
51-
, new_unittest("rad2deg-${k1}$", test_rad2deg_${k1}$) &
50+
, new_unittest("deg2rad-real-${k1}$", test_deg2rad_${k1}$) &
51+
, new_unittest("rad2deg-real-${k1}$", test_rad2deg_${k1}$) &
5252
#:endfor
5353

5454
!> Tests for `is_close` and `all_close`
@@ -312,15 +312,19 @@ contains
312312
subroutine test_deg2rad_${k1}$(error)
313313
type(error_type), allocatable, intent(out) :: error
314314
real(${k1}$), parameter :: tol = sqrt(epsilon(1.0_${k1}$))
315+
315316
call check(error, PI_${k1}$, deg2rad(180.0_${k1}$), thr=tol)
316317
if (allocated(error)) return
318+
317319
end subroutine test_deg2rad_${k1}$
318320

319321
subroutine test_rad2deg_${k1}$(error)
320322
type(error_type), allocatable, intent(out) :: error
321323
real(${k1}$), parameter :: tol = sqrt(epsilon(1.0_${k1}$))
322-
call check(error, 180.0_${k1}$, rad2deg(PI_${k1}$))
324+
325+
call check(error, 180.0_${k1}$, rad2deg(PI_${k1}$), thr=tol)
323326
if (allocated(error)) return
327+
324328
end subroutine test_rad2deg_${k1}$
325329
#:endfor
326330

0 commit comments

Comments
 (0)