/* antimicrox Gamepad to KB+M event mapper * Copyright (C) 2015 Travis Nickles * Copyright (C) 2020 Jagoda Górska * Copyright (C) 2020 Paweł Kotiuk * * 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 "aboutdialog.h" #include #include #include #include class TestAboutDialog: public QObject { Q_OBJECT public: TestAboutDialog(QObject* parent = 0); private slots: void testVersion(); void infoTextBrowserEmpty(); void changelogPlainEmpty(); void textBrowserDevsEmpty(); void licenseInfoEmpty(); void creditsInfoEmpty(); private: AboutDialog aboutDialog; }; TestAboutDialog::TestAboutDialog(QObject* parent) : QObject(parent), aboutDialog() { QTestEventLoop::instance().enterLoop(1); } void TestAboutDialog::infoTextBrowserEmpty() { QTextBrowser* infoTextBrowser = aboutDialog.findChild("infoTextBrowser"); QVERIFY2(!infoTextBrowser->toPlainText().isEmpty(), "infoTextBrowser is empty"); } void TestAboutDialog::changelogPlainEmpty() { QPlainTextEdit* changelogText = aboutDialog.findChild("changelogText"); QVERIFY2(!changelogText->toPlainText().isEmpty(), "changelogText is empty"); } void TestAboutDialog::textBrowserDevsEmpty() { QPlainTextEdit* developersInfo = aboutDialog.findChild("plainTextEdit"); QVERIFY2(!developersInfo->toPlainText().isEmpty(), "plainTextEdit for info about developers is empty"); } void TestAboutDialog::licenseInfoEmpty() { QTextBrowser* licenseInfo = aboutDialog.findChild("textBrowser_2"); QVERIFY2(!licenseInfo->toPlainText().isEmpty(), "textBrowser_2 about license information is empty"); } void TestAboutDialog::creditsInfoEmpty() { QTextBrowser* creditsInfo = aboutDialog.findChild("textBrowser"); QVERIFY2(!creditsInfo->toPlainText().isEmpty(), "textBrowser about credits is empty"); } void TestAboutDialog::testVersion() { QLabel* versionLabel = aboutDialog.findChild("versionLabel"); QCOMPARE(versionLabel->text(), QString("2.25")); } QTEST_MAIN(TestAboutDialog) #include "testaboutdialog.moc"