mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-04-04 21:17:43 +03:00
Remove backported Qt5 test macros.
This commit is contained in:
parent
66a01e4fef
commit
c8ae31a248
24 changed files with 0 additions and 97 deletions
|
@ -20,7 +20,6 @@
|
||||||
#include <QPluginLoader>
|
#include <QPluginLoader>
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
#include "tests.h"
|
|
||||||
#include "core/Config.h"
|
#include "core/Config.h"
|
||||||
#include "core/FilePath.h"
|
#include "core/FilePath.h"
|
||||||
#include "core/Entry.h"
|
#include "core/Entry.h"
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
#include "tests.h"
|
|
||||||
#include "crypto/Crypto.h"
|
#include "crypto/Crypto.h"
|
||||||
#include "crypto/CryptoHash.h"
|
#include "crypto/CryptoHash.h"
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,6 @@
|
||||||
#include <QBuffer>
|
#include <QBuffer>
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
#include "tests.h"
|
|
||||||
|
|
||||||
#include "core/Database.h"
|
#include "core/Database.h"
|
||||||
#include "core/Entry.h"
|
#include "core/Entry.h"
|
||||||
#include "core/Group.h"
|
#include "core/Group.h"
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
#include "tests.h"
|
|
||||||
#include "core/Database.h"
|
#include "core/Database.h"
|
||||||
#include "core/Group.h"
|
#include "core/Group.h"
|
||||||
#include "crypto/Crypto.h"
|
#include "crypto/Crypto.h"
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
#include "tests.h"
|
|
||||||
#include "core/Entry.h"
|
#include "core/Entry.h"
|
||||||
#include "crypto/Crypto.h"
|
#include "crypto/Crypto.h"
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
#include "modeltest.h"
|
#include "modeltest.h"
|
||||||
#include "tests.h"
|
|
||||||
#include "core/DatabaseIcons.h"
|
#include "core/DatabaseIcons.h"
|
||||||
#include "core/Entry.h"
|
#include "core/Entry.h"
|
||||||
#include "core/Group.h"
|
#include "core/Group.h"
|
||||||
|
|
|
@ -19,8 +19,6 @@
|
||||||
|
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
#include "tests.h"
|
|
||||||
|
|
||||||
QTEST_GUILESS_MAIN(TestEntrySearcher)
|
QTEST_GUILESS_MAIN(TestEntrySearcher)
|
||||||
|
|
||||||
void TestEntrySearcher::initTestCase()
|
void TestEntrySearcher::initTestCase()
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
|
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
#include "tests.h"
|
|
||||||
#include "core/ToDbExporter.h"
|
#include "core/ToDbExporter.h"
|
||||||
#include "core/Group.h"
|
#include "core/Group.h"
|
||||||
#include "core/Metadata.h"
|
#include "core/Metadata.h"
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#include <QSignalSpy>
|
#include <QSignalSpy>
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
#include "tests.h"
|
|
||||||
#include "core/Database.h"
|
#include "core/Database.h"
|
||||||
#include "core/Group.h"
|
#include "core/Group.h"
|
||||||
#include "core/Metadata.h"
|
#include "core/Metadata.h"
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
#include "modeltest.h"
|
#include "modeltest.h"
|
||||||
#include "tests.h"
|
|
||||||
#include "core/Database.h"
|
#include "core/Database.h"
|
||||||
#include "core/Group.h"
|
#include "core/Group.h"
|
||||||
#include "crypto/Crypto.h"
|
#include "crypto/Crypto.h"
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
#include <QBuffer>
|
#include <QBuffer>
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
#include "tests.h"
|
|
||||||
#include "FailDevice.h"
|
#include "FailDevice.h"
|
||||||
#include "crypto/Crypto.h"
|
#include "crypto/Crypto.h"
|
||||||
#include "streams/HashedBlockStream.h"
|
#include "streams/HashedBlockStream.h"
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
#include "config-keepassx-tests.h"
|
#include "config-keepassx-tests.h"
|
||||||
#include "tests.h"
|
|
||||||
#include "core/Database.h"
|
#include "core/Database.h"
|
||||||
#include "core/Entry.h"
|
#include "core/Entry.h"
|
||||||
#include "core/Group.h"
|
#include "core/Group.h"
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
#include "tests.h"
|
|
||||||
#include "crypto/Crypto.h"
|
#include "crypto/Crypto.h"
|
||||||
#include "crypto/CryptoHash.h"
|
#include "crypto/CryptoHash.h"
|
||||||
#include "crypto/SymmetricCipher.h"
|
#include "crypto/SymmetricCipher.h"
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
#include "config-keepassx-tests.h"
|
#include "config-keepassx-tests.h"
|
||||||
#include "tests.h"
|
|
||||||
#include "core/Database.h"
|
#include "core/Database.h"
|
||||||
#include "core/Group.h"
|
#include "core/Group.h"
|
||||||
#include "core/Metadata.h"
|
#include "core/Metadata.h"
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
#include <QBuffer>
|
#include <QBuffer>
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
#include "tests.h"
|
|
||||||
#include "FailDevice.h"
|
#include "FailDevice.h"
|
||||||
#include "core/Database.h"
|
#include "core/Database.h"
|
||||||
#include "core/Group.h"
|
#include "core/Group.h"
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
#include "tests.h"
|
|
||||||
#include "core/Database.h"
|
#include "core/Database.h"
|
||||||
#include "core/Group.h"
|
#include "core/Group.h"
|
||||||
#include "core/Metadata.h"
|
#include "core/Metadata.h"
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
#include "config-keepassx-tests.h"
|
#include "config-keepassx-tests.h"
|
||||||
#include "tests.h"
|
|
||||||
#include "core/Database.h"
|
#include "core/Database.h"
|
||||||
#include "core/Metadata.h"
|
#include "core/Metadata.h"
|
||||||
#include "crypto/Crypto.h"
|
#include "crypto/Crypto.h"
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
#include <QSignalSpy>
|
#include <QSignalSpy>
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
#include "tests.h"
|
|
||||||
#include "core/Database.h"
|
#include "core/Database.h"
|
||||||
#include "core/Group.h"
|
#include "core/Group.h"
|
||||||
#include "core/Metadata.h"
|
#include "core/Metadata.h"
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
|
|
||||||
#include "TestRandom.h"
|
#include "TestRandom.h"
|
||||||
|
|
||||||
#include "tests.h"
|
|
||||||
#include "core/Endian.h"
|
#include "core/Endian.h"
|
||||||
#include "core/Global.h"
|
#include "core/Global.h"
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
#include <QBuffer>
|
#include <QBuffer>
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
#include "tests.h"
|
|
||||||
#include "crypto/Crypto.h"
|
#include "crypto/Crypto.h"
|
||||||
#include "crypto/SymmetricCipher.h"
|
#include "crypto/SymmetricCipher.h"
|
||||||
#include "streams/SymmetricCipherStream.h"
|
#include "streams/SymmetricCipherStream.h"
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
#include "tests.h"
|
|
||||||
#include "autotype/WildcardMatcher.h"
|
#include "autotype/WildcardMatcher.h"
|
||||||
|
|
||||||
QTEST_GUILESS_MAIN(TestWildcardMatcher)
|
QTEST_GUILESS_MAIN(TestWildcardMatcher)
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
|
|
||||||
#include "config-keepassx-tests.h"
|
#include "config-keepassx-tests.h"
|
||||||
#include "tests.h"
|
|
||||||
#include "core/Config.h"
|
#include "core/Config.h"
|
||||||
#include "core/Database.h"
|
#include "core/Database.h"
|
||||||
#include "core/Entry.h"
|
#include "core/Entry.h"
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
#include "tests.h"
|
|
||||||
#include "core/Database.h"
|
#include "core/Database.h"
|
||||||
#include "core/DatabaseIcons.h"
|
#include "core/DatabaseIcons.h"
|
||||||
#include "core/Entry.h"
|
#include "core/Entry.h"
|
||||||
|
|
|
@ -1,72 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2011 Felix Geyer <debfx@fobos.de>
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef KEEPASSX_TESTS_H
|
|
||||||
#define KEEPASSX_TESTS_H
|
|
||||||
|
|
||||||
#include <QTest>
|
|
||||||
|
|
||||||
// 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
|
|
Loading…
Add table
Add a link
Reference in a new issue