qt5base-lts/tests/auto/corelib/io/qsettings
Edward Welbourne 2b16997116 Clean up tst_QSettings::testVariantTypes()
Give the macro and its parameters clearer names, wrap the macro body
in do {...} while (0), use QCOMPARE() rather than QVERIFY()ing
comparisons, convert the result type to QMetaType::Type rather than
QVariant's deprecated equivalent, save one macro parameter by using
decltype() on another. Simplify one check by pulling out a common
sub-expression as a local variable.

In the process, give the settings keys meaningful names rather than
just "key" with a numeric suffix.

Ideally this test would be reworked to be data-driven, instead of
using macros, but the use of qvariant_cast<> to convert a read-back
value, along with the variable type of the input value compared to the
result of that cast, precludes this (as far as I can see).

Change-Id: I4e083cd0dea14d723910873829352e15740006bd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-26 15:10:15 +02:00
..
.gitattributes Remove two unused resource files from tst_qsettings 2022-04-26 15:10:15 +02:00
.gitignore
bom.ini
CMakeLists.txt Remove two unused resource files from tst_qsettings 2022-04-26 15:10:15 +02:00
float.ini QSettings: Add support for QMetaType::Float 2021-01-15 18:51:15 +01:00
qt5settings.ini QSettings: support reading UTF-8 keys in INI files 2022-03-02 11:13:33 +01:00
resourcefile2.ini
resourcefile3.ini
resourcefile6.plist
resourcefile.ini
tst_qsettings.cpp Clean up tst_QSettings::testVariantTypes() 2022-04-26 15:10:15 +02:00
utf8settings.ini QSettings: support reading UTF-8 keys in INI files 2022-03-02 11:13:33 +01:00
withcomments.ini Fix QSettings parsing of spaces after comment lines 2018-12-07 18:53:34 +00:00