MCPcopy Create free account
hub / github.com/e2wugui/zeze / test_integer

Method test_integer

python/test/test_buffer.py:334–368  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

332 self.check_skip_ulong(-x)
333
334 def test_integer(self):
335 for i in range(0, 65):
336 if i < 64:
337 self.check_all(1 << i)
338 self.check_all((1 << i) - 1)
339 self.check_all(((1 << i) - 1) & 0x5555_5555_5555_5555)
340 self.check_all(((1 << i) - 1) & 0xaaaa_aaaa_aaaa_aaaa)
341 int_min = -0x8000_0000
342 int_max = 0x7fff_ffff
343 long_min = -0x8000_0000_0000_0000
344 long_max = 0x7fff_ffff_ffff_ffff
345 for i in range(0, 1000):
346 self.check_all(random.randint(long_min, long_max))
347 self.check_int(int_min)
348 self.check_int(int_max)
349 self.check_long(int_min)
350 self.check_long(int_max)
351 self.check_long(long_min)
352 self.check_long(long_max)
353 self.check_uint(int_min)
354 self.check_uint(int_max)
355 self.check_ulong(int_min)
356 self.check_ulong(int_max)
357 self.check_ulong(long_min)
358 self.check_ulong(long_max)
359 self.check_skip_long(int_min)
360 self.check_skip_long(int_max)
361 self.check_skip_long(long_min)
362 self.check_skip_long(long_max)
363 self.check_skip_uint(int_min)
364 self.check_skip_uint(int_max)
365 self.check_skip_ulong(int_min)
366 self.check_skip_ulong(int_max)
367 self.check_skip_ulong(long_min)
368 self.check_skip_ulong(long_max)
369
370 def test_to_long(self):
371 b = bytearray(8)

Callers

nothing calls this directly

Calls 8

check_allMethod · 0.95
check_intMethod · 0.95
check_longMethod · 0.95
check_uintMethod · 0.95
check_ulongMethod · 0.95
check_skip_longMethod · 0.95
check_skip_uintMethod · 0.95
check_skip_ulongMethod · 0.95

Tested by

no test coverage detected