mirror of https://github.com/status-im/qzxing.git
enhancements in testing functions. Fixed results matching boolean
This commit is contained in:
parent
e227543035
commit
ef160e3ae7
|
@ -49,7 +49,7 @@ std::shared_ptr<ValidationStats> DecodeValidator::testDecodeWithExpectedOutput(Q
|
|||
|
||||
stats_->setElaspedTime(decoder.getProcessTimeOfLastDecoding());
|
||||
stats_->setOperationSuccess(result != "");
|
||||
stats_->setResultMatch(result == expectedOutput);
|
||||
stats_->setResultMatch(expectedOutput != "" && result == expectedOutput);
|
||||
|
||||
return stats_;
|
||||
}
|
||||
|
@ -80,21 +80,19 @@ std::shared_ptr<ValidationStats> DecodeValidator::testDecodeWithExpectedOutput(Q
|
|||
stats_->setExpectedOutput(expectedOutput);
|
||||
|
||||
qDebug() << "Operation success: " << stats_->getOperationSuccess()
|
||||
<< ", Result Match: " << stats_->getResultMatch()
|
||||
<< ", Path: " << stats_->getImagePath()
|
||||
//<< ", Expected Output: " << stats_->getExpectedOutput()
|
||||
;
|
||||
<< "\t, Result Match: " << stats_->getResultMatch()
|
||||
<< "\t, Path: " << stats_->getImagePath();
|
||||
|
||||
if(!stats_->getOperationSuccess() && stats_->getResultMatch())
|
||||
qDebug() << "\t[Warning]...";
|
||||
|
||||
return stats_;
|
||||
}
|
||||
|
||||
void DecodeValidator::decodeAllImagesInForderWithValidator(QZXing::DecoderFormat enabledDecoder, const QString &folderPath)
|
||||
{
|
||||
// auto test = std::vector<std::shared_ptr<ValidationStats>>();
|
||||
|
||||
QDirIterator dirIt(folderPath, QDirIterator::NoIteratorFlags);
|
||||
|
||||
// testResults.insert(enabledDecoder, std::move(test));
|
||||
|
||||
while (dirIt.hasNext()) {
|
||||
dirIt.next();
|
||||
QFileInfo fileInfo(dirIt.filePath());
|
||||
|
|
|
@ -61,12 +61,12 @@ void ValidationStats::setImagePath(const QString &value)
|
|||
}
|
||||
|
||||
ValidationStats::ValidationStats():
|
||||
imagePath(""),
|
||||
expectedOutput(""),
|
||||
operationSuccess(false),
|
||||
resultMatch(false),
|
||||
errorMessage(""),
|
||||
elaspedTime(0)
|
||||
imagePath(""),
|
||||
expectedOutput(""),
|
||||
operationSuccess(false),
|
||||
resultMatch(false),
|
||||
errorMessage(""),
|
||||
elaspedTime(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue