From cfb12091ca902148773d2d7a29140849ef112b9b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 17 Jul 2019 22:15:03 +0200 Subject: [PATCH] Skip wxTextCtrl::HitTest() unit test failing under Xvfb For some reason, wxTextCtrl scrolls much too far when running under Xvfb, so the test assumption that it still has some visible characters after calling SetInsertionPointEnd() fails and must be disabled in this environment. --- tests/controls/textctrltest.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/controls/textctrltest.cpp b/tests/controls/textctrltest.cpp index 75fb647c48..f24bed5c89 100644 --- a/tests/controls/textctrltest.cpp +++ b/tests/controls/textctrltest.cpp @@ -377,8 +377,21 @@ void TextCtrlTestCase::HitTestSingleLine() // wxGTK must be given an opportunity to lay the text out. wxYield(); - REQUIRE( m_text->HitTest(wxPoint(2*sizeChar.x, yMid), &pos) == wxTE_HT_ON_TEXT ); - CHECK( pos > 3 ); + // For some reason, this test consistently fails when running under + // Xvfb. Debugging shows that the text gets scrolled too far, instead + // of scrolling by ~156 characters, leaving the remaining 44 shown, in + // normal runs, it gets scrolled by all 200 characters, leaving nothing + // shown. It's not clear why does it happen, and there doesn't seem + // anything we can do about it. + if ( IsRunningUnderXVFB() ) + { + WARN("Skipping test known to fail under Xvfb"); + } + else + { + REQUIRE( m_text->HitTest(wxPoint(2*sizeChar.x, yMid), &pos) == wxTE_HT_ON_TEXT ); + CHECK( pos > 3 ); + } } #endif }