summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-02-25 17:53:02 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-03-03 02:08:57 +0000
commit5cb7310be850c82643c2ca504634177cce37586c (patch)
treedfc0b43c77c491cc7693d16dd3b063004bfc6f74 /src/testlib
parent844eab73219ee1b4aba8cef982c60c60daf370e8 (diff)
QTest: fix QCOMPARE with QT_TYPESAFE_FLAGS
Amends 631a0cc45cbe70940746cd944d325d7d3bab8c15. Fixes: QTBUG-101299 Change-Id: Ib17e405de4db9fb592aba4ea842d3768a95cad74 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit ea3a7aaf2bf0e0e067423a7e19c457a4f26516cc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qtest.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/testlib/qtest.h b/src/testlib/qtest.h
index 20c80058ac..bae57b146a 100644
--- a/src/testlib/qtest.h
+++ b/src/testlib/qtest.h
@@ -503,14 +503,16 @@ template <typename T>
inline bool qCompare(QFlags<T> const &t1, T const &t2, const char *actual, const char *expected,
const char *file, int line)
{
- return qCompare(int(t1), int(t2), actual, expected, file, line);
+ using Int = typename QFlags<T>::Int;
+ return qCompare(Int(t1), Int(t2), actual, expected, file, line);
}
template <typename T>
inline bool qCompare(QFlags<T> const &t1, int const &t2, const char *actual, const char *expected,
const char *file, int line)
{
- return qCompare(int(t1), t2, actual, expected, file, line);
+ using Int = typename QFlags<T>::Int;
+ return qCompare(Int(t1), Int(t2), actual, expected, file, line);
}
template<>