test_add_primary_spec Subroutine

public subroutine test_add_primary_spec()

Arguments

None

Calls

proc~~test_add_primary_spec~~CallsGraph proc~test_add_primary_spec test_add_primary_spec anyexceptions anyexceptions proc~test_add_primary_spec->anyexceptions assert_that assert_that proc~test_add_primary_spec->assert_that none~add_primary_spec StateRegistry%add_primary_spec proc~test_add_primary_spec->none~add_primary_spec none~get_extension_family StateRegistry%get_extension_family proc~test_add_primary_spec->none~get_extension_family none~get_primary ExtensionFamily%get_primary proc~test_add_primary_spec->none~get_primary none~get_spec StateItemExtension%get_spec proc~test_add_primary_spec->none~get_spec none~num_owned_items StateRegistry%num_owned_items proc~test_add_primary_spec->none~num_owned_items sourcelocation sourcelocation proc~test_add_primary_spec->sourcelocation true true proc~test_add_primary_spec->true none~add_family StateRegistry%add_family none~add_primary_spec->none~add_family none~back~74 StateItemExtensionVector%back none~add_primary_spec->none~back~74 none~push_back~67 StateItemExtensionVector%push_back none~add_primary_spec->none~push_back~67 proc~mapl_return MAPL_Return none~add_primary_spec->proc~mapl_return proc~mapl_verify MAPL_Verify none~add_primary_spec->proc~mapl_verify none~at~337 VirtualPtFamilyMap%at none~get_extension_family->none~at~337 none~get_extension_family->proc~mapl_return none~get_extension_family->proc~mapl_verify interface~mapl_assert MAPL_Assert none~get_primary->interface~mapl_assert none~front~11 StateItemExtensionPtrVector%front none~get_primary->none~front~11 none~get_primary->proc~mapl_return none~add_family->none~at~337 none~add_family->proc~mapl_return none~add_family->proc~mapl_verify none~add_virtual_pt StateRegistry%add_virtual_pt none~add_family->none~add_virtual_pt none~at_rc~13 VirtualPtFamilyMap%at_rc none~at~337->none~at_rc~13 none~capacity~397 StateItemExtensionVector%capacity none~push_back~67->none~capacity~397 none~resize~134 StateItemExtensionVector%resize none~push_back~67->none~resize~134 at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception proc~mapl_verify->proc~mapl_throw_exception none~add_virtual_pt->interface~mapl_assert none~add_virtual_pt->proc~mapl_return none~has_virtual_pt StateRegistry%has_virtual_pt none~add_virtual_pt->none~has_virtual_pt none~insert~321 VirtualPtFamilyMap%insert none~add_virtual_pt->none~insert~321 none~find~93 VirtualPtFamilyMap%find none~at_rc~13->none~find~93 none~resize_size_kind~20 StateItemExtensionVector%resize_size_kind none~resize~134->none~resize_size_kind~20

Source Code

   subroutine test_add_primary_spec()
      type(StateRegistry), target :: r
      type(VirtualConnectionPt) :: x
      integer :: status
      type(ExtensionFamily), pointer :: family
      type(StateItemExtension), pointer :: primary
      class(StateItemSpec), pointer :: spec

      r = StateRegistry('A')
      x = VirtualConnectionPt(state_intent='import', short_name='x')

      call r%add_primary_spec(x, MockItemSpec('x'), _RC)

      @assert_that(r%num_owned_items(), is(1))

      family => r%get_extension_family(x, _RC)
      primary => family%get_primary()
      @assert_that(associated(primary), is(true()))
      spec => primary%get_spec()
      select type (spec)
      type is (MockItemSpec)
         @assert_that(spec%name, is('x'))
      class default
         @assert_that(1, is(0))
      end select

   end subroutine test_add_primary_spec