From: Emmanuel Rodriguez Date: Fri, 8 May 2009 15:18:00 +0000 (+0200) Subject: Add get_license_uri() and set_license_uri() with unit tests X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1477b677f3f9a3ed99a77b193f4e881bceeed0d0;p=libchamplain Add get_license_uri() and set_license_uri() with unit tests --- diff --git a/bindings/perl/Champlain/t/ChamplainMapSource.t b/bindings/perl/Champlain/t/ChamplainMapSource.t index 2c2224b..96b72ab 100644 --- a/bindings/perl/Champlain/t/ChamplainMapSource.t +++ b/bindings/perl/Champlain/t/ChamplainMapSource.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Clutter::TestHelper tests => 120; +use Clutter::TestHelper tests => 125; use Champlain ':coords'; @@ -34,6 +34,7 @@ sub test_osm_mapnik { is($map->get_max_zoom_level, 18, "$label max zoom"); is($map->get_tile_size, 256, "$label tile size"); is($map->get_license, $OSM_LICENSE, "$label license"); + is($map->get_license_uri, 'http://creativecommons.org/licenses/by/2.0/' , "$label license_uri"); # Generic map operations generic_map_operations($label, $map); @@ -53,6 +54,7 @@ sub test_osm_cyclemap { is($map->get_max_zoom_level, 18, "$label max zoom"); is($map->get_tile_size, 256, "$label tile size"); is($map->get_license, $OSM_LICENSE, "$label license"); + is($map->get_license_uri, 'http://creativecommons.org/licenses/by/2.0/' , "$label license_uri"); # Generic map operations generic_map_operations($label, $map); @@ -72,6 +74,7 @@ sub test_osm_osmarender { is($map->get_max_zoom_level, 18, "$label max zoom"); is($map->get_tile_size, 256, "$label tile size"); is($map->get_license, $OSM_LICENSE, "$label license"); + is($map->get_license_uri, 'http://creativecommons.org/licenses/by/2.0/' , "$label license_uri"); # Generic map operations generic_map_operations($label, $map); @@ -91,6 +94,7 @@ sub test_oam { is($map->get_max_zoom_level, 17, "$label max zoom"); is($map->get_tile_size, 256, "$label tile size"); is($map->get_license, "(CC) BY 3.0 OpenAerialMap contributors", "$label license"); + is($map->get_license_uri, 'http://creativecommons.org/licenses/by/3.0/' , "$label license_uri"); # Generic map operations generic_map_operations($label, $map); @@ -114,6 +118,7 @@ sub test_mff_relief { "Map data available under GNU Free Documentation license, Version 1.2 or later", "$label license" ); + is($map->get_license_uri, 'http://www.gnu.org/copyleft/fdl.html' , "$label license_uri"); # Generic map operations generic_map_operations($label, $map); diff --git a/bindings/perl/Champlain/xs/ChamplainMapSource.xs b/bindings/perl/Champlain/xs/ChamplainMapSource.xs index e4f53f5..9d4a79c 100644 --- a/bindings/perl/Champlain/xs/ChamplainMapSource.xs +++ b/bindings/perl/Champlain/xs/ChamplainMapSource.xs @@ -74,3 +74,11 @@ champlain_map_source_set_id (ChamplainMapSource *map_source, const gchar *id) const gchar* champlain_map_source_get_id (ChamplainMapSource *map_source) + + +void +champlain_map_source_set_license_uri (ChamplainMapSource *map_source, const gchar *license_uri) + + +const gchar* +champlain_map_source_get_license_uri (ChamplainMapSource *map_source)