GitLab will continue to be upgraded from 11.4.5-ce.0 on November 25th 2019 at 4.00pm (AEDT) to 5.00pm (AEDT) due to Critical Security Patch Availability. During the update, GitLab and Mattermost services will not be available.

Commit 05e7b1cc authored by John Zhang's avatar John Zhang

forgot this file

parent b5606cac
Pipeline #160 failed with stage
in 15 minutes and 21 seconds
from rpython.rtyper.lltypesystem import rffi, lltype
from rpython.rlib import rmu_fast as rmu
from util import fncptr_from_rpy_func, fncptr_from_py_script, call_and_check
from util import fncptr_from_rpy_func, fncptr_from_py_script, may_spawn_proc
import ctypes
@may_spawn_proc
def test_fibonacci():
from perftarget.fibonacci import fib
fnc, (db, bdlgen) = fncptr_from_rpy_func(fib, [rffi.ULONGLONG], rffi.ULONGLONG)
bdlgen.mu.current_thread_as_mu_thread(rmu.null(rmu.MuCPtr))
def check(f):
assert f == 6765
call_and_check(fnc, (rffi.cast(rffi.ULONGLONG, 20), ), check)
fnc(rffi.cast(rffi.ULONGLONG, 20)) == 6765
@may_spawn_proc
def test_fibonacci_iterative():
def fib_iter(n):
if n <= 1:
......@@ -32,7 +31,4 @@ def test_fibonacci_iterative():
fnc, (db, bdlgen) = fncptr_from_rpy_func(fib_iter, [rffi.ULONGLONG], rffi.ULONGLONG)
bdlgen.mu.current_thread_as_mu_thread(rmu.null(rmu.MuCPtr))
def check(f):
assert f == 6765
call_and_check(fnc, (rffi.cast(rffi.ULONGLONG, 20),), check)
\ No newline at end of file
assert fnc(rffi.cast(rffi.ULONGLONG, 20))
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