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:
Vadim Zeitlin
2026-08-06 22:15:55 +02:00
parent 8d8967a29a
commit fe360d4d01
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -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;
}
+3
View File
@@ -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;
}