Beispiel #1
0
def test_execute_varargs():
    cpu = FakeCPU()
    descr = FakeCallDescr()
    argboxes = [BoxInt(99999), BoxInt(321), constfloat(2.25), ConstInt(123),
                BoxPtr(), boxfloat(5.5)]
    box = execute_varargs(cpu, FakeMetaInterp(), rop.CALL, argboxes, descr)
    assert box.getfloat() == 42.5
    assert cpu.fakecalled == (99999, descr, [321, 123],
                              [ConstPtr.value],
                              [longlong.getfloatstorage(2.25),
                               longlong.getfloatstorage(5.5)])
Beispiel #2
0
def test_execute_varargs():
    cpu = FakeCPU()
    descr = FakeDescr()
    argboxes = [BoxInt(321), ConstInt(123)]
    box = execute_varargs(cpu, rop.CALL, argboxes, descr)
    assert box.args == ('call', argboxes, descr)