diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-06-26 10:08:00 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-07-15 11:01:31 +0200 |
commit | a2e25af0ec427d9c86228ecec349ea2d303abbe1 (patch) | |
tree | 426d32afeb10c516899d96e46c390bdd3b8c3b5c /vcl/qa | |
parent | 208e66185b634ebc131121158f93f4f3ae4bd18e (diff) |
emfplus: corrections for UnitTest in vcl
The CppunitTest_vcl_filters_test was not working due
to a wmf file now being loadable. This leaded to better
check errors on stream and react on it in test code.
Hrad to find since that test - for whatever reason - is
not executed on win. Also need to check result of
EmfReader. Added emfio to test's module list
Change-Id: Iea2b835408e919a8456e8f178cbfc782885ffebb
Diffstat (limited to 'vcl/qa')
-rw-r--r-- | vcl/qa/cppunit/graphicfilter/filters-test.cxx | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/vcl/qa/cppunit/graphicfilter/filters-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-test.cxx index 0b28c706fd84..d6a32f2875d5 100644 --- a/vcl/qa/cppunit/graphicfilter/filters-test.cxx +++ b/vcl/qa/cppunit/graphicfilter/filters-test.cxx @@ -57,7 +57,30 @@ bool VclFiltersTest::load(const OUString &, { SvFileStream aFileStream(rURL, StreamMode::READ); Graphic aGraphic; - return mGraphicFilter.ImportGraphic(aGraphic, rURL, aFileStream) == ERRCODE_NONE; + bool bRetval(ERRCODE_NONE == mGraphicFilter.ImportGraphic(aGraphic, rURL, aFileStream)); + + if (!bRetval) + { + // if error occurred, we are done + return bRetval; + } + + // if not and we have an embedded Vector Graphic Data, trigger it's interpretation + // to check for error. Graphic with VectorGraphicData (Svg/Emf/Wmf) load without error + // as long as one of the three types gets detected. Thus, cycles like load/save in + // other format will work (what may be wanted). For the test framework it was indirectly + // intended to trigger an error when load in the sense of deep data interpretation fails, + // so we need to trigger this here + if (aGraphic.getVectorGraphicData().get()) + { + if (aGraphic.getVectorGraphicData()->getRange().isEmpty()) + { + // invalid file or file with no content + return false; + } + } + + return true; } void VclFiltersTest::testScaling() |