Esempio n. 1
0
    public static int test_0_constrained_void_iface_call()
    {
        IFaceConstrained c = new ClassConstrained();
        var s = new ConsStruct()
        {
            i = 42
        };

        constrained_res = null;
        c.constrained_void_iface_call <int, ConsStruct> (1, s);
        if (!(constrained_res is int) || ((int)constrained_res) != 42)
        {
            return(1);
        }
        constrained_res = null;
        c.constrained_void_iface_call_ref_arg <int, ConsStruct> (1, s);
        if (!(constrained_res is int) || ((int)constrained_res) != 42)
        {
            return(2);
        }
        var s2 = new ConsClass()
        {
            i = 43
        };

        constrained_res = null;
        c.constrained_void_iface_call <int, ConsClass> (1, s2);
        if (!(constrained_res is int) || ((int)constrained_res) != 43)
        {
            return(3);
        }
        constrained_res = null;
        c.constrained_void_iface_call_ref_arg <int, ConsClass> (1, s2);
        if (!(constrained_res is int) || ((int)constrained_res) != 43)
        {
            return(4);
        }
        return(0);
    }
Esempio n. 2
0
    public static int test_0_constrained_eh()
    {
        var s2 = new ConsStructThrow()
        {
        };

        try {
            IFaceConstrained c = new ClassConstrained();
            c.constrained_void_iface_call <int, ConsStructThrow> (1, s2);
            return(1);
        } catch (Exception) {
            return(0);
        }
    }