From 98e8a9355d49f4540e70a42e9d3abc1474cd7cd2 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Wed, 24 Jan 2018 16:38:25 +0100 Subject: [PATCH] Autotests: Convert to proper tests runnable with make test --- autotests/CMakeLists.txt | 35 +- autotests/adblocktest.cpp | 2 + autotests/cookiestest.cpp | 2 + .../databaseencryptedpasswordbackendtest.cpp | 57 ++++ .../databaseencryptedpasswordbackendtest.h | 34 ++ autotests/databasepasswordbackendtest.cpp | 45 +++ autotests/databasepasswordbackendtest.h | 31 ++ autotests/formcompletertest.cpp | 303 ------------------ autotests/formcompletertest.h | 57 ---- autotests/main.cpp | 55 ---- autotests/passwordbackendtest.cpp | 65 +--- autotests/passwordbackendtest.h | 36 +-- autotests/qztoolstest.cpp | 2 + autotests/updatertest.cpp | 2 + 14 files changed, 205 insertions(+), 521 deletions(-) create mode 100644 autotests/databaseencryptedpasswordbackendtest.cpp create mode 100644 autotests/databaseencryptedpasswordbackendtest.h create mode 100644 autotests/databasepasswordbackendtest.cpp create mode 100644 autotests/databasepasswordbackendtest.h delete mode 100644 autotests/formcompletertest.cpp delete mode 100644 autotests/formcompletertest.h delete mode 100644 autotests/main.cpp diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt index 800dd6727..3936dee4e 100644 --- a/autotests/CMakeLists.txt +++ b/autotests/CMakeLists.txt @@ -1,11 +1,26 @@ -set( autotests_SRCS - qztoolstest.cpp - main.cpp - cookiestest.cpp - adblocktest.cpp - updatertest.cpp - passwordbackendtest.cpp - ) +include(ECMMarkAsTest) -add_executable(autotests ${autotests_SRCS}) -target_link_libraries(autotests FalkonPrivate Qt5::Test) +set(falkon_autotests_SRCS ) + +macro(falkon_tests) + foreach(_testname ${ARGN}) + add_executable(${_testname} ${_testname}.cpp ${falkon_autotests_SRCS}) + target_link_libraries(${_testname} Qt5::Test FalkonPrivate) + add_test(NAME falkon-${_testname} COMMAND ${_testname}) + ecm_mark_as_test(${_testname}) + set_tests_properties(falkon-${_testname} PROPERTIES RUN_SERIAL TRUE) + endforeach(_testname) +endmacro() + +falkon_tests( + qztoolstest + #cookiestest + adblocktest + updatertest +) + +set(falkon_autotests_SRCS passwordbackendtest.cpp) +falkon_tests( + databasepasswordbackendtest + databaseencryptedpasswordbackendtest +) diff --git a/autotests/adblocktest.cpp b/autotests/adblocktest.cpp index 9bcac640b..7f24a86bb 100644 --- a/autotests/adblocktest.cpp +++ b/autotests/adblocktest.cpp @@ -107,3 +107,5 @@ void AdBlockTest::parseRegExpFilterTest() QCOMPARE(rule_test.parseRegExpFilter(parsedFilter), result); } + +QTEST_MAIN(AdBlockTest) diff --git a/autotests/cookiestest.cpp b/autotests/cookiestest.cpp index 1d102b83e..4cd66349f 100644 --- a/autotests/cookiestest.cpp +++ b/autotests/cookiestest.cpp @@ -98,3 +98,5 @@ void CookiesTest::listMatchesDomainTest() QCOMPARE(m_cookieJar->listMatchesDomain(list, cookieDomain), result); } + +QTEST_MAIN(CookiesTest) diff --git a/autotests/databaseencryptedpasswordbackendtest.cpp b/autotests/databaseencryptedpasswordbackendtest.cpp new file mode 100644 index 000000000..b93a42f0b --- /dev/null +++ b/autotests/databaseencryptedpasswordbackendtest.cpp @@ -0,0 +1,57 @@ +/* ============================================================ +* Falkon - Qt web browser +* Copyright (C) 2013-2018 David Rosca +* +* 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 3 of the License, or +* (at your option) any later version. +* +* 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 . +* ============================================================ */ +#include "databaseencryptedpasswordbackendtest.h" +#include "aesinterface.h" + +#include +#include +#include + +void DatabaseEncryptedPasswordBackendTest::reloadBackend() +{ + delete m_backend; + DatabaseEncryptedPasswordBackend* backend = new DatabaseEncryptedPasswordBackend; + + if (m_testMasterPassword.isEmpty()) { + m_testMasterPassword = AesInterface::passwordToHash(QString::fromUtf8(AesInterface::createRandomData(8))); + backend->updateSampleData(m_testMasterPassword); + } + + // a trick for setting masterPassword without gui interactions + backend->isPasswordVerified(m_testMasterPassword); + backend->setAskMasterPasswordState(false); + + m_backend = backend; +} + +void DatabaseEncryptedPasswordBackendTest::init() +{ + QSqlDatabase db = QSqlDatabase::database(); + if (!db.isValid()) { + db = QSqlDatabase::addDatabase("QSQLITE"); + db.setDatabaseName(":memory:"); + } + db.open(); +} + +void DatabaseEncryptedPasswordBackendTest::cleanup() +{ + QSqlDatabase::removeDatabase(QSqlDatabase::database().databaseName()); +} + +QTEST_MAIN(DatabaseEncryptedPasswordBackendTest) diff --git a/autotests/databaseencryptedpasswordbackendtest.h b/autotests/databaseencryptedpasswordbackendtest.h new file mode 100644 index 000000000..2095daca9 --- /dev/null +++ b/autotests/databaseencryptedpasswordbackendtest.h @@ -0,0 +1,34 @@ +/* ============================================================ +* Falkon - Qt web browser +* Copyright (C) 2013-2018 David Rosca +* +* 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 3 of the License, or +* (at your option) any later version. +* +* 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 . +* ============================================================ */ +#pragma once + +#include "passwordbackendtest.h" +#include "passwordbackends/databaseencryptedpasswordbackend.h" + +class DatabaseEncryptedPasswordBackendTest : public PasswordBackendTest +{ + Q_OBJECT + +private: + QByteArray m_testMasterPassword; + +protected: + void reloadBackend(); + void init(); + void cleanup(); +}; diff --git a/autotests/databasepasswordbackendtest.cpp b/autotests/databasepasswordbackendtest.cpp new file mode 100644 index 000000000..89e3fa4d9 --- /dev/null +++ b/autotests/databasepasswordbackendtest.cpp @@ -0,0 +1,45 @@ +/* ============================================================ +* Falkon - Qt web browser +* Copyright (C) 2013-2018 David Rosca +* +* 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 3 of the License, or +* (at your option) any later version. +* +* 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 . +* ============================================================ */ +#include "databasepasswordbackendtest.h" + +#include +#include +#include + +void DatabasePasswordBackendTest::reloadBackend() +{ + delete m_backend; + m_backend = new DatabasePasswordBackend; +} + +void DatabasePasswordBackendTest::init() +{ + QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE"); + db.setDatabaseName(":memory:"); + db.open(); + + db.exec("CREATE TABLE autofill (data TEXT, id INTEGER PRIMARY KEY, password TEXT," + "server TEXT, username TEXT, last_used NUMERIC)"); +} + +void DatabasePasswordBackendTest::cleanup() +{ + QSqlDatabase::removeDatabase(QSqlDatabase::database().databaseName()); +} + +QTEST_MAIN(DatabasePasswordBackendTest) diff --git a/autotests/databasepasswordbackendtest.h b/autotests/databasepasswordbackendtest.h new file mode 100644 index 000000000..c083712da --- /dev/null +++ b/autotests/databasepasswordbackendtest.h @@ -0,0 +1,31 @@ +/* ============================================================ +* Falkon - Qt web browser +* Copyright (C) 2013-2018 David Rosca +* +* 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 3 of the License, or +* (at your option) any later version. +* +* 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 . +* ============================================================ */ +#pragma once + +#include "passwordbackendtest.h" +#include "passwordbackends/databasepasswordbackend.h" + +class DatabasePasswordBackendTest : public PasswordBackendTest +{ + Q_OBJECT + +protected: + void reloadBackend(); + void init(); + void cleanup(); +}; diff --git a/autotests/formcompletertest.cpp b/autotests/formcompletertest.cpp deleted file mode 100644 index 80dc17b72..000000000 --- a/autotests/formcompletertest.cpp +++ /dev/null @@ -1,303 +0,0 @@ -/* ============================================================ -* QupZilla - WebKit based browser -* Copyright (C) 2013-2014 David Rosca -* -* 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 3 of the License, or -* (at your option) any later version. -* -* 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 . -* ============================================================ */ -#include "formcompletertest.h" -#include "pageformcompleter.h" - -#include -#include -#include - -void FormCompleterTest::initTestCase() -{ - view = new QWebView(); -} - -void FormCompleterTest::cleanupTestCase() -{ - delete view; -} - -void FormCompleterTest::init() -{ - view->setHtml(QString()); -} - -void FormCompleterTest::completePageTest1() -{ - // Basic test - - QByteArray data = "username=tst_username&password=tst_password"; - - QString html = "
" - "" - "" - "" - "
"; - - completeWithData(html, data); - - QCOMPARE(getElementByIdValue("id1").toString(), QString("tst_username")); - QCOMPARE(getElementByIdValue("id2").toString(), QString("tst_password")); -} - -void FormCompleterTest::completePageTest2() -{ - // Real word test: GMail login - // uses input type=email for username - - QByteArray data = "dsh=-821344601702946291&GALX=pAkf3B9TdCo&timeStmp=&secTok=" - "&_utf8=%E2%98%83&bgresponse=%21A0IjdiuCmhg1wERY2iLkbgozxgIAAAAOUgAAA" - "AcqAMaxqx-r1kXOOzeHkuDrRiOJvacFeSxGJ-pg_KQbwMJk3mBUCoZO2g602Uq4upHsM" - "KVfjKRkuPCC0bVCaglP90VLBN8lqCQ5zLSrczVa-WpBFXlEZsKm5UXasE2ZZUQfDc1MI" - "VQbDUviv7Ap54jx6vlTinen6UlxWW_wAvtLkpSO1hqrWnDSDmvFtbJZX61BlMFoHTPYk" - "ijYnuCWzrHWsfKVI8uigtpClgwBTGovCWzuLrbFhG6txV5SokxdfNhbr3Vv-zO9xCw&E" - "mail=tst_mail%40google.com&&Passwd=pass+%CB%87+word1&signIn=P%+se&Per" - "sistentCookie=yes&rmShown=1"; - - QString html = "
" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "
" - "" - "" - "
" - "" - "" - "" - "
"; - - completeWithData(html, data); - - QCOMPARE(getElementByIdValue("Email").toString(), QString("tst_mail@google.com")); - QCOMPARE(getElementByIdValue("Passwd").toString(), QString::fromUtf8("pass ˇ word1")); -} - -void FormCompleterTest::completePageTest3() -{ - // This test is mainly to test properly decoding special characters - // in post data. - - QByteArray data = "user=%2B%C4%9B%C5%A1S+%CB%87+-+%2520+%2F+aa_&" - "pass=%C3%BD%C5%BE%C4%9B%C5%A1%2B%C3%AD%C3%A1+das+%2B%2F+%5C+%C4%91"; - - QString html = "
" - "" - "" - "" - "
"; - - completeWithData(html, data); - - QCOMPARE(getElementByIdValue("id1").toString(), QString::fromUtf8("+ěšS ˇ - %20 / aa_")); - QCOMPARE(getElementByIdValue("id2").toString(), QString::fromUtf8("ýžěš+íá das +/ \\ đ")); -} - -void FormCompleterTest::extractFormTest1() -{ - // Basic test - - QByteArray data = "username=tst_username&password=tst_password"; - - QString html = "
" - "" - "" - "" - "
"; - - PageFormData form = extractFormData(html, data); - - QVERIFY(form.isValid() == true); - QCOMPARE(form.username, QString("tst_username")); - QCOMPARE(form.password, QString("tst_password")); -} - -void FormCompleterTest::extractFormTest2() -{ - // Test special characters (even in input name) - - QByteArray data = "use%C2%B6+_nam%C4%8D=%2B%C4%9B+%2B%2B+%C3%A9%C3%AD%C2%A7%60%5D%7C%7E%C4%9111+%2B%21%3A" - "&pA+%5DsQ+%2Bword=%2B%C4%9B%C5%A1+asn%7E%C4%91%C2%B0%23%26%23+%7C%E2%82%AC"; - - QString html = QString::fromUtf8("
" - "" - "" - "" - "
"); - - PageFormData form = extractFormData(html, data); - - QVERIFY(form.isValid() == true); - QCOMPARE(form.username, QString::fromUtf8("+ě ++ éí§`]|~đ11 +!:")); - QCOMPARE(form.password, QString::fromUtf8("+ěš asn~đ°#&# |€")); -} - -void FormCompleterTest::extractFormTest3() -{ - // Test detecting sent form between 2 identical forms - // but only one form is filled with correct data - - QByteArray data = "username=tst_username&password=tst_password"; - - QString html = "
" - "" - "" - "" - "
"; - - QString html2 = "
" - "" - "" - "" - "
"; - - PageFormData form = extractFormData(html + html2, data); - - QVERIFY(form.isValid() == true); - QCOMPARE(form.username, QString("tst_username")); - QCOMPARE(form.password, QString("tst_password")); -} - -void FormCompleterTest::extractFormTest4() -{ - // Test extracting form that contains only password - // as editable input - - QByteArray data = "username=tst_username&password=tst_password"; - - QString html = "
" - "" - "" - "" - "
"; - - PageFormData form = extractFormData(html, data); - - QVERIFY(form.isValid() == true); - QCOMPARE(form.username, QString()); - QCOMPARE(form.password, QString("tst_password")); -} - -void FormCompleterTest::extractFormTest5() -{ - // Twitter.com : Multiple almost same forms - - QByteArray data = "session%5Busername_or_email%5D=user1&session%5Bpassword%5D=pass&" - "return_to_ssl=true&scribe_log=&redirect_after_login=%2F&" - "authenticity_token=0d37030972c34b021d4a5ebab35817821dc0358b"; - - QString html = "" - "" - - "" - "" - "" - ""; - - PageFormData form = extractFormData(html, data); - - QVERIFY(form.isValid() == true); - QCOMPARE(form.username, QString("user1")); - QCOMPARE(form.password, QString("pass")); -} - -void FormCompleterTest::extractFormTest6() -{ - // Not found form test - - QByteArray data = "username=tst_username&password=tst_password"; - - QString html = "
" - "" - "" - "" - "
"; - - PageFormData form = extractFormData(html, data); - - QVERIFY(form.isValid() == false); -} - -void FormCompleterTest::completeWithData(const QString &html, const QByteArray &data) -{ - view->setHtml(html); - - PageFormCompleter completer; - completer.completeFormData(view->page(), data); -} - -PageFormData FormCompleterTest::extractFormData(const QString &html, const QByteArray &data) -{ - view->setHtml(html); - - PageFormCompleter completer; - return completer.extractFormData(view->page(), data); -} - -QVariant FormCompleterTest::getElementByIdValue(const QString &id) -{ - QString source = QString("document.getElementById('%1').value").arg(id); - return view->page()->mainFrame()->evaluateJavaScript(source); -} diff --git a/autotests/formcompletertest.h b/autotests/formcompletertest.h deleted file mode 100644 index 7fb2f282e..000000000 --- a/autotests/formcompletertest.h +++ /dev/null @@ -1,57 +0,0 @@ -/* ============================================================ -* QupZilla - WebKit based browser -* Copyright (C) 2013-2014 David Rosca -* -* 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 3 of the License, or -* (at your option) any later version. -* -* 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 FORMPAGECOMPLETERTEST_H -#define FORMPAGECOMPLETERTEST_H - -#include -#include - -class QWebView; -struct PageFormData; - -class FormCompleterTest : public QObject -{ - Q_OBJECT - -private slots: - void initTestCase(); - void cleanupTestCase(); - - void init(); - - void completePageTest1(); - void completePageTest2(); - void completePageTest3(); - - void extractFormTest1(); - void extractFormTest2(); - void extractFormTest3(); - void extractFormTest4(); - void extractFormTest5(); - void extractFormTest6(); - -private: - void completeWithData(const QString &html, const QByteArray &data); - PageFormData extractFormData(const QString &html, const QByteArray &data); - QVariant getElementByIdValue(const QString &id); - - QWebView *view; - -}; - -#endif // FORMPAGECOMPLETERTEST_H diff --git a/autotests/main.cpp b/autotests/main.cpp deleted file mode 100644 index 3d0bc65ee..000000000 --- a/autotests/main.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* ============================================================ -* QupZilla - Qt web browser -* Copyright (C) 2013-2017 David Rosca -* -* 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 3 of the License, or -* (at your option) any later version. -* -* 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 . -* ============================================================ */ -#include "qztoolstest.h" -#include "cookiestest.h" -#include "adblocktest.h" -#include "updatertest.h" -#include "passwordbackendtest.h" - -#include - -#define RUN_TEST(X) \ - { \ - X t; \ - int r = QTest::qExec(&t, argc, argv); \ - if (r != 0) return 1; \ - } - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - QTEST_DISABLE_KEYPAD_NAVIGATION; - - RUN_TEST(QzToolsTest) -// RUN_TEST(CookiesTest) - RUN_TEST(AdBlockTest) - RUN_TEST(UpdaterTest) - - RUN_TEST(DatabasePasswordBackendTest) - RUN_TEST(DatabaseEncryptedPasswordBackendTest) - -#ifdef HAVE_KDE_PASSWORDS_PLUGIN - RUN_TEST(KWalletPasswordBackendTest) -#endif - -#ifdef HAVE_GNOME_PASSWORDS_PLUGIN - RUN_TEST(GnomeKeyringPasswordBackendTest) -#endif - - return 0; -} diff --git a/autotests/passwordbackendtest.cpp b/autotests/passwordbackendtest.cpp index ae6840b84..a8b001343 100644 --- a/autotests/passwordbackendtest.cpp +++ b/autotests/passwordbackendtest.cpp @@ -1,6 +1,6 @@ /* ============================================================ -* QupZilla - WebKit based browser -* Copyright (C) 2013-2014 David Rosca +* Falkon - Qt web browser +* Copyright (C) 2013-2018 David Rosca * * 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 @@ -16,14 +16,9 @@ * along with this program. If not, see . * ============================================================ */ #include "passwordbackendtest.h" -#include "aesinterface.h" #include -#include -#include #include -#include -#include #ifdef Q_OS_WIN #include "qt_windows.h" @@ -215,59 +210,3 @@ void PasswordBackendTest::updateLastUsedTest() reloadBackend(); QCOMPARE(m_backend->getAllEntries().count(), 0); } - - -// DatabasePasswordBackendTest -void DatabasePasswordBackendTest::reloadBackend() -{ - delete m_backend; - m_backend = new DatabasePasswordBackend; -} - -void DatabasePasswordBackendTest::init() -{ - QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE"); - db.setDatabaseName(":memory:"); - db.open(); - - db.exec("CREATE TABLE autofill (data TEXT, id INTEGER PRIMARY KEY, password TEXT," - "server TEXT, username TEXT, last_used NUMERIC)"); -} - -void DatabasePasswordBackendTest::cleanup() -{ - QSqlDatabase::removeDatabase(QSqlDatabase::database().databaseName()); -} - -// DatabaseEncryptedPasswordBackendTest -void DatabaseEncryptedPasswordBackendTest::reloadBackend() -{ - delete m_backend; - DatabaseEncryptedPasswordBackend* backend = new DatabaseEncryptedPasswordBackend; - - if (m_testMasterPassword.isEmpty()) { - m_testMasterPassword = AesInterface::passwordToHash(QString::fromUtf8(AesInterface::createRandomData(8))); - backend->updateSampleData(m_testMasterPassword); - } - - // a trick for setting masterPassword without gui interactions - backend->isPasswordVerified(m_testMasterPassword); - backend->setAskMasterPasswordState(false); - - m_backend = backend; -} - -void DatabaseEncryptedPasswordBackendTest::init() -{ - QSqlDatabase db = QSqlDatabase::database(); - if (!db.isValid()) { - db = QSqlDatabase::addDatabase("QSQLITE"); - db.setDatabaseName(":memory:"); - } - db.open(); -} - -void DatabaseEncryptedPasswordBackendTest::cleanup() -{ - QSqlDatabase::removeDatabase(QSqlDatabase::database().databaseName()); -} diff --git a/autotests/passwordbackendtest.h b/autotests/passwordbackendtest.h index b972130cd..7eddb15dc 100644 --- a/autotests/passwordbackendtest.h +++ b/autotests/passwordbackendtest.h @@ -1,6 +1,6 @@ /* ============================================================ -* QupZilla - WebKit based browser -* Copyright (C) 2013-2014 David Rosca +* Falkon - Qt web browser +* Copyright (C) 2013-2018 David Rosca * * 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 @@ -15,8 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ -#ifndef PASSWORDBACKENDTEST_H -#define PASSWORDBACKENDTEST_H +#pragma once #include #include @@ -47,32 +46,3 @@ protected: PasswordBackend* m_backend; QVector m_entries; }; - -#include "passwordbackends/databasepasswordbackend.h" - -class DatabasePasswordBackendTest : public PasswordBackendTest -{ - Q_OBJECT - -protected: - void reloadBackend(); - void init(); - void cleanup(); -}; - -#include "passwordbackends/databaseencryptedpasswordbackend.h" - -class DatabaseEncryptedPasswordBackendTest : public PasswordBackendTest -{ - Q_OBJECT - -private: - QByteArray m_testMasterPassword; - -protected: - void reloadBackend(); - void init(); - void cleanup(); -}; - -#endif // PASSWORDBACKENDTEST_H diff --git a/autotests/qztoolstest.cpp b/autotests/qztoolstest.cpp index 52d908e88..289baa573 100644 --- a/autotests/qztoolstest.cpp +++ b/autotests/qztoolstest.cpp @@ -275,3 +275,5 @@ QString QzToolsTest::createPath(const char *file) const { return m_tmpPath + QL1S("/") + file; } + +QTEST_MAIN(QzToolsTest) diff --git a/autotests/updatertest.cpp b/autotests/updatertest.cpp index 7120c1bb6..9de171773 100644 --- a/autotests/updatertest.cpp +++ b/autotests/updatertest.cpp @@ -91,3 +91,5 @@ void UpdaterTest::compareVersionsTest() QCOMPARE(v1 > v2, more); QCOMPARE(v1 == v2, equal); } + +QTEST_MAIN(UpdaterTest)