Exemple #1
0
        public static int Main( String [] args )
        {
            int iRep = 20;

            Console.WriteLine("Test should return with ExitCode 100 ...");

            if( args.Length > 0 )
            {
                try
                {
                    iRep = Int32.Parse( args[0] );
                }
                catch(FormatException )
                {
                    Console.WriteLine("FormatException is caught");
                }
            }

            Object [] VarAry = new Object[1];
            VarAryStress mv_obj = new VarAryStress();
            for(int i=0; i< iRep; i++ )
            {
                if( i>1 )
                {
                    VarAry[0] = mv_obj.SetVarAry( i-1 );
                }
                else
                {
                    VarAry[0] = i;
                }
                if( i%5 == 0)
                {
                    GC.Collect();
                    // Console.WriteLine( "HeapSize after GC: {0}", GC.GetTotalMemory(false) );
                }

            }

            Console.WriteLine( "Test Passed" );
            return 100;
        }
Exemple #2
0
        public static int Main(String [] args)
        {
            int iRep = 20;

            Console.WriteLine("Test should return with ExitCode 100 ...");

            if (args.Length > 0)
            {
                try
                {
                    iRep = Int32.Parse(args[0]);
                }
                catch (FormatException)
                {
                    Console.WriteLine("FormatException is caught");
                }
            }

            Object []    VarAry = new Object[1];
            VarAryStress mv_obj = new VarAryStress();

            for (int i = 0; i < iRep; i++)
            {
                if (i > 1)
                {
                    VarAry[0] = mv_obj.SetVarAry(i - 1);
                }
                else
                {
                    VarAry[0] = i;
                }
                if (i % 5 == 0)
                {
                    GC.Collect();
                    // Console.WriteLine( "HeapSize after GC: {0}", GC.GetTotalMemory(false) );
                }
            }

            Console.WriteLine("Test Passed");
            return(100);
        }