Cleanup tst_qdatastream
Make NColorRoles constexpr and use static_assert() to verify that it has a proper size. Pick-to: 6.8 Change-Id: I40351e4815e248fe8cc07e906099172d5be531d0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit f12115e97ca8875a2577eebc67b8c8dc03441996) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
0bd5917b8b
commit
b7ad2f3a9f
@ -276,7 +276,7 @@ private:
|
|||||||
QString m_previousCurrent;
|
QString m_previousCurrent;
|
||||||
};
|
};
|
||||||
|
|
||||||
static int NColorRoles[] = {
|
static constexpr int NColorRoles[] = {
|
||||||
QPalette::NoRole, // No Version
|
QPalette::NoRole, // No Version
|
||||||
QPalette::NoRole, // Qt_1_0
|
QPalette::NoRole, // Qt_1_0
|
||||||
QPalette::HighlightedText + 1, // Qt_2_0
|
QPalette::HighlightedText + 1, // Qt_2_0
|
||||||
@ -300,9 +300,11 @@ static int NColorRoles[] = {
|
|||||||
QPalette::PlaceholderText + 1, // Qt_6_0
|
QPalette::PlaceholderText + 1, // Qt_6_0
|
||||||
QPalette::Accent + 1, // Qt_6_6
|
QPalette::Accent + 1, // Qt_6_6
|
||||||
QPalette::Accent + 1, // Qt_6_7
|
QPalette::Accent + 1, // Qt_6_7
|
||||||
0 // add the correct value for Qt_5_14 here later
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// +1, because we start from "No Version"
|
||||||
|
static_assert(std::size(NColorRoles) == QDataStream::Qt_DefaultCompiledVersion + 1);
|
||||||
|
|
||||||
// Testing get/set functions
|
// Testing get/set functions
|
||||||
void tst_QDataStream::getSetCheck()
|
void tst_QDataStream::getSetCheck()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user