diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-05-18 16:22:06 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-05-18 16:50:18 (GMT) |
commit | 8472194d716e0e3b95a66bf5be45c246ee79d0af (patch) | |
tree | b9f473e0e606b012ee5013e85d2cf5e7523b7029 /Swiften/Serializer/UnitTest | |
parent | b1b3b8f88517ad8b14795cc8a6265962d2935be3 (diff) | |
download | swift-contrib-8472194d716e0e3b95a66bf5be45c246ee79d0af.zip swift-contrib-8472194d716e0e3b95a66bf5be45c246ee79d0af.tar.bz2 |
Propagate use of SafeByteArray down to the connection.
Diffstat (limited to 'Swiften/Serializer/UnitTest')
5 files changed, 19 insertions, 13 deletions
diff --git a/Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp index a81620d..2dcadcd 100644 --- a/Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp @@ -10,6 +10,7 @@ #include <Swiften/Serializer/AuthChallengeSerializer.h> #include <Swiften/Elements/AuthChallenge.h> #include <Swiften/Base/ByteArray.h> +#include <QA/Checker/IO.h> using namespace Swift; @@ -26,7 +27,7 @@ class AuthChallengeSerializerTest : public CppUnit::TestFixture { boost::shared_ptr<AuthChallenge> authChallenge(new AuthChallenge()); authChallenge->setValue(createByteArray("foo")); - CPPUNIT_ASSERT_EQUAL(std::string( + CPPUNIT_ASSERT_EQUAL(SafeString( "<challenge xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" "Zm9v" "</challenge>"), testling.serialize(authChallenge)); @@ -36,7 +37,7 @@ class AuthChallengeSerializerTest : public CppUnit::TestFixture { AuthChallengeSerializer testling; boost::shared_ptr<AuthChallenge> authChallenge(new AuthChallenge()); - CPPUNIT_ASSERT_EQUAL(std::string( + CPPUNIT_ASSERT_EQUAL(SafeString( "<challenge xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" "</challenge>"), testling.serialize(authChallenge)); } @@ -46,7 +47,7 @@ class AuthChallengeSerializerTest : public CppUnit::TestFixture { boost::shared_ptr<AuthChallenge> authChallenge(new AuthChallenge()); authChallenge->setValue(std::vector<unsigned char>()); - CPPUNIT_ASSERT_EQUAL(std::string( + CPPUNIT_ASSERT_EQUAL(SafeString( "<challenge xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" "=" "</challenge>"), testling.serialize(authChallenge)); diff --git a/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp index d5c0a09..7d7b1be 100644 --- a/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp @@ -10,6 +10,7 @@ #include <Swiften/Serializer/AuthRequestSerializer.h> #include <Swiften/Elements/AuthRequest.h> #include <Swiften/Base/ByteArray.h> +#include <QA/Checker/IO.h> using namespace Swift; @@ -26,7 +27,7 @@ class AuthRequestSerializerTest : public CppUnit::TestFixture { boost::shared_ptr<AuthRequest> authRequest(new AuthRequest("PLAIN")); authRequest->setMessage(createSafeByteArray("foo")); - CPPUNIT_ASSERT_EQUAL(std::string( + CPPUNIT_ASSERT_EQUAL(SafeString( "<auth xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\" mechanism=\"PLAIN\">" "Zm9v" "</auth>"), testling.serialize(authRequest)); @@ -36,7 +37,7 @@ class AuthRequestSerializerTest : public CppUnit::TestFixture { AuthRequestSerializer testling; boost::shared_ptr<AuthRequest> authRequest(new AuthRequest("PLAIN")); - CPPUNIT_ASSERT_EQUAL(std::string( + CPPUNIT_ASSERT_EQUAL(SafeString( "<auth xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\" mechanism=\"PLAIN\">" "</auth>"), testling.serialize(authRequest)); } @@ -46,7 +47,7 @@ class AuthRequestSerializerTest : public CppUnit::TestFixture { boost::shared_ptr<AuthRequest> authRequest(new AuthRequest("PLAIN")); authRequest->setMessage(SafeByteArray()); - CPPUNIT_ASSERT_EQUAL(std::string( + CPPUNIT_ASSERT_EQUAL(SafeString( "<auth xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\" mechanism=\"PLAIN\">" "=" "</auth>"), testling.serialize(authRequest)); diff --git a/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp index 8887b27..3be1185 100644 --- a/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp @@ -10,6 +10,7 @@ #include <Swiften/Serializer/AuthResponseSerializer.h> #include <Swiften/Elements/AuthResponse.h> #include <Swiften/Base/ByteArray.h> +#include <QA/Checker/IO.h> using namespace Swift; @@ -26,7 +27,7 @@ class AuthResponseSerializerTest : public CppUnit::TestFixture { boost::shared_ptr<AuthResponse> authResponse(new AuthResponse()); authResponse->setValue(createSafeByteArray("foo")); - CPPUNIT_ASSERT_EQUAL(std::string( + CPPUNIT_ASSERT_EQUAL(SafeString( "<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" "Zm9v" "</response>"), testling.serialize(authResponse)); @@ -36,7 +37,7 @@ class AuthResponseSerializerTest : public CppUnit::TestFixture { AuthResponseSerializer testling; boost::shared_ptr<AuthResponse> authResponse(new AuthResponse()); - CPPUNIT_ASSERT_EQUAL(std::string( + CPPUNIT_ASSERT_EQUAL(SafeString( "<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" "</response>"), testling.serialize(authResponse)); } @@ -46,7 +47,7 @@ class AuthResponseSerializerTest : public CppUnit::TestFixture { boost::shared_ptr<AuthResponse> authResponse(new AuthResponse()); authResponse->setValue(SafeByteArray()); - CPPUNIT_ASSERT_EQUAL(std::string( + CPPUNIT_ASSERT_EQUAL(SafeString( "<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" "=" "</response>"), testling.serialize(authResponse)); diff --git a/Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp index a9f6de2..b8646c0 100644 --- a/Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp @@ -10,6 +10,7 @@ #include <Swiften/Serializer/AuthSuccessSerializer.h> #include <Swiften/Elements/AuthSuccess.h> #include <Swiften/Base/ByteArray.h> +#include <QA/Checker/IO.h> using namespace Swift; @@ -26,7 +27,7 @@ class AuthSuccessSerializerTest : public CppUnit::TestFixture { boost::shared_ptr<AuthSuccess> authSuccess(new AuthSuccess()); authSuccess->setValue(createByteArray("foo")); - CPPUNIT_ASSERT_EQUAL(std::string( + CPPUNIT_ASSERT_EQUAL(SafeString( "<success xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" "Zm9v" "</success>"), testling.serialize(authSuccess)); @@ -36,7 +37,7 @@ class AuthSuccessSerializerTest : public CppUnit::TestFixture { AuthSuccessSerializer testling; boost::shared_ptr<AuthSuccess> authSuccess(new AuthSuccess()); - CPPUNIT_ASSERT_EQUAL(std::string( + CPPUNIT_ASSERT_EQUAL(SafeString( "<success xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" "</success>"), testling.serialize(authSuccess)); } @@ -46,7 +47,7 @@ class AuthSuccessSerializerTest : public CppUnit::TestFixture { boost::shared_ptr<AuthSuccess> authSuccess(new AuthSuccess()); authSuccess->setValue(std::vector<unsigned char>()); - CPPUNIT_ASSERT_EQUAL(std::string( + CPPUNIT_ASSERT_EQUAL(SafeString( "<success xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" "=" "</success>"), testling.serialize(authSuccess)); diff --git a/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp b/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp index 5b9412b..b30a774 100644 --- a/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp @@ -9,6 +9,8 @@ #include <Swiften/Serializer/StreamFeaturesSerializer.h> #include <Swiften/Elements/StreamFeatures.h> +#include <QA/Checker/IO.h> + using namespace Swift; @@ -34,7 +36,7 @@ class StreamFeaturesSerializerTest : public CppUnit::TestFixture streamFeatures->setHasStreamManagement(); streamFeatures->setHasRosterVersioning(); - CPPUNIT_ASSERT_EQUAL(std::string( + CPPUNIT_ASSERT_EQUAL(SafeString( "<stream:features>" "<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"/>" "<compression xmlns=\"http://jabber.org/features/compress\">" |