From c22e99a940e6d50300d8cfeb8b97961bf8cbfcfe Mon Sep 17 00:00:00 2001 From: Emmanuel Rodriguez Date: Sun, 14 Jun 2009 15:10:07 +0200 Subject: [PATCH] Replace deprecated method names (dup_default, dup_list). --- .../Champlain/t/ChamplainMapSourceFactory.t | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/bindings/perl/Champlain/t/ChamplainMapSourceFactory.t b/bindings/perl/Champlain/t/ChamplainMapSourceFactory.t index c6de5ca..eec4726 100644 --- a/bindings/perl/Champlain/t/ChamplainMapSourceFactory.t +++ b/bindings/perl/Champlain/t/ChamplainMapSourceFactory.t @@ -21,11 +21,11 @@ sub tests { sub test_map_source_names { # Map identification - is(Champlain::MapSourceFactory->OSM_MAPNIK, 'osm::mapnik'); - is(Champlain::MapSourceFactory->OSM_OSMARENDER, 'osm::osmarender'); - is(Champlain::MapSourceFactory->OSM_CYCLE_MAP, 'osm::cyclemap'); + is(Champlain::MapSourceFactory->OSM_MAPNIK, 'osm-mapnik'); + is(Champlain::MapSourceFactory->OSM_OSMARENDER, 'osm-osmarender'); + is(Champlain::MapSourceFactory->OSM_CYCLE_MAP, 'osm-cyclemap'); is(Champlain::MapSourceFactory->OAM, 'oam'); - is(Champlain::MapSourceFactory->MFF_RELIEF, 'mff::relief'); + is(Champlain::MapSourceFactory->MFF_RELIEF, 'mff-relief'); } @@ -60,17 +60,17 @@ sub test_map_factory { ); # Get the maps available - my @maps = $factory->get_list(); + my @maps = $factory->dup_list(); ok(@maps >= 5, "Maps factory has the default maps"); } sub test_map_register { - my $factory = Champlain::MapSourceFactory->get_default(); + my $factory = Champlain::MapSourceFactory->dup_default(); isa_ok($factory, 'Champlain::MapSourceFactory'); # Get the maps available - my @maps = $factory->get_list(); + my @maps = $factory->dup_list(); ok(@maps >= 5, "Maps factory has the default maps"); # Add a new map @@ -84,7 +84,7 @@ sub test_map_register { projection => 'mercator', }; - $factory->register($description, sub { + my $constructor = sub { return Champlain::NetworkMapSource->new_full( $description->{id}, $description->{name}, @@ -97,7 +97,8 @@ sub test_map_register { # This is a copy of OAM "http://tile.openaerialmap.org/tiles/1.0.0/openaerialmap-900913/#Z#/#X#/#Y#.jpg", ); - }); + }; + $factory->register($description, $constructor); my @new_maps = $factory->get_list(); ok(@new_maps == @maps + 1, "Maps factory has an extra map"); -- 2.39.5