[libchamplain/libchamplain-0-4] Test get_meters_per_pixel for all map sources



commit 487aebd6f475854d9f4d774ae31ab5360390a5cd
Author: Emmanuel Rodriguez <emmanuel rodriguez gmail com>
Date:   Sat Jan 9 07:29:23 2010 +0100

    Test get_meters_per_pixel for all map sources

 bindings/perl/Champlain/t/ChamplainMapSource.t |   26 ++++++++++++++---------
 1 files changed, 16 insertions(+), 10 deletions(-)
---
diff --git a/bindings/perl/Champlain/t/ChamplainMapSource.t b/bindings/perl/Champlain/t/ChamplainMapSource.t
index 0036b7c..bae0a8e 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 => 166;
+use Clutter::TestHelper tests => 177;
 
 use Champlain qw(:coords :maps);
 
@@ -13,18 +13,12 @@ my $OSM_URL_LICENSE = 'http://creativecommons.org/licenses/by-sa/2.0/';
 exit tests();
 
 sub tests {
-	my $map = test_osm_mapnik();
+	test_osm_mapnik();
 	test_osm_cyclemap();
 	test_osm_osmarender();
 	test_oam();
 	test_mff_relief();
 
-	SKIP: {
-		Champlain->CHECK_VERSION(0, 4, 3) or skip '0.4.3 stuff', 1;
-		my $meters = $map->get_meters_per_pixel($map->get_min_zoom_level, 0, 0);
-		ok($meters > 0, "Meters per pixel $meters");
-	}
-
 	return 0;
 }
 
@@ -46,8 +40,6 @@ sub test_osm_mapnik {
 	
 	# Generic map operations
 	generic_map_operations($label, $map);
-
-	return $map;
 }
 
 
@@ -248,6 +240,20 @@ sub generic_map_operations {
 		"$label column count at min zoom"
 	);
 
+
+	# Check that min zoom level and max zoom level meters per pixel at different
+	SKIP: {
+		Champlain->CHECK_VERSION(0, 4, 3) or skip '0.4.3 stuff', 2;
+		my $meters_at_min = $map->get_meters_per_pixel($map->get_min_zoom_level, 0, 0);
+		ok($meters_at_min > 0, "Meters per pixel $meters_at_min at min zoom level");
+
+		my $meters_at_max = $map->get_meters_per_pixel($map->get_max_zoom_level, 0, 0);
+		ok($meters_at_max > 0, "Meters per pixel $meters_at_max at max zoom level");
+
+		ok($meters_at_max < $meters_at_min, "Meters per pixel are different at max/min zoom level");
+	}
+
+
 	my $tile = Champlain::Tile->new();
 	is($tile->get_size(), 0, "get_size() default tile");
 	is($tile->get_state(), 'init', "get_state() default tile");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]