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 <thiago.macieira@intel.com>
This commit is contained in:
Jason McDonald 2011-12-23 15:35:32 +10:00 committed by Qt by Nokia
parent f4c7bbba13
commit bca775edaa

View File

@ -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