mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-08-17 00:47:34 +08:00
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.
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const wxColour& c)
|
||||
{
|
||||
os << c.GetAsString(wxC2S_HTML_SYNTAX);
|
||||
os << (c.IsOk() ? c.GetAsString(wxC2S_HTML_SYNTAX) : "invalid");
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
@@ -34,6 +34,9 @@ public:
|
||||
|
||||
bool match(const wxColour& c) const override
|
||||
{
|
||||
if ( !c.IsOk() )
|
||||
return false;
|
||||
|
||||
return c.Red() == m_red && c.Green() == m_green && c.Blue() == m_blue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user