summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoanna Hulboj <joanna.hulboj@isode.com>2017-04-28 13:52:47 (GMT)
committerKevin Smith <kevin.smith@isode.com>2017-07-07 16:23:08 (GMT)
commitf68d574ff04162e98e16a636c66ab6de5960e875 (patch)
tree0248d9450a8bb6aa6731067d9f921791d9d4deaa /Swiften/QA/TLSTest
parentd89b27b8796f89c847c280dacfb1b09fd6cb6731 (diff)
downloadswift-f68d574ff04162e98e16a636c66ab6de5960e875.zip
swift-f68d574ff04162e98e16a636c66ab6de5960e875.tar.bz2
Make std:: make_unique available in gcc with c++11
Test-Information: Unit tests pass OK on Windows 10 and CentOS 7.3. Change-Id: I33c9eb6b3e6409727350a44e6d5c88c5e8907275
Diffstat (limited to 'Swiften/QA/TLSTest')
-rw-r--r--Swiften/QA/TLSTest/CertificateTest.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Swiften/QA/TLSTest/CertificateTest.cpp b/Swiften/QA/TLSTest/CertificateTest.cpp
index b53cd2f..02ec0f8 100644
--- a/Swiften/QA/TLSTest/CertificateTest.cpp
+++ b/Swiften/QA/TLSTest/CertificateTest.cpp
@@ -7,61 +7,61 @@
#include <memory>
#include <boost/bind.hpp>
#include <QA/Checker/IO.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <Swiften/Base/ByteArray.h>
#include <Swiften/TLS/CertificateFactory.h>
#include <SwifTools/Application/PlatformApplicationPathProvider.h>
using namespace Swift;
template<typename CERTIFICATE_FACTORY>
class CertificateTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(CertificateTest);
CPPUNIT_TEST(testConstructFromDER);
CPPUNIT_TEST(testToDER);
//CPPUNIT_TEST(testGetSubjectName);
CPPUNIT_TEST(testGetCommonNames);
CPPUNIT_TEST(testGetSRVNames);
CPPUNIT_TEST(testGetDNSNames);
CPPUNIT_TEST(testGetXMPPAddresses);
CPPUNIT_TEST_SUITE_END();
public:
void setUp() {
- pathProvider = std::unique_ptr<PlatformApplicationPathProvider>(new PlatformApplicationPathProvider("FileReadBytestreamTest"));
+ pathProvider = std::make_unique<PlatformApplicationPathProvider>("FileReadBytestreamTest");
readByteArrayFromFile(certificateData, (pathProvider->getExecutableDir() / "jabber_org.crt"));
certificateFactory = std::unique_ptr<CertificateFactory>(new CERTIFICATE_FACTORY());
}
void testConstructFromDER() {
Certificate::ref testling = Certificate::ref(certificateFactory->createCertificateFromDER(certificateData));
CPPUNIT_ASSERT_EQUAL(std::string("*.jabber.org"), testling->getCommonNames()[0]);
}
void testToDER() {
Certificate::ref testling = Certificate::ref(certificateFactory->createCertificateFromDER(certificateData));
CPPUNIT_ASSERT_EQUAL(certificateData, testling->toDER());
}
/*
void testGetSubjectName() {
Certificate::ref testling = Certificate::ref(certificateFactory->createCertificateFromDER(certificateData);
CPPUNIT_ASSERT_EQUAL(std::string("/description=114072-VMk8pdi1aj5kTXxO/C=US/ST=Colorado/L=Denver/O=Peter Saint-Andre/OU=StartCom Trusted Certificate Member/CN=*.jabber.org/emailAddress=hostmaster@jabber.org"), testling->getSubjectName());
}
*/
void testGetCommonNames() {
Certificate::ref testling = Certificate::ref(certificateFactory->createCertificateFromDER(certificateData));
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(testling->getCommonNames().size()));
CPPUNIT_ASSERT_EQUAL(std::string("*.jabber.org"), testling->getCommonNames()[0]);
}