|
QGIS API Documentation
master-59fd5e0
|
This is a helper class for unit tests that need to write an image and compare it to an expected result or render time. More...
#include <qgsrasterchecker.h>
Public Member Functions | |
| QgsRasterChecker () | |
| ~QgsRasterChecker () | |
| Destructor. | |
| QString | report () |
| bool | runTest (QString theVerifiedKey, QString theVerifiedUri, QString theExpectedKey, QString theExpectedUri) |
| Test using renderer to generate the image to be compared. | |
Private Member Functions | |
| bool | compare (double verifiedVal, double expectedVal, double theTolerance) |
| void | compare (QString theParamName, int verifiedVal, int expectedVal, QString &theReport, bool &theOk) |
| void | compare (QString theParamName, double verifiedVal, double expectedVal, QString &theReport, bool &theOk, double theTolerance=0) |
| QString | compareHead () |
| void | compareRow (QString theParamName, QString verifiedVal, QString expectedVal, QString &theReport, bool theOk, QString theDifference="", QString theTolerance="") |
| void | error (QString theMessage, QString &theReport) |
| double | tolerance (double val, int places=6) |
Private Attributes | |
| QString | mCellStyle |
| QString | mCheckedUri |
| QString | mErrMsgStyle |
| QString | mErrStyle |
| QString | mExpectedUri |
| QString | mOkStyle |
| QString | mReport |
| QString | mTabStyle |
This is a helper class for unit tests that need to write an image and compare it to an expected result or render time.
Definition at line 29 of file qgsrasterchecker.h.
Definition at line 31 of file qgsrasterchecker.cpp.
References mCellStyle, mErrMsgStyle, mErrStyle, mOkStyle, and mTabStyle.
| QgsRasterChecker::~QgsRasterChecker | ( | ) | [inline] |
Destructor.
Definition at line 36 of file qgsrasterchecker.h.
| bool QgsRasterChecker::compare | ( | double | verifiedVal, |
| double | expectedVal, | ||
| double | theTolerance | ||
| ) | [private] |
Definition at line 225 of file qgsrasterchecker.cpp.
| void QgsRasterChecker::compare | ( | QString | theParamName, |
| int | verifiedVal, | ||
| int | expectedVal, | ||
| QString & | theReport, | ||
| bool & | theOk | ||
| ) | [private] |
Definition at line 218 of file qgsrasterchecker.cpp.
References compareRow().
| void QgsRasterChecker::compare | ( | QString | theParamName, |
| double | verifiedVal, | ||
| double | expectedVal, | ||
| QString & | theReport, | ||
| bool & | theOk, | ||
| double | theTolerance = 0 |
||
| ) | [private] |
Definition at line 231 of file qgsrasterchecker.cpp.
References compare(), and compareRow().
| QString QgsRasterChecker::compareHead | ( | ) | [private] |
Definition at line 211 of file qgsrasterchecker.cpp.
References mCellStyle.
Referenced by runTest().
| void QgsRasterChecker::compareRow | ( | QString | theParamName, |
| QString | verifiedVal, | ||
| QString | expectedVal, | ||
| QString & | theReport, | ||
| bool | theOk, | ||
| QString | theDifference = "", |
||
| QString | theTolerance = "" |
||
| ) | [private] |
Definition at line 238 of file qgsrasterchecker.cpp.
References mCellStyle, mErrStyle, and mOkStyle.
| void QgsRasterChecker::error | ( | QString | theMessage, |
| QString & | theReport | ||
| ) | [private] |
Definition at line 197 of file qgsrasterchecker.cpp.
References mErrMsgStyle.
Referenced by runTest().
| QString QgsRasterChecker::report | ( | ) | [inline] |
Definition at line 38 of file qgsrasterchecker.h.
| bool QgsRasterChecker::runTest | ( | QString | theVerifiedKey, |
| QString | theVerifiedUri, | ||
| QString | theExpectedKey, | ||
| QString | theExpectedUri | ||
| ) |
Test using renderer to generate the image to be compared.
| theVerifiedKey | verified provider key |
| theVerifiedUri | URI of the raster to be verified |
| theExpectedKey | expected provider key |
| theExpectedUri | URI of the expected (control) raster |
Definition at line 41 of file qgsrasterchecker.cpp.
References QgsRasterInterface::bandCount(), QgsRasterInterface::bandStatistics(), QgsRasterDataProvider::block(), compare(), compareHead(), compareRow(), QgsRasterDataProvider::dataType(), error(), QgsRasterDataProvider::extent(), QgsProviderRegistry::instance(), QgsRasterBlock::isValid(), QgsDataProvider::isValid(), QgsRasterBandStats::maximumValue, mCellStyle, QgsRasterBandStats::mean, mErrStyle, QgsRasterBandStats::minimumValue, mOkStyle, mReport, mTabStyle, QgsProviderRegistry::provider(), QgsRasterDataProvider::srcDataType(), QgsRasterBandStats::stdDev, tolerance(), QgsRectangle::toString(), QgsRasterBlock::value(), QgsRasterInterface::xSize(), and QgsRasterInterface::ySize().
| double QgsRasterChecker::tolerance | ( | double | val, |
| int | places = 6 |
||
| ) | [private] |
Definition at line 204 of file qgsrasterchecker.cpp.
Referenced by runTest().
QString QgsRasterChecker::mCellStyle [private] |
Definition at line 53 of file qgsrasterchecker.h.
Referenced by compareHead(), compareRow(), QgsRasterChecker(), and runTest().
QString QgsRasterChecker::mCheckedUri [private] |
Definition at line 51 of file qgsrasterchecker.h.
QString QgsRasterChecker::mErrMsgStyle [private] |
Definition at line 56 of file qgsrasterchecker.h.
Referenced by error(), and QgsRasterChecker().
QString QgsRasterChecker::mErrStyle [private] |
Definition at line 55 of file qgsrasterchecker.h.
Referenced by compareRow(), QgsRasterChecker(), and runTest().
QString QgsRasterChecker::mExpectedUri [private] |
Definition at line 50 of file qgsrasterchecker.h.
QString QgsRasterChecker::mOkStyle [private] |
Definition at line 54 of file qgsrasterchecker.h.
Referenced by compareRow(), QgsRasterChecker(), and runTest().
QString QgsRasterChecker::mReport [private] |
Definition at line 49 of file qgsrasterchecker.h.
Referenced by runTest().
QString QgsRasterChecker::mTabStyle [private] |
Definition at line 52 of file qgsrasterchecker.h.
Referenced by QgsRasterChecker(), and runTest().