summaryrefslogtreecommitdiff
path: root/tests/common/printQtTypes.h
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2021-07-14 11:49:10 +1200
committerJedidiah Barber <contact@jedbarber.id.au>2021-07-14 11:49:10 +1200
commitd24f813f3f2a05c112e803e4256b53535895fc98 (patch)
tree601e6ae9a1cd44bcfdcf91739a5ca36aedd827c9 /tests/common/printQtTypes.h
Initial mirror commitHEADmaster
Diffstat (limited to 'tests/common/printQtTypes.h')
-rw-r--r--tests/common/printQtTypes.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/common/printQtTypes.h b/tests/common/printQtTypes.h
new file mode 100644
index 0000000..20c23d6
--- /dev/null
+++ b/tests/common/printQtTypes.h
@@ -0,0 +1,23 @@
+#ifndef PRINT_QT_TYPES_H
+#define PRINT_QT_TYPES_H
+
+#include <iostream>
+#include <QtCore>
+#include <vector>
+
+using std::ostream;
+using std::vector;
+
+void PrintTo(const QString& str, ::std::ostream* os);
+void PrintTo(const QStringList& list, ::std::ostream* os);
+
+#define ASSERT_EQ_QSTR(x, y) ASSERT_EQ(x, y) << "\"" << x.toStdString() << "\"" << \
+ " != " << "\"" << y.toStdString() << "\"";
+
+#define ASSERT_EQ_QSTRLIST(x, y) ASSERT_EQ(x, y) << "(" << x.join(", ").toStdString() << ")" << \
+ " != " << "(" << y.join(", ").toStdString() << ")";
+
+void PrintTo(const QDateTime& time, ::std::ostream* os);
+void PrintTo(const QByteArray& array, ::std::ostream* os);
+
+#endif