Пример #1
0
        private void ExecuteRandomThread()
        {
            FireEventExecuteTest();

            int i = 1;

            for (; i <= m_Rounds; i++)
            {
                BigInteger k = BigIntegerHelper.Max(2, BigIntegerHelper.RandomIntLimit(BigInteger.Parse(m_RandomBaseTo.ToString())));
                if (ExecuteWitness(i, new PrimesBigInteger(k.ToString())))
                {
                    break;
                }
            }

            if (i <= m_Rounds)
            {
                log.Info(string.Format((i == 1) ? rsc.Primetest.mr_witnessfound1 : rsc.Primetest.mr_witnessfound2, i, m_Value));
            }
            else
            {
                log.Info(string.Format((m_Rounds.IntValue == 1) ? rsc.Primetest.mr_witnessnotfound1 : rsc.Primetest.mr_witnessnotfound2, m_Rounds.IntValue, m_Value));
            }

            FireEventCancelTest();
        }