Test_MAPL_GetResource_scalar_character Subroutine

public subroutine Test_MAPL_GetResource_scalar_character()

Arguments

None

Calls

proc~~test_mapl_getresource_scalar_character~~CallsGraph proc~test_mapl_getresource_scalar_character Test_MAPL_GetResource_scalar_character ESMF_ConfigCreate ESMF_ConfigCreate proc~test_mapl_getresource_scalar_character->ESMF_ConfigCreate ESMF_ConfigSetAttribute ESMF_ConfigSetAttribute proc~test_mapl_getresource_scalar_character->ESMF_ConfigSetAttribute assertequal assertequal proc~test_mapl_getresource_scalar_character->assertequal asserttrue asserttrue proc~test_mapl_getresource_scalar_character->asserttrue proc~mapl_getresource_config_scalar MAPL_GetResource_config_scalar proc~test_mapl_getresource_scalar_character->proc~mapl_getresource_config_scalar ESMF_ConfigFindLabel ESMF_ConfigFindLabel proc~mapl_getresource_config_scalar->ESMF_ConfigFindLabel ESMF_ConfigGetAttribute ESMF_ConfigGetAttribute proc~mapl_getresource_config_scalar->ESMF_ConfigGetAttribute begin begin proc~mapl_getresource_config_scalar->begin interface~mapl_am_i_root MAPL_Am_I_Root proc~mapl_getresource_config_scalar->interface~mapl_am_i_root interface~mapl_assert MAPL_Assert proc~mapl_getresource_config_scalar->interface~mapl_assert next next proc~mapl_getresource_config_scalar->next of of proc~mapl_getresource_config_scalar->of proc~mapl_return MAPL_Return proc~mapl_getresource_config_scalar->proc~mapl_return proc~mapl_verify MAPL_Verify proc~mapl_getresource_config_scalar->proc~mapl_verify push_back push_back proc~mapl_getresource_config_scalar->push_back 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

Source Code

   subroutine Test_MAPL_GetResource_scalar_character()
      type(ESMF_Config) :: config
      integer :: status
      character(ESMF_MAXSTR) :: expected, actual
      character(len=*), parameter :: LABEL = 'label'
      character(len=*), parameter :: VAL = 'value'
      character(len=MAX_LINE_LENGTH) :: output_string
      logical :: value_is_set

      config = ESMF_ConfigCreate(rc = status)
      @assertEqual(0, status, 'Failed to create ESMF_Config')
      call ESMF_ConfigSetAttribute(config, PRINT_ALL, label = 'PRINTRC:', rc = status)
      @assertEqual(0, status, 'Failed to set PRINTRC')
      call ESMF_ConfigSetAttribute(config, VAL, label = LABEL, rc = status)
      @assertEqual(0, status, 'Failed to set attribute')
      expected = VAL
      call MAPL_GetResource_config_scalar(config, actual, label = LABEL, value_is_set = value_is_set, iunit = output_string, rc = status)
      @assertEqual(0, status, 'Failed to get resource')
      @assertEqual(expected, actual, 'actual does not match expected.')
      @assertTrue(len_trim(output_string) > len(VAL), 'output_string should be longer than VAL')
      @assertTrue(len_trim(output_string) <= MAX_LINE_LENGTH, 'output_string is too long.')

   end subroutine Test_MAPL_GetResource_scalar_character