test_get_converter Subroutine

public subroutine test_get_converter()

Arguments

None

Calls

proc~~test_get_converter~~CallsGraph proc~test_get_converter test_get_converter assertequal assertequal proc~test_get_converter->assertequal assertfalse assertfalse proc~test_get_converter->assertfalse asserttrue asserttrue proc~test_get_converter->asserttrue finalize_udunits_system finalize_udunits_system proc~test_get_converter->finalize_udunits_system initialize_udunits_system initialize_udunits_system proc~test_get_converter->initialize_udunits_system none~get_cptr CptrWrapper%get_cptr proc~test_get_converter->none~get_cptr none~is_free CptrWrapper%is_free proc~test_get_converter->none~is_free proc~get_converter get_converter proc~test_get_converter->proc~get_converter proc~get_converter->none~is_free

Source Code

   subroutine test_get_converter()
      type(Converter) :: conv
      type(c_ptr) :: cptr
      integer(ut_status) :: status

      call initialize_udunits_system(rc=status)
      @assertEqual(UT_SUCCESS, status, 'Failed to initialize')
      call get_converter(conv, KM, M, rc=status)
      @assertEqual(UT_SUCCESS, status, 'Failed to get converter')
      @assertFalse(conv%is_free(), 'cv_converter is not set')
      cptr = conv%get_cptr()
      @assertTrue(c_associated(cptr), 'c_ptr is not associated')
      
      call conv%free()
      call finalize_udunits_system()
      
  end subroutine test_get_converter