From 8fc4c449d32b1c0f153951a7a467892d77e4534e Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Mon, 12 Apr 2021 18:27:44 +0200 Subject: [PATCH] Added DECLARE_QDEBUG_OP_FOR_ENUM --- test/cpputilstestutils.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/cpputilstestutils.h b/test/cpputilstestutils.h index 2a4299d..a4da67c 100644 --- a/test/cpputilstestutils.h +++ b/test/cpputilstestutils.h @@ -5,6 +5,14 @@ Q_DECLARE_METATYPE(std::string) +#define DECLARE_QDEBUG_OP_FOR_ENUM(Namespace, EnumName) \ + QDebug operator<<(QDebug debug, EnumName val) \ + { \ + QDebugStateSaver saver(debug); \ + debug.nospace() << #EnumName "(" << Namespace toString(val).c_str() << ')'; \ + return debug; \ + } + // only needed if there is a nameclash between std::string *::toString(const T &) and template char *QTest::toString(const T &) #define FIXEDCOMPARE(actual, expected) \ do {\