From fab634e3eeb456e9d5dffa2cabb9ded39c45d6b6 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 3 Jul 2017 15:05:08 -0700 Subject: Turn on Rosie CI testing to test new builds on real hardware. This introduces a skip_if module that can be used by tests to determine when they should be skipped due to the environment. Some tests have been split in order to have finer grained skip control. --- tests/basics/int_longint_bytes.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/basics/int_longint_bytes.py (limited to 'tests/basics/int_longint_bytes.py') diff --git a/tests/basics/int_longint_bytes.py b/tests/basics/int_longint_bytes.py new file mode 100644 index 000000000..31510d75a --- /dev/null +++ b/tests/basics/int_longint_bytes.py @@ -0,0 +1,15 @@ +# Skip if long ints are not supported. +try: + # We have to use variables because 1 << 40 causes an exception on parse and + # cannot be caught. + x = 40 + x = 1 << x +except OverflowError: + print("SKIP") + import sys + sys.exit(1) + +print((2**64).to_bytes(9, "little")) +print(int.from_bytes(b"\x00\x01\0\0\0\0\0\0", "little")) +print(int.from_bytes(b"\x01\0\0\0\0\0\0\0", "little")) +print(int.from_bytes(b"\x00\x01\0\0\0\0\0\0", "little")) -- cgit v1.2.3