summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-08-04 16:50:39 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-08-04 21:59:38 +0200
commit178e3acd41225d2ba0c1bcca371c34770f1f30db (patch)
tree07e7abd196c535d8dda92ed86d937ea59325671b /sc
parent67e5f16e53a05587c4f36518a56e931f4708e16b (diff)
tdf#128218: sc_macros_test: Add unittest
Change-Id: Id0597de78873dccd7316c406364f1c4c2ae5bb93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100120 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/extras/macros-test.cxx33
-rw-r--r--sc/qa/extras/testdocuments/tdf128218.odsbin0 -> 8232 bytes
2 files changed, 33 insertions, 0 deletions
diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index 7289dcc75888..d158d8c412c5 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -46,6 +46,7 @@ public:
void testTdf107902();
void testTdf131296_legacy();
void testTdf131296_new();
+ void testTdf128218();
CPPUNIT_TEST_SUITE(ScMacrosTest);
CPPUNIT_TEST(testStarBasic);
@@ -60,6 +61,7 @@ public:
CPPUNIT_TEST(testTdf107902);
CPPUNIT_TEST(testTdf131296_legacy);
CPPUNIT_TEST(testTdf131296_new);
+ CPPUNIT_TEST(testTdf128218);
CPPUNIT_TEST_SUITE_END();
};
@@ -705,6 +707,37 @@ void ScMacrosTest::testTdf131296_new()
xCloseable->close(true);
}
+void ScMacrosTest::testTdf128218()
+{
+ OUString aFileName;
+ createFileURL("tdf128218.ods", aFileName);
+ uno::Reference< css::lang::XComponent > xComponent = loadFromDesktop(aFileName, "com.sun.star.sheet.SpreadsheetDocument");
+
+ CPPUNIT_ASSERT_MESSAGE("Failed to load the doc", xComponent.is());
+
+ Any aRet;
+ Sequence< sal_Int16 > aOutParamIndex;
+ Sequence< Any > aOutParam;
+ Sequence< uno::Any > aParams;
+
+ SfxObjectShell::CallXScript(
+ xComponent,
+ "vnd.sun.Star.script:Standard.Module1.TestRAND?language=Basic&location=document",
+ aParams, aRet, aOutParamIndex, aOutParam);
+
+ OUString aReturnValue;
+ aRet >>= aReturnValue;
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: Double
+ // - Actual : Object()
+
+ CPPUNIT_ASSERT_EQUAL(OUString("Double"), aReturnValue);
+
+ css::uno::Reference<css::util::XCloseable> xCloseable(xComponent, css::uno::UNO_QUERY_THROW);
+ xCloseable->close(true);
+}
+
ScMacrosTest::ScMacrosTest()
: UnoApiTest("/sc/qa/extras/testdocuments")
{
diff --git a/sc/qa/extras/testdocuments/tdf128218.ods b/sc/qa/extras/testdocuments/tdf128218.ods
new file mode 100644
index 000000000000..9fa3e8b4ecbd
--- /dev/null
+++ b/sc/qa/extras/testdocuments/tdf128218.ods
Binary files differ