From e1c1585f9d6b5a2a26b32bceafb20abaf7c395d5 Mon Sep 17 00:00:00 2001 From: Emmanuel Rodriguez Date: Tue, 5 May 2009 22:23:15 +0200 Subject: [PATCH] Use the factory for creating map sources --- bindings/perl/Champlain/t/ChamplainView.t | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bindings/perl/Champlain/t/ChamplainView.t b/bindings/perl/Champlain/t/ChamplainView.t index d4e51d4..6edbbd5 100644 --- a/bindings/perl/Champlain/t/ChamplainView.t +++ b/bindings/perl/Champlain/t/ChamplainView.t @@ -50,10 +50,11 @@ sub test_generic { # Change the map source (get a different map source) my $source_original = $view->get('map-source'); - my $source_new = Champlain::MapSource->new_osm_mapnik(); - if ($source_original->get_name eq $source_new->get_name) { + my $factory = Champlain::MapSourceFactory->get_default(); + my $source_new = $factory->create(Champlain::MapSourceFactory->OSM_MAPNIK); + if ($source_original->get_id eq $source_new->get_id) { # Same kind of map source, take another one - $source_new = Champlain::MapSource->new_oam(); + $source_new = $factory->create(Champlain::MapSourceFactory->OAM); } $view->set_map_source($source_new); is($view->get('map-source'), $source_new, "Change map source"); -- 2.39.5