mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-10-06 07:00:16 +08:00
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
50 lines
1.1 KiB
C++
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;
|
|
}
|