def time_struct_68(self, arg): my_struct = self.struct_compiled[arg] # buf_len = struct.calcsize(arg) with open(binary_path(20), 'rb') as f: while 1: b = f.read(arg) if len(b) != arg: break for word in my_struct.unpack(b): cpRepCode.from68(word)
def time_cpRepCode_from(self): cpRepCode.from68(0x444C8000)
def test_from_zero(self): """TestRepCodeToFrom68CPython.test_04_c(): from68(0x40000000) -> 0.0 CPython.""" self.assertEqual(cpRepCode.from68(0x40000000), 0.0)
def test_from_minus_153(self): """TestRepCodeToFrom68CPython.test_02_c(): from68(0xBBB38000) -> -153.0 CPython.""" self.assertEqual(cpRepCode.from68(0xBBB38000), -153.0)
def test_from_153(self): """TestRepCodeToFrom68CPython.test_01_c(): from68(0x444C8000) -> 153.0 CPython.""" self.assertEqual(cpRepCode.from68(0x444C8000), 153.0)
def test_from_max(self): self.assertEqual(cpRepCode.from68(0x7FFFFFFF), math.ldexp(1 - 1.0 / (1 << 23), 127))
def test_from_min(self): self.assertEqual(cpRepCode.from68(0x80700000), math.ldexp(-2.0, 123))