summaryrefslogtreecommitdiff
path: root/src/testlib/qtestcase.h
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-11-09 09:58:56 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-01-22 12:11:39 +0100
commitdb942d61252ee909c480629d4900ef155e158712 (patch)
tree0a6b4e34b67a72f32557e3ff56b44376a0fc6847 /src/testlib/qtestcase.h
parentcbdf2ba46aed53d002b90d4d9683c28306f8e0a9 (diff)
downloadqtbase-db942d61252ee909c480629d4900ef155e158712.tar.gz
QTestlib: Speed up comparison of qsizetype
Add a qCompare() overload for qsizetype, preventing it falling back to the slow code path pre-formatting expected/actual. toString() should use the correct format from the already present int-types (see macro TO_STRING_IMPL). Complements 94aa350621e8a5c4ad3b438c10fc1c0a9ed3bc8a. Task-number: QTBUG-38890 Change-Id: Ieb8cea7de086141a2c80f93b4c1be01572be96df Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/testlib/qtestcase.h')
-rw-r--r--src/testlib/qtestcase.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h
index ced876fcd9..def2ff9da5 100644
--- a/src/testlib/qtestcase.h
+++ b/src/testlib/qtestcase.h
@@ -377,6 +377,11 @@ namespace QTest
Q_TESTLIB_EXPORT bool qCompare(int t1, int t2, const char *actual, const char *expected,
const char *file, int line);
+#if QT_POINTER_SIZE == 8
+ Q_TESTLIB_EXPORT bool qCompare(qsizetype t1, qsizetype t2, const char *actual, const char *expected,
+ const char *file, int line);
+#endif
+
Q_TESTLIB_EXPORT bool qCompare(unsigned t1, unsigned t2, const char *actual, const char *expected,
const char *file, int line);