Test_MAPL_GetResource_scalar_logical Subroutine

public subroutine Test_MAPL_GetResource_scalar_logical()

Arguments

None

Calls

proc~~test_mapl_getresource_scalar_logical~~CallsGraph proc~test_mapl_getresource_scalar_logical Test_MAPL_GetResource_scalar_logical ESMF_ConfigCreate ESMF_ConfigCreate proc~test_mapl_getresource_scalar_logical->ESMF_ConfigCreate ESMF_ConfigSetAttribute ESMF_ConfigSetAttribute proc~test_mapl_getresource_scalar_logical->ESMF_ConfigSetAttribute assertequal assertequal proc~test_mapl_getresource_scalar_logical->assertequal asserttrue asserttrue proc~test_mapl_getresource_scalar_logical->asserttrue proc~mapl_getresource_config_scalar MAPL_GetResource_config_scalar proc~test_mapl_getresource_scalar_logical->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_logical()
      type(ESMF_Config) :: config
      integer :: status
      logical :: expected, actual, match
      character(len=*), parameter :: LABEL = 'label'
      character(len=*), parameter :: VAL = '.T.'
      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 = .TRUE.
      call MAPL_GetResource_config_scalar(config, actual, label = LABEL, value_is_set = value_is_set, rc = status)
      @assertEqual(0, status, 'Failed to get resource')
      match = expected .eqv. actual 
      @assertTrue(match, 'actual does not match expected.')

   end subroutine Test_MAPL_GetResource_scalar_logical