Skip to content

Commit 92d074a

Browse files
committed
test_struct: skip tests that require the finalization of the native buffer protocol (for arrays), skip tests that rely on overflowing when sys.maxsize is used over the C / Java boundary
- our sys.maxsize is Integer.MAX_VALUE while cpython uses size_t size
1 parent 902ea93 commit 92d074a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

graalpython/lib-python/3/test/test_struct.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ def test_unpack_from(self):
422422
self.assertEqual(s.unpack_from(buffer=test_string, offset=2),
423423
(b'cd01',))
424424

425+
@support.impl_detail(msg="not yet supported: GR-21120 array buffer protocol", graalvm=False)
425426
def test_pack_into(self):
426427
test_string = b'Reykjavik rocks, eow!'
427428
writable_buf = array.array('b', b' '*100)
@@ -450,6 +451,7 @@ def test_pack_into(self):
450451
self.assertRaises((TypeError, struct.error), struct.pack_into, b'', sb,
451452
None)
452453

454+
@support.impl_detail(msg="not yet supported: GR-21120 array buffer protocol", graalvm=False)
453455
def test_pack_into_fn(self):
454456
test_string = b'Reykjavik rocks, eow!'
455457
writable_buf = array.array('b', b' '*100)
@@ -473,6 +475,7 @@ def test_pack_into_fn(self):
473475
self.assertRaises((ValueError, struct.error), pack_into, small_buf, 2,
474476
test_string)
475477

478+
@support.impl_detail(msg="not yet supported: GR-21120 array buffer protocol", graalvm=False)
476479
def test_unpack_with_buffer(self):
477480
# SF bug 1563759: struct.unpack doesn't support buffer protocol objects
478481
data1 = array.array('B', b'\x12\x34\x56\x78')
@@ -525,6 +528,8 @@ def __bool__(self):
525528
for c in [b'\x01', b'\x7f', b'\xff', b'\x0f', b'\xf0']:
526529
self.assertTrue(struct.unpack('>?', c)[0])
527530

531+
@support.impl_detail(msg="not yet supported: sys.maxsize difference Java -> C, does not overflow defined as "
532+
"Integer.MAX_VALUE < size_t size", graalvm=False)
528533
def test_count_overflow(self):
529534
hugecount = '{}b'.format(sys.maxsize+1)
530535
self.assertRaises(struct.error, struct.calcsize, hugecount)

0 commit comments

Comments
 (0)