In automatic tests, enhanced logs to provide more info for the inconsistent results. Also handled the fact that the txt files used for results matching instead of having \r\n they have \n.

This commit is contained in:
favoritas37 2016-04-08 19:49:14 +03:00
parent 00d0e8d8d0
commit 0c59e57f79
1 changed files with 6 additions and 0 deletions

View File

@ -52,11 +52,17 @@ std::shared_ptr<ValidationStats> DecodeValidator::testDecodeWithExpectedOutput(Q
decoder.setDecoder(enabledDecoder);
QString result = decoder.decodeImage(imageToDecode);
result.replace("\r\n","\n");
stats_->setElaspedTime(decoder.getProcessTimeOfLastDecoding());
stats_->setOperationSuccess(result != "");
stats_->setResultMatch(expectedOutput != "" && result == expectedOutput);
if(!stats_->getResultMatch() && stats_->getOperationSuccess()) {
qDebug() << "Expected: " << expectedOutput;
qDebug() << "Decoded: " << result;
}
return stats_;
}