[Libreoffice-commits] core.git: sc/qa
Kohei Yoshida
kohei.yoshida at collabora.com
Sun Feb 9 19:13:42 PST 2014
sc/qa/unit/ucalc.cxx | 14 ++++++++++++++
1 file changed, 14 insertions(+)
New commits:
commit 863f1bfca71a5eb084931b49393fb7a9c5a0deaf
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Sun Feb 9 22:17:59 2014 -0500
fdo#74323: Test the undo and redo as well.
Change-Id: I5ed921290fc3f98ecd268b606c0f7ccbf9016c39
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 5ae240f..fc539d9 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -5486,6 +5486,20 @@ void Test::testTransliterateText()
CPPUNIT_ASSERT_EQUAL(OUString("NOAH"), m_pDoc->GetString(ScAddress(0,1,0)));
CPPUNIT_ASSERT_EQUAL(OUString("OSCAR"), m_pDoc->GetString(ScAddress(0,2,0)));
+ // Test the undo and redo.
+ SfxUndoManager* pUndoMgr = m_pDoc->GetUndoManager();
+ CPPUNIT_ASSERT_MESSAGE("Failed to get undo manager.", pUndoMgr);
+
+ pUndoMgr->Undo();
+ CPPUNIT_ASSERT_EQUAL(OUString("Mike"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("Noah"), m_pDoc->GetString(ScAddress(0,1,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("Oscar"), m_pDoc->GetString(ScAddress(0,2,0)));
+
+ pUndoMgr->Redo();
+ CPPUNIT_ASSERT_EQUAL(OUString("MIKE"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("NOAH"), m_pDoc->GetString(ScAddress(0,1,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("OSCAR"), m_pDoc->GetString(ScAddress(0,2,0)));
+
m_pDoc->DeleteTab(0);
}
More information about the Libreoffice-commits
mailing list