From bca775edaa22f383f319aae72799b6cb61bce48c Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Fri, 23 Dec 2011 15:35:32 +1000 Subject: [PATCH] Improve QSettings autotest QTestLib-based autotests cannot perform verification steps in the test class constructor. This needs to be done in initTestCase() instead. Change-Id: Ib1f7f838f052fa0fc5104603bdac01ffd8313aef Reviewed-by: Thiago Macieira --- tests/auto/corelib/io/qsettings/tst_qsettings.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp index 2c96339..58e0b4f 100644 --- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp +++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp @@ -73,10 +73,8 @@ class tst_QSettings : public QObject { Q_OBJECT -public: - tst_QSettings(); - public slots: + void initTestCase(); void init(); void cleanup(); private slots: @@ -270,7 +268,7 @@ static void populateWithFormats() QTest::newRow("custom2") << QSettings::CustomFormat2; } -tst_QSettings::tst_QSettings() +void tst_QSettings::initTestCase() { QSettings::Format custom1 = QSettings::registerFormat("custom1", readCustom1File, writeCustom1File); QSettings::Format custom2 = QSettings::registerFormat("custom2", readCustom2File, writeCustom2File -- 2.7.4