From 40fe1f721e57a14d45de0341bb243b07cb93ef0e Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 28 Aug 2017 19:22:59 +0300 Subject: [PATCH] unpacking tests for "I" and "F" modes --- Tests/test_lib_pack.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Tests/test_lib_pack.py b/Tests/test_lib_pack.py index f07452de7..d062b33be 100644 --- a/Tests/test_lib_pack.py +++ b/Tests/test_lib_pack.py @@ -366,7 +366,6 @@ class TestLibUnpack(PillowTestCase): self.assert_unpack("HSV", "V", 1, (0,0,1), (0,0,2), (0,0,3)) def test_I(self): - self.assert_unpack("I", "I", 4, 0x04030201, 0x08070605) self.assert_unpack("I", "I;8", 1, 0x01, 0x02, 0x03, 0x04) self.assert_unpack("I", "I;8S", b'\x01\x83', 1, -125) self.assert_unpack("I", "I;16", 2, 0x0201, 0x0403) @@ -383,6 +382,7 @@ class TestLibUnpack(PillowTestCase): -2097151999, 0x01000083) if sys.byteorder == 'little': + self.assert_unpack("I", "I", 4, 0x04030201, 0x08070605) self.assert_unpack("I", "I;16N", 2, 0x0201, 0x0403) self.assert_unpack("I", "I;16NS", b'\x83\x01\x01\x83', 0x0183, -31999) self.assert_unpack("I", "I;32N", 4, 0x04030201, 0x08070605) @@ -390,6 +390,7 @@ class TestLibUnpack(PillowTestCase): b'\x83\x00\x00\x01\x01\x00\x00\x83', 0x01000083, -2097151999) else: + self.assert_unpack("I", "I", 4, 0x01020304, 0x05060708) self.assert_unpack("I", "I;16N", 2, 0x0102, 0x0304) self.assert_unpack("I", "I;16NS", b'\x83\x01\x01\x83', -31999, 0x0183) self.assert_unpack("I", "I;32N", 4, 0x01020304, 0x05060708) @@ -429,8 +430,6 @@ class TestLibUnpack(PillowTestCase): -2097152000, 16777348) def test_F_float(self): - self.assert_unpack("F", "F", 4, - 1.539989614439558e-36, 4.063216068939723e-34) self.assert_unpack("F", "F;32F", 4, 1.539989614439558e-36, 4.063216068939723e-34) self.assert_unpack("F", "F;32BF", 4, @@ -443,12 +442,16 @@ class TestLibUnpack(PillowTestCase): 0.15000000596046448, -1234.5) if sys.byteorder == 'little': + self.assert_unpack("F", "F", 4, + 1.539989614439558e-36, 4.063216068939723e-34) self.assert_unpack("F", "F;32NF", 4, 1.539989614439558e-36, 4.063216068939723e-34) self.assert_unpack("F", "F;64NF", b'333333\xc3?\x00\x00\x00\x00\x00J\x93\xc0', 0.15000000596046448, -1234.5) else: + self.assert_unpack("F", "F", 4, + 2.387939260590663e-38, 6.301941157072183e-36) self.assert_unpack("F", "F;32NF", 4, 2.387939260590663e-38, 6.301941157072183e-36) self.assert_unpack("F", "F;64NF",