summaryrefslogtreecommitdiff
path: root/vcl/qa
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-05-11 11:09:50 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-05-11 13:35:07 +0200
commit687f46059cc9238d74e0687fbd9422dfdb109e1e (patch)
tree000f85ff07d3123746cdb0304e1818e4d8bbf9a6 /vcl/qa
parente84d6f512fceb8b354b2d111193a9fd7d834acc5 (diff)
fix some leaks in vcl
Change-Id: I9588841de6f751ad767f695dec51f660b2990b49 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93954 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/qa')
-rw-r--r--vcl/qa/cppunit/FontFeatureTest.cxx2
-rw-r--r--vcl/qa/cppunit/GraphicTest.cxx17
-rw-r--r--vcl/qa/cppunit/TypeSerializerTest.cxx17
-rw-r--r--vcl/qa/cppunit/lifecycle.cxx2
-rw-r--r--vcl/qa/cppunit/pdfexport/pdfexport.cxx7
5 files changed, 45 insertions, 0 deletions
diff --git a/vcl/qa/cppunit/FontFeatureTest.cxx b/vcl/qa/cppunit/FontFeatureTest.cxx
index 79ec3c158fbe..e4040f35bf39 100644
--- a/vcl/qa/cppunit/FontFeatureTest.cxx
+++ b/vcl/qa/cppunit/FontFeatureTest.cxx
@@ -120,6 +120,8 @@ void FontFeatureTest::testGetFontFeatures()
CPPUNIT_ASSERT_EQUAL(uint32_t(2), rParameter3.getCode());
CPPUNIT_ASSERT(!rParameter2.getDescription().isEmpty());
}
+
+ aVDev.disposeAndClear();
#endif // HAVE_MORE_FONTS
}
diff --git a/vcl/qa/cppunit/GraphicTest.cxx b/vcl/qa/cppunit/GraphicTest.cxx
index d040f8837cd0..f40b5c1b88e7 100644
--- a/vcl/qa/cppunit/GraphicTest.cxx
+++ b/vcl/qa/cppunit/GraphicTest.cxx
@@ -7,6 +7,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include <sal/config.h>
+#include <config_oox.h>
#include <cppunit/TestAssert.h>
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
@@ -25,12 +27,20 @@
#include <impgraph.hxx>
+#if USE_TLS_NSS
+#include <nss.h>
+#endif
+
using namespace css;
namespace
{
class GraphicTest : public CppUnit::TestFixture
{
+public:
+ ~GraphicTest();
+
+private:
void testUnloadedGraphic();
void testUnloadedGraphicLoading();
void testUnloadedGraphicWmf();
@@ -50,6 +60,13 @@ class GraphicTest : public CppUnit::TestFixture
CPPUNIT_TEST_SUITE_END();
};
+GraphicTest::~GraphicTest()
+{
+#if USE_TLS_NSS
+ NSS_Shutdown();
+#endif
+}
+
BitmapEx createBitmap(bool alpha = false)
{
Bitmap aBitmap(Size(120, 100), 24);
diff --git a/vcl/qa/cppunit/TypeSerializerTest.cxx b/vcl/qa/cppunit/TypeSerializerTest.cxx
index 0193ce272142..30966700a3a3 100644
--- a/vcl/qa/cppunit/TypeSerializerTest.cxx
+++ b/vcl/qa/cppunit/TypeSerializerTest.cxx
@@ -7,6 +7,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include <sal/config.h>
+#include <config_oox.h>
#include <config_features.h>
#include <cppunit/TestAssert.h>
@@ -25,6 +27,10 @@
#include <TypeSerializer.hxx>
+#if USE_TLS_NSS
+#include <nss.h>
+#endif
+
namespace
{
constexpr char DATA_DIRECTORY[] = "/vcl/qa/cppunit/data/";
@@ -52,6 +58,10 @@ std::string toHexString(const std::vector<unsigned char>& a)
class TypeSerializerTest : public CppUnit::TestFixture
{
+public:
+ ~TypeSerializerTest();
+
+private:
void testGradient();
void testGraphic_Vector();
void testGraphic_Bitmap_NoGfxLink();
@@ -67,6 +77,13 @@ class TypeSerializerTest : public CppUnit::TestFixture
CPPUNIT_TEST_SUITE_END();
};
+TypeSerializerTest::~TypeSerializerTest()
+{
+#if USE_TLS_NSS
+ NSS_Shutdown();
+#endif
+}
+
void TypeSerializerTest::testGradient()
{
Gradient aGradient(GradientStyle::Radial, Color(0xFF, 0x00, 0x00), Color(0x00, 0xFF, 0x00));
diff --git a/vcl/qa/cppunit/lifecycle.cxx b/vcl/qa/cppunit/lifecycle.cxx
index 097852770814..e55e7da8ebaf 100644
--- a/vcl/qa/cppunit/lifecycle.cxx
+++ b/vcl/qa/cppunit/lifecycle.cxx
@@ -76,6 +76,8 @@ void LifecycleTest::testVirtualDevice()
VclPtrInstance<VirtualDevice> pVDev3;
VclPtrInstance<VirtualDevice> pVDev4(DeviceFormat::BITMASK);
CPPUNIT_ASSERT(!!pVDev && !!pVDev2 && !!pVDev3 && !!pVDev4);
+ pVDev.disposeAndClear();
+ pVDev4.disposeAndClear();
}
void LifecycleTest::testMultiDispose()
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index a57add56a292..a171a6791292 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -1180,6 +1180,8 @@ void PdfExportTest::testTdf115117_1a()
aChars[i] = FPDFText_GetUnicode(pPdfTextPage, i);
OUString aActualText(aChars.data(), aChars.size());
CPPUNIT_ASSERT_EQUAL(aExpectedText, aActualText);
+
+ FPDFText_ClosePage(pPdfTextPage);
#endif
}
@@ -1222,6 +1224,8 @@ void PdfExportTest::testTdf115117_2a()
aChars[i] = FPDFText_GetUnicode(pPdfTextPage, i);
OUString aActualText(aChars.data(), aChars.size());
CPPUNIT_ASSERT_EQUAL(aExpectedText, aActualText);
+
+ FPDFText_ClosePage(pPdfTextPage);
#endif
}
@@ -1759,6 +1763,7 @@ void PdfExportTest::testTdf121962()
CPPUNIT_ASSERT(sText != "** Expression is faulty **");
}
+ FPDFText_ClosePage(pTextPage);
}
void PdfExportTest::testTdf115967()
@@ -1790,6 +1795,8 @@ void PdfExportTest::testTdf115967()
sText += sChar.trim();
}
CPPUNIT_ASSERT_EQUAL(OUString("m=750abc"), sText);
+
+ FPDFText_ClosePage(pTextPage);
}
void PdfExportTest::testTdf121615()