[libchamplain] Add the properties uri_format and constructor.



commit e2cae53df11a91e535a7c6a840efca5c4df54ab8
Author: Emmanuel Rodriguez <emmanuel rodriguez gmail com>
Date:   Sun Jun 14 13:48:01 2009 +0200

    Add the properties uri_format and constructor.
    
    The get/set method for constructor are not working yet.

 bindings/perl/Champlain/t/ChamplainMapSourceDesc.t |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/bindings/perl/Champlain/t/ChamplainMapSourceDesc.t b/bindings/perl/Champlain/t/ChamplainMapSourceDesc.t
index 5b88650..7040aff 100644
--- a/bindings/perl/Champlain/t/ChamplainMapSourceDesc.t
+++ b/bindings/perl/Champlain/t/ChamplainMapSourceDesc.t
@@ -3,7 +3,8 @@
 use strict;
 use warnings;
 
-use Clutter::TestHelper tests => 18;
+use Clutter::TestHelper tests => 22;
+use Test::Exception;
 
 use Champlain ':maps';
 
@@ -41,7 +42,7 @@ sub test_get_set {
 	is($oam->get_min_zoom_level, 0, "get_min_zoom_level()");
 	is($oam->get_max_zoom_level, 17, "get_max_zoom_level()");
 	is($oam->get_projection, 'mercator', "get_projection()");
-	
+	is($oam->get_uri_format, 'http://tile.openaerialmap.org/tiles/1.0.0/openaerialmap-900913/#Z#/#X#/#Y#.jpg', "get_uri_format()");
 	
 	# Setters
 	$oam->set_id('test');
@@ -62,7 +63,15 @@ sub test_get_set {
 	$oam->set_max_zoom_level(4);
 	is($oam->get_max_zoom_level, 4, "set_max_zoom_level()");
 	
-	# There are no other projections now
+	# There are no other projections now, we have to trust that the setter works
 	$oam->set_projection('mercator');
 	is($oam->get_projection, 'mercator', "set_projection()");
+
+	$oam->set_uri_format('http://tile.oam.org/tiles/#Z#/#X#/#Y#.jpg');
+	is($oam->get_uri_format, 'http://tile.oam.org/tiles/#Z#/#X#/#Y#.jpg', "set_uri_format()");
+	
+	
+	# The constructor is not yet available in the perl bindings
+	throws_ok { $oam->get_constructor } qr/\Qdesc->get_constructor() isn't implemented yet/, "get_constructor() isn't implemented";
+	throws_ok { $oam->set_constructor(sub{}) } qr/\Qdesc->set_constructor(&code_ref)/, "set_constructor() isn't implemented";
 }



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