Permalink
Browse files

add testcase for #1508 to visual tests

  • Loading branch information...
1 parent 43ded34 commit a7670459d62312aca764fb0ac3671f5281e20c2a @springmeyer springmeyer committed Sep 28, 2012
View
BIN tests/visual_tests/images/tiff-opaque-edge-gdal-600-reference.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN tests/visual_tests/images/tiff-opaque-edge-raster-256-reference.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
17 tests/visual_tests/styles/tiff-opaque-edge-gdal.xml
@@ -0,0 +1,17 @@
+<Map srs="+init=EPSG:4326" background-color="white">
+
+<Style name="test">
+ <Rule>
+ <RasterSymbolizer scaling="bilinear" />
+ </Rule>
+</Style>
+
+<Layer name="test" srs="+init=EPSG:4326">
+ <StyleName>test</StyleName>
+ <Datasource>
+ <Parameter name="file">../../data/raster/river.tiff</Parameter>
+ <Parameter name="type">gdal</Parameter>
+ </Datasource>
+</Layer>
+
+</Map>
View
18 tests/visual_tests/styles/tiff-opaque-edge-raster.xml
@@ -0,0 +1,18 @@
+<Map srs="+init=EPSG:4326" background-color="white">
+
+<Style name="test">
+ <Rule>
+ <RasterSymbolizer scaling="bilinear" />
+ </Rule>
+</Style>
+
+<Layer name="test" srs="+init=EPSG:4326">
+ <StyleName>test</StyleName>
+ <Datasource>
+ <Parameter name="file">../../data/raster/river.tiff</Parameter>
+ <Parameter name="type">raster</Parameter>
+ <Parameter name="extent">0,0,256,210</Parameter>
+ </Datasource>
+</Layer>
+
+</Map>
View
12 tests/visual_tests/test.py
@@ -52,12 +52,14 @@
{'name': "tiff-alpha-gradient-gdal", 'sizes':[(600,400)]},
{'name': "tiff-nodata-edge-gdal", 'sizes':[(600,400)]},
{'name': "tiff-nodata-edge-raster", 'sizes':[(600,400)]},
+ {'name': "tiff-opaque-edge-gdal", 'sizes':[(600,400)]},
+ {'name': "tiff-opaque-edge-raster", 'sizes':[(256,256)]},
+
]
def render(filename, width, height, bbox, quiet=False):
if not quiet:
- print "Rendering style \"%s\" with size %dx%d ... \x1b[1;32m✓ \x1b[0m" % (filename, width, height)
- print "-"*80
+ print "Rendering style \"%s\" with size %dx%d ..." % (filename, width, height),
m = mapnik.Map(width, height)
mapnik.load_map(m, os.path.join(dirname, "styles", "%s.xml" % filename), False)
if bbox is not None:
@@ -72,9 +74,9 @@ def render(filename, width, height, bbox, quiet=False):
mapnik.render_to_file(m, actual)
diff = compare(actual, expected)
if diff > 0:
- print "-"*80
- print '\x1b[33mError:\x1b[0m %u different pixels' % diff
- print "-"*80
+ print '\x1b[31mError:\x1b[0m %u different pixels' % diff
+ else:
+ print '\x1b[1;32m✓ \x1b[0m'
except Exception, e:
sys.stderr.write(e.message + '\n')
fail(actual,expected)

0 comments on commit a767045

Please sign in to comment.