summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestcase.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/testlib/qtestcase.h')
-rw-r--r--src/testlib/qtestcase.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h
index 3fe6d2d867..b046232c65 100644
--- a/src/testlib/qtestcase.h
+++ b/src/testlib/qtestcase.h
@@ -297,6 +297,7 @@ namespace QTest
Q_TESTLIB_EXPORT char *toString(const char *);
Q_TESTLIB_EXPORT char *toString(const volatile void *);
Q_TESTLIB_EXPORT char *toString(const void *); // ### FIXME: Qt 7: Remove
+ Q_TESTLIB_EXPORT char *toString(const volatile QObject *);
Q_TESTLIB_EXPORT void qInit(QObject *testObject, int argc = 0, char **argv = nullptr);
Q_TESTLIB_EXPORT int qRun();
@@ -421,6 +422,27 @@ namespace QTest
toString(t1), toString(t2), actual, expected, file, line);
}
+ inline bool compare_ptr_helper(const volatile QObject *t1, const volatile QObject *t2, const char *actual,
+ const char *expected, const char *file, int line)
+ {
+ return compare_helper(t1 == t2, "Compared QObject pointers are not the same",
+ toString(t1), toString(t2), actual, expected, file, line);
+ }
+
+ inline bool compare_ptr_helper(const volatile QObject *t1, std::nullptr_t, const char *actual,
+ const char *expected, const char *file, int line)
+ {
+ return compare_helper(t1 == nullptr, "Compared QObject pointers are not the same",
+ toString(t1), toString(nullptr), actual, expected, file, line);
+ }
+
+ inline bool compare_ptr_helper(std::nullptr_t, const volatile QObject *t2, const char *actual,
+ const char *expected, const char *file, int line)
+ {
+ return compare_helper(nullptr == t2, "Compared QObject pointers are not the same",
+ toString(nullptr), toString(t2), actual, expected, file, line);
+ }
+
inline bool compare_ptr_helper(const volatile void *t1, std::nullptr_t, const char *actual,
const char *expected, const char *file, int line)
{