From: Emmanuel Rodriguez Date: Sun, 14 Jun 2009 11:48:01 +0000 (+0200) Subject: Add the properties uri_format and constructor. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2cae53df11a91e535a7c6a840efca5c4df54ab8;p=libchamplain Add the properties uri_format and constructor. The get/set method for constructor are not working yet. --- 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"; }