sc/qa/unit/ucalc_formula2.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
New commits: commit 5eca134cf91307f0e7ffc89e9074b37d26fcac99 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Mon Aug 7 17:06:00 2023 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Aug 7 20:53:06 2023 +0200 tdf#127334: sc_ucalc_formula2: Add unittest Change-Id: I61ce8847f0ac571815a02dca6456ce526ae711d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155428 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/qa/unit/ucalc_formula2.cxx b/sc/qa/unit/ucalc_formula2.cxx index 87f858ff4dc9..14f0001f943d 100644 --- a/sc/qa/unit/ucalc_formula2.cxx +++ b/sc/qa/unit/ucalc_formula2.cxx @@ -3754,6 +3754,22 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testTdf132519) m_pDoc->DeleteTab(0); } +CPPUNIT_TEST_FIXTURE(TestFormula2, testTdf127334) +{ + CPPUNIT_ASSERT(m_pDoc->InsertTab(0, "Sheet1")); + + m_pDoc->SetString( + 0, 0, 0, + "= (((DATE(2019;9;17) + TIME(0;0;1)) - DATE(2019;9;17)) - TIME(0;0;1))/TIME(0;0;1)"); + + // Without the fix in place, this test would have failed with + // - Expected: 0 + // - Actual : 2.32e-07 + CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(0, 0, 0)); + + m_pDoc->DeleteTab(0); +} + CPPUNIT_TEST_FIXTURE(TestFormula2, testTdf100818) { CPPUNIT_ASSERT(m_pDoc->InsertTab(0, "Sheet1"));