public static void TestProc3()
        {
            Pystone.IntGlob = 0;
            var PtrParOut = new Record(Idents.Ident1, Idents.Ident3, 5, "DHRYSTONE PROGRAM, SOME STRING");

            PtrParOut.PtrComp = PtrParOut;
            PtrGlb            = PtrParOut;
            var result = Pystone.Proc3(PtrParOut);

            if (result.Discr != Idents.Ident1)
            {
                Environment.Exit(-1);
            }
            if (result.EnumComp != Idents.Ident3)
            {
                Environment.Exit(-1);
            }
            if (result.IntComp != 12)
            {
                Environment.Exit(-1);
            }
            if (!("DHRYSTONE PROGRAM, SOME STRING".Equals(result.StringComp)))
            {
                Environment.Exit(-1);
            }
        }
Esempio n. 2
0
        public static void Run()
        {
            Pystone pystone = new Pystone();
            var     result  = Pystone.pystones(1);

            Console.WriteLine("benchtime: " + result[0]);
            Console.WriteLine("loops / benchtime: " + result[1]);
        }
        public static void TestFunc3()
        {
            var EnumParIn = 3;
            var result    = Pystone.Func3(EnumParIn);

            if (result != true)
            {
                Environment.Exit(-1);
            }
        }
 public static void TestProc4()
 {
     Pystone.BoolGlob  = false;
     Pystone.Char1Glob = 'A';
     Pystone.Proc4();
     if (Pystone.Char2Glob != 'B')
     {
         Environment.Exit(-1);
     }
 }
        public static void TestProc6()
        {
            Pystone.IntGlob = 5;
            var EnumParIn = 3;
            var result    = Pystone.Proc6(EnumParIn);

            if (result != 2)
            {
                Environment.Exit(-1);
            }
        }
        public static void TestFunc1()
        {
            var CharPar1 = 'H';
            var CharPar2 = 'R';
            var result   = Pystone.Func1(CharPar1, CharPar2);

            if (result != Idents.Ident1)
            {
                Environment.Exit(-1);
            }
        }
Esempio n. 7
0
        public static void TestFunc2()
        {
            var StrParI1 = "DHRYSTONE PROGRAM, 1'ST STRING";
            var StrParI2 = "DHRYSTONE PROGRAM, 2'ND STRING";
            var result   = Pystone.Func2(StrParI1, StrParI2);

            if (result != false)
            {
                Environment.Exit(-1);
            }
        }
        public static void TestProc7()
        {
            var IntParI1 = 2;
            var IntParI2 = 3;
            var result   = Pystone.Proc7(IntParI1, IntParI2);

            if (result != 7)
            {
                Environment.Exit(-1);
            }
        }
Esempio n. 9
0
 public static void TestProc5()
 {
     Pystone.Proc5();
     if (Pystone.Char1Glob != 'A')
     {
         Environment.Exit(-1);
     }
     if (Pystone.BoolGlob != false)
     {
         Environment.Exit(-1);
     }
 }
Esempio n. 10
0
        public static void TestProc2()
        {
            var IntParIO = 3;

            Pystone.Char1Glob = 'A';
            Pystone.IntGlob   = 5;
            var result = Pystone.Proc2(IntParIO);

            if (result != 7)
            {
                Environment.Exit(-1);
            }
        }
Esempio n. 11
0
        public static void TestProc8()
        {
            var Array1Par = new int[51];
            var Array2Par = new int[51][];

            for (int i = 0; i < 51; i++)
            {
                Array2Par[i] = new int[51];
            }
            Array2Par[8][7] = 10;
            var IntParI1 = 3;
            var IntParI2 = 7;

            Pystone.Proc8(Array1Par, Array2Par, IntParI1, IntParI2);
            if (Pystone.IntGlob != 5)
            {
                Environment.Exit(-1);
            }
        }
Esempio n. 12
0
        public static var Proc0(var loops)
        {
            var benchtime  = 0;
            var nulltime   = 0;
            var String1Loc = "";

            Chronometer chronometer = new Chronometer();

            chronometer.Start();
            for (int i = 0; i < loops; i++)
            {
                ;
            }
            chronometer.Stop();
            benchtime = chronometer.GetMiliSeconds();

            PtrGlbNext        = new Record(0, Idents.Ident1, 0, "");
            PtrGlb            = new Record(0, Idents.Ident1, 0, "");
            PtrGlb.PtrComp    = PtrGlbNext;
            PtrGlb.Discr      = Idents.Ident1;
            PtrGlb.EnumComp   = Idents.Ident3;
            PtrGlb.IntComp    = 40;
            PtrGlb.StringComp = "DHRYSTONE PROGRAM, SOME STRING";
            String1Loc        = "DHRYSTONE PROGRAM, 1'ST STRING";
            Array2Glob[8][7]  = 10;

            chronometer.Start();
            for (int i = 0; i < loops; i++)
            {
                Pystone.DoWork();
            }
            chronometer.Stop();
            benchtime = benchtime + chronometer.GetMiliSeconds();

            var result = new double[2];

            result[0] = benchtime;
            result[1] = (benchtime != 0)?(loops / benchtime):0;
            return(result);
        }
Esempio n. 13
0
        public static void TestProc1()
        {
            var PtrParIn = new Record(Idents.Ident1, Idents.Ident3, 40, "DHRYSTONE PROGRAM, SOME STRING");

            Pystone.PtrGlb = PtrParIn;
            var result = Pystone.Proc1(PtrParIn);

            if (result.Discr != Idents.Ident1)
            {
                Environment.Exit(-1);
            }
            if (result.EnumComp != Idents.Ident3)
            {
                Environment.Exit(-1);
            }
            if (result.IntComp != 12)
            {
                Environment.Exit(-1);
            }
            if (!("DHRYSTONE PROGRAM, SOME STRING".Equals(result.StringComp)))
            {
                Environment.Exit(-1);
            }
        }
Esempio n. 14
0
 public static void Test()
 {
     Pystone.TestProc1();
     Console.WriteLine("TestProc1 completed!!");
 }
Esempio n. 15
0
 public static void Main()
 {
     Pystone.Run();
     Console.WriteLine("Pystone completed!!");
 }
Esempio n. 16
0
 public static var pystones(var loops)
 {
     return(Pystone.Proc0(loops));
 }
Esempio n. 17
0
 public static void Test()
 {
     Pystone.TestFunc3();
     Console.WriteLine("TestFunc3 completed!!");
 }