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

As a user of QTestLib, I want to express inequalities the same way as QCOMPARE does for equality

    XMLWordPrintable

Details

    • All
    • 8
    • Team A Foundation Sprint 57, Team A Foundation Sprint 58
    • 343e0ff485 (qt/qtbase/dev) 343e0ff485 (qt/tqtc-qtbase/dev) 343e0ff485 (qt/tqtc-qtbase/6.4)

    Description

      For other unit test frameworks, I'm used to having inequality (!=, <, <=, >, >=) treated as first-class assertions. In QTestLib, however, only equality is a first-class assertion (via QCOMPARE) , everything else must be shoe-horned through QVERIFY. This creates problems for me, because, unlike QCOMPARE, QVERIFY doesn't print the values of the RHS and LHS expressions on failure.

      I suggest to add QCOMPARE_(EQ,NE,LT,GT,LE,GE) to directly express ==, !=, <, >, <=, and >=, resp.

      Yes, QCOMPARE_EQ is then the same as QCOMPARE. Sure me. I like symmetry.

      Attachments

        Issue Links

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

          Activity

            People

              ivan.solovev Ivan Solovev
              mmutz Marc Mutz
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: