From d9abe7f2f9fdf31c7c9756d78601022f6a2462dc Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 28 Apr 2012 22:25:01 +0000 Subject: [PATCH] Run some wxTextCtrl unit test cases for single and multi-line controls. Some of the tests that were previously ran for single or multi-line controls only actually apply to both of them, so run them for both kinds of control to test that both of them work correctly. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71307 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- tests/controls/textctrltest.cpp | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/tests/controls/textctrltest.cpp b/tests/controls/textctrltest.cpp index 970dbb5a5c..61dd87347c 100644 --- a/tests/controls/textctrltest.cpp +++ b/tests/controls/textctrltest.cpp @@ -49,13 +49,36 @@ private: virtual wxTextEntry *GetTestEntry() const { return m_text; } virtual wxWindow *GetTestWindow() const { return m_text; } + #define SINGLE_AND_MULTI_TESTS() \ + WXUISIM_TEST( ReadOnly ); \ + CPPUNIT_TEST( StreamInput ); \ + CPPUNIT_TEST( Redirector ) + CPPUNIT_TEST_SUITE( TextCtrlTestCase ); + // These tests run for single line text controls. wxTEXT_ENTRY_TESTS(); - WXUISIM_TEST( ReadOnly ); WXUISIM_TEST( MaxLength ); - CPPUNIT_TEST( StreamInput ); - CPPUNIT_TEST( Redirector ); + SINGLE_AND_MULTI_TESTS(); + + // 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( Replace ); + WXUISIM_TEST( Editable ); + CPPUNIT_TEST( CopyPaste ); + CPPUNIT_TEST( UndoRedo ); + + SINGLE_AND_MULTI_TESTS(); + + + // All tests from now on are for multi-line controls only. CPPUNIT_TEST( MultiLineReplace ); //WXUISIM_TEST( ProcessEnter ); WXUISIM_TEST( Url ); -- 2.47.2