示例#1
0
        /// <summary>
        ///   Replays the computation of the initial state.
        /// </summary>
        internal unsafe void ReplayInitialState()
        {
            var initialState = _states[0];

            fixed(byte *state = &initialState[0])
            RuntimeModel.Replay(state, _replayInfo[0], initializationStep: true);
        }
示例#2
0
        /// <summary>
        ///   Replays the next transition of the simulated counter example.
        /// </summary>
        private void Replay()
        {
            fixed(byte *sourceState = _states[_stateIndex - 1])
            _runtimeModel.Replay(sourceState, _counterExample.GetReplayInformation(_stateIndex - 1), initializationStep: _stateIndex == -1);

            var actualState = stackalloc byte[_runtimeModel.StateVectorSize];
            _runtimeModel.Serialize(actualState);

            if (IsCompleted && _counterExample.EndsWithException)
            {
                throw new InvalidOperationException(
                          "The path the counter example was generated for ended with an exception that could not be reproduced by the replay.");
            }

            EnsureStatesMatch(actualState, _states[_stateIndex]);
        }