test_are_convertible Subroutine

public subroutine test_are_convertible()

Arguments

None

Calls

proc~~test_are_convertible~~CallsGraph proc~test_are_convertible test_are_convertible assertequal assertequal proc~test_are_convertible->assertequal assertfalse assertfalse proc~test_are_convertible->assertfalse finalize_udunits_system finalize_udunits_system proc~test_are_convertible->finalize_udunits_system initialize_udunits_system initialize_udunits_system proc~test_are_convertible->initialize_udunits_system interface~are_convertible are_convertible proc~test_are_convertible->interface~are_convertible

Source Code

   subroutine test_are_convertible()
      type(UDUnit) :: unit1
      type(UDUnit) :: unit2
      integer(ut_status) :: status
      logical :: convertible

      call initialize_udunits_system(rc=status)
      @assertEqual(UT_SUCCESS, status, 'Failed to initialize')
      unit1 = UDUnit(KM)
      unit2 = UDUnit(M)
      convertible = are_convertible(unit1, unit2, rc=status)
      if(.not. convertible) then
         @assertFalse(status == UT_BAD_ARG, 'One of the units is null.')
         @assertFalse(status == UT_NOT_SAME_SYSTEM, 'Units belong to different systems.')
      end if

      call unit1%free()
      call unit2%free()
      call finalize_udunits_system()

   end subroutine test_are_convertible