~ubuntu-branches/ubuntu/maverick/libchamplain/maverick

« back to all changes in this revision

Viewing changes to bindings/perl/Champlain/t/ChamplainMapSource.t

  • Committer: Bazaar Package Importer
  • Author(s): Laurent Bigonville, Andreas Henriksson, Laurent Bigonville
  • Date: 2010-01-20 18:12:56 UTC
  • mfrom: (1.1.5 upstream) (2.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20100120181256-ij0kwd9n0s8sl7f7
Tags: 0.4.3-1
[ Andreas Henriksson ]
* New upstream release.
  - fix linking using binutils-gold (Closes: #555082)
* Add support for "get-orig-source" in debian/rules.
* Update libchamplain-0.4-0.symbols for function added in 0.4.3.

[ Laurent Bigonville ]
* Add Recommends on libchamplain-doc package for
  libchamplain-gtk-doc (Closes: #565311)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
use strict;
4
4
use warnings;
5
5
 
6
 
use Clutter::TestHelper tests => 165;
 
6
use Clutter::TestHelper tests => 177;
7
7
 
8
8
use Champlain qw(:coords :maps);
9
9
 
10
 
my $OSM_LICENSE = "CC-BY-SA 2.0 OpenStreetMap contributors";
 
10
my $OSM_LICENSE_REGEXP = qr/OpenStreetMap contributors/;
11
11
my $OSM_URL_LICENSE = 'http://creativecommons.org/licenses/by-sa/2.0/';
12
12
 
13
13
exit tests();
18
18
        test_osm_osmarender();
19
19
        test_oam();
20
20
        test_mff_relief();
 
21
 
21
22
        return 0;
22
23
}
23
24
 
34
35
        is($map->get_min_zoom_level, 0, "$label min zoom");
35
36
        is($map->get_max_zoom_level, 18, "$label max zoom");
36
37
        is($map->get_tile_size, 256, "$label tile size");
37
 
        is($map->get_license, $OSM_LICENSE, "$label license");
 
38
        ok($map->get_license =~ /$OSM_LICENSE_REGEXP/, "$label license");
38
39
        is($map->get_license_uri, $OSM_URL_LICENSE , "$label license_uri");
39
40
        
40
41
        # Generic map operations
54
55
        is($map->get_min_zoom_level, 0, "$label min zoom");
55
56
        is($map->get_max_zoom_level, 18, "$label max zoom");
56
57
        is($map->get_tile_size, 256, "$label tile size");
57
 
        is($map->get_license, $OSM_LICENSE, "$label license");
 
58
        ok($map->get_license =~ /$OSM_LICENSE_REGEXP/, "$label license");
58
59
        is($map->get_license_uri, $OSM_URL_LICENSE , "$label license_uri");
59
60
        
60
61
        # Generic map operations
74
75
        is($map->get_min_zoom_level, 0, "$label min zoom");
75
76
        is($map->get_max_zoom_level, 17, "$label max zoom");
76
77
        is($map->get_tile_size, 256, "$label tile size");
77
 
        is($map->get_license, $OSM_LICENSE, "$label license");
 
78
        ok($map->get_license =~ /$OSM_LICENSE_REGEXP/, "$label license");
78
79
        is($map->get_license_uri, $OSM_URL_LICENSE , "$label license_uri");
79
80
        
80
81
        # Generic map operations
239
240
                "$label column count at min zoom"
240
241
        );
241
242
 
 
243
 
 
244
        # Check that min zoom level and max zoom level meters per pixel at different
 
245
        SKIP: {
 
246
                Champlain->CHECK_VERSION(0, 4, 3) or skip '0.4.3 stuff', 2;
 
247
                my $meters_at_min = $map->get_meters_per_pixel($map->get_min_zoom_level, 0, 0);
 
248
                ok($meters_at_min > 0, "Meters per pixel $meters_at_min at min zoom level");
 
249
 
 
250
                my $meters_at_max = $map->get_meters_per_pixel($map->get_max_zoom_level, 0, 0);
 
251
                ok($meters_at_max > 0, "Meters per pixel $meters_at_max at max zoom level");
 
252
 
 
253
                ok($meters_at_max < $meters_at_min, "Meters per pixel are different at max/min zoom level");
 
254
        }
 
255
 
 
256
 
242
257
        my $tile = Champlain::Tile->new();
243
258
        is($tile->get_size(), 0, "get_size() default tile");
244
259
        is($tile->get_state(), 'init', "get_state() default tile");