summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2023-07-06 17:47:08 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2023-07-06 21:12:52 +0200
commitfaadaa111d0c4025af5cffb8c8dbd084040f7217 (patch)
tree8bf0a0fa3cb0fe41d5c893608906674b8403d926 /sc
parente751d59264c369cfc342dab5f0759be12341d306 (diff)
tdf#153517: sc_ucalc: Add unittest
Change-Id: Idaa8bd4e0d6e34b0f45faa1ab49b46c5fb154475 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154138 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/ucalc.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index a72fb326029c..afbe5b8432a0 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -4581,6 +4581,23 @@ CPPUNIT_TEST_FIXTURE(Test, testAutoFill)
CPPUNIT_ASSERT_EQUAL( OUString("2nd"), m_pDoc->GetString( 0, 1, 0 ) );
CPPUNIT_ASSERT_EQUAL( OUString("3rd"), m_pDoc->GetString( 0, 2, 0 ) );
+ // Clear column A for a new test.
+ clearRange(m_pDoc, ScRange(0,0,0,0,m_pDoc->MaxRow(),0));
+ m_pDoc->SetRowHidden(0, m_pDoc->MaxRow(), 0, false); // Show all rows.
+
+ m_pDoc->SetString( 0, 200, 0, "15:00" );
+ m_pDoc->SetString( 0, 201, 0, "15:20" );
+ m_pDoc->Fill( 0, 200, 0, 201, nullptr, aMarkData, 25, FILL_TO_BOTTOM, FILL_AUTO );
+
+ CPPUNIT_ASSERT_EQUAL( OUString("03:00:00 PM"), m_pDoc->GetString( 0, 200, 0 ) );
+
+ // tdf#153517: Without the fix in place, this test would have failed with
+ // - Expected: 03:20:00 PM
+ // - Actual : 03:19:59 PM
+ CPPUNIT_ASSERT_EQUAL( OUString("03:20:00 PM"), m_pDoc->GetString( 0, 201, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( OUString("03:40:00 PM"), m_pDoc->GetString( 0, 202, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( OUString("04:00:00 PM"), m_pDoc->GetString( 0, 203, 0 ) );
+
m_pDoc->DeleteTab(0);
}