Priority: Not Evaluated
Affects Version/s: None
Fix Version/s: None
Component/s: Testing: qtestlib
QVERIFY and QCOMPARE macros can only be used in functions returning void; In more complex test cases a test might want to use these macros also in non void functions.
See for example this test: https://codereview.qt-project.org/#/c/153336/22/tests/auto/qx11info/tst_qx11info.cpp
It would be nice if we could set arbitrary "exit functions" for macros , e.g. "return;" (default), "return false", "close()" (as in QWindow);
This missing feature becomes more important now with an introduction of lambdas in C++: In the same example code, instead of writing :
It would be cleaner just to add QFAIL macro there, that calls QWindow::close();
This would need to be looked at properly, maybe there are better alternatives to macros.
|For Gerrit Dashboard: QTBUG-62354|
|139744,8||WIP: Testlib: Add class for delayed formatting of the values||dev||qt/qtbase||Status: ABANDONED||-2||0|
|205562,1||IP: Testlib: Add class for delayed formatting of the values||dev||qt/qtbase||Status: ABANDONED||0||0|