예제 #1
0
파일: test_consing.py 프로젝트: jgors/numba
def test_mutability():
    ty = ts.function(ts.int_, (ts.float_,))
    ty.args
    try:
        ty.args = [1, 2]
    except AttributeError as e:
        pass
    else:
        raise Exception("Expected: AttributeError: Cannot set attribute 'args' of type ...")
예제 #2
0
def test_mutability():
    ty = ts.function(ts.int_, (ts.float_,))
    ty.args
    try:
        ty.args = [1, 2]
    except AttributeError as e:
        pass
    else:
        raise Exception(
            "Expected: AttributeError: Cannot set attribute 'args' of type ...")
예제 #3
0
파일: test_consing.py 프로젝트: jgors/numba
def test_functions():
    functype1 = ts.function(ts.int_, (ts.float_,))
    functype2 = ts.function(ts.int_, (ts.float_,))
    functype3 = ts.function(ts.int_, (ts.float_,), is_vararg=False)
    functype4 = ts.function(ts.int_, (ts.float_,), name="hello")
    functype5 = ts.function(ts.int_, (ts.float_,), name="hello", is_vararg=False)
    functype6 = ts.function(ts.int_, (ts.float_,), name="hello", is_vararg=True)

    assert functype1 is functype2
    assert functype1 is functype3
    assert functype1 is not functype4
    assert functype1 is not functype5
    assert functype1 is not functype6

    assert functype4 is functype5
    assert functype4 is not functype6
예제 #4
0
def test_functions():
    functype1 = ts.function(ts.int_, (ts.float_,))
    functype2 = ts.function(ts.int_, (ts.float_,))
    functype3 = ts.function(ts.int_, (ts.float_,), is_vararg=False)
    functype4 = ts.function(ts.int_, (ts.float_,), name="hello")
    functype5 = ts.function(ts.int_, (ts.float_,), name="hello", is_vararg=False)
    functype6 = ts.function(ts.int_, (ts.float_,), name="hello", is_vararg=True)

    assert functype1 is functype2
    assert functype1 is functype3
    assert functype1 is not functype4
    assert functype1 is not functype5
    assert functype1 is not functype6

    assert functype4 is functype5
    assert functype4 is not functype6
예제 #5
0
def test_ctypes_functions(): # TODO: unifiy with test_llvm_functions
    functype = ts.function(ts.int_, (ts.float_,))
    cfunctype = cts.function(cts.int_, (cts.float_,))
    assert ct(functype) == cfunctype
예제 #6
0
def test_llvm_functions():
    functype = ts.function(ts.int_, (ts.float_,))
    lfunctype = lts.function(lts.int_, (lts.float_,))
    assert llvmt(functype) == lfunctype
예제 #7
0
def test_functions():
    functype = ts.function(ts.int_, (ts.float_, ))
    assert str(functype) == "int (*)(float32)", functype
    functype = ts.function(ts.int_, (ts.float_, ), "hello")
    assert str(functype) == "int (*hello)(float32)", functype
예제 #8
0
def test_functions():
    functype = ts.function(ts.int_, (ts.float_,))
    assert str(functype) == "int (*)(float32)", functype
    functype = ts.function(ts.int_, (ts.float_,), "hello")
    assert str(functype) == "int (*hello)(float32)", functype
예제 #9
0
def test_llvm_functions():
    functype = ts.function(ts.int_, (ts.float_, ))
    lfunctype = lts.function(lts.int_, (lts.float_, ))
    assert llvmt(functype) == lfunctype
예제 #10
0
def test_ctypes_functions():  # TODO: unifiy with test_llvm_functions
    functype = ts.function(ts.int_, (ts.float_, ))
    cfunctype = cts.function(cts.int_, (cts.float_, ))
    assert ct(functype) == cfunctype