Created reporting at the end of the tests. Failed images are enlisted there. TODO: separate listing of inconsistant successfull decodings (because of actual content decoded.)

This commit is contained in:
favoritas37 2016-01-24 00:30:58 +02:00
parent 36e303e8be
commit a1e658b975
2 changed files with 39 additions and 0 deletions

View File

@ -69,6 +69,42 @@ QZXing::DecoderFormat DecodeValidator::getDecoderForFolder(const QString &folder
return QZXing::DecoderFormat_None;
}
void DecodeValidator::printResults()
{
std::map<QZXing::DecoderFormat, std::vector<std::shared_ptr<ValidationStats>>>::iterator it;
for(it=testResults.begin(); it != testResults.end(); it++) {
QString decoderStr = QZXing::decoderFormatToString(it->first);
std::vector<std::shared_ptr<ValidationStats>> &resPerDecoder = it->second;
size_t successfulTestCount = 0;
size_t failedTestCount = 0;
size_t resultIncosistencyCount = 0;
QVector<QString> failedResultLogs;
for(size_t i=0; i<resPerDecoder.size(); i++) {
if(resPerDecoder[i]->getOperationSuccess())
successfulTestCount++;
else {
failedTestCount++;
failedResultLogs.push_back(QString(" failed file: ") + resPerDecoder[i]->getImagePath());
}
if(resPerDecoder[i]->getOperationSuccess() && !resPerDecoder[i]->getResultMatch())
resultIncosistencyCount++;
}
qDebug() << "Decoder: [" << decoderStr << "]"
<< ", successful: [" << successfulTestCount << "]"
<< ", failed: [" << failedTestCount << "]"
<< ", inconsistencies: [" << resultIncosistencyCount << "]";
for(size_t i=0; i<failedResultLogs.size(); i++)
qDebug() << failedResultLogs[i];
}
}
std::shared_ptr<ValidationStats> DecodeValidator::testDecodeWithExpectedOutput(QZXing::DecoderFormat enabledDecoder, const QString &imageToDecodePath, const QString &expectedOutputFilePath)
{
QImage tmpImage = QImage(imageToDecodePath);
@ -124,6 +160,7 @@ void DecodeValidator::executeTests(const QString &folderPath)
}
}
printResults();
}

View File

@ -25,6 +25,8 @@ private:
QZXing::DecoderFormat getDecoderForFolder(const QString &folderName);
void printResults();
public:
DecodeValidator();