]> err.no Git - libchamplain/commitdiff
Add the properties uri_format and constructor.
authorEmmanuel Rodriguez <emmanuel.rodriguez@gmail.com>
Sun, 14 Jun 2009 11:48:01 +0000 (13:48 +0200)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Sun, 14 Jun 2009 15:11:17 +0000 (11:11 -0400)
The get/set method for constructor are not working yet.

bindings/perl/Champlain/t/ChamplainMapSourceDesc.t

index 5b88650e94ac5c2362d3010e29a339e1ec3ba9a2..7040aff345cc8ee0ef974637c9f6c86f2b028d24 100644 (file)
@@ -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";
 }