summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2008-10-28 17:19:07 +0000
committerRafael H. Schloming <rhs@apache.org>2008-10-28 17:19:07 +0000
commit70e7f4334aa923abb819b9e6517cbef138946c14 (patch)
treebd3104e493cb72c4a62717d575720ea8a4dc9bfb
parenta9ff42414f14d97a631507ab10cc01f8a1d113c9 (diff)
downloadqpid-python-70e7f4334aa923abb819b9e6517cbef138946c14.tar.gz
fixed a bug in int16 codec
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@708615 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--python/qpid/codec010.py2
-rw-r--r--python/tests/codec010.py4
2 files changed, 5 insertions, 1 deletions
diff --git a/python/qpid/codec010.py b/python/qpid/codec010.py
index dac023e2bd..c2ea7ed512 100644
--- a/python/qpid/codec010.py
+++ b/python/qpid/codec010.py
@@ -68,7 +68,7 @@ class Codec(Packer):
def read_int16(self):
return self.unpack("!h")
def write_int16(self, n):
- return self.unpack("!h", n)
+ self.pack("!h", n)
def read_uint32(self):
diff --git a/python/tests/codec010.py b/python/tests/codec010.py
index 835966e103..bbe894b7b3 100644
--- a/python/tests/codec010.py
+++ b/python/tests/codec010.py
@@ -86,3 +86,7 @@ class CodecTest(TestCase):
def testArrayNone(self):
self.check("array", None)
+
+ def testInt16(self):
+ self.check("int16", 3)
+ self.check("int16", -3)