From 558dcdd6eefd334cd81fcf0c4a3843097974f652 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Fri, 23 May 2008 13:39:07 +0000 Subject: 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@659538 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/tests/ClientSessionTest.cpp | 2 +- qpid/cpp/src/tests/SessionState.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'qpid/cpp/src/tests') diff --git a/qpid/cpp/src/tests/ClientSessionTest.cpp b/qpid/cpp/src/tests/ClientSessionTest.cpp index aeff35dbf0..801e33d412 100644 --- a/qpid/cpp/src/tests/ClientSessionTest.cpp +++ b/qpid/cpp/src/tests/ClientSessionTest.cpp @@ -157,7 +157,7 @@ QPID_AUTO_TEST_CASE(testDispatcherThread) fix.session.messageTransfer(content=TransferContent(lexical_cast(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(i), listener.messages[i].getData()); } diff --git a/qpid/cpp/src/tests/SessionState.cpp b/qpid/cpp/src/tests/SessionState.cpp index 4beef87cfe..40922b3be8 100644 --- a/qpid/cpp/src/tests/SessionState.cpp +++ b/qpid/cpp/src/tests/SessionState.cpp @@ -65,17 +65,18 @@ string str(const boost::iterator_range::const_iterator>& frames // Make a transfer command frame. AMQFrame transferFrame(bool hasContent) { AMQFrame t(in_place()); - 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(content)); - f.setFirstFrame(); - f.setLastFrame(); + f.setFirstFrame(true); + f.setLastFrame(true); + f.setFirstSegment(false); f.setLastSegment(isLast); return f; } -- cgit v1.2.1