summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-03-12 10:53:25 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-03-12 11:36:41 +0100
commit2fce798d70bb39fe1b1dc95e2661e5836026de1a (patch)
treeb8a366acfab52d56b3367923916f8e929bf17afa /sc
parentc900de3b01ee0f445dd55d529f35ce25df37160a (diff)
tdf#37424: sc_ucalc: Add unittest
Change-Id: Ic7accef0592b5f404661e087a8d72c65820f214f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112375 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/ucalc.cxx27
1 files changed, 27 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index b7e89b71fb94..04fabd9f5414 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -4935,6 +4935,33 @@ void Test::testAutoFill()
CPPUNIT_ASSERT_EQUAL( OUString("2012-10-31"), m_pDoc->GetString( 0, 103, 0 ) );
CPPUNIT_ASSERT_EQUAL( OUString("2012-10-31"), m_pDoc->GetString( 0, 104, 0 ) );
+ // Clear column A for a new test.
+ clearRange(m_pDoc, ScRange(0,0,0,0,MAXROW,0));
+ m_pDoc->SetRowHidden(0, MAXROW, 0, false); // Show all rows.
+
+ m_pDoc->SetString( 0, 50, 0, "1.0" );
+ m_pDoc->SetString( 0, 51, 0, "1.1" );
+ m_pDoc->SetString( 0, 52, 0, "1.2" );
+ m_pDoc->SetString( 0, 53, 0, "1.3" );
+ m_pDoc->Fill( 0, 50, 0, 53, nullptr, aMarkData, 3, FILL_TO_BOTTOM, FILL_AUTO );
+
+ CPPUNIT_ASSERT_EQUAL( OUString("1.4"), m_pDoc->GetString( 0, 54, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( OUString("1.5"), m_pDoc->GetString( 0, 55, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( OUString("1.6"), m_pDoc->GetString( 0, 56, 0 ) );
+
+ m_pDoc->SetString( 0, 60, 0, "4.0" );
+ m_pDoc->SetString( 0, 61, 0, "4.1" );
+ m_pDoc->SetString( 0, 62, 0, "4.2" );
+ m_pDoc->SetString( 0, 63, 0, "4.3" );
+ m_pDoc->Fill( 0, 60, 0, 63, nullptr, aMarkData, 3, FILL_TO_BOTTOM, FILL_AUTO );
+
+ // tdf#37424: Without the fix in place, this test would have failed with
+ // - Expected: 4.4
+ // - Actual : 5
+ CPPUNIT_ASSERT_EQUAL( OUString("4.4"), m_pDoc->GetString( 0, 64, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( OUString("4.5"), m_pDoc->GetString( 0, 65, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( OUString("4.6"), m_pDoc->GetString( 0, 66, 0 ) );
+
m_pDoc->DeleteTab(0);
}