Example #1
0
File: fact.py Project: Yayg/rift
def test_fact():
    test_values = [0, 1, 7, 13, 20]
    for i in test_values:
        ret, stdout, stderr = rift.call(lib.fact, rift.c_longlong, i)
        if ret != fact(i):
            print("fact({}) = {} != {}".format(i, ret, fact(i)))
            return False
    return True
Example #2
0
File: main.py Project: Yayg/rift
#! /usr/bin/env python2
import rift

rift.init("main.so")
print(rift.call(lib.main, rift.c_int))