You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2013/02/21 18:33:55 UTC

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

Author: astitcher
Date: Thu Feb 21 17:33:55 2013
New Revision: 1448733

URL: http://svn.apache.org/r1448733
Log:
PROTON-230, PROTON-246: Copying nested data fails in some cases

Modified:
    qpid/proton/trunk/proton-c/src/codec/codec.c
    qpid/proton/trunk/tests/python/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=1448733&r1=1448732&r2=1448733&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/src/codec/codec.c (original)
+++ qpid/proton/trunk/proton-c/src/codec/codec.c Thu Feb 21 17:33:55 2013
@@ -2982,14 +2982,13 @@ int pn_data_appendn(pn_data_t *data, pn_
         pn_data_exit(data);
         pn_data_exit(src);
         level--;
+        continue;
       }
 
-      if (pn_data_next(src)) {
-        break;
-      } else {
+      if (!pn_data_next(src)) {
         stop = true;
-        break;
       }
+      break;
     }
 
     if (stop) break;

Modified: qpid/proton/trunk/tests/python/proton_tests/codec.py
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/tests/python/proton_tests/codec.py?rev=1448733&r1=1448732&r2=1448733&view=diff
==============================================================================
--- qpid/proton/trunk/tests/python/proton_tests/codec.py (original)
+++ qpid/proton/trunk/tests/python/proton_tests/codec.py Thu Feb 21 17:33:55 2013
@@ -270,6 +270,18 @@ class DataTest(Test):
     dst.copy(self.data)
     assert dst.format() == self.data.format()
 
+  def testCopyNestedArray(self):
+    nested = [Array(UNDESCRIBED, Data.LIST,
+                    ["first", [Array(UNDESCRIBED, Data.INT, 1,2,3)]],
+                    ["second", [Array(UNDESCRIBED, Data.INT, 1,2,3)]],
+                    ["third", [Array(UNDESCRIBED, Data.INT, 1,2,3)]],
+                    ),
+              "end"]
+    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