mirror of
https://github.com/lubosz/overte.git
synced 2025-08-08 03:08:00 +02:00
Reformatting per coding standard.
This commit is contained in:
parent
8c1a4e058e
commit
5806605439
6 changed files with 31 additions and 45 deletions
|
@ -39,8 +39,7 @@ bool Test::compareImageLists(QStringList expectedImages, QStringList resultImage
|
||||||
double similarityIndex; // in [-1.0 .. 1.0], where 1.0 means images are identical
|
double similarityIndex; // in [-1.0 .. 1.0], where 1.0 means images are identical
|
||||||
try {
|
try {
|
||||||
similarityIndex = imageComparer.compareImages(resultImage, expectedImage);
|
similarityIndex = imageComparer.compareImages(resultImage, expectedImage);
|
||||||
}
|
} catch (...) {
|
||||||
catch (...) {
|
|
||||||
messageBox.critical(0, "Internal error", "Image not in expected format");
|
messageBox.critical(0, "Internal error", "Image not in expected format");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
@ -56,17 +55,18 @@ bool Test::compareImageLists(QStringList expectedImages, QStringList resultImage
|
||||||
mismatchWindow.exec();
|
mismatchWindow.exec();
|
||||||
|
|
||||||
switch (mismatchWindow.getUserResponse()) {
|
switch (mismatchWindow.getUserResponse()) {
|
||||||
case USER_RESPONSE_PASS:
|
case USER_RESPONSE_PASS:
|
||||||
break;
|
break;
|
||||||
case USE_RESPONSE_FAIL:
|
case USE_RESPONSE_FAIL:
|
||||||
success = false;
|
success = false;
|
||||||
break;
|
break;
|
||||||
case USER_RESPONSE_ABORT:
|
case USER_RESPONSE_ABORT:
|
||||||
keepOn = false;
|
keepOn = false;
|
||||||
success = false;
|
success = false;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(false);
|
assert(false);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,12 +14,12 @@
|
||||||
|
|
||||||
class TestFailure {
|
class TestFailure {
|
||||||
public:
|
public:
|
||||||
TestFailure(float error, QString pathname, QString expectedImageFilename, QString actualImageFilename) {
|
TestFailure(float error, QString pathname, QString expectedImageFilename, QString actualImageFilename) :
|
||||||
_error = error;
|
_error(error),
|
||||||
_pathname = pathname;
|
_pathname(pathname),
|
||||||
_expectedImageFilename = expectedImageFilename;
|
_expectedImageFilename(expectedImageFilename),
|
||||||
_actualImageFilename = actualImageFilename;
|
_actualImageFilename(actualImageFilename)
|
||||||
}
|
{}
|
||||||
|
|
||||||
double _error;
|
double _error;
|
||||||
QString _pathname;
|
QString _pathname;
|
||||||
|
|
|
@ -10,8 +10,7 @@
|
||||||
#include <QtWidgets/QApplication>
|
#include <QtWidgets/QApplication>
|
||||||
#include "ui/AutoTester.h"
|
#include "ui/AutoTester.h"
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[]) {
|
||||||
{
|
|
||||||
QApplication application(argc, argv);
|
QApplication application(argc, argv);
|
||||||
|
|
||||||
AutoTester autoTester;
|
AutoTester autoTester;
|
||||||
|
|
|
@ -10,33 +10,26 @@
|
||||||
//
|
//
|
||||||
#include "AutoTester.h"
|
#include "AutoTester.h"
|
||||||
|
|
||||||
AutoTester::AutoTester(QWidget *parent)
|
AutoTester::AutoTester(QWidget *parent) : QMainWindow(parent) {
|
||||||
: QMainWindow(parent)
|
|
||||||
{
|
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoTester::on_evaluateTestsButton_clicked()
|
void AutoTester::on_evaluateTestsButton_clicked() {
|
||||||
{
|
|
||||||
test.evaluateTests();
|
test.evaluateTests();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoTester::on_evaluateTestsRecursivelyButton_clicked()
|
void AutoTester::on_evaluateTestsRecursivelyButton_clicked() {
|
||||||
{
|
|
||||||
test.evaluateTestsRecursively();
|
test.evaluateTestsRecursively();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoTester::on_createRecursiveScriptButton_clicked()
|
void AutoTester::on_createRecursiveScriptButton_clicked() {
|
||||||
{
|
|
||||||
test.createRecursiveScript();
|
test.createRecursiveScript();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoTester::on_createTestButton_clicked()
|
void AutoTester::on_createTestButton_clicked() {
|
||||||
{
|
|
||||||
test.createTest();
|
test.createTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoTester::on_closeButton_clicked()
|
void AutoTester::on_closeButton_clicked() {
|
||||||
{
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
|
@ -15,8 +15,7 @@
|
||||||
#include "ui_AutoTester.h"
|
#include "ui_AutoTester.h"
|
||||||
#include "../Test.h"
|
#include "../Test.h"
|
||||||
|
|
||||||
class AutoTester : public QMainWindow
|
class AutoTester : public QMainWindow {
|
||||||
{
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -11,9 +11,7 @@
|
||||||
|
|
||||||
#include <QtCore/QFileInfo>
|
#include <QtCore/QFileInfo>
|
||||||
|
|
||||||
MismatchWindow::MismatchWindow(QWidget *parent)
|
MismatchWindow::MismatchWindow(QWidget *parent) : QDialog(parent) {
|
||||||
: QDialog(parent)
|
|
||||||
{
|
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
expectedImage->setScaledContents(true);
|
expectedImage->setScaledContents(true);
|
||||||
|
@ -32,20 +30,17 @@ void MismatchWindow::setTestFailure(TestFailure testFailure) {
|
||||||
resultImage->setPixmap(QPixmap(testFailure._pathname + testFailure._actualImageFilename));
|
resultImage->setPixmap(QPixmap(testFailure._pathname + testFailure._actualImageFilename));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MismatchWindow::on_passTestButton_clicked()
|
void MismatchWindow::on_passTestButton_clicked() {
|
||||||
{
|
|
||||||
_userResponse = USER_RESPONSE_PASS;
|
_userResponse = USER_RESPONSE_PASS;
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MismatchWindow::on_failTestButton_clicked()
|
void MismatchWindow::on_failTestButton_clicked() {
|
||||||
{
|
|
||||||
_userResponse = USE_RESPONSE_FAIL;
|
_userResponse = USE_RESPONSE_FAIL;
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MismatchWindow::on_abortTestsButton_clicked()
|
void MismatchWindow::on_abortTestsButton_clicked() {
|
||||||
{
|
|
||||||
_userResponse = USER_RESPONSE_ABORT;
|
_userResponse = USER_RESPONSE_ABORT;
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue