private static void TestCLongUnmanagedCallersOnly() { ThisCallNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f); CLong result = ThisCallNative.GetWidthAsLongFromManaged(&c); Assert.Equal((nint)c.width, result.Value); }
private static void TestCLongUnmanagedCallersOnly() { PlatformDefaultMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f); CLong result = PlatformDefaultMemberFunctionNative.GetWidthAsLongFromManaged(&c); Assert.AreEqual((nint)c.width, result.Value); }
public void Ctor_NInt_LargeValue() { nint largeValue = unchecked (((nint)int.MaxValue) + 1); CLong value = new CLong(largeValue); Assert.Equal(largeValue, value.Value); }
private static void TestCLongReverse() { ThisCallNative.C c = CreateCWithManagedVTable(2.0f, 3.0f); CLong result = ThisCallNative.GetWidthAsLongFromManaged(&c); Assert.AreEqual((nint)c.width, result.Value); }
private static void TestCLong(ThisCallNative.C *instance) { ThisCallNative.GetWidthAsLongFn callback = Marshal.GetDelegateForFunctionPointer <ThisCallNative.GetWidthAsLongFn>(instance->vtable->getWidthAsLong); CLong result = callback(instance); Assert.Equal((nint)instance->width, result.Value); }
public void EqualsTest(CLong clong, object obj, bool expected) { if (obj is CLong clong2) { Assert.Equal(expected, clong.Equals(clong2)); Assert.Equal(expected, clong.GetHashCode().Equals(clong2.GetHashCode())); } Assert.Equal(expected, clong.Equals(obj)); }
private static void TestCLong(PlatformDefaultMemberFunctionNative.C *instance) { CLong result = instance->vtable->getWidthAsLong(instance); Assert.AreEqual((nint)instance->width, result.Value); }
public static void ToStringTest(int value, string expected) { CLong clong = new CLong(value); Assert.Equal(expected, clong.ToString()); }
public void Ctor_NInt() { CLong value = new CLong((nint)42); Assert.Equal(42, value.Value); }
public void Ctor_Empty() { CLong value = new CLong(); Assert.Equal(0, value.Value); }
private static void TestCLong(StdCallMemberFunctionNative.C *instance) { CLong result = instance->vtable->getWidthAsLong(instance); Assert.Equal((nint)instance->width, result.Value); }