diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-02-25 17:53:02 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-03-02 15:38:27 +0000 |
commit | ea3a7aaf2bf0e0e067423a7e19c457a4f26516cc (patch) | |
tree | fa5fd03bed8b33a7d3244f15cff5116e8fad1188 /src/testlib/qtest.h | |
parent | 586fd9e0345c2066746805d6725abfd15805f3bc (diff) |
QTest: fix QCOMPARE with QT_TYPESAFE_FLAGS
Amends 631a0cc45cbe70940746cd944d325d7d3bab8c15.
Pick-to: 6.3
Fixes: QTBUG-101299
Change-Id: Ib17e405de4db9fb592aba4ea842d3768a95cad74
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/testlib/qtest.h')
-rw-r--r-- | src/testlib/qtest.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/testlib/qtest.h b/src/testlib/qtest.h index 7fd205ba2d..eb7c2c3412 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<> |