Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-65845

QTestlib: Add formatting for QFlags<> of enumerations in QCOMPARE (registered/unregistered)

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.10.0
    • Testing: qtestlib
    • 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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kleint Friedemann Kleint
            kleint Friedemann Kleint
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes