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

QTRY_COMPARE() doesn't use QCOMPARE()'s customised comparisons

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.4
    • Testing: qtestlib
    • None
    • All

    Description

      QTRY_COMPARE_WITH_TIMEOUT()'s definition tests QTRY_IMPL((expr) == (expected), timeout) using the == operator in the loop instead of the QTest::qCompare() overloads that QCOMPARE() uses to determine whether values are equal. After the QTRY_IMPL(), the macro does go on to do an actual QCOMPARE(), so the right results get reported, but it's possible the QTRY_IMPL() loop will spin until the end of the full timeout after the QTest::qCompare() comparison would have reported success, due to values being "suitably equal" despite not being operator==() equal.

      Unfortunately fixing this would be somewhat non-trivial.

      Attachments

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

        Activity

          People

            macadder Jason McDonald
            Eddy Edward Welbourne
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes