summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/StreamManagement')
-rw-r--r--Swiften/StreamManagement/StanzaAckRequester.cpp7
-rw-r--r--Swiften/StreamManagement/StanzaAckRequester.h4
-rw-r--r--Swiften/StreamManagement/StanzaAckResponder.cpp2
-rw-r--r--Swiften/StreamManagement/StanzaAckResponder.h4
-rw-r--r--Swiften/StreamManagement/UnitTest/StanzaAckRequesterTest.cpp24
-rw-r--r--Swiften/StreamManagement/UnitTest/StanzaAckResponderTest.cpp12
6 files changed, 27 insertions, 26 deletions
diff --git a/Swiften/StreamManagement/StanzaAckRequester.cpp b/Swiften/StreamManagement/StanzaAckRequester.cpp
index f7d603b..b60b9b0 100644
--- a/Swiften/StreamManagement/StanzaAckRequester.cpp
+++ b/Swiften/StreamManagement/StanzaAckRequester.cpp
@@ -4,11 +4,12 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/StreamManagement/StanzaAckRequester.h"
+#include <Swiften/StreamManagement/StanzaAckRequester.h>
#include <boost/numeric/conversion/cast.hpp>
+#include <iostream>
-#include "Swiften/Elements/Message.h"
+#include <Swiften/Elements/Message.h>
namespace Swift {
@@ -28,7 +29,7 @@ void StanzaAckRequester::handleStanzaSent(boost::shared_ptr<Stanza> stanza) {
void StanzaAckRequester::handleAckReceived(unsigned int handledStanzasCount) {
unsigned int i = lastHandledStanzasCount;
while (i != handledStanzasCount) {
- if (unackedStanzas.size() == 0) {
+ if (unackedStanzas.empty()) {
std::cerr << "Warning: Server acked more stanzas than we sent" << std::endl;
break;
}
diff --git a/Swiften/StreamManagement/StanzaAckRequester.h b/Swiften/StreamManagement/StanzaAckRequester.h
index 89f068e..e8e4997 100644
--- a/Swiften/StreamManagement/StanzaAckRequester.h
+++ b/Swiften/StreamManagement/StanzaAckRequester.h
@@ -9,8 +9,8 @@
#include <boost/shared_ptr.hpp>
#include <deque>
-#include "Swiften/Elements/Stanza.h"
-#include "Swiften/Base/boost_bsignals.h"
+#include <Swiften/Elements/Stanza.h>
+#include <Swiften/Base/boost_bsignals.h>
namespace Swift {
class StanzaAckRequester {
diff --git a/Swiften/StreamManagement/StanzaAckResponder.cpp b/Swiften/StreamManagement/StanzaAckResponder.cpp
index 5b71f91..9295924 100644
--- a/Swiften/StreamManagement/StanzaAckResponder.cpp
+++ b/Swiften/StreamManagement/StanzaAckResponder.cpp
@@ -4,7 +4,7 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/StreamManagement/StanzaAckResponder.h"
+#include <Swiften/StreamManagement/StanzaAckResponder.h>
#include <boost/numeric/conversion/cast.hpp>
diff --git a/Swiften/StreamManagement/StanzaAckResponder.h b/Swiften/StreamManagement/StanzaAckResponder.h
index bc83aa1..b5888b7 100644
--- a/Swiften/StreamManagement/StanzaAckResponder.h
+++ b/Swiften/StreamManagement/StanzaAckResponder.h
@@ -8,8 +8,8 @@
#include <boost/shared_ptr.hpp>
-#include "Swiften/Elements/Stanza.h"
-#include "Swiften/Base/boost_bsignals.h"
+#include <Swiften/Elements/Stanza.h>
+#include <Swiften/Base/boost_bsignals.h>
namespace Swift {
class StanzaAckResponder {
diff --git a/Swiften/StreamManagement/UnitTest/StanzaAckRequesterTest.cpp b/Swiften/StreamManagement/UnitTest/StanzaAckRequesterTest.cpp
index 1028ae7..baccc41 100644
--- a/Swiften/StreamManagement/UnitTest/StanzaAckRequesterTest.cpp
+++ b/Swiften/StreamManagement/UnitTest/StanzaAckRequesterTest.cpp
@@ -9,10 +9,10 @@
#include <boost/bind.hpp>
#include <boost/numeric/conversion/cast.hpp>
-#include "Swiften/StreamManagement/StanzaAckRequester.h"
-#include "Swiften/Elements/Message.h"
-#include "Swiften/Elements/Presence.h"
-#include "Swiften/Elements/IQ.h"
+#include <Swiften/StreamManagement/StanzaAckRequester.h>
+#include <Swiften/Elements/Message.h>
+#include <Swiften/Elements/Presence.h>
+#include <Swiften/Elements/IQ.h>
using namespace Swift;
@@ -36,28 +36,28 @@ class StanzaAckRequesterTest : public CppUnit::TestFixture {
}
void testHandleStanzaSent_MessageRequestsAck() {
- std::auto_ptr<StanzaAckRequester> testling(createRequester());
+ boost::shared_ptr<StanzaAckRequester> testling(createRequester());
testling->handleStanzaSent(createMessage("m1"));
CPPUNIT_ASSERT_EQUAL(1, acksRequested);
}
void testHandleStanzaSent_IQDoesNotRequestAck() {
- std::auto_ptr<StanzaAckRequester> testling(createRequester());
+ boost::shared_ptr<StanzaAckRequester> testling(createRequester());
testling->handleStanzaSent(createIQ("iq1"));
CPPUNIT_ASSERT_EQUAL(0, acksRequested);
}
void testHandleStanzaSent_PresenceDoesNotRequestAck() {
- std::auto_ptr<StanzaAckRequester> testling(createRequester());
+ boost::shared_ptr<StanzaAckRequester> testling(createRequester());
testling->handleStanzaSent(createPresence("p1"));
CPPUNIT_ASSERT_EQUAL(0, acksRequested);
}
void testHandleAckReceived_AcksStanza() {
- std::auto_ptr<StanzaAckRequester> testling(createRequester());
+ boost::shared_ptr<StanzaAckRequester> testling(createRequester());
testling->handleStanzaSent(createMessage("m1"));
testling->handleAckReceived(1);
@@ -67,7 +67,7 @@ class StanzaAckRequesterTest : public CppUnit::TestFixture {
}
void testHandleAckReceived_AcksMultipleMessages() {
- std::auto_ptr<StanzaAckRequester> testling(createRequester());
+ boost::shared_ptr<StanzaAckRequester> testling(createRequester());
testling->handleStanzaSent(createMessage("m1"));
testling->handleStanzaSent(createMessage("m2"));
@@ -79,7 +79,7 @@ class StanzaAckRequesterTest : public CppUnit::TestFixture {
}
void testHandleAckReceived_AcksMultipleStanzas() {
- std::auto_ptr<StanzaAckRequester> testling(createRequester());
+ boost::shared_ptr<StanzaAckRequester> testling(createRequester());
testling->handleStanzaSent(createIQ("iq1"));
testling->handleStanzaSent(createPresence("p1"));
testling->handleStanzaSent(createMessage("m1"));
@@ -93,7 +93,7 @@ class StanzaAckRequesterTest : public CppUnit::TestFixture {
}
void testHandleAckReceived_MultipleAcks() {
- std::auto_ptr<StanzaAckRequester> testling(createRequester());
+ boost::shared_ptr<StanzaAckRequester> testling(createRequester());
testling->handleStanzaSent(createMessage("m1"));
testling->handleAckReceived(1);
@@ -109,7 +109,7 @@ class StanzaAckRequesterTest : public CppUnit::TestFixture {
// Handle stanza ack count wrapping, as per the XEP
void testHandleAckReceived_WrapAround() {
- std::auto_ptr<StanzaAckRequester> testling(createRequester());
+ boost::shared_ptr<StanzaAckRequester> testling(createRequester());
testling->lastHandledStanzasCount = boost::numeric_cast<unsigned int>((1ULL<<32) - 1);
testling->handleStanzaSent(createMessage("m1"));
testling->handleStanzaSent(createMessage("m2"));
diff --git a/Swiften/StreamManagement/UnitTest/StanzaAckResponderTest.cpp b/Swiften/StreamManagement/UnitTest/StanzaAckResponderTest.cpp
index b24335f..71a7f94 100644
--- a/Swiften/StreamManagement/UnitTest/StanzaAckResponderTest.cpp
+++ b/Swiften/StreamManagement/UnitTest/StanzaAckResponderTest.cpp
@@ -9,8 +9,8 @@
#include <boost/bind.hpp>
#include <boost/numeric/conversion/cast.hpp>
-#include "Swiften/StreamManagement/StanzaAckResponder.h"
-#include "Swiften/Elements/Message.h"
+#include <Swiften/StreamManagement/StanzaAckResponder.h>
+#include <Swiften/Elements/Message.h>
using namespace Swift;
@@ -26,7 +26,7 @@ class StanzaAckResponderTest : public CppUnit::TestFixture {
public:
void testHandleAckRequestReceived_AcksStanza() {
- std::auto_ptr<StanzaAckResponder> testling(createResponder());
+ boost::shared_ptr<StanzaAckResponder> testling(createResponder());
testling->handleStanzaReceived();
testling->handleAckRequestReceived();
@@ -36,7 +36,7 @@ class StanzaAckResponderTest : public CppUnit::TestFixture {
}
void testHandleAckRequestReceived_AcksMultipleStanzas() {
- std::auto_ptr<StanzaAckResponder> testling(createResponder());
+ boost::shared_ptr<StanzaAckResponder> testling(createResponder());
testling->handleStanzaReceived();
testling->handleStanzaReceived();
@@ -47,7 +47,7 @@ class StanzaAckResponderTest : public CppUnit::TestFixture {
}
void testHandleAckRequestReceived_MultipleAcks() {
- std::auto_ptr<StanzaAckResponder> testling(createResponder());
+ boost::shared_ptr<StanzaAckResponder> testling(createResponder());
testling->handleStanzaReceived();
testling->handleAckRequestReceived();
@@ -61,7 +61,7 @@ class StanzaAckResponderTest : public CppUnit::TestFixture {
// Handle stanza ack count wrapping, as per the XEP
void testHandleAckRequestReceived_WrapAround() {
- std::auto_ptr<StanzaAckResponder> testling(createResponder());
+ boost::shared_ptr<StanzaAckResponder> testling(createResponder());
testling->handledStanzasCount = boost::numeric_cast<unsigned int>((1ULL<<32) - 1);
testling->handleStanzaReceived();
testling->handleStanzaReceived();