コード例 #1
0
ファイル: ThisCallTest.cs プロジェクト: trieshard/runtime
    private static void Test4ByteNonHFAReverse()
    {
        ThisCallNative.C          c      = CreateCWithManagedVTable(2.0f, 3.0f);
        ThisCallNative.IntWrapper result = ThisCallNative.GetHeightAsIntFromManaged(&c);

        Assert.AreEqual((int)c.height, result.i);
    }
コード例 #2
0
    private static unsafe void Test4ByteNonHFA(ThisCallNative.C *instance)
    {
        ThisCallNative.GetHeightAsIntFn callback = Marshal.GetDelegateForFunctionPointer <ThisCallNative.GetHeightAsIntFn>(instance->vtable->getHeightAsInt);

        ThisCallNative.IntWrapper result = callback(instance);

        Assert.AreEqual((int)instance->height, result.i);
    }