コード例 #1
0
ファイル: getgeneration.cs プロジェクト: zwei222/coreclr
    public static int Main(string[] args)
    {
        uint sizeInMB = 0;

        try {
            sizeInMB = UInt32.Parse(args[0]);
        } catch (Exception e) {
            if ((e is IndexOutOfRangeException) || (e is FormatException) || (e is OverflowException))
            {
                Console.WriteLine("args: uint - number of MB to allocate");
                return(0);
            }
            throw;
        }

        int availableMem = MemCheck.GetPhysicalMem();

        if (availableMem != -1 && availableMem < sizeInMB)
        {
            sizeInMB = (uint)(availableMem > 300 ? 300 : (availableMem / 2));
            Console.WriteLine("Not enough memory. Allocating " + sizeInMB + "MB instead.");
        }

        GetGenerationTest test = new GetGenerationTest();

        test.size = sizeInMB;
        if (test.RunTests())
        {
            Console.WriteLine("Test passed");
            return(100);
        }

        Console.WriteLine("Test failed");
        return(0);
    }
コード例 #2
0
    public static int Main(string[] args)
    {
        uint size = 0;

        try {
            size = UInt32.Parse(args[0]);
        } catch (Exception e) {
            if ((e is IndexOutOfRangeException) || (e is FormatException) || (e is OverflowException))
            {
                Console.WriteLine("args: uint - number of GB to allocate");
                return(0);
            }
            throw;
        }

        GetGenerationTest test = new GetGenerationTest();

        test.size = size;
        if (test.RunTests())
        {
            Console.WriteLine("Test passed");
            return(100);
        }

        Console.WriteLine("Test failed");
        return(0);
    }
コード例 #3
0
    public static int Main()
    {
        GetGenerationTest t = new GetGenerationTest();

        if (t.RunTests())
        {
            Console.WriteLine("Test for GetGeneration() passed!");
            return(100);
        }


        Console.WriteLine("Test for GetGeneration() FAILED!");
        return(1);
    }
コード例 #4
0
ファイル: getgeneration.cs プロジェクト: mikem8361/runtime
    public static int Main(string[] args)
    {
        GetGenerationTest test = new GetGenerationTest();

        test.size = MemCheck.ParseSizeMBAndLimitByAvailableMem(args);
        if (test.RunTests())
        {
            Console.WriteLine("Test passed");
            return(100);
        }

        Console.WriteLine("Test failed");
        return(0);
    }
コード例 #5
0
ファイル: getgeneration.cs プロジェクト: geoffkizer/coreclr
    public static int Main(string[] args) {

        uint size = 0;
        try {
            size = UInt32.Parse(args[0]);
        } catch (Exception e) {
            if ( (e is IndexOutOfRangeException) || (e is FormatException) || (e is OverflowException) ) {
                Console.WriteLine("args: uint - number of GB to allocate");
                return 0;
            }
            throw;
        }

        GetGenerationTest test = new GetGenerationTest();
        test.size = size;
        if (test.RunTests()) {
            Console.WriteLine("Test passed");
            return 100;
        }

        Console.WriteLine("Test failed");
        return 0;
    }
コード例 #6
0
ファイル: GetGeneration.cs プロジェクト: CheneyWu/coreclr
    public static int Main()
    {
        GetGenerationTest t = new GetGenerationTest();

        if (t.RunTests())
        {
            Console.WriteLine("Test for GetGeneration() passed!");
            return 100;
        }


        Console.WriteLine("Test for GetGeneration() FAILED!");
        return 1;
    }
コード例 #7
0
ファイル: getgeneration.cs プロジェクト: CheneyWu/coreclr
    public static int Main(string[] args) {

        uint sizeInMB = 0;
        try {
            sizeInMB = UInt32.Parse(args[0]);
        } catch (Exception e) {
            if ( (e is IndexOutOfRangeException) || (e is FormatException) || (e is OverflowException) ) {
                Console.WriteLine("args: uint - number of MB to allocate");
                return 0;
            }
            throw;
        }

        int availableMem = MemCheck.GetPhysicalMem();
        if (availableMem != -1 && availableMem < sizeInMB){
            sizeInMB = (uint)(availableMem > 300 ? 300 : (availableMem / 2));
            Console.WriteLine("Not enough memory. Allocating " + sizeInMB + "MB instead.");
        }

        GetGenerationTest test = new GetGenerationTest();
        test.size = sizeInMB;
        if (test.RunTests()) {
            Console.WriteLine("Test passed");
            return 100;
        }

        Console.WriteLine("Test failed");
        return 0;
    }