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); }
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); }