diff options
-rw-r--r-- | qpid/cpp/src/qpid/framing/FieldTable.cpp | 3 | ||||
-rw-r--r-- | qpid/cpp/src/tests/QueueOptionsTest.cpp | 19 |
2 files changed, 21 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/framing/FieldTable.cpp b/qpid/cpp/src/qpid/framing/FieldTable.cpp index 7ff5a07c9a..7260261970 100644 --- a/qpid/cpp/src/qpid/framing/FieldTable.cpp +++ b/qpid/cpp/src/qpid/framing/FieldTable.cpp @@ -232,7 +232,8 @@ bool FieldTable::operator==(const FieldTable& x) const { void FieldTable::erase(const std::string& name) { - values.erase(values.find(name)); + if (values.find(name) != values.end()) + values.erase(name); } } diff --git a/qpid/cpp/src/tests/QueueOptionsTest.cpp b/qpid/cpp/src/tests/QueueOptionsTest.cpp index 7d9bfa68fb..bac369bfec 100644 --- a/qpid/cpp/src/tests/QueueOptionsTest.cpp +++ b/qpid/cpp/src/tests/QueueOptionsTest.cpp @@ -75,5 +75,24 @@ QPID_AUTO_TEST_CASE(testFlags) } +QPID_AUTO_TEST_CASE(testSetOrdering) +{ + //ensure setOrdering(FIFO) works even if not preceded by a call to + //setOrdering(LVQ) + QueueOptions ft; + ft.setOrdering(FIFO); + BOOST_CHECK(!ft.isSet(QueueOptions::strLastValueQueue)); + +} + +QPID_AUTO_TEST_CASE(testClearPersistLastNode) +{ + //ensure clear works even if not preceded by the setting on the + //option + QueueOptions ft; + ft.clearPersistLastNode(); + BOOST_CHECK(!ft.isSet(QueueOptions::strPersistLastNode)); +} + QPID_AUTO_TEST_SUITE_END() |