Files
wxWidgets/tests/asserthelper.cpp
T
Vadim Zeitlin ac6b47dae4 Remove wx/catch_cppunit.h, no longer used by anything
Now that none of the tests use the CppUnit compatibility macros any more,
this header can be removed entirely.

Move the pieces still needed by the tests, i.e. wxINFO_FMT(),
WX_ASSERT_MESSAGE(), WX_ASSERT_EQUAL_MESSAGE() and the Catch::StringMaker
specializations for wxString and wxUniChar[Ref], to tests/testprec.h.

wxGetCurrentTestName() is now implemented using Catch itself instead of the
strings set by the CppUnit macros, which means that it finally returns the
correct name for all the tests and not just the CppUnit-style ones.

Assisted-by: Claude Opus 5
2026-08-24 18:46:44 +02:00

50 lines
1.1 KiB
C++

///////////////////////////////////////////////////////////////////////////////
// Name: tests/asserthelper.cpp
// Purpose: Helper functions for the unit tests
// 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)
: wxString::FromAscii("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;
}