tst_QMetaEnum: add round-trip testing to valueToKeys()
... adding a bit of test coverage of keysToValue(). This is not intended as a reproducer for QTBUG-118240, because that is concerned with inputs valueToKeys() cannot produce. Task-number: QTBUG-118240 Pick-to: 6.5 6.2 5.15 Change-Id: I5d772be4231717cdbb5d033b1f11ae31e4c57c0b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 38994ab9accc9aecf1139eb02f7e5fc75fccceec) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
4dcab758b5
commit
bd242a7d2d
@ -73,6 +73,9 @@ void tst_QMetaEnum::valuesToKeys()
|
||||
|
||||
QMetaEnum me = QMetaEnum::fromType<Qt::WindowFlags>();
|
||||
QCOMPARE(me.valueToKeys(windowFlags), expected);
|
||||
bool ok = false;
|
||||
QCOMPARE(uint(me.keysToValue(expected, &ok)), windowFlags.toInt());
|
||||
QVERIFY(ok);
|
||||
}
|
||||
|
||||
void tst_QMetaEnum::defaultConstructed()
|
||||
|
Loading…
x
Reference in New Issue
Block a user