diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-09-12 06:38:23 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-09-14 10:42:18 (GMT) |
commit | ba4292f83f92037fdd12b0f7413f628a4b2c7a22 (patch) | |
tree | 31c4f566b5a47e99789ed94702d87e39c53c71f5 /Swiften/Parser/PayloadParsers/UnitTest/StorageParserTest.cpp | |
parent | 234b140b5675c737859ed2457dcb07ad75a900ab (diff) | |
download | swift-contrib-ba4292f83f92037fdd12b0f7413f628a4b2c7a22.zip swift-contrib-ba4292f83f92037fdd12b0f7413f628a4b2c7a22.tar.bz2 |
Added more general PayloadsParserTester.
This tester also tests whether the PayloadParserFactory works properly.
Diffstat (limited to 'Swiften/Parser/PayloadParsers/UnitTest/StorageParserTest.cpp')
-rw-r--r-- | Swiften/Parser/PayloadParsers/UnitTest/StorageParserTest.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/StorageParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/StorageParserTest.cpp index fa188b7..384a0e9 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/StorageParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/StorageParserTest.cpp @@ -2,7 +2,7 @@ #include <cppunit/extensions/TestFactoryRegistry.h> #include "Swiften/Parser/PayloadParsers/StorageParser.h" -#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadParserTester.h" +#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h" using namespace Swift; @@ -17,8 +17,7 @@ class StorageParserTest : public CppUnit::TestFixture StorageParserTest() {} void testParse_Conference() { - StorageParser testling; - PayloadParserTester parser(&testling); + PayloadsParserTester parser; CPPUNIT_ASSERT(parser.parse( "<storage xmlns='storage:bookmarks'>" @@ -30,7 +29,7 @@ class StorageParserTest : public CppUnit::TestFixture "</conference>" "</storage>")); - Storage* payload = dynamic_cast<Storage*>(testling.getPayload().get()); + Storage* payload = dynamic_cast<Storage*>(parser.getPayload().get()); std::vector<Storage::Conference> conferences = payload->getConferences(); CPPUNIT_ASSERT_EQUAL(1U, conferences.size()); CPPUNIT_ASSERT_EQUAL(String("Council of Oberon"), conferences[0].name); @@ -41,8 +40,7 @@ class StorageParserTest : public CppUnit::TestFixture } void testParse_MultipleConferences() { - StorageParser testling; - PayloadParserTester parser(&testling); + PayloadsParserTester parser; CPPUNIT_ASSERT(parser.parse( "<storage xmlns='storage:bookmarks'>" @@ -54,7 +52,7 @@ class StorageParserTest : public CppUnit::TestFixture "jid='teaparty@wonderland.lit' />" "</storage>")); - Storage* payload = dynamic_cast<Storage*>(testling.getPayload().get()); + Storage* payload = dynamic_cast<Storage*>(parser.getPayload().get()); std::vector<Storage::Conference> conferences = payload->getConferences(); CPPUNIT_ASSERT_EQUAL(2U, conferences.size()); CPPUNIT_ASSERT_EQUAL(String("Council of Oberon"), conferences[0].name); |