diff options
author | Gordon Sim <gsim@apache.org> | 2007-10-17 13:45:27 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2007-10-17 13:45:27 +0000 |
commit | 69aabf18f7ce2377e411bddb8fb2297e2254b280 (patch) | |
tree | 600fbde59d3c8116c7d8dff66511949fbe8f5a3a /cpp/src/tests/HeadersExchangeTest.cpp | |
parent | 8d5defb2febf2988d77cc0b2ee8b7f137119eac1 (diff) | |
download | qpid-python-69aabf18f7ce2377e411bddb8fb2297e2254b280.tar.gz |
Fix to headers exchanges bind: need to check the match value is present before dereferencing
Added tests for this.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@585503 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/HeadersExchangeTest.cpp')
-rw-r--r-- | cpp/src/tests/HeadersExchangeTest.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cpp/src/tests/HeadersExchangeTest.cpp b/cpp/src/tests/HeadersExchangeTest.cpp index 14c60449ec..c47266caa6 100644 --- a/cpp/src/tests/HeadersExchangeTest.cpp +++ b/cpp/src/tests/HeadersExchangeTest.cpp @@ -19,6 +19,7 @@ * */ +#include "qpid/QpidError.h" #include "qpid/broker/HeadersExchange.h" #include "qpid/framing/FieldTable.h" #include "qpid/framing/FieldValue.h" @@ -35,6 +36,7 @@ class HeadersExchangeTest : public CppUnit::TestCase CPPUNIT_TEST(testMatchEmptyValue); CPPUNIT_TEST(testMatchEmptyArgs); CPPUNIT_TEST(testMatchNoXMatch); + CPPUNIT_TEST(testBindNoXMatch); CPPUNIT_TEST_SUITE_END(); public: @@ -107,6 +109,20 @@ class HeadersExchangeTest : public CppUnit::TestCase CPPUNIT_ASSERT(!HeadersExchange::match(b, m)); } + void testBindNoXMatch() + { + HeadersExchange exchange("test"); + Queue::shared_ptr queue; + std::string key; + FieldTable args; + try { + //just checking this doesn't cause assertion etc + exchange.bind(queue, key, &args); + } catch(qpid::QpidError&) { + //expected + } + } + }; |