test_get_component Subroutine

public subroutine test_get_component()

Arguments

None

Calls

proc~~test_get_component~~CallsGraph proc~test_get_component test_get_component assert_that assert_that proc~test_get_component->assert_that false false proc~test_get_component->false none~get_component~4 ConcreteComposite%get_component proc~test_get_component->none~get_component~4

Source Code

   subroutine test_get_component()
      type(ConcreteComposite) :: composite

      type(NamedComponent) :: component
      class(AbstractFrameworkComponent), pointer :: component_ptr

      component%name = 'foo'
      composite = ConcreteComposite(component)
      component_ptr => composite%get_component()
      select type (component_ptr)
      type is (NamedComponent)
         @assert_that(component_ptr%name, is('foo'))
      class default
         @assert_that('incorrect type', .true., is(false()))
      end select

   end subroutine test_get_component