[Libreoffice-commits] .: 2 commits - sc/qa
Markus Mohrhard
mmohrhard at kemper.freedesktop.org
Sun Apr 22 17:20:54 PDT 2012
sc/qa/unit/ucalc.cxx | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
New commits:
commit 7d65dd728ca2b7dea073ef085110dccdf22c2d5c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 23 02:18:14 2012 +0200
add test case for copy/paste formulas, related fdo#48482
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 07782da..9542320 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -209,6 +209,7 @@ public:
void testRenameTable();
void testAutoFill();
+ void testCopyPasteFormulas();
CPPUNIT_TEST_SUITE(Test);
CPPUNIT_TEST(testCollator);
@@ -249,6 +250,7 @@ public:
CPPUNIT_TEST(testSetBackgroundColor);
CPPUNIT_TEST(testRenameTable);
CPPUNIT_TEST(testAutoFill);
+ CPPUNIT_TEST(testCopyPasteFormulas);
CPPUNIT_TEST_SUITE_END();
private:
@@ -4221,6 +4223,25 @@ void Test::testAutoFill()
m_pDoc->DeleteTab(0);
}
+void Test::testCopyPasteFormulas()
+{
+ m_pDoc->InsertTab(0, "Sheet1");
+ m_pDoc->InsertTab(1, "Sheet2");
+
+ m_pDoc->SetString(0,0,0, "=COLUMN($A$1)");
+ m_pDoc->SetInTest();
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(m_pDoc->GetValue(0,0,0), 1.0, 1e-08);
+ ScDocFunc& rDocFunc = m_xDocShRef->GetDocFunc();
+ bool bMoveDone = rDocFunc.MoveBlock(ScRange(0,0,0), ScAddress( 10, 10, 0), false, false, false, true);
+
+ // check that moving was succesful, mainly for editable tester
+ CPPUNIT_ASSERT(bMoveDone);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(m_pDoc->GetValue(10,10,0), 1.0, 1e-8);
+ rtl::OUString aFormula;
+ m_pDoc->GetFormula(10,10,0, aFormula);
+ CPPUNIT_ASSERT_EQUAL(aFormula, rtl::OUString("=COLUMN($A$1)"));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
}
commit 0d3d836ec6541b7a1e0a7fa48195ebb678e2951e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 23 01:34:47 2012 +0200
I did not want to disable these tests
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index c743e68..07782da 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -211,7 +211,6 @@ public:
void testAutoFill();
CPPUNIT_TEST_SUITE(Test);
-#if 0
CPPUNIT_TEST(testCollator);
CPPUNIT_TEST(testInput);
CPPUNIT_TEST(testCellFunctions);
@@ -249,7 +248,6 @@ public:
CPPUNIT_TEST(testJumpToPrecedentsDependents);
CPPUNIT_TEST(testSetBackgroundColor);
CPPUNIT_TEST(testRenameTable);
-#endif
CPPUNIT_TEST(testAutoFill);
CPPUNIT_TEST_SUITE_END();
More information about the Libreoffice-commits
mailing list