test_get_parent Subroutine

public subroutine test_get_parent()

Arguments

None

Calls

proc~~test_get_parent~~CallsGraph proc~test_get_parent test_get_parent assert_that assert_that proc~test_get_parent->assert_that none~get_parent~2 ConcreteComposite%get_parent proc~test_get_parent->none~get_parent~2 true true proc~test_get_parent->true

Source Code

   subroutine test_get_parent()
      type(ConcreteComposite) :: child
      type(ConcreteComposite), target :: parent
      type(MaplGenericComponent) :: component

      class(AbstractComposite), pointer :: ptr
      
      parent = ConcreteComposite(component)
      ptr => parent
      child = ConcreteComposite(component, parent)
      
      ptr => child%get_parent()
      @assert_that(associated(ptr), is(true()))
      @assert_that(associated(ptr,parent), is(true()))

   end subroutine test_get_parent