tst_qsettings: reliably remove the empty.ini file
... using QScopeGuard. Change-Id: I3693ca5e5ef32aa7ccabaa7e05a94bee69e0910b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
44fa80cbd4
commit
16f695f8a8
@ -2177,6 +2177,8 @@ void tst_QSettings::testEmptyData()
|
||||
vList2 << emptyString << nullString;
|
||||
vList3 << QString("foo");
|
||||
|
||||
const auto rm = QScopeGuard([=] { QFile::remove(filename); });
|
||||
|
||||
{
|
||||
QSettings settings(filename, QSettings::IniFormat);
|
||||
settings.setValue("nullString", nullString);
|
||||
@ -2230,7 +2232,6 @@ void tst_QSettings::testEmptyData()
|
||||
QCOMPARE(settings.value("vList3").toList(), vList3);
|
||||
QCOMPARE(settings.status(), QSettings::NoError);
|
||||
}
|
||||
QFile::remove(filename);
|
||||
}
|
||||
|
||||
void tst_QSettings::testEmptyKey()
|
||||
|
Loading…
Reference in New Issue
Block a user