addTestRealArrVal Subroutine

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

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

Arguments

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

An initialized TestRealArrVal object with the desired name.

real(kind=wp), allocatable, dimension(:):: res

See TestRealArrVal.

real(kind=wp), allocatable, dimension(:):: tgt

See TestRealArrVal.


Contents

Source Code


Variables

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

Source Code

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

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

    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 (TestRealArrVal)
        t%next => next
        t%test_name = ut%test_name
        t%res = res
        t%tgt = tgt
    end select
    end associate
end subroutine addTestRealArrVal