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>
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index a72fb32..afbe5b8 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);
}