diff options
Diffstat (limited to 'Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp')
-rw-r--r-- | Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp index 9f9f2fa..7d7b1be 100644 --- a/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp @@ -7,8 +7,10 @@ #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> +#include <QA/Checker/IO.h> using namespace Swift; @@ -23,9 +25,9 @@ class AuthRequestSerializerTest : public CppUnit::TestFixture { void testSerialize() { AuthRequestSerializer testling; boost::shared_ptr<AuthRequest> authRequest(new AuthRequest("PLAIN")); - authRequest->setMessage("foo"); + 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)); @@ -35,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)); } @@ -43,9 +45,9 @@ class AuthRequestSerializerTest : public CppUnit::TestFixture { void testSerialize_EmptyMessage() { AuthRequestSerializer testling; boost::shared_ptr<AuthRequest> authRequest(new AuthRequest("PLAIN")); - authRequest->setMessage(ByteArray()); + 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)); |