From 789f1a7975f9f4cf5d5f72dee2a468ed6b5d2719 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 14 Jul 2014 19:17:12 +0000 Subject: [PATCH] Replace anonymous namespace with a named one in the test helpers. This should avoid clang warnings about the function in anonymous namespace being unused. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76928 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- tests/asserthelper.cpp | 7 +++++++ tests/asserthelper.h | 7 +++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/asserthelper.cpp b/tests/asserthelper.cpp index 1400f3b71a..8f9f36d452 100644 --- a/tests/asserthelper.cpp +++ b/tests/asserthelper.cpp @@ -14,6 +14,9 @@ #include "asserthelper.h" +namespace wxTestPrivate +{ + std::ostream& operator<<(std::ostream& os, const ColourChannel& cc) { os.width(2); @@ -22,8 +25,12 @@ std::ostream& operator<<(std::ostream& os, const ColourChannel& cc) return os; } +} + std::ostream& operator<<(std::ostream& os, const wxColour& c) { + using wxTestPrivate::ColourChannel; + os << std::hex << std::noshowbase << "(" << ColourChannel(c.Red()) << ", " diff --git a/tests/asserthelper.h b/tests/asserthelper.h index 74ca91242c..ce8c9c6a29 100644 --- a/tests/asserthelper.h +++ b/tests/asserthelper.h @@ -14,7 +14,7 @@ #include "wx/gdicmn.h" #include "wx/font.h" -namespace +namespace wxTestPrivate { // by default colour components values are output incorrectly because they // are unsigned chars, define a small helper struct which formats them in @@ -26,9 +26,8 @@ namespace unsigned char m_value; }; -} // anonymous namespace - -std::ostream& operator<<(std::ostream& os, const ColourChannel& cc); + std::ostream& operator<<(std::ostream& os, const ColourChannel& cc); +} // wxTestPrivate namespace // this operator is needed to use CPPUNIT_ASSERT_EQUAL with wxColour objects std::ostream& operator<<(std::ostream& os, const wxColour& c);