diff options
author | offtkp <parisoplop@gmail.com> | 2022-05-24 00:03:04 +0300 |
---|---|---|
committer | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2022-05-24 08:20:45 +0200 |
commit | 5f30b778bccbcc417e4ed1da5997650babb942a8 (patch) | |
tree | 34f529a9e1aee3852fc87248732aed48bf823607 /vcl/qa | |
parent | 504d61697bac45236da27fba23c7189daf8c171e (diff) |
tdf#149206: Add EMF test in GraphicDescriptorTest
Add a testDetectEMF test case in GraphicDescriptorTest.cxx that tests
GraphicDescriptor for EMF detection and that the size metadata were
fetched.
Change-Id: I6fbe082bea4d5f1e8660b43a923a09bfcdf466b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134845
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'vcl/qa')
-rw-r--r-- | vcl/qa/cppunit/GraphicDescriptorTest.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/vcl/qa/cppunit/GraphicDescriptorTest.cxx b/vcl/qa/cppunit/GraphicDescriptorTest.cxx index ace1a6c90a28..c86d95edebdb 100644 --- a/vcl/qa/cppunit/GraphicDescriptorTest.cxx +++ b/vcl/qa/cppunit/GraphicDescriptorTest.cxx @@ -35,6 +35,7 @@ class GraphicDescriptorTest : public test::BootstrapFixtureBase void testDetectTIF(); void testDetectBMP(); void testDetectWEBP(); + void testDetectEMF(); CPPUNIT_TEST_SUITE(GraphicDescriptorTest); CPPUNIT_TEST(testDetectPNG); @@ -43,6 +44,7 @@ class GraphicDescriptorTest : public test::BootstrapFixtureBase CPPUNIT_TEST(testDetectTIF); CPPUNIT_TEST(testDetectBMP); CPPUNIT_TEST(testDetectWEBP); + CPPUNIT_TEST(testDetectEMF); CPPUNIT_TEST_SUITE_END(); }; @@ -154,6 +156,19 @@ void GraphicDescriptorTest::testDetectWEBP() CPPUNIT_ASSERT_EQUAL(tools::Long(100), aDescriptor.GetSizePixel().Height()); } +void GraphicDescriptorTest::testDetectEMF() +{ + SvFileStream aFileStream(getFullUrl(u"TypeDetectionExample.emf"), StreamMode::READ); + GraphicDescriptor aDescriptor(aFileStream, nullptr); + aDescriptor.Detect(true); + CPPUNIT_ASSERT_EQUAL(GraphicFileFormat::EMF, aDescriptor.GetFileFormat()); + // Test that Bounds/Frame values are fetched from header + CPPUNIT_ASSERT_EQUAL(tools::Long(142), aDescriptor.GetSizePixel().Width()); + CPPUNIT_ASSERT_EQUAL(tools::Long(142), aDescriptor.GetSizePixel().Height()); + CPPUNIT_ASSERT_EQUAL(tools::Long(300), aDescriptor.GetSize_100TH_MM().Width()); + CPPUNIT_ASSERT_EQUAL(tools::Long(300), aDescriptor.GetSize_100TH_MM().Height()); +} + } // namespace CPPUNIT_TEST_SUITE_REGISTRATION(GraphicDescriptorTest); |