Merge branch 'text-event-tests'

Improve and extend wxTextCtrl unit tests.

See https://github.com/wxWidgets/wxWidgets/pull/996
This commit is contained in:
Vadim Zeitlin
2018-10-31 02:26:50 +01:00
2 changed files with 7 additions and 13 deletions

View File

@@ -65,19 +65,9 @@ private:
// Now switch to the multi-line text controls.
CPPUNIT_TEST( PseudoTestSwitchToMultiLineStyle );
// Rerun some of the tests above. Notice that not all of them pass, so
// we can't just use wxTEXT_ENTRY_TESTS() here. For some of them it's
// normal, e.g. Hint() test isn't supposed to work for multi-line
// controls. Others, such as InsertionPoint() and TextChangeEvents()
// don't pass neither but this could be a bug.
CPPUNIT_TEST( SetValue );
CPPUNIT_TEST( Selection );
CPPUNIT_TEST( InsertionPoint );
CPPUNIT_TEST( Replace );
WXUISIM_TEST( Editable );
CPPUNIT_TEST( CopyPaste );
CPPUNIT_TEST( UndoRedo );
// Rerun the text entry tests not specific to single line controls for
// multiline ones now.
wxTEXT_ENTRY_TESTS();
SINGLE_AND_MULTI_TESTS();

View File

@@ -83,6 +83,10 @@ void TextEntryTestCase::TextChangeEvents()
entry->Clear();
CPPUNIT_ASSERT_EQUAL( 1, updated.GetCount() );
updated.Clear();
entry->ChangeValue("");
CPPUNIT_ASSERT_EQUAL( 0, updated.GetCount() );
updated.Clear();
}
void TextEntryTestCase::CheckStringSelection(const char *sel)