You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2015/07/10 00:11:58 UTC

[18/50] qpid-proton git commit: PROTON_927: only write out values for expiry and creation time if these are non-zero, which passes at present for a test that they have been set

PROTON_927: only write out values for expiry and creation time if these are non-zero, which passes at present for a test that they have been set


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/57b0f34a
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/57b0f34a
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/57b0f34a

Branch: refs/heads/cjansen-cpp-client
Commit: 57b0f34ab9904209fdc67aa066c72e0f80b3e966
Parents: fc38e86
Author: Gordon Sim <gs...@redhat.com>
Authored: Wed Jul 1 18:31:08 2015 +0100
Committer: Gordon Sim <gs...@redhat.com>
Committed: Fri Jul 3 10:34:57 2015 +0100

----------------------------------------------------------------------
 proton-c/src/message/message.c       |  4 +++-
 tests/python/proton_tests/message.py | 13 +++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/57b0f34a/proton-c/src/message/message.c
----------------------------------------------------------------------
diff --git a/proton-c/src/message/message.c b/proton-c/src/message/message.c
index b24a994..847c314 100644
--- a/proton-c/src/message/message.c
+++ b/proton-c/src/message/message.c
@@ -792,7 +792,7 @@ int pn_message_data(pn_message_t *msg, pn_data_t *data)
     pn_data_exit(data);
   }
 
-  err = pn_data_fill(data, "DL[CzSSSCssttSIS]", PROPERTIES,
+  err = pn_data_fill(data, "DL[CzSSSCss?t?tSIS]", PROPERTIES,
                      msg->id,
                      pn_string_size(msg->user_id), pn_string_get(msg->user_id),
                      pn_string_get(msg->address),
@@ -802,6 +802,8 @@ int pn_message_data(pn_message_t *msg, pn_data_t *data)
                      pn_string_get(msg->content_type),
                      pn_string_get(msg->content_encoding),
                      msg->expiry_time,
+                     msg->expiry_time,
+                     msg->creation_time,
                      msg->creation_time,
                      pn_string_get(msg->group_id),
                      msg->group_sequence,

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/57b0f34a/tests/python/proton_tests/message.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/message.py b/tests/python/proton_tests/message.py
index 2f7cb4f..899cbab 100644
--- a/tests/python/proton_tests/message.py
+++ b/tests/python/proton_tests/message.py
@@ -129,3 +129,16 @@ class CodecTest(Test):
     assert self.msg.address == msg2.address, (self.msg.address, msg2.address)
     assert self.msg.subject == msg2.subject, (self.msg.subject, msg2.subject)
     assert self.msg.body == msg2.body, (self.msg.body, msg2.body)
+
+  def testRoundTripWithTimes(self):
+    self.msg.expiry_time = 987654321;
+    self.msg.creation_time = 123456789;
+    self.msg.body = 'Hello World!'
+
+    data = self.msg.encode()
+
+    msg2 = Message()
+    msg2.decode(data)
+
+    assert self.msg.expiry_time == msg2.expiry_time, (self.msg.expiry_time, msg2.expiry_time)
+    assert self.msg.creation_time == msg2.creation_time, (self.msg.creation_time, msg2.creation_time)


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