6864 references to Assert
CodeGenerator (1)
HttpUtilities\HttpUtilities.cs (1)
308Debug.Assert(str.Length == sizeof(ulong), string.Format(CultureInfo.InvariantCulture, "String must be exactly {0} (ASCII) characters long.", sizeof(ulong)));
http2cat (7)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
223Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
IIS.FunctionalTests (7)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
223Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
IIS.LongTests (7)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
223Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
IIS.NewHandler.FunctionalTests (7)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
223Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
IIS.NewShim.FunctionalTests (7)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
223Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
IIS.ShadowCopy.Tests (3)
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
223Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
IISExpress.FunctionalTests (7)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
223Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
illink (6)
ILLink.RoslynAnalyzer (10)
DataFlow\LocalDataFlowVisitor.cs (7)
103 Debug.Assert (OwningSymbol is IMethodSymbol or IFieldSymbol or IPropertySymbol, 111 Debug.Assert (OwningSymbol is IMethodSymbol, 204 Debug.Assert (local.ContainingSymbol is IMethodSymbol or IFieldSymbol, // backing field for property initializers 451 Debug.Assert (!IsLValueFlowCapture (operation.Id), 453 Debug.Assert (operation.GetValueUsageInfo (OwningSymbol).HasFlag (ValueUsageInfo.Read), 472 Debug.Assert (operation.GetValueUsageInfo (OwningSymbol).HasFlag (ValueUsageInfo.Write), 474 Debug.Assert (operation.GetValueUsageInfo (OwningSymbol).HasFlag (ValueUsageInfo.Reference),
DataFlow\LValueFlowCaptureProvider.cs (1)
80 Debug.Assert (kind == FlowCaptureKind.LValueAndRValueCapture || !rvalueFlowCaptureIds.Contains (captureId), "Flow capture used as both an r-value and an l-value, but with incorrect flow capture kind");
TrimAnalysis\MethodReturnValue.cs (1)
22 Debug.Assert (!isNewObj || methodSymbol.MethodKind == MethodKind.Constructor, "isNewObj can only be true for constructors");
TrimAnalysis\TrimAnalysisPatternStore.cs (1)
103 Debug.Assert (existingPattern == pattern, "Return values should be identical");
InMemory.FunctionalTests (2)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (1)
122Debug.Assert(streamId == 0 || streamId == -1, "StreamId sent that was non-zero, which isn't handled by tests");
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
Microsoft.AspNetCore (3)
WebApplicationBuilder.cs (3)
82Debug.Assert(slim, "should only be called with slim: true"); 148Debug.Assert(!slim, "should only be called with slim: false"); 149Debug.Assert(empty, "should only be called with empty: true");
Microsoft.AspNetCore.App.Analyzers (11)
Infrastructure\VirtualChars\AbstractVirtualCharService.cs (8)
82Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 86Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 95Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 104Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 114Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 118Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 144Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 150Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics.");
src\Shared\Diagnostics\AnalyzerDebug.cs (2)
16/// <inheritdoc cref="Debug.Assert(bool, string)"/> 19=> Debug.Assert(b, message);
src\Shared\RoslynUtils\WellKnownTypes.cs (1)
46Debug.Assert(name == typeIdName, $"Enum name ({typeIdName}) and type name ({name}) must match at {i}");
Microsoft.AspNetCore.App.CodeFixes (2)
Authorization\AddAuthorizationBuilderFixer.cs (2)
76Debug.Assert(false, "AddAuthorizationBuilderAnalyzer should not have emitted a diagnostic."); 110Debug.Assert(false, "AddAuthorizationBuilderAnalyzer should not have emitted a diagnostic.");
Microsoft.AspNetCore.Authentication.Negotiate (2)
NegotiateHandler.cs (2)
209Debug.Assert(object.ReferenceEquals(persistence?.State, _negotiateState), 401Debug.Assert(!items.ContainsKey(AuthPersistenceKey), "This should only be registered once per connection");
Microsoft.AspNetCore.Components (2)
RenderTree\RenderTreeDiffBuilder.cs (1)
174Debug.Assert(action switch
src\Http\Routing\src\Patterns\RoutePatternMatcher.cs (1)
434Debug.Assert(false, "indexOfLastSegementUsed should always be 0 from the check above");
Microsoft.AspNetCore.Components.Server (14)
BlazorPack\SequenceOfT.cs (3)
168Debug.Assert(last != null, "Cannot advance before acquiring memory."); 407Debug.Assert(segment != null, "Null not allowed."); 433Debug.Assert(offset >= this.Start, "Trying to rewind.");
Circuits\CircuitRegistry.cs (1)
133Debug.Assert(result, "This operation operates inside of a lock. We expect the previously inspected value to be still here.");
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequenceReader.cs (9)
263Debug.Assert(this.usingSequence, "usingSequence"); 270Debug.Assert(this.usingSequence, "usingSequence"); 305Debug.Assert(this.usingSequence, "usingSequence"); 365Debug.Assert(count >= 0, "count >= 0"); 382Debug.Assert(count >= 0, "count >= 0"); 387Debug.Assert(this.CurrentSpanIndex < this.CurrentSpan.Length, "this.CurrentSpanIndex < this.CurrentSpan.Length"); 408Debug.Assert(this.usingSequence, "usingSequence"); 430Debug.Assert(count >= 0, "count >= 0"); 474Debug.Assert(firstSpan.Length < destination.Length, "firstSpan.Length < destination.Length");
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequenceReaderExtensions.cs (1)
72Debug.Assert(reader.UnreadSpan.Length < sizeof(T), "reader.UnreadSpan.Length < sizeof(T)");
Microsoft.AspNetCore.Components.Server.Tests (2)
src\SignalR\common\SignalR.Common\test\Internal\Protocol\MessagePackHubProtocolTestBase.cs (2)
465Debug.Assert(size < 16, "Test code doesn't support array sizes greater than 15"); 472Debug.Assert(size < 16, "Test code doesn't support string sizes greater than 15");
Microsoft.AspNetCore.Components.WebAssembly (1)
Services\WebAssemblyConsoleLogger.cs (1)
95Debug.Assert(logLevel != LogLevel.None, "This method is never called with LogLevel.None.");
Microsoft.AspNetCore.Cryptography.Internal (1)
UnsafeNativeMethods.cs (1)
479Debug.Assert(lastError != 0, "This method should only be called if there was an error.");
Microsoft.AspNetCore.DataProtection (7)
KeyManagement\Key.cs (1)
151Debug.Assert(_descriptorFactory is not null, "Key constructed without either descriptor or descriptor factory");
KeyManagement\KeyRingBasedDataProtector.cs (1)
299Debug.Assert(success, "Failed to write Guid.");
KeyManagement\KeyRingProvider.cs (4)
387Debug.Assert(taskKeyRing is not null, "How did _cacheableKeyRingTask change while we were holding the lock?"); 395Debug.Assert(!forceRefresh, "Consumed cached key ring even though forceRefresh is true"); 396Debug.Assert(!CacheableKeyRing.IsValid(existingCacheableKeyRing, utcNow), "Should have returned a valid cached key ring above"); 447Debug.Assert(!task.IsCanceled, "How did a task with no cancellation token get canceled?");
KeyManagement\XmlKeyManager.cs (1)
261Debug.Assert(_cacheExpirationTokenSource != null, $"{nameof(TriggerAndResetCacheExpirationToken)} must have been called first.");
Microsoft.AspNetCore.DataProtection.Abstractions (1)
src\Shared\WebEncoders\WebEncoders.cs (1)
111Debug.Assert(arraySizeRequired % 4 == 0, "Invariant: Array length must be a multiple of 4.");
Microsoft.AspNetCore.Diagnostics (2)
src\Shared\Diagnostics\AnalyzerDebug.cs (2)
16/// <inheritdoc cref="Debug.Assert(bool, string)"/> 19=> Debug.Assert(b, message);
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (2)
src\Shared\Diagnostics\AnalyzerDebug.cs (2)
16/// <inheritdoc cref="Debug.Assert(bool, string)"/> 19=> Debug.Assert(b, message);
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
Internal\Json\MessageTypeInfoResolver.cs (1)
126Debug.Assert(!field.IsRepeated && !field.IsMap, "Collections shouldn't have a setter.");
Microsoft.AspNetCore.Hosting (6)
Internal\ConfigureContainerBuilder.cs (1)
24Debug.Assert(MethodInfo != null, "Shouldn't be called when there is no Configure method.");
Internal\HostingApplicationDiagnostics.cs (1)
160Debug.Assert(context.MetricsTagsFeature != null, "MetricsTagsFeature should be set if MetricsEnabled is true.");
Internal\WebHost.cs (4)
81Debug.Assert(_applicationServices != null, "Initialize must be called before accessing services."); 126Debug.Assert(_applicationServices != null, "Initialize must be called first."); 202Debug.Assert(_applicationServices != null, "Initialize must be called first."); 255Debug.Assert(_applicationServices != null, "Initialize must be called first.");
Microsoft.AspNetCore.Http.Abstractions (2)
Extensions\UseMiddlewareExtensions.cs (2)
201Debug.Assert(!RuntimeFeature.IsDynamicCodeSupported, "Use reflection fallback when dynamic code is not supported."); 227Debug.Assert(RuntimeFeature.IsDynamicCodeSupported, "Use compiled expression when dynamic code is supported.");
Microsoft.AspNetCore.Http.Connections (3)
Internal\HttpConnectionContext.cs (1)
629Debug.Assert(TransportType != HttpTransportType.None, "Transport has not been initialized yet");
Internal\Transports\WebSocketsServerTransport.cs (1)
39Debug.Assert(context.WebSockets.IsWebSocketRequest, "Not a websocket request");
src\Shared\WebEncoders\WebEncoders.cs (1)
111Debug.Assert(arraySizeRequired % 4 == 0, "Invariant: Array length must be a multiple of 4.");
Microsoft.AspNetCore.Http.Extensions (9)
RequestDelegateFactory.cs (5)
1268Debug.Assert(factoryContext.JsonRequestBodyParameter is not null, "factoryContext.JsonRequestBodyParameter is null for a JSON body."); 1275Debug.Assert(parameterName is not null, "CreateArgument() should throw if parameter.Name is null."); 1403Debug.Assert(factoryContext.FirstFormRequestBodyParameter is not null, "factoryContext.FirstFormRequestBodyParameter is null for a form body."); 1410Debug.Assert(parameterName is not null, "CreateArgument() should throw if parameter.Name is null."); 2245Debug.Assert(parameterName is not null, "CreateArgument() should throw if parameter.Name is null.");
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (2)
106Debug.Assert(_executor != null, "Sync execution is not supported."); 132Debug.Assert(_executorAsync != null, "Async execution is not supported.");
src\Shared\PropertyAsParameterInfo.cs (1)
25Debug.Assert(propertyInfo != null, "PropertyInfo must be provided.");
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (1)
290Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.AspNetCore.Http.RequestDelegateGenerator (3)
src\Shared\Diagnostics\AnalyzerDebug.cs (2)
16/// <inheritdoc cref="Debug.Assert(bool, string)"/> 19=> Debug.Assert(b, message);
src\Shared\RoslynUtils\WellKnownTypes.cs (1)
46Debug.Assert(name == typeIdName, $"Enum name ({typeIdName}) and type name ({name}) must match at {i}");
Microsoft.AspNetCore.HttpLogging (1)
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (1)
290Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.AspNetCore.Mvc.Abstractions (2)
ModelBinding\ModelMetadata.cs (2)
152Debug.Assert(BoundConstructor != null, "This API can be only called for types with bound constructors."); 167Debug.Assert(BoundConstructor != null, "This API can be only called for types with bound constructors.");
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
src\Shared\PropertyAsParameterInfo.cs (1)
25Debug.Assert(propertyInfo != null, "PropertyInfo must be provided.");
Microsoft.AspNetCore.Mvc.Core (9)
Filters\DefaultFilterProvider.cs (2)
68Debug.Assert(actualFilter != null, "actualFilter should not be null"); 69Debug.Assert(filterMetadata != null, "filterMetadata should not be null");
Infrastructure\ControllerActionInvoker.cs (1)
538Debug.Assert(actionParameters != null, "Expect arguments to be initialized.");
ModelBinding\Binders\ArrayModelBinder.cs (2)
94Debug.Assert(targetType == typeof(TElement[]), "GenericModelBinder only creates this binder for arrays."); 102Debug.Assert(targetType == typeof(TElement?[]), "GenericModelBinder only creates this binder for arrays.");
ModelBinding\Binders\CollectionModelBinder.cs (1)
472Debug.Assert(targetCollection != null, "This binder is instantiated only for ICollection<T> model types.");
ModelBinding\PlaceholderBinder.cs (1)
20Debug.Assert(Inner is not null, "Inner must be resolved before BindModelAsync can be called.");
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (2)
106Debug.Assert(_executor != null, "Sync execution is not supported."); 132Debug.Assert(_executorAsync != null, "Async execution is not supported.");
Microsoft.AspNetCore.Mvc.Localization (1)
ViewLocalizer.cs (1)
90Debug.Assert(!string.IsNullOrEmpty(path), "Couldn't determine a path for the view");
Microsoft.AspNetCore.Mvc.NewtonsoftJson (2)
BsonTempDataSerializer.cs (2)
182Debug.Assert(genericTypeArguments.Length == 1, "IList<T> has one generic argument"); 188Debug.Assert(
Microsoft.AspNetCore.Mvc.RazorPages (2)
Infrastructure\PageActionInvoker.cs (1)
267Debug.Assert(executor != null, "We should always find a executor for a handler");
Infrastructure\PageActionInvokerCache.cs (1)
47Debug.Assert(compiledPageActionDescriptor != null, "PageLoader didn't run!");
Microsoft.AspNetCore.Mvc.TagHelpers (1)
JavaScriptResources.cs (1)
39Debug.Assert(
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
Filters\SaveTempDataPropertyFilterBase.cs (1)
70Debug.Assert(Subject != null, "Subject must be set before this method is invoked.");
Microsoft.AspNetCore.OpenApi (5)
Extensions\ApiDescriptionExtensions.cs (1)
44Debug.Assert(apiDescription.RelativePath != null, "Relative path cannot be null.");
Services\OpenApiDocumentService.cs (1)
107Debug.Assert(descriptions.Key != null, "Relative path mapped to OpenApiPath key cannot be null.");
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (2)
106Debug.Assert(_executor != null, "Sync execution is not supported."); 132Debug.Assert(_executorAsync != null, "Async execution is not supported.");
src\Shared\PropertyAsParameterInfo.cs (1)
25Debug.Assert(propertyInfo != null, "PropertyInfo must be provided.");
Microsoft.AspNetCore.OutputCaching (1)
OutputCacheEntryFormatter.cs (1)
373Debug.Assert(reader.IsEOF, "should have read entire payload");
Microsoft.AspNetCore.ResponseCompression (1)
ResponseCompressionProvider.cs (1)
83Debug.Assert(false, "Duplicate check failed.");
Microsoft.AspNetCore.Rewrite (1)
ApacheModRewrite\ConditionEvaluator.cs (1)
52Debug.Assert(condResult != null, "ConditionEvaluator must be passed at least one condition to evaluate.");
Microsoft.AspNetCore.Routing (5)
Matching\ILEmitTrieFactory.cs (1)
524Debug.Assert(entries.Length == 1, "We should have a single entry");
Patterns\RoutePatternMatcher.cs (1)
434Debug.Assert(false, "indexOfLastSegementUsed should always be 0 from the check above");
RouteEndpointDataSource.cs (1)
213Debug.Assert(entry.InferMetadataFunc != null, "A func to infer metadata must be provided for route handlers.");
RouteOptions.cs (1)
34Debug.Assert(_endpointDataSources != null, "Endpoint data sources should have been set in DI.");
UriBuildingContext.cs (1)
137Debug.Assert(_lastValueOffset != -1, "Cannot invoke Remove more than once.");
Microsoft.AspNetCore.Server.HttpSys (26)
AsyncAcceptContext.cs (3)
138Debug.Assert(false, nameof(SetExpectCompletion)); // fail hard in debug 150Debug.Assert(false, nameof(CancelExpectCompletion)); // fail hard in debug 162Debug.Assert(false, nameof(ObserveCompletion)); // fail hard in debug
AuthenticationManager.cs (1)
87Debug.Assert(_urlGroup == null, "SetUrlGroupSecurity called more than once.");
HttpSysListener.cs (3)
262Debug.Assert(_serverSession != null, "ServerSessionHandle is null in CloseV2Config"); 263Debug.Assert(!_serverSession.Id.IsInvalid, "ServerSessionHandle is invalid in CloseV2Config"); 274Debug.Assert(_state != State.Stopped, "Listener has been stopped.");
MessagePump.cs (1)
104Debug.Assert(RequestContextFactory == null, "Start called twice!");
NativeInterop\SafeNativeOverlapped.cs (1)
36Debug.Assert(_boundHandle != null, "ReleaseHandle can't be called on SafeNativeOverlapped.Zero.");
NativeInterop\ServerSession.cs (1)
22Debug.Assert(serverSessionId != 0, "Invalid id returned by HttpCreateServerSession");
NativeInterop\UrlGroup.cs (3)
43Debug.Assert(urlGroupId != 0, "Invalid id returned by HttpCreateUrlGroup"); 89Debug.Assert(info != IntPtr.Zero, "SetUrlGroupProperty called with invalid pointer"); 193Debug.Assert(Id != 0, "HttpCloseUrlGroup called with invalid url group id");
RequestProcessing\Response.cs (2)
285Debug.Assert(!HasStarted, "HttpListenerResponse::SendHeaders()|SentHeaders is true."); 386Debug.Assert(!HasComputedHeaders, nameof(HasComputedHeaders) + " is true.");
RequestProcessing\ResponseBody.cs (3)
114Debug.Assert(!(endOfRequest && data.Count > 0), "Data is not supported at the end of the request."); 195Debug.Assert(!(addTrailers && chunked), "Trailers aren't currently supported for HTTP/1.1 chunking."); 272Debug.Assert(currentChunk == dataChunks.Length, "All chunks should be accounted for");
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (4)
119Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 128Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 177Debug.Assert(_nativeRequest != null, "RequestContextBase::ReleasePins()|ReleasePins() called twice."); 215Debug.Assert(_nativeRequest == null, "RequestContextBase::Dispose()|Dispose() called before ReleasePins().");
src\Shared\HttpSys\RequestProcessing\PathNormalizer.cs (2)
36Debug.Assert(ch1 == '/', "Path segment must always start with a '/'"); 155Debug.Assert(ch1 == '/', "Path segment must always start with a '/'");
src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (1)
22Debug.Assert(rawUrlBytes.Length != 0, "Length of the URL cannot be zero.");
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (7)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
223Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
Microsoft.AspNetCore.Server.IIS (21)
Core\HttpRequestStream.cs (2)
62Debug.Assert(_body != null, "Stream must be accepting reads."); 75Debug.Assert(_body != null, "Stream must be accepting reads.");
Core\IISHttpServer.cs (1)
164Debug.Assert(server._iisContextFactory != null, "StartAsync must be called first.");
Core\IISServerAuthenticationHandlerInternal.cs (4)
24Debug.Assert(_iisHttpContext != null, "Handler must be initialized."); 25Debug.Assert(Scheme != null, "Handler must be initialized."); 41Debug.Assert(_context != null, "Handler must be initialized."); 51Debug.Assert(_context != null, "Handler must be initialized.");
Core\IO\AsyncIOEngine.Flush.cs (1)
30Debug.Assert(_requestHandler != null, "Must initialize first.");
Core\IO\AsyncIOEngine.Read.cs (1)
34Debug.Assert(_requestHandler != null, "Must initialize first.");
Core\IO\AsyncIOOperation.cs (1)
13private static readonly Action<object?> CallbackCompleted = _ => { Debug.Assert(false, "Should not be invoked"); };
Core\IO\AsyncWriteOperationBase.cs (1)
26Debug.Assert(_requestHandler != null, "Must initialize first.");
Core\IO\WebSocketsAsyncIOEngine.Initialize.cs (1)
28Debug.Assert(_requestHandler != null, "Must initialize first.");
Core\IO\WebSocketsAsyncIOEngine.Read.cs (1)
42Debug.Assert(_requestHandler != null, "Must initialize first.");
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (4)
119Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 128Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 177Debug.Assert(_nativeRequest != null, "RequestContextBase::ReleasePins()|ReleasePins() called twice."); 215Debug.Assert(_nativeRequest == null, "RequestContextBase::Dispose()|Dispose() called before ReleasePins().");
src\Shared\HttpSys\RequestProcessing\PathNormalizer.cs (2)
36Debug.Assert(ch1 == '/', "Path segment must always start with a '/'"); 155Debug.Assert(ch1 == '/', "Path segment must always start with a '/'");
src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (1)
22Debug.Assert(rawUrlBytes.Length != 0, "Length of the URL cannot be zero.");
Microsoft.AspNetCore.Server.IISIntegration (3)
AuthenticationHandler.cs (3)
19Debug.Assert(_scheme != null, "Handler must be initialized."); 33Debug.Assert(_context != null, "Handler must be initialized."); 42Debug.Assert(_context != null, "Handler must be initialized.");
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Common\TestUriHelper.cs (1)
38Debug.Assert(scheme == "http", "Https not supported");
Microsoft.AspNetCore.Server.Kestrel.Core (69)
Internal\CertificatePathWatcher.cs (2)
113Debug.Assert(certificateConfig.IsFileCert, "AddWatch called on non-file cert"); 216Debug.Assert(certificateConfig.IsFileCert, "RemoveWatch called on non-file cert");
Internal\Http\Http1ChunkedEncodingMessageBody.cs (2)
90Debug.Assert(!RequestUpgrade, "Upgraded connections should never use this code path!"); 170Debug.Assert(_pumpTask != null, "OnReadStartedAsync must have been called.");
Internal\Http\Http1Connection.cs (7)
283Debug.Assert(target.Length != 0, "Request target must be non-zero length"); 317Debug.Assert(RawTarget != null, "RawTarget was not set"); 318Debug.Assert(((IHttpRequestFeature)this).Method != null, "Method was not set"); 319Debug.Assert(Path != null, "Path was not set"); 320Debug.Assert(QueryString != null, "QueryString was not set"); 321Debug.Assert(HttpVersion != null, "HttpVersion was not set"); 327Debug.Assert(target[0] == ByteForwardSlash, "Should only be called when path starts with /");
Internal\Http\HttpProtocol.cs (1)
1340Debug.Assert(!HasResponseStarted, $"{nameof(SetErrorResponseHeaders)} called after response had already started.");
Internal\Http\PathNormalizer.cs (2)
75Debug.Assert(ch1 == '/', "Path segment must always start with a '/'"); 192Debug.Assert(ch1 == '/', "Path segment must always start with a '/'");
Internal\Http2\FlowControl\FlowControl.cs (2)
12Debug.Assert(initialWindowSize <= Http2PeerSettings.MaxWindowSize, $"{nameof(initialWindowSize)} too large."); 23Debug.Assert(!IsAborted, $"({nameof(Advance)} called after abort.");
Internal\Http2\FlowControl\InputFlowControl.cs (2)
20Debug.Assert(initialWindowSize >= minWindowSizeIncrement, "minWindowSizeIncrement is greater than the window size."); 74Debug.Assert(false, $"{nameof(TryUpdateWindow)} attempted to grow window past max size.");
Internal\Http2\FlowControl\StreamInputFlowControl.cs (2)
39Debug.Assert(connectionSuccess, "Connection-level input flow control should never be aborted."); 88Debug.Assert(connectionSuccess, "Connection-level input flow control should never be aborted.");
Internal\Http2\Http2Connection.cs (4)
610Debug.Assert(buffer.Length >= ClientPreface.Length, "Not enough content to match preface."); 778Debug.Assert(TimeoutControl.TimerReason == TimeoutReason.KeepAlive, "Non keep-alive timeout set at start of stream."); 1113Debug.Assert(TimeoutControl.TimerReason == TimeoutReason.RequestHeaders, "Received continuation frame without request header timeout being set."); 1664Debug.Assert(staticTableIndex > 0, "Static table starts at 1.");
Internal\Http2\Http2FrameWriter.cs (1)
249Debug.Assert(flushHeaders, "The app completed successfully without flushing headers!");
Internal\Http3\Http3Connection.cs (1)
579Debug.Assert(persistentStateFeature != null, $"Required {nameof(IPersistentStateFeature)} not on stream context.");
Internal\Http3\Http3Stream.cs (1)
458Debug.Assert(staticTableIndex >= 0, "Static table starts at 0.");
Internal\HttpConnection.cs (6)
94Debug.Assert(connectionHeartbeatFeature != null, nameof(IConnectionHeartbeatFeature) + " is missing!"); 95Debug.Assert(connectionLifetimeNotificationFeature != null, nameof(IConnectionLifetimeNotificationFeature) + " is missing!"); 140Debug.Assert(previousState != ProtocolSelectionState.Initializing, "The state should never be initializing"); 159Debug.Assert(previousState != ProtocolSelectionState.Initializing, "The state should never be initializing"); 179Debug.Assert(previousState != ProtocolSelectionState.Initializing, "The state should never be initializing"); 279Debug.Assert(false, "Invalid TimeoutReason");
Internal\Infrastructure\HttpUtilities.cs (4)
55Debug.Assert(str.Length == 8, "String must be exactly 8 (ASCII) characters long."); 67Debug.Assert(str.Length == 4, "String must be exactly 4 (ASCII) characters long."); 79Debug.Assert(bytes.Length == 8, "Mask must be exactly 8 bytes long."); 314Debug.Assert(char.IsAscii(c), "Must already be validated");
Internal\Infrastructure\PipeWriterHelpers\ConcurrentPipeWriter.cs (1)
62Debug.Assert(_currentFlushTcs == null, "There should not be a pending flush.");
Internal\Infrastructure\ResourceCounter.cs (1)
64Debug.Assert(_count >= 0, "Resource count is negative. More resources were released than were locked.");
Internal\Infrastructure\TimeoutControl.cs (3)
170Debug.Assert(_timeoutTimestamp == long.MaxValue, "Concurrent timeouts are not supported."); 206Debug.Assert(_concurrentIncompleteRequestBodies == 0 || minRate == _minReadRate, "Multiple simultaneous read data rates are not supported."); 261Debug.Assert(count >= 0, "BytesRead count must not be negative.");
Internal\KestrelServerImpl.cs (1)
341Debug.Assert(Options.ConfigurationLoader != null, "Rebind can only happen when there is a ConfigurationLoader.");
Internal\SniOptionsSelector.cs (1)
154Debug.Assert(_fallbackServerCertificateSelector != null,
Internal\ThrowHelper.cs (1)
24Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
KestrelConfigurationLoader.cs (4)
50Debug.Assert(reloadOnChange || (certificatePathWatcher is null), "If reloadOnChange is false, then certificatePathWatcher should be null"); 267Debug.Assert(!!_loaded || _reloadToken is null, "Shouldn't have a reload token before first load"); 268Debug.Assert(!!ReloadOnChange || _reloadToken is null, "Shouldn't have a reload token unless reload-on-change is set"); 374Debug.Assert(o.EndpointConfig?.Certificate?.FileHasChanged != true, "Preserving an endpoint with file changes");
KestrelServerOptions.cs (2)
295Debug.Assert(ApplicationServices.GetRequiredService<IHttpsConfigurationService>().IsInitialized, "HTTPS configuration should have been enabled"); 394Debug.Assert(status.FailureMessage != null, "Status with a failure result must have a message.");
Middleware\HttpsConnectionMiddleware.cs (3)
250Debug.Assert(!certificate.HasPrivateKey, "This should only be called with certificates that don't have a private key"); 315Debug.Assert(_options != null, "Middleware must be created with options."); 411Debug.Assert(_options != null, "Middleware must be created with options.");
src\Shared\Hpack\DynamicHPackEncoder.cs (4)
71Debug.Assert(!_pendingTableSizeUpdate, "Dynamic table size update should be encoded before headers."); 153Debug.Assert(headerSize <= _maxHeaderTableSize, "Header is bigger than dynamic table size."); 212Debug.Assert(headerSize <= _maxHeaderTableSize, "Header is bigger than dynamic table size."); 213Debug.Assert(headerSize <= _maxHeaderTableSize - _headerTableSize, "Not enough room in dynamic table.");
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\runtime\Http3\Frames\Http3Frame.cs (1)
43Debug.Assert(VariableLengthIntegerHelper.GetByteCount((long)frameType) == 1, $"{nameof(TryWriteFrameEnvelope)} assumes {nameof(frameType)} will fit within a single byte varint.");
src\Shared\runtime\Http3\Helpers\VariableLengthIntegerHelper.cs (1)
73Debug.Assert(value >= 0 && value <= EightByteLimit, "Serialized values are within [0, 2^62).");
src\Shared\runtime\Http3\QPack\QPackDecoder.cs (2)
428Debug.Assert(_state == State.CompressedHeaders, "Should be ready to parse a new header."); 646Debug.Assert(_stringOctets != null, "String buffer should have a value.");
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
223Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (2)
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
src\Shared\test\Shared.Tests\runtime\Http2\DynamicTableTest.cs (1)
149Debug.Assert((insertSize % 64) == 0, $"{nameof(insertSize)} must be a multiple of 64 ({nameof(HeaderField)}.{nameof(HeaderField.RfcOverhead)} * 2)");
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (1)
122Debug.Assert(streamId == 0 || streamId == -1, "StreamId sent that was non-zero, which isn't handled by tests");
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (4)
Internal\NamedPipeConnectionListener.cs (2)
63Debug.Assert(!stream.IsConnected, "Stream should have been successfully disconnected to reach this point."); 71Debug.Assert(_completeListeningTask == null, "Already started");
Internal\NamedPipeTransportFactory.cs (1)
28Debug.Assert(OperatingSystem.IsWindows(), "Named pipes transport requires a Windows operating system.");
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (2)
Internal\QuicConnectionContext.cs (1)
178Debug.Assert(cancellationToken.IsCancellationRequested, "Error requires cancellation is requested.");
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (2)
SocketConnectionListener.cs (1)
65Debug.Assert(_listenSocket != null, "Bind must be called first.");
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
Microsoft.AspNetCore.Shared.Tests (26)
runtime\Http2\DynamicTableTest.cs (1)
149Debug.Assert((insertSize % 64) == 0, $"{nameof(insertSize)} must be a multiple of 64 ({nameof(HeaderField)}.{nameof(HeaderField.RfcOverhead)} * 2)");
src\Shared\Hpack\DynamicHPackEncoder.cs (4)
71Debug.Assert(!_pendingTableSizeUpdate, "Dynamic table size update should be encoded before headers."); 153Debug.Assert(headerSize <= _maxHeaderTableSize, "Header is bigger than dynamic table size."); 212Debug.Assert(headerSize <= _maxHeaderTableSize, "Header is bigger than dynamic table size."); 213Debug.Assert(headerSize <= _maxHeaderTableSize - _headerTableSize, "Not enough room in dynamic table.");
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (4)
119Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 128Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 177Debug.Assert(_nativeRequest != null, "RequestContextBase::ReleasePins()|ReleasePins() called twice."); 215Debug.Assert(_nativeRequest == null, "RequestContextBase::Dispose()|Dispose() called before ReleasePins().");
src\Shared\HttpSys\RequestProcessing\PathNormalizer.cs (2)
36Debug.Assert(ch1 == '/', "Path segment must always start with a '/'"); 155Debug.Assert(ch1 == '/', "Path segment must always start with a '/'");
src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (1)
22Debug.Assert(rawUrlBytes.Length != 0, "Length of the URL cannot be zero.");
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (2)
106Debug.Assert(_executor != null, "Sync execution is not supported."); 132Debug.Assert(_executorAsync != null, "Async execution is not supported.");
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\runtime\Http3\Frames\Http3Frame.cs (1)
43Debug.Assert(VariableLengthIntegerHelper.GetByteCount((long)frameType) == 1, $"{nameof(TryWriteFrameEnvelope)} assumes {nameof(frameType)} will fit within a single byte varint.");
src\Shared\runtime\Http3\Helpers\VariableLengthIntegerHelper.cs (1)
73Debug.Assert(value >= 0 && value <= EightByteLimit, "Serialized values are within [0, 2^62).");
src\Shared\runtime\Http3\QPack\QPackDecoder.cs (2)
428Debug.Assert(_state == State.CompressedHeaders, "Should be ready to parse a new header."); 646Debug.Assert(_stringOctets != null, "String buffer should have a value.");
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
223Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
src\Shared\WebEncoders\WebEncoders.cs (1)
111Debug.Assert(arraySizeRequired % 4 == 0, "Invariant: Array length must be a multiple of 4.");
Microsoft.AspNetCore.SignalR.Common.Tests (2)
Internal\Protocol\MessagePackHubProtocolTestBase.cs (2)
465Debug.Assert(size < 16, "Test code doesn't support array sizes greater than 15"); 472Debug.Assert(size < 16, "Test code doesn't support string sizes greater than 15");
Microsoft.AspNetCore.SignalR.Core (4)
Internal\DefaultHubActivator.cs (2)
23Debug.Assert(!_created.HasValue, "hub activators must not be reused."); 40Debug.Assert(_created.HasValue, "hubs must be released with the hub activator they were created");
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (2)
106Debug.Assert(_executor != null, "Sync execution is not supported."); 132Debug.Assert(_executorAsync != null, "Async execution is not supported.");
Microsoft.AspNetCore.WebSockets (1)
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (1)
290Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.AspNetCore.WebUtilities (3)
MultipartReaderStream.cs (2)
227Debug.Assert(stream.FinalBoundaryFound || remainder.IsEmpty, "Un-expected data found on the boundary line: " + remainder.ToString()); 313Debug.Assert(stream.FinalBoundaryFound || string.Equals(string.Empty, remainder, StringComparison.Ordinal), "Un-expected data found on the boundary line: " + remainder);
src\Shared\WebEncoders\WebEncoders.cs (1)
111Debug.Assert(arraySizeRequired % 4 == 0, "Invariant: Array length must be a multiple of 4.");
Microsoft.Build (28)
BackEnd\BuildManager\BuildManager.cs (1)
1035Debug.Assert(allMismatchedProjectStartedEventsDueToLoggerErrors, "There was a mismatched project started event not caused by an exception result");
BackEnd\Client\MSBuildClient.cs (1)
517Debug.Assert(KnownTelemetry.PartialBuildTelemetry == null || KnownTelemetry.PartialBuildTelemetry.StartAt.HasValue, "BuildTelemetry.StartAt was not initialized!");
Collections\RetrievableEntryHashSet\HashHelpers.cs (1)
61Debug.Assert(min >= 0, "min less than zero; handle overflow checking before calling HashHelpers");
Collections\RetrievableEntryHashSet\HashSet.cs (6)
266Debug.Assert(_buckets != null, "m_buckets was null but m_lastIndex > 0"); 706Debug.Assert(_count >= 0, "m_count is negative"); 717Debug.Assert(_buckets != null, "m_buckets was null but m_count > 0"); 743Debug.Assert(newSlots.Length <= _slots.Length, "capacity increased after TrimExcess"); 763Debug.Assert(_buckets == null, "Initialize was called but m_buckets was non-null"); 779Debug.Assert(_buckets != null, "IncreaseCapacity called on a set with no elements");
Construction\ProjectElementContainer.cs (1)
444Debug.Assert(child.ExpressedAsAttribute, nameof(SetElementAsAttributeValue) + " method requires that " +
Definition\ProjectCollection.cs (1)
1723Debug.Assert(!_locker.IsWriteLockHeld, "We should never raise events while holding a private lock.");
Evaluation\Conditionals\Scanner.cs (1)
84Debug.Assert(false, "What code path did not set an appropriate error resource? Expression: " + _expression);
Evaluation\LazyItemEvaluator.cs (1)
207Debug.Assert(_applyCalls == cacheCount, "Apply should only be called once per globsToIgnore. Otherwise caching is not working");
Evaluation\Profiler\ProfilerResultPrettyPrinter.cs (1)
70Debug.Assert(totalTime != null, "There should be at least one evaluation pass result");
FileMatcher.cs (2)
862Debug.Assert(FileUtilities.PathsEqual(searchToExclude.BaseDirectory, recursionState.BaseDirectory), "Expected exclude search base directory to match include search base directory"); 2522Debug.Assert(excludeState.SearchData.RegexFileMatch != null || excludeState.SearchData.DirectoryPattern != null,
InterningBinaryReader.cs (1)
173Debug.Assert(false, e.ToString());
Logging\BaseConsoleLogger.cs (2)
1210Debug.Assert(shared != null, "This is not supposed to be used in multiple threads or multiple time. One method is expected to return it before next acquire. Most probably it was not returned."); 1266Debug.Assert(previous == null, "This is not supposed to be used in multiple threads or multiple time. One method is expected to return it before next acquire. Most probably it was double returned.");
Logging\InProcessConsoleConfiguration.cs (1)
39Debug.Assert(false, $"MSBuild client warning: problem during enabling support for VT100: {ex}.");
Logging\LogFormatter.cs (1)
39Debug.Assert(timeStamp != DateTime.MinValue, "Timestamp missing");
Logging\ProfilerLogger.cs (3)
105Debug.Assert(_aggregatedLocations == null, 141Debug.Assert(result, 254Debug.Assert(pair.Key.ParentId.HasValue,
TaskEngineAssemblyResolver.cs (2)
54Debug.Assert(_eventHandler == null, "The TaskEngineAssemblyResolver.InstallHandler method should only be called once!"); 84Debug.Assert(false, "There is no handler to remove.");
TaskLoggingHelper.cs (2)
274Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?"); 469Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?");
Microsoft.Build.Conversion.Core (7)
AdditionalOptionsParser.cs (7)
339Debug.Assert(false, "Cannot parse boolean switch: " + compSwitch); 354Debug.Assert(false, "Cannot parse string switch: " + compSwitch); 359Debug.Assert( 375Debug.Assert(false, "Cannot parse multistring switch: " + compSwitch); 380Debug.Assert(false, "Unknown switch value type"); 426Debug.Assert(compSwitchInfo.SwitchValue != null, "Expected non null value for multistring switch"); 437Debug.Assert(false, "Unknown switch value type");
Microsoft.Build.Engine (13)
Conditionals\Scanner.cs (1)
101Debug.Assert(false, "What code path did not set an appropriate error resource? Expression: " + expression);
Engine\Engine.cs (2)
1486Debug.Assert(this.projectsLoadedByHost.Count == 0, "Shouldn't the host have unloaded the projects already?"); 2762Debug.Assert(!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("_NTROOT")),
Engine\TargetDependencyAnalyzer.cs (1)
221Debug.Assert(GetItemSpecsFromItemVectors(itemVectorsInTargetInputs).Count > 0, "The target must have inputs.");
Engine\TaskEngineAssemblyResolver.cs (2)
52Debug.Assert(eventHandler == null, "The TaskEngineAssemblyResolver.InstallHandler method should only be called once!"); 71Debug.Assert(false, "There is no handler to remove.");
LocalProvider\SharedMemory.cs (2)
464Debug.Assert(type == SharedMemoryType.WriteOnly, "Should only be calling Write from a writeonly shared memory object"); 609Debug.Assert(objectToWrite != null, "Expect to get a non-null object from the queue");
Logging\ParallelLogger\ParallelConsoleLogger.cs (1)
1557Debug.Assert(startedEvent != null, "Cannot have finished counter without started counter. ");
Logging\SerialConsoleLogger.cs (1)
787Debug.Assert(false, errorMessage);
Shared\AssemblyNameExtension.cs (1)
285Debug.Assert(result == baselineResult, "Optimized version of CompareBaseNameTo didn't return the same result as the baseline.");
Shared\FileMatcher.cs (1)
578Debug.Assert((filespec == null) || (regexFileMatch == null),
Shared\FileUtilities.cs (1)
356Debug.Assert(FileUtilitiesRegex.UNCPattern.IsMatch(modifiedItemSpec),
Microsoft.Build.Framework (20)
ArraySortHelper.cs (3)
63Debug.Assert(comparer != null, "Check the arguments in the caller!"); 82Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 338Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
BuildException\BuildExceptionBase.cs (1)
112Debug.Assert((exception.Data?.Count ?? 0) == 0,
ChangeWaves.cs (1)
175Debug.Assert(_runningTests || AllWaves.Contains(wave), $"Change wave version {wave} is invalid");
HashHelpers.cs (1)
89Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
ReuseableStringBuilder.cs (1)
326Debug.Assert(returningBuilder.Capacity > returning._borrowedWithCapacity, "Capacity can only increase");
SegmentedArray.cs (1)
483Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
SegmentedArrayHelper.cs (1)
120Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
SegmentedDictionary`2.cs (10)
236Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 237Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 337Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 482Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 618Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 650Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 687Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 709Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 759Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 783Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
StringBuilderCache.cs (1)
92Debug.Assert(StringBuilderCache.t_cachedInstance == null, "Unexpected replacing of other StringBuilder.");
Microsoft.Build.Tasks.Core (39)
AssemblyDependency\CandidateAssemblyFilesResolver.cs (1)
88Debug.Assert(considered.Reason != NoMatchReason.Unknown, "Expected a no match reason here.");
AssemblyDependency\Reference.cs (4)
210Debug.Assert(dependee.FullPath.Length > 0, "Cannot add dependee that doesn't have a full name. This should have already been resolved."); 424Debug.Assert(filenameExtension[0] == '.', "Expected extension to start with '.'"); 445Debug.Assert(!Path.IsPathRooted(filename), "Satellite path should be relative to the current reference."); 457Debug.Assert(!Path.IsPathRooted(filename), "Serialization assembly path should be relative to the current reference.");
AssemblyDependency\ResolveAssemblyReference.cs (6)
1669Debug.Assert(false, "Should have handled this case."); 1714Debug.Assert(false, "Unexpected exception type."); 1852Debug.Assert(false, "Should have handled this case."); 1970Debug.Assert(false, "Should have handled this case."); 2009Debug.Assert(!reference.IsPrimary, "A primary reference should never lose a conflict because of version. This is an insoluble conflict instead."); 2040Debug.Assert(false, "Should have handled this case.");
AssignCulture.cs (1)
191Debug.Assert(false, "Unexpected exception in AssignCulture.Execute. " +
BootstrapperUtil\BootstrapperBuilder.cs (10)
801Debug.Assert(filePath != null, "null filePath?"); 802Debug.Assert(schemaPath != null, "null schemaPath?"); 803Debug.Assert(schemaNamespace != null, "null schemaNamespace?"); 848Debug.Assert(_document != null, "our document should have been created by now!"); 867Debug.Assert(xmlDocument.DocumentElement != null && 944Debug.Assert(langDoc != null, "we couldn't load package.xml in '" + strLangManifestFilename + "'...?"); 951Debug.Assert(langNode != null, string.Format(CultureInfo.CurrentCulture, "Unable to find a package node in {0}", strLangManifestFilename)); 1258Debug.Assert(false, "Specified key does not exist for node " + nextNode.InnerXml); 1564Debug.Assert(sourceAttribute != null, "we should not be here if there is no ProductCode attribute"); 1986Debug.Assert(s != null, String.Format(CultureInfo.CurrentCulture, "EmbeddedResource '{0}' not found", name));
CSharptokenEnumerator.cs (2)
96Debug.Assert(false, "Code defect in tokenizer: Should have yielded a closing tick."); 160Debug.Assert(false, "Defect in tokenizer: Should have yielded a terminating quote.");
FileMatcher.cs (2)
862Debug.Assert(FileUtilities.PathsEqual(searchToExclude.BaseDirectory, recursionState.BaseDirectory), "Expected exclude search base directory to match include search base directory"); 2522Debug.Assert(excludeState.SearchData.RegexFileMatch != null || excludeState.SearchData.DirectoryPattern != null,
InterningBinaryReader.cs (1)
173Debug.Assert(false, e.ToString());
ManifestUtil\Manifest.cs (1)
528Debug.Assert(false, "AssemblyName cannot be empty");
ManifestUtil\TrustInfo.cs (1)
318Debug.Assert(document != null, "GetPermissionSetElement was passed a null document");
ManifestUtil\Util.cs (1)
220Debug.Assert(s != null, String.Format(CultureInfo.CurrentCulture, "EmbeddedResource '{0}' not found", name));
RedistList.cs (1)
862Debug.Assert(isValidEntry, string.Format(CultureInfo.InvariantCulture, "Missing attribute in redist file: {0}, line #{1}", path,
ResGenDependencies.cs (3)
370Debug.Assert(outputFiles != null, "OutputFiles hasn't been set"); 395Debug.Assert(OutputFiles != null, "This has not been initialized"); 396Debug.Assert(otherLibrary.OutputFiles != null, "The other library has not been initialized");
ResolveManifestFiles.cs (4)
349Debug.Assert(!String.IsNullOrEmpty(itemCulture), String.Format(CultureInfo.CurrentCulture, "Satellite item '{0}' is missing expected attribute '{1}'", item.ItemSpec, "Culture")); 865Debug.Assert(!_dictionary.ContainsKey(key), String.Format(CultureInfo.CurrentCulture, "Two or more items with same key '{0}' detected", key)); 924Debug.Assert(!_dictionary.ContainsKey(key), String.Format(CultureInfo.CurrentCulture, "Two or more items with same key '{0}' detected", key)); 965Debug.Assert(!_dictionary.ContainsKey(key), String.Format(CultureInfo.CurrentCulture, "Two or more items with same '{0}' attribute detected", ItemMetadataNames.targetPath));
SystemState.cs (1)
654Debug.Assert(false, "Using slow-path in SystemState.GetDirectories, was this intentional?");
Microsoft.Build.Tasks.UnitTests (1)
QuotingUtilities.cs (1)
91Debug.Assert(false, "Null character in parameter");
Microsoft.Build.Utilities.Core (6)
CommandLineBuilder.cs (1)
201Debug.Assert(!hasAllUnquotedCharacters || !hasSomeQuotedCharacters,
FileMatcher.cs (2)
862Debug.Assert(FileUtilities.PathsEqual(searchToExclude.BaseDirectory, recursionState.BaseDirectory), "Expected exclude search base directory to match include search base directory"); 2522Debug.Assert(excludeState.SearchData.RegexFileMatch != null || excludeState.SearchData.DirectoryPattern != null,
TaskLoggingHelper.cs (2)
274Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?"); 469Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?");
ToolTask.cs (1)
436Debug.Assert(ExitCode != 0, "HandleTaskExecutionErrors should only be called if there were problems executing the task");
Microsoft.CSharp (7)
Microsoft\CSharp\RuntimeBinder\DynamicDebuggerProxy.cs (1)
175Debug.Assert((numberOfArguments == argTypes.Length) && (numberOfArguments == argFlags.Length), "Argument arrays size mismatch.");
Microsoft\CSharp\RuntimeBinder\Errors\UserStringBuilder.cs (1)
469Debug.Assert(elementType != null, "No element type");
Microsoft\CSharp\RuntimeBinder\Semantics\Conversion.cs (1)
497Debug.Assert(exprType <= FUNDTYPE.FT_LASTNUMERIC, "Error in constant conversion logic!");
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\MethodOrPropertySymbol.cs (1)
61Debug.Assert(_Params == null, "Should only be set once");
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Constant.cs (1)
40Debug.Assert(
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeManager.cs (2)
91Debug.Assert(atsOuter == null || atsOuter.OwningAggregate == agg.Parent, ""); 152Debug.Assert(!(pUnderlyingType is NullableType), "Attempt to make nullable of nullable");
Microsoft.DotNet.ApiCompat (5)
NamespaceRemappingComparer.cs (5)
19Debug.Assert(_mappings.Count > 0, "NamespaceRemappingComparers has no namespace remappings."); 41Debug.Assert(_mappings.Count > 0, "NamespaceRemappingComparers has no namespace remappings."); 91Debug.Assert(name.IndexOf('+') < 0, "Encountered a nested type. Not sure whether to treat that as two types or one, or to only remap the outer type."); 104Debug.Assert(File.Exists(mappingFile), String.Format("Excepting namespace mapping file \"{0}\" to exist.", mappingFile)); 123Debug.Assert(_mappings.Count > 0, "Expected to find namespace mappings in our namespace mapping text file. Is this intentional?");
Microsoft.Extensions.Caching.Hybrid (12)
Internal\BufferChunk.cs (10)
40Debug.Assert(array is not null, "expected valid array input"); 48Debug.Assert(!ReturnToPool, "do not return right-sized arrays"); 49Debug.Assert(Length == array.Length, "array length not respected"); 54Debug.Assert(array is not null, "expected valid array input"); 55Debug.Assert(length >= 0, "expected valid length"); 58Debug.Assert(ReturnToPool == returnToPool, "return-to-pool not respected"); 59Debug.Assert(Length == length, "length not respected"); 69Debug.Assert(Array is null && !ReturnToPool, "expected clean slate after recycle"); 78Debug.Assert(copy.Length == Length, "same length expected"); 79Debug.Assert(!copy.ReturnToPool, "do not return to pool");
Internal\DefaultHybridCache.CacheItem.cs (1)
45Debug.Assert(newCount >= 0, "over-release detected");
Internal\DefaultHybridCache.StampedeStateT.cs (1)
173Debug.Assert(value.Array is not null, "expected buffer");
Microsoft.Extensions.Caching.Memory (1)
CacheEntry.cs (1)
204Debug.Assert(_current.Value == this, "Entries disposed in invalid order");
Microsoft.Extensions.DependencyInjection (6)
DependencyInjectionEventSource.cs (1)
265Debug.Assert(instance != null, "descriptor.ImplementationInstance != null");
ServiceLookup\CallSiteFactory.cs (1)
429Debug.Assert(implementationType != null, "descriptor.ImplementationType != null");
ServiceLookup\CallSiteRuntimeResolver.cs (1)
180Debug.Assert(!ServiceProvider.VerifyAotCompatibility || !elementType.IsValueType, "VerifyAotCompatibility=true will throw during building the IEnumerableCallSite if elementType is a ValueType.");
ServiceLookup\Expressions\ExpressionResolverBuilder.cs (2)
121Debug.Assert(!ServiceProvider.VerifyAotCompatibility || !elementType.IsValueType, "VerifyAotCompatibility=true will throw during building the IEnumerableCallSite if elementType is a ValueType."); 130Debug.Assert(!ServiceProvider.VerifyAotCompatibility || !elementType.IsValueType, "VerifyAotCompatibility=true will throw during building the IEnumerableCallSite if elementType is a ValueType.");
ServiceLookup\IEnumerableCallSite.cs (1)
18Debug.Assert(!ServiceProvider.VerifyAotCompatibility || !itemType.IsValueType, "If VerifyAotCompatibility=true, an IEnumerableCallSite should not be created with a ValueType.");
Microsoft.Extensions.DependencyInjection.Abstractions (1)
ServiceDescriptor.cs (1)
333Debug.Assert(false, "ImplementationType, ImplementationInstance, ImplementationFactory or KeyedImplementationFactory must be non null");
Microsoft.Extensions.Diagnostics (1)
Metrics\ListenerSubscription.cs (1)
55Debug.Assert(false, "InstrumentPublished called for an instrument we're already listening to.");
Microsoft.Extensions.FileProviders.Physical (2)
PollingFileChangeToken.cs (1)
72Debug.Assert(_tokenSource == null, "We expect CancellationTokenSource to be initialized exactly once.");
PollingWildCardChangeToken.cs (1)
75Debug.Assert(_tokenSource == null, "We expect CancellationTokenSource to be initialized exactly once.");
Microsoft.Extensions.Hosting (2)
HostApplicationBuilder.cs (1)
120Debug.Assert(empty, "should only be called with empty: true");
Internal\Host.cs (1)
241Debug.Assert(_hostedServices != null, "Hosted services are resolved when host is started.");
Microsoft.Extensions.Http (3)
DefaultHttpClientFactory.cs (3)
200Debug.Assert(removed, "Entry not found. We should always be able to remove the entry"); 201Debug.Assert(object.ReferenceEquals(active, found!.Value), "Different entry found. The entry should not have been replaced"); 279Debug.Assert(entry != null, "Entry was null, we should always get an entry back from TryDequeue");
Microsoft.Extensions.Logging (1)
LoggerInformation.cs (1)
50Debug.Assert(logger != null || externalScopeProvider != null, "Logger can't be null when there isn't an ExternalScopeProvider");
Microsoft.Extensions.Logging.Abstractions (1)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.Extensions.Logging.Generators (3)
LoggerMessageGenerator.Parser.cs (2)
104Debug.Assert(logMethodSymbol != null, "log method is present."); 184Debug.Assert(false, "Unexpected number of arguments in attribute constructor.");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (1)
91Debug.Assert(index == 0, "Implementation currently only supports index == 0");
Microsoft.Extensions.Primitives (2)
ThrowHelper.cs (2)
61Debug.Assert(Enum.IsDefined(typeof(ExceptionResource), resource), 79Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument),
Microsoft.Interop.LibraryImportGenerator (1)
LibraryImportGenerator.cs (1)
439Debug.Assert(!options.GenerateForwarders, "GenerateForwarders should have already been handled to use a forwarder stub");
Microsoft.JSInterop (1)
DotNetObjectReferenceOfT.cs (1)
51Debug.Assert(_objectId != 0, "Accessing ObjectId without tracking is always incorrect.");
Microsoft.Net.Http.Headers (2)
HeaderUtilities.cs (2)
266Debug.Assert(false, $"Index '{nameof(current)}' not advanced, this is a bug."); 320Debug.Assert(false, $"Index '{nameof(current)}' not advanced, this is a bug.");
Microsoft.VisualBasic.Core (223)
Microsoft\VisualBasic\Collection.vb (11)
58Debug.Assert(m_KeyedNodesHash.ContainsKey(Key), "We got an argumentexception from a hashtable add, but it wasn't a duplicate key.") 162Debug.Assert(node.m_Key IsNot Nothing, "How can that be? We just found it by its key.") 178Debug.Assert(node IsNot Nothing, "Should have thrown exception rather than return Nothing") 197Debug.Assert(node IsNot Nothing, "Should have thrown rather than returning Nothing") 385Debug.Assert(NodeToBeDeleted IsNot Nothing, "How can we remove a non-existent node ?") 448Debug.Assert(NodeToInsertBefore IsNot Nothing, "FastList.InsertBefore: NodeToInsertBefore may not be nothing") 456Debug.Assert(NodeToInsertAfter IsNot Nothing, "FastList.InsertAfter: NodeToInsertAfter may not be nothing") 514Debug.Assert(NodeToBeDeleted IsNot Nothing, "How can we delete a non-existent node ?") 518Debug.Assert(NodeToBeDeleted Is m_StartOfList, "How can any node besides the first node not have a previous node ?") 571Debug.Assert(NewOrRemovedNode IsNot Nothing, "AdjustIndexes: Node shouldn't be Nothing") 681Debug.Assert(node IsNot Nothing, "Should have thrown exception rather than return Nothing")
Microsoft\VisualBasic\CompilerServices\ConversionResolution.vb (23)
160Debug.Assert(TypeCode.Empty = 0, "wrong value!") 161Debug.Assert(TypeCode.Object = 1, "wrong value!") 162Debug.Assert(TypeCode.Boolean = 3, "yte is wrong value!") 163Debug.Assert(TypeCode.Char = 4, "wrong value!") 164Debug.Assert(TypeCode.SByte = 5, "wrong value!") 165Debug.Assert(TypeCode.Byte = 6, "wrong value!") 166Debug.Assert(TypeCode.Int16 = 7, "wrong value!") 167Debug.Assert(TypeCode.UInt16 = 8, "wrong value!") 168Debug.Assert(TypeCode.Int32 = 9, "wrong value!") 169Debug.Assert(TypeCode.UInt32 = 10, "wrong value!") 170Debug.Assert(TypeCode.Int64 = 11, "wrong value!") 171Debug.Assert(TypeCode.UInt64 = 12, "wrong value!") 172Debug.Assert(TypeCode.Single = 13, "wrong value!") 173Debug.Assert(TypeCode.Double = 14, "wrong value!") 174Debug.Assert(TypeCode.Decimal = 15, "wrong value!") 175Debug.Assert(TypeCode.DateTime = 16, "wrong value!") 176Debug.Assert(TypeCode.String = 18, "wrong value!") 250Debug.Assert(False, "all conversions from interface should have been handled by now") 590Debug.Assert(types.Count > 0, "unexpected empty set") 616Debug.Assert(types.Count > 0, "unexpected empty set") 839Debug.Assert(Not wideningOnly AndAlso sourceDeriveds.Count > 0, "unexpected state") 848Debug.Assert(Not wideningOnly AndAlso targetBases.Count > 0, "unexpected state") 979Debug.Assert(operatorSet.Count > 0, "expected operators")
Microsoft\VisualBasic\CompilerServices\Conversions.vb (1)
2517Debug.Assert(Not SourceType.IsByRef, "never expected to see byref source type")
Microsoft\VisualBasic\CompilerServices\LateBinding.vb (4)
599Debug.Assert(False, ex.Message) 1212Debug.Assert(Not Member Is Nothing, "How can this be Nothing ?") 1229Debug.Assert(False, "How can a property get here ?") 1234Debug.Assert(False, "How did we get here ?")
Microsoft\VisualBasic\CompilerServices\LikeOperator.vb (29)
78Debug.Assert(Options <> CompareOptions.Ordinal, "Char expansion check unexpected during binary compare") 455Debug.Assert(Comparer IsNot Nothing, "Like Operator - Comparer expected for option compare text") 456Debug.Assert(Not MatchBothCharsOfExpandedCharInRight OrElse Not UseUnexpandedCharForRight, "Conflicting compare options") 493Debug.Assert(LeftEnd < LeftLength AndAlso RightEnd < RightLength, "Comparing chars beyond end of string") 517Debug.Assert(Comparer IsNot Nothing, "Like Operator - Comparer expected for option compare text") 537Debug.Assert(Comparer IsNot Nothing, "Like Operator - Comparer expected for option compare text") 567Debug.Assert(RangeList Is Nothing OrElse ValidatePatternWithoutMatching, "Unexpected options to MatchRange") 784Debug.Assert(Not ValidatePatternWithoutMatching, "Unexpected string matching when validating pattern string") 912Debug.Assert(PatType = PatternType.STRING, "Unexpected pattern group type") 916Debug.Assert(PatType = PatternType.STRING, "Unexpected pattern group type") 924Debug.Assert(PatType = PatternType.STRING, "Unexpected pattern group type") 928Debug.Assert(PatType = PatternType.STRING, "Unexpected pattern group type") 942Debug.Assert(PatType = PatternType.STAR OrElse PatType = PatternType.NONE, "Unexpected pattern group type") 946Debug.Assert(PatType = PatternType.STAR OrElse PatType = PatternType.NONE, "Unexpected pattern group type") 958Debug.Assert(PatType = PatternType.EXCLIST OrElse PatType = PatternType.INCLIST, "Unexpected pattern group type") 962Debug.Assert(PatType = PatternType.EXCLIST OrElse PatType = PatternType.INCLIST, "Unexpected pattern group type") 971Debug.Assert(PatType = PatternType.EXCLIST OrElse PatType = PatternType.INCLIST, "Unexpected pattern group type") 975Debug.Assert(PatType = PatternType.EXCLIST OrElse PatType = PatternType.INCLIST, "Unexpected pattern group type") 1165Debug.Assert(False, "Unexpected pattern kind") 1229Debug.Assert(PatternGroups IsNot Nothing AndAlso 1281Debug.Assert(PatternGroups(PGIndex).PatType = PatternType.NONE, "Unexpected pattern end") 1310Debug.Assert(False, "Unexpected pattern kind") 1356Debug.Assert(PatternGroups(PGIndex).PatType = PatternType.STAR, "Unexpected start of pattern groups list") 1498Debug.Assert(SourceIndex <= PGCurrent.MaxSourceIndex, "Pattern matching lost") 1524Debug.Assert(PatternGroups(PGPrevMismatchIndex).PatType <> PatternType.NONE, "Bad previous mismatch index") 1605Debug.Assert(PG.PatType = PatternType.EXCLIST OrElse PG.PatType = PatternType.INCLIST, "Unexpected pattern group") 1611Debug.Assert(RangeList IsNot Nothing AndAlso RangeList.Count > 0, "Empty RangeList unexpected") 1617Debug.Assert(Range.Start >= 0, "NULL Range start unexpected") 1729Debug.Assert(Options <> CompareOptions.Ordinal, "This method should not be invoked in Option compare binary mode")
Microsoft\VisualBasic\CompilerServices\NewLateBinding.vb (22)
522Debug.Assert(False, "the resolution should have thrown an exception") 720Debug.Assert(False, "the resolution should have thrown an exception - should never reach here") 1096Debug.Assert(False, "the resolution should have thrown an exception") 1182Debug.Assert(baseReference IsNot Nothing, "Nothing unexpected") 1183Debug.Assert(arguments IsNot Nothing, "Nothing unexpected") 1184Debug.Assert(argumentNames IsNot Nothing, "Nothing unexpected") 1185Debug.Assert(typeArguments IsNot Nothing, "Nothing unexpected") 1217Debug.Assert(False, "If ReportErrors is True, GetMembers should have thrown above") 1259Debug.Assert(propInfo.GetSetMethod Is Nothing OrElse HasIsExternalInitModifier(propInfo.GetSetMethod), "expected error condition") 1263Debug.Assert(propInfo.GetGetMethod Is Nothing, "expected error condition") 1293Debug.Assert(baseReference IsNot Nothing, "expected a base reference") 1294Debug.Assert(methodName IsNot Nothing, "expected method name") 1295Debug.Assert(members IsNot Nothing AndAlso members.Length > 0, "expected members") 1296Debug.Assert(arguments IsNot Nothing AndAlso 1353Debug.Assert(failure = OverloadResolution.ResolutionFailure.None OrElse Not reportErrors, 1357Debug.Assert(resolutionResult Is Nothing, "resolution failed so should have no result") 1361Debug.Assert(resolutionResult IsNot Nothing, "resolution didn't fail, so should have result") 1384Debug.Assert(result = False AndAlso errors.Count > 0, "expected this candidate to fail") 1460Debug.Assert(result = False AndAlso errors.Count > 0, "expected this candidate to fail") 1483Debug.Assert(False, "not a method or property??") 1493Debug.Assert(targetProcedure IsNot Nothing AndAlso arguments IsNot Nothing, "expected arguments") 1504Debug.Assert(arguments.Length > 0, "must have an argument for property set Value")
Microsoft\VisualBasic\CompilerServices\ObjectType.vb (2)
330Diagnostics.Debug.Assert(Not FromType Is ToType, "IsWideningConversion invalid for like types") 1080Diagnostics.Debug.Assert(Int16Result <= 0, "Invalid result")
Microsoft\VisualBasic\CompilerServices\Operators.Resolution.vb (4)
137Debug.Assert(arguments.Length > 1, "unary op on Nothing unexpected here") 138Debug.Assert(arguments(1) IsNot Nothing, "binary op on Nothing operands unexpected here") 193Debug.Assert(operatorMethod IsNot Nothing, "Operator can't be nothing at this point") 209Debug.Assert(result = False AndAlso errors.Count > 0, "expected this candidate to fail")
Microsoft\VisualBasic\CompilerServices\OverloadResolution.vb (31)
105Debug.Assert(GetTypeCode(leftType) <> GetTypeCode(rightType), 414Debug.Assert(False, "Unexpected comparison type!!!") 424Debug.Assert(Not (leftWinsAtLeastOnce AndAlso rightWinsAtLeastOnce), 493Debug.Assert(arguments Is Nothing OrElse arguments.Length = argumentCount, "Inconsistency in arguments!!!") 686Debug.Assert(False, "unexpected code path") 728Debug.Assert(arguments Is Nothing OrElse arguments.Length = argumentCount, "Inconsistency in arguments!!!") 790Debug.Assert(setMethod IsNot Nothing, "must have set here") 813Debug.Assert(False, "what is this? just ignore it.") 822Debug.Assert(candidateSignature IsNot Nothing, "must have signature if we have a method") 876Debug.Assert(Not collectOnlyOperators, "didn't expect operator with paramarray") 1116Debug.Assert(Not parameterType.IsByRef, "didn't expect byref parameter type here") 1171Debug.Assert(parameterTypeParameters.Length = argumentTypeArguments.Length, 1527Debug.Assert(arguments.Length - argIndex <= 1, 1578Debug.Assert(parameters.Length > 0, "expected some parameters here") 'Candidate collection guarantees this. 1717Debug.Assert(matchedArguments.Length = parameters.Length OrElse 1775Debug.Assert(arguments.Length - argIndex = 1, 1803Debug.Assert(parameters.Length > 0, "expected some parameters here") 'Candidate collection guarantees this. 1822Debug.Assert(Not matchedParameters(paramIndex), "named argument match collision") 1834Debug.Assert(parameters(index).IsOptional, 1915Debug.Assert(arguments.Length - argIndex <= 1, 1942Debug.Assert(parameters.Length > 0, "expected some parameters here") 'Candidate collection guarantees this. 2006Debug.Assert(copyBack.Length = arguments.Length, "array sizes must match") 2217Debug.Assert(False, "Unexpected comparison type!!!") 2296Debug.Assert(Not (leftWinsAtLeastOnce AndAlso rightWinsAtLeastOnce), 2357Debug.Assert(candidateCount = 1, "Surprising overload candidate remains.") 2462Debug.Assert(errors IsNot Nothing, "expected error table") 2477Debug.Assert(errors IsNot Nothing, "expected error table") 2490Debug.Assert(errors IsNot Nothing, "expected error table") 2499Debug.Assert(errors IsNot Nothing, "expected error table") 2552Debug.Assert(result = False AndAlso errors.Count > 0, "expected this candidate to fail") 2565Debug.Assert(candidateReportCount > 0, "expected at least one candidate")
Microsoft\VisualBasic\CompilerServices\StructUtils.vb (1)
96Debug.Assert(PackSize = 1, "PackSize is not actually set to anything other than 1 in the current library. " _
Microsoft\VisualBasic\CompilerServices\Symbols.vb (20)
181Debug.Assert(IsUserDefinedOperator(method), "expected operator here") 517Debug.Assert(type.GetGenericTypeDefinition IsNot Nothing, "expected bound generic type") 542Debug.Assert(genericMethodDef IsNot Nothing AndAlso IsRawGeneric(genericMethodDef), "Uninstantiated generic expected!!!") 563Debug.Assert(referringType.DeclaringMethod.IsGenericMethodDefinition, "Unexpected generic method instantiation!!!") 626Debug.Assert(method1 IsNot Nothing AndAlso IsRawGeneric(method1), "Generic method def expected!!!") 627Debug.Assert(method2 IsNot Nothing AndAlso IsRawGeneric(method2), "Generic method def expected!!!") 666Debug.Assert(False, "unexpected membertype") 708Debug.Assert(parameters IsNot Nothing, "expected parameter array") 938Debug.Assert(Me.IsWindowsRuntimeObject(), "Expected a Windows Runtime Object") 1002Debug.Assert(Me.IsWindowsRuntimeObject(), "Expected a Windows Runtime Object") 1149Debug.Assert(Me.IsArray, "expected array when getting array value") 1150Debug.Assert(indices IsNot Nothing, "expected valid indices") 1198Debug.Assert(Me.IsArray, "expected array when setting array value") 1199Debug.Assert(arguments IsNot Nothing, "expected valid indices") 1261Debug.Assert(callTarget IsNot Nothing, "must have valid MethodBase") 1263Debug.Assert(Not targetProcedure.IsGeneric OrElse 1481Debug.Assert(Me.ArgumentsValidated, "can't bind without validating arguments") 1482Debug.Assert(Me.IsMethod, "binding to a non-method") 1494Debug.Assert(Me.IsMethod, "casting a non-method to a method") 1499Debug.Assert(Me.IsProperty, "casting a non-property to a property")
Microsoft\VisualBasic\CompilerServices\VBBinder.vb (6)
1240Debug.Assert(Not SelectedMatch Is Nothing, "Should have already thrown an exception") 1967Diagnostics.Debug.Assert(False, "Should never be reached") 1976Debug.Assert((invokeAttr And BindingFlags.CreateInstance) = 0, "CreateInstance not supported") 1978Debug.Assert(Not name Is Nothing, "Invalid argument") 2286Debug.Assert(Not Member Is Nothing, "How can this be Nothing ?") 2299Debug.Assert(False, "How can a property get here ?")
Microsoft\VisualBasic\ErrObject.vb (2)
175Diagnostics.Debug.Assert((Not m_HelpContextIsSet) OrElse (Not m_HelpFileIsSet), "Why is this getting called?") 369Diagnostics.Debug.Assert(e IsNot Nothing, "Exception shouldn't be Nothing")
Microsoft\VisualBasic\FileIO\FileSystem.vb (41)
685Debug.Assert(GetParentPath(FullNewPath).Equals(GetParentPath(directory), 722Debug.Assert(GetParentPath(FullNewPath).Equals(GetParentPath(file), 863Debug.Assert(StrCollection IsNot Nothing, "StrCollection is NULL") 895Debug.Assert([Enum].IsDefined(operation), "Invalid Operation") 936Debug.Assert(TargetDirectoryFullPath.Length > SourceDirectoryFullPath.Length, "Target path should be longer") 964Debug.Assert([Enum].IsDefined(operation), "Invalid Operation") 965Debug.Assert(sourceDirectoryPath <> "" And IO.Path.IsPathRooted(sourceDirectoryPath), "Invalid Source") 966Debug.Assert(targetDirectoryPath <> "" And IO.Path.IsPathRooted(targetDirectoryPath), "Invalid Target") 987Debug.Assert(IO.Directory.Exists(targetDirectoryPath), "Should be able to create Target Directory") 1013Debug.Assert([Enum].IsDefined(Operation), "Invalid Operation") 1014Debug.Assert(Exceptions IsNot Nothing, "Null exception list") 1015Debug.Assert(SourceDirectoryNode IsNot Nothing, "Null source node") 1032Debug.Assert(IO.Directory.Exists(SourceDirectoryNode.TargetPath), "TargetPath should have existed or exception should be thrown") 1095Debug.Assert([Enum].IsDefined(operation), "Invalid Operation") 1267Debug.Assert(FilePath <> "" AndAlso IO.Path.IsPathRooted(FilePath), FilePath) 1268Debug.Assert(Text <> "", "Empty text") 1330Debug.Assert(Not (TypeOf ex Is ArgumentException Or TypeOf ex Is ArgumentOutOfRangeException Or 1382Debug.Assert(Results IsNot Nothing, "Results is NULL") 1449Debug.Assert(Path <> "" AndAlso IO.Path.IsPathRooted(Path), Path) 1450Debug.Assert(Path.Equals(IO.Path.GetFullPath(Path)), Path) 1451Debug.Assert(NewName <> "", "Null NewName") 1452Debug.Assert(ArgumentName <> "", "Null argument name") 1485Debug.Assert(Not FullPath = "" AndAlso IO.Path.IsPathRooted(FullPath), "Must be full path") 1497Debug.Assert(DInfo.GetFiles(IO.Path.GetFileName(FullPath)).Length = 1, "Must found exactly 1") 1500Debug.Assert(DInfo.GetDirectories(IO.Path.GetFileName(FullPath)).Length = 1, 1517Debug.Assert(Not (TypeOf ex Is ArgumentException OrElse 1602Debug.Assert(FullSourcePath <> "" And IO.Path.IsPathRooted(FullSourcePath), "Invalid FullSourcePath") 1603Debug.Assert(FullTargetPath <> "" And IO.Path.IsPathRooted(FullTargetPath), "Invalid FullTargetPath") 1604Debug.Assert(ShowUI <> UIOptionInternal.NoUI, "Why call ShellDelete if ShowUI is NoUI???") 1667Debug.Assert(FullPath <> "" And IO.Path.IsPathRooted(FullPath), "FullPath must be a full path") 1668Debug.Assert(ShowUI <> UIOptionInternal.NoUI, "Why call ShellDelete if ShowUI is NoUI???") 2096Debug.Assert(IO.Directory.Exists(DirectoryPath), "Directory does not exist") 2097Debug.Assert(TargetDirectoryPath <> "" And IO.Path.IsPathRooted(TargetDirectoryPath), "Invalid TargetPath") 2157Debug.Assert(Encoding IsNot Nothing, "Null Decoder") 2158Debug.Assert(Text <> "", "Empty Text") 2179Debug.Assert(ByteBuffer IsNot Nothing, "Null ByteBuffer") 2180Debug.Assert(Count > 0, Count.ToString(CultureInfo.InvariantCulture)) 2181Debug.Assert(m_Decoder IsNot Nothing, "Null Decoder") 2182Debug.Assert(m_Preamble IsNot Nothing, "Null Preamble") 2211Debug.Assert(CharCount = ExpectedCharCount, "Should read all characters") 2245Debug.Assert(BigBuffer.Length > SmallBuffer.Length, "BigBuffer should be longer")
Microsoft\VisualBasic\FileIO\TextFieldParser.vb (21)
656Debug.Assert(m_Buffer IsNot Nothing, "There's no buffer") 657Debug.Assert(m_Reader IsNot Nothing, "There's no StreamReader") 662Debug.Assert(BufferLength >= DEFAULT_BUFFER_LENGTH, "Buffer shrunk to below default") 688Debug.Assert(m_Buffer IsNot Nothing, "There's no buffer") 689Debug.Assert(m_Reader IsNot Nothing, "There's no StreamReader") 690Debug.Assert(m_Position >= 0 And m_Position <= m_Buffer.Length, "The cursor is out of range") 717Debug.Assert(m_Buffer IsNot Nothing, "There's no buffer") 718Debug.Assert(m_Reader IsNot Nothing, "There's no StreamReader") 719Debug.Assert(m_Position = 0, "Non-zero position") 739Debug.Assert(CharsRead <= m_Buffer.Length - m_CharsRead, "We've read more chars than we have space for") 811Debug.Assert(m_Buffer IsNot Nothing, "There's no buffer") 812Debug.Assert(Cursor >= 0 And Cursor <= m_CharsRead, "The cursor is out of range") 1007Debug.Assert(m_FieldWidths IsNot Nothing, "No field widths") 1070Debug.Assert(Line IsNot Nothing, "We are parsing a Nothing") 1073Debug.Assert(Length > 0, "A blank line shouldn't be parsed") 1098Debug.Assert(Line IsNot Nothing, "No Line sent") 1128Debug.Assert(m_FieldWidths(i) > 0, "Bad field width, this should have been caught on input") 1150Debug.Assert(Widths IsNot Nothing, "There are no field widths") 1281Debug.Assert((m_DelimitersCopy Is Nothing And m_Delimiters Is Nothing) Or (m_DelimitersCopy IsNot Nothing And m_Delimiters IsNot Nothing), "Delimiters and copy are not both Nothing or both not Nothing") 1299Debug.Assert((m_FieldWidthsCopy Is Nothing And m_FieldWidths Is Nothing) Or (m_FieldWidthsCopy IsNot Nothing And m_FieldWidths IsNot Nothing), "FieldWidths and copy are not both Nothing or both not Nothing") 1414Debug.Assert(m_Delimiters IsNot Nothing, "No delimiters set!")
Microsoft\VisualBasic\Helpers\ForEachEnum.vb (1)
130Debug.Assert(Node IsNot mCurrent, "If we just inserted Node, then it couldn't be the current node because it's not in the list yet")
Microsoft\VisualBasic\Strings.vb (4)
703System.Diagnostics.Debug.Assert(Expression <> "", "Expression is empty") 704System.Diagnostics.Debug.Assert(Find <> "", "Find is empty") 705System.Diagnostics.Debug.Assert(Count > 0, "Number of replacements is 0 or less") 706System.Diagnostics.Debug.Assert([Compare] = CompareMethod.Text Or [Compare] = CompareMethod.Binary, "Unknown compare.")
MSBuild (8)
CommandLineSwitches.cs (4)
407Debug.Assert(s_parameterlessSwitchesMap.Length == (int)ParameterlessSwitch.NumberOfParameterlessSwitches, 409Debug.Assert(s_parameterizedSwitchesMap.Length == (int)ParameterizedSwitch.NumberOfParameterizedSwitches, 414Debug.Assert(i == (int)(s_parameterlessSwitchesMap[i].parameterlessSwitch), 420Debug.Assert(i == (int)(s_parameterizedSwitchesMap[i].parameterizedSwitch),
InterningBinaryReader.cs (1)
173Debug.Assert(false, e.ToString());
QuotingUtilities.cs (1)
91Debug.Assert(false, "Null character in parameter");
TaskEngineAssemblyResolver.cs (1)
84Debug.Assert(false, "There is no handler to remove.");
XMake.cs (1)
3726Debug.Assert((parameterSections.Length >= 1) && (parameterSections.Length <= 2),
MSBuildTaskHost (8)
BuildExceptionBase.cs (1)
112Debug.Assert((exception.Data?.Count ?? 0) == 0,
ChangeWaves.cs (1)
175Debug.Assert(_runningTests || AllWaves.Contains(wave), $"Change wave version {wave} is invalid");
Concurrent\ConcurrentQueue.cs (2)
294Debug.Assert(boundedLength >= 2, $"Must be >= 2, got {boundedLength}"); 295Debug.Assert((boundedLength & (boundedLength - 1)) == 0, $"Must be a power of 2, got {boundedLength}");
InterningBinaryReader.cs (1)
173Debug.Assert(false, e.ToString());
StringBuilderCache.cs (1)
92Debug.Assert(StringBuilderCache.t_cachedInstance == null, "Unexpected replacing of other StringBuilder.");
TaskEngineAssemblyResolver.cs (2)
54Debug.Assert(_eventHandler == null, "The TaskEngineAssemblyResolver.InstallHandler method should only be called once!"); 84Debug.Assert(false, "There is no handler to remove.");
PresentationBuildTasks (121)
MS\Internal\MarkupCompiler\MarkupCompiler.cs (3)
2535Debug.Assert(_codeContexts == null || _codeContexts.Count == 0, "mismatched CodeContexts"); 2554Debug.Assert(HasLocalReference, "if we have a local event, there should be a local mapping PI for it"); 2998Debug.Assert(_codeContexts.Count == 0, "mismatched codecontext");
MS\Internal\MarkupCompiler\ParserExtension.cs (4)
43Debug.Assert(bamlWriter != null, "Need a BamlRecordWriter for compiling to Baml"); 152Debug.Assert(_name == null && _nameField == null, "Name has already been set"); 347Debug.Assert(_name == null && _nameField == null, "Name has already been set"); 793Debug.Assert(_name == null && _nameField == null, "Name definition has already been set");
MS\Internal\Tasks\CompilerLocalReference.cs (3)
181Debug.Assert(String.IsNullOrEmpty(_localCacheFile) != true, "_localCacheFile must not be empty."); 182Debug.Assert(mcPass1 != null, "A valid instance of MarkupCompilePass1 must be passed to method SaveCacheInformation."); 243Debug.Assert(String.IsNullOrEmpty(_localCacheFile) != true, "_localCacheFile must not be empty.");
MS\Internal\Tasks\CompilerState.cs (7)
94Debug.Assert(String.IsNullOrEmpty(_stateFilePath) != true, "StateFilePath must not be empty."); 95Debug.Assert(mcPass1 != null, "A valid instance of MarkupCompilePass1 must be passed to method SaveCacheInformation."); 96Debug.Assert(_cacheInfoList.Length == (int)CompilerStateType.MaxCount, "The Cache string array should be already allocated."); 155Debug.Assert(String.IsNullOrEmpty(_stateFilePath) != true, "_stateFilePath must be not be empty."); 156Debug.Assert(_cacheInfoList.Length == (int)CompilerStateType.MaxCount, "The Cache string array should be already allocated."); 264Debug.Assert(src[str.Length] == '\0', "src[str.Length] == '\\0'"); 265Debug.Assert(((int)src) % 4 == 0, "Managed string should start at 4 bytes boundary");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlMapTable.cs (2)
1024Debug.Assert(assemblyFullName.Length != 0, "empty assembly"); 1470Debug.Assert(GetHashTableData(stringValue) == null,
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecordHelper.cs (1)
132Debug.Assert(false, "Unhandled case in DoesRecordTypeHaveDebugExtension");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecords.cs (20)
700Debug.Assert(false,"Assembly, Type and Attribute records are not cached, so don't ask for one."); 725Debug.Assert(false,"Unknown RecordType"); 868set { Debug.Assert (value == -1, "Setting fixed record to an invalid size"); } 877Debug.Assert(false, "Must override RecordType"); 1513Debug.Assert(_valuePositionPosition != -1, 1696Debug.Assert(_valuePositionPosition != -1, 2061set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2131set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2192set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2419set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 2996set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 3210set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3297set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3446Debug.Assert(_contentSizePosition != -1, 3491set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3651set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 3749set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 3827set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 4012Debug.Assert(FilePos != -1,"UpdateWrite called but Write Never was"); 4708Debug.Assert((propertyMember is MethodInfo) || (propertyMember is PropertyInfo)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecordWriter.cs (11)
467Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 567Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 604Debug.Assert(!InStaticResourceSection, "We do not support x:Shared within a StaticResource Section"); 788Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 844Debug.Assert(keyRecord.RecordList.Count == 0, "Should have empty record list"); 870Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 1632Debug.Assert(keyRecord != null, "Unknown key record type in defer load dictionary"); 1643Debug.Assert(keyIndex == _deferKeys.Count, 1666Debug.Assert(_deferElementDepth > 0 && CollectingValues, 1674Debug.Assert(valueDeferRecord.Record != null && 1686Debug.Assert(valueDeferRecord.Record != null && valueDeferRecord.Record.RecordType == BamlRecordType.ElementEnd,
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlVersionHeader.cs (2)
104Debug.Assert(length == BamlVersionHeader.BinarySerializationSize, 109Debug.Assert((posEnd-posStart) == BamlVersionHeader.BinarySerializationSize,
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\KnownTypes.cs (3)
4762Debug.Assert(asmFramework != null, "asmFramework must not be null"); 4763Debug.Assert(asmCore != null, "asmCore must not be null"); 4764Debug.Assert(asmBase != null, "asmBase must not be null");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\MarkupExtensionParser.cs (1)
1544Debug.Assert(null != info, "No property or method info for field Name");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\StyleXamlParser.cs (1)
1298Debug.Assert (mode != StyleMode.Base || xamlPropertyNode.PropName != XamlStyleSerializer.TargetTypePropertyName,
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\TreeBuilder.cs (1)
94Debug.Assert (false, "Parse Fragment was not overidden");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlParser.cs (4)
535Debug.Assert(false,"Unknown Xaml Token."); 1101Debug.Assert(null != assemblyName, "assembly name returned from GetBaseElement is null"); 1102Debug.Assert(null != typeFullName, "Type name returned from GetBaseElement is null"); 1353Debug.Assert(null == _bamlWriter || null == value, "XamlParser already had a bamlWriter");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (37)
128Debug.Assert(xamlParser != null, "Cannot have null xaml parser"); 129Debug.Assert(parserContext != null, "Cannot have null parser context"); 130Debug.Assert(xmlReader != null, "Cannot have null xmlReader"); 341Debug.Assert(null != xamlNode, "null returned from the collection"); 409Debug.Assert(!IsMoreData(), "Setting state to done but not done parsing."); 442Debug.Assert(null != xamlNode, "null returned from the collection"); 1188Debug.Assert(null != typeFullName, "type name not set"); 1189Debug.Assert(null != dynamicObjectName, "dynamicObject name not set"); 1190Debug.Assert(null != assemblyName, "assembly name not set"); 1842Debug.Assert(null == dynamicObject,"DynamicObject should be null for code"); 2006Debug.Assert(false == endTagHasBeenRead, "Read past end tag on end tag"); 3186Debug.Assert(null != assemblyName, "property without an AssemblyName"); 3187Debug.Assert(null != declaringTypeFullName, "property without a type name"); 3188Debug.Assert(null != dynamicObjectName, "property without a field Name"); 3763Debug.Assert(CurrentContext.ContextType == ElementContextType.PropertyComplex || 4143Debug.Assert(null != assemblyName, "property without an AssemblyName"); 4144Debug.Assert(null != typeFullName, "property without a type name"); 4145Debug.Assert(null != dynamicObjectName, "property without a field Name"); 5094Debug.Assert( isWhitespace, 5273Debug.Assert(null != XmlReader, "XmlReader is not yet set"); 5321Debug.Assert(false, "XmlReader doesn't support LineNumber"); 5352Debug.Assert(false, "XmlReader doesn't support LinePosition"); 5579Debug.Assert(null != text, "String passed to CollapseText cannot be null"); 5580Debug.Assert(textLength > 0, "String passed to Collapsed Text cannot be empty"); 5840Debug.Assert((_nodeIndex == 0 && _xamlNodes.Count == 0 ) || (_nodeIndex < _xamlNodes.Count), 5860Debug.Assert((_nodeIndex == 0 && _xamlNodes.Count == 0 ) || (_nodeIndex < _xamlNodes.Count), 5887Debug.Assert(!value || _insertionIndex == -1, "Attribute node collection is already marked for insertion."); 5946Debug.Assert(_nodeIndex == _xamlNodes.Count, "NodeIndex is larger than node count."); 6014Debug.Assert( _typeConverterDecisionState == TypeConverterDecisionState.ElementEnd, 6077Debug.Assert(((XamlNode)_xamlNodes[_typeConverterCandidateIndex]).TokenType==XamlNodeType.ElementStart, 6096Debug.Assert(((XamlNode)_xamlNodes[_typeConverterCandidateIndex])==xamlNode, 6120Debug.Assert(((XamlNode)_xamlNodes[_typeConverterCandidateIndex])==xamlNode, 6136Debug.Assert( _typeConverterTextWrittenAndNotProcessed != null, 6165Debug.Assert(((XamlNode)_xamlNodes[_typeConverterCandidateIndex]).TokenType==XamlNodeType.ElementStart, 6441Debug.Assert(null != textFlowData, "No data for TextFlow"); 6463Debug.Assert(null != typeRightTag, "ElementType not yet assigned to Node"); 6584Debug.Assert(0 == textFlowData.InlineCount, "Text stack still has an inline count");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlTypeMapper.cs (15)
954Debug.Assert(null != localName, "null localName"); 955Debug.Assert(null != xmlNamespace, "null xmlNamespace"); 1921Debug.Assert(typeInfo != null, "Must have cached type info at this point"); 2413Debug.Assert(null != xmlNamespace,"null value passed for xmlNamespace"); 2414Debug.Assert(null != localName,"null value passed for localName"); 2452Debug.Assert(null != xmlNamespace,"null value passed for xmlNamespace"); 2453Debug.Assert(null != localName,"null value passed for localName"); 2603Debug.Assert(namespaceMap.ClrNamespace != null,"Null CLR Namespace"); 2604Debug.Assert(localName != null,"Null localName"); 3161Debug.Assert(false, "Should initialize cache prior to compiling"); 3432Debug.Assert(false, "Should initialize cache prior to compiling"); 3451Debug.Assert(null != type, "Null passed for type to GetTypeConverterType"); 3526Debug.Assert(null != propType, "Null passed for propType to GetPropertyConverterType"); 3755Debug.Assert(null != type, "null value for type passed to GetWhitespace"); 4021Debug.Assert(_dpLookupHashtable != null,
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\TokenizerHelper.cs (1)
195Debug.Assert(!Char.IsWhiteSpace(currentChar),"Token started on Whitespace");
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (2)
133Debug.Assert(null != type, "Type passed to IsInternalType is null"); 154Debug.Assert(null != type, "Type passed to IsPublicType is null");
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\TypeConverterHelper.cs (2)
103Debug.Assert(null != memberInfo, "Null passed for memberInfo to GetConverterType"); 120Debug.Assert(null != type, "Null passed for type to GetConverterType");
src\Microsoft.DotNet.Wpf\src\WindowsBase\MS\Internal\IO\Packaging\CompoundFile\ContainerUtilities.cs (1)
90Debug.Assert(length >= 0, "The length cannot be negative. Caller must verify this");
PresentationCore (521)
MS\Internal\DpiUtil\DpiUtil+ProcessDpiAwarenessHelper.cs (1)
105Debug.Assert(windowThreadProcessId != 0, "GetWindowThreadProcessId failed");
MS\Internal\Generic\Span.cs (1)
473Debug.Assert(
MS\Internal\Ink\EllipticalNodeOperations.cs (3)
42Debug.Assert(_nodeShapeToCircle.HasInverse, "About to invert a non-invertible transform"); 54Debug.Assert(_nodeShapeToCircle.HasInverse, "Just rotated an invertible transform and produced a non-invertible one"); 70Debug.Assert(_nodeShapeToCircle.HasInverse, "Just scaled an invertible transform and produced a non-invertible one");
MS\Internal\Ink\ExtendedPropertyCollection.cs (1)
325System.Diagnostics.Debug.Assert(!this.Contains(extendedProperty.Id), "ExtendedProperty already belongs to the collection");
MS\Internal\Ink\GestureRecognizer\NativeRecognizer.cs (3)
687Debug.Assert(!(bestResultColumnCount != 0 && pRecoLattice->pLatticeColumns == IntPtr.Zero), "Invalid results!"); 701Debug.Assert(0 < recoColumn.cLatticeElements, "Invalid results!"); 708Debug.Assert((RECO_TYPE)(recoElement.type) == RECO_TYPE.RECO_TYPE_WCHAR, "The Application gesture has to be WCHAR type" );
MS\Internal\Ink\InkSerializedFormat\CustomAttributeSerializer.cs (1)
958Debug.Assert(false, "Missing case statement!");
MS\Internal\Ink\InkSerializedFormat\DrawingAttributeSerializer.cs (3)
293System.Diagnostics.Debug.Assert(false, "Corrupt Matrix in the ExtendedPropertyCollection!"); 509System.Diagnostics.Debug.Assert(da.Color != (Color)DrawingAttributes.GetDefaultDrawingAttributeValue(KnownIds.Color), "Color was put in the EPC for the default value!"); 610System.Diagnostics.Debug.Assert(da.StylusTip != StylusTip.Ellipse, "StylusTip was put in the EPC for the default value!");
MS\Internal\Ink\InkSerializedFormat\StrokeSerializer.cs (1)
299System.Diagnostics.Debug.Assert(false, "ExtendedProperties for points are not supported");
MS\Internal\Ink\StrokeNode.cs (3)
266Debug.Assert(false, "StrokeNodeOperations.GetPointsAtStartOfSegment failed to find the D position"); 379Debug.Assert(false, "StrokeNodeOperations.GetPointsAtEndOfSegment failed to find the B position"); 646Debug.Assert(false, "Couldn't find all 4 indexes in StrokeNodeOperations.GetPointsAtMiddleSegment");
MS\Internal\Ink\StrokeRenderer.cs (2)
353Debug.Assert(!prevStrokeNode.GetConnectingQuad().IsEmpty, "prevStrokeNode.GetConnectingQuad() is Empty!"); 459Debug.Assert(!strokeNode.GetConnectingQuad().IsEmpty, "strokeNode.GetConnectingQuad was empty, this is unexpected");
MS\Internal\IO\Packaging\ByteRangeDownloader.cs (3)
79Debug.Assert(fileMutex != null, "FileMutex must be a valid mutex"); 80Debug.Assert(tempStream != null, "ByteRangeDownloader requires a stream to write to"); 196Debug.Assert(byteRanges.GetLength(0) == 1, "We don't support a request with multiple byte ranges");
MS\Internal\IO\Packaging\NetStream.cs (2)
731Debug.Assert(_fullStreamLength >= 0, "We assume _fullStreamLength is correct for Http cases - only Ftp can return bogus values"); 1165Debug.Assert(_fullDownloadComplete, "Do not call this unless full download is complete.");
MS\Internal\IO\Packaging\PseudoWebRequest.cs (3)
52Debug.Assert(uri != null, "PackWebRequest uri cannot be null"); 53Debug.Assert(packageUri != null, "packageUri cannot be null"); 54Debug.Assert(partUri != null, "partUri cannot be null");
MS\Internal\IO\Packaging\ResponseStream.cs (4)
50Debug.Assert(container != null, "Logic error: use other constructor for full package request streams"); 51Debug.Assert(owningStream != null, "Logic error: use other constructor for full package request streams"); 74Debug.Assert(s != null, "Logic error: base stream cannot be null"); 75Debug.Assert(response != null, "Logic error: response cannot be null");
MS\Internal\Media\VisualTreeUtils.cs (3)
242Debug.Assert((visual == null) != (visual3D == null), 263Debug.Assert(castSucceeded && ((visual == null) != (visual3D == null)), 270Debug.Assert(!castSucceeded && visual == null && visual3D == null,
MS\Internal\Media3D\GeneralTransform2DTo3DTo2D.cs (1)
492Debug.Assert(uv.Length == p.Length, "vertices and texture coordinate sizes should match");
MS\Internal\Media3D\M3DUtil.cs (2)
44Debug.Assert(!bounds.IsEmpty, 388Debug.Assert(camera != null, "Caller is responsible for ensuring camera is not null.");
MS\Internal\Shaping\GlyphInfoList.cs (1)
60Debug.Assert(_glyphs.Offset + _glyphs.Length == cch, "Invalid glyph length!");
MS\Internal\Shaping\OpenTypeCommon.cs (4)
599Debug.Assert(false,"Unknown OpenType layout table!"); 1080Debug.Assert(false,"Ext.Lookup processed earlier!"); 1165Debug.Assert(false,"Ext.Lookup processed earlier!"); 1178Debug.Assert(false,"Unknown OpenType layout table!");
MS\Internal\Shaping\TypefaceMap.cs (2)
226Debug.Assert(false, "Invalid font face spans"); 399Debug.Assert(index >= 0, "Invalid scaled shapeable typeface index spans");
MS\Internal\Shaping\UshortList2.cs (4)
142Debug.Assert(false, "Not supported"); 148Debug.Assert(false, "Not supported"); 154Debug.Assert(false, "Not supported"); 159Debug.Assert(false, "Not supported");
MS\Internal\TextFormatting\Bidi.cs (30)
693Debug.Assert(CharProperty[1, (int) startClass]==1 || (startClass == DirectionClass.ArabicLetter), 696Debug.Assert(CharProperty[1, (int) endClass]==1, ("Cannot use non strong type to resolve neutrals")); 719Debug.Assert(CharProperty[2, (int) characterClass[counter + classIndex]]==0, 744Debug.Assert(CharProperty[2, (int) characterClass[counter + classIndex]]==0, "Changing class of a fixed class"); 855Debug.Assert(startOfNeutrals == PositionInvalid, 900Debug.Assert(startOfDelayed != PositionInvalid, 945Debug.Assert(startOfNeutrals == PositionInvalid, 950Debug.Assert(startOfDelayed != PositionInvalid, 1050Debug.Assert(startOfNeutrals != PositionInvalid, 1089Debug.Assert(startOfNeutrals != PositionInvalid, 1122Debug.Assert(startOfNeutrals == PositionInvalid, 1140Debug.Assert(startOfNeutrals == PositionInvalid, 1153Debug.Assert(startOfDelayed != PositionInvalid, 1167Debug.Assert(startOfNeutrals == PositionInvalid, 1172Debug.Assert(startOfDelayed != PositionInvalid, 1183Debug.Assert(startOfNeutrals != PositionInvalid, 1192Debug.Assert(startOfNeutrals == PositionInvalid, 1210Debug.Assert(startOfDelayed != PositionInvalid, 1214Debug.Assert(lastClass == DirectionClass.EuropeanTerminator, 1221Debug.Assert(startOfNeutrals == PositionInvalid, 1226Debug.Assert(startOfDelayed != PositionInvalid, 1275Debug.Assert(startOfNeutrals != PositionInvalid, 1289Debug.Assert(startOfNeutrals == PositionInvalid, 1294Debug.Assert(startOfDelayed != PositionInvalid, 1326Debug.Assert(startOfNeutrals == PositionInvalid, 1353Debug.Assert(startOfNeutrals == PositionInvalid, 1398Debug.Assert(startOfNeutrals == PositionInvalid, 1434Debug.Assert(startOfDelayed != PositionInvalid, 1576Debug.Assert(startOfNeutrals == PositionInvalid, 2467Debug.Assert(runLengthResolved == runLength,
MS\Internal\TextFormatting\FullTextState.cs (1)
292Debug.Assert(lsccp > 0, "Zero-length text line!");
MS\Internal\TextFormatting\LineServicesCallbacks.cs (9)
192Debug.Assert(TextStore.IsContent(plsrun), "Unrecognizable run!"); 193Debug.Assert(lsrun.RunProp != null, "invalid lsrun!"); 624Debug.Assert(markerStore != null, "No marker store, yet autonumbering is specified!"); 692Debug.Assert( 756Debug.Assert( 1266Debug.Assert(false, "Not supported TextDecorationUnit"); 1293Debug.Assert(false, "Not supported TextDecorationUnit"); 2342Debug.Assert(false, "Unsupported installed object!"); 2630Debug.Assert(fGeometryProvided == 0, "Line enumeration doesn't need geometry information");
MS\Internal\TextFormatting\TextMarkerSource.cs (1)
134Debug.Assert(false, "Invalid marker style");
MS\Internal\TextFormatting\TextRunCacheImp.cs (2)
190Debug.Assert(textRun != null && runLength > 0, "Invalid run!"); 263Debug.Assert(
MS\Internal\UIElementHelper.cs (3)
22Debug.Assert(o != null, "UIElementHelper.IsHitTestVisible called with null argument"); 38Debug.Assert(o != null, "UIElementHelper.IsVisible called with null argument"); 54Debug.Assert(o != null, "UIElementHelper.PredictFocus called with null argument");
src\Microsoft.DotNet.Wpf\src\Common\Graphics\exports.cs (1)
1089Debug.Assert(_others == null, "There shouldn't be anything stored in the others array.");
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\CharacterBuffer.cs (2)
251Debug.Assert(characterOffset >= 0 && characterOffset < _characterArray.Length, "Invalid character index"); 351Debug.Assert(characterOffset >= 0 && characterOffset < _string.Length, "Invalid character index");
System\IO\Packaging\PackWebRequest.cs (2)
73Debug.Assert(uri != null, "PackWebRequest uri cannot be null"); 74Debug.Assert(packageUri != null, "packageUri cannot be null");
System\IO\Packaging\PackWebResponse.cs (1)
625Debug.Assert(false, "Cannot return full-container stream from cached container object");
System\Windows\Automation\Peers\AutomationPeer.cs (1)
1642Debug.Assert(caller._children != null, "iteration over a null family");
System\Windows\ClassHandlersStore.cs (4)
38Debug.Assert(index != -1, "There should exist a set of handlers for the given routedEvent"); 75Debug.Assert(index != -1, "There should exist a set of handlers for the given index"); 86Debug.Assert(GetHandlersIndex(routedEvent) == -1, "There should not exist a set of handlers for the given routedEvent"); 104Debug.Assert(baseClassListeners != null, "Update only when there are base class listeners to be updated");
System\Windows\DragDrop.cs (2)
573Debug.Assert(dragSource != null, "Invalid dragSource"); 574Debug.Assert(dataObject != null, "Invalid dataObject");
System\Windows\DragEventArgs.cs (3)
58Debug.Assert(false, "Invalid dragDropKeyStates"); 63Debug.Assert(false, "Invalid allowedEffects"); 68Debug.Assert(false, "Invalid target");
System\Windows\EventHandlersStore.cs (2)
259Debug.Assert(key != null, "Search key cannot be null"); 277Debug.Assert(key != null, "Search key cannot be null");
System\Windows\FreezableCollection.cs (2)
1008Debug.Assert(list != null, "list may not be null."); 1106Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Generated\TextDecorationCollection.cs (2)
754Debug.Assert(list != null, "list may not be null."); 852Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\GiveFeedbackEventArgs.cs (1)
44Debug.Assert(false, "Invalid effects");
System\Windows\GlobalEventManager.cs (3)
26Debug.Assert(GetRoutedEventFromName(name, ownerType, false) == null, 59Debug.Assert( 64Debug.Assert(routedEvent.IsLegalHandler(handler),
System\Windows\Ink\IncrementalHitTester.cs (2)
214Debug.Assert(false, "Benign assert. IncrementalHitTester's _strokeInfos cache is out of sync, rebuilding."); 222Debug.Assert(false, "Benign assert. IncrementalHitTester's _strokeInfos cache is out of sync, rebuilding.");
System\Windows\Input\AccessKeyManager.cs (2)
253Debug.Assert(target != null, "Targets should only be UIElements"); 615Debug.Assert(element is IInputElement, "Element in AccessKeyManager store was not of type IInputElement");
System\Windows\Input\Command\CommandBinding.cs (2)
189Debug.Assert(Executed != null, nameof(Executed) + " != null"); 197Debug.Assert(PreviewExecuted != null, nameof(PreviewExecuted) + " != null");
System\Windows\Input\InputLanguageSource.cs (1)
204Debug.Assert(_ipp == null, "_EnsureInputProcesoorProfile has been called.");
System\Windows\Input\InputMethod.cs (1)
729Debug.Assert(false, "Unknown Speech Mode");
System\Windows\Input\InputMethodStateTypeInfo.cs (1)
102Debug.Assert(false, "The guid does not match.");
System\Windows\Input\InputProcessorProfiles.cs (5)
67Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "Initialize called on MTA thread!"); 69Debug.Assert(_ipp.Value == null, "Initialize called twice"); 87Debug.Assert(_ipp.Value != null, "Uninitialize called without initializing"); 187Debug.Assert(_cookie == UnsafeNativeMethods.TF_INVALID_COOKIE, "Cookie is already set."); 202Debug.Assert(_cookie != UnsafeNativeMethods.TF_INVALID_COOKIE, "Cookie is not set.");
System\Windows\Input\InputProcessorProfilesLoader.cs (1)
66Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "Load called on MTA thread!");
System\Windows\Input\Manipulation.cs (1)
44Debug.Assert(element != null, "element should be non-null.");
System\Windows\Input\ManipulationDevice.cs (2)
84Debug.Assert(element != null, "element should be non-null."); 113Debug.Assert(element != null, "element should be non-null.");
System\Windows\Input\ManipulationLogic.cs (1)
307Debug.Assert(_generatedEvent == null, "There is already a generated event waiting to be pushed.");
System\Windows\Input\MouseDevice.cs (1)
1475Debug.Assert(_mouseOver == null, "_mouseOver should be null because we have called ChangeMouseOver(null) already.");
System\Windows\Input\Stylus\Common\DynamicRenderer.cs (1)
601Debug.Assert(_waitingForRenderComplete, "We were expecting to be waiting for a RenderComplete to call our OnRenderComplete, we might never reset and get flashing strokes from here on out");
System\Windows\Input\Stylus\Common\StylusLogic.cs (1)
791Debug.Assert(false, "Unknown Flick Action encountered");
System\Windows\Input\Stylus\Common\StylusPointCollection.cs (3)
153Debug.Assert(0 == rawPacketData.Length % lengthPerPoint, "Invalid assumption about packet length, there shouldn't be any remainder"); 567Debug.Assert(this.Count != 0, "Why are we serializing an empty StylusPointCollection???"); 650Debug.Assert(e.Cancel, "This event should always be cancelled");
System\Windows\Input\Stylus\Common\StylusPointPropertyInfo.cs (1)
124Debug.Assert(( stylusPointPropertyInfo1.Id != StylusPointPropertyIds.X &&
System\Windows\Input\Stylus\Pointer\PointerTabletDeviceInfo.cs (3)
262Debug.Assert(properties[StylusPointDescription.RequiredXIndex /*0*/].Id == StylusPointPropertyIds.X || !seenX, 264Debug.Assert(properties[StylusPointDescription.RequiredYIndex /*1*/].Id == StylusPointPropertyIds.Y || !seenY, 266Debug.Assert(properties[StylusPointDescription.RequiredPressureIndex /*1*/].Id == StylusPointPropertyIds.NormalPressure /*2*/,
System\Windows\Input\Stylus\Wisp\PenContext.cs (3)
169Debug.Assert(propertyInfos[StylusPointDescription.RequiredXIndex /*0*/].Id == StylusPointPropertyIds.X, "X isn't where we expect it! Fix PenImc to ask for X at index 0"); 170Debug.Assert(propertyInfos[StylusPointDescription.RequiredYIndex /*0*/].Id == StylusPointPropertyIds.Y, "Y isn't where we expect it! Fix PenImc to ask for Y at index 1"); 171Debug.Assert(pressureIndex == -1 || pressureIndex == StylusPointDescription.RequiredPressureIndex /*2*/,
System\Windows\Input\Stylus\Wisp\PenThreadPool.cs (1)
152Debug.Assert(false, "Retry limit reached when acquiring PenThread");
System\Windows\Input\Stylus\Wisp\PenThreadWorker.cs (2)
942Debug.Assert(properties[StylusPointDescription.RequiredXIndex /*0*/].Id == StylusPointPropertyIds.X, "X isn't where we expect it! Fix PenImc to ask for X at index 0"); 943Debug.Assert(properties[StylusPointDescription.RequiredYIndex /*1*/].Id == StylusPointPropertyIds.Y, "Y isn't where we expect it! Fix PenImc to ask for Y at index 1");
System\Windows\Input\Stylus\Wisp\WispLogic.cs (1)
3291Debug.Assert(!_inputEnabled, "StylusLogic has been enabled unexpectly.");
System\Windows\Input\Stylus\Wisp\WispTabletDeviceCollection.cs (2)
272Debug.Assert(false, "Error acquiring PenThread in UpdateTabletsImpl()"); 420Debug.Assert(false, "Error acquiring PenThread in HandleTabletAdded()");
System\Windows\Input\TextServicesCompartment.cs (2)
95Debug.Assert(_cookie == UnsafeNativeMethods.TF_INVALID_COOKIE, "cookie is already set."); 116Debug.Assert(_cookie != UnsafeNativeMethods.TF_INVALID_COOKIE, "cookie is not set.");
System\Windows\Input\TextServicesContext.cs (1)
53Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "SetDispatcherThreaad on MTA thread");
System\Windows\Input\TouchDevice.cs (3)
614Debug.Assert(oldCapture != null, "oldCapture should be non-null."); 623Debug.Assert(captured != null, "captured should be non-null."); 861Debug.Assert(newDirectlyOver != _directlyOver, "ChangeDirectlyOver called when newDirectlyOver is the same as _directlyOver.");
System\Windows\InterOp\HwndSource.cs (3)
1041Debug.Assert(_hwndTarget!= null, "HwndTarget is null"); 1042Debug.Assert(_hwndTarget.IsDisposed == false, "HwndTarget is disposed"); 2284Debug.Assert(null!=ikis, "ChildSinkWithFocus called when none had focus");
System\Windows\Media\Animation\AnimationLayer.cs (6)
39Debug.Assert(defaultDestinationValue != DependencyProperty.UnsetValue, 86Debug.Assert(handoffBehavior == HandoffBehavior.Compose, 88Debug.Assert(defaultDestinationValue == DependencyProperty.UnsetValue, 140Debug.Assert(_hasStickySnapshotValue, 150Debug.Assert(_animationClocks != null 158Debug.Assert(index >= 0,
System\Windows\Media\Animation\AnimationStorage.cs (10)
517Debug.Assert(index > -1, 546Debug.Assert(_hasStickySnapshotValue, 597Debug.Assert(animationClocks != null, 599Debug.Assert(animationClocks.Count > 0, 601Debug.Assert(!animationClocks.Contains(null), 603Debug.Assert(HandoffBehaviorEnum.IsDefined(handoffBehavior), 716Debug.Assert(HandoffBehaviorEnum.IsDefined(handoffBehavior), 789Debug.Assert(HandoffBehaviorEnum.IsDefined(handoffBehavior), 905Debug.Assert(storage != null, 1156Debug.Assert(type == typeof(Vector3D), "Application is trying to create independent animation storage for an unsupported type.");
System\Windows\Media\Animation\Clock.cs (24)
1409Debug.Assert(_resolvedDuration != Duration.Automatic, "_resolvedDuration should never be set to Automatic."); 1957Debug.Assert(_currentDuration != Duration.Automatic, "_currentDuration should never be Automatic."); 2184Debug.Assert(_currentDuration == Duration.Forever, "_currentDuration has an invalid enum value."); 2203Debug.Assert(this is ClockGroup, "ComputeCurrentIterationWithGrow should only run on ClockGroups."); 2204Debug.Assert(CanGrow, "ComputeCurrentIterationWithGrow should only run on clocks with CanGrow."); 2205Debug.Assert(_currentIterationBeginTime.HasValue, "ComputeCurrentIterationWithGrow should only be called when _currentIterationBeginTime has a value."); 2206Debug.Assert(_resolvedDuration.HasTimeSpan, "ComputeCurrentIterationWithGrow should only be called when _resolvedDuration has a value."); // We must have a computed duration 2207Debug.Assert(_currentDuration.HasTimeSpan, "ComputeCurrentIterationWithGrow should only be called when _currentDuration has a value."); 2354Debug.Assert(_currentDuration != Duration.Automatic, "_currentDuration should never be Automatic."); 2358Debug.Assert(_currentDuration.TimeSpan > TimeSpan.Zero, "ComputeCurrentTime was entered with _currentDuration <= 0"); 2365Debug.Assert(transitionTime <= 1, "The values of the accel and decel attributes incorrectly add to more than 1.0"); 2366Debug.Assert(transitionTime >= 0, "The values of the accel and decel attributes incorrectly add to less than 0.0"); 2429Debug.Assert(_currentDuration == Duration.Forever, "_currentDuration has an invalid enum value."); 2457Debug.Assert(_resolvedDuration == Duration.Forever, "_resolvedDuration should be Forever when NaturalDuration is Automatic."); 2490Debug.Assert(_resolvedDuration != Duration.Automatic, "_resolvedDuration should never be Automatic."); 2491Debug.Assert(_currentDuration != Duration.Automatic, "_currentDuration should never be Automatic."); 2513Debug.Assert(_currentDuration.HasTimeSpan, "_currentDuration is invalid, neither Forever nor a TimeSpan."); 2514Debug.Assert(_currentDuration == _resolvedDuration, "For clocks which cannot grow, _currentDuration must equal _resolvedDuration."); 2526Debug.Assert(_resolvedDuration.HasTimeSpan, "_resolvedDuration is invalid, neither Forever nor a TimeSpan."); 2527Debug.Assert(_currentDuration.HasTimeSpan, "_currentDuration is invalid, neither Forever nor a TimeSpan."); 2667Debug.Assert(!_currentIterationBeginTime.HasValue, "_currentIterationBeginTime should not have a value when _beginTime has no value."); 3093Debug.Assert(_rootData != null, "A root Clock must have the _rootData structure initialized."); 3407Debug.Assert(!current.IsRoot, "Root nodes never should reset their Slip amounts with ResetSlipOnSubtree(), even when seeking."); 4192Debug.Assert(Math.Abs(optimizedInputTime - inputTime) <= error,
System\Windows\Media\Animation\ClockController.cs (1)
45Debug.Assert(owner != null, "ClockController must have a non-null owner.");
System\Windows\Media\Animation\ClockGroup.cs (8)
413Debug.Assert(!IsTimeManager, "Cannot associate a root with multiple timing trees"); 414Debug.Assert(this._timeManager == null, "Cannot use a timeline already in the timing tree as a root"); 415Debug.Assert(timeManager.TimeManagerClock == this, "Cannot associate more than one root per timing tree"); 416Debug.Assert(this._parent == null && _children == null, "Cannot use a timeline connected to other timelines as a root"); 463Debug.Assert(IsTimeManager, "Invalid call to RootActivate for a non-root Clock"); 479Debug.Assert(IsTimeManager, "Invalid call to RootCleanChildren for a non-root Clock"); 502Debug.Assert(IsTimeManager, "Invalid call to RootHasChildren for a non-root Clock"); 513Debug.Assert(IsTimeManager, "Invalid call to RootDeactivate for a non-root Clock");
System\Windows\Media\Animation\Generated\BooleanAnimationUsingKeyFrames.cs (6)
353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 542Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 549Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 599Debug.Assert(!_areKeyTimesValid, "KeyFrameBooleanAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 741Debug.Assert(index < keyFrameCount, 817Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\ByteAnimationUsingKeyFrames.cs (6)
353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameByteAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\CharAnimationUsingKeyFrames.cs (6)
353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 542Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 549Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 599Debug.Assert(!_areKeyTimesValid, "KeyFrameCharAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 741Debug.Assert(index < keyFrameCount, 817Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\ColorAnimationUsingKeyFrames.cs (6)
353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameColorAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\DecimalAnimationUsingKeyFrames.cs (6)
353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameDecimalAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\DoubleAnimationUsingKeyFrames.cs (6)
353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameDoubleAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Int16AnimationUsingKeyFrames.cs (6)
353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameInt16Animaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Int32AnimationUsingKeyFrames.cs (6)
353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameInt32Animaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Int64AnimationUsingKeyFrames.cs (6)
353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameInt64Animaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\MatrixAnimationUsingKeyFrames.cs (6)
353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 542Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 549Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 599Debug.Assert(!_areKeyTimesValid, "KeyFrameMatrixAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 741Debug.Assert(index < keyFrameCount, 817Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\ObjectAnimationUsingKeyFrames.cs (6)
353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 542Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 549Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 599Debug.Assert(!_areKeyTimesValid, "KeyFrameObjectAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 741Debug.Assert(index < keyFrameCount, 817Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Point3DAnimationUsingKeyFrames.cs (6)
353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFramePoint3DAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\PointAnimationUsingKeyFrames.cs (6)
353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFramePointAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\QuaternionAnimationUsingKeyFrames.cs (6)
353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameQuaternionAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\RectAnimationUsingKeyFrames.cs (6)
353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameRectAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Rotation3DAnimationUsingKeyFrames.cs (6)
353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameRotation3DAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\SingleAnimationUsingKeyFrames.cs (6)
353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameSingleAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\SizeAnimationUsingKeyFrames.cs (6)
353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameSizeAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\StringAnimationUsingKeyFrames.cs (6)
353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 542Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 549Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 599Debug.Assert(!_areKeyTimesValid, "KeyFrameStringAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 741Debug.Assert(index < keyFrameCount, 817Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\TimelineCollection.cs (2)
772Debug.Assert(list != null, "list may not be null."); 871Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Animation\Generated\TimelineGroup.cs (1)
199Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Animation\Generated\Vector3DAnimationUsingKeyFrames.cs (6)
353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameVector3DAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\VectorAnimationUsingKeyFrames.cs (6)
353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameVectorAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\TimelineClockCollection.cs (2)
433Debug.Assert(owner != null, "ClockCollection must have a non-null owner."); 442Debug.Assert(false, "Parameterless constructor is illegal for ClockCollection.");
System\Windows\Media\Animation\TimeManager.cs (1)
590Debug.Assert(false, "Unrecognized TimeState enumeration value");
System\Windows\Media\BitmapCacheBrush.cs (1)
192Debug.Assert(InternalTarget == AutoWrapVisual,
System\Windows\Media\Effects\Generated\BitmapEffectCollection.cs (2)
760Debug.Assert(list != null, "list may not be null."); 858Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Effects\Generated\BitmapEffectGroup.cs (1)
217Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Effects\Generated\BitmapEffectInput.cs (1)
250Debug.Assert(s_Input == null || s_Input.IsFrozen,
System\Windows\Media\Effects\ShaderEffect.cs (1)
731Debug.Assert(!hBrush.IsNull || ss._brush == null, "If brush isn't null, hBrush better not be");
System\Windows\Media\EventProxy.cs (2)
40Debug.Assert(((IntPtr)pEPD.m_handle) != IntPtr.Zero, "If this asserts fires: Why is it firing? It might be legal in future."); 117Debug.Assert(((IntPtr)epd.m_handle) != IntPtr.Zero, "Stream is disposed.");
System\Windows\Media\FormattedText.cs (2)
1753Debug.Assert(_defaultParaProps.Indent == 0.0, "FormattedText was assumed to always have 0 indent. This assumption has changed and thus the calculation of Width and Overhangs should be revised."); 1754Debug.Assert(_defaultParaProps.TextMarkerProperties == null, "FormattedText was assumed to always have no TextMarkerProperties. This assumption has changed and thus the calculation of Width and Overhangs should be revised.");
System\Windows\Media\Generated\Brush.cs (2)
448Debug.Assert(s_Transform == null || s_Transform.IsFrozen, 452Debug.Assert(s_RelativeTransform == null || s_RelativeTransform.IsFrozen,
System\Windows\Media\Generated\CombinedGeometry.cs (2)
447Debug.Assert(s_Geometry1 == null || s_Geometry1.IsFrozen, 451Debug.Assert(s_Geometry2 == null || s_Geometry2.IsFrozen,
System\Windows\Media\Generated\DashStyle.cs (1)
346Debug.Assert(s_Dashes == null || s_Dashes.IsFrozen,
System\Windows\Media\Generated\DoubleCollection.cs (2)
783Debug.Assert(list != null, "list may not be null."); 881Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\DrawingCollection.cs (2)
803Debug.Assert(list != null, "list may not be null."); 901Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\DrawingGroup.cs (1)
850Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Generated\GeneralTransformCollection.cs (2)
762Debug.Assert(list != null, "list may not be null."); 860Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\GeneralTransformGroup.cs (1)
207Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Generated\Geometry.cs (1)
372Debug.Assert(s_Transform == null || s_Transform.IsFrozen,
System\Windows\Media\Generated\GeometryCollection.cs (2)
803Debug.Assert(list != null, "list may not be null."); 901Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\GeometryGroup.cs (1)
504Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Generated\GradientBrush.cs (1)
299Debug.Assert(s_GradientStops == null || s_GradientStops.IsFrozen,
System\Windows\Media\Generated\GradientStopCollection.cs (2)
865Debug.Assert(list != null, "list may not be null."); 963Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\GuidelineSet.cs (2)
367Debug.Assert(s_GuidelinesX == null || s_GuidelinesX.IsFrozen, 371Debug.Assert(s_GuidelinesY == null || s_GuidelinesY.IsFrozen,
System\Windows\Media\Generated\Int32Collection.cs (2)
783Debug.Assert(list != null, "list may not be null."); 881Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\PathFigure.cs (1)
282Debug.Assert(s_Segments == null || s_Segments.IsFrozen,
System\Windows\Media\Generated\PathFigureCollection.cs (2)
852Debug.Assert(list != null, "list may not be null."); 950Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\PathGeometry.cs (1)
299Debug.Assert(s_Figures == null || s_Figures.IsFrozen,
System\Windows\Media\Generated\PathSegmentCollection.cs (2)
762Debug.Assert(list != null, "list may not be null."); 860Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\Pen.cs (1)
572Debug.Assert(s_DashStyle == null || s_DashStyle.IsFrozen,
System\Windows\Media\Generated\PointCollection.cs (2)
785Debug.Assert(list != null, "list may not be null."); 883Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\PolyBezierSegment.cs (1)
220Debug.Assert(s_Points == null || s_Points.IsFrozen,
System\Windows\Media\Generated\PolyLineSegment.cs (1)
220Debug.Assert(s_Points == null || s_Points.IsFrozen,
System\Windows\Media\Generated\PolyQuadraticBezierSegment.cs (1)
220Debug.Assert(s_Points == null || s_Points.IsFrozen,
System\Windows\Media\Generated\TextEffectCollection.cs (2)
762Debug.Assert(list != null, "list may not be null."); 860Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\TransformCollection.cs (2)
803Debug.Assert(list != null, "list may not be null."); 901Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\TransformGroup.cs (1)
455Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Generated\VectorCollection.cs (2)
785Debug.Assert(list != null, "list may not be null."); 883Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\GeometryHitTestParameters.cs (1)
99Debug.Assert(_hitGeometryInternal.Transform.Value == _hitGeometryCache.Transform.Value,
System\Windows\Media\HostVisual.cs (1)
339Debug.Assert(channelDispatcher == this.Dispatcher, "HostVisual connecting on a second thread");
System\Windows\Media\ImageSourceConverter.cs (1)
238Debug.Assert(rawData != null, "rawData is null.");
System\Windows\Media\Imaging\BitmapFrame.cs (2)
71Debug.Assert((stream == null), "Both stream and uri are non-null"); 92Debug.Assert((stream != null), "Both stream and uri are null");
System\Windows\Media\Imaging\BitmapVisualManager.cs (1)
107Debug.Assert (renderTargetBitmap != null, "Render Target is null");
System\Windows\Media\Imaging\Generated\ColorConvertedBitmap.cs (1)
376Debug.Assert(s_Source == null || s_Source.IsFrozen,
System\Windows\Media\Imaging\Generated\CroppedBitmap.cs (1)
319Debug.Assert(s_Source == null || s_Source.IsFrozen,
System\Windows\Media\Imaging\Generated\FormatConvertedBitmap.cs (1)
377Debug.Assert(s_Source == null || s_Source.IsFrozen,
System\Windows\Media\Imaging\Generated\TransformedBitmap.cs (2)
337Debug.Assert(s_Source == null || s_Source.IsFrozen, 341Debug.Assert(s_Transform == null || s_Transform.IsFrozen,
System\Windows\Media\MediaContext.cs (11)
629Debug.Assert(InterlockIsEnabled, 726Debug.Assert(_interlockState == InterlockState.WaitingForResponse, 803Debug.Assert(!InterlockIsWaiting, 868Debug.Assert(InterlockIsWaiting, 1103Debug.Assert(IsClockSupported, "MediaContext.CurrentTime called when QueryPerformaceCounter is not supported"); 1362Debug.Assert(_interlockState == InterlockState.Disabled, 1392Debug.Assert(dispatcher != null, "Dispatcher required"); 2151Debug.Assert(_needToCommitChannel, "CommitChannel called with nothing on the channel"); 2155Debug.Assert(!InterlockIsWaiting, 2221Debug.Assert(InterlockIsEnabled, 2553Debug.Assert(_interlockState == InterlockState.WaitingForNextFrame
System\Windows\Media\mediaeventshelper.cs (3)
96Debug.Assert((sender != null), "Sender is null"); 97Debug.Assert((sender.Dispatcher != null), "Dispatcher is null"); 263Debug.Assert((cb == size), "Invalid event packet");
System\Windows\Media\MediaSystem.cs (1)
281Debug.Assert(reference != null, "The reference object can not be null.");
System\Windows\Media\PathStreamGeometryContext.cs (4)
83Debug.Assert(_figures == null, "It is illegal to call SetFigureCount multiple times or after BeginFigure."); 92Debug.Assert(_figures != null, "It is illegal to call SetSegmentCount before BeginFigure."); 93Debug.Assert(_currentFigure != null, "It is illegal to call SetSegmentCount before BeginFigure."); 94Debug.Assert(_segments == null, "It is illegal to call SetSegmentCount multiple times per BeginFigure or after a *To method.");
System\Windows\Media\StreamAsIStream.cs (2)
67Debug.Assert(((IntPtr)pSD.m_handle) != IntPtr.Zero, "If this asserts fires: why is it firing. It might be legal in future."); 575Debug.Assert(((IntPtr)sd.m_handle) != IntPtr.Zero, "Stream is disposed.");
System\Windows\Media\UniqueEventHelper.cs (4)
42Debug.Assert(sender != null, "Sender is null"); 45Debug.Assert(handler != null, "Event handler is null"); 73Debug.Assert(sender != null, "Sender is null"); 76Debug.Assert(handler != null, "Event handler is null");
System\Windows\Media\Visual.cs (7)
174Debug.Assert(false, "TYPE_VISUAL or TYPE_VIEWPORT3DVISUAL expected."); 1965Debug.Assert(Point.Equals(pointParams.HitPoint, backupHitPoint), 1996Debug.Assert(Matrix.Equals(geometryParams.InternalHitGeometry.Transform.Value, originalMatrix), 3058Debug.Assert(bed != null, "Must be non-null because otherwise the code would have earlied out where new value is compared against old value."); 3303Debug.Assert(EffectField.GetValue(this) == null, "Not expecting both BitmapEffect and Effect to be set on the same node"); 3978Debug.Assert(_parent != null, "If oldParent is null, current parent should != null."); 5247Debug.Assert(cyclicBrushToChannelsMap != null, "Visual brush roots need to have the visual brush to channels map!");
System\Windows\Media\VisualCollection.cs (3)
280Debug.Assert(value == 0, "There shouldn't be a case where value != 0."); 281Debug.Assert(_size == 0, "Size must be 0 here."); 841Debug.Assert(newIndex >= 0 && newIndex <= _size, "New index is invalid");
System\Windows\Media3D\GeneralTransform2DTo3D.cs (1)
35Debug.Assert(child != null, "Going from 2D to 3D containingVisual3D.Visual should not be null");
System\Windows\Media3D\Generated\Camera.cs (1)
351Debug.Assert(s_Transform == null || s_Transform.IsFrozen,
System\Windows\Media3D\Generated\DiffuseMaterial.cs (1)
381Debug.Assert(s_Brush == null || s_Brush.IsFrozen,
System\Windows\Media3D\Generated\EmissiveMaterial.cs (1)
353Debug.Assert(s_Brush == null || s_Brush.IsFrozen,
System\Windows\Media3D\Generated\GeneralTransform3DCollection.cs (2)
758Debug.Assert(list != null, "list may not be null."); 856Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Generated\GeneralTransform3DGroup.cs (1)
203Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media3D\Generated\MaterialCollection.cs (2)
799Debug.Assert(list != null, "list may not be null."); 897Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Generated\MaterialGroup.cs (1)
451Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media3D\Generated\MeshGeometry3D.cs (4)
422Debug.Assert(s_Positions == null || s_Positions.IsFrozen, 426Debug.Assert(s_Normals == null || s_Normals.IsFrozen, 430Debug.Assert(s_TextureCoordinates == null || s_TextureCoordinates.IsFrozen, 434Debug.Assert(s_TriangleIndices == null || s_TriangleIndices.IsFrozen,
System\Windows\Media3D\Generated\Model3D.cs (1)
351Debug.Assert(s_Transform == null || s_Transform.IsFrozen,
System\Windows\Media3D\Generated\Model3DCollection.cs (2)
799Debug.Assert(list != null, "list may not be null."); 897Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Generated\Model3DGroup.cs (1)
472Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media3D\Generated\Point3DCollection.cs (2)
782Debug.Assert(list != null, "list may not be null."); 880Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Generated\RotateTransform3D.cs (1)
428Debug.Assert(s_Rotation == null || s_Rotation.IsFrozen,
System\Windows\Media3D\Generated\SpecularMaterial.cs (1)
381Debug.Assert(s_Brush == null || s_Brush.IsFrozen,
System\Windows\Media3D\Generated\Transform3DCollection.cs (2)
799Debug.Assert(list != null, "list may not be null."); 897Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Generated\Transform3DGroup.cs (1)
451Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media3D\Generated\Vector3DCollection.cs (2)
782Debug.Assert(list != null, "list may not be null."); 880Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Geometry3D.cs (1)
80Debug.Assert(facesToHit != FaceType.None,
System\Windows\Media3D\HitTestParameters3D.cs (4)
68Debug.Assert(!HasModelTransformMatrix, 117Debug.Assert(HasWorldTransformMatrix, 150Debug.Assert(HasModelTransformMatrix, 190Debug.Assert(HasHitTestProjectionMatrix,
System\Windows\Media3D\Matrix3D.cs (4)
1228Debug.Assert(!(det < Determinant || det > Determinant), 1315Debug.Assert(!(det < Determinant || det > Determinant), 1408Debug.Assert( 1426Debug.Assert(IsDistinguishedIdentity == value,
System\Windows\Media3D\MeshGeometry3D.cs (5)
172Debug.Assert(hitTestableFaces != FaceType.None, 414Debug.Assert(!double.IsInfinity(pz / pw) && !double.IsNaN(pz / pw), 419Debug.Assert(dist > 0, "Distance is negative: " + dist); 500Debug.Assert(!double.IsInfinity(pz / pw) && !double.IsNaN(pz / pw), 536Debug.Assert(_cachedBounds.IsEmpty,
System\Windows\Media3D\Quaternion.cs (1)
538Debug.Assert(!(cosOmega < -1.0) && !(cosOmega > 1.0),
System\Windows\Media3D\Viewport2DVisual3D.cs (6)
343Debug.Assert((newValue == null || newValue.InheritanceContext == null), 352Debug.Assert((newValue == null || newValue.InheritanceContext == null), 359Debug.Assert((newValue == null || newValue.InheritanceContext == null), 777Debug.Assert( (viewport2DVisual3D.InternalBitmapCacheBrush.InternalTarget == null 786Debug.Assert( (viewport2DVisual3D.InternalBitmapCacheBrush.InternalTarget == null 806Debug.Assert((viewport2DVisual3D.Visual == null || viewport2DVisual3D.Visual.InheritanceContext == null),
System\Windows\Media3D\Viewport3DVisual.cs (4)
264Debug.Assert(!e.IsASubPropertyChange, 656Debug.Assert( 676Debug.Assert( 778Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentNodeConnected),
System\Windows\Media3D\Visual3D.cs (10)
467Debug.Assert(VisualTreeHelper.GetParent(this) != null, "If oldParent is null, current parent should != null."); 1068Debug.Assert(boundsAreEqual, errorString); 1222Debug.Assert((flags & VisualProxyFlags.IsContentNodeConnected) == 0, 1593Debug.Assert(child.InheritanceContext == this, 1845Debug.Assert(_2DParent.GetValue(this) == null, 1853Debug.Assert(parent2D == null || parent2D is Viewport3DVisual, 2059Debug.Assert(!e.CheckFlagsOr(VisualFlags.ShouldPostRender), 2061Debug.Assert(!e.CheckFlagsOr(VisualFlags.NodeIsCyclicBrushRoot), 2073Debug.Assert((viewport == null) == (e.InternalVisualParent == null), 2111Debug.Assert(_inheritanceContext.GetValue(this) == UseParentAsContext,
System\Windows\Media3D\Visual3DCollection.cs (7)
496Debug.Assert(InternalGetItem(i).ParentIndex == i - 1, 520Debug.Assert(InternalGetItem(i).ParentIndex == i + 1, 554Debug.Assert(_owner != null, "How did an Visual3DCollection get constructed without an owner?"); 562Debug.Assert(!duplicates.ContainsKey(visual), "How did the visual get re-inserted?"); 565Debug.Assert(visual.InternalVisualParent == _owner, "Why isn't our child's parent pointer the same as the collection owner?"); 566Debug.Assert(visual.ParentIndex == i, 616Debug.Assert(list != null, "list may not be null.");
System\Windows\QueryContinueDragEventArgs.cs (1)
46Debug.Assert(false, "Invalid dragDropKeyStates");
System\Windows\UIElement.cs (4)
264Debug.Assert(MeasureRequest == null, "can't be clean and still have MeasureRequest"); 297Debug.Assert(ArrangeRequest == null, "can't be clean and still have MeasureRequest"); 1893Debug.Assert(routedEvent != null, "RoutedEvent must not be null"); 1930Debug.Assert(routedEvent != null, "RoutedEvent must not be null");
PresentationFramework (1097)
MS\Internal\Annotations\Anchoring\AttachedAnnotation.cs (8)
70Debug.Assert(manager != null, "LocatorManager can not be null"); 71Debug.Assert(annotation != null, "Annotation can not be null"); 72Debug.Assert(anchor != null, "Anchor can not be null"); 73Debug.Assert(attachedAnchor != null, "AttachedAnchor can not be null"); 240Debug.Assert(attachedAnchor != null, "AttachedAnchor can not be null"); 241Debug.Assert(attachmentLevel > AttachmentLevel.Unresolved && attachmentLevel <= AttachmentLevel.Incomplete, 256Debug.Assert(_selectionProcessor != null, SR.Format(SR.NoProcessorForSelectionType, attachedAnchor.GetType())); 266Debug.Assert(_attachmentLevel != AttachmentLevel.Full, "Should only set fully resolved anchor if attachment level is not full.");
MS\Internal\Annotations\Anchoring\DataIdProcessor.cs (2)
408Debug.Assert(node != null, "DependencyObject can not be null"); 429Debug.Assert(d != null, "DependencyObject can not be null");
MS\Internal\Annotations\Anchoring\FixedPageProcessor.cs (1)
326Debug.Assert(page >= 0, "page can not be negative");
MS\Internal\Annotations\Anchoring\FixedTextSelectionProcessor.cs (2)
123Debug.Assert(numOfPages >= 0, "start page number is bigger than the end page number"); 612Debug.Assert((start != null) && (end != null), "null start/end TextPointer on a non empty page");
MS\Internal\Annotations\Anchoring\LocatorManager.cs (13)
330Debug.Assert(attachedAnchor != null, "AttachedAnchor cannot be null if attachmentLevel is not Unresolved."); 380Debug.Assert(processor != null, "SubtreeProcessor can not be null"); 658Debug.Assert(startNode != null, "startNode can not be null"); 770Debug.Assert(node != null, "node can not be null"); 837Debug.Assert(data != null, "dataBlob is either null or not of ProcessingTreeState type"); 842Debug.Assert(processor != null, "SubtreeProcessor can not be null"); // There is always a default processor 864Debug.Assert(data != null, "dataBlob is either null or not of ProcessingTreeState type"); 868Debug.Assert(processor != null, "SubtreeProcessor can not be null"); 903Debug.Assert(locator != null, "locator can not be null"); 904Debug.Assert(startNode != null, "startNode can not be null"); 940Debug.Assert(offset >= 0 && offset < realLocator.Parts.Count, "offset out of range"); 1111Debug.Assert(locator != null, "locator can not be null"); 1112Debug.Assert(data.LocatorPartIndex >= 0 && data.LocatorPartIndex < locator.Parts.Count,
MS\Internal\Annotations\Anchoring\PathNode.cs (5)
227Debug.Assert(node != null, "node can not be null"); 281Debug.Assert(node != null, "node can not be null"); 320Debug.Assert(path != null, "path can not be null"); 321Debug.Assert(branch != null, "branch can not be null"); 325Debug.Assert(path.Node.Equals(branch.Node), "path.Node is not equal to branch.Node");
MS\Internal\Annotations\Component\AdornerPresentationContext.cs (1)
439Debug.Assert((adorners != null) && (adorner != null), "null adorners list or adorner");
MS\Internal\Annotations\Component\AnnotationComponentManager.cs (9)
60Debug.Assert(attachedAnnotation != null, "AttachedAnnotation should not be null"); 77Debug.Assert(attachedAnnotation != null, "AttachedAnnotation should not be null"); 145Debug.Assert(attachedAnnotation != null, "AttachedAnnotation should not be null"); 148Debug.Assert(annotatedElement != null, "the annotatedElement should inherit from UIElement"); 168Debug.Assert(annotatedElement != null, "the annotatedElement should inherit from UIElement"); 211Debug.Assert(attachedAnnotation != null, "attachedAnnotation should not be null"); 212Debug.Assert(previousAttachedAnchor != null, "previousAttachedAnchor should not be null"); 272Debug.Assert(attachedAnnotation != null, "attachedAnnotation should not be null"); 273Debug.Assert(component != null, "component should not be null");
MS\Internal\Annotations\Component\AnnotationHighlightLayer.cs (21)
80Debug.Assert(start != null, "start pointer is null"); 81Debug.Assert(end != null, "end pointer is null"); 82Debug.Assert(start.CompareTo(end) <= 0, "end pointer before start"); 118Debug.Assert(highlightRange != null, "null range data"); 348Debug.Assert(highlightRange != null, " null highlight range"); 350Debug.Assert((rangeSegments != null) && (rangeSegments.Count > 0), "invalid rangeSegments"); 361Debug.Assert(highlightSegment != null, "null highlight segment"); 385Debug.Assert(rangeEnumerator.Current.IsNull || !next || 520Debug.Assert(false, "Mismatched segment data"); 643Debug.Assert(start != null, "start pointer is null"); 644Debug.Assert(end != null, "end pointer is null"); 645Debug.Assert(owners != null, "null owners list"); 646Debug.Assert(owners.Count > 0, "empty owners list"); 648Debug.Assert(owners[i] != null, "null owner"); 799Debug.Assert((ps1 != null) && (ps2 != null) && (ps1.CompareTo(ps2) <= 0), "invalid splitting points"); 873Debug.Assert(res.Count == 2, "unexpected resulting segment count after split"); 929Debug.Assert(textViews != null, "geometry text view not found"); 948Debug.Assert((view != null) && (parentView != null), "null text view"); 990Debug.Assert(!_segment.IsNull, "null TextSegment"); 1109Debug.Assert(TopOwner != null, "invalid TopOwner"); 1111Debug.Assert(parentView != null, "geometry parent text view not found");
MS\Internal\Annotations\Component\MarkedHighlightComponent.cs (26)
370Debug.Assert(anchor != null, "undefined anchor"); 371Debug.Assert(marker.Data != null || marker.Data == Geometry.Empty, "undefined geometry"); 375Debug.Assert(geometry != null, "unexpected geometry type"); 376Debug.Assert(geometry.Children.Count == 3, "unexpected geometry children count"); 443Debug.Assert(_uiParent != null, "No selection container"); 485Debug.Assert(textContainer != null, "TextAnchor does not belong to a TextContainer"); 633Debug.Assert(componentsRegister != null, "The selection is not registered"); 659Debug.Assert(anchor != null, "wrong attachedAnchor"); 892Debug.Assert(selection != null, "Unexpected sender of Changed event"); 902Debug.Assert(components != null, "No SN registered for this selection"); 910Debug.Assert(components[i].HighlightAnchor != null, "Missing highlight anchor component"); 931Debug.Assert(sender != null, "undefined sender"); 958Debug.Assert(pos != null, "null text pointer"); 972Debug.Assert((components != null) && (components.Count > 0), "invalid component registry"); 999Debug.Assert(selectionHandler != null, "SelectionHandler handler can not be null"); 1000Debug.Assert(mouseMoveHandler != null, "MouseMoveHandler handler can not be null"); 1013Debug.Assert(component != null, "component is null"); 1014Debug.Assert(_components != null, "_components are null"); 1048Debug.Assert(component != null, "component is null"); 1049Debug.Assert(_components != null, "_components are null"); 1104Debug.Assert(first != null, "first component is null"); 1105Debug.Assert((first.AttachedAnnotations != null) && (first.AttachedAnnotations.Count > 0), "first AttachedAnchor is null"); 1106Debug.Assert(second != null, "second component is null"); 1107Debug.Assert((second.AttachedAnnotations != null) && (second.AttachedAnnotations.Count > 0), "second AttachedAnchor is null"); 1112Debug.Assert(firstAnchor != null, " first TextAnchor is null"); 1113Debug.Assert(secondAnchor != null, " second TextAnchor is null");
MS\Internal\Annotations\Storage\StoreAnnotationsMap.cs (2)
50Debug.Assert(authorChanged != null && anchorChanged != null && cargoChanged != null, 76Debug.Assert(FindAnnotation(annotation.Id) == null, "annotation not found");
MS\Internal\AppModel\IconHelper.cs (1)
343Debug.Assert(nBytesCount > 0, "The N-Byte has to be greater than 0!");
MS\Internal\AppModel\Journaling.cs (5)
102Debug.Assert(_contentId == 0 || _contentId == value, 382Debug.Assert(endingPF.ParentPageFunctionId == Guid.Empty, 572Debug.Assert(ns != null, "Fragment navigation won't work when the INavigator doesn't have a NavigationService."); 659Debug.Assert(contentObject.GetType().AssemblyQualifiedName == this._typeName.Value, 793Debug.Assert(_markupUri != null, "_markupUri in JournalEntryPageFunctionUri should be set.");
MS\Internal\AppModel\JournalNavigationScope.cs (2)
316Debug.Assert(navigationService != null, "NavigationService cannot be null for journal navigations"); 421Debug.Assert(_journal == null && value != null,
MS\Internal\AppModel\ReturnEventSaver.cs (1)
114Debug.Assert(caller != null, "Caller should not be null");
MS\Internal\Controls\ActiveXContainer.cs (3)
67Debug.Assert(_host != null, "gotta have the avalon activex host"); 213Debug.Assert(_siteUIActive == null, "Object did not call OnUIDeactivate"); 224Debug.Assert(this.ActiveXHost == site, "deactivating when not active...");
MS\Internal\Controls\InkCanvasInnerCanvas.cs (1)
281Debug.Assert(Children.Contains(hitElement), "The hit element should be a child of InnerCanvas.");
MS\Internal\Controls\InkCanvasSelectionAdorner.cs (1)
36Debug.Assert(adornedElement is InkCanvasInnerCanvas,
MS\Internal\Controls\ModelTreeEnumerator.cs (6)
150Debug.Assert(contentControl != null, "contentControl should be non-null."); 170Debug.Assert(headeredContentControl != null, "headeredContentControl should be non-null."); 171Debug.Assert(header != null, "Header should be non-null. If Header was null, the base ContentControl enumerator should have been used."); 230Debug.Assert(headeredItemsControl != null, "headeredItemsControl should be non-null."); 231Debug.Assert(items != null, "items should be non-null."); 232Debug.Assert(header != null, "header should be non-null. If Header was null, the base ItemsControl enumerator should have been used.");
MS\Internal\Controls\StickyNote\StickyNoteAnnotations.cs (4)
732Debug.Assert(false, "The annotation data does match with the current content control in StickyNote"); 1378Debug.Assert(((IAnnotationComponent)this).AnnotatedElement != null, "undefined annotated element"); 1405Debug.Assert(adornerTransform != null, "transform to AnnotatedElement is null"); 1571Debug.Assert(_attachedAnnotation != null, "This property should never be acccessed from outside of CAF");
MS\Internal\Controls\StickyNote\StickyNoteContentControl.cs (1)
400Debug.Assert(node != null, "Try to load data from an invalid node");
MS\Internal\Controls\TemplatedAdorner.cs (3)
48Debug.Assert(adornedElement != null, "adornedElement should not be null"); 49Debug.Assert(adornerTemplate != null, "adornerTemplate should not be null"); 142Debug.Assert(_child != null, "_child should not be null");
MS\Internal\Controls\WebBrowserEvent.cs (7)
44Debug.Assert(parent != null, "WebBrowser control required for hooking webbrowser events"); 54Debug.Assert(url == null || url is string, "invalid url type"); 55Debug.Assert(targetFrameName == null || targetFrameName is string, "invalid targetFrameName type"); 56Debug.Assert(headers == null || headers is string, "invalid headers type"); 175Debug.Assert(url == null || url is string, "invalid url type"); 193Debug.Assert(psi != null, "The Document does not implement IPersistStreamInit"); 230Debug.Assert(url == null || url is string, "invalid url type");
MS\Internal\Data\BindingWorker.cs (1)
34Debug.Assert((int)Feature.LastFeatureId <= 32, "UncommonValueTable supports only 32 Ids");
MS\Internal\Data\CollectionViewGroupRoot.cs (2)
155Debug.Assert(System.Windows.Controls.ItemsControl.EqualsEx(item, ProtectedItems[index]), "RemoveSpecialItem finds inconsistent data"); 643Debug.Assert(false, "Failed to find item in expected subgroup after Move");
MS\Internal\Data\CompositeCollectionView.cs (3)
416Debug.Assert(startingIndex >= 0, "Source composite collection failed to supply an index"); 1672Debug.Assert(false, "CurrentItem is not consistent with CurrentPosition"); 1677Debug.Assert(false, "CurrentItem is not consistent with CurrentPosition");
MS\Internal\Data\DataExtensionMethods.cs (1)
38Debug.Assert(false, "Unsupported list passed to Search");
MS\Internal\Data\IndexedEnumerable.cs (2)
405Debug.Assert(false, "EnsureCacheCurrent: _enumerator.Current failed with InvalidOperationException"); 407Debug.Assert(System.Windows.Controls.ItemsControl.EqualsEx(_cachedItem, current), "EnsureCacheCurrent: _cachedItem out of sync with _enumerator.Current");
MS\Internal\Data\LiveShapingBlock.cs (1)
94Debug.Assert(index < size, "FindPosition called with item not in its block");
MS\Internal\Data\LiveShapingList.cs (1)
263Debug.Assert(sdc.Count >= _compInfos.Length, "SortDescriptions don't match LivePropertyInfos");
MS\Internal\Data\PropertyPathWorker.cs (2)
621Debug.Assert(0 <= k && k < _arySVS.Length && _arySVS[k].collectionView == collectionView, "bad parameters to UpdateSourceValueState"); 1156Debug.Assert(_dependencySourcesChanged, "Cached accessor didn't change sources");
MS\Internal\Data\RBNode.cs (4)
423Debug.Assert(successor != null && successor.Size < MaxSize, "InsertAt: successor should have room"); 444Debug.Assert(succsucc.Size == MaxSize, "InsertAt: outer nodes should be full"); 522Debug.Assert(index >= node.LeftSize + node.Size, "InsertNode: index should fall between nodes"); 575Debug.Assert(!deleteHere || node.Size == 0, "DeleteNode: Deleted node should be empty");
MS\Internal\Data\StaticPropertyChangedEventManager.cs (6)
87Debug.Assert(false, "Should never get here"); 95Debug.Assert(false, "Should never get here"); 157Debug.Assert(handler != null && type != null && propertyName != null, 182Debug.Assert(handler != null && type != null && propertyName != null, 403Debug.Assert((String)de.Key != AllListenersKey, "special key should not appear"); 491Debug.Assert(_toRemove.Count == 0, "to-remove list should be empty");
MS\Internal\Data\ValueChangedEventManager.cs (3)
193Debug.Assert(_toRemove.Count == 0, "to-remove list should be empty"); 301Debug.Assert(listener != null && source != null && pd != null, 309Debug.Assert(listener != null && source != null && pd != null,
MS\Internal\Data\ViewManager.cs (1)
240Debug.Assert(cvs != null, "Required CVS key is missing");
MS\Internal\Data\XDeferredAxisSource.cs (1)
80Debug.Assert(aryMembers.Length == 1, "XLinq changed XDeferredAxis to have more than one indexer");
MS\Internal\Documents\Application\DocumentApplicationJournalEntry.cs (1)
75Debug.Assert(docViewer != null, "PUIDocumentApplicationDocumentViewer not found.");
MS\Internal\Documents\HostedElements.cs (1)
197Debug.Assert(false, "Invalid state in HostedElements.cs");
MS\Internal\Documents\PageCache.cs (1)
740Debug.Assert(changes != null, "Attempt to fire PageCacheChangedEvent with null change set.");
MS\Internal\Documents\RowCache.cs (1)
1062Debug.Assert(false, "Requested to update a non-existent row.");
MS\Internal\Documents\TableTextElementCollectionInternal.cs (1)
346Debug.Assert(false, "Garbage in logical tree.");
MS\Internal\Documents\TextBoxView.cs (1)
1223System.Diagnostics.Debug.Assert(_host != null && _host.TextContainer != null && _host.TextContainer.Highlights != null,
MS\Internal\Documents\TextParagraphView.cs (1)
329Debug.Assert(lines != null && lines.Count > 0, "Line array is empty.");
MS\Internal\Globalization\BamlResourceSerializer.cs (2)
60Debug.Assert(output != null, "The output stream given is null"); 61Debug.Assert(tree != null && tree.Root != null, "The tree to be serialized is null.");
MS\Internal\Globalization\BamlTreeMap.cs (2)
51Debug.Assert(tree != null, "Baml Tree is empty"); 52Debug.Assert(localizer != null, "BamlLocalizer is null");
MS\Internal\Globalization\BamlTreeNode.cs (2)
43Debug.Assert(root != null, "Baml tree root is null!"); 44Debug.Assert(size > 0, "Baml tree size is less than 1");
MS\Internal\Globalization\BamlTreeUpdater.cs (3)
34Debug.Assert(tree != null && tree.Root != null, "Empty Tree!"); 35Debug.Assert(treeMap != null, "Empty map!"); 36Debug.Assert(dictionary != null, "Empty dictionary");
MS\Internal\Globalization\LocalizableResourceBuilder.cs (1)
518Debug.Assert(false, "Can't process localizability attribute on nodes other than Element, Property and LiteralContent.");
MS\Internal\Helper.cs (5)
604Debug.Assert(targetDependencyObject != null, "DependencyProperties can only be set on DependencyObjects"); 650Debug.Assert(targetMember is PropertyInfo || targetMember is MethodInfo, 663Debug.Assert(parameterInfos.Length == 2, "The signature of a static settor must contain two parameters"); 1264Debug.Assert(virtualizingElement != null, "Must have a virtualizingElement to clear"); 1342Debug.Assert(VisualTreeHelper.IsAncestorOf(pathEndElement, pathStartElement), "pathEndElement should be an ancestor of pathStartElement");
MS\Internal\Ink\ClipboardProcessor.cs (1)
175Debug.Assert(false , "CopySelectData: InkCanvas should have a selection!");
MS\Internal\Ink\EditingCoordinator.cs (19)
88Debug.Assert(ActiveEditingBehavior == SelectionEditor, 181Debug.Assert(currentBehavior is StylusEditingBehavior, 203Debug.Assert(currentBehavior is StylusEditingBehavior, 317Debug.Assert(_activationStack.Count == 1, "The behavior stack has to contain one behavior."); 373Debug.Assert(behavior == LassoSelectionBehavior || behavior == SelectionEditingBehavior, 384Debug.Assert(behavior != LassoSelectionBehavior && behavior != SelectionEditingBehavior, 453Debug.Assert((_capturedStylus != null && _capturedMouse == null) 787Debug.Assert(stylusEditingBehavior != null || ActiveEditingBehavior == null, 870Debug.Assert(ActiveEditingBehavior == null || ActiveEditingBehavior is IStylusEditing, 942Debug.Assert(inputDevice != null, "A null device is passed in."); 943Debug.Assert(stylusEditingBehavior != null, "stylusEditingBehavior cannot be null."); 944Debug.Assert(!IsInMidStroke, "The previous device hasn't been released yet."); 992Debug.Assert(!resetDynamicRenderer, "The dynamic renderer shouldn't be reset for Mouse"); 1028Debug.Assert(IsInMidStroke || !releaseDevice, "The captured device has been release unexpectly."); 1070Debug.Assert(_capturedStylus == null || _capturedMouse == null, "InkCanvas cannot capture both stylus and mouse at the same time."); 1203Debug.Assert(false, "Unknown behavior"); 1240Debug.Assert(false, "Unknown behavior"); 1248Debug.Assert(!IsInMidStroke, "ChangeEditingBehavior cannot be called in a mid-stroke"); 1249Debug.Assert(_activationStack.Count <= 1, "The behavior stack has to contain at most one behavior when user is not editing.");
MS\Internal\Ink\EraserBehavior.cs (5)
91Debug.Assert(EditingCoordinator.IsInMidStroke, "SwitchToMode should only be called in a mid-stroke"); 154Debug.Assert(false, "Unknown InkCanvasEditingMode!"); 187Debug.Assert(_cachedPointEraserCursor != null, "_cachedPointEraserCursor shouldn't be null."); 393Debug.Assert(null != e.HitStroke, "e.HitStroke cannot be null"); 409Debug.Assert(eraseResult != null, "eraseResult cannot be null");
MS\Internal\Ink\InkCanvasSelection.cs (9)
143Debug.Assert(activeSelectionHitResult != InkCanvasSelectionHitResult.None, "activeSelectionHitResult cannot be InkCanvasSelectionHitResult.None."); 153Debug.Assert(VisualTreeHelper.GetParent(feedbackAdorner) == null, 168Debug.Assert(VisualTreeHelper.GetParent(_inkCanvas.FeedbackAdorner) 186Debug.Assert(VisualTreeHelper.GetParent(feedbackAdorner) == adornerLayer, 493Debug.Assert(false, "The updatedElement has to be the same type as the originalElement."); 613Debug.Assert(false, "An unexpected single selected Element"); 774Debug.Assert( SelectedElements.Count != 0, 892Debug.Assert(_inkCanvas.SelectionAdorner.Visibility == Visibility.Visible, 899Debug.Assert(_inkCanvas.SelectionAdorner.Visibility == Visibility.Collapsed,
MS\Internal\Ink\InkCollectionBehavior.cs (3)
114Debug.Assert(EditingCoordinator.IsInMidStroke, "SwitchToMode should only be called in a mid-stroke"); 173Debug.Assert(false, "Unknown InkCanvasEditingMode!"); 301Debug.Assert(_strokeDrawingAttributes != null, "_strokeDrawingAttributes can not be null, did we not see a down?");
MS\Internal\Ink\LassoSelectionBehavior.cs (5)
77Debug.Assert(EditingCoordinator.IsInMidStroke, "SwitchToMode should only be called in a mid-stroke"); 105Debug.Assert(false, "Cannot switch from Select to Select in mid-stroke"); 118Debug.Assert(false, "Unknown InkCanvasEditingMode!"); 130Debug.Assert(stylusPoints.Count != 0, "An empty stylusPoints has been passed in."); 596Debug.Assert(!_disableLasso && _lassoHelper == null, "StartLasso is called unexpectedly.");
MS\Internal\Ink\PenCursorManager.cs (2)
64Debug.Assert(DoubleUtil.IsZero(tranform.OffsetX) && DoubleUtil.IsZero(tranform.OffsetY), "The EraserShape cannot be translated."); 65Debug.Assert(tranform.HasInverse, "The transform has to be invertable.");
MS\Internal\Ink\SelectionEditingBehavior.cs (1)
389Debug.Assert(EditingCoordinator.UserIsEditing == false, "Unexpect UserIsEditng state." );
MS\Internal\IO\Packaging\ManagedFilter.cs (2)
72System.Diagnostics.Debug.Assert(_propType == PropSpecType.Name, "ManagedPropSpec.PropName - PropName only meaningful if PropType is type string"); 93System.Diagnostics.Debug.Assert(_propType == PropSpecType.Id, "ManagedPropSpec.PropId - PropId only meaningful if PropType is numeric");
MS\Internal\LayoutDump.cs (5)
466Debug.Assert(dpv != null, "Dump function has to match element type."); 482Debug.Assert(text != null, "Dump function has to match element type."); 515Debug.Assert(fdsv != null, "Dump function has to match element type."); 541Debug.Assert(fdView != null, "Dump function has to match element type."); 581Debug.Assert(flowDocumentPage != null, "Dump function has to match page type.");
MS\Internal\Navigation\JournalEntryStack.cs (1)
127Debug.Assert(_current != null, "If we are returning true, our current cannot be null");
MS\Internal\PtsHost\CellParagraph.cs (3)
69Debug.Assert(Cell.Index != -1 && Cell.ColumnIndex != -1, 141Debug.Assert(Cell.Index != -1 && Cell.ColumnIndex != -1, 170Debug.Assert(Cell.Index != -1 && Cell.ColumnIndex != -1,
MS\Internal\PtsHost\ErrorHandler.cs (2)
28System.Diagnostics.Debug.Assert(false, message); 42System.Diagnostics.Debug.Assert(false, message);
MS\Internal\PtsHost\FigureParagraph.cs (1)
317Debug.Assert(false, "Tight wrap is not currently supported.");
MS\Internal\PtsHost\FloaterBaseParagraph.cs (1)
126Debug.Assert(false, "Tight wrap is not currently supported.");
MS\Internal\PtsHost\FloaterParagraph.cs (1)
822Debug.Assert(false, "Unknown type of anchor.");
MS\Internal\PtsHost\Line.cs (4)
73Debug.Assert(_line != null, "Line has been already disposed."); 362Debug.Assert(!double.IsNaN(_trackWidth), "Track width must be set for measure pass."); 422Debug.Assert(DoubleUtil.GreaterThanOrClose(rect.Width, 0), "Negative inline object's width."); 1024Debug.Assert(runBounds.Count == 1, "Expecting exactly one TextRunBounds for a single text position.");
MS\Internal\PtsHost\LineBase.cs (2)
146Debug.Assert(element != null, "Cannot use ITextContainer that does not provide TextElement instances."); 268Debug.Assert(element != null, "Element should be here.");
MS\Internal\PtsHost\Pts.cs (3)
62Debug.Assert(ptsContext != null, "Null argument 'ptsContext' - required for return value validation."); 97Debug.Assert(ptsContext != null, "Null argument 'ptsContext' - required for return value validation."); 214Debug.Assert(false, "Unknown WrapDirection value.");
MS\Internal\PtsHost\PtsHelper.cs (1)
903Debug.Assert(cColumns > 0, "At least one column is required.");
MS\Internal\PtsHost\PtsHost.cs (19)
584Debug.Assert(false, "PTS.GetSegmentDefinedColumnSpanAreaInfo is not implemented."); 596Debug.Assert(false, "PTS.GetHeightDefinedColumnSpanAreaInfo is not implemented."); 884Debug.Assert(false, "PTS.GetNumberEndnoteColumns is not implemented."); 896Debug.Assert(false, "PTS.GetEndnoteColumnInfo is not implemented."); 907Debug.Assert(false, "PTS.GetFootnoteSeparators is not implemented."); 916Debug.Assert(false, "PTS.FFootnoteBeneathText is not implemented."); 925Debug.Assert(false, "PTS.GetNumberFootnoteColumns is not implemented."); 937Debug.Assert(false, "PTS.GetFootnoteColumnInfo is not implemented."); 946Debug.Assert(false, "PTS.GetFootnoteSegment is not implemented."); 960Debug.Assert(false, "PTS.GetFootnotePresentationAndRejectionOrder is not implemented."); 969Debug.Assert(false, "PTS.FAllowFootnoteSeparation is not implemented."); 1267Debug.Assert(false, "PTS.GetFootnotes is not implemented."); 1286Debug.Assert(false, "PTS.FormatDropCap is not implemented."); 1304Debug.Assert(false, "PTS.GetDropCapPolygons is not implemented."); 1312Debug.Assert(false, "PTS.DestroyDropCap is not implemented."); 1724Debug.Assert(false, "PTS.SnapGridVertical is not implemented."); 1825Debug.Assert(false, "PTS.UpdGetDropCapChange is not implemented."); 1926Debug.Assert(false, "PTS.GetOptimalLineDcpCache is not implemented."); 2956Debug.Assert(false, "PTS.ObjGetFootnoteInfo is not implemented.");
MS\Internal\PtsHost\PtsPage.cs (1)
172Debug.Assert(breakRecord == null || !_section.StructuralCache.DestroyStructure, "Cannot format from dirty break record unless StructuralCache.DestroyStructure is not set.");
MS\Internal\PtsHost\SubpageParagraph.cs (1)
201Debug.Assert(fSuppressTopSpace == 1, "Top space should be always suppressed at the top of broken paragraph.");
MS\Internal\PtsHost\TableParaClient.cs (2)
1979Debug.Assert(false, "Unsupported unit type"); 2047Debug.Assert(_calculatedColumns[i].UserWidth.GridUnitType == GridUnitType.Auto || _calculatedColumns[i].UserWidth.GridUnitType == GridUnitType.Star || _calculatedColumns[i].UserWidth.GridUnitType == GridUnitType.Pixel, "Unexpected GridUnitType");
MS\Internal\PtsHost\TableParagraph.cs (2)
332Debug.Assert(currentRowGroup.Rows[nextRowIndex].Index != -1, 349Debug.Assert(Rows[0].Index != -1,
MS\Internal\PtsHost\TextFormatterHost.cs (6)
43Debug.Assert(Context != null, "TextFormatter host is not initialized."); 44Debug.Assert(textSourceCharacterIndex >= 0, "Character index must be non-negative."); 59Debug.Assert(Context != null, "TextFormatter host is not initialized."); 60Debug.Assert(textSourceCharacterIndexLimit >= 0, "Character index must be non-negative."); 73Debug.Assert(Context != null, "TextFormatter host is not initialized."); 74Debug.Assert(textSourceCharacterIndex>= 0, "Character index must be non-negative.");
MS\Internal\PtsHost\TextParaClient.cs (10)
138Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 236Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 325Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 378Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 720Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 801Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 864Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 914Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 1071Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 1373Debug.Assert(false, "Should not get here. ParaCache is not currently used.");
MS\Internal\SystemDataHelper.cs (1)
86Debug.Assert(false, "Could not find Null field or property for SqlNullable type");
MS\Internal\Text\ComplexLine.cs (11)
69Debug.Assert(run != null, "TextRun has not been created."); 70Debug.Assert(run.Length > 0, "TextRun has to have positive length."); 160Debug.Assert(runs != null, "Cannot retrieve runs collection."); 183Debug.Assert(DoubleUtil.GreaterThanOrClose(rect.Width, 0), "Negative inline object's width."); 235Debug.Assert(runs != null, "Cannot retrieve runs collection."); 339Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text, "TextPointer does not point to characters."); 386Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart, "TextPointer does not point to element start edge."); 391Debug.Assert(element != null, "Cannot use ITextContainer that does not provide TextElement instances."); 477Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd, "TextPointer does not point to element end edge."); 482Debug.Assert(element != null, "Element should be here."); 527Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.EmbeddedElement, "TextPointer does not point to embedded object.");
MS\Internal\Text\Line.cs (7)
116Debug.Assert(_line != null, "Rendering line that has not been measured yet."); 123Debug.Assert(line.HasCollapsed, "Line has not been collapsed"); 316Debug.Assert(collapsedLine.HasCollapsed, "Line has not been collapsed"); 320Debug.Assert(collapsedRanges.Count == 1, "Multiple collapsed ranges are not supported."); 352Debug.Assert(collapsedLine.HasCollapsed, "Line has not been collapsed"); 483Debug.Assert(runBounds.Count == 1, "Expecting exactly one TextRunBounds for a single text position."); 506Debug.Assert(paraProperties.TextTrimming != TextTrimming.None, "Text trimming must be enabled.");
MS\Internal\Text\SimpleLine.cs (2)
39Debug.Assert(dcp >= 0, "Character index must be non-negative."); 79Debug.Assert(dcp >= 0, "Character index must be non-negative.");
MS\Internal\Text\TypographyProperties.cs (2)
779Debug.Assert((uint)propertyId < (uint)PropertyId.PropertyCount, "Invalid typography property id"); 795Debug.Assert((uint)propertyId < (uint)PropertyId.PropertyCount, "Invalid typography property id");
MS\Internal\WeakHashtable.cs (1)
56Debug.Assert(!key.GetType().IsValueType, "WeakHashtable doesn't support value-type keys. Use WeakObjectHashtable instead.");
MS\Win32\UxThemeWrapper.cs (1)
405Debug.Assert(themeState.IsActive, "Queried ThemeColor while UxTheme is not active.");
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Context\XamlFrame.cs (1)
46Debug.Assert(_depth != -1, "Context Frame is uninitialized");
System\Windows\Annotations\AnnotationHelper.cs (1)
639Debug.Assert((textSegments != null) && (textSegments.Count > 0), "Invalid selection TextSegments");
System\Windows\Annotations\Storage\XmlStreamStore.cs (2)
843Debug.Assert(knownNamespace != null, "null knownNamespace"); 862Debug.Assert(name != null, "null compatible namespace");
System\Windows\Application.cs (6)
122Debug.Assert(_appInstance == null, "_appInstance must be null here."); 551Debug.Assert(stream != null, "stream should not be null."); 552Debug.Assert(pc != null, "pc should not be null."); 735Debug.Assert( ((stream != null) && (sooPart == null)) != true, "When stream is not null, sooPart cannot be null either"); 1486Debug.Assert(CheckAccess(), "This should only be called on the Application thread"); 1545Debug.Assert(CheckAccess() == true, "DoShutdown can only be called on the Dispatcer thread");
System\Windows\Automation\Peers\ItemAutomationPeer.cs (1)
707System.Diagnostics.Debug.Assert(Object.Equals(item, Item), "ItemPeer reuse for an unequal item is not supported");
System\Windows\Automation\Peers\ItemsControlAutomationPeer.cs (1)
643Debug.Assert(false,"it must not add already present Item");
System\Windows\BroadcastEventHelper.cs (2)
172Debug.Assert(loadedPending != null && loadedPending.Length == 3, 209Debug.Assert(unloadedPending != null && unloadedPending.Length == 3,
System\Windows\Controls\AVElementHelper.cs (1)
60Debug.Assert((element != null), "Element is null");
System\Windows\Controls\ComboBox.cs (4)
1213Debug.Assert(_autoScrollTimer == null, "IsMouseCaptured went from true to true"); 1573Debug.Assert((increment > 0 && startIndex <= stopIndex) || (increment < 0 && startIndex >= stopIndex), "Infinite loop detected"); 1735Debug.Assert(!comboBox.CheckAccess() || Mouse.Captured != comboBox, "On the dispatcher thread, ComboBox should not have capture after closing the dropdown"); 1783Debug.Assert(!CheckAccess() || Mouse.Captured != this, "On the dispatcher thread, ComboBox should not have capture after closing the dropdown");
System\Windows\Controls\ContainerTracking.cs (2)
111Debug.Assert(IsInList(root), "This container should be in the tracking list."); 122Debug.Assert(!IsInList(root), "This container shouldn't be in our tracking list");
System\Windows\Controls\ContextMenu.cs (1)
489Debug.Assert(_parentPopup == null, "_parentPopup should be null");
System\Windows\Controls\DataGrid.cs (14)
1649Debug.Assert(info != null, "info is null."); 1650Debug.Assert(column != null, "column is null."); 1759Debug.Assert(_isDraggingSelection, "DoAutoScroll should only be called when dragging selection."); 3569Debug.Assert(CanUserAddRows, "AddNewItem called when the end-user cannot add new rows."); 3570Debug.Assert(!IsAddingNewItem, "AddNewItem called when a pending add is taking place."); 6417Debug.Assert(RelativeMousePosition != RelativeMousePositions.Over, "The mouse is not supposed to be over the DataGrid."); 7136Debug.Assert(sortColumn != null, "column should not be null"); 7294Debug.Assert(e.NewItems.Count == 1, "SortDescriptionCollection should handle one element at a time"); 7305Debug.Assert(e.OldItems.Count == 1, "SortDescriptionCollection should handle one element at a time"); 7325Debug.Assert(e.OldItems.Count == 1 && e.NewItems.Count == 1, "SortDescriptionCollection should handle one element at a time"); 7439Debug.Assert(e.NewItems.Count == 1, "GroupDescriptionCollection should handle one element at a time"); 7447Debug.Assert(e.OldItems.Count == 1, "GroupDescriptionCollection should handle one element at a time"); 7458Debug.Assert(e.OldItems.Count == 1 && e.NewItems.Count == 1, "GroupDescriptionCollection should handle one element at a time"); 7881Debug.Assert(dataGrid != null || columnCollection != null, "Both dataGrid and columnCollection cannot not be null at the same time");
System\Windows\Controls\DataGridAutoGeneratingColumnEventArgs.cs (1)
110Debug.Assert(
System\Windows\Controls\DataGridCell.cs (5)
97Debug.Assert(_owner == null || _owner == ownerRow, "_owner should be null before PrepareCell is called or the same value as the ownerRow."); 145Debug.Assert(_owner == ownerRow, "_owner should be the same as the DataGridRow that is clearing the cell."); 584Debug.Assert(!IsEditing, "Should not call BeginEdit when IsEditing is true."); 600Debug.Assert(IsEditing, "Should not call CancelEdit when IsEditing is false."); 614Debug.Assert(IsEditing, "Should not call CommitEdit when IsEditing is false.");
System\Windows\Controls\DataGridCellInfo.cs (9)
59Debug.Assert(item != null, "item should not be null."); 60Debug.Assert(column != null, "column should not be null."); 61Debug.Assert(owner != null, "owner should not be null."); 70Debug.Assert(info != null, "item should not be null."); 71Debug.Assert(column != null, "column should not be null."); 72Debug.Assert(owner != null, "owner should not be null."); 84Debug.Assert(item == DependencyProperty.UnsetValue, "This should only be used to make an Unset CellInfo."); 110Debug.Assert(owner != null, "owner should not be null."); 122Debug.Assert(owner != null, "owner should not be null.");
System\Windows\Controls\DataGridCellsPanel.cs (17)
172Debug.Assert(blockList != null, "RealizedColumnsBlockList shouldn't be null at this point."); 639Debug.Assert(!children.Contains(child), "we incorrectly identified a recycled container"); 654Debug.Assert(child == InternalChildren[childIndex], "Wrong child was generated"); 684Debug.Assert(container != null, "Null container was generated"); 720Debug.Assert(children[visualTreeIndex] != null, "MoveVisualChild interprets a null destination as 'move to end'"); 781Debug.Assert(false, "We should have found a child"); 1076Debug.Assert(columnIndex < columnCount, "columnIndex should be less than column count"); 1152Debug.Assert(children == _realizedChildren, "the given child list must be the _realizedChildren list when recycling"); 1343Debug.Assert( 1349Debug.Assert( 1426Debug.Assert(i >= arrangeState.FrozenColumnCount, "Frozen cells should have been realized or not visible"); 1460Debug.Assert(child != null, "child cannot be null."); 1475Debug.Assert(cell.Column != null, "column cannot be null."); 1580Debug.Assert(children.Count > blockElementCount, "Element count from blocks can't be less than total children count"); 1621Debug.Assert(columnIndex <= block.EndIndex, "Missing children for index in block list"); 1983Debug.Assert(ParentDataGrid != null, "ParentDataGrid should not be null"); 2101Debug.Assert((itemCount == itemUICount) || (itemUICount == 0), "Both ItemUICount and ItemCount should be equal or ItemUICount should be 0.");
System\Windows\Controls\DataGridColumn.cs (2)
902Debug.Assert(d is DataGridColumn, "d should be a DataGridColumn"); 1157Debug.Assert(itemProperty != null && itemProperty.PropertyType != null, "itemProperty and/or its PropertyType member cannot be null");
System\Windows\Controls\DataGridColumnCollection.cs (16)
25Debug.Assert(dataGridOwner != null, "We should have a valid DataGrid"); 232Debug.Assert(displayIndex >= 0 && displayIndex < DisplayIndexMap.Count, "displayIndex should have already been validated"); 330Debug.Assert(newDisplayIndex >= 0 && newDisplayIndex < Count, "The new DisplayIndex should have already been validated"); 363Debug.Assert(oldDisplayIndex != newDisplayIndex, "A column's display index must have changed for us to call OnColumnDisplayIndexChanged"); 364Debug.Assert(oldDisplayIndex >= 0 && oldDisplayIndex < Count, "The old DisplayIndex should be valid"); 415Debug.Assert( 418Debug.Assert(IsUpdatingDisplayIndex == false, "We don't add new columns as part of a display index update operation"); 475Debug.Assert(DisplayIndexMap.Count == 0, "DisplayIndexMap should be empty until first measure call."); 559Debug.Assert( 562Debug.Assert(IsUpdatingDisplayIndex == false, "We don't remove columns as part of a display index update operation"); 567Debug.Assert(DisplayIndexMap.Count > Count, "Columns were just removed: the display index map shouldn't have yet been updated"); 603Debug.Assert(oldColumns.Count == 1 && newColumns.Count == 1, "Multi replace isn't possible with ObservableCollection"); 731Debug.Assert(Count == DisplayIndexMap.Count, "Display Index map is of the wrong size"); 734Debug.Assert(DisplayIndexMap[i] >= 0 && DisplayIndexMap[i] < Count, "DisplayIndex map entry doesn't point to a valid column"); 735Debug.Assert(ColumnFromDisplayIndex(i).DisplayIndex == i, "DisplayIndex map doesn't match column indices"); 902Debug.Assert(
System\Windows\Controls\DataGridColumnHeaderCollection.cs (1)
50Debug.Assert(e.Property == DataGridColumn.HeaderProperty, "We only want to know about the header property changing");
System\Windows\Controls\DataGridHelper.cs (2)
243Debug.Assert((cell is DataGridCell) || (cell is DataGridColumnHeader), "provideColumn should be one of the cell or header containers."); 307Debug.Assert((cell is DataGridCell) || (cell is DataGridColumnHeader), "provideColumn should be one of the cell or header containers.");
System\Windows\Controls\DataGridHyperlinkColumn.cs (1)
294Debug.Assert(e.RoutedEvent == Keyboard.PreviewKeyDownEvent, "We should only reach here on the PreviewKeyDown event because the TextBox within is expected to handle the preview event and hence trump the successive KeyDown event.");
System\Windows\Controls\DataGridLengthConverter.cs (1)
266Debug.Assert(
System\Windows\Controls\DataGridRow.cs (2)
443Debug.Assert(_owner == null || _owner == owningDataGrid, "_owner should be null before PrepareRow is called or the same as the owningDataGrid."); 484Debug.Assert(_owner == owningDataGrid, "_owner should be the same as the DataGrid that is clearing the row.");
System\Windows\Controls\DataGridTextColumn.cs (1)
272Debug.Assert(e.RoutedEvent == Keyboard.PreviewKeyDownEvent, "We should only reach here on the PreviewKeyDown event because the TextBox within is expected to handle the preview event and hence trump the successive KeyDown event.");
System\Windows\Controls\Grid.cs (1)
2386Debug.Assert(!def.IsShared, "*-defs cannot be shared");
System\Windows\Controls\GridSplitter.cs (2)
635Debug.Assert(_resizeData == null, "_resizeData is not null, DragCompleted was not called"); 869Debug.Assert(_resizeData != null, "_resizeData should not be null when calling MoveSplitter");
System\Windows\Controls\GridViewColumn.cs (1)
426Debug.Assert(false, "Invalid value for ActualWidth.");
System\Windows\Controls\GridViewColumnCollection.cs (3)
144Debug.Assert(IsImmutable != true, "IsImmutable is true before BlockWrite"); 153Debug.Assert(IsImmutable != false, "IsImmutable is flase before UnblockWrite"); 244Debug.Assert(oldIndex != newIndex, "oldIndex==newIndex when perform move action.");
System\Windows\Controls\GridViewColumnCollectionChangedEventArgs.cs (12)
48Debug.Assert(action == NotifyCollectionChangedAction.Add || action == NotifyCollectionChangedAction.Remove, 50Debug.Assert(changedItem != null, "changedItem can't be null"); 51Debug.Assert(index >= 0, "index must >= 0"); 52Debug.Assert(actualIndex >= 0, "actualIndex must >= 0"); 63Debug.Assert(newItem != null, "newItem can't be null"); 64Debug.Assert(oldItem != null, "oldItem can't be null"); 65Debug.Assert(index >= 0, "index must >= 0"); 66Debug.Assert(actualIndex >= 0, "actualIndex must >= 0"); 77Debug.Assert(changedItem != null, "changedItem can't be null"); 78Debug.Assert(index >= 0, "index must >= 0"); 79Debug.Assert(oldIndex >= 0, "oldIndex must >= 0"); 80Debug.Assert(actualIndex >= 0, "actualIndex must >= 0");
System\Windows\Controls\GridViewColumnHeader.cs (4)
294Debug.Assert(false, "Method ShouldSerializeProperty is called on an internally generated GridViewColumnHeader."); 431Debug.Assert(flag != Flags.None && ignoreFlag != Flags.None, "Invalid parameter dp."); 772Debug.Assert(stream != null, "stream is null"); 796Debug.Assert(gripperCursor != null, "gripper cursor is null");
System\Windows\Controls\GridViewHeaderRowPresenter.cs (12)
304Debug.Assert(_paddingHeader != null, "padding header is null"); 314Debug.Assert(_indicator != null, "_indicator is null"); 315Debug.Assert(_floatingHeader != null, "_floatingHeader is null"); 388Debug.Assert(_paddingHeader != null, "padding header is null"); 457Debug.Assert(_draggingSrcHeader != null, "_draggingSrcHeader is null"); 858Debug.Assert(index >= 0 && index < InternalChildren.Count, "Error index when GetVisualIndex"); 941Debug.Assert(false, "Head is container for itself, but parent is neither GridViewHeaderRowPresenter nor null."); 1192Debug.Assert(header != null, "Cannot instantiate GridViewColumnHeader in AddFloatingHeader"); 1205Debug.Assert(srcHeader != null, "srcHeader is null"); 1206Debug.Assert(_floatingHeader != null, "floating header is null"); 1372Debug.Assert(index >= 0 && index < HeadersPositionList.Count, "wrong index"); 1565Debug.Assert(Columns != null, "Columns is null in OnHeaderDragCompleted");
System\Windows\Controls\GridViewRowPresenter.cs (2)
579Debug.Assert(column != null, "column shouldn't be null"); 656Debug.Assert(cell is TextBlock, "cells are either TextBlocks or ContentPresenters");
System\Windows\Controls\InkCanvas.cs (14)
578Debug.Assert(e.Property == InkCanvas.RightProperty || e.Property == InkCanvas.BottomProperty, 1042Debug.Assert(e != null, "EventArg can not be null"); 1261Debug.Assert(e != null, "EventArg can not be null"); 1318Debug.Assert(e != null, "EventArg can not be null"); 1372Debug.Assert(e != null, "EventArg can not be null"); 1406Debug.Assert(e != null, "EventArg can not be null"); 1437Debug.Assert(e != null, "EventArg can not be null"); 1473Debug.Assert(e != null, "EventArg can not be null"); 1549Debug.Assert(e != null, "EventArg can not be null"); 1579Debug.Assert(e != null, "EventArg can not be null"); 1613Debug.Assert(e != null, "EventArg can not be null"); 1643Debug.Assert(e != null, "EventArg can not be null"); 2336Debug.Assert(strokes != null 2663Debug.Assert(removeSelectedStrokes || removeSelectedElements, "At least either Strokes or Elements should be removed!");
System\Windows\Controls\InkPresenter.cs (2)
460Debug.Assert(newStrokes != null, "Cannot set a null to InkPresenter"); 491Debug.Assert(addedStrokes != null, "The added StrokeCollection cannot be null.");
System\Windows\Controls\ItemCollection.cs (5)
2305Debug.Assert(IsShapingActive, "Shaping storage not available"); 2342Debug.Assert(!value, "Shaping storage not available"); 2374Debug.Assert(IsShapingActive, "Shaping storage not available"); 2407Debug.Assert(IsShapingActive, "Shaping storage not available"); 2440Debug.Assert(IsShapingActive, "Shaping storage not available");
System\Windows\Controls\ItemContainerGenerator.cs (9)
286Debug.Assert(false, "Unexpected reentrant call to ICG.Remove"); 332Debug.Assert(!_recyclableContainers.Contains(container), "trying to add a container to the collection twice"); 937Debug.Assert(item == null || ItemsControl.EqualsEx(item, target), 2217Debug.Assert(ItemsControl.EqualsEx(rib.ItemAt(rib.ContainerCount - 1), 2283Debug.Assert(!container.HasExpression(entryIndex, dp), "DataContext set by expression (unexpectedly)"); 2348Debug.Assert(!container.HasExpression(entryIndex, dp), "DataContext set by expression (unexpectedly)"); 2381Debug.Assert(ItemsControl.EqualsEx(item, ItemsInternal[index]), "Event contains the wrong index"); 2456Debug.Assert(false, "unexpected reentrant call to OnItemAdded"); 2644Debug.Assert(false, "unexpected reentrant call to OnItemMoved");
System\Windows\Controls\ItemsControl.cs (3)
2630Debug.Assert(ScrollHost != null, "This operation to adjust the offset along an edge is only possible when there is a ScrollHost available"); 2791Debug.Assert(direction == FocusNavigationDirection.Up || direction == FocusNavigationDirection.Down, "Can only get the first item on a page using North or South"); 3105Debug.Assert(element != viewPort && element.IsArrangeValid && parent != null, "GetElementViewportPosition called in unsupported situation");
System\Windows\Controls\ListBox.cs (1)
623Debug.Assert(_autoScrollTimer == null, "IsMouseCaptured went from true to true");
System\Windows\Controls\MenuItem.cs (6)
1755Debug.Assert(IsSelected, "When IsSubmenuOpen = true, IsSelected should be true as well"); 1937Debug.Assert(IsHighlighted, "MenuItem got Key.Enter but was not highlighted -- focus did not follow highlight?"); 2200Debug.Assert(Role == MenuItemRole.TopLevelHeader || Role == MenuItemRole.TopLevelItem, "MenuItem was not top-level"); 2240Debug.Assert(!parentMenu.OpenOnMouseEnter || parentMenu.IsMenuMode, "OpenOnMouseEnter can only be true when IsMenuMode is true"); 2589Debug.Assert(timer != null, "timer should not be null."); 2590Debug.Assert(!timer.IsEnabled, "timer should not be running.");
System\Windows\Controls\MultipleCopiesCollection.cs (9)
32Debug.Assert(item != null, "item should not be null."); 33Debug.Assert(count >= 0, "count should not be negative."); 53Debug.Assert( 60Debug.Assert( 67Debug.Assert( 74Debug.Assert( 119Debug.Assert(RepeatCount == newCount, "We should have properly updated the RepeatCount"); 202Debug.Assert((index >= 0) && (index < RepeatCount), "Index out of range"); 288Debug.Assert(_item != null, "_item should be non-null.");
System\Windows\Controls\Page.cs (2)
749Debug.Assert( p != null, "DependencyObject must be of type Page." ); 794Debug.Assert(_currentIws != null, "_currentIws cannot be null here. Caller should always verify it");
System\Windows\Controls\Panel.cs (9)
576Debug.Assert(_itemContainerGenerator == null, "Attempted to connect to a generator when Panel._itemContainerGenerator is non-null."); 599Debug.Assert(_itemContainerGenerator != null, "Attempted to disconnect from a generator when Panel._itemContainerGenerator is null."); 620Debug.Assert(IsItemsHost, "Should be invoked only on an ItemsHost panel"); 680Debug.Assert(_itemContainerGenerator != null, "Encountered a null _itemContainerGenerator while receiving an ItemsChanged from a generator."); 719Debug.Assert(_itemContainerGenerator != null, "Encountered a null _itemContainerGenerator while receiving an Add action from a generator."); 748Debug.Assert(itemCount == containerCount, "Panel expects Replace to affect only realized containers"); 749Debug.Assert(_itemContainerGenerator != null, "Encountered a null _itemContainerGenerator while receiving an Replace action from a generator."); 759Debug.Assert(e != null && !isNewlyRealized, "Panel expects Replace to affect only realized containers"); 778Debug.Assert(_itemContainerGenerator != null, "Encountered a null _itemContainerGenerator while receiving an Move action from a generator.");
System\Windows\Controls\PasswordTextNavigator.cs (8)
32Debug.Assert(offset >= 0 && offset <= container.SymbolCount, "Bad PasswordTextPointer offset!"); 56Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 427Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 468Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 474Debug.Assert(false, "Bad distance!"); 494Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 512Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 513Debug.Assert(false, "No scoping element!");
System\Windows\Controls\PopupControlService.cs (2)
1613Debug.Assert(hwndSource != null && rootElement != null, "expect non-null hwndSource and rootElement"); 1615Debug.Assert(((int)pt.X == (int)Math.Round(pt2.X)) && ((int)pt.Y == (int)Math.Round(pt2.Y)), "got incorrect mouse point");
System\Windows\Controls\Primitives\BulletDecorator.cs (2)
155Debug.Assert(child1 != null, "First child should be non-null."); 156Debug.Assert(child2 != null, "Second child should be non-null.");
System\Windows\Controls\Primitives\DataGridCellsPresenter.cs (1)
354Debug.Assert(
System\Windows\Controls\Primitives\DataGridColumnHeader.cs (6)
108Debug.Assert(column != null, "This header must have been generated with for a particular column"); 109Debug.Assert(column.Header == item, "The data item for a ColumnHeader is the Header property of a column"); 328Debug.Assert(header != null, "Header should not be null"); 471Debug.Assert(Column != null, "column can't be null if we got a notification for this property change"); 481Debug.Assert(Column != null, "column can't be null if we got a notification for this property change"); 567Debug.Assert(Column != null, "column can't be null if we got a notification for this property change");
System\Windows\Controls\Primitives\DataGridColumnHeadersPresenter.cs (11)
232Debug.Assert(column != null, "We shouldn't have generated this column header if we don't have a column."); 268Debug.Assert(HeaderCollection != null, "This is a helper method for preparing and clearing a container; if it's called we must have a valid ItemSource"); 710Debug.Assert(ParentDataGrid != null, "ParentDataGrid is null"); 757Debug.Assert(_draggingSrcColumnHeader != null, "Dragging header is null"); 769Debug.Assert(_columnHeaderDragIndicator != null, "Drag indicator is null"); 770Debug.Assert(_draggingSrcColumnHeader != null, "Dragging header is null"); 788Debug.Assert(_draggingSrcColumnHeader != null, "Dragging header is null"); 800Debug.Assert(_columnHeaderDropLocationIndicator != null, "Drag indicator is null"); 801Debug.Assert(_draggingSrcColumnHeader != null, "Dragging header is null"); 818Debug.Assert(ParentDataGrid != null, "ParentDataGrid is null"); 934Debug.Assert(ParentDataGrid != null, "ParentDataGrid is null");
System\Windows\Controls\Primitives\DatePickerTextBox.cs (2)
155Debug.Assert( 195Debug.Assert(datePickerTextBox != null, "The source is not an instance of a DatePickerTextBox!");
System\Windows\Controls\Primitives\MenuBase.cs (1)
808Debug.Assert(CheckAccess(), "IsMenuMode requires context access");
System\Windows\Controls\Primitives\Popup.cs (11)
188Debug.Assert(popup != null, "Popup must be non-null"); 189Debug.Assert(placementTarget != null, "Placement target must be non-null."); 219Debug.Assert(popup != null, "Popup must be non-null"); 220Debug.Assert(placementTarget != null, "Placement target must be non-null."); 896Debug.Assert(!bindTreatMousePlacementAsBottomProperty || child is ToolTip, "child must be a Tooltip to bind TreatMousePlacementAsBottomProperty"); 1102Debug.Assert( Mouse.Captured == _popupRoot.Value, "_cacheValid[(int)CacheBits.CaptureEngaged] == true but Mouse.Captured != _popupRoot"); 1395Debug.Assert(popup != null, "popup should be non-null."); 1396Debug.Assert(child != null, "child should be non-null."); 1419Debug.Assert(child != null, "child should be non-null"); 1933Debug.Assert(CheckAccess(), "AsyncReposition not called on the dispatcher thread."); 3308Debug.Assert(!IsChildPopup || (IsChildPopup && !transparent), "Child popups cannot be transparent");
System\Windows\Controls\Primitives\ResizeGrip.cs (1)
72Debug.Assert(rg != null, "DependencyObject must be of type ResizeGrip.");
System\Windows\Controls\Primitives\Selector.cs (13)
1047Debug.Assert(CanSelectMultiple, "CanSelectMultiple should be true when calling SelectAllImpl"); 1435Debug.Assert(!SelectionChange.IsActive, "SelectionChange is already active -- use SelectionChange.Select or Unselect"); 1509Debug.Assert(!((SelectedIndex >= 0) && (_selectedItems.Count == 0)), "SelectedIndex >= 0 implies _selectedItems nonempty"); 1607Debug.Assert(SelectionChange.IsActive, "SelectionChange.IsActive should be true"); 1689Debug.Assert(SelectionChange.IsActive, "SelectionChange.IsActive should be true"); 2051Debug.Assert(SelectionChange.IsActive, "SelectionChange.IsActive should be true"); 2283Debug.Assert(!_active, SR.SelectionChangeActive); 2296Debug.Assert(_active, "There must be a selection change active when you call SelectionChange.End()"); 2330Debug.Assert(_toSelect.Count <= 1, "_toSelect.Count was > 1"); 2506Debug.Assert(_active, SR.SelectionChangeNotActive); 2507Debug.Assert(info != null, "parameter info should not be null"); 2563Debug.Assert(_active, SR.SelectionChangeNotActive); 2564Debug.Assert(info != null, "info should not be null");
System\Windows\Controls\Primitives\Thumb.cs (1)
258Debug.Assert(false,"Got MouseLeftButtonDown event while dragging!");
System\Windows\Controls\Primitives\ToolBarOverflowPanel.cs (1)
104Debug.Assert(childrenIndex == childrenCount, "ToolBarOverflowPanel.Children count mismatch after transferring children from GeneratedItemsCollection.");
System\Windows\Controls\Primitives\ToolBarPanel.cs (4)
151Debug.Assert(children[childrenIndex] == child, "InternalChildren is out of sync with _generatedItemsCollection."); 198Debug.Assert(children[childrenIndex] == child, "InternalChildren is out of sync with _generatedItemsCollection."); 467Debug.Assert(itemCount == containerCount, "ToolBarPanel expects Replace to affect only realized containers"); 477Debug.Assert(e != null && !isNewlyRealized, "ToolBarPanel expects Replace to affect only realized containers");
System\Windows\Controls\Primitives\Track.cs (6)
400Debug.Assert(_visualChildren == null || _visualChildren[1] == null, "Child[1] should be null if Child[0] == null)"); 401Debug.Assert(_visualChildren == null || _visualChildren[2] == null, "Child[2] should be null if Child[0] == null)"); 406Debug.Assert(_visualChildren[2] == null, "Child[2] should be null if Child[1] == null)"); 608Debug.Assert(decreaseButtonLength >= 0.0 && decreaseButtonLength <= remainingTrackLength, "decreaseButtonLength is outside bounds"); 609Debug.Assert(increaseButtonLength >= 0.0 && increaseButtonLength <= remainingTrackLength, "increaseButtonLength is outside bounds"); 623Debug.Assert(DoubleUtil.GreaterThanOrClose(offset, 0.0), "Invalid offest (negative value).");
System\Windows\Controls\ScrollViewer.cs (1)
2398Debug.Assert(DoubleUtil.GreaterThanOrClose(_xSize, 0.0) && DoubleUtil.GreaterThanOrClose(_ySize, 0.0), "Negative size for scrolling viewport. Bad IScrollInfo implementation.");
System\Windows\Controls\SelectedCellsChangedEventArgs.cs (2)
51Debug.Assert(_addedCells.IsReadOnly, "_addedCells should have ended up as read-only."); 52Debug.Assert(_removedCells.IsReadOnly, "_removedCells should have ended up as read-only.");
System\Windows\Controls\TextBlock.cs (4)
1967Debug.Assert(_complexContent != null, "Inline objects are supported only in complex content."); 1997Debug.Assert(((InlineObject)inlineObjects[index]).Element == inlineObject.Element, "InlineObject cache is out of sync."); 2966Debug.Assert(sender == _complexContent.TextContainer, "Received text change for foreign TextContainer."); 3446Debug.Assert(DoubleUtil.AreClose(lineHeight, lineMetrics.Height), "Line height is out of sync.");
System\Windows\Controls\TextSearch.cs (3)
306Debug.Assert(String.IsNullOrEmpty(matchedText) == false, "matchedText cannot be null or empty"); 307Debug.Assert(String.IsNullOrEmpty(newText) == false, "newText cannot be null or empty"); 308Debug.Assert(matchedText.StartsWith(newText, ignoreCase, cultureInfo), "matchedText should start with newText");
System\Windows\Controls\ToolTip.cs (1)
514Debug.Assert(_parentPopup == null, "_parentPopup should be null");
System\Windows\Controls\VirtualizedCellInfoCollection.cs (20)
28Debug.Assert(owner != null, "owner must not be null."); 41Debug.Assert(owner != null, "owner must not be null."); 91Debug.Assert(IsValidCell(cell), "The cell should be valid."); 92Debug.Assert(!Contains(cell), "VirtualizedCellInfoCollection does not support duplicate items."); 475Debug.Assert(left >= 0, "left must be positive."); 476Debug.Assert(top >= 0, "top must be positive."); 477Debug.Assert(width >= 0, "width must be positive."); 478Debug.Assert(height >= 0, "height must be positive."); 495Debug.Assert(value >= 0, "Value must be positive."); 509Debug.Assert(value >= 0, "Value must be positive."); 523Debug.Assert(value >= _left, "Right must be greater than or equal to Left."); 537Debug.Assert(value >= _top, "Bottom must be greater than or equal to Top."); 551Debug.Assert(value >= 0, "Value must be positive."); 565Debug.Assert(value >= 0, "Value must be positive."); 791Debug.Assert(!IsEmpty, "Don't call GetBoundingRegion when IsEmpty is true."); 823Debug.Assert(left <= right, "left should be less than or equal to right."); 824Debug.Assert(top <= bottom, "top should be less than or equal to bottom."); 834Debug.Assert(rowCount > 0, "rowCount should be greater than 0."); 835Debug.Assert(columnCount > 0, "columnCount should be greater than 0."); 1638Debug.Assert(list != null, "list should not be null.");
System\Windows\Controls\VirtualizingStackPanel.cs (73)
407Debug.Assert(!IsPixelBased && IsScrolling && 484Debug.Assert(IsScrolling, "setting offset on non-scrolling panel"); 612Debug.Assert(IsScrolling, "setting offset on non-scrolling panel"); 803Debug.Assert(AnchorOperationField.GetValue(this) == null, "There is already a pending AnchorOperation."); 835Debug.Assert(_scrollData._firstContainerInViewport != null, "Must have an anchor element"); 861Debug.Assert(AnchorOperationField.GetValue(this) != null, "anchor state is inconsistent"); 892Debug.Assert(currFirstContainerInViewport != null, "Cannot find container in viewport"); 1147Debug.Assert(!IsPixelBased || !findTopContainer, "find 'top' container only makes sense when item-scrolling"); 1714Debug.Assert(IsVirtualizing && InRecyclingMode, "We should only modify the visual order when in recycling mode"); 2405Debug.Assert(!adjustToChangeInFirstItem || foundFirstItemInViewport, "This loop should only happen twice at most"); 3869Debug.Assert(info != null, "Expected state from previous measure not found"); 3977Debug.Assert(IsScrolling && IsVirtualizing, "Only check viewport on scrolling panel when virtualizing"); 4378Debug.Assert(retryCount >=0, "retry MeasureCaches too often"); 4538Debug.Assert(effectiveOffsetInfo.ScrollGeneration <= scrollGeneration, 4737Debug.Assert(cacheUnit != VirtualizationCacheLengthUnit.Page, "Page cacheUnit is not expected here."); 4993Debug.Assert(IsScrolling, "The scrolling panel is the only one that should extend the viewport"); 5051Debug.Assert(virtualizationInfoProvider != null, "This method should only be invoked for a virtualizing owner"); 5052Debug.Assert(cacheUnit != VirtualizationCacheLengthUnit.Page, "Page after cache size is not expected here."); 5680Debug.Assert(itemIndex < items.Count, "index out of range"); 5780Debug.Assert(IsVirtualizing, "We should only need to extend the viewport beyond the generated items when virtualizing"); 6114Debug.Assert(!containerSize.IsEmpty, "We can't estimate an empty size"); 6130Debug.Assert(!IsVSP45Compat, "this method should not be called in VSP45Compat mode"); 6198Debug.Assert(!containerSize.IsEmpty, "We can't estimate an empty size"); 6410Debug.Assert(parentItemStorageProvider != null || container != null, 6453Debug.Assert(!IsVSP45Compat, "SetItemsHostInset should not be called in VSP45-compat mode"); 6489Debug.Assert(false, "SetInset should only be called for a container"); 6634Debug.Assert(cacheUnit != VirtualizationCacheLengthUnit.Page, "Page cacheUnit is not expected here."); 6842Debug.Assert(virtualizingChild != null, "This method should only be invoked for a virtualizing child"); 7280Debug.Assert(DoubleUtil.AreClose(pixelSizeInViewport + pixelSizeBeforeViewport + pixelSizeAfterViewport, childPixelSize.Width), "The computed sizes within and outside the viewport should add up to the childPixelSize."); 7372Debug.Assert(DoubleUtil.AreClose(pixelSizeInViewport + pixelSizeBeforeViewport + pixelSizeAfterViewport, childPixelSize.Height), "The computed sizes within and outside the viewport should add up to the childPixelSize."); 7467Debug.Assert(IsVSP45Compat, "this method should only be called in VSP45Compat mode"); 7473Debug.Assert(evaluateAreContainersUniformlySized || !computedAreContainersUniformlySized, "AreContainersUniformlySized starts off true and can only be flipped to false."); 7619Debug.Assert(!IsVSP45Compat, "this method should not be called in VSP45Compat mode"); 7625Debug.Assert(evaluateAreContainersUniformlySized || !computedAreContainersUniformlySized, "AreContainersUniformlySized starts off true and can only be flipped to false."); 7908Debug.Assert(itemStorageProvider != null || item == this, "An item storage provider must be available."); 7909Debug.Assert(item != null, "An item must be available."); 7933Debug.Assert(itemStorageProvider != null || item == this, "An item storage provider must be available."); 7934Debug.Assert(item != null, "An item must be available."); 7977Debug.Assert(itemStorageProvider != null || item == this, "An item storage provider must be available."); 7978Debug.Assert(item != null, "An item must be available."); 8035Debug.Assert(itemStorageProvider != null || item == this, "An item storage provider must be available."); 8036Debug.Assert(item != null, "An item must be available."); 8758Debug.Assert(container != null, "Null container was generated"); 8803Debug.Assert(children[visualTreeIndex] != null, "MoveVisualChild interprets a null destination as 'move to end'"); 8928Debug.Assert(!children.Contains(child), "we incorrectly identified a recycled container"); 8949Debug.Assert(child == InternalChildren[childIndex], "Wrong child was generated"); 8971Debug.Assert(args.ItemUICount == args.ItemCount, "Both ItemUICount and ItemCount should be equal or ItemUICount should be 0."); 8981Debug.Assert(child != null, "Null child was generated"); 8982Debug.Assert(!newlyRealized, "newlyRealized should be false after Replace"); 9011Debug.Assert((itemCount == itemUICount) || (itemUICount == 0), "Both ItemUICount and ItemCount should be equal or ItemUICount should be 0."); 9052Debug.Assert(IsVirtualizing, "Can't clean up containers if not virtualizing"); 9053Debug.Assert(itemsControl != null, "We can't cleanup if we aren't the itemshost"); 9198Debug.Assert(InRecyclingMode, "This method only applies to recycling mode"); 9217Debug.Assert(IsVirtualizing && InRecyclingMode, "Realized children only exist when recycling"); 9218Debug.Assert(_realizedChildren != null, "Realized children must exist to verify it"); 9231Debug.Assert(!_realizedChildren.Contains(child), "_realizedChildren should not contain recycled containers"); 9237Debug.Assert(_realizedChildren[position.Index] == child, "_realizedChildren is corrupt!"); 9249Debug.Assert(_realizedChildren.Count == children.Count, "Realized and visual children must match"); 9253Debug.Assert(_realizedChildren[i] == children[i], "Realized and visual children must match"); 9283Debug.Assert(false, "We should have found a child"); 9399Debug.Assert(!InRecyclingMode, "This method only applies to standard virtualization"); 9465Debug.Assert(children == _realizedChildren, "the given child list must be the _realizedChildren list when recycling"); 9611Debug.Assert(IsScrolling, "ScrollData must only be set on a scrolling panel."); 9738Debug.Assert(DoubleUtil.AreClose(viewportSize.Width - Math.Floor(viewportSize.Width), 0.0), "The viewport size must not contain fractional values when in item scrolling mode."); 9739Debug.Assert(DoubleUtil.AreClose(extentSize.Width - Math.Floor(extentSize.Width), 0.0), "The extent size must not contain fractional values when in item scrolling mode."); 9743Debug.Assert(DoubleUtil.AreClose(viewportSize.Height - Math.Floor(viewportSize.Height), 0.0), "The viewport size must not contain fractional values when in item scrolling mode."); 9744Debug.Assert(DoubleUtil.AreClose(extentSize.Height - Math.Floor(extentSize.Height), 0.0), "The extent size must not contain fractional values when in item scrolling mode."); 10465Debug.Assert(IsScrolling, "ScrollData must only be set on a scrolling panel."); 10590Debug.Assert(DoubleUtil.AreClose(viewportSize.Width - Math.Floor(viewportSize.Width), 0.0), "The viewport size must not contain fractional values when in item scrolling mode."); 10591Debug.Assert(DoubleUtil.AreClose(extentSize.Width - Math.Floor(extentSize.Width), 0.0), "The extent size must not contain fractional values when in item scrolling mode."); 10595Debug.Assert(DoubleUtil.AreClose(viewportSize.Height - Math.Floor(viewportSize.Height), 0.0), "The viewport size must not contain fractional values when in item scrolling mode."); 10596Debug.Assert(DoubleUtil.AreClose(extentSize.Height - Math.Floor(extentSize.Height), 0.0), "The extent size must not contain fractional values when in item scrolling mode."); 12239Debug.Assert(tracer != null, "Trace called when not tracing");
System\Windows\Data\BindingBase.cs (1)
72Debug.Assert((int)Feature.LastFeatureId <= 32, "UncommonValueTable supports only 32 Ids");
System\Windows\Data\BindingExpression.cs (1)
2166Debug.Assert(NeedsValidation, "check NeedsValidation before calling this");
System\Windows\Data\BindingExpressionBase.cs (3)
126Debug.Assert((int)Feature.LastFeatureId <= 32, "UncommonValueTable supports only 32 Ids"); 1699Debug.Assert(RootBindingExpression == this, "Only call this with a root binding"); 2531Debug.Assert((_flags & PrivateFlags.iPropagationMask) != PrivateFlags.iPropDefault,
System\Windows\Data\BindingGroup.cs (3)
1349Debug.Assert(_bindingExpressions.Count == 0, "Unexpected Reset event"); 1353Debug.Assert(false, "Unexpected change event"); 1794Debug.Assert(bindingExpression != null, "do not ask for source value from a [Multi,Priority]Binding");
System\Windows\Data\BindingListCollectionView.cs (4)
588Debug.Assert(_newItemIndex != -2 && newItem == _newItem, "AddNew did not raise expected events"); 621Debug.Assert(_newItemIndex == -2 && _newItem == NoNewItem, "unexpected call to BeginAddNew"); 1928Debug.Assert(_newItem == InternalList[index], "unexpected item while committing AddNew"); 1987Debug.Assert(item == InternalList[index], "unexpected item while committing AddNew");
System\Windows\Data\CollectionView.cs (1)
1826Debug.Assert(changeLog != null && changeLog.Count > 0, "don't defer when there's no work");
System\Windows\Data\ListCollectionView.cs (6)
775Debug.Assert(_newItemIndex != -2 && System.Windows.Controls.ItemsControl.EqualsEx(newItem, _newItem), "AddNew did not raise expected events"); 800Debug.Assert(_newItemIndex == -2 && _newItem == NoNewItem, "unexpected call to BeginAddNew"); 1710Debug.Assert(false, "Cannot update collection view from outside UIContext without index in event args"); 2459Debug.Assert(view != null, "lazyGetCollectionView should not return null"); 3141Debug.Assert(list.VerifyLiveSorting(lsi), "live sorting failed"); 3151Debug.Assert(list.VerifyLiveSorting(null), "live sorting not resotred");
System\Windows\Data\MultiBinding.cs (2)
115Debug.Assert(false, "Unexpected BindingMode value"); 138Debug.Assert(false, "Unexpected UpdateSourceTrigger value");
System\Windows\Data\MultiBindingExpression.cs (2)
188Debug.Assert(ParentMultiBinding.Converter != null || !String.IsNullOrEmpty(EffectiveStringFormat), 880Debug.Assert(NeedsValidation, "check NeedsValidation before calling this");
System\Windows\Data\PriorityBindingExpression.cs (2)
200Debug.Assert(MutableBindingExpressions.Count == 0, "expect to encounter empty BindingExpression collection when attaching MultiBinding"); 458Debug.Assert(NeedsValidation, "check NeedsValidation before calling this");
System\Windows\Data\XmlDataProvider.cs (1)
286Debug.Assert(_domSetDocument == null, "Should not be possible to be using Source and user-set Doc at the same time.");
System\Windows\DataTrigger.cs (1)
190Debug.Assert( TriggerConditions != null && TriggerConditions.Length == 1,
System\Windows\DescendentsWalker.cs (1)
99Debug.Assert( false, "Tree walk priority should be Visual first or Logical first - but this instance of DescendentsWalker has an invalid priority setting that's neither of the two." );
System\Windows\Diagnostics\ResourceDictionaryDiagnostics.cs (5)
382Debug.Assert(result.Dictionary == null || result.Dictionary == rd, 423Debug.Assert(Object.Equals(result.Requester, requester), "Reverting a request for the wrong requester"); 432Debug.Assert(result.Dictionary != null, "simple lookup resolved incorrectly"); 459Debug.Assert(cachedDict == result.Dictionary, "conflicting dictionaries for a StaticResource reference"); 467Debug.Assert(cachedDict != null, "no dictionary found for StaticResource reference");
System\Windows\Documents\AdornerLayer.cs (3)
424Debug.Assert(adornerInfos != null, "No adorners found for element in AdornerLayer._zOrderMap"); 459Debug.Assert(adornerInfos != null, "No adorners found for element in AdornerLayer._zOrderMap"); 535Debug.Assert(adornerInfo != null, "Adorner should not be null");
System\Windows\Documents\ColumnResizeAdorner.cs (1)
141Debug.Assert(_adornerLayer == null, "Attempt to overwrite existing AdornerLayer!");
System\Windows\Documents\CompositionAdorner.cs (3)
364Debug.Assert(_adornerLayer == null, "Attempt to overwrite existing AdornerLayer!"); 589Debug.Assert(start.CompareTo(startLinePointer) <= 0, "The start pointer is positioned after the composition start line pointer!"); 612Debug.Assert(endLinePointer.CompareTo(textSegment.End) == 0, "The end line pointer is positioned after the composition text range end pointer!");
System\Windows\Documents\DocumentSequenceHighlightLayer.cs (1)
55Debug.Assert(false, "This method is not implemented and not expected to be called.");
System\Windows\Documents\DocumentSequenceTextContainer.cs (1)
452Debug.Assert(false, "should never be here");
System\Windows\Documents\DocumentSequenceTextPointer.cs (5)
57Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 453Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 482Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 502Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 1092Debug.Assert(false, "invalid TextPointerContext");
System\Windows\Documents\FixedDocument.cs (2)
1112Debug.Assert(!highlightTransitionPosition.IsNull, "Highlight start not followed by highlight end!"); 1128Debug.Assert(!highlightTransitionPosition.IsNull, "Highlight start not followed by highlight end!");
System\Windows\Documents\FixedPage.cs (1)
612Debug.Assert(dpo != null, "GetLinkUri shouldn't be called for non-DependencyObjects.");
System\Windows\Documents\FixedSOMPageConstructor.cs (2)
59Debug.Assert(stroke || fill, "should not be a nop"); 198Debug.Assert(false, "It should not be called");
System\Windows\Documents\FixedTextPointer.cs (5)
385Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 388Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 418Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 429Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 680Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!");
System\Windows\Documents\FixedTextView.cs (1)
1209Debug.Assert(!textPointer.IsFrozen, "Can't reposition a frozen pointer!");
System\Windows\Documents\ImmComposition.cs (1)
304Debug.Assert(oldSource == null || newSource == null,
System\Windows\Documents\NullTextContainer.cs (1)
256Debug.Assert(false, "Unexpected call to NullTextContainer.set_TextView!");
System\Windows\Documents\NullTextNavigator.cs (9)
228Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 238Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 250Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 252Debug.Assert(distance == 0, "Single possible position in this empty container"); 262Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 272Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 274Debug.Assert(false, "No scoping element!"); 282Debug.Assert(false, "NullTextPointer does not expect layout dependent method calls!"); 291Debug.Assert(false, "NullTextPointer does not expect layout dependent method calls!");
System\Windows\Documents\TextServicesHost.cs (7)
70Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "OnRegisterTextStore must be called on STA thread"); 270Debug.Assert(_registeredtextstorecount > 0, "Overrelease TextStore!"); 288Debug.Assert(CheckAccess(), "OnDispatcherShutdownFinished called on bad thread!"); 289Debug.Assert(_isDispatcherShutdownFinished == false, "Was this dispather finished???"); 317Debug.Assert(CheckAccess(), "RegisterTextStore called on bad thread!"); 322Debug.Assert(_isDispatcherShutdownFinished == false, "Was this dispather finished?"); 323Debug.Assert(_registeredtextstorecount == 0, "TextStore was registered without ThreadMgr?");
System\Windows\Documents\TextStore.cs (1)
4836Debug.Assert(tracer != null, "Trace called when not tracing");
System\Windows\FrameworkContextData.cs (1)
67Debug.Assert((walkerEntry.Data == data) && (walkerEntry.Walker == walker),
System\Windows\FrameworkElement.cs (7)
1181Debug.Assert(startNode.IsValid || unlinkedParent != null, 1392Debug.Assert(fo.IsValid, 1481Debug.Assert(target != null, "Don't call FindTemplateResource with a null target object"); 1487Debug.Assert(fo.IsValid, "Don't call FindTemplateResource with a target object that is neither a FrameworkElement nor a FrameworkContentElement"); 1925Debug.Assert(entry.Value == DependencyProperty.UnsetValue,"FrameworkElement.GetRawValue should never fall through with a value != DependencyProperty.UnsetValue. We're supposed to return as soon as we found something."); 2354Debug.Assert(templatedParentTemplate != null , 2542Debug.Assert(fceParent == null, "Nearest framework parent via the visual tree has to be an FE. It cannot be an FCE");
System\Windows\FrameworkElementFactory.cs (3)
692Debug.Assert( treeNodeFO.IsValid || (treeNodeVisual3D != null), 1183Debug.Assert(_frameworkTemplate != null, "ContentPresenter is an FE and can only have a FrameworkTemplate"); 1226Debug.Assert(_frameworkTemplate != null, "GridViewRowPresenter is an FE and can only have a FrameworkTemplate");
System\Windows\FrameworkTemplate.cs (5)
67Debug.Assert(templatedParent != null, 448Debug.Assert(!_sealed, "call this method before template is sealed"); 839Debug.Assert(false, "We do not have support for DynamicResource within unshared template content"); 966Debug.Assert(templateReader != null, "PlayXaml returned null"); 1065Debug.Assert(false, "Unknown enum value");
System\Windows\Generated\FrameworkContentElement.cs (1)
1166Debug.Assert(value == true,
System\Windows\Generated\FrameworkElement.cs (1)
1205Debug.Assert(value == true,
System\Windows\Input\Command\CommandConverter.cs (2)
812System.Diagnostics.Debug.Assert( propertyInfo == null, "KnownCommand isn't known to CommandConverter.GetKnownCommand" ); 815System.Diagnostics.Debug.Assert( fieldInfo == null, "KnownCommand isn't known to CommandConverter.GetKnownCommand" );
System\Windows\Input\KeyboardNavigation.cs (18)
505Debug.Assert(adornedElement != null, "adornedElement should not be null"); 506Debug.Assert(focusVisualStyle != null, "focusVisual should not be null"); 520Debug.Assert(adornedElement != null, "adornedElement should not be null"); 521Debug.Assert(adornedElementParent != null, "adornedElementParent should not be null"); 522Debug.Assert(contentHostParent != null, "contentHostParent should not be null"); 523Debug.Assert(contentHostParent is Visual, "contentHostParent should be Visual"); 524Debug.Assert(focusVisualStyle != null, "focusVisual should not be null"); 988Debug.Assert(currentElement != null, "currentElement should not be null"); 1349Debug.Assert(container != null, "container cannot be null"); 1800Debug.Assert(e != null, "e should not be null"); 1801Debug.Assert(container != null, "container should not be null"); 1879Debug.Assert(e != null, "e cannot be null"); 2093Debug.Assert(container != null, "container should not be null"); 2129Debug.Assert(IsTabStopOrGroup(nextTabElement), "nextTabElement should be IsTabStop or group"); 2268Debug.Assert(e != null || container != null, "e or container should not be null"); 2647Debug.Assert(sourceElement != null, "sourceElement must not be null"); 2901Debug.Assert(!(sourceElement == null && container == null), "Both sourceElement and container cannot be null"); 2906Debug.Assert(container != null, "container cannot be null");
System\Windows\Interop\ActiveXHost.cs (20)
232Debug.Assert(args.Key.Length > 0, "got an empty access key"); 424Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Loaded, "Failed transition"); 429Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Running, "Failed transition"); 434Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.InPlaceActive, "Failed transition"); 439Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.UIActive, "Failed transition"); 480Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.InPlaceActive, "Failed transition"); 485Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Running, "Failed transition"); 490Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Loaded, "Failed transition"); 495Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Passive, "Failed transition"); 566Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Passive, "Wrong start state to transition from"); 571Debug.Assert(_axInstance == null, "_axInstance must be null"); 574Debug.Assert(_axInstance != null, "w/o an exception being thrown we must have an object..."); 589Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Loaded, "Wrong start state to transition from"); 623Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Loaded, "Wrong start state to transition from"); 648Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Running, "Wrong start state to transition from"); 665Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Running, "Wrong start state to transition from"); 692Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.InPlaceActive, "Wrong start state to transition from"); 707Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.InPlaceActive, "Wrong start state to transition from"); 720Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.UIActive, "Wrong start state to transition from"); 956Debug.Assert(_axInstance != null, "The native control is null");
System\Windows\Interop\WindowInteropHelper.cs (2)
88Debug.Assert(_window != null, "Cannot be null since we verify in the constructor"); 93Debug.Assert(_window != null, "Cannot be null since we verify in the constructor");
System\Windows\LogicalTreeHelper.cs (1)
421Debug.Assert(parentFE != null || parentFCE != null, "Either parentFE or parentFCE should be non-null");
System\Windows\Markup\Baml2006\Baml2006Reader.cs (1)
2114Debug.Assert(_context.CurrentFrame.XamlType != null, "BAML Xmlns record is only legal between ElementStart and ElementEnd");
System\Windows\Markup\Baml2006\SharedStream.cs (1)
290System.Diagnostics.Debug.Assert(_baseStream != null, "Stream has already been disposed");
System\Windows\Markup\BamlMapTable.cs (3)
823Debug.Assert(attributeId >= 0, "Known Property Id must be a DependencyProperty."); 1024Debug.Assert(assemblyFullName.Length != 0, "empty assembly"); 1470Debug.Assert(GetHashTableData(stringValue) == null,
System\Windows\Markup\BamlReader.cs (2)
1390Debug.Assert(dictKey != null, "Bad Key record"); 1421Debug.Assert(keyStartRecord != null, "Bad Key Element Start record");
System\Windows\Markup\BamlRecordHelper.cs (1)
132Debug.Assert(false, "Unhandled case in DoesRecordTypeHaveDebugExtension");
System\Windows\Markup\BamlRecordReader.cs (10)
242Debug.Assert(false == XamlReaderStream.IsWriteComplete, 1219Debug.Assert(!CurrentContext.CheckFlag(ReaderFlags.NeedToAddToTree), "Failed to add Element to tree before popping stack"); 1516Debug.Assert(param != null && paramList == null, "Must have a single param"); 1530Debug.Assert(param == null && paramList != null, "Must have a paramList"); 1904Debug.Assert(staticResourceValues != null, "Must have a list of StaticResourceValues for lookup"); 1977Debug.Assert(staticResourceValues != null, "Must have a list of StaticResourceValues for lookup"); 2245Debug.Assert(element is DependencyObject, "Guaranteed by PropertyDefinition constructor"); 2713Debug.Assert( attributeUsage == BamlAttributeUsage.XmlSpace, 3458Debug.Assert( CurrentContext.ObjectData == null && CurrentContext.ExpectedType != null, 5008Debug.Assert(false, "The only remaining option is attached property, which is not allowed in xaml for content properties");
System\Windows\Markup\BamlRecords.cs (21)
700Debug.Assert(false,"Assembly, Type and Attribute records are not cached, so don't ask for one."); 725Debug.Assert(false,"Unknown RecordType"); 868set { Debug.Assert (value == -1, "Setting fixed record to an invalid size"); } 877Debug.Assert(false, "Must override RecordType"); 1513Debug.Assert(_valuePositionPosition != -1, 1696Debug.Assert(_valuePositionPosition != -1, 2061set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2131set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2192set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2419set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 2808Debug.Assert (false, "Unknown custom serializer"); 2996set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 3210set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3297set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3446Debug.Assert(_contentSizePosition != -1, 3491set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3651set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 3749set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 3827set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 4012Debug.Assert(FilePos != -1,"UpdateWrite called but Write Never was"); 4708Debug.Assert((propertyMember is MethodInfo) || (propertyMember is PropertyInfo)
System\Windows\Markup\BamlRecordWriter.cs (11)
467Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 567Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 604Debug.Assert(!InStaticResourceSection, "We do not support x:Shared within a StaticResource Section"); 788Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 844Debug.Assert(keyRecord.RecordList.Count == 0, "Should have empty record list"); 870Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 1632Debug.Assert(keyRecord != null, "Unknown key record type in defer load dictionary"); 1643Debug.Assert(keyIndex == _deferKeys.Count, 1666Debug.Assert(_deferElementDepth > 0 && CollectingValues, 1674Debug.Assert(valueDeferRecord.Record != null && 1686Debug.Assert(valueDeferRecord.Record != null && valueDeferRecord.Record.RecordType == BamlRecordType.ElementEnd,
System\Windows\Markup\BamlVersionHeader.cs (3)
73Debug.Assert((posEnd-posStart) == BamlVersionHeader.BinarySerializationSize, 104Debug.Assert(length == BamlVersionHeader.BinarySerializationSize, 109Debug.Assert((posEnd-posStart) == BamlVersionHeader.BinarySerializationSize,
System\Windows\Markup\BamlWriter.cs (2)
131Debug.Assert(null != assemblyName,"assembly name returned from GetBaseElement is null"); 132Debug.Assert(null != typeFullName,"Type name returned from GetBaseElement is null");
System\Windows\Markup\MarkupExtensionParser.cs (1)
1544Debug.Assert(null != info, "No property or method info for field Name");
System\Windows\Markup\Primitives\ElementMarkupObject.cs (3)
943Debug.Assert(typeSerializer != null, "typeSerializer for Enum was null"); 1003Debug.Assert(serializer != null && serializer.CanConvertToString(_object.Instance, _object.Context), 1028Debug.Assert(serializer != null && serializer.CanConvertToString(_object.Instance, _object.Context),
System\Windows\Markup\Primitives\ExtensionSimplifierMarkupObject.cs (2)
320Debug.Assert(typeSerializer != null, "Could not retrieve typeSerializer for Type"); 355Debug.Assert(!propertyWritten, "An argument was returned after a property was set. All arguments must be returned first and in order");
System\Windows\Markup\Primitives\MarkupWriter.cs (5)
508Debug.Assert(!noOtherPropertiesAllowed || property.IsKey, 528Debug.Assert(first, "Problem with MarkupObject implemenation: Items returning a ValueAsString can have no other properties"); 544Debug.Assert(dependencyProperty != null, "Problem with MarkupObject implementation: If PropertyDescriptor is null one of the following needs to be true; IsKey, IsValueAsString, IsConstructorArgument, or DependencyProperty is not null"); 691Debug.Assert(!property.IsValueAsString, "Problem with MarkupObject implementation: String values cannnot be composite"); 1366Debug.Assert( ((bool)_xmlnsSpacePreserve) == _containingScope.XmlnsSpacePreserve ,
System\Windows\Markup\WpfXamlLoader.cs (2)
321System.Diagnostics.Debug.Assert(count == 0, "Mismatch StartMember/EndMember"); 391System.Diagnostics.Debug.Assert(xamlReader.Value is string, "XmlAttributeProperties.XmlSpaceProperty has the type string.");
System\Windows\Markup\XamlStream.cs (14)
84Debug.Assert(!WriteComplete,"Write called after close"); 86Debug.Assert(null != buffer,"Null buffer past to the Writer"); 98Debug.Assert(null != writeBuffer,"Null writeBuffer returned"); 118Debug.Assert(0 < bufferWriteCount,"Not writing any bytes to the buffer"); 123Debug.Assert(bufferOffset < BufferSize,"Trying to Read past bufer"); 189Debug.Assert(!WriteComplete,"UpdateReaderLength called after close"); 234Debug.Assert(bufferOffset < BufferSize,"Calculated bufferOffset is greater than buffer"); 254Debug.Assert(0 < bufferReadCount,"Not reading any bytes to the buffer"); 259Debug.Assert(bufferOffset < BufferSize,"Trying ot read past buffer"); 382Debug.Assert(bufferOffset < BufferSize,"Calculated bufferOffset is greater than buffer"); 387Debug.Assert(bufferArray.Count == bufferIndex,"Need to allocate more than one buffer"); 388Debug.Assert(false == reader,"Allocating a buffer on Read"); 793Debug.Assert(false,"Close called on ReaderStream"); 801Debug.Assert(false,"Flush called on ReaderStream");
System\Windows\Markup\XamlTypeMapper.cs (26)
835Debug.Assert(null != attribInfo, "null attribInfo"); 836Debug.Assert(null != currentParentType, "null currentParentType"); 954Debug.Assert(null != localName, "null localName"); 955Debug.Assert(null != xmlNamespace, "null xmlNamespace"); 1602Debug.Assert(null != eventName, "null eventName"); 1603Debug.Assert(null != owner, "null owner"); 1647Debug.Assert(null != localName, "null localName"); 1648Debug.Assert(null != xmlNamespace, "null xmlNamespace"); 1685Debug.Assert(null != baseType, "baseType not set"); 1778Debug.Assert(null != localName, "null localName"); 1779Debug.Assert(null != xmlNamespace, "null xmlNamespace"); 1921Debug.Assert(typeInfo != null, "Must have cached type info at this point"); 2413Debug.Assert(null != xmlNamespace,"null value passed for xmlNamespace"); 2414Debug.Assert(null != localName,"null value passed for localName"); 2452Debug.Assert(null != xmlNamespace,"null value passed for xmlNamespace"); 2453Debug.Assert(null != localName,"null value passed for localName"); 2603Debug.Assert(namespaceMap.ClrNamespace != null,"Null CLR Namespace"); 2604Debug.Assert(localName != null,"Null localName"); 3451Debug.Assert(null != type, "Null passed for type to GetTypeConverterType"); 3482Debug.Assert(null != type, "Null passed for type to GetTypeConverter"); 3526Debug.Assert(null != propType, "Null passed for propType to GetPropertyConverterType"); 3570Debug.Assert(null != propType, "Null passed for propType to GetPropertyConverter"); 3689Debug.Assert(_constructors != null, "This operation is legal only after the constructors have been fetched"); 3755Debug.Assert(null != type, "null value for type passed to GetWhitespace"); 3767Debug.Assert(1 == trimAttribute.Length,"More than one TrimWhitespace Attribute"); 4021Debug.Assert(_dpLookupHashtable != null,
System\Windows\Media\Animation\BeginStoryboard.cs (2)
180Debug.Assert( fe != null || fce != null, "Caller of internal function failed to verify that we have a FE or FCE - we have neither." ); 199Debug.Assert( fe != null, "Invoke needs an object as starting point");
System\Windows\Media\Animation\ControllableStoryboardAction.cs (3)
63Debug.Assert( fe != null || fce != null, "Caller of internal function failed to verify that we have a FE or FCE - we have neither." ); 64Debug.Assert( targetStyle != null || frameworkTemplate != null, 83Debug.Assert( fe != null, "Invoke needs an object as starting point");
System\Windows\Media\Animation\Generated\ThicknessAnimationUsingKeyFrames.cs (6)
352Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 633Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 640Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 690Debug.Assert(!_areKeyTimesValid, "KeyFrameThicknessAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 832Debug.Assert(index < keyFrameCount, 908Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\PauseStoryboard.cs (1)
28Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\RemoveStoryboard.cs (1)
28Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\ResumeStoryboard.cs (1)
28Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\SeekStoryboard.cs (1)
93Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\SetStoryboardSpeedRatio.cs (1)
51Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\SkipStoryboardToFill.cs (1)
28Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\StopStoryboard.cs (1)
28Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\Storyboard.cs (6)
691Debug.Assert( i > 0, "The caller should not have set the PropertyPath context to a null object." ); 746Debug.Assert( i > 0, "The caller should not have set the PropertyPath context to a non DependencyObject." ); 811Debug.Assert(path.Length > 1, "This method shouldn't even be called for a simple property path."); 861Debug.Assert(targetPropertyValue is Freezable, "We shouldn't be trying to clone a type we don't understand. PropertyCloningRequired() has improperly flagged the current value as 'need to clone'."); 981Debug.Assert(cacheEntry.Source != DependencyProperty.UnsetValue, 2118Debug.Assert( target != null && clone != null && property != null && original != null,
System\Windows\MultiTrigger.cs (1)
134Debug.Assert( TriggerConditions[i].SourceChildIndex == 0,
System\Windows\Navigation\Journal.cs (6)
284Debug.Assert(!(journalEntry.IsAlive() && journalEntry.JEGroupState.JournalDataStreams != null), 314Debug.Assert(_uncommittedCurrentIndex == _currentEntryIndex, 427Debug.Assert(IsNavigable(target), "target must be navigable"); 496Debug.Assert(index < TotalCount && index >= 0, "Invalid index passed to RemoveEntryInternal"); 497Debug.Assert(_uncommittedCurrentIndex == _currentEntryIndex, 501Debug.Assert(theEntry != null, "Journal list state is messed up");
System\Windows\Navigation\JournalEntry.cs (1)
280Debug.Assert(!_jeGroupState.JournalDataStreams.HasAnyData,
System\Windows\Navigation\NavigationService.cs (15)
104Debug.Assert(e != null, "Hyperlink fired Navigate event with null NavigateEventArgs"); 117Debug.Assert(dobj != null, "RequestNavigateEventArgs.OriginalSource should be DependencyObject"); 254Debug.Assert(_bp != null, "NavigationService should not handle a nav from a hyperlink thats not in its hosted tree"); 640Debug.Assert(ChildNavigationServices.Contains(ncChild), "Child NavigationService must already exist"); 703Debug.Assert(fe != null, "INavigatorHost needs to be FrameworkElement"); 1145Debug.Assert(bpu == null || 1175Debug.Assert(navMode == NavigationMode.Refresh, 1951Debug.Assert(PendingNavigationList.Count == 0, 2061Debug.Assert(this.Application != null && 2116Debug.Assert(source == null || 2166Debug.Assert(PendingNavigationList.Count == 0, 2176Debug.Assert(_navigateQueueItem == null, "Previous nav queue item should be cleared by now."); 3113Debug.Assert(navigationMode == NavigationMode.New || 3732Debug.Assert(_navigateQueueItem == null, 4531Debug.Assert(node != null, "Trying to dispose a null Logical Tree Node");
System\Windows\Navigation\NavigationWindow.cs (8)
1017Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1024Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1032Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1039Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1047Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1054Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1061Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1073Debug.Assert(nw != null, "sender must be of type NavigationWindow.");
System\Windows\ResourceDictionary.cs (7)
550Debug.Assert(_numDefer > 0, "The stream was closed before all deferred content was loaded."); 963Debug.Assert(IsInitialized == false, "Dictionary should not be initialized when EndInit is called"); 1024Debug.Assert(_numDefer > 0, "The stream was closed before all deferred content was loaded."); 1295Debug.Assert(keyValue != null, "Didn't find the ResourceKey property or x:PositionalParameters directive"); 1299Debug.Assert(false, "StaticResources[] entry is not a StaticResource not OptimizedStaticResource"); 1726Debug.Assert(resourceKey != null, "ResourceKey cannot be null"); 2245Debug.Assert(IsThemeDictionary || _ownerApps != null || IsReadOnly, "This must be an App/Theme/Style/Template ResourceDictionary");
System\Windows\ResourceDictionaryCollection.cs (1)
18Debug.Assert(owner != null, "ResourceDictionaryCollection's owner cannot be null");
System\Windows\ResourceReferenceExpression.cs (1)
106Debug.Assert(_targetObject == d, "TargetObject that this expression is attached to must be the same as the one on which its value is being queried");
System\Windows\ResourcesChangeInfo.cs (1)
224Debug.Assert(_oldDictionaries != null || _newDictionaries != null || _key != null, "Must have a dictionary or a key that has changed");
System\Windows\StaticResourceExtension.cs (1)
250Debug.Assert(ambientList != null, "IAmbientProvider.GetAllAmbientValues no longer returns List<>, please copy the list");
System\Windows\Style.cs (2)
364Debug.Assert(resourceKey != null, "Argument cannot be null"); 653Debug.Assert(setterBase != null, "Setter collection must contain non-null instances of SetterBase");
System\Windows\StyleHelper.cs (40)
723Debug.Assert(freezable.IsFrozen, "Freezable within a Style or Template should have been frozen by now"); 1133Debug.Assert(action.IsSealed, "TriggerAction should have already been sealed by this point."); 1502Debug.Assert((container is FrameworkElement) || (container is FrameworkContentElement), "Caller has queried with non-framework element. Bad caller, bad!"); 1503Debug.Assert(dataType < InstanceStyleData.ArraySize, "Caller has queried using a value outside the range of the Enum. Bad caller, bad!"); 1606Debug.Assert(!freezable.CanFreeze, "If a freezable could have been frozen it would have been done by now."); 1633Debug.Assert(instanceValues != null, "InstanceValues hashtable should have been created at initialization time."); 1818Debug.Assert(treeRoot is FrameworkElement || treeRoot is FrameworkContentElement, 1866Debug.Assert(treeRoot == null || treeRoot is FrameworkElement || treeRoot is FrameworkContentElement, 1894Debug.Assert( feContainer._buildVisualTreeVerification == VerificationState.WaitingForBuildVisualTree, 1902Debug.Assert(frameworkTemplate != null, "Only FrameworkTemplate has the ability to build a VisualTree by this means"); 1914Debug.Assert( feContainer._buildVisualTreeVerification == VerificationState.WaitingForBuildVisualTreeCompletion, 1919Debug.Assert( feContainer._buildVisualTreeVerification == VerificationState.WaitingForAddCustomTemplateRoot, 1954Debug.Assert( container._buildVisualTreeVerification != VerificationState.WaitingForBuildVisualTreeCompletion, 1956Debug.Assert( container._buildVisualTreeVerification == VerificationState.WaitingForAddCustomTemplateRoot, 1977Debug.Assert( null == VisualTreeHelper.GetParent(child), 2065Debug.Assert( feWalkNode != null || fceWalkNode != null, 2138Debug.Assert(feContainer != null || fceContainer != null, 2157Debug.Assert(templatedChildren.Count > 0, 2401Debug.Assert(sender is FrameworkElement || sender is FrameworkContentElement, 2456Debug.Assert(sender is FrameworkElement || sender is FrameworkContentElement, 2490Debug.Assert(templatedParentTemplate != null, "Must have a VisualTree owner"); 2535Debug.Assert(action.ContainingTrigger is EventTrigger, 2626Debug.Assert(child.IsValid, "child should either be an FE or an FCE"); 2978Debug.Assert(value != NotYetApplied, "attempt to retrieve instance value that was never set"); 3500Debug.Assert( oldTemplate == null || oldTemplate is FrameworkTemplate, 3502Debug.Assert( newTemplate == null || newTemplate is FrameworkTemplate, 3504Debug.Assert( (oldTemplate == null || newTemplate == null ) || 4092Debug.Assert(styledChildren != null, "Should reach here only if the template tree has already been created"); 4221Debug.Assert(dp != null, "dp must not be null"); 4453Debug.Assert( triggerBase is MultiDataTrigger, 4489Debug.Assert( triggerBase is MultiTrigger, 4832Debug.Assert(!(action.ContainingTrigger is EventTrigger), 4848Debug.Assert( trigger.Property == changedProperty, 4855Debug.Assert( frameworkTemplate != null, 4863Debug.Assert( conditions != null && conditions.Length == 1, 4893Debug.Assert( conditions != null && conditions.Length == 1, 4926Debug.Assert( frameworkTemplate != null, 4937Debug.Assert(evaluationNode != null, 4999Debug.Assert( evaluationBinding != null, 5815Debug.Assert(false, "GetHashCode for value types will use reflection to generate the hashcode. Write a better hash code generation algorithm if this struct is to be used in a hashtable, or remove this assert if it's decided that reflection is OK.");
System\Windows\SystemResources.cs (1)
363Debug.Assert(typeKey != null || resourceKey != null, "typeKey or resourceKey should be non-null");
System\Windows\TemplateContent.cs (1)
584Debug.Assert(iReader != null, "Template's Reader is not a Indexing Reader");
System\Windows\TemplateNameScope.cs (2)
55Debug.Assert(templatedParent == null || (templatedParent is FrameworkElement || templatedParent is FrameworkContentElement), 203Debug.Assert(false, "Should never be trying to unregister via this interface for templates");
System\Windows\ThemeDictionaryExtension.cs (2)
190Debug.Assert(dictionary != null, "dictionary should not be null"); 191Debug.Assert(assemblyName != null, "assemblyName should not be null");
System\Windows\TreeChangeInfo.cs (2)
59Debug.Assert(d != null, "Must have non-null current node"); 118Debug.Assert(!inheritableProperties.Contains(dp), "EffectiveValues cache must not contains duplicate entries for the same DP");
System\Windows\TreeWalkHelper.cs (14)
44Debug.Assert(fe != null || fce != null, "Node with the tree change notification must be an FE or an FCE."); 45Debug.Assert(parent != null, "Must have a parent that the current node is connected to or disconnected from."); 246Debug.Assert(fe != null || fce != null, "Must have non-null current node"); 269Debug.Assert(inheritableProperty.IsPotentiallyInherited, "if we got here, it means that this property is inheritable by someone"); 286Debug.Assert(!currentInheritableProperties.Contains(inheritableProperty), "InheritableProperties list should not have duplicates"); 321Debug.Assert(d != null, "Must have non-null current node"); 324Debug.Assert(fMetadata.IsInherited == true, "This must be an inherited dependency property"); 327Debug.Assert(!wasSelfInheritanceParent || isSelfInheritanceParent, "IsSelfInheritanceParent changed from true to false"); 458Debug.Assert(fe != null || fce != null, "Node with the resources change notification must be an FE or an FCE."); 516Debug.Assert(d != null, "Must have non-null current node"); 681Debug.Assert(d != null, "Must have non-null current node"); 744Debug.Assert(d != null, "Must have non-null current node"); 906Debug.Assert(fo.IsValid, "Node with the resources change notification must be an FE or an FCE."); 938Debug.Assert(d != null, "Must have non-null current node");
System\Windows\Trigger.cs (2)
239Debug.Assert( TriggerConditions != null && TriggerConditions.Length == 1, 242Debug.Assert( TriggerConditions[0].SourceChildIndex == 0,
System\Windows\TriggerBase.cs (1)
376Debug.Assert( false,
System\Windows\Window.cs (40)
353Debug.Assert(_threadWindowHandles == null, "_threadWindowHandles must be null before enumerating the thread windows"); 1321Debug.Assert( IsSourceWindowNull == false , "IsSourceWindowNull cannot be true when _showingAsDialog is true"); 2929Debug.Assert( IsSourceWindowNull == false , "IsSourceWindowNull cannot be true when calling this function"); 3156Debug.Assert(Manager != null, "HwndStyleManager must have a valid value here"); 3477Debug.Assert(w != null, "Target must be of type Window."); 3500Debug.Assert(_threadWindowHandles != null, "_threadWindowHandles must not be null at this point"); 3523Debug.Assert(_threadWindowHandles != null, "_threadWindowHandles must not be null at this point"); 3676Debug.Assert(IsSourceWindowNull == false, "_swh should not be null here"); 3826Debug.Assert(workAreaWidthDeviceUnits >= 0, string.Create(CultureInfo.InvariantCulture, $"workAreaWidth ({hMonitor})for monitor ({workAreaWidthDeviceUnits}) is negative")); 3827Debug.Assert(workAreaHeightDeviceUnits >= 0, string.Create(CultureInfo.InvariantCulture, $"workAreaHeight ({hMonitor}) for monitor ({workAreaHeightDeviceUnits}) is negative")); 3837Debug.Assert(IsSourceWindowNull == false, "_swh should not be null here"); 3964Debug.Assert(false, "Invalid value for ResizeMode"); 4342Debug.Assert(_showingAsDialog == true, "_showingAsDialog must be true when DoDialogHide is called"); 4383Debug.Assert(_threadWindowHandles != null, "_threadWindowHandles must not be null at this point"); 4424Debug.Assert(ownedWindows.Count == 0, "All owned windows should now be gone"); 4985Debug.Assert(w != null, "DependencyObject must be of type Window."); 5011Debug.Assert(w != null, "DependencyObject must be of type Window."); 5030Debug.Assert(w != null, "DependencyObject must be of type Window."); 5090Debug.Assert(w != null, "DependencyObject must be of type Window."); 5217Debug.Assert(w != null, "DependencyObject must be of type Window."); 5237Debug.Assert(w != null, "DependencyObject must be of type Window."); 5498Debug.Assert(_dispatcherFrame == null, "_dispatcherFrame must be null here"); 5557Debug.Assert(w != null, "DependencyObject must be of type Window."); 5568Debug.Assert(w != null, "DependencyObject must be of type Window."); 5628Debug.Assert(w != null, "d must be typeof Window"); 5651Debug.Assert(w != null, "d must be typeof Window"); 5690Debug.Assert(w != null, "d must be typeof Window"); 5728Debug.Assert(w != null, "d must be typeof Window"); 5749Debug.Assert(w != null, "d must be typeof Window"); 5790Debug.Assert(w != null, "d must be typeof Window"); 6016Debug.Assert( w != null, "DependencyObject must be of type Window." ); 6091Debug.Assert( w != null, "DependencyObject must be of type Window." ); 6148Debug.Assert( IsSourceWindowNull == false , "IsSourceWindowNull cannot be true when calling this function"); 6170Debug.Assert( w != null, "DependencyObject must be of type Window." ); 6202Debug.Assert(w != null, "DependencyObject must be of type Window."); 7362Debug.Assert(IsSourceWindowNull != true, "IsSourceWindowNull cannot be true here"); 7453Debug.Assert( IsSourceWindowNull == false , "Should only be invoked when we know Handle is non-null" ); 7463Debug.Assert( IsSourceWindowNull == false , "Should only be invoked when we know Handle is non-null" ); 7488Debug.Assert( IsSourceWindowNull == false , "IsSourceWindowNull can't be true here"); 7507Debug.Assert( IsSourceWindowNull == false , "IsSourceWindowNull can't be true here");
System\Windows\WindowCollection.cs (1)
41Debug.Assert(count >= 0, "count must not be less than zero");
PresentationFramework.Aero (3)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
330Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 357Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 367Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
PresentationFramework.Aero2 (3)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
330Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 357Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 367Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
PresentationFramework.AeroLite (3)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
330Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 357Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 367Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
PresentationFramework.Classic (21)
Microsoft\Windows\Themes\ClassicBorderDecorator.cs (18)
235Debug.Assert(rgbColor.Red >= 0 && rgbColor.Red <= 1, "Red must be between 0 and 1."); 236Debug.Assert(rgbColor.Green >= 0 && rgbColor.Green <= 1, "Green must be between 0 and 1."); 237Debug.Assert(rgbColor.Blue >= 0 && rgbColor.Blue <= 1, "Blue must be between 0 and 1."); 299Debug.Assert(hue >= 0 && hue <= 1, "Output hue should be between 0 and 1."); 300Debug.Assert(lightness >= 0 && lightness <= 1, "Output lightness should be between 0 and 1."); 301Debug.Assert(saturation >= 0 && saturation <= 1, "Output saturation should be between 0 and 1."); 303Debug.Assert(!isHueDefined || isSaturationDefined, "If hue is defined, saturation must also be defined."); 315Debug.Assert(hlsColor.Lightness >= 0 && hlsColor.Lightness <= 1, "Lightness must be between 0 and 1."); 316Debug.Assert(hlsColor.Saturation >= 0 && hlsColor.Saturation <= 1, "Saturation must be between 0 and 1."); 341Debug.Assert(red >= 0 && red <= 1, "Output red should be between 0 and 1."); 342Debug.Assert(green >= 0 && green <= 1, "Output green should be between 0 and 1."); 343Debug.Assert(blue >= 0 && blue <= 1, "Output blue should be between 0 and 1."); 350Debug.Assert(n1 >= 0 && n1 <= 1, "n1 must be between 0 and 1."); 351Debug.Assert(n2 >= 0 && n2 <= 1, "n2 must be between 0 and 1."); 352Debug.Assert(hue >= -6 && hue < 12, "Hue must be between -6 (inclusive) and 12 (exclusive)."); 1150Debug.Assert(_tabCache != null, "_tabCache is null. GetShadow1 should only be called after GetHighlight1"); 1163Debug.Assert(_tabCache != null, "_tabCache is null. GetHighlight2 should only be called after GetHighlight1"); 1176Debug.Assert(_tabCache != null, "_tabCache is null. GetHighlight2 should only be called after GetHighlight1");
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
330Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 357Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 367Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
PresentationFramework.Luna (3)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
330Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 357Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 367Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
PresentationFramework.Royale (3)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
330Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 357Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 367Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
PresentationUI (5)
MS\Internal\Documents\Application\DocumentProperties.cs (1)
226System.Diagnostics.Debug.Assert(
MS\Internal\Documents\DocumentApplicationDocumentViewer.cs (1)
62System.Diagnostics.Debug.Assert(
MS\Internal\Documents\DocumentSignatureManager.cs (1)
839System.Diagnostics.Debug.Assert(
MS\Internal\Documents\RightsManagementManager.cs (1)
74System.Diagnostics.Debug.Assert(
MS\Internal\Documents\SignatureSummaryDialog.cs (1)
751Debug.Assert(item._displayImage != null, "Signature icon is null");
ReachFramework (80)
AlphaFlattener\BrushProxy.cs (37)
168Debug.Assert(pen != null, "pen expected"); 169Debug.Assert(brush != null, "brush expected"); 192Debug.Assert(_brush.BrushList == null, "Simple brush expected"); 273Debug.Assert(pen != null, "pen expected"); 274Debug.Assert(pen.Brush != null, "pen expected to have a brush"); 306Debug.Assert(pen != null, "pen expected"); 307Debug.Assert(pen.Brush != null, "pen expected to have a brush"); 544Debug.Assert(bp._opacityOnly == _opacityOnly, "Brush and OpacityMask can't mix in a single list"); 672Debug.Assert(Utility.IsRenderVisible(vb), "TileBrush.Viewbox area must be positive"); 679Debug.Assert(false, "IsOpaque(" + _brush.GetType() + ") not handled"); 739Debug.Assert(Utility.IsRenderVisible(vb), "TileBrush.Viewbox must be visible"); 775Debug.Assert(false, "IsTransparent not handled " + _brush.GetType()); 1082Debug.Assert(false, "Unexpected brush type"); 1255Debug.Assert(drawingBrush.Drawing != null, "DrawingBrush where Drawing == null should've been culled"); 1321Debug.Assert(_drawing != null, "_drawing primitive changed, but it's null"); 1939Debug.Assert(false, "Unhandled GradientBrush type"); 2136Debug.Assert(b._brush is SolidColorBrush, "SolidColorBrush expected"); 2137Debug.Assert(!b._opacityOnly, "OpacityMask not expected"); 2149Debug.Assert(first, "prefix only"); 2377Debug.Assert(bp != null, "Blending visible ImageBrush with another brush should yield non-empty brush"); 2653Debug.Assert(brush != null, "null brush"); 2696Debug.Assert(gb.MappingMode == BrushMappingMode.Absolute, "absolute brush"); 2704Debug.Assert(tb.ViewportUnits == BrushMappingMode.Absolute, "absolute brush required for BrushProxy"); 2894Debug.Assert(false, "Unhandled GradientBrush type"); 2919Debug.Assert(false, "Unandled Brush type"); 2949Debug.Assert(gsc != null && gsc.Count > 0, "BrushProxy.IsEmpty should return true upon GradientBrush with zero stops"); 2989Debug.Assert(!bounds.IsEmpty, "Bounds must not be empty for BitmapCacheBrush"); 3067Debug.Assert(!bounds.IsEmpty, "Bounds must not be empty for VisualBrush"); 3205Debug.Assert(false, "Unhandled ImageBrush.ImageSource type"); 3260Debug.Assert(brushB.Brush != null, "null brush not expected"); 3348Debug.Assert(false, "Brush type not expected"); 3373Debug.Assert(Utility.NormalizeOpacity(value) == value, "BrushProxy.Opacity must always be normalized"); 3501Debug.Assert(false, "Unexpected brush type"); 3621Debug.Assert(false, "Single brush expected"); 3646Debug.Assert( 3713Debug.Assert(Utility.IsValid(opacity), "Opacity comes from BrushProxy, should be valid"); 4182Debug.Assert(Utility.IsValid(opacity), "Opacity comes from BrushProxy, should be valid");
AlphaFlattener\DrawingContext.cs (11)
254Debug.Assert(b != null, "LinearGradientBrush expected"); 377Debug.Assert(b != null, "RadialGradientBrush expected"); 498Debug.Assert(one.BrushList.Count == 2, "Only two brushes allowed here"); 600Debug.Assert(brush != null, "brush expected"); 601Debug.Assert(shape != null, "shape expected"); 602Debug.Assert(!_costing, "in costing mode DrawImage"); 685Debug.Assert(false, "Opacity invalid at BrushProxyDecomposer"); 690Debug.Assert(false, "Opacity invalid at BrushProxyDecomposer"); 695Debug.Assert(brushTrans.IsIdentity, "brushTrans not supported"); 724Debug.Assert(pen == null, "no pen"); 932Debug.Assert(!_costing, "in costing mode DrawyGlyphs");
AlphaFlattener\Flattener.cs (2)
92Debug.Assert(Utility.IsValid(opacity) && Utility.IsValid(tree.Opacity), "Invalid opacity encountered, should've been normalized in conversion to Primitive"); 1177Debug.Assert(false, "Wrong Primitive type");
AlphaFlattener\ImageProxy.cs (2)
177Debug.Assert(opacityBrush.ViewportUnits == BrushMappingMode.Absolute, "TileBrush must have absolute viewport by this point"); 305Debug.Assert(!opacityOnly, "Opaque image OpacityMask should not be blended with brush");
AlphaFlattener\Optimizer.cs (1)
88Debug.Assert(geometry != null, "No geometry available for primitive");
AlphaFlattener\Primitive.cs (9)
266Debug.Assert(Utility.NormalizeOpacity(value) == value, "Opacity should be normalized during tree walking"); 677Debug.Assert(Brush == null, "no brush expected"); 1315Debug.Assert((Brush != null) || (Pen != null), "empty primitive"); 1388Debug.Assert(tb.ViewboxUnits == BrushMappingMode.Absolute, "Absolute Viewbox expected"); 1857Debug.Assert(false, "Image over Brush?"); 2027Debug.Assert(false, "GetShapeGeometry on Canvas"); 2033Debug.Assert(false, "Exclude on Canvas"); 2038Debug.Assert(false, "BlendBrush on Canvas"); 2045Debug.Assert(false, "BlendOverImage on Canvas");
AlphaFlattener\PrimitiveRenderer.cs (1)
66Debug.Assert(_brush == null, "no brush");
AlphaFlattener\Utility.cs (3)
978Debug.Assert(false, "Unsupported PathSegment"); 1614Debug.Assert(false, "Unhandled TileBrush type"); 1685Debug.Assert(IsValidViewbox(viewbox, brush.Stretch != Stretch.None) &&
Packaging\XpsManager.cs (2)
1421Debug.Assert(package != null, "package cannot be null"); 1466Debug.Assert(package != null, "package cannot be null");
PrintConfig\PrintSchemaShim.cs (1)
663Debug.Assert(false, "PrintTicketScope enum is out of range");
Serialization\DrawingContextFlattener.cs (2)
91Debug.Assert(Utility.IsValid(opacity), "Invalid opacity should clip subtree"); 101Debug.Assert(!BrushProxy.IsEmpty(opacityMask), "empty opacity mask should not result in Push");
Serialization\Manager\MetroSerializationManager.cs (1)
854Debug.Assert(propertyInfo.PropertyType == dependencyProperty.PropertyType,
Serialization\VisualSerializer.cs (7)
265Debug.Assert(!BrushProxy.IsEmpty(brush), "Should not be serializing empty brush"); 395Debug.Assert(pos >= 0, "Missing offset"); 828Debug.Assert(false, "Brush not supported"); 1442Debug.Assert(forFill || forStroke, "Either forFill or forStoke should be true"); 1685Debug.Assert(_nameAttr.Length > 0, "Empty _nameAttr"); 2354Debug.Assert(nameAttr == null || nameAttr.Length > 0, "Bad name attribute"); 2389Debug.Assert(_nameAttr == null, "Empty");
Serialization\VisualTreeFlattener.cs (1)
656Debug.Assert(_visualDepth >= 0, "StartVisual/EndVisual mismatch");
System.Collections (5)
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (1)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
System\Collections\Generic\LinkedList.cs (4)
389Debug.Assert(head == null && count == 0, "LinkedList must be empty when this method is called!"); 399Debug.Assert(node.list == this, "Deleting the node from another list!"); 400Debug.Assert(head != null, "This method shouldn't be called on empty list!"); 403Debug.Assert(count == 1 && head == node, "this should only be true for a list with only one node");
System.Collections.Concurrent (15)
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (1)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
System\Collections\Concurrent\BlockingCollection.cs (6)
257Debug.Assert(tryAddReturnValue, "TryAdd() was expected to return true."); 287Debug.Assert(tryAddReturnValue, "TryAdd() was expected to return true."); 458Debug.Assert((observedAdders + 1) <= (~COMPLETE_ADDING_ON_MASK), "The number of concurrent adders thread exceeded the maximum limit."); 767Debug.Assert(tryAddAnyReturnValue >= 0 && tryAddAnyReturnValue < collections.Length, 809Debug.Assert(tryAddAnyReturnValue >= 0 && tryAddAnyReturnValue < collections.Length, 1168Debug.Assert(returnValue >= 0 && returnValue < collections.Length,
System\Collections\Concurrent\ConcurrentBag.cs (2)
739Debug.Assert(_tailIndex == tail, "No other thread should be changing _tailIndex"); 1034Debug.Assert(
System\Collections\Concurrent\ConcurrentDictionary.cs (3)
769Debug.Assert(index < int.MaxValue, "This method should only be called when there's no overflow risk"); 784Debug.Assert(index < int.MaxValue, "This method should only be called when there's no overflow risk"); 799Debug.Assert(index < int.MaxValue, "This method should only be called when there's no overflow risk");
System\Collections\Concurrent\PartitionerStatic.cs (3)
694Debug.Assert(_useSingleChunking, "Expected _useSingleChecking to be true"); 744Debug.Assert(!_useSingleChunking, "Did not expect to be in single-chunking mode"); 1659Debug.Assert((DEFAULT_BYTES_PER_CHUNK % IntPtr.Size) == 0, "bytes per chunk should be a multiple of pointer size");
System.Collections.Immutable (10)
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (1)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
System\Collections\Frozen\FrozenDictionary.cs (1)
116Debug.Assert(source.Count > 0, "Empty sources should have been filtered out by caller");
System\Collections\Frozen\FrozenSet.cs (1)
62Debug.Assert(source.Count > 0, "Empty sources should have been filtered out by caller");
System\Collections\Frozen\FrozenSetInternalBase.cs (7)
33Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used."); 60Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used."); 87Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used."); 103Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used."); 131Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used."); 147Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used."); 192Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used.");
System.Collections.NonGeneric (1)
System\Collections\SortedList.cs (1)
219Debug.Assert(_size == 0, "Size is not zero");
System.ComponentModel.Annotations (4)
System\ComponentModel\DataAnnotations\EnumDataTypeAttribute.cs (1)
69Debug.Assert(valueType == value.GetType(), "The valueType should equal the Type of the value");
System\ComponentModel\DataAnnotations\UIHintAttribute.cs (2)
146Debug.Assert(leftParams != null, "leftParams shouldn't be null"); 147Debug.Assert(rightParams != null, "rightParams shouldn't be null");
System\ComponentModel\DataAnnotations\ValidationAttribute.cs (1)
76Debug.Assert(populateErrorMessageResourceAccessor is false, "Use the default constructor instead");
System.ComponentModel.EventBasedAsync (1)
System\ComponentModel\BackgroundWorker.cs (1)
167Debug.Assert(_asyncOperation != null, "_asyncOperation not initialized");
System.ComponentModel.TypeConverter (70)
System\ComponentModel\AmbientValueAttribute.cs (1)
32Debug.Assert(IDesignerHost.IsSupported, "Runtime instantiation of this attribute is not allowed with trimming.");
System\ComponentModel\DecimalConverter.cs (1)
49Debug.Assert(ctor != null, "Expected constructor to exist.");
System\ComponentModel\Design\DesigntimeLicenseContext.cs (1)
52Debug.Assert(fileName != null && fileName.Length > 0, "Cannot get local path, fileName is not valid");
System\ComponentModel\Design\DesigntimeLicenseContextSerializer.cs (1)
93Debug.Assert(_stream.Position != 0, "Expected the first byte to be read first");
System\ComponentModel\Design\Serialization\MemberRelationshipService.cs (1)
151Debug.Assert(o is RelationshipEntry, "This is only called indirectly from a dictionary only containing RelationshipEntry structs.");
System\ComponentModel\EventDescriptorCollection.cs (3)
349Debug.Assert(foundCount == eventCount, "We did not completely fill our event array"); 421Debug.Assert(count == 0 || array != null, "if array is null, count should be 0"); 422Debug.Assert(array == null || count <= array.Length, "Trying to enumerate more than the array contains");
System\ComponentModel\ExtendedPropertyDescriptor.cs (5)
25Debug.Assert(extenderInfo != null, "ExtendedPropertyDescriptor must have extenderInfo"); 26Debug.Assert(provider != null, "ExtendedPropertyDescriptor must have provider"); 47Debug.Assert(extender != null, "The original PropertyDescriptor must be non-null"); 51Debug.Assert(attr != null, "The original PropertyDescriptor does not have an ExtenderProvidedPropertyAttribute"); 56Debug.Assert(reflectDesc != null, "The original PropertyDescriptor has an invalid ExtenderProperty");
System\ComponentModel\GuidConverter.cs (1)
61Debug.Assert(ctor != null, "Expected constructor to exist.");
System\ComponentModel\LicenseManager.cs (3)
196Debug.Assert(providerType != null, "Type cannot ever be null"); 205Debug.Assert(type != null, "IsValid Type cannot ever be null"); 216Debug.Assert(type != null, "IsValid Type cannot ever be null");
System\ComponentModel\LicFileLicenseProvider.cs (1)
52Debug.Assert(context != null, "No context provided!");
System\ComponentModel\MaskedTextProvider.cs (14)
635Debug.Assert(AssignedEditPositionCount >= 0, "Invalid count of assigned chars."); 647Debug.Assert(AssignedEditPositionCount >= 0, "Invalid count of assigned chars."); 1266Debug.Assert(input != null && position >= 0 && position < _testString.Length, "input param out of range."); 1554Debug.Assert(startPosition >= 0 && startPosition <= endPosition && endPosition < _testString.Length, "Out of range input value."); 1946Debug.Assert(AssignedEditPositionCount >= 0, "Invalid count of assigned chars."); 1956Debug.Assert(startPosition >= 0 && endPosition >= 0 && endPosition >= startPosition && endPosition < _testString.Length, "position out of range."); 2025Debug.Assert(position >= 0 && position < _testString.Length, "Position out of range."); 2037Debug.Assert(position >= 0 && position < _testString.Length, "Position out of range."); 2038Debug.Assert(charDescriptor != null, "Null character descriptor."); 2051Debug.Assert(!IsLiteralPosition(charDex), "Setting char in literal position."); 2084Debug.Assert(AssignedEditPositionCount <= EditPositionCount, "Invalid count of assigned chars."); 2162Debug.Assert(position >= 0 && position < _testString.Length, "Position out of range."); 2420Debug.Assert(input != null, "null input."); 2421Debug.Assert(position >= 0, "Position out of range.");
System\ComponentModel\NullableConverter.cs (1)
111Debug.Assert(ci != null, "Couldn't find constructor");
System\ComponentModel\PropertyDescriptorCollection.cs (1)
367Debug.Assert(foundCount == propCount, "We did not completely fill our property array");
System\ComponentModel\ReflectEventDescriptor.cs (6)
99Debug.Assert(eventInfo.ReflectedType!.IsAssignableFrom(componentClass), "eventInfo.ReflectedType is used below, but only componentClass is annotated with DynamicallyAccessedMembers. Ensure ReflectedType is in componentClass's hierarchy."); 236Debug.Assert(_componentClass != null, "Must have a component class for FilterAttributes"); 262Debug.Assert(currentReflectType != null, "currentReflectType cannot be null"); 263Debug.Assert(currentReflectType.IsAssignableFrom(_componentClass), "currentReflectType must be in _componentClass's hierarchy"); 383Debug.Assert(currentReflectType != null, "currentReflectType cannot be null"); 384Debug.Assert(currentReflectType.IsAssignableFrom(_componentClass), "currentReflectType must be in _componentClass's hierarchy");
System\ComponentModel\ReflectPropertyDescriptor.cs (2)
751Debug.Assert(_componentClass != null, "Must have a component class for FillAttributes"); 911Debug.Assert(component != null, "GetValue must be given a component");
System\ComponentModel\ReflectTypeDescriptionProvider.cs (7)
225Debug.Assert(table != null, "COMPAT: Editor table should not be null"); // don't throw; RTM didn't so we can't do it either. 246Debug.Assert(objectType != null, "Should have arg-checked before coming in here"); 771Debug.Assert(idx < extenderCount, "There are more extenders than we expect"); 776Debug.Assert(idx == extenderCount, "Wrong number of extenders"); 787Debug.Assert(idx < extenderCount, "There are more extenders than we expect"); 792Debug.Assert(idx == extenderCount, "Wrong number of extenders"); 920Debug.Assert(objectType != null, "Should have arg-checked before coming in here");
System\ComponentModel\ReflectTypeDescriptionProvider.ReflectedTypeData.cs (1)
232Debug.Assert(_converter != null, "There is no intrinsic setup in the hashtable for the Object type");
System\ComponentModel\TypeDescriptor.cs (16)
841Debug.Assert(converter != null, "Unexpected null TypeConverter."); 851Debug.Assert(converter != null, "Unexpected null TypeConverter."); 1644Debug.Assert(type != null, "Caller should validate"); 1732Debug.Assert(instance != null, "Caller should validate"); 1831Debug.Assert(target.Next == null, "Delegating provider should always be the last provider in the chain."); 1871Debug.Assert(pipelineType != PIPELINE_ATTRIBUTES, "PipelineAttributeFilter is not supported for attributes"); 1961Debug.Assert(cache == null || list == null || !cache.Contains(s_pipelineFilterKeys[pipelineType]), "Earlier pipeline stage should have removed our cache"); 2019Debug.Assert(suffix != null, "Name collision with non-extender property."); 2922Debug.Assert(newAttrs[idx] != null, "_attributes contains a null member"); 3089Debug.Assert(attrs != null, "Someone should have handled this"); 3100Debug.Assert(className != null, "Someone should have handled this"); 3120Debug.Assert(converter != null, "Someone should have handled this"); 3162Debug.Assert(events != null, "Someone should have handled this"); 3174Debug.Assert(events != null, "Someone should have handled this"); 3186Debug.Assert(properties != null, "Someone should have handled this"); 3200Debug.Assert(properties != null, "Someone should have handled this");
System\ComponentModel\UriTypeConverter.cs (1)
74Debug.Assert(ctor != null, "Couldn't find constructor");
System\ComponentModel\VersionConverter.cs (1)
75Debug.Assert(ctor != null, "Couldn't find constructor");
System\Drawing\ColorConverter.cs (1)
125Debug.Assert(member != null, "Could not convert color to member. Did someone change method name / signature and not update ColorConverter?");
System\Timers\Timer.cs (1)
155Debug.Assert(_timer != null, $"{nameof(_timer)} was expected not to be null");
System.Composition.Hosting (2)
System\Composition\Hosting\Core\CompositionDependency.cs (1)
166Debug.Assert(IsError, "Should be in error state.");
System\Composition\Hosting\Core\CompositionOperation.cs (1)
86Debug.Assert(sharingLock != null, "Expected a sharing lock to be passed.");
System.Console (5)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\ConsolePal.Unix.ConsoleStream.cs (2)
27Debug.Assert(handle != null, "Expected non-null console handle"); 28Debug.Assert(!handle.IsInvalid, "Expected valid console handle");
System\ConsolePal.Unix.cs (1)
618Debug.Assert(foundByteDstPos < foundByteDst.Length, "Should only be called when there's room for at least one byte.");
System.Data.Common (553)
src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (3)
40Debug.Assert(ADP.IsCatchableExceptionType(e), "Invalid exception type, should have been re-thrown!"); 243Debug.Assert(e != null, "Unexpected null exception!"); 263Debug.Assert(e != null, "Unexpected null exception!");
src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (7)
422Debug.Assert(((0 < keyname.Length) && (';' != keyname[0]) && !char.IsWhiteSpace(keyname[0]) && (-1 == keyname.IndexOf('\u0000'))) == compValue, "IsValueValid mismatch with regex"); 438Debug.Assert(KeyIndex == parser.GroupNumberFromName("key"), "wrong key index"); 439Debug.Assert(ValueIndex == parser.GroupNumberFromName("value"), "wrong value index"); 547Debug.Assert(null != connectionString, "null connectionstring"); 569Debug.Assert(IsKeyNameValid(keyname), "ParseFailure, invalid keyname"); 570Debug.Assert(IsValueValidInternal(keyvalue), "parse failure, invalid keyvalue"); 651Debug.Assert(expanded, "password/pwd was not removed");
src\libraries\Common\src\System\Data\Common\NameValuePair.cs (2)
17Debug.Assert(!string.IsNullOrEmpty(name), "empty keyname"); 27Debug.Assert(0 < _length, "NameValuePair zero Length usage");
System\Data\Common\AdapterUtil.Common.cs (4)
27Debug.Assert(e != null, "TraceException: null Exception"); 36Debug.Assert(IsCatchableExceptionType(e), "Invalid exception type, should have been re-thrown!"); 728Debug.Assert(0 == (rowStates & dataRow.RowState), "flagged RowState"); 753Debug.Assert(0 == (rowStates & dataRow.RowState), "flagged RowState");
System\Data\Common\BigIntegerStorage.cs (3)
44Debug.Assert(0 <= recordNo, "Invalid record"); 45Debug.Assert(null != value, "null value"); 129Debug.Assert(null != value, "null value");
System\Data\Common\BooleanStorage.cs (3)
95Debug.Assert(0 <= recordNo, "Invalid record"); 96Debug.Assert(null != value, "null value"); 149System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\ByteStorage.cs (3)
167Debug.Assert(0 <= recordNo, "Invalid record"); 168System.Diagnostics.Debug.Assert(null != value, "null value"); 221System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\CharStorage.cs (3)
94Debug.Assert(0 <= recordNo, "Invalid record"); 95System.Diagnostics.Debug.Assert(null != value, "null value"); 148System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\DataAdapter.cs (2)
37Debug.Assert(readerHandler.FieldCount > 0, "Scenario expects non-empty results but no fields reported by reader"); 449Debug.Assert(null != dataTables[i], "null DataTable Fill");
System\Data\Common\DataColumnMapping.cs (3)
91Debug.Assert(null != columns, "GetDataColumnBySchemaAction: unexpected null DataColumnCollection"); 97Debug.Assert(null != dataColumn, "GetDataColumnBySchemaAction: unexpected null dataColumn"); 117Debug.Assert(dataTable != null, "Should not call with a null DataTable");
System\Data\Common\DataColumnMappingCollection.cs (2)
350Debug.Assert((null != _items) && (0 <= index) && (index < Count), "RemoveIndex, invalid"); 381Debug.Assert((null != _items) && (0 <= index) && (index < Count), "RemoveIndex, invalid");
System\Data\Common\DataRecordInternal.cs (2)
21Debug.Assert(null != schemaInfo, "invalid attempt to instantiate DataRecordInternal with null schema information"); 22Debug.Assert(null != values, "invalid attempt to instantiate DataRecordInternal with null value[]");
System\Data\Common\DataStorage.cs (11)
142Debug.Assert(storageType == GetStorageType(type), "Incorrect storage type specified"); 293Debug.Assert(typeCode == GetStorageType(dataType), "Incorrect storage type specified"); 461Debug.Assert(result == dataType.IsValueType, "typeCode mismatches dataType"); 474Debug.Assert(typeCode == GetStorageType(dataType), "typeCode mismatches dataType"); 501Debug.Assert(nullable == typeof(INullable).IsAssignableFrom(dataType), "INullable"); 502Debug.Assert(changeTracking == typeof(System.ComponentModel.IChangeTracking).IsAssignableFrom(dataType), "IChangeTracking"); 503Debug.Assert(revertibleChangeTracking == typeof(System.ComponentModel.IRevertibleChangeTracking).IsAssignableFrom(dataType), "IRevertibleChangeTracking"); 504Debug.Assert(xmlSerializable == typeof(IXmlSerializable).IsAssignableFrom(dataType), "IXmlSerializable"); 509Debug.Assert(dataType != null, "Type should not be null"); 520Debug.Assert(typeCode == GetStorageType(dataType), "typeCode mismatches dataType"); 591Debug.Assert(null != type, "null type");
System\Data\Common\DataTableMappingCollection.cs (1)
287Debug.Assert((null != _items) && (0 <= index) && (index < Count), "RemoveIndex, invalid");
System\Data\Common\DateTimeOffsetStorage.cs (3)
106System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 107System.Diagnostics.Debug.Assert(null != value, "null value"); 156System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\DateTimeStorage.cs (3)
106System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 107System.Diagnostics.Debug.Assert(null != value, "null value"); 156System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\DBCommandBuilder.cs (9)
799Debug.Assert(!string.IsNullOrEmpty(_quotedBaseTableName), "no table name"); 820Debug.Assert(!string.IsNullOrEmpty(_quotedBaseTableName), "no table name"); 911Debug.Assert(!string.IsNullOrEmpty(_quotedBaseTableName), "no table name"); 1135Debug.Assert(!string.IsNullOrEmpty(sourceColumn), "empty source column"); 1167Debug.Assert(null != _parameterNames, "How can we have a parameterName without a _parameterNames collection?"); 1168Debug.Assert(null != _parameterMarkerFormat, "How can we have a _parameterNames collection but no _parameterMarkerFormat?"); 1216Debug.Assert(null != _parameterNames, "How can we have a parameterName without a _parameterNames collection?"); 1217Debug.Assert(null != _parameterMarkerFormat, "How can we have a _parameterNames collection but no _parameterMarkerFormat?"); 1402Debug.Assert(null != p, "null CreateParameter");
System\Data\Common\DbConnectionOptions.cs (2)
159Debug.Assert(!_useOdbcRules, "ExpandKeyword not ready for Odbc"); 168Debug.Assert(keyname == keyname.ToLowerInvariant(), "missing ToLower");
System\Data\Common\DbDataAdapter.cs (22)
775Debug.Assert(DbType.Int32 == parameter.DbType, "unexpected DbType"); 937Debug.Assert(null != tableMapping, "null TableMapping when MissingMappingAction.Error"); 966Debug.Assert((null != dataRows) && (0 < dataRows.Length), "Update: bad dataRows"); 967Debug.Assert(null != tableMapping, "Update: bad DataTableMapping"); 1451Debug.Assert(null == rowUpdatedEvent.Errors, "Continue - but contains an exception"); 1462Debug.Assert(null != connection, "unexpected null connection"); 1497Debug.Assert(null != rowUpdatedEvent, "null rowUpdatedEvent"); 1498Debug.Assert(null != dataCommand, "null dataCommand"); 1499Debug.Assert(rowUpdatedEvent.Command == dataCommand, "dataCommand differs from rowUpdatedEvent"); 1585Debug.Assert(null == rowUpdatedEvent.Errors, "Continue - but contains an exception"); 1597Debug.Assert(null != rowUpdatedEvent, "null rowUpdatedEvent"); 1619Debug.Assert(null != batchCommands, "null batchCommands?"); 1638Debug.Assert(null != row, "null dataRow?"); 1654Debug.Assert(null != batchCommands, "null batchCommands?"); 1670Debug.Assert(null != row, "null dataRow?"); 1706Debug.Assert(null != batchCommands, "null batchCommands?"); 1713Debug.Assert(null != row, "null dataRow?"); 1724Debug.Assert(null != dataRow, "null dataRow"); 1771Debug.Assert(null != command, "GetConnection3: null command"); 1772Debug.Assert(!string.IsNullOrEmpty(method), "missing method name"); 1783Debug.Assert(null != command, "GetConnection4: null command"); 1824Debug.Assert(null != connection, "QuietOpen: null connection");
System\Data\Common\DbEnumerator.cs (1)
60Debug.Assert(null != _schemaInfo && null != _descriptors, "unable to build schema information!");
System\Data\Common\DBSchemaRow.cs (3)
33Debug.Assert(null != dataRows, "GetSchemaRows: unexpected null dataRows"); 70Debug.Assert(null != _schemaTable.ColumnName, "no column ColumnName"); 84Debug.Assert(null != _schemaTable.Size, "no column Size");
System\Data\Common\DecimalStorage.cs (3)
172System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 173System.Diagnostics.Debug.Assert(null != value, "null value"); 217System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\DoubleStorage.cs (3)
167System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 168System.Diagnostics.Debug.Assert(null != value, "null value"); 221System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\Int16Storage.cs (3)
184System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 185System.Diagnostics.Debug.Assert(null != value, "null value"); 235System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\Int32Storage.cs (3)
183System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 184System.Diagnostics.Debug.Assert(null != value, "null value"); 234System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\Int64Storage.cs (3)
175System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 176System.Diagnostics.Debug.Assert(null != value, "null value"); 226System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\ObjectStorage.cs (3)
235Debug.Assert(null != value, "null value"); 422Debug.Assert(xmlReader is DataTextReader, "Invalid DataTextReader is being passed to customer"); 504Debug.Assert(xmlWriter is DataTextWriter, "Invalid DataTextWriter is being passed to customer");
System\Data\Common\SByteStorage.cs (3)
168System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 169System.Diagnostics.Debug.Assert(null != value, "null value"); 223System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\SingleStorage.cs (3)
168System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 169System.Diagnostics.Debug.Assert(null != value, "null value"); 222System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\SQLConvert.cs (16)
14Debug.Assert(value != null, "null argument in ConvertToSqlByte"); 32Debug.Assert(value != null, "null argument in ConvertToSqlInt16"); 51Debug.Assert(value != null, "null argument in ConvertToSqlInt32"); 74Debug.Assert(value != null, "null argument in ConvertToSqlInt64"); 99Debug.Assert(value != null, "null argument in ConvertToSqlDouble"); 132Debug.Assert(value != null, "null argument in ConvertToSqlDecimal"); 162Debug.Assert(value != null, "null argument in ConvertToSqlSingle"); 193Debug.Assert(value != null, "null argument in ConvertToSqlMoney"); 223Debug.Assert(value != null, "null argument in ConvertToSqlDateTime"); 241Debug.Assert(value != null, "null argument in ConvertToSqlBoolean"); 259Debug.Assert(value != null, "null argument in ConvertToSqlGuid"); 277Debug.Assert(value != null, "null argument in ConvertToSqlBinary"); 295Debug.Assert(value != null, "null argument in ConvertToSqlString"); 313Debug.Assert(value != null, "null argument in ConvertToSqlChars"); 329Debug.Assert(value != null, "null argument in ConvertToSqlBytes"); 561Debug.Assert(value is string || type == typeof(string), "invalid call to ChangeTypeForXML");
System\Data\Common\SQLTypes\SQLBinaryStorage.cs (3)
59Debug.Assert(null != value, "null value"); 116Debug.Assert(!DataStorage.IsObjectNull(value), "we should have null here"); 117Debug.Assert((value.GetType() == typeof(SqlBinary)), "wrong input type");
System\Data\Common\SQLTypes\SQlBooleanStorage.cs (3)
93Debug.Assert(null != value, "null value"); 150Debug.Assert(!DataStorage.IsObjectNull(value), "we should have null here"); 151Debug.Assert((value.GetType() == typeof(SqlBoolean)), "wrong input type");
System\Data\Common\SQLTypes\SQLBytesStorage.cs (2)
114Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 115Debug.Assert((value.GetType() == typeof(SqlBytes)), "wrong input type");
System\Data\Common\SQLTypes\SQLByteStorage.cs (3)
168Debug.Assert(null != value, "null value"); 226Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 227Debug.Assert((value.GetType() == typeof(SqlByte)), "wrong input type");
System\Data\Common\SQLTypes\SQLCharsStorage.cs (2)
117Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 118Debug.Assert((value.GetType() == typeof(SqlChars)), "wrong input type");
System\Data\Common\SQLTypes\SQLDateTimeStorage.cs (3)
95Debug.Assert(null != value, "null value"); 152Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 153Debug.Assert((value.GetType() == typeof(SqlDateTime)), "wrong input type");
System\Data\Common\SQLTypes\SQLDecimalStorage.cs (3)
167Debug.Assert(null != value, "null value"); 224Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 225Debug.Assert((value.GetType() == typeof(SqlDecimal)), "wrong input type");
System\Data\Common\SQLTypes\SQLDoubleStorage.cs (3)
168Debug.Assert(null != value, "null value"); 225Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 226Debug.Assert((value.GetType() == typeof(SqlDouble)), "wrong input type");
System\Data\Common\SQLTypes\SQLGuidStorage.cs (3)
60Debug.Assert(null != value, "null value"); 117Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 118Debug.Assert((value.GetType() == typeof(SqlGuid)), "wrong input type");
System\Data\Common\SQLTypes\SQLInt16Storage.cs (3)
168Debug.Assert(null != value, "null value"); 225Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 226Debug.Assert((value.GetType() == typeof(SqlInt16)), "wrong input type");
System\Data\Common\SQLTypes\SQLInt32Storage.cs (3)
168Debug.Assert(null != value, "null value"); 225Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 226Debug.Assert((value.GetType() == typeof(SqlInt32)), "wrong input type");
System\Data\Common\SQLTypes\SQLInt64Storage.cs (3)
169Debug.Assert(null != value, "null value"); 226Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 227Debug.Assert((value.GetType() == typeof(SqlInt64)), "wrong input type");
System\Data\Common\SQLTypes\SQLMoneyStorage.cs (3)
168Debug.Assert(null != value, "null value"); 225Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 226Debug.Assert((value.GetType() == typeof(SqlMoney)), "wrong input type");
System\Data\Common\SQLTypes\SQLSingleStorage.cs (3)
166Debug.Assert(null != value, "null value"); 223Debug.Assert(!DataStorage.IsObjectNull(value), "we should have null here"); 224Debug.Assert((value.GetType() == typeof(SqlSingle)), "wrong input type");
System\Data\Common\SQLTypes\SQLStringStorage.cs (3)
115Debug.Assert(null != value, "null value"); 178Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 179Debug.Assert((value.GetType() == typeof(SqlString)), "wrong input type");
System\Data\Common\SqlUDTStorage.cs (2)
189Debug.Assert(xmlReader is DataTextReader, "Invalid DataTextReader is being passed to customer"); 224Debug.Assert(xmlWriter is DataTextWriter, "Invalid DataTextWriter is being passed to customer");
System\Data\Common\StringStorage.cs (3)
102Debug.Assert(recordNo != -1, "Invalid (-1) parameter: 'recordNo'"); 103Debug.Assert(null != value, "null value"); 169Debug.Assert(null != value, "null value");
System\Data\Common\TimeSpanStorage.cs (3)
163System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 164System.Diagnostics.Debug.Assert(null != value, "null value"); 241System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\UInt16Storage.cs (3)
183System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 184System.Diagnostics.Debug.Assert(null != value, "null value"); 234System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\UInt32Storage.cs (3)
182System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 183System.Diagnostics.Debug.Assert(null != value, "null value"); 233System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\UInt64Storage.cs (3)
173System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 174System.Diagnostics.Debug.Assert(null != value, "null value"); 224System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\ConstraintCollection.cs (2)
284Debug.Assert(constraint != null, "Attempt to add null constraint to constraint array"); 564Debug.Assert(a1 != null && a2 != null, "Invalid Arguments");
System\Data\ConstraintEnumerator.cs (3)
46Debug.Assert(_constraints.Current is Constraint, "ConstraintEnumerator, contains object which is not constraint"); 60Debug.Assert(_currentObject != null, "GetObject should never be called w/ null currentObject."); 78Debug.Assert(CurrentObject != null, "GetObject should never be called w/ null currentObject.");
System\Data\DataColumn.cs (38)
646Debug.Assert(_defaultValue != null, "It should not have been set to null."); 858Debug.Assert(null != _storage, "no storage"); 867Debug.Assert(null != _storage, "no storage"); 876Debug.Assert(null != _storage, "no storage"); 887Debug.Assert(_simpleType.CanHaveMaxLength(), "expected simpleType to be string"); 1027Debug.Assert(2 <= _sortIndex.RefCount, "bad sortIndex refcount"); 1130Debug.Assert(null != _storage, "null storage"); 1138Debug.Assert(null != _storage, "no storage"); 1139Debug.Assert(null != value, "setting null, expecting dbnull"); 1141Debug.Assert(null != _table, "storage with no DataTable on column"); 1171Debug.Assert(null != _storage, "no storage"); 1180Debug.Assert(null != value, "setting null, expecting dbnull"); 1181Debug.Assert(null != _table, "storage with no DataTable on column"); 1182Debug.Assert(null != _storage, "no storage"); 1200Debug.Assert(null != _storage, "no storage"); 1239Debug.Assert(oldConstraint != null, "Should have found a column to remove from the collection."); 1254Debug.Assert(_table.Constraints.FindKeyConstraint(this) == null, "Should not be a duplication constraint in collection"); 1376Debug.Assert(IsStringType, "not a String or SqlString column"); 1396Debug.Assert(IsStringType, "not a String or SqlString column"); 1451Debug.Assert(null != _storage, "no storage"); 1471Debug.Assert(null != _storage, "null storage"); 1502Debug.Assert(null != _storage, "null storage"); 1508Debug.Assert(null != _storage, "null storage"); 1514Debug.Assert(null != _storage, "null storage"); 1591Debug.Assert(null != _storage, "no storage"); 1601Debug.Assert(null != _storage, "no storage"); 1636Debug.Assert(null != _storage, "no storage"); 1648Debug.Assert(rels != null, "Invalid ParentRelations"); 1652Debug.Assert(key.HasValue, "Invalid child key (null)"); 1660Debug.Assert(rels != null, "Invalid ChildRelations"); 1664Debug.Assert(key.HasValue, "Invalid parent key (null)"); 1760Debug.Assert(s != null, "Caller is responsible for missing element/attribute case"); 1773Debug.Assert(value != null && (value != DBNull.Value), "Caller is responsible for checking on DBNull"); 1780Debug.Assert(value != null && (value != DBNull.Value), "Caller is responsible for checking on DBNull"); 1791Debug.Assert(null != _storage, "no storage"); 1805Debug.Assert(!_dependentColumns.Contains(expressionColumn), "duplicate column - expected to be unique"); 1830Debug.Assert(null != col, "null datacolumn in expression dependencies"); 1959Debug.Assert(null != value && DataColumn.IsAutoIncrementType(value.GetType()) && !(value is BigInteger), "unexpected value for autoincrement");
System\Data\DataColumnCollection.cs (2)
548Debug.Assert(col.Computed, "invalid (non an expression) column in the expression dependent columns"); 861Debug.Assert(name != null, "Must specify a name");
System\Data\DataError.cs (4)
40Debug.Assert(column != null, "Invalid (null) argument"); 41Debug.Assert(column.Table != null, "Invalid (loose) column"); 88Debug.Assert(column._errors >= 0, "missing error counts"); 98Debug.Assert(_errorList[i]._column._errors >= 0, "missing error counts");
System\Data\DataException.cs (1)
313Debug.Assert(null != e, "TraceException: null Exception");
System\Data\DataRelation.cs (4)
415Debug.Assert(DataSet == null || !_nested, "this relation supposed to be not in dataset or not nested"); 485Debug.Assert(ChildTable != null, "On a DataSet, but not on Table. Bad state"); 595Debug.Assert(_parentKeyConstraint == null || value == null, "ParentKeyConstraint should not have been set already."); 626Debug.Assert(_childKeyConstraint == null || value == null, "ChildKeyConstraint should not have been set already.");
System\Data\DataRow.cs (15)
340Debug.Assert(!_inChangingEvent, "how are we in a changing event to cancel?"); 341Debug.Assert(-1 != _tempRecord, "how no propsed record to cancel?"); 357Debug.Assert(!_inChangingEvent, "how are we in a changing event to end?"); 512Debug.Assert(!_inChangingEvent, "how are we in a changing event to cancel?"); 513Debug.Assert(-1 != _tempRecord, "how no propsed record to cancel?"); 530Debug.Assert(!_inChangingEvent, "how are we in a changing event to end?"); 608Debug.Assert(-1 != _tempRecord, "missing temp record"); 609Debug.Assert(0 == _countColumnChange, "unexpected column change count"); 610Debug.Assert(null == _lastChangedColumn, "unexpected last column change"); 626Debug.Assert(-1 == _tempRecord, "unexpected temp record"); 1033Debug.Assert(0 != (DataViewRowState.Added & viewState), "not DataViewRowState.Added"); 1038Debug.Assert(_action == DataRowAction.Rollback || 0 != (DataViewRowState.Deleted & viewState), "not DataViewRowState.Deleted"); 1047Debug.Assert(0 != (DataViewRowState.ModifiedOriginal & viewState), "not DataViewRowState.ModifiedOriginal"); 1352Debug.Assert(relation != null, "The relation should not be null here."); 1447Debug.Assert(valueFromStorage.Equals(column.DataExpression.Evaluate(this, version)),
System\Data\DataSet.cs (7)
868Debug.Assert(null != _culture, "DataSet.Locale: null culture"); 1308Debug.Assert(value && !_rowChanges[index], "setting twice or to false"); 1340Debug.Assert(0 <= bitMatrix[i].HasChanges, "negative change count"); 1352Debug.Assert(bitMatrix[i].HasChanges <= table.Rows.Count, "to many changes"); 1390Debug.Assert(DataRowState.Added == rowState || 2240Debug.Assert(root.NamespaceURI != null, "root.NamespaceURI should not ne null, it should be empty string"); 2471Debug.Assert(reader.NodeType != XmlNodeType.Whitespace, "Should not be on Whitespace node");
System\Data\DataTable.cs (55)
275Debug.Assert(ds.RemotingFormat == SerializationFormat.Xml, "RemotingFormat must be SerializationFormat.Xml"); 324Debug.Assert(ds.Tables.Count == 1, "There should be exactly 1 table here"); 450Debug.Assert(Columns.Count == 0, "There is column in Table"); 1404Debug.Assert(null != _culture, "null culture"); 1475Debug.Assert(null != culture, "SetLocaleValue: no locale"); 1564Debug.Assert(nRel.Length == _nestedParentRelations.Length, "nestedParent cache is broken"); 1567Debug.Assert(null != nRel[i], "null relation"); 1568Debug.Assert(null != _nestedParentRelations[i], "null relation"); 1569Debug.Assert(nRel[i] == _nestedParentRelations[i], "unequal relations"); 1631Debug.Assert(2 <= primayKeyConstraint.ConstraintIndex.RefCount, "bad primaryKey index RefCount"); 1725Debug.Assert(_primaryKey == null || Constraints.FindConstraint(_primaryKey) == _primaryKey, "PrimaryKey is not in ConstraintCollection"); 2093Debug.Assert(value != null, "Value should not be null ??"); 2094Debug.Assert(value.ColumnMapping == MappingType.SimpleContent, "should be text node here"); 2158Debug.Assert(action == DataRowAction.Delete, "Unexpected SetNewRecord action in merge function."); 2245Debug.Assert(saveIdxRecord == ((saveRowState == DataRowState.Added) ? targetRow._newRecord : targetRow._oldRecord), "oops, you change index record without noticing it"); 2395Debug.Assert(clone != null, "The table passed in has to be newly created empty DataTable."); 2837Debug.Assert(null == _rowDiffId, "wasn't previously cleared"); 3126Debug.Assert(Enum.GetUnderlyingType(typeof(DataRowState)) == typeof(int), "Invalid DataRowState type"); 3551Debug.Assert(e != null, "e should not be null"); 3561Debug.Assert(e != null, "e should not be null"); 3617Debug.Assert((null != e) && ((null != _onRowChangedDelegate) || IsTypedDataTable), "OnRowChanged arguments"); 3630Debug.Assert((null != e) && ((null != _onRowChangingDelegate) || IsTypedDataTable), "OnRowChanging arguments"); 3643Debug.Assert((null != e) && ((null != _onRowDeletingDelegate) || IsTypedDataTable), "OnRowDeleting arguments"); 3656Debug.Assert((null != e) && ((null != _onRowDeletedDelegate) || IsTypedDataTable), "OnRowDeleted arguments"); 3759Debug.Assert(record != -1, "Record number must be given"); 3785Debug.Assert(oldIndex.Length == newIndex.Length, "Size oldIndexes and newIndexes should be the same"); 3786Debug.Assert(oldIndex.Length == _shadowIndexes!.Count, "Size of OldIndexes should be the same as size of Live indexes"); 4060Debug.Assert(null != _indexes, "unexpected null indexes"); 4279Debug.Assert(row != null, "Row can't be null."); 4294Debug.Assert(fireEvent, "SetNewRecord is called with wrong parameter"); 4300Debug.Assert(!row._inChangingEvent, "How can this row be in an infinite loop?"); 4551Debug.Assert(1 <= _shadowCount, "unexpected negative shadow count"); 4563Debug.Assert(0 == _shadowCount, "unexpected count"); 4569Debug.Assert(1 <= _shadowCount, "unexpected negative shadow count"); 4578Debug.Assert(0 < _indexes.Count, "unexpected"); 4601Debug.Assert(null == _loadIndex, "loadIndex should already be null"); 4690Debug.Assert(2 <= _loadIndex.RefCount, "bad loadIndex.RefCount"); 4697Debug.Assert(row != null, "Row can't be null for index record"); 4753Debug.Assert(_loadIndexwithCurrentDeleted != null, "loadIndexwithCurrentDeleted should not be null"); 4764Debug.Assert(_loadIndexwithOriginalAdded != null, "loadIndexwithOriginalAdded should not be null"); 4770Debug.Assert(2 <= indextoUse!.RefCount, "bad indextoUse.RefCount"); 4805Debug.Assert(row != null, "Row can't be null for index record"); 4878Debug.Assert(parentKey != null, "AddForeignKey: Invalid parameter.. related primary key is null"); 5196Debug.Assert(dataRow._tempRecord == recordNo, "tempRecord has been changed in event handler"); 5512Debug.Assert(tableList != null, "tableList shouldnot be null"); 6771Debug.Assert(_targetTable == null, "do not reuse this section"); 6773Debug.Assert(table._rowDiffId == null, "rowDiffId wasn't previously cleared"); 6775Debug.Assert(t_usedTables == null || !t_usedTables.Contains(table), 6793Debug.Assert(t_usedTables != null && t_usedTables.Contains(_targetTable), "missing Prepare before Cleanup"); 6811Debug.Assert(t_usedTables != null, message); 6822Debug.Assert(_targetDS == null, "do not reuse this section"); 6835Debug.Assert(!RowDiffIdUsageSection.t_usedTables.Contains(table), "Nested call with same table can cause data corruption!"); 6838Debug.Assert(table._rowDiffId == null, "rowDiffId wasn't previously cleared"); 6850Debug.Assert(RowDiffIdUsageSection.t_usedTables != null, "missing Prepare before Cleanup"); 7016Debug.Assert(column.Computed, "Only computed columns should be re-evaluated.");
System\Data\DataTableCollection.cs (1)
618Debug.Assert(_list.Count == tableList.Count, "Both lists should have equal numbers of tables");
System\Data\DataTableExtensions.cs (1)
218Debug.Assert(null != table, "null DataTable");
System\Data\DataView.cs (20)
275Debug.Assert(_rowViewCache.Count == CountFromIndex, "DataView.Count mismatch"); 360Debug.Assert(null != predicate, "null predicate"); 367Debug.Assert(DataRowVersion.Default != version, "not expecting Default"); 368Debug.Assert(DataRowVersion.Proposed != version, "not expecting Proposed"); 549Debug.Assert(null == _addNewRow, "AddNew addNewRow is not null"); 784Debug.Assert(null != _addNewRow, "null addNewRow"); 808Debug.Assert(flag, "didn't remove addNewRow"); 1099Debug.Assert(property != null, "property is null"); 1291Debug.Assert(null != row, "MaintainDataView.ItemAdded with null DataRow"); 1298Debug.Assert(flag, "row actually removed"); 1305Debug.Assert(0 <= index, "ItemAdded was actually deleted"); 1320Debug.Assert(null != row, "MaintainDataView.ItemDeleted with null DataRow"); 1321Debug.Assert(row != _addNewRow, "addNewRow being deleted"); 1342Debug.Assert(null == row, "MaintainDataView.Reset with non-null DataRow"); 1376Debug.Assert(((ListChangedType.ItemChanged == e.ListChangedType) && ((e.NewIndex == e.OldIndex) || (-1 == e.OldIndex))) || 1380Debug.Assert(0 <= e.NewIndex, "negative NewIndex"); 1471Debug.Assert(null != drv, "didn't contain addNewRow"); 1474Debug.Assert(rvc.Count == CountFromIndex, "didn't add expected count"); 1535Debug.Assert((0 == (DataViewRowState.ModifiedCurrent & newRowStates)) || 1552Debug.Assert(null == _comparison, "RelatedView should not have a comparison function");
System\Data\DataViewListener.cs (2)
96Debug.Assert(null == _table, "DataViewListener already registered table"); 152Debug.Assert(null == _index, "DataviewListener already registered index");
System\Data\EnumerableRowCollection.cs (2)
76Debug.Assert(!isDataViewable || table != null, "isDataViewable bug table is null"); 104Debug.Assert(null != enumerableRows, "null enumerableRows");
System\Data\Filter\AggregateNode.cs (2)
44Debug.Assert(columnName != null, "Invalid parameter column name (null)."); 207Debug.Assert(DataRowVersion.Original == version, "wrong version");
System\Data\Filter\BinaryNode.cs (2)
1110Debug.Assert((!DataStorage.IsObjectNull(vLeft)) && (!DataStorage.IsObjectNull(vRight)), "Impossible."); 1675Debug.Assert(patchars[length - 1] == '*' || patchars[length - 1] == '%', "Invalid LIKE pattern formed.. ");
System\Data\Filter\DataExpression.cs (2)
94Debug.Assert(_parsed, "Invalid calling order: Bind() before Parse()"); 220Debug.Assert(_dependency != null, "GetDependencies: null, we should have created an empty list");
System\Data\Filter\ExpressionParser.cs (32)
294Debug.Assert(_text[_start] == '\'' && _text[_pos - 1] == '\'', "The expression contains an invalid string constant"); 295Debug.Assert(_pos - _start > 1, "The expression contains an invalid string constant"); 301Debug.Assert(_text[_start] == '#' && _text[_pos - 1] == '#', "The expression contains invalid date constant."); 302Debug.Assert(_pos - _start > 2, "The expression contains invalid date constant '{0}'."); 322Debug.Assert(_topOperator > 0, "Empty operator stack!!"); 393Debug.Assert(_topOperator > 1, "melformed operator stack."); 403Debug.Assert(opInfo._priority == Operators.PriParen, "melformed operator stack."); 415Debug.Assert(_topNode > 0 && NodePeek()!.GetType() == typeof(FunctionNode), "The function node should be created on '('"); 549Debug.Assert(_topNode == 1 || _topNode == 0, "Invalid Node Stack"); 562Debug.Assert(_token == Tokens.LeftParen, "ParseAggregateArgument(): Invalid argument, token <> '('"); 618Debug.Assert(_topNode > 0, "NodePop(): Corrupted node stack"); 620Debug.Assert(null != node, "null NodePop"); 640Debug.Assert(null != node, "null NodePush"); 658Debug.Assert(pri > Operators.PriStart && pri <= Operators.PriMax, "Invalid priority value"); 664Debug.Assert(_topOperator > 0, "Empty operator stack!!"); 670Debug.Assert(opInfo._priority >= pri, "Invalid prioriry value"); 710Debug.Assert(opInfo._op == Operators.Plus || 719Debug.Assert(nodeLeft != null, "Invalid left operand"); 720Debug.Assert(nodeRight != null, "Invalid right operand"); 751Debug.Assert(nodeLeft == null, "Invalid left operand"); 752Debug.Assert(nodeRight != null, "Invalid right operand"); 766Debug.Assert(expr != null, "Failed to create expression"); 992Debug.Assert(_pos != 0, "We have at least one digit in the buffer, ScanNumeric()"); 993Debug.Assert(IsDigit(text[_pos - 1]), "We have at least one digit in the buffer, ScanNumeric(), not a digit"); 1053Debug.Assert(chEnd != '\0', "Invalid bracket value"); 1054Debug.Assert(esc != '\0', "Invalid escape value"); 1072Debug.Assert(text[_pos] == chEnd, "Invalid bracket value"); 1111Debug.Assert(_token == Tokens.Name, "Exprecing an identifier."); 1112Debug.Assert(_pos > _start, "Exprecing an identifier."); 1115Debug.Assert(name != null, "Make sure the arguments for Compare method are OK"); 1125Debug.Assert(s_reservedwords[i]._word != null, "Make sure the arguments for Compare method are OK"); 1145Debug.Assert(_token == Tokens.Name, "Exprecing an identifier.");
System\Data\Filter\FunctionNode.cs (5)
123Debug.Assert(_info < s_funcs.Length && _info >= 0, "Invalid function info."); 127Debug.Assert(_argumentCount == s_funcs[_info]._argumentCount || s_funcs[_info]._isVariantArgumentList, "Invalid argument argumentCount."); 198Debug.Assert(_info > -1, "All function nodes should be bound at this point."); // default info is -1, it means if not bounded, it should be -1, not 0!! 258Debug.Assert(_info > -1, "Optimizing unbound function "); // default info is -1, it means if not bounded, it should be -1, not 0!! 396Debug.Assert(_argumentCount == 2, "Invalid argument argumentCount: ");
System\Data\Filter\LookupNode.cs (2)
58Debug.Assert(_relation != null, "Invalid relation: no parent table."); 59Debug.Assert(_columnName != null, "All Lookup expressions have columnName set.");
System\Data\Filter\ZeroOpNode.cs (2)
21Debug.Assert(op == Operators.True || op == Operators.False || op == Operators.Null, "Invalid zero-op"); 40Debug.Assert(_op == Operators.True || _op == Operators.False || _op == Operators.Null, "Invalid zero-op");
System\Data\ForeignKeyConstraint.cs (1)
759Debug.Assert(Table == RelatedTable, "We call this clone just if we have the same datatable as parent and child ");
System\Data\LinqDataView.cs (2)
39Debug.Assert(table != null, "null DataTable"); 112Debug.Assert(!(!string.IsNullOrEmpty(base.Sort) && base.SortComparison != null),
System\Data\Merger.cs (2)
269Debug.Assert(MissingSchemaAction.Ignore == _missingSchemaAction, "MergeSchema failed"); 522Debug.Assert(MissingSchemaAction.Error == _missingSchemaAction ||
System\Data\ProviderBase\DataReaderContainer.cs (6)
30Debug.Assert(null != dataReader, "null dataReader"); 53Debug.Assert(null != fieldName, "null GetName"); 81Debug.Assert(null != dataReader, "null dbDataReader"); 98Debug.Assert(0 <= fieldCount, "negative FieldCount"); 107Debug.Assert(null != fieldType, "null FieldType"); 139Debug.Assert(0 <= fieldCount, "negative FieldCount");
System\Data\ProviderBase\SchemaMapping.cs (18)
64Debug.Assert(null != adapter, nameof(adapter)); 65Debug.Assert(null != dataReader, nameof(dataReader)); 66Debug.Assert(0 < dataReader.FieldCount, "FieldCount"); 67Debug.Assert(null != dataset || null != datatable, "SchemaMapping - null dataSet"); 68Debug.Assert(SchemaType.Mapped == schemaType || SchemaType.Source == schemaType, "SetupSchema - invalid schemaType"); 284Debug.Assert(_mappedLength == _indexMap!.Length, "incorrect precomputed length"); 299Debug.Assert(_mappedLength == Math.Min(_readerDataValues!.Length, _mappedDataValues!.Length), "incorrect precomputed length"); 363Debug.Assert(0 == _mappedMode, "incorrect mappedMode"); 364Debug.Assert((null == _chapterMap) && (null == _indexMap) && (null == _mappedDataValues), "incorrect MappedValues"); 367Debug.Assert((null == _chapterMap) && (null == _indexMap) && (null != _mappedDataValues), "incorrect MappedValues"); 371Debug.Assert((null == _chapterMap) && (null != _indexMap) && (null != _mappedDataValues), "incorrect MappedValues"); 375Debug.Assert((null != _chapterMap) && (null == _indexMap) && (null != _mappedDataValues), "incorrect MappedValues"); 379Debug.Assert((null != _chapterMap) && (null != _indexMap) && (null != _mappedDataValues), "incorrect MappedValues"); 472Debug.Assert(null != _dataSet, "if chapters, then Fill(DataSet,...) not Fill(DataTable,...)"); 523Debug.Assert(rgcol != null, "invalid call to ResizeArray"); 524Debug.Assert(len <= rgcol.Length, "invalid len passed to ResizeArray"); 769Debug.Assert(null != schemaRows, "SchemaSetup - null DbSchemaRow[]"); 770Debug.Assert(_dataReader.FieldCount <= schemaRows.Length, "unexpected fewer rows in Schema than FieldCount");
System\Data\RbTree.cs (30)
321Debug.Assert(_inUseNodeCount - 1 == SubTreeSize(root), "count mismatch"); 371Debug.Assert(page._slots[slotId]._leftId == NIL, "node not cleared"); 372Debug.Assert(page._slots[slotId]._rightId == NIL, "node not cleared"); 373Debug.Assert(page._slots[slotId]._parentId == NIL, "node not cleared"); 374Debug.Assert(page._slots[slotId]._nextId == NIL, "node not cleared"); 377Debug.Assert(page._slots[slotId]._nodeColor == NodeColor.red, "node not cleared"); 550Debug.Assert(NIL != x_id, "nil left"); 551Debug.Assert(NIL != z_id, "nil right"); 580Debug.Assert(-1 == position, "KEY_SEARCH_AND_INDEX with bad position"); 591Debug.Assert((NIL == Left(z_id)) || (0 > Compare(root_id, Left(z_id), z_id)), "Left is not left"); 598Debug.Assert((NIL == Right(z_id)) || (0 < Compare(root_id, Right(z_id), z_id)), "Right is not right"); 841Debug.Assert(_accessMethod == TreeAccessMethod.INDEX_ONLY, "not expecting anything else"); 1229Debug.Assert((NIL == Left(x_id)) || (0 > Compare(root_id, Left(x_id), x_id)), "Search duplicate Left is not left"); 1236Debug.Assert((NIL == Right(x_id)) || (0 < Compare(root_id, Right(x_id), x_id)), "Search duplicate Right is not right"); 1259Debug.Assert((NIL == Left(x_id)) || (0 > Compare(NIL, Left(x_id), x_id)), "Search Left is not left"); 1266Debug.Assert((NIL == Right(x_id)) || (0 < Compare(NIL, Right(x_id), x_id)), "Search Right is not right"); 1347Debug.Assert(NIL != node, "GetIndexByNode(NIL)"); 1513Debug.Assert(NIL == Next(x_id), "has unexpected satellite tree"); 1698Debug.Assert(nodeId != NIL, " in SetParent nodeId == NIL"); 1709Debug.Assert(nodeId != NIL, " in SetColor nodeId == NIL"); 1740Debug.Assert(nodeId != NIL && 1786Debug.Assert(myCorrectSize == size, "VerifySize"); 1907Debug.Assert(null != tree, "null tree"); 1908Debug.Assert((NIL == _nodeID && NIL == _mainTreeNodeID) || (NIL != _nodeID), "MainTreeNodeID is not NIL"); 1912Debug.Assert(NIL != tree.Next(_mainTreeNodeID), "MainTreeNodeID should have a Next"); 1918Debug.Assert(tree.root == node, "MainTreeNodeID parent change doesn't align"); 1922Debug.Assert(NIL == tree.Next(_nodeID), "NodeID should not have a Next"); 1935Debug.Assert(NIL == tree.Next(node), "duplicate node should not have a next"); 1939Debug.Assert((NIL == _mainTreeNodeID && tree.root == node) || 1989Debug.Assert((_slotMap[segmentPos] & freeSlot) == 0, "Slot position segment[segmentPos ]: [freeSlot] is in use. Expected to be empty");
System\Data\RecordManager.cs (9)
115Debug.Assert(record >= 0 && record < _recordCapacity, "NewRecord: Invalid record"); 121Debug.Assert(-1 <= record && record < _recordCapacity, "invalid record"); 185Debug.Assert(record >= 0 && record < _rows.Length, "Invalid record number"); 190Debug.Assert(record >= 0 && record < _rows.Length, "Invalid record number"); 212Debug.Assert(src != null, "Can not Merge record without a table"); 270Debug.Assert((record < _lastFreeRecord) && (-1 == _freeRecordList.IndexOf(record)), "accessing free record"); 272Debug.Assert((null == r) || 281Debug.Assert((record < _lastFreeRecord) && (-1 == _freeRecordList.IndexOf(record)), "accessing free record"); 282Debug.Assert((null == _rows[record]) || (row == _rows[record]), "record of a different row");
System\Data\RelatedView.cs (2)
27Debug.Assert(Table == _childKey.Table, "Key.Table Must be equal to Current Table"); 37Debug.Assert(Table == _childKey.Table, "Key.Table Must be equal to Current Table");
System\Data\Select.cs (8)
480Debug.Assert(_matchedCandidates > 0 && _matchedCandidates <= lenId, "BuildLinearExpression : Invalid Index"); 484Debug.Assert(canColumn != null && canColumn.expr != null, "BuildLinearExpression : Must be a matched candidate"); 563Debug.Assert(!needSorting, "What are we doing here if no real reuse of this index ?"); 711default: Debug.Assert(true, "Unsupported Binary Search Operator!"); break; 743Debug.Assert(candidateColumn != null, "How come this is not a candidate column"); 744Debug.Assert(candidateColumn.expr != null, "How come there is no associated expression"); 797Debug.Assert(_matchedCandidates <= _index._indexFields.Length, "GetBinaryFilteredRecords : Invalid Index"); 804Debug.Assert(lo <= hi, "GetBinaryFilteredRecords : Invalid Search Results");
System\Data\Selection.cs (26)
19Debug.Assert(column != null, "null column"); 114Debug.Assert(null != table, "null table"); 175Debug.Assert(recordIndex >= 0 && recordIndex < _recordCount, "recordIndex out of range"); 233Debug.Assert(0 <= _refCount, "AddRef on disposed index"); 234Debug.Assert(null != _records, "null records"); 298Debug.Assert(_records.CheckUnique(_records.root) != HasDuplicates, "CheckUnique difference"); 326Debug.Assert(null != row1, "record1 no datarow"); 327Debug.Assert(null != row2, "record2 no datarow"); 350Debug.Assert(0 == CompareDataRows(record1, record2), "duplicate record not a duplicate by user function"); 357Debug.Assert(0 == c, "duplicate record not a duplicate"); 362Debug.Assert(null != row1, "record1 no datarow"); 363Debug.Assert(null != row2, "record2 no datarow"); 448Debug.Assert(null != _comparison, "missing comparison"); 475Debug.Assert(record == row._newRecord, "newRecord has change during GetIndex"); 479Debug.Assert(record == row._oldRecord, "oldRecord has change during GetIndex"); 859Debug.Assert(DoListChanged, "supposed to check DoListChanged before calling to delay create ListChangedEventArgs"); 870Debug.Assert(-1 <= record, "bad record#"); 942Debug.Assert((-1 == oldRecord) || (-1 == newRecord) || 1073Debug.Assert(null != listener, "null listener"); 1074Debug.Assert(!Index.ContainsReference(_listeners, listener), "already contains reference"); 1086Debug.Assert(null != listener, "null listener"); 1089Debug.Assert(0 <= index, "listeners don't contain listener"); 1104Debug.Assert(null != action, "no action"); 1105Debug.Assert(0 <= _listenerReaderCount, "negative _listEventCount"); 1147Debug.Assert((-1 == nullIndex) || (null == _listeners[nullIndex]), "non-null listener"); 1148Debug.Assert(0 == _listenerReaderCount, "0 < _listenerReaderCount");
System\Data\SQLTypes\SQLDecimal.cs (4)
409Debug.Assert((precision == MaxPrecision + 1) || VerifyPrecision(precision), "Calcualted precision too low?"); 410Debug.Assert((precision == 1) || !VerifyPrecision((byte)(precision - 1)), "Calculated precision too high?"); 433Debug.Assert(precision > 0, "Precision cannot be less than 1"); 434Debug.Assert(precision <= MaxPrecision, "Precision > MaxPrecision");
System\Data\SQLTypes\SqlXml.cs (3)
89Debug.Assert(_createSqlReaderMethodInfo != null, "MethodInfo reference for XmlReader.CreateSqlReader should not be null."); 120Debug.Assert(CreateSqlReaderMethodInfo != null, "MethodInfo reference for XmlReader.CreateSqlReader should not be null."); 283Debug.Assert(_stream != null, "stream can not be null");
System\Data\UniqueConstraint.cs (3)
139Debug.Assert(null != _constraintIndex, "null UniqueConstraint index"); 148Debug.Assert(DataKey.ColumnsEqual(_key.ColumnsReference, sortIndexColumns), "UniqueConstraint index columns do not match the key sort index"); 189Debug.Assert(constraints.Table._primaryKey == this, "If the primary key and this are 'Equal', they should also be '=='");
System\Data\XDRSchema.cs (5)
40Debug.Assert(FEqualIdentity(schemaRoot, Keywords.XDR_SCHEMA, Keywords.XDRNS), "Illegal node"); 74Debug.Assert(FEqualIdentity(node, Keywords.XDR_ELEMENT, Keywords.XDRNS) || 184Debug.Assert(FEqualIdentity(node, Keywords.XDR_ELEMENTTYPE, Keywords.XDRNS) || 275Debug.Assert((s_mapNameTypeXdr[i - 1].CompareTo(s_mapNameTypeXdr[i].name)) < 0, "incorrect sorting"); 345Debug.Assert(FEqualIdentity(node, Keywords.XDR_ELEMENT, Keywords.XDRNS) ||
System\Data\XmlDataLoader.cs (5)
686Debug.Assert(table != null, "Table to be loaded is null on LoadTopMostTable() entry"); 687Debug.Assert(_topMostNode != null, "topMostNode is null on LoadTopMostTable() entry"); 688Debug.Assert(!_isDiffgram, "Diffgram mode is on while we have topMostNode table. This is bad."); 703Debug.Assert(entryDepth >= 0, "Wrong entry Depth for top most element."); 870Debug.Assert(table != null, "Table to be loaded is null on LoadTable() entry");
System\Data\XMLDiffLoader.cs (2)
32Debug.Assert(reader.LocalName == Keywords.MSD_ERRORS && reader.NamespaceURI == Keywords.DFFNS, "something fishy"); 68Debug.Assert(reader.LocalName == Keywords.MSD_ERRORS && reader.NamespaceURI == Keywords.DFFNS, "something fishy");
System\Data\xmlsaver.cs (4)
798Debug.Assert(nodeApp != null, "Need to create <application..> node first."); 1423Debug.Assert(col.ColumnMapping != MappingType.SimpleContent, "Illegal state"); 3090Debug.Assert(value != null, "Value can not be null"); 3306Debug.Assert(!(xr is DataTextReader), "XmlReader is DataTextReader");
System\Data\XMLSchema.cs (15)
332Debug.Assert(val is PropertyCollection, "We can set values only for classes that have ExtendedProperties"); 363Debug.Assert(dc != null, "HandleColumnExpression is supposed to be called for DataColumn"); 403Debug.Assert(val is PropertyCollection, "We can set values only for classes that have ExtendedProperties"); 417Debug.Assert(table != null, "ref table should have been already created"); 849Debug.Assert(schemaSet.Count == 1, "there should be one schema"); 920Debug.Assert(child == table, "table not the same"); 1066Debug.Assert(ct.BaseXmlSchemaType is XmlSchemaSimpleType, "Expected SimpleType or ComplexType"); 1084Debug.Assert(cContent is XmlSchemaComplexContentRestriction, "Expected complexContent extension or restriction"); 1096Debug.Assert(ct.ContentModel is XmlSchemaSimpleContent, "expected simpleContent or complexContent"); 1107Debug.Assert(ct.BaseXmlSchemaType is XmlSchemaSimpleType, "Expected SimpleType or ComplexType"); 1113Debug.Assert(cContent is XmlSchemaSimpleContentRestriction, "Expected SimpleContent extension or restriction"); 1150Debug.Assert(cContent is XmlSchemaComplexContentRestriction, "Expected complexContent extension or restriction"); 1156Debug.Assert(ct.ContentModel is XmlSchemaSimpleContent, "expected simpleContent or complexContent"); 1530Debug.Assert((node is XmlSchemaElement) || (node is XmlSchemaAttribute), "GetInstanceName should only be called on attribute or elements"); 1541Debug.Assert((instanceName != null) && (instanceName.Length != 0), "instanceName cannot be null or empty. There's an error in the XSD compiler");
System\Data\XmlToDatasetMap.cs (10)
107Debug.Assert(dataSet != null, "DataSet can't be null"); 108Debug.Assert(nameTable != null, "NameTable can't be null"); 116Debug.Assert(dataSet != null, "DataSet can't be null"); 117Debug.Assert(nameTable != null, "NameTable can't be null"); 125Debug.Assert(dataTable != null, "DataTable can't be null"); 126Debug.Assert(nameTable != null, "NameTable can't be null"); 134Debug.Assert(dataTable != null, "DataTable can't be null"); 135Debug.Assert(nameTable != null, "NameTable can't be null"); 438Debug.Assert(node != null, "Argument validation"); 506Debug.Assert(col.ColumnName.StartsWith("xml", StringComparison.OrdinalIgnoreCase), "column name should start with xml");
System\Xml\DataPointer.cs (1)
848Debug.Assert(state == ElementState.Defoliated, "Region is accessed using column, but it's state is FOLIATED");
System\Xml\XmlDataDocument.cs (1)
3145Debug.Assert(tableList[readPos] != null, "Temp Array is not supposed to reach to null");
System.Diagnostics.DiagnosticSource (6)
src\libraries\Common\src\System\HexConverter.cs (2)
332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Diagnostics\DiagnosticListener.cs (1)
301Debug.Assert(!(cur.Observer == Observer && cur.IsEnabled1Arg == IsEnabled1Arg && cur.IsEnabled3Arg == IsEnabled3Arg), "Did not remove subscription!");
System\Diagnostics\DiagnosticSourceEventSource.cs (1)
1308Debug.Assert(type != null, "Type should only be null for the well-known static fetchers already checked");
System\Diagnostics\Metrics\ObservableInstrument.cs (1)
89Debug.Assert(false, "Execution shouldn't reach this point");
System.Diagnostics.Process (18)
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.cs (2)
90Debug.Assert(!b || result.pid == pid, "Expected process ID from stat file to match supplied pid"); 97Debug.Assert(!b || result.pid == tid, "Expected thread ID from stat file to match supplied tid");
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (1)
39Debug.Assert(!b || result.Pid == pid, "Expected process ID from status file to match supplied pid");
src\libraries\Common\src\System\IO\StringParser.cs (5)
177Debug.Assert(result == int.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 222Debug.Assert(result == long.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 253Debug.Assert(result == uint.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 280Debug.Assert(result == ulong.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 295Debug.Assert(result == char.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Diagnostics\AsyncStreamReader.cs (2)
50Debug.Assert(stream != null && encoding != null && callback != null, "Invalid arguments!"); 51Debug.Assert(stream.CanRead, "Stream must be readable!");
System\Diagnostics\Process.cs (1)
781Debug.Assert(waitHandleContext != null, "Process.CompletionCallback called with no waitHandleContext");
System\Diagnostics\Process.Unix.cs (4)
161Debug.Assert(_haveProcessId, $"{nameof(ConfigureAfterProcessIdSet)} should only be called once a process ID is set"); 180Debug.Assert(Associated, "Process.EnsureWatchingForExit called with no associated process"); 294Debug.Assert(value == ProcessPriorityClass.Normal, "Input should have been validated by caller"); 967Debug.Assert(userId.HasValue == groupId.HasValue, "userId and groupId both need to have values, or both need to be null.");
System\Diagnostics\ProcessManager.Linux.cs (1)
21Debug.Assert(processNameFilter is null, "Not used on Linux");
System\Diagnostics\ProcessStartInfo.cs (1)
105Debug.Assert(!(e is IDisposable), "Environment.GetEnvironmentVariables should not be IDisposable.");
System.Diagnostics.TextWriterTraceListener (1)
System\Diagnostics\XmlWriterTraceListener.cs (1)
392Debug.Assert(typeof(T) == typeof(int) || typeof(T) == typeof(uint) || typeof(T) == typeof(long), "We only currently stackalloc enough space for these types.");
System.Diagnostics.TraceSource (1)
System\Diagnostics\Switch.cs (1)
172Debug.Assert(switchValueString is not null, "Unexpected 'switchValueString' null value");
System.Formats.Asn1 (3)
System\Formats\Asn1\AsnWriter.BitString.cs (1)
193Debug.Assert(_buffer == ensureNoExtraCopy, $"_buffer was replaced during {nameof(WriteConstructedCerBitString)}");
System\Formats\Asn1\AsnWriter.GeneralizedTime.cs (1)
65Debug.Assert(normalized.Year <= 9999, "DateTimeOffset guards against this internally");
System\Formats\Asn1\AsnWriter.OctetString.cs (1)
166Debug.Assert(_buffer == ensureNoExtraCopy, $"_buffer was replaced during {nameof(WriteConstructedCerOctetString)}");
System.Formats.Cbor (6)
System\Formats\Cbor\CborInitialByte.cs (2)
47Debug.Assert((byte)majorType < 8, "CBOR Major Type is out of range"); 48Debug.Assert((byte)additionalInfo < 32, "CBOR initial byte additional info is out of range");
System\Formats\Cbor\Reader\CborReader.cs (3)
381Debug.Assert(restoreHeight >= 0, "Attempting to restore checkpoint outside of its original context."); 388Debug.Assert(_nestedDataItems.ToArray()[restoreHeight - 1].FrameOffset == checkpoint.FrameOffset, 403Debug.Assert(checkpoint.FrameOffset == _frameOffset, "Attempting to restore checkpoint outside of its original context.");
System\Formats\Cbor\Writer\CborWriter.Tag.cs (1)
166Debug.Assert((flags & ScaleMask) == 0, "mantissa argument should be integral.");
System.Formats.Tar (5)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Formats\Tar\TarEntry.cs (1)
383Debug.Assert(PathInternal.EndsInDirectorySeparator(destinationDirectoryFullPath), "caller must ensure the path ends with a separator.");
System\Formats\Tar\TarHeader.Read.cs (1)
378Debug.Assert(size <= TarHelpers.MaxSizeLength, "size exceeded the max value possible with 11 octal digits. Actual size " + size);
System\Formats\Tar\TarWriter.cs (1)
310Debug.Assert(entry.Format == TarEntryFormat.Unknown, "Missing format handler");
System.IO.Compression (23)
System\IO\Compression\DeflateManaged\DeflateManagedStream.cs (1)
121Debug.Assert(_inflater.AvailableOutput == 0, "We should have copied all stuff out!");
System\IO\Compression\DeflateManaged\HuffmanTree.cs (3)
48Debug.Assert( 102Debug.Assert(length > 0 && length <= 16, "Invalid len"); 236Debug.Assert(value < 0, "CreateTable: Only negative numbers are used for tree pointers!");
System\IO\Compression\DeflateManaged\InflaterManaged.cs (1)
396Debug.Assert(_extraBits != 0, "We handle other cases separately!");
System\IO\Compression\DeflateManaged\InputBuffer.cs (3)
35Debug.Assert(0 < count && count <= 16, "count is invalid."); 110Debug.Assert(0 < count && count <= 16, "count is invalid."); 213Debug.Assert(_bitsInBuffer >= n, "No enough bits in the buffer, Did you call EnsureBitsAvailable?");
System\IO\Compression\DeflateManaged\OutputWindow.cs (3)
35Debug.Assert(_bytesUsed < WindowSize, "Can't add byte when window is full!"); 43Debug.Assert((_bytesUsed + length) <= WindowSize, "No Enough space"); 148Debug.Assert(_bytesUsed >= 0, "check this function and find why we copied more bytes than we have");
System\IO\Compression\DeflateZLib\Deflater.cs (9)
124Debug.Assert(NeedsInput(), "We have something left in previous input!"); 138Debug.Assert(NeedsInput(), "We have something left in previous input!"); 151Debug.Assert(null != outputBuffer, "Can't pass in a null output buffer!"); 152Debug.Assert(!NeedsInput(), "GetDeflateOutput should only be called after providing input"); 191Debug.Assert(null != outputBuffer, "Can't pass in a null output buffer!"); 192Debug.Assert(outputBuffer.Length > 0, "Can't pass in an empty output buffer!"); 203Debug.Assert(null != outputBuffer, "Can't pass in a null output buffer!"); 204Debug.Assert(outputBuffer.Length > 0, "Can't pass in an empty output buffer!"); 205Debug.Assert(NeedsInput(), "We have something left in previous input!");
System\IO\Compression\DeflateZLib\Inflater.cs (3)
68Debug.Assert(null != bytes, "Can't pass in a null output buffer!"); 185Debug.Assert(NeedsInput(), "We have something left in previous input!"); 195Debug.Assert(NeedsInput(), "We have something left in previous input!");
System.IO.Compression.ZipFile (1)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
System.IO.FileSystem.DriveInfo (1)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
System.IO.FileSystem.Watcher (4)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\IO\FileSystemWatcher.cs (2)
69Debug.Assert(c_notifyFiltersValidMask == s_notifyFiltersValidMask, "The NotifyFilters enum has changed. The c_notifyFiltersValidMask must be updated to reflect the values of the NotifyFilters enum."); 593Debug.Assert(EnableRaisingEvents, "Expected EnableRaisingEvents to be true");
System.IO.Hashing (4)
System\IO\Hashing\Crc32.Arm.cs (2)
15Debug.Assert(ArmCrc.Arm64.IsSupported, "ARM CRC support is required."); 43Debug.Assert(ArmCrc.IsSupported, "ARM CRC support is required.");
System\IO\Hashing\Crc32.Vectorized.cs (1)
34Debug.Assert(CanBeVectorized(source), "source cannot be vectorized.");
System\IO\Hashing\Crc64.Vectorized.cs (1)
48Debug.Assert(CanBeVectorized(source), "source cannot be vectorized.");
System.IO.IsolatedStorage (3)
src\libraries\Common\src\System\Security\IdentityHelper.cs (2)
79Debug.Assert(((buff.Length % 5) == 0), "Unexpected hash length"); 119Debug.Assert(((b2 & 0xF8) == 0), "Unexpected set bits");
System\IO\IsolatedStorage\IsolatedStorageFile.cs (1)
541Debug.Assert(partialPath != null, "partialPath should be non null");
System.IO.MemoryMappedFiles (4)
Microsoft\Win32\SafeMemoryMappedFileHandle.Unix.cs (1)
44Debug.Assert(!ownsFileHandle || fileHandle != null, "We can only own a FileStream we're actually given.");
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
System\IO\MemoryMappedFiles\MemoryMappedViewAccessor.cs (1)
15Debug.Assert(view != null, "view is null");
System\IO\MemoryMappedFiles\MemoryMappedViewStream.cs (1)
15Debug.Assert(view != null, "view is null");
System.IO.Pipelines (9)
System\IO\Pipelines\Pipe.cs (6)
280Debug.Assert(segment != _readHead, "Returning _readHead segment that's in use!"); 281Debug.Assert(segment != _readTail, "Returning _readTail segment that's in use!"); 282Debug.Assert(segment != _writingHead, "Returning _writingHead segment that's in use!"); 502Debug.Assert(_unconsumedBytes >= 0, "Length has gone negative"); 503Debug.Assert(ResumeWriterThreshold >= 1, "ResumeWriterThreshold is less than 1"); 573Debug.Assert(_writerAwaitable.IsCompleted, "PipeWriter.FlushAsync is isn't completed and will deadlock");
System\IO\Pipelines\PipeAwaitable.cs (1)
63Debug.Assert(previousAwaitableState == _awaitableState, "The awaitable state changed!");
System\IO\Pipelines\StreamPipeReader.cs (2)
555Debug.Assert(segment != _readHead, "Returning _readHead segment that's in use!"); 556Debug.Assert(segment != _readTail, "Returning _readTail segment that's in use!");
System.IO.Pipes (15)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
System\IO\Pipes\AnonymousPipeClientStream.cs (2)
65Debug.Assert(direction != PipeDirection.InOut, "anonymous pipes are unidirectional, caller should have verified before calling Init"); 66Debug.Assert(safePipeHandle != null && !safePipeHandle.IsInvalid, "safePipeHandle must be valid");
System\IO\Pipes\AnonymousPipeServerStream.Unix.cs (1)
17Debug.Assert(direction != PipeDirection.InOut, "Anonymous pipe direction shouldn't be InOut");
System\IO\Pipes\NamedPipeServerStream.Unix.cs (6)
28Debug.Assert(!string.IsNullOrEmpty(pipeName), "fullPipeName is null or empty"); 29Debug.Assert(direction >= PipeDirection.In && direction <= PipeDirection.InOut, "invalid pipe direction"); 30Debug.Assert(inBufferSize >= 0, "inBufferSize is negative"); 31Debug.Assert(outBufferSize >= 0, "outBufferSize is negative"); 32Debug.Assert((maxNumberOfServerInstances >= 1) || (maxNumberOfServerInstances == MaxAllowedServerInstances), "maxNumberOfServerInstances is invalid"); 33Debug.Assert(transmissionMode >= PipeTransmissionMode.Byte && transmissionMode <= PipeTransmissionMode.Message, "transmissionMode is out of range");
System\IO\Pipes\PipeStream.cs (5)
59Debug.Assert(direction >= PipeDirection.In && direction <= PipeDirection.InOut, "invalid pipe direction"); 60Debug.Assert(transmissionMode >= PipeTransmissionMode.Byte && transmissionMode <= PipeTransmissionMode.Message, "transmissionMode is out of range"); 61Debug.Assert(outBufferSize >= 0, "outBufferSize is negative"); 107Debug.Assert(handle != null, "handle is null"); 108Debug.Assert(!handle.IsClosed, "handle is closed");
System.Linq (10)
System\Linq\Grouping.cs (1)
391Debug.Assert(_count > 0, "A grouping should only have been created if an element was being added to it.");
System\Linq\Lookup.cs (1)
173Debug.Assert(index == _count, "All list elements were not initialized.");
System\Linq\OrderedEnumerable.SpeedOpt.cs (1)
393Debug.Assert(TypeIsImplicitlyStable<TElement>(), "Using Min/Max has different semantics for floating-point values.");
System\Linq\Select.SpeedOpt.cs (1)
734Debug.Assert(index == results.Length, "All list elements were not initialized.");
System\Linq\SkipTake.SpeedOpt.cs (6)
213Debug.Assert(!(source is IList<TSource>), $"The caller needs to check for {nameof(IList<TSource>)}."); 219Debug.Assert(maxIndexInclusive == -1 || (maxIndexInclusive - minIndexInclusive < int.MaxValue), $"{nameof(Limit)} will overflow!"); 273Debug.Assert(count != (uint)int.MaxValue + 1 || _minIndexInclusive > 0, "Our return value will be incorrect."); 349Debug.Assert(minIndex >= 0, $"We should have taken care of all cases when {nameof(minIndex)} overflows."); 377Debug.Assert(maxIndex >= 0, $"We should have taken care of all cases when {nameof(maxIndex)} overflows."); 386Debug.Assert(_minIndexInclusive + index >= 0, $"Adding {nameof(index)} caused {nameof(_minIndexInclusive)} to overflow.");
System.Linq.Expressions (36)
System\Dynamic\DynamicMetaObject.cs (1)
264Debug.Assert(expr != null, "Unexpected null expression; ctor should have caught this.");
System\Dynamic\DynamicObject.cs (1)
835Debug.Assert(Restrictions == BindingRestrictions.Empty, "We don't merge, restrictions are always empty");
System\Dynamic\ExpandoObject.cs (1)
1010Debug.Assert(Restrictions == BindingRestrictions.Empty, "We don't merge, restrictions are always empty");
System\Dynamic\Utils\ContractUtils.cs (1)
125Debug.Assert(Monitor.IsEntered(lockObject), "Expected lock is not held.");
System\Dynamic\Utils\TypeUtils.cs (1)
27Debug.Assert(type != null, "type cannot be null");
System\Linq\Expressions\Compiler\LambdaCompiler.cs (2)
256Debug.Assert(_hasClosureArgument, "must have a Closure argument"); 257Debug.Assert(_method.IsStatic, "must be a static method");
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (2)
635Debug.Assert(node.ArgumentCount == 0, "Node with arguments must have a constructor."); 636Debug.Assert(node.Type.IsValueType, "Only value type may have constructor not set.");
System\Linq\Expressions\Compiler\LambdaCompiler.Logical.cs (2)
284Debug.Assert(opFalse != null, "factory should check that the method exists"); 390Debug.Assert(opTrue != null, "factory should check that the method exists");
System\Linq\Expressions\Compiler\StackSpiller.cs (6)
136Debug.Assert((result.Action == RewriteAction.None) ^ (node != result.Node), "rewrite action does not match node object identity"); 139Debug.Assert(result.Node.NodeType != ExpressionType.Extension, "extension nodes must be rewritten"); 142Debug.Assert( 150Debug.Assert( 605Debug.Assert(node.NodeType != ExpressionType.Quote, "unexpected Quote"); 606Debug.Assert(node.NodeType != ExpressionType.Throw, "unexpected Throw");
System\Linq\Expressions\Interpreter\ControlFlowInstructions.cs (8)
267Debug.Assert(_tryHandler == null && tryHandler != null, "the tryHandler can be set only once"); 293Debug.Assert(_tryHandler != null, "the tryHandler must be set already"); 319Debug.Assert(instructions[index] is GotoInstruction, "should be the 'Goto' instruction that jumps out the try/catch/finally"); 353Debug.Assert(instructions[index] is GotoInstruction, "should be the 'Goto' instruction that jumps out the try/catch/finally"); 378Debug.Assert(!isFromJump || (isFromJump && _tryHandler.FinallyStartIndex == frame.InstructionIndex), "we should already jump to the first instruction of the finally"); 416Debug.Assert(_tryHandler == null, "the tryHandler can be set only once"); 422Debug.Assert(_tryHandler != null, "the tryHandler must be set already"); 451Debug.Assert(instructions[index] is GotoInstruction, "should be the 'Goto' instruction that jumps out the try/fault");
System\Linq\Expressions\Interpreter\InstructionList.cs (1)
194Debug.Assert(instruction.ConsumedStack >= 0 && instruction.ProducedStack >= 0 &&
System\Linq\Expressions\Interpreter\InterpretedFrame.cs (1)
255Debug.Assert(!gotoExceptionHandler || (gotoExceptionHandler && _continuationIndex == target.ContinuationStackDepth),
System\Linq\Expressions\Interpreter\LightCompiler.cs (2)
86Debug.Assert(handlers != null, "catch blocks should exist"); 1360Debug.Assert(opTrue != null, "factory should check that the method exists");
System\Linq\Expressions\Interpreter\LocalAccess.cs (2)
377Debug.Assert(type.IsValueType, "MutableValue only supports value types."); 416Debug.Assert(type.IsValueType, "MutableBox only supports value types.");
System\Linq\Expressions\Interpreter\TypeOperations.cs (1)
153Debug.Assert(mi.ReturnType.IsValueType, "Nullable is only allowed on value types.");
System\Linq\Expressions\TypeBinaryExpression.cs (1)
77Debug.Assert(TypeUtils.AreReferenceAssignable(typeof(object), Expression.Type), "Expecting reference types only after this point.");
System\Runtime\CompilerServices\CallSite.cs (3)
135Debug.Assert(s_cachedNoMatch != null, "all normal sites should have Update cached once there is an instance."); 140Debug.Assert(s_cachedUpdate != null, "all normal sites should have Update cached once there is an instance."); 191Debug.Assert(matchmaker?._match != false, "cached site should be set up for matchmaking");
System.Linq.Parallel (147)
System\Linq\Parallel\Channels\AsynchronousChannel.cs (10)
118Debug.Assert(chunkSize > 0, "chunk size must be greater than 0"); 119Debug.Assert(capacity > 1, "this impl doesn't support capacity of 1 or 0"); 290Debug.Assert(!_done, "can't continue producing after the production is over"); 294Debug.Assert(!IsFull, "expected a non-full buffer"); 418Debug.Assert(_consumerChunk != null, "consumer chunk is null"); 419Debug.Assert(0 <= _consumerChunkIndex && _consumerChunkIndex < _consumerChunk.Length, "chunk index out of bounds"); 496Debug.Assert(_consumerChunk != null, "consumer chunk is null"); 497Debug.Assert(0 <= _consumerChunkIndex && _consumerChunkIndex < _consumerChunk.Length, "chunk index out of bounds"); 587Debug.Assert(!IsChunkBufferEmpty, "single-consumer should never witness an empty queue here"); 663Debug.Assert(_done, "Expected channel to be done before disposing");
System\Linq\Parallel\Channels\SynchronousChannel.cs (3)
69Debug.Assert(!_done, "trying to enqueue into the queue after production is done"); 91Debug.Assert(_done, "trying to dequeue before production is done -- this is not safe"); 119Debug.Assert(_done, "Can only copy from the channel after it's done being added to");
System\Linq\Parallel\Enumerables\AggregationMinMaxHelpers.cs (2)
101Debug.Assert(default(T) != null || element.Second != null, "nulls unexpected in final reduce"); 118Debug.Assert(accumulator.First || default(T) == null,
System\Linq\Parallel\Enumerables\ParallelEnumerableWrapper.cs (1)
69Debug.Assert(wrappedEnumerable != null, "wrappedEnumerable must not be null.");
System\Linq\Parallel\Enumerables\RepeatEnumerable.cs (1)
33Debug.Assert(count >= 0, "count not within range (must be >= 0)");
System\Linq\Parallel\Merging\AsynchronousChannelMergeEnumerator.cs (3)
153Debug.Assert(dequeueResult, "channel isn't empty, yet the dequeue failed, hmm"); 165Debug.Assert(_channels[currChannelIndex].IsDone, "thought this channel was done"); 166Debug.Assert(_channels[currChannelIndex].IsChunkBufferEmpty, "thought this channel was empty");
System\Linq\Parallel\Merging\DefaultMergeHelper.cs (1)
88Debug.Assert(_channelEnumerator != null, "enumerator can't be null if we're not ignoring output");
System\Linq\Parallel\Merging\MergeExecutor.cs (1)
55Debug.Assert(!ignoreOutput || options == ParallelMergeOptions.FullyBuffered, "Pipelining with no output is not supported.");
System\Linq\Parallel\Merging\OrderPreservingPipeliningMergeHelper.cs (1)
421Debug.Assert(buffer.Count > 0, "Producer's buffer should not be empty here.");
System\Linq\Parallel\Partitioning\HashRepartitionEnumerator.cs (3)
74Debug.Assert(valueExchangeMatrix.GetLength(0) == partitionCount, "expected square matrix of buffers (NxN)"); 75Debug.Assert(partitionCount > 0 && valueExchangeMatrix[0].Length == partitionCount, "expected square matrix of buffers (NxN)"); 229Debug.Assert(0 <= destinationIndex && destinationIndex < _partitionCount,
System\Linq\Parallel\Partitioning\OrderedHashRepartitionEnumerator.cs (4)
76Debug.Assert(valueExchangeMatrix.GetLength(0) == partitionCount, "expected square matrix of buffers (NxN)"); 77Debug.Assert(partitionCount > 0 && valueExchangeMatrix[0].Length == partitionCount, "expected square matrix of buffers (NxN)"); 151Debug.Assert(mutables._currentKeyBuffer != null, "expected same # of buffers/key-buffers"); 236Debug.Assert(0 <= destinationIndex && destinationIndex < _partitionCount,
System\Linq\Parallel\Partitioning\PartitionedDataSource.cs (20)
238Debug.Assert(data != null, "data mustn't be null"); 239Debug.Assert(partitionCount > 0, "partitionCount must be positive"); 240Debug.Assert(partitionIndex >= 0, "partitionIndex can't be negative"); 241Debug.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount"); 242Debug.Assert(maxChunkSize > 0, "maxChunkSize must be positive or -1"); 340Debug.Assert(data != null, "data must not be null"); 341Debug.Assert(partitionCount > 0, "partitionCount must be positive"); 342Debug.Assert(partitionIndex >= 0, "partitionIndex can't be negative"); 343Debug.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount"); 360Debug.Assert(_currentIndex == null, "Expected deferred allocation to ensure it happens on correct thread"); 409Debug.Assert(data != null, "data must not be null"); 410Debug.Assert(partitionCount > 0, "partitionCount must be positive"); 411Debug.Assert(partitionIndex >= 0, "partitionIndex can't be negative"); 412Debug.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount"); 413Debug.Assert(maxChunkSize > 0, "maxChunkSize must be positive or -1"); 511Debug.Assert(data != null, "data must not be null"); 512Debug.Assert(partitionCount > 0, "partitionCount must be positive"); 513Debug.Assert(partitionIndex >= 0, "partitionIndex can't be negative"); 514Debug.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount"); 531Debug.Assert(_currentIndex == null, "Expected deferred allocation to ensure it happens on correct thread");
System\Linq\Parallel\Partitioning\PartitionedStream.cs (2)
58Debug.Assert(0 <= index && index < _partitions.Length, "index out of bounds"); 65Debug.Assert(0 <= index && index < _partitions.Length, "index out of bounds");
System\Linq\Parallel\QueryOperators\AssociativeAggregationOperator.cs (8)
78Debug.Assert(child != null, "child data source cannot be null"); 79Debug.Assert(intermediateReduce != null, "need an intermediate reduce function"); 80Debug.Assert(finalReduce != null, "need a final reduce function"); 81Debug.Assert(resultSelector != null, "need a result selector function"); 82Debug.Assert(options.IsValidQueryAggregationOption(), "enum out of valid range"); 83Debug.Assert((options & QueryAggregationOptions.Associative) == QueryAggregationOptions.Associative, "expected an associative operator"); 84Debug.Assert(typeof(TIntermediate) == typeof(TInput) || seedIsSpecified, "seed must be specified if TIntermediate differs from TInput"); 262Debug.Assert(_reduceOperator._intermediateReduce != null, "expected a compiled operator");
System\Linq\Parallel\QueryOperators\Binary\ConcatQueryOperator.cs (2)
42Debug.Assert(firstChild != null, "first child data source cannot be null"); 43Debug.Assert(secondChild != null, "second child data source cannot be null");
System\Linq\Parallel\QueryOperators\Binary\ExceptQueryOperator.cs (1)
34Debug.Assert(left != null && right != null, "child data sources cannot be null");
System\Linq\Parallel\QueryOperators\Binary\GroupJoinQueryOperator.cs (4)
44Debug.Assert(left != null && right != null, "child data sources cannot be null"); 45Debug.Assert(leftKeySelector != null, "left key selector must not be null"); 46Debug.Assert(rightKeySelector != null, "right key selector must not be null"); 47Debug.Assert(resultSelector != null, "need a result selector function");
System\Linq\Parallel\QueryOperators\Binary\HashJoinQueryOperatorEnumerator.cs (2)
95Debug.Assert(_resultSelector != null, "expected a compiled result selector"); 139Debug.Assert(mutables._currentRightMatches == null || mutables._currentRightMatches.Count > 0,
System\Linq\Parallel\QueryOperators\Binary\IntersectQueryOperator.cs (1)
33Debug.Assert(left != null && right != null, "child data sources cannot be null");
System\Linq\Parallel\QueryOperators\Binary\JoinQueryOperator.cs (4)
60Debug.Assert(left != null && right != null, "child data sources cannot be null"); 61Debug.Assert(leftKeySelector != null, "left key selector must not be null"); 62Debug.Assert(rightKeySelector != null, "right key selector must not be null"); 63Debug.Assert(resultSelector != null, "need a result selector function");
System\Linq\Parallel\QueryOperators\Binary\UnionQueryOperator.cs (1)
33Debug.Assert(left != null && right != null, "child data sources cannot be null");
System\Linq\Parallel\QueryOperators\Binary\ZipQueryOperator.cs (1)
60Debug.Assert(resultSelector != null, "operator cannot be null");
System\Linq\Parallel\QueryOperators\Inlined\DecimalMinMaxAggregationOperator.cs (1)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\DoubleMinMaxAggregationOperator.cs (1)
35Debug.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\FloatMinMaxAggregationOperator.cs (1)
34Debug.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\InlinedAggregationOperator.cs (1)
37Debug.Assert(child != null, "child data source cannot be null");
System\Linq\Parallel\QueryOperators\Inlined\IntMinMaxAggregationOperator.cs (1)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\LongMinMaxAggregationOperator.cs (1)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalMinMaxAggregationOperator.cs (1)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleMinMaxAggregationOperator.cs (1)
35Debug.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\NullableFloatMinMaxAggregationOperator.cs (1)
35Debug.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\NullableIntMinMaxAggregationOperator.cs (1)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\NullableLongMinMaxAggregationOperator.cs (1)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\PartitionedStreamMerger.cs (1)
38Debug.Assert(_received, "Cannot return the merge executor because Receive() has not been called yet.");
System\Linq\Parallel\QueryOperators\QuerySettings.cs (1)
149Debug.Assert(topLevelCancellationTokenSource != null, "There should always be a top-level cancellation signal specified.");
System\Linq\Parallel\QueryOperators\Unary\AnyAllSearchOperator.cs (2)
54Debug.Assert(child != null, "child data source cannot be null"); 55Debug.Assert(predicate != null, "need a predicate function");
System\Linq\Parallel\QueryOperators\Unary\ContainsSearchOperator.cs (1)
40Debug.Assert(child != null, "child data source cannot be null");
System\Linq\Parallel\QueryOperators\Unary\DefaultIfEmptyQueryOperator.cs (1)
40Debug.Assert(child != null, "child data source cannot be null");
System\Linq\Parallel\QueryOperators\Unary\DistinctQueryOperator.cs (1)
34Debug.Assert(source != null, "child data source cannot be null");
System\Linq\Parallel\QueryOperators\Unary\ElementAtQueryOperator.cs (3)
40Debug.Assert(child != null, "child data source cannot be null"); 41Debug.Assert(index >= 0, "index can't be less than 0"); 152Debug.Assert(!e.MoveNext(), "expected enumerator to be empty");
System\Linq\Parallel\QueryOperators\Unary\FirstQueryOperator.cs (1)
39Debug.Assert(child != null, "child data source cannot be null");
System\Linq\Parallel\QueryOperators\Unary\ForAllOperator.cs (3)
35Debug.Assert(child != null, "child data source cannot be null"); 36Debug.Assert(elementAction != null, "need a function"); 151Debug.Assert(_elementAction != null, "expected a compiled operator");
System\Linq\Parallel\QueryOperators\Unary\GroupByQueryOperator.cs (3)
56Debug.Assert(child != null, "child data source cannot be null"); 57Debug.Assert(keySelector != null, "need a selector function"); 58Debug.Assert(elementSelector != null ||
System\Linq\Parallel\QueryOperators\Unary\IndexedSelectQueryOperator.cs (3)
47Debug.Assert(child != null, "child data source cannot be null"); 48Debug.Assert(selector != null, "need a selector function"); 161Debug.Assert(_selector != null, "expected a compiled selection function");
System\Linq\Parallel\QueryOperators\Unary\IndexedWhereQueryOperator.cs (3)
46Debug.Assert(child != null, "child data source cannot be null"); 47Debug.Assert(predicate != null, "need a filter function"); 165Debug.Assert(_predicate != null, "expected a compiled operator");
System\Linq\Parallel\QueryOperators\Unary\LastQueryOperator.cs (1)
40Debug.Assert(child != null, "child data source cannot be null");
System\Linq\Parallel\QueryOperators\Unary\ReverseQueryOperator.cs (2)
41Debug.Assert(child != null, "child data source cannot be null"); 56Debug.Assert(Child.OrdinalIndexState != OrdinalIndexState.Indexable, "Don't take this code path if the child is indexable.");
System\Linq\Parallel\QueryOperators\Unary\SelectManyQueryOperator.cs (6)
58Debug.Assert(leftChild != null, "left child data source cannot be null"); 59Debug.Assert(rightChildSelector != null || indexedRightChildSelector != null, 61Debug.Assert(rightChildSelector == null || indexedRightChildSelector == null, 63Debug.Assert(typeof(TRightInput) == typeof(TOutput) || resultSelector != null, 313Debug.Assert(_currentRightSourceAsOutput == _currentRightSource, 442Debug.Assert(_currentRightSourceAsOutput == _currentRightSource,
System\Linq\Parallel\QueryOperators\Unary\SelectQueryOperator.cs (3)
42Debug.Assert(child != null, "child data source cannot be null"); 43Debug.Assert(selector != null, "need a selector function"); 120Debug.Assert(_selector != null, "expected a compiled operator");
System\Linq\Parallel\QueryOperators\Unary\SingleQueryOperator.cs (1)
39Debug.Assert(child != null, "child data source cannot be null");
System\Linq\Parallel\QueryOperators\Unary\SortQueryOperator.cs (2)
36Debug.Assert(keySelector != null, "key selector must not be null"); 181Debug.Assert(keySelector != null, "need a key comparer");
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipQueryOperator.cs (3)
51Debug.Assert(child != null, "child data source cannot be null"); 89Debug.Assert(Child.OrdinalIndexState != OrdinalIndexState.Indexable, "Don't take this code path if the child is indexable."); 298Debug.Assert(_count <= 0 || _keyComparer.Compare(currentKey, minKey) > 0,
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipWhileQueryOperator.cs (3)
71Debug.Assert(child != null, "child data source cannot be null"); 72Debug.Assert(predicate != null || indexedPredicate != null, "need a predicate function"); 390Debug.Assert(_keyComparer.Compare(currentKey, _operatorState._currentLowKey) > 0,
System\Linq\Parallel\QueryOperators\Unary\WhereQueryOperator.cs (3)
41Debug.Assert(child != null, "child data source cannot be null"); 42Debug.Assert(predicate != null, "need a filter function"); 130Debug.Assert(_predicate != null, "expected a compiled operator");
System\Linq\Parallel\Scheduling\QueryTask.cs (2)
62Debug.Assert(taskScheduler == TaskScheduler.Default, "PLINQ queries can currently execute only on the default scheduler."); 81Debug.Assert(taskScheduler == TaskScheduler.Default, "PLINQ queries can currently execute only on the default scheduler.");
System\Linq\Parallel\Scheduling\QueryTaskGroupState.cs (2)
73Debug.Assert(rootTask != null, "Expected a non-null task"); 74Debug.Assert(_rootTask == null, "Cannot begin a query more than once");
System\Linq\Parallel\Scheduling\Scheduling.cs (1)
88Debug.Assert((DEFAULT_BYTES_PER_CHUNK % IntPtr.Size) == 0, "bytes per chunk should be a multiple of pointer size");
System\Linq\Parallel\Utils\Lookup.cs (1)
115Debug.Assert(_defaultKeyGrouping == null, "Cannot insert two groupings with the default key into a lookup.");
System\Linq\Parallel\Utils\Sorting.cs (4)
194Debug.Assert(sourceValues != null, "values weren't populated"); 195Debug.Assert(sourceKeys != null, "keys weren't populated"); 584Debug.Assert(keys != null, "need a non-null keyset"); 608Debug.Assert(i >= left && j <= right, "(i>=left && j<=right) sort failed - bogus IComparer?");
System\Linq\ParallelEnumerable.cs (3)
1526Debug.Assert(options.IsValidQueryAggregationOption(), "enum is out of range"); 5334Debug.Assert(queryOp != null, "expected query operator"); 5353Debug.Assert(!e.MoveNext(), "expected only a single element");
System.Linq.Queryable (1)
System\Linq\EnumerableRewriter.cs (1)
227Debug.Assert(matchingMethods.Length > 0, "All static methods with arguments on Queryable have equivalents on Enumerable.");
System.Memory (2)
System\Text\EncodingExtensions.cs (2)
209Debug.Assert(remainingBytes.IsEmpty, "Over-allocated the byte[] instance?"); 395Debug.Assert(span.IsEmpty, "Over-allocated the string instance?");
System.Net.Http (73)
src\libraries\Common\src\System\CharArrayHelpers.cs (1)
13Debug.Assert(array != null, "Null array");
src\libraries\Common\src\System\Collections\Generic\BidirectionalDictionary.cs (2)
26Debug.Assert(_forward.Count == _backward.Count, "both the dictionaries must have the same number of elements"); 33Debug.Assert(!_backward.ContainsKey(item2), "No added item1 should ever have existing item2");
src\libraries\Common\src\System\HexConverter.cs (2)
332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackDecoder.cs (3)
244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\IntegerDecoder.cs (1)
40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\Frames\Http3Frame.cs (1)
43Debug.Assert(VariableLengthIntegerHelper.GetByteCount((long)frameType) == 1, $"{nameof(TryWriteFrameEnvelope)} assumes {nameof(frameType)} will fit within a single byte varint.");
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\Helpers\VariableLengthIntegerHelper.cs (1)
73Debug.Assert(value >= 0 && value <= EightByteLimit, "Serialized values are within [0, 2^62).");
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackDecoder.cs (2)
428Debug.Assert(_state == State.CompressedHeaders, "Should be ready to parse a new header."); 646Debug.Assert(_stringOctets != null, "String buffer should have a value.");
src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (1)
349Debug.Assert(_length > 0, "Length should never be 0 here because BlockCount would be 0");
src\libraries\Common\src\System\StrongToWeakReference.cs (2)
17Debug.Assert(obj != null, "Expected non-null obj"); 28Debug.Assert(_strongRef != null, $"Expected non-null {nameof(_strongRef)} after setting");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Net\Http\Headers\AltSvcHeaderParser.cs (1)
322Debug.Assert(value[startIndex] == '"' && value[startIndex + quotedLength - 1] == '"', $"{nameof(HttpRuleParser.GetQuotedStringLength)} should return {nameof(HttpParseResult.NotParsed)} if the opening/closing quotes are missing.");
System\Net\Http\Headers\AuthenticationHeaderValue.cs (1)
236Debug.Assert(parseEndIndex < input.Length, "Expected string to have at least 1 char");
System\Net\Http\Headers\CacheControlHeaderParser.cs (1)
48Debug.Assert(isInvalidValue || storeValue == null || temp != null, "'storeValue' is not of type CacheControlHeaderValue");
System\Net\Http\Headers\HeaderUtilities.cs (1)
237Debug.Assert(Array.TrueForAll(alreadyFound, value => value),
System\Net\Http\Headers\HttpHeaders.cs (18)
307Debug.Assert(_count != 0 && entries is not null, "Caller should have validated the collection is not empty"); 353Debug.Assert(descriptor.Parser != null, "Can't add parsed value if there is no parser available."); 367Debug.Assert(descriptor.Parser != null, "Can't add parsed value if there is no parser available."); 401Debug.Assert(descriptor.Parser != null, "Can't add parsed value if there is no parser available."); 402Debug.Assert(descriptor.Parser.SupportsMultipleValues, 420Debug.Assert(parsedValue.GetType() == value.GetType(), 436Debug.Assert(item.GetType() == value.GetType(), 479Debug.Assert(descriptor.Parser != null, "Can't add parsed value if there is no parser available."); 480Debug.Assert(descriptor.Parser.SupportsMultipleValues, 498Debug.Assert(parsedValue.GetType() == value.GetType(), 510Debug.Assert(item.GetType() == value.GetType(), 530Debug.Assert(GetType() == sourceHeaders.GetType(), "Can only copy headers from an instance of the same type."); 833Debug.Assert(index < value.Length, "Parser must return an index value within the string length."); 886Debug.Assert(!(value is List<object>), 1001Debug.Assert(index < value.Length, "Parser must return an index value within the string length."); 1119Debug.Assert(length > 1, "The header should have been removed when it became empty"); 1239Debug.Assert(parser != null, "There should be no reason to call CanAddValue if there is no parser for the current header."); 1311Debug.Assert(count == 1, "Only a single parsed value should be stored for this parser");
System\Net\Http\Headers\RangeHeaderValue.cs (1)
171Debug.Assert(current == input.Length, "GetRangeItemListLength() should consume the whole string or fail.");
System\Net\Http\Metrics\MetricsHandler.cs (1)
156Debug.Assert(Enum.GetValues<HttpRequestError>().Length == 12, "We need to extend the mapping in case new values are added to HttpRequestError.");
System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs (1)
25Debug.Assert(response != null, "The HttpResponseMessage cannot be null.");
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (1)
904Debug.Assert((_availableHttp2Connections?.Count ?? 0) == 0, $"Expected {nameof(_availableHttp2Connections)}.{nameof(_availableHttp2Connections.Count)} == 0");
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http2.cs (3)
369Debug.Assert(isNewConnection || initialRequestWaiter is null, "Shouldn't have a request unless the connection is new"); 394Debug.Assert(_availableHttp2Connections is null || !_availableHttp2Connections.Contains(connection), $"HTTP2 connection already in available list"); 467Debug.Assert(initialRequestWaiter is not null, "Expect request for a new connection");
System\Net\Http\SocketsHttpHandler\ContentLengthReadStream.cs (1)
19Debug.Assert(contentLength > 0, "Caller should have checked for 0.");
System\Net\Http\SocketsHttpHandler\CookieHelper.cs (1)
18Debug.Assert(valuesArray.Length > 0, "No values for header??");
System\Net\Http\SocketsHttpHandler\CreditManager.cs (3)
97Debug.Assert(_current <= 0 || _waitersTail is null, "Shouldn't have waiters when credit is available"); 161Debug.Assert(Monitor.IsEntered(SyncObject), "Shouldn't be called outside lock."); 167Debug.Assert(_waitersTail is null, "Shouldn't have waiters when credit is available");
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (4)
345Debug.Assert(_availableStreamsWaiter is null, "As used currently, shouldn't already have a waiter"); 1139Debug.Assert(canceled, "Callback should have been unregistered if the operation was completing successfully."); 1425Debug.Assert(headerValuesCount > 0, "No values for header??"); 1857Debug.Assert(completed, "FinalTeardown was called twice");
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (1)
367Debug.Assert(_requestCompletionState == StreamCompletionState.Failed || _responseCompletionState == StreamCompletionState.Failed,
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (1)
676Debug.Assert(headerValuesCount > 0, "No values for header??");
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (15)
401Debug.Assert(headerValuesCount > 0, "No values for header??"); 498Debug.Assert(_currentRequest == null, $"Expected null {nameof(_currentRequest)}."); 499Debug.Assert(_readBuffer.ActiveLength == 0, "Unexpected data in read buffer"); 1729Debug.Assert(_readAheadTask == default, "Read ahead task should have been consumed as part of the headers."); 1747Debug.Assert(_readAheadTask == default, "Read ahead task should have been consumed as part of the headers."); 1768Debug.Assert(_readAheadTask == default, "Read ahead task should have been consumed as part of the headers."); 1806Debug.Assert(_readAheadTask == default, "Read ahead task should have been consumed as part of the headers."); 1896Debug.Assert(_readBuffer.ActiveLength == 0, "HttpConnection's buffer should have been empty."); 2000Debug.Assert(_currentRequest != null, "Expected the connection to be associated with a request."); 2001Debug.Assert(_writeBuffer.ActiveLength == 0, "Everything in write buffer should have been flushed."); 2062Debug.Assert(_currentRequest == null, "Connection should no longer be associated with a request."); 2063Debug.Assert(_readAheadTask == default, "Expected a previous initial read to already be consumed."); 2064Debug.Assert(_readAheadTaskStatus == ReadAheadTask_NotStarted, "Expected SendAsync to reset the read-ahead task status."); 2065Debug.Assert(_readBuffer.ActiveLength == 0, "Unexpected data in connection read buffer."); 2082Debug.Assert(!_detachedFromPool, "Should not be detached from pool unless _connectionClose is true");
System\Net\Http\SocketsHttpHandler\MultiProxy.cs (1)
155Debug.Assert(_uris != null || _proxyConfig != null, $"{nameof(ReadNext)} must not be called on a default-initialized {nameof(MultiProxy)}.");
System.Net.HttpListener (28)
src\libraries\Common\src\System\HexConverter.cs (2)
332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Net\CookieParser.cs (3)
539Debug.Assert(method != null, "We need to use an internal method named InternalSetName that is declared on Cookie."); 557Debug.Assert(field != null, "We need to use an internal field named IsQuotedDomain that is declared on Cookie."); 574Debug.Assert(field != null, "We need to use an internal field named IsQuotedVersion that is declared on Cookie.");
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (2)
261Debug.Assert(value != DBNull.Value, "Result can't be set to DBNull - it's a special internal value."); 263Debug.Assert(!InternalPeekCompleted, "Called on completed result.");
src\libraries\Common\src\System\Net\WebSockets\WebSocketValidate.cs (1)
121Debug.Assert(!string.IsNullOrEmpty(parameterName), "'parameterName' MUST NOT be NULL or string.Empty");
System\Net\HttpListenerRequestUriBuilder.cs (11)
49Debug.Assert(!string.IsNullOrEmpty(rawUri), "Empty raw URL."); 50Debug.Assert(!string.IsNullOrEmpty(cookedUriScheme), "Empty cooked URL scheme."); 51Debug.Assert(!string.IsNullOrEmpty(cookedUriHost), "Empty cooked URL host."); 52Debug.Assert(!string.IsNullOrEmpty(cookedUriPath), "Empty cooked URL path."); 136Debug.Assert(encoding != null, "'encoding' must be assigned."); 137Debug.Assert(!string.IsNullOrEmpty(_rawPath), "'rawPath' must have at least one character."); 150Debug.Assert(_rawOctets.Count == 0, 172Debug.Assert(encoding != null, "'encoding' must be assigned."); 365Debug.Assert(uriString != null, "uriString must not be null"); 366Debug.Assert(uriString.Length > 0, "uriString must not be empty"); 434Debug.Assert(path != null, "'path' must not be null");
System\Net\WebSockets\HttpListenerWebSocketContext.cs (5)
42Debug.Assert(requestUri != null, "requestUri shouldn't be null"); 43Debug.Assert(headers != null, "headers shouldn't be null"); 44Debug.Assert(cookieCollection != null, "cookieCollection shouldn't be null"); 45Debug.Assert(secWebSocketProtocols != null, "secWebSocketProtocols shouldn't be null"); 46Debug.Assert(webSocket != null, "webSocket shouldn't be null");
System\Net\Windows\CookieExtensions.cs (4)
18Debug.Assert(s_toServerStringFunc != null, "Reflection failed for Cookie.ToServerString()."); 27Debug.Assert(s_cloneFunc != null, "Reflection failed for Cookie.Clone()."); 45Debug.Assert(s_getVariantFunc != null, "Reflection failed for Cookie.Variant."); 57Debug.Assert(s_internalAddFunc != null, "Reflection failed for CookieCollection.InternalAdd().");
System.Net.Mail (40)
src\libraries\Common\src\System\Collections\Generic\BidirectionalDictionary.cs (2)
26Debug.Assert(_forward.Count == _backward.Count, "both the dictionaries must have the same number of elements"); 33Debug.Assert(!_backward.ContainsKey(item2), "No added item1 should ever have existing item2");
src\libraries\Common\src\System\HexConverter.cs (2)
332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Net\ContextAwareResult.cs (7)
133Debug.Assert((_flags & StateFlags.ThreadSafeContextCopy) != 0, "Called on completed result."); 144Debug.Assert(AsyncCallback != null || (_flags & StateFlags.CaptureContext) != 0, "No context captured - specify a callback or forceCaptureContext."); 150Debug.Assert(_lock != null, "Must lock (StartPostingAsyncOp()) { ... FinishPostingAsyncOp(); } when calling ContextCopy (unless it's only called after FinishPostingAsyncOp)."); 156Debug.Assert((_flags & StateFlags.ThreadSafeContextCopy) != 0, "Result became completed during call."); 186Debug.Assert(!InternalPeekCompleted, "Called on completed result."); 270Debug.Assert((_flags & StateFlags.PostBlockStarted) != 0, "Called without calling StartPostingAsyncOp."); 313Debug.Assert(AsyncCallback == null || CompletedSynchronously, "Didn't capture context, but didn't complete synchronously!");
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (2)
261Debug.Assert(value != DBNull.Value, "Result can't be set to DBNull - it's a special internal value."); 263Debug.Assert(!InternalPeekCompleted, "Called on completed result.");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Net\Base64Stream.cs (1)
61Debug.Assert(_writeState != null, "_writeState was null");
System\Net\Mail\DomainLiteralReader.cs (1)
35Debug.Assert(data[index] == MailBnfHelper.EndSquareBracket, "data did not end with a square bracket");
System\Net\Mail\MailAddress.cs (4)
34Debug.Assert(_host != null, 37Debug.Assert(userName != null, 40Debug.Assert(displayName != null, 285Debug.Assert(Address != null, "address was null");
System\Net\Mail\MailAddressParser.cs (1)
45Debug.Assert(index == -1 || data[index] == MailBnfHelper.Comma,
System\Net\Mail\MailHeaderInfo.cs (1)
77Debug.Assert((int)s_headerInfo[i].ID == i, "Header info data structures are not in sync");
System\Net\Mail\SmtpCommands.cs (1)
211System.Diagnostics.Debug.Assert(lines.Length == 1, "Did not expect more than one line response for auth command");
System\Net\Mail\SmtpConnection.cs (1)
302Debug.Assert(context == null || context.IdentityRequested, "Authentication required when it wasn't expected. (Maybe Credentials was changed on another thread?)");
System\Net\Mail\WhitespaceReader.cs (4)
34Debug.Assert(!string.IsNullOrEmpty(data), "data was null or empty"); 35Debug.Assert(index < data.Length, "index was outside the bounds of the string"); 117Debug.Assert(!string.IsNullOrEmpty(data), "data was null or empty"); 118Debug.Assert(index < data.Length, "index was outside the bounds of the string");
System\Net\Mime\Base64Encoder.cs (1)
22Debug.Assert(_writeState != null, "_writeState was null");
System\Net\Mime\ByteEncoder.cs (4)
56Debug.Assert(value != null, "value was null"); 57Debug.Assert(WriteState != null, "writestate was null"); 58Debug.Assert(WriteState.Buffer != null, "writestate.buffer was null"); 76Debug.Assert(codepointSize == 1 || codepointSize == 2, "codepointSize was not 1 or 2");
System\Net\Mime\SmtpDateTime.cs (6)
163Debug.Assert(timeZone.Seconds == 0, "Span had seconds value"); 164Debug.Assert(timeZone.Milliseconds == 0, "Span had milliseconds value"); 175Debug.Assert(!string.IsNullOrEmpty(offset), "violation of precondition: offset must not be null or empty"); 176Debug.Assert(offset != UnknownTimeZoneDefaultOffset, "Violation of precondition: do not pass an unknown offset"); 177Debug.Assert(offset.StartsWith('-') || offset.StartsWith('+'), "offset initial character was not a + or -"); 211Debug.Assert(!string.IsNullOrEmpty(value), "violation of precondition: offset must not be null or empty");
System\Net\TrackingValidationObjectDictionary.cs (1)
45Debug.Assert(key != null, "key was null");
System.Net.NetworkInformation (11)
src\libraries\Common\src\System\HexConverter.cs (2)
332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\IO\StringParser.cs (5)
177Debug.Assert(result == int.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 222Debug.Assert(result == long.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 253Debug.Assert(result == uint.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 280Debug.Assert(result == ulong.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 295Debug.Assert(result == char.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result");
System\Net\NetworkInformation\NetworkAddressChange.Unix.cs (4)
74Debug.Assert(Socket == null, 125Debug.Assert(Socket == null, 153Debug.Assert(Socket == null, "Socket is not null, must close existing socket before opening another."); 178Debug.Assert(Socket != null, "Socket was null when CloseSocket was called.");
System.Net.Ping (1)
System\Net\NetworkInformation\Ping.RawSocket.cs (1)
378Debug.Assert(Marshal.SizeOf<IcmpHeader>() == 8, "The size of an ICMP Header must be 8 bytes.");
System.Net.Primitives (4)
src\libraries\Common\src\System\HexConverter.cs (2)
332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Net\CookieParser.cs (2)
557Debug.Assert(field != null, "We need to use an internal field named IsQuotedDomain that is declared on Cookie."); 574Debug.Assert(field != null, "We need to use an internal field named IsQuotedVersion that is declared on Cookie.");
System.Net.Quic (10)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs (2)
72Debug.Assert(bytesNeeded != 0, "OBJ_obj2txt reported a zero-length response"); 92Debug.Assert(
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs (1)
135Debug.Assert(verifyTime.Kind != DateTimeKind.Utc, "UTC verifyTime should have been normalized to Local");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (1)
83Debug.Assert(error <= uint.MaxValue, "ErrGetError should only return error codes in the UInt32 range.");
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs (2)
50Debug.Assert(_parent == null, "Expected no existing parent"); 51Debug.Assert(parent != null && !parent.IsInvalid, "Expected new parent to be non-null and valid");
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (1)
53Debug.Assert(!isCachedInvalidHandle || handle.IsInvalid, "The cached invalid handle must still be invalid.");
src\libraries\Common\src\System\HexConverter.cs (2)
332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (1)
349Debug.Assert(_length > 0, "Length should never be 0 here because BlockCount would be 0");
System.Net.Requests (12)
src\libraries\Common\src\System\Net\ContextAwareResult.cs (7)
133Debug.Assert((_flags & StateFlags.ThreadSafeContextCopy) != 0, "Called on completed result."); 144Debug.Assert(AsyncCallback != null || (_flags & StateFlags.CaptureContext) != 0, "No context captured - specify a callback or forceCaptureContext."); 150Debug.Assert(_lock != null, "Must lock (StartPostingAsyncOp()) { ... FinishPostingAsyncOp(); } when calling ContextCopy (unless it's only called after FinishPostingAsyncOp)."); 156Debug.Assert((_flags & StateFlags.ThreadSafeContextCopy) != 0, "Result became completed during call."); 186Debug.Assert(!InternalPeekCompleted, "Called on completed result."); 270Debug.Assert((_flags & StateFlags.PostBlockStarted) != 0, "Called without calling StartPostingAsyncOp."); 313Debug.Assert(AsyncCallback == null || CompletedSynchronously, "Didn't capture context, but didn't complete synchronously!");
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (2)
261Debug.Assert(value != DBNull.Value, "Result can't be set to DBNull - it's a special internal value."); 263Debug.Assert(!InternalPeekCompleted, "Called on completed result.");
System\Net\FtpControlStream.cs (1)
666Debug.Assert(port != -1, "'port' not set.");
System\Net\FtpWebRequest.cs (1)
1444Debug.Assert(stream is ICloseEx, "The _stream member is not CloseEx hence the risk of connection been orphaned.");
System\Net\TimerThread.cs (1)
200Debug.Assert(_timers.Prev!.Next == _timers, $"Tail corruption.");
System.Net.Security (46)
src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssBuffer.cs (1)
21Debug.Assert(destination != null, "target destination cannot be null");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs (2)
72Debug.Assert(bytesNeeded != 0, "OBJ_obj2txt reported a zero-length response"); 92Debug.Assert(
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs (1)
135Debug.Assert(verifyTime.Kind != DateTimeKind.Utc, "UTC verifyTime should have been normalized to Local");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (1)
83Debug.Assert(error <= uint.MaxValue, "ErrGetError should only return error codes in the UInt32 range.");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (5)
32Debug.Assert( 329Debug.Assert(sslHandle != null, "Expected non-null return value from SafeSslHandle.Create"); 400Debug.Assert(certList != null, "certList != null"); 814Debug.Assert(certPtr != null && !certPtr.IsInvalid, "certPtr != null && !certPtr.IsInvalid"); 815Debug.Assert(keyPtr != null && !keyPtr.IsInvalid, "keyPtr != null && !keyPtr.IsInvalid");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (2)
209Debug.Assert(GetAlpnProtocolListSerializedLength(applicationProtocols) == buffer.Length, 450Debug.Assert(!IsInvalid, "Expected a valid context in Disconnect");
src\libraries\Common\src\Microsoft\Win32\SafeHandles\GssSafeHandles.cs (2)
18Debug.Assert(!string.IsNullOrEmpty(name), "Invalid user name passed to SafeGssNameHandle create"); 35Debug.Assert(!string.IsNullOrEmpty(name), "Invalid target name passed to SafeGssNameHandle create");
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs (2)
50Debug.Assert(_parent == null, "Expected no existing parent"); 51Debug.Assert(parent != null && !parent.IsInvalid, "Expected new parent to be non-null and valid");
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (1)
53Debug.Assert(!isCachedInvalidHandle || handle.IsInvalid, "The cached invalid handle must still be invalid.");
src\libraries\Common\src\System\HexConverter.cs (2)
332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
System\Net\NegotiateAuthenticationPal.Unix.cs (4)
119Debug.Assert(_securityContext is not null && _isAuthenticated, "Trying to get the client SPN before handshaking is done!"); 487Debug.Assert(username != null && password != null, "Username and Password can not be null"); 655Debug.Assert(resultBlob != null, "Unexpected null buffer returned by GssApi"); 709Debug.Assert(resultBlob != null, "Unexpected null buffer returned by GssApi");
System\Net\Security\CipherSuitesPolicyPal.Linux.cs (2)
92Debug.Assert( 109Debug.Assert(
System\Net\Security\NegotiateAuthentication.cs (1)
173Debug.Assert(!OperatingSystem.IsTvOS(), "Server authentication is not supported on tvOS");
System\Net\Security\NegotiateStream.cs (1)
310Debug.Assert(vt.IsCompleted, "Should have completed synchroously with sync adapter");
System\Net\Security\NetSecurityTelemetry.cs (1)
176Debug.Assert(Enum.GetValues<SslProtocols>()[^1] == SslProtocols.Tls13, "Make sure to add a counter for new SslProtocols");
System\Net\Security\Pal.Managed\SafeChannelBindingHandle.cs (1)
23Debug.Assert(certHashBytes != null, "check certHashBytes is not null");
System\Net\Security\SslSessionsCache.cs (1)
149Debug.Assert(creds != null, "creds == null");
System\Net\Security\SslStream.cs (10)
88Debug.Assert(length <= DecryptedLength, "length <= DecryptedLength"); 118Debug.Assert(byteCount <= _decryptedLength, "byteCount <= _decryptedBytes"); 135Debug.Assert(_decryptedLength == 0, "_decryptedBytes == 0"); 136Debug.Assert(_decryptedPadding == 0, "_encryptedOffset == 0"); 143Debug.Assert(_decryptedLength == 0, "_decryptedBytes == 0"); 144Debug.Assert(_decryptedPadding == 0, "_encryptedOffset == 0"); 782Debug.Assert(vt.IsCompleted, "Sync operation must have completed synchronously"); 797Debug.Assert(vt.IsCompleted, "Sync operation must have completed synchronously"); 814Debug.Assert(vt.IsCompleted, "Sync operation must have completed synchronously"); 832Debug.Assert(vt.IsCompleted, "Sync operation must have completed synchronously");
System\Net\Security\SslStream.IO.cs (2)
42Debug.Assert(e != null, $"Expected non-null Exception to be passed to {nameof(SetException)}"); 726Debug.Assert(_buffer.AvailableLength > 0, "_buffer.AvailableBytes > 0");
System\Net\Security\SslStream.Protocol.cs (4)
280Debug.Assert(certificate != null, "certificate != null"); 526Debug.Assert((object?)clientCertificate == (object?)selectedCert || clientCertificate!.Equals(selectedCert), "'selectedCert' does not match 'clientCertificate'."); 738Debug.Assert(localCertificate.Equals(selectedCert), "'selectedCert' does not match 'localCertificate'."); 985Debug.Assert(_maxDataSize > 0, "_maxDataSize > 0");
System.Net.Sockets (26)
System\Net\Sockets\Socket.cs (1)
3408Debug.Assert(boundAddress != null, "Not Bound");
System\Net\Sockets\Socket.Unix.cs (1)
79Debug.Assert(e == Interop.Error.SUCCESS, e.ToString());
System\Net\Sockets\SocketAsyncContext.Unix.cs (15)
169Debug.Assert((State)Volatile.Read(ref _state) is State.Running or State.RunningWithPendingCancellation, "Unexpected operation state"); 703Debug.Assert(success, "Timed out waiting for queue lock"); 836Debug.Assert(observedSequenceNumber - _sequenceNumber < 10000, "Very large sequence number increase???"); 848Debug.Assert(operation.Next == operation, "Expected operation.Next == operation"); 936Debug.Assert(_tail == null, "State == Ready but queue is not empty!"); 942Debug.Assert(_tail != null, "State == Waiting but queue is empty!"); 957Debug.Assert(_tail != null, "State == Processing but queue is empty!"); 992Debug.Assert(op.Event == null, "Sync operation encountered in ProcessAsyncOperation"); 1026Debug.Assert(_tail != null, "Unexpected empty queue while processing I/O"); 1027Debug.Assert(op == _tail.Next, "Operation is not at head of queue???"); 1059Debug.Assert(observedSequenceNumber - _sequenceNumber < 10000, "Very large sequence number increase???"); 1085Debug.Assert(_tail.Next == op, "Queue modified while processing queue"); 1127Debug.Assert(_tail != null, "Unexpected empty queue in CancelAndContinueProcessing"); 1445Debug.Assert(callback != null, "Expected non-null callback"); 1509Debug.Assert(callback != null, "Expected non-null callback");
System\Net\Sockets\SocketPal.Unix.cs (6)
66Debug.Assert(fd != (IntPtr)(-1), "fd should not be -1"); 631Debug.Assert(fd != (IntPtr)(-1), "Expected fd != -1"); 1742Debug.Assert(count > 0, $"Expected at least one entry."); 1782Debug.Assert(eventsLength == checkReadInitialCount + checkWriteInitialCount + checkErrorInitialCount, "Invalid eventsLength"); 1843Debug.Assert(arrOffset < arrLength, "IList.Count must have been faulty, returning a negative value and/or returning a different value across calls."); 1878Debug.Assert(arrEndOffset >= 0, "IList.Count must have been faulty, returning a negative value and/or returning a different value across calls.");
System\Net\Sockets\UnixDomainSocketEndPoint.Unix.cs (3)
28Debug.Assert(s_nativePathOffset >= 0, "Expected path offset to be positive"); 29Debug.Assert(s_nativePathOffset + s_nativePathLength <= s_nativeAddressSize, "Expected address size to include all of the path length"); 30Debug.Assert(s_nativePathLength >= 92, "Expected max path length to be at least 92"); // per http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_un.h.html
System.Net.WebClient (4)
src\libraries\Common\src\System\HexConverter.cs (2)
332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
System\Net\WebClient.cs (2)
871Debug.Assert(_progress != null, "ProgressData should have been initialized"); 1010Debug.Assert(_progress != null, "ProgressData should have been initialized");
System.Net.WebSockets (15)
src\libraries\Common\src\System\Net\WebSockets\WebSocketValidate.cs (1)
121Debug.Assert(!string.IsNullOrEmpty(parameterName), "'parameterName' MUST NOT be NULL or string.Empty");
System\Net\WebSockets\Compression\WebSocketDeflater.cs (2)
43Debug.Assert(_buffer is null, "Invalid state, ReleaseBuffer not called."); 106Debug.Assert(output.Slice(written - WebSocketInflater.FlushMarkerLength, WebSocketInflater.FlushMarkerLength)
System\Net\WebSockets\Compression\WebSocketInflater.cs (1)
89Debug.Assert(totalBytesReceived == 0 || _buffer is not null, "Prepare must be called.");
System\Net\WebSockets\ManagedWebSocket.cs (11)
145Debug.Assert(StateUpdateLock != null, $"Expected {nameof(StateUpdateLock)} to be non-null"); 146Debug.Assert(stream != null, $"Expected non-null {nameof(stream)}"); 147Debug.Assert(stream.CanRead, $"Expected readable {nameof(stream)}"); 148Debug.Assert(stream.CanWrite, $"Expected writeable {nameof(stream)}"); 210Debug.Assert(Monitor.IsEntered(StateUpdateLock), $"Expected {nameof(StateUpdateLock)} to be held"); 432Debug.Assert(_sendMutex.IsHeld, $"Caller should hold the {nameof(_sendMutex)}"); 1142Debug.Assert(_receiveBufferCount >= 2, "Expected to at least have the first two bytes of the header."); 1160Debug.Assert(_receiveBufferCount >= 2, "Expected to have two bytes for the payload length."); 1166Debug.Assert(_receiveBufferCount >= 8, "Expected to have eight bytes for the payload length."); 1363Debug.Assert(count - 2 == encodedLength, $"{nameof(s_textEncoding.GetByteCount)} and {nameof(s_textEncoding.GetBytes)} encoded count didn't match"); 1457Debug.Assert(_sendMutex.IsHeld, $"Caller should hold the {nameof(_sendMutex)}");
System.Net.WebSockets.Client (2)
src\libraries\Common\src\System\Net\WebSockets\WebSocketValidate.cs (1)
121Debug.Assert(!string.IsNullOrEmpty(parameterName), "'parameterName' MUST NOT be NULL or string.Empty");
System\Net\WebSockets\ClientWebSocketOptions.cs (1)
253Debug.Assert(!_isReadOnly, "Already set");
System.Numerics.Tensors (6)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan.cs (2)
557Debug.Assert(copiedValues == _flattenedLength, "Didn't copy the right amount to the array."); 604Debug.Assert(copiedValues == _flattenedLength, "Didn't copy the right amount to the array.");
System\Numerics\Tensors\netcore\TensorSpan.cs (4)
538Debug.Assert(clearedValues == _flattenedLength, "Didn't clear the right amount"); 560Debug.Assert(filledValues == _flattenedLength, "Didn't copy the right amount to the array."); 603Debug.Assert(copiedValues == _flattenedLength, "Didn't copy the right amount to the array."); 646Debug.Assert(copiedValues == _flattenedLength, "Didn't copy the right amount to the array.");
System.ObjectModel (1)
System\Collections\ObjectModel\KeyedCollection.cs (1)
273Debug.Assert(key != null, "key shouldn't be null!");
System.Private.CoreLib (1184)
src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\ExceptionHandling.cs (13)
203Debug.Assert(false, "Unhandled exceptions should be processed by the native runtime only"); 655Debug.Assert(isValid, "Unwind and intercept failed unexpectedly"); 699Debug.Assert(false, "unreachable"); 727Debug.Assert(exInfo._passNumber == 1, "expected asm throw routine to set the pass"); 751Debug.Assert(isValid, "RhThrowEx called with an unexpected context"); 838Debug.Assert(pCatchHandler != null || pReversePInvokePropagationCallback != IntPtr.Zero || unwoundReversePInvoke || isExceptionIntercepted, "We should have a handler if we're starting the second pass"); 839Debug.Assert(!isExceptionIntercepted || (pCatchHandler == null), "No catch handler should be returned for intercepted exceptions in the first pass"); 863Debug.Assert(isValid, "second-pass EH unwind failed unexpectedly"); 878Debug.Assert(frameIter.SP == handlingFrameSP, "Encountered a different reverse P/Invoke frame in the second pass."); 931Debug.Assert(false, "unreachable"); 938Debug.Assert(ip != null, "IP address must not be null"); 944Debug.Assert(handlingFrameSP != MaxSP, "Handling frame must have an SP value"); 945Debug.Assert(((UIntPtr*)handlingFrameSP) > &handlingFrameSP,
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (1)
39Debug.Assert(!b || result.Pid == pid, "Expected process ID from status file to match supplied pid");
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadDir.cs (3)
40Debug.Assert(Name != null, "should not have a null name"); 47Debug.Assert(nameBytes.Length > 0, "we shouldn't have gotten a garbage value from the OS"); 51Debug.Assert(NameLength != -1 || !value.Contains('\0'), "should not have embedded nulls if we parsed the end of string");
src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (13)
67Debug.Assert(InitialSegmentSize > 0, "Initial segment size must be > 0."); 68Debug.Assert((InitialSegmentSize & (InitialSegmentSize - 1)) == 0, "Initial segment size must be a power of 2"); 69Debug.Assert(InitialSegmentSize <= MaxSegmentSize, "Initial segment size should be <= maximum."); 70Debug.Assert(MaxSegmentSize < int.MaxValue / 2, "Max segment size * 2 must be < int.MaxValue, or else overflow could occur."); 102Debug.Assert(segment != null, "Expected a non-null segment."); 112Debug.Assert(newSegmentSize > 0, "The max size should always be small enough that we don't overflow."); 179Debug.Assert(segment != null, "Expected a non-null segment."); 180Debug.Assert(array != null, "Expected a non-null item array."); 253Debug.Assert(segment != null, "Expected a non-null segment."); 254Debug.Assert(array != null, "Expected a non-null item array."); 368Debug.Assert(syncObj != null, "The syncObj parameter is null."); 390Debug.Assert((size & (size - 1)) == 0, "Size must be a power of 2"); 429Debug.Assert(queue != null, "Expected a non-null queue.");
src\libraries\Common\src\System\HexConverter.cs (2)
332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\IO\StringParser.cs (5)
177Debug.Assert(result == int.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 222Debug.Assert(result == long.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 253Debug.Assert(result == uint.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 280Debug.Assert(result == ulong.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 295Debug.Assert(result == char.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result");
src\libraries\Common\src\System\Number.Formatting.Common.cs (1)
820Debug.Assert(p >= spanPtr - 1, "Underflow");
src\libraries\Common\src\System\Number.NumberBuffer.cs (3)
68Debug.Assert(Digits[0] != '0', "Leading zeros should never be stored in a Number"); 83Debug.Assert(numDigits == DigitsCount, "Null terminator found in unexpected location in Number"); 84Debug.Assert(numDigits < Digits.Length, "Null terminator not found in Number");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\libraries\System.Private.CoreLib\src\System\AppContext.cs (1)
157Debug.Assert(s_dataStore == null, "s_dataStore is not expected to be inited before Setup is called");
src\libraries\System.Private.CoreLib\src\System\Array.cs (1)
615Debug.Assert(hi - low >= 0, "Length overflow!");
src\libraries\System.Private.CoreLib\src\System\Buffers\SharedArrayPool.cs (2)
280Debug.Assert(t_tlsBuckets is null, $"Non-null {nameof(t_tlsBuckets)}"); 477Debug.Assert(array is not null, "No nulls should have been present in slots < _count.");
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\FormattingHelpers.CountDigits.cs (1)
103Debug.Assert(table.Length == 32, "Every result of uint.Log2(value) needs a long entry in the table.");
src\libraries\System.Private.CoreLib\src\System\Char.cs (1)
96Debug.Assert(IsLatin1(c), "char.GetLatin1UnicodeCategory(): c should be <= 00ff");
src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentQueue.cs (3)
335Debug.Assert(s._frozenForEnqueues, "Internal segment must be frozen as there's a following segment."); 577Debug.Assert(s._preservedForObservation, "Would have had to been preserved as a segment part of enumeration"); 578Debug.Assert(s._frozenForEnqueues, "Would have had to be frozen for enqueues as it's intermediate");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ArraySortHelper.cs (5)
56Debug.Assert(comparer != null, "Check the arguments in the caller!"); 75Debug.Assert(array != null, "Check the arguments in the caller!"); 76Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 326Debug.Assert(array != null, "Check the arguments in the caller!"); 327Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (13)
199Debug.Assert(_comparer is not null, "The comparer should never be null for a reference type."); 285Debug.Assert(_buckets != null, "_buckets should be non-null"); 286Debug.Assert(_entries != null, "_entries should be non-null"); 407Debug.Assert(_entries != null, "expected entries to be != null"); 522Debug.Assert(entries != null, "expected entries to be non-null"); 602Debug.Assert((StartOfFreeList - entries[_freeList].next) >= -1, "shouldn't overflow because `next` cannot underflow"); 663Debug.Assert(entries != null, "expected entries to be non-null"); 725Debug.Assert((StartOfFreeList - entries[dictionary._freeList].next) >= -1, "shouldn't overflow because `next` cannot underflow"); 827Debug.Assert(_entries != null, "_entries should be non-null"); 880Debug.Assert(_entries != null, "entries should be non-null"); 907Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 953Debug.Assert(_entries != null, "entries should be non-null"); 982Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (11)
199Debug.Assert(_buckets != null, "_buckets should be non-null"); 200Debug.Assert(_entries != null, "_entries should be non-null"); 222Debug.Assert(entries != null, "Expected _entries to be initialized"); 294Debug.Assert(entries != null, "entries should be non-null"); 324Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 927Debug.Assert(_comparer is not null, "The comparer should never be null for a reference type."); 967Debug.Assert(_entries != null, "_entries should be non-null"); 1097Debug.Assert(entries != null, "expected entries to be non-null"); 1161Debug.Assert((StartOfFreeList - entries![_freeList].Next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1252Debug.Assert(_buckets != null, "_buckets shouldn't be null; callers should check first"); 1410Debug.Assert((_buckets != null) && (_count > 0), "_buckets was null but count greater than 0");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\NonRandomizedStringEqualityComparer.cs (2)
87Debug.Assert(obj != null, "This implementation is only called from first-party collection types that guarantee non-null parameters."); 104Debug.Assert(obj != null, "This implementation is only called from first-party collection types that guarantee non-null parameters.");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (1)
91Debug.Assert(index == 0, "Implementation currently only supports index == 0");
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (1)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
src\libraries\System.Private.CoreLib\src\System\Collections\Hashtable.cs (6)
281Debug.Assert(_loadsize < hashsize, "Invalid hashtable loadsize!"); 424Debug.Assert(!_isWriterInProgress, "Race condition detected in usages of Hashtable - multiple threads appear to be writing to a Hashtable instance simultaneously! Don't do that - use Hashtable.Synchronized."); 743Debug.Assert(_loadsize < newsize, "Our current implementation means this is not possible."); 790Debug.Assert(key != null, "key can't be null here!"); 940Debug.Assert(hashcode >= 0, "hashcode >= 0"); // make sure collision bit (sign bit) wasn't set. 972Debug.Assert(!_isWriterInProgress, "Race condition detected in usages of Hashtable - multiple threads appear to be writing to a Hashtable instance simultaneously! Don't do that - use Hashtable.Synchronized.");
src\libraries\System.Private.CoreLib\src\System\ComponentModel\DefaultValueAttribute.cs (1)
44Debug.Assert(IsSupported, "Runtime instantiation of this attribute is not allowed with trimming.");
src\libraries\System.Private.CoreLib\src\System\Convert.cs (2)
172Debug.Assert(value != null, "[Convert.DefaultToType]value!=null"); 2544Debug.Assert(Unsafe.AreSame(ref srcBeginning, ref Unsafe.As<ushort, byte>(ref dest)),
src\libraries\System.Private.CoreLib\src\System\DateTime.cs (5)
218Debug.Assert(kind == DateTimeKind.Local, "Internal Constructor is for local times only"); 819Debug.Assert(ticks <= MaxTicks, "Input parameters validated already"); 1149Debug.Assert(ticks <= MaxTicks, "Input parameters validated already"); 1162Debug.Assert(ticks <= MaxTicks, "Input parameters validated already"); 2053Debug.Assert(ticks <= MaxTicks, "Input parameters validated already");
src\libraries\System.Private.CoreLib\src\System\DateTimeOffset.cs (1)
994Debug.Assert(offset.Ticks >= MinOffset && offset.Ticks <= MaxOffset, "Offset not validated.");
src\libraries\System.Private.CoreLib\src\System\Decimal.cs (2)
630Debug.Assert(buffer.Length >= 16, "buffer.Length >= 16"); 640Debug.Assert(span.Length >= 16, "span.Length >= 16");
src\libraries\System.Private.CoreLib\src\System\DefaultBinder.cs (1)
1062Debug.Assert(cur1.IsStatic != cur2.IsStatic, "hierarchyDepth1 == hierarchyDepth2");
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Debug.cs (1)
90Assert(condition, message.ToStringAndClear());
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventProvider.cs (1)
486Debug.Assert(EtwAPIMaxRefObjCount == 8, $"{nameof(EtwAPIMaxRefObjCount)} must equal the number of fields in {nameof(EightObjects)}");
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (7)
1872Debug.Assert(data->Size >= 0 && data->Size % 2 == 0, "String size should be even"); 1877Debug.Assert(*(charPointer + i) != 0, "String may not contain null chars"); 1879Debug.Assert(*(charPointer + charLength) == 0, "String must be null terminated"); 2810Debug.Assert(EventListener.s_EventSources != null, "should be called within lock on EventListener.EventListenersLock which ensures s_EventSources to be initialized"); 4378Debug.Assert(eventSource.m_id == id, "Unexpected event source ID."); 4384Debug.Assert(allListeners.ContainsKey(dispatcher.m_Listener), "EventSource has a listener not on the global list."); 4394Debug.Assert(dispatcher != null, "Listener is not on all eventSources.");
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\ArrayTypeInfo.cs (1)
46Debug.Assert(value != null, "null accepted only for some overrides");
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\EnumerableTypeInfo.cs (1)
51Debug.Assert(value != null, "null accepted only for some overrides");
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\PropertyValue.cs (3)
132Debug.Assert(_scalarLength == 0, "This ReflectedValue refers to an unboxed value type, not a reference type or boxed value type."); 141Debug.Assert(_scalarLength > 0, "This ReflectedValue refers to a reference type or boxed value type, not an unboxed value type"); 150Debug.Assert(_scalarLength > 0, "This ReflectedValue refers to a reference type or boxed value type, not an unboxed value type");
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingEventSource.cs (2)
632Debug.Assert(eventName != null, "GetOpcodeWithDefault should not returned Start when eventName is null"); 637Debug.Assert(eventName != null, "GetOpcodeWithDefault should not returned Stop when eventName is null");
src\libraries\System.Private.CoreLib\src\System\Environment.GetFolderPathCore.Unix.cs (3)
164Debug.Assert(!string.IsNullOrEmpty(homeDir), $"Expected non-empty homeDir"); 165Debug.Assert(!string.IsNullOrEmpty(key), $"Expected non-empty key"); 166Debug.Assert(!string.IsNullOrEmpty(fallback), $"Expected non-empty fallback");
src\libraries\System.Private.CoreLib\src\System\Globalization\Calendar.cs (2)
123Debug.Assert(BaseCalendarID != CalendarId.UNINITIALIZED_VALUE, "[Calendar.CurrentEraValue] Expected a real calendar ID"); 394Debug.Assert(offset >= 0, "Calendar.GetFirstDayWeekOfYear(): offset >= 0");
src\libraries\System.Private.CoreLib\src\System\Globalization\CharUnicodeInfo.cs (10)
56Debug.Assert(s != null, "s != null"); 57Debug.Assert(index >= 0 && index < s.Length, "index < s.Length"); 89Debug.Assert(bidiCategory == StrongBidiCategory.Other || bidiCategory == StrongBidiCategory.StrongLeftToRight || bidiCategory == StrongBidiCategory.StrongRightToLeft, "Unknown StrongBidiCategory value."); 365Debug.Assert(value != null, "value can not be null"); 366Debug.Assert(index < value.Length, "index < value.Length"); 377Debug.Assert(str != null, "str can not be null"); 378Debug.Assert(str.Length > 0, "str.Length > 0"); 379Debug.Assert(index >= 0 && index < str.Length, "index >= 0 && index < str.Length"); 411Debug.Assert(s != null, "s != null"); 412Debug.Assert((uint)index < (uint)s.Length, "index < s.Length");
src\libraries\System.Private.CoreLib\src\System\Globalization\CharUnicodeInfoData.cs (6)
17Debug.Assert(level1BitCount == 11, "Unexpected level 1 bit count."); 18Debug.Assert(level2BitCount == 5, "Unexpected level 2 bit count."); 19Debug.Assert(level3BitCount == 4, "Unexpected level 3 bit count."); 1436Debug.Assert(level1BitCount == 11, "Unexpected level 1 bit count."); 1437Debug.Assert(level2BitCount == 5, "Unexpected level 2 bit count."); 1438Debug.Assert(level3BitCount == 4, "Unexpected level 3 bit count.");
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.cs (2)
221Debug.Assert(m_name != null, "CompareInfo.OnSerializing - expected m_name to be set already"); 238Debug.Assert(m_name != null, "CompareInfo.Name Expected _name to be set");
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Nls.cs (3)
503Debug.Assert(actualSortKeyLength == 0, "LCMapStringEx should never return a negative value."); 555Debug.Assert(sortKeyLength == 0, "LCMapStringEx should never return a negative value."); 605Debug.Assert(((options & ~(CompareOptions.IgnoreCase |
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.cs (15)
917Debug.Assert(_sRealName != null, "[CultureData.CultureName] Expected _sRealName to be populated by already"); 1104Debug.Assert(_sSpecificCulture != null, "[CultureData.SpecificCultureName] Expected this.sSpecificCulture to be populated by culture data initialization already"); 1683Debug.Assert(_sWindowsName != null, "[CultureData.CalendarIds] Expected _sWindowsName to be populated by already"); 1751Debug.Assert(calendarId > 0 && calendarId <= CalendarId.LAST_CALENDAR, 1767Debug.Assert(_sWindowsName != null, "[CultureData.GetCalendar] Expected _sWindowsName to be populated by already"); 1796Debug.Assert(_sRealName != null, "[CultureData.IsRightToLeft] Expected _sRealName to be populated by already"); 1820Debug.Assert(_sRealName != null, "[CultureData.TextInfoName] Expected _sRealName to be populated by already"); 1832Debug.Assert(_sRealName != null, "[CultureData.SortName] Expected _sRealName to be populated by already"); 1905Debug.Assert(_sRealName != null, "[CultureData.LCID] Expected this.sRealName to be populated already"); 1948Debug.Assert(calendarId > 0, "[CultureData.saEraNames] Expected Calendar.ID > 0"); 1954Debug.Assert(calendarId > 0, "[CultureData.saAbbrevEraNames] Expected Calendar.ID > 0"); 1960Debug.Assert(calendarId > 0, "[CultureData.saAbbrevEraNames] Expected Calendar.ID > 0"); 2129Debug.Assert(startIndex >= 0, "startIndex cannot be negative"); 2130Debug.Assert(!timeParts.AsSpan().ContainsAny('\'', '\\'), "timeParts cannot include quote characters"); 2250Debug.Assert(_sWindowsName != null, "[CultureData.GetNFIValues] Expected _sWindowsName to be populated by already");
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Icu.cs (6)
205Debug.Assert(_sWindowsName != null, "[CultureData.IcuGetLocaleInfo] Expected _sWindowsName to be populated already"); 220Debug.Assert(localeName != null, "[CultureData.IcuGetLocaleInfo] Expected localeName to be not be null"); 245Debug.Assert(_sWindowsName != null, "[CultureData.IcuGetLocaleInfo(LocaleNumberData)] Expected _sWindowsName to be populated already"); 269Debug.Assert(_sWindowsName != null, "[CultureData.IcuGetLocaleInfo(LocaleGroupingData)] Expected _sWindowsName to be populated already"); 292Debug.Assert(_sWindowsName != null, "[CultureData.GetTimeFormatString(bool shortFormat)] Expected _sWindowsName to be populated already"); 444Debug.Assert(false, "[CultureData.IcuGetListSeparator] Unexpected ListSeparator value.");
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Nls.cs (6)
52Debug.Assert(_sRealName != null, "[CultureData.DoGetLocaleInfo] Expected _sRealName to be populated by already"); 79Debug.Assert(_sRealName != null, "[CultureData.DoGetLocaleInfoInt] Expected _sRealName to be populated by already"); 86Debug.Assert(_sRealName != null, "[CultureData.DoGetLocaleInfoInt] Expected _sRealName to be populated by already"); 99Debug.Assert(_sRealName != null, "[CultureData.DoGetLocaleInfoInt] Expected _sRealName to be populated by already"); 106Debug.Assert(_sRealName != null, "[CultureData.DoGetLocaleInfoInt] Expected _sRealName to be populated by already"); 178Debug.Assert(localeName != null, "[CultureData.GetLocaleInfoFromLCType] Expected localeName to be not be null");
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureInfo.cs (3)
465Debug.Assert(s_InvariantCultureInfo != null, "[CultureInfo.InvariantCulture] s_InvariantCultureInfo is null"); 587Debug.Assert(_name != null, "[CultureInfo.DisplayName] Always expect _name to be set"); 814Debug.Assert(calType != CalendarId.GREGORIAN, "calType!=CalendarId.GREGORIAN");
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (4)
166Debug.Assert(value >= 0, "DateTimeFormat.FormatDigits(): value >= 0"); 209Debug.Assert(dayOfWeek >= 0 && dayOfWeek <= 6, "dayOfWeek >= 0 && dayOfWeek <= 6"); 221Debug.Assert(month >= 1 && month <= 12, "month >=1 && month <= 12"); 262Debug.Assert(repeatCount != 3 || repeatCount != 4, "repeateCount should be 3 or 4");
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfo.cs (38)
172Debug.Assert(abbreviatedDayNames.Length == 7, "[DateTimeFormatInfo.GetAbbreviatedDayOfWeekNames] Expected 7 day names in a week"); 186Debug.Assert(m_superShortDayNames.Length == 7, "[DateTimeFormatInfo.InternalGetSuperShortDayNames] Expected 7 day names in a week"); 200Debug.Assert(dayNames.Length == 7, "[DateTimeFormatInfo.GetDayOfWeekNames] Expected 7 day names in a week"); 214Debug.Assert(abbreviatedMonthNames.Length == 12 || abbreviatedMonthNames.Length == 13, 229Debug.Assert(monthNames.Length == 12 || monthNames.Length == 13, 255Debug.Assert(calendarId != CalendarId.UNINITIALIZED_VALUE, "[DateTimeFormatInfo.Populate] Expected initialized calendarId"); 272Debug.Assert(allLongTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long time patterns"); 275Debug.Assert(allShortTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short time patterns"); 278Debug.Assert(allLongDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long date patterns"); 281Debug.Assert(allShortDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short date patterns"); 284Debug.Assert(allYearMonthPatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some year month patterns"); 340Debug.Assert(amDesignator != null, "DateTimeFormatInfo.AMDesignator, amDesignator != null"); 369Debug.Assert(calendar != null, "DateTimeFormatInfo.Calendar: calendar != null"); 573Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.AbbreviatedEnglishEraNames] Expected Calendar.ID > 0"); 589Debug.Assert(dateSeparator != null, "DateTimeFormatInfo.DateSeparator, dateSeparator != null"); 622Debug.Assert(firstDayOfWeek != -1, "DateTimeFormatInfo.FirstDayOfWeek, firstDayOfWeek != -1"); 654Debug.Assert(calendarWeekRule != -1, "DateTimeFormatInfo.CalendarWeekRule, calendarWeekRule != -1"); 768Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.MonthDayPattern] Expected calID > 0"); 772Debug.Assert(monthDayPattern != null, "DateTimeFormatInfo.MonthDayPattern, monthDayPattern != null"); 792Debug.Assert(pmDesignator != null, "DateTimeFormatInfo.PMDesignator, pmDesignator != null"); 974Debug.Assert(timeSeparator != null, "DateTimeFormatInfo.TimeSeparator, timeSeparator != null"); 1037Debug.Assert(values != null, "value != null"); 1196Debug.Assert(m_genitiveAbbreviatedMonthNames.Length == 13, 1206Debug.Assert(genitiveMonthNames.Length == 13, 1222Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.InternalGetLeapYearMonthNames] Expected Calendar.ID > 0"); 1224Debug.Assert(leapYearMonthNames.Length == 13, 1405Debug.Assert(patterns != null && patterns.Length > 0, 1407Debug.Assert(defaultPattern != null, 1483Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.UnclonedYearMonthPatterns] Expected Calendar.ID > 0"); 1485Debug.Assert(allYearMonthPatterns.Length > 0, 1504Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.UnclonedShortDatePatterns] Expected Calendar.ID > 0"); 1506Debug.Assert(allShortDatePatterns.Length > 0, 1525Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.UnclonedLongDatePatterns] Expected Calendar.ID > 0"); 1527Debug.Assert(allLongDatePatterns.Length > 0, 1547Debug.Assert(allShortTimePatterns.Length > 0, 1567Debug.Assert(allLongTimePatterns.Length > 0, 2296Debug.Assert(state == HebrewNumberParsingState.ContinueParsing || state == HebrewNumberParsingState.FoundEndOfHebrewNumber, 2345Debug.Assert(str.Index < str.Value.Length, "DateTimeFormatInfo.Tokenize(): start < value.Length");
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeParse.cs (19)
97Debug.Assert(dtfi != null, "dtfi == null"); 190Debug.Assert(dtfi != null, "dtfi == null"); 553Debug.Assert(hourOffset >= 0 && hourOffset <= 99, "hourOffset >= 0 && hourOffset <= 99"); 554Debug.Assert(minuteOffset >= 0 && minuteOffset <= 99, "minuteOffset >= 0 && minuteOffset <= 99"); 2069Debug.Assert(raw.numCount >= 2, "raw.numCount >= 2"); 2091Debug.Assert(raw.numCount >= 3, "raw.numCount >= 3"); 2513Debug.Assert(dtfi != null, "dtfi == null"); 2809Debug.Assert(result.parsedDate.Kind == DateTimeKind.Unspecified, "result.parsedDate.Kind == DateTimeKind.Unspecified"); 3145Debug.Assert(minDigitLen > 0, "minDigitLen > 0"); 3146Debug.Assert(maxDigitLen < 9, "maxDigitLen < 9"); 3147Debug.Assert(minDigitLen <= maxDigitLen, "minDigitLen <= maxDigitLen"); 5390Debug.Assert(dtfi != null, "Expected non-null DateTimeFormatInfo"); 5429Debug.Assert(Index + count <= Length, "__DTString::Advance: Index + count <= len"); 5756Debug.Assert(Index >= 0 && Index < Length, "Index >= 0 && Index < len"); 5765Debug.Assert(Index >= 0 && Index < Length, "Index >= 0 && Index < len"); 5766Debug.Assert(char.IsAsciiDigit(Value[Index]), "IsDigit(Value[Index])"); 5918Debug.Assert(number >= 0 && number <= 9, "number >= 0 && number <= 9"); 5940Debug.Assert(sub.index == Index, "sub.index == Index"); 5941Debug.Assert(sub.index + sub.length <= Length, "sub.index + sub.length <= len");
src\libraries\System.Private.CoreLib\src\System\Globalization\HebrewCalendar.cs (1)
494Debug.Assert(numDays >= 1, "NumDays >= 1");
src\libraries\System.Private.CoreLib\src\System\Globalization\HebrewNumber.cs (1)
102Debug.Assert(Number > 0 && Number <= 999, "Number is out of range.");
src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.cs (12)
201Debug.Assert(count >= 1, "[IdnMapping.GetAscii] Expected 0 length strings to fail before now."); 372Debug.Assert(!char.IsLowSurrogate(unicode, basicCount), "[IdnMapping.punycode_encode]Unexpected low surrogate"); 449Debug.Assert(delta > 0, "[IdnMapping.cs]1 punycode_encode - delta overflowed int"); 463Debug.Assert(delta > 0, "[IdnMapping.cs]2 punycode_encode - delta overflowed int"); 474Debug.Assert(c_punycodeBase != t, "[IdnMapping.punycode_encode]Expected c_punycodeBase (36) to be != t"); 493Debug.Assert(delta > 0, "[IdnMapping.cs]3 punycode_encode - delta overflowed int"); 693Debug.Assert(w > 0, "[IdnMapping.punycode_decode]Expected w > 0"); 701Debug.Assert(c_punycodeBase != t, "[IdnMapping.punycode_decode]Expected t != c_punycodeBase (36)"); 711Debug.Assert((output.Length - iOutputAfterLastDot - numSurrogatePairs) + 1 > 0, 835Debug.Assert(numpoints != 0, "[IdnMapping.adapt]Expected non-zero numpoints."); 843Debug.Assert(delta + c_skew != 0, "[IdnMapping.adapt]Expected non-zero delta+skew."); 868Debug.Assert(d >= 0 && d < c_punycodeBase, "[IdnMapping.encode_digit]Expected 0 <= d < punycodeBase");
src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Nls.cs (1)
100Debug.Assert(realLength > buffer.Length, "Buffer overflow should have iLength > cBuffer.Length");
src\libraries\System.Private.CoreLib\src\System\Globalization\RegionInfo.cs (1)
112Debug.Assert(_name != null, "Expected RegionInfo._name to be populated already");
src\libraries\System.Private.CoreLib\src\System\Globalization\SortKey.cs (2)
54Debug.Assert(key1Data != null, "key1Data != null"); 55Debug.Assert(key2Data != null, "key2Data != null");
src\libraries\System.Private.CoreLib\src\System\Globalization\TextElementEnumerator.cs (2)
21Debug.Assert(str != null, "TextElementEnumerator(): str != null"); 22Debug.Assert(startIndex >= 0 && startIndex <= str.Length, "TextElementEnumerator(): startIndex >= 0 && startIndex <= str.Length");
src\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.cs (2)
631Debug.Assert(charLen == 1 || charLen == 2, "[TextInfo.AddNonLetter] CharUnicodeInfo.InternalGetUnicodeCategory returned an unexpected charLen!"); 647Debug.Assert(charLen == 1 || charLen == 2, "[TextInfo.AddTitlecaseLetter] CharUnicodeInfo.InternalGetUnicodeCategory returned an unexpected charLen!");
src\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.Nls.cs (1)
42Debug.Assert(ret == pSourceLen, "Expected getting the same length of the original string");
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanFormat.cs (10)
551Debug.Assert((field == 0 && sb.Length == 0) || field == 1, "field == 0 || field == 1, Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 559Debug.Assert((field == 1 && sb.Length == 0) || field == 2, "field == 1 || field == 2, Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 567Debug.Assert((field == 2 && sb.Length == 0) || field == 3, "field == 2 || field == 3, Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 575Debug.Assert((field == 3 && sb.Length == 0) || field == 4, "field == 3 || field == 4, Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 584Debug.Assert((field == 4 && sb.Length == 0) || field == 5, "field == 4 || field == 5, Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 600Debug.Assert(0 < dd && dd < 3, "0 < dd && dd < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 601Debug.Assert(0 < hh && hh < 3, "0 < hh && hh < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 602Debug.Assert(0 < mm && mm < 3, "0 < mm && mm < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 603Debug.Assert(0 < ss && ss < 3, "0 < ss && ss < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 604Debug.Assert(0 < ff && ff < 8, "0 < ff && ff < 8, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern");
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanParse.cs (4)
447Debug.Assert(_tokenCount == (_sepCount + _numCount), "tokenCount == (SepCount + NumCount)"); 631Debug.Assert(success, "Should have thrown on failure"); 653Debug.Assert(success, "Should have thrown on failure"); 675Debug.Assert(success, "Should have thrown on failure");
src\libraries\System.Private.CoreLib\src\System\Globalization\UmAlQuraCalendar.cs (6)
267Debug.Assert((HijriYear >= MinCalendarYear) && (HijriYear <= MaxCalendarYear), "Hijri year is out of range."); 268Debug.Assert(HijriMonth >= 1, "Hijri month is out of range."); 269Debug.Assert(HijriDay >= 1, "Hijri day is out of range."); 339Debug.Assert((time.Ticks >= s_minDate.Ticks) && (time.Ticks <= s_maxDate.Ticks), "Gregorian date is out of range."); 487Debug.Assert((year >= MinCalendarYear) && (year <= MaxCalendarYear), "Hijri year is out of range."); 497Debug.Assert((days == 354) || (days == 355), "Hijri year has to be 354 or 355 days.");
src\libraries\System.Private.CoreLib\src\System\Guid.cs (4)
259Debug.Assert(success, "GuidParseThrowStyle.All means throw on all failures"); 274Debug.Assert(success, "GuidParseThrowStyle.AllButOverflow means throw on all failures"); 333Debug.Assert(success, "GuidParseThrowStyle.AllButOverflow means throw on all failures"); 1172Debug.Assert(result && bytesWritten == guidString.Length, "Formatting guid should have succeeded.");
src\libraries\System.Private.CoreLib\src\System\IO\BinaryReader.cs (3)
159Debug.Assert(numBytes is 1 or 2, "BinaryReader::ReadOneChar assumes it's reading one or two bytes only."); 178Debug.Assert(charsRead < 2, "BinaryReader::ReadOneChar - assuming we only got 0 or 1 char, not 2!"); 458Debug.Assert(buffer.Length != 1, "length of 1 should use ReadByte.");
src\libraries\System.Private.CoreLib\src\System\IO\BufferedStream.cs (10)
199Debug.Assert(!(_writePos > 0 && _readPos != _readLen), "Read and Write buffers cannot both have data in them at the same time."); 368Debug.Assert(_writePos == 0, "BufferedStream: Write buffer must be empty in FlushRead!"); 407Debug.Assert(_readPos == 0 && _readLen == 0, 409Debug.Assert(_buffer != null && _bufferSize >= _writePos, 420Debug.Assert(_readPos == 0 && _readLen == 0, 422Debug.Assert(_buffer != null && _bufferSize >= _writePos, 499Debug.Assert(_readLen == _readPos, "The read buffer must now be empty"); 549Debug.Assert(_readLen == _readPos, "The read buffer must now be empty"); 1256Debug.Assert(_writePos == 0, "Write buffer must be empty if there's data in the read buffer"); 1295Debug.Assert(_writePos == 0, "Write buffer must be empty if there's data in the read buffer");
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEntry.Unix.cs (1)
85Debug.Assert(charsWritten > 0, "didn't write any chars to buffer");
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (1)
106Debug.Assert(path != null, "File.Exists: GetFullPath returned null");
src\libraries\System.Private.CoreLib\src\System\IO\FileInfo.cs (1)
26Debug.Assert(!isNormalized || !PathInternal.IsPartiallyQualified(fullPath.AsSpan()), "should be fully qualified if normalized");
src\libraries\System.Private.CoreLib\src\System\IO\FileNotFoundException.cs (1)
53Debug.Assert(_message != null, "_message was null after calling SetMessageField");
src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (3)
243Debug.Assert(_position + n >= 0, "_position + n >= 0"); // len is less than 2^31 -1. 330Debug.Assert(_position + n >= 0, "_position + n >= 0"); // len is less than 2^31 -1. 533Debug.Assert(_position >= _origin, "_position >= _origin");
src\libraries\System.Private.CoreLib\src\System\IO\Path.cs (7)
640Debug.Assert(result, "should never fail joining first two paths"); 705Debug.Assert(first.Length > 0 && second.Length > 0, "should have dealt with empty paths"); 716Debug.Assert(first.Length > 0 && second.Length > 0 && third.Length > 0, "should have dealt with empty paths"); 732Debug.Assert(first.Length > 0 && second.Length > 0 && third.Length > 0 && fourth.Length > 0, "should have dealt with empty paths"); 800Debug.Assert(byteCount == 8, $"Unexpected {nameof(byteCount)}"); 801Debug.Assert(chars.Length == 12, $"Unexpected {nameof(chars)}.Length"); 831Debug.Assert((b2 & 0xF8) == 0, "Unexpected set bits");
src\libraries\System.Private.CoreLib\src\System\IO\Path.Unix.cs (1)
68Debug.Assert(collapsedString.Length < path.Length || collapsedString.ToString() == path,
src\libraries\System.Private.CoreLib\src\System\IO\PinnedBufferMemoryStream.cs (1)
19Debug.Assert(array != null, "Array can't be null");
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs (22)
28Debug.Assert(bufferSize > 1, "Buffering must not be enabled for smaller buffer sizes"); 62Debug.Assert(!(_writePos > 0 && _readPos != _readLen), "Read and Write buffers cannot both have data in them at the same time."); 162Debug.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), 233Debug.Assert(_readPos == _readLen, "Read buffer should be empty!"); 301Debug.Assert(!_strategy.IsClosed, "FileStream ensures that strategy is not closed"); 302Debug.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), 380Debug.Assert(_writePos == 0, "Win32FileStream must not have buffered write data here! Pipes should be unidirectional."); 427Debug.Assert(_readLen == _readPos, "The read buffer must now be empty"); 518Debug.Assert(_writePos == 0, "FlushWrite must set _writePos to 0"); 524Debug.Assert(_writePos == 0, "FileStream cannot have buffered data to write here! Your stream will be corrupted."); 598Debug.Assert(!_strategy.IsClosed, "FileStream ensures that strategy is not closed"); 599Debug.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), 601Debug.Assert(_strategy.CanSeek || (_readPos == 0 && _readLen == 0), 721Debug.Assert(_writePos == 0, "FileStream cannot have buffered data to write here! Your stream will be corrupted."); 758Debug.Assert(!_strategy.IsClosed, "FileStream responsibility"); 759Debug.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), 854Debug.Assert(_writePos == 0, "Write buffer must be empty if there's data in the read buffer"); 885Debug.Assert(_writePos == 0, "Write buffer must be empty if there's data in the read buffer"); 952Debug.Assert(_writePos == 0, "Write buffer must be empty in FlushRead!"); 965Debug.Assert(_readPos == 0 && _readLen == 0, "Read buffer must be empty in FlushWrite!"); 966Debug.Assert(_buffer != null && _bufferSize >= _writePos, "Write buffer must be allocated and write position must be in the bounds of the buffer in FlushWrite!"); 1044Debug.Assert(!_strategy.IsClosed, "FileStream ensures that strategy is not closed");
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\OSFileStreamStrategy.cs (2)
189Debug.Assert(value >= 0, "value >= 0"); 192Debug.Assert(!_fileHandle.TryGetCachedLength(out _), "If length can be cached (file opened for reading, not shared for writing), it should be impossible to modify file length");
src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (6)
238Debug.Assert(thisTask != null && thisTask._stream != null, 520Debug.Assert(thisTask != null && thisTask._stream != null, 564Debug.Assert(asyncWaiter.IsCompletedSuccessfully, "The semaphore wait should always complete successfully."); 571Debug.Assert(t.IsCompletedSuccessfully, "The semaphore wait should always complete successfully."); 573Debug.Assert(rwt._stream != null, "Validates that this code isn't run a second time."); 593Debug.Assert(_asyncActiveSemaphore != null, "Must have been initialized in order to get here.");
src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (27)
463Debug.Assert(_byteLen >= n, "CompressBuffer was called with a number of bytes greater than the current buffer length. Are two threads using this StreamReader at the same time?"); 472Debug.Assert(_byteLen >= 2, "Caller should've validated that at least 2 bytes were available."); 553Debug.Assert(_bytePos < preamble.Length, "_compressPreamble was called with the current bytePos greater than the preamble buffer length. Are two threads using this StreamReader at the same time?"); 567Debug.Assert(_bytePos <= preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 598Debug.Assert(_bytePos <= _encoding.Preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 600Debug.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 612Debug.Assert(_bytePos == 0, "bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?"); 614Debug.Assert(_byteLen >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 643Debug.Assert(_charPos == 0 && _charLen == 0, "We shouldn't be trying to decode more data if we made progress in an earlier iteration."); 653Debug.Assert(_charPos == 0 && _charLen == 0, "We shouldn't be looking for EOF unless we have an empty char buffer."); 702Debug.Assert(_bytePos <= _encoding.Preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 704Debug.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 716Debug.Assert(_bytePos == 0, "bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?"); 718Debug.Assert(_byteLen >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 750Debug.Assert(charsRead == 0 && _charPos == 0 && _charLen == 0, "We shouldn't be trying to decode more data if we made progress in an earlier iteration."); 768Debug.Assert(charsRead == 0 && _charPos == 0 && _charLen == 0, "We shouldn't be looking for EOF unless we have an empty char buffer."); 924Debug.Assert(charPos < charLen, "ReadBuffer returned > 0 but didn't bump _charLen?"); 1140Debug.Assert(_bytePos <= _encoding.Preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 1143Debug.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 1176Debug.Assert(_bytePos == 0, "_bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?"); 1180Debug.Assert(_byteLen >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 1335Debug.Assert(_bytePos <= _encoding.Preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 1338Debug.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 1350Debug.Assert(_bytePos == 0, "_bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?"); 1352Debug.Assert(_byteLen >= 0, "Stream.Read returned a negative number! Bug in stream class."); 1381Debug.Assert(_charPos == 0 && _charLen == 0, "We shouldn't be trying to decode more data if we made progress in an earlier iteration."); 1391Debug.Assert(_charPos == 0 && _charLen == 0, "We shouldn't be looking for EOF unless we have an empty char buffer.");
src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (1)
792Debug.Assert(n > 0, "StreamWriter::Write(char[], int, int) isn't making progress! This is most likely a race condition in user code.");
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStream.cs (1)
382Debug.Assert(pos + nInt >= 0, "_position + n >= 0"); // len is less than 2^63 -1.
src\libraries\System.Private.CoreLib\src\System\Lazy.cs (1)
93Debug.Assert(_exceptionDispatch != null, "execution path is invalid");
src\libraries\System.Private.CoreLib\src\System\Marvin.cs (3)
48Debug.Assert(loopCount > 0, "Shouldn't reach this code path for small inputs."); 93Debug.Assert(count >= 4, "Only should've gotten here if the original count was >= 4."); 106Debug.Assert(count >= 4, "Only should've gotten here if the original count was >= 4.");
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (1)
4590Debug.Assert(formatter != null, "An incorrectly written provider said it implemented ICustomFormatter, and then didn't");
src\libraries\System.Private.CoreLib\src\System\Number.Parsing.cs (1)
226Debug.Assert((styles & ~NumberStyles.Integer) == 0, "Only handles subsets of Integer format");
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\DynamicMethod.cs (4)
255Debug.Assert(owner == null && m == null, "owner and m cannot be set for transparent methods"); 261Debug.Assert(m != null || owner != null, "Constructor should ensure that either m or owner is set"); 262Debug.Assert(m == null || !m.Equals(s_anonymouslyHostedDynamicMethodsModule), "The user cannot explicitly use this assembly"); 263Debug.Assert(m == null || owner == null, "m and owner cannot both be set");
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeBuilderInstantiation.cs (1)
34Debug.Assert(type != null, "this is only called from RuntimeType.MakeGenericType and TypeBuilder.MakeGenericType so 'type' cannot be null");
src\libraries\System.Private.CoreLib\src\System\Reflection\FieldAccessor.cs (1)
200Debug.Assert(false, "Unknown enum value");
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs (1)
405Debug.Assert(!sigElementType.IsNullableOfT, "A true boxed Nullable<T> should never be here.");
src\libraries\System.Private.CoreLib\src\System\Resources\FastResourceComparer.cs (5)
75Debug.Assert(a != null && bytes != null, "FastResourceComparer::CompareOrdinal must have non-null params"); 76Debug.Assert(bCharLength * 2 <= bytes.Length, "FastResourceComparer::CompareOrdinal - numChars is too big!"); 111Debug.Assert((byteLen & 1) == 0, "CompareOrdinal is expecting a UTF-16 string length, which must be even!"); 112Debug.Assert(a != null && b != null, "Null args not allowed."); 113Debug.Assert(byteLen >= 0, "byteLen must be non-negative.");
src\libraries\System.Private.CoreLib\src\System\Resources\FileBasedResourceGroveler.cs (5)
20Debug.Assert(mediator != null, "mediator shouldn't be null; check caller"); 29Debug.Assert(culture != null, "culture shouldn't be null; check caller"); 64Debug.Assert(culture != null, "culture shouldn't be null; check caller"); 65Debug.Assert(fileName != null, "fileName shouldn't be null; check caller"); 88Debug.Assert(file != null, "file shouldn't be null; check caller");
src\libraries\System.Private.CoreLib\src\System\Resources\ManifestBasedResourceGroveler.cs (15)
31Debug.Assert(mediator != null, "mediator shouldn't be null; check caller"); 37Debug.Assert(culture != null, "culture shouldn't be null; check caller"); 38Debug.Assert(localResourceSets != null, "localResourceSets shouldn't be null; check caller"); 90Debug.Assert(satellite != null, "satellite should not be null when stream is set"); 128Debug.Assert(a != null, "assembly != null"); 168Debug.Assert(store != null, "I need a Stream!"); 225Debug.Assert(readerTypeName != null, "Reader Type name should be set"); 226Debug.Assert(resSetTypeName != null, "ResourceSet Type name should be set"); 305Debug.Assert(resSetTypeName != null, "We should have a ResourceSet type name from the custom resource file here."); 320Debug.Assert(satellite != null, "satellite shouldn't be null; check caller"); 321Debug.Assert(fileName != null, "fileName shouldn't be null; check caller"); 333Debug.Assert(satellite != null, "satellite shouldn't be null; check caller"); 334Debug.Assert(name != null, "name shouldn't be null; check caller"); 397Debug.Assert(readerTypeName != null, "readerTypeName shouldn't be null; check caller"); 398Debug.Assert(resSetTypeName != null, "resSetTypeName shouldn't be null; check caller");
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceManager.cs (2)
430Debug.Assert(culture != null, "culture != null"); 556Debug.Assert(asmTypeName != null, "asmTypeName was unexpectedly null");
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.Core.cs (5)
34Debug.Assert(stream != null, "Need a stream!"); 35Debug.Assert(stream.CanRead, "Stream should be readable!"); 36Debug.Assert(resCache != null, "Need a Dictionary!"); 178Debug.Assert(index >= 0 && index < _numResources, "Couldn't find data position within sorted data positions array!"); 181Debug.Assert(len >= 0 && len <= (int)_store.BaseStream.Length - dataPos + _dataSectionOffset, "Length was negative or outside the bounds of the file!");
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (20)
46Debug.Assert(value >= 0, "negative ResourceTypeCode. What?"); 201Debug.Assert(_nameHashes != null && _nameHashesPtr == null, "Internal state mangled."); 206Debug.Assert(_nameHashes == null && _nameHashesPtr != null, "Internal state mangled."); 217Debug.Assert(_namePositions != null && _namePositionsPtr == null, "Internal state mangled."); 222Debug.Assert(_namePositions == null && _namePositionsPtr != null, "Internal state mangled."); 258Debug.Assert(_store != null, "ResourceReader is closed!"); 339Debug.Assert(_store != null, "ResourceReader is closed!"); 382Debug.Assert(_store != null, "ResourceReader is closed!"); 453Debug.Assert(_store != null, "ResourceReader is closed!"); 477Debug.Assert(_store != null, "ResourceReader is closed!"); 539Debug.Assert(_store != null, "ResourceReader is closed!"); 540Debug.Assert(_version == 1, ".resources file was not a V1 .resources file!"); 621Debug.Assert(_store != null, "ResourceReader is closed!"); 622Debug.Assert(_version >= 2, ".resources file was not a V2 (or higher) .resources file!"); 729Debug.Assert(r == len, "ResourceReader needs to use a blocking read here. (Call _store.ReadBytes(len)?)"); 782Debug.Assert(_store != null, "ResourceReader is closed!"); 1001Debug.Assert(_typeTable[typeIndex] != null, "Should have found a type!"); 1032Debug.Assert(typeCode >= 0, "can't be negative"); 1037Debug.Assert(!string.Equals(typeCode.ToString(), "LastPrimitive"), "Change ResourceTypeCode metadata order so LastPrimitive isn't what Enum.ToString prefers."); 1043Debug.Assert(typeIndex >= 0 && typeIndex < _typeTable.Length, "TypeCode is broken or corrupted!");
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncMethodBuilderCore.cs (3)
146Debug.Assert(continuation != null, "Expected non-null continuation"); 147Debug.Assert(invokeAction != null, "Expected non-null invokeAction"); 148Debug.Assert(innerTask != null, "Expected non-null innerTask");
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilderT.cs (3)
302Debug.Assert((m_stateFlags & (int)InternalTaskOptions.PromiseTask) != 0, "Expected state flags to already be configured."); 303Debug.Assert(m_stateObject is null, "Expected to be able to use the state object field for ExecutionContext."); 487Debug.Assert(task != null, "Expected non-null task");
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncVoidMethodBuilder.cs (1)
152Debug.Assert(context != null, "Must only be used with a non-null context.");
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConditionalWeakTable.cs (6)
294Debug.Assert(table != null, "Must provide a valid table"); 295Debug.Assert(Monitor.IsEntered(table._lock), "Must hold the _lock lock to construct the enumerator"); 296Debug.Assert(table._container != null, "Should not be used on a finalized table"); 297Debug.Assert(table._container.FirstFreeEntry > 0, "Should have returned an empty enumerator instead"); 301Debug.Assert(table._activeEnumeratorRefCount >= 0, "Should never have a negative ref count before incrementing"); 328Debug.Assert(table._activeEnumeratorRefCount >= 0, "Should never have a negative ref count after decrementing");
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\DefaultInterpolatedStringHandler.cs (2)
505Debug.Assert(provider is not CultureInfo || provider.GetFormat(typeof(ICustomFormatter)) is null, "Expected CultureInfo to not provide a custom formatter"); 526Debug.Assert(formatter != null, "An incorrectly written provider said it implemented ICustomFormatter, and then didn't");
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilderT.cs (1)
408Debug.Assert(StateMachine is not null, $"Null {nameof(StateMachine)}");
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs (10)
32Debug.Assert(task != null, "Constructing an awaiter requires a task to await."); 107Debug.Assert(taskCompleted, "With an infinite timeout, the task should have always completed."); 129Debug.Assert(task.IsCompleted, "Task must have been completed by now."); 130Debug.Assert(task.Status != TaskStatus.RanToCompletion, "Task should not be completed successfully."); 217Debug.Assert(task != null, "Need a task to wait on"); 218Debug.Assert(continuation != null, "Need a continuation to invoke when the wait completes"); 298Debug.Assert(task != null, "Constructing an awaiter requires a task to await."); 366Debug.Assert(task != null, "Constructing an awaitable requires a task to await."); 394Debug.Assert(task != null, "Constructing an awaiter requires a task to await."); 476Debug.Assert(task != null, "Constructing an awaiter requires a task to await.");
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\CollectionsMarshal.cs (2)
29Debug.Assert(items is not null, "Implementation depends on List<T> always having an array."); 37Debug.Assert(typeof(T[]) == list._items.GetType(), "Implementation depends on List<T> always using a T[] and not U[] where U : T.");
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.Unix.cs (1)
37Debug.Assert(bufferLength >= (s.Length + 1) * SystemMaxDBCSCharSize, "Insufficient buffer length passed to StringToAnsiString");
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (1)
279Debug.Assert(allContexts != null, "Creating the default context should have initialized the contexts collection.");
src\libraries\System.Private.CoreLib\src\System\Runtime\MemoryFailPoint.cs (1)
337Debug.Assert(Volatile.Read(ref s_failPointReservedMemory) >= 0, "Process-wide MemoryFailPoint reserved memory was negative!");
src\libraries\System.Private.CoreLib\src\System\Runtime\Serialization\SerializationInfo.cs (14)
105Debug.Assert(_names.Length == _count, "[SerializationInfo.ExpandArrays]_names.Length == _count"); 267Debug.Assert(null != name, "[SerializationInfo.UpdateValue]name!=null"); 268Debug.Assert(null != value, "[SerializationInfo.UpdateValue]value!=null"); 269Debug.Assert(type is not null, "[SerializationInfo.UpdateValue]type!=null"); 310Debug.Assert(index < _values.Length, "[SerializationInfo.GetElement]index<_values.Length"); 311Debug.Assert(index < _types.Length, "[SerializationInfo.GetElement]index<_types.Length"); 314Debug.Assert(foundType is not null, "[SerializationInfo.GetElement]foundType!=null"); 327Debug.Assert(index < _values.Length, "[SerializationInfo.GetElement]index<_values.Length"); 328Debug.Assert(index < _types.Length, "[SerializationInfo.GetElement]index<_types.Length"); 331Debug.Assert(foundType is not null, "[SerializationInfo.GetElement]foundType!=null"); 349Debug.Assert(_converter != null, "[SerializationInfo.GetValue]_converter!=null"); 355Debug.Assert(type is not null, "[SerializationInfo.GetValue]type ==null"); 356Debug.Assert(type is RuntimeType, "[SerializationInfo.GetValue]type is not a runtime type"); 367Debug.Assert(_converter != null, "[SerializationInfo.GetValue]_converter!=null");
src\libraries\System.Private.CoreLib\src\System\Runtime\Serialization\SerializationInfoEnumerator.cs (7)
38Debug.Assert(members != null, "[SerializationInfoEnumerator.ctor]members!=null"); 39Debug.Assert(info != null, "[SerializationInfoEnumerator.ctor]info!=null"); 40Debug.Assert(types != null, "[SerializationInfoEnumerator.ctor]types!=null"); 41Debug.Assert(numItems >= 0, "[SerializationInfoEnumerator.ctor]numItems>=0"); 42Debug.Assert(members.Length >= numItems, "[SerializationInfoEnumerator.ctor]members.Length>=numItems"); 43Debug.Assert(info.Length >= numItems, "[SerializationInfoEnumerator.ctor]info.Length>=numItems"); 44Debug.Assert(types.Length >= numItems, "[SerializationInfoEnumerator.ctor]types.Length>=numItems");
src\libraries\System.Private.CoreLib\src\System\Runtime\Versioning\VersioningHelper.cs (1)
166Debug.Assert(requires == SxSRequirements.None, "Computed a strange set of required resource scoping. It's probably wrong.");
src\libraries\System.Private.CoreLib\src\System\SearchValues\IndexOfAnyAsciiSearcher.cs (12)
270Debug.Assert(searchSpaceLength >= Vector256<short>.Count, "We expect that the input is long enough for us to load a whole vector."); 323Debug.Assert(searchSpaceLength >= Vector128<short>.Count, "We expect that the input is long enough for us to load a whole vector."); 401Debug.Assert(searchSpaceLength >= Vector256<short>.Count, "We expect that the input is long enough for us to load a whole vector."); 452Debug.Assert(searchSpaceLength >= Vector128<short>.Count, "We expect that the input is long enough for us to load a whole vector."); 548Debug.Assert(searchSpaceLength >= Vector128<byte>.Count, "We expect that the input is long enough for us to load a Vector128."); 597Debug.Assert(searchSpaceLength >= sizeof(ulong), "We expect that the input is long enough for us to load a ulong."); 672Debug.Assert(searchSpaceLength >= Vector128<byte>.Count, "We expect that the input is long enough for us to load a Vector128."); 721Debug.Assert(searchSpaceLength >= sizeof(ulong), "We expect that the input is long enough for us to load a ulong."); 819Debug.Assert(searchSpaceLength >= Vector128<byte>.Count, "We expect that the input is long enough for us to load a Vector128."); 871Debug.Assert(searchSpaceLength >= sizeof(ulong), "We expect that the input is long enough for us to load a ulong."); 947Debug.Assert(searchSpaceLength >= Vector128<byte>.Count, "We expect that the input is long enough for us to load a Vector128."); 999Debug.Assert(searchSpaceLength >= sizeof(ulong), "We expect that the input is long enough for us to load a ulong.");
src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticWithAsciiCharSearchValues.cs (4)
57Debug.Assert(_inverseAsciiState.Lookup.Contains(0), "The inverse bitmap did not contain a 0."); 66Debug.Assert(!(Ssse3.IsSupported || PackedSimd.IsSupported) || !_inverseAsciiState.Lookup.Contains(0), 156Debug.Assert(_inverseAsciiState.Lookup.Contains(0), "The inverse bitmap did not contain a 0."); 165Debug.Assert(!(Ssse3.IsSupported || PackedSimd.IsSupported) || !_inverseAsciiState.Lookup.Contains(0),
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasickBuilder.cs (1)
44Debug.Assert(_nodes[0].MatchLength == 0, "The root node shouldn't have a match.");
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\RabinKarp.cs (2)
112Debug.Assert(span.Length <= MaxInputLength, "Teddy should have handled short inputs."); 164Debug.Assert(span.Length <= MaxInputLength, "Teddy should have handled long inputs.");
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\StringSearchValuesHelper.cs (1)
147Debug.Assert(matchStart == candidate[0], "This should only be called after the first character has been checked");
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\TeddyBucketizer.cs (2)
84Debug.Assert(bucketCount == 8, "This may change if we end up supporting the 'fat Teddy' variant."); 85Debug.Assert(values.Length > bucketCount, "Should be using a non-bucketized implementation.");
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValues.cs (1)
340Debug.Assert(newValuesCount > values.Length, "Shouldn't have been called if there were no letters present");
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValuesBase.cs (2)
30Debug.Assert(_uniqueValues is not null, "ContainsCore should be overridden if uniqueValues weren't provided."); 36Debug.Assert(_uniqueValues is not null, "GetValues should be overridden if uniqueValues weren't provided.");
src\libraries\System.Private.CoreLib\src\System\Security\SecureString.cs (2)
55Debug.Assert(str._buffer != null, "Expected other SecureString's buffer to be non-null"); 56Debug.Assert(str._encrypted, "Expected to be used only on encrypted SecureStrings");
src\libraries\System.Private.CoreLib\src\System\Security\SecurityElement.cs (7)
87Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 176Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 237Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 306Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 346Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 421Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 485Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly");
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.T.cs (32)
1061Debug.Assert(length >= 0, "Expected non-negative length"); 1076Debug.Assert(length >= 0, "Expected non-negative length"); 1091Debug.Assert(length >= 0, "Expected non-negative length"); 1107Debug.Assert(length >= 0, "Expected non-negative length"); 1123Debug.Assert(length >= 0, "Expected non-negative length"); 1141Debug.Assert(length >= 0, "Expected non-negative length"); 1159Debug.Assert(length >= 0, "Expected non-negative length"); 1178Debug.Assert(length >= 0, "Expected non-negative length"); 1318Debug.Assert(length >= 0, "Expected non-negative length"); 1319Debug.Assert(value is byte or short or int or long, "Expected caller to normalize to one of these types"); 1498Debug.Assert(length >= 0, "Expected non-negative length"); 1499Debug.Assert(value is byte or short or int or long, "Expected caller to normalize to one of these types"); 1704Debug.Assert(length >= 0, "Expected non-negative length"); 1705Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 1911Debug.Assert(length >= 0, "Expected non-negative length"); 1912Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 2103Debug.Assert(length >= 0, "Expected non-negative length"); 2104Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 2265Debug.Assert(length >= 0, "Expected non-negative length"); 2266Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 2431Debug.Assert(length >= 0, "Expected non-negative length"); 2432Debug.Assert(value is byte or short or int or long, "Expected caller to normalize to one of these types"); 2551Debug.Assert(length >= 0, "Expected non-negative length"); 2552Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 2736Debug.Assert(length >= 0, "Expected non-negative length"); 2737Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 2922Debug.Assert(length >= 0, "Expected non-negative length"); 2923Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 3094Debug.Assert(Vector128.IsHardwareAccelerated && Vector128<T>.IsSupported, "Vector128 is not HW-accelerated or not supported"); 3151Debug.Assert(Vector512.IsHardwareAccelerated && Vector512<T>.IsSupported, "Vector512 is not HW-accelerated or not supported"); 3189Debug.Assert(length >= 0, "Expected non-negative length"); 3190Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types");
src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (6)
82Debug.Assert(strA._firstChar == strB._firstChar, 189Debug.Assert(*(a + 1) != *(b + 1), "This char must be different if we reach here!"); 820Debug.Assert(src[this.Length] == '\0', "src[this.Length] == '\\0'"); 821Debug.Assert(((int)src) % 4 == 0, "Managed string should start at 4 bytes boundary"); 855Debug.Assert(src[this.Length] == '\0', "src[this.Length] == '\\0'"); 856Debug.Assert(((int) src) % 4 == 0, "Managed string should start at 4 bytes boundary");
src\libraries\System.Private.CoreLib\src\System\String.cs (2)
536Debug.Assert(stringLength >= 0, "stringLength >= 0"); 547Debug.Assert(stringLength == doubleCheck,
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (3)
124Debug.Assert(position <= totalLength - s.Length, "We didn't allocate enough space for the result string!"); 2282Debug.Assert(startIndex >= 0 && startIndex <= this.Length, "StartIndex is out of range!"); 2283Debug.Assert(length >= 0 && startIndex <= this.Length - length, "length is out of range!");
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.CaseConversion.cs (2)
268Debug.Assert((nuint)(&pDest[i]) % expectedWriteAlignment == 0, "Destination buffer wasn't properly aligned!"); 275Debug.Assert(i <= elementCount, "We overran a buffer somewhere.");
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Utility.cs (64)
143Debug.Assert(0 < numBytesRead && numBytesRead <= Vector512.Size, "We should've made forward progress of at least one byte."); 144Debug.Assert((nuint)numBytesRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 147Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 151Debug.Assert((nuint)pBuffer % Vector512.Size == 0, "Vector read should be aligned."); 179Debug.Assert(0 < numBytesRead && numBytesRead <= Vector256.Size, "We should've made forward progress of at least one byte."); 180Debug.Assert((nuint)numBytesRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 183Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 187Debug.Assert((nuint)pBuffer % Vector256.Size == 0, "Vector read should be aligned."); 215Debug.Assert(0 < numBytesRead && numBytesRead <= Vector128.Size, "We should've made forward progress of at least one byte."); 216Debug.Assert((nuint)numBytesRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 219Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 223Debug.Assert((nuint)pBuffer % Vector128.Size == 0, "Vector read should be aligned."); 323Debug.Assert(!AllBytesInUInt32AreAscii(currentUInt32), "Shouldn't have reached this point if we have an all-ASCII input."); 357Debug.Assert(Sse2.IsSupported || AdvSimd.Arm64.IsSupported, "Sse2 or AdvSimd64 required."); 358Debug.Assert(BitConverter.IsLittleEndian, "This SSE2/Arm64 implementation assumes little-endian."); 415Debug.Assert(0 < numBytesRead && numBytesRead <= SizeOfVector128, "We should've made forward progress of at least one byte."); 416Debug.Assert((nuint)numBytesRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 582Debug.Assert(ContainsNonAsciiByte_Sse2(currentSseMask), "Shouldn't be here unless we see non-ASCII data."); 587Debug.Assert(ContainsNonAsciiByte_AdvSimd(currentAdvSimdIndex), "Shouldn't be here unless we see non-ASCII data."); 600Debug.Assert(!AllBytesInUInt32AreAscii(currentDWord), "Shouldn't be here unless we see non-ASCII data."); 759Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector512InChars, "We should've made forward progress of at least one char."); 760Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 763Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 767Debug.Assert((nuint)pBuffer % Vector512.Size == 0, "Vector read should be aligned."); 795Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector256InChars, "We should've made forward progress of at least one char."); 796Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 799Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 803Debug.Assert((nuint)pBuffer % Vector256.Size == 0, "Vector read should be aligned."); 830Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector128InChars, "We should've made forward progress of at least one char."); 831Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 834Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 838Debug.Assert((nuint)pBuffer % Vector128.Size == 0, "Vector read should be aligned."); 917Debug.Assert(totalNumBytesRead % sizeof(char) == 0, "Total number of bytes read should be even since we're working with chars."); 922Debug.Assert(!AllCharsInUInt32AreAscii(currentUInt32), "Shouldn't have reached this point if we have an all-ASCII input."); 950Debug.Assert(Sse2.IsSupported || AdvSimd.Arm64.IsSupported, "Should've been checked by caller."); 951Debug.Assert(BitConverter.IsLittleEndian, "This SSE2/Arm64 assumes little-endian."); 997Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector128InChars, "We should've made forward progress of at least one char."); 998Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 1076Debug.Assert(((nuint)pBuffer - (nuint)pOriginalBuffer) % 2 == 0, "Shouldn't have incremented any pointer by an odd byte count."); 1119Debug.Assert(currentMask != 0, "Shouldn't be here unless we see non-ASCII data."); 1144Debug.Assert(!AllCharsInUInt32AreAscii(currentDWord), "Shouldn't be here unless we see non-ASCII data."); 1480Debug.Assert(!AllCharsInUInt32AreAscii(utf16Data32BitsHigh), "Shouldn't have reached this point if we have an all-ASCII input."); 1689Debug.Assert(Vector128.IsHardwareAccelerated, "Vector128 is required."); 1690Debug.Assert(BitConverter.IsLittleEndian, "This implementation assumes little-endian."); 1742Debug.Assert(0 < currentOffsetInElements && currentOffsetInElements <= SizeOfVector128, "We wrote at least 1 byte but no more than a whole vector."); 1743Debug.Assert(currentOffsetInElements <= elementCount, "Shouldn't have overrun the destination buffer."); 1744Debug.Assert(elementCount - currentOffsetInElements >= SizeOfVector128, "We should be able to run at least one whole vector."); 1762Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % SizeOfVector128 == 0, "Write should be aligned."); 1785Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % sizeof(ulong) == 0, "Destination should be ulong-aligned."); 1807Debug.Assert(Vector256.IsHardwareAccelerated, "Vector256 is required."); 1808Debug.Assert(BitConverter.IsLittleEndian, "This implementation assumes little-endian."); 1859Debug.Assert(0 < currentOffsetInElements && currentOffsetInElements <= Vector256.Size, "We wrote at least 1 byte but no more than a whole vector."); 1860Debug.Assert(currentOffsetInElements <= elementCount, "Shouldn't have overrun the destination buffer."); 1861Debug.Assert(elementCount - currentOffsetInElements >= Vector256.Size, "We should be able to run at least one whole vector."); 1879Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % Vector256.Size == 0, "Write should be aligned."); 1902Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % Vector128.Size == 0, "Destination should be 128-bit-aligned."); 1924Debug.Assert(Vector512.IsHardwareAccelerated, "Vector512 is required."); 1925Debug.Assert(BitConverter.IsLittleEndian, "This implementation assumes little-endian."); 1977Debug.Assert(0 < currentOffsetInElements && currentOffsetInElements <= Vector512.Size, "We wrote at least 1 byte but no more than a whole vector."); 1978Debug.Assert(currentOffsetInElements <= elementCount, "Shouldn't have overrun the destination buffer."); 1979Debug.Assert(elementCount - currentOffsetInElements >= Vector512.Size, "We should be able to run at least one whole vector."); 1997Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % Vector512.Size == 0, "Write should be aligned."); 2020Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % Vector256.Size == 0, "Destination should be 256-bit-aligned."); 2127Debug.Assert(!AllBytesInUInt32AreAscii(asciiData), "Shouldn't have reached this point if we have an all-ASCII input.");
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Utility.Helpers.cs (1)
43Debug.Assert(!AllBytesInUInt32AreAscii(value), "Caller shouldn't provide an all-ASCII value.");
src\libraries\System.Private.CoreLib\src\System\Text\ASCIIEncoding.cs (14)
156Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 157Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 349Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 350Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 351Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 352Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 408Debug.Assert(idx <= numElementsToConvert, "Somehow went beyond bounds of source or destination buffer?"); 498Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 499Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 640Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 641Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 642Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 643Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 696Debug.Assert(idx <= numElementsToConvert, "Somehow went beyond bounds of source or destination buffer?");
src\libraries\System.Private.CoreLib\src\System\Text\CompositeFormat.cs (1)
46Debug.Assert((segment.Literal is not null) ^ (segment.ArgIndex >= 0), "The segment should represent a literal or a format hole, but not both.");
src\libraries\System.Private.CoreLib\src\System\Text\Decoder.cs (1)
178Debug.Assert(result <= charCount, "Returned more chars than we have space for");
src\libraries\System.Private.CoreLib\src\System\Text\DecoderFallback.cs (2)
109Debug.Assert(byteStart != null, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize"); 164Debug.Assert(byteStart != null, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize");
src\libraries\System.Private.CoreLib\src\System\Text\DecoderNLS.cs (6)
227Debug.Assert(_fallbackBuffer is null || _fallbackBuffer.Remaining == 0, "Should have no data remaining in the fallback buffer."); 228Debug.Assert(HasLeftoverData, "Caller shouldn't invoke this routine unless there's leftover data in the decoder."); 268Debug.Assert(charCount >= 0, "Fallback buffer shouldn't have returned a negative char count."); 283Debug.Assert(_fallbackBuffer is null || _fallbackBuffer.Remaining == 0, "Should have no data remaining in the fallback buffer."); 284Debug.Assert(HasLeftoverData, "Caller shouldn't invoke this routine unless there's leftover data in the decoder."); 351Debug.Assert(combinedBufferBytesConsumed == combinedBuffer.Length, "We should be asked to persist the entire combined buffer.");
src\libraries\System.Private.CoreLib\src\System\Text\DecoderReplacementFallback.cs (1)
132Debug.Assert(_fallbackIndex < _strDefault.Length && _fallbackIndex >= 0,
src\libraries\System.Private.CoreLib\src\System\Text\Encoder.cs (1)
176Debug.Assert(result <= byteCount, "Returned more bytes than we have space for");
src\libraries\System.Private.CoreLib\src\System\Text\EncoderFallback.cs (2)
262Debug.Assert(byteCountThisIteration >= 0, "Encoding shouldn't have returned a negative byte count."); 299Debug.Assert(charStart != null,
src\libraries\System.Private.CoreLib\src\System\Text\EncoderLatin1BestFitFallback.cs (2)
142Debug.Assert(index + 1 < ArrayCharBestFit.Length, 163Debug.Assert(index + 1 < ArrayCharBestFit.Length,
src\libraries\System.Private.CoreLib\src\System\Text\EncoderNLS.cs (1)
288Debug.Assert(byteCount >= 0, "Encoding shouldn't have returned a negative byte count.");
src\libraries\System.Private.CoreLib\src\System\Text\EncoderReplacementFallback.cs (1)
160Debug.Assert(_fallbackIndex < _strDefault.Length && _fallbackIndex >= 0,
src\libraries\System.Private.CoreLib\src\System\Text\Encoding.cs (6)
711Debug.Assert(result <= byteCount, "[Encoding.GetBytes]Returned more bytes than we have space for"); 860Debug.Assert(result <= charCount, "[Encoding.GetChars]Returned more chars than we have space for"); 1287Debug.Assert(_fallbackBuffer.Remaining == 0, 1339Debug.Assert(_bytes < _byteEnd, "[EncodingCharBuffer.GetNextByte]Expected more date"); 1446Debug.Assert(moreBytesExpected >= 0, "[EncodingByteBuffer.AddByte]expected non-negative moreBytesExpected"); 1488Debug.Assert(_chars > _charStart ||
src\libraries\System.Private.CoreLib\src\System\Text\Encoding.Internal.cs (59)
123Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS."); 124Debug.Assert(charCount >= 0, "Caller should've checked this condition."); 125Debug.Assert(pChars != null || charCount == 0, "Cannot provide a null pointer and a non-zero count."); 231Debug.Assert(0 <= charsConsumedSoFar && charsConsumedSoFar < originalCharCount, "Invalid arguments provided to method."); 257Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS."); 258Debug.Assert(0 <= charsConsumedSoFar && charsConsumedSoFar <= originalCharCount, "Caller should've checked this condition."); 313Debug.Assert(originalCharsLength >= 0, "Caller provided invalid parameter."); 347Debug.Assert(byteCountThisIteration >= 0, "Fallback shouldn't have returned a negative value."); 348Debug.Assert(charsConsumedThisIteration >= 0, "Fallback shouldn't have returned a negative value."); 370Debug.Assert(byteCountThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 371Debug.Assert(charsConsumedThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 385Debug.Assert(fallbackBuffer.Remaining == 0, "There should be no data in the fallback buffer after GetByteCount."); 400Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS."); 401Debug.Assert(charCount >= 0, "Caller should've checked this condition."); 402Debug.Assert(pChars != null || charCount == 0, "Cannot provide a null pointer and a non-zero count."); 403Debug.Assert(byteCount >= 0, "Caller should've checked this condition."); 404Debug.Assert(pBytes != null || byteCount == 0, "Cannot provide a null pointer and a non-zero count."); 494Debug.Assert(0 <= charsConsumedSoFar && charsConsumedSoFar < originalCharCount, "Invalid arguments provided to method."); 495Debug.Assert(0 <= bytesWrittenSoFar && bytesWrittenSoFar <= originalByteCount, "Invalid arguments provided to method."); 524Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS."); 525Debug.Assert(0 <= charsConsumedSoFar && charsConsumedSoFar <= originalCharCount, "Caller should've checked this condition."); 526Debug.Assert(0 <= bytesWrittenSoFar && bytesWrittenSoFar <= originalByteCount, "Caller should've checked this condition."); 589Debug.Assert(originalCharsLength >= 0, "Caller provided invalid parameter."); 590Debug.Assert(originalBytesLength >= 0, "Caller provided invalid parameter."); 608Debug.Assert(charsConsumedThisIteration == chars.Length, "If returning NeedMoreData, should out the entire buffer length as chars consumed."); 658Debug.Assert(bytesWrittenThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 659Debug.Assert(charsConsumedThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 697Debug.Assert(originalCharsLength >= chars.Length, "About to report a negative number of chars used?"); 701Debug.Assert(fallbackBuffer.Remaining == 0 || encoder != null, "Shouldn't have any leftover data in fallback buffer unless an EncoderNLS is in use."); 716Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS."); 717Debug.Assert(byteCount >= 0, "Caller should've checked this condition."); 718Debug.Assert(pBytes != null || byteCount == 0, "Cannot provide a null pointer and a non-zero count."); 725Debug.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, "Fallback buffer can't hold data between GetChars invocations."); 825Debug.Assert(0 <= bytesConsumedSoFar && bytesConsumedSoFar < originalByteCount, "Invalid arguments provided to method."); 851Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS."); 852Debug.Assert(0 <= bytesConsumedSoFar && bytesConsumedSoFar <= originalByteCount, "Caller should've checked this condition."); 913Debug.Assert(originalBytesLength >= 0, "Caller provided invalid parameter."); 944Debug.Assert(charCountThisIteration >= 0, "Fallback shouldn't have returned a negative value."); 966Debug.Assert(charCountThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 967Debug.Assert(bytesConsumedThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 981Debug.Assert(fallbackBuffer.Remaining == 0, "There should be no data in the fallback buffer after GetCharCount."); 996Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS."); 997Debug.Assert(byteCount >= 0, "Caller should've checked this condition."); 998Debug.Assert(pBytes != null || byteCount == 0, "Cannot provide a null pointer and a non-zero count."); 999Debug.Assert(charCount >= 0, "Caller should've checked this condition."); 1000Debug.Assert(pChars != null || charCount == 0, "Cannot provide a null pointer and a non-zero count."); 1090Debug.Assert(0 <= bytesConsumedSoFar && bytesConsumedSoFar < originalByteCount, "Invalid arguments provided to method."); 1091Debug.Assert(0 <= charsWrittenSoFar && charsWrittenSoFar <= originalCharCount, "Invalid arguments provided to method."); 1120Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS."); 1121Debug.Assert(0 <= bytesConsumedSoFar && bytesConsumedSoFar <= originalByteCount, "Caller should've checked this condition."); 1122Debug.Assert(0 <= charsWrittenSoFar && charsWrittenSoFar <= originalCharCount, "Caller should've checked this condition."); 1146Debug.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, "Should be no remaining fallback data at this point."); 1190Debug.Assert(originalBytesLength >= 0, "Caller provided invalid parameter."); 1191Debug.Assert(originalCharsLength >= 0, "Caller provided invalid parameter."); 1210Debug.Assert(bytesConsumedThisIteration == bytes.Length, "If returning NeedMoreData, should out the entire buffer length as bytes consumed."); 1227Debug.Assert(charsWrittenThisIteration >= 0, "Fallback shouldn't have returned a negative value."); 1258Debug.Assert(charsWrittenThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 1259Debug.Assert(bytesConsumedThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 1294Debug.Assert(originalBytesLength >= bytes.Length, "About to report a negative number of bytes used?");
src\libraries\System.Private.CoreLib\src\System\Text\Latin1Encoding.cs (10)
108Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 109Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 295Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 296Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 297Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 298Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 601Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 602Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 603Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 604Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified.");
src\libraries\System.Private.CoreLib\src\System\Text\Latin1Utility.cs (22)
63Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVectorInChars, "We should've made forward progress of at least one char."); 64Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 67Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 71Debug.Assert((nuint)pBuffer % SizeOfVectorInChars == 0, "Vector read should be aligned."); 149Debug.Assert(totalNumBytesRead % sizeof(char) == 0, "Total number of bytes read should be even since we're working with chars."); 154Debug.Assert(!AllCharsInUInt32AreLatin1(currentUInt32), "Shouldn't have reached this point if we have an all-Latin-1 input."); 184Debug.Assert(Sse2.IsSupported, "Should've been checked by caller."); 185Debug.Assert(BitConverter.IsLittleEndian, "SSE2 assumes little-endian."); 240Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector128InChars, "We should've made forward progress of at least one char."); 241Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 370Debug.Assert(((nuint)pBuffer - (nuint)pOriginalBuffer) % 2 == 0, "Shouldn't have incremented any pointer by an odd byte count."); 425Debug.Assert(currentMask != 0, "Shouldn't be here unless we see non-Latin-1 data."); 433Debug.Assert(!AllCharsInUInt32AreLatin1(currentDWord), "Shouldn't be here unless we see non-Latin-1 data."); 550Debug.Assert(BitConverter.IsLittleEndian, "Assume little endian if SSE2 is supported."); 746Debug.Assert(!AllCharsInUInt32AreLatin1(utf16Data32BitsHigh), "Shouldn't have reached this point if we have an all-Latin-1 input."); 862Debug.Assert(0 < currentOffsetInElements && currentOffsetInElements <= SizeOfVector128, "We wrote at least 1 byte but no more than a whole vector."); 864Debug.Assert(currentOffsetInElements <= elementCount, "Shouldn't have overrun the destination buffer."); 865Debug.Assert(elementCount - currentOffsetInElements >= SizeOfVector128, "We should be able to run at least one whole vector."); 898Debug.Assert(((nuint)pLatin1Buffer + currentOffsetInElements) % SizeOfVector128 == 0, "Write should be aligned."); 933Debug.Assert(((nuint)pLatin1Buffer + currentOffsetInElements) % sizeof(ulong) == 0, "Destination should be ulong-aligned."); 1027Debug.Assert(elementCount - currentOffset < SizeOfVector128, "Case where 2 vectors remained should've been in the hot loop."); 1098Debug.Assert(elementCount - currentOffset < SizeOfVector, "Vectorized logic should result in less than a vector's length of data remaining.");
src\libraries\System.Private.CoreLib\src\System\Text\Rune.cs (3)
210Debug.Assert(!GlobalizationMode.Invariant, "This should've been checked by the caller."); 211Debug.Assert(textInfo != null, "This should've been checked by the caller."); 1199Debug.Assert(!value.IsAscii, "Shouldn't use this non-optimized code path for ASCII characters.");
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (25)
238Debug.Assert(m_ChunkOffset + m_ChunkChars.Length >= m_ChunkOffset, "The length of the string is greater than int.MaxValue."); 431Debug.Assert(newLen == chunk.m_ChunkChars.Length, "The new chunk should be larger or equal to the one it is replacing."); 441Debug.Assert(Length == value, "Something went wrong setting Length."); 684Debug.Assert(repeatCount > 0, "Invalid length; should have been validated by caller."); 706Debug.Assert(m_ChunkLength == 0, "A new block was not created."); 1024Debug.Assert(m_ChunkLength == 0, "A new block was not created."); 1057Debug.Assert(typeof(T).Assembly.Equals(typeof(object).Assembly), "Implementation trusts the results of TryFormat because T is expected to be something known"); 1070Debug.Assert(typeof(T).Assembly.Equals(typeof(object).Assembly), "Implementation trusts the results of TryFormat because T is expected to be something known"); 1413Debug.Assert(typeof(T).Assembly.Equals(typeof(object).Assembly), "Implementation trusts the results of TryFormat because T is expected to be something known"); 2102Debug.Assert(chunk != null, "chunk was null in replace"); 2126Debug.Assert(count >= 0, "count should never go negative"); 2182Debug.Assert(chunk != null || count == 0, "Chunks ended prematurely!"); 2268Debug.Assert(valueCount >= 0, "Invalid length; should have been validated by caller."); 2320Debug.Assert(m_ChunkLength == 0, "A new block was not created."); 2337Debug.Assert((uint)index <= (uint)Length, "Callers should check that index is a legal value."); 2391Debug.Assert(gapStart < sourceChunk.m_ChunkChars.Length, "gap starts at end of buffer. Should not happen"); 2392Debug.Assert(gapStart <= gapEnd, "negative gap size"); 2393Debug.Assert(gapEnd <= sourceChunk.m_ChunkLength, "gap too big"); 2402Debug.Assert(targetIndexInChunk <= targetChunk.m_ChunkLength, "gap not in chunk"); 2471Debug.Assert(chunk != null, "chunk should not be null at this point"); 2473Debug.Assert(lengthInChunk >= 0, "Index isn't in the chunk."); 2547Debug.Assert(Capacity == Length, nameof(ExpandByABlock) + " should only be called when there is no space left."); 2764Debug.Assert(chunk != null, "We fell off the beginning of the string!"); 2796Debug.Assert(chunk != null, "We fell off the beginning of the string!"); 3138Debug.Assert(formatter != null, "An incorrectly written provider said it implemented ICustomFormatter, and then didn't");
src\libraries\System.Private.CoreLib\src\System\Text\TranscodingStream.cs (1)
93Debug.Assert(disposing, "This type isn't finalizable.");
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf16Utility.Validation.cs (5)
26Debug.Assert(inputLength >= 0, "Input length must not be negative."); 27Debug.Assert(pInputBuffer != null || inputLength == 0, "Input length must be zero if input buffer pointer is null."); 91Debug.Assert((debugMask & 0b_1010_1010_1010_1010) == 0, "Shouldn't have set the 0x8000 bit of any element in 'charIsNonAscii'."); 193Debug.Assert((highSurrogatesMask & lowSurrogatesMask) == 0, 196Debug.Assert(((highSurrogatesMask | lowSurrogatesMask) & 0b_1010_1010_1010_1010u) == 0,
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8.cs (1)
658Debug.Assert(formatter is not null, "An incorrectly written provider said it implemented ICustomFormatter, and then didn't");
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.Helpers.cs (3)
726Debug.Assert(IsFirstCharAtLeastThreeUtf8Bytes(value) && !IsFirstCharSurrogate(value), "First half of value should've been 0800..D7FF or E000..FFFF"); 727Debug.Assert(IsSecondCharAtLeastThreeUtf8Bytes(value) && !IsSecondCharSurrogate(value), "Second half of value should've been 0800..D7FF or E000..FFFF"); 761Debug.Assert(IsFirstCharAtLeastThreeUtf8Bytes(value) && !IsFirstCharSurrogate(value), "First half of value should've been 0800..D7FF or E000..FFFF");
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.Transcoding.cs (10)
22Debug.Assert(inputLength >= 0, "Input length must not be negative."); 23Debug.Assert(pInputBuffer != null || inputLength == 0, "Input length must be zero if input buffer pointer is null."); 25Debug.Assert(outputCharsRemaining >= 0, "Destination length must not be negative."); 26Debug.Assert(pOutputBuffer != null || outputCharsRemaining == 0, "Destination length must be zero if destination buffer pointer is null."); 72Debug.Assert(pLastBufferPosProcessed < pInputBuffer, "Algorithm should've made forward progress since last read."); 842Debug.Assert(inputLength >= 0, "Input length must not be negative."); 843Debug.Assert(pInputBuffer != null || inputLength == 0, "Input length must be zero if input buffer pointer is null."); 845Debug.Assert(outputBytesRemaining >= 0, "Destination length must not be negative."); 846Debug.Assert(pOutputBuffer != null || outputBytesRemaining == 0, "Destination length must be zero if destination buffer pointer is null."); 906Debug.Assert(pLastBufferPosProcessed < pInputBuffer, "Algorithm should've made forward progress since last read.");
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.Validation.cs (4)
26Debug.Assert(inputLength >= 0, "Input length must not be negative."); 27Debug.Assert(pInputBuffer != null || inputLength == 0, "Input length must be zero if input buffer pointer is null."); 77Debug.Assert(pLastBufferPosProcessed < pInputBuffer, "Algorithm should've made forward progress since last read."); 729Debug.Assert(pOriginalInputBuffer + originalInputLength == pInputBuffer, "About to return an unexpected value.");
src\libraries\System.Private.CoreLib\src\System\Text\UnicodeEncoding.cs (32)
338Debug.Assert(chars is not null, "[UnicodeEncoding.GetByteCount]chars!=null"); 339Debug.Assert(count >= 0, "[UnicodeEncoding.GetByteCount]count >=0"); 482Debug.Assert(chars > charStart, 550Debug.Assert(chars > charStart, 617Debug.Assert(fallbackBuffer is null || fallbackBuffer.Remaining == 0, 627Debug.Assert(chars is not null, "[UnicodeEncoding.GetBytes]chars!=null"); 628Debug.Assert(byteCount >= 0, "[UnicodeEncoding.GetBytes]byteCount >=0"); 629Debug.Assert(charCount >= 0, "[UnicodeEncoding.GetBytes]charCount >=0"); 630Debug.Assert(bytes is not null, "[UnicodeEncoding.GetBytes]bytes!=null"); 767Debug.Assert(chars > charStart, 835Debug.Assert(chars > charStart + 1 || bytes == byteStart, 864Debug.Assert(chars > charStart, 899Debug.Assert(chars > charStart, 966Debug.Assert((encoder is not null && !encoder.MustFlush) || charLeftOver == (char)0, 969Debug.Assert(fallbackBuffer is null || fallbackBuffer.Remaining == 0 || 978Debug.Assert(bytes is not null, "[UnicodeEncoding.GetCharCount]bytes!=null"); 979Debug.Assert(count >= 0, "[UnicodeEncoding.GetCharCount]count >=0"); 1013Debug.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, 1292Debug.Assert(fallbackBuffer is null || fallbackBuffer.Remaining == 0, 1301Debug.Assert(chars is not null, "[UnicodeEncoding.GetChars]chars!=null"); 1302Debug.Assert(byteCount >= 0, "[UnicodeEncoding.GetChars]byteCount >=0"); 1303Debug.Assert(charCount >= 0, "[UnicodeEncoding.GetChars]charCount >=0"); 1304Debug.Assert(bytes is not null, "[UnicodeEncoding.GetChars]bytes!=null"); 1320Debug.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, 1474Debug.Assert(bytes >= byteStart + 2 || chars == charStart, 1525Debug.Assert(bytes >= byteStart + 2 || chars == charStart, 1542Debug.Assert(bytes >= byteStart + 2 || chars == charStart, 1586Debug.Assert(bytes >= byteStart + 2 || chars == charStart, 1603Debug.Assert(bytes >= byteStart + 2 || chars == charStart, 1650Debug.Assert(bytes >= byteStart + 2 || chars == charStart, 1706Debug.Assert(!decoder.MustFlush || ((lastChar == (char)0) && (lastByte == -1)), 1716Debug.Assert(fallbackBuffer is null || fallbackBuffer.Remaining == 0,
src\libraries\System.Private.CoreLib\src\System\Text\UTF32Encoding.cs (25)
346Debug.Assert(chars is not null, "[UTF32Encoding.GetByteCount]chars!=null"); 347Debug.Assert(count >= 0, "[UTF32Encoding.GetByteCount]count >=0"); 410Debug.Assert(chars > charStart, 468Debug.Assert(fallbackBuffer.Remaining == 0, 478Debug.Assert(chars is not null, "[UTF32Encoding.GetBytes]chars!=null"); 479Debug.Assert(bytes is not null, "[UTF32Encoding.GetBytes]bytes!=null"); 480Debug.Assert(byteCount >= 0, "[UTF32Encoding.GetBytes]byteCount >=0"); 481Debug.Assert(charCount >= 0, "[UTF32Encoding.GetBytes]charCount >=0"); 551Debug.Assert(chars > charStart + 1 || bytes == byteStart, 579Debug.Assert(chars > charStart, 624Debug.Assert(chars > charStart, 661Debug.Assert(highSurrogate == 0 || (encoder is not null && !encoder.MustFlush), 679Debug.Assert(bytes is not null, "[UTF32Encoding.GetCharCount]bytes!=null"); 680Debug.Assert(count >= 0, "[UTF32Encoding.GetCharCount]count >=0"); 705Debug.Assert(fallbackBuffer.Remaining == 0, 812Debug.Assert(fallbackBuffer.Remaining == 0, 822Debug.Assert(chars is not null, "[UTF32Encoding.GetChars]chars!=null"); 823Debug.Assert(bytes is not null, "[UTF32Encoding.GetChars]bytes!=null"); 824Debug.Assert(byteCount >= 0, "[UTF32Encoding.GetChars]byteCount >=0"); 825Debug.Assert(charCount >= 0, "[UTF32Encoding.GetChars]charCount >=0"); 854Debug.Assert(fallbackBuffer.Remaining == 0, 919Debug.Assert(bytes >= byteStart + 4 || chars == charStart, 942Debug.Assert(bytes >= byteStart + 4 || chars == charStart, 959Debug.Assert(bytes >= byteStart + 4 || chars == charStart, 1027Debug.Assert(fallbackBuffer.Remaining == 0,
src\libraries\System.Private.CoreLib\src\System\Text\UTF7Encoding.cs (14)
382Debug.Assert(chars is not null, "[UTF7Encoding.GetByteCount]chars!=null"); 383Debug.Assert(count >= 0, "[UTF7Encoding.GetByteCount]count >=0"); 392Debug.Assert(byteCount >= 0, "[UTF7Encoding.GetBytes]byteCount >=0"); 393Debug.Assert(chars is not null, "[UTF7Encoding.GetBytes]chars!=null"); 394Debug.Assert(charCount >= 0, "[UTF7Encoding.GetBytes]charCount >=0"); 531Debug.Assert(count >= 0, "[UTF7Encoding.GetCharCount]count >=0"); 532Debug.Assert(bytes is not null, "[UTF7Encoding.GetCharCount]bytes!=null"); 541Debug.Assert(byteCount >= 0, "[UTF7Encoding.GetChars]byteCount >=0"); 542Debug.Assert(bytes is not null, "[UTF7Encoding.GetChars]bytes!=null"); 543Debug.Assert(charCount >= 0, "[UTF7Encoding.GetChars]charCount >=0"); 562Debug.Assert(!firstByte || decoder.bitCount <= 0, 840Debug.Assert(iCount < 0, "[DecoderUTF7FallbackBuffer.Fallback] Can't have recursive fallbacks"); 841Debug.Assert(bytesUnknown.Length == 1, "[DecoderUTF7FallbackBuffer.Fallback] Only possible fallback case should be 1 unknown byte"); 893Debug.Assert(iCount < 0, "[DecoderUTF7FallbackBuffer.InternalFallback] Can't have recursive fallbacks");
src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.cs (12)
206Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 207Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 396Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 397Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 398Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 399Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 598Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 599Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 600Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 601Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 716Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 717Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified.");
src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (9)
342Debug.Assert(IsCancellationCompleted, "Expected cancellation to have finished"); 585Debug.Assert(this != s_neverCanceledSource, "This source should never be exposed via a CancellationToken."); 621Debug.Assert(node.Prev == null, "Nodes in the free list should all have a null Prev"); 679Debug.Assert(id != 0, "IDs should never be the reserved value 0."); 697Debug.Assert(IsCancellationCompleted, "Expected cancellation to have finished"); 733Debug.Assert(IsCancellationRequested, "ExecuteCallbackHandlers should only be called after setting IsCancellationRequested->true"); 1055Debug.Assert(node != null, "Expected non-null node"); 1056Debug.Assert(node.Registrations == this, "Expected node to come from this registrations instance"); 1203Debug.Assert(registrations != null, "Expected non-null parent registrations");
src\libraries\System.Private.CoreLib\src\System\Threading\EventWaitHandle.cs (1)
43Debug.Assert(result != null, "result should be non-null on success");
src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs (6)
298Debug.Assert(executionContext != null && !executionContext.m_isDefault, "ExecutionContext argument is Default."); 351Debug.Assert(Thread.CurrentThread._executionContext == null, "ThreadPool thread not on Default ExecutionContext."); 352Debug.Assert(Thread.CurrentThread._synchronizationContext == null, "ThreadPool thread not on Default SynchronizationContext."); 457Debug.Assert(current.m_localValues != null, "Only the default context should have null, and we shouldn't be here on the default context"); 471Debug.Assert(current.m_localValues != null, "Only the default context should have null, and we shouldn't be here on the default context"); 494Debug.Assert(current.m_localValues != null, "Only the default context should have null, and we shouldn't be here on the default context");
src\libraries\System.Private.CoreLib\src\System\Threading\IOCompletionCallbackHelper.cs (1)
28Debug.Assert(helper != null, "IOCompletionCallbackHelper cannot be null");
src\libraries\System.Private.CoreLib\src\System\Threading\ManualResetEventSlim.cs (8)
111Debug.Assert(value >= 0, "SpinCount is a restricted-width integer. The value supplied is outside the legal range."); 112Debug.Assert(value <= SpinCountState_MaxValue, "SpinCount is a restricted-width integer. The value supplied is outside the legal range."); 127Debug.Assert(value >= 0, "NumWaiters should never be less than zero. This indicates an internal error."); 194Debug.Assert(DEFAULT_SPIN_SP >= 0, "Internal error - DEFAULT_SPIN_SP is outside the legal range."); 195Debug.Assert(DEFAULT_SPIN_SP <= SpinCountState_MaxValue, "Internal error - DEFAULT_SPIN_SP is outside the legal range."); 240Debug.Assert(currentIsSet, 650Debug.Assert(obj is ManualResetEventSlim, "Expected a ManualResetEventSlim"); 672Debug.Assert((newBits | updateBitsMask) == updateBitsMask, "newBits do not fall within the updateBitsMask.");
src\libraries\System.Private.CoreLib\src\System\Threading\Mutex.cs (1)
53Debug.Assert(result != null, "result should be non-null on success");
src\libraries\System.Private.CoreLib\src\System\Threading\PeriodicTimer.cs (1)
218Debug.Assert(!_stopped, "Unexpectedly stopped without _signaled being true.");
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WaitThread.cs (1)
127Debug.Assert(current != null, "The wait thread to remove was not found in the list of thread pool wait threads.");
src\libraries\System.Private.CoreLib\src\System\Threading\ReaderWriterLockSlim.cs (6)
587Debug.Assert(_numWriteUpgradeWaiters == 0, "There can be at most one thread with the upgrade lock held."); 615Debug.Assert(lrwc != null, "Initialized based on _fIsReentrant earlier in the method"); 756Debug.Assert(lrwc != null, "Initialized based on _fIsReentrant earlier in the method"); 795Debug.Assert(_owners > 0, "ReleasingReaderLock: releasing lock and no read lock taken"); 843Debug.Assert((_owners & WRITER_HELD) > 0, "Calling ReleaseWriterLock when no write lock is held"); 1609Debug.Assert(_isLocked != 0, "Exiting spin lock that is not held");
src\libraries\System.Private.CoreLib\src\System\Threading\Semaphore.cs (1)
45Debug.Assert(result != null, "result should be non-null on success");
src\libraries\System.Private.CoreLib\src\System\Threading\SemaphoreSlim.cs (13)
352Debug.Assert(m_asyncTail is not null, "tail should not be null if head isn't"); 384Debug.Assert(!waitSuccessful || m_currentCount > 0, 631Debug.Assert(m_currentCount == 0, "m_currentCount should never be negative"); 644Debug.Assert(Monitor.IsEntered(m_lockObjAndDisposed), "Requires the lock be held"); 652Debug.Assert(m_asyncTail is null, "If head is null, so too should be tail"); 658Debug.Assert(m_asyncTail is not null, "If head is not null, neither should be tail"); 673Debug.Assert(task is not null, "Expected non-null task"); 674Debug.Assert(Monitor.IsEntered(m_lockObjAndDisposed), "Requires the lock be held"); 684Debug.Assert((m_asyncHead is null) == (m_asyncTail is null), "Head is null iff tail is null"); 700Debug.Assert(asyncWaiter is not null, "Waiter should have been constructed"); 701Debug.Assert(Monitor.IsEntered(m_lockObjAndDisposed), "Requires the lock be held"); 818Debug.Assert(m_asyncTail is not null, "tail should not be null if head isn't null"); 892Debug.Assert(obj is SemaphoreSlim, "Expected a SemaphoreSlim");
src\libraries\System.Private.CoreLib\src\System\Threading\SpinLock.cs (1)
117Debug.Assert(!IsThreadOwnerTrackingEnabled, "property should be false by now");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\CachedCompletedInt32Task.cs (1)
26Debug.Assert(task.IsCompletedSuccessfully, "Expected that a stored last task completed successfully");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (25)
200Debug.Assert(ReadyToComplete, "The block must be ready to complete to be here."); 213Debug.Assert(!localThis.m_completionState!.IsCompleted, "Completion should only happen once."); 219Debug.Assert(success, "Expected to complete completion task."); 230Debug.Assert(faultedTask != null && faultedTask.IsFaulted && faultedTask.Exception!.InnerExceptionCount > 0, 340else Debug.Assert(m_processingCount == EXCLUSIVE_PROCESSING_SENTINEL, "The processing count must be the sentinel if it's not >= 0."); 364Debug.Assert(m_processingCount == EXCLUSIVE_PROCESSING_SENTINEL, "Processing exclusive tasks requires being in exclusive mode."); 365Debug.Assert(!m_exclusiveTaskScheduler.m_tasks.IsEmpty, "Processing exclusive tasks requires tasks to be processed."); 370Debug.Assert(m_threadProcessingMode.Value == ProcessingMode.NotCurrentlyProcessing, 388Debug.Assert(m_threadProcessingMode.Value == ProcessingMode.ProcessingExclusiveTask, 399Debug.Assert(m_processingCount == EXCLUSIVE_PROCESSING_SENTINEL, "The processing mode should not have deviated from exclusive."); 412Debug.Assert(m_processingCount > 0, "Processing concurrent tasks requires us to be in concurrent mode."); 417Debug.Assert(m_threadProcessingMode.Value == ProcessingMode.NotCurrentlyProcessing, 446Debug.Assert(m_threadProcessingMode.Value == ProcessingMode.ProcessingConcurrentTasks, 457Debug.Assert(m_processingCount > 0, "The procesing mode should not have deviated from concurrent."); 524Debug.Assert(pair != null, "Scheduler must be associated with a valid pair."); 525Debug.Assert(processingMode == ProcessingMode.ProcessingConcurrentTasks || processingMode == ProcessingMode.ProcessingExclusiveTask, 527Debug.Assert( 547Debug.Assert(task != null, "Infrastructure should have provided a non-null task."); 563Debug.Assert(task != null, "Infrastructure should have provided a non-null task."); 573Debug.Assert(task != null, "Infrastructure should have provided a non-null task."); 647Debug.Assert(t.IsFaulted, "Task should be faulted due to the scheduler faulting it and throwing the exception."); 671Debug.Assert(scheduler != null, "Need a scheduler with which to construct the debug view."); 694Debug.Assert(pair != null, "Need a pair with which to construct the debug view."); 734Debug.Assert(syncObj != null, "The monitor object to check must be provided."); 735Debug.Assert(Monitor.IsEntered(syncObj) == held, "The locking scheme was not correctly followed.");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Future.cs (3)
402Debug.Assert(!IsCompleted, "The promise must not yet be completed."); 444Debug.Assert(!IsWaitNotificationEnabledOrNotRanToCompletion, 463Debug.Assert(IsCompletedSuccessfully, "Task<T>.Result getter: Expected result to have been set.");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\FutureFactory.cs (22)
497Debug.Assert((endFunction != null) != (endAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 641Debug.Assert((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 761Debug.Assert((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 783Debug.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 878Debug.Assert((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 900Debug.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 1003Debug.Assert((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 1025Debug.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 1136Debug.Assert((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 1158Debug.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 1197Debug.Assert(thisRef != null, "Expected a non-null thisRef"); 1198Debug.Assert(beginMethod != null, "Expected a non-null beginMethod"); 1199Debug.Assert(endMethod != null, "Expected a non-null endMethod"); 1212Debug.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 1240Debug.Assert(thisRef != null, "Expected a non-null thisRef"); 1241Debug.Assert(endMethod != null, "Expected a non-null endMethod"); 1287Debug.Assert(!IsCompleted, "The task should not have been completed yet."); 1316Debug.Assert(successfullySet, "Expected the task to not yet be completed"); 1608Debug.Assert((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 1655Debug.Assert((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 1979Debug.Assert((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 2029Debug.Assert((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Sources\ManualResetValueTaskSourceCore.cs (4)
176Debug.Assert(storedContinuation is not null, $"{nameof(storedContinuation)} is null"); 224Debug.Assert(continuation is not null, $"{nameof(continuation)} is null"); 260Debug.Assert(executionContext is not null, $"{nameof(executionContext)} is null"); 319Debug.Assert(continuation is not null, $"{nameof(continuation)} is null");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (86)
187Debug.Assert(task != null, "Null Task objects can't be added to the ActiveTasks collection"); 328Debug.Assert(promiseStyle, "Promise CTOR: promiseStyle was false"); 521Debug.Assert(m_contingentProperties == null || m_contingentProperties.m_capturedContext == null, 565Debug.Assert(illegalInternalOptions == 0, "TaskConstructorCore: Illegal internal options"); 569Debug.Assert(m_stateFlags == 0, "TaskConstructorCore: non-zero m_stateFlags"); 570Debug.Assert((((int)creationOptions) | (int)TaskStateFlags.OptionsMask) == (int)TaskStateFlags.OptionsMask, "TaskConstructorCore: options take too many bits"); 597Debug.Assert((internalOptions & InternalTaskOptions.ContinuationTask) == 0, "TaskConstructorCore: Did not expect to see cancelable token for continuation task."); 685Debug.Assert(((int)TaskStateFlags.OptionsMask & 1) == 1, "OptionsMask needs a shift in Options.get"); 740Debug.Assert((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) != 0, 748Debug.Assert(success, "Tried to set enabled on completed Task"); 778Debug.Assert(tasks != null, "Expected non-null array of tasks"); 815Debug.Assert(isWaitNotificationEnabled, "Should only be called if the wait completion bit is set."); 833Debug.Assert(IsWaitNotificationEnabled, "Should only be called if the wait completion bit is set."); 874Debug.Assert(InternalCurrent == this, "Task.AddNewChild(): Called from an external context"); 895Debug.Assert(InternalCurrent == this, "Task.DisregardChild(): Called from an external context"); 898Debug.Assert(props.m_completionCountdown >= 2, "Task.DisregardChild(): Expected parent count to be >= 2"); 1043Debug.Assert(scheduler != null, "Task.InternalRunSynchronously(): null TaskScheduler"); 1113Debug.Assert( 1130Debug.Assert((m_stateFlags & (int)TaskStateFlags.Canceled) != 0, "Task.RunSynchronously: expected TaskStateFlags.Canceled to be set"); 1260Debug.Assert((e == null) || IsFaulted, "Task.Exception_get(): returning non-null value when not Faulted"); 1660Debug.Assert(m_taskScheduler != null, "expected a task scheduler to have been selected"); 1661Debug.Assert((m_stateFlags & (int)TaskStateFlags.Started) == 0, "task has already started"); 1683Debug.Assert(m_action != null, "Must have a delegate to be in ScheduleAndStart"); 1708Debug.Assert( 1728Debug.Assert(exceptionObject != null, "Task.AddException: Expected a non-null exception object"); 1739Debug.Assert(exceptionObject != null, "Task.AddException: Expected a non-null exception object"); 1747Debug.Assert( 1753Debug.Assert( 1845Debug.Assert(m_contingentProperties != null && m_contingentProperties.m_exceptionsHolder != null, "ExceptionRecorded should imply this"); 1863Debug.Assert(IsFaulted && ExceptionRecorded, "Must only be used when the task has faulted with exceptions."); 1871Debug.Assert(IsCanceled, "Must only be used when the task has canceled."); 1886Debug.Assert(IsCompleted, "ThrowIfExceptional(): Expected IsCompleted == true"); 2154Debug.Assert(childTask.IsCompleted, "ProcessChildCompletion was called for an uncompleted task"); 2156Debug.Assert(childTask.m_contingentProperties?.m_parent == this, "ProcessChildCompletion should only be called for a child of this task"); 2216Debug.Assert(task.IsCompleted, "Expected all tasks in list to be completed"); 2393Debug.Assert(m_action != null, "Null action in InnerInvoke()"); 2530Debug.Assert(!flowExecutionContext, "We already determined we're not required to flow context."); 2629Debug.Assert(waitResult, "expected wait to succeed"); 2785Debug.Assert((m_stateFlags & (int)TaskStateFlags.Faulted) == 0, "Task.Wait() completing when in Faulted state."); 3147Debug.Assert((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) == 0, "Task.InternalCancel() did not expect promise-style task"); 3219Debug.Assert((m_stateFlags & IllegalFlags) == 0, "The continuation was in an invalid state."); 3220Debug.Assert((m_stateFlags & (int)TaskStateFlags.WaitingForActivation) != 0, "Expected continuation to be waiting for activation"); 3239Debug.Assert((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) != 0, "Task.RecordInternalCancellationRequest(CancellationToken) only valid for promise-style task"); 3259Debug.Assert(edi != null, "Expected either an OCE or an EDI"); 3261Debug.Assert(oce != null, "Expected EDI to contain an OCE"); 3263Debug.Assert(oce.CancellationToken == tokenToRecord, 3274Debug.Assert((m_stateFlags & ((int)TaskStateFlags.Canceled | (int)TaskStateFlags.CompletionReserved)) != 0, "Task.CancellationCleanupLogic(): Task not canceled or reserved."); 3306Debug.Assert(this == InternalCurrent, "SetCancellationAcknowledged() should only be called while this is still the current task"); 3307Debug.Assert(IsCancellationRequested, "SetCancellationAcknowledged() should not be called if the task's CT wasn't signaled"); 3344Debug.Assert(exceptionObject != null, "Expected non-null exceptionObject argument"); 3347Debug.Assert( 3389Debug.Assert( 4433Debug.Assert(continuationTask != null, "Task.ContinueWithCore(): null continuationTask"); 4434Debug.Assert(scheduler != null, "Task.ContinueWithCore(): null scheduler"); 4435Debug.Assert(!continuationTask.IsCompleted, "Did not expect continuationTask to be completed"); 4517Debug.Assert(tc != null, "Expected non-null tc object in AddTaskContinuationComplex"); 4520Debug.Assert(oldValue is not null, "Expected non-null m_continuationObject object"); 4556Debug.Assert(oldValue == s_taskCompletionSentinel, "Expected m_continuationObject to be list or sentinel"); 4690Debug.Assert(waitResult, "expected wait to succeed"); 4710Debug.Assert(waitResult, "expected wait to succeed"); 5014Debug.Assert(exceptions != null, "Should have seen at least one exception"); 5040Debug.Assert(tasks != null, "Expected a non-null list of tasks"); 5041Debug.Assert(tasks.Count > 0, "Expected at least one task"); 5087Debug.Assert(count > 0, "Expected count > 0"); 5094Debug.Assert(_count >= 0, "Count should never go below 0"); 5137Debug.Assert(tasks.Length == 0 || waitResult != -1, "expected wait to succeed"); 5401Debug.Assert(succeeded, "This should always succeed on a new task."); 5415Debug.Assert(succeeded, "This should always succeed on a new task."); 5449Debug.Assert(succeeded, "This should always succeed on a new task."); 5463Debug.Assert(succeeded, "This should always succeed on a new task."); 5987Debug.Assert(tasks.Length != 0, "Expected a non-zero length task array"); 5988Debug.Assert(m_stateObject is null, "Expected to be able to use the state object field for faulted/canceled tasks."); 6133Debug.Assert(observedExceptions.Count > 0, "Expected at least one exception"); 6148Debug.Assert(_remainingToComplete >= 0, "Count should never go below 0"); 6339Debug.Assert(tasks != null, "Expected a non-null task array"); 6340Debug.Assert(tasks.Length > 0, "Expected a non-zero length task array"); 6378Debug.Assert(task != null, "Constituent task in WhenAll should never be null"); 6403Debug.Assert(observedExceptions.Count > 0, "Expected at least one exception"); 6424Debug.Assert(m_count >= 0, "Count should never go below 0"); 6625Debug.Assert(success, "Only one task should have gotten to this point, and thus this must be successful."); 7324Debug.Assert(outerTask != null, "Expected non-null outerTask"); 7378Debug.Assert(result, "Expected TrySetFromTask from inner task to succeed"); 7405Debug.Assert(task != null && task.IsCompleted, "Expected non-null, completed outer task"); 7406Debug.Assert(_state == STATE_WAITING_ON_OUTER_TASK, "We're in the wrong state!"); 7418Debug.Assert(result, "Expected TrySetFromTask from outer task to succeed"); 7435Debug.Assert(task != null && task.IsCompleted, "TrySetFromTask: Expected task to have completed.");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskCache.cs (1)
33Debug.Assert(ExclusiveInt32Max >= InclusiveInt32Min, "Expected max to be at least min");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskContinuation.cs (11)
18Debug.Assert(action is Action<Task> || action is Action<Task, object?>, 31Debug.Assert(antecedent != null, 64Debug.Assert(function is Func<Task, TResult> || function is Func<Task, object?, TResult>, 77Debug.Assert(antecedent != null, 110Debug.Assert(action is Action<Task<TAntecedentResult>> || action is Action<Task<TAntecedentResult>, object?>, 123Debug.Assert(antecedent != null, 156Debug.Assert(function is Func<Task<TAntecedentResult>, TResult> || function is Func<Task<TAntecedentResult>, object?, TResult>, 169Debug.Assert(antecedent != null, 274Debug.Assert(task != null, "TaskContinuation ctor: task is null"); 275Debug.Assert(scheduler != null, "TaskContinuation ctor: scheduler is null"); 292Debug.Assert(completedTask.IsCompleted, "ContinuationTask.Run(): completedTask not completed");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskExceptionHolder.cs (17)
47Debug.Assert(task != null, "Expected a non-null task."); 92Debug.Assert(exceptionObject != null, "TaskExceptionHolder.Add(): Expected a non-null exceptionObject"); 93Debug.Assert( 109Debug.Assert(exceptionObject != null, "Expected exceptionObject to be non-null."); 111Debug.Assert(m_cancellationException == null, 116Debug.Assert(m_faultExceptions == null, 129Debug.Assert(edi != null && edi.SourceException is OperationCanceledException, 145Debug.Assert(exceptionObject != null, "AddFaultException(): Expected a non-null exceptionObject"); 173Debug.Assert(exc != null, "No exceptions should be null"); 179Debug.Assert(numExceptions > 0, "Collection should contain at least one exception."); 189Debug.Assert(exceptions.Count > 0, "There should be at least one dispatch info."); 192Debug.Assert(tmp != null, "No dispatch infos should be null"); 255Debug.Assert(exceptions != null, "Expected an initialized list."); 256Debug.Assert(exceptions.Count > 0, "Expected at least one exception."); 284Debug.Assert(exceptions != null, "Expected an initialized list."); 285Debug.Assert(exceptions.Count > 0, "Expected at least one exception."); 300Debug.Assert(edi == null || edi.SourceException is OperationCanceledException,
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskFactory.cs (7)
1554Debug.Assert((tasksCopy != null) && (tasksCopy.Length > 0), "Expected non-null task array with at least one element in it"); 1581Debug.Assert(_count >= 0, "Count should never go below 0"); 1624Debug.Assert((tasksCopy != null) && (tasksCopy.Length > 0), "Expected non-null task array with at least one element in it"); 1651Debug.Assert(_count >= 0, "Count should never go below 0"); 2274Debug.Assert(tasks != null, "Expected non-null collection of tasks"); 2309Debug.Assert(success, "Only one task should have gotten to this point, and thus this must be successful."); 2317Debug.Assert(tasks != null, "Should not have been nulled out yet.");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskScheduler.cs (1)
512Debug.Assert(scheduler != null, "Table returned an incorrect Count or CopyTo failed");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ValueTask.cs (1)
416Debug.Assert(valueTask._obj is null or Task or IValueTaskSource, "If the ValueTask<>'s backing object is an IValueTaskSource<TResult>, it must also be IValueTaskSource.");
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadLocal.cs (4)
175Debug.Assert(id >= 0 || !_initialized, "expected id >= 0 if initialized"); 182Debug.Assert(_linkedSlot != null, "Should be non-null if not yet disposed"); 350Debug.Assert(ts_finalizationHelper != null, "Should have been initialized when this thread's slot array was created."); 393Debug.Assert(_linkedSlot != null, "Should only be null if disposed");
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (4)
699Debug.Assert(c > 0, "There must at least be a queue for this thread."); 1169Debug.Assert( 1178Debug.Assert( 1335Debug.Assert(helper != null, "Null state passed to PerformWaitOrTimerCallback!");
src\libraries\System.Private.CoreLib\src\System\Threading\Timer.cs (3)
203Debug.Assert(timer._dueTime != Timeout.UnsignedInfinite, "A timer in the list must have a valid due time."); 373Debug.Assert(timer._dueTime != Timeout.UnsignedInfinite, "Expected timer to be on a list."); 374Debug.Assert(timer._short != shortList, "Unnecessary if timer is already on the right list.");
src\libraries\System.Private.CoreLib\src\System\Threading\Win32ThreadPoolNativeOverlapped.cs (2)
194Debug.Assert(data._callback != null, "Does CompleteWithCallback called after Reset?"); 231Debug.Assert(data._callback != null, "Does OnExecutionContextCallback called after Reset?");
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.AdjustmentRule.cs (1)
243Diagnostics.Debug.Assert(daylightDelta <= MaxDaylightDelta && daylightDelta >= -MaxDaylightDelta,
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.cs (4)
312Debug.Assert(rule.NoDaylightTransitions, "GetPreviousAdjustmentRule should only be used with NoDaylightTransitions rules."); 612Debug.Assert(e is InvalidTimeZoneException, 1173Debug.Assert(result == null || ruleIndex.HasValue, "If an AdjustmentRule was found, ruleIndex should also be set."); 1895Debug.Assert(rule == null || ruleIndex.HasValue,
src\libraries\System.Private.CoreLib\src\System\WeakReference.T.cs (1)
169Debug.Assert(false, " WeakReference<T> finalizer should never run");
src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeNameParser.cs (1)
240Debug.Assert(nestedNameLength > 0, "TryGetTypeNameInfo should return error on zero lengths");
src\System\Buffer.CoreCLR.cs (3)
24Debug.Assert(len >= 0, "Negative length in memcpy!"); 31Debug.Assert((srcIndex >= 0) && (destIndex >= 0) && (len >= 0), "Index and length must be non-negative!"); 32Debug.Assert(src.Length - srcIndex >= len, "not enough bytes in src");
src\System\Delegate.CoreCLR.cs (1)
197Debug.Assert(currentType != null || _target.GetType().IsCOMObject, "The class hierarchy should declare the method");
src\System\Exception.CoreCLR.cs (1)
63Debug.Assert(_stackTrace != null, "_stackTrace shouldn't be null when this method is called");
src\System\MulticastDelegate.CoreCLR.cs (3)
56Debug.Assert(obj is MulticastDelegate, "Shouldn't have failed here since we already checked the types are the same!"); 94Debug.Assert(_invocationList is object[], "empty invocation list on multicast delegate"); 200Debug.Assert(!IsUnmanagedFunctionPtr(), "dynamic method and unmanaged fntptr delegate combined");
src\System\Reflection\Associates.cs (1)
67Debug.Assert(!associateMethodHandle.IsNullHandle(), "Failed to resolve associateRecord methodDef token");
src\System\Reflection\Emit\DynamicILGenerator.cs (1)
308Debug.Assert(opcode.Equals(OpCodes.Calli),
src\System\Reflection\Emit\RuntimeILGenerator.cs (11)
653Debug.Assert(opcode.Equals(OpCodes.Calli), 683Debug.Assert(opcode.Equals(OpCodes.Call) || 691Debug.Assert(opcode.Equals(OpCodes.Call) || 1309Debug.Assert(m_catchEndAddr[currentCatch - 1] == -1, "m_catchEndAddr[m_currentCatch-1] == -1"); 1326Debug.Assert(m_catchEndAddr[currentCatch - 1] == -1, "m_catchEndAddr[m_currentCatch-1] == -1"); 1372Debug.Assert(m_currentCatch > 0, "m_currentCatch > 0"); 1373Debug.Assert(m_catchAddr[m_currentCatch - 1] > 0, "m_catchAddr[m_currentCatch-1] > 0"); 1374Debug.Assert(m_catchEndAddr[m_currentCatch - 1] == -1, "m_catchEndAddr[m_currentCatch-1] == -1"); 1450Debug.Assert(m_currentCatch > 0, "m_currentCatch > 0"); 1451Debug.Assert(exc.m_currentCatch > 0, "exc.m_currentCatch > 0"); 1461Debug.Assert(exc.GetEndAddress() != GetEndAddress(),
src\System\Reflection\Emit\RuntimeMethodBuilder.cs (3)
586Debug.Assert(currentMethod == this, "We should have found this method in m_containingType.m_listMethods"); 587Debug.Assert(currentToken != 0, "The token should not be 0"); 594Debug.Assert(m_token == 0, "m_token should not have been initialized");
src\System\Reflection\Emit\RuntimeModuleBuilder.cs (2)
216Debug.Assert(!type.IsByRef, "Must not be ByRef. Get token from TypeSpec."); 217Debug.Assert(!type.IsGenericType || type.IsGenericTypeDefinition, "Must not have generic arguments.");
src\System\Reflection\Emit\RuntimeTypeBuilder.cs (1)
234Debug.Assert(destType is RuntimeType, "destType is not a runtime type, an EnumBuilder, or a TypeBuilder.");
src\System\Reflection\RuntimeCustomAttributeData.cs (1)
1985Debug.Assert(pca.BaseType == typeof(Attribute), "Pseudo CA Error - Incorrect base type");
src\System\Reflection\RuntimeLocalVariableInfo.cs (1)
16public override Type LocalType { get { Debug.Assert(_type != null, "type must be set!"); return _type; } }
src\System\Runtime\CompilerServices\CastHelpers.cs (1)
325Debug.Assert(mt != toTypeHnd, "The check for the trivial cases should be inlined by the JIT");
src\System\RuntimeHandles.cs (2)
210Debug.Assert(type.GetConstructor(Type.EmptyTypes) is ConstructorInfo c && c.IsPublic, 234Debug.Assert(type.GetConstructor(Type.EmptyTypes) is ConstructorInfo c && c.IsPublic,
src\System\RuntimeType.ActivatorCache.cs (1)
77Debug.Assert(Nullable.GetUnderlyingType(rt) != null,
src\System\RuntimeType.CoreCLR.cs (1)
4300Debug.Assert(!hit.Equals(key), "Key was already in CerHashtable! Potential race condition (or bug) in the Reflection cache?");
src\System\StubHelpers.cs (5)
33Debug.Assert(cbLength > 0, "Zero bytes returned from DoAnsiConversion in AnsiCharMarshaler.ConvertToNative"); 252Debug.Assert(length >= lengthInBytes + 6, "BSTR localloc'ed buffer is too small"); 361Debug.Assert(nbytesused >= 0 && nbytesused < nbytes, "Insufficient buffer allocated in VBByValStrMarshaler.ConvertToNative"); 904Debug.Assert(pvArrayMarshaler != IntPtr.Zero, "pvArrayMarshaler must not be null"); 1061Debug.Assert(length < allocSize, "Expected a length less than the allocated size");
System.Private.CoreLib.Generators (1)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (1)
91Debug.Assert(index == 0, "Implementation currently only supports index == 0");
System.Private.DataContractSerialization (19)
src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (1)
254Debug.Assert(q.Count == 1, "We should have one and only one in the rank queue.");
src\libraries\Common\src\System\HexConverter.cs (2)
332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
System\Runtime\Serialization\CodeGenerator.cs (1)
362Debug.Assert(cmp == Cmp.GreaterThanOrEqualTo, "Unexpected cmp");
System\Runtime\Serialization\CollectionDataContract.cs (2)
843Debug.Assert(Kind != CollectionKind.Array, "GetCollectionElementType should not be called on Arrays"); 844Debug.Assert(GetEnumeratorMethod != null, "GetEnumeratorMethod should be non-null for non-Arrays");
System\Runtime\Serialization\Json\XmlJsonReader.cs (1)
1570Debug.Assert(i < val.Length, "Found that an '\' was the last character in a string. ReadServerTypeAttriute validates that the escape sequence is valid when it calls ReadQuotedText and ReadEscapedCharacter");
System\Runtime\Serialization\Json\XmlJsonWriter.cs (2)
434Debug.Assert(!(_isWritingDataTypeAttribute && _isWritingServerTypeAttribute), 603Debug.Assert((_nodeType == JsonNodeType.StandaloneText) || (_nodeType == JsonNodeType.EndElement),
System\Runtime\Serialization\KnownTypeDataContractResolver.cs (1)
17Debug.Assert(context != null, "KnownTypeDataContractResolver should not be instantiated with a null context");
System\Runtime\Serialization\ReflectionXmlFormatReader.cs (1)
74Debug.Assert(reflectedMemberCount == memberCount, "The value returned by ReflectionGetMembers() should equal to memberCount.");
System\Xml\StringHandle.cs (2)
117Debug.Assert(type == StringHandleType.EscapedUTF8, "Should be EscapedUTF8"); 131Debug.Assert(type == StringHandleType.EscapedUTF8, "Should be EscapedUTF8");
System\Xml\ValueHandle.cs (1)
690Debug.Assert(offset + count <= chars.Length, string.Format("offset '{0}' + count '{1}' MUST BE <= chars.Length '{2}'", offset, count, chars.Length));
System\Xml\XmlBinaryWriter.cs (4)
38Debug.Assert(XmlBinaryNodeType.MaxAttribute < XmlBinaryNodeType.MinElement && 71Debug.Assert(nodeType >= XmlBinaryNodeType.MinText && nodeType <= XmlBinaryNodeType.MaxText && ((byte)nodeType & 1) == 0, "Invalid nodeType"); 109Debug.Assert(offset >= 0 && offset + 1 + Unsafe.SizeOf<T>() <= buffer.Length, "WriteTextNodeRaw"); 124Debug.Assert(offset >= 0 && offset + Unsafe.SizeOf<T>() <= buffer.Length, "WriteRaw");
System\Xml\XmlUTF8TextReader.cs (1)
879Debug.Assert(buffer[offset] == 0xEF, "buffer[offset] MUST be 0xEF.");
System.Private.Uri (9)
src\libraries\Common\src\System\HexConverter.cs (2)
332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\DomainNameHelper.cs (1)
61Debug.Assert(!str.AsSpan(start, index).Contains(':'),
System\IriHelper.cs (1)
118Debug.Assert(ch < 0xFF, "Expecting ASCII character.");
System\UriExt.cs (2)
782Debug.Assert(!syntax!.IsSimple, "A UriPraser threw on InitializeAndValidate."); 796Debug.Assert(!baseUri.IsNotAbsoluteUri && !baseUri.UserDrivenParsing, "Uri::ResolveHelper()|baseUri is not Absolute or is controlled by User Parser.");
System\UriHelper.cs (2)
193Debug.Assert(!noEscape.Contains('%'), "Need to treat % specially; it should be part of any escaped set"); 220Debug.Assert(!noEscape.Contains('%'), "Need to treat % specially; it should be part of any escaped set");
System.Private.Xml (440)
src\libraries\Common\src\System\HexConverter.cs (2)
332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Xml\BinaryXml\XmlBinaryReader.cs (8)
2004Debug.Assert(_mark <= _end, "Mark should never be past End"); 2005Debug.Assert(_mark <= _pos, "Mark should never be after Pos"); 2756Debug.Assert(_stringValue == null, "this.stringValue == null"); 2757Debug.Assert(_token == BinXmlToken.CData, "this.token == BinXmlToken.CData"); 3488Debug.Assert(_checkCharacters, "this.checkCharacters"); 3494Debug.Assert(data.Length % 2 == 0, "Data size should not be odd"); 3543Debug.Assert(!_checkCharacters, "!this.checkCharacters"); 3546Debug.Assert(0 == ((_pos - _tokDataPos) & 1), "Data size should not be odd");
System\Xml\BitStack.cs (2)
50Debug.Assert(_curr != 0x1, "Stack empty"); 71Debug.Assert(_curr != 0x1, "Stack empty");
System\Xml\Cache\XPathDocumentBuilder.cs (5)
320Debug.Assert(_idxParent != 0 && _pageParent != null, "ID attribute must have an element parent"); 554Debug.Assert(prefix.Equals("xml"), "xmlns:xml namespace declaration should always be present in the list."); 705Debug.Assert(_lineInfo.HasLineInfo(), "HasLineInfo should have been checked before this."); 773Debug.Assert(_textBldr.HasText || (_idxSibling == 0 && _idxParent == 0), "Cannot create empty text node unless it's a top-level text node."); 774Debug.Assert(_idxSibling == 0 || (_pageSibling != null && !_pageSibling[_idxSibling].IsText), "Cannot create adjacent text nodes.");
System\Xml\Cache\XPathDocumentNavigator.cs (1)
88Debug.Assert(_idxParent != 0 && _pageParent![_idxParent].HasCollapsedText,
System\Xml\Cache\XPathNode.cs (7)
154Debug.Assert(HasCollapsedText, "Do not call CollapsedLinePosition unless HasCollapsedText is true."); 211Debug.Assert(localName == null || (object?)Document.NameTable.Get(localName) == (object)localName, "localName must be atomized."); 223Debug.Assert(localName == null || (object?)Document.NameTable.Get(localName) == (object)localName, "localName must be atomized."); 439Debug.Assert(pageSibling != null && idxSibling != 0 && idxSibling <= ushort.MaxValue, "Bad argument"); 440Debug.Assert(_idxSibling == 0, "SetSibling should not be called more than once."); 458Debug.Assert(pageSimilar != null && idxSimilar != 0 && idxSimilar <= ushort.MaxValue, "Bad argument"); 459Debug.Assert(_idxSimilar == 0, "SetSimilarElement should not be called more than once.");
System\Xml\Cache\XPathNodeHelper.cs (21)
70Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 89Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 109Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 138Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 161Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 179Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 194Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 228Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 261Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 299Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 331Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 394Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 428Debug.Assert(pageCurrent != null && idxCurrent != 0, "Cannot pass null argument(s)"); 527Debug.Assert(pageCurrent != null && idxCurrent != 0, "Cannot pass null argument(s)"); 528Debug.Assert(typ != XPathNodeType.Text, "Text should be handled by GetTextFollowing in order to take into account collapsed text."); 529Debug.Assert(page[idx].NodeType != XPathNodeType.Attribute, "Current node should never be an attribute or namespace--caller should handle this case."); 566Debug.Assert(!page[idx].IsAttrNmsp, "GetContentFollowing should never return attributes or namespaces."); 585Debug.Assert(pageCurrent != null && idxCurrent != 0, "Cannot pass null argument(s)"); 586Debug.Assert(!page[idx].IsAttrNmsp, "Current node should never be an attribute or namespace--caller should handle this case."); 662Debug.Assert(pageNode[idxNode].HasAttribute || pageNode[idxNode].HasContentChild, "Caller must check HasAttribute/HasContentChild on parent before calling GetChild."); 663Debug.Assert(pageNode[idxNode].HasAttribute || !pageNode[idxNode].HasCollapsedText, "Text child is virtualized and therefore is not present in the physical node page.");
System\Xml\Core\XmlTextReaderImpl.cs (23)
763Debug.Assert(baseUriStr == string.Empty, "BaseURI can come either from XmlParserContext or from the constructor argument, not from both"); 2008Debug.Assert(_v1Compat, "XmlTextReaderImpl.Normalization property cannot be accessed on reader created via XmlReader.Create."); 2013Debug.Assert(_v1Compat, "XmlTextReaderImpl.Normalization property cannot be changed on reader created via XmlReader.Create."); 2041Debug.Assert(_v1Compat, "XmlTextReaderImpl.WhitespaceHandling property cannot be accessed on reader created via XmlReader.Create."); 2046Debug.Assert(_v1Compat, "XmlTextReaderImpl.WhitespaceHandling property cannot be changed on reader created via XmlReader.Create."); 2066Debug.Assert(_v1Compat, "XmlTextReaderImpl.DtdProcessing property cannot be accessed on reader created via XmlReader.Create."); 2071Debug.Assert(_v1Compat, "XmlTextReaderImpl.DtdProcessing property cannot be changed on reader created via XmlReader.Create."); 2123Debug.Assert(_v1Compat, "XmlTextReaderImpl.ResetState cannot be called on reader created via XmlReader.Create."); 2165Debug.Assert(_v1Compat, "XmlTextReaderImpl.GetRemainder cannot be called on reader created via XmlReader.Create."); 2206Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadChars cannot be called on reader created via XmlReader.Create."); 2242Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadBase64 cannot be called on reader created via XmlReader.Create."); 2276Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadBinHex cannot be called on reader created via XmlReader.Create."); 3286Debug.Assert(_ps.appendMode, "UnDecodeChars cannot be called after ps.appendMode has been changed to false"); 3288Debug.Assert(_ps.charsUsed >= _ps.charPos, "The current position must be in the valid character range."); 3296Debug.Assert(_charactersInDocument >= _ps.charsUsed - _ps.charPos, 3305Debug.Assert(_charactersFromEntities >= _ps.charsUsed - _ps.charPos, 4887Debug.Assert(val == XmlComplianceUtil.CDataNormalize(val), "The attribute value is not CDATA normalized!"); 7967Debug.Assert(_xmlResolver.SupportsType(uri, typeof(Stream)), "Stream must always be a supported type in XmlResolver"); 8511Debug.Assert(count == charsParsed || _incReadDecoder.IsFull, "Check if decoded consumed all characters unless it's full."); 8528Debug.Assert(IncrementalRead() == 0, "Previous call of IncrementalRead should eat up all characters!"); 8590Debug.Assert(_ps.eolNormalized, "Entity replacement text for attribute values should be EOL-normalized!"); 9023Debug.Assert(context.NameTable == null || context.NameTable == nt, "This check should have been done in XmlParserContext constructor."); 9122Debug.Assert(_curNode.type == XmlNodeType.Whitespace && newNodeType == XmlNodeType.SignificantWhitespace, "Incorrect node type change!");
System\Xml\Core\XmlTextReaderImplAsync.cs (2)
2530Debug.Assert(val == XmlComplianceUtil.CDataNormalize(val), "The attribute value is not CDATA normalized!"); 5178Debug.Assert(_xmlResolver.SupportsType(uri, typeof(Stream)), "Stream must always be a supported type in XmlResolver");
System\Xml\Core\XmlTextReaderImplHelpers.cs (1)
447Debug.Assert(_valueStartPos >= 0 || _value != null, "Value not ready.");
System\Xml\Core\XmlTextWriter.cs (1)
1471Debug.Assert(declared, "Unexpected situation!!");
System\Xml\Core\XmlWriterSettings.cs (1)
603Debug.Assert(Encoding.Equals(Encoding.GetEncoding(Encoding.CodePage)), "Cannot serialize encoding correctly");
System\Xml\Core\XsdValidatingReaderAsync.cs (1)
156Debug.Assert(false, $"{nameof(typedValue)} should never be null");
System\Xml\Dom\DocumentXPathNavigator.cs (4)
1309Debug.Assert(node1 != node2, "Should be handled by ComparePosition()"); 1791Debug.Assert(node != null, "This method needs to be called with the beforehand check of NextSibling being not null from node to end"); 1833Debug.Assert(node != null, "Undefined navigator position"); 1834Debug.Assert(node == _document || node.OwnerDocument == _document, "Navigator switched documents");
System\Xml\Dom\XmlNode.cs (1)
809Debug.Assert(true, "shouldn't have fall through here.");
System\Xml\Schema\Inference\Infer.cs (2)
253Debug.Assert(_rootSchema != null, "rootSchema is null"); 483Debug.Assert(targetNS == null || targetNS.Length > 0, "targetns for schema is empty");
System\Xml\Schema\XmlSchemaException.cs (1)
83Debug.Assert(message == null || !message.StartsWith("Sch_", StringComparison.Ordinal), "Do not pass a resource here!");
System\Xml\Schema\XmlSchemaObjectTable.cs (3)
21Debug.Assert(!_table.ContainsKey(name), "XmlSchemaObjectTable.Add: entry already exists"); 195Debug.Assert(array.Length >= _size, "array is not big enough to hold all the items in the ICollection"); 248Debug.Assert(array.Length >= _size, "array is not big enough to hold all the items in the ICollection");
System\Xml\Schema\XmlValueConverter.cs (6)
235Debug.Assert(schemaType != null && datatype != null, "schemaType or schemaType.Datatype may not be null"); 242Debug.Assert(schemaType.Datatype!.Variety != XmlSchemaDatatypeVariety.List, "schemaType must be list's item type, not list itself"); 435Debug.Assert(_typeCode == XmlTypeCode.Item, "If SchemaType is null, then TypeCode may only be Item, Node, or AnyAtomicType"); 2919Debug.Assert(!(atomicConverter is XmlListConverter) || ((XmlListConverter)atomicConverter).atomicConverter == null, 3051Debug.Assert(enumSrc != null, "Value passed to ToArray must implement IEnumerable"); 3079Debug.Assert(enumSrc != null, "Value passed to ToArray must implement IEnumerable");
System\Xml\Schema\XsdDateTime.cs (2)
180Debug.Assert(BitOperations.IsPow2((uint)kinds), "One and only one DateTime type code can be set."); 224Debug.Assert(BitOperations.IsPow2((uint)kinds), "Only one DateTime type code can be set.");
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (5)
625Debug.Assert(o != null, "Object o should not be null"); 626Debug.Assert(!string.IsNullOrEmpty(memberName), "memberName must have a value"); 637Debug.Assert(memberInfo != null, "memberInfo could not be retrieved"); 1269Debug.Assert(!mapping.IsSoap, "mapping.IsSoap was true. Use WriteEnumMethodSoap for reading SOAP encoded enum value."); 1918Debug.Assert(xmlnsMember.XmlnsSource != null, "Xmlns member's source was not set.");
System\Xml\Serialization\XmlSerializationWriter.cs (2)
410Debug.Assert(tryFormatResult.Value, "Something goes wrong with formatting primitives to the buffer."); 414Debug.Assert(!span.Slice(0, charsWritten).ContainsAny(escapeChars), "Primitive value contains illegal xml char.");
System\Xml\XmlException.cs (2)
92Debug.Assert(message == null || !message.StartsWith("Xml_", StringComparison.Ordinal), "Do not pass a resource here!"); 294Debug.Assert(e != null, "Unexpected null exception");
System\Xml\XPath\Internal\BooleanFunctions.cs (1)
65Debug.Assert(result is XPathNavigator, "Unknown value type");
System\Xml\XPath\Internal\CompiledXPathExpr.cs (1)
46Debug.Assert(_query != null, "In case of error in XPath we create ErrorXPathExpression");
System\Xml\XPath\Internal\DescendantoverDescendantQuery.cs (1)
95Debug.Assert(result, "Algorithm error, We always should be able to move up if level > 0");
System\Xml\XPath\Internal\FilterQuery.cs (1)
71Debug.Assert(value is XPathNavigator, "Unknown value type");
System\Xml\XPath\Internal\LogicalExpr.cs (2)
254Debug.Assert(op == Operator.Op.EQ || op == Operator.Op.NE, 366Debug.Assert(op == Operator.Op.EQ || op == Operator.Op.NE,
System\Xml\XPath\Internal\NamespaceQuery.cs (1)
61Debug.Assert(e.LocalName.Length == 0, "Only xmlns='' can have empty string as a value");
System\Xml\XPath\Internal\PrecedingQuery.cs (1)
85Debug.Assert(qyInput.Advance() == null, "we read all qyInput.Advance() already");
System\Xml\XPath\Internal\PreSiblingQuery.cs (1)
67Debug.Assert(test, "We just moved to parent, how we can not have first child?");
System\Xml\XPath\Internal\Query.cs (1)
191Debug.Assert(value is XPathNavigator, "Unknown value type");
System\Xml\XPath\Internal\QueryBuilder.cs (1)
464Debug.Assert(root != null, "root != null");
System\Xml\XPath\Internal\SortQuery.cs (3)
22Debug.Assert(qyInput != null, "Sort Query needs an input query tree to work on"); 54Debug.Assert(numSorts > 0, "Why was the sort query created?"); 197Debug.Assert(x != null && y != null, "Oops!! what happened?");
System\Xml\XPath\Internal\StringFunctions.cs (1)
22Debug.Assert(argList != null, "Use 'new Query[]{}' instead.");
System\Xml\XPath\Internal\XPathMultyIterator.cs (2)
127Debug.Assert(position != 0, "MoveNext() wasn't called"); 128Debug.Assert(firstNotEmpty < arr.Length, "MoveNext() returned false");
System\Xml\XPath\Internal\XPathParser.cs (1)
498Debug.Assert(opnd != null, "IsPrimaryExpr() was true. We should recognize this lex.");
System\Xml\XPath\XPathDocument.cs (1)
178Debug.Assert((object?)_nameTable.Get(string.Empty) == (object)string.Empty, "NameTable must contain atomized string.Empty");
System\Xml\XPath\XPathNavigator.cs (3)
970Debug.Assert(CompareSiblings(n1.Clone(), n2.Clone()) != CompareSiblings(n2.Clone(), n1.Clone()), "IsSamePosition() on custom navigator returns inconsistent results"); 1039Debug.Assert(schemaType != null || this.NodeType == XPathNodeType.Root, "schemaType != null || this.NodeType == XPathNodeType.Root"); 1067Debug.Assert(schemas != null, "schemas != null");
System\Xml\Xsl\IlGen\GenerateHelper.cs (6)
116Debug.Assert(seqEmpty != null, "Field `Empty` could not be found"); 896Debug.Assert(clrTypeDst == typeof(object), "Invalid cast, since value types do not allow inheritance."); 902Debug.Assert(clrTypeSrc == typeof(object), "Invalid cast, since value types do not allow inheritance."); 910Debug.Assert(clrTypeSrc.IsAssignableFrom(clrTypeDst) || clrTypeDst.IsAssignableFrom(clrTypeSrc), 1411Debug.Assert(keyType.IsAtomicValue, "Sort key must have atomic value type."); 1633Debug.Assert(!opcode.Equals(OpCodes.Br) && !opcode.Equals(OpCodes.Br_S), "Use EmitUnconditionalBranch and be careful not to emit unverifiable code.");
System\Xml\Xsl\IlGen\IteratorDescriptor.cs (2)
678Debug.Assert(_storage.ItemStorageType == typeof(XPathItem) || storageTypeDest == typeof(XPathItem), 722Debug.Assert(storageTypeDest == typeof(XPathItem), "Must be converting from XPathNavigator to XPathItem");
System\Xml\Xsl\IlGen\OptimizerPatterns.cs (2)
209Debug.Assert(!_isReadOnly, "This OptimizerPatterns instance is read-only."); 247Debug.Assert(!_isReadOnly, "This OptimizerPatterns instance is read-only.");
System\Xml\Xsl\IlGen\TailCallAnalyzer.cs (1)
36Debug.Assert(XmlILConstructInfo.Read(nd).PushToWriterLast,
System\Xml\Xsl\IlGen\XmlILConstructAnalyzer.cs (15)
130Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 143Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 156Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 169Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 182Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 195Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 219Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 243Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 268Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 297Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 311Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 325Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 339Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 353Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 1095Debug.Assert(nd.NodeType != QilNodeType.NamespaceDecl || !_nsmgr.HasNamespace(prefix) || _nsmgr.LookupNamespace(prefix) == ns,
System\Xml\Xsl\IlGen\XmlILModule.cs (3)
211Debug.Assert(!_useLRE, "Cannot create initialized data for an LRE module"); 220Debug.Assert(!_useLRE, "Cannot create field for an LRE module"); 229Debug.Assert(!_useLRE, "Cannot create type initializer for an LRE module");
System\Xml\Xsl\IlGen\XmlILOptimizerVisitor.cs (2)
5297Debug.Assert(nd is QilLiteral, "All literals except True, False, and QName must use QilLiteral"); 5639Debug.Assert(nd.NodeType == QilNodeType.Let || nd.NodeType == QilNodeType.Parameter, "Unexpected type of a global");
System\Xml\Xsl\IlGen\XmlIlVisitor.cs (32)
76Debug.Assert(_iterCurr.Storage.Location == ItemLocation.None, "Root expression should have been pushed to the writer."); 97Debug.Assert(methGlobal != null, "Metadata for global value should have already been computed"); 149Debug.Assert(iter.XmlType == TypeFactory.ItemS, "IlGen currently only supports parameters of type item*."); 193Debug.Assert(iter.NodeType == QilNodeType.Parameter, "Only parameters may not have a default value"); 253Debug.Assert(iter.XmlType == TypeFactory.ItemS, "IlGen currently only supports default values in parameters of type item*."); 318Debug.Assert(nd.XmlType!.IsSingleton || CachesResult(nd) || _iterCurr.HasLabelNext, 981Debug.Assert(ndBranch.XmlType!.IsSingleton, "Conditional must produce a singleton"); 1144Debug.Assert(XmlILConstructInfo.Read(nd).PullFromIteratorFirst, "VisitEmpty should only be called if items are iterated"); 1165Debug.Assert(XmlILConstructInfo.Read(ndSeq).ConstructMethod == XmlILConstructMethod.Iterator, "This method should only be called if items in list are pulled from a code iterator."); 1509Debug.Assert(!ndStrConcat.Values.XmlType!.IsSingleton, "Optimizer should have folded StrConcat of a singleton value"); 1713Debug.Assert(ndComp.Left.XmlType!.IsAtomicValue && ndComp.Right.XmlType!.IsAtomicValue, "Operands to compare must be atomic values."); 1714Debug.Assert(ndComp.Left.XmlType.IsSingleton && ndComp.Right.XmlType.IsSingleton, "Operands to compare must be cardinality one."); 1715Debug.Assert(ndComp.Left.XmlType == ndComp.Right.XmlType, "Operands to compare may not be heterogenous."); 2330Debug.Assert(ndKey.Key.XmlType!.IsAtomicValue, "Sort key must be an atomic value."); 2437Debug.Assert(pattStep.MatchesPattern(OptimizerPatternName.Axis), "Dod patterns should only match if step is FilterElements or FilterKindTest or Axis"); 2523Debug.Assert(_iterCurr.Storage.IsCached, "DodMerge pattern should only be matched when cached sequences are returned from loop"); 2600Debug.Assert(ndName != null, "Attribute node must have a literal QName as its second argument"); 2780Debug.Assert(XmlILConstructInfo.Read(ndElem).PushToWriterFirst, "Element construction should always be pushed to writer."); 2830Debug.Assert(XmlILConstructInfo.Read(ndAttr).PushToWriterFirst, "Attribute construction should always be pushed to writer."); 2864Debug.Assert(XmlILConstructInfo.Read(ndComment).PushToWriterFirst, "Comment construction should always be pushed to writer."); 2884Debug.Assert(XmlILConstructInfo.Read(ndPI).PushToWriterFirst, "PI construction should always be pushed to writer."); 2924Debug.Assert(info.PushToWriterFirst, "Text construction should always be pushed to writer."); 2984Debug.Assert(XmlILConstructInfo.Read(ndDoc).PushToWriterFirst, "Document root construction should always be pushed to writer."); 3007Debug.Assert(info.PushToWriterFirst, "Namespace construction should always be pushed to writer."); 3181Debug.Assert(!typDerived!.NeverSubtypeOf(typBase), "Normalizer should have eliminated IsType where source can never be a subtype of destination type."); 3187Debug.Assert(_iterCurr.Storage.ItemStorageType == typeof(XPathItem), "If !IsNode, then storage type should be Item"); 3263Debug.Assert((typDerived.NodeKinds & kinds) != XmlNodeKindFlags.None, "Normalizer should have taken care of case where node kinds are disjoint."); 3439Debug.Assert(ndVal.Child.XmlType!.IsNode, "XPathNodeValue node may only be applied to a sequence of Nodes."); 3649Debug.Assert(ndActualArg.XmlType!.IsSubtypeOf(xmlTypeFormalArg), "Xml type of actual arg must be a subtype of the Xml type of the formal arg"); 3779Debug.Assert(XmlILConstructInfo.Read(ndCopyOf).PushToWriterFirst, "XsltCopyOf should always be pushed to writer."); 4105Debug.Assert(ndName.XmlType!.TypeCode == XmlTypeCode.QName, "Element or attribute name must have QName type."); 4853Debug.Assert(_iterCurr.Storage.IsCached, "Expression result should be cached. CachesResult() might have a bug in it.");
System\Xml\Xsl\QIL\QilList.cs (1)
58Debug.Assert(!xt.IsDod, "Sequences do not preserve DocOrderDistinct");
System\Xml\Xsl\QIL\QilPatternFactory.cs (3)
228Debug.Assert(arg != null, "Argument shouldn't be null"); 229Debug.Assert(arg.XmlType!.TypeCode == XmlTypeCode.Boolean && arg.XmlType.IsSingleton, 770Debug.Assert(t != null, "Type can't be null");
System\Xml\Xsl\QIL\QilReplaceVisitor.cs (1)
81Debug.Assert(newType.IsSubtypeOf(XmlQueryTypeFactory.AtMost(oldType, oldType.Cardinality)), "Replace shouldn't relax original type");
System\Xml\Xsl\QIL\WhitespaceRule.cs (1)
77Debug.Assert(this.GetType() == typeof(WhitespaceRule), "Serialization of WhitespaceRule subclasses is not implemented");
System\Xml\Xsl\Runtime\DodSequenceMerge.cs (1)
94Debug.Assert(_sequencesToMerge.Count == 1, "While loop should terminate when count == 1");
System\Xml\Xsl\Runtime\SetIterators.cs (2)
213Debug.Assert(nestedNavigator == null, "null is passed to MoveNext after IteratorState.HaveCurrent has been returned."); 313Debug.Assert(nestedNavigator == null, "null is passed to MoveNext after IteratorState.HaveCurrent has been returned.");
System\Xml\Xsl\Runtime\XmlAttributeCache.cs (1)
156Debug.Assert(value is XmlAtomicValue, "value should always be an XmlAtomicValue, as XmlAttributeCache is only used by XmlQueryOutput");
System\Xml\Xsl\Runtime\XmlCollation.cs (2)
156Debug.Assert(collationLiteral != null, "collation literal should not be null"); 379Debug.Assert(_cultInfo == null || _cultInfo.Equals(new CultureInfo(_cultInfo.Name)),
System\Xml\Xsl\Runtime\XmlExtensionFunction.cs (2)
281Debug.Assert(_meth != null, "Must call Bind() before calling Invoke."); 282Debug.Assert(args.Length == _argClrTypes!.Length, "Mismatched number of actual and formal arguments.");
System\Xml\Xsl\Runtime\XmlILIndex.cs (1)
45Debug.Assert(navigator.ComparePosition(seq[seq.Count - 1]) >= 0, "Index nodes must be added in document order");
System\Xml\Xsl\Runtime\XmlQueryContext.cs (2)
167Debug.Assert(dataSource != null, "GetType() below assumes dataSource is not null"); 199Debug.Assert(uriRelative != null, "Relative URI should not be null");
System\Xml\Xsl\Runtime\XmlQueryOutput.cs (14)
162Debug.Assert(prefix != null && !string.IsNullOrEmpty(localName) && ns != null, "Invalid argument"); 163Debug.Assert(ValidateNames.ValidateName(prefix, localName, ns, XPathNodeType.Element, ValidateNames.Flags.All), "Name validation failed"); 221Debug.Assert(prefix != null && localName != null && ns != null, "Invalid argument"); 595Debug.Assert(_depth == 0, "Root node can only be constructed at top-level."); 608Debug.Assert(_depth == 1, "Root node can only be constructed at top-level."); 746Debug.Assert(prefix != null, "Invalid argument"); 884Debug.Assert(_xstate == XmlState.WithinSequence, "Values can only be written at the top-level."); 938Debug.Assert(navigator.NodeType == XPathNodeType.Element, "StartCopy should return true only for Element nodes."); 957Debug.Assert(navigator.NodeType == XPathNodeType.Root, "EndCopy should only be called for Element and Document nodes."); 980Debug.Assert(text != null, "Invalid argument"); 1044Debug.Assert(nodeType == XPathNodeType.Element, "StartCopy should return true only for Element nodes."); 1175Debug.Assert(_xstate != XmlState.WithinSequence, "StartCopy should not called if state is WithinSequence"); 1219Debug.Assert(navigator.NodeType == XPathNodeType.Element, "Only elements have namespaces to copy"); 1224Debug.Assert(navigator.LocalName.Length != 0, "xmlns:foo='' isn't allowed");
System\Xml\Xsl\Runtime\XmlQueryRuntime.cs (9)
174Debug.Assert(IsGlobalComputed(idx), "Cannot get the value of a global value until it has been computed."); 175Debug.Assert(_globalValues![idx] is IList<XPathItem>, "Only debugger should call this method, and all global values should have type item* in debugging scenarios."); 191Debug.Assert(IsGlobalComputed(idx), "Cannot get the value of a global value until it has been computed."); 192Debug.Assert(_globalValues![idx] is IList<XPathItem>, "Only debugger should call this method, and all global values should have type item* in debugging scenarios."); 250Debug.Assert(_earlyObjects != null && index < _earlyObjects.Length, "Early bound object does not exist"); 300Debug.Assert(IsGlobalComputed(index), "Cannot get the value of a global value until it has been computed."); 310Debug.Assert(!IsGlobalComputed(index), "Global value should only be set once."); 480Debug.Assert(XmlILTypeHelper.GetStorageType(xmlType).IsAssignableFrom(value.GetType()), 499Debug.Assert(xmlType != XmlQueryTypeFactory.Node && xmlType != XmlQueryTypeFactory.NodeS,
System\Xml\Xsl\Runtime\XmlQuerySequence.cs (1)
387Debug.Assert(keys.Length >= _size, "Number of keys must be >= number of items.");
System\Xml\Xsl\Runtime\XmlQueryStaticData.cs (1)
184Debug.Assert(formatVersion != CurrentFormatVersion || dataReader.Read() == -1, "Extra data at the end of the stream");
System\Xml\Xsl\Runtime\XmlSortKey.cs (2)
252Debug.Assert(that._sortKey != null, "Both keys must have non-null sortKey field"); 257Debug.Assert(_sortKeyBytes != null && that._sortKeyBytes != null, "Both keys must have non-null sortKeyBytes field");
System\Xml\Xsl\Runtime\XslNumber.cs (4)
27Debug.Assert(isSeparator == (formatString != null), "AssertSeparator"); 270Debug.Assert(item.ValueType == typeof(double), "Item must be either of type int, or double"); 308Debug.Assert(val >= 0 && val == Math.Round(val), "ConvertToArabic operates on non-negative integer numbers only"); 360Debug.Assert(pNewEnd >= result, "Separator cannot be the first character");
System\Xml\Xsl\Runtime\XsltConvert.cs (1)
252Debug.Assert(destinationType.IsStrict && destinationType.IsAtomicValue, "Can only convert to strict atomic type.");
System\Xml\Xsl\Runtime\XsltLibrary.cs (4)
196Debug.Assert(_decimalFormatters != null && 0 <= idx && idx < _decimalFormatters.Count, "Value of decimalFormatterIndex is out of range"); 341Debug.Assert(!item.IsNode, "Atomic value expected"); 361Debug.Assert(TypeCode.Boolean < TypeCode.Double && TypeCode.Double < TypeCode.String, "Cannot use the smallest TypeCode as a weakest one"); 539Debug.Assert((object)nav1.NameTable == (object)nav2.NameTable, "Ref.Equal cannot be used if navigators have different name tables");
System\Xml\Xsl\SourceLineInfo.cs (3)
75Debug.Assert(0 < lineInfo.Start.Line && 0 < lineInfo.Start.Pos, "0 < start"); 76Debug.Assert(0 < lineInfo.End.Line && 0 < lineInfo.End.Pos, "0 < end"); 77Debug.Assert(lineInfo.Start.LessOrEqual(lineInfo.End), "start <= end");
System\Xml\Xsl\XmlIlGenerator.cs (1)
341Debug.Assert(methInfo != null, "MethodInfo for global value should have been created previously.");
System\Xml\Xsl\XmlQueryType.cs (10)
487Debug.Assert(Count == 1 && IsSingleton, "This method should only be called for item types."); 488Debug.Assert(baseType.Count == 1 && baseType.IsSingleton, "This method should only be called for item types."); 489Debug.Assert(!IsDod && !baseType.IsDod, "Singleton types may not have DocOrderDistinct property"); 528Debug.Assert(this.Count == 1 && this.IsSingleton, "this should be an item"); 529Debug.Assert(other.Count == 1 && other.IsSingleton, "other should be an item"); 562Debug.Assert(Count == 1, "Do not pass a Union type to this method."); 563Debug.Assert(IsSingleton, "Do not pass a Sequence type to this method."); 885Debug.Assert(count < 64, "BitMatrix currently only handles up to 64x64 matrix."); 903Debug.Assert(index1 < _bits.Length && index2 < _bits.Length, "Index out of range."); 908Debug.Assert(index1 < _bits.Length && index2 < _bits.Length, "Index out of range.");
System\Xml\Xsl\XmlQueryTypeFactory.cs (10)
265Debug.Assert(itemType.IsSingleton, "All types should be prime."); 351Debug.Assert(arrEnum[arrEnum.Length - 1] == XmlTypeCode.DayTimeDuration, 437Debug.Assert(schemaType.Datatype!.Variety == XmlSchemaDatatypeVariety.Atomic, "List or Union Xsd types should have been handled by caller."); 504Debug.Assert(nameTest != null, "nameTest cannot be null"); 505Debug.Assert(schemaType != null, "schemaType cannot be null"); 554Debug.Assert((object)this == (object)Create(_code, _isStrict), "Unknown type"); 741Debug.Assert(members != null && members.Count != 1, "ChoiceType must contain a list with 0 or >1 types."); 749Debug.Assert(t.Cardinality == XmlQueryCardinality.One, "ChoiceType member types must be prime types."); 972Debug.Assert(prime != null, "SequenceType can only modify the cardinality of a non-null XmlQueryType."); 973Debug.Assert(prime.IsSingleton, "Prime type must have cardinality one.");
System\Xml\Xsl\XPath\XPathBuilder.cs (9)
67Debug.Assert(!_inTheBuild, "XPathBuilder is busy!"); 80Debug.Assert(_inTheBuild, "StartBuild() wasn't called"); 92Debug.Assert(numFixupCurrent >= 0, "Context fixup error"); 93Debug.Assert(numFixupPosition >= 0, "Context fixup error"); 94Debug.Assert(numFixupLast >= 0, "Context fixup error"); 148Debug.Assert(compType == XmlTypeCode.Boolean || left.XmlType!.IsSingleton && right.XmlType!.IsSingleton, "Both comparison operands must be singletons"); 170Debug.Assert(compType == XmlTypeCode.Boolean || compType == XmlTypeCode.Double || compType == XmlTypeCode.String, "I don't know what to do with RTF here"); 457Debug.Assert(nodeset.NodeType == QilNodeType.DocOrderDistinct, 561Debug.Assert(!args.IsReadOnly, "Writable collection expected");
System\Xml\Xsl\XPath\XPathParser.cs (2)
57Debug.Assert(_posInfo.Count == 0, "PushPosInfo() and PopPosInfo() calls have been unbalanced"); 536Debug.Assert(
System\Xml\Xsl\XPath\XPathQilFactory.cs (8)
41Debug.Assert(result == (xt.TypeCode == XmlTypeCode.Item || xt.TypeCode == XmlTypeCode.AnyAtomicType), "What else can it be?"); 48Debug.Assert(n != null && n.XmlType!.IsSingleton && n.XmlType.IsNode, "Must be a singleton node"); 54Debug.Assert(n != null && n.XmlType!.IsNode, "Must be a node-set"); 60Debug.Assert(n != null && n.XmlType!.IsSingleton && n.XmlType.IsNode && n.XmlType.IsNotRtf, "Must be a singleton node and not an Rtf"); 66Debug.Assert(n != null && n.XmlType!.IsSubtypeOf(T.StringX), "Must be a singleton string"); 72Debug.Assert(n != null && n.XmlType!.IsSubtypeOf(T.StringXS), "Must be a sequence of strings"); 78Debug.Assert(n != null && n.XmlType!.IsSubtypeOf(T.DoubleX), "Must be a singleton Double"); 84Debug.Assert(n != null && n.XmlType!.IsSubtypeOf(T.BooleanX), "Must be a singleton Bool");
System\Xml\Xsl\XPathConvert.cs (2)
1045Debug.Assert(equal, "DblToRgbFast and DblToRgbPrecise should give the same result"); 2857Debug.Assert(('0' & 0xF) == 0, "We use (char)(d |'0') to convert digit to char");
System\Xml\Xsl\Xslt\Compiler.cs (5)
63Debug.Assert(CompilerErrorColl == null, "Compiler cannot be reused"); 76Debug.Assert(Root == null, "Compiler cannot be reused"); 119Debug.Assert(importPrecedence <= oldNsAlias.ImportPrecedence, "Stylesheets must be processed in the order of decreasing import precedence"); 291Debug.Assert(_savedErrorCount == -1, "Nested EnterForwardsCompatible calls"); 298Debug.Assert(_savedErrorCount != -1, "ExitForwardsCompatible without EnterForwardsCompatible");
System\Xml\Xsl\Xslt\CompilerScopeManager.cs (7)
97Debug.Assert(_lastRecord == 0 && _lastScopes == 0, "PushScope() and PopScope() calls are unbalanced"); 111Debug.Assert(nsDecl.Prefix == null, "NS may be null only when prefix is null where it is used for extension-element-prefixes='#all'"); 149Debug.Assert(flag == (flag & ScopeFlags.ExclusiveFlags) && BitOperations.IsPow2((uint)flag), "One exclusive flag"); 150Debug.Assert(uri != null || ncName == null, "null, null means exclude '#all'"); 168Debug.Assert(flag == (flag & ScopeFlags.InheritedFlags) && BitOperations.IsPow2((uint)flag), "one inherited flag"); 193Debug.Assert((_records[_lastRecord].flags & ScopeFlags.CompatibilityFlags) != ScopeFlags.CompatibilityFlags, 414Debug.Assert(LastPredefRecord <= _currentRecord && _currentRecord <= _scope._lastRecord, "MoveNext() either was not called or returned false");
System\Xml\Xsl\Xslt\Focus.cs (7)
68Debug.Assert(_focusType != SingletonFocusType.None, "Focus is not set, call SetFocus first"); 79Debug.Assert(_focusType == SingletonFocusType.Iterator && _current != null, "Unexpected singleton focus type"); 104Debug.Assert(!IsFocusSet, "Focus was already set"); 125Debug.Assert(IsFocusSet, "Focus was not set"); 136Debug.Assert(_current != null, "Naked current() is not expected in this function"); 142Debug.Assert(_position != null, "Naked position() is not expected in this function"); 148Debug.Assert(_last != null, "Naked last() is not expected in this function");
System\Xml\Xsl\Xslt\InvokeGenerator.cs (6)
60Debug.Assert(formalArg.Name.LocalName == "namespaces", "Cur,Pos,Last don't have default values and should be always added to by caller in AddImplicitArgs()"); 61Debug.Assert(formalArg.DefaultValue != null, "PrecompileProtoTemplatesHeaders() set it"); 71Debug.Assert(formalArg.Name!.NamespaceUri != XmlReservedNs.NsXslDebug, "Cur,Pos,Last don't have default values and should be always added to by caller in AddImplicitArgs(). We don't have $namespaces in !debug."); 86Debug.Assert(invokeType == T.ItemS, "Actual argument type is not a subtype of formal argument type"); 132Debug.Assert(_formalArgs![prevArg] != null, "formalArg must be in the list"); 133Debug.Assert(_invokeArgs![prevArg] != null, "This arg should be compiled already");
System\Xml\Xsl\Xslt\KeyMatchBuilder.cs (3)
29Debug.Assert(0 <= _depth && _depth <= 1, "this shouldn't happen"); 41Debug.Assert(0 <= _depth && _depth <= 1, "this shouldn't happen"); 110Debug.Assert(content.Child == _fixup, "Unexpected content node");
System\Xml\Xsl\Xslt\MatcherBuilder.cs (1)
135Debug.Assert(
System\Xml\Xsl\Xslt\OutputScopeManager.cs (1)
149Debug.Assert(0 < record, "first record is lookup barrier, so we don't need to check this condition runtime");
System\Xml\Xsl\Xslt\QilGenerator.cs (18)
234Debug.Assert(!_curLoop.IsFocusSet && !_funcFocus.IsFocusSet, "Must be compiled using singleton focus"); 432Debug.Assert(IsDebug, "This is debug only logic"); 602Debug.Assert((template != null) == (tmpl.SourceLine != null), "Templates must have line information, and attribute sets must not"); 610Debug.Assert(!IsDebug, "In debug mode we don't generate parumWithCalls functions. Otherwise focus flags should be adjusted"); 653Debug.Assert(tmpl is Template, "Only templates can have explicit arguments"); 656Debug.Assert(arg.DefaultValue == null, "Argument must not be compiled yet"); 747Debug.Assert(result != null, "Result of compilation should not be null"); 1216Debug.Assert(!_curLoop.IsFocusSet, "xsl:apply-imports cannot be inside of xsl:for-each"); 1246Debug.Assert(tmpl.Function != null, "All templates should be already compiled"); 1281Debug.Assert(attSet.Function != null, "All templates should be already compiled"); 1421Debug.Assert(result == null, "xsl:otherwise must be the last child of xsl:choose"); 1818Debug.Assert(0 < list.Count, "Pattern should have at least one filter"); 2581Debug.Assert(actualArgs[actArg].NodeType == XslNodeType.WithParam, "All Sorts was removed in CompileSorts()"); 2662Debug.Assert(actualArgs[i].NodeType == XslNodeType.WithParam, "All Sorts was removed in CompileSorts()"); 2689Debug.Assert(actualArgs[0].Name == _nameCurrent, "Caller should always pass $current as a first argument to apply-* calls."); 2753Debug.Assert( 2794Debug.Assert(!IsDebug, "Attempt to override SourceLineInfo in debug mode"); 2886Debug.Assert(_vars.Count == 0, "Accumulated variables left unclaimed");
System\Xml\Xsl\Xslt\QilGeneratorEnv.cs (2)
26Debug.Assert(args == null || args.Length == 0, "Error message must already be composed in res"); 103Debug.Assert(!args.IsReadOnly, "Writable collection expected");
System\Xml\Xsl\Xslt\QilStrConcatenator.cs (3)
46Debug.Assert(_inUse, "Reset() wasn't called"); 52Debug.Assert(_inUse, "Reset() wasn't called"); 58Debug.Assert(_inUse, "Reset() wasn't called");
System\Xml\Xsl\Xslt\Stylesheet.cs (2)
87Debug.Assert(var.Name!.NamespaceUri != null, "Name must be resolved in XsltLoader"); 120Debug.Assert(template.ImportPrecedence <= old.ImportPrecedence, "Global objects are processed in order of decreasing import precedence");
System\Xml\Xsl\Xslt\XPathPatternBuilder.cs (15)
44Debug.Assert(!_inTheBuild, "XPathBuilder is busy!"); 52Debug.Assert(filter.NodeType == QilNodeType.Filter, "XPathPatternBuilder expected to generate list of Filters on top level"); 67Debug.Assert(_inTheBuild, "StartBuild() wasn't called"); 71Debug.Assert(_predicateEnvironment.numFixupCurrent >= 0, "Context fixup error"); 72Debug.Assert(_predicateEnvironment.numFixupPosition >= 0, "Context fixup error"); 73Debug.Assert(_predicateEnvironment.numFixupLast >= 0, "Context fixup error"); 84Debug.Assert(right.NodeType == QilNodeType.Filter, "LocationPathPattern must be compiled into a filter"); 92Debug.Assert(left.NodeType == QilNodeType.Filter, "LocationPathPattern must be compiled into a filter"); 133Debug.Assert(nodeType == XPathNodeType.All && prefix == null && name == null, " // is the only d-o-s axes that we can have in pattern"); 199Debug.Assert(GetLastParent(left) == left, "Left is always single axis and never the step"); 297Debug.Assert( 305Debug.Assert(name == "key", "Unexpected function"); 306Debug.Assert( 376Debug.Assert(context != null, "Predicate always has step so it can't have context == null"); 377Debug.Assert(context.Variable.NodeType == QilNodeType.For, "It shouldn't be Let, becaus predicates in PatternBuilder don't produce cached tuples.");
System\Xml\Xsl\Xslt\XslAstAnalyzer.cs (9)
113Debug.Assert((v.Flags & XslFlags.Stop) == 0, "Already visited this vertex"); 121Debug.Assert((u.Flags & flag) == flag, "Flag was not set on an adjacent vertex"); 347Debug.Assert(_forEachDepth == 0, "xsl:apply-imports cannot be inside of xsl:for-each"); 348Debug.Assert(_currentTemplate is Template, "xsl:apply-imports can only occur within xsl:template"); 356Debug.Assert(node.Select != null, "Absent @select should be replaced with 'node()' in XsltLoader"); 807Debug.Assert((t.Flags & XslFlags.Stop) == 0, "Already visited this vertex"); 816Debug.Assert((u.Flags & XslFlags.SideEffects) == XslFlags.SideEffects, "Flag was not set on an adjacent vertex"); 824Debug.Assert((u.Flags & XslFlags.SideEffects) == XslFlags.SideEffects, "Flag was not set on an adjacent vertex"); 839Debug.Assert((u.Flags & XslFlags.SideEffects) == XslFlags.SideEffects, "Flag was not set on an adjacent vertex");
System\Xml\Xsl\Xslt\XsltInput.cs (16)
77Debug.Assert(tr.Settings == null, "XmlReader created with XmlReader.Create should always expand entities."); 273Debug.Assert(_reader.NodeType == XmlNodeType.Attribute, "reader.NodeType == XmlNodeType.Attribute"); 323Debug.Assert(_reader.NodeType == XmlNodeType.Text, "Unexpected node type inside attribute value"); 348Debug.Assert(_nodeType == XmlNodeType.Element, "To call MoveToFirstChild() XsltInut should be positioned on an Element."); 358Debug.Assert(_nodeType != XmlNodeType.Element || IsEmptyElement, "On non-empty elements we should call MoveToFirstChild()"); 518Debug.Assert(_nodeType == XmlNodeType.Element, "For MoveToElement() we should be positioned on Element or Attribute"); 524Debug.Assert(_nodeType == XmlNodeType.Element, "For MoveToLiteralAttribute() we should be positioned on Element or Attribute"); 539Debug.Assert(_nodeType == XmlNodeType.Element, "For MoveToLiteralAttribute() we should be positioned on Element or Attribute"); 554Debug.Assert(_attributes != null && _attributes[attNum].name == attName, "Attribute numbering error."); 566Debug.Assert(_attributes != null && _attributes[attNum].name == attName, "Attribute numbering error."); 589Debug.Assert(_nodeType == XmlNodeType.Element || _nodeType == XmlNodeType.EndElement, "Input is positioned on element or attribute"); 620Debug.Assert(_nodeType != XmlNodeType.Element || _attributesRead, "Should first read attributes"); 628Debug.Assert(_nodeType != XmlNodeType.Element || _attributesRead, "Should first read attributes"); 637Debug.Assert(_nodeType != XmlNodeType.Element || _attributesRead, "Should first read attributes"); 750Debug.Assert(SS, "First we parse xsl:stylesheet element"); 1099Debug.Assert(Ref.Equal(_atoms.NameTable.Get(nsUri), nsUri), "Namespaces must be atomized");
System\Xml\Xsl\Xslt\XsltLoader.cs (11)
177Debug.Assert(_compiler.Version != 0, "Version should be already decided at this point"); 236Debug.Assert(!_documentUriInUse.Contains(baseUri), "Circular references must be checked while processing xsl:include and xsl:import"); 973Debug.Assert(dummy, "One of the attrs should have lineInfo. If both are default they can't conflict."); 1067Debug.Assert(setName != null, "Required attribute always != null"); 2800Debug.Assert(_input.IsRequiredAttribute(attNum), "It happened that @name as NCName is always required attribute"); 2890Debug.Assert(_input.LocalName == "use-attribute-sets", "we are positioned on this attribute"); 2891Debug.Assert(list != null && list.Count == 0, "It happened that we always add use-attribute-sets first. Otherwise we can't call list.Clear()"); 2954Debug.Assert(!_input.IsRequiredAttribute(attNum), "All Yes/No attributes are optional."); 2974Debug.Assert(!_input.IsRequiredAttribute(attNum), "All 'type' attributes are optional."); 2983Debug.Assert(!_input.IsRequiredAttribute(attNum), "All 'validation' attributes are optional."); 3009Debug.Assert(!_input.IsRequiredAttribute(attNum), "All 'input-type-validation' attributes are optional.");
System\Xml\Xsl\Xslt\XsltQilFactory.cs (4)
28Debug.Assert(xt.IsSingleton && xt.IsStrict, "Xslt assumes that these types will always be singleton and strict"); 34Debug.Assert(IsDebug, "QName is reserved as the marker for missing values"); 45Debug.Assert(n != null && n.XmlType!.IsSubtypeOf(T.QNameX), "Must be a singleton QName"); 121Debug.Assert(value != null && (
System\Xml\Xsl\XsltOld\ActionFrame.cs (3)
113Debug.Assert(!_withParams.Contains(name), "We should check duplicate params at compile time"); 155Debug.Assert(proc.ActionStack.Peek() == this, "the trick we are doing with proc.Current will work only if this is topmost frame"); 327Debug.Assert(index > 0, "MoveNext() wasn't called");
System\Xml\Xsl\XsltOld\BeginEvent.cs (1)
46Debug.Assert(!_replaceNSAliasesDone, "Second attempt to replace NS aliases!. This bad.");
System\Xml\Xsl\XsltOld\Compiler.cs (9)
551Debug.Assert(!_documentURIs.Contains(href), "Circular references must be checked while processing xsl:include and xsl:import"); 557Debug.Assert(_documentURIs.Contains(href), "Attempt to remove href that was not added"); 805Debug.Assert(avt.Length != start, "Empty string not supposed here"); 806Debug.Assert(lex.Length == 0, "Builder should to be reset here"); 845Debug.Assert(avt.Length != start, "Empty string not supposed here"); 846Debug.Assert(lex.Length == 0, "Builder should to be reset here"); 847Debug.Assert(avt[start] == '{', "We calling getXPathLex() only after we really meet {"); 915Debug.Assert(saveStart < start, "We have to read something. Otherwise it's dead loop."); 944Debug.Assert(!constant || list.Count <= 1, "We can't have more then 1 text event if now {avt} found");
System\Xml\Xsl\XsltOld\InputScopeManager.cs (7)
59Debug.Assert(_scopeStack != null, "Push/Pop disbalance"); 75Debug.Assert(_scopeStack != null, "PushScope wasn't called"); 95Debug.Assert(_scopeStack != null, "PushScope wasn't called"); 139Debug.Assert(_scopeStack != null, "PushScope wasn't called"); 149Debug.Assert(_scopeStack != null, "PushScope wasn't called"); 162Debug.Assert(_scopeStack != null, "PushScope wasn't called"); 172Debug.Assert(_scopeStack != null, "PushScope wasn't called");
System\Xml\Xsl\XsltOld\Processor.cs (11)
142Debug.Assert(_resolver != null, "Constructor should create it if null passed"); 151Debug.Assert(_sortArray != null, "InitSortArray() wasn't called"); 202Debug.Assert(_sortArray != null, "InitSortArray() wasn't called"); 828Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State, 1019Debug.Assert(result != null, "Variable was just calculated and result can't be null"); 1058Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger"); 1070Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger"); 1076Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger"); 1078Debug.Assert(dbgFrame != null, "PushDebuggerStack() wasn't ever called"); 1085Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger"); 1092Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger");
System\Xml\Xsl\XsltOld\ReaderOutput.cs (1)
344Debug.Assert(Value.Length != 0, "It whould be Whitespace in this case");
System\Xml\Xsl\XsltOld\SequentialOutput.cs (7)
162Debug.Assert(!_isHtmlOutput || mainNode.Prefix != null, "Html can't have abbreviated elements"); 213Debug.Assert(i < node.TextInfoCount, "disableEscaping marker can't be last TextInfo record"); 232Debug.Assert(_outputDoctype, "It supposed to check this condition before actual call"); 233Debug.Assert(_output.DoctypeSystem != null || (_isHtmlOutput && _output.DoctypePublic != null), "We set outputDoctype == true only if"); 267Debug.Assert(_outputXmlDecl, "It supposed to check this condition before actual call"); 268Debug.Assert(_isXmlOutput && !_output.OmitXmlDeclaration, "We set outputXmlDecl == true only if"); 660Debug.Assert(0 <= i, "find char wasn't really find");
System\Xml\Xsl\XsltOld\TemplateAction.cs (1)
139Debug.Assert(!(union.qy2 is UnionExpr), "only qy1 can be union");
System\Xml\Xsl\XsltOld\XsltCompileContext.cs (3)
329Debug.Assert( 344Debug.Assert( 995Debug.Assert(args.Length <= this.Minargs, "We are checking this on resolve time");
System.Private.Xml.Linq (13)
System\Xml\Linq\XContainer.cs (2)
1059Debug.Assert(e != null, "EndElement received but the current container is not an element."); 1175Debug.Assert(e != null, "EndElement received but the current container is not an element.");
System\Xml\Linq\XHashtable.cs (5)
147Debug.Assert(BitOperations.IsPow2(capacity), "capacity must be a power of 2"); 148Debug.Assert(extractKey != null, "extractKey may not be null"); 200Debug.Assert(entryIdx == EndOfList, "Resize() should only be called by one thread"); 232Debug.Assert(entryIdx == FullList, "Linked list should have been closed when it was counted"); 398Debug.Assert(key != null, "key should have been checked previously for null");
System\Xml\Linq\XNamespace.cs (5)
217Debug.Assert(index >= 0 && index <= localName.Length, "Caller should have checked that index was in bounds"); 218Debug.Assert(count >= 0 && index + count <= localName.Length, "Caller should have checked that count was in bounds"); 235Debug.Assert(index >= 0 && index <= namespaceName.Length, "Caller should have checked that index was in bounds"); 236Debug.Assert(count >= 0 && index + count <= namespaceName.Length, "Caller should have checked that count was in bounds"); 274Debug.Assert(n != null, "Null name should never exist here");
System\Xml\Linq\XNodeReader.cs (1)
1386Debug.Assert(_omitDuplicateNamespaces, "This method should only be called if we're omitting duplicate namespace attribute. For perf reason it's better to test this flag in the caller method.");
System.Reflection.Emit (3)
System\Reflection\Emit\ILGeneratorImpl.cs (3)
407Debug.Assert(opcode.Equals(OpCodes.Call) || 416Debug.Assert(opcode.Equals(OpCodes.Call) || 552Debug.Assert(opcode.Equals(OpCodes.Calli), "Unexpected opcode encountered for StackBehaviour VarPop.");
System.Reflection.Metadata (11)
src\libraries\Common\src\System\HexConverter.cs (2)
332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Reflection\Metadata\BlobReader.cs (1)
137Debug.Assert((alignment & (alignment - 1)) == 0, "Alignment must be a power of two.");
System\Reflection\Metadata\Internal\StringHeap.cs (3)
291Debug.Assert(rawHandle.StringKind != StringKind.DotTerminated, "Not supported"); 310Debug.Assert(rawHandle.StringKind != StringKind.DotTerminated, "Not supported"); 320Debug.Assert(rawHandle.StringKind != StringKind.DotTerminated, "Not supported");
System\Reflection\Metadata\TypeNameParser.cs (1)
240Debug.Assert(nestedNameLength > 0, "TryGetTypeNameInfo should return error on zero lengths");
System\Reflection\Metadata\TypeSystem\AssemblyReference.cs (1)
175Debug.Assert(false, "Unexpected virtual index value");
System\Reflection\Metadata\TypeSystem\TypeReference.cs (2)
112Debug.Assert(false, "Unknown TypeRef treatment"); 140Debug.Assert(false, "Unknown TypeRef treatment");
System.Reflection.MetadataLoadContext (2)
System\Reflection\Runtime\General\ListBuilder.cs (1)
38Debug.Assert(!_toArrayAlreadyCalled, "Cannot call ListBuilder.ToArray() a second time. Copy the one you already got.");
System\Reflection\TypeLoading\General\Helpers.cs (1)
232Debug.Assert(ns != null, "For top level types, the namespace must be string.Empty, not null");
System.Resources.Extensions (30)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (4)
294Debug.Assert(resMgrHeaderBlob.Length > 0, "ResourceWriter: Expected non empty header"); 388Debug.Assert((bw.BaseStream.Position & 7) == 0, "ResourceWriter: Name hashes array won't be 8 byte aligned! Ack!"); 399Debug.Assert((bw.BaseStream.Position & 3) == 0, "ResourceWriter: Name positions array won't be 4 byte aligned! Ack!"); 425Debug.Assert(startOfDataSection == bw.Seek(0, SeekOrigin.Current), "ResourceWriter::Generate - start of data section is wrong!");
src\libraries\System.Private.CoreLib\src\System\IO\PinnedBufferMemoryStream.cs (1)
19Debug.Assert(array != null, "Array can't be null");
src\libraries\System.Private.CoreLib\src\System\Resources\FastResourceComparer.cs (5)
75Debug.Assert(a != null && bytes != null, "FastResourceComparer::CompareOrdinal must have non-null params"); 76Debug.Assert(bCharLength * 2 <= bytes.Length, "FastResourceComparer::CompareOrdinal - numChars is too big!"); 111Debug.Assert((byteLen & 1) == 0, "CompareOrdinal is expecting a UTF-16 string length, which must be even!"); 112Debug.Assert(a != null && b != null, "Null args not allowed."); 113Debug.Assert(byteLen >= 0, "byteLen must be non-negative.");
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (20)
46Debug.Assert(value >= 0, "negative ResourceTypeCode. What?"); 201Debug.Assert(_nameHashes != null && _nameHashesPtr == null, "Internal state mangled."); 206Debug.Assert(_nameHashes == null && _nameHashesPtr != null, "Internal state mangled."); 217Debug.Assert(_namePositions != null && _namePositionsPtr == null, "Internal state mangled."); 222Debug.Assert(_namePositions == null && _namePositionsPtr != null, "Internal state mangled."); 258Debug.Assert(_store != null, "ResourceReader is closed!"); 339Debug.Assert(_store != null, "ResourceReader is closed!"); 382Debug.Assert(_store != null, "ResourceReader is closed!"); 453Debug.Assert(_store != null, "ResourceReader is closed!"); 477Debug.Assert(_store != null, "ResourceReader is closed!"); 539Debug.Assert(_store != null, "ResourceReader is closed!"); 540Debug.Assert(_version == 1, ".resources file was not a V1 .resources file!"); 621Debug.Assert(_store != null, "ResourceReader is closed!"); 622Debug.Assert(_version >= 2, ".resources file was not a V2 (or higher) .resources file!"); 729Debug.Assert(r == len, "ResourceReader needs to use a blocking read here. (Call _store.ReadBytes(len)?)"); 782Debug.Assert(_store != null, "ResourceReader is closed!"); 1001Debug.Assert(_typeTable[typeIndex] != null, "Should have found a type!"); 1032Debug.Assert(typeCode >= 0, "can't be negative"); 1037Debug.Assert(!string.Equals(typeCode.ToString(), "LastPrimitive"), "Change ResourceTypeCode metadata order so LastPrimitive isn't what Enum.ToString prefers."); 1043Debug.Assert(typeIndex >= 0 && typeIndex < _typeTable.Length, "TypeCode is broken or corrupted!");
System.Resources.Writer (4)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (4)
294Debug.Assert(resMgrHeaderBlob.Length > 0, "ResourceWriter: Expected non empty header"); 388Debug.Assert((bw.BaseStream.Position & 7) == 0, "ResourceWriter: Name hashes array won't be 8 byte aligned! Ack!"); 399Debug.Assert((bw.BaseStream.Position & 3) == 0, "ResourceWriter: Name positions array won't be 4 byte aligned! Ack!"); 425Debug.Assert(startOfDataSection == bw.Seek(0, SeekOrigin.Current), "ResourceWriter::Generate - start of data section is wrong!");
System.Runtime.Caching (117)
System\Runtime\Caching\CacheExpires.cs (47)
27Debug.Assert((pageIndex & 0x00ffffff) == pageIndex, "(pageIndex & 0x00ffffff) == pageIndex"); 28Debug.Assert((entryIndex & ENTRY_MASK) == entryIndex, "(entryIndex & ENTRY_MASK) == entryIndex"); 29Debug.Assert(entryIndex != 0 || pageIndex == 0, "entryIndex != 0 || pageIndex == 0"); 118Debug.Assert(_cPagesInUse == 0, "_cPagesInUse == 0"); 119Debug.Assert(_cEntriesInUse == 0, "_cEntriesInUse == 0"); 120Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0"); 182Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)"); 188Debug.Assert((_pages[(list._head)]._pagePrev) == -1, "PagePrev(list._head) == -1"); 201Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)"); 207Debug.Assert((_pages[(list._tail)]._pageNext) == -1, "PageNext(list._tail) == -1"); 220Debug.Assert(list._head != -1, "list._head != -1"); 229Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)"); 233Debug.Assert((_pages[((_pages[(pageIndex)]._pagePrev))]._pageNext) == pageIndex, "PageNext(PagePrev(pageIndex)) == pageIndex"); 238Debug.Assert(list._head == pageIndex, "list._head == pageIndex"); 244Debug.Assert((_pages[((_pages[(pageIndex)]._pageNext))]._pagePrev) == pageIndex, "PagePrev(PageNext(pageIndex)) == pageIndex"); 249Debug.Assert(list._tail == pageIndex, "list._tail == pageIndex"); 259Debug.Assert(list._head != -1, "list._head != -1"); 260Debug.Assert(list._tail != -1, "list._tail != -1"); 272Debug.Assert(list._head != -1, "list._head != -1"); 273Debug.Assert(list._tail != -1, "list._tail != -1"); 293Debug.Assert(capacity > 0, "capacity > 0"); 294Debug.Assert(MIN_LOAD_FACTOR < 1.0, "MIN_LOAD_FACTOR < 1.0"); 307Debug.Assert((((_pages[(pageIndex)]._entries))[0]._cFree) == NUM_ENTRIES, "FreeEntryCount(EntriesI(pageIndex)) == NUM_ENTRIES"); 312Debug.Assert((_pages[(pageIndex)]._entries) != null, "EntriesI(pageIndex) != null"); 328Debug.Assert(_freeEntryList._head >= 0, "_freeEntryList._head >= 0"); 338Debug.Assert(((entries)[0]._next).IsInvalid, "FreeEntryHead(entries).IsInvalid"); 349Debug.Assert(entries[entryIndex]._cacheEntry == null, "entries[entryIndex]._cacheEntry == null"); 370Debug.Assert(_cPagesInUse * NUM_ENTRIES == _cEntriesInUse, "_cPagesInUse * NUM_ENTRIES == _cEntriesInUse"); 371Debug.Assert(_freeEntryList._head == -1, "_freeEntryList._head == -1"); 372Debug.Assert(_freeEntryList._tail == -1, "_freeEntryList._tail == -1"); 386Debug.Assert(_cPagesInUse == oldLength, "_cPagesInUse == oldLength"); 387Debug.Assert(_cEntriesInUse == oldLength * NUM_ENTRIES, "_cEntriesInUse == oldLength * ExpiresEntryRef.NUM_ENTRIES"); 392Debug.Assert(newLength > oldLength, "newLength > oldLength"); 439Debug.Assert(_freeEntryList._head != -1, "_freeEntryList._head != -1"); 440Debug.Assert(_freeEntryList._tail != -1, "_freeEntryList._tail != -1"); 441Debug.Assert(_freeEntryList._head != _freeEntryList._tail, "_freeEntryList._head != _freeEntryList._tail"); 476Debug.Assert(((entries)[0]._cFree) > 0, "FreeEntryCount(entries) > 0"); 486Debug.Assert(_freeEntryList._head != _freeEntryList._tail, "_freeEntryList._head != _freeEntryList._tail"); 488Debug.Assert(newRef.PageIndex != _freeEntryList._tail, "newRef.PageIndex != _freeEntryList._tail"); 512Debug.Assert((cacheEntry.ExpiresBucket == 0xff) == entryRef.IsInvalid, "(cacheEntry.ExpiresBucket == 0xff) == entryRef.IsInvalid"); 522Debug.Assert(cacheEntry.ExpiresBucket == 0xff, "cacheEntry.ExpiresBucket == 0xff"); 523Debug.Assert(cacheEntry.ExpiresEntryRef.IsInvalid, "cacheEntry.ExpiresEntryRef.IsInvalid"); 610Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0"); 628Debug.Assert(_blockReduce == false, "_blockReduce == false"); 695Debug.Assert(!inFlushHead.IsInvalid, "!inFlushHead.IsInvalid"); 709Debug.Assert(cacheEntry.ExpiresEntryRef.IsInvalid, "cacheEntry.ExpiresEntryRef.IsInvalid"); 738Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0");
System\Runtime\Caching\CacheUsage.cs (59)
27Debug.Assert((pageIndex & 0x00ffffff) == pageIndex, "(pageIndex & 0x00ffffff) == pageIndex"); 28Debug.Assert((Math.Abs(entryIndex) & ENTRY_MASK) == (Math.Abs(entryIndex)), "(Math.Abs(entryIndex) & ENTRY_MASK) == Math.Abs(entryIndex)"); 29Debug.Assert(entryIndex != 0 || pageIndex == 0, "entryIndex != 0 || pageIndex == 0"); 52Debug.Assert(result > 0, "result > 0"); 62Debug.Assert(result < 0, "result < 0"); 148Debug.Assert(_cPagesInUse == 0, "_cPagesInUse == 0"); 149Debug.Assert(_cEntriesInUse == 0, "_cEntriesInUse == 0"); 150Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0"); 151Debug.Assert(_lastRefHead.IsInvalid, "_lastRefHead.IsInvalid"); 152Debug.Assert(_lastRefTail.IsInvalid, "_lastRefTail.IsInvalid"); 153Debug.Assert(_addRef2Head.IsInvalid, "_addRef2Head.IsInvalid"); 165Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)"); 171Debug.Assert((_pages[(list._head)]._pagePrev) == -1, "PagePrev(list._head) == -1"); 184Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)"); 190Debug.Assert((_pages[(list._tail)]._pageNext) == -1, "PageNext(list._tail) == -1"); 203Debug.Assert(list._head != -1, "list._head != -1"); 212Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)"); 216Debug.Assert((_pages[((_pages[(pageIndex)]._pagePrev))]._pageNext) == pageIndex, "PageNext(PagePrev(pageIndex)) == pageIndex"); 221Debug.Assert(list._head == pageIndex, "list._head == pageIndex"); 227Debug.Assert((_pages[((_pages[(pageIndex)]._pageNext))]._pagePrev) == pageIndex, "PagePrev(PageNext(pageIndex)) == pageIndex"); 232Debug.Assert(list._tail == pageIndex, "list._tail == pageIndex"); 242Debug.Assert(list._head != -1, "list._head != -1"); 243Debug.Assert(list._tail != -1, "list._tail != -1"); 254Debug.Assert(list._head != -1, "list._head != -1"); 255Debug.Assert(list._tail != -1, "list._tail != -1"); 273Debug.Assert(capacity > 0, "capacity > 0"); 274Debug.Assert(MIN_LOAD_FACTOR < 1.0, "MIN_LOAD_FACTOR < 1.0"); 287Debug.Assert((((_pages[(pageIndex)]._entries))[0]._cFree) == NUM_ENTRIES, "FreeEntryCount(EntriesI(pageIndex)) == NUM_ENTRIES"); 292Debug.Assert((_pages[(pageIndex)]._entries) != null, "EntriesI(pageIndex) != null"); 308Debug.Assert(_freeEntryList._head >= 0, "_freeEntryList._head >= 0"); 318Debug.Assert(((entries)[0]._ref1._next).IsInvalid, "FreeEntryHead(entries).IsInvalid"); 326Debug.Assert(entryRef.IsRef1, "entryRef.IsRef1"); 331Debug.Assert(entries[entryIndex]._cacheEntry == null, "entries[entryIndex]._cacheEntry == null"); 355Debug.Assert(_cPagesInUse * NUM_ENTRIES == _cEntriesInUse, "_cPagesInUse * NUM_ENTRIES == _cEntriesInUse"); 356Debug.Assert(_freeEntryList._head == -1, "_freeEntryList._head == -1"); 357Debug.Assert(_freeEntryList._tail == -1, "_freeEntryList._tail == -1"); 371Debug.Assert(_cPagesInUse == oldLength, "_cPagesInUse == oldLength"); 372Debug.Assert(_cEntriesInUse == oldLength * NUM_ENTRIES, "_cEntriesInUse == oldLength * ExpiresEntryRef.NUM_ENTRIES"); 377Debug.Assert(newLength > oldLength, "newLength > oldLength"); 424Debug.Assert(_freeEntryList._head != -1, "_freeEntryList._head != -1"); 425Debug.Assert(_freeEntryList._tail != -1, "_freeEntryList._tail != -1"); 426Debug.Assert(_freeEntryList._head != _freeEntryList._tail, "_freeEntryList._head != _freeEntryList._tail"); 459Debug.Assert(((entries)[0]._cFree) > 0, "FreeEntryCount(entries) > 0"); 469Debug.Assert(_freeEntryList._head != _freeEntryList._tail, "_freeEntryList._head != _freeEntryList._tail"); 472Debug.Assert(newRef1.PageIndex != _freeEntryList._tail, "newRef1.PageIndex != _freeEntryList._tail"); 478Debug.Assert(cacheEntry.UsageEntryRef == oldRef1, "cacheEntry.UsageEntryRef == oldRef1"); 487Debug.Assert(prev != oldRef2, "prev != oldRef2"); 505Debug.Assert(next != oldRef1, "next != oldRef1"); 531Debug.Assert(cacheEntry.UsageEntryRef.IsInvalid, "cacheEntry.UsageEntryRef.IsInvalid"); 583Debug.Assert(entryRef.IsRef1, "entryRef.IsRef1"); 683Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0"); 700Debug.Assert(_blockReduce == false, "_blockReduce == false"); 709Debug.Assert(_cEntriesInUse > 0, "_cEntriesInUse > 0"); 723Debug.Assert(utcDate != DateTime.MinValue, "utcDate != DateTime.MinValue"); 731Debug.Assert(cacheEntry.UsageEntryRef == prev1, "cacheEntry.UsageEntryRef == prev1"); 761Debug.Assert(!inFlushHead.IsInvalid, "!inFlushHead.IsInvalid"); 775Debug.Assert(cacheEntry.UsageEntryRef.IsInvalid, "cacheEntry.UsageEntryRef.IsInvalid"); 801Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0"); 851Debug.Assert(bucket != 0xff, "bucket != 0xff");
System\Runtime\Caching\ChangeMonitor.cs (3)
145Debug.Assert(_flags[INITIALIZED], "It is critical that INITIALIZED is set before CHANGED is checked below"); 162Debug.Assert(_flags[CHANGED], "It is critical that CHANGED is set before INITIALIZED is checked below."); 208Debug.Assert(_flags[CHANGED], "It is critical that CHANGED is set before INITIALIZED is checked below.");
System\Runtime\Caching\MemoryCacheEntry.cs (1)
257Debug.Assert(_fields._dependents == null, "_fields._dependents == null");
System\Runtime\Caching\MemoryCacheEntryChangeMonitor.cs (1)
136Debug.Assert(keys != null && keys.Count > 0, "keys != null && keys.Count > 0");
System\Runtime\Caching\MemoryCacheStore.cs (3)
111Debug.Assert(entry.State == EntryState.RemovingFromCache, "entry.State = EntryState.RemovingFromCache"); 281Debug.Assert(_useInsertBlock == false, "_useInsertBlock == false"); 375Debug.Assert(percent <= 100, "percent <= 100");
System\Runtime\Caching\MemoryMonitor.cs (3)
61Debug.Assert(_pressureHigh > 0, "_pressureHigh > 0"); 62Debug.Assert(_pressureLow > 0, "_pressureLow > 0"); 63Debug.Assert(_pressureLow <= _pressureHigh, "_pressureLow <= _pressureHigh");
System.Runtime.Numerics (14)
src\libraries\Common\src\System\HexConverter.cs (2)
332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Number.Formatting.Common.cs (1)
820Debug.Assert(p >= spanPtr - 1, "Underflow");
src\libraries\Common\src\System\Number.NumberBuffer.cs (3)
68Debug.Assert(Digits[0] != '0', "Leading zeros should never be stored in a Number"); 83Debug.Assert(numDigits == DigitsCount, "Null terminator found in unexpected location in Number"); 84Debug.Assert(numDigits < Digits.Length, "Null terminator not found in Number");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\FormattingHelpers.CountDigits.cs (1)
103Debug.Assert(table.Length == 32, "Every result of uint.Log2(value) needs a long entry in the table.");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (1)
91Debug.Assert(index == 0, "Implementation currently only supports index == 0");
System\Number.BigInteger.cs (1)
1036Debug.Assert(base1E9Value[^1] != 0, "Leading zeros should be trimmed by caller.");
System\Numerics\BigInteger.cs (4)
1319Debug.Assert(mode == GetBytesMode.Span || destination.IsEmpty, $"If we're not in span mode, we shouldn't have been passed a destination."); 1639Debug.Assert(!(trivialLeft && trivialRight), "Trivial cases should be handled on the caller operator"); 1717Debug.Assert(!(trivialLeft && trivialRight), "Trivial cases should be handled on the caller operator"); 2692Debug.Assert(!(trivialLeft && trivialRight), "Trivial cases should be handled on the caller operator");
System.Runtime.Serialization.Formatters (46)
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (1)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
System\Runtime\Serialization\Formatters\Binary\BinaryObjectReader.cs (1)
157Debug.Assert(index < _crossAppDomainArray.Length, "[System.Runtime.Serialization.Formatters.BinaryObjectReader index out of range for CrossAppDomainArray]");
System\Runtime\Serialization\Formatters\Binary\BinaryParser.cs (1)
879Debug.Assert((pr._newObj != null), "[BinaryParser expected a Primitive Array]");
System\Runtime\Serialization\Formatters\Binary\BinaryTypeConverter.cs (4)
68Debug.Assert(objectInfo != null, "[BinaryConverter.GetBinaryTypeInfo]objectInfo null for user object"); 140Debug.Assert(typeInformation != null, "[BinaryConverter.WriteTypeInfo]typeInformation!=null"); 149Debug.Assert(typeInformation != null, "[BinaryConverter.WriteTypeInfo]typeInformation!=null"); 153Debug.Assert(typeInformation != null, "[BinaryConverter.WriteTypeInfo]typeInformation!=null");
System\Runtime\Serialization\Formatters\Binary\Converter.cs (1)
329Debug.Assert((code != InternalPrimitiveTypeE.Invalid), "[Converter.FromString]!InternalPrimitiveTypeE.Invalid ");
System\Runtime\Serialization\ObjectManager.cs (36)
89Debug.Assert(holder != null, "holder!=null"); 90Debug.Assert(holder._id >= 0, "holder.m_id>=0"); 176Debug.Assert(holder.RequiresSerInfoFixup, "[ObjectManager.FixupSpecialObject]holder.HasSurrogate||holder.HasISerializable"); 180Debug.Assert(surrogate != null, "surrogate!=null"); 197Debug.Assert(holder.ObjectValue is ISerializable, "holder.m_object is ISerializable"); 224Debug.Assert(holder.IsIncompleteObjectReference, "holder.IsIncompleteObjectReference"); 284Debug.Assert(holder != null, "[TypedReferenceBuilder.ctor]holder!=null"); 285Debug.Assert(holder.RequiresValueTypeFixup, "[TypedReferenceBuilder.ctor]holder.RequiresValueTypeFixup"); 333Debug.Assert(currFixup.ParentIndex != null, "[ObjectManager.DoValueTypeFixup]currFixup.ParentIndex!=null"); 346Debug.Assert(fixupObj != null, "[ObjectManager.DoValueTypeFixup]FixupObj!=null"); 362Debug.Assert(fixupObj != null, "[ObjectManager.DoValueTypeFixup]fixupObj!=null"); 408Debug.Assert(holder != null, "[ObjectManager.CompleteObject]holder.m_object!=null"); 437Debug.Assert(fixups._values[i]!._fixupType == FixupHolder.DelayedFixup, "fixups.m_values[i].m_fixupType==FixupHolder.DelayedFixup"); 499Debug.Assert(holder.ObjectValue is Array, "holder.ObjectValue is Array"); 510Debug.Assert(fixupInfo is MemberInfo, "fixupInfo is MemberInfo"); 597Debug.Assert(temp.DirectlyDependentObjects > 0, "temp.m_missingElementsRemaining>0"); 654Debug.Assert(member == null || member is FieldInfo, "RegisterString - member is FieldInfo"); 859Debug.Assert(_fixupCount >= 0, "[ObjectManager.DoFixups]m_fixupCount>=0"); 1044Debug.Assert(objID >= 0, "objID>=0"); 1081Debug.Assert(objID >= 0, "objID>=0"); 1127Debug.Assert(_dependentObjects != null, "[ObjectHolder.RemoveDependency]m_dependentObjects!=null"); 1128Debug.Assert(id >= 0, "[ObjectHolder.RemoveDependency]id>=0"); 1168Debug.Assert(holder != null, "[ObjectHolder.UpdateTotalDependencyChain]holder!=null"); 1203Debug.Assert(obj != null, "obj!=null"); 1204Debug.Assert(_id > 0, "m_id>0"); 1390Debug.Assert(id > 0, "id>0"); 1391Debug.Assert(fixupInfo != null, "fixupInfo!=null"); 1392Debug.Assert(fixupType == ArrayFixup || fixupType == MemberFixup || fixupType == DelayedFixup, "fixupType==ArrayFixup || fixupType == MemberFixup || fixupType==DelayedFixup"); 1486Debug.Assert(_currentItem != -1, "[LongList.Current]m_currentItem!=-1"); 1487Debug.Assert(_values[_currentItem] != -1, "[LongList.Current]m_values[m_currentItem]!=-1"); 1537Debug.Assert(startingSize > 0 && startingSize < 0x1000, "startingSize>0 && startingSize<0x1000"); 1580Debug.Assert(list != null, "[ObjectHolderListEnumerator.ctor]list!=null"); 1589Debug.Assert(_startingVersion == _list.Version, "[ObjectHolderListEnumerator.MoveNext]m_startingVersion==m_list.Version"); 1606Debug.Assert(_currPos != -1, "[ObjectHolderListEnumerator.Current]m_currPos!=-1"); 1607Debug.Assert(_currPos < _list.Count, "[ObjectHolderListEnumerator.Current]m_currPos<m_list.Count"); 1608Debug.Assert(_startingVersion == _list.Version, "[ObjectHolderListEnumerator.Current]m_startingVersion==m_list.Version");
System\Runtime\Serialization\SerializationEventsCache.cs (1)
77Debug.Assert(obj != null, "object should have been initialized");
System\Runtime\Serialization\SurrogateSelector.cs (1)
26Debug.Assert(selector != null, "[HasCycle]selector!=null");
System.Security.Cryptography (47)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs (2)
72Debug.Assert(bytesNeeded != 0, "OBJ_obj2txt reported a zero-length response"); 92Debug.Assert(
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs (1)
135Debug.Assert(verifyTime.Kind != DateTimeKind.Utc, "UTC verifyTime should have been normalized to Local");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Dsa.cs (1)
92Debug.Assert(
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (1)
83Debug.Assert(error <= uint.MaxValue, "ErrGetError should only return error codes in the UInt32 range.");
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs (2)
50Debug.Assert(_parent == null, "Expected no existing parent"); 51Debug.Assert(parent != null && !parent.IsInvalid, "Expected new parent to be non-null and valid");
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (1)
53Debug.Assert(!isCachedInvalidHandle || handle.IsInvalid, "The cached invalid handle must still be invalid.");
src\libraries\Common\src\System\HexConverter.cs (2)
332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Security\Cryptography\ECOpenSsl.cs (4)
48Debug.Assert(currentKey != null, "null TODO"); 73Debug.Assert(key != null, "key != null"); 74Debug.Assert(!key.IsInvalid, "!key.IsInvalid"); 75Debug.Assert(!key.IsClosed, "!key.IsClosed");
src\libraries\Common\src\System\Security\Cryptography\KdfWorkLimiter.cs (2)
17Debug.Assert(t_state == null, "This method is not intended to be called recursively."); 25Debug.Assert(t_state != null, "This method should only be called within a protected block.");
src\libraries\Common\src\System\Security\Cryptography\KeyFormatHelper.cs (2)
170Debug.Assert(algorithmIdentifierLength > 0, "algorithmIdentifier was empty"); 171Debug.Assert(privateKeyLength > 0, "privateKey was empty");
src\libraries\Common\src\System\Security\Cryptography\SP800108HmacCounterKdfImplementationManaged.cs (1)
94Debug.Assert(newReferenceCount >= 0, newReferenceCount.ToString());
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Security\Cryptography\CryptoStream.cs (2)
144Debug.Assert(_outputBufferIndex == 0, "The output index can only ever be non-zero when in read mode."); 563Debug.Assert(_outputBufferIndex == 0, "The output index can only ever be non-zero when in read mode.");
System\Security\Cryptography\CspParameters.cs (1)
31Debug.Assert((CspProviderFlags.UseMachineKeyStore |
System\Security\Cryptography\Helpers.cs (2)
122Debug.Assert(index < cbHex, "index < cbHex"); 133Debug.Assert(index == cbHex, "index == cbHex");
System\Security\Cryptography\HKDF.cs (4)
180Debug.Assert(hashLength <= 512 / 8, "hashLength is larger than expected, consider increasing this value or using regular allocation"); 215Debug.Assert(hashLength <= 512 / 8, "hashLength is larger than expected, consider increasing this value or using regular allocation"); 253Debug.Assert(hashLength <= 512 / 8, "hashLength is larger than expected, consider increasing this value or using regular allocation"); 264Debug.Assert(false, "HMAC operation failed unexpectedly");
System\Security\Cryptography\OidLookup.OpenSsl.cs (1)
26Debug.Assert(friendlyNamePtr != IntPtr.Zero, "friendlyNamePtr != IntPtr.Zero");
System\Security\Cryptography\Rfc2898DeriveBytes.cs (1)
204Debug.Assert(_startIndex == 0 && _endIndex == 0, "Invalid start or end index in the internal buffer.");
System\Security\Cryptography\UniversalCryptoDecryptor.cs (2)
54Debug.Assert(inputBuffer.Length >= _heldoverCipher.Length, "inputBuffer.Length >= _heldoverCipher.Length"); 57Debug.Assert(inputBuffer.Length % InputBlockSize == 0, "Did not remove whole blocks for depadding");
System\Security\Cryptography\X509Certificates\ChainPal.OpenSsl.cs (2)
196Debug.Assert(reportedLeaf != null, "reportedLeaf != null"); 197Debug.Assert(!ReferenceEquals(cert, reportedLeaf.Pal), "!ReferenceEquals(cert, reportedLeaf.Pal)");
System\Security\Cryptography\X509Certificates\OpenSslCachedSystemStoreProvider.cs (3)
111Debug.Assert( 141Debug.Assert( 306Debug.Assert(
System\Security\Cryptography\X509Certificates\OpenSslCrlCache.cs (1)
164Debug.Assert(
System\Security\Cryptography\X509Certificates\OpenSslDirectoryBasedStoreProvider.cs (1)
34Debug.Assert(
System\Security\Cryptography\X509Certificates\OpenSslX509CertificateReader.cs (2)
793Debug.Assert( 796Debug.Assert(
System\Security\Cryptography\X509Certificates\OpenSslX509ChainProcessor.cs (2)
678Debug.Assert(!verify, "verify should have returned false for signature error"); 692Debug.Assert(verify, "verify should have returned true");
System\Security\Cryptography\X509Certificates\X500RelativeDistinguishedName.cs (1)
64Debug.Assert(overlaps, "AsnValueReader.ReadEncodedValue returns a slice of the source");
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (1)
1333Debug.Assert(firstDot != 0, "Leading periods should have been rejected.");
System\Security\Cryptography\X509Certificates\X509ChainElementCollection.cs (1)
21Debug.Assert(chainElements != null, "chainElements != null");
System.Security.Cryptography.Cose (3)
src\libraries\System.Formats.Cbor\src\System\Formats\Cbor\CborInitialByte.cs (2)
47Debug.Assert((byte)majorType < 8, "CBOR Major Type is out of range"); 48Debug.Assert((byte)additionalInfo < 32, "CBOR initial byte additional info is out of range");
System\Security\Cryptography\Cose\CoseSigner.cs (1)
157Debug.Assert(alg.HasValue, "Algorithm (alg) is a known header and should have been validated in Set[Encoded]Value()");
System.Text.Encoding.CodePages (149)
System\Text\BaseCodePageEncoding.cs (7)
105Debug.Assert(stream is UnmanagedMemoryStream, "UnmanagedMemoryStream will read a full buffer on one call to Read."); 143Debug.Assert(stream is UnmanagedMemoryStream, "UnmanagedMemoryStream will read a full buffer on one call to Read."); 189Debug.Assert(stream is UnmanagedMemoryStream, "UnmanagedMemoryStream will read a full buffer on one call to Read."); 230Debug.Assert(tableName != null, "table name can not be null"); 266Debug.Assert(m_codePageHeader != null && m_codePageHeader.Length == CODEPAGE_HEADER_SIZE, "m_codePageHeader expected to match in size the struct CodePageHeader"); 385Debug.Assert(arrayUnicodeBestFit != null, "[BaseCodePageEncoding.GetBestFitUnicodeToBytesData]Expected non-null arrayUnicodeBestFit"); 396Debug.Assert(arrayBytesBestFit != null, "[BaseCodePageEncoding.GetBestFitBytesToUnicodeData]Expected non-null arrayBytesBestFit");
System\Text\BaseCodePageEncoding.netcoreapp.cs (1)
16Debug.Assert(stream is UnmanagedMemoryStream, "UnmanagedMemoryStream will read a full buffer on one call to Read.");
System\Text\DBCSCodePageEncoding.cs (37)
94Debug.Assert(pCodePage->CodePage == dataTableCodePage, 116Debug.Assert(_bytesUnknown == 0x3f, 139Debug.Assert(bytesRead == m_dataSize, "s_codePagesEncodingDataStream.Read should have read a full buffer."); 179Debug.Assert(bytePosition < 0x100, "[DBCSCodePageEncoding.LoadManagedCodePage]expected lead byte to be < 0x100"); 262Debug.Assert(bytesRead == m_dataSize, "s_codePagesEncodingDataStream.Read should have read a full buffer."); 525Debug.Assert(count >= 0, "[DBCSCodePageEncoding.GetByteCount]count is negative"); 526Debug.Assert(chars != null, "[DBCSCodePageEncoding.GetByteCount]chars is null"); 529Debug.Assert(EncoderFallback != null, "[DBCSCodePageEncoding.GetByteCount]Attempting to use null fallback"); 556Debug.Assert(char.IsHighSurrogate(charLeftOver), "[DBCSCodePageEncoding.GetByteCount]leftover character should be high surrogate"); 557Debug.Assert(encoder != null, 621Debug.Assert(bytes != null, "[DBCSCodePageEncoding.GetBytes]bytes is null"); 622Debug.Assert(byteCount >= 0, "[DBCSCodePageEncoding.GetBytes]byteCount is negative"); 623Debug.Assert(chars != null, "[DBCSCodePageEncoding.GetBytes]chars is null"); 624Debug.Assert(charCount >= 0, "[DBCSCodePageEncoding.GetBytes]charCount is negative"); 627Debug.Assert(EncoderFallback != null, "[DBCSCodePageEncoding.GetBytes]Attempting to use null encoder fallback"); 647Debug.Assert(charLeftOver == 0 || char.IsHighSurrogate(charLeftOver), 662Debug.Assert(encoder != null, 695Debug.Assert(encoder == null, 718Debug.Assert(chars > charStart, 737Debug.Assert(chars > charStart, 770Debug.Assert(bytes != null, "[DBCSCodePageEncoding.GetCharCount]bytes is null"); 771Debug.Assert(count >= 0, "[DBCSCodePageEncoding.GetCharCount]byteCount is negative"); 787Debug.Assert(decoder == null || 807Debug.Assert(fallbackBuffer == null, 832Debug.Assert(fallbackBuffer == null, 907Debug.Assert(decoder == null || !decoder.m_throwOnOverflow || 919Debug.Assert(bytes != null, "[DBCSCodePageEncoding.GetChars]bytes is null"); 920Debug.Assert(byteCount >= 0, "[DBCSCodePageEncoding.GetChars]byteCount is negative"); 921Debug.Assert(chars != null, "[DBCSCodePageEncoding.GetChars]chars is null"); 922Debug.Assert(charCount >= 0, "[DBCSCodePageEncoding.GetChars]charCount is negative"); 940Debug.Assert(decoder == null || !decoder.m_throwOnOverflow || 961Debug.Assert(fallbackBuffer == null, 987Debug.Assert(fallbackBuffer == null, 1065Debug.Assert(bytes >= byteStart + byteBuffer.Length, 1079Debug.Assert(bytes > byteStart, 1084Debug.Assert(bytes > byteStart, 1110Debug.Assert(decoder == null || !decoder.m_throwOnOverflow ||
System\Text\DecoderBestFitFallback.cs (3)
84Debug.Assert(iCount < 1, "[DecoderReplacementFallbackBuffer.Fallback] Calling fallback without a previously empty buffer"); 182Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length, 203Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length,
System\Text\DecoderFallbackBufferHelper.cs (2)
46Debug.Assert(byteStart != null, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize"); 102Debug.Assert(byteStart != null, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize");
System\Text\EncoderBestFitFallback.cs (2)
187Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length, 208Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length,
System\Text\EncoderFallbackBufferHelper.cs (1)
74Debug.Assert(charStart != null, "[EncoderFallback.InternalFallbackBuffer]Fallback buffer is not initialized");
System\Text\EncodingByteBuffer.cs (2)
50Debug.Assert(moreBytesExpected >= 0, "[EncodingByteBuffer.AddByte]expected non-negative moreBytesExpected"); 107Debug.Assert(_chars > _charStart || (bThrow && (_bytes == _byteStart)),
System\Text\EncodingCharBuffer.cs (2)
42Debug.Assert(_fallbackBuffer.Remaining == 0, 108Debug.Assert(_bytes < _byteEnd, "[EncodingCharBuffer.GetNextByte]Expected more date");
System\Text\GB18030Encoding.cs (9)
166Debug.Assert(count4Byte <= GBLast4ByteCode, 186Debug.Assert(unicodeCount == 0, 217Debug.Assert(byteCount >= 0, "[GB18030Encoding.GetBytes]byteCount is negative"); 218Debug.Assert(chars != null, "[GB18030Encoding.GetBytes]chars is null"); 219Debug.Assert(charCount >= 0, "[GB18030Encoding.GetBytes]charCount is negative"); 222Debug.Assert(EncoderFallback != null, "[GB18030Encoding.GetBytes]Attempting to use null encoder fallback"); 402Debug.Assert(bytes != null, "[GB18030Encoding.GetChars]bytes is null"); 403Debug.Assert(byteCount >= 0, "[GB18030Encoding.GetChars]byteCount is negative"); 405Debug.Assert(charCount >= 0, "[GB18030Encoding.GetChars]charCount is negative");
System\Text\ISCIIEncoding.cs (26)
129Debug.Assert(chars != null, "[ISCIIEncoding.GetBytes]chars!=null"); 131Debug.Assert(charCount >= 0, "[ISCIIEncoding.GetBytes]charCount >=0"); 132Debug.Assert(byteCount >= 0, "[ISCIIEncoding.GetBytes]byteCount >=0"); 228Debug.Assert(indicScript != 0, "[ISCIIEncoding.GetBytes]expected an indic script value"); 318Debug.Assert(bytes != null, "[ISCIIEncoding.GetChars]bytes is null"); 319Debug.Assert(byteCount >= 0, "[ISCIIEncoding.GetChars]byteCount is negative"); 321Debug.Assert(charCount >= 0, "[ISCIIEncoding.GetChars]charCount is negative"); 431Debug.Assert(bLastVirama == false, "[ISCIIEncoding.GetChars] Expected no bLastVirama in bLastATR mode"); 432Debug.Assert(bLastDevenagariStressAbbr == false, "[ISCIIEncoding.GetChars] Expected no bLastDevenagariStressAbbr in bLastATR mode"); 433Debug.Assert(cLastCharForNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNextNukta in bLastATR mode"); 434Debug.Assert(cLastCharForNoNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNoNextNukta in bLastATR mode"); 462Debug.Assert(bLastATR == false, "[ISCIIEncoding.GetChars] Expected no bLastATR in bLastVirama mode"); 463Debug.Assert(bLastDevenagariStressAbbr == false, "[ISCIIEncoding.GetChars] Expected no bLastDevenagariStressAbbr in bLastVirama mode"); 464Debug.Assert(cLastCharForNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNextNukta in bLastVirama mode"); 465Debug.Assert(cLastCharForNoNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNoNextNukta in bLastVirama mode"); 498Debug.Assert(bLastATR == false, "[ISCIIEncoding.GetChars] Expected no bLastATR in bLastDevenagariStressAbbr mode"); 499Debug.Assert(bLastVirama == false, "[ISCIIEncoding.GetChars] Expected no bLastVirama in bLastDevenagariStressAbbr mode"); 500Debug.Assert(cLastCharForNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNextNukta in bLastDevenagariStressAbbr mode"); 501Debug.Assert(cLastCharForNoNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNoNextNukta in bLastDevenagariStressAbbr mode"); 506Debug.Assert(cLastCharForNextNukta > 0 && cLastCharForNoNextNukta > 0, 528Debug.Assert(bLastATR == false, "[ISCIIEncoding.GetChars] Expected no bLastATR in cLastCharForNextNukta mode"); 529Debug.Assert(bLastVirama == false, "[ISCIIEncoding.GetChars] Expected no bLastVirama in cLastCharForNextNukta mode"); 530Debug.Assert(bLastDevenagariStressAbbr == false, "[ISCIIEncoding.GetChars] Expected no bLastDevenagariStressAbbr in cLastCharForNextNukta mode"); 535Debug.Assert(!bLastSpecial && !bLastDevenagariStressAbbr && !bLastVirama && !bLastATR && 554Debug.Assert(currentCodePageIndex != -1, "[ISCIIEncoding.GetChars]Expected valid currentCodePageIndex != -1"); 652Debug.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow,
System\Text\ISO2022Encoding.cs (23)
226Debug.Assert(count >= 0, "[ISO2022Encoding.GetByteCount]count is negative"); 227Debug.Assert(chars != null, "[ISO2022Encoding.GetByteCount]chars is null"); 237Debug.Assert(chars != null, "[ISO2022Encoding.GetBytes]chars is null"); 238Debug.Assert(byteCount >= 0, "[ISO2022Encoding.GetBytes]byteCount is negative"); 239Debug.Assert(charCount >= 0, "[ISO2022Encoding.GetBytes]charCount is negative"); 242Debug.Assert(EncoderFallback != null, "[ISO2022Encoding.GetBytes]Attempting to use null encoder fallback"); 277Debug.Assert(bytes != null, "[ISO2022Encoding.GetCharCount]bytes is null"); 278Debug.Assert(count >= 0, "[ISO2022Encoding.GetCharCount]byteCount is negative"); 288Debug.Assert(bytes != null, "[ISO2022Encoding.GetChars]bytes is null"); 289Debug.Assert(byteCount >= 0, "[ISO2022Encoding.GetChars]byteCount is negative"); 290Debug.Assert(charCount >= 0, "[ISO2022Encoding.GetChars]charCount is negative"); 376Debug.Assert(char.IsHighSurrogate(charLeftOver), "[ISO2022Encoding.GetBytesCP5022xJP]leftover character should be high surrogate"); 437Debug.Assert(CodePage == 50221, "[ISO2022Encoding.GetBytesCP5022xJP]Expected Code Page 50221"); 617Debug.Assert(char.IsHighSurrogate(charLeftOver), "[ISO2022Encoding.GetBytesCP50225KR]leftover character should be high surrogate"); 717Debug.Assert(!encoder.MustFlush || !encoder.m_throwOnOverflow, 763Debug.Assert(char.IsHighSurrogate(charLeftOver), "[ISO2022Encoding.GetBytesCP52936]leftover character should be high surrogate"); 1086Debug.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow, 1180Debug.Assert(count > 0, "[ISO2022Encoding.DecrementEscapeBytes]count > 0"); 1385Debug.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow, 1443Debug.Assert(byteCount >= 0, "[ISO2022Encoding.GetCharsCP52936]count >=0"); 1444Debug.Assert(bytes != null, "[ISO2022Encoding.GetCharsCP52936]bytes!=null"); 1553Debug.Assert(currentMode == ISO2022Modes.ModeHZ, "[ISO2022Encoding.GetCharsCP52936]Expected ModeHZ"); 1677Debug.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow,
System\Text\SBCSCodePageEncoding.cs (34)
68Debug.Assert(pCodePage->CodePage == dataTableCodePage, 103Debug.Assert(bytesRead == buffer.Length, "s_codePagesEncodingDataStream.Read should have read a full buffer."); 167Debug.Assert(bytesRead == buffer.Length, "s_codePagesEncodingDataStream.Read should have read a full buffer."); 301Debug.Assert(count >= 0, "[SBCSCodePageEncoding.GetByteCount]count is negative"); 302Debug.Assert(chars != null, "[SBCSCodePageEncoding.GetByteCount]chars is null"); 305Debug.Assert(EncoderFallback != null, "[SBCSCodePageEncoding.GetByteCount]Attempting to use null fallback"); 317Debug.Assert(charLeftOver == 0 || char.IsHighSurrogate(charLeftOver), 322Debug.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer || 363Debug.Assert(encoder != null, "[SBCSCodePageEncoding.GetByteCount]Expect to have encoder if we have a charLeftOver"); 416Debug.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 426Debug.Assert(bytes != null, "[SBCSCodePageEncoding.GetBytes]bytes is null"); 427Debug.Assert(byteCount >= 0, "[SBCSCodePageEncoding.GetBytes]byteCount is negative"); 428Debug.Assert(chars != null, "[SBCSCodePageEncoding.GetBytes]chars is null"); 429Debug.Assert(charCount >= 0, "[SBCSCodePageEncoding.GetBytes]charCount is negative"); 432Debug.Assert(EncoderFallback != null, "[SBCSCodePageEncoding.GetBytes]Attempting to use null encoder fallback"); 444Debug.Assert(charLeftOver == 0 || char.IsHighSurrogate(charLeftOver), 449Debug.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer || 548Debug.Assert(encoder != null, "[SBCSCodePageEncoding.GetBytes]Expect to have encoder if we have a charLeftOver"); 607Debug.Assert(chars > charStart, "[SBCSCodePageEncoding.GetBytes]Expected chars to have advanced (fallback)"); 623Debug.Assert(fallbackBuffer == null || fallbackHelper.bFallingBack == false, "[SBCSCodePageEncoding.GetBytes]Expected to NOT be falling back"); 626Debug.Assert(chars > charStart, "[SBCSCodePageEncoding.GetBytes]Expected chars to have advanced (normal)"); 651Debug.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, "[SBCSEncoding.GetBytes]Expected Empty fallback buffer at end"); 660Debug.Assert(bytes != null, "[SBCSCodePageEncoding.GetCharCount]bytes is null"); 661Debug.Assert(count >= 0, "[SBCSCodePageEncoding.GetCharCount]byteCount is negative"); 680Debug.Assert(!decoder.m_throwOnOverflow || !decoder.InternalHasFallbackBuffer || 738Debug.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 749Debug.Assert(bytes != null, "[SBCSCodePageEncoding.GetChars]bytes is null"); 750Debug.Assert(byteCount >= 0, "[SBCSCodePageEncoding.GetChars]byteCount is negative"); 751Debug.Assert(chars != null, "[SBCSCodePageEncoding.GetChars]chars is null"); 752Debug.Assert(charCount >= 0, "[SBCSCodePageEncoding.GetChars]charCount is negative"); 776Debug.Assert(!decoder.m_throwOnOverflow || !decoder.InternalHasFallbackBuffer || 861Debug.Assert(bytes > byteStart, 880Debug.Assert(bytes > byteStart, 897Debug.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0,
System.Text.Encodings.Web (13)
src\libraries\Common\src\System\HexConverter.cs (2)
332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Text\Encodings\Web\AllowedBmpCodePointsBitmap.cs (1)
81Debug.Assert(thisAllowedCharactersBitmap.IsEmpty, "Both vectors should've been fully consumed.");
System\Text\Encodings\Web\DefaultHtmlEncoder.cs (2)
107Debug.Assert(4 <= idxOfSemicolon && idxOfSemicolon <= 9, "Expected '&#x0;'..'&#x10FFFF;'."); 182Debug.Assert(4 <= idxOfSemicolon && idxOfSemicolon <= 9, "Expected '&#x0;'..'&#x10FFFF;'.");
System\Text\Encodings\Web\OptimizedInboxTextEncoder.Ascii.cs (2)
105Debug.Assert(encodedCharCount > 0 && encodedCharCount <= 6, "Inner encoder returned bad length."); 112Debug.Assert(thisChar <= 0x7F, "Inner encoder returned non-ASCII data.");
System\Text\Encodings\Web\OptimizedInboxTextEncoder.cs (3)
103Debug.Assert(innerCharsWritten <= bufferLength, "Mustn't overflow the buffer."); 104Debug.Assert(innerCharsWritten != 0, "Inner escaper succeeded with 0-char output?"); 365Debug.Assert(Ssse3.IsSupported, "#ifdef was ill-formed.");
System\Text\Encodings\Web\TextEncoder.cs (1)
515Debug.Assert(!value.IsEmpty, "Caller should've special-cased 'no encoding needed'.");
System\Text\Encodings\Web\ThrowHelper.cs (1)
25Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument),
System.Text.Json (62)
src\libraries\Common\src\System\HexConverter.cs (2)
332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\libraries\System.Text.Json\Common\JsonHelpers.cs (2)
144Debug.Assert(childlessQueue.Count > 0, "The graph contains cycles."); 172Debug.Assert(idx == 0, "should have populated the entire sortedNodes array.");
System\Text\Json\BitStack.cs (2)
146Debug.Assert(_currentDepth == 0, "Only call SetFirstBit when depth is 0"); 153Debug.Assert(_currentDepth == 0, "Only call ResetFirstBit when depth is 0");
System\Text\Json\Document\JsonDocument.MetadataDb.cs (2)
159Debug.Assert(!_isLocked, "Dispose called on a locked database"); 235Debug.Assert(!_isLocked, "Appending to a locked database");
System\Text\Json\Document\JsonDocument.Parse.cs (2)
422Debug.Assert(ret, "TryParseValue returned false with shouldThrow: true."); 423Debug.Assert(document != null, "null document returned with shouldThrow: true.");
System\Text\Json\Document\JsonElement.Parse.cs (2)
51Debug.Assert(ret, "TryParseValue returned false with shouldThrow: true."); 52Debug.Assert(document != null, "null document returned with shouldThrow: true.");
System\Text\Json\JsonHelpers.cs (1)
152Debug.Assert(success, "The skipped value should have already been buffered.");
System\Text\Json\Nodes\JsonObject.cs (1)
243Debug.Assert(_dictionary != null, "Cannot have detachable nodes without a materialized dictionary.");
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (1)
484Debug.Assert(source[idx] == 'u', "invalid escape sequences must have already been caught by Utf8JsonReader.Read()");
System\Text\Json\Reader\Utf8JsonReader.TryGet.cs (3)
82Debug.Assert(_tokenType != JsonTokenType.Number || !ValueIsEscaped, "Numbers can't contain escape characters."); 146Debug.Assert(_tokenType != JsonTokenType.Number || !ValueIsEscaped, "Numbers can't contain escape characters."); 228Debug.Assert(bytesWritten < source.Length, "source buffer must contain at least one escape sequence");
System\Text\Json\Serialization\Converters\CastingConverter.cs (1)
25Debug.Assert(sourceConverter.SourceConverterForCastingConverter is null, "casting converters should not be layered.");
System\Text\Json\Serialization\Converters\Collection\JsonCollectionConverter.cs (2)
262Debug.Assert(JsonSerializer.IsMetadataPropertyName(reader.GetUnescapedSpan(), (state.Current.BaseJsonTypeInfo ?? jsonTypeInfo).PolymorphicTypeResolver), "should only be hit if metadata property."); 264Debug.Assert(result, "Metadata reader must have buffered all contents.");
System\Text\Json\Serialization\Converters\Object\ObjectDefaultConverter.cs (2)
292Debug.Assert(!isAlreadyReadMetadataProperty, "Only possible for types that can read metadata, which do not call into the fast-path method."); 475Debug.Assert(success, "Serializer should guarantee sufficient read-ahead has been done.");
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.cs (1)
325Debug.Assert(success, "Serializer should guarantee sufficient read-ahead has been done.");
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (1)
418Debug.Assert(_nameCacheForReading != null, "Enum value cache should be instantiated if a naming policy is specified.");
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (4)
58Debug.Assert(!allowOutOfOrderMetadata, "Object must have already been buffered in this mode."); 202Debug.Assert(!allowOutOfOrderMetadata, "Object must have already been buffered in this mode."); 270Debug.Assert(!isReadingAheadOfNonMetadataProperties, "must have already verified if non-metadata properties precede $values"); 286Debug.Assert(allowOutOfOrderMetadata, "should only be reached if reading ahead is required.");
System\Text\Json\Serialization\JsonSerializer.Read.HandlePropertyName.cs (2)
54Debug.Assert(jsonTypeInfo.ExtensionDataProperty is null, "jsonTypeInfo.Configure() should have caught conflicting configuration."); 66Debug.Assert(obj != null, "obj is null");
System\Text\Json\Serialization\JsonSerializerOptions.Caching.cs (3)
112Debug.Assert(!fallBackToNearestAncestorType || IsReadOnly, "ancestor resolution should only be invoked in read-only options."); 113Debug.Assert(ensureNotNull is null or true, "Explicitly passing false will result in invalid result annotation."); 407Debug.Assert(options.IsReadOnly, "Cannot create caching contexts for mutable JsonSerializerOptions instances");
System\Text\Json\Serialization\JsonSerializerOptions.cs (1)
951Debug.Assert(_effectiveJsonTypeInfoResolver is null, "an effective resolver always returns metadata");
System\Text\Json\Serialization\Metadata\FSharpCoreReflectionProxy.cs (1)
90Debug.Assert(s_singletonInstance is not null, "should be initialized via a successful IsFSharpType call.");
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Helpers.cs (1)
148Debug.Assert(jsonPropertyInfo.MemberName != null, "MemberName is not set by source gen");
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (11)
428Debug.Assert(EffectiveConverter != null, "Must have calculated the effective converter."); 465Debug.Assert(ParentTypeInfo != null, "We should have ensured parent is assigned in JsonTypeInfo"); 493Debug.Assert(ParentTypeInfo != null, "We should have ensured parent is assigned in JsonTypeInfo"); 494Debug.Assert(!IsConfigured, "Should not be called post-configuration."); 495Debug.Assert(_jsonTypeInfo != null, "Must have already been determined on configuration."); 520Debug.Assert(EffectiveConverter != null, "Must have calculated the effective converter."); 521Debug.Assert(ParentTypeInfo != null, "We should have ensured parent is assigned in JsonTypeInfo"); 522Debug.Assert(!IsConfigured, "Should not be called post-configuration."); 864Debug.Assert(EffectiveConverter.CanPopulate, "Property is marked with Populate but converter cannot populate. This should have been validated in Configure"); 865Debug.Assert(state.Parent.ReturnValue != null, "Parent object is null"); 866Debug.Assert(!state.Current.IsPopulating, "We've called TryGetPrePopulatedValue more than once");
System\Text\Json\Serialization\Metadata\JsonPropertyInfoOfT.cs (1)
289Debug.Assert(EffectiveObjectCreationHandling != JsonObjectCreationHandling.Populate, "Populating should not be possible for simple types");
System\Text\Json\Serialization\Metadata\JsonTypeInfo.Cache.cs (2)
169Debug.Assert(info != null, "PropertyCache contains null JsonPropertyInfo"); 451Debug.Assert(
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (4)
251Debug.Assert(_properties is null, "must not be set if a property list has been initialized."); 673Debug.Assert(Monitor.IsEntered(Options.CacheContext), "Configure called directly, use EnsureConfigured which synchronizes access to this method"); 1177Debug.Assert(ExtensionDataProperty.MemberName != null, "Custom property info cannot be data extension property"); 1365Debug.Assert(jsonPropertyInfo.MemberName != null, "MemberName can be null in custom JsonPropertyInfo instances and should never be passed in this method");
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.cs (1)
116Debug.Assert(!IsReadOnly, "We should not mutate read-only JsonTypeInfo");
System\Text\Json\Serialization\ReadBufferState.cs (1)
108Debug.Assert(!_isFinalBlock || _count == bytesConsumed, "The reader should have thrown if we have remaining bytes.");
System\Text\Json\Serialization\WriteStack.cs (1)
147Debug.Assert(!supportAsync || supportContinuation, "supportAsync must imply supportContinuation");
System\Text\Json\ThrowHelper.Serialization.cs (1)
761Debug.Assert(propertyInfo.ParentTypeInfo != null, "We should not throw this exception when ParentTypeInfo is null");
System\Text\Json\Writer\Utf8JsonWriter.cs (2)
154Debug.Assert(options.NewLine is "\n" or "\r\n", "Invalid NewLine string."); 1030Debug.Assert(_newLineLength is 1 or 2, "Invalid new line length.");
System.Text.Json.SourceGeneration (5)
Helpers\RoslynExtensions.cs (1)
23Debug.Assert(!type.IsArray, "Resolution logic only capable of handling named types.");
JsonSourceGenerator.Parser.cs (2)
483Debug.Assert(IsSymbolAccessibleWithin(typeToGenerate.Type, within: contextType), "should not generate metadata for inaccessible types."); 763Debug.Assert(arraySymbol.Rank == 1, "multi-dimensional arrays should have been handled earlier.");
src\libraries\System.Text.Json\Common\JsonHelpers.cs (2)
144Debug.Assert(childlessQueue.Count > 0, "The graph contains cycles."); 172Debug.Assert(idx == 0, "should have populated the entire sortedNodes array.");
System.Text.RegularExpressions (52)
src\libraries\Common\src\System\HexConverter.cs (2)
332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (1)
91Debug.Assert(index == 0, "Implementation currently only supports index == 0");
System\Text\RegularExpressions\CaptureCollection.cs (1)
187Debug.Assert(collection != null, "collection cannot be null.");
System\Text\RegularExpressions\GroupCollection.cs (1)
241Debug.Assert(collection != null, "collection cannot be null.");
System\Text\RegularExpressions\MatchCollection.cs (2)
77Debug.Assert(i >= 0, "i cannot be negative."); 200Debug.Assert(collection != null, "collection cannot be null.");
System\Text\RegularExpressions\Regex.Cache.cs (2)
277Debug.Assert(pattern != null, "Pattern must be provided"); 278Debug.Assert(culture != null, "Culture must be provided");
System\Text\RegularExpressions\RegexCharClass.cs (6)
371Debug.Assert(cc.CanMerge && CanMerge, "Both character classes added together must be able to merge"); 427Debug.Assert(_subtractor == null, "Can't add two subtractions to a char class. "); 601Debug.Assert(IsSingleton(set) || IsSingletonInverse(set), "Tried to get the singleton char out of a non singleton character class"); 1270Debug.Assert(asciiLazyCache is null || asciiLazyCache.Length == CacheArrayLength, "set lookup should be able to store two bits for each of the first 128 characters"); 1377Debug.Assert((SetStartIndex & 0x1) == 1, "If SetStartIndex is not odd, the calculation below this will be reversed"); 1842Debug.Assert(!string.IsNullOrEmpty(set), "Found a null/empty element in RegexCharClass prop table");
System\Text\RegularExpressions\RegexCompiler.cs (5)
1429Debug.Assert(node.Kind == RegexNodeKind.Capture, "Every generated tree should begin with a capture node"); 1430Debug.Assert(node.ChildCount() == 1, "Capture nodes should have one child"); 2695Debug.Assert(sliceStaticPos == 0, "This should be the first node and thus static position shouldn't have advanced."); 3861Debug.Assert(!isAtomic, "An atomic lazy should have had its upper bound lowered to its lower bound."); 5173Debug.Assert(!negate, "Negation isn't appropriate for a multi");
System\Text\RegularExpressions\RegexFindOptimizations.cs (1)
367Debug.Assert(LeadingAnchor != RegexNodeKind.Bol, "BOL isn't enabled for RTL");
System\Text\RegularExpressions\RegexInterpreter.cs (3)
39Debug.Assert(code != null, "code must not be null."); 300Debug.Assert(_culture != null, "If the pattern has backreferences and is IgnoreCase, then _culture must not be null."); 1131Debug.Assert(!_rightToLeft, "UpdateBumpalongs aren't added for RTL");
System\Text\RegularExpressions\RegexNode.cs (5)
203Debug.Assert(Kind == RegexNodeKind.Capture, "Every generated tree should begin with a capture node"); 222Debug.Assert(Kind != RegexNodeKind.Group, "All Group nodes should have been removed."); 292Debug.Assert(node.Str is not null, "Expect non-null multi string"); 1795Debug.Assert((Options & RegexOptions.NonBacktracking) == 0, "Atomic groups aren't supported and don't help performance with NonBacktracking"); 2217Debug.Assert(currentIndex >= 0, "Node should have been in its parent's child list");
System\Text\RegularExpressions\RegexParser.cs (5)
57Debug.Assert(pattern != null, "Pattern must be set"); 58Debug.Assert(culture != null, "Culture must be set"); 1078Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern"); 1153Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern"); 1976Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern");
System\Text\RegularExpressions\Symbolic\BDD.cs (3)
68Debug.Assert((one is null) == (zero is null), "Neither or both children should be null."); 344Debug.Assert(bytes.Length > 1, "All inputs are expected to be larger than a single byte, which would map to False or True."); 502Debug.Assert(leaf is not null, "this should never happen because there must exist another leaf besides False");
System\Text\RegularExpressions\Symbolic\CharSetSolver.cs (2)
207Debug.Assert(!set.IsLeaf, "Did not expect multi-terminal"); 257Debug.Assert(!set1.IsLeaf || !set2.IsLeaf, "Did not expect multi-terminal case");
System\Text\RegularExpressions\Symbolic\DoublyLinkedList.cs (4)
54Debug.Assert(other != this, "self append not allowed to avoid circularity"); 141Debug.Assert(_first is null && _last is null, "empty list"); 145Debug.Assert(_size > 0, "_size < 0 means that the list has been invalidated after Append"); 146Debug.Assert(_first is not null && _last is not null && _first.Prev is null && _last.Next is null, "non-empty list");
System\Text\RegularExpressions\Symbolic\MintermClassifier.cs (1)
40Debug.Assert(minterms.Length > 0, "Requires at least");
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.cs (7)
629Debug.Assert(lastStart != -1, "We expected to find a starting position but didn't."); 966Debug.Assert(state.DfaStateId > 0, $"Expected non-zero {nameof(state.DfaStateId)}."); 967Debug.Assert(state.NfaState is null, $"Expected null {nameof(state.NfaState)}."); 1072Debug.Assert(state.DfaStateId < 0, $"Expected negative {nameof(state.DfaStateId)}."); 1073Debug.Assert(state.NfaState is not null, $"Expected non-null {nameof(state.NfaState)}."); 1177Debug.Assert(state.DfaStateId < 0, $"Expected negative {nameof(state.DfaStateId)}."); 1178Debug.Assert(state.NfaState is not null, $"Expected non-null {nameof(state.NfaState)}.");
System.Text.RegularExpressions.Generator (77)
RegexGenerator.Emitter.cs (42)
1448Debug.Assert(node.Kind == RegexNodeKind.Capture, "Every generated tree should begin with a capture node"); 1449Debug.Assert(node.ChildCount() == 1, "Capture nodes should have one child"); 1630Debug.Assert(node.Kind is RegexNodeKind.Alternate, $"Unexpected type: {node.Kind}"); 1631Debug.Assert(node.ChildCount() >= 2, $"Expected at least 2 children, found {node.ChildCount()}"); 1768Debug.Assert(startingLiteralNode is not null, "Unexpectedly couldn't find the branch starting node."); 2070Debug.Assert(node.Kind is RegexNodeKind.Backreference, $"Unexpected type: {node.Kind}"); 2139Debug.Assert(node.Kind is RegexNodeKind.BackreferenceConditional, $"Unexpected type: {node.Kind}"); 2140Debug.Assert(node.ChildCount() == 2, $"Expected 2 children, found {node.ChildCount()}"); 2312Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.Kind}"); 2313Debug.Assert(node.ChildCount() == 3, $"Expected 3 children, found {node.ChildCount()}"); 2499Debug.Assert(node.Kind is RegexNodeKind.Capture, $"Unexpected type: {node.Kind}"); 2500Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 2596Debug.Assert(node.Kind is RegexNodeKind.PositiveLookaround, $"Unexpected type: {node.Kind}"); 2597Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 2644Debug.Assert(node.Kind is RegexNodeKind.NegativeLookaround, $"Unexpected type: {node.Kind}"); 2645Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 2755Debug.Assert(sliceStaticPos == 0, "This should be the first node and thus static position shouldn't have advanced."); 2919Debug.Assert(node.Kind is RegexNodeKind.Atomic or RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround or RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.Kind}"); 2948Debug.Assert(node.Kind is RegexNodeKind.UpdateBumpalong, $"Unexpected type: {node.Kind}"); 2960Debug.Assert(node.Kind is RegexNodeKind.Concatenate, $"Unexpected type: {node.Kind}"); 2961Debug.Assert(node.ChildCount() >= 2, $"Expected at least 2 children, found {node.ChildCount()}"); 3134Debug.Assert(node.Kind is RegexNodeKind.Boundary or RegexNodeKind.NonBoundary or RegexNodeKind.ECMABoundary or RegexNodeKind.NonECMABoundary, $"Unexpected kind: {node.Kind}"); 3161Debug.Assert(node.Kind is RegexNodeKind.Beginning or RegexNodeKind.Start or RegexNodeKind.Bol or RegexNodeKind.End or RegexNodeKind.EndZ or RegexNodeKind.Eol, $"Unexpected type: {node.Kind}"); 3227Debug.Assert(node.Kind is RegexNodeKind.Multi, $"Unexpected type: {node.Kind}"); 3276Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Notoneloop or RegexNodeKind.Setloop, $"Unexpected type: {node.Kind}"); 3414Debug.Assert(node.Kind is RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy or RegexNodeKind.Setlazy, $"Unexpected type: {node.Kind}"); 3660Debug.Assert(node.Kind is RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 3661Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}"); 3662Debug.Assert(node.N >= node.M, $"Unexpected M={node.M}, N={node.N}"); 3663Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 3686Debug.Assert(!isAtomic, "An atomic lazy should have had its upper bound lowered to its lower bound."); 4082Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic, $"Unexpected type: {node.Kind}"); 4223Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic, $"Unexpected type: {node.Kind}"); 4261Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 4262Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}"); 4263Debug.Assert(node.M == node.N, $"Unexpected M={node.M} == N={node.N}"); 4264Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 4281Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 4282Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}"); 4283Debug.Assert(node.N >= node.M, $"Unexpected M={node.M}, N={node.N}"); 4284Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 4905Debug.Assert(!negate, "Negation isn't appropriate for a multi");
src\libraries\Common\src\System\HexConverter.cs (2)
332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (1)
91Debug.Assert(index == 0, "Implementation currently only supports index == 0");
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (8)
324Debug.Assert( 331Debug.Assert(string.Compare(s_propTable[i][0], s_propTable[i + 1][0], StringComparison.Ordinal) < 0, $"RegexCharClass s_propTable is out of order at ({s_propTable[i][0]}, {s_propTable[i + 1][0]})"); 371Debug.Assert(cc.CanMerge && CanMerge, "Both character classes added together must be able to merge"); 427Debug.Assert(_subtractor == null, "Can't add two subtractions to a char class. "); 601Debug.Assert(IsSingleton(set) || IsSingletonInverse(set), "Tried to get the singleton char out of a non singleton character class"); 1270Debug.Assert(asciiLazyCache is null || asciiLazyCache.Length == CacheArrayLength, "set lookup should be able to store two bits for each of the first 128 characters"); 1377Debug.Assert((SetStartIndex & 0x1) == 1, "If SetStartIndex is not odd, the calculation below this will be reversed"); 1842Debug.Assert(!string.IsNullOrEmpty(set), "Found a null/empty element in RegexCharClass prop table");
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexFindOptimizations.cs (1)
55Debug.Assert(maxLength >= MinRequiredLength, $"{maxLength} should have been greater than {MinRequiredLength} minimum");
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (17)
203Debug.Assert(Kind == RegexNodeKind.Capture, "Every generated tree should begin with a capture node"); 216Debug.Assert(child.Parent == node, $"{child.Describe()} missing reference to parent {node.Describe()}"); 222Debug.Assert(Kind != RegexNodeKind.Group, "All Group nodes should have been removed."); 258Debug.Assert(childCount == 0, $"Expected zero children for {node.Kind}, got {childCount}."); 267Debug.Assert(childCount == 1, $"Expected one and only one child for {node.Kind}, got {childCount}."); 271Debug.Assert(childCount == 2, $"Expected two children for {node.Kind}, got {childCount}"); 275Debug.Assert(childCount == 3, $"Expected three children for {node.Kind}, got {childCount}"); 280Debug.Assert(childCount >= 2, $"Expected at least two children for {node.Kind}, got {childCount}."); 292Debug.Assert(node.Str is not null, "Expect non-null multi string"); 293Debug.Assert(node.Str.Length >= 2, $"Expected {node.Str} to be at least two characters"); 300Debug.Assert(!string.IsNullOrEmpty(node.Str), $"Expected non-null, non-empty string for {node.Kind}."); 304Debug.Assert(node.Str is null, $"Expected null string for {node.Kind}, got \"{node.Str}\"."); 315Debug.Assert((node.Options & RegexOptions.IgnoreCase) == 0, $"{node.Kind} node should not have RegexOptions.IgnoreCase"); 1795Debug.Assert((Options & RegexOptions.NonBacktracking) == 0, "Atomic groups aren't supported and don't help performance with NonBacktracking"); 2217Debug.Assert(currentIndex >= 0, "Node should have been in its parent's child list"); 2513Debug.Assert(Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {Kind}"); 2629Debug.Assert(Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {Kind}");
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexParser.cs (5)
57Debug.Assert(pattern != null, "Pattern must be set"); 58Debug.Assert(culture != null, "Culture must be set"); 1078Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern"); 1153Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern"); 1976Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern");
System.Threading (1)
System\Threading\CountdownEvent.cs (1)
249Debug.Assert(_currentCount >= 0, "latch was decremented below zero");
System.Threading.Channels (43)
src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (13)
67Debug.Assert(InitialSegmentSize > 0, "Initial segment size must be > 0."); 68Debug.Assert((InitialSegmentSize & (InitialSegmentSize - 1)) == 0, "Initial segment size must be a power of 2"); 69Debug.Assert(InitialSegmentSize <= MaxSegmentSize, "Initial segment size should be <= maximum."); 70Debug.Assert(MaxSegmentSize < int.MaxValue / 2, "Max segment size * 2 must be < int.MaxValue, or else overflow could occur."); 102Debug.Assert(segment != null, "Expected a non-null segment."); 112Debug.Assert(newSegmentSize > 0, "The max size should always be small enough that we don't overflow."); 179Debug.Assert(segment != null, "Expected a non-null segment."); 180Debug.Assert(array != null, "Expected a non-null item array."); 253Debug.Assert(segment != null, "Expected a non-null segment."); 254Debug.Assert(array != null, "Expected a non-null item array."); 368Debug.Assert(syncObj != null, "The syncObj parameter is null."); 390Debug.Assert((size & (size - 1)) == 0, "Size must be a power of 2"); 429Debug.Assert(queue != null, "Expected a non-null queue.");
System\Threading\Channels\AsyncOperation.cs (7)
90Debug.Assert(!_pooled, "Cancelable operations can't be pooled"); 184Debug.Assert(_pooled, "Should only be used for pooled objects"); 260Debug.Assert(IsCompleted, $"Expected IsCompleted"); 263Debug.Assert(prevContinuation != s_availableSentinel, "Continuation was the available sentinel."); 385Debug.Assert(_continuation != s_completedSentinel, $"The continuation was the completion sentinel."); 386Debug.Assert(_continuation != s_availableSentinel, $"The continuation was the available sentinel."); 415Debug.Assert(ts != null, "Expected a TaskScheduler");
System\Threading\Channels\BoundedChannel.cs (14)
458Debug.Assert(waitingReadersTail == null, "Shouldn't have any waiters to wake up"); 462Debug.Assert(success, "We should always be able to complete the reader."); 651Debug.Assert(success, "We should always be able to complete the reader."); 678Debug.Assert(SyncObj != null, "The sync obj must not be null."); 679Debug.Assert(Monitor.IsEntered(SyncObj), "Invariants can only be validated while holding the lock."); 683Debug.Assert(_blockedReaders.IsEmpty, "There are items available, so there shouldn't be any blocked readers."); 684Debug.Assert(_waitingReadersTail == null, "There are items available, so there shouldn't be any waiting readers."); 688Debug.Assert(_blockedWriters.IsEmpty, "There's space available, so there shouldn't be any blocked writers."); 689Debug.Assert(_waitingWritersTail == null, "There's space available, so there shouldn't be any waiting writers."); 693Debug.Assert(_items.IsEmpty, "There shouldn't be queued items if there's a blocked reader."); 694Debug.Assert(_blockedWriters.IsEmpty, "There shouldn't be any blocked writer if there's a blocked reader."); 698Debug.Assert(_items.Count == _bufferedCapacity, "We should have a full buffer if there's a blocked writer."); 699Debug.Assert(_blockedReaders.IsEmpty, "There shouldn't be any blocked readers if there's a blocked writer."); 703Debug.Assert(_doneWriting != null, "We can only complete if we're done writing.");
System\Threading\Channels\SingleConsumerUnboundedChannel.cs (2)
254Debug.Assert(blockedReader == null || waitingReader == null, "There should only ever be at most one reader."); 318Debug.Assert((blockedReader != null) ^ (waitingReader != null), "Expected either a blocked or waiting reader, but not both");
System\Threading\Channels\UnboundedChannel.cs (7)
367Debug.Assert(SyncObj != null, "The sync obj must not be null."); 368Debug.Assert(Monitor.IsEntered(SyncObj), "Invariants can only be validated while holding the lock."); 374Debug.Assert(_blockedReaders.IsEmpty, "There's data available, so there shouldn't be any blocked readers."); 375Debug.Assert(_waitingReadersTail == null, "There's data available, so there shouldn't be any waiting readers."); 377Debug.Assert(!_completion.Task.IsCompleted, "We still have data available, so shouldn't be completed."); 381Debug.Assert(_items.IsEmpty, "There are blocked/waiting readers, so there shouldn't be any data available."); 385Debug.Assert(_doneWriting != null, "We're completed, so we must be done writing.");
System.Threading.Tasks.Dataflow (407)
Base\DataflowBlock.cs (53)
126Debug.Assert(source != null, "Filtered link requires a source to filter on."); 127Debug.Assert(target != null, "Filtered link requires a target to filter to."); 128Debug.Assert(predicate != null, "Filtered link requires a predicate to filter with."); 141Debug.Assert(_userProvidedPredicate != null, "User-provided predicate is required."); 173Debug.Assert(messageHeader.IsValid, "Only valid messages may be consumed."); 182Debug.Assert(messageHeader.IsValid, "Only valid messages may be consumed."); 191Debug.Assert(messageHeader.IsValid, "Only valid messages may be consumed."); 228Debug.Assert(filter != null, "Need a filter with which to construct the debug view."); 336Debug.Assert(false, "A message should never be postponed when no source has been provided"); 340Debug.Assert(false, "The message should never be missed, as it's offered to only this one target"); 358Debug.Assert(source != null, "The SendAsyncSource instance must have been constructed."); 414Debug.Assert(target != null, "A valid target to send to is required."); 518Debug.Assert(completionAction != null, "Completion action to run is required."); 527Debug.Assert(_cancellationRegistration != default(CancellationTokenRegistration), 567Debug.Assert(source._cancellationState != CANCELLATION_STATE_NONE, 608Debug.Assert(_cancellationState == CANCELLATION_STATE_COMPLETING, 620Debug.Assert(false, "The message should never be missed, as it's offered to only this one target"); 663Debug.Assert( 764Debug.Assert(source != null, "Need a source with which to construct the debug view."); 1007Debug.Assert(source != null, "Need a source from which to receive."); 1261Debug.Assert(Volatile.Read(ref _cleanupReserved), "Should only be called once by whomever reserved the right."); 1343Debug.Assert(false, "Invalid linking cleanup reason specified."); 1569Debug.Assert(target != null, "The target should never be null; this should be checked by all internal usage."); 1570Debug.Assert(source != null, "The source should never be null; this should be checked by all internal usage."); 1667Debug.Assert(propagator != null, "Need a block with which to construct the debug view."); 1906Debug.Assert(source1 != null && action1 != null, "The first source and action should not be null."); 1907Debug.Assert(source2 != null && action2 != null, "The second source and action should not be null."); 1908Debug.Assert((source3 == null) == (action3 == null), "The third action should be null iff the third source is null."); 1909Debug.Assert(dataflowBlockOptions != null, "Options are required."); 1953Debug.Assert(source != null, "Expected a non-null source"); 1954Debug.Assert(action != null, "Expected a non-null action"); 1955Debug.Assert(branchId >= 0, "Expected a valid branch ID (> 0)"); 1956Debug.Assert(scheduler != null, "Expected a non-null scheduler"); 1991Debug.Assert(source1 != null && action1 != null, "The first source and action should not be null."); 1992Debug.Assert(source2 != null && action2 != null, "The second source and action should not be null."); 1993Debug.Assert((source3 == null) == (action3 == null), "The third action should be null iff the third source is null."); 1994Debug.Assert(dataflowBlockOptions != null, "Options are required."); 2040Debug.Assert(resultBranchId < tasks.Length, "Expected a valid branch ID"); 2041Debug.Assert(successfulBranchId == -1, "There should be at most one successful branch."); 2044else Debug.Assert(resultBranchId == -1, "Expected -1 as a signal of a non-successful branch"); 2166Debug.Assert(completed != null, "Requires a shared target to complete."); 2266Debug.Assert(source != null, "Requires a source for which to retrieve the observable."); 2284Debug.Assert(source != null, "The observable requires a source to wrap."); 2333Debug.Assert(_observersState.Unlinker == null, "The source should not be linked to the target."); 2358Debug.Assert(observer != null, "Expected an observer."); 2364Debug.Assert(currentState != null, "Observer state should never be null."); 2392Debug.Assert(currentState != null, "Observer state should never be null."); 2393Debug.Assert(currentState.Unlinker != null, "The target should be linked."); 2394Debug.Assert(currentState.Canceler != null, "The target should have set up continuations."); 2426Debug.Assert(observable != null, "Need a block with which to construct the debug view."); 2461Debug.Assert(observable != null, "Observe state must be mapped to a source observable."); 2555Debug.Assert(Target.Completion.IsCompleted, "The target must have already completed in order to notify of completion."); 2627Debug.Assert(target != null, "A target to observe is required.");
Base\DataflowBlockOptions.cs (9)
113Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 125Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 136Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 156Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 175Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 291Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 314Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 423Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 434Debug.Assert(this != Default, "Default instance is supposed to be immutable.");
Base\DataflowLinkOptions.cs (3)
85Debug.Assert(this != Default && this != UnlinkAfterOneAndPropagateCompletion, "Default and UnlinkAfterOneAndPropagateCompletion instances are supposed to be immutable."); 96Debug.Assert(this != Default && this != UnlinkAfterOneAndPropagateCompletion, "Default and UnlinkAfterOneAndPropagateCompletion instances are supposed to be immutable."); 108Debug.Assert(this != Default && this != UnlinkAfterOneAndPropagateCompletion, "Default and UnlinkAfterOneAndPropagateCompletion instances are supposed to be immutable.");
Blocks\ActionBlock.cs (6)
112Debug.Assert(asyncAction != null, "action is of incorrect delegate type"); 128Debug.Assert((_spscTarget != null) ^ (_defaultTarget != null), "One and only one of the two targets must be non-null after construction"); 159Debug.Assert(action != null, "action needed for processing"); 204Debug.Assert(completed != null, "Need completed task for processing"); 205Debug.Assert(completed.IsCompleted, "The task to be processed must be completed by now."); 336Debug.Assert(actionBlock != null, "Need a block with which to construct the debug view.");
Blocks\BatchBlock.cs (34)
84Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 202Debug.Assert(batchBlock != null, "Need a block with which to construct the debug view"); 293Debug.Assert(batchSize > 0, "A positive batch size is required"); 309Debug.Assert(owningBatch != null, "This batch target core must be associated with a batch block."); 310Debug.Assert(batchSize >= 1, "Batch sizes must be positive."); 311Debug.Assert(batchCompletedAction != null, "Completion action must be specified."); 312Debug.Assert(dataflowBlockOptions != null, "Options required to configure the block."); 381Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 409Debug.Assert(_nonGreedyState != null, "_nonGreedyState must have been initialized during construction in non-greedy mode."); 461Debug.Assert(_nonGreedyState != null && _nonGreedyState.TaskForInputProcessing != null, 622Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 637Debug.Assert(BatchesNeedProcessing, "There must be a batch that needs processing."); 666Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 755Debug.Assert(!_dataflowBlockOptions.Greedy, "This method may only be used in non-greedy mode."); 756Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 773Debug.Assert(_messages.Count == 0, "The queue must be empty between batches in non-greedy mode"); 785Debug.Assert(allowFewerThanBatchSize ? poppedInitially > 0 : poppedInitially == _batchSize, 819Debug.Assert(reserved.Count <= _batchSize, "Expected the number of reserved sources to be <= the number needed for a batch."); 872Debug.Assert(_dataflowBlockOptions.Greedy, "This method may only be used in greedy mode."); 873Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 874Debug.Assert(_boundingState != null, "Bounding state is required when in bounded mode."); 902Debug.Assert(poppedInitially > 0, "We received fewer than we expected based on the previous check."); 931Debug.Assert(reserved.Count <= itemCountNeededToCompleteBatch, "Expected the number of reserved sources to be <= the number needed for a batch."); 981Debug.Assert(!_dataflowBlockOptions.Greedy, "This method may only be used in non-greedy mode."); 982Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 983Debug.Assert(_nonGreedyState.ReservedSourcesTemp != null, "ReservedSourcesTemp should have been initialized."); 1031Debug.Assert(_dataflowBlockOptions.Greedy, "This method may only be used in greedy mode."); 1032Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 1033Debug.Assert(_nonGreedyState.ReservedSourcesTemp != null, "ReservedSourcesTemp should have been initialized."); 1034Debug.Assert(_boundingState != null, "Bounded state is required for bounded mode."); 1086Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 1087Debug.Assert(_nonGreedyState.ReservedSourcesTemp != null, "Should have been initialized"); 1117Debug.Assert(numItemsRemoved > 0, "Should only be called for a positive number of items removed."); 1128Debug.Assert(_boundingState.CurrentCount - numItemsRemoved >= 0,
Blocks\BatchedJoinBlock.cs (21)
102Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 149Debug.Assert(_target1 != null, "_target1 not initialized"); 150Debug.Assert(_target2 != null, "_target2 not initialized"); 164Debug.Assert(_sharedResources != null, "_sharedResources not initialized"); 165Debug.Assert(_sharedResources._incomingLock != null, "_sharedResources._incomingLock not initialized"); 166Debug.Assert(_source != null, "_source not initialized"); 230Debug.Assert(batchedJoinBlock != null, "Need a block with which to construct the debug view."); 354Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 404Debug.Assert(_target1 != null, "_target1 not initialized"); 405Debug.Assert(_target2 != null, "_target2 not initialized"); 406Debug.Assert(_target3 != null, "_target3 not initialized"); 421Debug.Assert(_sharedResources != null, "_sharedResources not initialized"); 422Debug.Assert(_sharedResources._incomingLock != null, "_sharedResources._incomingLock not initialized"); 423Debug.Assert(_source != null, "_source not initialized"); 488Debug.Assert(batchedJoinBlock != null, "Need a block with which to construct the debug view."); 546Debug.Assert(sharedResources != null, "Targets require a shared resources through which to communicate."); 586Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 652Debug.Assert(batchedJoinBlockTarget != null, "Need a block with which to construct the debug view."); 685Debug.Assert(batchSize >= 1, "A positive batch size is required."); 686Debug.Assert(batchSizeReachedAction != null, "Need an action to invoke for each batch."); 687Debug.Assert(allTargetsDecliningAction != null, "Need an action to invoke when all targets have declined.");
Blocks\BroadcastBlock.cs (26)
79Debug.Assert(dataflowBlockOptions.BoundedCapacity > 0, "Positive bounding count expected; should have been verified by options ctor"); 94Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 127Debug.Assert(storeExceptionEvenIfAlreadyCompleting || !revertProcessingState, 142Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 194Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 209Debug.Assert(_boundingState != null && _boundingState.PostponedMessages != null, 224Debug.Assert(numItemsRemoved > 0, "Should only be called for a positive number of items removed."); 235Debug.Assert(_boundingState.CurrentCount - numItemsRemoved >= 0, 250Debug.Assert(_boundingState != null, "Must be in bounded mode."); 285Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 287Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 331Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 333Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 464Debug.Assert(broadcastBlock != null, "Need a block with which to construct the debug view."); 553Debug.Assert(owningSource != null, "Must be associated with a broadcast block."); 554Debug.Assert(dataflowBlockOptions != null, "Options are required to configure this block."); 674Debug.Assert(target != null, "Target required to offer messages to."); 711else Debug.Assert(result != DataflowMessageStatus.NotAvailable, "Messages from a Broadcast should never be missed."); 744Debug.Assert(_messages.Count > 0, "There must be at least one message to dequeue."); 816Debug.Assert(false, "Messages from a Broadcast should never be missed."); 944Debug.Assert(_taskForOutputProcessing == null, "There must be no processing tasks."); 945Debug.Assert( 1162Debug.Assert(exception != null, "An exception to add is required."); 1163Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions."); 1174Debug.Assert(exceptions != null, "A list of exceptions to add is required."); 1175Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions.");
Blocks\BufferBlock.cs (13)
76Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 119Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 135Debug.Assert(_boundingState != null && _boundingState.PostponedMessages != null, 162Debug.Assert(storeExceptionEvenIfAlreadyCompleting || !revertProcessingState, 177Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 225Debug.Assert(numItemsRemoved > 0, "A positive number of items to remove is required."); 236Debug.Assert(_boundingState.CurrentCount - numItemsRemoved >= 0, 251Debug.Assert(_boundingState != null, "Must be in bounded mode."); 287Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 289Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 333Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 335Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 448Debug.Assert(bufferBlock != null, "Need a block with which to construct the debug view.");
Blocks\JoinBlock.cs (42)
98Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 136Debug.Assert(_target1 != null, "_target1 not initialized"); 137Debug.Assert(_target2 != null, "_target2 not initialized"); 151Debug.Assert(_sharedResources != null, "_sharedResources not initialized"); 152Debug.Assert(_sharedResources._exceptionAction != null, "_sharedResources._exceptionAction not initialized"); 211Debug.Assert(joinBlock != null, "Need a block with which to construct the debug view."); 323Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 361Debug.Assert(_target1 != null, "_target1 not initialized"); 362Debug.Assert(_target2 != null, "_target2 not initialized"); 363Debug.Assert(_target3 != null, "_target3 not initialized"); 378Debug.Assert(_sharedResources != null, "_sharedResources not initialized"); 379Debug.Assert(_sharedResources._exceptionAction != null, "_sharedResources._exceptionAction not initialized"); 441Debug.Assert(joinBlock != null, "Need a block with which to construct the debug view."); 514Debug.Assert(sharedResources != null, "Targets need shared resources through which to communicate."); 530Debug.Assert(_messages != null, "_messages must have been initialized in greedy mode"); 531Debug.Assert(_messages.Count >= 0, "A message must have been consumed by this point."); 536Debug.Assert(_nonGreedy!.ConsumedMessage.Key, "A message must have been consumed by this point."); 561Debug.Assert(_messages != null, "_messages must have been initialized in greedy mode"); 596Debug.Assert(_sharedResources._dataflowBlockOptions.Greedy, "This is only valid in greedy mode"); 613Debug.Assert(!_sharedResources._dataflowBlockOptions.Greedy, "This is only used in non-greedy mode"); 620Debug.Assert(!HasAtLeastOneMessageAvailable, "The queue must be empty between joins in non-greedy mode"); 653Debug.Assert(!_sharedResources._dataflowBlockOptions.Greedy, "This is only used in non-greedy mode"); 654Debug.Assert(_nonGreedy!.ReservedMessage.Key != null, "This target must have a reserved message"); 680Debug.Assert(!_nonGreedy.ConsumedMessage.Key, "There must be no other consumed message"); 695Debug.Assert(_sharedResources._dataflowBlockOptions.Greedy, "This is only used in greedy mode"); 696Debug.Assert(_sharedResources._boundingState != null, "This is only used in bounding mode"); 780Debug.Assert(_nonGreedy != null, "Only valid in non-greedy mode."); 791Debug.Assert(_nonGreedy == null || _nonGreedy.ReservedMessage.Key == null, 855Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 879Debug.Assert(_nonGreedy != null, "_nonGreedy must have been initialized during construction in non-greedy mode."); 910Debug.Assert(_messages != null, "_messages must be initialized in greedy mode."); 977Debug.Assert(joinBlockTarget != null, "Need a target with which to construct the debug view."); 1043Debug.Assert(ownerJoin != null, "Resources must be associated with a join."); 1044Debug.Assert(targets != null, "Resources must be shared between multiple targets."); 1045Debug.Assert(joinFilledAction != null, "An action to invoke when a join is created must be provided."); 1046Debug.Assert(exceptionAction != null, "An action to invoke for faults must be provided."); 1047Debug.Assert(dataflowBlockOptions != null, "Options must be provided to configure the resources."); 1277Debug.Assert(JoinNeedsProcessing, "There must be a join that needs processing."); 1358Debug.Assert(!_dataflowBlockOptions.Greedy || _boundingState != null, "This only makes sense in non-greedy or bounding mode"); 1397Debug.Assert(_targets.Length > 0, "A join must have targets."); 1424Debug.Assert(numItemsRemoved > 0, "Number of items removed needs to be positive."); 1435Debug.Assert(_boundingState.CurrentCount - numItemsRemoved >= 0,
Blocks\TransformBlock.cs (7)
101Debug.Assert(transformSync == null ^ transformAsync == null, "Exactly one of transformSync and transformAsync must be null."); 132Debug.Assert(transformAsync != null, "Incorrect delegate type."); 157Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 228Debug.Assert(transform != null, "Function to invoke is required."); 273Debug.Assert(completed != null, "Completed task is required."); 274Debug.Assert(completed.IsCompleted, "Task must be completed to be here."); 423Debug.Assert(transformBlock != null, "Need a block with which to construct the debug view.");
Blocks\TransformManyBlock.cs (11)
153Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 256Debug.Assert(completed != null, "A task should have been provided."); 257Debug.Assert(completed.IsCompleted, "The task should have been in a final state."); 295Debug.Assert(false, "The task should have been in a final state."); 350Debug.Assert(_reorderingBuffer != null, "Expected a reordering buffer"); 351Debug.Assert(id != Common.INVALID_REORDERING_ID, "This ID should never have been handed out."); 438Debug.Assert(_reorderingBuffer == null, "Expected not to have a reordering buffer"); 439Debug.Assert(outputItems is TOutput[] || outputItems is List<TOutput>, "outputItems must be a list we've already vetted as trusted"); 538Debug.Assert(_target.IsBounded, "Expected to be in bounding mode."); 541else Debug.Assert(count == 1, "Count shouldn't be negative."); 629Debug.Assert(transformManyBlock != null, "Need a block with which to construct the debug view.");
Blocks\TransformManyBlock.IAsyncEnumerable.cs (2)
122Debug.Assert(_reorderingBuffer is not null, "Expected a reordering buffer"); 123Debug.Assert(id != Common.INVALID_REORDERING_ID, "This ID should never have been handed out.");
Blocks\WriteOnceBlock.cs (6)
114Debug.Assert(_decliningPermanently, "We may get here only after we have started to decline permanently."); 115Debug.Assert(_completionReserved, "We may get here only after we have reserved completion."); 173Debug.Assert(_lazyCompletionTaskSource == null || !_lazyCompletionTaskSource.Task.IsCompleted, "The task completion source must not be completed. This must be the only thread that ever completes the block."); 227Debug.Assert(exception != null || !storeExceptionEvenIfAlreadyCompleting, 437Debug.Assert(_header.IsValid, "A valid header is required."); 534Debug.Assert(writeOnceBlock != null, "Need a block with which to construct the debug view.");
Internal\ActionOnDispose.cs (4)
33Debug.Assert(action != null, "Non-null disposer action required."); 48Debug.Assert(action != null, "Non-null disposer action required."); 76Debug.Assert(action != null, "Non-null action needed for disposable"); 117Debug.Assert(action != null, "Non-null action needed for disposable");
Internal\Common.cs (40)
48Debug.Assert(syncObj != null, "The monitor object to check must be provided."); 49Debug.Assert(Monitor.IsEntered(syncObj) == held, "The locking scheme was not correctly followed."); 71Debug.Assert(predicate != null, "Non-null predicate to execute is required."); 95Debug.Assert(wr != null, "Expected a WeakReference<T> as the state argument"); 104Debug.Assert(block != null, "Block required to extract an Id."); 120Debug.Assert(block != null, "Should only be used with valid objects being displayed in the debugger."); 121Debug.Assert(options == null || options.NameFormat != null, "If options are provided, NameFormat must be valid."); 152Debug.Assert(exception != null, "An exception to check for cancellation must be provided."); 178Debug.Assert(completionTask != null, "A task to wire up for completion is needed."); 179Debug.Assert(completeAction != null, "An action to invoke upon cancellation is required."); 214Debug.Assert(exception != null && exception.StackTrace == null, 230Debug.Assert(exc != null, "The exception into which data should be stored must be provided."); 274Debug.Assert(exception != null, "An exception is needed to store the data into."); 275Debug.Assert(key != null, "A key into the exception's data collection is needed."); 276Debug.Assert(value != null, "The value to store must be provided."); 313Debug.Assert(exception != null, "An exception to add is required."); 314Debug.Assert(!unwrapInnerExceptions || exception.InnerException != null, 374Debug.Assert(cancellationToken.IsCancellationRequested, 377Debug.Assert(t.IsCanceled, "Task's constructor should cancel the task synchronously in the ctor."); 386Debug.Assert(block != null, "We need a block from which to retrieve a cancellation task."); 407Debug.Assert(outgoingLock != null, "Monitor object needed to protect the operation."); 408Debug.Assert(targetRegistry != null, "Registry from which to remove is required."); 409Debug.Assert(targetBlock != null, "Target block to unlink is required."); 454Debug.Assert(task != null, "Task to start is required."); 455Debug.Assert(scheduler != null, "Scheduler on which to start the task is required."); 472Debug.Assert(task != null, "Task to start is needed."); 473Debug.Assert(scheduler != null, "Scheduler on which to start the task is required."); 484Debug.Assert(task.IsFaulted, "The task should have been faulted if it failed to start."); 501Debug.Assert(target != null, "There must be a subject target."); 502Debug.Assert(postponedMessages != null, "The stacked map of postponed messages must exist."); 519Debug.Assert(sourceAndMessage.Key != null, "Postponed messages must have an associated source."); 533Debug.Assert(processedCount == initialCount, 548Debug.Assert(sourceCompletionTask != null, "sourceCompletionTask may not be null."); 549Debug.Assert(target != null, "The target where completion is to be propagated may not be null."); 550Debug.Assert(sourceCompletionTask.IsCompleted, "sourceCompletionTask must be completed in order to propagate its completion."); 571Debug.Assert(sourceCompletionTask != null, "sourceCompletionTask may not be null."); 572Debug.Assert(target != null, "The target where completion is to be propagated may not be null."); 582Debug.Assert(sourceCompletionTask != null, "sourceCompletionTask may not be null."); 583Debug.Assert(target != null, "The target where completion is to be propagated may not be null."); 628Debug.Assert(boundedCapacity > 0, "Bounded is only supported with positive values.");
Internal\DataflowEtwProvider.cs (11)
66Debug.Assert(block != null, "Block needed for the ETW event."); 67Debug.Assert(dataflowBlockOptions != null, "Options needed for the ETW event."); 94Debug.Assert(block != null, "Block needed for the ETW event."); 95Debug.Assert(task != null, "Task needed for the ETW event."); 96Debug.Assert(reason == TaskLaunchedReason.ProcessingInputMessages || reason == TaskLaunchedReason.OfferingOutputMessages, 130Debug.Assert(block != null, "Block needed for the ETW event."); 135Debug.Assert(blockIsCompleted, "Block must be completed for this event to be valid."); 181Debug.Assert(source != null, "Source needed for the ETW event."); 182Debug.Assert(target != null, "Target needed for the ETW event."); 203Debug.Assert(source != null, "Source needed for the ETW event."); 204Debug.Assert(target != null, "Target needed for the ETW event.");
Internal\EnumerableDebugView.cs (1)
29Debug.Assert(enumerable != null, "Expected a non-null enumerable.");
Internal\ImmutableArray.cs (1)
41Debug.Assert(elements != null, "Requires an array to wrap.");
Internal\QueuedMap.cs (11)
78Debug.Assert(0 <= _freeIndex && _freeIndex < _storage.Count, "Index is out of range."); 93Debug.Assert(_tailIndex == TERMINATOR_INDEX, "If head indicates empty, so too should tail."); 99Debug.Assert(_tailIndex != TERMINATOR_INDEX, "If head does not indicate empty, neither should tail."); 116Debug.Assert(_tailIndex == TERMINATOR_INDEX, "If head indicates empty, so too should tail."); 122Debug.Assert(0 <= _headIndex && _headIndex < _storage.Count, "Head is out of range."); 140Debug.Assert(0 <= index && index < _storage.Count, "Index is out of range."); 144Debug.Assert(idx != index, "Index should not belong to the list of free slots."); 211Debug.Assert(items != null, "Requires non-null array to store into."); 212Debug.Assert(count >= 0 && arrayOffset >= 0, "Count and offset must be non-negative"); 213Debug.Assert(arrayOffset + count >= 0, "Offset plus count overflowed"); 214Debug.Assert(arrayOffset + count <= items.Length, "Range must be within array size");
Internal\ReorderingBuffer.cs (7)
59Debug.Assert(owningSource != null, "Buffer must be associated with a source."); 60Debug.Assert(outputAction != null, "Action required for when items are to be released."); 71Debug.Assert(id != Common.INVALID_REORDERING_ID, "This ID should never have been handed out."); 86Debug.Assert((ulong)id > (ulong)_nextReorderedIdToOutput, "Duplicate id."); 97Debug.Assert(id != Common.INVALID_REORDERING_ID, "This ID should never have been handed out."); 123Debug.Assert(id != Common.INVALID_REORDERING_ID, "This ID should never have been handed out."); 188Debug.Assert(buffer != null, "Need a buffer with which to construct the debug view.");
Internal\SourceCore.cs (20)
108Debug.Assert(owningSource != null, "Core must be associated with a source."); 109Debug.Assert(dataflowBlockOptions != null, "Options must be provided to configure the core."); 110Debug.Assert(completeAction != null, "Action to invoke on completion is required."); 264Debug.Assert(!_enableOffering, "Offering should have been disabled if there was a valid reservation"); 412Debug.Assert(items != null, "Items list must be valid."); 462Debug.Assert(exception != null, "Valid exception must be provided to be added."); 463Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions."); 474Debug.Assert(exceptions != null, "Valid exceptions must be provided to be added."); 475Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions."); 489Debug.Assert(aggregateException != null && aggregateException.InnerExceptions.Count > 0, "Aggregate must be valid and contain inner exceptions to unwrap."); 490Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions."); 579Debug.Assert(linkToTarget != null, "Must have a valid target to offer to."); 628Debug.Assert(false, "The target did not follow the protocol."); 673Debug.Assert(target != null, "Valid target to offer to is required."); 678Debug.Assert(result != DataflowMessageStatus.NotAvailable, "Messages are not being offered concurrently, so nothing should be missed."); 696Debug.Assert(result == DataflowMessageStatus.Postponed, 741Debug.Assert(_taskForOutputProcessing == null && _enableOffering && !_messages.IsEmpty, 800Debug.Assert(_taskForOutputProcessing != null && _taskForOutputProcessing.Id == Task.CurrentId, 858Debug.Assert(_taskForOutputProcessing != null && _taskForOutputProcessing.Id == Task.CurrentId, 912Debug.Assert(
Internal\SpscTargetCore.cs (7)
77Debug.Assert(owningTarget != null, "Expected non-null owningTarget"); 78Debug.Assert(action != null, "Expected non-null action"); 79Debug.Assert(dataflowBlockOptions != null, "Expected non-null dataflowBlockOptions"); 193Debug.Assert( 256Debug.Assert(previousConsumer != null && previousConsumer.Id == Task.CurrentId, 324Debug.Assert(_completionReserved, "Should only invoke once completion has been reserved."); 341Debug.Assert(result, "Expected completion task to not yet be completed");
Internal\TargetCore.cs (30)
114Debug.Assert(owningTarget != null, "Core must be associated with a target block."); 115Debug.Assert(dataflowBlockOptions != null, "Options must be provided to configure the core."); 116Debug.Assert(callAction != null, "Action to invoke for each item is required."); 129Debug.Assert(_dataflowBlockOptions.BoundedCapacity > 0, "Positive bounding count expected; should have been verified by options ctor"); 143Debug.Assert(storeExceptionEvenIfAlreadyCompleting || !revertProcessingState, 153Debug.Assert(_numberOfOutstandingOperations > 0 || !storeExceptionEvenIfAlreadyCompleting, 168Debug.Assert(_numberOfOutstandingOperations > 0 && (!UsesAsyncCompletion || _numberOfOutstandingServiceTasks > 0), 208Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 218Debug.Assert(messageId != Common.INVALID_REORDERING_ID, "The assigned message ID is invalid."); 227Debug.Assert(_boundingState != null && _boundingState.PostponedMessages != null, 259Debug.Assert(_numberOfOutstandingOperations > 0, "Operations may only be completed if any are outstanding."); 265Debug.Assert(boundingCountChange <= 0 && _boundingState.CurrentCount + boundingCountChange >= 0, 295Debug.Assert(_numberOfOutstandingOperations >= 0, "Number of outstanding operations should never be negative."); 296Debug.Assert(_numberOfOutstandingServiceTasks >= 0, "Number of outstanding service tasks should never be negative."); 297Debug.Assert(_numberOfOutstandingOperations >= _numberOfOutstandingServiceTasks, "Number of outstanding service tasks should never exceed the number of outstanding operations."); 311Debug.Assert(_numberOfOutstandingOperations >= 0, "Number of outstanding operations should never be negative."); 312Debug.Assert(_numberOfOutstandingServiceTasks >= 0, "Number of outstanding service tasks should never be negative."); 313Debug.Assert(_numberOfOutstandingOperations >= _numberOfOutstandingServiceTasks, "Number of outstanding service tasks should never exceed the number of outstanding operations."); 354Debug.Assert(HasRoomForMoreServiceTasks, "There must be room to process asynchronously."); 424Debug.Assert( 495Debug.Assert(_numberOfOutstandingOperations > 0, "Expected a positive number of outstanding operations, since we're completing one here."); 502Debug.Assert(_numberOfOutstandingServiceTasks > 0, "Expected a positive number of outstanding service tasks, since we're completing one here."); 523Debug.Assert(UsesAsyncCompletion, "Only valid to use when in async mode."); 615Debug.Assert( 660Debug.Assert(messageId != Common.INVALID_REORDERING_ID, "The assigned message ID is invalid."); 664Debug.Assert(_boundingState.OutstandingTransfers >= 0, "Expected TryConsumePostponedMessage to not be negative."); 730Debug.Assert((_decliningPermanently && _messages.IsEmpty) || CanceledOrFaulted, "There must be no more messages."); 758lock (IncomingLock) Debug.Assert(_numberOfOutstandingOperations == 0, "Everything must be done by now."); 811Debug.Assert(count != 0, "Should only be called when the count is actually changing."); 817Debug.Assert(count > 0 || (count < 0 && _boundingState.CurrentCount + count >= 0),
Internal\TargetRegistry.cs (29)
37Debug.Assert(target != null, "The target that is supposed to be linked must not be null."); 38Debug.Assert(linkOptions != null, "The linkOptions must not be null."); 74Debug.Assert(owningSource != null, "The TargetRegistry instance must be owned by a source block."); 85Debug.Assert(target != null, "The target that is supposed to be linked must not be null."); 86Debug.Assert(linkOptions != null, "The link options must not be null."); 97Debug.Assert(_linksWithRemainingMessages >= 0, "_linksWithRemainingMessages must be non-negative at any time."); 121Debug.Assert(target != null, "Target to remove is required."); 124Debug.Assert(_linksWithRemainingMessages >= 0, "_linksWithRemainingMessages must be non-negative at any time."); 138Debug.Assert(target != null, "Target to remove is required."); 141Debug.Assert(_linksWithRemainingMessages >= 0, "_linksWithRemainingMessages must be non-negative at any time."); 142Debug.Assert(!onlyIfReachedMaxMessages || _linksWithRemainingMessages > 0, "We shouldn't have ended on the slow path."); 148Debug.Assert(node != null, "The LinkedTargetInfo node referenced in the Dictionary must be non-null."); 159Debug.Assert(_linksWithRemainingMessages >= 0, "_linksWithRemainingMessages must be non-negative at any time."); 169Debug.Assert(node.RemainingMessages > 1, "The target should have been removed, because there are no remaining messages."); 184Debug.Assert(_linksWithRemainingMessages >= 0, "_linksWithRemainingMessages must be non-negative at any time."); 194Debug.Assert(_owningSource.Completion.IsCompleted, "The owning source must have completed before propagating completion."); 214Debug.Assert(node != null, "Requires a node to be added."); 223Debug.Assert(_firstTarget != null && _lastTarget != null, "Both first and last node must either be null or non-null."); 224Debug.Assert(_lastTarget.Next == null, "The last node must not have a successor."); 225Debug.Assert(_firstTarget.Previous == null, "The first node must not have a predecessor."); 243Debug.Assert(_firstTarget != null && _lastTarget != null, "Both first and last node must be non-null after AddToList."); 250Debug.Assert(node != null, "Node to remove is required."); 251Debug.Assert(_firstTarget != null && _lastTarget != null, "Both first and last node must be non-null before RemoveFromList."); 273Debug.Assert((_firstTarget != null) == (_lastTarget != null), "Both first and last node must either be null or non-null after RemoveFromList."); 312Debug.Assert(owningSource != null, "Propagator must be associated with a source."); 313Debug.Assert(target != null, "Target to propagate to is required."); 323Debug.Assert(source == _owningSource, "Only valid to be used with the source for which it was created."); 378Debug.Assert(passthrough != null, "Need a propagator with which to construct the debug view."); 398Debug.Assert(registry != null, "Need a registry with which to construct the debug view.");
src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (13)
67Debug.Assert(InitialSegmentSize > 0, "Initial segment size must be > 0."); 68Debug.Assert((InitialSegmentSize & (InitialSegmentSize - 1)) == 0, "Initial segment size must be a power of 2"); 69Debug.Assert(InitialSegmentSize <= MaxSegmentSize, "Initial segment size should be <= maximum."); 70Debug.Assert(MaxSegmentSize < int.MaxValue / 2, "Max segment size * 2 must be < int.MaxValue, or else overflow could occur."); 102Debug.Assert(segment != null, "Expected a non-null segment."); 112Debug.Assert(newSegmentSize > 0, "The max size should always be small enough that we don't overflow."); 179Debug.Assert(segment != null, "Expected a non-null segment."); 180Debug.Assert(array != null, "Expected a non-null item array."); 253Debug.Assert(segment != null, "Expected a non-null segment."); 254Debug.Assert(array != null, "Expected a non-null item array."); 368Debug.Assert(syncObj != null, "The syncObj parameter is null."); 390Debug.Assert((size & (size - 1)) == 0, "Size must be a power of 2"); 429Debug.Assert(queue != null, "Expected a non-null queue.");
System.Threading.Tasks.Parallel (12)
System\Threading\Tasks\Parallel.cs (9)
924Debug.Assert(((body == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) + (bodyWithLocal == null ? 0 : 1)) == 1, 926Debug.Assert(bodyWithLocal != null || (localInit == null && localFinally == null), 1645Debug.Assert(((body == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) + 1648Debug.Assert((bodyWithStateAndLocal != null) || (bodyWithEverything != null) || (localInit == null && localFinally == null), 1704Debug.Assert(parallelOptions != null, "ForEachWorker(array): parallelOptions is null"); 1763Debug.Assert(parallelOptions != null, "ForEachWorker(list): parallelOptions is null"); 2517Debug.Assert(((simpleBody == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) + 2520Debug.Assert((bodyWithStateAndLocal != null) || (bodyWithEverything != null) || (localInit == null && localFinally == null), 2524Debug.Assert((orderedSource != null) || (bodyWithStateAndIndex == null && bodyWithEverything == null),
System\Threading\Tasks\Parallel.ForEachAsync.cs (3)
625Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 632Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 689Debug.Assert(taskSet, "Complete should only be called once.");
System.Transactions.Local (38)
System\Transactions\Enlistment.cs (3)
93Debug.Assert(this is RecoveringInternalEnlistment, "this is RecoveringInternalEnlistment"); 103Debug.Assert(this is PromotableInternalEnlistment, "this is PromotableInternalEnlistment"); 164Debug.Assert(_transaction != null, "this.transaction != null");
System\Transactions\InternalTransaction.cs (1)
129Debug.Assert(_promotedTransaction == null, "A transaction can only be promoted once!");
System\Transactions\TransactionScope.cs (1)
804Debug.Assert(null != _dependentTransaction, "null != this.dependentTransaction");
System\Transactions\TransactionsEtwProvider.cs (7)
271Debug.Assert(transaction != null, "Transaction needed for the ETW event."); 595Debug.Assert(enlistment != null, "Enlistment needed for the ETW event."); 620Debug.Assert(enlistment != null, "Enlistment needed for the ETW event."); 645Debug.Assert(enlistment != null, "Enlistment needed for the ETW event."); 670Debug.Assert(enlistment != null, "Enlistment needed for the ETW event."); 696Debug.Assert(enlistment != null, "Enlistment needed for the ETW event."); 721Debug.Assert(enlistment != null, "Enlistment needed for the ETW event.");
System\Transactions\TransactionState.cs (24)
163Debug.Assert(tx.State != this, "Changing to the same state."); 788Debug.Assert(tx._promoterType != Guid.Empty, "InternalTransaction.PromoterType was not set in PSPEInitialize"); 835Debug.Assert(tx._promoter != null, "Transaction Promoter is Null entering SubordinateActive"); 1077Debug.Assert(tx._promoterType != Guid.Empty, "InternalTransaction.PromoterType was not set in Phase0PSPEInitialize"); 1266Debug.Assert(tx._phase1Volatiles._volatileEnlistmentCount == 1, 1668Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 1697Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 1727Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 1768Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 1803Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 2007Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 2101Debug.Assert(tx.promotedToken != null, "InternalTransaction.promotedToken is null in TransactionStateDelegatedNonMSDTCBase or one of its derived classes."); 2145Debug.Assert((tx._promoterType == Guid.Empty) || (tx._promoterType == TransactionInterop.PromoterTypeDtc), "Promoted to MSTC but PromoterType is not TransactionInterop.PromoterTypeDtc"); 2536Debug.Assert(tx._phase0Volatiles.VolatileDemux != null, "Volatile Demux must exist for VolatilePrepareDone when promoted."); 2644Debug.Assert(tx._phase1Volatiles.VolatileDemux != null, "Volatile Demux must exist for VolatilePrepareDone when promoted."); 2801Debug.Assert(tx._phase1Volatiles.VolatileDemux != null, "Volatile Demux must exist."); 2864Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 3494Debug.Assert(tx._durableEnlistment != null, "PromotedNonMSDTC state is not valid for transaction"); 3633Debug.Assert(tx.promotedToken != null, "InternalTransaction.promotedToken is null in TransactionStateDelegatedNonMSDTCBase or one of its derived classes."); 4265Debug.Assert((distributedTx == null), "PSPEPromote for non-MSDTC promotion returned a distributed transaction."); 4266Debug.Assert((tx.promotedToken != null), "PSPEPromote for non-MSDTC promotion did not set InternalTransaction.PromotedToken."); 4351Debug.Assert(tx.State == TransactionStateActive, "PSPEPromote called from state other than TransactionStateActive"); 4378Debug.Assert(tx.State == TransactionStatePhase0, "Phase0PSPEInitialize called from state other than TransactionStatePhase0"); 4401Debug.Assert(returnState == TransactionStateDelegated ||
System\Transactions\TransactionTable.cs (1)
671Debug.Assert(transactionCount == _index, "Index changed timing out transactions");
System\Transactions\VolatileEnlistmentMultiplexing.cs (1)
454Debug.Assert(_volatileDemux == null, "volatileDemux can only be set once.");
System.Web.HttpUtility (2)
src\libraries\Common\src\System\HexConverter.cs (2)
332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
System.Windows.Controls.Ribbon (22)
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonQuickAccessToolBarOverflowPanel.cs (2)
29Debug.Assert(child != null, "child not expected to be null"); 30Debug.Assert(RibbonQuickAccessToolBar.GetIsOverflowItem(child) == true, "child expected to have IsOverflowItem == true");
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonQuickAccessToolBarPanel.cs (1)
229Debug.Assert(overflowPanel.Children.Count >= overflowIndex, "overflowIndex should never get above overflowPanel.Children.Count");
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonWindowSmallIconConverter.cs (2)
91Debug.Assert(size.Width != 0, "input param width should not be zero"); 92Debug.Assert(size.Height != 0, "input param height should not be zero");
Microsoft\Windows\Controls\Ribbon\Ribbon.cs (1)
1674Debug.Assert(ItemContainerGenerator.Status == GeneratorStatus.ContainersGenerated, "Expected: containers should be generated before calling this method.");
Microsoft\Windows\Controls\Ribbon\RibbonGallery.cs (4)
1040Debug.Assert(selectedItem != null, "Must have a selectedItem to synchronize with."); 1081Debug.Assert(IsSynchronizedWithCurrentItemInternal, "We should add currency change listeners only when IsSynchronizedWithCurrentItemInternal is true"); 1159Debug.Assert(IsSynchronizedWithCurrentItemInternal, "We shouldn't be listening for currency changes if IsSynchronizedWithCurrentItemInternal is false"); 1182Debug.Assert(IsSynchronizedWithCurrentItemInternal, "We shouldn't be listening for currency changes if IsSynchronizedWithCurrentItemInternal is false");
Microsoft\Windows\Controls\Ribbon\RibbonGalleryCategory.cs (1)
516Debug.Assert(RibbonGallery == null || RibbonGallery.IsSynchronizedWithCurrentItemInternal, "We shouldn't be listening for currency changes if IsSynchronizedWithCurrentItemInternal is false");
Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs (9)
781Debug.Assert(category.RibbonGallery == gallery, "The reference RibbongalleryItem and the RibbonGallery must be related."); 944Debug.Assert(element != null, "Element must not be null"); 945Debug.Assert(routedEvent != null, "RoutedEvent must not be null"); 972Debug.Assert(element != null, "Element must not be null"); 973Debug.Assert(routedEvent != null, "RoutedEvent must not be null"); 2139Debug.Assert(clone is ButtonBase, 2172Debug.Assert(clone is ButtonBase || clone is RibbonMenuButton, 2210Debug.Assert(clone is ButtonBase || clone is RibbonMenuButton, 2230Debug.Assert(clone is RibbonMenuButton,
Microsoft\Windows\Controls\Ribbon\RibbonMenuItem.cs (2)
1177Debug.Assert(timer != null, "timer should not be null."); 1178Debug.Assert(!timer.IsEnabled, "timer should not be running.");
System.Windows.Input.Manipulations (36)
System\Windows\Input\Manipulations\InertiaProcessor2D.cs (7)
319Debug.Assert(!result, "Complete method is supposed to raise Completed event."); 615Debug.Assert(double.IsNaN(this.desiredDeceleration), "desiredDisplacement and desiredDeceleration are mutually exclusive."); 626Debug.Assert(double.IsNaN(this.desiredDisplacement), "desiredDisplacement and desiredDeceleration are mutually exclusive."); 672Debug.Assert( 795Debug.Assert(this.expansion.InitialValue > 0 && 840Debug.Assert(this.expansion.InitialValue > 0 && 958Debug.Assert(!double.IsNaN(resultValue) && !double.IsInfinity(resultValue), "Calculation error, value should be a finite number.");
System\Windows\Input\Manipulations\Manipulation2DCompletedEventArgs.cs (4)
38Debug.Assert(Validations.IsFinite(originX), "originX should be finite"); 39Debug.Assert(Validations.IsFinite(originY), "originY should be finite"); 40Debug.Assert(velocities != null, "velocities should not be null"); 41Debug.Assert(total != null, "total should not be null");
System\Windows\Input\Manipulations\Manipulation2DDeltaEventArgs.cs (5)
41Debug.Assert(Validations.IsFinite(originX), "originX should be finite"); 42Debug.Assert(Validations.IsFinite(originY), "originY should be finite"); 43Debug.Assert(velocities != null, "velocities should not be null"); 44Debug.Assert(delta != null, "delta should not be null"); 45Debug.Assert(cumulative != null, "cumulative should not be null");
System\Windows\Input\Manipulations\ManipulationDelta2D.cs (7)
105Debug.Assert(Validations.IsFinite(translationX), "translationX should be finite"); 106Debug.Assert(Validations.IsFinite(translationY), "translationY should be finite"); 107Debug.Assert(Validations.IsFinite(rotation), "rotation should be finite"); 108Debug.Assert(Validations.IsFiniteNonNegative(scaleX), "scaleX should be finite and not negative"); 109Debug.Assert(Validations.IsFiniteNonNegative(scaleY), "scaleY should be finite and not negative"); 110Debug.Assert(Validations.IsFinite(expansionX), "expansionX should be finite"); 111Debug.Assert(Validations.IsFinite(expansionY), "expansionY should be finite");
System\Windows\Input\Manipulations\ManipulationProcessor2D.cs (1)
331Debug.Assert(this.currentManipulation == null, "Manipulation was already in progress");
System\Windows\Input\Manipulations\ManipulationSequence.cs (8)
432Debug.Assert(this.processorState == ProcessorState.Manipulating, "Wrong state."); 514Debug.Assert(Started != null, "Processor hasn't registered for Started event"); 521Debug.Assert(Delta != null, "Processor hasn't registered for Delta event"); 581Debug.Assert(Completed != null, "Processor hasn't registered for Completed event"); 667Debug.Assert(this.processorState == ProcessorState.Manipulating, "Invalid state."); 949Debug.Assert(settings.Pivot != null, "don't call unless we have a settings.Pivot"); 950Debug.Assert(settings.Pivot.HasPosition, "don't call unless there's a settings.Pivot location"); 1101Debug.Assert(timeDelta >= ManipulationProcessor2D.TimestampTicksPerMillisecond,
System\Windows\Input\Manipulations\ManipulationVelocities2D.cs (4)
112Debug.Assert(getLinearVelocityX != null, "getLinearVelocityX should not be null"); 113Debug.Assert(getLinearVelocityY != null, "getLinearVelocityX should not be null"); 114Debug.Assert(getAngularVelocity != null, "getLinearVelocityX should not be null"); 115Debug.Assert(getExpansionVelocity != null, "getLinearVelocityX should not be null");
System.Xaml (59)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Context\XamlFrame.cs (1)
46Debug.Assert(_depth != -1, "Context Frame is uninitialized");
src\Microsoft.DotNet.Wpf\src\Shared\MS\Utility\FrugalList.cs (2)
188Debug.Assert(start >= _previousEnd, "Arguments out of order during Compact"); 189Debug.Assert(_validItemCount + end - start <= _newCount, "Too many items copied during Compact");
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (3)
133Debug.Assert(null != type, "Type passed to IsInternalType is null"); 154Debug.Assert(null != type, "Type passed to IsPublicType is null"); 449Debug.Assert(!assemblyPath.EndsWith(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal), "the assembly path should be a full file path containing file extension");
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\TypeConverterHelper.cs (1)
120Debug.Assert(null != type, "Null passed for type to GetConverterType");
System\Xaml\Context\ObjectWriterContext.cs (1)
78Debug.Assert(rootNameScope == null, "Cannot pass a new namescope in to a reparse context");
System\Xaml\Context\XamlContext.cs (2)
259Debug.Assert(typeName != null, "typeName cannot be null and should have been checked before now"); 260Debug.Assert(typeName.Name != null, "typeName.Name cannot be null and should have been checked before now");
System\Xaml\InfosetObjects\XamlNodes.cs (7)
53Debug.Assert(false, "XamlNode Ctor missing data argument"); 68Debug.Assert(data is XamlType, "XamlNode ctor, StartObject data is not a XamlType"); 72Debug.Assert(data is XamlMember, "XamlNode ctor, StartMember data is not a XamlMember"); 76Debug.Assert(data is NamespaceDeclaration, "XamlNode ctor, NamespaceDeclaration data is not a NamespaceDeclaration"); 86Debug.Assert(data == null, "XamlNode ctor, Internal XamlNode data must be null for this Node type"); 90Debug.Assert(false, "XamlNode ctor, incorrect ctor called."); 101Debug.Assert(internalNodeType == InternalNodeType.EndOfAttributes ||
System\Xaml\InfosetObjects\XamlObjectWriter.cs (2)
151Debug.Assert(_context.SourceBamlUri == null || _context.BaseUri == null || _context.SourceBamlUri == _context.BaseUri, 1816Debug.Assert(ctx.ParentType.IsCollection, "Logic_WillParentCollectionAdd called on a non-collection");
System\Xaml\InfosetObjects\XamlXmlReader.cs (1)
258Debug.Assert(_current.IsEof, "Xaml Parser returned an illegal internal XamlNode");
System\Xaml\MS\Impl\XmlNsInfo.cs (1)
125Debug.Assert(Assembly != null, "RefOnly assemblies shouldn't be GCed");
System\Xaml\Parser\NodeStreamSorter.cs (1)
641Debug.Assert(false, "Missing End Object in node sorter");
System\Xaml\Parser\XamlScanner.cs (1)
829Debug.Assert(_accumulatedText != null, "Creating unnecessary XamlText objects");
System\Xaml\Schema\Reflector.cs (1)
349Debug.Assert((flagMask & 0xFFFF) == flagMask, "flagMask should only use lower 16 bits of int");
System\Xaml\Schema\TypeReflector.cs (11)
306Debug.Assert(_positionalParameterTypes != null, "TryGetPositionalParameters should have been called first"); 428Debug.Assert(UnderlyingType != null, "Caller should check for UnderlyingType == null"); 439Debug.Assert(UnderlyingType != null, "Caller should check for UnderlyingType == null"); 452Debug.Assert(UnderlyingType != null, "Caller should check for UnderlyingType == null"); 453Debug.Assert(_nonAttachableMemberCache != null, "Members property should have been invoked before this"); 465Debug.Assert(UnderlyingType != null, "Caller should check for UnderlyingType == null"); 466Debug.Assert(_nonAttachableMemberCache != null, "Members property should have been invoked before this"); 685Debug.Assert(UnderlyingType != null, "Caller should check for UnderlyingType == null"); 702Debug.Assert(UnderlyingType != null, "Caller should check for UnderlyingType == null"); 952Debug.Assert(UnderlyingType != null, "Caller should check for UnderlyingType == null"); 953Debug.Assert(_attachableMemberCache != null, "AttachableMembers property should have been invoked before this");
System\Xaml\Schema\XamlNamespace.cs (1)
99Debug.Assert(typeArgs.Length > 0, "This method should only be called for generic types.");
System\Xaml\XamlMember.cs (2)
341Debug.Assert(_declaringType != null, "XamlDirective should not call base.ToString"); 993Debug.Assert(DeclaringType != null, "XamlDirective should not call into base.GetHashCode");
System\Xaml\XamlType.cs (21)
199Debug.Assert(_reflector != null, "_reflector should have been initialized by IsDictionary"); 216Debug.Assert(_reflector != null, "_reflector should have been initialized by GetCollectionKind"); 235Debug.Assert(_reflector != null, "_reflector should have been initialized by GetCollectionKind"); 253Debug.Assert(_reflector != null, "_reflector should have been initialized by IsCollection"); 323Debug.Assert(_reflector != null, "_reflector should have been initialized by IsMarkupExtension"); 498Debug.Assert(_reflector != null, "_reflector should have been initialized by ItemType"); 566Debug.Assert(_reflector != null, "_reflector should have been initialized by GetCollectionKind"); 775Debug.Assert(_reflector != null, "_reflector should have been initialized by AreAttributesAvailable"); 812Debug.Assert(_reflector != null, "_reflector should have been initialized by AreAttributesAvailable"); 897Debug.Assert(_reflector != null, "_reflector should have been initialized by AreAttributesAvailable"); 909Debug.Assert(_reflector != null, "_reflector should have been initialized by AreAttributesAvailable"); 967Debug.Assert(_reflector != null, "_reflector should have been initialized by AreAttributesAvailable"); 1131Debug.Assert(_reflector != null, "_reflector should have been initialized by AreAttributesAvailable"); 1143Debug.Assert(_reflector != null, "_reflector should have been initialized by AreAttributesAvailable"); 1153Debug.Assert(_reflector != null, "_reflector should have been initialized by AreAttributesAvailable"); 1197Debug.Assert(_reflector != null, "_reflector should have been initialized by AreAttributesAvailable"); 1239Debug.Assert(_reflector != null, "_reflector should have been initialized by AreAttributesAvailable"); 1256Debug.Assert(_reflector != null, "_reflector should have been initialized by AreAttributesAvailable"); 1328Debug.Assert(UnderlyingTypeInternal.IsSet, "EnsureReflector should have caused UnderlyingType to be initialized"); 1560Debug.Assert(GetType() != typeof(XamlType), "Default GetAllMembers logic should have already captured all writeable properties"); 1691Debug.Assert(_reflector != null, "_reflector should have been initialized by AreAttributesAvailable");
UIAutomationClient (28)
MS\Internal\Automation\Accessible.cs (1)
23Debug.Assert(acc != null, "null IAccessible");
MS\Internal\Automation\CacheHelper.cs (4)
75Debug.Assert(response.RequestedData == null, "both RequestedData and TreeStructure should be null or non-null"); 105Debug.Assert(false, "Internal error: got malformed tree description string (extra chars at end)"); 111Debug.Assert(false, "Internal error: mismatch between count of property buckets and nodes claiming them"); 231Debug.Assert(false, "Internal error: Got malformed tree description string, missing closing paren");
MS\Internal\Automation\ClientEventManager.cs (1)
470Debug.Assert(false, "GetNewRootTracker internal error: Unexpected Tracker value!");
MS\Internal\Automation\FocusTracker.cs (1)
83Debug.Assert(acc != null, "HandleFocusChange got hwnd and null IAccessible");
MS\Internal\Automation\HwndProxyElementProvider.cs (4)
385Debug.Assert(false,"unexpected switch() case:"); 1434Debug.Assert(false, "too many children or inf loop?"); 1894Debug.Assert(false, "too many children or inf loop?"); 2136Debug.Assert(provider is IRawElementProviderFragment, "Expecting a fragment provider");
MS\Internal\Automation\MenuTracker.cs (1)
76Debug.Assert(handlers.Length <= 1, "handlers.Length");
MS\Internal\Automation\Misc.cs (1)
159Debug.Assert(false, "missing client-side pattern wrapper");
MS\Internal\Automation\ProxyManager.cs (1)
689Debug.Assert(false, "unexpected switch() case:");
MS\Internal\Automation\QueueProcessor.cs (3)
82Debug.Assert(!_quitting, "Can't add items to queue when quitting"); 92Debug.Assert(!_quitting, "Can't add items to queue when quitting"); 147Debug.Assert(_quitting, "MsgWaitForMultipleObjects failed while WaitForWork");
MS\Internal\Automation\Schema.cs (3)
67Debug.Assert( false, "GetPropertyInfo failed " + id ); 79Debug.Assert(false, "GetDefaultValue was passed an unknown property"); 115Debug.Assert( false, "GetAttributeInfo failed " + id );
MS\Internal\Automation\UiaCoreApi.cs (5)
245Debug.Assert(false, "unsupported property should not have made it this far"); 456Debug.Assert(offsets == null && treeStructures == null, "if nothin found, all out params shoud be null"); 648Debug.Assert(false, "Got unknown eventId from core: " + args._eventId); 666Debug.Assert(false, "Got unknown propertyId from core: " + pcargs._propertyId); 707Debug.Assert(false, "Unknown event type from core:" + args._type);
MS\Internal\Automation\WindowHideOrCloseTracker.cs (1)
90Debug.Assert(handlers.Length <= 1, "handlers.Length");
MS\Internal\Automation\WindowShowOrOpenTracker.cs (1)
88Debug.Assert(handlers.Length <= 1, "handlers.Length");
MS\Internal\Automation\WinEventWrap.cs (1)
37Debug.Assert(eventIds != null && eventIds.Length > 0, "eventIds is invalid");
UIAutomationClientSideProviders (51)
MS\Internal\AutomationProxies\Accessible.cs (5)
151Debug.Assert(acc != null, "null IAccessible"); 706Debug.Assert( false, "Need to handle Accessible.accFocus case!" ); 945System.Diagnostics.Debug.Assert(false, "Call to AccessibleChildren() returned E_INVALIDARG."); 1402Debug.Assert(false, string.Format(CultureInfo.CurrentCulture, "MsaaNativeProvider: IAccessible threw a COMException: {0}", e.Message)); 1419Debug.Assert(false, string.Format(CultureInfo.CurrentCulture, "Unexpected IAccessible exception: {0}", e));
MS\Internal\AutomationProxies\CommonGetThemePartSize.cs (1)
99System.Diagnostics.Debug.Assert (false, "Unsupport Type");
MS\Internal\AutomationProxies\MSAANativeProvider.cs (1)
57Debug.Assert(acc != null, "acc");
MS\Internal\AutomationProxies\NonClientArea.cs (1)
119System.Diagnostics.Debug.Assert(idChild == 0, string.Format(CultureInfo.CurrentCulture, "Invalid Child Id, idChild == {2}\n\rClassName: \"{0}\"\n\rhwnd = 0x{1:x8}", Misc.ProxyGetClassName(hwnd), hwnd.ToInt32(), idChild));
MS\Internal\AutomationProxies\ProxyFragment.cs (3)
126System.Diagnostics.Debug.Assert(this is ProxyHwnd, "Invalid method called ElementProviderFromPoint"); 213System.Diagnostics.Debug.Assert(fragment != null, "DrillDownFragment: starting point is null"); 218System.Diagnostics.Debug.Assert(fromPoint != null, @"DrillDownFragment: calling ElementProviderFromPoint on Fragment should not return null");
MS\Internal\AutomationProxies\ProxySimple.cs (2)
255System.Diagnostics.Debug.Assert(_sAutomationId != null, "_sAutomationId is null!"); 454System.Diagnostics.Debug.Assert(_parent != null, "Navigate: Leaf element does not have parent");
MS\Internal\AutomationProxies\QueueProcessor.cs (1)
129Debug.Assert(false, "MsgWaitForMultipleObjects failed while WaitForWork");
MS\Internal\AutomationProxies\WindowsEditBox.cs (13)
441Debug.Assert(point.x >= 0 && point.x < 65536, "WindowsEditBox.CharFromPos() x coordinate out of range."); 442Debug.Assert(point.y >= 0 && point.y < 65536, "WindowsEditBox.CharFromPos() y coordinate out of range."); 556Debug.Assert(hfont != IntPtr.Zero, "WindowsEditBox.GetLogfont got null HFONT"); 561Debug.Assert(false, "WindowsEditBox.GetObject unexpected return value"); 682Debug.Assert(index >= 0, "WindowsEditBox.LineFromChar negative index."); 683Debug.Assert(index <= GetTextLength(), "WindowsEditBox.LineFromChar index out of range."); 742Debug.Assert(index >= 0, "WindowsEditBox.PosFromChar negative index."); 743Debug.Assert(index < GetTextLength(), "WindowsEditBox.PosFromChar index out of range."); 746Debug.Assert(result!=-1, "WindowsEditBox.PosFromChar index out of bounds."); 801Debug.Assert(start >= 0, "WindowsEditBox.SetSel negative start."); 802Debug.Assert(start <= GetTextLength(), "WindowsEditBox.SetSel start out of range."); 803Debug.Assert(end >= 0, "WindowsEditBox.SetSel negative end."); 804Debug.Assert(end <= GetTextLength(), "WindowsEditBox.SetSel end out of range.");
MS\Internal\AutomationProxies\WindowsIPAddress.cs (1)
107System.Diagnostics.Debug.Assert (index != -1, "GetOverrideProviderForHwnd: cannot find child hwnd index");
MS\Internal\AutomationProxies\WindowsListBox.cs (3)
608System.Diagnostics.Debug.Assert (IsMultipleSelection (), "Calling ClearAll on single-selected listbox"); 924System.Diagnostics.Debug.Assert (_parent is WindowsListBox, "Invalid Parent for a Listbox Item"); 1192System.Diagnostics.Debug.Assert (_listBox.IsMultipleSelection (), "Calling UnSelect on single-selected listbox");
MS\Internal\AutomationProxies\WindowsListViewGroup.cs (2)
554System.Diagnostics.Debug.Assert (!WindowsListView.IsDetailMode (hwnd), "GetColumnCountExternal: called when lv is in Detail mode"); 804System.Diagnostics.Debug.Assert (false, "GetCountOfItemsInDimension: failed to get item rect");
MS\Internal\AutomationProxies\WindowsListViewGroupHelper.cs (3)
413System.Diagnostics.Debug.Assert(false, "Cannot add item to the needed group"); 438System.Diagnostics.Debug.Assert(false, "Cannot add item to the needed group"); 802System.Diagnostics.Debug.Assert(min <= _items.Length, "EnsureCapacity: min is > _items.Length");
MS\Internal\AutomationProxies\WindowsListViewItem.cs (2)
504System.Diagnostics.Debug.Assert (parent != null, "Hit null while looking for the SelectionContainer"); 732System.Diagnostics.Debug.Assert (WindowsListView.IsGroupViewEnabled (hwnd), "GetGroupID: called when lv does not have groups");
MS\Internal\AutomationProxies\WindowsListViewItemStartMenu.cs (2)
52System.Diagnostics.Debug.Assert(false, "The listview item on the Start Menu has an unexpected IAccessible role!"); 90System.Diagnostics.Debug.Assert(AccessibleObject != null, "Failed to get a valid IAccessible!");
MS\Internal\AutomationProxies\WindowsMenu.cs (3)
121System.Diagnostics.Debug.Assert(idObject == NativeMethods.OBJID_MENU || idObject == NativeMethods.OBJID_SYSMENU, "Unexpected idObject"); 1359System.Diagnostics.Debug.Assert(false, "Cannot find back the accelerator in the menu!"); 2704System.Diagnostics.Debug.Assert (name.Length > hotKeyStart + 1, "Unexpected end of string");
MS\Internal\AutomationProxies\WindowsTab.cs (2)
1185System.Diagnostics.Debug.Assert(false, "XSendMessage.GetItem() failed!"); 1199System.Diagnostics.Debug.Assert(_parent is WindowsTab, "Invalid Parent for a Tab Item");
MS\Internal\AutomationProxies\WindowsToolbarAsMenu.cs (1)
49System.Diagnostics.Debug.Assert(false, "Unexpected role " + role);
MS\Internal\AutomationProxies\WindowsToolbarItemAsMenuItem.cs (1)
42System.Diagnostics.Debug.Assert(false, "Unexpected role " + role);
MS\Internal\AutomationProxies\WindowsTreeView.cs (1)
1065System.Diagnostics.Debug.Assert (topLevelParent is WindowsTreeView, "Invalid Parent for a TreeView Item");
MS\Internal\AutomationProxies\WinEventTracker.cs (3)
272Debug.Assert(false, "Exception raising event " + eventId + " for prop " + ecp._idProp + " on hwnd " + hwnd + "\n" + e.Message); 317Debug.Assert(false, "Exception raising event " + eventId + " for prop " + ecp._idProp + " on hwnd " + hwnd + "\n" + e.Message); 461Debug.Assert (hwnd == IntPtr.Zero, @"BuildEventsList: event is global but hwnd is not null");
UIAutomationTypes (3)
System\Windows\Automation\AutomationIdentifier.cs (3)
127Debug.Assert(obj != null, "Null obj!"); 131Debug.Assert(obj is AutomationIdentifier, "CompareTo called with unexpected type"); 171default: Debug.Assert(false, "Invalid type specified for AutomationIdentifier");
WindowsFormsIntegration (6)
System\Windows\Integration\ApplicationInterop.cs (1)
147Debug.Assert(processedState == SWF.PreProcessControlState.MessageNotNeeded, "invalid state");
System\Windows\Integration\ElementHost.cs (2)
1596Debug.Assert(request != null, "request was null!"); 1615Debug.Assert(false, "Unknown FocusNavigationDirection");
System\Windows\Integration\WindowsFormsHost.cs (3)
893Debug.Assert(false, "Unknown FocusNavigationDirection"); 991Debug.Assert(uiAction == NativeMethods.UIS_INITIALIZE || uiAction == NativeMethods.UIS_SET, "Unexpected uiAction"); 1118Debug.Assert(methodInfo != null, "Couldn't find OnParentRightToLeftChanged method!");