Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
5.0.0
-
None
Description
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.
Attachments
Issue Links
- relates to
-
QTBUG-62354 QVERIFY / QCOMPARE macros could use an upgrade
- Reported