Rename KEEPASSX_QTEST_CORE_MAIN to QTEST_GUILESS_MAIN which is available in Qt 5.

This commit is contained in:
Felix Geyer 2012-07-24 00:07:28 +02:00
parent 2185afefed
commit 6b13d18137
19 changed files with 24 additions and 24 deletions

View file

@ -48,4 +48,4 @@ void TestCryptoHash::test()
QByteArray::fromHex("0b56e5f65263e747af4a833bd7dd7ad26a64d7a4de7c68e52364893dca0766b4")); QByteArray::fromHex("0b56e5f65263e747af4a833bd7dd7ad26a64d7a4de7c68e52364893dca0766b4"));
} }
KEEPASSX_QTEST_CORE_MAIN(TestCryptoHash) QTEST_GUILESS_MAIN(TestCryptoHash)

View file

@ -159,4 +159,4 @@ void TestDeletedObjects::testDatabaseChange()
delete db2; delete db2;
} }
KEEPASSX_QTEST_CORE_MAIN(TestDeletedObjects) QTEST_GUILESS_MAIN(TestDeletedObjects)

View file

@ -311,4 +311,4 @@ void TestEntryModel::testProxyModel()
delete db; delete db;
} }
KEEPASSX_QTEST_CORE_MAIN(TestEntryModel) QTEST_GUILESS_MAIN(TestEntryModel)

View file

@ -399,4 +399,4 @@ void TestGroup::testSearch()
delete groupRoot; delete groupRoot;
} }
KEEPASSX_QTEST_CORE_MAIN(TestGroup) QTEST_GUILESS_MAIN(TestGroup)

View file

@ -150,4 +150,4 @@ void TestGroupModel::test()
delete model; delete model;
} }
KEEPASSX_QTEST_CORE_MAIN(TestGroupModel) QTEST_GUILESS_MAIN(TestGroupModel)

View file

@ -70,4 +70,4 @@ void TestHashedBlockStream::testWriteRead()
buffer.buffer().clear(); buffer.buffer().clear();
} }
KEEPASSX_QTEST_CORE_MAIN(TestHashedBlockStream) QTEST_GUILESS_MAIN(TestHashedBlockStream)

View file

@ -293,4 +293,4 @@ void TestKeePass1Reader::reopenDatabase(Database* db, const QString& password, c
delete newDb; delete newDb;
} }
KEEPASSX_QTEST_CORE_MAIN(TestKeePass1Reader) QTEST_GUILESS_MAIN(TestKeePass1Reader)

View file

@ -78,4 +78,4 @@ void TestKeePass2RandomStream::test()
QCOMPARE(randomStreamData, cipherData); QCOMPARE(randomStreamData, cipherData);
} }
KEEPASSX_QTEST_CORE_MAIN(TestKeePass2RandomStream) QTEST_GUILESS_MAIN(TestKeePass2RandomStream)

View file

@ -121,4 +121,4 @@ void TestKeePass2Reader::testFormat200()
delete db; delete db;
} }
KEEPASSX_QTEST_CORE_MAIN(TestKeePass2Reader) QTEST_GUILESS_MAIN(TestKeePass2Reader)

View file

@ -105,4 +105,4 @@ void TestKeePass2Writer::cleanupTestCase()
delete m_dbTest; delete m_dbTest;
} }
KEEPASSX_QTEST_CORE_MAIN(TestKeePass2Writer) QTEST_GUILESS_MAIN(TestKeePass2Writer)

View file

@ -356,4 +356,4 @@ void TestKeePass2XmlReader::cleanupTestCase()
delete m_db; delete m_db;
} }
KEEPASSX_QTEST_CORE_MAIN(TestKeePass2XmlReader) QTEST_GUILESS_MAIN(TestKeePass2XmlReader)

View file

@ -165,4 +165,4 @@ void TestKeys::testFileKeyError()
errorMsg = ""; errorMsg = "";
} }
KEEPASSX_QTEST_CORE_MAIN(TestKeys) QTEST_GUILESS_MAIN(TestKeys)

