Пример #1
0
 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)
Пример #2
0
 def time_cpRepCode_from(self):
     cpRepCode.from68(0x444C8000)
Пример #3
0
 def test_from_zero(self):
     """TestRepCodeToFrom68CPython.test_04_c(): from68(0x40000000) -> 0.0 CPython."""
     self.assertEqual(cpRepCode.from68(0x40000000), 0.0)
Пример #4
0
 def test_from_minus_153(self):
     """TestRepCodeToFrom68CPython.test_02_c(): from68(0xBBB38000) -> -153.0 CPython."""
     self.assertEqual(cpRepCode.from68(0xBBB38000), -153.0)
Пример #5
0
 def test_from_153(self):
     """TestRepCodeToFrom68CPython.test_01_c(): from68(0x444C8000) -> 153.0 CPython."""
     self.assertEqual(cpRepCode.from68(0x444C8000), 153.0)
Пример #6
0
 def test_from_max(self):
     self.assertEqual(cpRepCode.from68(0x7FFFFFFF),
                      math.ldexp(1 - 1.0 / (1 << 23), 127))
Пример #7
0
 def test_from_min(self):
     self.assertEqual(cpRepCode.from68(0x80700000), math.ldexp(-2.0, 123))