diff options
author | panoskorovesis <panoskorovesis@outlook.com> | 2021-06-09 10:03:34 +0300 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2021-06-09 15:47:53 +0200 |
commit | 1adbb3e00593af8eed5baf7019fa9b177186567c (patch) | |
tree | b03221294aeb10edd37464b1d2b31c0d06e53b63 /vcl | |
parent | e0900c497a65af2e45c7cff3211b340bf14c4324 (diff) |
Add RefPoint cppunit test to vcl
The test creates two RefPoints. A default one and one
using a Point. Then checks their attributes
Change-Id: I7ae3d6498f776d00dee3d084d13f0764942af5c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116780
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/qa/cppunit/svm/data/refpoint.svm | bin | 0 -> 247 bytes | |||
-rw-r--r-- | vcl/qa/cppunit/svm/svmtest.cxx | 32 |
2 files changed, 30 insertions, 2 deletions
diff --git a/vcl/qa/cppunit/svm/data/refpoint.svm b/vcl/qa/cppunit/svm/data/refpoint.svm Binary files differnew file mode 100644 index 000000000000..e6412f9083b2 --- /dev/null +++ b/vcl/qa/cppunit/svm/data/refpoint.svm diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx index 06ec5841f8f6..0331502d1041 100644 --- a/vcl/qa/cppunit/svm/svmtest.cxx +++ b/vcl/qa/cppunit/svm/svmtest.cxx @@ -179,7 +179,7 @@ class SvmTest : public test::BootstrapFixture, public XmlTestTools //void checkEPS(const GDIMetaFile& rMetaFile); void testEPS(); - //void checkRefPoint(const GDIMetaFile& rMetaFile); + void checkRefPoint(const GDIMetaFile& rMetaFile); void testRefPoint(); //void checkComment(const GDIMetaFile& rMetaFile); @@ -1636,8 +1636,36 @@ void SvmTest::testFloatTransparent() void SvmTest::testEPS() {} +void SvmTest::checkRefPoint(const GDIMetaFile& rMetaFile) +{ + xmlDocUniquePtr pDoc = dumpMeta(rMetaFile); + + assertXPathAttrs(pDoc, "/metafile/refpoint[1]", { + {"x", "0"}, + {"y", "0"}, + {"set", "false"} + }); + + assertXPathAttrs(pDoc, "/metafile/refpoint[2]", { + {"x", "1"}, + {"y", "2"}, + {"set", "true"} + }); +} + void SvmTest::testRefPoint() -{} +{ + GDIMetaFile aGDIMetaFile; + ScopedVclPtrInstance<VirtualDevice> pVirtualDev; + setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile); + + pVirtualDev->SetRefPoint(); + + pVirtualDev->SetRefPoint(Point(1,2)); + + checkRefPoint(writeAndReadStream(aGDIMetaFile)); + checkRefPoint(readFile(u"refpoint.svm")); +} void SvmTest::testComment() {} |