diff --git a/tools/auto-tester/src/Test.cpp b/tools/auto-tester/src/Test.cpp index 48fa530384..dbaa3a05a5 100644 --- a/tools/auto-tester/src/Test.cpp +++ b/tools/auto-tester/src/Test.cpp @@ -344,13 +344,7 @@ void Test::createTest() { const int maxImages = pow(10, NUM_DIGITS); foreach (QString currentFilename, sortedImageFilenames) { QString fullCurrentFilename = imageSourceDirectory + "/" + currentFilename; - if (isInExpectedImageFilenameFormat(currentFilename)) { - if (!QFile::remove(fullCurrentFilename)) { - messageBox.critical(0, "Error", "Could not delete existing file: " + currentFilename + "\nTest creation aborted"); - exit(-1); - } - } else if (isInSnapshotFilenameFormat(currentFilename)) { - + if (isInSnapshotFilenameFormat(currentFilename)) { if (i >= maxImages) { messageBox.critical(0, "Error", "More than " + QString::number(maxImages) + " images not supported"); exit(-1); @@ -360,6 +354,7 @@ void Test::createTest() { QString fullNewFileName = imageDestinationDirectory + "/" + newFilename; try { + QFile::remove(fullNewFileName); QFile::copy(fullCurrentFilename, fullNewFileName); } catch (...) { messageBox.critical(0, "Error", "Could not delete existing file: " + currentFilename + "\nTest creation aborted"); @@ -471,7 +466,3 @@ QString Test::getExpectedImagePartialSourceDirectory(QString filename) { return result; } - -bool Test::isInExpectedImageFilenameFormat(QString filename) { - return (expectedImageFilenameFormat.match(filename).hasMatch()); -} \ No newline at end of file diff --git a/tools/auto-tester/src/Test.h b/tools/auto-tester/src/Test.h index 56d924b82a..29e1b135ed 100644 --- a/tools/auto-tester/src/Test.h +++ b/tools/auto-tester/src/Test.h @@ -36,7 +36,6 @@ public: QStringList createListOfAll_IMAGE_FORMAT_imagesInDirectory(QString pathToImageDirectory); bool isInSnapshotFilenameFormat(QString filename); - bool isInExpectedImageFilenameFormat(QString filename); void importTest(QTextStream& textStream, const QString& testPathname);