Example #1
0
    private static void Test4ByteHFAReverse()
    {
        ThisCallNative.C     c      = CreateCWithManagedVTable(2.0f, 3.0f);
        ThisCallNative.Width result = ThisCallNative.GetWidthFromManaged(&c);

        Assert.AreEqual(c.width, result.width);
    }
Example #2
0
    private static void Test4ByteHFAUnmanagedCallersOnly()
    {
        ThisCallNative.C     c      = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f);
        ThisCallNative.Width result = ThisCallNative.GetWidthFromManaged(&c);

        Assert.Equal(c.width, result.width);
    }
Example #3
0
    private static unsafe void Test4ByteHFA(ThisCallNative.C *instance)
    {
        ThisCallNative.GetWidthFn callback = Marshal.GetDelegateForFunctionPointer <ThisCallNative.GetWidthFn>(instance->vtable->getWidth);

        ThisCallNative.Width result = callback(instance);

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