From: Emmanuel Rodriguez Date: Tue, 24 Mar 2009 22:05:14 +0000 (+0100) Subject: Unit tests for osm_osmarender and osm_cyclemap X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76b34a87944dea6128953d175042ac779a21b572;p=libchamplain Unit tests for osm_osmarender and osm_cyclemap --- diff --git a/bindings/perl/Champlain/t/ChamplainMapSource.t b/bindings/perl/Champlain/t/ChamplainMapSource.t index 69081ce..03bd69d 100644 --- a/bindings/perl/Champlain/t/ChamplainMapSource.t +++ b/bindings/perl/Champlain/t/ChamplainMapSource.t @@ -3,22 +3,24 @@ use strict; use warnings; -use Clutter::TestHelper tests => 57; +use Clutter::TestHelper tests => 95; use Champlain ':coords'; exit tests(); sub tests { - test_osm(); + test_osm_mapnik(); + test_osm_cyclemap(); + test_osm_osmarender(); test_oam(); test_mff(); return 0; } -# OpenStreetMap -sub test_osm { +# OpenStreetMap Mapnik +sub test_osm_mapnik { my $label = "OpenStreetMap"; my $map = Champlain::MapSource->new_osm_mapnik(); isa_ok($map, 'Champlain::MapSource'); @@ -34,6 +36,39 @@ sub test_osm { } +# OpenStreetMap Cycle Map +sub test_osm_cyclemap { + my $label = "OpenStreetMap (cyclemap)"; + my $map = Champlain::MapSource->new_osm_cyclemap(); + isa_ok($map, 'Champlain::MapSource'); + + # Map identification + 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"); + is($map->get_tile_size, 256, "$label tile size"); + + # Generic map operations + generic_map_operations($label, $map); +} + + +# OpenStreetMap Osmarender +sub test_osm_osmarender { + my $label = "OpenStreetMap (osmarender)"; + my $map = Champlain::MapSource->new_osm_osmarender(); + isa_ok($map, 'Champlain::MapSource'); + + # Map identification + 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"); + is($map->get_tile_size, 256, "$label tile size"); + + # Generic map operations + generic_map_operations($label, $map); +} + # OpenArialMap sub test_oam { my $label = "OpenArialMap";