Fix initial value returned from wxRichTextCtrl::IsModified()
A just created control shouldn't be considered modified, so reset its modified state in Create(). And add a unit test checking that IsModified() really behaves as expected. Closes https://github.com/wxWidgets/wxWidgets/pull/1652
This commit is contained in:
committed by
Vadim Zeitlin
parent
33da780ecf
commit
68de1b2acf
@@ -34,6 +34,7 @@ public:
|
||||
|
||||
private:
|
||||
CPPUNIT_TEST_SUITE( RichTextCtrlTestCase );
|
||||
CPPUNIT_TEST( IsModified );
|
||||
WXUISIM_TEST( CharacterEvent );
|
||||
WXUISIM_TEST( DeleteEvent );
|
||||
WXUISIM_TEST( ReturnEvent );
|
||||
@@ -64,6 +65,7 @@ private:
|
||||
CPPUNIT_TEST( Table );
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
void IsModified();
|
||||
void CharacterEvent();
|
||||
void DeleteEvent();
|
||||
void ReturnEvent();
|
||||
@@ -115,6 +117,13 @@ void RichTextCtrlTestCase::tearDown()
|
||||
wxDELETE(m_rich);
|
||||
}
|
||||
|
||||
void RichTextCtrlTestCase::IsModified()
|
||||
{
|
||||
CPPUNIT_ASSERT_EQUAL( false, m_rich->IsModified() );
|
||||
m_rich->WriteText("abcdef");
|
||||
CPPUNIT_ASSERT_EQUAL( true, m_rich->IsModified() );
|
||||
}
|
||||
|
||||
void RichTextCtrlTestCase::CharacterEvent()
|
||||
{
|
||||
#if wxUSE_UIACTIONSIMULATOR
|
||||
|
Reference in New Issue
Block a user