diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-11-10 07:30:52 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-11-10 07:30:52 (GMT) |
commit | 896e2a121d58931740ea8becc0544e10e629c6c5 (patch) | |
tree | a5e0c748ff472357dfbde89292eccac08900cee9 /Swiften/QA/OpenSSLTest | |
parent | afae15f7cf212c993da8264a4ae89cf8729b3f86 (diff) | |
download | swift-contrib-896e2a121d58931740ea8becc0544e10e629c6c5.zip swift-contrib-896e2a121d58931740ea8becc0544e10e629c6c5.tar.bz2 |
Refactored TLS tests.
Diffstat (limited to 'Swiften/QA/OpenSSLTest')
-rw-r--r-- | Swiften/QA/OpenSSLTest/.gitignore | 1 | ||||
-rw-r--r-- | Swiften/QA/OpenSSLTest/OpenSSLCertificateTest.cpp | 56 | ||||
-rw-r--r-- | Swiften/QA/OpenSSLTest/SConscript | 18 | ||||
-rw-r--r-- | Swiften/QA/OpenSSLTest/jabber_org.crt | bin | 2081 -> 0 bytes |
4 files changed, 0 insertions, 75 deletions
diff --git a/Swiften/QA/OpenSSLTest/.gitignore b/Swiften/QA/OpenSSLTest/.gitignore deleted file mode 100644 index 27154e7..0000000 --- a/Swiften/QA/OpenSSLTest/.gitignore +++ /dev/null @@ -1 +0,0 @@ -OpenSSLTest diff --git a/Swiften/QA/OpenSSLTest/OpenSSLCertificateTest.cpp b/Swiften/QA/OpenSSLTest/OpenSSLCertificateTest.cpp deleted file mode 100644 index 59aee47..0000000 --- a/Swiften/QA/OpenSSLTest/OpenSSLCertificateTest.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2010 Remko Tronçon - * Licensed under the GNU General Public License v3. - * See Documentation/Licenses/GPLv3.txt for more information. - */ - -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/extensions/TestFactoryRegistry.h> -#include <boost/bind.hpp> - -#include "Swiften/TLS/OpenSSL/OpenSSLCertificate.h" -#include "SwifTools/Application/PlatformApplicationPathProvider.h" - -using namespace Swift; - -class OpenSSLCertificateTest : public CppUnit::TestFixture { - CPPUNIT_TEST_SUITE(OpenSSLCertificateTest); - CPPUNIT_TEST(testConstructFromDER); - CPPUNIT_TEST(testToDER); - CPPUNIT_TEST(testGetSubjectName); - CPPUNIT_TEST_SUITE_END(); - - public: - void setUp() { - pathProvider = new PlatformApplicationPathProvider("FileReadBytestreamTest"); - certificateData.readFromFile((pathProvider->getExecutableDir() / "jabber_org.crt").string()); - } - - void tearDown() { - delete pathProvider; - } - - void testConstructFromDER() { - OpenSSLCertificate testling(certificateData); - - CPPUNIT_ASSERT_EQUAL(String("*.jabber.org"), testling.getCommonNames()[0]); - } - - void testToDER() { - OpenSSLCertificate testling(certificateData); - - CPPUNIT_ASSERT_EQUAL(certificateData, testling.toDER()); - } - - void testGetSubjectName() { - OpenSSLCertificate testling(certificateData); - - CPPUNIT_ASSERT_EQUAL(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()); - } - - private: - PlatformApplicationPathProvider* pathProvider; - ByteArray certificateData; -}; - -CPPUNIT_TEST_SUITE_REGISTRATION(OpenSSLCertificateTest); diff --git a/Swiften/QA/OpenSSLTest/SConscript b/Swiften/QA/OpenSSLTest/SConscript deleted file mode 100644 index a3309f2..0000000 --- a/Swiften/QA/OpenSSLTest/SConscript +++ /dev/null @@ -1,18 +0,0 @@ -import os - -Import("env") - -if env["TEST"] : - myenv = env.Clone() - myenv.MergeFlags(myenv["CHECKER_FLAGS"]) - myenv.MergeFlags(myenv["SWIFTOOLS_FLAGS"]) - myenv.MergeFlags(myenv["SWIFTEN_FLAGS"]) - myenv.MergeFlags(myenv["CPPUNIT_FLAGS"]) - myenv.MergeFlags(myenv["BOOST_FLAGS"]) - myenv.MergeFlags(myenv["LIBIDN_FLAGS"]) - myenv.MergeFlags(myenv["OPENSSL_FLAGS"]) - - tester = myenv.Program("OpenSSLTest", [ - "OpenSSLCertificateTest.cpp", - ]) - myenv.Test(tester, "system") diff --git a/Swiften/QA/OpenSSLTest/jabber_org.crt b/Swiften/QA/OpenSSLTest/jabber_org.crt Binary files differdeleted file mode 100644 index 5a9ddaa..0000000 --- a/Swiften/QA/OpenSSLTest/jabber_org.crt +++ /dev/null |