• Home
  • Raw
  • Download

Lines Matching +full:big +full:- +full:tests

10 ISBIGENDIAN = sys.byteorder == "big"
42 lineno = inspect.currentframe().f_lineno - 1
99 # (format, argument, big-endian result, little-endian result, asymmetric)
100 tests = [
112 ('b', -7, '\371', '\371', 0),
116 ('h', -700, '\375D', 'D\375', 0),
118 ('H', 0x10000-700, '\375D', 'D\375', 0),
120 ('i', -70000000, '\373\323\342\200', '\200\342\323\373', 0),
122 ('I', 0x100000000L-70000000, '\373\323\342\200', '\200\342\323\373', 0),
124 ('l', -70000000, '\373\323\342\200', '\200\342\323\373', 0),
126 ('L', 0x100000000L-70000000, '\373\323\342\200', '\200\342\323\373', 0),
130 ('f', -2.0, '\300\000\000\000', '\000\000\000\300', 0),
131 ('d', -2.0, '\300\000\000\000\000\000\000\000',
140 for fmt, arg, big, lil, asy in tests:
141 for (xfmt, exp) in [('>'+fmt, big), ('!'+fmt, big), ('<'+fmt, lil),
142 ('='+fmt, ISBIGENDIAN and big or lil)]:
180 # tests for native 'q' and 'Q' when applicable
187 # Integer tests (bBhHiIlLqQ).
194 self.code = format[-1]
195 self.direction = format[:-1]
203 self.min_value = -(2L**(self.bitsize-1))
204 self.max_value = 2L**(self.bitsize-1) - 1
208 self.max_value = 2L**self.bitsize - 1
227 expected = ("\x00" * (self.bytesize - len(expected)) +
242 # Adding any byte should cause a "too big" error.
246 # x is out of range -- verify pack realizes that.
265 # Values absorbed from other tests
268 # Try all those, and their negations, and +-1 from
269 # them. Note that this tests all power-of-2
271 # +-(2**n +- 1).
273 for val in -base, base:
274 for incr in -1, 0, 1:
292 return -163L
320 "got non-integer", DeprecationWarning)):
324 # an attempt to convert a non-integer (with an
329 "-integer", DeprecationWarning)) as w:
331 lineno = inspect.currentframe().f_lineno - 1
382 # from the low-order discarded bits could propagate into the exponent
387 # smaller <- largest representable float less than base.
389 while base - delta / 2.0 != base:
391 smaller = base - delta
404 big = (1 << 24) - 1
405 big = math.ldexp(big, 127 - 23)
406 packed = struct.pack(">f", big)
408 self.assertEqual(big, unpacked)
411 big = (1 << 25) - 1
412 big = math.ldexp(big, 127 - 24)
413 self.assertRaises(OverflowError, struct.pack, ">f", big)
522 true = [1], 'test', 5, -1, 0xffffffffL+1, 0xffffffff//2