Skip to content
Permalink
Browse files

Give a better error message when expected image is missing

Avoids the confusing "pre-set DPI not equal to painter's DPI"
message
  • Loading branch information
Sandro Santilli
Sandro Santilli committed Feb 19, 2015
1 parent e38b13c commit cafeaa689696bc4811955f6b14811116dcaea0d2
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/core/qgsrenderchecker.cpp
@@ -177,6 +177,15 @@ bool QgsRenderChecker::runTest( QString theTestName,
// Load the expected result pixmap
//
QImage myExpectedImage( mExpectedImageFile );
if ( myExpectedImage.isNull() )
{
qDebug() << "QgsRenderChecker::runTest failed - Could not load expected image from " << mExpectedImageFile;
mReport = "<table>"
"<tr><td>Test Result:</td><td>Expected Result:</td></tr>\n"
"<tr><td>Nothing rendered</td>\n<td>Failed because Expected "
"Image File could not be loaded.</td></tr></table>\n";
return false;
}
mMatchTarget = myExpectedImage.width() * myExpectedImage.height();
//
// Now render our layers onto a pixmap

0 comments on commit cafeaa6

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