Ejemplo n.º 1
0
        public void SanityCheck(int length)
        {
            bool ok = true;

            for (int n = 0; n < length; n++)
            {
                XInt r = Candidate.Reference.GetValue(n);

                foreach (Candidate cand in Candidate.Sanity)
                {
                    XInt t = cand.GetValue(n);
                    if (!t.Equals(r))
                    {
                        this.winsole.WriteLine(string.Format(
                                                   "\n{0}({1}) failed!", cand.Name.Trim(), n));
                        ok = false;
                    }
                }
                if ((n % 10) == 0)
                {
                    this.winsole.WriteFlush(" . ");
                }
                if ((n % 150) == 149)
                {
                    this.winsole.WriteLine();
                }
            }

            this.winsole.Write("\nWell, some values will" + (ok ? " " : " not ") +
                               "give correct results  " + (ok ? ";-)\n" : "~:(\n"));
        }