[Libreoffice-commits] core.git: filter/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Fri Dec 18 23:16:54 UTC 2020
filter/qa/cppunit/data/tiff/tdf138818.tif |binary
filter/qa/cppunit/filters-tiff-test.cxx | 20 ++++++++++++++++++++
2 files changed, 20 insertions(+)
New commits:
commit 4db61e4cb26a8bf739701876aa806479a61bb447
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Fri Dec 18 10:21:36 2020 +0100
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Sat Dec 19 00:16:16 2020 +0100
tdf#138818: libtest_filter_tiff: Add unittest
Change-Id: Ibb8566d58c23a76923d39f6f9d4dabf5a01d101a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107939
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/filter/qa/cppunit/data/tiff/tdf138818.tif b/filter/qa/cppunit/data/tiff/tdf138818.tif
new file mode 100644
index 000000000000..bb3e51011b25
Binary files /dev/null and b/filter/qa/cppunit/data/tiff/tdf138818.tif differ
diff --git a/filter/qa/cppunit/filters-tiff-test.cxx b/filter/qa/cppunit/filters-tiff-test.cxx
index 4a5647ca7867..93968e9be9b7 100644
--- a/filter/qa/cppunit/filters-tiff-test.cxx
+++ b/filter/qa/cppunit/filters-tiff-test.cxx
@@ -47,11 +47,13 @@ public:
void testCVEs();
void testTdf126460();
void testTdf115863();
+ void testTdf138818();
CPPUNIT_TEST_SUITE(TiffFilterTest);
CPPUNIT_TEST(testCVEs);
CPPUNIT_TEST(testTdf126460);
CPPUNIT_TEST(testTdf115863);
+ CPPUNIT_TEST(testTdf138818);
CPPUNIT_TEST_SUITE_END();
};
@@ -107,6 +109,24 @@ void TiffFilterTest::testTdf115863()
}
+void TiffFilterTest::testTdf138818()
+{
+ OUString aURL = getUrl() + "tdf138818.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, this test would have failed with
+ // - Expected: 46428
+ // - Actual : 45951
+ CPPUNIT_ASSERT_EQUAL(sal_uInt32(46428), aGraphic.GetGfxLink().GetDataSize());
+
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(TiffFilterTest);
CPPUNIT_PLUGIN_IMPLEMENT();
More information about the Libreoffice-commits
mailing list