summaryrefslogtreecommitdiffstats
path: root/sc/qa/unit/functions_array.cxx
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
commited5640d8b587fbcfed7dd7967f3de04b37a76f26 (patch)
tree7a5f7c6c9d02226d7471cb3cc8fbbf631b415303 /sc/qa/unit/functions_array.cxx
parentInitial commit. (diff)
downloadlibreoffice-ed5640d8b587fbcfed7dd7967f3de04b37a76f26.tar.xz
libreoffice-ed5640d8b587fbcfed7dd7967f3de04b37a76f26.zip
Adding upstream version 4:7.4.7.upstream/4%7.4.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sc/qa/unit/functions_array.cxx')
-rw-r--r--sc/qa/unit/functions_array.cxx49
1 files changed, 49 insertions, 0 deletions
diff --git a/sc/qa/unit/functions_array.cxx b/sc/qa/unit/functions_array.cxx
new file mode 100644
index 000000000..88a4b70d7
--- /dev/null
+++ b/sc/qa/unit/functions_array.cxx
@@ -0,0 +1,49 @@
+#include "functions_test.hxx"
+
+class ArrayFunctionsTest : public FunctionsTest
+{
+public:
+ ArrayFunctionsTest();
+
+ void testArrayFormulasFODS();
+ void testDubiousArrayFormulasFODS();
+
+ CPPUNIT_TEST_SUITE(ArrayFunctionsTest);
+ CPPUNIT_TEST(testArrayFormulasFODS);
+ CPPUNIT_TEST(testDubiousArrayFormulasFODS);
+ CPPUNIT_TEST_SUITE_END();
+
+};
+
+void ArrayFunctionsTest::testArrayFormulasFODS()
+{
+ OUString aDirectoryURL = m_directories.getURLFromSrc(u"/sc/qa/unit/data/functions/array/fods/");
+ recursiveScan(test::pass, "OpenDocument Spreadsheet Flat XML", aDirectoryURL,
+ "com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true",
+ FODS_FORMAT_TYPE, SotClipboardFormatId::NONE, 0, false);
+}
+
+void ArrayFunctionsTest::testDubiousArrayFormulasFODS()
+{
+ //TODO: sc/qa/unit/data/functions/array/dubious/fods/linest.fods produces widely different
+ // values when built with -ffp-contract enabled (-ffp-contract=on default on Clang 14,
+ // -ffp-contract=fast default when building with optimizations on GCC) on at least aarch64:
+#if !((defined __clang__ || defined __GNUC__) && defined __aarch64__)
+ OUString aDirectoryURL
+ = m_directories.getURLFromSrc(u"/sc/qa/unit/data/functions/array/dubious/fods/");
+ recursiveScan(test::pass, "OpenDocument Spreadsheet Flat XML", aDirectoryURL,
+ "com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true",
+ FODS_FORMAT_TYPE, SotClipboardFormatId::NONE, 0, false);
+#endif
+}
+
+ArrayFunctionsTest::ArrayFunctionsTest():
+ FunctionsTest("sc/qa/unit/data/functions/array/fods/")
+{
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(ArrayFunctionsTest);
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */