[Libreoffice-commits] core.git: sc/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jun 11 08:14:32 UTC 2020
sc/qa/unit/uicalc/data/tdf132431.ods |binary
sc/qa/unit/uicalc/uicalc.cxx | 22 ++++++++++++++++++++++
2 files changed, 22 insertions(+)
New commits:
commit 399f1f8e2458e672c6f78ad8775b4c73aece0e73
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Wed Jun 10 14:42:16 2020 +0200
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Thu Jun 11 10:13:56 2020 +0200
tdf#132431: sc: Add unittest
Change-Id: I4ecae9e29827a29680c9f082a9602fc181b0b56e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96024
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/sc/qa/unit/uicalc/data/tdf132431.ods b/sc/qa/unit/uicalc/data/tdf132431.ods
new file mode 100644
index 000000000000..2022a9db4f47
Binary files /dev/null and b/sc/qa/unit/uicalc/data/tdf132431.ods differ
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index 694644b77df3..46e4b24bf669 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -149,6 +149,28 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf124815)
CPPUNIT_ASSERT_EQUAL(OUString("Rakennukset"), pDoc->GetString(ScAddress(2, 0, 0)));
}
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf132431)
+{
+ ScModelObj* pModelObj = createDoc("tdf132431.ods");
+ ScDocument* pDoc = pModelObj->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+
+ OUString aFormula;
+ pDoc->GetFormula(7, 219, 0, aFormula);
+ CPPUNIT_ASSERT_EQUAL(OUString("=SUMIFS($H$2:$H$198,B$2:B$198,G220)"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(0.0, pDoc->GetValue(ScAddress(7, 219, 0)));
+
+ // Without the fix in place, it would crash here with
+ // uncaught exception of type std::exception (or derived).
+ // - vector::_M_fill_insert
+ pDoc->SetString(ScAddress(7, 219, 0), "=SUMIFS($H$2:$DB$198,B$2:B$198,G220)");
+
+ pDoc->GetFormula(7, 219, 0, aFormula);
+ CPPUNIT_ASSERT_EQUAL(OUString("=SUMIFS($H$2:$DB$198,B$2:B$198,G220)"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(0.0, pDoc->GetValue(ScAddress(7, 219, 0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("Err:502"), pDoc->GetString(ScAddress(7, 219, 0)));
+}
+
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf83901)
{
mxComponent = loadFromDesktop("private:factory/scalc");
More information about the Libreoffice-commits
mailing list