From c41969eff2fc0e6c3dd786fa42ffc60dd0bf3943 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 15 May 2023 21:50:31 +0100 Subject: [PATCH] Disable wxHyperlinkCtrl colours test under Wine This doesn't work due to LM_GETITEM not returning the expected result after changing the state using LM_SETITEM under Wine. It could be worked around by remembering whether we changed the colours in our own variable, or maybe just reverted later if Wine fixes this, but for now disable the test. --- tests/controls/hyperlinkctrltest.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/controls/hyperlinkctrltest.cpp b/tests/controls/hyperlinkctrltest.cpp index f17789919a..cbccbf1979 100644 --- a/tests/controls/hyperlinkctrltest.cpp +++ b/tests/controls/hyperlinkctrltest.cpp @@ -48,11 +48,18 @@ TEST_CASE_METHOD(HyperlinkCtrlTestCase, "wxHyperlinkCtrl::Colour", CHECK(m_hyperlink->GetNormalColour().IsOk()); CHECK(m_hyperlink->GetVisitedColour().IsOk()); - // Changing hover colour doesn't work in wxMSW. -#ifndef __WXMSW__ + // Changing hover colour doesn't work in wxMSW and Wine doesn't seem to + // implement either LM_SETITEM or LM_GETITEM correctly, so skip this there. +#ifdef __WXMSW__ + if ( wxIsRunningUnderWine() ) + { + WARN("Skipping testing wxHyperlinkCtrl colours under Wine."); + return; + } +#else // __WXMSW__ m_hyperlink->SetHoverColour(*wxGREEN); CHECK( m_hyperlink->GetHoverColour() == *wxGREEN ); -#endif // !__WXMSW__ +#endif // __WXMSW__/!__WXMSW__ m_hyperlink->SetNormalColour(*wxRED); CHECK( m_hyperlink->GetNormalColour() == *wxRED );