]> err.no Git - libchamplain/commitdiff
Add get_id/set_id to Champlain::MapSource
authorEmmanuel Rodriguez <emmanuel.rodriguez@gmail.com>
Tue, 5 May 2009 18:41:04 +0000 (20:41 +0200)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Wed, 6 May 2009 03:16:03 +0000 (23:16 -0400)
bindings/perl/Champlain/t/ChamplainMapSource.t
bindings/perl/Champlain/xs/ChamplainMapSource.xs

index 6db2aabfdd551e1da97882920877191be6b18241..2c2224b9e5e7e1c16315c158246cf7b919cbb69b 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Clutter::TestHelper tests => 110;
+use Clutter::TestHelper tests => 120;
 
 use Champlain ':coords';
 
@@ -28,6 +28,7 @@ sub test_osm_mapnik {
        isa_ok($map, 'Champlain::MapSource');
        
        # Map identification
+       is($map->get_id, 'osm::mapnik', "$label id");
        is($map->get_name, 'OpenStreetMap Mapnik', "$label name");
        is($map->get_min_zoom_level, 0, "$label min zoom");
        is($map->get_max_zoom_level, 18, "$label max zoom");
@@ -46,6 +47,7 @@ sub test_osm_cyclemap {
        isa_ok($map, 'Champlain::MapSource');
        
        # Map identification
+       is($map->get_id, 'osm::cyclemap', "$label id");
        is($map->get_name, 'OpenStreetMap Cycle Map', "$label name");
        is($map->get_min_zoom_level, 0, "$label min zoom");
        is($map->get_max_zoom_level, 18, "$label max zoom");
@@ -64,6 +66,7 @@ sub test_osm_osmarender {
        isa_ok($map, 'Champlain::MapSource');
        
        # Map identification
+       is($map->get_id, 'osm::osmarender', "$label id");
        is($map->get_name, 'OpenStreetMap Osmarender', "$label name");
        is($map->get_min_zoom_level, 0, "$label min zoom");
        is($map->get_max_zoom_level, 18, "$label max zoom");
@@ -82,6 +85,7 @@ sub test_oam {
        isa_ok($map, 'Champlain::MapSource');
        
        # Map identification
+       is($map->get_id, 'oam', "$label id");
        is($map->get_name, 'OpenAerialMap', "$label name");
        is($map->get_min_zoom_level, 0, "$label min zoom");
        is($map->get_max_zoom_level, 17, "$label max zoom");
@@ -100,6 +104,7 @@ sub test_mff_relief {
        isa_ok($map, 'Champlain::MapSource');
        
        # Map identification
+       is($map->get_id, 'mff::relief', "$label id");
        is($map->get_name, 'Maps for Free Relief', "$label name");
        is($map->get_min_zoom_level, 0, "$label min zoom");
        is($map->get_max_zoom_level, 11, "$label max zoom");
@@ -123,6 +128,9 @@ sub generic_map_operations {
        # Rename of the map
        $map->set_name("No name");
        is($map->get_name, "No name", "Rename the map");
+       $map->set_id('test::map');
+       is($map->get_id, 'test::map', "Change the map id");
+       
        
        # Relicense the map
        $map->set_license("Free for all!");
index 395d8503a81a391e00bdd1bbe9489f9a17ac7a3d..e4f53f59af6f393cd323724312e36b745b02868c 100644 (file)
@@ -66,3 +66,11 @@ champlain_map_source_set_projection (ChamplainMapSource *map_source, ChamplainMa
 
 ChamplainMapProjection
 champlain_map_source_get_projection (ChamplainMapSource *map_source)
+
+
+void
+champlain_map_source_set_id (ChamplainMapSource *map_source, const gchar *id)
+
+
+const gchar*
+champlain_map_source_get_id (ChamplainMapSource *map_source)