public static void StructWithDefaultNonBlittableFields_IgnoresMarshalAsInfo() { short s = 41; bool b = true; Assert.False(DisabledRuntimeMarshallingNative.GetStructWithShortAndBoolWithVariantBoolCallback()(new StructWithShortAndBool(s, b), s, b)); }
public static void StructWithDefaultNonBlittableFields_MarshalAsInfo() { short s = 41; bool b = true; var callback = Marshal.GetDelegateForFunctionPointer <CheckStructWithShortAndBoolWithMarshalAsAndVariantBoolCallback>((IntPtr)DisabledRuntimeMarshallingNative.GetStructWithShortAndBoolWithVariantBoolCallback()); Assert.True(callback(new StructWithShortAndBoolWithMarshalAs(s, b), s, b)); }