Example #1
0
        public void startVerification(string assert)
        {
            do
            {
                mCurAssert = assert;
                if (!mSpec.GrabSharedDataLock())
                    break;

                try
                {
                    mSpec.LockSharedData(false);
                    mAssertion = mSpec.AssertionDatabase[assert];
                    mAssertion.UIInitialize(null, 0, 0);
                    mAssertion.ReturnResult += VerificationFinished;
                    mAssertion.Start();
                    System.Console.WriteLine("\nVerify {0}, result: {1}", assert, mAssertion.VerificationOutput.VerificationResult);
                }
                catch (RuntimeException e)
                {
                    mSpec.UnLockSharedData();
                    Common.Utility.Utilities.LogRuntimeException(e);
                    return;
                }
                catch (Exception ex)
                {
                    mSpec.UnLockSharedData();
                    Common.Utility.Utilities.LogException(ex, mSpec);
                    return;
                }
            } while (false);
        }
Example #2
0
        public void startVerification(string assert)
        {
            do
            {

                mCurAssert = assert;
                if (!mListener.moduleSpecificCheckPassed())
                    break;

                if (!mSpec.GrabSharedDataLock())
                {
                    MessageBox.Show(Resources.Please_wait_for_the_simulation_or_parsing_finished_before_verification, Common.Utility.Utilities.APPLICATION_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    break;
                }

                mListener.disableAllControls();
                try
                {
                    mSpec.LockSharedData(false);

                    mListener.updateStatusLabel(Resources.ModelCheckingForm_StartVerification_Verification_Starts);
                    mListener.updateResStartVerify();

                    mAssertion = mSpec.AssertionDatabase[assert];

                    int admissibleIndex = mListener.getCmbAdmissibleIndex();
                    int verificationEngineIndex = mListener.getCmbVerificationEngineIndex();
                    mAssertion.UIInitialize(mForm, admissibleIndex == -1 ? 0 : admissibleIndex,
                        verificationEngineIndex == -1 ? 0 : verificationEngineIndex);

                    mAssertion.VerificationOutput.GenerateCounterExample = mListener.generateCounterExample();
                    mAssertion.Action += mListener.onAction;
                    mAssertion.ReturnResult += VerificationFinished;
                    mAssertion.Cancelled += Verification_Cancelled;
                    mAssertion.Failed += MC_Failed;

                    mSeconds = 1;
                    mTimer.Start();
                    mAssertion.Start();
                }
                catch (RuntimeException e)
                {
                    mSpec.UnLockSharedData();
                    Common.Utility.Utilities.LogRuntimeException(e);
                    mListener.updateVerifyBtnLabel(LABEL_VERIFY);
                    mListener.closeForm();
                    return;
                }
                catch (Exception ex)
                {
                    mSpec.UnLockSharedData();
                    Common.Utility.Utilities.LogException(ex, mSpec);
                    mListener.updateVerifyBtnLabel(LABEL_VERIFY);
                    mListener.closeForm();
                    return;
                }
            } while (false);
        }