]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/graphics/colour.cpp
Have wxPropertyGrid inherit from wxControl and wxScrollHelper instead of wxScrolledWi...
[wxWidgets.git] / tests / graphics / colour.cpp
index 0269e6bc1b37b9a41ff7a788a5747606b4278a92..2f0691940991a98d20181b283c911d2e3b79400b 100644 (file)
 #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