Ticket #3999: ruby-tests.patch

File ruby-tests.patch, 3.0 KB (added by jimk, 6 years ago)

Fixes some of the ruby tests. Mostly fixes names of methods and constants. It can be applied with patch -p0 in ./autotest

  • ruby/osr/tc_osr_basic.rb

     
    106106                    Gdal::Osr::SRS_WGS84_SEMIMAJOR,
    107107                    Gdal::Osr::SRS_WGS84_INVFLATTENING)
    108108   
    109     srs.set_towgs84(1, 2, 3)
     109    srs.set_towgs_84(1, 2, 3)
    110110
    111     assert_equal(srs.get_towgs84(), [1,2,3,0,0,0,0])
     111    assert_equal(srs.get_towgs_84(), [1,2,3,0,0,0,0])
    112112    proj4 = srs.export_to_proj4()
    113113   
    114114    srs2 = Gdal::Osr::SpatialReference.new()
    115115    srs2.import_from_proj4(proj4)
    116116
    117     assert_equal(srs2.get_towgs84(), [1,2,3,0,0,0,0])
     117    assert_equal(srs2.get_towgs_84(), [1,2,3,0,0,0,0])
    118118  end
    119119end
  • ruby/ogr/tc_ogr_basic.rb

     
    7171    layer.set_spatial_filter(poly)
    7272    layer.reset_reading()
    7373
    74     assert(1, layer.get_feature_count)
     74    assert(1, layer.get_feature_count.to_s)
    7575
    7676    feat1 = layer.get_next_feature
    7777    feat2 = layer.get_next_feature
  • ruby/ogr/tc_ogr_wktempty.rb

     
    3636        end
    3737
    3838        def test_ogr_wktempty_5()
    39                 geom = Gdal::Ogr.create_geometry_from_wkt("POINT(EMPTY)")
    40                 wkt = geom.export_to_wkt
    41                 assert_equal('POINT (0 0)', wkt)
     39                assert(check_empty_geom1('POINT'))
    4240        end
    4341
    4442        def test_ogr_wktempty_6()
     
    6664        end
    6765       
    6866        def test_ogr_wktempty_12()
    69                 geom = Gdal::Ogr.create_geometry_from_wkt("POINT EMPTY")
    70                 wkt = geom.export_to_wkt
    71                 assert_equal('POINT (0 0)', wkt)
     67                assert(check_empty_geom2('POINT'))
    7268        end
    7369       
    7470        def test_ogr_wktempty_13()
  • ruby/ogr/ogrtest.rb

     
    5959  poly_feat.each do |orig_feat|
    6060    read_feat = layer.get_next_feature
    6161
    62     assert(check_feature_geometry(read_feat, orig_feat.get_geometry_ref()),
     62    assert(check_feature_geometry(read_feat, orig_feat.get_geometry_ref().to_s),
    6363                                  max_error = 0.000000001 )
    6464
    6565    0.upto(2) do |i|
     
    195195   
    196196    #if result != 0:
    197197    #raise ValueError, 'CreateFeature() failed in ogrtest.quick_create_feature()'
    198    
    199  No newline at end of file
  • ruby/ogr/tc_ogr_pg.rb

     
    197197
    198198    feat.set_field( 'SHORTNAME', 'Reset' )
    199199
    200     point = Gdal::Ogr::Geometry.new(Gdal::Ogr::WkbPoint25D)
     200    point = Gdal::Ogr::Geometry.new(Gdal::Ogr::WKBPOINT25D)
    201201    point.set_point( 0, 5, 6, 7 )
    202202    feat.set_geometry_directly( point )
    203203