summaryrefslogtreecommitdiff
path: root/emfio
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-05-05 19:10:16 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-05-07 09:52:27 +0200
commitec6eaa58addf0d8823f8c56d4ec168ff389da8c5 (patch)
treeadb44639fc6bdecad5f576aa5e1aa90f3c9d64b3 /emfio
parentc437948f6c0d602bb200fc92e80cb73ae8ae5109 (diff)
fix memory leak of xmlDoc objects
in unit tests Change-Id: Id16731bbbe2f1b0e3642722d77aba04fc98db4cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93508 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'emfio')
-rw-r--r--emfio/qa/cppunit/emf/EmfImportTest.cxx10
-rw-r--r--emfio/qa/cppunit/wmf/wmfimporttest.cxx16
2 files changed, 13 insertions, 13 deletions
diff --git a/emfio/qa/cppunit/emf/EmfImportTest.cxx b/emfio/qa/cppunit/emf/EmfImportTest.cxx
index 636216a79fc2..ac435905d570 100644
--- a/emfio/qa/cppunit/emf/EmfImportTest.cxx
+++ b/emfio/qa/cppunit/emf/EmfImportTest.cxx
@@ -77,7 +77,7 @@ Primitive2DSequence Test::parseEmf(const OUString& aSource)
void Test::checkRectPrimitive(Primitive2DSequence const & rPrimitive)
{
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(rPrimitive));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(rPrimitive));
CPPUNIT_ASSERT (pDocument);
@@ -104,7 +104,7 @@ void Test::TestDrawString()
Primitive2DSequence aSequence = parseEmf("/emfio/qa/cppunit/emf/data/TestDrawString.emf");
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequence));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequence));
CPPUNIT_ASSERT (pDocument);
// check correct import of the DrawString: height, position, text, color and font
@@ -126,7 +126,7 @@ void Test::TestDrawStringTransparent()
Primitive2DSequence aSequence = parseEmf("/emfio/qa/cppunit/emf/data/TestDrawStringTransparent.emf");
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequence));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequence));
CPPUNIT_ASSERT (pDocument);
assertXPath(pDocument, "/primitive2D/metafile/transform/mask/transform/unifiedtransparence", "transparence", "0.498039215686275");
@@ -149,7 +149,7 @@ void Test::TestDrawLine()
Primitive2DSequence aSequence = parseEmf("/emfio/qa/cppunit/emf/data/TestDrawLine.emf");
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequence));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequence));
CPPUNIT_ASSERT (pDocument);
// check correct import of the DrawLine: color and width of the line
@@ -163,7 +163,7 @@ void Test::TestLinearGradient()
Primitive2DSequence aSequence = parseEmf("/emfio/qa/cppunit/emf/data/TestLinearGradient.emf");
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequence));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequence));
CPPUNIT_ASSERT (pDocument);
assertXPath(pDocument, "/primitive2D/metafile/transform", "xy11", "1.0000656512605");
diff --git a/emfio/qa/cppunit/wmf/wmfimporttest.cxx b/emfio/qa/cppunit/wmf/wmfimporttest.cxx
index 5d3c3b772de5..5dfcfdad2041 100644
--- a/emfio/qa/cppunit/wmf/wmfimporttest.cxx
+++ b/emfio/qa/cppunit/wmf/wmfimporttest.cxx
@@ -73,7 +73,7 @@ void WmfTest::testNonPlaceableWmf()
MetafileXmlDump dumper;
dumper.filterAllActionTypes();
dumper.filterActionType(MetaActionType::POLYLINE, false);
- xmlDocPtr pDoc = dumpAndParse(dumper, aGDIMetaFile);
+ xmlDocUniquePtr pDoc = dumpAndParse(dumper, aGDIMetaFile);
CPPUNIT_ASSERT(pDoc);
@@ -102,7 +102,7 @@ void WmfTest::testSine()
MetafileXmlDump dumper;
dumper.filterAllActionTypes();
dumper.filterActionType(MetaActionType::ISECTRECTCLIPREGION, false);
- xmlDocPtr pDoc = dumpAndParse(dumper, aGDIMetaFile);
+ xmlDocUniquePtr pDoc = dumpAndParse(dumper, aGDIMetaFile);
CPPUNIT_ASSERT(pDoc);
@@ -118,7 +118,7 @@ void WmfTest::testEmfProblem()
MetafileXmlDump dumper;
dumper.filterAllActionTypes();
dumper.filterActionType(MetaActionType::ISECTRECTCLIPREGION, false);
- xmlDocPtr pDoc = dumpAndParse(dumper, aGDIMetaFile);
+ xmlDocUniquePtr pDoc = dumpAndParse(dumper, aGDIMetaFile);
CPPUNIT_ASSERT(pDoc);
@@ -138,7 +138,7 @@ void WmfTest::testEmfLineStyles()
dumper.filterAllActionTypes();
dumper.filterActionType(MetaActionType::LINE, false);
dumper.filterActionType(MetaActionType::LINECOLOR, false);
- xmlDocPtr pDoc = dumpAndParse(dumper, aGDIMetaFile);
+ xmlDocUniquePtr pDoc = dumpAndParse(dumper, aGDIMetaFile);
CPPUNIT_ASSERT(pDoc);
@@ -197,7 +197,7 @@ void WmfTest::testWorldTransformFontSize()
MetafileXmlDump dumper;
dumper.filterAllActionTypes();
dumper.filterActionType(MetaActionType::FONT, false);
- xmlDocPtr pDoc = dumpAndParse(dumper, aGDIMetaFile);
+ xmlDocUniquePtr pDoc = dumpAndParse(dumper, aGDIMetaFile);
CPPUNIT_ASSERT(pDoc);
@@ -225,7 +225,7 @@ void WmfTest::testTdf93750()
ReadWindowMetafile(aFileStream, aGDIMetaFile);
MetafileXmlDump dumper;
- xmlDocPtr pDoc = dumpAndParse(dumper, aGDIMetaFile);
+ xmlDocUniquePtr pDoc = dumpAndParse(dumper, aGDIMetaFile);
CPPUNIT_ASSERT(pDoc);
@@ -264,7 +264,7 @@ void WmfTest::testTdf39894()
ReadWindowMetafile(aFileStream, aGDIMetaFile);
MetafileXmlDump dumper;
- xmlDocPtr pDoc = dumpAndParse(dumper, aGDIMetaFile);
+ xmlDocUniquePtr pDoc = dumpAndParse(dumper, aGDIMetaFile);
CPPUNIT_ASSERT(pDoc);
@@ -285,7 +285,7 @@ void WmfTest::testETO_PDY()
ReadWindowMetafile(aFileStream, aGDIMetaFile);
MetafileXmlDump dumper;
- xmlDocPtr pDoc = dumpAndParse(dumper, aGDIMetaFile);
+ xmlDocUniquePtr pDoc = dumpAndParse(dumper, aGDIMetaFile);
CPPUNIT_ASSERT(pDoc);