From 02323e893a2bd426ee8a07d25ac7d4a1e66d3be1 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 4 May 2020 16:44:55 +0200 Subject: 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 --- comphelper/CppunitTest_comphelper_test.mk | 7 +++++++ comphelper/qa/unit/test_hash.cxx | 12 ++++++++++++ 2 files changed, 19 insertions(+) (limited to 'comphelper') 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 +#include #include #include @@ -16,6 +18,10 @@ #include #include +#if USE_TLS_NSS +#include +#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); -- cgit