summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-12-07 09:52:33 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-12-07 09:54:02 +0100
commite6304affe916ed7e310da7b348f7d2ff166718f5 (patch)
tree93badba551d91fa95189bd0b84149bf97ba58c7b /sc/qa
parent4cfca1b859bfb6b2dbe18d79a46f689fc6dbfbab (diff)
add test case for fdo#86754
Change-Id: I0f57c1124e62d8946b68c614e3ff09d26b569e77
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/ucalc.cxx30
-rw-r--r--sc/qa/unit/ucalc.hxx2
2 files changed, 32 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index d7d8cdbad2b5..d2c66bbbe2b0 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -4487,6 +4487,36 @@ void Test::testAutoFill()
m_pDoc->DeleteTab(0);
}
+void Test::testAutoFillSimple()
+{
+ m_pDoc->InsertTab(0, "test");
+
+ m_pDoc->SetValue(0, 0, 0, 1);
+ m_pDoc->SetString(0, 1, 0, "=10");
+
+ ScMarkData aMarkData;
+ aMarkData.SelectTable(0, true);
+
+ m_pDoc->Fill( 0, 0, 0, 1, NULL, aMarkData, 6, FILL_TO_BOTTOM, FILL_AUTO);
+
+ for(SCROW nRow = 0; nRow < 8; ++nRow)
+ {
+ if (nRow % 2 == 0)
+ {
+ double nVal = m_pDoc->GetValue(0, nRow, 0);
+ CPPUNIT_ASSERT_EQUAL(double((nRow+2)/2), nVal);
+ }
+ else
+ {
+ OString aMsg = OString("wrong value in row: ") + OString::number(nRow);
+ double nVal = m_pDoc->GetValue(0, nRow, 0);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), 10.0, nVal);
+ }
+ }
+
+ m_pDoc->DeleteTab(0);
+}
+
void Test::testCopyPasteFormulas()
{
m_pDoc->InsertTab(0, "Sheet1");
diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx
index ed35ca1dac7c..9ab1199a3dad 100644
--- a/sc/qa/unit/ucalc.hxx
+++ b/sc/qa/unit/ucalc.hxx
@@ -360,6 +360,7 @@ public:
void testRenameTable();
void testAutoFill();
+ void testAutoFillSimple();
void testCopyPasteFormulas();
void testCopyPasteFormulasExternalDoc();
@@ -564,6 +565,7 @@ public:
CPPUNIT_TEST(testSetBackgroundColor);
CPPUNIT_TEST(testRenameTable);
CPPUNIT_TEST(testAutoFill);
+ CPPUNIT_TEST(testAutoFillSimple);
CPPUNIT_TEST(testCopyPasteFormulas);
CPPUNIT_TEST(testCopyPasteFormulasExternalDoc);
CPPUNIT_TEST(testFindAreaPosVertical);