View file

@ -467,4 +467,4 @@ void TestModified::testHistoryItem()
delete db; delete db;
} }
KEEPASSX_QTEST_CORE_MAIN(TestModified) QTEST_GUILESS_MAIN(TestModified)

View file

@ -195,4 +195,4 @@ QString TestQSaveFile::tmpDir()
return dirName; return dirName;
} }
KEEPASSX_QTEST_CORE_MAIN(TestQSaveFile) QTEST_GUILESS_MAIN(TestQSaveFile)

View file

@ -193,4 +193,4 @@ void TestSymmetricCipher::testPadding()
QCOMPARE(decrypted, plainText); QCOMPARE(decrypted, plainText);
} }
KEEPASSX_QTEST_CORE_MAIN(TestSymmetricCipher) QTEST_GUILESS_MAIN(TestSymmetricCipher)

View file

@ -83,4 +83,4 @@ void TestWildcardMatcher::verifyNoMatch(QString pattern)
QVERIFY(!matchResult); QVERIFY(!matchResult);
} }
KEEPASSX_QTEST_CORE_MAIN(TestWildcardMatcher) QTEST_GUILESS_MAIN(TestWildcardMatcher)

View file

@ -380,4 +380,4 @@ void TestGui::dragAndDropGroup(const QModelIndex& sourceIndex, const QModelIndex
QCOMPARE(group->parentGroup()->children().indexOf(group), expectedPos); QCOMPARE(group->parentGroup()->children().indexOf(group), expectedPos);
} }
KEEPASSX_QTEST_GUI_MAIN(TestGui) QTEST_MAIN(TestGui)

View file

@ -147,4 +147,4 @@ void TestGuiPixmaps::compareImages(const QPixmap& pixmap, const QImage& image)
image.convertToFormat(QImage::Format_ARGB32_Premultiplied)); image.convertToFormat(QImage::Format_ARGB32_Premultiplied));
} }
KEEPASSX_QTEST_GUI_MAIN(TestGuiPixmaps) QTEST_MAIN(TestGuiPixmaps)

View file

@ -21,19 +21,18 @@
#include <QtTest/QTest> #include <QtTest/QTest>
#define KEEPASSX_QTEST_CORE_MAIN(TestObject) \ // 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[]) \ int main(int argc, char* argv[]) \
{ \ { \
QCoreApplication app(argc, argv); \ QCoreApplication app(argc, argv); \
TestObject tc; \ TestObject tc; \
return QTest::qExec(&tc, argc, argv); \ return QTest::qExec(&tc, argc, argv); \
} }
#endif // QTEST_GUILESS_MAIN
// just for the sake of a consistent naming scheme
#define KEEPASSX_QTEST_GUI_MAIN QTEST_MAIN
// backport QTRY_VERIFY and QTRY_COMPARE from Qt 5
#ifndef QTRY_VERIFY #ifndef QTRY_VERIFY
#define KEEPASSX_VERIFY_WITH_TIMEOUT(__expr, __timeout) \ #define KEEPASSX_VERIFY_WITH_TIMEOUT(__expr, __timeout) \
@ -52,6 +51,7 @@ do { \
#define QTRY_VERIFY(__expr) KEEPASSX_VERIFY_WITH_TIMEOUT(__expr, 5000) #define QTRY_VERIFY(__expr) KEEPASSX_VERIFY_WITH_TIMEOUT(__expr, 5000)
#endif // QTRY_VERIFY #endif // QTRY_VERIFY
#ifndef QTRY_COMPARE #ifndef QTRY_COMPARE
#define KEEPASSX_COMPARE_WITH_TIMEOUT(__expr, __expected, __timeout) \ #define KEEPASSX_COMPARE_WITH_TIMEOUT(__expr, __expected, __timeout) \
do { \ do { \