예제 #1
0
    private static void TestEnumReverse()
    {
        ThisCallNative.C c      = CreateCWithManagedVTable(2.0f, 3.0f);
        ThisCallNative.E result = ThisCallNative.GetEFromManaged(&c);

        Assert.AreEqual(c.dummy, result);
    }
예제 #2
0
    private static void TestEnumUnmanagedCallersOnly()
    {
        ThisCallNative.C c      = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f);
        ThisCallNative.E result = ThisCallNative.GetEFromManaged(&c);

        Assert.Equal(c.dummy, result);
    }
예제 #3
0
    private static void TestEnum(ThisCallNative.C *instance)
    {
        ThisCallNative.GetEFn callback = Marshal.GetDelegateForFunctionPointer <ThisCallNative.GetEFn>(instance->vtable->getE);

        ThisCallNative.E result = callback(instance);

        Assert.AreEqual(instance->dummy, result);
    }