summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-09-12 06:38:23 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-09-14 10:42:18 (GMT)
commitba4292f83f92037fdd12b0f7413f628a4b2c7a22 (patch)
tree31c4f566b5a47e99789ed94702d87e39c53c71f5 /Swiften/Parser/PayloadParsers/UnitTest/RosterParserTest.cpp
parent234b140b5675c737859ed2457dcb07ad75a900ab (diff)
downloadswift-ba4292f83f92037fdd12b0f7413f628a4b2c7a22.zip
swift-ba4292f83f92037fdd12b0f7413f628a4b2c7a22.tar.bz2
Added more general PayloadsParserTester.
This tester also tests whether the PayloadParserFactory works properly.
Diffstat (limited to 'Swiften/Parser/PayloadParsers/UnitTest/RosterParserTest.cpp')
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/RosterParserTest.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/RosterParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/RosterParserTest.cpp
index 7f0fc64..4c8db07 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/RosterParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/RosterParserTest.cpp
@@ -2,7 +2,7 @@
#include <cppunit/extensions/TestFactoryRegistry.h>
#include "Swiften/Parser/PayloadParsers/RosterParser.h"
-#include "Swiften/Parser/PayloadParsers/UnitTest/XMLPayloadParser.h"
+#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h"
using namespace Swift;
@@ -16,8 +16,7 @@ class RosterParserTest : public CppUnit::TestFixture
RosterParserTest() {}
void testParse() {
- RosterParser testling;
- XMLPayloadParser parser(&testling);
+ PayloadsParserTester parser;
parser.parse(
"<query xmlns='jabber:iq:roster'>"
" <item jid='foo@bar.com' name='Foo @ Bar' subscription='from' ask='subscribe'>"
@@ -27,7 +26,7 @@ class RosterParserTest : public CppUnit::TestFixture
" <item jid='baz@blo.com' name='Baz'/>"
"</query>");
- RosterPayload* payload = dynamic_cast<RosterPayload*>(testling.getPayload().get());
+ RosterPayload* payload = dynamic_cast<RosterPayload*>(parser.getPayload().get());
const RosterPayload::RosterItemPayloads& items = payload->getItems();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), items.size());