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
#! /usr/bin/env python2 import rift rift.init("main.so") print(rift.call(lib.main, rift.c_int))