diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-11-09 09:58:56 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-01-22 12:11:39 +0100 |
commit | db942d61252ee909c480629d4900ef155e158712 (patch) | |
tree | 0a6b4e34b67a72f32557e3ff56b44376a0fc6847 /src/testlib/qtestresult_p.h | |
parent | cbdf2ba46aed53d002b90d4d9683c28306f8e0a9 (diff) |
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/qtestresult_p.h')
-rw-r--r-- | src/testlib/qtestresult_p.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/testlib/qtestresult_p.h b/src/testlib/qtestresult_p.h index 38a3024a0f..4da66885df 100644 --- a/src/testlib/qtestresult_p.h +++ b/src/testlib/qtestresult_p.h @@ -94,6 +94,12 @@ public: int val1, int val2, const char *actual, const char *expected, const char *file, int line); +#if QT_POINTER_SIZE == 8 + static bool compare(bool success, const char *failureMsg, + qsizetype val1, qsizetype val2, + const char *actual, const char *expected, + const char *file, int line); +#endif static bool compare(bool success, const char *failureMsg, unsigned val1, unsigned val2, const char *actual, const char *expected, |