From c13e28ebfb20048cf02093e209dbed7852a3bacf Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 7 Nov 2017 16:16:08 +0100 Subject: [PATCH] Disable wxTopLevelWindow::IsActive() unit test for wxGTK It just doesn't work in the test, so live without it for now. Also use CHECK() instead of CPPUNIT_ASSERT(), which expands into REQUIRE(), for independent tests to let later tests to still be done even if an earlier one fails. --- tests/toplevel/toplevel.cpp | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/tests/toplevel/toplevel.cpp b/tests/toplevel/toplevel.cpp index 61c52207ed..53ea380960 100644 --- a/tests/toplevel/toplevel.cpp +++ b/tests/toplevel/toplevel.cpp @@ -73,7 +73,7 @@ void TopLevelWindowTestCase::FrameShowTest() void TopLevelWindowTestCase::TopLevelWindowShowTest(wxTopLevelWindow* tlw) { - CPPUNIT_ASSERT(!tlw->IsShown()); + CHECK(!tlw->IsShown()); wxTextCtrl* textCtrl = new wxTextCtrl(tlw, -1, "test"); textCtrl->SetFocus(); @@ -81,19 +81,26 @@ void TopLevelWindowTestCase::TopLevelWindowShowTest(wxTopLevelWindow* tlw) // only run this test on platforms where ShowWithoutActivating is implemented. #if defined(__WXMSW__) || defined(__WXMAC__) tlw->ShowWithoutActivating(); - CPPUNIT_ASSERT(tlw->IsShown()); - CPPUNIT_ASSERT(!tlw->IsActive()); + CHECK(tlw->IsShown()); + CHECK(!tlw->IsActive()); tlw->Hide(); - CPPUNIT_ASSERT(!tlw->IsShown()); - CPPUNIT_ASSERT(!tlw->IsActive()); + CHECK(!tlw->IsShown()); + CHECK(!tlw->IsActive()); #endif tlw->Show(true); - CPPUNIT_ASSERT(tlw->IsActive()); - CPPUNIT_ASSERT(tlw->IsShown()); + + // wxGTK needs many event loop iterations before the TLW becomes active and + // this doesn't happen in this test, so avoid checking for it. +#ifndef __WXGTK__ + CHECK(tlw->IsActive()); +#endif + CHECK(tlw->IsShown()); tlw->Hide(); - CPPUNIT_ASSERT(!tlw->IsShown()); - CPPUNIT_ASSERT(tlw->IsActive()); + CHECK(!tlw->IsShown()); +#ifndef __WXGTK__ + CHECK(tlw->IsActive()); +#endif }