Example #1
0
 /// <summary>
 /// Throws a <see cref="NotSupportedException"/> for the specified unsupported method.
 /// </summary>
 /// <param name="methodName">The name of the invoked method that is not supported.</param>
 public static void ThrowNotSupportedInvocationException(string methodName)
 {
     // Do not throw any exception while Delay Fuzzing.
     if (CoyoteRuntime.IsExecutionControlled && CoyoteRuntime.Current.SchedulingPolicy != SchedulingPolicy.Fuzzing)
     {
         // If Relaxed CCT is enabled, we should switch the Scheduling Policy to Delay fuzzing.
         CoyoteRuntime.CheckAndSetSchedulerStrategyToDelayFuzzing();
         throw new NotSupportedException($"Invoking '{methodName}' is not supported during systematic testing.");
     }
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TaskOperation"/> class.
 /// </summary>
 internal TaskOperation(ulong operationId, string name, CoyoteRuntime runtime)
     : base(operationId, name)
 {
     this.Runtime          = runtime;
     this.JoinDependencies = new HashSet <Task>();
 }
Example #3
0
 /// <inheritdoc/>
 public void Dispose()
 {
     this.Runtime = null;
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ControlledSynchronizationContext"/> class.
 /// </summary>
 internal ControlledSynchronizationContext(CoyoteRuntime runtime)
 {
     this.Runtime = runtime;
 }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ControlledTaskScheduler"/> class.
 /// </summary>
 public ControlledTaskScheduler(CoyoteRuntime runtime)
 {
     this.Runtime = runtime;
 }
Example #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Resource"/> class.
 /// </summary>
 internal Resource()
 {
     this.Runtime            = CoyoteRuntime.Current;
     this.AwaitingOperations = new HashSet <AsyncOperation>();
 }
Example #7
0
 /// <summary>
 /// Assigns the specified runtime as the default global runtime.
 /// </summary>
 internal static void AssignGlobalRuntime(CoyoteRuntime runtime) => DefaultInstance = runtime;
Example #8
0
 /// <summary>
 /// Assigns the specified runtime as the default for the current asynchronous control flow.
 /// </summary>
 internal static void AssignAsyncControlFlowRuntime(CoyoteRuntime runtime) => AsyncLocalInstance.Value = runtime;