summaryrefslogtreecommitdiff
path: root/cpp/src/tests
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-05-23 13:39:07 +0000
committerAlan Conway <aconway@apache.org>2008-05-23 13:39:07 +0000
commit896d94f7c27e958806b96b537a7a96208ede145a (patch)
tree35c139fcc037fde8fef675d9d730882d22781931 /cpp/src/tests
parentbb4584d228b837fa70839560d72bc2a59dc1aa17 (diff)
downloadqpid-python-896d94f7c27e958806b96b537a7a96208ede145a.tar.gz
qpid::SessionState: Added error checking for invalid frame sequences.
client: Fix client crash on error during connection shutdown. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@659538 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests')
-rw-r--r--cpp/src/tests/ClientSessionTest.cpp2
-rw-r--r--cpp/src/tests/SessionState.cpp11
2 files changed, 7 insertions, 6 deletions
diff --git a/cpp/src/tests/ClientSessionTest.cpp b/cpp/src/tests/ClientSessionTest.cpp
index aeff35dbf0..801e33d412 100644
--- a/cpp/src/tests/ClientSessionTest.cpp
+++ b/cpp/src/tests/ClientSessionTest.cpp
@@ -157,7 +157,7 @@ QPID_AUTO_TEST_CASE(testDispatcherThread)
fix.session.messageTransfer(content=TransferContent(lexical_cast<string>(i), "my-queue"));
}
t.join();
- BOOST_CHECK_EQUAL(count, listener.messages.size());
+ BOOST_REQUIRE_EQUAL(count, listener.messages.size());
for (size_t i = 0; i < count; ++i)
BOOST_CHECK_EQUAL(lexical_cast<string>(i), listener.messages[i].getData());
}
diff --git a/cpp/src/tests/SessionState.cpp b/cpp/src/tests/SessionState.cpp
index 4beef87cfe..40922b3be8 100644
--- a/cpp/src/tests/SessionState.cpp
+++ b/cpp/src/tests/SessionState.cpp
@@ -65,17 +65,18 @@ string str(const boost::iterator_range<vector<AMQFrame>::const_iterator>& frames
// Make a transfer command frame.
AMQFrame transferFrame(bool hasContent) {
AMQFrame t(in_place<MessageTransferBody>());
- t.setFirstFrame();
- t.setLastFrame();
- t.setFirstSegment();
+ t.setFirstFrame(true);
+ t.setLastFrame(true);
+ t.setFirstSegment(true);
t.setLastSegment(!hasContent);
return t;
}
// Make a content frame
AMQFrame contentFrame(string content, bool isLast=true) {
AMQFrame f(in_place<AMQContentBody>(content));
- f.setFirstFrame();
- f.setLastFrame();
+ f.setFirstFrame(true);
+ f.setLastFrame(true);
+ f.setFirstSegment(false);
f.setLastSegment(isLast);
return f;
}