qt6-bb10/tests/auto/corelib/time
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
..
qcalendar Add QCalendar::matchCenturyToWeekday() 2023-12-08 11:40:36 +01:00
qdate Introduce macros to simplify testing comparison 2024-01-19 12:58:57 +00:00
qdatetime Introduce macros to simplify testing comparison 2024-01-19 12:58:57 +00:00
qdatetimeparser Use localized time-zone abbreviations or offset 2023-10-27 10:52:48 +02:00
qtime Introduce macros to simplify testing comparison 2024-01-19 12:58:57 +00:00
qtimezone Introduce macros to simplify testing comparison 2024-01-19 12:58:57 +00:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00