summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-09-29 15:22:52 (GMT)
committerTobias Markmann <tm@ayena.de>2016-09-29 15:22:52 (GMT)
commit9abfaaa771f91010dbe01a1b9b5b9e2801956718 (patch)
tree618a5f66ea97d3d8552f72aad6a8e1313c56ec6e /Swiften/QA/TLSTest
parent2bf44a1d641c3bc35546cb49d3766f2962f9a984 (diff)
downloadswift-9abfaaa771f91010dbe01a1b9b5b9e2801956718.zip
swift-9abfaaa771f91010dbe01a1b9b5b9e2801956718.tar.bz2
Fix uninitialised class members
Initialised previously uninitialised class members. Changed some raw pointers to std::unique_ptr for clearer and automatically initialised code. Test-Information: Builds on macOS 10.12 and unit tests pass in ASAN-enabled build. Change-Id: I7900fe6131119c228ca92c79c0ee8125137f2e48
Diffstat (limited to 'Swiften/QA/TLSTest')
-rw-r--r--Swiften/QA/TLSTest/CertificateTest.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/Swiften/QA/TLSTest/CertificateTest.cpp b/Swiften/QA/TLSTest/CertificateTest.cpp
index ede1063..b53cd2f 100644
--- a/Swiften/QA/TLSTest/CertificateTest.cpp
+++ b/Swiften/QA/TLSTest/CertificateTest.cpp
@@ -4,6 +4,8 @@
* See the COPYING file for more information.
*/
+#include <memory>
+
#include <boost/bind.hpp>
#include <QA/Checker/IO.h>
@@ -32,14 +34,9 @@ class CertificateTest : public CppUnit::TestFixture {
public:
void setUp() {
- pathProvider = new PlatformApplicationPathProvider("FileReadBytestreamTest");
+ pathProvider = std::unique_ptr<PlatformApplicationPathProvider>(new PlatformApplicationPathProvider("FileReadBytestreamTest"));
readByteArrayFromFile(certificateData, (pathProvider->getExecutableDir() / "jabber_org.crt"));
- certificateFactory = new CERTIFICATE_FACTORY();
- }
-
- void tearDown() {
- delete certificateFactory;
- delete pathProvider;
+ certificateFactory = std::unique_ptr<CertificateFactory>(new CERTIFICATE_FACTORY());
}
void testConstructFromDER() {
@@ -92,9 +89,9 @@ class CertificateTest : public CppUnit::TestFixture {
}
private:
- PlatformApplicationPathProvider* pathProvider;
+ std::unique_ptr<PlatformApplicationPathProvider> pathProvider;
ByteArray certificateData;
- CertificateFactory* certificateFactory;
+ std::unique_ptr<CertificateFactory> certificateFactory;
};
#ifdef HAVE_OPENSSL