Apply clang-format on tests
This commit is contained in:
parent
8df0a87970
commit
777cbb6fc0
|
@ -4,8 +4,8 @@
|
||||||
#include "../widgets/clearspinbox.h"
|
#include "../widgets/clearspinbox.h"
|
||||||
#include "../widgets/iconbutton.h"
|
#include "../widgets/iconbutton.h"
|
||||||
|
|
||||||
#include <QPushButton>
|
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
|
#include <QPushButton>
|
||||||
#include <QtTest/QtTest>
|
#include <QtTest/QtTest>
|
||||||
|
|
||||||
using namespace QtUtilities;
|
using namespace QtUtilities;
|
||||||
|
@ -37,7 +37,8 @@ void ButtonOverlayTests::changeBasicConfiguration(ButtonOverlay &buttonOverlay)
|
||||||
{
|
{
|
||||||
buttonOverlay.setClearButtonEnabled(false);
|
buttonOverlay.setClearButtonEnabled(false);
|
||||||
QVERIFY2(!buttonOverlay.isClearButtonEnabled(), "clear button disabled");
|
QVERIFY2(!buttonOverlay.isClearButtonEnabled(), "clear button disabled");
|
||||||
buttonOverlay.enableInfoButton(QIcon::fromTheme(QStringLiteral("data-information")).pixmap(IconButton::defaultPixmapSize), QStringLiteral("Some info"));
|
buttonOverlay.enableInfoButton(
|
||||||
|
QIcon::fromTheme(QStringLiteral("data-information")).pixmap(IconButton::defaultPixmapSize), QStringLiteral("Some info"));
|
||||||
QVERIFY2(buttonOverlay.isInfoButtonEnabled(), "info button enabled");
|
QVERIFY2(buttonOverlay.isInfoButtonEnabled(), "info button enabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
#include "resources/config.h"
|
#include "resources/config.h"
|
||||||
|
|
||||||
#include <QTest>
|
|
||||||
#include <QSignalSpy>
|
#include <QSignalSpy>
|
||||||
|
#include <QTest>
|
||||||
|
|
||||||
using namespace QtUtilities;
|
using namespace QtUtilities;
|
||||||
|
|
||||||
|
@ -68,12 +68,10 @@ void DBusNotificationTests::semiAutomaticTest()
|
||||||
|
|
||||||
DBusNotification n(QStringLiteral("Semi-automatic test"), NotificationIcon::Information, 10000);
|
DBusNotification n(QStringLiteral("Semi-automatic test"), NotificationIcon::Information, 10000);
|
||||||
QString clickedAction, error;
|
QString clickedAction, error;
|
||||||
const auto actionConnection = connect(&n, &DBusNotification::actionInvoked, [&clickedAction] (const QString &actionName) {
|
const auto actionConnection
|
||||||
clickedAction = actionName;
|
= connect(&n, &DBusNotification::actionInvoked, [&clickedAction](const QString &actionName) { clickedAction = actionName; });
|
||||||
});
|
const auto errorConnection
|
||||||
const auto errorConnection = connect(&n, &DBusNotification::error, [&error] () {
|
= connect(&n, &DBusNotification::error, [&error]() { error = QStringLiteral("error occurred (TODO: pass an error message here)"); });
|
||||||
error = QStringLiteral("error occurred (TODO: pass an error message here)");
|
|
||||||
});
|
|
||||||
n.setApplicationName(QStringLiteral(APP_NAME " tests; " APP_VERSION));
|
n.setApplicationName(QStringLiteral(APP_NAME " tests; " APP_VERSION));
|
||||||
n.show(QStringLiteral("Some message; will append more lines later"));
|
n.show(QStringLiteral("Some message; will append more lines later"));
|
||||||
for (auto i = 1; i <= 10; ++i) {
|
for (auto i = 1; i <= 10; ++i) {
|
||||||
|
@ -83,7 +81,7 @@ void DBusNotificationTests::semiAutomaticTest()
|
||||||
QCOMPARE(error, QString());
|
QCOMPARE(error, QString());
|
||||||
n.setImage(QIcon::fromTheme(QStringLiteral("document-open")).pixmap(64).toImage());
|
n.setImage(QIcon::fromTheme(QStringLiteral("document-open")).pixmap(64).toImage());
|
||||||
n.setTitle(n.title() + QStringLiteral(" - click action to continue"));
|
n.setTitle(n.title() + QStringLiteral(" - click action to continue"));
|
||||||
n.setActions(QStringList({QStringLiteral("fail"), QStringLiteral("Let test fail"), QStringLiteral("pass"), QStringLiteral("Let test pass")}));
|
n.setActions(QStringList({ QStringLiteral("fail"), QStringLiteral("Let test fail"), QStringLiteral("pass"), QStringLiteral("Let test pass") }));
|
||||||
QSignalSpy actionInvokedSpy(&n, &DBusNotification::actionInvoked);
|
QSignalSpy actionInvokedSpy(&n, &DBusNotification::actionInvoked);
|
||||||
n.update(QStringLiteral("Click on \"Let test pass\" to continue within 10 seconds"));
|
n.update(QStringLiteral("Click on \"Let test pass\" to continue within 10 seconds"));
|
||||||
actionInvokedSpy.wait(10000);
|
actionInvokedSpy.wait(10000);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#include "../settingsdialog/settingsdialog.h"
|
|
||||||
#include "../settingsdialog/optioncategory.h"
|
#include "../settingsdialog/optioncategory.h"
|
||||||
#include "../settingsdialog/optioncategorymodel.h"
|
#include "../settingsdialog/optioncategorymodel.h"
|
||||||
#include "../settingsdialog/qtsettings.h"
|
#include "../settingsdialog/qtsettings.h"
|
||||||
|
#include "../settingsdialog/settingsdialog.h"
|
||||||
|
|
||||||
#include <QtTest/QtTest>
|
#include <QtTest/QtTest>
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ void DialogsTests::testSettingsDialog()
|
||||||
settingsDlg.showCategory(nullptr); // ensure no current category is shown anymore
|
settingsDlg.showCategory(nullptr); // ensure no current category is shown anymore
|
||||||
settingsDlg.setSingleCategory(nullptr);
|
settingsDlg.setSingleCategory(nullptr);
|
||||||
auto *const qtCategory = qtSettings.category();
|
auto *const qtCategory = qtSettings.category();
|
||||||
settingsDlg.categoryModel()->setCategories(QList<OptionCategory *>({testCategory, qtCategory}));
|
settingsDlg.categoryModel()->setCategories(QList<OptionCategory *>({ testCategory, qtCategory }));
|
||||||
settingsDlg.showCategory(qtCategory);
|
settingsDlg.showCategory(qtCategory);
|
||||||
settingsDlg.show();
|
settingsDlg.show();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue