Esempio n. 1
0
    def test_big_endian(self):
        self.assertEqual(_binary.i16be(b"\x00\x00\xff\xff"), 0)
        self.assertEqual(_binary.i32be(b"\x00\x00\xff\xff"), 65535)

        self.assertEqual(_binary.o16be(65535), b"\xff\xff")
        self.assertEqual(_binary.o32be(65535), b"\x00\x00\xff\xff")
Esempio n. 2
0
    def test_big_endian(self):
        self.assertEqual(_binary.i16be(b'\x00\x00\xff\xff'), 0)
        self.assertEqual(_binary.i32be(b'\x00\x00\xff\xff'), 65535)

        self.assertEqual(_binary.o16be(65535), b'\xff\xff')
        self.assertEqual(_binary.o32be(65535), b'\x00\x00\xff\xff')
Esempio n. 3
0
def test_big_endian():
    assert _binary.i16be(b"\x00\x00\xff\xff") == 0
    assert _binary.i32be(b"\x00\x00\xff\xff") == 65535

    assert _binary.o16be(65535) == b"\xff\xff"
    assert _binary.o32be(65535) == b"\x00\x00\xff\xff"