summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2024-01-03 16:19:09 +0100
committerMarc Mutz <marc.mutz@qt.io>2024-01-19 12:58:57 +0000
commit1353c6f85757ad9d9f77bc754bf16c7fb185df00 (patch)
treebeb14170b330cbfd50826b624676cb430237ccf2 /tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp
parenta73f10aee422bbbee22c63ff1c436cb3193938e6 (diff)
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>
Diffstat (limited to 'tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp')
-rw-r--r--tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp
index c4ba809bb5..f52226e0e8 100644
--- a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp
+++ b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp
@@ -365,7 +365,7 @@ void tst_QTimeZone::compare()
QFETCH(QTimeZone, right);
QFETCH(bool, expectedEqual);
- QTestPrivate::testEqualityOperators(left, right, expectedEqual);
+ QT_TEST_EQUALITY_OPS(left, right, expectedEqual);
}
void tst_QTimeZone::timespec()