diff options
Diffstat (limited to 'Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp')
-rw-r--r-- | Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp index 4dfb04d..1ee4b62 100644 --- a/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,50 +8,50 @@ #include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/TestFactoryRegistry.h> -#include <Swiften/Serializer/AuthResponseSerializer.h> -#include <Swiften/Elements/AuthResponse.h> #include <Swiften/Base/ByteArray.h> +#include <Swiften/Elements/AuthResponse.h> +#include <Swiften/Serializer/AuthResponseSerializer.h> using namespace Swift; class AuthResponseSerializerTest : public CppUnit::TestFixture { - CPPUNIT_TEST_SUITE(AuthResponseSerializerTest); - CPPUNIT_TEST(testSerialize); - CPPUNIT_TEST(testSerialize_NoMessage); - CPPUNIT_TEST(testSerialize_EmptyMessage); - CPPUNIT_TEST_SUITE_END(); - - public: - void testSerialize() { - AuthResponseSerializer testling; - boost::shared_ptr<AuthResponse> authResponse(new AuthResponse()); - authResponse->setValue(createSafeByteArray("foo")); - - CPPUNIT_ASSERT_EQUAL(createSafeByteArray( - "<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" - "Zm9v" - "</response>"), testling.serialize(authResponse)); - } - - void testSerialize_NoMessage() { - AuthResponseSerializer testling; - boost::shared_ptr<AuthResponse> authResponse(new AuthResponse()); - - CPPUNIT_ASSERT_EQUAL(createSafeByteArray( - "<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" - "</response>"), testling.serialize(authResponse)); - } - - void testSerialize_EmptyMessage() { - AuthResponseSerializer testling; - boost::shared_ptr<AuthResponse> authResponse(new AuthResponse()); - authResponse->setValue(SafeByteArray()); - - CPPUNIT_ASSERT_EQUAL(createSafeByteArray( - "<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" - "" - "</response>"), testling.serialize(authResponse)); - } + CPPUNIT_TEST_SUITE(AuthResponseSerializerTest); + CPPUNIT_TEST(testSerialize); + CPPUNIT_TEST(testSerialize_NoMessage); + CPPUNIT_TEST(testSerialize_EmptyMessage); + CPPUNIT_TEST_SUITE_END(); + + public: + void testSerialize() { + AuthResponseSerializer testling; + std::shared_ptr<AuthResponse> authResponse(new AuthResponse()); + authResponse->setValue(createSafeByteArray("foo")); + + CPPUNIT_ASSERT_EQUAL(createSafeByteArray( + "<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" + "Zm9v" + "</response>"), testling.serialize(authResponse)); + } + + void testSerialize_NoMessage() { + AuthResponseSerializer testling; + std::shared_ptr<AuthResponse> authResponse(new AuthResponse()); + + CPPUNIT_ASSERT_EQUAL(createSafeByteArray( + "<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" + "</response>"), testling.serialize(authResponse)); + } + + void testSerialize_EmptyMessage() { + AuthResponseSerializer testling; + std::shared_ptr<AuthResponse> authResponse(new AuthResponse()); + authResponse->setValue(SafeByteArray()); + + CPPUNIT_ASSERT_EQUAL(createSafeByteArray( + "<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" + "" + "</response>"), testling.serialize(authResponse)); + } }; CPPUNIT_TEST_SUITE_REGISTRATION(AuthResponseSerializerTest); |