From ec6eaa58addf0d8823f8c56d4ec168ff389da8c5 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 5 May 2020 19:10:16 +0200 Subject: 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 --- emfio/qa/cppunit/wmf/wmfimporttest.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'emfio/qa/cppunit/wmf/wmfimporttest.cxx') 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); -- cgit