[Libreoffice-commits] core.git: sc/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Mon Sep 13 14:24:44 UTC 2021
sc/qa/extras/macros-test.cxx | 29 +++++++++++++++++++++++++++++
sc/qa/extras/testdocuments/tdf144085.ods |binary
2 files changed, 29 insertions(+)
New commits:
commit ded2c1eee423235bc26ff4ab467988ab286e59d4
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Mon Sep 13 13:17:05 2021 +0200
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Mon Sep 13 16:24:09 2021 +0200
tdf#144085: sc_macros_test: Add unittest
Change-Id: I8f5d8fa6efebaeb686baca280c7b9850a6192aad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122031
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index 885c7d351f6e..50eba8cbc7b6 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -65,6 +65,7 @@ public:
void testTdf105558();
void testTdf90278();
void testTdf143582();
+ void testTdf144085();
void testMacroButtonFormControlXlsxExport();
CPPUNIT_TEST_SUITE(ScMacrosTest);
@@ -92,6 +93,7 @@ public:
CPPUNIT_TEST(testTdf105558);
CPPUNIT_TEST(testTdf90278);
CPPUNIT_TEST(testTdf143582);
+ CPPUNIT_TEST(testTdf144085);
CPPUNIT_TEST(testMacroButtonFormControlXlsxExport);
CPPUNIT_TEST_SUITE_END();
@@ -1024,6 +1026,33 @@ void ScMacrosTest::testTdf143582()
xCloseable->close(true);
}
+void ScMacrosTest::testTdf144085()
+{
+ OUString aFileName;
+ createFileURL(u"tdf144085.ods", aFileName);
+ auto xComponent = loadFromDesktop(aFileName, "com.sun.star.sheet.SpreadsheetDocument");
+
+ css::uno::Any aRet;
+ css::uno::Sequence<css::uno::Any> aParams;
+ css::uno::Sequence<css::uno::Any> aOutParam;
+ css::uno::Sequence<sal_Int16> aOutParamIndex;
+
+ SfxObjectShell::CallXScript(
+ xComponent,
+ "vnd.sun.Star.script:Standard.Module1.TestScriptInvoke?language=Basic&location=document",
+ aParams, aRet, aOutParamIndex, aOutParam);
+
+ OUString aReturnValue;
+ aRet >>= aReturnValue;
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: $Sheet1.$B$5:$E$17
+ // - Actual : $Sheet1.$B$5:$C$10
+ CPPUNIT_ASSERT_EQUAL(OUString("$Sheet1.$B$5:$E$17"), aReturnValue);
+
+ css::uno::Reference<css::util::XCloseable> xCloseable(xComponent, css::uno::UNO_QUERY_THROW);
+ xCloseable->close(true);
+}
void ScMacrosTest::testTdf138646()
{
OUString aFileName;
diff --git a/sc/qa/extras/testdocuments/tdf144085.ods b/sc/qa/extras/testdocuments/tdf144085.ods
new file mode 100644
index 000000000000..2493695768b5
Binary files /dev/null and b/sc/qa/extras/testdocuments/tdf144085.ods differ
More information about the Libreoffice-commits
mailing list