From 70e7f4334aa923abb819b9e6517cbef138946c14 Mon Sep 17 00:00:00 2001 From: "Rafael H. Schloming" Date: Tue, 28 Oct 2008 17:19:07 +0000 Subject: 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 --- python/qpid/codec010.py | 2 +- python/tests/codec010.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'python') 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) -- cgit v1.2.1