diff options
Diffstat (limited to 'Swiften/Serializer/UnitTest')
6 files changed, 31 insertions, 25 deletions
diff --git a/Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp index af857ef..a81620d 100644 --- a/Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp @@ -7,8 +7,9 @@ #include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/TestFactoryRegistry.h> -#include "Swiften/Serializer/AuthChallengeSerializer.h" -#include "Swiften/Elements/AuthChallenge.h" +#include <Swiften/Serializer/AuthChallengeSerializer.h> +#include <Swiften/Elements/AuthChallenge.h> +#include <Swiften/Base/ByteArray.h> using namespace Swift; @@ -23,7 +24,7 @@ class AuthChallengeSerializerTest : public CppUnit::TestFixture { void testSerialize() { AuthChallengeSerializer testling; boost::shared_ptr<AuthChallenge> authChallenge(new AuthChallenge()); - authChallenge->setValue("foo"); + authChallenge->setValue(createByteArray("foo")); CPPUNIT_ASSERT_EQUAL(std::string( "<challenge xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" @@ -43,7 +44,7 @@ class AuthChallengeSerializerTest : public CppUnit::TestFixture { void testSerialize_EmptyMessage() { AuthChallengeSerializer testling; boost::shared_ptr<AuthChallenge> authChallenge(new AuthChallenge()); - authChallenge->setValue(ByteArray()); + authChallenge->setValue(std::vector<unsigned char>()); CPPUNIT_ASSERT_EQUAL(std::string( "<challenge xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" diff --git a/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp index 9f9f2fa..8270139 100644 --- a/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp @@ -7,8 +7,9 @@ #include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/TestFactoryRegistry.h> -#include "Swiften/Serializer/AuthRequestSerializer.h" -#include "Swiften/Elements/AuthRequest.h" +#include <Swiften/Serializer/AuthRequestSerializer.h> +#include <Swiften/Elements/AuthRequest.h> +#include <Swiften/Base/ByteArray.h> using namespace Swift; @@ -23,7 +24,7 @@ class AuthRequestSerializerTest : public CppUnit::TestFixture { void testSerialize() { AuthRequestSerializer testling; boost::shared_ptr<AuthRequest> authRequest(new AuthRequest("PLAIN")); - authRequest->setMessage("foo"); + authRequest->setMessage(createByteArray("foo")); CPPUNIT_ASSERT_EQUAL(std::string( "<auth xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\" mechanism=\"PLAIN\">" @@ -43,7 +44,7 @@ class AuthRequestSerializerTest : public CppUnit::TestFixture { void testSerialize_EmptyMessage() { AuthRequestSerializer testling; boost::shared_ptr<AuthRequest> authRequest(new AuthRequest("PLAIN")); - authRequest->setMessage(ByteArray()); + authRequest->setMessage(std::vector<unsigned char>()); CPPUNIT_ASSERT_EQUAL(std::string( "<auth xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\" mechanism=\"PLAIN\">" diff --git a/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp index c93810c..e790cc3 100644 --- a/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp @@ -7,8 +7,9 @@ #include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/TestFactoryRegistry.h> -#include "Swiften/Serializer/AuthResponseSerializer.h" -#include "Swiften/Elements/AuthResponse.h" +#include <Swiften/Serializer/AuthResponseSerializer.h> +#include <Swiften/Elements/AuthResponse.h> +#include <Swiften/Base/ByteArray.h> using namespace Swift; @@ -23,7 +24,7 @@ class AuthResponseSerializerTest : public CppUnit::TestFixture { void testSerialize() { AuthResponseSerializer testling; boost::shared_ptr<AuthResponse> authResponse(new AuthResponse()); - authResponse->setValue("foo"); + authResponse->setValue(createByteArray("foo")); CPPUNIT_ASSERT_EQUAL(std::string( "<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" @@ -43,7 +44,7 @@ class AuthResponseSerializerTest : public CppUnit::TestFixture { void testSerialize_EmptyMessage() { AuthResponseSerializer testling; boost::shared_ptr<AuthResponse> authResponse(new AuthResponse()); - authResponse->setValue(ByteArray()); + authResponse->setValue(std::vector<unsigned char>()); CPPUNIT_ASSERT_EQUAL(std::string( "<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" diff --git a/Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp index 385c1e5..a9f6de2 100644 --- a/Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp @@ -7,8 +7,9 @@ #include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/TestFactoryRegistry.h> -#include "Swiften/Serializer/AuthSuccessSerializer.h" -#include "Swiften/Elements/AuthSuccess.h" +#include <Swiften/Serializer/AuthSuccessSerializer.h> +#include <Swiften/Elements/AuthSuccess.h> +#include <Swiften/Base/ByteArray.h> using namespace Swift; @@ -23,7 +24,7 @@ class AuthSuccessSerializerTest : public CppUnit::TestFixture { void testSerialize() { AuthSuccessSerializer testling; boost::shared_ptr<AuthSuccess> authSuccess(new AuthSuccess()); - authSuccess->setValue("foo"); + authSuccess->setValue(createByteArray("foo")); CPPUNIT_ASSERT_EQUAL(std::string( "<success xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" @@ -43,7 +44,7 @@ class AuthSuccessSerializerTest : public CppUnit::TestFixture { void testSerialize_EmptyMessage() { AuthSuccessSerializer testling; boost::shared_ptr<AuthSuccess> authSuccess(new AuthSuccess()); - authSuccess->setValue(ByteArray()); + authSuccess->setValue(std::vector<unsigned char>()); CPPUNIT_ASSERT_EQUAL(std::string( "<success xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" diff --git a/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp b/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp index 65caa81..5b9412b 100644 --- a/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp @@ -7,8 +7,8 @@ #include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/TestFactoryRegistry.h> -#include "Swiften/Serializer/StreamFeaturesSerializer.h" -#include "Swiften/Elements/StreamFeatures.h" +#include <Swiften/Serializer/StreamFeaturesSerializer.h> +#include <Swiften/Elements/StreamFeatures.h> using namespace Swift; @@ -32,6 +32,7 @@ class StreamFeaturesSerializerTest : public CppUnit::TestFixture streamFeatures->setHasResourceBind(); streamFeatures->setHasSession(); streamFeatures->setHasStreamManagement(); + streamFeatures->setHasRosterVersioning(); CPPUNIT_ASSERT_EQUAL(std::string( "<stream:features>" @@ -47,6 +48,7 @@ class StreamFeaturesSerializerTest : public CppUnit::TestFixture "<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)); } }; diff --git a/Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp b/Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp index 76c1b23..c0ab841 100644 --- a/Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp @@ -7,10 +7,10 @@ #include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/TestFactoryRegistry.h> -#include "Swiften/Serializer/XMPPSerializer.h" -#include "Swiften/Elements/AuthChallenge.h" -#include "Swiften/Serializer/PayloadSerializerCollection.h" -#include "Swiften/Elements/ProtocolHeader.h" +#include <Swiften/Serializer/XMPPSerializer.h> +#include <Swiften/Elements/AuthChallenge.h> +#include <Swiften/Serializer/PayloadSerializerCollection.h> +#include <Swiften/Elements/ProtocolHeader.h> using namespace Swift; @@ -31,7 +31,7 @@ class XMPPSerializerTest : public CppUnit::TestFixture { } void testSerializeHeader_Client() { - std::auto_ptr<XMPPSerializer> testling(createSerializer(ClientStreamType)); + boost::shared_ptr<XMPPSerializer> testling(createSerializer(ClientStreamType)); ProtocolHeader protocolHeader; protocolHeader.setFrom("bla@foo.com"); protocolHeader.setTo("foo.com"); @@ -42,7 +42,7 @@ class XMPPSerializerTest : public CppUnit::TestFixture { } void testSerializeHeader_Component() { - std::auto_ptr<XMPPSerializer> testling(createSerializer(ComponentStreamType)); + boost::shared_ptr<XMPPSerializer> testling(createSerializer(ComponentStreamType)); ProtocolHeader protocolHeader; protocolHeader.setFrom("bla@foo.com"); protocolHeader.setTo("foo.com"); @@ -53,7 +53,7 @@ class XMPPSerializerTest : public CppUnit::TestFixture { } void testSerializeHeader_Server() { - std::auto_ptr<XMPPSerializer> testling(createSerializer(ServerStreamType)); + boost::shared_ptr<XMPPSerializer> testling(createSerializer(ServerStreamType)); ProtocolHeader protocolHeader; protocolHeader.setFrom("bla@foo.com"); protocolHeader.setTo("foo.com"); |