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

[autotests] Some tests use QVERIFY and friends outside of test functions

XMLWordPrintable

      Some autotests use QVERIFY, QCOMPARE, etc. outside of test functions (e.g. in helper functions or classes). This will not have the desired effect if a test failure occurs (aborting the test function) because those macros simply set a failure flag and return from the current function. If the call to QVERIFY is in a helper function called from a test function, the failure will cause the helper function to return, but won't cause the calling test function to return also.

      Therefore, tests should only use QVERIFY and friends directly in a test function – helpers should instead return a boolean or some other kind of value that the test function can use in a QVERIFY to report a meaningful failure.

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

            macadder Jason McDonald
            jasmcdon Jason McDonald (Closed Nokia Identity. Please assign to "macadder" instead) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes