Details
-
Bug
-
Resolution: Invalid
-
P3: Somewhat important
-
None
-
dev
-
None
Description
In tst_QMetaObject::checkScope():
MyAnotherEnum3 is an enumerator with value "-1"; this test:
QCOMPARE(me2.keyToValue("MyAnotherEnum3", &ok), -1);
only passes due to integer overflow. The enumerators are stored as uint
in the generated code:
uint(MyNamespace::MyClass2::MyAnotherEnum3)
uint(-1) is 4294967295; keyToValue() returns int(4294967295) which overflows and becomes -1 letting the test pass.
I am not sure how this should be fixed; at least it should be documented in QMetaEnum API docs.