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