WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

Commit 69bce35a authored by qinsoon's avatar qinsoon
Browse files

list test: check_all100 doesnt run

parent e5aa3f6d
......@@ -117,18 +117,48 @@ def test_rpython_list_addr_check_length2():
res = run_boot_image(main, '/tmp/test_rpython_list_addr_check_length2')
assert res.returncode == 0, 'returncode = %d\n%s' % (res.returncode, res.err)
@may_spawn_proc
def test_rpython_list_addr_check_length100():
Int64Ptr = lltype.Ptr(lltype.Array(rffi.LONGLONG, hints={'nolength': True}))
def check(actual, expect):
if actual != expect:
c_exit(rffi.cast(rffi.INT, actual))
def main(argv):
a = []
for i in range(0, 100):
a.append(i)
from rpython.rtyper.lltypesystem.llmemory import cast_ptr_to_adr
from rpython.rlib.objectmodel import keepalive_until_here
addr = cast_ptr_to_adr(a)
mem = rffi.cast(Int64Ptr, addr)
# ignore mem[0]
check(mem[1], 100)
keepalive_until_here(a)
return 0
res = run_boot_image(main, '/tmp/test_rpython_list_addr_check_length2')
assert res.returncode == 0, 'returncode = %d\n%s' % (res.returncode, res.err)
@may_spawn_proc
def test_rpython_list_addr_check_all():
def test_rpython_list_addr_check_all10():
Int64Ptr = lltype.Ptr(lltype.Array(rffi.LONGLONG, hints={'nolength': True}))
N = 10
def check(actual, expect):
if actual != expect:
c_exit(rffi.cast(rffi.INT, actual))
def main(argv):
a = []
for i in range(0, 10):
for i in range(0, N):
a.append(i)
from rpython.rtyper.lltypesystem.llmemory import cast_ptr_to_adr
......@@ -137,18 +167,56 @@ def test_rpython_list_addr_check_all():
addr = cast_ptr_to_adr(a)
mem = rffi.cast(Int64Ptr, addr)
# ignore mem[0]
check(mem[1], 10)
check(mem[1], N)
inner_addr = mem[2]
inner = rffi.cast(Int64Ptr, inner_addr)
# inner[0], inner[1] is ignored
for i in range(0, 10):
for i in range(0, N):
check(inner[2 + i], i)
keepalive_until_here(a)
return 0
res = run_boot_image(main, '/tmp/test_rpython_list_addr_check_all10')
assert res.returncode == 0, 'returncode = %d\n%s' % (res.returncode, res.err)
@pytest.mark.xfail(reason='unknown')
@may_spawn_proc
def test_rpython_list_addr_check_all100():
Int64Ptr = lltype.Ptr(lltype.Array(rffi.LONGLONG, hints={'nolength': True}))
N = 100
def check(actual, expect):
if actual != expect:
c_exit(rffi.cast(rffi.INT, actual))
def main(argv):
a = []
for i in range(0, N):
a.append(i)
from rpython.rtyper.lltypesystem.llmemory import cast_ptr_to_adr
from rpython.rlib.objectmodel import keepalive_until_here
addr = cast_ptr_to_adr(a)
mem = rffi.cast(Int64Ptr, addr)
# ignore mem[0]
check(mem[1], N)
inner_addr = mem[2]
inner = rffi.cast(Int64Ptr, inner_addr)
# inner[0], inner[1] is ignored
for i in range(0, N):
check(inner[2 + i], i)
keepalive_until_here(a)
return 0
res = run_boot_image(main, '/tmp/test_rpython_list_addr_check_all')
res = run_boot_image(main, '/tmp/test_rpython_list_addr_check_all100')
assert res.returncode == 0, 'returncode = %d\n%s' % (res.returncode, res.err)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment