aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2021-01-11 17:44:21 +0100
committerMitch Curtis <mitch.curtis@qt.io>2021-01-13 11:33:04 +0100
commit023a03e9c5d2e714b676df0c89e90f3057be52e4 (patch)
treeb3819ca21d2f701bb21194908da930bea142740f /tests/auto
parenta3e2233e1654dd8eeaa600eb02bc2e24daca5014 (diff)
tst_qquickstyle: don't use test macros in helper functions
They don't do anything outside of the test function. Pick-to: 6.0 Change-Id: Ie66e707c0963bbcaaadbdf6340ef393dd028b303 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qquickstyle/tst_qquickstyle.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/auto/qquickstyle/tst_qquickstyle.cpp b/tests/auto/qquickstyle/tst_qquickstyle.cpp
index 907dbd13..b9497500 100644
--- a/tests/auto/qquickstyle/tst_qquickstyle.cpp
+++ b/tests/auto/qquickstyle/tst_qquickstyle.cpp
@@ -59,7 +59,7 @@ private slots:
void environmentVariables();
private:
- void loadControls();
+ Q_REQUIRED_RESULT bool loadControls();
void unloadControls();
};
@@ -73,7 +73,7 @@ void tst_QQuickStyle::cleanup()
qunsetenv("QT_QUICK_CONTROLS_CONF");
}
-void tst_QQuickStyle::loadControls()
+bool tst_QQuickStyle::loadControls()
{
QQmlEngine engine;
engine.addImportPath(dataDirectory());
@@ -81,7 +81,11 @@ void tst_QQuickStyle::loadControls()
component.setData("import QtQuick; import QtQuick.Controls; Control { }", QUrl());
QScopedPointer<QObject> object(component.create());
- QVERIFY2(!object.isNull(), qPrintable(component.errorString()));
+ if (object.isNull()) {
+ qWarning() << component.errorString();
+ return false;
+ }
+ return true;
}
void tst_QQuickStyle::unloadControls()
@@ -94,7 +98,7 @@ void tst_QQuickStyle::lookup()
QQuickStyle::setStyle("Material");
QCOMPARE(QQuickStyle::name(), QString("Material"));
- loadControls();
+ QVERIFY(loadControls());
// The font size for editors in the (default) Normal variant is 16.
// If this is wrong, the style plugin may not have been loaded.
@@ -147,7 +151,7 @@ void tst_QQuickStyle::commandLineArgument()
{
QGuiApplicationPrivate::styleOverride = "CmdLineArgStyle";
- loadControls();
+ QVERIFY(loadControls());
QCOMPARE(QQuickStyle::name(), QString("CmdLineArgStyle"));
}