assert_isclose Interface

public interface assert_isclose

Module Procedures

public function assert_isclose_real32(got, expect, test_name, rtol, print_result) result(test_pass)

Asserts that two real32 values coincide to a given relative tolerance

Arguments

Type IntentOptional Attributes Name
real(kind=real32), intent(in) :: got

The value to be tested

real(kind=real32), intent(in) :: expect

The expected value

character(len=*), intent(in) :: test_name

Name of the test being run

real(kind=real32), intent(in), optional :: rtol

Optional relative tolerance (defaults to 1e-5)

logical, intent(in), optional :: print_result

Optionally print test result to screen (defaults to .true.)

Return Value logical

Did the assertion pass?

public function assert_isclose_real64(got, expect, test_name, rtol, print_result) result(test_pass)

Asserts that two real64 values coincide to a given relative tolerance

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: got

The value to be tested

real(kind=real64), intent(in) :: expect

The expected value

character(len=*), intent(in) :: test_name

Name of the test being run

real(kind=real64), intent(in), optional :: rtol

Optional relative tolerance (defaults to 1e-5)

logical, intent(in), optional :: print_result

Optionally print test result to screen (defaults to .true.)

Return Value logical

Did the assertion pass?