From 64e33727bb846c11b350e20ef00ec25688bddf27 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Tue, 1 Feb 2022 16:53:56 +0100 Subject: [PATCH] QPlainTestLogger: code tidies Remove a couple of unnecessary string literals that only coped with an impossible situation (default return after a switch that cover all the enumerators). Add a Q_UNREACHABLE() for good measure. Change-Id: I8065218554edf98408d9c0823b8c301932681c59 Reviewed-by: Marc Mutz Reviewed-by: Edward Welbourne --- src/testlib/qplaintestlogger.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp index d6da0ce2c4..9b4f535890 100644 --- a/src/testlib/qplaintestlogger.cpp +++ b/src/testlib/qplaintestlogger.cpp @@ -96,7 +96,8 @@ namespace QTest { case QAbstractTestLogger::BlacklistedXFail: return "BXFAIL "; } - return "??????"; + Q_UNREACHABLE(); + return nullptr; } static const char *benchmarkResult2String() @@ -122,7 +123,8 @@ namespace QTest { case QAbstractTestLogger::Warn: return "WARNING"; } - return "??????"; + Q_UNREACHABLE(); + return nullptr; } template