test_write_scalar Subroutine

public subroutine test_write_scalar()

Arguments

None

Calls

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

Source Code

   subroutine test_write_scalar()
      type(ESMF_HConfig) :: hconfig
      character(10) :: buffer
      integer :: status
      character(:), allocatable :: content

      content = 'a'
      hconfig = ESMF_HConfigCreate(content=content, _RC)
      write(buffer, *, iostat=status) hconfig
      _VERIFY(status)
      @assertEqual(expected=content, found=trim(buffer))
      call ESMF_HConfigDestroy(hconfig)

      content = 'aBc'
      hconfig = ESMF_HConfigCreate(content=content, _RC)
      write(buffer, *, iostat=status) hconfig
      _VERIFY(status)
      @assertEqual(expected=content, found=trim(buffer))
      call ESMF_HConfigDestroy(hconfig)

      content = '3.14'
      hconfig = ESMF_HConfigCreate(content=content, _RC)
      write(buffer, *, iostat=status) hconfig
      _VERIFY(status)
      @assertEqual(expected=content, found=trim(buffer))
      call ESMF_HConfigDestroy(hconfig)

   end subroutine test_write_scalar