diff options
author | Tobias Markmann <tm@ayena.de> | 2016-03-31 14:57:35 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2016-03-31 14:57:35 (GMT) |
commit | cfbdb43d2cadd40aa87338d41548e4bf89e146e6 (patch) | |
tree | 18d94153a302445196fc0c18586abf44a1ce4a38 /Swiften/Serializer/UnitTest | |
parent | 1d545a4a7fb877f021508094b88c1f17b30d8b4e (diff) | |
download | swift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.zip swift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.tar.bz2 |
Convert tabs to 4 spaces for all source files
Removed trailing spaces and whitespace on empty lines
in the process.
Changed CheckTabs.py tool to disallow hard tabs in source
files.
Test-Information:
Manually checked 30 random files that the conversion worked
as expected.
Change-Id: I874f99d617bd3d2bb55f02d58f22f58f9b094480
Diffstat (limited to 'Swiften/Serializer/UnitTest')
6 files changed, 230 insertions, 230 deletions
diff --git a/Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp index 71da7e8..1d41e81 100644 --- a/Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp @@ -15,43 +15,43 @@ using namespace Swift; class AuthChallengeSerializerTest : public CppUnit::TestFixture { - CPPUNIT_TEST_SUITE(AuthChallengeSerializerTest); - CPPUNIT_TEST(testSerialize); - CPPUNIT_TEST(testSerialize_NoMessage); - CPPUNIT_TEST(testSerialize_EmptyMessage); - CPPUNIT_TEST_SUITE_END(); - - public: - void testSerialize() { - AuthChallengeSerializer testling; - boost::shared_ptr<AuthChallenge> authChallenge(new AuthChallenge()); - authChallenge->setValue(createByteArray("foo")); - - CPPUNIT_ASSERT_EQUAL(createSafeByteArray( - "<challenge xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" - "Zm9v" - "</challenge>"), testling.serialize(authChallenge)); - } - - void testSerialize_NoMessage() { - AuthChallengeSerializer testling; - boost::shared_ptr<AuthChallenge> authChallenge(new AuthChallenge()); - - CPPUNIT_ASSERT_EQUAL(createSafeByteArray( - "<challenge xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" - "</challenge>"), testling.serialize(authChallenge)); - } - - void testSerialize_EmptyMessage() { - AuthChallengeSerializer testling; - boost::shared_ptr<AuthChallenge> authChallenge(new AuthChallenge()); - authChallenge->setValue(std::vector<unsigned char>()); - - CPPUNIT_ASSERT_EQUAL(createSafeByteArray( - "<challenge xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" - "=" - "</challenge>"), testling.serialize(authChallenge)); - } + CPPUNIT_TEST_SUITE(AuthChallengeSerializerTest); + CPPUNIT_TEST(testSerialize); + CPPUNIT_TEST(testSerialize_NoMessage); + CPPUNIT_TEST(testSerialize_EmptyMessage); + CPPUNIT_TEST_SUITE_END(); + + public: + void testSerialize() { + AuthChallengeSerializer testling; + boost::shared_ptr<AuthChallenge> authChallenge(new AuthChallenge()); + authChallenge->setValue(createByteArray("foo")); + + CPPUNIT_ASSERT_EQUAL(createSafeByteArray( + "<challenge xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" + "Zm9v" + "</challenge>"), testling.serialize(authChallenge)); + } + + void testSerialize_NoMessage() { + AuthChallengeSerializer testling; + boost::shared_ptr<AuthChallenge> authChallenge(new AuthChallenge()); + + CPPUNIT_ASSERT_EQUAL(createSafeByteArray( + "<challenge xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" + "</challenge>"), testling.serialize(authChallenge)); + } + + void testSerialize_EmptyMessage() { + AuthChallengeSerializer testling; + boost::shared_ptr<AuthChallenge> authChallenge(new AuthChallenge()); + authChallenge->setValue(std::vector<unsigned char>()); + + CPPUNIT_ASSERT_EQUAL(createSafeByteArray( + "<challenge xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" + "=" + "</challenge>"), testling.serialize(authChallenge)); + } }; CPPUNIT_TEST_SUITE_REGISTRATION(AuthChallengeSerializerTest); diff --git a/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp index b27b736..95460b2 100644 --- a/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp @@ -15,43 +15,43 @@ using namespace Swift; class AuthRequestSerializerTest : public CppUnit::TestFixture { - CPPUNIT_TEST_SUITE(AuthRequestSerializerTest); - CPPUNIT_TEST(testSerialize); - CPPUNIT_TEST(testSerialize_NoMessage); - CPPUNIT_TEST(testSerialize_EmptyMessage); - CPPUNIT_TEST_SUITE_END(); - - public: - void testSerialize() { - AuthRequestSerializer testling; - boost::shared_ptr<AuthRequest> authRequest(new AuthRequest("PLAIN")); - authRequest->setMessage(createSafeByteArray("foo")); - - CPPUNIT_ASSERT_EQUAL(createSafeByteArray( - "<auth xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\" mechanism=\"PLAIN\">" - "Zm9v" - "</auth>"), testling.serialize(authRequest)); - } - - void testSerialize_NoMessage() { - AuthRequestSerializer testling; - boost::shared_ptr<AuthRequest> authRequest(new AuthRequest("PLAIN")); - - CPPUNIT_ASSERT_EQUAL(createSafeByteArray( - "<auth xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\" mechanism=\"PLAIN\">" - "</auth>"), testling.serialize(authRequest)); - } - - void testSerialize_EmptyMessage() { - AuthRequestSerializer testling; - boost::shared_ptr<AuthRequest> authRequest(new AuthRequest("PLAIN")); - authRequest->setMessage(SafeByteArray()); - - CPPUNIT_ASSERT_EQUAL(createSafeByteArray( - "<auth xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\" mechanism=\"PLAIN\">" - "=" - "</auth>"), testling.serialize(authRequest)); - } + CPPUNIT_TEST_SUITE(AuthRequestSerializerTest); + CPPUNIT_TEST(testSerialize); + CPPUNIT_TEST(testSerialize_NoMessage); + CPPUNIT_TEST(testSerialize_EmptyMessage); + CPPUNIT_TEST_SUITE_END(); + + public: + void testSerialize() { + AuthRequestSerializer testling; + boost::shared_ptr<AuthRequest> authRequest(new AuthRequest("PLAIN")); + authRequest->setMessage(createSafeByteArray("foo")); + + CPPUNIT_ASSERT_EQUAL(createSafeByteArray( + "<auth xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\" mechanism=\"PLAIN\">" + "Zm9v" + "</auth>"), testling.serialize(authRequest)); + } + + void testSerialize_NoMessage() { + AuthRequestSerializer testling; + boost::shared_ptr<AuthRequest> authRequest(new AuthRequest("PLAIN")); + + CPPUNIT_ASSERT_EQUAL(createSafeByteArray( + "<auth xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\" mechanism=\"PLAIN\">" + "</auth>"), testling.serialize(authRequest)); + } + + void testSerialize_EmptyMessage() { + AuthRequestSerializer testling; + boost::shared_ptr<AuthRequest> authRequest(new AuthRequest("PLAIN")); + authRequest->setMessage(SafeByteArray()); + + CPPUNIT_ASSERT_EQUAL(createSafeByteArray( + "<auth xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\" mechanism=\"PLAIN\">" + "=" + "</auth>"), testling.serialize(authRequest)); + } }; CPPUNIT_TEST_SUITE_REGISTRATION(AuthRequestSerializerTest); diff --git a/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp index fdff30b..67c6f16 100644 --- a/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp @@ -15,43 +15,43 @@ 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; + 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_REGISTRATION(AuthResponseSerializerTest); diff --git a/Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp index 2d9b610..228bd9b 100644 --- a/Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp @@ -15,43 +15,43 @@ using namespace Swift; class AuthSuccessSerializerTest : public CppUnit::TestFixture { - CPPUNIT_TEST_SUITE(AuthSuccessSerializerTest); - CPPUNIT_TEST(testSerialize); - CPPUNIT_TEST(testSerialize_NoMessage); - CPPUNIT_TEST(testSerialize_EmptyMessage); - CPPUNIT_TEST_SUITE_END(); - - public: - void testSerialize() { - AuthSuccessSerializer testling; - boost::shared_ptr<AuthSuccess> authSuccess(new AuthSuccess()); - authSuccess->setValue(createByteArray("foo")); - - CPPUNIT_ASSERT_EQUAL(createSafeByteArray( - "<success xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" - "Zm9v" - "</success>"), testling.serialize(authSuccess)); - } - - void testSerialize_NoMessage() { - AuthSuccessSerializer testling; - boost::shared_ptr<AuthSuccess> authSuccess(new AuthSuccess()); - - CPPUNIT_ASSERT_EQUAL(createSafeByteArray( - "<success xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" - "</success>"), testling.serialize(authSuccess)); - } - - void testSerialize_EmptyMessage() { - AuthSuccessSerializer testling; - boost::shared_ptr<AuthSuccess> authSuccess(new AuthSuccess()); - authSuccess->setValue(std::vector<unsigned char>()); - - CPPUNIT_ASSERT_EQUAL(createSafeByteArray( - "<success xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" - "=" - "</success>"), testling.serialize(authSuccess)); - } + CPPUNIT_TEST_SUITE(AuthSuccessSerializerTest); + CPPUNIT_TEST(testSerialize); + CPPUNIT_TEST(testSerialize_NoMessage); + CPPUNIT_TEST(testSerialize_EmptyMessage); + CPPUNIT_TEST_SUITE_END(); + + public: + void testSerialize() { + AuthSuccessSerializer testling; + boost::shared_ptr<AuthSuccess> authSuccess(new AuthSuccess()); + authSuccess->setValue(createByteArray("foo")); + + CPPUNIT_ASSERT_EQUAL(createSafeByteArray( + "<success xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" + "Zm9v" + "</success>"), testling.serialize(authSuccess)); + } + + void testSerialize_NoMessage() { + AuthSuccessSerializer testling; + boost::shared_ptr<AuthSuccess> authSuccess(new AuthSuccess()); + + CPPUNIT_ASSERT_EQUAL(createSafeByteArray( + "<success xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" + "</success>"), testling.serialize(authSuccess)); + } + + void testSerialize_EmptyMessage() { + AuthSuccessSerializer testling; + boost::shared_ptr<AuthSuccess> authSuccess(new AuthSuccess()); + authSuccess->setValue(std::vector<unsigned char>()); + + CPPUNIT_ASSERT_EQUAL(createSafeByteArray( + "<success xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" + "=" + "</success>"), testling.serialize(authSuccess)); + } }; CPPUNIT_TEST_SUITE_REGISTRATION(AuthSuccessSerializerTest); diff --git a/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp b/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp index adfadbc..5f4f821 100644 --- a/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp @@ -15,43 +15,43 @@ using namespace Swift; class StreamFeaturesSerializerTest : public CppUnit::TestFixture { - CPPUNIT_TEST_SUITE(StreamFeaturesSerializerTest); - CPPUNIT_TEST(testSerialize); - CPPUNIT_TEST_SUITE_END(); - - public: - StreamFeaturesSerializerTest() {} - - void testSerialize() { - StreamFeaturesSerializer testling; - boost::shared_ptr<StreamFeatures> streamFeatures(new StreamFeatures()); - streamFeatures->setHasStartTLS(); - streamFeatures->addCompressionMethod("zlib"); - streamFeatures->addCompressionMethod("lzw"); - streamFeatures->addAuthenticationMechanism("DIGEST-MD5"); - streamFeatures->addAuthenticationMechanism("PLAIN"); - streamFeatures->setHasResourceBind(); - streamFeatures->setHasSession(); - streamFeatures->setHasStreamManagement(); - streamFeatures->setHasRosterVersioning(); - - CPPUNIT_ASSERT_EQUAL(createSafeByteArray( - "<stream:features>" - "<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"/>" - "<compression xmlns=\"http://jabber.org/features/compress\">" - "<method>zlib</method>" - "<method>lzw</method>" - "</compression>" - "<mechanisms xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" - "<mechanism>DIGEST-MD5</mechanism>" - "<mechanism>PLAIN</mechanism>" - "</mechanisms>" - "<bind xmlns=\"urn:ietf:params:xml:ns:xmpp-bind\"/>" - "<session xmlns=\"urn:ietf:params:xml:ns:xmpp-session\"/>" - "<sm xmlns=\"urn:xmpp:sm:2\"/>" - "<ver xmlns=\"urn:xmpp:features:rosterver\"/>" - "</stream:features>"), testling.serialize(streamFeatures)); - } + CPPUNIT_TEST_SUITE(StreamFeaturesSerializerTest); + CPPUNIT_TEST(testSerialize); + CPPUNIT_TEST_SUITE_END(); + + public: + StreamFeaturesSerializerTest() {} + + void testSerialize() { + StreamFeaturesSerializer testling; + boost::shared_ptr<StreamFeatures> streamFeatures(new StreamFeatures()); + streamFeatures->setHasStartTLS(); + streamFeatures->addCompressionMethod("zlib"); + streamFeatures->addCompressionMethod("lzw"); + streamFeatures->addAuthenticationMechanism("DIGEST-MD5"); + streamFeatures->addAuthenticationMechanism("PLAIN"); + streamFeatures->setHasResourceBind(); + streamFeatures->setHasSession(); + streamFeatures->setHasStreamManagement(); + streamFeatures->setHasRosterVersioning(); + + CPPUNIT_ASSERT_EQUAL(createSafeByteArray( + "<stream:features>" + "<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"/>" + "<compression xmlns=\"http://jabber.org/features/compress\">" + "<method>zlib</method>" + "<method>lzw</method>" + "</compression>" + "<mechanisms xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" + "<mechanism>DIGEST-MD5</mechanism>" + "<mechanism>PLAIN</mechanism>" + "</mechanisms>" + "<bind xmlns=\"urn:ietf:params:xml:ns:xmpp-bind\"/>" + "<session xmlns=\"urn:ietf:params:xml:ns:xmpp-session\"/>" + "<sm xmlns=\"urn:xmpp:sm:2\"/>" + "<ver xmlns=\"urn:xmpp:features:rosterver\"/>" + "</stream:features>"), testling.serialize(streamFeatures)); + } }; CPPUNIT_TEST_SUITE_REGISTRATION(StreamFeaturesSerializerTest); diff --git a/Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp b/Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp index 83bb737..3eaeef0 100644 --- a/Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp @@ -15,61 +15,61 @@ using namespace Swift; class XMPPSerializerTest : public CppUnit::TestFixture { - CPPUNIT_TEST_SUITE(XMPPSerializerTest); - CPPUNIT_TEST(testSerializeHeader_Client); - CPPUNIT_TEST(testSerializeHeader_Component); - CPPUNIT_TEST(testSerializeHeader_Server); - CPPUNIT_TEST_SUITE_END(); + CPPUNIT_TEST_SUITE(XMPPSerializerTest); + CPPUNIT_TEST(testSerializeHeader_Client); + CPPUNIT_TEST(testSerializeHeader_Component); + CPPUNIT_TEST(testSerializeHeader_Server); + CPPUNIT_TEST_SUITE_END(); - public: - void setUp() { - payloadSerializerCollection = new PayloadSerializerCollection(); - } + public: + void setUp() { + payloadSerializerCollection = new PayloadSerializerCollection(); + } - void tearDown() { - delete payloadSerializerCollection; - } + void tearDown() { + delete payloadSerializerCollection; + } - void testSerializeHeader_Client() { - boost::shared_ptr<XMPPSerializer> testling(createSerializer(ClientStreamType)); - ProtocolHeader protocolHeader; - protocolHeader.setFrom("bla@foo.com"); - protocolHeader.setTo("foo.com"); - protocolHeader.setID("myid"); - protocolHeader.setVersion("0.99"); + void testSerializeHeader_Client() { + boost::shared_ptr<XMPPSerializer> testling(createSerializer(ClientStreamType)); + ProtocolHeader protocolHeader; + protocolHeader.setFrom("bla@foo.com"); + protocolHeader.setTo("foo.com"); + protocolHeader.setID("myid"); + protocolHeader.setVersion("0.99"); - CPPUNIT_ASSERT_EQUAL(std::string("<?xml version=\"1.0\"?><stream:stream xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\" from=\"bla@foo.com\" to=\"foo.com\" id=\"myid\" version=\"0.99\">"), testling->serializeHeader(protocolHeader)); - } + CPPUNIT_ASSERT_EQUAL(std::string("<?xml version=\"1.0\"?><stream:stream xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\" from=\"bla@foo.com\" to=\"foo.com\" id=\"myid\" version=\"0.99\">"), testling->serializeHeader(protocolHeader)); + } - void testSerializeHeader_Component() { - boost::shared_ptr<XMPPSerializer> testling(createSerializer(ComponentStreamType)); - ProtocolHeader protocolHeader; - protocolHeader.setFrom("bla@foo.com"); - protocolHeader.setTo("foo.com"); - protocolHeader.setID("myid"); - protocolHeader.setVersion("0.99"); + void testSerializeHeader_Component() { + boost::shared_ptr<XMPPSerializer> testling(createSerializer(ComponentStreamType)); + ProtocolHeader protocolHeader; + protocolHeader.setFrom("bla@foo.com"); + protocolHeader.setTo("foo.com"); + protocolHeader.setID("myid"); + protocolHeader.setVersion("0.99"); - CPPUNIT_ASSERT_EQUAL(std::string("<?xml version=\"1.0\"?><stream:stream xmlns=\"jabber:component:accept\" xmlns:stream=\"http://etherx.jabber.org/streams\" from=\"bla@foo.com\" to=\"foo.com\" id=\"myid\" version=\"0.99\">"), testling->serializeHeader(protocolHeader)); - } + CPPUNIT_ASSERT_EQUAL(std::string("<?xml version=\"1.0\"?><stream:stream xmlns=\"jabber:component:accept\" xmlns:stream=\"http://etherx.jabber.org/streams\" from=\"bla@foo.com\" to=\"foo.com\" id=\"myid\" version=\"0.99\">"), testling->serializeHeader(protocolHeader)); + } - void testSerializeHeader_Server() { - boost::shared_ptr<XMPPSerializer> testling(createSerializer(ServerStreamType)); - ProtocolHeader protocolHeader; - protocolHeader.setFrom("bla@foo.com"); - protocolHeader.setTo("foo.com"); - protocolHeader.setID("myid"); - protocolHeader.setVersion("0.99"); + void testSerializeHeader_Server() { + boost::shared_ptr<XMPPSerializer> testling(createSerializer(ServerStreamType)); + ProtocolHeader protocolHeader; + protocolHeader.setFrom("bla@foo.com"); + protocolHeader.setTo("foo.com"); + protocolHeader.setID("myid"); + protocolHeader.setVersion("0.99"); - CPPUNIT_ASSERT_EQUAL(std::string("<?xml version=\"1.0\"?><stream:stream xmlns=\"jabber:server\" xmlns:stream=\"http://etherx.jabber.org/streams\" from=\"bla@foo.com\" to=\"foo.com\" id=\"myid\" version=\"0.99\">"), testling->serializeHeader(protocolHeader)); - } + CPPUNIT_ASSERT_EQUAL(std::string("<?xml version=\"1.0\"?><stream:stream xmlns=\"jabber:server\" xmlns:stream=\"http://etherx.jabber.org/streams\" from=\"bla@foo.com\" to=\"foo.com\" id=\"myid\" version=\"0.99\">"), testling->serializeHeader(protocolHeader)); + } - private: - XMPPSerializer* createSerializer(StreamType type) { - return new XMPPSerializer(payloadSerializerCollection, type, false); - } + private: + XMPPSerializer* createSerializer(StreamType type) { + return new XMPPSerializer(payloadSerializerCollection, type, false); + } - private: - PayloadSerializerCollection* payloadSerializerCollection; + private: + PayloadSerializerCollection* payloadSerializerCollection; }; CPPUNIT_TEST_SUITE_REGISTRATION(XMPPSerializerTest); |