addTestRealVal Subroutine

public subroutine addTestRealVal(self, ut, res, tgt)

Compact alternative to add a TestRealVal object to the test suite.

Arguments

Type IntentOptional AttributesName
class(TestSuite), intent(inout) :: self
type(TestRealVal), intent(in) :: ut

An initialized TestRealVal object with the desired name.

real(kind=wp), intent(in) :: res

See TestRealVal.

real(kind=wp), intent(in) :: tgt

See TestRealVal.


Contents

Source Code


Variables

TypeVisibility AttributesNameInitial
class(Test), public, pointer:: next

Source Code

subroutine addTestRealVal(self, ut, res, tgt)
    !! Compact alternative to add a TestRealVal object to the test suite.

    class(TestSuite), intent(inout) :: self
    type(TestRealVal), intent(in) :: ut
        !! An initialized TestRealVal object with the desired name.
    real(kind=wp), intent(in) :: res, tgt
        !! See TestRealVal.

    class(Test), pointer :: next
        
    if (this_image() == 1) self%n_tests = self%n_tests + 1

    allocate(next)
    next => self%test

    allocate(self%test, source=ut)

    associate (t => self%test)
    select type(t)
    type is (TestRealVal)
        t%next => next
        t%test_name = ut%test_name
        t%res = res
        t%tgt = tgt
    end select
    end associate
end subroutine addTestRealVal