]> err.no Git - libchamplain/commitdiff
Use the factory for creating map sources
authorEmmanuel Rodriguez <emmanuel.rodriguez@gmail.com>
Tue, 5 May 2009 20:23:15 +0000 (22:23 +0200)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Wed, 6 May 2009 03:16:03 +0000 (23:16 -0400)
bindings/perl/Champlain/t/ChamplainView.t

index d4e51d4e815ff922353adee2c1e16b577e00f076..6edbbd5438ba92efac6214233ea29d0665aa7aa5 100644 (file)
@@ -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");