Files
wxWidgets/tests/asserthelper.cpp
T
Vadim Zeitlin fe360d4d01 Handle invalid wxColour better in unit test assertions
Show invalid colour as "invalid" instead of "" and don't trigger a wx
assertion when comparing with it.
2026-08-06 22:15:55 +02:00

49 lines
1.1 KiB
C++

///////////////////////////////////////////////////////////////////////////////
// Name: tests/asserthelper.cpp
// Purpose: Helper functions for cppunit
// Author: Steven Lamerton
// Created: 2010-07-23
// Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
///////////////////////////////////////////////////////////////////////////////
#include "testprec.h"
#include "asserthelper.h"
std::ostream& operator<<(std::ostream& os, const wxColour& c)
{
os << (c.IsOk() ? c.GetAsString(wxC2S_HTML_SYNTAX) : "invalid");
return os;
}
std::ostream& operator<<(std::ostream& os, const wxSize& s)
{
os << s.x << "*" << s.y;
return os;
}
std::ostream& operator<<(std::ostream& os, const wxFont& f)
{
os << f.GetNativeFontInfoUserDesc();
return os;
}
std::ostream& operator<<(std::ostream& os, const wxPoint& p)
{
os << "(" << p.x << ", " << p.y << ")";
return os;
}
std::ostream& operator<<(std::ostream& os, const wxRect& r)
{
os << "{"
<< r.x << ", " << r.y << " " << r.width << "*" << r.height
<< "}";
return os;
}