summaryrefslogtreecommitdiff
path: root/tests/auto/webchannel/tst_webchannel.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/webchannel/tst_webchannel.h')
-rw-r--r--tests/auto/webchannel/tst_webchannel.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/webchannel/tst_webchannel.h b/tests/auto/webchannel/tst_webchannel.h
index 9344fdc..290457f 100644
--- a/tests/auto/webchannel/tst_webchannel.h
+++ b/tests/auto/webchannel/tst_webchannel.h
@@ -15,6 +15,7 @@
#if QT_CONFIG(future)
#include <QFuture>
#endif
+#include <QtDebug>
#include <QtWebChannel/QWebChannelAbstractTransport>
@@ -26,7 +27,21 @@ struct TestStruct
{}
int foo;
int bar;
+
+ operator QString() const {
+ return QStringLiteral("TestStruct(foo=%1, bar=%2)").arg(foo).arg(bar);
+ }
};
+inline bool operator==(const TestStruct &a, const TestStruct &b)
+{
+ return a.foo == b.foo && a.bar == b.bar;
+}
+inline QDebug operator<<(QDebug &dbg, const TestStruct &ts)
+{
+ QDebugStateSaver dbgState(dbg);
+ dbg.noquote() << static_cast<QString>(ts);
+ return dbg;
+}
Q_DECLARE_METATYPE(TestStruct)
using TestStructVector = std::vector<TestStruct>;
Q_DECLARE_METATYPE(TestStructVector)