Added serialization and deserialization for signed integers
[sandbox] / serial / test_binary.py
index e72447f..0463dda 100644 (file)
@@ -10,6 +10,18 @@ EXAMPLE_REPRESENTATIONS = [
     (binary.TAG_UINT16, 7, b'\x04\x00\x07'),
     (binary.TAG_UINT32, 7, b'\x05\x00\x00\x00\x07'),
     (binary.TAG_UINT64, 7, b'\x06\x00\x00\x00\x00\x00\x00\x00\x07'),
+    (binary.TAG_INT8, 7, b'\x10\x07'),
+    (binary.TAG_INT16, 7, b'\x11\x00\x07'),
+    (binary.TAG_INT32, 7, b'\x12\x00\x00\x00\x07'),
+    (binary.TAG_INT64, 7, b'\x13\x00\x00\x00\x00\x00\x00\x00\x07'),
+    (binary.TAG_UINT8, 254, b'\x03\xfe'),
+    (binary.TAG_UINT16, 65534, b'\x04\xff\xfe'),
+    (binary.TAG_UINT32, 4294967294, b'\x05\xff\xff\xff\xfe'),
+    (binary.TAG_UINT64, 18446744073709551614, b'\x06\xff\xff\xff\xff\xff\xff\xff\xfe'),
+    (binary.TAG_INT8, -2, b'\x10\xfe'),
+    (binary.TAG_INT16, -2, b'\x11\xff\xfe'),
+    (binary.TAG_INT32, -2, b'\x12\xff\xff\xff\xfe'),
+    (binary.TAG_INT64, -2, b'\x13\xff\xff\xff\xff\xff\xff\xff\xfe'),
 ]
 
 class SerializeTests(unittest.TestCase):