From 4b4c572d5f01c59b7f93204dbf442464d0350d8d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 3 Jan 2017 02:39:57 +0100 Subject: [PATCH] Make wxTextCtrl Lines() unit test more robust Verify that the last logical line was wrapped at least once, not exactly once, as it could be wrapped more times depending on the font size. --- tests/controls/textctrltest.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/controls/textctrltest.cpp b/tests/controls/textctrltest.cpp index 761b38d561..742de53535 100644 --- a/tests/controls/textctrltest.cpp +++ b/tests/controls/textctrltest.cpp @@ -496,7 +496,8 @@ void TextCtrlTestCase::Lines() CPPUNIT_ASSERT_EQUAL(0, m_text->GetLineLength(3)); CPPUNIT_ASSERT_EQUAL("", m_text->GetLineText(3)); - // Verify that wrapped lines count as 2 lines. + // Verify that wrapped lines count as (at least) lines (but it can be more + // if it's wrapped more than once). // // This currently doesn't work neither in wxGTK, wxUniv, or wxOSX/Cocoa, see // #12366, where GetNumberOfLines() always returns the number of logical, @@ -505,7 +506,7 @@ void TextCtrlTestCase::Lines() #if defined(__WXGTK__) || defined(__WXOSX_COCOA__) || defined(__WXUNIVERSAL__) CPPUNIT_ASSERT_EQUAL(6, m_text->GetNumberOfLines()); #else - CPPUNIT_ASSERT_EQUAL(7, m_text->GetNumberOfLines()); + CPPUNIT_ASSERT(m_text->GetNumberOfLines() > 6); #endif }