From 014c7d30c12b4278319cd7aa68f3497893add5b2 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Fri, 27 Jun 2014 22:14:14 +0000 Subject: 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 --- qpid/cpp/src/tests/MessagingSessionTests.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'qpid/cpp/src/tests/MessagingSessionTests.cpp') 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 -- cgit v1.2.1