diff options
| author | Edward Welbourne <edward.welbourne@qt.io> | 2022-04-20 14:21:07 +0200 |
|---|---|---|
| committer | Edward Welbourne <edward.welbourne@qt.io> | 2022-04-26 15:10:15 +0200 |
| commit | 2b169971168ed3b2d55ef9199745aef17ab1a1ef (patch) | |
| tree | 06ba57b0452d60b7d2a86ba158bd0a74cc53cbe9 /src/tools/uic/cpp/cppwritedeclaration.cpp | |
| parent | af61bb018f61147dd32024ffd2c80aaf7aa930fd (diff) | |
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>
Diffstat (limited to 'src/tools/uic/cpp/cppwritedeclaration.cpp')
0 files changed, 0 insertions, 0 deletions
