コード例 #1
0
ファイル: caller.c プロジェクト: AmesianX/RosWine
static HRESULT WINAPI Test_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp,
        VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
{
    ok(pspCaller != NULL, "pspCaller == NULL\n");

    switch(id) {
    case DISPID_TEST_TESTARGCONV:
        CHECK_EXPECT(testArgConv);

        ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags);
        ok(pdp != NULL, "pdp == NULL\n");
        ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
        ok(!pvarRes, "pvarRes != NULL\n");
        ok(pei != NULL, "pei == NULL\n");

        ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
        ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(rgvarg) = %d\n", V_VT(pdp->rgvarg));

        test_caller(pspCaller, V_DISPATCH(pdp->rgvarg));

        stored_obj = V_DISPATCH(pdp->rgvarg);
        IDispatch_AddRef(stored_obj);
        break;

    default:
        ok(0, "unexpected call\n");
        return E_NOTIMPL;
    }

    return S_OK;
}
コード例 #2
0
void
verify_code (gcc_jit_context *ctxt, gcc_jit_result *result)
{
  typedef void (*fn_type) (int);
  CHECK_NON_NULL (result);

  fn_type test_caller =
    (fn_type)gcc_jit_result_get_code (result, "test_caller");
  CHECK_NON_NULL (test_caller);

  called_with[0] = 0;
  called_with[1] = 0;
  called_with[2] = 0;

  /* Call the JIT-generated function.  */
  test_caller (5);

  /* Verify that it correctly called "called_function".  */
  CHECK_VALUE (called_with[0], 15);
  CHECK_VALUE (called_with[1], 20);
  CHECK_VALUE (called_with[2], 25);
}