subroutine test_add_extension_spec() type(StateRegistry), target :: r type(VirtualConnectionPt) :: x integer :: status type(ExtensionFamily), pointer :: family type(StateItemExtensionPtr), pointer :: wrapper class(StateItemSpec), pointer :: spec type(StateItemExtension), pointer :: extension type(StateItemExtensionPtrVector) :: extensions r = StateRegistry('A') x = VirtualConnectionPt(state_intent='import', short_name='x') call r%add_virtual_pt(x, _RC) call r%add_spec(x, MockItemSpec('x'), _RC) @assert_that(r%num_owned_items(), is(1)) family => r%get_extension_family(x, _RC) @assert_that(associated(family), is(true())) @assert_that(family%has_primary(), is(false())) extensions = family%get_extensions() @assert_that(int(extensions%size()), is(1)) wrapper => extensions%of(1) extension => wrapper%ptr spec => extension%get_spec() select type (spec) type is (MockItemSpec) @assert_that(spec%name, is('x')) class default @assert_that(1, is(0)) end select call r%add_spec(x, MockItemSpec('y'), _RC) @assert_that(r%num_owned_items(), is(2)) @assert_that(family%has_primary(), is(false())) extensions = family%get_extensions() @assert_that(int(extensions%size()), is(2)) wrapper => extensions%of(2) extension => wrapper%ptr spec => extension%get_spec() select type (spec) type is (MockItemSpec) @assert_that(spec%name, is('y')) class default @assert_that(1, is(0)) end select end subroutine test_add_extension_spec