Beispiel #1
0
    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);
    }
Beispiel #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);
    }
Beispiel #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);
    }
Beispiel #4
0
    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);
    }
Beispiel #5
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;
    }
Beispiel #6
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;
    }
Beispiel #7
0
    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;
    }