[Libreoffice-commits] core.git: sc/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Fri Mar 12 10:37:34 UTC 2021
sc/qa/unit/ucalc.cxx | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
New commits:
commit 2fce798d70bb39fe1b1dc95e2661e5836026de1a
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Fri Mar 12 10:53:25 2021 +0100
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Fri Mar 12 11:36:41 2021 +0100
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 at libreoffice.org>
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);
}
More information about the Libreoffice-commits
mailing list