]> git.saurik.com Git - wxWidgets.git/blob - tests/asserthelper.cpp
Standardize Project-Id-Version in PO files.
[wxWidgets.git] / tests / asserthelper.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: tests/asserthelper.cpp
3 // Purpose: Helper functions for cppunit
4 // Author: Steven Lamerton
5 // Created: 2010-07-23
6 // Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
7 ///////////////////////////////////////////////////////////////////////////////
8
9 #include "testprec.h"
10
11 #ifdef __BORLANDC__
12 #pragma hdrstop
13 #endif
14
15 #include "asserthelper.h"
16
17 namespace
18 {
19 std::ostream& operator<<(std::ostream& os, const ColourChannel& cc)
20 {
21 os.width(2);
22 os.fill('0');
23 os << static_cast<int>(cc.m_value);
24 return os;
25 }
26 } // anonymous namespace
27
28 std::ostream& operator<<(std::ostream& os, const wxColour& c)
29 {
30 os << std::hex << std::noshowbase
31 << "("
32 << ColourChannel(c.Red()) << ", "
33 << ColourChannel(c.Green()) << ", "
34 << ColourChannel(c.Blue());
35
36 if ( const unsigned char a = c.Alpha() )
37 {
38 os << ", " << ColourChannel(a);
39 }
40
41 os << ")";
42
43 return os;
44 }
45
46 std::ostream& operator<<(std::ostream& os, const wxSize& s)
47 {
48 os << s.x << "x" << s.y;
49
50 return os;
51 }
52
53 std::ostream& operator<<(std::ostream& os, const wxFont& f)
54 {
55 os << f.GetNativeFontInfoUserDesc();
56
57 return os;
58 }
59
60 std::ostream& operator<<(std::ostream& os, const wxPoint& p)
61 {
62 os << "(" << p.x << ", " << p.y << ")";
63
64 return os;
65 }