diff options
-rw-r--r-- | vcl/qa/cppunit/graphicfilter/data/psd/tdf142629.psd | bin | 0 -> 53812 bytes | |||
-rw-r--r-- | vcl/qa/cppunit/graphicfilter/filters-psd-test.cxx | 27 |
2 files changed, 25 insertions, 2 deletions
diff --git a/vcl/qa/cppunit/graphicfilter/data/psd/tdf142629.psd b/vcl/qa/cppunit/graphicfilter/data/psd/tdf142629.psd Binary files differnew file mode 100644 index 000000000000..097536bcc484 --- /dev/null +++ b/vcl/qa/cppunit/graphicfilter/data/psd/tdf142629.psd diff --git a/vcl/qa/cppunit/graphicfilter/filters-psd-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-psd-test.cxx index 4ff25b18636a..bf181f811e76 100644 --- a/vcl/qa/cppunit/graphicfilter/filters-psd-test.cxx +++ b/vcl/qa/cppunit/graphicfilter/filters-psd-test.cxx @@ -12,6 +12,7 @@ #include <vcl/FilterConfigItem.hxx> #include <tools/stream.hxx> #include <vcl/graph.hxx> +#include <vcl/graphicfilter.hxx> #include <filter/PsdReader.hxx> using namespace css; @@ -29,13 +30,20 @@ public: const OUString &rURL, const OUString &, SfxFilterFlags, SotClipboardFormatId, unsigned int) override; + OUString getUrl() const + { + return m_directories.getURLFromSrc(u"/vcl/qa/cppunit/graphicfilter/data/psd/"); + } + /** * Ensure CVEs remain unbroken */ void testCVEs(); + void testTdf142629(); CPPUNIT_TEST_SUITE(PsdFilterTest); CPPUNIT_TEST(testCVEs); + CPPUNIT_TEST(testTdf142629); CPPUNIT_TEST_SUITE_END(); }; @@ -51,11 +59,26 @@ bool PsdFilterTest::load(const OUString &, void PsdFilterTest::testCVEs() { #ifndef DISABLE_CVE_TESTS - testDir(OUString(), - m_directories.getURLFromSrc(u"/vcl/qa/cppunit/graphicfilter/data/psd/")); + testDir(OUString(), getUrl()); #endif } +void PsdFilterTest::testTdf142629() +{ + OUString aURL = getUrl() + "tdf142629.psd"; + SvFileStream aFileStream(aURL, StreamMode::READ); + Graphic aGraphic; + GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter(); + + ErrCode bResult = rFilter.ImportGraphic(aGraphic, aURL, aFileStream); + + // Without the fix in place, the following asserts would have failed + CPPUNIT_ASSERT_EQUAL(ERRCODE_NONE, bResult); + + CPPUNIT_ASSERT(aGraphic.IsAlpha()); + CPPUNIT_ASSERT(aGraphic.IsTransparent()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(PsdFilterTest); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |