You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rh...@apache.org on 2012/10/29 23:35:43 UTC

svn commit: r1403564 - in /qpid/proton/trunk: proton-c/src/codec/codec.c tests/proton_tests/codec.py

Author: rhs
Date: Mon Oct 29 22:35:43 2012
New Revision: 1403564

URL: http://svn.apache.org/viewvc?rev=1403564&view=rev
Log:
fixed bug in copy of nested data structures

Modified:
    qpid/proton/trunk/proton-c/src/codec/codec.c
    qpid/proton/trunk/tests/proton_tests/codec.py

Modified: qpid/proton/trunk/proton-c/src/codec/codec.c
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/src/codec/codec.c?rev=1403564&r1=1403563&r2=1403564&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/src/codec/codec.c (original)
+++ qpid/proton/trunk/proton-c/src/codec/codec.c Mon Oct 29 22:35:43 2012
@@ -2882,7 +2882,9 @@ int pn_data_appendn(pn_data_t *data, pn_
         level--;
       }
 
-      if (!pn_data_next(src)) {
+      if (pn_data_next(src)) {
+        break;
+      } else {
         stop = true;
         break;
       }

Modified: qpid/proton/trunk/tests/proton_tests/codec.py
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/tests/proton_tests/codec.py?rev=1403564&r1=1403563&r2=1403564&view=diff
==============================================================================
--- qpid/proton/trunk/tests/proton_tests/codec.py (original)
+++ qpid/proton/trunk/tests/proton_tests/codec.py Mon Oct 29 22:35:43 2012
@@ -262,6 +262,13 @@ class DataTest(Test):
 
     assert dst.format() == self.data.format()
 
+  def testCopyNested(self):
+    nested = [1, 2, 3, [4, 5, 6], 7, 8, 9]
+    self.data.put_object(nested)
+    dst = Data()
+    dst.copy(self.data)
+    assert dst.format() == self.data.format()
+
   def testRoundTrip(self):
     obj = {symbol("key"): timestamp(1234),
            ulong(123): "blah",



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org