summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2022-01-06 09:45:30 +0100
committerAndras Timar <andras.timar@collabora.com>2022-01-06 10:27:02 +0100
commitd33c478eca48b4b1790c2e9cff7e08472164b3ed (patch)
treeff52f8c8d6c4859d632febe4b913da579d637aab
parentd9a4e323555d01202dd15e71a3a32294bfd568cc (diff)
Unit test for 0-byte ods detection
Fixed by commit: d9a4e323555d01202dd15e71a3a32294bfd568cc Open empty (0 bytes) ods as spreadsheet Change-Id: I9b7220f46f5d00f6e4a73d6325dca51d7ea5b656 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128033 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--filter/qa/unit/data/empty.ods0
-rw-r--r--filter/qa/unit/textfilterdetect.cxx9
2 files changed, 9 insertions, 0 deletions
diff --git a/filter/qa/unit/data/empty.ods b/filter/qa/unit/data/empty.ods
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/filter/qa/unit/data/empty.ods
diff --git a/filter/qa/unit/textfilterdetect.cxx b/filter/qa/unit/textfilterdetect.cxx
index 500e886f5199..a56f63e6a4fe 100644
--- a/filter/qa/unit/textfilterdetect.cxx
+++ b/filter/qa/unit/textfilterdetect.cxx
@@ -103,6 +103,15 @@ CPPUNIT_TEST_FIXTURE(TextFilterDetectTest, testEmptyFile)
CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.TextDocument"));
getComponent()->dispose();
+ // ... and ODS
+ aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "empty.ods";
+ getComponent() = loadFromDesktop(aURL);
+ xServiceInfo.set(getComponent(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xServiceInfo.is());
+ // Make sure it opens in Calc.
+ CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.sheet.SpreadsheetDocument"));
+ getComponent()->dispose();
+
// ... and ODP
aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "empty.odp";
getComponent() = loadFromDesktop(aURL);