test_get_i4 Subroutine

public subroutine test_get_i4()

Arguments

None

Calls

proc~~test_get_i4~~CallsGraph proc~test_get_i4 test_get_i4 ESMF_HConfigAdd ESMF_HConfigAdd proc~test_get_i4->ESMF_HConfigAdd assertequal assertequal proc~test_get_i4->assertequal asserttrue asserttrue proc~test_get_i4->asserttrue interface~get_value get_value proc~test_get_i4->interface~get_value

Source Code

   subroutine test_get_i4()
      character(len=*), parameter :: LABEL = 'inv_alpha'
      integer(kind=I4), parameter :: EXPECTED = 137
      integer(kind=I4) :: actual
      type(HConfigParams) :: params
      logical :: found
      integer :: status

      call ESMF_HConfigAdd(hconfig, EXPECTED, addKeyString=LABEL, rc=status)
      @assertEqual(0, status, ERROR_ADD_FAIL)
      params = HConfigParams(hconfig, LABEL, check_value_set=.TRUE.)
      call get_value(params, actual, rc=status)
      found = params%value_set
      @assertEqual(0, status, ERROR_GET_FAILED)
      @assertTrue(found, ERROR_NOT_FOUND // LABEL)
      @assertTrue(actual == EXPECTED, ERROR_MISMATCH)

   end subroutine test_get_i4