From 26890407699b000102bc63d4148e7c39dcebe8d6 Mon Sep 17 00:00:00 2001 From: ali kettab Date: Tue, 23 Feb 2021 10:38:24 +0100 Subject: [PATCH] Remove unnecessary hack from ListBaseTestCase under wxGTK The tests pass without it now, so simplify the test code added in fedc80eee3 (Improve selection and focus events generation in wxGenericLisCtrl, 2020-09-06). Closes https://github.com/wxWidgets/wxWidgets/pull/2249 --- tests/controls/listbasetest.cpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/tests/controls/listbasetest.cpp b/tests/controls/listbasetest.cpp index 92fd8cebee..4c9131414c 100644 --- a/tests/controls/listbasetest.cpp +++ b/tests/controls/listbasetest.cpp @@ -175,14 +175,6 @@ void ListBaseTestCase::ChangeMode() CPPUNIT_ASSERT_EQUAL( "First", list->GetItemText(0) ); } -#ifdef __WXGTK__ - #define wxGTK_TIMED_YIELD(t) \ - if ( !IsRunningUnderXVFB() ) \ - for ( wxStopWatch sw; sw.Time() < t; ) wxYield() -#else // !__WXGTK__ - #define wxGTK_TIMED_YIELD(t) -#endif // __WXGTK__ - void ListBaseTestCase::MultiSelect() { #if wxUSE_UIACTIONSIMULATOR @@ -219,8 +211,6 @@ void ListBaseTestCase::MultiSelect() sim.MouseClick(); // select the anchor wxYield(); - wxGTK_TIMED_YIELD(50); - list->GetItemRect(5, pos); point = list->ClientToScreen(pos.GetPosition()) + wxPoint(10, 10); @@ -232,8 +222,6 @@ void ListBaseTestCase::MultiSelect() sim.KeyUp(WXK_SHIFT); wxYield(); - wxGTK_TIMED_YIELD(10); - // when the first item was selected the focus changes to it, but not // on subsequent clicks CPPUNIT_ASSERT_EQUAL(4, list->GetSelectedItemCount()); // item 2 to 5 (inclusive) are selected @@ -248,8 +236,6 @@ void ListBaseTestCase::MultiSelect() sim.Char(WXK_END, wxMOD_SHIFT); // extend the selection to the last item wxYield(); - wxGTK_TIMED_YIELD(10); - CPPUNIT_ASSERT_EQUAL(8, list->GetSelectedItemCount()); // item 2 to 9 (inclusive) are selected CPPUNIT_ASSERT_EQUAL(1, focused.GetCount()); // focus is on the last item CPPUNIT_ASSERT_EQUAL(4, selected.GetCount()); // only newly selected items got the event @@ -262,8 +248,6 @@ void ListBaseTestCase::MultiSelect() sim.Char(WXK_HOME, wxMOD_SHIFT); // select from anchor to the first item wxYield(); - wxGTK_TIMED_YIELD(10); - CPPUNIT_ASSERT_EQUAL(3, list->GetSelectedItemCount()); // item 0 to 2 (inclusive) are selected CPPUNIT_ASSERT_EQUAL(1, focused.GetCount()); // focus is on item 0 CPPUNIT_ASSERT_EQUAL(2, selected.GetCount()); // events are only generated for item 0 and 1