diff options
Diffstat (limited to 'tests/common/printQtTypes.h')
-rw-r--r-- | tests/common/printQtTypes.h | 23 |
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 |