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:
@@ -67,3 +67,11 @@ std::ostream& operator<<(std::ostream& os, const wxPoint& p)
|
|||||||
|
|
||||||
return os;
|
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 wxSize& s);
|
||||||
std::ostream& operator<<(std::ostream& os, const wxFont& f);
|
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 wxPoint& p);
|
||||||
|
std::ostream& operator<<(std::ostream& os, const wxRect& r);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -22,18 +22,7 @@
|
|||||||
|
|
||||||
#include "wx/iosfwrap.h"
|
#include "wx/iosfwrap.h"
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
#include "asserthelper.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;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// test class
|
// test class
|
||||||
|
Reference in New Issue
Block a user