test_parse_item_common Subroutine

public subroutine test_parse_item_common()

Arguments

None

Calls

proc~~test_parse_item_common~~CallsGraph proc~test_parse_item_common test_parse_item_common ESMF_HConfigCreate ESMF_HConfigCreate proc~test_parse_item_common->ESMF_HConfigCreate ESMF_HConfigIterLoop ESMF_HConfigIterLoop proc~test_parse_item_common->ESMF_HConfigIterLoop anyexceptions anyexceptions proc~test_parse_item_common->anyexceptions assert_that assert_that proc~test_parse_item_common->assert_that assertequal assertequal proc~test_parse_item_common->assertequal esmf_hconfigiterbegin esmf_hconfigiterbegin proc~test_parse_item_common->esmf_hconfigiterbegin esmf_hconfigiterend esmf_hconfigiterend proc~test_parse_item_common->esmf_hconfigiterend proc~parse_item_common parse_item_common proc~test_parse_item_common->proc~parse_item_common sourcelocation sourcelocation proc~test_parse_item_common->sourcelocation ESMF_HConfigAsStringMapKey ESMF_HConfigAsStringMapKey proc~parse_item_common->ESMF_HConfigAsStringMapKey ESMF_HConfigCreateAtMapVal ESMF_HConfigCreateAtMapVal proc~parse_item_common->ESMF_HConfigCreateAtMapVal ESMF_HConfigIsMapMapVal ESMF_HConfigIsMapMapVal proc~parse_item_common->ESMF_HConfigIsMapMapVal ESMF_HConfigIsScalarMapKey ESMF_HConfigIsScalarMapKey proc~parse_item_common->ESMF_HConfigIsScalarMapKey esmf_hconfigasstring esmf_hconfigasstring proc~parse_item_common->esmf_hconfigasstring interface~mapl_assert MAPL_Assert proc~parse_item_common->interface~mapl_assert proc~mapl_return MAPL_Return proc~parse_item_common->proc~mapl_return proc~mapl_verify MAPL_Verify proc~parse_item_common->proc~mapl_verify 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_parse_item_common()
      type(ESMF_HConfig) :: hconfig
      type(ESMF_HConfigIter) :: hc_iter, hc_iter_begin, hc_iter_end
      character(len=:), allocatable :: expression, item_name, content, expected_name, expected_expression
      integer :: status

      expected_name = 'A_1'
      expected_expression = 'GC1.F1+GC2.F2'

      content = '{' // expected_name // ': {expr: ' // expected_expression // '}}'
!      content = '{A_1: {expr: GC1.F1+GC2.F2}}' 
      hconfig = ESMF_HConfigCreate(content=content, _RC)

      hc_iter_begin = ESMF_HConfigIterBegin(hconfig, _RC)
      hc_iter_end = ESMF_HConfigIterEnd(hconfig, _RC)
      hc_iter = hc_iter_begin

      do while (ESMF_HConfigIterLoop(hc_iter, hc_iter_begin, hc_iter_end, rc=status))
         @assertEqual(0, status, 'Nonzero status returned.')
         call parse_item_common(hc_iter, item_name, expression)
         @assertEqual(expected_name, item_name, 'Actual item_name does not match actual item_name.')
         @assertEqual(expected_expression, expression, 'Actual expression does not match actual expression')
      end do

   end subroutine test_parse_item_common