Skip to content

Commit

Permalink
Give a better error message when expected image is missing
Browse files Browse the repository at this point in the history
Avoids the confusing "pre-set DPI not equal to painter's DPI"
message
  • Loading branch information
Sandro Santilli committed Feb 19, 2015
1 parent e38b13c commit cafeaa6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/qgsrenderchecker.cpp
Expand Up @@ -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
Expand Down

0 comments on commit cafeaa6

Please sign in to comment.