[libchamplain: 17/39] Adjust the unit tests to libchamplain 0.4



commit c4b5eafb45e222e8f2dcbc1bf6767ee958a29d24
Author: Emmanuel Rodriguez <emmanuel rodriguez gmail com>
Date:   Wed Sep 16 19:57:46 2009 +0200

    Adjust the unit tests to libchamplain 0.4
      - OAM (OpenAerialMap) is now optional.
      - $tile->get_uri returns undef instead of '' when a tile is initialized.
      - $tile->get_filename returns undef instead of '' when a tile is initialized.

 bindings/perl/Champlain/t/ChamplainMapSource.t |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/bindings/perl/Champlain/t/ChamplainMapSource.t b/bindings/perl/Champlain/t/ChamplainMapSource.t
index ddc00b7..fbaacd8 100644
--- a/bindings/perl/Champlain/t/ChamplainMapSource.t
+++ b/bindings/perl/Champlain/t/ChamplainMapSource.t
@@ -85,6 +85,15 @@ sub test_osm_osmarender {
 sub test_oam {
 	my $label = "OpenAerialMap";
 	my $map = get_oam();
+
+	if (! defined $map) {
+		# The map source is now gone
+		SKIP: {
+			skip "The map source $label is no longer available", 33;
+		};
+		return;
+	}
+
 	isa_ok($map, 'Champlain::MapSource');
 	
 	# Map identification
@@ -232,8 +241,8 @@ sub generic_map_operations {
 	my $tile = Champlain::Tile->new();
 	is($tile->get_size(), 0, "get_size() default tile");
 	is($tile->get_state(), 'init', "get_state() default tile");
-	is($tile->get_uri(), '', "get_uri() default tile");
-	is($tile->get_filename(), '', "get_filename() default tile");
+	is($tile->get_uri(), undef, "get_uri() default tile");
+	is($tile->get_filename(), undef, "get_filename() default tile");
 	$map->fill_tile($tile);
 	is($tile->get_size(), $map->get_tile_size, "size is filled");
 	is($tile->get_state(), 'loading', "state changed");



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