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.
This commit is contained in:
Vadim Zeitlin 2017-01-03 02:39:57 +01:00
parent c15d804197
commit 4b4c572d5f

View File

@ -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
}