Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 3
0
        public void Ctor_NInt_LargeValue()
        {
            nint  largeValue = unchecked (((nint)int.MaxValue) + 1);
            CLong value      = new CLong(largeValue);

            Assert.Equal(largeValue, value.Value);
        }
Ejemplo n.º 4
0
    private static void TestCLongReverse()
    {
        ThisCallNative.C c = CreateCWithManagedVTable(2.0f, 3.0f);
        CLong result = ThisCallNative.GetWidthAsLongFromManaged(&c);

        Assert.AreEqual((nint)c.width, result.Value);
    }
Ejemplo n.º 5
0
    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);
    }
Ejemplo n.º 6
0
 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);
    }
Ejemplo n.º 8
0
        public static void ToStringTest(int value, string expected)
        {
            CLong clong = new CLong(value);

            Assert.Equal(expected, clong.ToString());
        }
Ejemplo n.º 9
0
        public void Ctor_NInt()
        {
            CLong value = new CLong((nint)42);

            Assert.Equal(42, value.Value);
        }
Ejemplo n.º 10
0
        public void Ctor_Empty()
        {
            CLong value = new CLong();

            Assert.Equal(0, value.Value);
        }
Ejemplo n.º 11
0
    private static void TestCLong(StdCallMemberFunctionNative.C *instance)
    {
        CLong result = instance->vtable->getWidthAsLong(instance);

        Assert.Equal((nint)instance->width, result.Value);
    }