summaryrefslogtreecommitdiff
path: root/svgio
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 /svgio
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 'svgio')
-rw-r--r--svgio/qa/cppunit/SvgImportTest.cxx58
1 files changed, 29 insertions, 29 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index 9f09f9bda6e9..8120241e227a 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -128,7 +128,7 @@ Primitive2DSequence Test::parseSvg(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);
@@ -184,7 +184,7 @@ void Test::testTdf87309()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf87309.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf87309));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf87309));
CPPUNIT_ASSERT (pDocument);
@@ -203,7 +203,7 @@ void Test::testFontsizeKeywords()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceFontsizeKeywords.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceFontsizeKeywords));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceFontsizeKeywords));
CPPUNIT_ASSERT (pDocument);
@@ -266,7 +266,7 @@ void Test::testFontsizePercentage()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceFontsizePercentage.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceFontsizePercentage));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceFontsizePercentage));
CPPUNIT_ASSERT (pDocument);
@@ -283,7 +283,7 @@ void Test::testFontsizeRelative()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceFontsizeRelative.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceFontsizeRelative));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceFontsizeRelative));
CPPUNIT_ASSERT (pDocument);
@@ -305,7 +305,7 @@ void Test::testTdf45771()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf45771.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf45771));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf45771));
CPPUNIT_ASSERT (pDocument);
@@ -322,7 +322,7 @@ void Test::testTdf97941()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf97941.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf97941));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf97941));
CPPUNIT_ASSERT (pDocument);
@@ -338,7 +338,7 @@ void Test::testTdf104339()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf104339.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf104339));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf104339));
CPPUNIT_ASSERT (pDocument);
assertXPath(pDocument, "/primitive2D/transform/transform/transform/transform/transform/polypolygoncolor", "color", "#000000");
@@ -350,7 +350,7 @@ void Test::testTdf85770()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf85770.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf85770));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf85770));
CPPUNIT_ASSERT (pDocument);
@@ -376,7 +376,7 @@ void Test::testTdf79163()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf79163.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf79163));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf79163));
CPPUNIT_ASSERT (pDocument);
@@ -389,7 +389,7 @@ void Test::testTdf97542_1()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf97542_1.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf97542_1));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf97542_1));
CPPUNIT_ASSERT (pDocument);
@@ -405,7 +405,7 @@ void Test::testTdf97542_2()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf97542_2.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf97542_2));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf97542_2));
CPPUNIT_ASSERT (pDocument);
@@ -421,7 +421,7 @@ void Test::testTdf97543()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf97543.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf97543));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf97543));
CPPUNIT_ASSERT (pDocument);
@@ -440,7 +440,7 @@ void Test::testRGBColor()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceRGBColor.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceRGBColor));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceRGBColor));
CPPUNIT_ASSERT (pDocument);
@@ -459,7 +459,7 @@ void Test::testRGBAColor()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceRGBAColor.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceRGBAColor));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceRGBAColor));
CPPUNIT_ASSERT (pDocument);
@@ -472,7 +472,7 @@ void Test::testNoneColor()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceRGBAColor.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceRGBAColor));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceRGBAColor));
CPPUNIT_ASSERT (pDocument);
@@ -489,7 +489,7 @@ void Test::testTdf97936()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf97936.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf97936));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf97936));
CPPUNIT_ASSERT (pDocument);
@@ -517,7 +517,7 @@ void Test::testClipPathAndParentStyle()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceClipPathAndParentStyle.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceClipPathAndParentStyle));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceClipPathAndParentStyle));
CPPUNIT_ASSERT (pDocument);
@@ -535,7 +535,7 @@ void Test::testClipPathAndStyle()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceClipPathAndStyle.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceClipPathAndStyle));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceClipPathAndStyle));
CPPUNIT_ASSERT (pDocument);
@@ -552,7 +552,7 @@ void Test::testi125329()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequencei125329.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequencei125329));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequencei125329));
CPPUNIT_ASSERT (pDocument);
@@ -575,7 +575,7 @@ void Test::testMaskingPath07b()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceMaskingPath07b.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceMaskingPath07b));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceMaskingPath07b));
CPPUNIT_ASSERT (pDocument);
@@ -587,7 +587,7 @@ void Test::test123926()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence123926.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequence123926));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequence123926));
CPPUNIT_ASSERT (pDocument);
@@ -601,7 +601,7 @@ void Test::test47446()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence47446.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequence47446));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequence47446));
CPPUNIT_ASSERT (pDocument);
@@ -616,7 +616,7 @@ void Test::test47446b()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence47446b.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequence47446b));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequence47446b));
CPPUNIT_ASSERT (pDocument);
@@ -631,7 +631,7 @@ void Test::testMaskText()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceMaskText.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceMaskText));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceMaskText));
CPPUNIT_ASSERT (pDocument);
@@ -649,7 +649,7 @@ void Test::testTdf99994()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf99994.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf99994));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf99994));
CPPUNIT_ASSERT (pDocument);
@@ -666,7 +666,7 @@ void Test::testTdf99115()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf99115.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf99115) );
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf99115) );
CPPUNIT_ASSERT (pDocument);
@@ -715,7 +715,7 @@ void Test::testTdf101237()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf101237.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf101237));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf101237));
CPPUNIT_ASSERT (pDocument);
@@ -730,7 +730,7 @@ void Test::testTdf94765()
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf94765.getLength()));
drawinglayer::tools::Primitive2dXmlDump dumper;
- xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf94765));
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf94765));
CPPUNIT_ASSERT (pDocument);