コード例 #1
0
 private static void VerifyIncrementString(string opstring)
 {
     StackCalc sc = new StackCalc(opstring);
     while (sc.DoNextOperation())
     {
         Assert.Equal(sc.snCalc.Peek().ToString(), sc.myCalc.Peek().ToString());
     }
 }
コード例 #2
0
ファイル: sign.cs プロジェクト: Rayislandstyle/corefx
 private static void VerifySignString(string opstring)
 {
     StackCalc sc = new StackCalc(opstring);
     while (sc.DoNextOperation())
     {
         Assert.Equal(sc.snCalc.Peek().ToString(), sc.myCalc.Peek().ToString());
     }
 }
コード例 #3
0
        private static void VerifyAbsoluteValueString(string opstring)
        {
            StackCalc sc = new StackCalc(opstring);

            while (sc.DoNextOperation())
            {
                Assert.AreEqual(sc.snCalc.Peek().ToString(), sc.myCalc.Peek().ToString());
            }
        }
コード例 #4
0
        private static void VerifyDivRemString(string opstring)
        {
            StackCalc sc = new StackCalc(opstring);

            while (sc.DoNextOperation())
            {
                Assert.Equal(sc.snCalc.Peek().ToString(), sc.myCalc.Peek().ToString());
                sc.VerifyOutParameter();
            }
        }
コード例 #5
0
ファイル: log10.cs プロジェクト: wuyou201400/corefx
        private static bool VerifyLogString(string opstring)
        {
            bool      ret = true;
            StackCalc sc  = new StackCalc(opstring);

            while (sc.DoNextOperation())
            {
                ret &= Eval(sc.snCalc.Peek().ToString(), sc.myCalc.Peek().ToString(), String.Format("Out of Sync stacks found.  BigInteger {0} Mine {1}", sc.snCalc.Peek(), sc.myCalc.Peek()));
            }
            return(ret);
        }
コード例 #6
0
 private static void VerifyDivRemString(string opstring)
 {
     try
     {
         StackCalc sc = new StackCalc(opstring);
         while (sc.DoNextOperation())
         {
             Assert.Equal(sc.snCalc.Peek().ToString(), sc.myCalc.Peek().ToString());
             sc.VerifyOutParameter();
         }
     }
     catch (Exception e) when(!(e is DivideByZeroException))
     {
         // Log the original parameters, so we can reproduce any failure given the log
         throw new Exception($"VerifyDivRemString failed: {opstring} {e.ToString()}", e);
     }
 }
コード例 #7
0
ファイル: log.cs プロジェクト: zhiliangxu/corefx
        private static void VerifyIdentityString(string opstring1, string opstring2)
        {
            StackCalc sc1 = new StackCalc(opstring1);

            while (sc1.DoNextOperation())
            {
                //Run the full calculation
                sc1.DoNextOperation();
            }

            StackCalc sc2 = new StackCalc(opstring2);

            while (sc2.DoNextOperation())
            {
                //Run the full calculation
                sc2.DoNextOperation();
            }

            Assert.Equal(sc1.snCalc.Peek().ToString(), sc2.snCalc.Peek().ToString());
        }
コード例 #8
0
ファイル: log10.cs プロジェクト: wuyou201400/corefx
        private static bool VerifyIdentityString(string opstring1, string opstring2)
        {
            bool ret = true;

            StackCalc sc1 = new StackCalc(opstring1);

            while (sc1.DoNextOperation())
            {   //Run the full calculation
                sc1.DoNextOperation();
            }

            StackCalc sc2 = new StackCalc(opstring2);

            while (sc2.DoNextOperation())
            {   //Run the full calculation
                sc2.DoNextOperation();
            }

            ret &= Eval(sc1.snCalc.Peek().ToString(), sc2.snCalc.Peek().ToString(), String.Format("Out of Sync stacks found.  BigInteger1: {0} BigInteger2: {1}", sc1.snCalc.Peek(), sc2.snCalc.Peek()));

            return(ret);
        }
コード例 #9
0
ファイル: gcd.cs プロジェクト: Rayislandstyle/corefx
        private static void VerifyIdentityString(string opstring1, string opstring2)
        {
            StackCalc sc1 = new StackCalc(opstring1);
            while (sc1.DoNextOperation())
            {
                //Run the full calculation
                sc1.DoNextOperation();
            }

            StackCalc sc2 = new StackCalc(opstring2);
            while (sc2.DoNextOperation())
            {	
                //Run the full calculation
                sc2.DoNextOperation();
            }

            Assert.Equal(sc1.snCalc.Peek().ToString(), sc2.snCalc.Peek().ToString());
        }
コード例 #10
0
ファイル: divrem.cs プロジェクト: chcosta/corefx
 private static void VerifyDivRemString(string opstring)
 {
     try
     {
         StackCalc sc = new StackCalc(opstring);
         while (sc.DoNextOperation())
         {
             Assert.Equal(sc.snCalc.Peek().ToString(), sc.myCalc.Peek().ToString());
             sc.VerifyOutParameter();
         }
     }
     catch(Exception e) when (!(e is DivideByZeroException))
     {
         // Log the original parameters, so we can reproduce any failure given the log
         throw new Exception($"VerifyDivRemString failed: {opstring} {e.ToString()}", e);
     }
 }
コード例 #11
0
ファイル: divrem.cs プロジェクト: Corillian/corefx
 private static void VerifyDivRemString(string opstring)
 {
     StackCalc sc = new StackCalc(opstring);
     while (sc.DoNextOperation())
     {
         Assert.Equal(sc.snCalc.Peek().ToString(), sc.myCalc.Peek().ToString());
         sc.VerifyOutParameter();
     }
 }