summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-01-21 18:36:11 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-01-21 18:36:11 (GMT)
commit739e16ab8fa21f22b8ddf827b0979e71bf613e78 (patch)
tree91bf9bad8e8ade3aa9484fc01dff0221addb4cbe /Swiften/Parser/UnitTest
parentc632dffabdd3387547bd07cd96754deab47703bc (diff)
downloadswift-739e16ab8fa21f22b8ddf827b0979e71bf613e78.zip
swift-739e16ab8fa21f22b8ddf827b0979e71bf613e78.tar.bz2
Code cleanup.
Diffstat (limited to 'Swiften/Parser/UnitTest')
-rw-r--r--Swiften/Parser/UnitTest/IQParserTest.cpp5
-rw-r--r--Swiften/Parser/UnitTest/MessageParserTest.cpp5
-rw-r--r--Swiften/Parser/UnitTest/PresenceParserTest.cpp5
-rw-r--r--Swiften/Parser/UnitTest/StanzaParserTest.cpp5
-rw-r--r--Swiften/Parser/UnitTest/StreamFeaturesParserTest.cpp11
5 files changed, 8 insertions, 23 deletions
diff --git a/Swiften/Parser/UnitTest/IQParserTest.cpp b/Swiften/Parser/UnitTest/IQParserTest.cpp
index 427d32e..3cc7d45 100644
--- a/Swiften/Parser/UnitTest/IQParserTest.cpp
+++ b/Swiften/Parser/UnitTest/IQParserTest.cpp
@@ -13,8 +13,7 @@
using namespace Swift;
-class IQParserTest : public CppUnit::TestFixture
-{
+class IQParserTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(IQParserTest);
CPPUNIT_TEST(testParse_Set);
CPPUNIT_TEST(testParse_Get);
@@ -23,8 +22,6 @@ class IQParserTest : public CppUnit::TestFixture
CPPUNIT_TEST_SUITE_END();
public:
- IQParserTest() {}
-
void setUp() {
factoryCollection_ = new PayloadParserFactoryCollection();
}
diff --git a/Swiften/Parser/UnitTest/MessageParserTest.cpp b/Swiften/Parser/UnitTest/MessageParserTest.cpp
index de9e858..7615fa3 100644
--- a/Swiften/Parser/UnitTest/MessageParserTest.cpp
+++ b/Swiften/Parser/UnitTest/MessageParserTest.cpp
@@ -13,8 +13,7 @@
using namespace Swift;
-class MessageParserTest : public CppUnit::TestFixture
-{
+class MessageParserTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(MessageParserTest);
CPPUNIT_TEST(testParse_Normal);
CPPUNIT_TEST(testParse_Chat);
@@ -24,8 +23,6 @@ class MessageParserTest : public CppUnit::TestFixture
CPPUNIT_TEST_SUITE_END();
public:
- MessageParserTest() {}
-
void setUp() {
factoryCollection_ = new PayloadParserFactoryCollection();
}
diff --git a/Swiften/Parser/UnitTest/PresenceParserTest.cpp b/Swiften/Parser/UnitTest/PresenceParserTest.cpp
index ba7c2d9..f68db40 100644
--- a/Swiften/Parser/UnitTest/PresenceParserTest.cpp
+++ b/Swiften/Parser/UnitTest/PresenceParserTest.cpp
@@ -13,8 +13,7 @@
using namespace Swift;
-class PresenceParserTest : public CppUnit::TestFixture
-{
+class PresenceParserTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(PresenceParserTest);
CPPUNIT_TEST(testParse_Available);
CPPUNIT_TEST(testParse_Unavailable);
@@ -27,8 +26,6 @@ class PresenceParserTest : public CppUnit::TestFixture
CPPUNIT_TEST_SUITE_END();
public:
- PresenceParserTest() {}
-
void setUp() {
factoryCollection_ = new PayloadParserFactoryCollection();
}
diff --git a/Swiften/Parser/UnitTest/StanzaParserTest.cpp b/Swiften/Parser/UnitTest/StanzaParserTest.cpp
index 6e51a9f..48d24da 100644
--- a/Swiften/Parser/UnitTest/StanzaParserTest.cpp
+++ b/Swiften/Parser/UnitTest/StanzaParserTest.cpp
@@ -16,8 +16,7 @@
using namespace Swift;
-class StanzaParserTest : public CppUnit::TestFixture
-{
+class StanzaParserTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(StanzaParserTest);
CPPUNIT_TEST(testHandleEndElement_OnePayload);
CPPUNIT_TEST(testHandleEndElement_MultiplePayloads);
@@ -27,8 +26,6 @@ class StanzaParserTest : public CppUnit::TestFixture
CPPUNIT_TEST_SUITE_END();
public:
- StanzaParserTest() {}
-
void setUp() {
factoryCollection_ = new PayloadParserFactoryCollection();
factoryCollection_->addFactory(&factory1_);
diff --git a/Swiften/Parser/UnitTest/StreamFeaturesParserTest.cpp b/Swiften/Parser/UnitTest/StreamFeaturesParserTest.cpp
index 7f5a398..1cdaf54 100644
--- a/Swiften/Parser/UnitTest/StreamFeaturesParserTest.cpp
+++ b/Swiften/Parser/UnitTest/StreamFeaturesParserTest.cpp
@@ -12,16 +12,13 @@
using namespace Swift;
-class StreamFeaturesParserTest : public CppUnit::TestFixture
-{
+class StreamFeaturesParserTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(StreamFeaturesParserTest);
CPPUNIT_TEST(testParse);
CPPUNIT_TEST(testParse_Empty);
CPPUNIT_TEST_SUITE_END();
public:
- StreamFeaturesParserTest() {}
-
void testParse() {
StreamFeaturesParser testling;
ElementParserTester parser(&testling);
@@ -42,7 +39,7 @@ class StreamFeaturesParserTest : public CppUnit::TestFixture
"<session xmlns=\"urn:ietf:params:xml:ns:xmpp-session\"/>"
"</stream:features>"));
- StreamFeatures* element = dynamic_cast<StreamFeatures*>(testling.getElement().get());
+ StreamFeatures::ref element = boost::dynamic_pointer_cast<StreamFeatures>(testling.getElement());
CPPUNIT_ASSERT(element->hasStartTLS());
CPPUNIT_ASSERT(element->hasSession());
CPPUNIT_ASSERT(element->hasResourceBind());
@@ -58,9 +55,9 @@ class StreamFeaturesParserTest : public CppUnit::TestFixture
StreamFeaturesParser testling;
ElementParserTester parser(&testling);
- parser.parse("<stream:features xmlns:stream='http://etherx.jabber.org/streams'/>");
+ CPPUNIT_ASSERT(parser.parse("<stream:features xmlns:stream='http://etherx.jabber.org/streams'/>"));
- StreamFeatures* element = dynamic_cast<StreamFeatures*>(testling.getElement().get());
+ StreamFeatures::ref element = boost::dynamic_pointer_cast<StreamFeatures>(testling.getElement());
CPPUNIT_ASSERT(!element->hasStartTLS());
CPPUNIT_ASSERT(!element->hasSession());
CPPUNIT_ASSERT(!element->hasResourceBind());