qt6-bb10/tests/auto/corelib/time/qdate
Ivan Solovev 1353c6f857 Introduce macros to simplify testing comparison
The problem with the QTestPrivate::testAllComparisonOperators() and
QTestPrivate::testEqualityOperators() functions is that if they fail,
they point into the helper function, but not into the actual test that
called the helper function. This is specially annoying when some test
calls the helper function multiple times.

This patch introduces the helper macros QT_TEST_ALL_COMPARISON_OPS and
QT_TEST_EQUALITY_OPS that wrap the respective function calls together
with the QTest::currentTestFailed() check. If the test has failed,
the macro generates a meaningful debug message with the original file
name and line number.

This patch also applies the new macros to qtbase.

Task-number: QTBUG-119433
Pick-to: 6.7
Change-Id: Iad709de45e5bf53c82e7afa8e9f51e9275c1e619
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-01-19 12:58:57 +00:00
..
.gitignore
CMakeLists.txt TestLib: provide helper functions to test relational operators 2023-11-13 16:35:54 +01:00
tst_qdate.cpp Introduce macros to simplify testing comparison 2024-01-19 12:58:57 +00:00