Check if two reals (32 bits) are equal.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this | The tester. |
||
real(kind=real32), | intent(in) | :: | r1 | Value to compare. |
||
real(kind=real32), | intent(in) | :: | r2 | Value to compare. |
||
logical, | intent(in), | optional | :: | fail | Fail flag. |
subroutine assert_equal_r32(this, r1, r2, fail)
class(tester_t), intent(inout) :: this !< The tester.
real(real32), intent(in) :: r1 !< Value to compare.
real(real32), intent(in) :: r2 !< Value to compare.
logical, intent(in), optional :: fail !< Fail flag.
this% n_tests = this% n_tests + 1
if (r1 .ne. r2) then
if (.not. present(fail) .or. (present(fail) .and. fail .eqv. .false.)) then
this% n_errors = this% n_errors + 1
end if
end if
end subroutine assert_equal_r32