test_set_stateitem_shared_string Subroutine

public subroutine test_set_stateitem_shared_string()

Arguments

None

Calls

proc~~test_set_stateitem_shared_string~~CallsGraph proc~test_set_stateitem_shared_string test_set_stateitem_shared_string anyexceptions anyexceptions proc~test_set_stateitem_shared_string->anyexceptions assert_that assert_that proc~test_set_stateitem_shared_string->assert_that assertequal assertequal proc~test_set_stateitem_shared_string->assertequal esmf_fielddestroy esmf_fielddestroy proc~test_set_stateitem_shared_string->esmf_fielddestroy esmf_fieldemptycreate esmf_fieldemptycreate proc~test_set_stateitem_shared_string->esmf_fieldemptycreate esmf_stateadd esmf_stateadd proc~test_set_stateitem_shared_string->esmf_stateadd esmf_statecreate esmf_statecreate proc~test_set_stateitem_shared_string->esmf_statecreate esmf_statedestroy esmf_statedestroy proc~test_set_stateitem_shared_string->esmf_statedestroy interface~mapl_infogetshared MAPL_InfoGetShared proc~test_set_stateitem_shared_string->interface~mapl_infogetshared interface~mapl_infosetshared MAPL_InfoSetShared proc~test_set_stateitem_shared_string->interface~mapl_infosetshared sourcelocation sourcelocation proc~test_set_stateitem_shared_string->sourcelocation

Source Code

   subroutine test_set_stateitem_shared_string()
      type(ESMF_State) :: state
      type(ESMF_Field) :: field
      integer :: status
      character(:), allocatable :: s
      character(*), parameter :: expected = 'hello'

      state = ESMF_StateCreate(name='export', _RC)

      field = ESMF_FieldEmptyCreate(name='f', _RC)
      call ESMF_StateAdd(state, [field], _RC)

      call MAPL_InfoSetShared(state, short_name='f', key='a', value=expected, _RC)
      call MAPL_InfoGetShared(state, short_name='f', key='a', value=s, _RC)

      @assertEqual(expected, s)

      call ESMF_FieldDestroy(field, _RC)
      call ESMF_StateDestroy(state, _RC)

   end subroutine test_set_stateitem_shared_string