qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r723263 - in /incubator/qpid/trunk/qpid/cpp/src: qpid/framing/FieldTable.cpp tests/QueueOptionsTest.cpp
Date Thu, 04 Dec 2008 09:25:34 GMT
Author: gsim
Date: Thu Dec  4 01:25:33 2008
New Revision: 723263

URL: http://svn.apache.org/viewvc?rev=723263&view=rev
Log:
QPID-1514: Add check for presence of key to FieldTable::erase()


Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpid/framing/FieldTable.cpp
    incubator/qpid/trunk/qpid/cpp/src/tests/QueueOptionsTest.cpp

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/framing/FieldTable.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/framing/FieldTable.cpp?rev=723263&r1=723262&r2=723263&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/framing/FieldTable.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/framing/FieldTable.cpp Thu Dec  4 01:25:33 2008
@@ -232,7 +232,8 @@
 
 void FieldTable::erase(const std::string& name) 
 {
-    values.erase(values.find(name));
+    if (values.find(name) != values.end()) 
+        values.erase(name);
 }
 
 }

Modified: incubator/qpid/trunk/qpid/cpp/src/tests/QueueOptionsTest.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/QueueOptionsTest.cpp?rev=723263&r1=723262&r2=723263&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/QueueOptionsTest.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/QueueOptionsTest.cpp Thu Dec  4 01:25:33 2008
@@ -75,5 +75,24 @@
 
 }
 
+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()



Mime
View raw message