diff --git a/tests/TestAutoType.cpp b/tests/TestAutoType.cpp index d18f4f66..3d4a6630 100644 --- a/tests/TestAutoType.cpp +++ b/tests/TestAutoType.cpp @@ -20,7 +20,6 @@ #include #include -#include "tests.h" #include "core/Config.h" #include "core/FilePath.h" #include "core/Entry.h" diff --git a/tests/TestCryptoHash.cpp b/tests/TestCryptoHash.cpp index 4002aea6..c166f559 100644 --- a/tests/TestCryptoHash.cpp +++ b/tests/TestCryptoHash.cpp @@ -19,7 +19,6 @@ #include -#include "tests.h" #include "crypto/Crypto.h" #include "crypto/CryptoHash.h" diff --git a/tests/TestCsvExporter.cpp b/tests/TestCsvExporter.cpp index 5965e605..3304d695 100644 --- a/tests/TestCsvExporter.cpp +++ b/tests/TestCsvExporter.cpp @@ -21,8 +21,6 @@ #include #include -#include "tests.h" - #include "core/Database.h" #include "core/Entry.h" #include "core/Group.h" diff --git a/tests/TestDeletedObjects.cpp b/tests/TestDeletedObjects.cpp index cf9e3d10..5af01788 100644 --- a/tests/TestDeletedObjects.cpp +++ b/tests/TestDeletedObjects.cpp @@ -19,7 +19,6 @@ #include -#include "tests.h" #include "core/Database.h" #include "core/Group.h" #include "crypto/Crypto.h" diff --git a/tests/TestEntry.cpp b/tests/TestEntry.cpp index 477e83b8..53d68b5e 100644 --- a/tests/TestEntry.cpp +++ b/tests/TestEntry.cpp @@ -19,7 +19,6 @@ #include -#include "tests.h" #include "core/Entry.h" #include "crypto/Crypto.h" diff --git a/tests/TestEntryModel.cpp b/tests/TestEntryModel.cpp index 7ba886bc..6186a351 100644 --- a/tests/TestEntryModel.cpp +++ b/tests/TestEntryModel.cpp @@ -21,7 +21,6 @@ #include #include "modeltest.h" -#include "tests.h" #include "core/DatabaseIcons.h" #include "core/Entry.h" #include "core/Group.h" diff --git a/tests/TestEntrySearcher.cpp b/tests/TestEntrySearcher.cpp index 9f7ca139..6b951c70 100644 --- a/tests/TestEntrySearcher.cpp +++ b/tests/TestEntrySearcher.cpp @@ -19,8 +19,6 @@ #include -#include "tests.h" - QTEST_GUILESS_MAIN(TestEntrySearcher) void TestEntrySearcher::initTestCase() diff --git a/tests/TestExporter.cpp b/tests/TestExporter.cpp index d703e02f..46319bc3 100644 --- a/tests/TestExporter.cpp +++ b/tests/TestExporter.cpp @@ -20,7 +20,6 @@ #include -#include "tests.h" #include "core/ToDbExporter.h" #include "core/Group.h" #include "core/Metadata.h" diff --git a/tests/TestGroup.cpp b/tests/TestGroup.cpp index 507cf155..13ce82ea 100644 --- a/tests/TestGroup.cpp +++ b/tests/TestGroup.cpp @@ -21,7 +21,6 @@ #include #include -#include "tests.h" #include "core/Database.h" #include "core/Group.h" #include "core/Metadata.h" diff --git a/tests/TestGroupModel.cpp b/tests/TestGroupModel.cpp index 32a4b8e9..3608cc47 100644 --- a/tests/TestGroupModel.cpp +++ b/tests/TestGroupModel.cpp @@ -21,7 +21,6 @@ #include #include "modeltest.h" -#include "tests.h" #include "core/Database.h" #include "core/Group.h" #include "crypto/Crypto.h" diff --git a/tests/TestHashedBlockStream.cpp b/tests/TestHashedBlockStream.cpp index d5a0ceaf..b78a46ba 100644 --- a/tests/TestHashedBlockStream.cpp +++ b/tests/TestHashedBlockStream.cpp @@ -20,7 +20,6 @@ #include #include -#include "tests.h" #include "FailDevice.h" #include "crypto/Crypto.h" #include "streams/HashedBlockStream.h" diff --git a/tests/TestKeePass1Reader.cpp b/tests/TestKeePass1Reader.cpp index 249a3657..14eb5f48 100644 --- a/tests/TestKeePass1Reader.cpp +++ b/tests/TestKeePass1Reader.cpp @@ -21,7 +21,6 @@ #include #include "config-keepassx-tests.h" -#include "tests.h" #include "core/Database.h" #include "core/Entry.h" #include "core/Group.h" diff --git a/tests/TestKeePass2RandomStream.cpp b/tests/TestKeePass2RandomStream.cpp index cb881337..03dfbe50 100644 --- a/tests/TestKeePass2RandomStream.cpp +++ b/tests/TestKeePass2RandomStream.cpp @@ -19,7 +19,6 @@ #include -#include "tests.h" #include "crypto/Crypto.h" #include "crypto/CryptoHash.h" #include "crypto/SymmetricCipher.h" diff --git a/tests/TestKeePass2Reader.cpp b/tests/TestKeePass2Reader.cpp index d6cb70c7..22973ee0 100644 --- a/tests/TestKeePass2Reader.cpp +++ b/tests/TestKeePass2Reader.cpp @@ -20,7 +20,6 @@ #include #include "config-keepassx-tests.h" -#include "tests.h" #include "core/Database.h" #include "core/Group.h" #include "core/Metadata.h" diff --git a/tests/TestKeePass2Writer.cpp b/tests/TestKeePass2Writer.cpp index fd478a87..d120458b 100644 --- a/tests/TestKeePass2Writer.cpp +++ b/tests/TestKeePass2Writer.cpp @@ -20,7 +20,6 @@ #include #include -#include "tests.h" #include "FailDevice.h" #include "core/Database.h" #include "core/Group.h" diff --git a/tests/TestKeePass2XmlReader.cpp b/tests/TestKeePass2XmlReader.cpp index ff94e9a6..0f9676f5 100644 --- a/tests/TestKeePass2XmlReader.cpp +++ b/tests/TestKeePass2XmlReader.cpp @@ -20,7 +20,6 @@ #include #include -#include "tests.h" #include "core/Database.h" #include "core/Group.h" #include "core/Metadata.h" diff --git a/tests/TestKeys.cpp b/tests/TestKeys.cpp index abd137f5..4e53d544 100644 --- a/tests/TestKeys.cpp +++ b/tests/TestKeys.cpp @@ -21,7 +21,6 @@ #include #include "config-keepassx-tests.h" -#include "tests.h" #include "core/Database.h" #include "core/Metadata.h" #include "crypto/Crypto.h" diff --git a/tests/TestModified.cpp b/tests/TestModified.cpp index b057feea..70a4a484 100644 --- a/tests/TestModified.cpp +++ b/tests/TestModified.cpp @@ -20,7 +20,6 @@ #include #include -#include "tests.h" #include "core/Database.h" #include "core/Group.h" #include "core/Metadata.h" diff --git a/tests/TestRandom.cpp b/tests/TestRandom.cpp index b37b5ced..6c5b1f72 100644 --- a/tests/TestRandom.cpp +++ b/tests/TestRandom.cpp @@ -17,7 +17,6 @@ #include "TestRandom.h" -#include "tests.h" #include "core/Endian.h" #include "core/Global.h" diff --git a/tests/TestSymmetricCipher.cpp b/tests/TestSymmetricCipher.cpp index 578d2501..698ecb20 100644 --- a/tests/TestSymmetricCipher.cpp +++ b/tests/TestSymmetricCipher.cpp @@ -20,7 +20,6 @@ #include #include -#include "tests.h" #include "crypto/Crypto.h" #include "crypto/SymmetricCipher.h" #include "streams/SymmetricCipherStream.h" diff --git a/tests/TestWildcardMatcher.cpp b/tests/TestWildcardMatcher.cpp index dc9991db..dffe1c85 100644 --- a/tests/TestWildcardMatcher.cpp +++ b/tests/TestWildcardMatcher.cpp @@ -19,7 +19,6 @@ #include -#include "tests.h" #include "autotype/WildcardMatcher.h" QTEST_GUILESS_MAIN(TestWildcardMatcher) diff --git a/tests/gui/TestGui.cpp b/tests/gui/TestGui.cpp index 549d0370..5eb8f6f2 100644 --- a/tests/gui/TestGui.cpp +++ b/tests/gui/TestGui.cpp @@ -30,7 +30,6 @@ #include #include "config-keepassx-tests.h" -#include "tests.h" #include "core/Config.h" #include "core/Database.h" #include "core/Entry.h" diff --git a/tests/gui/TestGuiPixmaps.cpp b/tests/gui/TestGuiPixmaps.cpp index 87e3f248..36374947 100644 --- a/tests/gui/TestGuiPixmaps.cpp +++ b/tests/gui/TestGuiPixmaps.cpp @@ -19,7 +19,6 @@ #include -#include "tests.h" #include "core/Database.h" #include "core/DatabaseIcons.h" #include "core/Entry.h" diff --git a/tests/tests.h b/tests/tests.h deleted file mode 100644 index e719a0bf..00000000 --- a/tests/tests.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2011 Felix Geyer - * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 or (at your option) - * version 3 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef KEEPASSX_TESTS_H -#define KEEPASSX_TESTS_H - -#include - -// backport QTEST_GUILESS_MAIN, QTRY_VERIFY and QTRY_COMPARE from Qt 5 - -#ifndef QTEST_GUILESS_MAIN -#define QTEST_GUILESS_MAIN(TestObject) \ -int main(int argc, char* argv[]) \ -{ \ - QCoreApplication app(argc, argv); \ - TestObject tc; \ - return QTest::qExec(&tc, argc, argv); \ -} -#endif // QTEST_GUILESS_MAIN - - -#ifndef QTRY_VERIFY -#define KEEPASSX_VERIFY_WITH_TIMEOUT(__expr, __timeout) \ -do { \ - const int __step = 50; \ - const int __timeoutValue = __timeout; \ - if (!(__expr)) { \ - QTest::qWait(0); \ - } \ - for (int __i = 0; __i < __timeoutValue && !(__expr); __i+=__step) { \ - QTest::qWait(__step); \ - } \ - QVERIFY(__expr); \ -} while (0) - -#define QTRY_VERIFY(__expr) KEEPASSX_VERIFY_WITH_TIMEOUT(__expr, 5000) -#endif // QTRY_VERIFY - - -#ifndef QTRY_COMPARE -#define KEEPASSX_COMPARE_WITH_TIMEOUT(__expr, __expected, __timeout) \ -do { \ - const int __step = 50; \ - const int __timeoutValue = __timeout; \ - if ((__expr) != (__expected)) { \ - QTest::qWait(0); \ - } \ - for (int __i = 0; __i < __timeoutValue && ((__expr) != (__expected)); __i+=__step) { \ - QTest::qWait(__step); \ - } \ - QCOMPARE(__expr, __expected); \ -} while (0) - -#define QTRY_COMPARE(__expr, __expected) KEEPASSX_COMPARE_WITH_TIMEOUT(__expr, __expected, 5000) -#endif // QTRY_COMPARE - -#endif // KEEPASSX_TESTS_H