Skip to content
Permalink
Browse files

make QgsCompositionChecker less forgiving and readd a svg used in tes…

…ts (fixes #7731)
  • Loading branch information
jef-n committed Jul 13, 2013
1 parent b9fc239 commit ff7aaba3231b8dabf89102ccb1e03ba10547c566
Showing with 78 additions and 2 deletions.
  1. +76 −0 images/svg/gpsicons/plane_orange.svg
  2. +2 −2 tests/src/core/qgscompositionchecker.cpp
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Sodipodi ("http://www.sodipodi.com/") -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://web.resource.org/cc/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.0"
x="0"
y="0"
width="109.13385"
height="109.13385"
id="svg602"
xml:space="preserve"
sodipodi:version="0.32"
inkscape:version="0.45"
sodipodi:docname="plane_orange.svg"
sodipodi:docbase="/home/gsherman/qgis_09_qml/share/qgis/svg/gpsicons"
inkscape:output_extension="org.inkscape.output.svg.inkscape"><metadata
id="metadata10"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
id="defs8" /><sodipodi:namedview
inkscape:window-height="679"
inkscape:window-width="1024"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
borderopacity="1.0"
bordercolor="#666666"
pagecolor="#ffffff"
id="base"
inkscape:zoom="3.6927131"
inkscape:cx="54.566925"
inkscape:cy="54.566925"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:current-layer="g841" /><g
transform="translate(1.907349e-5,1.15625)"
style="font-size:12;"
id="g841"><rect
style="fill:#ff8000;fill-opacity:1;stroke:none;stroke-opacity:1"
id="rect1309"
width="7.9182968"
height="86.771385"
x="50.982937"
y="6.1554475"
ry="4.6036596"
rx="4.6036596" /><path
style="fill:#ff8000;fill-opacity:1;fill-rule:evenodd;stroke:#ff8000;stroke-width:6.09166908;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 54.942086,37.82865 L 11.143125,65.542701 L 98.74105,65.542701 L 54.942086,37.82865 z "
id="path3061"
sodipodi:nodetypes="cccc" /><path
sodipodi:nodetypes="cccc"
id="path3936"
d="M 54.942086,79.491147 L 35.702152,91.665329 L 74.182023,91.665329 L 54.942086,79.491147 z "
style="fill:#ff8000;fill-opacity:1;fill-rule:evenodd;stroke:#ff8000;stroke-width:2.67593813;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><rect
rx="4.6036596"
ry="4.6036596"
y="45.42197"
x="25.527399"
height="18.258076"
width="7.9182968"
id="rect3938"
style="fill:#ff8000;fill-opacity:1;stroke:#ff8000;stroke-opacity:1" /><use
x="0"
y="0"
xlink:href="#rect3938"
id="use3940"
transform="translate(50.64027,-4.017428e-7)"
width="109.13385"
height="109.13385"
style="fill:#ff8000;fill-opacity:1;stroke:#ff8000;stroke-opacity:1" /></g></svg>
@@ -126,7 +126,7 @@ bool QgsCompositionChecker::compareImages( const QImage& imgExpected, const QIma
differenceImage.save( differenceImagePath, "PNG" );
}

//allow pixel deviation of 1 percent
//allow pixel deviation of 1 per mille
int pixelCount = imageWidth * imageHeight;
return (( double )mismatchCount / ( double )pixelCount ) < 0.01;
return (( double )mismatchCount / ( double )pixelCount ) < 0.001;
}

0 comments on commit ff7aaba

Please sign in to comment.
You can’t perform that action at this time.