test_write_mapping Subroutine

public subroutine test_write_mapping()

Arguments

None

Calls

proc~~test_write_mapping~~CallsGraph proc~test_write_mapping test_write_mapping ESMF_HConfigCreate ESMF_HConfigCreate proc~test_write_mapping->ESMF_HConfigCreate ESMF_HConfigDestroy ESMF_HConfigDestroy proc~test_write_mapping->ESMF_HConfigDestroy anyexceptions anyexceptions proc~test_write_mapping->anyexceptions assert_that assert_that proc~test_write_mapping->assert_that assertequal assertequal proc~test_write_mapping->assertequal sourcelocation sourcelocation proc~test_write_mapping->sourcelocation

Source Code

   subroutine test_write_mapping()
      type(ESMF_HConfig) :: hconfig
      character(100) :: buffer
      integer :: status
      
      hconfig = ESMF_HConfigCreate(content='{}', _RC)
      write(buffer, *, iostat=status) hconfig
      _VERIFY(status)
      @assertEqual(expected='{}', found=trim(buffer))
      call ESMF_HConfigDestroy(hconfig)
      
      hconfig = ESMF_HConfigCreate(content='{a: b}', _RC)
      write(buffer, *, iostat=status) hconfig
      _VERIFY(status)
      @assertEqual(expected='{a: b}', found=trim(buffer))
      call ESMF_HConfigDestroy(hconfig)

      hconfig = ESMF_HConfigCreate(content='{a: b, c: 1, d: 3.14, e: true}', _RC)
      write(buffer, *, iostat=status) hconfig
      _VERIFY(status)
      @assertEqual(expected='{a: b, c: 1, d: 3.14, e: true}', found=trim(buffer))
      call ESMF_HConfigDestroy(hconfig)

   end subroutine test_write_mapping