From 602b4a6863592af4b10c0141b6ce711c82d74425 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 30 Oct 2018 01:34:27 +0100 Subject: [PATCH 1/2] Run all wxTextEntry unit tests for wxTextCtrl too Comment stated that InsertionPoint() didn't pass, but it was actually already running (and passing) and the only excluded test was the TextChangeEvents() one which really should pass for multiline controls as well, so run it too. --- tests/controls/textctrltest.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/tests/controls/textctrltest.cpp b/tests/controls/textctrltest.cpp index 753890f85c..7d594ca77a 100644 --- a/tests/controls/textctrltest.cpp +++ b/tests/controls/textctrltest.cpp @@ -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(); From f3c148cd4adb3c4c5983549bdd44bafc5c851678 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 30 Oct 2018 01:35:32 +0100 Subject: [PATCH 2/2] Verify that wxTextCtrl::ChangeValue("") doesn't generate events Check that changing the value of an already empty control to empty doesn't result in any events. See #18264. --- tests/controls/textentrytest.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/controls/textentrytest.cpp b/tests/controls/textentrytest.cpp index 96b121de84..5ae7c53179 100644 --- a/tests/controls/textentrytest.cpp +++ b/tests/controls/textentrytest.cpp @@ -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)