Details
-
Task
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.10.0
-
None
Description
The output is currently misleading as apparently a formatter for Q_ENUM is used which only works when the QFlags value is set to one flag and otherwise prints <null>.
********* Start testing of QCompareTest ********* Config: Using QtTest library 5.11.0, Qt 5.11.0 (x86_64-little_endian-lp64 shared (dynamic) debug build; by GCC 7.2.0) PASS : QCompareTest::initTestCase() QDEBUG : QCompareTest::test_imh(pass) qt.core.logging: Loading "/etc/xdg/QtProject/qtlogging.ini" ... QWARN : QCompareTest::test_imh(pass) QFlags<Qt::InputMethodHint>(ImhHiddenText) QFlags<Qt::InputMethodHint>(ImhHiddenText) PASS : QCompareTest::test_imh(pass) QWARN : QCompareTest::test_imh(fail1-<null>-output) QFlags<Qt::InputMethodHint>(ImhHiddenText) QFlags<Qt::InputMethodHint>(ImhHiddenText|ImhMultiLine) FAIL! : QCompareTest::test_imh(fail1-<null>-output) Compared values are not the same Actual (im1): ImhHiddenText Expected (im2): <null> Loc: [../comtest/tst_comparetest.cpp(45)] QWARN : QCompareTest::test_imh(fail2-no-output) QFlags<Qt::InputMethodHint>(ImhHiddenText|ImhSensitiveData|ImhNoAutoUppercase|ImhNoPredictiveText) QFlags<Qt::InputMethodHint>(ImhHiddenText|ImhSensitiveData|ImhNoAutoUppercase|ImhNoPredictiveText|ImhMultiLine) FAIL! : QCompareTest::test_imh(fail2-no-output) Compared values are not the same Loc: [../comtest/tst_comparetest.cpp(45)] QWARN : QCompareTest::test_wf(pass) QFlags<Qt::WindowType>(Window|WindowSystemMenuHint|WindowStaysOnBottomHint) QFlags<Qt::WindowType>(Window|WindowSystemMenuHint|WindowStaysOnBottomHint) PASS : QCompareTest::test_wf(pass) QWARN : QCompareTest::test_wf(fail) QFlags<Qt::WindowType>(Window|WindowSystemMenuHint|WindowStaysOnBottomHint) QFlags<Qt::WindowType>(Window|FramelessWindowHint|WindowSystemMenuHint|WindowStaysOnBottomHint) FAIL! : QCompareTest::test_wf(fail) Compared values are not the same Loc: [../comtest/tst_comparetest.cpp(71)] QWARN : QCompareTest::test_wf(fail) QFlags<Qt::WindowType>(Window) QFlags<Qt::WindowType>(Window|FramelessWindowHint) FAIL! : QCompareTest::test_wf(fail) Compared values are not the same Actual (wf1): Window Expected (wf2): <null> Loc: [../comtest/tst_comparetest.cpp(71)] PASS : QCompareTest::cleanupTestCase() Totals: 4 passed, 4 failed, 0 skipped, 0 blacklisted, 2ms ********* Finished testing of QCompareTest *********
See "Output registered enumeration names in QCOMPARE." d0f64542c8e6ec272d3fa19cf25ffe7ac33a99bc https://codereview.qt-project.org/#/c/113893/
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-65845 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
217222,8 | QTestlib: Add formatting for QFlags<> | dev | qt/qtbase | Status: MERGED | -2 | 0 |
219345,8 | QTestlib/selftests: Refactor comparison | dev | qt/qtbase | Status: MERGED | -2 | 0 |
219378,3 | QTestlib/selftests: Add expected_crashes_4.txt for boot2qt | dev | qt/qtbase | Status: MERGED | +2 | 0 |
219382,2 | WIP: WIP: test fmt for QFlags with new crashes text | dev | qt/qtbase | Status: ABANDONED | -2 | 0 |