From: Emmanuel Rodriguez Date: Tue, 5 May 2009 20:23:15 +0000 (+0200) Subject: Use the factory for creating map sources X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1c1585f9d6b5a2a26b32bceafb20abaf7c395d5;p=libchamplain Use the factory for creating map sources --- 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");