#endif
#include "wx/colour.h"
-
-// ----------------------------------------------------------------------------
-// helper functions
-// ----------------------------------------------------------------------------
-
-namespace
-{
- // by default colour components values are output incorrectly because they
- // are unsigned chars, define a small helper struct which formats them in
- // a more useful way
- struct ColourChannel
- {
- ColourChannel(unsigned char value) : m_value(value) { }
-
- unsigned char m_value;
- };
-
- std::ostream& operator<<(std::ostream& os, const ColourChannel& cc)
- {
- os.width(2);
- os.fill('0');
- os << static_cast<int>(cc.m_value);
- return os;
- }
-} // anonymous namespace
-
-// this operator is needed to use CPPUNIT_ASSERT_EQUAL with wxColour objects
-std::ostream& operator<<(std::ostream& os, const wxColour& c)
-{
- os << std::hex << std::noshowbase
- << "("
- << ColourChannel(c.Red()) << ", "
- << ColourChannel(c.Green()) << ", "
- << ColourChannel(c.Blue());
-
- if ( const unsigned char a = c.Alpha() )
- {
- os << ", " << ColourChannel(a);
- }
-
- os << ")";
-
- return os;
-}
+#include "asserthelper.h"
// ----------------------------------------------------------------------------
// test class