summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp')
-rw-r--r--Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp
index c93810c..4b846d7 100644
--- a/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp
+++ b/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp
@@ -3,12 +3,14 @@
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
+#include <QA/Checker/IO.h>
#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,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(createSafeByteArray(
"<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(createSafeByteArray(
"<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(createSafeByteArray(
"<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">"
"="
"</response>"), testling.serialize(authResponse));