Move operator<<(std::ostream&, wxRect) overload to a header
This will allow reusing it in other tests too. Also make the output slightly more readable by formatting the rectangle as "{x,y w*h}" instead of "{x,y,w,h}". No real changes.
This commit is contained in:
parent
9d2ee59138
commit
12f8ab20f9
@ -67,3 +67,11 @@ std::ostream& operator<<(std::ostream& os, const wxPoint& p)
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const wxRect& r)
|
||||
{
|
||||
os << "{"
|
||||
<< r.x << ", " << r.y << " " << r.width << "*" << r.height
|
||||
<< "}";
|
||||
return os;
|
||||
}
|
||||
|
@ -35,5 +35,6 @@ std::ostream& operator<<(std::ostream& os, const wxColour& c);
|
||||
std::ostream& operator<<(std::ostream& os, const wxSize& s);
|
||||
std::ostream& operator<<(std::ostream& os, const wxFont& f);
|
||||
std::ostream& operator<<(std::ostream& os, const wxPoint& p);
|
||||
std::ostream& operator<<(std::ostream& os, const wxRect& r);
|
||||
|
||||
#endif
|
||||
|
@ -22,18 +22,7 @@
|
||||
|
||||
#include "wx/iosfwrap.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// helper functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// this operator is needed to use CPPUNIT_ASSERT_EQUAL with wxRects
|
||||
std::ostream& operator<<(std::ostream& os, const wxRect& r)
|
||||
{
|
||||
os << "{"
|
||||
<< r.x << ", " << r.y << ", " << r.width << ", " << r.height
|
||||
<< "}";
|
||||
return os;
|
||||
}
|
||||
#include "asserthelper.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// test class
|
||||
|
Loading…
Reference in New Issue
Block a user