[Libreoffice-commits] core.git: filter/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Fri Dec 18 11:30:19 UTC 2020


 filter/qa/cppunit/data/tiff/tdf126460.tif |binary
 filter/qa/cppunit/filters-tiff-test.cxx   |   18 ++++++++++++++++++
 2 files changed, 18 insertions(+)

New commits:
commit 8cfad2357f309c8f8aaf11c89722307b5bd704c7
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Fri Dec 18 11:02:53 2020 +0100
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Fri Dec 18 12:29:37 2020 +0100

    tdf#126460: libtest_filter_tiff: Add unittest
    
    Change-Id: I60ad27828df684d1886c21a50247dd5fa59e933c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107942
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/filter/qa/cppunit/data/tiff/tdf126460.tif b/filter/qa/cppunit/data/tiff/tdf126460.tif
new file mode 100644
index 000000000000..ffdf6a1d56b8
Binary files /dev/null and b/filter/qa/cppunit/data/tiff/tdf126460.tif differ
diff --git a/filter/qa/cppunit/filters-tiff-test.cxx b/filter/qa/cppunit/filters-tiff-test.cxx
index 0dd5e4f82354..4a5647ca7867 100644
--- a/filter/qa/cppunit/filters-tiff-test.cxx
+++ b/filter/qa/cppunit/filters-tiff-test.cxx
@@ -45,10 +45,12 @@ public:
      * Ensure CVEs remain unbroken
      */
     void testCVEs();
+    void testTdf126460();
     void testTdf115863();
 
     CPPUNIT_TEST_SUITE(TiffFilterTest);
     CPPUNIT_TEST(testCVEs);
+    CPPUNIT_TEST(testTdf126460);
     CPPUNIT_TEST(testTdf115863);
     CPPUNIT_TEST_SUITE_END();
 };
@@ -68,6 +70,22 @@ void TiffFilterTest::testCVEs()
         getUrl());
 }
 
+void TiffFilterTest::testTdf126460()
+{
+    OUString aURL = getUrl() + "tdf126460.tif";
+    SvFileStream aFileStream(aURL, StreamMode::READ);
+    Graphic aGraphic;
+    GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
+
+    ErrCode bResult = rFilter.ImportGraphic(aGraphic, aURL, aFileStream);
+
+    CPPUNIT_ASSERT_EQUAL(ERRCODE_NONE, bResult);
+
+    // Without the fix in place, the following asserts would have failed
+    CPPUNIT_ASSERT(aGraphic.IsAlpha());
+    CPPUNIT_ASSERT(aGraphic.IsTransparent());
+}
+
 void TiffFilterTest::testTdf115863()
 {
     OUString aURL = getUrl() + "tdf115863.tif";


More information about the Libreoffice-commits mailing list