Пример #1
0
 int GI2 <TC> .HF2 <TF> (GI1 <TF> i1, long counter, long initial_stack, long current_stack)
 {
     if (counter > 0)
     {
         return(i1.HF1 <TC> (this, counter - 1, initial_stack, (long)&counter));
     }
     return(check((long)&counter, current_stack));
 }
Пример #2
0
    int GI2 <TC> .GF2 <TF> (GI1 <TC> i1, int counter, long initial_stack, long current_stack)
    {
        int local;

        if (counter > 0)
        {
            return(i1.GF1 <TF> (this, counter - 1, initial_stack, (long)&local));
        }
        return(check((long)&local, current_stack));
    }
Пример #3
0
    public static void Negative()
    {
        FooClass fooObj = new FooClass();
        IFoo     foo    = (IFoo)fooObj;

        Console.WriteLine("Calling IFoo.Foo on Foo - expecting exception.");
        try
        {
            foo.Foo(10);
            Test.Assert(false, "Expecting exception on Foo");
        }
        catch (Exception ex)
        {
            Console.WriteLine("Exception caught: " + ex.ToString());
        }

        I47Class i47Class = new I47Class();
        I1       i1       = (I1)i47Class;

        Console.WriteLine("Calling I1.Func on I47Class - expecting exception");
        try
        {
            i1.Func(10);
            Test.Assert(false, "Expecting exception on I47Class");
        }
        catch (Exception ex)
        {
            Console.WriteLine("Exception caught: " + ex.ToString());
        }

        var          gi23Class = new GI23Class <object>();
        GI1 <object> gi1       = (GI1 <object>)gi23Class;

        Console.WriteLine("Calling GI1<T>.Func on GI23Class<S> - expecting exception");
        try
        {
            Type[] types;
            gi1.Func <string>(out types);
            Test.Assert(false, "Expecting exception on GI23Class");
        }
        catch (Exception ex)
        {
            Console.WriteLine("Exception caught: " + ex.ToString());
        }
    }