From 8634808a6cd65a1b19b9c5b9a6618b36b2e82acb Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 17 Jul 2019 15:18:56 +0200 Subject: [PATCH] Make wxRadioButton focus test MSW-specific This test doesn't need to, and actually does not, pass under wxGTK, where a radio button can have focus without being selected, unlike in wxMSW. --- tests/controls/radiobuttontest.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/controls/radiobuttontest.cpp b/tests/controls/radiobuttontest.cpp index 88a53d9438..104b5c98b4 100644 --- a/tests/controls/radiobuttontest.cpp +++ b/tests/controls/radiobuttontest.cpp @@ -248,7 +248,15 @@ TEST_CASE("wxRadioButton::Focus", "[radiobutton][focus]") // And giving the focus to the panel shouldn't change radio button // selection. radioPanel->SetFocus(); + + // Under MSW, focus is always on the selected button, but in the other + // ports this is not necessarily the case, i.e. under wxGTK this check + // would fail because focus gets set to the first button -- even though the + // second one remains checked. +#ifdef __WXMSW__ CHECK_FOCUS_IS(radio2); +#endif + CHECK(!radio1->GetValue()); CHECK(radio2->GetValue()); }