summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-05-04 16:44:55 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-05-04 20:13:12 +0200
commit02323e893a2bd426ee8a07d25ac7d4a1e66d3be1 (patch)
treec9441645eaff820cd3a12f03212bd8b45cbbf591 /comphelper
parent72795f68df49cfb58aee70daa848a1889a117c28 (diff)
fix leak in comphelper::TestHash
by shutting down NSS at end of test Change-Id: I63694e9bc54e8c142592005be353af7ed95d444d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93427 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/CppunitTest_comphelper_test.mk7
-rw-r--r--comphelper/qa/unit/test_hash.cxx12
2 files changed, 19 insertions, 0 deletions
diff --git a/comphelper/CppunitTest_comphelper_test.mk b/comphelper/CppunitTest_comphelper_test.mk
index 8bb335aa24dc..ef795f1664d1 100644
--- a/comphelper/CppunitTest_comphelper_test.mk
+++ b/comphelper/CppunitTest_comphelper_test.mk
@@ -27,4 +27,11 @@ $(eval $(call gb_CppunitTest_use_libraries,comphelper_test, \
sal \
))
+ifeq ($(TLS),NSS)
+$(eval $(call gb_CppunitTest_use_externals,comphelper_test,\
+ plc4 \
+ nss3 \
+))
+endif
+
# vim: set noet sw=4 ts=4:
diff --git a/comphelper/qa/unit/test_hash.cxx b/comphelper/qa/unit/test_hash.cxx
index 650cd6fc6976..99ce5bfd1751 100644
--- a/comphelper/qa/unit/test_hash.cxx
+++ b/comphelper/qa/unit/test_hash.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 <comphelper/hash.hxx>
#include <comphelper/docpasswordhelper.hxx>
@@ -16,6 +18,10 @@
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
+#if USE_TLS_NSS
+#include <nss.h>
+#endif
+
class TestHash : public CppUnit::TestFixture
{
public:
@@ -26,6 +32,12 @@ public:
void testSHA512_NoSaltNoSpin();
void testSHA512_saltspin();
+ virtual void tearDown()
+ {
+#if USE_TLS_NSS
+ NSS_Shutdown();
+#endif
+ }
CPPUNIT_TEST_SUITE(TestHash);
CPPUNIT_TEST(testMD5);
CPPUNIT_TEST(testSHA1);