summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/MessagingSessionTests.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2014-06-27 22:14:14 +0000
committerGordon Sim <gsim@apache.org>2014-06-27 22:14:14 +0000
commit014c7d30c12b4278319cd7aa68f3497893add5b2 (patch)
treea1ee762f409a42c9071305d42b6a4af27fbf7826 /qpid/cpp/src/tests/MessagingSessionTests.cpp
parentfdaed2846c34f566aa35b5304f912bfd763358b8 (diff)
downloadqpid-python-014c7d30c12b4278319cd7aa68f3497893add5b2.tar.gz
QPID-5858: prevent leakage of old exception types
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1606258 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/MessagingSessionTests.cpp')
-rw-r--r--qpid/cpp/src/tests/MessagingSessionTests.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/qpid/cpp/src/tests/MessagingSessionTests.cpp b/qpid/cpp/src/tests/MessagingSessionTests.cpp
index d23619e846..0926765d78 100644
--- a/qpid/cpp/src/tests/MessagingSessionTests.cpp
+++ b/qpid/cpp/src/tests/MessagingSessionTests.cpp
@@ -1432,6 +1432,25 @@ QPID_AUTO_TEST_CASE(testCloseAndMultipleConcurrentFetches)
BOOST_CHECK(!fetcher.timedOut);
}
+QPID_AUTO_TEST_CASE(testSessionCheckError)
+{
+ MessagingFixture fix;
+ std::string queue();
+ Session session = fix.connection.createSession();
+ Sender sender = session.createSender("q; {create:always, node:{x-declare:{auto-delete:True, arguments:{qpid.max_count:1}}}}");
+ ScopedSuppressLogging sl;
+ for (uint i = 0; i < 2; ++i) {
+ sender.send(Message((boost::format("A_%1%") % (i+1)).str()));
+ }
+ try {
+ while (true) session.checkError();
+ } catch (const qpid::types::Exception&) {
+ //this is ok
+ } catch (const qpid::Exception&) {
+ BOOST_FAIL("Wrong exception type thrown");
+ }
+}
+
QPID_AUTO_TEST_SUITE_END()
}} // namespace qpid::tests