33637 references to Assert
Analyzer.Utilities.UnitTests (1)
FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAnalysisTests.cs (1)
78Debug.Assert(cfg != null);
aspire (3)
Commands\PublishCommandBase.cs (1)
332Debug.Assert(stepId != null, "Activity data should have a StepId for task activities.");
src\Shared\CircularBuffer.cs (2)
129Debug.Assert(!_buffer.Contains(removedItem), "Item was not correctly removed."); 202Debug.Assert(!_buffer.Contains(removedItem), "Item was not correctly removed.");
Aspire.Azure.AI.Inference (1)
src\Components\Common\AzureComponent.cs (1)
66Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.AI.OpenAI (1)
src\Components\Common\AzureComponent.cs (1)
66Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.Data.Tables (1)
src\Components\Common\AzureComponent.cs (1)
66Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.Messaging.EventHubs (1)
src\Components\Common\AzureComponent.cs (1)
66Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.Messaging.ServiceBus (1)
src\Components\Common\AzureComponent.cs (1)
66Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.Messaging.WebPubSub (1)
src\Components\Common\AzureComponent.cs (1)
66Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.Search.Documents (1)
src\Components\Common\AzureComponent.cs (1)
66Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.Security.KeyVault (1)
src\Components\Common\AzureComponent.cs (1)
66Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.Storage.Blobs (1)
src\Components\Common\AzureComponent.cs (1)
66Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.Storage.Queues (1)
src\Components\Common\AzureComponent.cs (1)
66Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Dashboard (34)
Components\Controls\Chart\MetricTable.razor.cs (1)
42Debug.Assert(_jsModule != null, "The module should be initialized before chart data is sent to control.");
Components\Controls\Chart\PlotlyChart.razor.cs (1)
57Debug.Assert(_jsModule != null, "The module should be initialized before chart data is sent to control.");
Components\Interactions\InteractionsProvider.cs (2)
234Debug.Assert(currentDialogReference != null, "Dialog should have been created in UI thread."); 394Debug.Assert(message != null, "Message should have been created in UI thread.");
Components\Pages\ConsoleLogs.razor.cs (2)
197Debug.Assert(added, "Should not receive duplicate resources in initial snapshot data."); 626Debug.Assert(removed, "Cannot remove unknown resource.");
Components\Pages\Resources.razor.cs (2)
246Debug.Assert(added, "Should not receive duplicate resources in initial snapshot data."); 281Debug.Assert(removed, "Cannot remove unknown resource.");
Configuration\DashboardOptions.cs (4)
100Debug.Assert(_primaryApiKeyBytes is not null, "Should have been parsed during validation."); 176Debug.Assert(_parsedEndpointAddresses is not null, "Should have been parsed during validation."); 270Debug.Assert(_nameClaimTypes is not null, "Should have been parsed during validation."); 276Debug.Assert(_usernameClaimTypes is not null, "Should have been parsed during validation.");
DashboardWebApplication.cs (2)
856Debug.Assert(_validationFailures.Count == 0, "Validation failures: " + Environment.NewLine + string.Join(Environment.NewLine, _validationFailures)); 862Debug.Assert(_validationFailures.Count == 0, "Validation failures: " + Environment.NewLine + string.Join(Environment.NewLine, _validationFailures));
Model\ConsoleLogsManager.cs (1)
40Debug.Assert(_filters != null, "There should be filters if manager has been initialized.");
Model\PauseManager.cs (2)
62Debug.Assert(intervals.Length > 0, "There should be at least one interval."); 64Debug.Assert(lastInterval.End is null, "The last interval should not have an end time if unpausing.");
Model\ResourceOutgoingPeerResolver.cs (2)
37Debug.Assert(added, "Should not receive duplicate resources in initial snapshot data."); 63Debug.Assert(removed, "Cannot remove unknown resource.");
Model\ThemeManager.cs (1)
98Debug.Assert(_effectiveTheme != null, "There should be an effective theme if theme manager has been initialized.");
Otlp\Model\OtlpApplication.cs (1)
271Debug.Assert(result, "Guid.TryFormat not successful.");
Otlp\Storage\TelemetryRepository.cs (3)
779Debug.Assert(_tracesLock.IsReadLockHeld || _tracesLock.IsWriteLockHeld, $"Must get lock before calling {nameof(GetTraceUnsynchronized)}."); 794Debug.Assert(_tracesLock.IsReadLockHeld || _tracesLock.IsWriteLockHeld, $"Must get lock before calling {nameof(GetSpanUnsynchronized)}."); 1024Debug.Assert(_traces.Contains(trace), "Trace not found in traces collection.");
ServiceClient\DashboardClient.cs (2)
178Debug.Assert( 190Debug.Assert(
src\Shared\CircularBuffer.cs (2)
129Debug.Assert(!_buffer.Contains(removedItem), "Item was not correctly removed."); 202Debug.Assert(!_buffer.Contains(removedItem), "Item was not correctly removed.");
src\Shared\CompareHelpers.cs (1)
30Debug.Assert(encodedByteCount == requestBytesSpan.Length, "Should match because span was previously trimmed to byte count value.");
src\Shared\ConsoleLogs\LogEntries.cs (3)
85Debug.Assert(logLine.Timestamp == null || logLine.Timestamp.Value.Kind == DateTimeKind.Utc, "Timestamp should always be UTC."); 188Debug.Assert(BaseLineNumber != null, "Should be set before this method is run."); 193Debug.Assert(pause.EndTime is not null, "Pause should have ended before trying to insert another log.");
Telemetry\DashboardTelemetrySender.cs (2)
43Debug.Assert(Client is not null, "HttpClient must be initialized."); 92Debug.Assert(State == TelemetrySessionState.Uninitialized, "Telemetry session has already been started.");
Aspire.Hosting (16)
ApplicationModel\InteractionService.cs (1)
157Debug.Assert(
ApplicationModel\ResourceLoggerService.cs (1)
432Debug.Assert(_backlog.EntriesCount == 0, "The backlog should be empty if there are no subscribers.");
Dashboard\DashboardLifecycleHook.cs (3)
52Debug.Assert(executionContext.IsRunMode, "Dashboard resource should only be added in run mode"); 204Debug.Assert(options.DashboardUrl is not null, "DashboardUrl should not be null"); 205Debug.Assert(options.OtlpGrpcEndpointUrl is not null || options.OtlpHttpEndpointUrl is not null, "OtlpGrpcEndpointUrl and OtlpHttpEndpointUrl should not both be null");
Dcp\DcpExecutor.cs (2)
118Debug.Assert(_dcpInfo is not null, "DCP info should not be null at this point"); 263Debug.Assert(!entry.LogsAvailable.HasValue || entry.LogsAvailable.Value, "entry.LogsAvailable should never be 'false'");
Orchestrator\ApplicationOrchestrator.cs (2)
173Debug.Assert(context.DcpResourceName is not null, "Container that is starting should always include the DCP name."); 208Debug.Assert(endpoint.AllocatedEndpoint is not null, "Endpoint should be allocated at this point as we're calling this from ResourceEndpointsAllocatedEvent handler.");
ProjectResourceBuilderExtensions.cs (1)
803Debug.Assert(!e.EndpointAnnotation.FromLaunchProfile, "Endpoints from launch profile should never make it here");
src\Shared\CircularBuffer.cs (2)
129Debug.Assert(!_buffer.Contains(removedItem), "Item was not correctly removed."); 202Debug.Assert(!_buffer.Contains(removedItem), "Item was not correctly removed.");
src\Shared\CompareHelpers.cs (1)
30Debug.Assert(encodedByteCount == requestBytesSpan.Length, "Should match because span was previously trimmed to byte count value.");
src\Shared\ConsoleLogs\LogEntries.cs (3)
85Debug.Assert(logLine.Timestamp == null || logLine.Timestamp.Value.Kind == DateTimeKind.Utc, "Timestamp should always be UTC."); 188Debug.Assert(BaseLineNumber != null, "Should be set before this method is run."); 193Debug.Assert(pause.EndTime is not null, "Pause should have ended before trying to insert another log.");
Aspire.Hosting.Analyzers (1)
Infrastructure\WellKnownTypes.cs (1)
43Debug.Assert(name == typeIdName, $"Enum name ({typeIdName}) and type name ({name}) must match at {i}");
Aspire.Hosting.Azure.CosmosDB (2)
AzureCosmosDBResource.cs (1)
129Debug.Assert(!UseAccessKeyAuthentication, "AddRoleAssignments should not be called when using AccessKeyAuthentication");
src\Shared\Cosmos\CosmosUtils.cs (1)
76Debug.Assert(accountEndpoint is not null ^ connectionString is not null, "only one should be set.");
Aspire.Hosting.Azure.PostgreSQL (1)
AzurePostgresFlexibleServerResource.cs (1)
125Debug.Assert(!UsePasswordAuthentication, "AddRoleAssignments should not be called when using UsePasswordAuthentication");
Aspire.Hosting.Azure.Redis (1)
AzureRedisCacheResource.cs (1)
87Debug.Assert(!UseAccessKeyAuthentication, "AddRoleAssignments should not be called when using AccessKeyAuthentication");
Aspire.Microsoft.Azure.Cosmos (1)
src\Shared\Cosmos\CosmosUtils.cs (1)
76Debug.Assert(accountEndpoint is not null ^ connectionString is not null, "only one should be set.");
Aspire.Microsoft.EntityFrameworkCore.Cosmos (1)
src\Shared\Cosmos\CosmosUtils.cs (1)
76Debug.Assert(accountEndpoint is not null ^ connectionString is not null, "only one should be set.");
BuildActionTelemetryTable (4)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (2)
25Debug.Assert(descriptor.CustomTags is ImmutableArray<string>); 51Debug.Assert(reportDiagnostic != ReportDiagnostic.Default);
ClientSample (3)
Tcp\SocketAwaitable.cs (1)
36Debug.Assert(ReferenceEquals(_callback, _callbackCompleted));
Tcp\SocketSender.cs (2)
82Debug.Assert(!buffer.IsEmpty); 83Debug.Assert(!buffer.IsSingleSegment);
CodeGenerator (7)
HttpUtilities\HttpUtilities.cs (1)
308Debug.Assert(str.Length == sizeof(ulong), string.Format(CultureInfo.InvariantCulture, "String must be exactly {0} (ASCII) characters long.", sizeof(ulong)));
src\Servers\Kestrel\shared\KnownHeaders.cs (4)
773Debug.Assert(requestHeaders.Length <= 64); 774Debug.Assert(requestHeaders.Max(x => x.Index) <= 62); 778Debug.Assert(responseHeaders.Length <= 63); 779Debug.Assert(responseHeaders.Count(x => x.Index == 63) == 1);
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http3\QPack\HeaderField.cs (1)
17Debug.Assert(name.Length > 0);
CodeStyleConfigFileGenerator (4)
Program.cs (2)
49Debug.Assert(language is "CSharp" or "VisualBasic"); 122Debug.Assert(sortedRulesById.Count > 0);
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
ConfigurationSchemaGenerator (1)
ConfigurationBindingGenerator.ForSchemaGeneration.cs (1)
66Debug.Assert(_typesToParse.Count == 1, "there should only be one type to parse to start.");
csc (3)
src\Compilers\Core\CommandLine\BuildProtocol.cs (2)
71Debug.Assert(!string.IsNullOrWhiteSpace(CompilerHash), "A hash value is required to communicate with the server"); 83Debug.Assert(!string.IsNullOrWhiteSpace(compilerHash), "CompilerHash is required to send request to the build server");
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (1)
138Debug.Assert(false, e.Message);
CSharpSyntaxGenerator (7)
SourceWriter.cs (1)
1534System.Diagnostics.Debug.Assert(!IsRequiredFactoryField(nd, field));
src\Compilers\CSharp\Portable\Syntax\SyntaxKindFacts.cs (6)
22Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 151Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 181Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 187Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 193Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 1241Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i));
DesignSurface (1)
CustomControls\DesignerActionVerbItem.cs (1)
12Debug.Assert(verb is not null, "All callers check whether the verb is null.");
dotnet-dev-certs (3)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
655Debug.Assert(pemEnvelope != null);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
90Debug.Assert(oldTrustLevel == TrustLevel.Full); // Mac trust is all or nothing
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
334Debug.Assert(IsCommandAvailable(OpenSslCommand), "How did we trust without the openssl command?");
dotnet-svcutil-lib (202)
Bootstrapper\SvcutilBootstrapper.cs (1)
111Debug.Assert(frameworkInfo.IsDnx, "The bootstrapper has been enabled for a non-DNX platform!");
CmdCredentialsProvider.cs (2)
188System.Diagnostics.Debug.Assert(_serviceUri == null, "provider already started for the specified service URI"); 199System.Diagnostics.Debug.Assert(_serviceUri == serviceUri, "provider not statrted for the specified service URI");
CodeDomFixup\CodeDomVisitors\CreateCallbackImpl.cs (2)
234System.Diagnostics.Debug.Assert(!methodNames.ContainsKey(method.Name), $"Key '{method.Name}' already added to dictionary!"); 452System.Diagnostics.Debug.Assert((IsSyncOperationContract(method)), "Only support sync callback on immersive project");
CodeDomFixup\CodeDomVisitors\SpecialIXmlSerializableRemapper.cs (1)
101System.Diagnostics.Debug.Assert(!_specialIXmlSerializableTypes.ContainsKey(typeName), $"Key '{typeName}' already added to dictionary!");
CodeDomFixup\CodeDomVisitors\TypeDeclCollection.cs (1)
45System.Diagnostics.Debug.Assert(!AllTypeDecls.ContainsKey(fullName), $"Key '{fullName}' already added to dictionary!");
CodeDomFixup\EndpointSelector.cs (1)
274System.Diagnostics.Debug.Assert(singleSignedEncryptedParam, "Unexpected number of SignedEncrypted token parameters in transport security binding!");
CodeDomFixup\MethodCreationHelper.cs (1)
2172System.Diagnostics.Debug.Assert(endpointNames.Count == 1, "have and only have on endpoint has to exist for a given client type");
CommandLineParser.cs (1)
59System.Diagnostics.Debug.Assert(!s_allSwitches.Any(s => s.Equals(this)), $"A switch with name or abbreviation '{name}+{abbreviation}' has already been crated!");
CommandProcessorOptions.cs (3)
322Debug.Assert(this.ToolContext.HasValue, $"{nameof(ToolContext)} is not initialized!"); 323Debug.Assert(this.Verbosity.HasValue, $"{nameof(Verbosity)} is not initialized!"); 694Debug.Assert(this.BootstrapPath != null, $"{nameof(this.BootstrapPath)} is not initialized!");
FrameworkFork\Microsoft.CodeDom\Compiler\CompilerInfo.cs (1)
75Debug.Assert(_providerOptions != null, "Created CompilerInfo w/ null _providerOptions");
FrameworkFork\Microsoft.CodeDom\Compiler\IndentTextWriter.cs (1)
95Debug.Assert(value >= 0, "Bogus Indent... probably caused by mismatched Indent++ and Indent--");
FrameworkFork\Microsoft.CodeDom\System\CodeTypeReference.cs (1)
265Debug.Assert(q.Count == 1, "We should have one and only one in the rank queue.");
FrameworkFork\Microsoft.CodeDom\System\FixedStringLookup.cs (2)
48Debug.Assert(value.Length == i + 1, "Lookup table contains an item in the wrong subtable. Item name: " + value); 51Debug.Assert(string.Compare(lastValue, value, ((ignoreCase) ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal)) < 0,
FrameworkFork\Microsoft.Xml\Xml\BinaryXml\XmlBinaryReader.cs (8)
2015Debug.Assert(_mark <= _end, "Mark should never be past End"); 2016Debug.Assert(_mark <= _pos, "Mark should never be after Pos"); 2772Debug.Assert(_stringValue == null, "this.stringValue == null"); 2773Debug.Assert(_token == BinXmlToken.CData, "this.token == BinXmlToken.CData"); 3505Debug.Assert(_checkCharacters, "this.checkCharacters"); 3507Debug.Assert(0 == ((_pos - _tokDataPos) & 1), "Data size should not be odd"); 3567Debug.Assert(!_checkCharacters, "!this.checkCharacters"); 3570Debug.Assert(0 == ((_pos - _tokDataPos) & 1), "Data size should not be odd");
FrameworkFork\Microsoft.Xml\Xml\BitStack.cs (2)
51Debug.Assert(_curr != 0x1, "Stack empty"); 72Debug.Assert(_curr != 0x1, "Stack empty");
FrameworkFork\Microsoft.Xml\Xml\Cache\XPathDocumentBuilder.cs (5)
313Debug.Assert(_idxParent != 0, "ID attribute must have an element parent"); 543Debug.Assert(prefix.Equals("xml"), "xmlns:xml namespace declaration should always be present in the list."); 695Debug.Assert(_lineInfo.HasLineInfo(), "HasLineInfo should have been checked before this."); 759Debug.Assert(_textBldr.HasText || (_idxSibling == 0 && _idxParent == 0), "Cannot create empty text node unless it's a top-level text node."); 760Debug.Assert(_idxSibling == 0 || !_pageSibling[_idxSibling].IsText, "Cannot create adjacent text nodes.");
FrameworkFork\Microsoft.Xml\Xml\Cache\XPathDocumentNavigator.cs (2)
87Debug.Assert(false, "ReadStringValue() should have taken care of these node types."); 91Debug.Assert(_idxParent != 0 && _pageParent[_idxParent].HasCollapsedText,
FrameworkFork\Microsoft.Xml\Xml\Cache\XPathNode.cs (10)
158Debug.Assert(HasCollapsedText, "Do not call CollapsedLinePosition unless HasCollapsedText is true."); 213Debug.Assert(localName == null || (object)Document.NameTable.Get(localName) == (object)localName, "localName must be atomized."); 225Debug.Assert(localName == null || (object)Document.NameTable.Get(localName) == (object)localName, "localName must be atomized."); 374Debug.Assert(lineNumOffset >= 0 && lineNumOffset <= MaxLineNumberOffset, "Line number offset too large or small: " + lineNumOffset); 375Debug.Assert(linePosOffset >= 0 && linePosOffset <= MaxLinePositionOffset, "Line position offset too large or small: " + linePosOffset); 385Debug.Assert(posOffset >= 0 && posOffset <= MaxCollapsedPositionOffset, "Collapsed text line position offset too large or small: " + posOffset); 441Debug.Assert(pageSibling != null && idxSibling != 0 && idxSibling <= UInt16.MaxValue, "Bad argument"); 442Debug.Assert(_idxSibling == 0, "SetSibling should not be called more than once."); 460Debug.Assert(pageSimilar != null && idxSimilar != 0 && idxSimilar <= UInt16.MaxValue, "Bad argument"); 461Debug.Assert(_idxSimilar == 0, "SetSimilarElement should not be called more than once.");
FrameworkFork\Microsoft.Xml\Xml\Cache\XPathNodeHelper.cs (23)
74Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 93Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 113Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 141Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 164Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 182Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 197Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 231Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 264Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 302Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 334Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 397Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 427Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 454Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 516Debug.Assert(pageCurrent != null && idxCurrent != 0, "Cannot pass null argument(s)"); 613Debug.Assert(pageCurrent != null && idxCurrent != 0, "Cannot pass null argument(s)"); 614Debug.Assert(typ != XPathNodeType.Text, "Text should be handled by GetTextFollowing in order to take into account collapsed text."); 615Debug.Assert(page[idx].NodeType != XPathNodeType.Attribute, "Current node should never be an attribute or namespace--caller should handle this case."); 652Debug.Assert(!page[idx].IsAttrNmsp, "GetContentFollowing should never return attributes or namespaces."); 671Debug.Assert(pageCurrent != null && idxCurrent != 0, "Cannot pass null argument(s)"); 672Debug.Assert(!page[idx].IsAttrNmsp, "Current node should never be an attribute or namespace--caller should handle this case."); 749Debug.Assert(pageNode[idxNode].HasAttribute || pageNode[idxNode].HasContentChild, "Caller must check HasAttribute/HasContentChild on parent before calling GetChild."); 750Debug.Assert(pageNode[idxNode].HasAttribute || !pageNode[idxNode].HasCollapsedText, "Text child is virtualized and therefore is not present in the physical node page.");
FrameworkFork\Microsoft.Xml\Xml\Core\XmlEventCache.cs (3)
248Debug.Assert(false, "Unknown event: " + page[idxEvent].EventType); 254Debug.Assert(false, "Unknown event should be added to end of event sequence."); 311Debug.Assert(false, "Unknown event should be added to end of event sequence.");
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextReaderImpl.cs (32)
774Debug.Assert(baseUriStr == string.Empty, "BaseURI can come either from XmlParserContext or from the constructor argument, not from both"); 1218Debug.Assert(false, "Invalid InitInputType"); 2071Debug.Assert(_v1Compat, "XmlTextReaderImpl.Normalization property cannot be accessed on reader created via XmlReader.Create."); 2076Debug.Assert(_v1Compat, "XmlTextReaderImpl.Normalization property cannot be changed on reader created via XmlReader.Create."); 2104Debug.Assert(_v1Compat, "XmlTextReaderImpl.WhitespaceHandling property cannot be accessed on reader created via XmlReader.Create."); 2109Debug.Assert(_v1Compat, "XmlTextReaderImpl.WhitespaceHandling property cannot be changed on reader created via XmlReader.Create."); 2128Debug.Assert(_v1Compat, "XmlTextReaderImpl.DtdProcessing property cannot be accessed on reader created via XmlReader.Create."); 2133Debug.Assert(_v1Compat, "XmlTextReaderImpl.DtdProcessing property cannot be changed on reader created via XmlReader.Create."); 2185Debug.Assert(_v1Compat, "XmlTextReaderImpl.ResetState cannot be called on reader created via XmlReader.Create."); 2226Debug.Assert(_v1Compat, "XmlTextReaderImpl.GetRemainder cannot be called on reader created via XmlReader.Create."); 2268Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadChars cannot be called on reader created via XmlReader.Create."); 2310Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadBase64 cannot be called on reader created via XmlReader.Create."); 2347Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadBinHex cannot be called on reader created via XmlReader.Create."); 3123Debug.Assert(false, "Unhandled DtdProcessing enumeration value."); 3352Debug.Assert(_ps.appendMode, "UnDecodeChars cannot be called after ps.appendMode has been changed to false"); 3354Debug.Assert(_ps.charsUsed >= _ps.charPos, "The current position must be in the valid character range."); 3362Debug.Assert(_charactersInDocument >= _ps.charsUsed - _ps.charPos, 3370Debug.Assert(_charactersFromEntities >= _ps.charsUsed - _ps.charPos, 3587Debug.Assert(false, "We should get an exception again."); 4724Debug.Assert(false, "We should never get to this point."); 5015Debug.Assert(val == XmlComplianceUtil.CDataNormalize(val), "The attribute value is not CDATA normalized!"); 5438Debug.Assert(false, "We should never get to this point."); 7166Debug.Assert(false, "We should never get to this point."); 7272Debug.Assert(false, "We should never get to this point."); 8110Debug.Assert(_xmlResolver.SupportsType(uri, typeof(Stream)), "Stream must always be a supported type in XmlResolver"); 8653Debug.Assert(count == charsParsed || _incReadDecoder.IsFull, "Check if decoded consumed all characters unless it's full."); 8670Debug.Assert(IncrementalRead() == 0, "Previous call of IncrementalRead should eat up all characters!"); 8734Debug.Assert(_ps.eolNormalized, "Entity replacement text for attribute values should be EOL-normalized!"); 8788Debug.Assert(false, "We should never get to this point."); 8843Debug.Assert(false, "We should never get to this point."); 9143Debug.Assert(context.NameTable == null || context.NameTable == nt, "This check should have been done in XmlParserContext constructor."); 9246Debug.Assert(_curNode.type == XmlNodeType.Whitespace && newNodeType == XmlNodeType.SignificantWhitespace, "Incorrect node type change!");
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextReaderImplHelpers.cs (2)
465Debug.Assert(_valueStartPos >= 0 || _value != null, "Value not ready."); 708Debug.Assert(false, "We should never get to this point.");
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextWriter.cs (2)
1423Debug.Assert(declared == true, "Unexpected situation!!"); 1433Debug.Assert(false, "Should have never come here");
FrameworkFork\Microsoft.Xml\Xml\Core\XmlWellformedWriter.cs (4)
314Debug.Assert(false, "Expected currentState <= State.Error "); 1634Debug.Assert(false, "State.Attribute == currentState || State.RootLevelAttr == currentState"); 2061Debug.Assert(false, "We should not get to this point."); 2091Debug.Assert(false, "We should never get to this point. State = " + state);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlWellformedWriterHelpers.cs (1)
386Debug.Assert(false, "Unexpected ItemType value.");
FrameworkFork\Microsoft.Xml\Xml\Core\XmlWriterSettings.cs (3)
535Debug.Assert(false, "Invalid XmlOutputMethod setting."); 571Debug.Assert(false, "Invalid XmlOutputMethod setting."); 632Debug.Assert(false, "Invalid XmlOutputMethod setting.");
FrameworkFork\Microsoft.Xml\Xml\Dom\DocumentXPathNavigator.cs (3)
1326Debug.Assert(node1 != node2, "Should be handled by ComparePosition()"); 1861Debug.Assert(node != null, "Undefined navigator position"); 1862Debug.Assert(node == _document || node.OwnerDocument == _document, "Navigator switched documents");
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlNode.cs (1)
795Debug.Assert(true, "shouldn't have fall through here.");
FrameworkFork\Microsoft.Xml\Xml\Ref.cs (1)
21Debug.Assert(false, "Ref.Equal: Object comparison used for non-atomized string '" + strA + "'");
FrameworkFork\Microsoft.Xml\Xml\schema\DtdParser.cs (1)
3526Debug.Assert(false, "This is an unexpected error that should have been handled in the ScanXXX methods.");
FrameworkFork\Microsoft.Xml\Xml\schema\Inference\infer.cs (4)
276Debug.Assert(_rootSchema != null, "rootSchema is null"); 502Debug.Assert(targetNS == null || targetNS.Length > 0, "targetns for schema is empty"); 1753Debug.Assert(false, "Expected type not matched"); 2399Debug.Assert(false, "Expected date, time or dateTime");
FrameworkFork\Microsoft.Xml\Xml\schema\XmlAtomicValue.cs (8)
221default: Debug.Assert(false, "Should never get here"); break; 243default: Debug.Assert(false, "Should never get here"); break; 266default: Debug.Assert(false, "Should never get here"); break; 290default: Debug.Assert(false, "Should never get here"); break; 313default: Debug.Assert(false, "Should never get here"); break; 336default: Debug.Assert(false, "Should never get here"); break; 360default: Debug.Assert(false, "Should never get here"); break; 382default: Debug.Assert(false, "Should never get here"); break;
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaComplexType.cs (1)
408System.Diagnostics.Debug.Assert(false, "Should never call Clone() on XmlSchemaComplexType. Call Clone(XmlSchema) instead.");
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaElement.cs (1)
358System.Diagnostics.Debug.Assert(false, "Should never call Clone() on XmlSchemaElement. Call Clone(XmlSchema) instead.");
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaException.cs (1)
41Debug.Assert(message == null || !message.StartsWith("Sch_", StringComparison.Ordinal), "Do not pass a resource here!");
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaGroup.cs (1)
91System.Diagnostics.Debug.Assert(false, "Should never call Clone() on XmlSchemaGroup. Call Clone(XmlSchema) instead.");
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaObjectTable.cs (3)
27Debug.Assert(!_table.ContainsKey(name), "XmlSchemaObjectTable.Add: entry already exists"); 223Debug.Assert(array.Length >= _size, "array is not big enough to hold all the items in the ICollection"); 278Debug.Assert(array.Length >= _size, "array is not big enough to hold all the items in the ICollection");
FrameworkFork\Microsoft.Xml\Xml\schema\XmlValueConverter.cs (7)
287Debug.Assert(schemaType != null && datatype != null, "schemaType or schemaType.Datatype may not be null"); 297Debug.Assert(schemaType.Datatype.Variety != XmlSchemaDatatypeVariety.List, "schemaType must be list's item type, not list itself"); 321Debug.Assert(false, "Type code " + typeCode + " is not supported."); 529Debug.Assert(_typeCode == XmlTypeCode.Item, "If SchemaType is null, then TypeCode may only be Item, Node, or AnyAtomicType"); 3451Debug.Assert(!(atomicConverter is XmlListConverter) || ((XmlListConverter)atomicConverter).atomicConverter == null, 3583Debug.Assert(enumSrc != null, "Value passed to ToArray must implement IEnumerable"); 3611Debug.Assert(enumSrc != null, "Value passed to ToArray must implement IEnumerable");
FrameworkFork\Microsoft.Xml\Xml\schema\XsdBuilder.cs (2)
975Debug.Assert(false, "State is " + state); 1100Debug.Assert(false, "State is " + state);
FrameworkFork\Microsoft.Xml\Xml\schema\XsdDateTime.cs (3)
163Debug.Assert(Bits.ExactlyOne((uint)kinds), "Only one DateTime type code can be set."); 178Debug.Assert(dateTime.Kind == DateTimeKind.Local, "Unknown DateTimeKind: " + dateTime.Kind); 207Debug.Assert(Bits.ExactlyOne((uint)kinds), "Only one DateTime type code can be set.");
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeGenerator.cs (3)
123System.Diagnostics.Debug.Assert(false, msg); 1141Debug.Assert(false, "Char is not a valid schema primitive and should be treated as int in DataContract"); 1192Debug.Assert(false, "UnknownConstantType");
FrameworkFork\Microsoft.Xml\Xml\XmlException.cs (2)
41Debug.Assert(message == null || !message.StartsWith("Xml_", StringComparison.Ordinal), "Do not pass a resource here!"); 267Debug.Assert(e != null, "Unexpected null exception");
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\BooleanFunctions.cs (1)
68Debug.Assert(result is XPathNavigator, "Unknown value type");
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\CacheChildrenQuery.cs (1)
104Debug.Assert(order == XmlNodeOrder.Before, "Algorith error. Nodes expected to be DocOrderDistinct");
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\CompiledXpathExpr.cs (1)
47Debug.Assert(_query != null, "In case of error in XPath we create ErrorXPathExpression");
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\DescendantOverDescendantQuery.cs (1)
95Debug.Assert(result, "Algorithm error, We always should be able to move up if level > 0");
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\FilterQuery.cs (1)
74Debug.Assert(value is XPathNavigator, "Unknown value type");
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\LogicalExpr.cs (2)
250Debug.Assert(op == Operator.Op.EQ || op == Operator.Op.NE, 362Debug.Assert(op == Operator.Op.EQ || op == Operator.Op.NE,
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\NamespaceQuery.cs (1)
65Debug.Assert(e.LocalName.Length == 0, "Only xmlns='' can have empty string as a value");
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\precedingquery.cs (1)
89Debug.Assert(qyInput.Advance() == null, "we read all qyInput.Advance() already");
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\precedingsibling.cs (1)
70Debug.Assert(test, "We just moved to parent, how we can not have first child?");
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\Query.cs (8)
189Debug.Assert(0 <= pos && pos <= buffer.Count, "Algorithm error: Insert()"); 194Debug.Assert(cmp == XmlNodeOrder.Before, "Algorithm error: Insert()"); 199Debug.Assert(cmp == XmlNodeOrder.Before, "Algorithm error: Insert()"); 206Debug.Assert(query != null, "AssertQuery(): query == null"); 217Debug.Assert(curr == query.Current, "AssertQuery(): query.Advance() != query.Current"); 229Debug.Assert(cmp == XmlNodeOrder.Before, "AssertQuery(): Wrong node order"); 235Debug.Assert(actualSize == querySize, "AssertQuery(): actualSize != querySize"); 254Debug.Assert(value is XPathNavigator, "Unknown value type");
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\querybuilder.cs (2)
466Debug.Assert(root != null, "root != null"); 496Debug.Assert(false, "Unknown QueryType encountered!!");
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\SortQuery.cs (3)
23Debug.Assert(qyInput != null, "Sort Query needs an input query tree to work on"); 55Debug.Assert(numSorts > 0, "Why was the sort query created?"); 206Debug.Assert(x != null && y != null, "Oops!! what happened?");
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\StringFunctions.cs (1)
23Debug.Assert(argList != null, "Use 'new Query[]{}' instead.");
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\XPathMultyIterator.cs (2)
157Debug.Assert(position != 0, "MoveNext() wasn't called"); 158Debug.Assert(firstNotEmpty < arr.Length, "MoveNext() returned false");
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\XPathParser.cs (1)
511Debug.Assert(opnd != null, "IsPrimaryExpr() was true. We should recognize this lex.");
FrameworkFork\Microsoft.Xml\Xml\XPath\XPathDocument.cs (1)
189Debug.Assert((object)_nameTable.Get(string.Empty) == (object)string.Empty, "NameTable must contain atomized string.Empty");
FrameworkFork\Microsoft.Xml\Xml\XPath\XPathNavigator.cs (3)
1029Debug.Assert(CompareSiblings(n1.Clone(), n2.Clone()) != CompareSiblings(n2.Clone(), n1.Clone()), "IsSamePosition() on custom navigator returns incosistent results"); 1098Debug.Assert(schemaType != null || this.NodeType == XPathNodeType.Root, "schemaType != null || this.NodeType == XPathNodeType.Root"); 1126Debug.Assert(schemas != null, "schemas != null");
FrameworkFork\Microsoft.Xml\Xml\XPath\XPathNavigatorReader.cs (1)
1033Debug.Assert(_nav.NodeType == XPathNodeType.Element, _nav.NodeType.ToString() + " == XPathNodeType.Element");
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CollectionDataContract.cs (1)
550Debug.Assert(AddMethod != null || Kind == CollectionKind.Array, "Add method cannot be null if the collection is being used as a get-only property");
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DiagnosticUtility.cs (1)
21Debug.Assert(condition, message);
FrameworkFork\System.ServiceModel\Internals\System\Runtime\AssertHelper.cs (1)
22Debug.Assert(false, message);
FrameworkFork\System.Web.Services\Services\Description\ServiceDescription.cs (2)
1322Debug.Assert(isInput == true, "Oneway flow cannot have an output message"); 1330Debug.Assert(false, "Unknown message flow");
HelpGenerator.cs (1)
218Debug.Assert(!string.IsNullOrEmpty(name), "Help category name should have a valid value!");
ImportModule.cs (3)
278Debug.Assert(false, "Unrecognized serializer option!"); 299Debug.Assert(false, "Unrecognized serializer option!"); 325Debug.Assert(!dcOptions.Namespaces.ContainsKey(namespaceMapping.Key), $"Key '{namespaceMapping.Key}' already added to dictionary!");
Metadata\MetadataFileInfo.cs (1)
20Debug.Assert(metadata != null && filePath != null && write != null, "One or more parameters null!");
OutputPathHelper.cs (1)
19Debug.Assert(!string.IsNullOrWhiteSpace(filePath), "filePath must have a valid value!");
Shared\Utilities\AsyncHelper.cs (1)
60System.Diagnostics.Debug.Assert(finishedTask != taskCompletionSrc.Task, "Unexpected completion task!");
Tool.cs (1)
334Debug.Assert(ex != null, "exception should not be null!");
GenerateDocumentationAndConfigFiles (544)
JsonWriter.cs (1)
127Debug.Assert(_pending is Pending.NewLineAndIndent or Pending.CommaNewLineAndIndent);
Program.cs (14)
419Debug.Assert(!args.ContainsPortedFxCopRules); 420Debug.Assert(string.IsNullOrEmpty(args.PropsFileToDisableNetAnalyzersInNuGetPackageName)); 440Debug.Assert(Version.TryParse(args.AnalyzerVersion, out _)); 466Debug.Assert(args.AnalyzerPackageName is NetAnalyzersPackageName or TextAnalyzersPackageName); 487Debug.Assert(!args.ContainsPortedFxCopRules); 537Debug.Assert(!args.ContainsPortedFxCopRules); 623Debug.Assert(!args.ContainsPortedFxCopRules); 759Debug.Assert(false); 769Debug.Assert(!args.ContainsPortedFxCopRules); 1228Debug.Assert(category == null || customTag == null); 1229Debug.Assert(category != null == (rulesetKind == RulesetKind.CategoryDefault || rulesetKind == RulesetKind.CategoryEnabled)); 1230Debug.Assert(customTag != null == (rulesetKind == RulesetKind.CustomTagDefault || rulesetKind == RulesetKind.CustomTagEnabled)); 1386Debug.Assert(fileName.EndsWith(".globalconfig", StringComparison.Ordinal)); 1440Debug.Assert(sortedRulesById.Count > 0);
src\Compilers\Core\Portable\Collections\BitVector.cs (3)
34Debug.Assert(requiredWords == 0 || requiredWords <= bits.Length); 92Debug.Assert(_capacity == 0 || WordsForCapacity(_capacity) <= _bits.Length); 190Debug.Assert(numTrailingBits <= BitsPerWord);
src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (13)
69Debug.Assert(instance.IsEmpty); 100Debug.Assert(valueSet.Count >= 1); 116Debug.Assert(valueSet.Count >= 1); 149Debug.Assert(valueSet.Count >= 1); 161Debug.Assert(valueSet.Count >= 1); 211Debug.Assert(this.Count >= 1); 234Debug.Assert(this.Count >= 1); 263Debug.Assert(this.Count >= 1); 274Debug.Assert(this.Count >= 1); 280Debug.Assert(_value is V, "Item must be a a V"); 309Debug.Assert(this.Count >= 1); 315Debug.Assert(_value is V, "_value must be a V"); 343Debug.Assert(_count >= 1);
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (15)
49Debug.Assert(baseDirectory == null || searchPaths != null || PathUtilities.IsAbsolute(baseDirectory)); 62Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 73Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 86Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 103Debug.Assert(baseDirectory == null || PathUtilities.IsAbsolute(baseDirectory)); 109Debug.Assert(PathUtilities.GetPathKind(path) == kind); 174Debug.Assert(PathUtilities.IsDirectorySeparator(path![0])); 175Debug.Assert(path.Length == 1 || !PathUtilities.IsDirectorySeparator(path[1])); 200Debug.Assert(PathUtilities.IsAbsolute(resolvedBasePath)); 250Debug.Assert(PathUtilities.IsAbsolute(path)); 294Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 312Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 396Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 414Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 437Debug.Assert(PathUtilities.IsAbsolute(fullPath));
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (3)
385Debug.Assert(!IsUnixLikePlatform); 403Debug.Assert(IsAbsolute(root)); 855Debug.Assert(parts[toSkip - 1] == string.Empty);
src\Compilers\Core\Portable\FileSystem\RelativePathResolver.cs (4)
29Debug.Assert(searchPaths.All(PathUtilities.IsAbsolute)); 30Debug.Assert(baseDirectory == null || PathUtilities.GetPathKind(baseDirectory) == PathKind.Absolute); 49Debug.Assert(fullPath != null); 50Debug.Assert(PathUtilities.IsAbsolute(fullPath));
src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (1)
329Debug.Assert(destination.Length == HashLengthInBytes);
src\Compilers\Core\Portable\Hashing\XxHash128.cs (6)
259Debug.Assert(length >= 1 && length <= 3); 284Debug.Assert(length >= 4 && length <= 8); 310Debug.Assert(length >= 9 && length <= 16); 336Debug.Assert(length >= 17 && length <= 128); 362Debug.Assert(length >= 129 && length <= 240); 395Debug.Assert(length > 240);
src\Compilers\Core\Portable\Hashing\XxHashShared.cs (45)
122Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 125Debug.Assert(InternalBufferLengthBytes % StripeLengthBytes == 0); 128Debug.Assert(ReadLE64(defaultSecretUInt64[0]) == DefaultSecretUInt64_0); 129Debug.Assert(ReadLE64(defaultSecretUInt64[1]) == DefaultSecretUInt64_1); 130Debug.Assert(ReadLE64(defaultSecretUInt64[2]) == DefaultSecretUInt64_2); 131Debug.Assert(ReadLE64(defaultSecretUInt64[3]) == DefaultSecretUInt64_3); 132Debug.Assert(ReadLE64(defaultSecretUInt64[4]) == DefaultSecretUInt64_4); 133Debug.Assert(ReadLE64(defaultSecretUInt64[5]) == DefaultSecretUInt64_5); 134Debug.Assert(ReadLE64(defaultSecretUInt64[6]) == DefaultSecretUInt64_6); 135Debug.Assert(ReadLE64(defaultSecretUInt64[7]) == DefaultSecretUInt64_7); 136Debug.Assert(ReadLE64(defaultSecretUInt64[8]) == DefaultSecretUInt64_8); 137Debug.Assert(ReadLE64(defaultSecretUInt64[9]) == DefaultSecretUInt64_9); 138Debug.Assert(ReadLE64(defaultSecretUInt64[10]) == DefaultSecretUInt64_10); 139Debug.Assert(ReadLE64(defaultSecretUInt64[11]) == DefaultSecretUInt64_11); 140Debug.Assert(ReadLE64(defaultSecretUInt64[12]) == DefaultSecretUInt64_12); 141Debug.Assert(ReadLE64(defaultSecretUInt64[13]) == DefaultSecretUInt64_13); 142Debug.Assert(ReadLE64(defaultSecretUInt64[14]) == DefaultSecretUInt64_14); 143Debug.Assert(ReadLE64(defaultSecretUInt64[15]) == DefaultSecretUInt64_15); 146Debug.Assert(ReadLE64(defaultSecret3UInt64[0]) == DefaultSecret3UInt64_0); 147Debug.Assert(ReadLE64(defaultSecret3UInt64[1]) == DefaultSecret3UInt64_1); 148Debug.Assert(ReadLE64(defaultSecret3UInt64[2]) == DefaultSecret3UInt64_2); 149Debug.Assert(ReadLE64(defaultSecret3UInt64[3]) == DefaultSecret3UInt64_3); 150Debug.Assert(ReadLE64(defaultSecret3UInt64[4]) == DefaultSecret3UInt64_4); 151Debug.Assert(ReadLE64(defaultSecret3UInt64[5]) == DefaultSecret3UInt64_5); 152Debug.Assert(ReadLE64(defaultSecret3UInt64[6]) == DefaultSecret3UInt64_6); 153Debug.Assert(ReadLE64(defaultSecret3UInt64[7]) == DefaultSecret3UInt64_7); 154Debug.Assert(ReadLE64(defaultSecret3UInt64[8]) == DefaultSecret3UInt64_8); 155Debug.Assert(ReadLE64(defaultSecret3UInt64[9]) == DefaultSecret3UInt64_9); 156Debug.Assert(ReadLE64(defaultSecret3UInt64[10]) == DefaultSecret3UInt64_10); 157Debug.Assert(ReadLE64(defaultSecret3UInt64[11]) == DefaultSecret3UInt64_11); 158Debug.Assert(ReadLE64(defaultSecret3UInt64[12]) == DefaultSecret3UInt64_12); 159Debug.Assert(ReadLE64(defaultSecret3UInt64[13]) == DefaultSecret3UInt64_13); 213Debug.Assert(length > 240); 229Debug.Assert(stripes <= stripesPerBlock); // can handle max 1 scramble per invocation 230Debug.Assert(stripesSoFar < stripesPerBlock); 251Debug.Assert(state.BufferedCount <= InternalBufferLengthBytes); 281Debug.Assert(sourceIndex < source.Length); 287Debug.Assert(NumStripesPerBlock >= state.StripesProcessedInCurrentBlock); 291Debug.Assert(stripesToEnd <= stripes); 310Debug.Assert(sourceIndex < source.Length); // at least some bytes left 332Debug.Assert(sourceIndex < source.Length); 333Debug.Assert(remaining.Length <= InternalBufferLengthBytes); 334Debug.Assert(state.BufferedCount == 0); 371Debug.Assert(state.BufferedCount > 0); 787Debug.Assert(shift >= 0 && shift < 64);
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (2)
16Debug.Assert(start >= 0); 17Debug.Assert(start <= array.Length);
src\Compilers\Core\Portable\InternalUtilities\BitArithmeticUtilities.cs (3)
53Debug.Assert(CountBits(alignment) == 1); 66Debug.Assert(position >= 0 && alignment > 0); 67Debug.Assert(CountBits(alignment) == 1);
src\Compilers\Core\Portable\InternalUtilities\ConsList`1.cs (4)
38Debug.Assert(_tail != null); 89Debug.Assert(tail != null); 100Debug.Assert(this != Empty); 110Debug.Assert(this != Empty);
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (5)
17public static void Assert([DoesNotReturnIf(false)] bool condition) => Debug.Assert(condition); 19/// <inheritdoc cref="Debug.Assert(bool, string)"/> 22=> Debug.Assert(condition, message); 24/// <inheritdoc cref="Debug.Assert(bool, string)"/> 72Debug.Assert(false, message);
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (2)
140Debug.Assert((object?)initializedValue != uninitializedValue); 156Debug.Assert(!initializedValue.IsDefault);
src\Compilers\Core\Portable\InternalUtilities\MultiDictionary.cs (3)
49Debug.Assert(_count > 1); 52Debug.Assert(_count == v.Count); 154Debug.Assert(_value != null);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (2)
131Debug.Assert(e.InnerException is object); 133Debug.Assert(false, "Unreachable");
src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (1)
35Debug.Assert(count > 0);
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
32Debug.Assert(number >= 0);
src\Compilers\Core\Portable\SpecialTypeExtensions.cs (1)
373Debug.Assert(value.GetType().IsPrimitive);
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
85Debug.Assert(false, message);
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (1)
232Debug.Assert(newChange.SpanStart == oldChange.Span.Start + oldDelta);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
648Debug.Assert(data.All(d => d.Count() == count));
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (16)
83Debug.Assert(items != null); 484Debug.Assert(self.Length == other.Length); 515Debug.Assert(self.Length == other.Length); 548Debug.Assert(!array.IsDefault); 549Debug.Assert(predicateWithArg != null ^ predicateWithoutArg != null); 568Debug.Assert(i > 0); 584Debug.Assert(i > 0); 587Debug.Assert(builder == null); 600Debug.Assert(!all); 601Debug.Assert(!none); 610Debug.Assert(none); 900Debug.Assert(builder.Count > 1); 944Debug.Assert(members.Length > 0); 959Debug.Assert(count < members.Length); 971Debug.Assert(builder.Count == count); 1279Debug.Assert(!array.IsDefault);
src\Dependencies\Collections\Internal\ArraySortHelper.cs (44)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 112Debug.Assert(i != j); 125Debug.Assert(i != j); 134Debug.Assert(comparer != null); 147Debug.Assert(keys.Length > 0); 148Debug.Assert(depthLimit >= 0); 149Debug.Assert(comparer != null); 192Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 193Debug.Assert(comparer != null); 237Debug.Assert(comparer != null); 238Debug.Assert(keys.Length > 0); 255Debug.Assert(comparer != null); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 415Debug.Assert(!Unsafe.AreSame(ref i, ref j)); 427Debug.Assert(keys.Length > 0); 428Debug.Assert(depthLimit >= 0); 474Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 537Debug.Assert(keys.Length > 0); 693Debug.Assert(comparer != null); 694Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 695Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 696Debug.Assert(i != j); 713Debug.Assert(i != j); 726Debug.Assert(comparer != null); 727Debug.Assert(keys.Length == values.Length); 737Debug.Assert(keys.Length > 0); 738Debug.Assert(values.Length == keys.Length); 739Debug.Assert(depthLimit >= 0); 740Debug.Assert(comparer != null); 783Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 784Debug.Assert(comparer != null); 828Debug.Assert(comparer != null); 829Debug.Assert(keys.Length > 0); 846Debug.Assert(comparer != null); 873Debug.Assert(comparer != null); 946Debug.Assert(i != j); 964Debug.Assert(i != j); 977Debug.Assert(keys.Length > 0); 978Debug.Assert(values.Length == keys.Length); 979Debug.Assert(depthLimit >= 0); 1022Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 1081Debug.Assert(keys.Length > 0); 1235Debug.Assert(typeof(TKey) == typeof(double) || typeof(TKey) == typeof(float));
src\Dependencies\Collections\Internal\BitHelper.cs (2)
34Debug.Assert(bitPosition >= 0); 48Debug.Assert(bitPosition >= 0);
src\Dependencies\Collections\Internal\HashHelpers.cs (3)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 113Debug.Assert(divisor <= int.MaxValue); 119Debug.Assert(highbits == value % divisor);
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\Dependencies\Collections\OneOrMany.cs (1)
200Debug.Assert(HasOneItem == other.HasOneItem);
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
24Debug.Assert(dictionary is not null);
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
24Debug.Assert(dictionary is not null);
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
120Debug.Assert(other is not ValueBuilder);
src\Dependencies\Collections\Segmented\SegmentedArray.cs (6)
114Debug.Assert(length > 0); 115Debug.Assert(sourceIndex >= 0); 116Debug.Assert(destinationIndex >= 0); 117Debug.Assert((uint)(sourceIndex + length) <= array.Length); 118Debug.Assert((uint)(destinationIndex + length) <= array.Length); 491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (21)
168Debug.Assert(_entries.Length >= source.Count); 169Debug.Assert(_count == 0); 260Debug.Assert(modified); 267Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 447Debug.Assert(comparer is not null); 518Debug.Assert(_buckets.Length > 0); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 524Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType)); 574Debug.Assert(comparer is not null); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 649Debug.Assert(newSize >= _entries.Length); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 711Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 788Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (16)
189Debug.Assert(Count == source.Count); 204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 258Debug.Assert(comparer is not null); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 302Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 902Debug.Assert(newSize >= _entries.Length); 1023Debug.Assert(_buckets.Length > 0); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1063Debug.Assert(comparer is not null); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (2)
270Debug.Assert(_size == _items.Length); 520Debug.Assert(_items.Length < capacity);
src\Dependencies\Collections\TemporaryArray`1.cs (2)
173Debug.Assert(_count == InlineCapacity); 336Debug.Assert(_builder is null);
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\Dependencies\PooledObjects\ArrayBuilder.cs (8)
493Debug.Assert(builder.Count == 0); 609Debug.Assert(start >= 0 && length >= 0); 610Debug.Assert(start + length <= items.Count); 629Debug.Assert(start >= 0 && length >= 0); 630Debug.Assert(start + length <= items.Length); 644Debug.Assert(start >= 0 && length >= 0); 645Debug.Assert(start + length <= items.Length); 669Debug.Assert(limit <= Count);
src\Dependencies\PooledObjects\ObjectPool`1.cs (5)
118Debug.Assert(size >= 1); 126Debug.Assert(size >= 1); 277Debug.Assert(obj != null, "freeing null?"); 279Debug.Assert(_firstItem != obj, "freeing twice?"); 290Debug.Assert(value != obj, "freeing twice?");
src\Dependencies\PooledObjects\PooledDictionary.cs (1)
58Debug.Assert(instance.Count == 0);
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
47Debug.Assert(instance.Count == 0);
src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
30Debug.Assert(pool != null); 95Debug.Assert(builder.Builder.Length == 0);
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (1)
240Debug.Assert(_entireQueueCancellationToken.IsCancellationRequested);
src\RoslynAnalyzers\Microsoft.CodeAnalysis.Analyzers\Core\MetaAnalyzers\ReleaseTrackingHelper.cs (1)
482Debug.Assert(kind is ReleaseTrackingRuleEntryKind.New or ReleaseTrackingRuleEntryKind.Removed);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (2)
505Debug.Assert(SymbolEqualityComparer.Default.Equals(method.ContainingType.OriginalDefinition, systemThreadingInterlocked)); 517Debug.Assert(SymbolEqualityComparer.Default.Equals(method.ContainingType.OriginalDefinition, systemThreadingInterlocked));
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (6)
211Debug.Assert(isInsideAnonymousObjectInitializer == 289Debug.Assert(success); 290Debug.Assert(cfg != null); 334Debug.Assert(operation is IAnonymousFunctionOperation anonymousFunction && anonymousFunction.Symbol.OriginalDefinition.ReturnTypeAndParametersAreSame(lambdaOrLocalFunction.OriginalDefinition) || 507Debug.Assert(parameterIndex >= 0); 508Debug.Assert(parameterIndex < arguments.Length);
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (1)
48Debug.Assert(ReferenceEquals(this, Empty) || !_perTreeOptions.IsEmpty);
src\RoslynAnalyzers\Utilities\Compiler\Options\MSBuildItemOptionNames.cs (1)
42Debug.Assert(typeof(MSBuildItemOptionNames).GetFields().Single(f => f.Name == itemOptionName) != null);
src\RoslynAnalyzers\Utilities\Compiler\Options\MSBuildPropertyOptionNames.cs (1)
36Debug.Assert(typeof(MSBuildPropertyOptionNames).GetFields().Single(f => f.Name == propertyOptionName) != null);
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (3)
66Debug.Assert(!names.IsEmpty || !symbols.IsEmpty || !wildcardNamesBySymbolKind.IsEmpty); 144Debug.Assert(parts.SymbolName[^1] == WildcardChar); 145Debug.Assert(parts.SymbolName.Length >= 2);
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (2)
72Debug.Assert(instance.IsEmpty); 82Debug.Assert(added);
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (1)
47Debug.Assert(instance.Count == 0);
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (1)
69Debug.Assert(instance.Count == 0);
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
102Debug.Assert(rulesetNode.Name == RuleSetNodeName); 131Debug.Assert(rulesetNode.Name == RuleSetNodeName);
src\RoslynAnalyzers\Utilities\Compiler\SmallDictionary.cs (2)
428Debug.Assert(unbalanced != currentNode); 434Debug.Assert(n.HashCode != hashCode);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleHelpers.cs (1)
185Debug.Assert(s_unusedExpressionAssignmentPreferenceMap.ContainsValue(option.Value));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOptions2.cs (7)
193Debug.Assert(s_unusedParametersPreferenceMap.ContainsValue(option.Value)); 215Debug.Assert(s_accessibilityModifiersRequiredMap.ContainsKey(value)); 223Debug.Assert(s_accessibilityModifiersRequiredMap.ContainsValue(option.Value)); 261Debug.Assert(s_parenthesesPreferenceMap.ContainsKey(value)); 269Debug.Assert(s_parenthesesPreferenceMap.ContainsValue(option.Value)); 313Debug.Assert(s_forEachExplicitCastInSourcePreferencePreferenceMap.ContainsKey(value)); 322Debug.Assert(s_forEachExplicitCastInSourcePreferencePreferenceMap.ContainsValue(option.Value));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\ImmutableIntervalTree`1.cs (1)
79Debug.Assert(values.IsSorted(Comparer<T>.Create((t1, t2) => localIntrospector.GetSpan(t1).Start - localIntrospector.GetSpan(t2).Start)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\MutableIntervalTree`1.cs (2)
102Debug.Assert(rightBalance == 1); 115Debug.Assert(leftBalance == -1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (2)
295Debug.Assert(lastEnd < span1.End); 306Debug.Assert(lastEnd < span2.Start);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (4)
74Debug.Assert(!string.IsNullOrEmpty(sectionName)); 91Debug.Assert(!string.IsNullOrEmpty(key)); 92Debug.Assert(key == key.Trim()); 93Debug.Assert(value == value.Trim());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (1)
313Debug.Assert(match.Groups.Count - 1 == _numberRangePairs.Length);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSeparatedSyntaxNodeList.cs (4)
45Debug.Assert(NodesAndTokens[i].IsNode); 46Debug.Assert(NodesAndTokens[i].Node is EmbeddedSyntaxNode<TSyntaxKind, TSyntaxNode>); 51Debug.Assert(!NodesAndTokens[i].IsNode); 68Debug.Assert(nodeOrToken.IsNode);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNode.cs (1)
46Debug.Assert((int)(object)kind != 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNodeOrToken.cs (2)
26Debug.Assert((int)(object)token.Kind != 0); 34Debug.Assert(Node == null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxToken.cs (4)
36Debug.Assert(!leadingTrivia.IsDefault); 37Debug.Assert(!virtualChars.IsDefault); 38Debug.Assert(!trailingTrivia.IsDefault); 39Debug.Assert(!diagnostics.IsDefault);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxTrivia.cs (1)
28Debug.Assert(virtualChars.Length > 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (13)
79Debug.Assert(expectedValueText == actualValueText); 85Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 89Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 98Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 107Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 117Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 121Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 135Debug.Assert(!token.ContainsDiagnostics); 139Debug.Assert(startDelimiter == ""); 140Debug.Assert(endDelimiter == ""); 147Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 153Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 219Debug.Assert(char.IsSurrogate(ch));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.Chunks.cs (1)
104Debug.Assert(index + 1 >= data.Length ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (3)
196Debug.Assert(_leafCharacters == virtualChars._leafCharacters); 197Debug.Assert(_span.End == virtualChars._span.Start); 208Debug.Assert(chars1._leafCharacters == chars2._leafCharacters);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ControlFlowGraphExtensions.cs (2)
16Debug.Assert(firstBlock.Kind == BasicBlockKind.Entry); 23Debug.Assert(lastBlock.Kind == BasicBlockKind.Exit);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (2)
25Debug.Assert(descriptor.CustomTags is ImmutableArray<string>); 51Debug.Assert(reportDiagnostic != ReportDiagnostic.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (1)
43Debug.Assert(loc1.IsInSource && loc2.IsInSource);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
153Debug.Assert(parenthesizedOperation.Language == LanguageNames.VisualBasic);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (3)
79Debug.Assert(tabSize > 0); 80Debug.Assert(endPosition >= 0 && endPosition <= textSnippet.Length); 254Debug.Assert(builder.KeyComparer == StringComparer.Ordinal || builder.KeyComparer == StringComparer.OrdinalIgnoreCase);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolUsageInfo.cs (1)
31Debug.Assert(valueUsageInfoOpt.HasValue ^ typeOrNamespaceUsageInfoOpt.HasValue);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (18)
59Debug.Assert(unreachableBlocksToVisit.Count == 0); 215Debug.Assert(branch.Destination == null); 220Debug.Assert(branch.Destination == null); 226Debug.Assert(branch.Destination != null); 257Debug.Assert(region.Kind != ControlFlowRegionKind.Root); 261Debug.Assert(enclosing.NestedRegions[0] == region); 262Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 279Debug.Assert(@finally.Kind == ControlFlowRegionKind.Finally); 324Debug.Assert(enclosing.NestedRegions[0] == fromRegion); 325Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 336Debug.Assert(enclosing.NestedRegions[0] == fromRegion); 347Debug.Assert(enclosing.Kind == ControlFlowRegionKind.FilterAndHandler); 349Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 373Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 374Debug.Assert(startAt > 0); 375Debug.Assert(startAt <= tryAndCatch.NestedRegions.Length); 389Debug.Assert(@catch.NestedRegions[0].Kind == ControlFlowRegionKind.Filter); 390Debug.Assert(entryBlock.Ordinal == @catch.NestedRegions[0].FirstBlockOrdinal);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (1)
76Debug.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");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (2)
93Debug.Assert(localFunction.IsLocalFunction()); 245Debug.Assert(newBlockAnalysisData != null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.cs (1)
57Debug.Assert(localFunctionOrLambda.IsLocalFunction() || localFunctionOrLambda.IsAnonymousFunction());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (13)
101Debug.Assert(LValueFlowCapturesInGraph.Values.All(kind => kind is FlowCaptureKind.LValueCapture or FlowCaptureKind.LValueAndRValueCapture)); 121Debug.Assert(cfg.Parent == null); 144Debug.Assert(cfg.Parent != null); 145Debug.Assert(lambdaOrLocalFunction.IsAnonymousFunction() || lambdaOrLocalFunction.IsLocalFunction()); 146Debug.Assert(parentAnalysisData != null); 303Debug.Assert(lambdaOrLocalFunctionCfg != null); 313Debug.Assert(anonymousFunctionCfg != null); 322Debug.Assert(localFunction.IsLocalFunction()); 330Debug.Assert(localFunctionCfg != null); 346Debug.Assert(_analysisDataByBasicBlockMap[basicBlock] != null); 487Debug.Assert(localFunction.IsLocalFunction()); 488Debug.Assert(localFunction.Equals(localFunction.OriginalDefinition)); 578Debug.Assert(localFunctionTarget.Method.IsLocalFunction());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (11)
53Debug.Assert(_currentContainingSymbol == null); 54Debug.Assert(_currentAnalysisData == null); 55Debug.Assert(_currentRootOperation == null); 56Debug.Assert(_pendingWritesMap == null); 109Debug.Assert(symbol != null); 161Debug.Assert(symbolOpt != null || operation.Kind == OperationKind.FlowCaptureReference); 197Debug.Assert(symbolOpt != null); 207Debug.Assert(symbolOpt == null); 210Debug.Assert(_currentAnalysisData.IsLValueFlowCapture(captureReference.Id)); 346Debug.Assert(localFunction.IsLocalFunction()); 499Debug.Assert(operation.Type.IsDelegateType());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
56Debug.Assert(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (2)
191Debug.Assert(scratch.Count == 0); 205Debug.Assert(scratch.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (10)
65Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 92Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 107Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 130Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 148Debug.Assert(operation.Option == AdjustNewLinesOption.ForceLinesIfOnSingleLine); 178Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 195Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 209Debug.Assert(!context.IsFormattingDisabled(new TextSpan(context.TokenStream.GetToken(pairIndex + 1).SpanStart, 0))); 461Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 464Debug.Assert(!previousChangesMap.ContainsKey(currentToken));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (12)
63Debug.Assert(this.TokenCount > 0); 85Debug.Assert(previousToken.FullSpan.End <= currentToken.FullSpan.Start); 388Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 389Debug.Assert(token1.IndexInStream < 0 || token2.IndexInStream < 0 || (token1.IndexInStream + 1 == token2.IndexInStream)); 390Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span)); 413Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 414Debug.Assert(token1.IndexInStream < 0 || token2.IndexInStream < 0 || (token1.IndexInStream + 1 == token2.IndexInStream)); 415Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span)); 433Debug.Assert(_treeData.IsFirstToken(this.FirstTokenInStream.Token)); 445Debug.Assert(_treeData.IsLastToken(this.LastTokenInStream.Token)); 493Debug.Assert(tokenData2 == tokenData1.GetNextTokenData()); 517Debug.Assert(token.FullSpan.IsEmpty);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AlignTokensOperation.cs (1)
19Debug.Assert(!tokens.IsEmpty());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (2)
750Debug.Assert(!_firstLineBlank); 856Debug.Assert(IsWhitespaceOrEndOfLine(trivia2));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
84Debug.Assert(indentStyle == FormattingOptions2.IndentStyle.Smart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
161Debug.Assert(spanToCheck.Length > 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (1)
21Debug.Assert(nameSpan.Length > 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
416Debug.Assert(s_serializationVersion == 5, "After increasing the serialization version, add an upgrade path here.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\Option2.cs (3)
69Debug.Assert(LanguageName is null == (Definition.ConfigName.StartsWith(OptionDefinition.LanguageAgnosticConfigNamePrefix, StringComparison.Ordinal) || 71Debug.Assert(LanguageName is LanguageNames.CSharp == Definition.ConfigName.StartsWith(OptionDefinition.CSharpConfigNamePrefix, StringComparison.Ordinal)); 72Debug.Assert(LanguageName is LanguageNames.VisualBasic == Definition.ConfigName.StartsWith(OptionDefinition.VisualBasicConfigNamePrefix, StringComparison.Ordinal));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
59Debug.Assert(IsSupportedOptionType(Type));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionKey2.cs (3)
22Debug.Assert(option.IsPerLanguage == language is not null); 30Debug.Assert(option.IsPerLanguage); 42Debug.Assert(!option.IsPerLanguage);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\PerLanguageOption2.cs (2)
60Debug.Assert(!Definition.ConfigName.StartsWith(OptionDefinition.CSharpConfigNamePrefix, StringComparison.Ordinal)); 61Debug.Assert(!Definition.ConfigName.StartsWith(OptionDefinition.VisualBasicConfigNamePrefix, StringComparison.Ordinal));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectReader.cs (2)
45Debug.Assert(BitConverter.IsLittleEndian); 242Debug.Assert(code is >= TypeCode.FirstWellKnownTextEncoding and <= TypeCode.LastWellKnownTextEncoding);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (5)
92Debug.Assert(BitConverter.IsLittleEndian); 185Debug.Assert(value == null || !value.GetType().GetTypeInfo().IsEnum, "Enum should not be written with WriteValue. Write them as ints instead."); 195Debug.Assert(!typeInfo.IsEnum, "Enums should not be written with WriteObject. Write them out as integers instead."); 470Debug.Assert(id >= 0); 542Debug.Assert(kind is >= EncodingExtensions.FirstTextEncodingKind and <= EncodingExtensions.LastTextEncodingKind);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (5)
62Debug.Assert(HasPreamble(Encoding.Unicode)); 67Debug.Assert(HasPreamble(Encoding.BigEndianUnicode)); 72Debug.Assert(HasPreamble(Encoding.UTF32)); 77Debug.Assert(HasPreamble(Encoding.UTF32)); 82Debug.Assert(HasPreamble(Encoding.UTF8));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\FileBannerFacts\AbstractFileBannerFacts.cs (2)
168Debug.Assert(root.FullSpan.Start == 0); 174Debug.Assert(firstToken.FullSpan.Start == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (1)
40Debug.Assert(ownerOfHeader.FullSpan.Contains(lastTokenOrNodeOfHeader.Span));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
23Debug.Assert(symbol.IsAnonymousDelegateType() || symbol.IsAnonymousFunction());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousTypeSymbolKey.cs (1)
19Debug.Assert(symbol.IsAnonymousType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
198Debug.Assert(reader.Position == symbolKey.Length);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (3)
17Debug.Assert(symbol.Equals(symbol.ConstructedFrom)); 129Debug.Assert(symbol.Equals(symbol.ConstructedFrom)); 262Debug.Assert(method != null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (3)
36Debug.Assert(symbol.IsGlobalNamespace); 94Debug.Assert(metadataName == string.Empty); 98Debug.Assert(metadataName == string.Empty);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.PropertySymbolKey.cs (1)
104Debug.Assert(property != null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (8)
65Debug.Assert(Data[Position] == c); 87Debug.Assert(char.IsNumber(Data[Position])); 102Debug.Assert(start != Position); 116Debug.Assert(val is 0 or 1); 202Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 288Debug.Assert(_skipString == false); 293Debug.Assert(_skipString == true); 547Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
109Debug.Assert(_nestingCount == 0); 255Debug.Assert(location.Kind is LocationKind.None or 307Debug.Assert(!array.IsDefault);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
20Debug.Assert(symbol.IsTupleType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (18)
261Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 263Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 285Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 287Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 297Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 299Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 307Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 309Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 319Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 321Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 572Debug.Assert(previousOriginalNode == null || previousOriginalNode.Parent == currentOriginalNode); 573Debug.Assert(previousReplacedNode == null || previousReplacedNode.Parent == currentReplacedNode); 627Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 629Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 1081Debug.Assert(signature1Parameters.Length == signature2Parameters.Length); 1082Debug.Assert(specifiedArguments.Length <= signature1Parameters.Length || 1166Debug.Assert(parameter1.HasExplicitDefaultValue, "Expected all unspecified parameter to have default values"); 1167Debug.Assert(parameter1.HasExplicitDefaultValue == parameter2.HasExplicitDefaultValue);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (4)
98Debug.Assert(chars.Length != 0); // If TryDecodeFromUtf16() consumed the entire buffer, it could not have returned false. 127Debug.Assert(chars.Length != 0 && !chars[0].IsSpace()); 175Debug.Assert(tempBuffer.Length != 0); // We only bound-check after writing a character to the tempBuffer. 316Debug.Assert((consumed % 4) == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (1)
100Debug.Assert(_forwardMap.Count == _backwardMap.Count);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (4)
163Debug.Assert(spilledEdges.Count == (edgeCount - CompactEdgeAllocationSize)); 173Debug.Assert(currentEdgeIndex == edges.Capacity); 174Debug.Assert(currentEdgeIndex == edges.Count); 278Debug.Assert(currentNode.SpilloverEdges.Count == (currentNode.EdgeCount - CompactEdgeAllocationSize));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (8)
182Debug.Assert(source.Length <= target.Length); 219Debug.Assert(minimumEditCount >= 0); 485Debug.Assert(offset >= 0); 577Debug.Assert(v1 >= 0); 578Debug.Assert(v2 >= 0); 579Debug.Assert(v3 >= 0); 580Debug.Assert(v4 >= 0); 598Debug.Assert(min >= 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (2)
203Debug.Assert(!this.IsLocked); 212Debug.Assert(this.IsOwnedByMe);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (1)
239Debug.Assert(count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (4)
33Debug.Assert(span.Start >= start, "Bad generator."); 85Debug.Assert(current < length); 107Debug.Assert(current < length); 126Debug.Assert(char.IsUpper(identifier[current - 1]));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\WordSimilarityChecker.cs (1)
134Debug.Assert(similarityWeight <= _threshold);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
330Debug.Assert(type is null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IMethodSymbolExtensions.cs (2)
25Debug.Assert(method.PartialImplementationPart == null && !Equals(method.PartialDefinitionPart, method)); 30Debug.Assert(!Equals(method.PartialImplementationPart, method));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (7)
92Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 179Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 217Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 254Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 379Debug.Assert(current.IsDefinition); 413Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 439Debug.Assert(current.IsDefinition);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
533Debug.Assert(isTypeParameter2);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (1)
166Debug.Assert(_assemblyComparer == null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (7)
78Debug.Assert(!x.IsDefault && !y.IsDefault); 114Debug.Assert(x.Kind == y.Kind && x.Kind == k); 332Debug.Assert(GetTypeKind(x) == GetTypeKind(y)); 371Debug.Assert(y.Kind == SymbolKind.ErrorType); 420Debug.Assert(y.IsTupleType); 619Debug.Assert( 623Debug.Assert(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
266Debug.Assert(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (2)
341Debug.Assert(desiredGroupIndex >= 0); 342Debug.Assert(desiredGroupIndex <= declarationList.Count);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (1)
42Debug.Assert(!isInitOnly || methodKind == MethodKind.PropertySet);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
192Debug.Assert(false, message + ". " + diagnostics);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (3)
49Debug.Assert(diagnostic != null); 103Debug.Assert(analyzerConfigPath != null); 104Debug.Assert(PathUtilities.IsAbsolute(analyzerConfigPath));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
74Debug.Assert(!semanticModel.IsSpeculativeSemanticModel);
http2cat (39)
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (2)
76Debug.Assert(_count + 1 <= maxCapacity); 80Debug.Assert(newBufferSize > _count);
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
249Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 261Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 315Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
95Debug.Assert(indexLength >= 1); 127Debug.Assert(indexLength >= 1); 159Debug.Assert(indexLength >= 1); 197Debug.Assert(indexLength >= 1); 369Debug.Assert(Ascii.IsValid(value)); 376Debug.Assert(integerLength >= 1); 382Debug.Assert(status == OperationStatus.Done); 383Debug.Assert(valueBytesWritten == value.Length); 397Debug.Assert(destination.Length >= value.Length); 406Debug.Assert(status == OperationStatus.Done); 407Debug.Assert(bytesWritten == value.Length); 426Debug.Assert(integerLength >= 1); 470Debug.Assert(integerLength >= 1); 481Debug.Assert(written == encodedStringLength); 528Debug.Assert(separator != null); 529Debug.Assert(Ascii.IsValid(separator)); 551Debug.Assert(integerLength >= 1);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (2)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8); 40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
235Debug.Assert(totalBytesUsed == encodedLength);
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)
229Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
IIS.FunctionalTests (40)
src\Servers\IIS\IIS\test\Common.FunctionalTests\WebSocketTests.cs (1)
195Debug.Assert(expectedMessage.Length > 0);
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (2)
76Debug.Assert(_count + 1 <= maxCapacity); 80Debug.Assert(newBufferSize > _count);
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
249Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 261Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 315Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
95Debug.Assert(indexLength >= 1); 127Debug.Assert(indexLength >= 1); 159Debug.Assert(indexLength >= 1); 197Debug.Assert(indexLength >= 1); 369Debug.Assert(Ascii.IsValid(value)); 376Debug.Assert(integerLength >= 1); 382Debug.Assert(status == OperationStatus.Done); 383Debug.Assert(valueBytesWritten == value.Length); 397Debug.Assert(destination.Length >= value.Length); 406Debug.Assert(status == OperationStatus.Done); 407Debug.Assert(bytesWritten == value.Length); 426Debug.Assert(integerLength >= 1); 470Debug.Assert(integerLength >= 1); 481Debug.Assert(written == encodedStringLength); 528Debug.Assert(separator != null); 529Debug.Assert(Ascii.IsValid(separator)); 551Debug.Assert(integerLength >= 1);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (2)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8); 40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
235Debug.Assert(totalBytesUsed == encodedLength);
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)
229Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
IIS.LongTests (39)
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (2)
76Debug.Assert(_count + 1 <= maxCapacity); 80Debug.Assert(newBufferSize > _count);
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
249Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 261Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 315Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
95Debug.Assert(indexLength >= 1); 127Debug.Assert(indexLength >= 1); 159Debug.Assert(indexLength >= 1); 197Debug.Assert(indexLength >= 1); 369Debug.Assert(Ascii.IsValid(value)); 376Debug.Assert(integerLength >= 1); 382Debug.Assert(status == OperationStatus.Done); 383Debug.Assert(valueBytesWritten == value.Length); 397Debug.Assert(destination.Length >= value.Length); 406Debug.Assert(status == OperationStatus.Done); 407Debug.Assert(bytesWritten == value.Length); 426Debug.Assert(integerLength >= 1); 470Debug.Assert(integerLength >= 1); 481Debug.Assert(written == encodedStringLength); 528Debug.Assert(separator != null); 529Debug.Assert(Ascii.IsValid(separator)); 551Debug.Assert(integerLength >= 1);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (2)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8); 40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
235Debug.Assert(totalBytesUsed == encodedLength);
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)
229Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
IIS.NewHandler.FunctionalTests (39)
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (2)
76Debug.Assert(_count + 1 <= maxCapacity); 80Debug.Assert(newBufferSize > _count);
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
249Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 261Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 315Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
95Debug.Assert(indexLength >= 1); 127Debug.Assert(indexLength >= 1); 159Debug.Assert(indexLength >= 1); 197Debug.Assert(indexLength >= 1); 369Debug.Assert(Ascii.IsValid(value)); 376Debug.Assert(integerLength >= 1); 382Debug.Assert(status == OperationStatus.Done); 383Debug.Assert(valueBytesWritten == value.Length); 397Debug.Assert(destination.Length >= value.Length); 406Debug.Assert(status == OperationStatus.Done); 407Debug.Assert(bytesWritten == value.Length); 426Debug.Assert(integerLength >= 1); 470Debug.Assert(integerLength >= 1); 481Debug.Assert(written == encodedStringLength); 528Debug.Assert(separator != null); 529Debug.Assert(Ascii.IsValid(separator)); 551Debug.Assert(integerLength >= 1);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (2)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8); 40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
235Debug.Assert(totalBytesUsed == encodedLength);
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)
229Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
IIS.NewShim.FunctionalTests (39)
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (2)
76Debug.Assert(_count + 1 <= maxCapacity); 80Debug.Assert(newBufferSize > _count);
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
249Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 261Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 315Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
95Debug.Assert(indexLength >= 1); 127Debug.Assert(indexLength >= 1); 159Debug.Assert(indexLength >= 1); 197Debug.Assert(indexLength >= 1); 369Debug.Assert(Ascii.IsValid(value)); 376Debug.Assert(integerLength >= 1); 382Debug.Assert(status == OperationStatus.Done); 383Debug.Assert(valueBytesWritten == value.Length); 397Debug.Assert(destination.Length >= value.Length); 406Debug.Assert(status == OperationStatus.Done); 407Debug.Assert(bytesWritten == value.Length); 426Debug.Assert(integerLength >= 1); 470Debug.Assert(integerLength >= 1); 481Debug.Assert(written == encodedStringLength); 528Debug.Assert(separator != null); 529Debug.Assert(Ascii.IsValid(separator)); 551Debug.Assert(integerLength >= 1);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (2)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8); 40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
235Debug.Assert(totalBytesUsed == encodedLength);
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)
229Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
IIS.ShadowCopy.Tests (10)
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
235Debug.Assert(totalBytesUsed == encodedLength);
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)
229Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
IISExpress.FunctionalTests (40)
src\Servers\IIS\IIS\test\Common.FunctionalTests\WebSocketTests.cs (1)
195Debug.Assert(expectedMessage.Length > 0);
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (2)
76Debug.Assert(_count + 1 <= maxCapacity); 80Debug.Assert(newBufferSize > _count);
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
249Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 261Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 315Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
95Debug.Assert(indexLength >= 1); 127Debug.Assert(indexLength >= 1); 159Debug.Assert(indexLength >= 1); 197Debug.Assert(indexLength >= 1); 369Debug.Assert(Ascii.IsValid(value)); 376Debug.Assert(integerLength >= 1); 382Debug.Assert(status == OperationStatus.Done); 383Debug.Assert(valueBytesWritten == value.Length); 397Debug.Assert(destination.Length >= value.Length); 406Debug.Assert(status == OperationStatus.Done); 407Debug.Assert(bytesWritten == value.Length); 426Debug.Assert(integerLength >= 1); 470Debug.Assert(integerLength >= 1); 481Debug.Assert(written == encodedStringLength); 528Debug.Assert(separator != null); 529Debug.Assert(Ascii.IsValid(separator)); 551Debug.Assert(integerLength >= 1);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (2)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8); 40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
235Debug.Assert(totalBytesUsed == encodedLength);
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)
229Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
illink (203)
ILLink.RoslynAnalyzer (10)
DataFlow\LocalDataFlowVisitor.cs (7)
104Debug.Assert(OwningSymbol is IMethodSymbol or IFieldSymbol or IPropertySymbol, 112Debug.Assert(OwningSymbol is IMethodSymbol, 206Debug.Assert(local.ContainingSymbol is IMethodSymbol or IFieldSymbol, // backing field for property initializers 469Debug.Assert(!IsLValueFlowCapture(operation.Id), 471Debug.Assert(operation.GetValueUsageInfo(OwningSymbol).HasFlag(ValueUsageInfo.Read), 491Debug.Assert(operation.GetValueUsageInfo(OwningSymbol).HasFlag(ValueUsageInfo.Write), 493Debug.Assert(operation.GetValueUsageInfo(OwningSymbol).HasFlag(ValueUsageInfo.Reference),
DataFlow\LValueFlowCaptureProvider.cs (1)
86Debug.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)
23Debug.Assert(!isNewObj || methodSymbol.MethodKind == MethodKind.Constructor, "isNewObj can only be true for constructors");
TrimAnalysis\TrimAnalysisPatternStore.cs (1)
109Debug.Assert(existingPattern == pattern, "Return values should be identical");
InMemory.FunctionalTests (6)
Http2\Http2TestBase.cs (2)
446Debug.Assert(index <= H2StaticTable.Count); 454Debug.Assert(index <= H2StaticTable.Count);
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (2)
123Debug.Assert(streamId == 0 || streamId == -1, "StreamId sent that was non-zero, which isn't handled by tests"); 298Debug.Assert(success);
src\Servers\Kestrel\shared\test\RevocationResponder.cs (1)
314System.Diagnostics.Debug.Assert(read == requestBytes.Length);
src\Servers\Kestrel\shared\TransportConnection.cs (1)
72Debug.Assert(Application != null);
IntegrationTestsWebsite (1)
Infrastructure\DynamicServiceModelProvider.cs (1)
15Debug.Assert(CreateMethod != null);
InteractiveHost.UnitTests (1)
SynchronizedTextWriter.cs (1)
48Debug.Assert(!string.IsNullOrEmpty(mark));
Interop.FunctionalTests (6)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
205Debug.Assert(_memoryHandle.HasValue);
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\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
IOperationGenerator (4)
IOperationClassWriter.cs (4)
333Debug.Assert(elementsToKindEnumerator.MoveNext()); 366Debug.Assert(elementsToKindEnumerator.MoveNext() || i == numKinds); 614Debug.Assert(baseProperties != null); 1100Debug.Assert(typeName.Length > 0);
KeyManagementSimulator (3)
Program.cs (3)
402Debug.Assert(now >= _now); 485Debug.Assert(pFail >= 0); 486Debug.Assert(pFail <= 1); // Allow 100% failure rate
Metrics (58)
src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (2)
280Debug.Assert(_value is V, "Item must be a a V"); 315Debug.Assert(_value is V, "_value must be a V");
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (4)
19/// <inheritdoc cref="Debug.Assert(bool, string)"/> 22=> Debug.Assert(condition, message); 24/// <inheritdoc cref="Debug.Assert(bool, string)"/> 72Debug.Assert(false, message);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
133Debug.Assert(false, "Unreachable");
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
85Debug.Assert(false, message);
src\Dependencies\Collections\Internal\ArraySortHelper.cs (3)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\Dependencies\Collections\Internal\HashHelpers.cs (1)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\Dependencies\Collections\Segmented\SegmentedArray.cs (1)
491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (10)
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
277Debug.Assert(obj != null, "freeing null?"); 279Debug.Assert(_firstItem != obj, "freeing twice?"); 290Debug.Assert(value != obj, "freeing twice?");
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
321Debug.Assert(operation.Kind is OperationKind.None or OperationKind.Attribute, $"Unexpected root operation kind: {operation.Kind}");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (8)
85Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 89Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 98Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 107Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 117Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 121Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 147Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 153Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (1)
76Debug.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");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
416Debug.Assert(s_serializationVersion == 5, "After increasing the serialization version, add an upgrade path here.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (2)
185Debug.Assert(value == null || !value.GetType().GetTypeInfo().IsEnum, "Enum should not be written with WriteValue. Write them as ints instead."); 195Debug.Assert(!typeInfo.IsEnum, "Enums should not be written with WriteObject. Write them out as integers instead.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
1166Debug.Assert(parameter1.HasExplicitDefaultValue, "Expected all unspecified parameter to have default values");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (4)
492Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 499Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 532Debug.Assert(_completionRefCount == 0, $"Expected {nameof(_completionRefCount)} == 0, got {_completionRefCount}"); 560Debug.Assert(taskSet, "Complete should only be called once.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (1)
33Debug.Assert(span.Start >= start, "Bad generator.");
Metrics.Legacy (58)
src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (2)
280Debug.Assert(_value is V, "Item must be a a V"); 315Debug.Assert(_value is V, "_value must be a V");
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (4)
19/// <inheritdoc cref="Debug.Assert(bool, string)"/> 22=> Debug.Assert(condition, message); 24/// <inheritdoc cref="Debug.Assert(bool, string)"/> 72Debug.Assert(false, message);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
133Debug.Assert(false, "Unreachable");
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
85Debug.Assert(false, message);
src\Dependencies\Collections\Internal\ArraySortHelper.cs (3)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\Dependencies\Collections\Internal\HashHelpers.cs (1)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\Dependencies\Collections\Segmented\SegmentedArray.cs (1)
491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (10)
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
277Debug.Assert(obj != null, "freeing null?"); 279Debug.Assert(_firstItem != obj, "freeing twice?"); 290Debug.Assert(value != obj, "freeing twice?");
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
321Debug.Assert(operation.Kind is OperationKind.None or OperationKind.Attribute, $"Unexpected root operation kind: {operation.Kind}");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (8)
85Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 89Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 98Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 107Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 117Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 121Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 147Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 153Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (1)
76Debug.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");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
416Debug.Assert(s_serializationVersion == 5, "After increasing the serialization version, add an upgrade path here.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (2)
185Debug.Assert(value == null || !value.GetType().GetTypeInfo().IsEnum, "Enum should not be written with WriteValue. Write them as ints instead."); 195Debug.Assert(!typeInfo.IsEnum, "Enums should not be written with WriteObject. Write them out as integers instead.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
1166Debug.Assert(parameter1.HasExplicitDefaultValue, "Expected all unspecified parameter to have default values");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (4)
492Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 499Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 532Debug.Assert(_completionRefCount == 0, $"Expected {nameof(_completionRefCount)} == 0, got {_completionRefCount}"); 560Debug.Assert(taskSet, "Complete should only be called once.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (1)
33Debug.Assert(span.Start >= start, "Bad generator.");
Microsoft.Analyzers.Local.Tests (1)
InternalReferencedInPublicDocAnalyzerTests.cs (1)
459Debug.Assert(lineNumbers.Length == detectedTexts.Length, "Line numbers and texts should be the same length");
Microsoft.AspNetCore (6)
BootstrapHostBuilder.cs (1)
111Debug.Assert(descriptor.ImplementationType?.Name == "GenericWebHostService");
WebApplicationBuilder.cs (5)
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"); 391Debug.Assert(_builtApplication is not null); 495Debug.Assert(_builtApplication is not null);
Microsoft.AspNetCore.Antiforgery (14)
Internal\BinaryBlob.cs (2)
60Debug.Assert(_data.Length == other._data.Length); 73Debug.Assert(_data != null && _data.Length >= (32 / 8));
Internal\DefaultAntiforgery.cs (7)
54Debug.Assert(antiforgeryFeature.NewCookieTokenString != null); 184Debug.Assert(!string.IsNullOrEmpty(antiforgeryTokenSet.CookieToken)); 185Debug.Assert(!string.IsNullOrEmpty(antiforgeryTokenSet.RequestToken)); 284Debug.Assert(antiforgeryFeature.HaveDeserializedCookieToken); 313Debug.Assert(_tokenGenerator.IsCookieTokenValid(newCookieToken)); 407Debug.Assert(antiforgeryFeature.HaveGeneratedNewCookieToken); 408Debug.Assert(antiforgeryFeature.NewRequestToken != null);
Internal\DefaultAntiforgeryTokenStore.cs (4)
24Debug.Assert(httpContext != null); 38Debug.Assert(httpContext != null); 81Debug.Assert(httpContext != null); 82Debug.Assert(token != null);
Internal\DefaultClaimUidExtractor.cs (1)
26Debug.Assert(claimsPrincipal != null);
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 (1)
RemoteAuthenticationHandler.cs (1)
145Debug.Assert(ticket != null);
Microsoft.AspNetCore.Authentication.Cookies (1)
CookieAuthenticationHandler.cs (1)
212Debug.Assert(result.Ticket != null);
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (1)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
47Debug.Assert(tfms.Length > 0);
Microsoft.AspNetCore.Authentication.Negotiate (5)
Internal\LdapAdapter.cs (1)
47Debug.Assert(settings.LdapConnection != null);
NegotiateHandler.cs (3)
137Debug.Assert(exception != null); 206Debug.Assert(object.ReferenceEquals(persistence?.State, _negotiateState), 398Debug.Assert(!items.ContainsKey(AuthPersistenceKey), "This should only be registered once per connection");
PostConfigureNegotiateOptions.cs (1)
49Debug.Assert(_serverAuth.AuthenticationScheme != null);
Microsoft.AspNetCore.Components (49)
ComponentsMetrics.cs (1)
34Debug.Assert(meterFactory != null);
Rendering\RenderTreeBuilder.cs (1)
790Debug.Assert(_hasSeenAddMultipleAttributes);
RenderTree\Renderer.cs (2)
303Debug.Assert(_pendingTasks == null); 360Debug.Assert(_pendingTasks is null || _pendingTasks.Count == 0);
RenderTree\RenderTreeDiffBuilder.cs (1)
174Debug.Assert(action switch
Routing\SupplyParameterFromQueryValueProvider.cs (3)
54Debug.Assert(_subscribers is not null); 96Debug.Assert(url is not null); 126Debug.Assert(_subscribers is not null);
src\Components\Shared\src\ArrayBuilder.cs (1)
180Debug.Assert(newCapacity > _items.Length);
src\Http\Http.Abstractions\src\Routing\RouteValueDictionary.cs (1)
489Debug.Assert(_arrayStorage != null);
src\Http\Routing\src\Constraints\RegexRouteConstraint.cs (1)
68Debug.Assert(_regexFactory is not null);
src\Http\Routing\src\ParameterPolicyActivator.cs (1)
161Debug.Assert(constructors.Count > 0);
src\Http\Routing\src\PathTokenizer.cs (3)
47Debug.Assert(_path[0] == '/'); 97Debug.Assert(_path[_path.Length - 1] != '/'); 98Debug.Assert(currentSegmentIndex == index);
src\Http\Routing\src\Patterns\RoutePattern.cs (5)
48Debug.Assert(defaults != null); 49Debug.Assert(parameterPolicies != null); 50Debug.Assert(parameters != null); 51Debug.Assert(requiredValues != null); 52Debug.Assert(pathSegments != null);
src\Http\Routing\src\Patterns\RoutePatternLiteralPart.cs (1)
22Debug.Assert(!string.IsNullOrEmpty(content));
src\Http\Routing\src\Patterns\RoutePatternMatcher.cs (9)
111Debug.Assert(pathSegment != null); 168Debug.Assert(pathSegment != null); 169Debug.Assert(pathSegment.IsSimple); 172Debug.Assert(part.IsParameter); 240Debug.Assert(!pathSegment.IsSimple); 338Debug.Assert(routeSegment != null); 339Debug.Assert(routeSegment.Parts.Count > 1); 361Debug.Assert(part.IsLiteral || part.IsSeparator); 434Debug.Assert(false, "indexOfLastSegementUsed should always be 0 from the check above");
src\Http\Routing\src\Patterns\RoutePatternParser.cs (8)
51Debug.Assert(context.AtEnd() || context.Current == Separator); 73Debug.Assert(context != null); 74Debug.Assert(segments != null); 145Debug.Assert(context.Current == OpenBrace); 445Debug.Assert(context != null); 446Debug.Assert(literal != null); 485Debug.Assert(template != null); 526Debug.Assert(_index >= 0);
src\Http\Routing\src\Patterns\RoutePatternSeparatorPart.cs (1)
39Debug.Assert(!string.IsNullOrEmpty(content));
src\Http\Routing\src\Template\RoutePrecedence.cs (3)
69Debug.Assert(digit >= 0 && digit < 10); 125Debug.Assert(digit >= 0 && digit < 10); 191Debug.Assert(parameterPart != null);
src\Http\Routing\src\Tree\TreeEnumerator.cs (1)
94Debug.Assert(next.Depth < _tokenizer.Count);
src\Http\Routing\src\Tree\UrlMatchingTree.cs (1)
98Debug.Assert(segment.Parts.Count == 1);
src\Shared\Components\ComponentsActivityLinkStore.cs (1)
36Debug.Assert(_store != null, "Activity links store should not be null.");
src\Shared\QueryStringEnumerable.cs (1)
102Debug.Assert(success);
SupplyParameterFromPersistentComponentStateValueProvider.cs (3)
150Debug.Assert(written == 0); 170Debug.Assert(written == 0); 185Debug.Assert(hashSucceeded);
Microsoft.AspNetCore.Components.Endpoints (30)
Builder\RazorComponentEndpointDataSource.cs (4)
81Debug.Assert(_changeToken != null); 82Debug.Assert(_endpoints != null); 210Debug.Assert(_changeToken != null); 211Debug.Assert(_endpoints != null);
FormMapping\Factories\NullableConverterFactory.cs (3)
26Debug.Assert(underlyingType != null); 29Debug.Assert(underlyingConverter != null); 32Debug.Assert(expectedConverterType != null);
FormMapping\FormDataReader.cs (3)
202Debug.Assert(_currentDepth >= 0); 206Debug.Assert(_currentPrefixBuffer.Length >= keyLength); 235Debug.Assert(_prefixBuffer.Length >= (_currentPrefixBuffer.Length + separator.Length));
FormMapping\HttpContextFormValueMapper.cs (1)
88Debug.Assert(deserializer != null);
src\Shared\Components\ComponentsActivityLinkStore.cs (1)
36Debug.Assert(_store != null, "Activity links store should not be null.");
src\Shared\PropertyHelper\PropertyHelper.cs (18)
161Debug.Assert(propertyInfo != null); 181Debug.Assert(propertyInfo != null); 195Debug.Assert(propertyInfo != null); 198Debug.Assert(propertyGetterWrapperMethod != null); 199Debug.Assert(propertyGetterWrapperMethod.IsGenericMethodDefinition); 200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 203Debug.Assert(propertyGetterByRefWrapperMethod != null); 204Debug.Assert(propertyGetterByRefWrapperMethod.IsGenericMethodDefinition); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 208Debug.Assert(getMethod != null); 209Debug.Assert(!getMethod.IsStatic); 210Debug.Assert(getMethod.GetParameters().Length == 0); 274Debug.Assert(propertyInfo != null); 275Debug.Assert(!propertyInfo.DeclaringType!.IsValueType); 278Debug.Assert(setMethod != null); 279Debug.Assert(!setMethod.IsStatic); 280Debug.Assert(setMethod.ReturnType == typeof(void)); 282Debug.Assert(parameters.Length == 1);
Microsoft.AspNetCore.Components.Server (27)
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\CircuitMetrics.cs (1)
21Debug.Assert(meterFactory != null);
Circuits\CircuitRegistry.cs (2)
136Debug.Assert(result, "This operation operates inside of a lock. We expect the previously inspected value to be still here."); 361Debug.Assert(removeResult, "This operation operates inside of a lock. We expect the previously inspected value to be still here.");
src\Components\Shared\src\ArrayBuilder.cs (1)
180Debug.Assert(newCapacity > _items.Length);
src\Shared\Components\ComponentsActivityLinkStore.cs (1)
36Debug.Assert(_store != null, "Activity links store should not be null.");
src\Shared\PooledArrayBufferWriter.cs (6)
80Debug.Assert(_rentedBuffer != null); 144Debug.Assert(_rentedBuffer != null); 165Debug.Assert(oldBuffer.Length >= _index); 166Debug.Assert(_rentedBuffer.Length >= _index); 174Debug.Assert(_rentedBuffer.Length - _index > 0); 175Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (1)
376Debug.Assert(written == prefixLength);
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
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.Web (9)
Forms\EditForm.cs (2)
133Debug.Assert(_editContext != null); 194Debug.Assert(_editContext != null);
Forms\InputDate.cs (1)
114Debug.Assert(result != null);
Forms\InputRadio.cs (1)
63Debug.Assert(Context != null);
Forms\InputRadioGroup.cs (1)
71Debug.Assert(_context != null);
Forms\Mapping\SupplyParameterFromFormValueProvider.cs (1)
74Debug.Assert(mappingContext != null);
HtmlRendering\StaticHtmlRenderer.HtmlWriting.cs (2)
162Debug.Assert(afterElement == position + frame.ElementSubtreeLength); 177Debug.Assert(afterAttributes == position + frame.ElementSubtreeLength);
Virtualization\Virtualize.cs (1)
189Debug.Assert(refreshTask.IsCompletedSuccessfully);
Microsoft.AspNetCore.Components.WebAssembly (5)
.packages\microsoft.dotnet.hotreload.agent\10.0.100-preview.7.25327.102\contentFiles\cs\netstandard2.1\HotReloadAgent.cs (4)
112Debug.Assert(Capabilities.Length > 0); 113Debug.Assert(_applyUpdate != null); 152Debug.Assert(updatedType >> 24 == 0x02); 173Debug.Assert(_applyUpdate != null);
Services\WebAssemblyConsoleLogger.cs (1)
95Debug.Assert(logLevel != LogLevel.None, "This method is never called with LogLevel.None.");
Microsoft.AspNetCore.Components.WebView (1)
src\Components\Shared\src\ArrayBuilder.cs (1)
180Debug.Assert(newCapacity > _items.Length);
Microsoft.AspNetCore.CookiePolicy (1)
ResponseCookiesWrapper.cs (1)
98Debug.Assert(key != null);
Microsoft.AspNetCore.Cryptography.Internal (5)
SafeHandles\BCryptAlgorithmHandle.cs (1)
45Debug.Assert(pbKey != null);
UnsafeNativeMethods.cs (1)
479Debug.Assert(lastError != 0, "This method should only be called if there was an error.");
WeakReferenceHelpers.cs (3)
38Debug.Assert(newTarget != null); 41Debug.Assert(newWeakRef != null); 53Debug.Assert(currentWeakRef != null);
Microsoft.AspNetCore.Cryptography.KeyDerivation (17)
PBKDF2\ManagedPbkdf2Provider.cs (5)
19Debug.Assert(password != null); 20Debug.Assert(salt != null); 21Debug.Assert(iterationCount > 0); 22Debug.Assert(numBytesRequested > 0); 96Debug.Assert(src.Length == dest.Length);
PBKDF2\NetCorePbkdf2Provider.cs (4)
19Debug.Assert(password != null); 20Debug.Assert(salt != null); 21Debug.Assert(iterationCount > 0); 22Debug.Assert(numBytesRequested > 0);
PBKDF2\Win7Pbkdf2Provider.cs (4)
18Debug.Assert(password != null); 19Debug.Assert(salt != null); 20Debug.Assert(iterationCount > 0); 21Debug.Assert(numBytesRequested > 0);
PBKDF2\Win8Pbkdf2Provider.cs (4)
20Debug.Assert(password != null); 21Debug.Assert(salt != null); 22Debug.Assert(iterationCount > 0); 23Debug.Assert(numBytesRequested > 0);
Microsoft.AspNetCore.DataProtection (51)
AuthenticatedEncryption\AuthenticatedEncryptorFactory.cs (1)
82Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
AuthenticatedEncryption\CngCbcAuthenticatedEncryptorFactory.cs (1)
43Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
AuthenticatedEncryption\CngGcmAuthenticatedEncryptorFactory.cs (1)
44Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
Cng\DpapiSecretSerializerHelper.cs (9)
45Debug.Assert(secret != null); 120Debug.Assert(secret != null); 121Debug.Assert(protectionDescriptorHandle != null); 146Debug.Assert(protectionDescriptorHandle != null); 147Debug.Assert(pbData != null); 198Debug.Assert(protectedSecret != null); 261Debug.Assert(protectedData != null); 274Debug.Assert(pbData != null); 322Debug.Assert(protectedData != null);
DataProtectionServiceCollectionExtensions.cs (1)
64Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
EphemeralDataProtectionProvider.cs (2)
50Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); 103Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
KeyManagement\Key.cs (3)
135Debug.Assert(_descriptorException is null); // Mutually exclusive with _descriptor 151Debug.Assert(_descriptorFactory is not null, "Key constructed without either descriptor or descriptor factory"); 172Debug.Assert(_descriptorException is null); // Mutually exclusive with _descriptor
KeyManagement\KeyRingBasedDataProtector.cs (5)
39Debug.Assert(keyRingProvider != null); 192Debug.Assert(protectedData != null); 303Debug.Assert(success, "Failed to write Guid."); 334Debug.Assert(existingTemplate.Length >= sizeof(uint) /* MAGIC_HEADER */ + sizeof(Guid) /* keyId */); 410Debug.Assert(index == targetArr.Length);
KeyManagement\KeyRingProvider.cs (10)
173Debug.Assert(defaultKey != null); 176Debug.Assert(defaultKey.CreateEncryptor() != null); 228Debug.Assert(utcNow.Kind == DateTimeKind.Utc); 312Debug.Assert(existingCacheableKeyRing != null); 328Debug.Assert(utcNow.Kind == DateTimeKind.Utc); 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"); 446Debug.Assert(task.IsCompleted); 447Debug.Assert(!task.IsCanceled, "How did a task with no cancellation token get canceled?");
KeyManagement\XmlKeyManager.cs (10)
283Debug.Assert(_cacheExpirationTokenSource != null, $"{nameof(TriggerAndResetCacheExpirationToken)} must have been called first."); 290Debug.Assert(keyElement.Name == KeyElementName); 336Debug.Assert(_knownKeyMap.TryGetValue(key.KeyId, out var existingKey)); 337Debug.Assert(existingKey.CreationDate == key.CreationDate); 338Debug.Assert(existingKey.ActivationDate == key.ActivationDate); 339Debug.Assert(existingKey.ExpirationDate == key.ExpirationDate); 346Debug.Assert(revocationElement.Name == RevocationElementName); 668Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); // Hint for the platform compatibility analyzer. 693Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); // Hint for the platform compatibility analyzer. 698Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); // Hint for the platform compatibility analyzer.
Managed\ManagedAuthenticatedEncryptor.cs (2)
514Debug.Assert(success); 517Debug.Assert(bytesWritten == hashSize);
Repositories\DefaultKeyStorageDirectories.cs (1)
74Debug.Assert(retVal != null);
Repositories\FileSystemXmlRepository.cs (1)
209Debug.Assert(fileSystemInfo.Exists, "Having previously been deleted should not have caused an exception");
SP800_108\ManagedSP800_108_CTR_HMACSHA512.cs (2)
105Debug.Assert(success); 106Debug.Assert(bytesWritten == prfOutputSizeInBytes);
XmlEncryption\XmlEncryptionExtensions.cs (2)
62Debug.Assert(placeholderReplacements.Count > 0); 143Debug.Assert(placeholderReplacements.Count > 0);
Microsoft.AspNetCore.DataProtection.Abstractions (2)
DataProtectionCommonExtensions.cs (1)
53Debug.Assert(retVal is IDataProtector); // CreateProtector is supposed to return an instance of this interface
src\Shared\WebEncoders\WebEncoders.cs (1)
155Debug.Assert(arraySizeRequired % 4 == 0, "Invariant: Array length must be a multiple of 4.");
Microsoft.AspNetCore.DeveloperCertificates.XPlat (3)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
655Debug.Assert(pemEnvelope != null);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
90Debug.Assert(oldTrustLevel == TrustLevel.Full); // Mac trust is all or nothing
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
334Debug.Assert(IsCommandAvailable(OpenSslCommand), "How did we trust without the openssl command?");
Microsoft.AspNetCore.Diagnostics (11)
src\Shared\Diagnostics\AnalyzerDebug.cs (3)
14public static void Assert([DoesNotReturnIf(false)] bool b) => Debug.Assert(b); 16/// <inheritdoc cref="Debug.Assert(bool, string)"/> 19=> Debug.Assert(b, message);
src\Shared\Diagnostics\BaseView.cs (3)
110Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 118Debug.Assert(AttributeValues != null); 119Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
src\Shared\RazorViews\BaseView.cs (3)
150Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 158Debug.Assert(AttributeValues != null); 159Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
198Debug.Assert(method != null); 199Debug.Assert(method.DeclaringType != null);
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (9)
src\Shared\Diagnostics\AnalyzerDebug.cs (3)
14public static void Assert([DoesNotReturnIf(false)] bool b) => Debug.Assert(b); 16/// <inheritdoc cref="Debug.Assert(bool, string)"/> 19=> Debug.Assert(b, message);
src\Shared\Diagnostics\BaseView.cs (3)
110Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 118Debug.Assert(AttributeValues != null); 119Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
src\Shared\RazorViews\BaseView.cs (3)
150Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 158Debug.Assert(AttributeValues != null); 159Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (3)
Logging\ApiRoutingController.cs (3)
26Debug.Assert(userId != null, "Test"); 27Debug.Assert(noDataClassification != null, "Test"); 28Debug.Assert(noRedaction != null, "Test");
Microsoft.AspNetCore.Grpc.JsonTranscoding (5)
Internal\Json\MessageTypeInfoResolver.cs (1)
126Debug.Assert(!field.IsRepeated && !field.IsMap, "Collections shouldn't have a setter.");
Internal\JsonRequestHelpers.cs (1)
357Debug.Assert(read == data.Length);
src\Grpc\JsonTranscoding\src\Shared\HttpRoutePatternParser.cs (3)
343Debug.Assert(CurrentVariable.FieldPath.Any()); 344Debug.Assert(CurrentVariable.StartSegment < CurrentVariable.EndSegment); 345Debug.Assert(CurrentVariable.EndSegment <= _segments.Count);
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (3)
ConverterTests\JsonConverterReadTests.cs (1)
661Debug.Assert(objectOld != null);
UnaryServerCallHandlerTests.cs (2)
595Debug.Assert(requestMessage != null); 631Debug.Assert(requestMessage != null);
Microsoft.AspNetCore.Grpc.Swagger (3)
src\Grpc\JsonTranscoding\src\Shared\HttpRoutePatternParser.cs (3)
343Debug.Assert(CurrentVariable.FieldPath.Any()); 344Debug.Assert(CurrentVariable.StartSegment < CurrentVariable.EndSegment); 345Debug.Assert(CurrentVariable.EndSegment <= _segments.Count);
Microsoft.AspNetCore.Hosting (17)
Http\DefaultHttpContextFactory.cs (2)
56Debug.Assert(featureCollection != null); 57Debug.Assert(httpContext != null);
Internal\ConfigureContainerBuilder.cs (1)
24Debug.Assert(MethodInfo != null, "Shouldn't be called when there is no Configure method.");
Internal\HostingApplicationDiagnostics.cs (1)
158Debug.Assert(context.MetricsTagsFeature != null, "MetricsTagsFeature should be set if MetricsEnabled is true.");
Internal\HostingRequestFinishedLog.cs (2)
28Debug.Assert(_context.HttpContext != null); 62Debug.Assert(_context.HttpContext != null);
Internal\StartupMethods.cs (2)
14Debug.Assert(configure != null); 15Debug.Assert(configureServices != null);
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.");
src\Shared\RazorViews\BaseView.cs (3)
150Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 158Debug.Assert(AttributeValues != null); 159Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
198Debug.Assert(method != null); 199Debug.Assert(method.DeclaringType != null);
Microsoft.AspNetCore.Html.Abstractions (2)
HtmlFormattableString.cs (2)
89Debug.Assert(formatProvider != null); 90Debug.Assert(encoder != null);
Microsoft.AspNetCore.Http (12)
src\Http\Shared\StreamCopyOperationInternal.cs (4)
39Debug.Assert(source != null); 40Debug.Assert(destination != null); 41Debug.Assert(!bytesRemaining.HasValue || bytesRemaining.GetValueOrDefault() >= 0); 42Debug.Assert(buffer != null);
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (8)
229Debug.Assert(_arrayStorage == null); 515Debug.Assert(_arrayStorage != null); 545Debug.Assert(_arrayStorage is not null); 546Debug.Assert(_count <= _arrayStorage.Length); 556Debug.Assert(_dictionaryStorage == null); 557Debug.Assert(_arrayStorage != null); 576Debug.Assert(_dictionaryStorage == null); 577Debug.Assert(_arrayStorage != null);
Microsoft.AspNetCore.Http.Abstractions (26)
Extensions\UseMiddlewareExtensions.cs (2)
202Debug.Assert(!RuntimeFeature.IsDynamicCodeSupported, "Use reflection fallback when dynamic code is not supported."); 267Debug.Assert(RuntimeFeature.IsDynamicCodeSupported, "Use compiled expression when dynamic code is supported.");
PathString.cs (2)
158Debug.Assert(count > 0); 159Debug.Assert(buffer is not null);
Routing\RouteValueDictionary.cs (3)
489Debug.Assert(_arrayStorage != null); 772Debug.Assert(_propertyStorage != null); 885Debug.Assert(value != null);
src\Shared\PropertyHelper\PropertyHelper.cs (18)
161Debug.Assert(propertyInfo != null); 181Debug.Assert(propertyInfo != null); 195Debug.Assert(propertyInfo != null); 198Debug.Assert(propertyGetterWrapperMethod != null); 199Debug.Assert(propertyGetterWrapperMethod.IsGenericMethodDefinition); 200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 203Debug.Assert(propertyGetterByRefWrapperMethod != null); 204Debug.Assert(propertyGetterByRefWrapperMethod.IsGenericMethodDefinition); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 208Debug.Assert(getMethod != null); 209Debug.Assert(!getMethod.IsStatic); 210Debug.Assert(getMethod.GetParameters().Length == 0); 274Debug.Assert(propertyInfo != null); 275Debug.Assert(!propertyInfo.DeclaringType!.IsValueType); 278Debug.Assert(setMethod != null); 279Debug.Assert(!setMethod.IsStatic); 280Debug.Assert(setMethod.ReturnType == typeof(void)); 282Debug.Assert(parameters.Length == 1);
src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
47Debug.Assert(_pos == _span.Length);
Microsoft.AspNetCore.Http.Connections (7)
Internal\HttpConnectionContext.cs (2)
522Debug.Assert(Status == HttpConnectionStatus.Disposed); 629Debug.Assert(TransportType != HttpTransportType.None, "Transport has not been initialized yet");
Internal\HttpConnectionsMetrics.cs (1)
58Debug.Assert(transportType != HttpTransportType.None);
Internal\Transports\WebSocketsServerTransport.cs (1)
39Debug.Assert(context.WebSockets.IsWebSocketRequest, "Not a websocket request");
src\Shared\WebEncoders\WebEncoders.cs (1)
155Debug.Assert(arraySizeRequired % 4 == 0, "Invariant: Array length must be a multiple of 4.");
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
Microsoft.AspNetCore.Http.Connections.Client (9)
Internal\Constants.cs (1)
24Debug.Assert(assemblyVersion != null);
Internal\LongPollingTransport.cs (2)
73Debug.Assert(_application != null); 143Debug.Assert(_application != null);
Internal\ServerSentEventsTransport.cs (2)
90Debug.Assert(_application != null); 128Debug.Assert(_application != null);
Internal\WebSocketsTransport.cs (4)
339Debug.Assert(_application != null); 349Debug.Assert(_notifyOnReconnect is not null); 435Debug.Assert(_application != null); 532Debug.Assert(_application != null);
Microsoft.AspNetCore.Http.Connections.Common (3)
NegotiateProtocol.cs (2)
64Debug.Assert(writer.CurrentDepth == 0); 133Debug.Assert(writer.CurrentDepth == 0);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
126Debug.Assert(charsUsed == 1);
Microsoft.AspNetCore.Http.Extensions (33)
RequestDelegateFactory.cs (11)
245Debug.Assert(untargetableRequestDelegate is not null); 257Debug.Assert(targetableRequestDelegate is not null); 415Debug.Assert(factoryContext.EndpointBuilder.FilterFactories.Count > 0); 1295Debug.Assert(factoryContext.JsonRequestBodyParameter is not null, "factoryContext.JsonRequestBodyParameter is null for a JSON body."); 1302Debug.Assert(parameterName is not null, "CreateArgument() should throw if parameter.Name is null."); 1430Debug.Assert(factoryContext.FirstFormRequestBodyParameter is not null, "factoryContext.FirstFormRequestBodyParameter is null for a form body."); 1437Debug.Assert(parameterName is not null, "CreateArgument() should throw if parameter.Name is null."); 1586Debug.Assert(parameterInfo.Name != null, "Parameter name must be set for parameters resolved from properties."); 1611Debug.Assert(parameterInfo.Name != null, "Parameter name must be set for parameters resolved from properties."); 1989Debug.Assert(bindAsyncMethod.Expression is not null); 2282Debug.Assert(parameterName is not null, "CreateArgument() should throw if parameter.Name is null.");
src\Components\Endpoints\src\FormMapping\Factories\NullableConverterFactory.cs (3)
26Debug.Assert(underlyingType != null); 29Debug.Assert(underlyingConverter != null); 32Debug.Assert(expectedConverterType != null);
src\Components\Endpoints\src\FormMapping\FormDataReader.cs (3)
202Debug.Assert(_currentDepth >= 0); 206Debug.Assert(_currentPrefixBuffer.Length >= keyLength); 235Debug.Assert(_prefixBuffer.Length >= (_currentPrefixBuffer.Length + separator.Length));
src\Http\Shared\StreamCopyOperationInternal.cs (4)
39Debug.Assert(source != null); 40Debug.Assert(destination != null); 41Debug.Assert(!bytesRemaining.HasValue || bytesRemaining.GetValueOrDefault() >= 0); 42Debug.Assert(buffer != null);
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (3)
66Debug.Assert(isTrimAotCompatible, "isTrimAotCompatible should always be true."); 149Debug.Assert(_executor != null, "Sync execution is not supported."); 178Debug.Assert(_executorAsync != null, "Async execution is not supported.");
src\Shared\ParameterBindingMethodCache.cs (1)
725Debug.Assert(obj is ParameterLookupKey);
src\Shared\PropertyAsParameterInfo.cs (1)
25Debug.Assert(propertyInfo != null, "PropertyInfo must be provided.");
src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
47Debug.Assert(_pos == _span.Length);
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (6)
37Debug.Assert(value >= 0); 38Debug.Assert(value <= _chars.Length); 48Debug.Assert(capacity >= 0); 86Debug.Assert(index < _pos); 289Debug.Assert(additionalCapacityBeyondPos > 0); 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.Http.Results (6)
src\Http\Shared\StreamCopyOperationInternal.cs (4)
39Debug.Assert(source != null); 40Debug.Assert(destination != null); 41Debug.Assert(!bytesRemaining.HasValue || bytesRemaining.GetValueOrDefault() >= 0); 42Debug.Assert(buffer != null);
src\Shared\RangeHelper\RangeHelper.cs (1)
67Debug.Assert(rangeHeader.Ranges.Count == 1);
src\Shared\ResultsHelpers\SharedUrlHelper.cs (1)
26Debug.Assert(path.HasValue);
Microsoft.AspNetCore.HttpLogging (15)
BufferingStream.cs (1)
147Debug.Assert(_tail != null);
src\Shared\Buffers\BufferSegment.cs (4)
27Debug.Assert(value <= AvailableMemory.Length); 64Debug.Assert(_memoryOwner != null); 102Debug.Assert(segment != null); 103Debug.Assert(Next == null);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
47Debug.Assert(_pos == _span.Length);
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (6)
37Debug.Assert(value >= 0); 38Debug.Assert(value <= _chars.Length); 48Debug.Assert(capacity >= 0); 86Debug.Assert(index < _pos); 289Debug.Assert(additionalCapacityBeyondPos > 0); 290Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.AspNetCore.Identity (5)
IdentityApiEndpointRouteBuilderExtensions.cs (1)
433Debug.Assert(!result.Succeeded);
Passkeys\AuthenticatorData.cs (1)
99Debug.Assert(MinLength == 37);
Passkeys\BufferSourceJsonConverter.cs (3)
63Debug.Assert(bytesConsumed == utf8Unescaped.Length); 85Debug.Assert(status == OperationStatus.Done); 86Debug.Assert(bytesConsumed == bytes.Length);
Microsoft.AspNetCore.Identity.FunctionalTests (4)
src\Identity\Extensions.Core\src\Rfc6238AuthenticationService.cs (4)
40Debug.Assert(res); 53Debug.Assert(res); 54Debug.Assert(written == hash.Length); 61Debug.Assert(offset + 4 < hash.Length);
Microsoft.AspNetCore.Mvc.Abstractions (9)
ModelBinding\ModelMetadata.cs (6)
167Debug.Assert(BoundConstructor != null, "This API can be only called for types with bound constructors."); 182Debug.Assert(BoundConstructor != null, "This API can be only called for types with bound constructors."); 661Debug.Assert(_parameterMapping != null); 662Debug.Assert(_boundConstructorPropertyMapping != null); 749Debug.Assert(ModelType != null); 776Debug.Assert(ModelType != null);
ModelBinding\ModelStateDictionary.cs (2)
552Debug.Assert(key != null); 930Debug.Assert(ChildNodes != null);
src\Shared\ParameterBindingMethodCache.cs (1)
725Debug.Assert(obj is ParameterLookupKey);
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
src\Shared\PropertyAsParameterInfo.cs (1)
25Debug.Assert(propertyInfo != null, "PropertyInfo must be provided.");
Microsoft.AspNetCore.Mvc.Core (241)
ActionConstraints\ActionConstraintCache.cs (1)
95Debug.Assert(entry.ActionConstraints != null || entry.Items != null);
ApplicationModels\ApplicationModelFactory.cs (1)
79Debug.Assert(result != null);
ApplicationModels\ControllerActionDescriptorBuilder.cs (1)
134Debug.Assert(IsAttributeRouted(actionDescriptor));
Authorization\AuthorizeFilter.cs (1)
205Debug.Assert(AuthorizeData != null);
Controllers\ControllerBinderDelegateProvider.cs (1)
60Debug.Assert(valueProvider is not null);
Filters\DefaultFilterProvider.cs (2)
68Debug.Assert(actualFilter != null, "actualFilter should not be null"); 69Debug.Assert(filterMetadata != null, "filterMetadata should not be null");
Formatters\AcceptHeaderParser.cs (2)
124Debug.Assert(input != null); 125Debug.Assert(startIndex <= input.Length); // it's OK if index == value.Length.
Infrastructure\ActionSelectionTable.cs (2)
178Debug.Assert(matches != null); 179Debug.Assert(matches.Count >= 0);
Infrastructure\ControllerActionInvoker.cs (16)
116Debug.Assert(state != null); 117Debug.Assert(_actionExecutingContext != null); 140Debug.Assert(state != null); 141Debug.Assert(_actionExecutingContext != null); 171Debug.Assert(state != null); 172Debug.Assert(_actionExecutingContext != null); 220Debug.Assert(state != null); 221Debug.Assert(_actionExecutingContext != null); 222Debug.Assert(_actionExecutedContext != null); 314Debug.Assert(_actionExecutedContext != null); 336Debug.Assert(invoker._actionExecutedContext != null); 342Debug.Assert(_actionExecutingContext != null); 355Debug.Assert(_actionExecutedContext != null); 362Debug.Assert(invoker._actionExecutedContext != null); 523Debug.Assert(_cacheEntry.ControllerBinderDelegate != null); 538Debug.Assert(actionParameters != null, "Expect arguments to be initialized.");
Infrastructure\DefaultActionDescriptorCollectionProvider.cs (4)
57Debug.Assert(_collection != null); 58Debug.Assert(_changeToken != null); 72Debug.Assert(_collection != null); 73Debug.Assert(_changeToken != null);
Infrastructure\ObjectResultExecutor.cs (1)
124Debug.Assert(result.ContentTypes != null);
Infrastructure\ResourceInvoker.cs (49)
335Debug.Assert(state != null); 336Debug.Assert(_authorizationContext != null); 359Debug.Assert(state != null); 360Debug.Assert(_authorizationContext != null); 381Debug.Assert(state != null); 382Debug.Assert(_authorizationContext != null); 411Debug.Assert(state != null); 412Debug.Assert(_authorizationContext != null); 413Debug.Assert(_authorizationContext.Result != null); 471Debug.Assert(state != null); 472Debug.Assert(_resourceExecutingContext != null); 495Debug.Assert(state != null); 496Debug.Assert(_resourceExecutingContext != null); 530Debug.Assert(state != null); 531Debug.Assert(_resourceExecutingContext != null); 573Debug.Assert(state != null); 574Debug.Assert(_resourceExecutingContext != null); 575Debug.Assert(_resourceExecutedContext != null); 599Debug.Assert(state != null); 600Debug.Assert(_resourceExecutingContext != null); 601Debug.Assert(_resourceExecutedContext != null); 647Debug.Assert(scope == Scope.Invoker || scope == Scope.Resource); 666Debug.Assert(state != null); 696Debug.Assert(state != null); 697Debug.Assert(_exceptionContext != null); 733Debug.Assert(state != null); 782Debug.Assert(state != null); 783Debug.Assert(_exceptionContext != null); 856Debug.Assert(scope == Scope.Invoker || scope == Scope.Resource); 889Debug.Assert(scope == Scope.Invoker); 908Debug.Assert(_resourceExecutingContext != null); 922Debug.Assert(_resourceExecutedContext != null); 929Debug.Assert(invoker._resourceExecutedContext != null); 971Debug.Assert(_resourceExecutedContext != null); 993Debug.Assert(invoker._resourceExecutedContext != null); 1168Debug.Assert(state != null); 1169Debug.Assert(_resultExecutingContext != null); 1192Debug.Assert(state != null); 1193Debug.Assert(_resultExecutingContext != null); 1225Debug.Assert(state != null); 1226Debug.Assert(_resultExecutingContext != null); 1274Debug.Assert(state != null); 1275Debug.Assert(_resultExecutingContext != null); 1276Debug.Assert(_resultExecutedContext != null); 1373Debug.Assert(_resultExecutedContext != null); 1396Debug.Assert(invoker._resultExecutedContext != null); 1404Debug.Assert(_resultExecutingContext != null); 1418Debug.Assert(_resultExecutedContext != null); 1425Debug.Assert(invoker._resultExecutedContext != null);
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 (2)
168Debug.Assert(model != null); 472Debug.Assert(targetCollection != null, "This binder is instantiated only for ICollection<T> model types.");
ModelBinding\Binders\ComplexObjectModelBinder.cs (3)
68Debug.Assert(propertyData == GreedyPropertiesMayHaveData || propertyData == ValueProviderDataAvailable); 440Debug.Assert(property.MetadataKind == ModelMetadataKind.Property); 485Debug.Assert(parameter.MetadataKind == ModelMetadataKind.Parameter);
ModelBinding\Binders\ComplexTypeModelBinder.cs (1)
97Debug.Assert(propertyData == GreedyPropertiesMayHaveData || propertyData == ValueProviderDataAvailable);
ModelBinding\Binders\DictionaryModelBinder.cs (1)
119Debug.Assert(result.Model != null);
ModelBinding\Binders\FormFileModelBinder.cs (2)
105Debug.Assert(postedFiles is List<IFormFile>); 110Debug.Assert(postedFiles is List<IFormFile>);
ModelBinding\Binders\HeaderModelBinder.cs (1)
194Debug.Assert(values != null);
ModelBinding\Metadata\DefaultModelMetadataProvider.cs (1)
358Debug.Assert(propertyKey.MetadataKind == ModelMetadataKind.Property);
ModelBinding\ModelBinderFactory.cs (4)
79Debug.Assert(!(binder is PlaceholderBinder)); 176Debug.Assert(metadata != null); 177Debug.Assert(binder != null); 189Debug.Assert(metadata != null);
ModelBinding\PlaceholderBinder.cs (1)
20Debug.Assert(Inner is not null, "Inner must be resolved before BindModelAsync can be called.");
ModelBinding\PrefixContainer.cs (2)
202Debug.Assert(candidate.StartsWith(prefix, StringComparison.OrdinalIgnoreCase)); 259Debug.Assert(candidate.StartsWith(prefix, StringComparison.OrdinalIgnoreCase));
ModelBinding\SuppressChildValidationMetadataProvider.cs (1)
85Debug.Assert(FullTypeName != null);
ModelBinding\Validation\ClientValidatorCache.cs (1)
83Debug.Assert(entry.Items != null);
ModelBinding\Validation\ValidationStack.cs (1)
56Debug.Assert(ReferenceEquals(List[List.Count - 1], model));
ModelBinding\Validation\ValidationVisitor.cs (3)
203Debug.Assert(Key != null); 204Debug.Assert(Metadata != null); 422Debug.Assert(Metadata is not null && Key is not null && Model is not null);
ModelBinding\Validation\ValidatorCache.cs (1)
73Debug.Assert(entry.Items != null);
MvcCoreDiagnosticListenerExtensions.cs (100)
26Debug.Assert(diagnosticListener != null); 27Debug.Assert(actionDescriptor != null); 28Debug.Assert(httpContext != null); 29Debug.Assert(routeData != null); 54Debug.Assert(diagnosticListener != null); 55Debug.Assert(actionDescriptor != null); 56Debug.Assert(httpContext != null); 57Debug.Assert(routeData != null); 81Debug.Assert(diagnosticListener != null); 82Debug.Assert(authorizationContext != null); 83Debug.Assert(filter != null); 111Debug.Assert(diagnosticListener != null); 112Debug.Assert(authorizationContext != null); 113Debug.Assert(filter != null); 141Debug.Assert(diagnosticListener != null); 142Debug.Assert(authorizationContext != null); 143Debug.Assert(filter != null); 171Debug.Assert(diagnosticListener != null); 172Debug.Assert(authorizationContext != null); 173Debug.Assert(filter != null); 201Debug.Assert(diagnosticListener != null); 202Debug.Assert(resourceExecutingContext != null); 203Debug.Assert(filter != null); 231Debug.Assert(diagnosticListener != null); 232Debug.Assert(resourceExecutedContext != null); 233Debug.Assert(filter != null); 261Debug.Assert(diagnosticListener != null); 262Debug.Assert(resourceExecutingContext != null); 263Debug.Assert(filter != null); 291Debug.Assert(diagnosticListener != null); 292Debug.Assert(resourceExecutingContext != null); 293Debug.Assert(filter != null); 321Debug.Assert(diagnosticListener != null); 322Debug.Assert(resourceExecutedContext != null); 323Debug.Assert(filter != null); 351Debug.Assert(diagnosticListener != null); 352Debug.Assert(resourceExecutedContext != null); 353Debug.Assert(filter != null); 381Debug.Assert(diagnosticListener != null); 382Debug.Assert(exceptionContext != null); 383Debug.Assert(filter != null); 411Debug.Assert(diagnosticListener != null); 412Debug.Assert(exceptionContext != null); 413Debug.Assert(filter != null); 441Debug.Assert(diagnosticListener != null); 442Debug.Assert(exceptionContext != null); 443Debug.Assert(filter != null); 471Debug.Assert(diagnosticListener != null); 472Debug.Assert(exceptionContext != null); 473Debug.Assert(filter != null); 501Debug.Assert(diagnosticListener != null); 502Debug.Assert(actionExecutingContext != null); 503Debug.Assert(filter != null); 531Debug.Assert(diagnosticListener != null); 532Debug.Assert(actionExecutedContext != null); 533Debug.Assert(filter != null); 561Debug.Assert(diagnosticListener != null); 562Debug.Assert(actionExecutingContext != null); 563Debug.Assert(filter != null); 591Debug.Assert(diagnosticListener != null); 592Debug.Assert(actionExecutingContext != null); 593Debug.Assert(filter != null); 621Debug.Assert(diagnosticListener != null); 622Debug.Assert(actionExecutedContext != null); 623Debug.Assert(filter != null); 651Debug.Assert(diagnosticListener != null); 652Debug.Assert(actionExecutedContext != null); 653Debug.Assert(filter != null); 682Debug.Assert(diagnosticListener != null); 683Debug.Assert(actionContext != null); 684Debug.Assert(actionArguments != null); 685Debug.Assert(controller != null); 728Debug.Assert(diagnosticListener != null); 729Debug.Assert(actionContext != null); 730Debug.Assert(actionArguments != null); 731Debug.Assert(controller != null); 774Debug.Assert(diagnosticListener != null); 775Debug.Assert(resultExecutingContext != null); 776Debug.Assert(filter != null); 804Debug.Assert(diagnosticListener != null); 805Debug.Assert(resultExecutedContext != null); 806Debug.Assert(filter != null); 834Debug.Assert(diagnosticListener != null); 835Debug.Assert(resultExecutingContext != null); 836Debug.Assert(filter != null); 864Debug.Assert(diagnosticListener != null); 865Debug.Assert(resultExecutingContext != null); 866Debug.Assert(filter != null); 894Debug.Assert(diagnosticListener != null); 895Debug.Assert(resultExecutedContext != null); 896Debug.Assert(filter != null); 924Debug.Assert(diagnosticListener != null); 925Debug.Assert(resultExecutedContext != null); 926Debug.Assert(filter != null); 954Debug.Assert(diagnosticListener != null); 955Debug.Assert(actionContext != null); 956Debug.Assert(result != null); 980Debug.Assert(diagnosticListener != null); 981Debug.Assert(actionContext != null); 982Debug.Assert(result != null);
Routing\ActionEndpointDataSourceBase.cs (4)
46Debug.Assert(_changeToken != null); 47Debug.Assert(_endpoints != null); 90Debug.Assert(_changeToken != null); 91Debug.Assert(_endpoints != null);
Routing\DynamicControllerEndpointMatcherPolicy.cs (1)
166Debug.Assert(currentSelector == null || ReferenceEquals(currentSelector, selector));
Routing\UrlHelperBase.cs (2)
308Debug.Assert(path.HasValue); 377Debug.Assert(pageName.Length > 0);
Routing\ViewEnginePath.cs (3)
18Debug.Assert(!string.IsNullOrEmpty(first)); 31Debug.Assert(index >= 0); 48Debug.Assert(!string.IsNullOrEmpty(path));
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (3)
66Debug.Assert(isTrimAotCompatible, "isTrimAotCompatible should always be true."); 149Debug.Assert(_executor != null, "Sync execution is not supported."); 178Debug.Assert(_executorAsync != null, "Async execution is not supported.");
src\Shared\PropertyHelper\PropertyHelper.cs (18)
161Debug.Assert(propertyInfo != null); 181Debug.Assert(propertyInfo != null); 195Debug.Assert(propertyInfo != null); 198Debug.Assert(propertyGetterWrapperMethod != null); 199Debug.Assert(propertyGetterWrapperMethod.IsGenericMethodDefinition); 200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 203Debug.Assert(propertyGetterByRefWrapperMethod != null); 204Debug.Assert(propertyGetterByRefWrapperMethod.IsGenericMethodDefinition); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 208Debug.Assert(getMethod != null); 209Debug.Assert(!getMethod.IsStatic); 210Debug.Assert(getMethod.GetParameters().Length == 0); 274Debug.Assert(propertyInfo != null); 275Debug.Assert(!propertyInfo.DeclaringType!.IsValueType); 278Debug.Assert(setMethod != null); 279Debug.Assert(!setMethod.IsStatic); 280Debug.Assert(setMethod.ReturnType == typeof(void)); 282Debug.Assert(parameters.Length == 1);
src\Shared\RangeHelper\RangeHelper.cs (1)
67Debug.Assert(rangeHeader.Ranges.Count == 1);
src\Shared\ResultsHelpers\SharedUrlHelper.cs (1)
26Debug.Assert(path.HasValue);
Microsoft.AspNetCore.Mvc.Core.Test (1)
ModelBinding\StubModelBinder.cs (1)
64Debug.Assert(bindingContext.Result == ModelBindingResult.Failed());
Microsoft.AspNetCore.Mvc.Core.TestCommon (1)
ActivityReplacer.cs (1)
20Debug.Assert(Activity.Current == _activity);
Microsoft.AspNetCore.Mvc.Formatters.Xml (3)
XmlDataContractSerializerOutputFormatter.cs (2)
242Debug.Assert(valueType is not null); 251Debug.Assert(wrapperProvider is not null);
XmlSerializerOutputFormatter.cs (1)
228Debug.Assert(wrapperProvider is not null);
Microsoft.AspNetCore.Mvc.IntegrationTests (6)
BinderTypeBasedModelBinderIntegrationTest.cs (5)
322Debug.Assert(bindingContext.Result == ModelBindingResult.Failed()); 347Debug.Assert(bindingContext.Result == ModelBindingResult.Failed()); 371Debug.Assert(bindingContext.Result == ModelBindingResult.Failed()); 389Debug.Assert(bindingContext.Result == ModelBindingResult.Failed()); 401Debug.Assert(bindingContext.Result == ModelBindingResult.Failed());
GenericModelBinderIntegrationTest.cs (1)
170Debug.Assert(bindingContext.Result == ModelBindingResult.Failed());
Microsoft.AspNetCore.Mvc.Localization (2)
Properties\Resources.Designer.cs (1)
49System.Diagnostics.Debug.Assert(value != null);
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.Razor (7)
Compilation\DefaultViewCompiler.cs (1)
120Debug.Assert(relativePath != null);
RazorPageBase.cs (2)
304Debug.Assert(_valueBuffer is not null); 607Debug.Assert(_tagHelperAttributeInfo.ExecutionContext != null);
RazorView.cs (2)
97Debug.Assert(_bufferScope != null); 280Debug.Assert(originalLocations is not null && layoutPageResult.SearchedLocations is not null);
RazorViewEngine.cs (2)
482Debug.Assert(!string.IsNullOrEmpty(name)); 488Debug.Assert(!string.IsNullOrEmpty(name));
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (16)
CSharpCompiler.cs (3)
117Debug.Assert(_parseOptions is not null); 118Debug.Assert(_compilationOptions is not null); 119Debug.Assert(_emitOptions is not null);
PageActionDescriptorChangeProvider.cs (1)
32Debug.Assert(!string.IsNullOrEmpty(rootDirectory));
RuntimeViewCompiler.cs (5)
138Debug.Assert(item.ExpirationTokens != null); 152Debug.Assert(item.Descriptor != null); 162Debug.Assert(taskSource != null); 168Debug.Assert(item.Descriptor != null); 383Debug.Assert(relativePath != null);
src\Mvc\Mvc.RazorPages\src\ApplicationModels\PageRouteModelFactory.cs (7)
89Debug.Assert(relativePath.StartsWith('/')); 129Debug.Assert(path.StartsWith(rootDirectory, StringComparison.OrdinalIgnoreCase)); 130Debug.Assert(path.EndsWith(RazorViewEngine.ViewExtension, StringComparison.OrdinalIgnoreCase)); 140Debug.Assert(!string.IsNullOrEmpty(areaName)); 141Debug.Assert(!string.IsNullOrEmpty(viewEnginePath)); 142Debug.Assert(viewEnginePath.StartsWith('/')); 175Debug.Assert(directory.StartsWith('/'));
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (2)
TestInfrastructure\DirectoryNode.cs (2)
34Debug.Assert(directory != null); 113Debug.Assert(!string.IsNullOrEmpty(path));
Microsoft.AspNetCore.Mvc.RazorPages (80)
ApplicationModels\PageRouteModelFactory.cs (7)
89Debug.Assert(relativePath.StartsWith('/')); 129Debug.Assert(path.StartsWith(rootDirectory, StringComparison.OrdinalIgnoreCase)); 130Debug.Assert(path.EndsWith(RazorViewEngine.ViewExtension, StringComparison.OrdinalIgnoreCase)); 140Debug.Assert(!string.IsNullOrEmpty(areaName)); 141Debug.Assert(!string.IsNullOrEmpty(viewEnginePath)); 142Debug.Assert(viewEnginePath.StartsWith('/')); 175Debug.Assert(directory.StartsWith('/'));
DependencyInjection\RazorPagesRazorViewEngineOptionsSetup.cs (1)
26Debug.Assert(!string.IsNullOrEmpty(rootDirectory));
Infrastructure\DynamicPageEndpointMatcherPolicy.cs (1)
183Debug.Assert(currentSelector == null || ReferenceEquals(currentSelector, selector));
Infrastructure\DynamicPageEndpointSelectorCache.cs (1)
35Debug.Assert(dataSourceId is not null);
Infrastructure\PageActionInvoker.cs (29)
192Debug.Assert(_instance is not null); 213Debug.Assert(handlerBinder is not null); 214Debug.Assert(_arguments is not null); 253Debug.Assert(_instance is not null); 254Debug.Assert(_arguments is not null); 267Debug.Assert(executor != null, "We should always find a executor for a handler"); 321Debug.Assert(_instance is not null); 357Debug.Assert(state != null); 358Debug.Assert(_handlerSelectedContext != null); 381Debug.Assert(state != null); 382Debug.Assert(_handlerSelectedContext != null); 397Debug.Assert(state != null); 398Debug.Assert(_handlerSelectedContext != null); 439Debug.Assert(_instance is not null); 440Debug.Assert(_arguments is not null); 471Debug.Assert(state != null); 472Debug.Assert(_handlerExecutingContext != null); 495Debug.Assert(state != null); 496Debug.Assert(_handlerExecutingContext != null); 498Debug.Assert(_instance is not null); 529Debug.Assert(state != null); 530Debug.Assert(_handlerExecutingContext != null); 531Debug.Assert(_instance is not null); 580Debug.Assert(state != null); 581Debug.Assert(_handlerExecutingContext != null); 582Debug.Assert(_handlerExecutedContext != null); 670Debug.Assert(_handlerExecutedContext != null); 675Debug.Assert(_handlerExecutingContext != null); 690Debug.Assert(_handlerExecutedContext != null);
Infrastructure\PageActionInvokerCache.cs (1)
47Debug.Assert(compiledPageActionDescriptor != null, "PageLoader didn't run!");
MvcRazorPagesDiagnosticListenerExtensions.cs (40)
20Debug.Assert(diagnosticListener != null); 21Debug.Assert(actionContext != null); 22Debug.Assert(handlerMethodDescriptor != null); 23Debug.Assert(arguments != null); 24Debug.Assert(instance != null); 56Debug.Assert(diagnosticListener != null); 57Debug.Assert(actionContext != null); 58Debug.Assert(handlerMethodDescriptor != null); 59Debug.Assert(arguments != null); 60Debug.Assert(instance != null); 90Debug.Assert(diagnosticListener != null); 91Debug.Assert(handlerExecutionContext != null); 92Debug.Assert(filter != null); 120Debug.Assert(diagnosticListener != null); 121Debug.Assert(handlerExecutedContext != null); 122Debug.Assert(filter != null); 150Debug.Assert(diagnosticListener != null); 151Debug.Assert(handlerExecutingContext != null); 152Debug.Assert(filter != null); 180Debug.Assert(diagnosticListener != null); 181Debug.Assert(handlerExecutingContext != null); 182Debug.Assert(filter != null); 210Debug.Assert(diagnosticListener != null); 211Debug.Assert(handlerExecutedContext != null); 212Debug.Assert(filter != null); 240Debug.Assert(diagnosticListener != null); 241Debug.Assert(handlerExecutedContext != null); 242Debug.Assert(filter != null); 270Debug.Assert(diagnosticListener != null); 271Debug.Assert(handlerSelectedContext != null); 272Debug.Assert(filter != null); 300Debug.Assert(diagnosticListener != null); 301Debug.Assert(handlerSelectedContext != null); 302Debug.Assert(filter != null); 330Debug.Assert(diagnosticListener != null); 331Debug.Assert(handlerSelectedContext != null); 332Debug.Assert(filter != null); 360Debug.Assert(diagnosticListener != null); 361Debug.Assert(handlerSelectedContext != null); 362Debug.Assert(filter != null);
Microsoft.AspNetCore.Mvc.TagHelpers (8)
CacheTagHelper.cs (1)
269Debug.Assert(length == 0);
CurrentValues.cs (1)
12Debug.Assert(values != null);
JavaScriptResources.cs (1)
39Debug.Assert(
LinkTagHelper.cs (2)
325Debug.Assert(url != null); 451Debug.Assert(fallbackHrefs[i] != null);
ScriptTagHelper.cs (2)
338Debug.Assert(url != null); 366Debug.Assert(src != null);
TagHelperOutputExtensions.cs (1)
99Debug.Assert(found);
Microsoft.AspNetCore.Mvc.Testing (2)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.7.25327.102\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
294Debug.Assert(_hostTcs.Task.IsCompleted);
Handlers\RedirectHandler.cs (1)
137Debug.Assert(response.RequestMessage is not null);
Microsoft.AspNetCore.Mvc.ViewFeatures (47)
AttributeDictionary.cs (8)
76Debug.Assert(index >= 0 && index < Count && _items != null); 82Debug.Assert(index >= 0 && index <= Count); 83Debug.Assert(value.Key != null); 95Debug.Assert(index >= 0 && index <= Count); 96Debug.Assert(value.Key != null); 108Debug.Assert(index >= 0 && index < Count); 110Debug.Assert(_items != null); 119Debug.Assert(key != null);
Buffers\PagedBufferedTextWriter.cs (2)
50Debug.Assert(length > 0); 66Debug.Assert(length == 0);
Buffers\PagedCharBuffer.cs (2)
61Debug.Assert(copyLength > 0); 82Debug.Assert(copyLength > 0);
CachedExpressionCompiler.cs (2)
45Debug.Assert(expression != null); 223Debug.Assert(combinedNullTest.Type == typeof(bool));
DefaultDisplayTemplates.cs (1)
89Debug.Assert(elementMetadata != null);
DefaultEditorTemplates.cs (1)
71Debug.Assert(elementMetadata != null);
DefaultHtmlGenerator.cs (4)
199Debug.Assert(!isChecked.HasValue); 454Debug.Assert(!isChecked.HasValue); 457Debug.Assert(value != null); 966Debug.Assert(isTargetEnum ^ enumNames == null);
ExpressionHelper.cs (7)
131Debug.Assert(segmentCount >= 0); 134Debug.Assert(!doNotCache); 148Debug.Assert(doNotCache); 157Debug.Assert(doNotCache); 168Debug.Assert(!name.Contains("__")); 182Debug.Assert(false); 187Debug.Assert(segmentCount == 0);
ExpressionMetadataProvider.cs (1)
118Debug.Assert(metadata != null);
Filters\SaveTempDataPropertyFilterBase.cs (1)
70Debug.Assert(Subject != null, "Subject must be set before this method is invoked.");
ModelExplorer.cs (2)
127Debug.Assert(Container != null); 202Debug.Assert(propertyHelper != null);
ModelExplorerExtensions.cs (1)
53Debug.Assert(enumGroupedDisplayNamesAndValues != null);
src\Shared\PooledArrayBufferWriter.cs (6)
80Debug.Assert(_rentedBuffer != null); 144Debug.Assert(_rentedBuffer != null); 165Debug.Assert(oldBuffer.Length >= _index); 166Debug.Assert(_rentedBuffer.Length >= _index); 174Debug.Assert(_rentedBuffer.Length - _index > 0); 175Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
TempDataDictionary.cs (1)
152Debug.Assert(_initialKeys is not null && _retainedKeys is not null && _data is not null);
TemplateBuilder.cs (1)
107Debug.Assert(enumGrouped != null);
ValidationHelpers.cs (4)
13Debug.Assert(modelError != null); 29Debug.Assert(modelError != null); 30Debug.Assert(containingEntry != null); 31Debug.Assert(modelExplorer != null);
ViewDataDictionaryFactory.cs (2)
18Debug.Assert(constructor != null); 39Debug.Assert(constructor != null);
ViewDataEvaluator.cs (1)
100Debug.Assert(expression != null);
Microsoft.AspNetCore.OpenApi (13)
Extensions\ApiDescriptionExtensions.cs (1)
44Debug.Assert(apiDescription.RelativePath != null, "Relative path cannot be null.");
Schemas\OpenApiJsonSchema.Helpers.cs (1)
205Debug.Assert(type is not null);
Services\OpenApiDocumentService.cs (1)
252Debug.Assert(descriptions.Key != null, "Relative path mapped to OpenApiPath key cannot be null.");
Services\Schemas\OpenApiSchemaService.cs (1)
133Debug.Assert(deserializedSchema != null, "The schema should have been deserialized successfully and materialize a non-null value.");
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (3)
66Debug.Assert(isTrimAotCompatible, "isTrimAotCompatible should always be true."); 149Debug.Assert(_executor != null, "Sync execution is not supported."); 178Debug.Assert(_executorAsync != null, "Async execution is not supported.");
src\Shared\ParameterBindingMethodCache.cs (1)
725Debug.Assert(obj is ParameterLookupKey);
src\Shared\PropertyAsParameterInfo.cs (1)
25Debug.Assert(propertyInfo != null, "PropertyInfo must be provided.");
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
126Debug.Assert(charsUsed == 1);
Transformers\OpenApiDocumentTransformerContext.cs (1)
48Debug.Assert(Document is not null, "Document should have been initialized by framework.");
Microsoft.AspNetCore.OpenApi.SourceGenerators (2)
src\Shared\Diagnostics\AnalyzerDebug.cs (2)
16/// <inheritdoc cref="Debug.Assert(bool, string)"/> 19=> Debug.Assert(b, message);
Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests (1)
SnapshotTestHelper.cs (1)
484Debug.Assert(_hostTcs.Task.IsCompleted);
Microsoft.AspNetCore.OutputCaching (23)
FormatterBinaryWriter.cs (6)
46Debug.Assert(target is not null); 50Debug.Assert(length == 0 && offset == 0); 55Debug.Assert(offset >= 0 && offset <= length); 56Debug.Assert(length > 0); 94Debug.Assert(actual == bytes); 102Debug.Assert(actual == bytes);
Memory\MemoryOutputCacheStore.cs (7)
100Debug.Assert(keys != null); 118Debug.Assert(key != null); 137Debug.Assert(state != null); 141Debug.Assert(tags != null); 142Debug.Assert(tags.Length > 0); 143Debug.Assert(key is string); 144Debug.Assert(entryId != Guid.Empty);
OutputCacheEntryFormatter.cs (1)
373Debug.Assert(reader.IsEOF, "should have read entire payload");
RecyclableArrayBufferWriter.cs (4)
66Debug.Assert(_buffer.Length > _index); 73Debug.Assert(_buffer.Length > _index); 107Debug.Assert(needed > currentLength); 127Debug.Assert(FreeCapacity > 0 && FreeCapacity >= sizeHint);
RecyclableSequenceBuilder.cs (2)
73Debug.Assert(_currentSegment is not null); 75Debug.Assert(_currentSegmentIndex >= 0 && _currentSegmentIndex <= current.Length);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (6)
RedisOutputCacheStore.cs (6)
99Debug.Assert(secondsWithJitter >= 270 && secondsWithJitter <= 330); 168Debug.Assert(cache is not null); 193Debug.Assert(cache is not null); 212Debug.Assert(cache is not null); 246Debug.Assert(cache is not null); 345Debug.Assert(_cache is not null);
Microsoft.AspNetCore.Razor (1)
TagHelpers\DefaultTagHelperContent.cs (1)
34Debug.Assert(_buffer.Count == 0);
Microsoft.AspNetCore.Razor.Runtime (1)
Runtime\TagHelpers\TagHelperExecutionContext.cs (1)
221Debug.Assert(!Output.IsContentModified);
Microsoft.AspNetCore.Razor.Runtime.Test (1)
Runtime\TagHelpers\TagHelperRunnerTest.cs (1)
259Debug.Assert(ProcessOrderTracker != null);
Microsoft.AspNetCore.ResponseCaching (3)
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
Microsoft.AspNetCore.ResponseCompression (5)
ResponseCompressionMiddleware.cs (1)
51Debug.Assert(originalBodyFeature != null);
ResponseCompressionProvider.cs (1)
83Debug.Assert(false, "Duplicate check failed.");
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
Microsoft.AspNetCore.Rewrite (7)
ApacheModRewrite\ConditionEvaluator.cs (1)
52Debug.Assert(condResult != null, "ConditionEvaluator must be passed at least one condition to evaluate.");
ApacheModRewrite\CookieActionFactory.cs (1)
59Debug.Assert(action != null || tokenType == Fields.Name);
ApacheModRewrite\RuleBuilder.cs (4)
65Debug.Assert(input.Operand != null); 76Debug.Assert(input.Operand != null); 102Debug.Assert(input.Operand != null); 162Debug.Assert(input.Operand != null);
PatternSegments\RuleMatchSegment.cs (1)
19Debug.Assert(ruleBackReferences != null);
Microsoft.AspNetCore.Routing (89)
ArrayBuilder.cs (7)
32Debug.Assert(capacity >= 0); 61Debug.Assert(index >= 0 && index < _count); 85Debug.Assert(_count > 0); 94Debug.Assert(_count > 0); 111Debug.Assert(_array != null); // Nonzero _count should imply this 141Debug.Assert(_count < Capacity); 148Debug.Assert(minimum > Capacity);
Constraints\RegexRouteConstraint.cs (1)
68Debug.Assert(_regexFactory is not null);
Matching\CandidateSet.cs (2)
289Debug.Assert(cmp <= 0); 335Debug.Assert(count > 0);
Matching\DfaMatcher.cs (2)
198Debug.Assert(candidateStateArray is not null); 205Debug.Assert(candidateStateArray is not null);
Matching\DfaMatcherBuilder.cs (1)
396Debug.Assert(i == segment.Parts.Count - 1 && partParameter.IsOptional);
Matching\EndpointComparer.cs (4)
43Debug.Assert(x != null); 44Debug.Assert(y != null); 79Debug.Assert(x != null); 80Debug.Assert(y != null);
Matching\ILEmitTrieFactory.cs (4)
524Debug.Assert(entries.Length == 1, "We should have a single entry"); 534Debug.Assert(index + 4 <= text.Length); 544Debug.Assert(index + 4 <= text.Length); 552Debug.Assert(index + 1 <= text.Length);
Matching\SingleEntryAsciiJumpTable.cs (1)
47Debug.Assert(a.Length == b.Length && b.Length == length);
ParameterPolicyActivator.cs (1)
161Debug.Assert(constructors.Count > 0);
ParameterPolicyFactory.cs (1)
40Debug.Assert(reference.ParameterPolicy != null || reference.Content != null);
PathTokenizer.cs (3)
47Debug.Assert(_path[0] == '/'); 97Debug.Assert(_path[_path.Length - 1] != '/'); 98Debug.Assert(currentSegmentIndex == index);
Patterns\RoutePattern.cs (5)
48Debug.Assert(defaults != null); 49Debug.Assert(parameterPolicies != null); 50Debug.Assert(parameters != null); 51Debug.Assert(requiredValues != null); 52Debug.Assert(pathSegments != null);
Patterns\RoutePatternLiteralPart.cs (1)
22Debug.Assert(!string.IsNullOrEmpty(content));
Patterns\RoutePatternMatcher.cs (9)
111Debug.Assert(pathSegment != null); 168Debug.Assert(pathSegment != null); 169Debug.Assert(pathSegment.IsSimple); 172Debug.Assert(part.IsParameter); 240Debug.Assert(!pathSegment.IsSimple); 338Debug.Assert(routeSegment != null); 339Debug.Assert(routeSegment.Parts.Count > 1); 361Debug.Assert(part.IsLiteral || part.IsSeparator); 434Debug.Assert(false, "indexOfLastSegementUsed should always be 0 from the check above");
Patterns\RoutePatternParser.cs (8)
51Debug.Assert(context.AtEnd() || context.Current == Separator); 73Debug.Assert(context != null); 74Debug.Assert(segments != null); 145Debug.Assert(context.Current == OpenBrace); 445Debug.Assert(context != null); 446Debug.Assert(literal != null); 485Debug.Assert(template != null); 526Debug.Assert(_index >= 0);
Patterns\RoutePatternSeparatorPart.cs (1)
39Debug.Assert(!string.IsNullOrEmpty(content));
RequestDelegateFilterPipelineBuilder.cs (1)
19Debug.Assert(options.EndpointBuilder != null);
RouteBase.cs (2)
313Debug.Assert(_constraintLogger != null); 324Debug.Assert(_constraintLogger != null);
RouteCollection.cs (1)
150Debug.Assert(_options != null);
RouteEndpointDataSource.cs (2)
219Debug.Assert(entry.InferMetadataFunc != null, "A func to infer metadata must be provided for route handlers."); 264Debug.Assert(factoryCreatedRequestDelegate is not null);
RouteOptions.cs (1)
34Debug.Assert(_endpointDataSources != null, "Endpoint data sources should have been set in DI.");
src\Shared\PropertyHelper\PropertyHelper.cs (18)
161Debug.Assert(propertyInfo != null); 181Debug.Assert(propertyInfo != null); 195Debug.Assert(propertyInfo != null); 198Debug.Assert(propertyGetterWrapperMethod != null); 199Debug.Assert(propertyGetterWrapperMethod.IsGenericMethodDefinition); 200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 203Debug.Assert(propertyGetterByRefWrapperMethod != null); 204Debug.Assert(propertyGetterByRefWrapperMethod.IsGenericMethodDefinition); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 208Debug.Assert(getMethod != null); 209Debug.Assert(!getMethod.IsStatic); 210Debug.Assert(getMethod.GetParameters().Length == 0); 274Debug.Assert(propertyInfo != null); 275Debug.Assert(!propertyInfo.DeclaringType!.IsValueType); 278Debug.Assert(setMethod != null); 279Debug.Assert(!setMethod.IsStatic); 280Debug.Assert(setMethod.ReturnType == typeof(void)); 282Debug.Assert(parameters.Length == 1);
Template\RoutePrecedence.cs (7)
48Debug.Assert(digit >= 0 && digit < 10); 69Debug.Assert(digit >= 0 && digit < 10); 102Debug.Assert(digit >= 0 && digit < 10); 125Debug.Assert(digit >= 0 && digit < 10); 163Debug.Assert(part.IsParameter); 191Debug.Assert(parameterPart != null); 231Debug.Assert(part.IsParameter);
Template\TemplateBinder.cs (2)
518Debug.Assert(context.BufferState == SegmentState.Beginning); 519Debug.Assert(context.UriState == SegmentState.Beginning);
Tree\TreeEnumerator.cs (1)
94Debug.Assert(next.Depth < _tokenizer.Count);
Tree\UrlMatchingTree.cs (1)
98Debug.Assert(segment.Parts.Count == 1);
UriBuildingContext.cs (2)
137Debug.Assert(_lastValueOffset != -1, "Cannot invoke Remove more than once."); 171Debug.Assert(result);
Microsoft.AspNetCore.Routing.Abstractions (19)
RouteData.cs (1)
146Debug.Assert(_routers != null);
src\Shared\PropertyHelper\PropertyHelper.cs (18)
161Debug.Assert(propertyInfo != null); 181Debug.Assert(propertyInfo != null); 195Debug.Assert(propertyInfo != null); 198Debug.Assert(propertyGetterWrapperMethod != null); 199Debug.Assert(propertyGetterWrapperMethod.IsGenericMethodDefinition); 200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 203Debug.Assert(propertyGetterByRefWrapperMethod != null); 204Debug.Assert(propertyGetterByRefWrapperMethod.IsGenericMethodDefinition); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 208Debug.Assert(getMethod != null); 209Debug.Assert(!getMethod.IsStatic); 210Debug.Assert(getMethod.GetParameters().Length == 0); 274Debug.Assert(propertyInfo != null); 275Debug.Assert(!propertyInfo.DeclaringType!.IsValueType); 278Debug.Assert(setMethod != null); 279Debug.Assert(!setMethod.IsStatic); 280Debug.Assert(setMethod.ReturnType == typeof(void)); 282Debug.Assert(parameters.Length == 1);
Microsoft.AspNetCore.Server.HttpSys (54)
AsyncAcceptContext.cs (5)
72Debug.Assert(_requestContext != null); 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 172Debug.Assert(_requestContext != null);
AuthenticationManager.cs (1)
87Debug.Assert(_urlGroup == null, "SetUrlGroupSecurity called more than once.");
HttpSysListener.cs (3)
253Debug.Assert(_serverSession != null, "ServerSessionHandle is null in CloseV2Config"); 254Debug.Assert(!_serverSession.Id.IsInvalid, "ServerSessionHandle is invalid in CloseV2Config"); 265Debug.Assert(_state != State.Stopped, "Listener has been stopped.");
MessagePump.cs (4)
106Debug.Assert(RequestContextFactory == null, "Start called twice!"); 108Debug.Assert(application != null); 164Debug.Assert(RequestContextFactory != null); 272Debug.Assert(_messagePump.Stopping);
NativeInterop\RequestQueue.cs (2)
145Debug.Assert(Created); 161Debug.Assert(Created);
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\RequestContext.FeatureCollection.cs (1)
81Debug.Assert(_features != null);
RequestProcessing\Response.cs (4)
283Debug.Assert(!HasStarted, "HttpListenerResponse::SendHeaders()|SentHeaders is true."); 384Debug.Assert(!HasComputedHeaders, nameof(HasComputedHeaders) + " is true."); 607Debug.Assert(HasTrailers); 653Debug.Assert(unknownHeadersOffset == trailerCount);
RequestProcessing\ResponseBody.cs (4)
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."); 223Debug.Assert(hasData); 272Debug.Assert(currentChunk == dataChunks.Length, "All chunks should be accounted for");
RequestProcessing\ResponseStreamAsyncResult.cs (2)
94Debug.Assert(currentChunk == _dataChunks.Length); 135Debug.Assert(currentChunk == _dataChunks.Length);
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
205Debug.Assert(_memoryHandle.HasValue);
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\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (6)
122Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 131Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 171Debug.Assert(_backingBuffer != null); 185Debug.Assert(_nativeRequest != null, "RequestContextBase::ReleasePins()|ReleasePins() called twice."); 224Debug.Assert(_nativeRequest == null, "RequestContextBase::Dispose()|Dispose() called before ReleasePins()."); 235Debug.Assert((int)HTTP_VERB.HttpVerbMaximum == HttpVerbs.Length);
src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (1)
23Debug.Assert(rawUrlBytes.Length != 0, "Length of the URL cannot be zero.");
src\Shared\PathNormalizer\PathNormalizer.cs (2)
17Debug.Assert(src[0] == '/', "Path segment must always start with a '/'"); 98Debug.Assert(src[0] == '/');
src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
UrlPrefixCollection.cs (2)
214Debug.Assert(_urlGroup != null); 224Debug.Assert(port >= 5000 || port < 8000);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (33)
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (2)
76Debug.Assert(_count + 1 <= maxCapacity); 80Debug.Assert(newBufferSize > _count);
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
249Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 261Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 315Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
95Debug.Assert(indexLength >= 1); 127Debug.Assert(indexLength >= 1); 159Debug.Assert(indexLength >= 1); 197Debug.Assert(indexLength >= 1); 369Debug.Assert(Ascii.IsValid(value)); 376Debug.Assert(integerLength >= 1); 382Debug.Assert(status == OperationStatus.Done); 383Debug.Assert(valueBytesWritten == value.Length); 397Debug.Assert(destination.Length >= value.Length); 406Debug.Assert(status == OperationStatus.Done); 407Debug.Assert(bytesWritten == value.Length); 426Debug.Assert(integerLength >= 1); 470Debug.Assert(integerLength >= 1); 481Debug.Assert(written == encodedStringLength); 528Debug.Assert(separator != null); 529Debug.Assert(Ascii.IsValid(separator)); 551Debug.Assert(integerLength >= 1);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (2)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8); 40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
235Debug.Assert(totalBytesUsed == encodedLength);
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)
229Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
Microsoft.AspNetCore.Server.IIS (47)
Core\HttpRequestStream.cs (2)
62Debug.Assert(_body != null, "Stream must be accepting reads."); 75Debug.Assert(_body != null, "Stream must be accepting reads.");
Core\IISHttpContext.cs (2)
451Debug.Assert(_hasResponseStarted == false); 491Debug.Assert(!HasStartedConsumingRequestBody);
Core\IISHttpContext.FeatureCollection.cs (1)
365Debug.Assert(_readBodyTask == null || _readBodyTask.IsCompleted);
Core\IISHttpServer.cs (1)
167Debug.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.cs (1)
175Debug.Assert(_runningOperation != null);
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.cs (2)
37Debug.Assert(!read.InUse()); 53Debug.Assert(!write.InUse());
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.");
Core\OutputProducer.cs (1)
119Debug.Assert(false);
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
205Debug.Assert(_memoryHandle.HasValue);
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\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (6)
122Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 131Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 171Debug.Assert(_backingBuffer != null); 185Debug.Assert(_nativeRequest != null, "RequestContextBase::ReleasePins()|ReleasePins() called twice."); 224Debug.Assert(_nativeRequest == null, "RequestContextBase::Dispose()|Dispose() called before ReleasePins()."); 235Debug.Assert((int)HTTP_VERB.HttpVerbMaximum == HttpVerbs.Length);
src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (1)
23Debug.Assert(rawUrlBytes.Length != 0, "Length of the URL cannot be zero.");
src\Shared\PathNormalizer\PathNormalizer.cs (2)
17Debug.Assert(src[0] == '/', "Path segment must always start with a '/'"); 98Debug.Assert(src[0] == '/');
src\Shared\RazorViews\BaseView.cs (3)
150Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 158Debug.Assert(AttributeValues != null); 159Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
235Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
198Debug.Assert(method != null); 199Debug.Assert(method.DeclaringType != null);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
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 (358)
AnyIPListenOptions.cs (1)
20Debug.Assert(IPEndPoint != null);
HttpsConfigurationService.cs (4)
135Debug.Assert(_useHttpsWithDefaults is not null); 136Debug.Assert(_tlsConfigurationLoader is not null); 137Debug.Assert(_populateMultiplexedTransportFeatures is not null); 138Debug.Assert(_httpsLogger is not null);
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)
91Debug.Assert(!RequestUpgrade, "Upgraded connections should never use this code path!"); 172Debug.Assert(_pumpTask != null, "OnReadStartedAsync must have been called.");
Internal\Http\Http1Connection.cs (9)
160Debug.Assert(MinRequestBodyDataRate != null); 293Debug.Assert(startLine.IndexOf((byte)0) == -1); 298Debug.Assert(target.Length != 0, "Request target must be non-zero length"); 332Debug.Assert(RawTarget != null, "RawTarget was not set"); 333Debug.Assert(((IHttpRequestFeature)this).Method != null, "Method was not set"); 334Debug.Assert(Path != null, "Path was not set"); 335Debug.Assert(QueryString != null, "QueryString was not set"); 336Debug.Assert(HttpVersion != null, "HttpVersion was not set"); 342Debug.Assert(target[0] == ByteForwardSlash, "Should only be called when path starts with /");
Internal\Http\Http1OutputProducer.cs (8)
175Debug.Assert(!producer._pipeWriterCompleted); 176Debug.Assert(producer._responseBodyMode == ResponseBodyMode.Chunked && producer._advancedBytesForChunk > 0); 363Debug.Assert(responseBodyMode != ResponseBodyMode.Uninitialized); 541Debug.Assert(_currentSegmentOwner == null); 542Debug.Assert(_completedSegments == null || _completedSegments.Count == 0); 648Debug.Assert(_advancedBytesForChunk <= _currentChunkMemory.Length); 649Debug.Assert(_advancedBytesForChunk > 0); 653Debug.Assert(bytesWritten <= _currentMemoryPrefixBytes);
Internal\Http\HttpHeaders.Generated.cs (131)
8403Debug.Assert((_currentBits & 0x1L) != 0); 8408Debug.Assert((_currentBits & 0x2L) != 0); 8413Debug.Assert((_currentBits & 0x4L) != 0); 8418Debug.Assert((_currentBits & 0x8L) != 0); 8423Debug.Assert((_currentBits & 0x10L) != 0); 8428Debug.Assert((_currentBits & 0x20L) != 0); 8433Debug.Assert((_currentBits & 0x40L) != 0); 8438Debug.Assert((_currentBits & 0x80L) != 0); 8443Debug.Assert((_currentBits & 0x100L) != 0); 8448Debug.Assert((_currentBits & 0x200L) != 0); 8453Debug.Assert((_currentBits & 0x400L) != 0); 8458Debug.Assert((_currentBits & 0x800L) != 0); 8463Debug.Assert((_currentBits & 0x1000L) != 0); 8468Debug.Assert((_currentBits & 0x2000L) != 0); 8473Debug.Assert((_currentBits & 0x4000L) != 0); 8478Debug.Assert((_currentBits & 0x8000L) != 0); 8483Debug.Assert((_currentBits & 0x10000L) != 0); 8488Debug.Assert((_currentBits & 0x20000L) != 0); 8493Debug.Assert((_currentBits & 0x40000L) != 0); 8498Debug.Assert((_currentBits & 0x80000L) != 0); 8503Debug.Assert((_currentBits & 0x100000L) != 0); 8508Debug.Assert((_currentBits & 0x200000L) != 0); 8513Debug.Assert((_currentBits & 0x400000L) != 0); 8518Debug.Assert((_currentBits & 0x800000L) != 0); 8523Debug.Assert((_currentBits & 0x1000000L) != 0); 8528Debug.Assert((_currentBits & 0x2000000L) != 0); 8533Debug.Assert((_currentBits & 0x4000000L) != 0); 8538Debug.Assert((_currentBits & 0x8000000L) != 0); 8543Debug.Assert((_currentBits & 0x10000000L) != 0); 8548Debug.Assert((_currentBits & 0x20000000L) != 0); 8553Debug.Assert((_currentBits & 0x40000000L) != 0); 8558Debug.Assert((_currentBits & 0x80000000L) != 0); 8563Debug.Assert((_currentBits & 0x100000000L) != 0); 8568Debug.Assert((_currentBits & 0x200000000L) != 0); 8573Debug.Assert((_currentBits & 0x400000000L) != 0); 8578Debug.Assert((_currentBits & 0x800000000L) != 0); 8583Debug.Assert((_currentBits & 0x1000000000L) != 0); 8588Debug.Assert((_currentBits & 0x2000000000L) != 0); 8593Debug.Assert((_currentBits & 0x4000000000L) != 0); 8598Debug.Assert((_currentBits & 0x8000000000L) != 0); 8603Debug.Assert((_currentBits & 0x10000000000L) != 0); 8608Debug.Assert((_currentBits & 0x20000000000L) != 0); 8613Debug.Assert((_currentBits & 0x40000000000L) != 0); 8618Debug.Assert((_currentBits & 0x80000000000L) != 0); 8623Debug.Assert((_currentBits & 0x100000000000L) != 0); 8628Debug.Assert((_currentBits & 0x200000000000L) != 0); 8633Debug.Assert((_currentBits & 0x400000000000L) != 0); 8638Debug.Assert((_currentBits & 0x800000000000L) != 0); 8643Debug.Assert((_currentBits & 0x1000000000000L) != 0); 8648Debug.Assert(_currentBits == 0); 14835Debug.Assert((tempBits & 0x1L) != 0); 14854Debug.Assert((tempBits & 0x2L) != 0); 14861Debug.Assert((tempBits & 0x4L) != 0); 14880Debug.Assert((tempBits & 0x8L) != 0); 14899Debug.Assert((tempBits & 0x10L) != 0); 14906Debug.Assert((tempBits & 0x20L) != 0); 14913Debug.Assert((tempBits & 0x40L) != 0); 14920Debug.Assert((tempBits & 0x80L) != 0); 14927Debug.Assert((tempBits & 0x100L) != 0); 14934Debug.Assert((tempBits & 0x200L) != 0); 14941Debug.Assert((tempBits & 0x400L) != 0); 14948Debug.Assert((tempBits & 0x800L) != 0); 14955Debug.Assert((tempBits & 0x1000L) != 0); 14962Debug.Assert((tempBits & 0x2000L) != 0); 14981Debug.Assert((tempBits & 0x4000L) != 0); 14988Debug.Assert((tempBits & 0x8000L) != 0); 14995Debug.Assert((tempBits & 0x10000L) != 0); 15002Debug.Assert((tempBits & 0x20000L) != 0); 15009Debug.Assert((tempBits & 0x40000L) != 0); 15016Debug.Assert((tempBits & 0x80000L) != 0); 15023Debug.Assert((tempBits & 0x100000L) != 0); 15030Debug.Assert((tempBits & 0x200000L) != 0); 15037Debug.Assert((tempBits & 0x400000L) != 0); 15044Debug.Assert((tempBits & 0x800000L) != 0); 15051Debug.Assert((tempBits & 0x1000000L) != 0); 15058Debug.Assert((tempBits & 0x2000000L) != 0); 15065Debug.Assert((tempBits & 0x4000000L) != 0); 15072Debug.Assert((tempBits & 0x8000000L) != 0); 15079Debug.Assert((tempBits & 0x10000000L) != 0); 15086Debug.Assert((tempBits & 0x20000000L) != 0); 15093Debug.Assert((tempBits & 0x40000000L) != 0); 15100Debug.Assert((tempBits & 0x80000000L) != 0); 15107Debug.Assert((tempBits & 0x100000000L) != 0); 15126Debug.Assert((tempBits & 0x200000000L) != 0); 15133Debug.Assert((tempBits & 0x400000000L) != 0); 15140Debug.Assert((tempBits & 0x800000000L) != 0); 15147Debug.Assert((tempBits & 0x1000000000L) != 0); 15154Debug.Assert((tempBits & 0x2000000000L) != 0); 15172Debug.Assert(valueCount > 0); 15253Debug.Assert((_currentBits & 0x1L) != 0); 15259Debug.Assert((_currentBits & 0x2L) != 0); 15265Debug.Assert((_currentBits & 0x4L) != 0); 15271Debug.Assert((_currentBits & 0x8L) != 0); 15277Debug.Assert((_currentBits & 0x10L) != 0); 15283Debug.Assert((_currentBits & 0x20L) != 0); 15289Debug.Assert((_currentBits & 0x40L) != 0); 15295Debug.Assert((_currentBits & 0x80L) != 0); 15301Debug.Assert((_currentBits & 0x100L) != 0); 15307Debug.Assert((_currentBits & 0x200L) != 0); 15313Debug.Assert((_currentBits & 0x400L) != 0); 15319Debug.Assert((_currentBits & 0x800L) != 0); 15325Debug.Assert((_currentBits & 0x1000L) != 0); 15331Debug.Assert((_currentBits & 0x2000L) != 0); 15337Debug.Assert((_currentBits & 0x4000L) != 0); 15343Debug.Assert((_currentBits & 0x8000L) != 0); 15349Debug.Assert((_currentBits & 0x10000L) != 0); 15355Debug.Assert((_currentBits & 0x20000L) != 0); 15361Debug.Assert((_currentBits & 0x40000L) != 0); 15367Debug.Assert((_currentBits & 0x80000L) != 0); 15373Debug.Assert((_currentBits & 0x100000L) != 0); 15379Debug.Assert((_currentBits & 0x200000L) != 0); 15385Debug.Assert((_currentBits & 0x400000L) != 0); 15391Debug.Assert((_currentBits & 0x800000L) != 0); 15397Debug.Assert((_currentBits & 0x1000000L) != 0); 15403Debug.Assert((_currentBits & 0x2000000L) != 0); 15409Debug.Assert((_currentBits & 0x4000000L) != 0); 15415Debug.Assert((_currentBits & 0x8000000L) != 0); 15421Debug.Assert((_currentBits & 0x10000000L) != 0); 15427Debug.Assert((_currentBits & 0x20000000L) != 0); 15433Debug.Assert((_currentBits & 0x40000000L) != 0); 15439Debug.Assert((_currentBits & 0x80000000L) != 0); 15445Debug.Assert((_currentBits & 0x100000000L) != 0); 15451Debug.Assert((_currentBits & 0x200000000L) != 0); 15457Debug.Assert((_currentBits & 0x400000000L) != 0); 15463Debug.Assert((_currentBits & 0x800000000L) != 0); 15469Debug.Assert((_currentBits & 0x1000000000L) != 0); 15475Debug.Assert((_currentBits & 0x2000000000L) != 0); 15481Debug.Assert(_currentBits == 0); 17589Debug.Assert((_currentBits & 0x1L) != 0); 17595Debug.Assert((_currentBits & 0x2L) != 0); 17601Debug.Assert((_currentBits & 0x4L) != 0);
Internal\Http\HttpParser.cs (3)
73Debug.Assert(foundDelimiter); 80Debug.Assert(readResult); 345Debug.Assert(result);
Internal\Http\HttpProtocol.cs (7)
731Debug.Assert(_bodyControl != null); 1023Debug.Assert(_requestRejectedException != null); 1356Debug.Assert(!HasResponseStarted, $"{nameof(SetErrorResponseHeaders)} called after response had already started."); 1623Debug.Assert(false, "Should not reach here, all cases in above switch statement should return"); 1629Debug.Assert(!HasResponseStarted); 1673Debug.Assert(false, "Should not reach here, all cases in above switch statement should return"); 1720Debug.Assert(false, "Should not reach here, all cases in above switch statement should return");
Internal\Http\ReasonPhrases.cs (1)
84Debug.Assert(!string.IsNullOrEmpty(reasonPhrase));
Internal\Http2\FlowControl\FlowControl.cs (2)
19Debug.Assert(initialWindowSize <= Http2PeerSettings.MaxWindowSize, $"{nameof(initialWindowSize)} too large."); 30Debug.Assert(!IsAborted, $"({nameof(Advance)} called after abort.");
Internal\Http2\FlowControl\InputFlowControl.cs (2)
32Debug.Assert(initialWindowSize >= minWindowSizeIncrement, "minWindowSizeIncrement is greater than the window size."); 86Debug.Assert(false, $"{nameof(TryUpdateWindow)} attempted to grow window past max size.");
Internal\Http2\FlowControl\StreamInputFlowControl.cs (2)
52Debug.Assert(connectionSuccess, "Connection-level input flow control should never be aborted."); 101Debug.Assert(connectionSuccess, "Connection-level input flow control should never be aborted.");
Internal\Http2\Http2Connection.cs (15)
237Debug.Assert(_isClosed == 1, "Should only be set when connection is closed."); 269Debug.Assert(Limits.MinRequestBodyDataRate != null); 425Debug.Assert(_currentHeadersStream != null); 663Debug.Assert(buffer.Length >= ClientPreface.Length, "Not enough content to match preface."); 777Debug.Assert(_currentHeadersStream != null, "Only throw this error if parsing headers."); 857Debug.Assert(TimeoutControl.TimerReason == TimeoutReason.KeepAlive, "Non keep-alive timeout set at start of stream."); 1198Debug.Assert(TimeoutControl.TimerReason == TimeoutReason.RequestHeaders, "Received continuation frame without request header timeout being set."); 1221Debug.Assert(_currentHeadersStream != null); 1248Debug.Assert(_currentHeadersStream != null); 1263Debug.Assert(_currentHeadersStream != null); 1530Debug.Assert(TimeoutControl.TimerReason == TimeoutReason.RequestHeaders || 1548Debug.Assert(index <= H2StaticTable.Count); 1556Debug.Assert(index <= H2StaticTable.Count); 1574Debug.Assert(_currentHeadersStream != null); 1756Debug.Assert(staticTableIndex > 0, "Static table starts at 1.");
Internal\Http2\Http2FrameWriter.cs (9)
254Debug.Assert(actual <= int.MaxValue); 280Debug.Assert(flushHeaders, "The app completed successfully without flushing headers!"); 551Debug.Assert(writeResult != HeaderWriteResult.BufferTooSmall, "This always writes the status as the first header, and it should never be an over the buffer size."); 634Debug.Assert(payloadLength <= _maxFrameSize, "The initial payload lengths is written to _headerEncodingBuffer with size of _maxFrameSize"); 658Debug.Assert(payloadLength == 0, "Payload written even though buffer is too small"); 717Debug.Assert(dataLength == data.Length); 744Debug.Assert(dataLength == data.Length); 748Debug.Assert(dataLength > dataPayloadLength); 967Debug.Assert(payload.Length == _outgoingFrame.PayloadLength); // 8
Internal\Http2\Http2OutputProducer.cs (2)
186Debug.Assert(_completedResponse); 313Debug.Assert(_unconsumedBytes > 0);
Internal\Http2\Http2Stream.cs (3)
164Debug.Assert(_decrementCalled); 446Debug.Assert(32 < ch && ch < 127); 513Debug.Assert(flushTask.IsCompletedSuccessfully);
Internal\Http3\Http3Connection.cs (8)
384Debug.Assert(streamDirectionFeature != null); 385Debug.Assert(streamIdFeature != null); 599Debug.Assert(persistentStateFeature != null, $"Required {nameof(IPersistentStateFeature)} not on stream context."); 625Debug.Assert(_context.ServiceContext.ServerOptions.EnableWebTransportAndH3Datagrams); 891Debug.Assert(!stream.IsReceivingHeader); 902Debug.Assert(Limits.MinRequestBodyDataRate != null); 918Debug.Assert(_context.ServiceContext.ServerOptions.EnableWebTransportAndH3Datagrams); 923Debug.Assert(!_webtransportSessions.ContainsKey(http3Stream.StreamId));
Internal\Http3\Http3ControlStream.cs (3)
274Debug.Assert(incomingFrame.RemainingLength >= framePayload.Length); 287Debug.Assert(framePayload.Slice(0, consumed).Length == framePayload.Length); 297Debug.Assert(incomingFrame.RemainingLength > 0);
Internal\Http3\Http3FrameWriter.cs (3)
179Debug.Assert(dataLength == data.Length); 202Debug.Assert(dataLength == data.Length); 206Debug.Assert(dataLength > dataPayloadLength);
Internal\Http3\Http3OutputProducer.cs (1)
60Debug.Assert(_dataWriteProcessingTask.IsCompleted);
Internal\Http3\Http3Stream.cs (4)
205Debug.Assert(index <= H3StaticTable.Count); 213Debug.Assert(index <= H3StaticTable.Count); 458Debug.Assert(staticTableIndex >= 0, "Static table starts at 0."); 1187Debug.Assert(32 < ch && ch < 127);
Internal\Http3\QPackHeaderWriter.cs (1)
15Debug.Assert(hasValue == true);
Internal\HttpConnection.cs (6)
105Debug.Assert(connectionHeartbeatFeature != null, nameof(IConnectionHeartbeatFeature) + " is missing!"); 106Debug.Assert(connectionLifetimeNotificationFeature != null, nameof(IConnectionLifetimeNotificationFeature) + " is missing!"); 159Debug.Assert(previousState != ProtocolSelectionState.Initializing, "The state should never be initializing"); 178Debug.Assert(previousState != ProtocolSelectionState.Initializing, "The state should never be initializing"); 198Debug.Assert(previousState != ProtocolSelectionState.Initializing, "The state should never be initializing"); 298Debug.Assert(false, "Invalid TimeoutReason");
Internal\Infrastructure\HttpUtilities.cs (8)
54Debug.Assert(str.Length == 8, "String must be exactly 8 (ASCII) characters long."); 59Debug.Assert(operationStatus == OperationStatus.Done); 66Debug.Assert(str.Length == 4, "String must be exactly 4 (ASCII) characters long."); 71Debug.Assert(operationStatus == OperationStatus.Done); 78Debug.Assert(bytes.Length == 8, "Mask must be exactly 8 bytes long."); 101Debug.Assert(written == destination.Length); 281Debug.Assert(WordListForPerfectHashOfMethods.Length == (MaxHashValue + 1) && methodsLookup.Length == (MaxHashValue + 1)); 330Debug.Assert(char.IsAscii(c), "Must already be validated");
Internal\Infrastructure\KestrelMetrics.cs (3)
422Debug.Assert(reason != ConnectionEndReason.Unset); 435Debug.Assert(reason != ConnectionEndReason.Unset); 446Debug.Assert(TryGetErrorType(reason, out _), "Overwrite should only be set for an error reason.");
Internal\Infrastructure\PipeWriterHelpers\ConcurrentPipeWriter.cs (5)
62Debug.Assert(_currentFlushTcs == null, "There should not be a pending flush."); 163Debug.Assert(_currentFlushTcs != null); 249Debug.Assert(_tail != null); 305Debug.Assert(_currentFlushTcs != null); 338Debug.Assert(_tail != null);
Internal\Infrastructure\ResourceCounter.cs (1)
64Debug.Assert(_count >= 0, "Resource count is negative. More resources were released than were locked.");
Internal\Infrastructure\StatusCheckPipeWriter.cs (1)
33Debug.Assert(_context != null);
Internal\Infrastructure\StatusCheckWriteStream.cs (1)
27Debug.Assert(_context != null);
Internal\Infrastructure\StreamCloseAwaitable.cs (1)
22Debug.Assert(ReferenceEquals(_callback, _callbackCompleted));
Internal\Infrastructure\TimeoutControl.cs (4)
116Debug.Assert(_minReadRate != null); 169Debug.Assert(_timeoutTimestamp == long.MaxValue, "Concurrent timeouts are not supported."); 205Debug.Assert(_concurrentIncompleteRequestBodies == 0 || minRate == _minReadRate, "Multiple simultaneous read data rates are not supported."); 260Debug.Assert(count >= 0, "BytesRead count must not be negative.");
Internal\KestrelServerImpl.cs (1)
345Debug.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.");
Internal\WebTransport\WebTransportSession.cs (1)
136Debug.Assert(success);
KestrelConfigurationLoader.cs (5)
50Debug.Assert(reloadOnChange || (certificatePathWatcher is null), "If reloadOnChange is false, then certificatePathWatcher should be null"); 290Debug.Assert(!!_loaded || _reloadToken is null, "Shouldn't have a reload token before first load"); 291Debug.Assert(!!ReloadOnChange || _reloadToken is null, "Shouldn't have a reload token unless reload-on-change is set"); 320Debug.Assert(ReloadOnChange); 399Debug.Assert(o.EndpointConfig?.Certificate?.FileHasChanged != true, "Preserving an endpoint with file changes");
KestrelServerOptions.cs (3)
295Debug.Assert(ApplicationServices.GetRequiredService<IHttpsConfigurationService>().IsInitialized, "HTTPS configuration should have been enabled"); 316Debug.Assert(DevelopmentCertificate is null); 401Debug.Assert(status.FailureMessage != null, "Status with a failure result must have a message.");
Middleware\HttpsConnectionMiddleware.cs (4)
97Debug.Assert(_serverCertificate != null); 266Debug.Assert(!certificate.HasPrivateKey, "This should only be called with certificates that don't have a private key"); 331Debug.Assert(_options != null, "Middleware must be created with options."); 427Debug.Assert(_options != null, "Middleware must be created with options.");
Middleware\TlsListener.cs (1)
60Debug.Assert(parseState is ClientHelloParseState.ValidTlsClientHello or ClientHelloParseState.NotTlsClientHello);
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
205Debug.Assert(_memoryHandle.HasValue);
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\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
src\Shared\Buffers\BufferSegment.cs (4)
27Debug.Assert(value <= AvailableMemory.Length); 64Debug.Assert(_memoryOwner != null); 102Debug.Assert(segment != null); 103Debug.Assert(Next == null);
src\Shared\CertificateGeneration\CertificateManager.cs (1)
655Debug.Assert(pemEnvelope != null);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
90Debug.Assert(oldTrustLevel == TrustLevel.Full); // Mac trust is all or nothing
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
334Debug.Assert(IsCommandAvailable(OpenSslCommand), "How did we trust without the openssl command?");
src\Shared\Hpack\DynamicHPackEncoder.cs (5)
71Debug.Assert(!_pendingTableSizeUpdate, "Dynamic table size update should be encoded before headers."); 153Debug.Assert(headerSize <= _maxHeaderTableSize, "Header is bigger than dynamic table size."); 158Debug.Assert(removed != null); 212Debug.Assert(headerSize <= _maxHeaderTableSize, "Header is bigger than dynamic table size."); 213Debug.Assert(headerSize <= _maxHeaderTableSize - _headerTableSize, "Not enough room in dynamic table.");
src\Shared\Hpack\EncoderHeaderEntry.cs (2)
32Debug.Assert(name != null); 33Debug.Assert(value != null);
src\Shared\PathNormalizer\PathNormalizer.cs (2)
17Debug.Assert(src[0] == '/', "Path segment must always start with a '/'"); 98Debug.Assert(src[0] == '/');
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (2)
76Debug.Assert(_count + 1 <= maxCapacity); 80Debug.Assert(newBufferSize > _count);
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
249Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 261Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 315Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
95Debug.Assert(indexLength >= 1); 127Debug.Assert(indexLength >= 1); 159Debug.Assert(indexLength >= 1); 197Debug.Assert(indexLength >= 1); 369Debug.Assert(Ascii.IsValid(value)); 376Debug.Assert(integerLength >= 1); 382Debug.Assert(status == OperationStatus.Done); 383Debug.Assert(valueBytesWritten == value.Length); 397Debug.Assert(destination.Length >= value.Length); 406Debug.Assert(status == OperationStatus.Done); 407Debug.Assert(bytesWritten == value.Length); 426Debug.Assert(integerLength >= 1); 470Debug.Assert(integerLength >= 1); 481Debug.Assert(written == encodedStringLength); 528Debug.Assert(separator != null); 529Debug.Assert(Ascii.IsValid(separator)); 551Debug.Assert(integerLength >= 1);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (2)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8); 40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
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 (9)
69Debug.Assert((firstByte & LengthMask) == InitialEightByteLengthMask); 73Debug.Assert(value >= 0 && value <= EightByteLimit, "Serialized values are within [0, 2^62)."); 118Debug.Assert(result); 119Debug.Assert(bytesRead == length); 149Debug.Assert(longToEncode >= 0); 150Debug.Assert(longToEncode <= EightByteLimit); 193Debug.Assert(res); 199Debug.Assert(value >= 0); 200Debug.Assert(value <= EightByteLimit);
src\Shared\runtime\Http3\QPack\HeaderField.cs (1)
17Debug.Assert(name.Length > 0);
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\runtime\Http3\QPack\QPackEncoder.cs (14)
42Debug.Assert(res); 97Debug.Assert(res); 106Debug.Assert(res); 167Debug.Assert(res); 177Debug.Assert(res); 204Debug.Assert(written == encodedStringLength); 235Debug.Assert(separator != null); 236Debug.Assert(Ascii.IsValid(separator)); 303Debug.Assert(buffer.Length >= s.Length); 312Debug.Assert(status == OperationStatus.Done); 313Debug.Assert(bytesWritten == s.Length); 318Debug.Assert(Ascii.IsValid(s)); 331Debug.Assert(status == OperationStatus.Done); 332Debug.Assert(valueBytesWritten == s.Length);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
235Debug.Assert(totalBytesUsed == encodedLength);
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)
229Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (7)
src\Servers\Kestrel\shared\KnownHeaders.cs (4)
773Debug.Assert(requestHeaders.Length <= 64); 774Debug.Assert(requestHeaders.Max(x => x.Index) <= 62); 778Debug.Assert(responseHeaders.Length <= 63); 779Debug.Assert(responseHeaders.Count(x => x.Index == 63) == 1);
src\Servers\Kestrel\shared\test\RevocationResponder.cs (1)
314System.Diagnostics.Debug.Assert(read == requestBytes.Length);
src\Shared\test\Shared.Tests\runtime\Http2\DynamicTableTest.cs (2)
167Debug.Assert((insertSize % 64) == 0, $"{nameof(insertSize)} must be a multiple of 64 ({nameof(HeaderField)}.{nameof(HeaderField.RfcOverhead)} * 2)"); 175Debug.Assert(data.Length == 16);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (6)
Http2\Http2ConnectionBenchmarkBase.cs (3)
106Debug.Assert(_receiveHttpFrame.Type == Http2FrameType.SETTINGS); 108Debug.Assert(_receiveHttpFrame.Type == Http2FrameType.WINDOW_UPDATE); 110Debug.Assert(_receiveHttpFrame.Type == Http2FrameType.SETTINGS);
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (2)
123Debug.Assert(streamId == 0 || streamId == -1, "StreamId sent that was non-zero, which isn't handled by tests"); 298Debug.Assert(success);
src\Servers\Kestrel\shared\TransportConnection.cs (1)
72Debug.Assert(Application != null);
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (10)
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\Servers\Kestrel\shared\TransportConnection.cs (1)
72Debug.Assert(Application != null);
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
205Debug.Assert(_memoryHandle.HasValue);
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\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (24)
Internal\QuicConnectionContext.cs (1)
178Debug.Assert(cancellationToken.IsCancellationRequested, "Error requires cancellation is requested.");
Internal\QuicConnectionListener.cs (2)
169Debug.Assert(connectionContext != null); 170Debug.Assert(connectionContext.GetInnerConnection() == quicConnection);
Internal\QuicStreamContext.cs (8)
81Debug.Assert(_stream == null); 143Debug.Assert(_processingTask.IsCompletedSuccessfully); 150Debug.Assert(_stream != null); 184Debug.Assert(_stream != null); 204Debug.Assert(_stream != null); 352Debug.Assert(_streamClosedTokenSource != null); 367Debug.Assert(_stream != null); 522Debug.Assert(_stream != null);
src\Servers\Kestrel\shared\TransportConnection.cs (1)
72Debug.Assert(Application != null);
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
205Debug.Assert(_memoryHandle.HasValue);
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\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (8)
Internal\SocketConnection.cs (3)
45Debug.Assert(socket != null); 46Debug.Assert(memoryPool != null); 47Debug.Assert(logger != null);
Internal\SocketSender.cs (2)
78Debug.Assert(!buffer.IsEmpty); 79Debug.Assert(!buffer.IsSingleSegment);
SocketConnectionListener.cs (2)
51Debug.Assert(listenSocket.LocalEndPoint != null); 65Debug.Assert(_listenSocket != null, "Bind must be called first.");
src\Servers\Kestrel\shared\TransportConnection.cs (1)
72Debug.Assert(Application != null);
Microsoft.AspNetCore.Shared.Tests (117)
runtime\Http2\DynamicTableTest.cs (2)
167Debug.Assert((insertSize % 64) == 0, $"{nameof(insertSize)} must be a multiple of 64 ({nameof(HeaderField)}.{nameof(HeaderField.RfcOverhead)} * 2)"); 175Debug.Assert(data.Length == 16);
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (8)
229Debug.Assert(_arrayStorage == null); 515Debug.Assert(_arrayStorage != null); 545Debug.Assert(_arrayStorage is not null); 546Debug.Assert(_count <= _arrayStorage.Length); 556Debug.Assert(_dictionaryStorage == null); 557Debug.Assert(_arrayStorage != null); 576Debug.Assert(_dictionaryStorage == null); 577Debug.Assert(_arrayStorage != null);
src\Shared\Hpack\DynamicHPackEncoder.cs (5)
71Debug.Assert(!_pendingTableSizeUpdate, "Dynamic table size update should be encoded before headers."); 153Debug.Assert(headerSize <= _maxHeaderTableSize, "Header is bigger than dynamic table size."); 158Debug.Assert(removed != null); 212Debug.Assert(headerSize <= _maxHeaderTableSize, "Header is bigger than dynamic table size."); 213Debug.Assert(headerSize <= _maxHeaderTableSize - _headerTableSize, "Not enough room in dynamic table.");
src\Shared\Hpack\EncoderHeaderEntry.cs (2)
32Debug.Assert(name != null); 33Debug.Assert(value != null);
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (6)
122Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 131Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 171Debug.Assert(_backingBuffer != null); 185Debug.Assert(_nativeRequest != null, "RequestContextBase::ReleasePins()|ReleasePins() called twice."); 224Debug.Assert(_nativeRequest == null, "RequestContextBase::Dispose()|Dispose() called before ReleasePins()."); 235Debug.Assert((int)HTTP_VERB.HttpVerbMaximum == HttpVerbs.Length);
src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (1)
23Debug.Assert(rawUrlBytes.Length != 0, "Length of the URL cannot be zero.");
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (3)
66Debug.Assert(isTrimAotCompatible, "isTrimAotCompatible should always be true."); 149Debug.Assert(_executor != null, "Sync execution is not supported."); 178Debug.Assert(_executorAsync != null, "Async execution is not supported.");
src\Shared\PathNormalizer\PathNormalizer.cs (2)
17Debug.Assert(src[0] == '/', "Path segment must always start with a '/'"); 98Debug.Assert(src[0] == '/');
src\Shared\PropertyHelper\PropertyHelper.cs (18)
161Debug.Assert(propertyInfo != null); 181Debug.Assert(propertyInfo != null); 195Debug.Assert(propertyInfo != null); 198Debug.Assert(propertyGetterWrapperMethod != null); 199Debug.Assert(propertyGetterWrapperMethod.IsGenericMethodDefinition); 200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 203Debug.Assert(propertyGetterByRefWrapperMethod != null); 204Debug.Assert(propertyGetterByRefWrapperMethod.IsGenericMethodDefinition); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 208Debug.Assert(getMethod != null); 209Debug.Assert(!getMethod.IsStatic); 210Debug.Assert(getMethod.GetParameters().Length == 0); 274Debug.Assert(propertyInfo != null); 275Debug.Assert(!propertyInfo.DeclaringType!.IsValueType); 278Debug.Assert(setMethod != null); 279Debug.Assert(!setMethod.IsStatic); 280Debug.Assert(setMethod.ReturnType == typeof(void)); 282Debug.Assert(parameters.Length == 1);
src\Shared\QueryStringEnumerable.cs (1)
102Debug.Assert(success);
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (2)
76Debug.Assert(_count + 1 <= maxCapacity); 80Debug.Assert(newBufferSize > _count);
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
249Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 261Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 315Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
95Debug.Assert(indexLength >= 1); 127Debug.Assert(indexLength >= 1); 159Debug.Assert(indexLength >= 1); 197Debug.Assert(indexLength >= 1); 369Debug.Assert(Ascii.IsValid(value)); 376Debug.Assert(integerLength >= 1); 382Debug.Assert(status == OperationStatus.Done); 383Debug.Assert(valueBytesWritten == value.Length); 397Debug.Assert(destination.Length >= value.Length); 406Debug.Assert(status == OperationStatus.Done); 407Debug.Assert(bytesWritten == value.Length); 426Debug.Assert(integerLength >= 1); 470Debug.Assert(integerLength >= 1); 481Debug.Assert(written == encodedStringLength); 528Debug.Assert(separator != null); 529Debug.Assert(Ascii.IsValid(separator)); 551Debug.Assert(integerLength >= 1);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (2)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8); 40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
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 (9)
69Debug.Assert((firstByte & LengthMask) == InitialEightByteLengthMask); 73Debug.Assert(value >= 0 && value <= EightByteLimit, "Serialized values are within [0, 2^62)."); 118Debug.Assert(result); 119Debug.Assert(bytesRead == length); 149Debug.Assert(longToEncode >= 0); 150Debug.Assert(longToEncode <= EightByteLimit); 193Debug.Assert(res); 199Debug.Assert(value >= 0); 200Debug.Assert(value <= EightByteLimit);
src\Shared\runtime\Http3\QPack\HeaderField.cs (1)
17Debug.Assert(name.Length > 0);
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\runtime\Http3\QPack\QPackEncoder.cs (14)
42Debug.Assert(res); 97Debug.Assert(res); 106Debug.Assert(res); 167Debug.Assert(res); 177Debug.Assert(res); 204Debug.Assert(written == encodedStringLength); 235Debug.Assert(separator != null); 236Debug.Assert(Ascii.IsValid(separator)); 303Debug.Assert(buffer.Length >= s.Length); 312Debug.Assert(status == OperationStatus.Done); 313Debug.Assert(bytesWritten == s.Length); 318Debug.Assert(Ascii.IsValid(s)); 331Debug.Assert(status == OperationStatus.Done); 332Debug.Assert(valueBytesWritten == s.Length);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
235Debug.Assert(totalBytesUsed == encodedLength);
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)
229Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
198Debug.Assert(method != null); 199Debug.Assert(method.DeclaringType != null);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
src\Shared\WebEncoders\WebEncoders.cs (1)
155Debug.Assert(arraySizeRequired % 4 == 0, "Invariant: Array length must be a multiple of 4.");
Microsoft.AspNetCore.SignalR.Client.Core (7)
HubConnection.cs (3)
878Debug.Assert(genericTypes.Length == 1); 927Debug.Assert(methodInfo == _sendIAsyncStreamItemsMethod); 2303Debug.Assert(_messageBuffer is not null);
src\SignalR\common\Shared\MessageBuffer.cs (3)
327Debug.Assert(_currentIndex == -1); 333Debug.Assert(_startingSequenceId + _currentIndex + 1 == sequenceId); 375Debug.Assert(numElements > 0 && numElements < BufferLength + 1);
src\SignalR\common\Shared\ReflectionHelper.cs (1)
35Debug.Assert(nullableType.GetGenericArguments().Length == 1);
Microsoft.AspNetCore.SignalR.Client.Tests (3)
ServerSentEventsTransportTests.cs (1)
513Debug.Assert(buffer.Length > _contents[_index].Length);
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
Microsoft.AspNetCore.SignalR.Common (5)
Protocol\HandshakeProtocol.cs (2)
69Debug.Assert(writer.CurrentDepth == 0); 100Debug.Assert(writer.CurrentDepth == 0);
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
126Debug.Assert(charsUsed == 1);
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 (25)
HubConnectionContext.cs (1)
302Debug.Assert(_messageBuffer is not null);
Internal\ChannelBasedSemaphore.cs (1)
74Debug.Assert(false);
Internal\DefaultHubActivator.cs (2)
24Debug.Assert(!_created.HasValue, "hub activators must not be reused."); 41Debug.Assert(_created.HasValue, "hubs must be released with the hub activator they were created");
Internal\DefaultHubDispatcher.cs (2)
371Debug.Assert(hub.Clients is HubCallerClients); 683Debug.Assert(authorizePolicy != null);
Internal\HubMethodDescriptor.cs (1)
266Debug.Assert(adapterMethodInfo == MakeAsyncEnumeratorFromChannelMethod);
SerializedHubMessage.cs (1)
45Debug.Assert(message.GetType().IsAssignableTo(typeof(HubInvocationMessage)));
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (3)
66Debug.Assert(isTrimAotCompatible, "isTrimAotCompatible should always be true."); 149Debug.Assert(_executor != null, "Sync execution is not supported."); 178Debug.Assert(_executorAsync != null, "Async execution is not supported.");
src\SignalR\common\Shared\ClientResultsManager.cs (9)
34Debug.Assert(result); 44Debug.Assert(result); 169public static new void SetCanceled(CancellationToken cancellationToken) => Debug.Assert(false); 170public static new void SetException(IEnumerable<Exception> exceptions) => Debug.Assert(false); 173Debug.Assert(false); 178Debug.Assert(false); 183Debug.Assert(false); 188Debug.Assert(false); 193Debug.Assert(false);
src\SignalR\common\Shared\MessageBuffer.cs (3)
327Debug.Assert(_currentIndex == -1); 333Debug.Assert(_startingSequenceId + _currentIndex + 1 == sequenceId); 375Debug.Assert(numElements > 0 && numElements < BufferLength + 1);
src\SignalR\common\Shared\ReflectionHelper.cs (1)
35Debug.Assert(nullableType.GetGenericArguments().Length == 1);
StreamTracker.cs (1)
35Debug.Assert(RuntimeFeature.IsDynamicCodeSupported || !itemType.IsValueType, "HubMethodDescriptor ensures itemType is not a ValueType when PublishAot=true.");
Microsoft.AspNetCore.SignalR.Protocols.Json (4)
Protocol\JsonHubProtocol.cs (3)
571Debug.Assert(writer.CurrentDepth == 0); 791Debug.Assert(arguments != null); 809Debug.Assert(arguments != null);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
126Debug.Assert(charsUsed == 1);
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (3)
Protocol\MessagePackHubProtocolWorker.cs (1)
376Debug.Assert(written == prefixLength);
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (5)
Protocol\NewtonsoftJsonHubProtocol.cs (2)
783Debug.Assert(arguments != null); 800Debug.Assert(arguments != null);
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
126Debug.Assert(charsUsed == 1);
Microsoft.AspNetCore.SignalR.Specification.Tests (2)
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
Microsoft.AspNetCore.SignalR.StackExchangeRedis (16)
Internal\RedisProtocol.cs (1)
244Debug.Assert(isArray);
RedisHubLifetimeManager.cs (4)
821Debug.Assert(success); 825Debug.Assert(success); 826Debug.Assert(written == 24); 828Debug.Assert(base64.EndsWith("=="));
src\SignalR\common\Shared\ClientResultsManager.cs (9)
34Debug.Assert(result); 44Debug.Assert(result); 169public static new void SetCanceled(CancellationToken cancellationToken) => Debug.Assert(false); 170public static new void SetException(IEnumerable<Exception> exceptions) => Debug.Assert(false); 173Debug.Assert(false); 178Debug.Assert(false); 183Debug.Assert(false); 188Debug.Assert(false); 193Debug.Assert(false);
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
Microsoft.AspNetCore.SignalR.Tests (1)
TestFilters.cs (1)
48Debug.Assert(syncPoints.Length == 3);
Microsoft.AspNetCore.SpaServices.Extensions (1)
Npm\NodeScriptRunner.cs (1)
109Debug.Assert(chunk.Array != null);
Microsoft.AspNetCore.StaticAssets (5)
src\Shared\RangeHelper\RangeHelper.cs (1)
67Debug.Assert(rangeHeader.Ranges.Count == 1);
StaticAssetEndpointDataSource.cs (4)
77Debug.Assert(_changeToken != null); 78Debug.Assert(_endpoints != null); 125Debug.Assert(_changeToken != null); 126Debug.Assert(_endpoints != null);
Microsoft.AspNetCore.StaticFiles (1)
src\Shared\RangeHelper\RangeHelper.cs (1)
67Debug.Assert(rangeHeader.Ranges.Count == 1);
Microsoft.AspNetCore.StaticFiles.FunctionalTests (1)
src\Shared\RangeHelper\RangeHelper.cs (1)
67Debug.Assert(rangeHeader.Ranges.Count == 1);
Microsoft.AspNetCore.TestHost (3)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.7.25327.102\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
294Debug.Assert(_hostTcs.Task.IsCompleted);
ResponseBodyReaderStream.cs (1)
116Debug.Assert(innerException != null);
WebSocketClient.cs (1)
104Debug.Assert(webSocketFeature != null);
Microsoft.AspNetCore.WebSockets (11)
HandshakeHelpers.cs (4)
175Debug.Assert(ret); 176Debug.Assert(written == len); 270Debug.Assert(ret); 271Debug.Assert(written == len);
src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
47Debug.Assert(_pos == _span.Length);
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (6)
37Debug.Assert(value >= 0); 38Debug.Assert(value <= _chars.Length); 48Debug.Assert(capacity >= 0); 86Debug.Assert(index < _pos); 289Debug.Assert(additionalCapacityBeyondPos > 0); 290Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.AspNetCore.WebUtilities (24)
FileBufferingReadStream.cs (2)
238Debug.Assert(_tempFileDirectoryAccessor != null); 240Debug.Assert(_tempFileDirectory != null);
FileBufferingWriteStream.cs (2)
124Debug.Assert(PagedByteBuffer.Length <= _memoryThreshold); 163Debug.Assert(PagedByteBuffer.Length <= _memoryThreshold);
FormPipeReader.cs (1)
269Debug.Assert(segmentConsumed == keyValuePair.FirstSpan.Length);
HttpRequestStreamReader.cs (3)
258Debug.Assert(charsRemaining == 0); 269Debug.Assert(charsRemaining == 0); 279Debug.Assert(charsRemaining > 0);
HttpResponseStreamWriter.cs (8)
215Debug.Assert(_charBufferCount == _charBufferSize); 251Debug.Assert(count > 0); 252Debug.Assert(_charBufferSize - _charBufferCount < count); 295Debug.Assert(count > 0); 296Debug.Assert(_charBufferSize - _charBufferCount < count); 344Debug.Assert(value.Length > 0); 345Debug.Assert(_charBufferSize - _charBufferCount < value.Length); 616Debug.Assert(_charBufferSize - _charBufferCount >= value.Length);
MultipartReaderStream.cs (6)
212Debug.Assert(matchCount == length); 229Debug.Assert(read == length); // It should have all been buffered 237Debug.Assert(stream.FinalBoundaryFound || remainder.IsEmpty, "Un-expected data found on the boundary line: " + remainder.ToString()); 298Debug.Assert(matchCount == length); 315Debug.Assert(read == length); // It should have all been buffered 323Debug.Assert(stream.FinalBoundaryFound || string.Equals(string.Empty, remainder, StringComparison.Ordinal), "Un-expected data found on the boundary line: " + remainder);
src\Shared\QueryStringEnumerable.cs (1)
102Debug.Assert(success);
src\Shared\WebEncoders\WebEncoders.cs (1)
155Debug.Assert(arraySizeRequired % 4 == 0, "Invariant: Array length must be a multiple of 4.");
Microsoft.AspNetCore.WebUtilities.Microbenchmarks (2)
HttpRequestStreamReaderReadLineBenchmark.cs (2)
33Debug.Assert(result.Length == Length - 2); 42Debug.Assert(result.Length == Length - 2);
Microsoft.Build (30)
BackEnd\BuildManager\BuildManager.cs (1)
1063Debug.Assert(allMismatchedProjectStartedEventsDueToLoggerErrors, "There was a mismatched project started event not caused by an exception result");
BackEnd\Client\MSBuildClient.cs (1)
518Debug.Assert(KnownTelemetry.PartialBuildTelemetry == null || KnownTelemetry.PartialBuildTelemetry.StartAt.HasValue, "BuildTelemetry.StartAt was not initialized!");
BackEnd\Components\RequestBuilder\ItemBucket.cs (1)
160Debug.Assert(_expander != null, "ItemBucket.Initialize was not properly called");
Collections\RetrievableEntryHashSet\HashHelpers.cs (1)
61Debug.Assert(min >= 0, "min less than zero; handle overflow checking before calling HashHelpers");
Collections\RetrievableEntryHashSet\RetrievableEntryHashSet.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)
1729Debug.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)
205Debug.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)
869Debug.Assert(FileUtilities.PathsEqual(searchToExclude.BaseDirectory, recursionState.BaseDirectory), "Expected exclude search base directory to match include search base directory"); 2538Debug.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)
277Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?"); 472Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?");
Utilities\EngineFileUtilities.cs (1)
592Debug.Assert(s_lazyWildCardExpansionRegexes is not null, $"If the user provided lazy wildcard regexes, {nameof(s_lazyWildCardExpansionRegexes)} should be populated");
Microsoft.Build.Engine.OM.UnitTests (7)
FileUtilities.cs (2)
742Debug.Assert(allowedExtensions?.Length > 0); 750Debug.Assert(!String.IsNullOrEmpty(extension) && extension[0] == '.');
WindowsFileSystem.cs (2)
138Debug.Assert(hr != WindowsNative.ErrorFileNotFound); 200Debug.Assert(hr != WindowsNative.ErrorSuccess);
WindowsNative.cs (3)
158Debug.Assert(Status == EnumerateDirectoryStatus.UnknownError); 168Debug.Assert(Status != EnumerateDirectoryStatus.UnknownError && 178Debug.Assert(Status != EnumerateDirectoryStatus.Success);
Microsoft.Build.Framework (21)
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 || Array.IndexOf(AllWaves, wave) >= 0, $"Change wave version {wave} is invalid");
HashHelpers.cs (1)
89Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
LoggerException.cs (1)
125Debug.Assert(state is not null, "state cannot be null");
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.CodeAnalysis (15)
src\Compilers\Core\CommandLine\BuildProtocol.cs (2)
71Debug.Assert(!string.IsNullOrWhiteSpace(CompilerHash), "A hash value is required to communicate with the server"); 83Debug.Assert(!string.IsNullOrWhiteSpace(compilerHash), "CompilerHash is required to send request to the build server");
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (1)
138Debug.Assert(false, e.Message);
src\Compilers\Core\MSBuildTask\CommandLineBuilderExtension.cs (1)
240Debug.Assert(treatAsFlags == null
src\Compilers\Core\MSBuildTask\Csc.cs (1)
799Debug.Assert(HostObject != null, "We should not be here if the host object has not been set.");
src\Compilers\Core\MSBuildTask\RCWForCurrentContext.cs (1)
52Debug.Assert(objInCurrentCtx != null, "Unable to marshal COM Object to the current context (apartment). This will hurt performance.");
src\Compilers\Core\MSBuildTask\Vbc.cs (2)
1102Debug.Assert(this.HostObject != null, "We should not be here if the host object has not been set."); 1108Debug.Assert(vbcHostObject5 != null, "Wrong kind of host object passed in!");
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (4)
19/// <inheritdoc cref="Debug.Assert(bool, string)"/> 22=> Debug.Assert(condition, message); 24/// <inheritdoc cref="Debug.Assert(bool, string)"/> 72Debug.Assert(false, message);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
133Debug.Assert(false, "Unreachable");
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
Microsoft.Build.Tasks.CodeAnalysis.Sdk (15)
src\Compilers\Core\CommandLine\BuildProtocol.cs (2)
71Debug.Assert(!string.IsNullOrWhiteSpace(CompilerHash), "A hash value is required to communicate with the server"); 83Debug.Assert(!string.IsNullOrWhiteSpace(compilerHash), "CompilerHash is required to send request to the build server");
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (1)
138Debug.Assert(false, e.Message);
src\Compilers\Core\MSBuildTask\CommandLineBuilderExtension.cs (1)
240Debug.Assert(treatAsFlags == null
src\Compilers\Core\MSBuildTask\Csc.cs (1)
799Debug.Assert(HostObject != null, "We should not be here if the host object has not been set.");
src\Compilers\Core\MSBuildTask\RCWForCurrentContext.cs (1)
52Debug.Assert(objInCurrentCtx != null, "Unable to marshal COM Object to the current context (apartment). This will hurt performance.");
src\Compilers\Core\MSBuildTask\Vbc.cs (2)
1102Debug.Assert(this.HostObject != null, "We should not be here if the host object has not been set."); 1108Debug.Assert(vbcHostObject5 != null, "Wrong kind of host object passed in!");
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (4)
19/// <inheritdoc cref="Debug.Assert(bool, string)"/> 22=> Debug.Assert(condition, message); 24/// <inheritdoc cref="Debug.Assert(bool, string)"/> 72Debug.Assert(false, message);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
133Debug.Assert(false, "Unreachable");
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
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)
1710Debug.Assert(false, "Should have handled this case."); 1755Debug.Assert(false, "Unexpected exception type."); 1893Debug.Assert(false, "Should have handled this case."); 2011Debug.Assert(false, "Should have handled this case."); 2050Debug.Assert(!reference.IsPrimary, "A primary reference should never lose a conflict because of version. This is an insoluble conflict instead."); 2081Debug.Assert(false, "Should have handled this case.");
AssignCulture.cs (1)
211Debug.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, $"Unable to find a package node in {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"); 1990Debug.Assert(s != null, $"EmbeddedResource '{name}' not found");
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)
869Debug.Assert(FileUtilities.PathsEqual(searchToExclude.BaseDirectory, recursionState.BaseDirectory), "Expected exclude search base directory to match include search base directory"); 2538Debug.Assert(excludeState.SearchData.RegexFileMatch != null || excludeState.SearchData.DirectoryPattern != null,
InterningBinaryReader.cs (1)
173Debug.Assert(false, e.ToString());
ManifestUtil\Manifest.cs (1)
527Debug.Assert(false, "AssemblyName cannot be empty");
ManifestUtil\TrustInfo.cs (1)
317Debug.Assert(document != null, "GetPermissionSetElement was passed a null document");
ManifestUtil\Util.cs (1)
204Debug.Assert(s != null, $"EmbeddedResource '{name}' not found");
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)
354Debug.Assert(!String.IsNullOrEmpty(itemCulture), $"Satellite item '{item.ItemSpec}' is missing expected attribute 'Culture'"); 870Debug.Assert(!_dictionary.ContainsKey(key), $"Two or more items with same key '{key}' detected"); 929Debug.Assert(!_dictionary.ContainsKey(key), $"Two or more items with same key '{key}' detected"); 970Debug.Assert(!_dictionary.ContainsKey(key), $"Two or more items with same '{(object)ItemMetadataNames.targetPath}' attribute detected");
SystemState.cs (1)
650Debug.Assert(false, "Using slow-path in SystemState.GetDirectories, was this intentional?");
Microsoft.Build.Tasks.UnitTests (1)
QuotingUtilities.cs (1)
90Debug.Assert(false, "Null character in parameter");
Microsoft.Build.Utilities.Core (6)
CommandLineBuilder.cs (1)
201Debug.Assert(!hasAllUnquotedCharacters || !hasSomeQuotedCharacters,
FileMatcher.cs (2)
869Debug.Assert(FileUtilities.PathsEqual(searchToExclude.BaseDirectory, recursionState.BaseDirectory), "Expected exclude search base directory to match include search base directory"); 2538Debug.Assert(excludeState.SearchData.RegexFileMatch != null || excludeState.SearchData.DirectoryPattern != null,
TaskLoggingHelper.cs (2)
277Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?"); 472Debug.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.CodeAnalysis (99)
CodeGen\BasicBlock.cs (3)
186Debug.Assert((ILOpCode)(byte)value == value, "rev opcodes must fit in a byte"); 363Debug.Assert(BranchCode != ILOpCode.Nop, "Nop branches should not have labels"); 462Debug.Assert(!builder._labelInfos.Values.Any(li => li.bb == toRemove),
CodeGen\ILBuilder.cs (4)
1246Debug.Assert(this.RealizedIL.IsDefault, "Too late to allocate a new IL marker"); 1271Debug.Assert(!RealizedIL.IsDefault, "Builder must be realized to perform this operation"); 1272Debug.Assert(_allocatedILMarkers != null, "There are not markers in this builder"); 1273Debug.Assert(ilMarker >= 0 && ilMarker < _allocatedILMarkers.Count, "Wrong builder?");
CodeGen\ILBuilderEmit.cs (9)
32Debug.Assert(!code.IsControlTransfer(), 127Debug.Assert(labelInfo.bb == null, "duplicate use of a label"); 139Debug.Assert(curStack == labelStack, "forward branches and fall-through must agree on stack depth"); 184Debug.Assert(labelInfo.stack == _emitState.CurStack, "branches to same label with different stacks"); 289Debug.Assert(ld.stack == curStack, "branches to same label with different stacks"); 362Debug.Assert(!arrayType.IsSZArray, "should be used only with multidimensional arrays"); 376Debug.Assert(!arrayType.IsSZArray, "should be used only with multidimensional arrays"); 390Debug.Assert(!arrayType.IsSZArray, "should be used only with multidimensional arrays"); 404Debug.Assert(!arrayType.IsSZArray, "should be used only with multidimensional arrays");
CodeGen\PrivateImplementationDetails.cs (1)
402Debug.Assert(symbol is not null, "The emit layer should check the helpers exist.");
CodeGen\SwitchIntegralJumpTableEmitter.SwitchBucket.cs (2)
95Debug.Assert(i < LabelsCount, "index out of range"); 140Debug.Assert(_startLabelIndex != _endLabelIndex, "1-sized buckets should be already known as degenerate.");
Collections\OrderPreservingMultiDictionary.cs (2)
280Debug.Assert(_value is V, "Item must be a a V"); 315Debug.Assert(_value is V, "_value must be a V");
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
1601Debug.Assert(CompilationEventQueue.IsCompleted, "TryDequeueAsync should provide a value unless the AsyncQueue<T> is completed.");
DiagnosticAnalyzer\AsyncQueue.cs (1)
197Debug.Assert(this.Count == 0, "we should not be cancelling the waiters when we have items in the queue");
InternalUtilities\Debug.cs (4)
19/// <inheritdoc cref="Debug.Assert(bool, string)"/> 22=> Debug.Assert(condition, message); 24/// <inheritdoc cref="Debug.Assert(bool, string)"/> 72Debug.Assert(false, message);
InternalUtilities\ReflectionUtilities.cs (1)
133Debug.Assert(false, "Unreachable");
InternalUtilities\WeakList.cs (1)
76Debug.Assert(_items.Length > 0 && _size < 3 * _items.Length / 4, "length: " + _items.Length + " size: " + _size);
MetadataReader\MetadataHelpers.cs (2)
501Debug.Assert(emittedTypeName != null, "NULL actual name unexpected!!!"); 563Debug.Assert(!resultMemory.Equals(emittedTypeNameMemory) || ReferenceEquals(resultString, emittedTypeName), "If the name was not mangled, we should get the original string instance back.");
MetadataReader\MetadataTypeName.cs (3)
96Debug.Assert(forcedArity == -1 || 128Debug.Assert(forcedArity == -1 || 156Debug.Assert(forcedArity == -1 ||
MetadataReader\PEModule.cs (1)
3895Debug.Assert(indices.FirstIndex >= 0, "Not allowed to store a negative (non-existent) index in typesToAssemblyIndexMap");
Operations\ControlFlowGraphBuilder.cs (2)
1403Debug.Assert(((Operation)originalOperation).OwningSemanticModel != null, "Not an original node."); 6594Debug.Assert(operation.Parent is InvocationOperation { Parent: CollectionExpressionOperation ce } && ce.HasErrors(_compilation),
Operations\Operation.cs (1)
52Debug.Assert(_parentDoNotAccessDirectly != s_unset, "Attempt to access parent node before construction is complete!");
PEWriter\MetadataWriter.cs (2)
2364Debug.Assert(offset % ManagedPEBuilder.MappedFieldDataAlignment == 0, "Expected last write to end at alignment boundary"); 2365Debug.Assert(ManagedPEBuilder.MappedFieldDataAlignment == 8, "Expected alignment to be 8");
PEWriter\NativeResourceWriter.cs (2)
196Debug.Assert(typeDirectory.NumberOfIdEntries == 0, "Not all Win32 resources with types encoded as strings precede those encoded as ints"); 214Debug.Assert(nameDirectory.NumberOfIdEntries == 0, "Not all Win32 resources with names encoded as strings precede those encoded as ints");
RuleSet\RuleSetProcessor.cs (2)
82Debug.Assert(nodeList.Count == 1, "Multiple top-level nodes!"); 166Debug.Assert(false, "Unknown child node in Rules node");
SourceGeneration\Nodes\NodeStateTable.cs (2)
762Debug.Assert(_currentState.HasValue, "Created a builder with no values?"); 763Debug.Assert(_items.Count >= 1, "Created a builder with no values?");
src\Dependencies\Collections\Internal\ArraySortHelper.cs (3)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\Dependencies\Collections\Internal\HashHelpers.cs (1)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\Dependencies\Collections\Segmented\SegmentedArray.cs (1)
491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (10)
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
277Debug.Assert(obj != null, "freeing null?"); 279Debug.Assert(_firstItem != obj, "freeing twice?"); 290Debug.Assert(value != obj, "freeing twice?");
Syntax\GreenNode.cs (4)
580Debug.Assert(found, "We must be able to find annotations since we had the bit set on ourselves"); 581Debug.Assert(annotations != null, "annotations should not be null"); 582Debug.Assert(annotations != s_noAnnotations, "annotations should not be s_noAnnotations"); 583Debug.Assert(annotations.Length != 0, "annotations should be non-empty");
Syntax\InternalSyntax\SeparatedSyntaxList.cs (2)
28Debug.Assert(!item.IsToken, "even elements of a separated list must be nodes"); 32Debug.Assert(item.IsToken, "odd elements of a separated list must be tokens");
Syntax\SeparatedSyntaxList.cs (3)
74Debug.Assert(item.IsNode, "Node missing in separated list."); 78Debug.Assert(item.IsToken, "Separator token missing in separated list."); 149Debug.Assert(node.IsList, "separated list cannot be a singleton separator");
Syntax\SyntaxNode.cs (3)
480Debug.Assert(!triviaContainsMatch(current.GetLeadingTriviaCore(), rawKind), "Should not have a match if the token doesn't even have leading trivia"); 483Debug.Assert(!triviaContainsMatch(current.GetTrailingTriviaCore(), rawKind), "Should never have a match in trailing trivia"); 765Debug.Assert(childNodeOrToken.FullSpan.Contains(position), "ChildThatContainsPosition's return value does not contain the requested position.");
Syntax\SyntaxNodeOrToken.cs (6)
47Debug.Assert(!node.Green.IsList, "node cannot be a list"); 55Debug.Assert(parent == null || !parent.Green.IsList, "parent cannot be a list"); 56Debug.Assert(token != null || (parent == null && position == 0 && index == 0), "parts must form a token"); 57Debug.Assert(token == null || token.IsToken, "token must be a token"); 58Debug.Assert(index >= 0, "index must not be negative"); 59Debug.Assert(parent == null || token != null, "null token cannot have parent");
Syntax\SyntaxToken.cs (3)
31Debug.Assert(parent == null || !parent.Green.IsList, "list cannot be a parent"); 32Debug.Assert(token == null || token.IsToken, "token must be a token"); 42Debug.Assert(token == null || token.IsToken, "token must be a token");
Syntax\SyntaxTreeExtensions.cs (1)
85Debug.Assert(false, message);
Microsoft.CodeAnalysis.Analyzers (61)
MetaAnalyzers\CompilerExtensionStrictApiAnalyzer.cs (1)
173Debug.Assert(attribute.ApplicationSyntaxReference is not null,
MetaAnalyzers\CompilerExtensionTargetFrameworkAnalyzer.cs (1)
122Debug.Assert(attribute.ApplicationSyntaxReference is not null,
src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (2)
280Debug.Assert(_value is V, "Item must be a a V"); 315Debug.Assert(_value is V, "_value must be a V");
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (4)
19/// <inheritdoc cref="Debug.Assert(bool, string)"/> 22=> Debug.Assert(condition, message); 24/// <inheritdoc cref="Debug.Assert(bool, string)"/> 72Debug.Assert(false, message);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
133Debug.Assert(false, "Unreachable");
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
85Debug.Assert(false, message);
src\Dependencies\Collections\Internal\ArraySortHelper.cs (3)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\Dependencies\Collections\Internal\HashHelpers.cs (1)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\Dependencies\Collections\Segmented\SegmentedArray.cs (1)
491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (10)
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
277Debug.Assert(obj != null, "freeing null?"); 279Debug.Assert(_firstItem != obj, "freeing twice?"); 290Debug.Assert(value != obj, "freeing twice?");
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
321Debug.Assert(operation.Kind is OperationKind.None or OperationKind.Attribute, $"Unexpected root operation kind: {operation.Kind}");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (8)
85Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 89Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 98Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 107Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 117Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 121Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 147Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 153Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (1)
76Debug.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");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
416Debug.Assert(s_serializationVersion == 5, "After increasing the serialization version, add an upgrade path here.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (2)
185Debug.Assert(value == null || !value.GetType().GetTypeInfo().IsEnum, "Enum should not be written with WriteValue. Write them as ints instead."); 195Debug.Assert(!typeInfo.IsEnum, "Enums should not be written with WriteObject. Write them out as integers instead.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
1166Debug.Assert(parameter1.HasExplicitDefaultValue, "Expected all unspecified parameter to have default values");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (4)
492Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 499Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 532Debug.Assert(_completionRefCount == 0, $"Expected {nameof(_completionRefCount)} == 0, got {_completionRefCount}"); 560Debug.Assert(taskSet, "Complete should only be called once.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (1)
33Debug.Assert(span.Start >= start, "Bad generator.");
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
192Debug.Assert(false, message + ". " + diagnostics);
Microsoft.CodeAnalysis.AnalyzerUtilities (73)
src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (2)
280Debug.Assert(_value is V, "Item must be a a V"); 315Debug.Assert(_value is V, "_value must be a V");
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (4)
19/// <inheritdoc cref="Debug.Assert(bool, string)"/> 22=> Debug.Assert(condition, message); 24/// <inheritdoc cref="Debug.Assert(bool, string)"/> 72Debug.Assert(false, message);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
133Debug.Assert(false, "Unreachable");
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
85Debug.Assert(false, message);
src\Dependencies\Collections\Internal\ArraySortHelper.cs (3)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\Dependencies\Collections\Internal\HashHelpers.cs (1)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\Dependencies\Collections\Segmented\SegmentedArray.cs (1)
491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (10)
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
277Debug.Assert(obj != null, "freeing null?"); 279Debug.Assert(_firstItem != obj, "freeing twice?"); 290Debug.Assert(value != obj, "freeing twice?");
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
321Debug.Assert(operation.Kind is OperationKind.None or OperationKind.Attribute, $"Unexpected root operation kind: {operation.Kind}");
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAnalysisData.cs (1)
239Debug.Assert(!analysisEntity.HasUnknownInstanceLocation, "Don't track entities if do not know about it's instance location");
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAbstractValue.cs (2)
69Debug.Assert(!location.IsNull, "Use 'PointsToAbstractValue.NullLocation' singleton"); 70Debug.Assert(!location.IsNoLocation, "Use 'PointsToAbstractValue.NoLocation' singleton");
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAbstractValue.ValuePool.cs (1)
33Debug.Assert(values[i] == i, $"{nameof(PropertySetAbstractValueKind)} isn't a contiguous enum starting at 0");
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityBasedPredicateAnalysisData.cs (2)
75Debug.Assert(baseCompareResult < 0, "Non-monotonic Merge function"); 80Debug.Assert(coreAnalysisDataCompareResult <= 0, "Non-monotonic Merge function");
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowAnalysis.cs (3)
429Debug.Assert(compare <= 0, "The newly computed abstract value must be greater or equal than the previous one."); 538Debug.Assert(compare <= 0, "The newly computed abstract value must be greater or equal than the previous one."); 784Debug.Assert(builder[block] == null || AnalysisDomain.Compare(builder[block]!, newInput) <= 0, "Non-monotonic update");
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowAnalysisResult.cs (1)
108Debug.Assert(operation.GetRoot() != ControlFlowGraph.OriginalOperation,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (4)
1424Debug.Assert(Equals(savedCurrentAnalysisData, CurrentAnalysisData), "Expected no updates to CurrentAnalysisData"); 1462Debug.Assert(Equals(savedCurrentAnalysisData, CurrentAnalysisData), "Expected no updates to CurrentAnalysisData"); 3158Debug.Assert(operation.Initializer == null, "Object or collection initializer must have been lowered in the CFG"); 3828Debug.Assert(operation.Kind == OperationKind.YieldReturn, "IReturnOperation must have been lowered in the CFG");
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\PredicatedAnalysisData.cs (1)
92Debug.Assert(predicatedEntity.CaptureId != null, "Currently we only support predicated data tracking for flow captures");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (8)
85Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 89Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 98Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 107Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 117Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 121Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 147Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 153Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (1)
76Debug.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");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
416Debug.Assert(s_serializationVersion == 5, "After increasing the serialization version, add an upgrade path here.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (2)
185Debug.Assert(value == null || !value.GetType().GetTypeInfo().IsEnum, "Enum should not be written with WriteValue. Write them as ints instead."); 195Debug.Assert(!typeInfo.IsEnum, "Enums should not be written with WriteObject. Write them out as integers instead.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
1166Debug.Assert(parameter1.HasExplicitDefaultValue, "Expected all unspecified parameter to have default values");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (4)
492Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 499Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 532Debug.Assert(_completionRefCount == 0, $"Expected {nameof(_completionRefCount)} == 0, got {_completionRefCount}"); 560Debug.Assert(taskSet, "Complete should only be called once.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (1)
33Debug.Assert(span.Start >= start, "Bad generator.");
Microsoft.CodeAnalysis.BannedApiAnalyzers (59)
src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (2)
280Debug.Assert(_value is V, "Item must be a a V"); 315Debug.Assert(_value is V, "_value must be a V");
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (4)
19/// <inheritdoc cref="Debug.Assert(bool, string)"/> 22=> Debug.Assert(condition, message); 24/// <inheritdoc cref="Debug.Assert(bool, string)"/> 72Debug.Assert(false, message);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
133Debug.Assert(false, "Unreachable");
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
85Debug.Assert(false, message);
src\Dependencies\Collections\Internal\ArraySortHelper.cs (3)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\Dependencies\Collections\Internal\HashHelpers.cs (1)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\Dependencies\Collections\Segmented\SegmentedArray.cs (1)
491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (10)
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
277Debug.Assert(obj != null, "freeing null?"); 279Debug.Assert(_firstItem != obj, "freeing twice?"); 290Debug.Assert(value != obj, "freeing twice?");
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
321Debug.Assert(operation.Kind is OperationKind.None or OperationKind.Attribute, $"Unexpected root operation kind: {operation.Kind}");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (8)
85Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 89Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 98Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 107Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 117Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 121Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 147Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 153Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (1)
76Debug.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");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
416Debug.Assert(s_serializationVersion == 5, "After increasing the serialization version, add an upgrade path here.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (2)
185Debug.Assert(value == null || !value.GetType().GetTypeInfo().IsEnum, "Enum should not be written with WriteValue. Write them as ints instead."); 195Debug.Assert(!typeInfo.IsEnum, "Enums should not be written with WriteObject. Write them out as integers instead.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
1166Debug.Assert(parameter1.HasExplicitDefaultValue, "Expected all unspecified parameter to have default values");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (4)
492Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 499Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 532Debug.Assert(_completionRefCount == 0, $"Expected {nameof(_completionRefCount)} == 0, got {_completionRefCount}"); 560Debug.Assert(taskSet, "Complete should only be called once.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (1)
33Debug.Assert(span.Start >= start, "Bad generator.");
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
192Debug.Assert(false, message + ". " + diagnostics);
Microsoft.CodeAnalysis.CodeStyle (57)
src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (2)
280Debug.Assert(_value is V, "Item must be a a V"); 315Debug.Assert(_value is V, "_value must be a V");
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (4)
19/// <inheritdoc cref="Debug.Assert(bool, string)"/> 22=> Debug.Assert(condition, message); 24/// <inheritdoc cref="Debug.Assert(bool, string)"/> 72Debug.Assert(false, message);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
133Debug.Assert(false, "Unreachable");
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
85Debug.Assert(false, message);
src\Dependencies\Collections\Internal\ArraySortHelper.cs (3)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\Dependencies\Collections\Internal\HashHelpers.cs (1)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\Dependencies\Collections\Segmented\SegmentedArray.cs (1)
491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (10)
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
277Debug.Assert(obj != null, "freeing null?"); 279Debug.Assert(_firstItem != obj, "freeing twice?"); 290Debug.Assert(value != obj, "freeing twice?");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (8)
85Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 89Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 98Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 107Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 117Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 121Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 147Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 153Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (1)
76Debug.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");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
416Debug.Assert(s_serializationVersion == 5, "After increasing the serialization version, add an upgrade path here.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (2)
185Debug.Assert(value == null || !value.GetType().GetTypeInfo().IsEnum, "Enum should not be written with WriteValue. Write them as ints instead."); 195Debug.Assert(!typeInfo.IsEnum, "Enums should not be written with WriteObject. Write them out as integers instead.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
1166Debug.Assert(parameter1.HasExplicitDefaultValue, "Expected all unspecified parameter to have default values");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (4)
492Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 499Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 532Debug.Assert(_completionRefCount == 0, $"Expected {nameof(_completionRefCount)} == 0, got {_completionRefCount}"); 560Debug.Assert(taskSet, "Complete should only be called once.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (1)
33Debug.Assert(span.Start >= start, "Bad generator.");
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (1)
97Debug.Assert(false, "All conflict markers should start at the beginning of a line.");
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
192Debug.Assert(false, message + ". " + diagnostics);
Microsoft.CodeAnalysis.Collections.Package (137)
Extensions\IEnumerableExtensions.cs (1)
648Debug.Assert(data.All(d => d.Count() == count));
Extensions\ImmutableArrayExtensions.cs (16)
83Debug.Assert(items != null); 484Debug.Assert(self.Length == other.Length); 515Debug.Assert(self.Length == other.Length); 548Debug.Assert(!array.IsDefault); 549Debug.Assert(predicateWithArg != null ^ predicateWithoutArg != null); 568Debug.Assert(i > 0); 584Debug.Assert(i > 0); 587Debug.Assert(builder == null); 600Debug.Assert(!all); 601Debug.Assert(!none); 610Debug.Assert(none); 900Debug.Assert(builder.Count > 1); 944Debug.Assert(members.Length > 0); 959Debug.Assert(count < members.Length); 971Debug.Assert(builder.Count == count); 1279Debug.Assert(!array.IsDefault);
Internal\ArraySortHelper.cs (44)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 112Debug.Assert(i != j); 125Debug.Assert(i != j); 134Debug.Assert(comparer != null); 147Debug.Assert(keys.Length > 0); 148Debug.Assert(depthLimit >= 0); 149Debug.Assert(comparer != null); 192Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 193Debug.Assert(comparer != null); 237Debug.Assert(comparer != null); 238Debug.Assert(keys.Length > 0); 255Debug.Assert(comparer != null); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 415Debug.Assert(!Unsafe.AreSame(ref i, ref j)); 427Debug.Assert(keys.Length > 0); 428Debug.Assert(depthLimit >= 0); 474Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 537Debug.Assert(keys.Length > 0); 693Debug.Assert(comparer != null); 694Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 695Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 696Debug.Assert(i != j); 713Debug.Assert(i != j); 726Debug.Assert(comparer != null); 727Debug.Assert(keys.Length == values.Length); 737Debug.Assert(keys.Length > 0); 738Debug.Assert(values.Length == keys.Length); 739Debug.Assert(depthLimit >= 0); 740Debug.Assert(comparer != null); 783Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 784Debug.Assert(comparer != null); 828Debug.Assert(comparer != null); 829Debug.Assert(keys.Length > 0); 846Debug.Assert(comparer != null); 873Debug.Assert(comparer != null); 946Debug.Assert(i != j); 964Debug.Assert(i != j); 977Debug.Assert(keys.Length > 0); 978Debug.Assert(values.Length == keys.Length); 979Debug.Assert(depthLimit >= 0); 1022Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 1081Debug.Assert(keys.Length > 0); 1235Debug.Assert(typeof(TKey) == typeof(double) || typeof(TKey) == typeof(float));
Internal\BitHelper.cs (2)
34Debug.Assert(bitPosition >= 0); 48Debug.Assert(bitPosition >= 0);
Internal\HashHelpers.cs (3)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 113Debug.Assert(divisor <= int.MaxValue); 119Debug.Assert(highbits == value % divisor);
Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
OneOrMany.cs (1)
200Debug.Assert(HasOneItem == other.HasOneItem);
Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
24Debug.Assert(dictionary is not null);
Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
24Debug.Assert(dictionary is not null);
Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
120Debug.Assert(other is not ValueBuilder);
Segmented\SegmentedArray.cs (6)
114Debug.Assert(length > 0); 115Debug.Assert(sourceIndex >= 0); 116Debug.Assert(destinationIndex >= 0); 117Debug.Assert((uint)(sourceIndex + length) <= array.Length); 118Debug.Assert((uint)(destinationIndex + length) <= array.Length); 491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
Segmented\SegmentedDictionary`2.cs (21)
168Debug.Assert(_entries.Length >= source.Count); 169Debug.Assert(_count == 0); 260Debug.Assert(modified); 267Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 447Debug.Assert(comparer is not null); 518Debug.Assert(_buckets.Length > 0); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 524Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType)); 574Debug.Assert(comparer is not null); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 649Debug.Assert(newSize >= _entries.Length); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 711Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 788Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
Segmented\SegmentedHashSet`1.cs (16)
189Debug.Assert(Count == source.Count); 204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 258Debug.Assert(comparer is not null); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 302Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 902Debug.Assert(newSize >= _entries.Length); 1023Debug.Assert(_buckets.Length > 0); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1063Debug.Assert(comparer is not null); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
Segmented\SegmentedList`1.cs (2)
270Debug.Assert(_size == _items.Length); 520Debug.Assert(_items.Length < capacity);
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\Dependencies\PooledObjects\ArrayBuilder.cs (8)
493Debug.Assert(builder.Count == 0); 609Debug.Assert(start >= 0 && length >= 0); 610Debug.Assert(start + length <= items.Count); 629Debug.Assert(start >= 0 && length >= 0); 630Debug.Assert(start + length <= items.Length); 644Debug.Assert(start >= 0 && length >= 0); 645Debug.Assert(start + length <= items.Length); 669Debug.Assert(limit <= Count);
src\Dependencies\PooledObjects\ObjectPool`1.cs (5)
118Debug.Assert(size >= 1); 126Debug.Assert(size >= 1); 277Debug.Assert(obj != null, "freeing null?"); 279Debug.Assert(_firstItem != obj, "freeing twice?"); 290Debug.Assert(value != obj, "freeing twice?");
src\Dependencies\PooledObjects\PooledDictionary.cs (1)
58Debug.Assert(instance.Count == 0);
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
47Debug.Assert(instance.Count == 0);
src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
30Debug.Assert(pool != null); 95Debug.Assert(builder.Builder.Length == 0);
TemporaryArray`1.cs (2)
173Debug.Assert(_count == InlineCapacity); 336Debug.Assert(_builder is null);
Microsoft.CodeAnalysis.Contracts.Package (2)
ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
Microsoft.CodeAnalysis.CSharp (298)
Binder\Binder.ValueChecks.cs (2)
4429Debug.Assert(conversion.ConversionKind != ConversionKind.StackAllocToSpanType, "StackAllocToSpanType unexpected"); 5215Debug.Assert(conversion.ConversionKind != ConversionKind.StackAllocToSpanType, "StackAllocToSpanType unexpected");
Binder\Binder_Attributes.cs (1)
308Debug.Assert(!constructorArgsArray.IsDefault, "Property of VisitArguments");
Binder\Binder_Conversions.cs (4)
1633Debug.Assert(!method.HasUseSiteError, "Shouldn't have reached this point if there were use site errors."); 2496Debug.Assert(targetElementTypes.Length == arguments.Length, "converting a tuple literal to incompatible type?"); 2828Debug.Assert(delegateType is NamedTypeSymbol { TypeKind: TypeKind.Delegate, DelegateInvokeMethod: { HasUseSiteError: false } } 3064Debug.Assert(!selectedMethod.HasUseSiteError, "Shouldn't have reached this point if there were use site errors.");
Binder\Binder_Crefs.cs (3)
21Debug.Assert(!symbols.IsDefault, "Prefer empty to null."); 22Debug.Assert((symbols.Length > 1) == ((object?)ambiguityWinner != null), "ambiguityWinner should be set iff more than one symbol is returned."); 988Debug.Assert(candidate.GetMemberArity() != 0 || candidate.Name == WellKnownMemberNames.InstanceConstructorName || arity == 0,
Binder\Binder_Expressions.cs (3)
2456Debug.Assert(result.IsSingleViable, "If this happens, we need to deal with multiple label definitions."); 2810Debug.Assert(originalUserDefinedConversions.Length == 0, 7861Debug.Assert(lookupResult.IsClear, "If there's a legitimate reason for having candidates without a reason, then we should produce something intelligent in such cases.");
Binder\Binder_Invocation.cs (2)
1332Debug.Assert(!method.HasUseSiteError, "Shouldn't have reached this point if there were use site errors."); 1907Debug.Assert(d is not DiagnosticWithInfo { HasLazyInfo: true }, "Adjust the Arguments access to handle lazy diagnostics to avoid cycles.");
Binder\Binder_Lookup.cs (2)
1266Debug.Assert(!originalBinder.InCref, "Can't dot into type parameters, so how can this happen?"); 1673Debug.Assert(symbol.Kind != SymbolKind.Alias, "It is the caller's responsibility to unwrap aliased symbols.");
Binder\Binder_Operators.cs (3)
3873Debug.Assert((object)operandType != null, "BindValue should have caught a null operand type"); 4399Debug.Assert(false, "Should be handled separately."); 5142Debug.Assert(!targetType.IsPointerOrFunctionPointer(), "Should have been caught above");
Binder\Binder_Statements.cs (9)
151Debug.Assert(result.WasCompilerGenerated == false || 156Debug.Assert(result.Syntax is StatementSyntax, "BoundStatement should be associated with a statement syntax."); 158Debug.Assert(System.Linq.Enumerable.Contains(result.Syntax.AncestorsAndSelf(), node), @"Bound statement (or one of its parents) 2239Debug.Assert(false, "Missing case in lambda conversion error reporting"); 2293Debug.Assert(originalUserDefinedConversions.Length == 0, 2456Debug.Assert(operand.HasAnyErrors && operand.Kind != BoundKind.UnboundLambda, "Missing a case in implicit conversion error reporting"); 3724Debug.Assert(initializerInvocation.HasAnyErrors || constructorInitializer.IsConstructorInitializer(), "Please keep this bound node in sync with BoundNodeExtensions.IsConstructorInitializer."); 3792Debug.Assert(initializerInvocation.HasAnyErrors || constructorInitializer.IsConstructorInitializer(), "Please keep this bound node in sync with BoundNodeExtensions.IsConstructorInitializer."); 3809Debug.Assert(initializerInvocation.HasAnyErrors || constructorInitializer.IsConstructorInitializer(), "Please keep this bound node in sync with BoundNodeExtensions.IsConstructorInitializer.");
Binder\Binder_Symbols.cs (8)
1665Debug.Assert((object)typeSymbol != null, "Expect an error type if special type isn't found"); 1673Debug.Assert((object)typeSymbol != null, "Expect an error type if special type isn't found"); 1802Debug.Assert((object)typeSymbol != null, "Expect an error type if well-known type isn't found"); 1814Debug.Assert((object)typeSymbol != null, "Expect an error type if well-known type isn't found"); 2040Debug.Assert(!Symbol.Equals(originalSymbols[best.Index], originalSymbols[secondBest.Index], TypeCompareKind.ConsiderEverything) || options.IsAttributeTypeLookup(), 2043Debug.Assert(!Symbol.Equals(first, second, TypeCompareKind.ConsiderEverything) || !Symbol.Equals(originalSymbols[best.Index], originalSymbols[secondBest.Index], TypeCompareKind.ConsiderEverything), 2198Debug.Assert(originalSymbols[best.Index].Name != originalSymbols[secondBest.Index].Name || 2656Debug.Assert((object)forwardedType.ContainingAssembly != null, "How did we find a cycle if there was no forwarding?");
Binder\Binder_Unsafe.cs (1)
29Debug.Assert((node.Kind() == SyntaxKind.SizeOfExpression) == ((object)sizeOfTypeOpt != null), "Should have a type for (only) sizeof expressions.");
Binder\BinderFactory.BinderFactoryVisitor.cs (4)
221Debug.Assert(method.Arity == 0, "Generic Ctor, What to do?"); 854Debug.Assert(!inUsing || inBody, "inUsing => inBody"); 1051Debug.Assert(BitArithmeticUtilities.CountBits((uint)usage) <= 1, "Not a flags enum."); 1142Debug.Assert(extraInfo == NodeUsage.Normal || extraInfo == NodeUsage.CrefParameterOrReturnType,
Binder\BinderFactory.cs (1)
166Debug.Assert(constructor.Arity == 0, "Generic Ctor, What to do?");
Binder\DecisionDagBuilder.cs (1)
987Debug.Assert(wasAcyclic, "wasAcyclic"); // force failure in debug builds
Binder\EarlyWellKnownAttributeBinder.cs (1)
48Debug.Assert(false, "Don't call this overload.");
Binder\ForEachEnumeratorInfo.cs (3)
118Debug.Assert((object)CollectionType != null, $"'{nameof(CollectionType)}' cannot be null"); 119Debug.Assert((object)ElementType != null, $"'{nameof(ElementType)}' cannot be null"); 120Debug.Assert(GetEnumeratorInfo != null, $"'{nameof(GetEnumeratorInfo)}' cannot be null");
Binder\ForEachLoopBinder.cs (2)
561Debug.Assert((object)collectionConversionClassification.Method == null, 563Debug.Assert((object)currentConversionClassification.Method == null,
Binder\Imports.cs (2)
123Debug.Assert(!originalNamespace.IsGlobalNamespace, "Global using to global namespace"); 126Debug.Assert(expandedGlobalNamespace.IsGlobalNamespace, "Global namespace required");
Binder\InMethodBinder.cs (2)
249Debug.Assert(oldLocation != newLocation || oldLocation == Location.None || newLocation.SourceTree?.GetRoot().ContainsDiagnostics == true, 326Debug.Assert(false, "what else could be defined in a method?");
Binder\LocalScopeBinder.cs (1)
536Debug.Assert(false, "what else can be declared inside a local scope?");
Binder\LookupResultKind.cs (1)
94Debug.Assert(false, "Should not call this on LookupResultKind.Viable");
Binder\Semantics\Conversions\Conversions.cs (1)
401Debug.Assert((object)delegateInvokeMethod != null && !delegateInvokeMethod.HasUseSiteError,
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (1)
1418Debug.Assert((kind & ~BinaryOperatorKind.Checked) == kind, "Did not expect operator to be checked. Consider using .Operator() to mask.");
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (4)
929Debug.Assert((object)argument.Type == null, "should not need to dig into elements if tuple has natural type"); 1416Debug.Assert((object)delegateType.DelegateInvokeMethod != null && !delegateType.DelegateInvokeMethod.HasUseSiteError, 1470Debug.Assert(method is { HasUseSiteError: false }, 3065Debug.Assert((object)target.DelegateInvokeMethod != null && !target.DelegateInvokeMethod.HasUseSiteError,
Binder\Semantics\OverloadResolution\OverloadResolution.cs (1)
4732Debug.Assert((!conversion.Exists) || conversion.IsImplicit, "ClassifyImplicitConversion should only return implicit conversions");
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (6)
159Debug.Assert(false, "How did we manage to get two methods in the overload resolution results that were both better than every other method?"); 206Debug.Assert(!this.Succeeded, "Don't ask for diagnostic info on a successful overload resolution result."); 612Debug.Assert(bad.Member.GetUseSiteInfo().DiagnosticInfo.Severity == DiagnosticSeverity.Error, 1320Debug.Assert((object)parameter == unwrapIfParamsCollection(badArg, parameter, isLastParameter), "If they ever differ, just call the method when constructing the diagnostic."); 1403Debug.Assert(nWorse == 0, "How is it that there is exactly one applicable but worse method, and exactly zero applicable best methods? What was better than this thing?"); 1462Debug.Assert(nValid == 0, "Why are we doing error reporting on an overload resolution problem that had one valid result?");
Binder\WithCrefTypeParametersBinder.cs (1)
135Debug.Assert(typeParameterSyntax != null, "Syntactic requirement of crefs");
Binder\WithLambdaParametersBinder.cs (1)
153Debug.Assert(false, "what else could be defined in a lambda?");
BoundTree\BoundDecisionDagNode.cs (2)
66Debug.Assert(value >= 0, "Id must be non-negative but was set to " + value); 67Debug.Assert(_id == -1, $"Id was set to {_id} and set again to {value}");
BoundTree\BoundExpression.cs (4)
22Debug.Assert(this.WasCompilerGenerated || this.Syntax is InvocationExpressionSyntax or ConstructorInitializerSyntax or PrimaryConstructorBaseTypeSyntax { ArgumentList: { } }, 683Debug.Assert(valueSymbol != null, "Field 'valueSymbol' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)"); 684Debug.Assert(valueExpression != null, "Field 'valueExpression' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)"); 685Debug.Assert(typeExpression != null, "Field 'typeExpression' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
BoundTree\BoundNode.cs (11)
139Debug.Assert((_attributes & BoundNodeAttributes.HasErrors) == 0, 185Debug.Assert((_attributes & BoundNodeAttributes.WasCompilerGeneratedIsChecked) == 0, 195Debug.Assert((_attributes & BoundNodeAttributes.CompilerGenerated) == 0, 207Debug.Assert((_attributes & BoundNodeAttributes.WasCompilerGeneratedIsChecked) == 0, 240Debug.Assert((_attributes & BoundNodeAttributes.WasTopLevelNullabilityChecked) == 0, 304Debug.Assert((_attributes & BoundNodeAttributes.IsSuppressed) == 0, "flag should not be set twice or reset"); 326Debug.Assert((_attributes & BoundNodeAttributes.WasConverted) == 0, "WasConverted flag should not be set twice or reset"); 342Debug.Assert((_attributes & BoundNodeAttributes.WasPropertyBackingFieldAccessChecked) == 0, "should not be set twice or reset"); 506Debug.Assert(false, "duplicate local " + local.GetDebuggerDisplay()); 517Debug.Assert(false, "missing local " + local.GetDebuggerDisplay()); 526Debug.Assert(false, "undeclared local " + local.GetDebuggerDisplay());
BoundTree\Constructors.cs (2)
194Debug.Assert(argumentRefKind is RefKind.None or RefKind.Ref or RefKind.In or RefKind.Out or RefKindExtensions.StrictIn && 475Debug.Assert((object)typeWithAnnotations.Type != null, "Field 'type' cannot be null");
BoundTree\LengthBasedStringSwitchData.cs (1)
146Debug.Assert(nullCaseLabel is null, "At most one null case per string dispatch");
CodeGen\CodeGenerator.cs (2)
168Debug.Assert(!_method.ReturnsVoid, "returning something from void method?"); 302Debug.Assert(!(_expressionTemps?.Count > 0), "leaking expression temps?");
CodeGen\CodeGenerator_HasHome.cs (1)
71Debug.Assert(IsAnyReadOnly(addressKind), "`this` is readonly in classes");
CodeGen\EmitAddress.cs (4)
36Debug.Assert(((BoundDup)expression).RefKind != RefKind.None, "taking address of a stack value?"); 65Debug.Assert(expression.Type.IsValueType || IsAnyReadOnly(addressKind), "'this' is readonly in classes"); 90Debug.Assert(false, "base is always a reference type, why one may need a reference to it?"); 420Debug.Assert(arrayAccess.Type.TypeKind == TypeKind.TypeParameter, "constrained call should only be used with type parameter types");
CodeGen\EmitArrayInitializer.cs (3)
369Debug.Assert(inits.All((init) => init.Kind != BoundKind.ArrayInitialization) || 432Debug.Assert(inPlaceTarget is null || TargetIsNotOnHeap(inPlaceTarget), "in-place construction target should not be on heap"); 584Debug.Assert(specialElementType.SizeInBytes() is 2 or 4 or 8, "Supported primitives are expected to be 2, 4, or 8 bytes");
CodeGen\EmitExpression.cs (27)
411Debug.Assert(!receiverType.IsValueType || 677Debug.Assert(temp == null, "makeref should not create temps"); 737Debug.Assert(argument.Type.IsDynamic() || argument is BoundFieldAccess { FieldSymbol.RefKind: not RefKind.None }, "passing args byref should not clone them into temps"); 750Debug.Assert(temp == null, "If the operand is addressable, then a temp shouldn't be required."); 949Debug.Assert(arguments.Length == parameters.Length || 951Debug.Assert(parameters.All(p => p.RefKind == RefKind.None) || !argRefKindsOpt.IsDefault, "there are nontrivial parameters, so we must have argRefKinds"); 953Debug.Assert(argRefKindsOpt.IsDefault || argRefKindsOpt.Length == arguments.Length || 977Debug.Assert(argRefKind == parameters[i].RefKind || 988Debug.Assert(parameters[i].RefKind != RefKind.RefReadOnlyParameter, 1139Debug.Assert(!field.IsConst || field.ContainingType.SpecialType == SpecialType.System_Decimal, 1182Debug.Assert(FieldLoadMustUseRef(receiver), "only clr-ambiguous structs use temps here"); 1249Debug.Assert(!field.IsVolatile, "volatile valuetype fields are unexpected"); 1515Debug.Assert(receiver.Type.IsVerifierReference(), "this is not a reference"); 1516Debug.Assert(receiver.Kind != BoundKind.BaseReference, "base should always use call"); 2184Debug.Assert(methodContainingType.IsVerifierValue(), "only struct calls can be readonly"); 2299Debug.Assert(method.ContainingType.IsVerifierValue(), "this is not a value type"); 2675Debug.Assert(temp == null, "in-place init target should not create temps"); 2682Debug.Assert(TargetIsNotOnHeap(target), "cannot read-back the target since it could have been modified"); 2689Debug.Assert(TargetIsNotOnHeap(target), "in-place construction target should not be on heap"); 2704Debug.Assert(temp == null, "in-place ctor target should not create temps"); 2791Debug.Assert(temp == null, "temp is unexpected when assigning to a field"); 2875Debug.Assert(temp == null, "taking ref of this should not create a temp"); 2886Debug.Assert(temp == null, "taking ref of Dup should not create a temp"); 2898Debug.Assert(temp == null, "taking ref of this should not create a temp"); 3839Debug.Assert(expr.LeftConversion is null, "coalesce with nontrivial left conversions are lowered into conditional."); 4053Debug.Assert(useKind == UseKind.Unused, "Using the return value of a void method."); 4054Debug.Assert(_method.GenerateDebugInfo, "Implied by this.emitSequencePoints");
CodeGen\EmitStackAllocInitializer.cs (1)
171Debug.Assert(!(init is BoundArrayInitialization), "Nested initializers are not allowed for stackalloc");
CodeGen\EmitStatement.cs (2)
874Debug.Assert(unexpectedTemp == null, "ref-returning a temp?"); 1157Debug.Assert(!left.FieldSymbol.IsStatic, "Not supported");
CodeGen\Optimizer.cs (18)
614Debug.Assert(EvalStackIsEmpty(), "entering blocks when evaluation stack is not empty?"); 793Debug.Assert(localUsedWalker.IsLocalUsedIn(assignment.Right), "who assigns the temp?"); 928Debug.Assert(_context != ExprContext.AssignmentTarget, "assignment expression cannot be a target of another assignment"); 938Debug.Assert(_context == ExprContext.Value || 972Debug.Assert( 978Debug.Assert(!isIndirectAssignment, "indirect assignment is a read, not a write"); 1029Debug.Assert(!node.IsRef || 1036Debug.Assert(lhs.Type.IsValueType, "'this' is assignable only in structs"); 1056Debug.Assert(((BoundCall)lhs).Method.RefKind == RefKind.Ref, "only ref returning methods are assignable"); 1060Debug.Assert(((BoundFunctionPointerInvocation)lhs).FunctionPointer.Signature.RefKind == RefKind.Ref, "only ref returning function pointers are assignable"); 1064Debug.Assert(((BoundConditionalOperator)lhs).IsRef, "only ref ternaries are assignable"); 1068Debug.Assert(((BoundAssignmentOperator)lhs).IsRef, "only ref assignments are assignable"); 1072Debug.Assert(!IsIndirectAssignment(node.Update(((BoundSequence)node.Left).Value, node.Right, node.IsRef, node.Type)), 1388Debug.Assert(false, "we should not have label expressions at this stage"); 1394Debug.Assert(false, "we should not have is-pattern expressions at this stage"); 1400Debug.Assert(node.CaseExpressionOpt == null, "we should not have label expressions at this stage"); 1873Debug.Assert(local.RefKind == RefKind.None, "cannot take a ref of a ref"); 2009Debug.Assert(local.SynthesizedKind == SynthesizedLocalKind.LoweringTemp, "only lowering temps may be sometimes reused");
Compilation\BuiltInOperators.cs (3)
766Debug.Assert(false, "Bad operator kind in left type"); 798Debug.Assert(false, "Bad operator kind in right type"); 829Debug.Assert(false, "Bad operator kind in return type");
Compilation\CSharpSemanticModel.cs (6)
1360Debug.Assert(position == CheckAndAdjustPosition(position), "Expected adjusted position"); 1568Debug.Assert((options & LookupOptions.UseBaseReferenceAccessibility) == 0, "Use the useBaseReferenceAccessibility parameter."); 1951Debug.Assert(ReferenceEquals(lowestBoundNode, highestBoundNode), "How is it that this operator has the same syntax node as its operand?"); 4126Debug.Assert(symbol.IsIndexer(), "Only indexers can have name " + WellKnownMemberNames.Indexer); 4901Debug.Assert(((options & SymbolInfoOptions.PreferConstructorsToType) != 0) != 4903Debug.Assert(((options & SymbolInfoOptions.ResolveAliases) != 0) !=
Compilation\MemberSemanticModel.cs (6)
886Debug.Assert(this.GetMemberModel(lambda) == null, "Did not find a unique LambdaSymbol for lambda in member."); 1218Debug.Assert(IsInTree(node), "Since the node is in the tree, we can always recompute the binder later"); 1241Debug.Assert(IsInTree(node), "Since the node is in the tree, we can always recompute the binder later"); 1253Debug.Assert(IsInTree(node), "Since the node is in the tree, we can always recompute the binder later"); 1379Debug.Assert(current != null, "Why are we being asked to find an enclosing lambda outside of our root?"); 1535Debug.Assert(current != null, "How did we get outside the root?");
Compilation\MemberSemanticModel.NodeMapBuilder.cs (7)
41Debug.Assert(node == null || root == null || !(root.Syntax is StatementSyntax), "individually added nodes are not supposed to be statements."); 80Debug.Assert(existing.Count == nodesToAdd.Count, "existing.Count == nodesToAdd.Length"); 90Debug.Assert(!(key is StatementSyntax), "!(key is StatementSyntax)"); 95Debug.Assert( 103Debug.Assert( 111Debug.Assert(false, "New bound node does not match existing bound node"); 116Debug.Assert(
Compilation\SyntaxTreeSemanticModel.cs (3)
1796Debug.Assert(name is not null, "Should only be looking for a known namespace by name."); 1797Debug.Assert(namespaces is [NamespaceSymbol], "Namespace declarations of the same name are expected to appear as a single merged symbol."); 1801Debug.Assert(knownNamespace.HasLocationContainedWithin(SyntaxTree, declarationSpan, out _), "Namespace symbols should include all syntax declaration locations.");
Compiler\ClsComplianceChecker.cs (12)
122System.Diagnostics.Debug.Assert(warningLocation != null || !moduleDeclaredCompliance.HasValue || (i == 0 && _filterTree != null), 279System.Diagnostics.Debug.Assert(IsAccessibleOutsideAssembly(constructor), "Should be implied by IsAccessibleIfContainerIsAccessible"); 499System.Diagnostics.Debug.Assert(!IsTrue(GetDeclaredOrInheritedCompliance(symbol)), "Only call on non-compliant symbols"); 514System.Diagnostics.Debug.Assert(IsTrue(GetDeclaredOrInheritedCompliance(symbol)), "Only call on compliant symbols"); 532System.Diagnostics.Debug.Assert((object)baseType != null || symbol.SpecialType == SpecialType.System_Object, "Only object has no base."); 543System.Diagnostics.Debug.Assert(IsTrue(GetDeclaredOrInheritedCompliance(symbol)), "Only call on compliant symbols"); 555System.Diagnostics.Debug.Assert(typeParameters.IsEmpty || IsTrue(GetDeclaredOrInheritedCompliance(context)), "Only call on compliant symbols"); 574System.Diagnostics.Debug.Assert(parameters.IsEmpty || IsTrue(GetDeclaredOrInheritedCompliance(context)), "Only call on compliant symbols"); 587System.Diagnostics.Debug.Assert(IsTrue(GetDeclaredOrInheritedCompliance(symbol)), "Only call on compliant symbols"); 713System.Diagnostics.Debug.Assert(IsTrue(GetDeclaredOrInheritedCompliance(symbol)), "Only call on compliant symbols"); 1116System.Diagnostics.Debug.Assert(symbol.Kind == SymbolKind.NamedType || !((symbol is TypeSymbol)), 1209System.Diagnostics.Debug.Assert(args.Length == 1, "We already checked the signature and HasErrors.");
Compiler\DocumentationCommentCompiler.cs (2)
1363Debug.Assert(false, "Didn't expect nesting to reach depth " + depth); 1398Debug.Assert(false, "If we hit this, then we might need to think about a different workaround " +
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (4)
104Debug.Assert(sourceIncludeElementNodes.All(syntax => syntax.SyntaxTree.Options.DocumentationMode < DocumentationMode.Diagnose), 193Debug.Assert(commentMessage == null, "How did we get an error comment for a non-container?"); 513Debug.Assert(memberDeclSyntax != null, 535Debug.Assert(memberDeclSyntax != null,
Compiler\MethodCompiler.cs (1)
2459Debug.Assert(initializerInvocation.HasAnyErrors || constructorInitializer.IsConstructorInitializer(), "Please keep this bound node in sync with BoundNodeExtensions.IsConstructorInitializer.");
Emitter\EditAndContinue\CSharpSymbolMatcher.cs (1)
61Debug.Assert(
Emitter\Model\AttributeDataAdapter.cs (1)
193Debug.Assert(false, "Name does not match an attribute field or a property. How can that be?");
Emitter\Model\NamedTypeSymbolAdapter.cs (1)
797Debug.Assert(AdaptedNamedTypeSymbol.IsErrorType() ||
Emitter\Model\PEModuleBuilder.cs (5)
471Debug.Assert(Compilation == compilation, "How did we get symbol from different compilation?"); 757Debug.Assert((object)originalDefinition.ContainingType == null, "How did a nested type get forwarded?"); 1174Debug.Assert(!fieldSymbol.IsVirtualTupleField && 1369Debug.Assert(@params.All(p => mustBeTranslated == MustBeWrapped(p)), "either all or no parameters need translating"); 1761Debug.Assert(diagnosticsOpt is null || attribute == EmbeddableAttributes.ParamCollectionAttribute, "Don't report any errors. They should be reported during binding.");
FlowAnalysis\AbstractFlowPass.cs (1)
204Debug.Assert(length >= 0, "last comes before first");
FlowAnalysis\DefiniteAssignment.cs (3)
289Debug.Assert(variableId.Symbol.Kind == SymbolKind.Field || variableId.Symbol.Kind == SymbolKind.Property || variableId.Symbol.Kind == SymbolKind.Event, 315Debug.Assert( 624Debug.Assert(newCode != oldCode || oldCode == ErrorCode.ERR_InsufficientStack, oldCode.ToString());
FlowAnalysis\NullableWalker.cs (1)
6161Debug.Assert(node is not BoundConditionalOperator { WasTargetTyped: true }, """
FlowAnalysis\NullableWalker.SnapshotManager.cs (1)
171Debug.Assert(_currentWalkerSlot == -1, "Attempting to finalize snapshots before all walks completed");
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (1)
370Debug.Assert(node.Label == _currentAwaitFinallyFrame.ProxyLabelIfNeeded(node.Label), "conditional leave?");
Lowering\ClosureConversion\ClosureConversion.cs (1)
1082Debug.Assert(node.ArgsToParamsOpt.IsDefault, "should be done with argument reordering by now");
Lowering\DiagnosticsPass_Warnings.cs (1)
668Debug.Assert(false, "How did we get here?");
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.cs (6)
291Debug.Assert(body != null, "we should have either sub-dispatch or a handler"); 361Debug.Assert(node.Label == proxyLabel || !(F.CurrentFunction is IteratorFinallyMethodSymbol), "should not be proxying branches in finally"); 367Debug.Assert(node.Label == _currentFinallyFrame.ProxyLabelIfNeeded(node.Label), "conditional leave?"); 388Debug.Assert(node.CatchBlocks.IsEmpty, "try with yields must have no catches"); 389Debug.Assert(node.FinallyBlockOpt != null, "try with yields must have finally"); 397Debug.Assert(frame.parent.knownStates.ContainsValue(frame), "parent must be aware about states in the child frame");
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.IteratorFinallyFrame.cs (2)
49Debug.Assert(parent != null, "non root frame must have a parent"); 50Debug.Assert((object)handler != null, "non root frame must have a handler");
Lowering\LocalRewriter\LocalRewriter.cs (3)
209Debug.Assert(!node.HasErrors, "nodes with errors should not be lowered"); 227Debug.Assert(!node.HasErrors, "nodes with errors should not be lowered"); 239Debug.Assert(!node.HasErrors, "nodes with errors should not be lowered");
Lowering\LocalRewriter\LocalRewriter_AssignmentOperator.cs (1)
284Debug.Assert(autoProp.IsAutoPropertyOrUsesFieldKeyword,
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (3)
118Debug.Assert(node.Type.SpecialType == SpecialType.System_String, "Non-string binary addition should have been handled by VisitConversion or VisitArguments"); 1022Debug.Assert(yNonNull is null, "Handled by trivial optimization above; otherwise we should use yNonNull here."); 1035Debug.Assert(xNonNull is null, "Handled by trivial optimization above; otherwise we should use xNonNull here.");
Lowering\LocalRewriter\LocalRewriter_Call.cs (2)
627Debug.Assert(false, "Unexpected conversion kind" + conv.ConversionKind); 1031Debug.Assert(rewrittenArguments.All(arg => arg is not BoundDiscardExpression), "Discards should have been substituted by VisitArguments");
Lowering\LocalRewriter\LocalRewriter_Event.cs (1)
186Debug.Assert(sideEffects.Any(), "Otherwise, we shouldn't be building a sequence");
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (1)
818Debug.Assert(refKind == RefKind.None || refKind == RefKind.Ref || refKind == RefKind.Out, "unexpected refKind in dynamic");
Lowering\SpillSequenceSpiller.cs (1)
1374Debug.Assert(replacer._replaced == 1, "should have replaced exactly one node");
Lowering\SyntheticBoundNodeFactory.cs (1)
279Debug.Assert(!(receiverOpt is { Type: ArrayTypeSymbol { IsSZArray: true } } &&
Parser\Blender.cs (1)
134Debug.Assert(token.Kind() != SyntaxKind.None, "how could we not get a real token back?");
Parser\LanguageParser.cs (2)
4930Debug.Assert(typeParameterList == null, "Exit condition of ParseMemberName in this scenario"); 6696Debug.Assert(!ReferenceEquals(tmp, explicitInterfaceName), "We should have consumed something and updated explicitInterfaceName");
Parser\Lexer.cs (8)
1714Debug.Assert(consumedSurrogate == SlidingTextWindow.InvalidCharacter, "Since consumedChar == '\\'"); 3301Debug.Assert(false, "Should have picked up leading indentationTrivia, but didn't."); 3317Debug.Assert(false, "Should have picked up leading indentationTrivia, but didn't."); 3709Debug.Assert(TextWindow.Position > beforeConsumed, "First character or entity has been consumed."); 3820Debug.Assert(info.Text == null, "Haven't tried to set it yet."); 3821Debug.Assert(info.StringValue == null, "Haven't tried to set it yet."); 4624Debug.Assert(info == null, "Never produce a diagnostic while peeking."); 4632Debug.Assert(ch != SlidingTextWindow.InvalidCharacter, "Precondition established by all callers; required for correctness of AdvanceChar() call.");
Parser\QuickScanner.cs (1)
232Debug.Assert(state == QuickScanState.Bad || state == QuickScanState.Done, "can only exit with Bad or Done");
Parser\SyntaxParser.cs (1)
790Debug.Assert(offset == 0, "Why are we producing a missing token that has both skipped text and leading trivia?");
Symbols\AliasSymbol.cs (1)
330Debug.Assert(won, "Only one thread can win the alias target CompareExchange");
Symbols\AssemblySymbol.cs (2)
940Debug.Assert(this is SourceAssemblySymbol, 1034Debug.Assert((object)result.ContainingType == null || IsValidWellKnownType(result.ContainingType),
Symbols\BaseTypeAnalysis.cs (1)
188Debug.Assert((object)(field.AssociatedSymbol as EventSymbol) == null,
Symbols\Compilation_WellKnownMembers.cs (1)
701Debug.Assert((object)debuggableAttribute != null, "GetWellKnownType unexpectedly returned null");
Symbols\ErrorTypeSymbol.cs (1)
73Debug.Assert(ResultKind != LookupResultKind.Viable, "Shouldn't have viable result kind on error symbol");
Symbols\ExtendedErrorTypeSymbol.cs (1)
79Debug.Assert(candidateSymbols.IsEmpty || resultKind != LookupResultKind.Viable, "Shouldn't use LookupResultKind.Viable with candidate symbols");
Symbols\MemberSignatureComparer.cs (4)
394Debug.Assert(!considerExplicitlyImplementedInterfaces || considerName, "Doesn't make sense to consider interfaces separately from name."); 395Debug.Assert(!considerTypeConstraints || considerArity, "If you consider type constraints, you must also consider arity"); 406Debug.Assert((_typeComparison & TypeCompareKind.FunctionPointerRefMatchesOutInRefReadonly) == 0, 408Debug.Assert(_refKindCompareMode == RefKindCompareMode.DoNotConsiderDifferences ||
Symbols\Metadata\PE\DynamicTypeDecoder.cs (1)
173Debug.Assert(!_haveCustomModifierFlags, "This shouldn't happen during decoding.");
Symbols\Metadata\PE\PEModuleSymbol.cs (3)
770Debug.Assert(forwarder.Value.FirstIndex >= 0, "First index should never be negative"); 772Debug.Assert((object)firstSymbol != null, "Invalid indexes (out of bound) are discarded during reading metadata in PEModule.EnsureForwardTypeToAssemblyMap()"); 777Debug.Assert((object)secondSymbol != null, "Invalid indexes (out of bound) are discarded during reading metadata in PEModule.EnsureForwardTypeToAssemblyMap()");
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
99Debug.Assert(result != s_noUncommonProperties || result.IsDefaultValue(), "default value was modified");
Symbols\MethodSymbol.cs (1)
1276Debug.Assert(obsoleteData != ObsoleteAttributeData.Uninitialized, "getting synthesized attributes before attributes are decoded");
Symbols\OverriddenOrHiddenMembersHelpers.cs (1)
622Debug.Assert(memberIsFromSomeCompilation || minCustomModifierCount == int.MaxValue, "Metadata members require exact custom modifier matches.");
Symbols\Source\ParameterHelpers.cs (1)
141Debug.Assert(addRefReadOnlyModifier, "If addReadonlyRef isn't true, we must have found a different location to encode the readonlyness of a function pointer");
Symbols\Source\SourceAssemblySymbol.cs (10)
652Debug.Assert((object)compilationRelaxationsAttribute != null, "GetWellKnownType unexpectedly returned null"); 661Debug.Assert((object)runtimeCompatibilityAttribute != null, "GetWellKnownType unexpectedly returned null"); 694Debug.Assert((object)unverifiableCodeAttribute != null, "GetWellKnownType unexpectedly returned null"); 706Debug.Assert((object)securityPermissionAttribute != null, "GetWellKnownType unexpectedly returned null"); 713Debug.Assert((object)securityAction != null, "GetWellKnownType unexpectedly returned null"); 2643Debug.Assert( 2651Debug.Assert(_unusedFieldWarnings.IsDefault, "We shouldn't have computed the diagnostics if we're still noting definitions."); 2672Debug.Assert(this.HasComplete(CompletionPart.Module), 2694Debug.Assert(success, "Once CompletionPart.Module is set, no-one should be modifying the map."); 2839Debug.Assert((object)originalDefinition.ContainingType == null, "How did a nested type get forwarded?");
Symbols\Source\SourceMemberContainerSymbol.cs (2)
2657Debug.Assert(field.AssociatedSymbol is not EventSymbol, "Didn't expect to find a field-like event backing field in the member list."); 2994Debug.Assert(f.AssociatedSymbol is not EventSymbol, "Didn't expect to find a field-like event backing field in the member list.");
Symbols\Source\SourceMemberFieldSymbol.cs (2)
170Debug.Assert(!this.IsFixedSizeBuffer, "Subclasses representing fixed fields must override"); 326Debug.Assert(!this.IsFixedSizeBuffer, "Subclasses representing fixed fields must override");
Symbols\Source\SourceNamedTypeSymbol.cs (2)
90Debug.Assert(false, "bad declaration kind"); 1705Debug.Assert(obsoleteData != ObsoleteAttributeData.Uninitialized, "getting synthesized attributes before attributes are decoded");
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (2)
664Debug.Assert(GetDeclaredInterfaces(basesBeingResolved: null).IsEmpty, "Computation skipped for enums"); 716Debug.Assert((object)GetDeclaredBaseType(basesBeingResolved: null) == null, "Computation skipped for enums");
Symbols\Source\SourceOrdinaryMethodSymbol.cs (2)
645Debug.Assert(this.MethodKind != MethodKind.UserDefinedOperator, "SourceUserDefinedOperatorSymbolBase overrides this"); 700Debug.Assert(!available, "Should have been parsed as partial constructor.");
Symbols\Source\SourcePropertyAccessorSymbol.cs (1)
197Debug.Assert(!_property.IsExpressionBodied, "Cannot have accessors in expression bodied lightweight properties");
Symbols\Symbol.cs (2)
203Debug.Assert(!(this is SourceAssemblySymbol), "SourceAssemblySymbol must override DeclaringCompilation"); 206Debug.Assert(!(this is SourceModuleSymbol), "SourceModuleSymbol must override DeclaringCompilation");
Symbols\Symbol_Attributes.cs (2)
954Debug.Assert(this.ObsoleteState != ThreeState.Unknown, "ObsoleteState should be true or false now."); 955Debug.Assert(this.ExperimentalState != ThreeState.Unknown, "ExperimentalState should be true or false now.");
Symbols\SymbolCompletionState.cs (1)
106Debug.Assert(HasAtMostOneBitSet(next), "ForceComplete won't handle the result correctly if more than one bit is set.");
Symbols\Synthesized\SynthesizedContainer.cs (1)
65Debug.Assert(compilation != null, "SynthesizedClass is not contained in a source module?");
Symbols\Synthesized\SynthesizedSubstitutedTypeParameterSymbol.cs (1)
22Debug.Assert(this.TypeParameterKind == (ContainingSymbol is MethodSymbol ? TypeParameterKind.Method :
Symbols\Tuples\TupleFieldSymbol.cs (2)
47Debug.Assert(container.Equals(underlyingField.ContainingType, TypeCompareKind.IgnoreDynamicAndTupleNames) || this is TupleVirtualElementFieldSymbol, 270Debug.Assert(name != underlyingField.Name || !container.Equals(underlyingField.ContainingType, TypeCompareKind.IgnoreDynamicAndTupleNames),
Symbols\Tuples\TupleTypeSymbol.cs (1)
651Debug.Assert(fieldSymbol.Name == defaultName, "top level underlying field must match default name");
Symbols\TypeSymbol.cs (1)
102Debug.Assert(info != s_noInterfaces || info.IsDefaultValue(), "default value was modified");
Syntax\CSharpSyntaxNode.cs (1)
102Debug.Assert(existingTree == tree, "how could this node belong to a different tree?");
Syntax\InternalSyntax\CSharpSyntaxRewriter.cs (1)
57Debug.Assert(visited != null && visited.Kind != SyntaxKind.None, "Cannot remove node using Syntax.InternalSyntax.SyntaxRewriter.");
Syntax\SyntaxFactory.cs (1)
2266Debug.Assert(currentNode != null, "binding should be enclosed in a conditional access");
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (2)
92Debug.Assert(recursivePattern.Designation is not null, "If we got to this point variable designation cannot be null"); 96Debug.Assert(listPattern.Designation is not null, "If we got to this point variable designation cannot be null");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (1)
358System.Diagnostics.Debug.Assert(false, "Invalid BinaryOperatorSpacingOptions");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
106Debug.Assert(speculativeSemanticModel != null ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
101Debug.Assert(!typeName.StripRefIfNeeded().IsVar, "'var' special case should have prevented analysis of this variable.");
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (2)
144Debug.Assert(whenClauseUnused == null, "We should not have offered to convert multiple cases if any have a when clause"); 149Debug.Assert(whenClauseUnused == null, "We should not have offered to convert multiple cases if any have a when clause");
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1231Debug.Assert(propertyDeclaration?.Type != null, "Property type should never be null");
Microsoft.CodeAnalysis.CSharp.Features (10)
BraceCompletion\AbstractCurlyBraceOrBracketCompletionService.cs (1)
145Debug.Assert(desiredCaretLine.GetFirstNonWhitespacePosition() == null, "the line between the formatted braces is not empty");
ChangeSignature\CSharpChangeSignatureService.cs (1)
527Debug.Assert(false, "Unknown reference location");
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
356Debug.Assert(annotatedNodesOrTokens.Count == 1, "Only a single variable declarator should have been annotated.");
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (2)
46Debug.Assert(whenClause == null || section.Labels.Length == 1, "We shouldn't have guards when we're combining multiple cases into a single arm"); 51Debug.Assert(label.Guards.Length == 0, "We shouldn't have guards when we're combining multiple cases into a single arm");
NavigationBar\CSharpNavigationBarItemService.cs (1)
100Debug.Assert(member is IMethodSymbol { PartialDefinitionPart: null } or IPropertySymbol { PartialDefinitionPart: null } or IEventSymbol { PartialDefinitionPart: null },
src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (2)
92Debug.Assert(recursivePattern.Designation is not null, "If we got to this point variable designation cannot be null"); 96Debug.Assert(listPattern.Designation is not null, "If we got to this point variable designation cannot be null");
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (2)
144Debug.Assert(whenClauseUnused == null, "We should not have offered to convert multiple cases if any have a when clause"); 149Debug.Assert(whenClauseUnused == null, "We should not have offered to convert multiple cases if any have a when clause");
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (3)
Compilation\ReferenceManagerTests.cs (1)
840Debug.Assert(parts.Length >= 3);
DeclarationTests.cs (2)
938Debug.Assert(underlying != null); 939Debug.Assert(underlying.HasCompilationUnitRoot);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CSharpTestBase.cs (1)
2602Debug.Assert(syntaxNode is not null, "Did you forget to place /*<bind>*/ comments in your source?");
Microsoft.CodeAnalysis.CSharp.Workspaces (6)
Simplification\CSharpSimplificationService.Expander.cs (1)
1009Debug.Assert(false, "This method is used only replacing the '<' and '>' to '{' and '}' respectively");
Simplification\Reducers\CSharpExtensionMethodReducer.cs (1)
96Debug.Assert(false, "The expression kind is not MemberAccessExpression or IdentifierName or GenericName to be converted to Member Access Expression for Ext Method Reduction");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (1)
358System.Diagnostics.Debug.Assert(false, "Invalid BinaryOperatorSpacingOptions");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
106Debug.Assert(speculativeSemanticModel != null ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
101Debug.Assert(!typeName.StripRefIfNeeded().IsVar, "'var' special case should have prevented analysis of this variable.");
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1231Debug.Assert(propertyDeclaration?.Type != null, "Property type should never be null");
Microsoft.CodeAnalysis.Debugging.Package (5)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
277Debug.Assert(obj != null, "freeing null?"); 279Debug.Assert(_firstItem != obj, "freeing twice?"); 290Debug.Assert(value != obj, "freeing twice?");
Microsoft.CodeAnalysis.EditorFeatures (3)
AutomaticCompletion\BraceCompletionSessionProvider.BraceCompletionSession.cs (2)
384Debug.Assert(caretPoint.Snapshot == endPoint.Snapshot, "snapshots do not match"); 416Debug.Assert(afterBrace.HasValue, "Unable to move caret to closing point");
Tagging\AbstractAsynchronousTaggerProvider.TagSource_ProduceTags.cs (1)
463Debug.Assert(snapshot.Version.Next == null, "should be on latest snapshot");
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (6)
AbstractTypeParameterChecker.cs (1)
33Debug.Assert(false,
ExpressionEvaluatorFatalError.cs (1)
44Debug.Assert(false, "Failure checking registry key: " + ex.ToString());
FrameDecoder.cs (1)
49Debug.Assert((argumentFlags & (DkmVariableInfoFlags.Names | DkmVariableInfoFlags.Types | DkmVariableInfoFlags.Values)) == argumentFlags,
LanguageInstructionDecoder.cs (1)
40Debug.Assert((argumentFlags & (DkmVariableInfoFlags.FullNames | DkmVariableInfoFlags.Names | DkmVariableInfoFlags.Types | DkmVariableInfoFlags.CompactName)) == argumentFlags,
PDB\MethodDebugInfo.Native.cs (2)
254Debug.Assert(false, "Expected a root scope."); 333Debug.Assert(kind == ImportTargetKind.Assembly, "Programmer error: How did a non-assembly get in the extern alias list?");
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (1)
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (15)
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (4)
19/// <inheritdoc cref="Debug.Assert(bool, string)"/> 22=> Debug.Assert(condition, message); 24/// <inheritdoc cref="Debug.Assert(bool, string)"/> 72Debug.Assert(false, message);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
133Debug.Assert(false, "Unreachable");
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
277Debug.Assert(obj != null, "freeing null?"); 279Debug.Assert(_firstItem != obj, "freeing twice?"); 290Debug.Assert(value != obj, "freeing twice?");
src\ExpressionEvaluator\Core\Source\ExpressionCompiler\ExpressionEvaluatorFatalError.cs (1)
44Debug.Assert(false, "Failure checking registry key: " + ex.ToString());
src\ExpressionEvaluator\Core\Source\ResultProvider\Formatter.TypeNames.cs (2)
106Debug.Assert(nullableCount < 2, "Benign: someone is nesting nullables."); 108Debug.Assert(pointerCount == 0 || nullableCount == 0, "Benign: pointer to nullable?");
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\TypeAndCustomInfo.cs (1)
38Debug.Assert(!t.IsByRef, "double byref type?");
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\TypeHelpers.cs (1)
521Debug.Assert((underlyingType.BaseType != null) || underlyingType.IsPointer || underlyingType.IsArray, "BaseType should only return null if the underlyingType is a pointer or array.");
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (26)
Debugger\Engine\DkmClrValue.cs (2)
229Debug.Assert(rawValue != null || this.Type.GetLmrType().IsVoid(), "In our mock system, this should only happen for void."); 238Debug.Assert(!this.IsNull, "Not supported by VIL");
Debugger\MemberInfo\AssemblyImpl.cs (1)
27Debug.Assert(Assembly.GetReferencedAssemblies().Length == 0, "If this fires, we have to actually implement this method.");
Debugger\MemberInfo\ConstructorInfoImpl.cs (1)
143Debug.Assert(binder == null, "NYI");
Debugger\MemberInfo\PropertyInfoImpl.cs (3)
129Debug.Assert(binder == null, "NYI"); 130Debug.Assert(index == null, "NYI"); 131Debug.Assert(culture == null, "NYI");
Debugger\MemberInfo\TypeImpl.cs (4)
390Debug.Assert(binder == null, "NYI"); 391Debug.Assert(returnType == null, "NYI"); 392Debug.Assert(types == null, "NYI"); 393Debug.Assert(modifiers == null, "NYI");
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (4)
19/// <inheritdoc cref="Debug.Assert(bool, string)"/> 22=> Debug.Assert(condition, message); 24/// <inheritdoc cref="Debug.Assert(bool, string)"/> 72Debug.Assert(false, message);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
133Debug.Assert(false, "Unreachable");
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
277Debug.Assert(obj != null, "freeing null?"); 279Debug.Assert(_firstItem != obj, "freeing twice?"); 290Debug.Assert(value != obj, "freeing twice?");
src\ExpressionEvaluator\Core\Source\ExpressionCompiler\ExpressionEvaluatorFatalError.cs (1)
44Debug.Assert(false, "Failure checking registry key: " + ex.ToString());
src\ExpressionEvaluator\Core\Source\ResultProvider\Formatter.TypeNames.cs (2)
106Debug.Assert(nullableCount < 2, "Benign: someone is nesting nullables."); 108Debug.Assert(pointerCount == 0 || nullableCount == 0, "Benign: pointer to nullable?");
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\TypeAndCustomInfo.cs (1)
38Debug.Assert(!t.IsByRef, "double byref type?");
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\TypeHelpers.cs (1)
521Debug.Assert((underlyingType.BaseType != null) || underlyingType.IsPointer || underlyingType.IsArray, "BaseType should only return null if the underlyingType is a pointer or array.");
Microsoft.CodeAnalysis.Extensions.Package (31)
src\Dependencies\Collections\Internal\ArraySortHelper.cs (3)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\Dependencies\Collections\Internal\HashHelpers.cs (1)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\Dependencies\Collections\Segmented\SegmentedArray.cs (1)
491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (10)
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
277Debug.Assert(obj != null, "freeing null?"); 279Debug.Assert(_firstItem != obj, "freeing twice?"); 290Debug.Assert(value != obj, "freeing twice?");
Microsoft.CodeAnalysis.ExternalAccess.FSharp (1)
SignatureHelp\FSharpSignatureHelpItems.cs (1)
96Debug.Assert(selectedItem.Value >= 0, "actual item was not part of the final list");
Microsoft.CodeAnalysis.Features (10)
ChangeSignature\AbstractChangeSignatureService.cs (1)
450Debug.Assert(false, "Change Signature: Attempted to modify node twice with different semantic parameters.");
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
521Debug.Assert(containingType != null,
DocumentationComments\AbstractDocumentationCommentSnippetService.cs (1)
449Debug.Assert(trimmedPreviousLine.StartsWith(ExteriorTriviaText), "Unexpected: previous line does not begin with doc comment exterior trivia.");
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
6662Debug.Assert(!self.FullSpan.Contains(position), "Position is valid. How could we not find a child?");
ExtractInterface\AbstractExtractInterfaceService.cs (1)
416Debug.Assert(false, string.Format(FeaturesResources.Unexpected_interface_member_kind_colon_0, member.Kind.ToString()));
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
144Debug.Assert(false, "How?");
Shared\Utilities\ExtractTypeHelpers.cs (1)
221Debug.Assert(false, string.Format(FeaturesResources.Unexpected_interface_member_kind_colon_0, member.Kind.ToString()));
SignatureHelp\SignatureHelpItems.cs (1)
91Debug.Assert(selectedItem.Value >= 0, "actual item was not part of the final list");
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (1)
97Debug.Assert(false, "All conflict markers should start at the beginning of a line.");
Wrapping\BinaryExpression\AbstractBinaryExpressionWrapper.cs (1)
75Debug.Assert(exprsAndOperators.Length % 2 == 1, "Should have odd number of exprs and operators");
Microsoft.CodeAnalysis.Features.Test.Utilities (4)
EditAndContinue\SyntaxMapDescription.cs (4)
21Debug.Assert(match != null, "Must be created from edit script"); 22Debug.Assert(index < Spans.Length, $"Marker <N:{index}> not present in new source"); 29Debug.Assert(match != null, "Must be created from edit script"); 30Debug.Assert(index < newSpans.Length, $"Marker <S:{index}> not present in new source");
Microsoft.CodeAnalysis.InteractiveHost (35)
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (4)
19/// <inheritdoc cref="Debug.Assert(bool, string)"/> 22=> Debug.Assert(condition, message); 24/// <inheritdoc cref="Debug.Assert(bool, string)"/> 72Debug.Assert(false, message);
src\Dependencies\Collections\Internal\ArraySortHelper.cs (3)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\Dependencies\Collections\Internal\HashHelpers.cs (1)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\Dependencies\Collections\Segmented\SegmentedArray.cs (1)
491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (10)
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
277Debug.Assert(obj != null, "freeing null?"); 279Debug.Assert(_firstItem != obj, "freeing twice?"); 290Debug.Assert(value != obj, "freeing twice?");
Microsoft.CodeAnalysis.LanguageServer (1)
WindowsErrorReporting.cs (1)
23Debug.Assert(GetErrorMode() == (oldErrorMode & ErrorModes.SEM_NOALIGNMENTFAULTEXCEPT));
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Handler\Diagnostics\DiagnosticSourceProviders\DiagnosticSourceManager.cs (1)
109Debug.Assert(sources.All(s => s.IsLiveSource()), "All document sources should be live");
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\RequestExecutionQueue.cs (1)
366Debug.Assert(!concurrentlyExecutingTasks.Any(t => !t.Key.IsCompleted), "The tasks should have all been drained before continuing");
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (59)
src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (2)
280Debug.Assert(_value is V, "Item must be a a V"); 315Debug.Assert(_value is V, "_value must be a V");
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (4)
19/// <inheritdoc cref="Debug.Assert(bool, string)"/> 22=> Debug.Assert(condition, message); 24/// <inheritdoc cref="Debug.Assert(bool, string)"/> 72Debug.Assert(false, message);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
133Debug.Assert(false, "Unreachable");
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
85Debug.Assert(false, message);
src\Dependencies\Collections\Internal\ArraySortHelper.cs (3)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\Dependencies\Collections\Internal\HashHelpers.cs (1)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\Dependencies\Collections\Segmented\SegmentedArray.cs (1)
491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (10)
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
277Debug.Assert(obj != null, "freeing null?"); 279Debug.Assert(_firstItem != obj, "freeing twice?"); 290Debug.Assert(value != obj, "freeing twice?");
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
321Debug.Assert(operation.Kind is OperationKind.None or OperationKind.Attribute, $"Unexpected root operation kind: {operation.Kind}");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (8)
85Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 89Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 98Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 107Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 117Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 121Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 147Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 153Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (1)
76Debug.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");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
416Debug.Assert(s_serializationVersion == 5, "After increasing the serialization version, add an upgrade path here.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (2)
185Debug.Assert(value == null || !value.GetType().GetTypeInfo().IsEnum, "Enum should not be written with WriteValue. Write them as ints instead."); 195Debug.Assert(!typeInfo.IsEnum, "Enums should not be written with WriteObject. Write them out as integers instead.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
1166Debug.Assert(parameter1.HasExplicitDefaultValue, "Expected all unspecified parameter to have default values");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (4)
492Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 499Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 532Debug.Assert(_completionRefCount == 0, $"Expected {nameof(_completionRefCount)} == 0, got {_completionRefCount}"); 560Debug.Assert(taskSet, "Complete should only be called once.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (1)
33Debug.Assert(span.Start >= start, "Bad generator.");
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
192Debug.Assert(false, message + ". " + diagnostics);
Microsoft.CodeAnalysis.PooledObjects.Package (5)
ObjectPool`1.cs (3)
277Debug.Assert(obj != null, "freeing null?"); 279Debug.Assert(_firstItem != obj, "freeing twice?"); 290Debug.Assert(value != obj, "freeing twice?");
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
Microsoft.CodeAnalysis.PublicApiAnalyzers (59)
DeclarePublicApiAnalyzer.Impl.cs (1)
494Debug.Assert(false, ex.Message);
src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (2)
280Debug.Assert(_value is V, "Item must be a a V"); 315Debug.Assert(_value is V, "_value must be a V");
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (4)
19/// <inheritdoc cref="Debug.Assert(bool, string)"/> 22=> Debug.Assert(condition, message); 24/// <inheritdoc cref="Debug.Assert(bool, string)"/> 72Debug.Assert(false, message);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
133Debug.Assert(false, "Unreachable");
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
85Debug.Assert(false, message);
src\Dependencies\Collections\Internal\ArraySortHelper.cs (3)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\Dependencies\Collections\Internal\HashHelpers.cs (1)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\Dependencies\Collections\Segmented\SegmentedArray.cs (1)
491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (10)
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
277Debug.Assert(obj != null, "freeing null?"); 279Debug.Assert(_firstItem != obj, "freeing twice?"); 290Debug.Assert(value != obj, "freeing twice?");
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
321Debug.Assert(operation.Kind is OperationKind.None or OperationKind.Attribute, $"Unexpected root operation kind: {operation.Kind}");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (8)
85Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 89Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 98Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 107Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 117Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 121Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 147Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 153Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (1)
76Debug.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");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
416Debug.Assert(s_serializationVersion == 5, "After increasing the serialization version, add an upgrade path here.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (2)
185Debug.Assert(value == null || !value.GetType().GetTypeInfo().IsEnum, "Enum should not be written with WriteValue. Write them as ints instead."); 195Debug.Assert(!typeInfo.IsEnum, "Enums should not be written with WriteObject. Write them out as integers instead.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
1166Debug.Assert(parameter1.HasExplicitDefaultValue, "Expected all unspecified parameter to have default values");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (4)
492Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 499Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 532Debug.Assert(_completionRefCount == 0, $"Expected {nameof(_completionRefCount)} == 0, got {_completionRefCount}"); 560Debug.Assert(taskSet, "Complete should only be called once.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (1)
33Debug.Assert(span.Start >= start, "Bad generator.");
Microsoft.CodeAnalysis.ResxSourceGenerator (58)
src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (2)
280Debug.Assert(_value is V, "Item must be a a V"); 315Debug.Assert(_value is V, "_value must be a V");
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (4)
19/// <inheritdoc cref="Debug.Assert(bool, string)"/> 22=> Debug.Assert(condition, message); 24/// <inheritdoc cref="Debug.Assert(bool, string)"/> 72Debug.Assert(false, message);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
133Debug.Assert(false, "Unreachable");
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
85Debug.Assert(false, message);
src\Dependencies\Collections\Internal\ArraySortHelper.cs (3)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\Dependencies\Collections\Internal\HashHelpers.cs (1)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\Dependencies\Collections\Segmented\SegmentedArray.cs (1)
491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (10)
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
277Debug.Assert(obj != null, "freeing null?"); 279Debug.Assert(_firstItem != obj, "freeing twice?"); 290Debug.Assert(value != obj, "freeing twice?");
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
321Debug.Assert(operation.Kind is OperationKind.None or OperationKind.Attribute, $"Unexpected root operation kind: {operation.Kind}");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (8)
85Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 89Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 98Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 107Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 117Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 121Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 147Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 153Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (1)
76Debug.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");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
416Debug.Assert(s_serializationVersion == 5, "After increasing the serialization version, add an upgrade path here.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (2)
185Debug.Assert(value == null || !value.GetType().GetTypeInfo().IsEnum, "Enum should not be written with WriteValue. Write them as ints instead."); 195Debug.Assert(!typeInfo.IsEnum, "Enums should not be written with WriteObject. Write them out as integers instead.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
1166Debug.Assert(parameter1.HasExplicitDefaultValue, "Expected all unspecified parameter to have default values");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (4)
492Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 499Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 532Debug.Assert(_completionRefCount == 0, $"Expected {nameof(_completionRefCount)} == 0, got {_completionRefCount}"); 560Debug.Assert(taskSet, "Complete should only be called once.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (1)
33Debug.Assert(span.Start >= start, "Bad generator.");
Microsoft.CodeAnalysis.Test.Utilities (1)
Platform\Desktop\RuntimeAssemblyManager.cs (1)
377Debug.Assert(entryPoint != null, "Attempting to execute an assembly that has no entrypoint; is your test trying to execute a DLL?");
Microsoft.CodeAnalysis.Threading.Package (31)
src\Dependencies\Collections\Internal\ArraySortHelper.cs (3)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\Dependencies\Collections\Internal\HashHelpers.cs (1)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\Dependencies\Collections\Segmented\SegmentedArray.cs (1)
491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (10)
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
277Debug.Assert(obj != null, "freeing null?"); 279Debug.Assert(_firstItem != obj, "freeing twice?"); 290Debug.Assert(value != obj, "freeing twice?");
Microsoft.CodeAnalysis.UnitTests (3)
Collections\List\TestBase.Generic.cs (3)
111Debug.Assert(numberOfDuplicateElements == 0, "Can not create a HashSet with duplicate elements - numberOfDuplicateElements must be zero"); 116Debug.Assert(numberOfDuplicateElements == 0, "Can not create a SortedSet with duplicate elements - numberOfDuplicateElements must be zero"); 123Debug.Assert(false, "Check that the 'EnumerableType' Enum returns only types that are special-cased in the CreateEnumerable function within the Iset_Generic_Tests class");
Microsoft.CodeAnalysis.VisualBasic (457)
BoundTree\BoundTypeOrValueExpression.vb (2)
45Debug.Assert(valueExpression IsNot Nothing, "Field 'valueExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 46Debug.Assert(typeExpression IsNot Nothing, "Field 'typeExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
Compilation\DocumentationComments\DocumentationCommentCompiler.Namespace.vb (1)
50Debug.Assert(Not Me._isForSingleSymbol, "Do not expect a doc comment query for a single namespace")
Compilation\DocumentationComments\DocWriter.vb (2)
108Debug.Assert(Me._indentDepth = t.InitialIndentDepth, 129Debug.Assert(False, "Didn't expect nesting to reach depth " & depth)
Generated\BoundNodes.xml.Generated.vb (427)
225Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 233Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 294Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 301Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 313Debug.Assert(underlyingLValue IsNot Nothing, "Field 'underlyingLValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 314Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 353Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 360Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 372Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 379Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 391Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 398Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 424Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 431Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 457Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 469Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 497Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 509Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 573Debug.Assert(Not (symbols.IsDefault), "Field 'symbols' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 574Debug.Assert(Not (childBoundNodes.IsDefault), "Field 'childBoundNodes' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 629Debug.Assert(Not (childBoundNodes.IsDefault), "Field 'childBoundNodes' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 663Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 702Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 744Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 745Debug.Assert(Not (indices.IsDefault), "Field 'indices' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 746Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 801Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 802Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 836Debug.Assert(sourceType IsNot Nothing, "Field 'sourceType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 837Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 879Debug.Assert(field IsNot Nothing, "Field 'field' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 880Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 888Debug.Assert(field IsNot Nothing, "Field 'field' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 889Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 923Debug.Assert(method IsNot Nothing, "Field 'method' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 924Debug.Assert(getMethodFromHandle IsNot Nothing, "Field 'getMethodFromHandle' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 925Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 934Debug.Assert(method IsNot Nothing, "Field 'method' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 935Debug.Assert(getMethodFromHandle IsNot Nothing, "Field 'getMethodFromHandle' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 936Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 978Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1020Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1028Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1062Debug.Assert(namespaceSymbol IsNot Nothing, "Field 'namespaceSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1117Debug.Assert(method IsNot Nothing, "Field 'method' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1118Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1126Debug.Assert(method IsNot Nothing, "Field 'method' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1127Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1161Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1168Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1194Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1203Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1245Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1253Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1287Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1294Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1320Debug.Assert(document IsNot Nothing, "Field 'document' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1321Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1329Debug.Assert(document IsNot Nothing, "Field 'document' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1330Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1364Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1365Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1428Debug.Assert(underlyingExpression IsNot Nothing, "Field 'underlyingExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1429Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1476Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1477Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1516Debug.Assert(left IsNot Nothing, "Field 'left' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1517Debug.Assert(right IsNot Nothing, "Field 'right' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1518Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1589Debug.Assert(underlyingExpression IsNot Nothing, "Field 'underlyingExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1590Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1645Debug.Assert(bitwiseOperator IsNot Nothing, "Field 'bitwiseOperator' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1646Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1709Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1716Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1742Debug.Assert(left IsNot Nothing, "Field 'left' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1743Debug.Assert(right IsNot Nothing, "Field 'right' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1744Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1807Debug.Assert(byRefLocal IsNot Nothing, "Field 'byRefLocal' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1808Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1863Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1864Debug.Assert(methodGroup IsNot Nothing, "Field 'methodGroup' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1914Debug.Assert(condition IsNot Nothing, "Field 'condition' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1915Debug.Assert(whenTrue IsNot Nothing, "Field 'whenTrue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1916Debug.Assert(whenFalse IsNot Nothing, "Field 'whenFalse' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1917Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1980Debug.Assert(testExpression IsNot Nothing, "Field 'testExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1981Debug.Assert(elseExpression IsNot Nothing, "Field 'elseExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1982Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2053Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2060Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2072Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2073Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2165Debug.Assert(lambda IsNot Nothing, "Field 'lambda' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2207Debug.Assert(Not (elementPlaceholders.IsDefault), "Field 'elementPlaceholders' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2208Debug.Assert(Not (convertedElements.IsDefault), "Field 'convertedElements' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2255Debug.Assert(underlyingExpression IsNot Nothing, "Field 'underlyingExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2256Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2303Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2304Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2375Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2376Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2439Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2440Debug.Assert(targetType IsNot Nothing, "Field 'targetType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2441Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2535Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2669Debug.Assert(Not (methods.IsDefault), "Field 'methods' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2727Debug.Assert(Not (properties.IsDefault), "Field 'properties' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2821Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2891Debug.Assert(Not (clauses.IsDefault), "Field 'clauses' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2925Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2926Debug.Assert(Not (indices.IsDefault), "Field 'indices' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2989Debug.Assert(Not (clauses.IsDefault), "Field 'clauses' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3023Debug.Assert(method IsNot Nothing, "Field 'method' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3024Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3025Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3120Debug.Assert(Not (constructorArguments.IsDefault), "Field 'constructorArguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3121Debug.Assert(Not (namedArguments.IsDefault), "Field 'namedArguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3122Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3188Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3259Debug.Assert(member IsNot Nothing, "Field 'member' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3260Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3331Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3332Debug.Assert(memberAccess IsNot Nothing, "Field 'memberAccess' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3374Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3394Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3444Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3445Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3479Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3504Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3505Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3568Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3602Debug.Assert(Not (declarations.IsDefault), "Field 'declarations' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3603Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3653Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3662Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3704Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3705Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3747Debug.Assert(Not (initializers.IsDefault), "Field 'initializers' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3775Debug.Assert(Not (initializers.IsDefault), "Field 'initializers' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3814Debug.Assert(Not (initializers.IsDefault), "Field 'initializers' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3845Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3876Debug.Assert(method IsNot Nothing, "Field 'method' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3877Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3943Debug.Assert(Not (bounds.IsDefault), "Field 'bounds' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3944Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4015Debug.Assert(inferredType IsNot Nothing, "Field 'inferredType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4016Debug.Assert(Not (bounds.IsDefault), "Field 'bounds' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4017Debug.Assert(initializer IsNot Nothing, "Field 'initializer' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4018Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4092Debug.Assert(Not (initializers.IsDefault), "Field 'initializers' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4126Debug.Assert(fieldSymbol IsNot Nothing, "Field 'fieldSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4127Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4198Debug.Assert(propertySymbol IsNot Nothing, "Field 'propertySymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4199Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4200Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4295Debug.Assert(eventSymbol IsNot Nothing, "Field 'eventSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4296Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4338Debug.Assert(Not (locals.IsDefault), "Field 'locals' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4339Debug.Assert(Not (statements.IsDefault), "Field 'statements' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4389Debug.Assert(Not (fields.IsDefault), "Field 'fields' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4390Debug.Assert(statement IsNot Nothing, "Field 'statement' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4445Debug.Assert(localSymbol IsNot Nothing, "Field 'localSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4508Debug.Assert(Not (localDeclarations.IsDefault), "Field 'localDeclarations' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4509Debug.Assert(initializer IsNot Nothing, "Field 'initializer' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4510Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4560Debug.Assert(Not (localDeclarations.IsDefault), "Field 'localDeclarations' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4628Debug.Assert(initialValue IsNot Nothing, "Field 'initialValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4664Debug.Assert(Not (initializedFields.IsDefault), "Field 'initializedFields' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4665Debug.Assert(initialValue IsNot Nothing, "Field 'initialValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4699Debug.Assert(Not (initializedProperties.IsDefault), "Field 'initializedProperties' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4700Debug.Assert(initialValue IsNot Nothing, "Field 'initialValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4734Debug.Assert(parameter IsNot Nothing, "Field 'parameter' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4735Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4777Debug.Assert(statement IsNot Nothing, "Field 'statement' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4811Debug.Assert(Not (locals.IsDefault), "Field 'locals' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4812Debug.Assert(Not (sideEffects.IsDefault), "Field 'sideEffects' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4813Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4868Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4902Debug.Assert(condition IsNot Nothing, "Field 'condition' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4903Debug.Assert(consequence IsNot Nothing, "Field 'consequence' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4953Debug.Assert(expressionStatement IsNot Nothing, "Field 'expressionStatement' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4954Debug.Assert(Not (caseBlocks.IsDefault), "Field 'caseBlocks' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4955Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5021Debug.Assert(caseStatement IsNot Nothing, "Field 'caseStatement' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5022Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5064Debug.Assert(Not (caseClauses.IsDefault), "Field 'caseClauses' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5268Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5269Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5278Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5279Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5307Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5308Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5309Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5375Debug.Assert(condition IsNot Nothing, "Field 'condition' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5376Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5377Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5378Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5420Debug.Assert(controlVariable IsNot Nothing, "Field 'controlVariable' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5421Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5422Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5423Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5467Debug.Assert(leftOperandPlaceholder IsNot Nothing, "Field 'leftOperandPlaceholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5468Debug.Assert(rightOperandPlaceholder IsNot Nothing, "Field 'rightOperandPlaceholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5469Debug.Assert(addition IsNot Nothing, "Field 'addition' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5470Debug.Assert(subtraction IsNot Nothing, "Field 'subtraction' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5471Debug.Assert(lessThanOrEqual IsNot Nothing, "Field 'lessThanOrEqual' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5472Debug.Assert(greaterThanOrEqual IsNot Nothing, "Field 'greaterThanOrEqual' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5551Debug.Assert(initialValue IsNot Nothing, "Field 'initialValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5552Debug.Assert(limitValue IsNot Nothing, "Field 'limitValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5553Debug.Assert(stepValue IsNot Nothing, "Field 'stepValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5554Debug.Assert(controlVariable IsNot Nothing, "Field 'controlVariable' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5555Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5556Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5557Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5623Debug.Assert(collection IsNot Nothing, "Field 'collection' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5624Debug.Assert(enumeratorInfo IsNot Nothing, "Field 'enumeratorInfo' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5625Debug.Assert(controlVariable IsNot Nothing, "Field 'controlVariable' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5626Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5627Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5628Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5670Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5678Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5712Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5720Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5754Debug.Assert(tryBlock IsNot Nothing, "Field 'tryBlock' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5755Debug.Assert(Not (catchBlocks.IsDefault), "Field 'catchBlocks' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5813Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5887Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5900Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5936Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5943Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5969Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5981Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6009Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6016Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6042Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6049Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6075Debug.Assert(sourceType IsNot Nothing, "Field 'sourceType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6076Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6084Debug.Assert(sourceType IsNot Nothing, "Field 'sourceType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6085Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6119Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6126Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6152Debug.Assert(localSymbol IsNot Nothing, "Field 'localSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6153Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6167Debug.Assert(localSymbol IsNot Nothing, "Field 'localSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6168Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6212Debug.Assert(localSymbol IsNot Nothing, "Field 'localSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6213Debug.Assert(emitExpressions IsNot Nothing, "Field 'emitExpressions' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6214Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6229Debug.Assert(localSymbol IsNot Nothing, "Field 'localSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6230Debug.Assert(emitExpressions IsNot Nothing, "Field 'emitExpressions' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6231Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6283Debug.Assert(parameterSymbol IsNot Nothing, "Field 'parameterSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6284Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6294Debug.Assert(parameterSymbol IsNot Nothing, "Field 'parameterSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6295Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6345Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6353Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6387Debug.Assert(originalArgument IsNot Nothing, "Field 'originalArgument' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6388Debug.Assert(inConversion IsNot Nothing, "Field 'inConversion' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6389Debug.Assert(inPlaceholder IsNot Nothing, "Field 'inPlaceholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6390Debug.Assert(outConversion IsNot Nothing, "Field 'outConversion' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6391Debug.Assert(outPlaceholder IsNot Nothing, "Field 'outPlaceholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6462Debug.Assert(originalArgument IsNot Nothing, "Field 'originalArgument' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6463Debug.Assert(localSymbol IsNot Nothing, "Field 'localSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6510Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6518Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6552Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6560Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6594Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6636Debug.Assert(Not (statements.IsDefault), "Field 'statements' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6670Debug.Assert(condition IsNot Nothing, "Field 'condition' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6671Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6721Debug.Assert(originalExpression IsNot Nothing, "Field 'originalExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6722Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6723Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6773Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6774Debug.Assert(Not (parameters.IsDefault), "Field 'parameters' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6775Debug.Assert(bindingCache IsNot Nothing, "Field 'bindingCache' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6792Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6793Debug.Assert(Not (parameters.IsDefault), "Field 'parameters' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6794Debug.Assert(bindingCache IsNot Nothing, "Field 'bindingCache' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6862Debug.Assert(lambdaSymbol IsNot Nothing, "Field 'lambdaSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6863Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6942Debug.Assert(lastOperator IsNot Nothing, "Field 'lastOperator' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6943Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6977Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6984Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6996Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6997Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7031Debug.Assert(conversionCall IsNot Nothing, "Field 'conversionCall' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7032Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7066Debug.Assert(Not (rangeVariables.IsDefault), "Field 'rangeVariables' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7067Debug.Assert(compoundVariableType IsNot Nothing, "Field 'compoundVariableType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7068Debug.Assert(Not (binders.IsDefault), "Field 'binders' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7069Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7079Debug.Assert(Not (rangeVariables.IsDefault), "Field 'rangeVariables' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7080Debug.Assert(compoundVariableType IsNot Nothing, "Field 'compoundVariableType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7081Debug.Assert(Not (binders.IsDefault), "Field 'binders' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7082Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7118Debug.Assert(source IsNot Nothing, "Field 'source' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7119Debug.Assert(Not (rangeVariables.IsDefault), "Field 'rangeVariables' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7120Debug.Assert(compoundVariableType IsNot Nothing, "Field 'compoundVariableType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7121Debug.Assert(Not (binders.IsDefault), "Field 'binders' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7122Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7169Debug.Assert(underlyingExpression IsNot Nothing, "Field 'underlyingExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7170Debug.Assert(Not (rangeVariables.IsDefault), "Field 'rangeVariables' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7171Debug.Assert(compoundVariableType IsNot Nothing, "Field 'compoundVariableType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7172Debug.Assert(Not (binders.IsDefault), "Field 'binders' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7173Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7207Debug.Assert(underlyingExpression IsNot Nothing, "Field 'underlyingExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7208Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7242Debug.Assert(lambdaSymbol IsNot Nothing, "Field 'lambdaSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7243Debug.Assert(Not (rangeVariables.IsDefault), "Field 'rangeVariables' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7244Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7302Debug.Assert(rangeVariable IsNot Nothing, "Field 'rangeVariable' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7303Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7304Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7346Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7347Debug.Assert(Not (parameters.IsDefault), "Field 'parameters' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7348Debug.Assert(compilation IsNot Nothing, "Field 'compilation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7358Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7359Debug.Assert(Not (parameters.IsDefault), "Field 'parameters' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7360Debug.Assert(compilation IsNot Nothing, "Field 'compilation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7410Debug.Assert(underlyingExpression IsNot Nothing, "Field 'underlyingExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7411Debug.Assert(Not (rangeVariables.IsDefault), "Field 'rangeVariables' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7412Debug.Assert(compoundVariableType IsNot Nothing, "Field 'compoundVariableType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7413Debug.Assert(Not (binders.IsDefault), "Field 'binders' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7414Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7464Debug.Assert(group IsNot Nothing, "Field 'group' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7465Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7499Debug.Assert(rangeVariable IsNot Nothing, "Field 'rangeVariable' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7500Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7508Debug.Assert(rangeVariable IsNot Nothing, "Field 'rangeVariable' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7509Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7543Debug.Assert(eventAccess IsNot Nothing, "Field 'eventAccess' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7544Debug.Assert(handler IsNot Nothing, "Field 'handler' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7572Debug.Assert(eventAccess IsNot Nothing, "Field 'eventAccess' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7573Debug.Assert(handler IsNot Nothing, "Field 'handler' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7599Debug.Assert(eventAccess IsNot Nothing, "Field 'eventAccess' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7600Debug.Assert(handler IsNot Nothing, "Field 'handler' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7626Debug.Assert(eventSymbol IsNot Nothing, "Field 'eventSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7627Debug.Assert(eventInvocation IsNot Nothing, "Field 'eventInvocation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7669Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7670Debug.Assert(usingInfo IsNot Nothing, "Field 'usingInfo' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7671Debug.Assert(Not (locals.IsDefault), "Field 'locals' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7737Debug.Assert(lockExpression IsNot Nothing, "Field 'lockExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7738Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7780Debug.Assert(xmlNamespace IsNot Nothing, "Field 'xmlNamespace' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7781Debug.Assert(localName IsNot Nothing, "Field 'localName' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7782Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7783Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7833Debug.Assert(xmlNamespace IsNot Nothing, "Field 'xmlNamespace' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7834Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7835Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7877Debug.Assert(declaration IsNot Nothing, "Field 'declaration' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7878Debug.Assert(Not (childNodes.IsDefault), "Field 'childNodes' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7879Debug.Assert(rewriterInfo IsNot Nothing, "Field 'rewriterInfo' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7880Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7930Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7931Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7989Debug.Assert(target IsNot Nothing, "Field 'target' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7990Debug.Assert(data IsNot Nothing, "Field 'data' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7991Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7992Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8042Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8043Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8044Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8086Debug.Assert(name IsNot Nothing, "Field 'name' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8087Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8088Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8089Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8152Debug.Assert(argument IsNot Nothing, "Field 'argument' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8153Debug.Assert(Not (childNodes.IsDefault), "Field 'childNodes' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8154Debug.Assert(rewriterInfo IsNot Nothing, "Field 'rewriterInfo' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8155Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8205Debug.Assert(memberAccess IsNot Nothing, "Field 'memberAccess' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8206Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8240Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8241Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8275Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8276Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8277Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8423Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8494Debug.Assert(activeHandlerLocal IsNot Nothing, "Field 'activeHandlerLocal' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8495Debug.Assert(resumeTargetLocal IsNot Nothing, "Field 'resumeTargetLocal' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8496Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8543Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8544Debug.Assert(Not (jumps.IsDefault), "Field 'jumps' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8591Debug.Assert(resumeTargetTemporary IsNot Nothing, "Field 'resumeTargetTemporary' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8592Debug.Assert(resumeLabel IsNot Nothing, "Field 'resumeLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8593Debug.Assert(resumeNextLabel IsNot Nothing, "Field 'resumeNextLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8594Debug.Assert(Not (jumps.IsDefault), "Field 'jumps' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8657Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8658Debug.Assert(awaitableInstancePlaceholder IsNot Nothing, "Field 'awaitableInstancePlaceholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8659Debug.Assert(getAwaiter IsNot Nothing, "Field 'getAwaiter' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8660Debug.Assert(awaiterInstancePlaceholder IsNot Nothing, "Field 'awaiterInstancePlaceholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8661Debug.Assert(isCompleted IsNot Nothing, "Field 'isCompleted' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8662Debug.Assert(getResult IsNot Nothing, "Field 'getResult' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8663Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8742Debug.Assert(Not (locals.IsDefault), "Field 'locals' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8743Debug.Assert(Not (spillFields.IsDefault), "Field 'spillFields' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8744Debug.Assert(Not (statements.IsDefault), "Field 'statements' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8843Debug.Assert(original IsNot Nothing, "Field 'original' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8844Debug.Assert(start IsNot Nothing, "Field 'start' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8845Debug.Assert(source IsNot Nothing, "Field 'source' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8846Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8909Debug.Assert(receiver IsNot Nothing, "Field 'receiver' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8910Debug.Assert(placeholder IsNot Nothing, "Field 'placeholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8911Debug.Assert(accessExpression IsNot Nothing, "Field 'accessExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8961Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8975Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9019Debug.Assert(receiver IsNot Nothing, "Field 'receiver' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9020Debug.Assert(whenNotNull IsNot Nothing, "Field 'whenNotNull' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9021Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9092Debug.Assert(valueTypeReceiver IsNot Nothing, "Field 'valueTypeReceiver' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9093Debug.Assert(referenceTypeReceiver IsNot Nothing, "Field 'referenceTypeReceiver' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9094Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9141Debug.Assert(argument IsNot Nothing, "Field 'argument' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9142Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9189Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9190Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9229Debug.Assert(Not (contents.IsDefault), "Field 'contents' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9230Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9277Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter.vb (4)
331Debug.Assert(Not p.IsByRef, "DiagnosticsPass should have reported an error") 353Debug.Assert(node.WasCompilerGenerated OrElse node.IsSingleLine, 585Debug.Assert(initializer.CreateTemporaryLocalForInitialization, 616Debug.Assert(Not BoundNodeFinder.ContainsNode(right, initializer.PlaceholderOpt, _recursionDepth, convertInsufficientExecutionStackExceptionToCancelledByStackGuardException:=True), "Should be addressed in DiagnosticsPass")
Lowering\LambdaRewriter\LambdaRewriter.Analysis.vb (1)
540Debug.Assert(False, "should not have nodes like this")
Lowering\LocalRewriter\LocalRewriter_AddRemoveHandler.vb (2)
198Debug.Assert(False, "All event accesses should be handled by AddHandler/RemoveHandler/RaiseEvent.") 252Debug.Assert(node.Kind = BoundKind.Parenthesized, "node can only be EventAccess or Parenthesized")
Lowering\LocalRewriter\LocalRewriter_AssignmentOperator.vb (1)
216Debug.Assert(backingField IsNot Nothing, "autoproperty must have a backing field")
Lowering\LocalRewriter\LocalRewriter_Call.vb (1)
17Debug.Assert(Not node.IsConstant, "Constant calls should become literals by now")
Lowering\LocalRewriter\LocalRewriter_LateInvocation.vb (1)
20Debug.Assert(node.Member IsNot Nothing, "late invocation always has a member that is invoked")
Lowering\LocalRewriter\LocalRewriter_RaiseEvent.vb (1)
121Debug.Assert(getOrCreateMethod IsNot Nothing, "Checked during initial binding")
Lowering\LocalRewriter\LocalRewriter_Throw.vb (1)
23Debug.Assert(node.Syntax.Kind = SyntaxKind.ErrorStatement, "Must be an Error statement.")
Semantics\OverloadResolution.vb (1)
2884Debug.Assert(False, "Should not reach this line.")
Semantics\TypeInference\TypeInferenceCollection.vb (9)
190Debug.Assert(numberOfStrictCandidates = 0, "code logic error: since every strict candidate is also an unstrict candidate.") 197Debug.Assert(numberOfUnstrictCandidates > 1, "code logic error: we should already have covered this case") 211Debug.Assert(numberOfStrictCandidates > 1, "code logic error: we should have >1 widening candidates; all other possibilities have already been covered") 251Debug.Assert(False, "How can a typeless hint be a candidate?") 392Debug.Assert(False, "unexpected: how can there be multiple strict candidates and no widest ones??? please tell lwischik if you find such a case.") 424Debug.Assert(RequiredConversion.Count = 8, "If you've updated the type argument inference restrictions, then please also update CheckHintSatisfaction()") 535Debug.Assert(False, "code logic error: inferenceRestrictions; we should have dealt with all of them already") 548Debug.Assert(False, "code logic error: ConversionClass; we should have dealt with them already") 593Debug.Assert(Not foundInList, "List is supposed to be unique: how can we already find two of the same type in this list.")
Symbols\Source\OverrideHidingHelper.vb (2)
504Debug.Assert(False, String.Format("Unexpected method kind '{0}'", DirectCast(sym, MethodSymbol).MethodKind)) 644Debug.Assert(Not containingType.IsInterface, "An interface member can't be marked overrides")
Symbols\SynthesizedSymbols\SynthesizedClonedTypeParameterSymbol.vb (1)
49Debug.Assert(Me.TypeParameterKind = If(TypeOf Me.ContainingSymbol Is MethodSymbol, TypeParameterKind.Method,
Microsoft.CodeAnalysis.Workspaces (67)
CodeFixes\CodeFixProvider.cs (1)
64Debug.Assert(priority is CodeActionRequestPriority.Low or CodeActionRequestPriority.Default or CodeActionRequestPriority.High, "Provider returned invalid priority");
CodeRefactorings\CodeRefactoringProvider.cs (1)
60Debug.Assert(priority is CodeActionRequestPriority.Low or CodeActionRequestPriority.Default or CodeActionRequestPriority.High, "Provider returned invalid priority");
FindSymbols\FindReferences\DependentTypeFinder.cs (1)
379Debug.Assert(type.Locations.All(assert), message);
Rename\ConflictEngine\ConflictResolver.cs (1)
465Debug.Assert(index <= str1.Length && index <= str2.Length, "Index cannot be greater than the string");
Rename\SymbolicRenameLocations.cs (1)
41Debug.Assert(locations.Distinct().Length == locations.Length, "Locations should be unique");
Shared\Extensions\SafeHandleExtensions.cs (1)
34Debug.Assert(success, $"{nameof(SafeHandle.DangerousAddRef)} does not return when {nameof(success)} is false.");
Shared\TestHooks\AsynchronousOperationListener.cs (1)
153Debug.Assert(removed, "IAsyncToken and Listener mismatch");
src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (2)
280Debug.Assert(_value is V, "Item must be a a V"); 315Debug.Assert(_value is V, "_value must be a V");
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (4)
19/// <inheritdoc cref="Debug.Assert(bool, string)"/> 22=> Debug.Assert(condition, message); 24/// <inheritdoc cref="Debug.Assert(bool, string)"/> 72Debug.Assert(false, message);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
133Debug.Assert(false, "Unreachable");
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
85Debug.Assert(false, message);
src\Dependencies\Collections\Internal\ArraySortHelper.cs (3)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\Dependencies\Collections\Internal\HashHelpers.cs (1)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\Dependencies\Collections\Segmented\SegmentedArray.cs (1)
491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (10)
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
277Debug.Assert(obj != null, "freeing null?"); 279Debug.Assert(_firstItem != obj, "freeing twice?"); 290Debug.Assert(value != obj, "freeing twice?");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (8)
85Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 89Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 98Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 107Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 117Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 121Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 147Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 153Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (1)
76Debug.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");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
416Debug.Assert(s_serializationVersion == 5, "After increasing the serialization version, add an upgrade path here.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (2)
185Debug.Assert(value == null || !value.GetType().GetTypeInfo().IsEnum, "Enum should not be written with WriteValue. Write them as ints instead."); 195Debug.Assert(!typeInfo.IsEnum, "Enums should not be written with WriteObject. Write them out as integers instead.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
1166Debug.Assert(parameter1.HasExplicitDefaultValue, "Expected all unspecified parameter to have default values");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (1)
33Debug.Assert(span.Start >= start, "Bad generator.");
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
192Debug.Assert(false, message + ". " + diagnostics);
Workspace\Solution\ProjectDependencyGraph.cs (3)
499Debug.Assert(!referencedProjects.IsEmpty, "Unexpected empty value in the forward references map."); 502Debug.Assert(projectIds.Contains(referencedProject), "Unexpected reference to unknown project."); 530Debug.Assert(!referencingProjects.IsEmpty, "Unexpected empty value in the reverse references map.");
Workspace\Solution\SolutionState.CachingFilePathComparer.cs (2)
84Debug.Assert(src[obj.Length] == '\0', "src[this.Length] == '\\0'"); 85Debug.Assert(((int)src) % 4 == 0, "Managed string should start at 4 bytes boundary");
Workspace\WorkspaceEventMap.cs (1)
78Debug.Assert(registry != null, "Expected to find a registry for the handler and options.");
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (37)
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (4)
19/// <inheritdoc cref="Debug.Assert(bool, string)"/> 22=> Debug.Assert(condition, message); 24/// <inheritdoc cref="Debug.Assert(bool, string)"/> 72Debug.Assert(false, message);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
133Debug.Assert(false, "Unreachable");
src\Compilers\Core\Portable\InternalUtilities\WeakList.cs (1)
76Debug.Assert(_items.Length > 0 && _size < 3 * _items.Length / 4, "length: " + _items.Length + " size: " + _size);
src\Dependencies\Collections\Internal\ArraySortHelper.cs (3)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\Dependencies\Collections\Internal\HashHelpers.cs (1)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\Dependencies\Collections\Segmented\SegmentedArray.cs (1)
491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (10)
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
277Debug.Assert(obj != null, "freeing null?"); 279Debug.Assert(_firstItem != obj, "freeing twice?"); 290Debug.Assert(value != obj, "freeing twice?");
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
BatchFixAllProviderTests.cs (1)
82Debug.Assert(replacements.All(replacement => replacement >= 0), $"Assertion failed: {nameof(replacements)}.All(replacement => replacement >= 0)");
Microsoft.CommonLanguageServerProtocol.Framework.Example (2)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
Microsoft.CommonLanguageServerProtocol.Framework.Package (3)
RequestExecutionQueue.cs (1)
366Debug.Assert(!concurrentlyExecutingTasks.Any(t => !t.Key.IsCompleted), "The tasks should have all been drained before continuing");
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
Microsoft.CSharp (807)
Microsoft\CSharp\RuntimeBinder\ArgumentObject.cs (1)
22Debug.Assert(type != null);
Microsoft\CSharp\RuntimeBinder\BinderHelper.cs (8)
44Debug.Assert(o.HasValue); 265Debug.Assert(action.ReturnType == typeof(object)); 274Debug.Assert(action.ReturnType == typeof(object)); 289Debug.Assert(args != null); 290Debug.Assert(args.Length != 0); 291Debug.Assert(args[0].Value is Type); 368Debug.Assert(discard <= argCount); 369Debug.Assert(argNames.Count <= argCount - discard);
Microsoft\CSharp\RuntimeBinder\CSharpBinaryOperationBinder.cs (2)
41Debug.Assert(name != null); 83Debug.Assert(_argumentInfo.Length == 2);
Microsoft\CSharp\RuntimeBinder\CSharpConvertBinder.cs (1)
36Debug.Assert(arguments.Length == 1);
Microsoft\CSharp\RuntimeBinder\CSharpGetMemberBinder.cs (1)
27Debug.Assert(arguments.Length == 1);
Microsoft\CSharp\RuntimeBinder\CSharpUnaryOperationBinder.cs (1)
69Debug.Assert(_argumentInfo.Length == 1);
Microsoft\CSharp\RuntimeBinder\DynamicDebuggerProxy.cs (1)
180Debug.Assert((numberOfArguments == argTypes.Length) && (numberOfArguments == argFlags.Length), "Argument arrays size mismatch.");
Microsoft\CSharp\RuntimeBinder\Errors\ErrorHandling.cs (3)
73Debug.Assert(0 != (arg.eaf & ErrArgFlags.Unique) && 0 == (arg.eaf & ErrArgFlags.NoStr)); 103Debug.Assert(0 != (args[prgiarg[j]].eaf & ErrArgFlags.Unique)); 117Debug.Assert(0 != (arg2.eaf & ErrArgFlags.Unique) && 0 == (arg2.eaf & ErrArgFlags.NoStr));
Microsoft\CSharp\RuntimeBinder\Errors\UserStringBuilder.cs (5)
19Debug.Assert(_strBuilder == null || _strBuilder.Length == 0); 25Debug.Assert(_strBuilder != null); 195Debug.Assert(meth == prop.SetterMethod); 215Debug.Assert(meth == @event.methRemove); 481Debug.Assert(elementType != null, "No element type");
Microsoft\CSharp\RuntimeBinder\ExpressionTreeCallRewriter.cs (18)
56Debug.Assert(binOp != null); 57Debug.Assert(binOp.Kind == ExpressionKind.Sequence); 58Debug.Assert(binOp.OptionalRightChild is ExprCall); 59Debug.Assert(((ExprCall)binOp.OptionalRightChild).PredefinedMethod == PREDEFMETH.PM_EXPRESSION_LAMBDA); 60Debug.Assert(binOp.OptionalLeftChild != null); 78Debug.Assert(call?.PredefinedMethod == PREDEFMETH.PM_EXPRESSION_PARAMETER); 79Debug.Assert(pExpr.OptionalRightChild is ExprWrap); 297Debug.Assert(list != null); 307Debug.Assert(pExpr.PredefinedMethod == PREDEFMETH.PM_EXPRESSION_ARRAYINDEX2); 340Debug.Assert((pExpr.Flags & EXPRFLAG.EXF_UNBOXRUNTIME) == 0); 352Debug.Assert(pm == PREDEFMETH.PM_EXPRESSION_CONVERT || 428Debug.Assert(fieldInfo != null); 502Debug.Assert(list != null); 574Debug.Assert(isLifted != null); 704Debug.Assert(pExpr.Type is NullType); 711Debug.Assert(call != null); 713Debug.Assert(pm == PREDEFMETH.PM_EXPRESSION_CONVERT || 913Debug.Assert(expressions.Count == arrinit.DimensionSizes[0]);
Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs (18)
79Debug.Assert(args.Length >= 1); 121Debug.Assert(pResult != null); 132Debug.Assert(System.Threading.Monitor.IsEntered(s_bindLock)); 212Debug.Assert(t != null); 264Debug.Assert(array[i].Type != null); 406Debug.Assert(type.IsByRef); 499Debug.Assert(argument.Info.Name != null); 714Debug.Assert(t != null); // Would have thrown in PopulateSymbolTableWithPayloadInformation already 843Debug.Assert(result != null); 880Debug.Assert(prop != null); 969Debug.Assert(arguments.Length == 1); 1010Debug.Assert(arguments.Length == 2); 1163Debug.Assert(type != typeof(string)); 1171Debug.Assert(callingObject.Type is ArrayType); 1220Debug.Assert(arguments.Length == 1); 1256Debug.Assert(arguments.Length == 1); 1280Debug.Assert(arguments.Length >= 2); 1281Debug.Assert(Array.TrueForAll(arguments, a => a.Type != null));
Microsoft\CSharp\RuntimeBinder\RuntimeBinderExtensions.cs (4)
141Debug.Assert(!(member1 is MethodBase) || 223Debug.Assert(typeParam.IsGenericParameter); 322Debug.Assert(type != null); 342Debug.Assert(type != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Binding\Better.cs (9)
186Debug.Assert(index != -1); 210Debug.Assert(!(args.prgexpr[i] is ExprNamedArgumentSpecification)); 355Debug.Assert(betterMethod == BetterType.Neither); 404Debug.Assert(argType != null); 405Debug.Assert(p1 != null); 406Debug.Assert(p2 != null); 494Debug.Assert(list.Count != 0); 495Debug.Assert(list[0].mpwi != null); 520Debug.Assert(candidate != contender);
Microsoft\CSharp\RuntimeBinder\Semantics\BinOpArgInfo.cs (2)
15Debug.Assert(op1 != null); 16Debug.Assert(op2 != null);
Microsoft\CSharp\RuntimeBinder\Semantics\BinOpSig.cs (2)
108Debug.Assert(((_grflt & LiftFlags.Lift1) == 0) || ((_grflt & LiftFlags.Convert1) == 0)); 109Debug.Assert(((_grflt & LiftFlags.Lift2) == 0) || ((_grflt & LiftFlags.Convert2) == 0));
Microsoft\CSharp\RuntimeBinder\Semantics\Conversion.cs (40)
223Debug.Assert(s_simpleTypeBetter[i][i] == same); 226Debug.Assert(s_simpleTypeBetter[i][j] != same && s_simpleTypeBetter[j][i] != same); 227Debug.Assert( 231Debug.Assert( 250Debug.Assert((int)pt1 < NUM_EXT_TYPES); 251Debug.Assert((int)pt2 < NUM_EXT_TYPES); 302Debug.Assert(type1 != null && type2 != null); 370Debug.Assert(!(expr is ExprMemberGroup)); 456Debug.Assert(!(expr is ExprMemberGroup)); 457Debug.Assert(dest != null); 512Debug.Assert(exprType <= FUNDTYPE.FT_LASTNUMERIC, "Error in constant conversion logic!"); 533Debug.Assert(expr.Type != null); 656Debug.Assert(exprSrc == null || exprSrc.Type == typeSrc); 748Debug.Assert(convCur.getClass() == aggCur); 836Debug.Assert((typeBestSrc == null) == (typeBestDst == null)); // If typeBestSrc is null then typeBestDst should be null. 837Debug.Assert(fFromImplicit); 844Debug.Assert(iuciBestSrc == -1); 850Debug.Assert(0 <= iuciBestSrc && iuciBestSrc < prguci.Count - 1); 864Debug.Assert(fToImplicit); 871Debug.Assert(iuciBestDst == -1); 877Debug.Assert(0 <= iuciBestDst && iuciBestDst < prguci.Count - 1); 890Debug.Assert((typeBestSrc == null) == (typeBestDst == null)); 893Debug.Assert(iuciBestSrc == -1 && iuciBestDst == -1); 897Debug.Assert(0 <= iuciBestSrc && iuciBestSrc < prguci.Count); 898Debug.Assert(0 <= iuciBestDst && iuciBestDst < prguci.Count); 960Debug.Assert(typeFrom != typeBestSrc || typeTo != typeBestDst); 968Debug.Assert(n <= 0); 982Debug.Assert(n <= 0); 1009Debug.Assert(ctypeLiftBest <= 2); 1023Debug.Assert(fLiftSrc || fLiftDst); 1061Debug.Assert(pConversionArgument != null); 1085Debug.Assert(0 <= iuciBestSrc && iuciBestSrc < prguci.Count); 1086Debug.Assert(0 <= iuciBestDst && iuciBestDst < prguci.Count); 1094Debug.Assert(pExpr != null); 1132Debug.Assert(pTransformedArgument != null); 1136Debug.Assert(pCast != null); 1157Debug.Assert(constSrc != null); 1359Debug.Assert(type1 != type2); 1394Debug.Assert(type1 != type2); 1522Debug.Assert(typeDest != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Conversions.cs (5)
80Debug.Assert(typeSrc != null); 81Debug.Assert(typeDst != null); 188Debug.Assert(!(typeArr is MethodGroupType)); 245Debug.Assert(pTypeParams.Count == pSourceArgs.Count); 246Debug.Assert(pTypeParams.Count == pTargetArgs.Count);
Microsoft\CSharp\RuntimeBinder\Semantics\ExplicitConversion.cs (31)
75Debug.Assert((_flags & CONVERTTYPE.STANDARD) == 0); 190Debug.Assert(_typeSrc != null); 191Debug.Assert(_typeDest != null); 205Debug.Assert(valueSrc.Type == _typeSrc.StripNubs()); 236Debug.Assert(_typeSrc != null); 237Debug.Assert(_typeDest != null); 300Debug.Assert(!(typeArr is MethodGroupType)); 346Debug.Assert(_typeSrc != null); 347Debug.Assert(arrayDest != null); 413Debug.Assert(_typeSrc != null); 414Debug.Assert(aggTypeDest != null); 456Debug.Assert(_typeSrc != null); 457Debug.Assert(_typeSrc.IsPredefType(PredefinedType.PT_DECIMAL)); 458Debug.Assert(aggTypeDest.IsEnumType); 498Debug.Assert(_typeSrc != null); 499Debug.Assert(aggTypeDest != null); 500Debug.Assert(aggTypeDest.IsPredefType(PredefinedType.PT_DECIMAL)); 501Debug.Assert(_typeSrc.IsEnumType); 543Debug.Assert(ok); 552Debug.Assert(_typeSrc != null); 553Debug.Assert(aggTypeDest != null); 605Debug.Assert(_typeSrc != null); 606Debug.Assert(aggTypeDest != null); 615Debug.Assert(_typeSrc.IsPredefined && aggDest.IsPredefined()); 620Debug.Assert((int)ptSrc < NUM_SIMPLE_TYPES && (int)ptDest < NUM_SIMPLE_TYPES); 624Debug.Assert(convertKind != ConvKind.Implicit); 625Debug.Assert(convertKind != ConvKind.Identity); 680Debug.Assert(_typeSrc != null); 681Debug.Assert(aggTypeDest != null); 738Debug.Assert(_typeSrc != null); 739Debug.Assert(aggTypeDest != null);
Microsoft\CSharp\RuntimeBinder\Semantics\ExpressionBinder.cs (45)
276Debug.Assert(pt != PredefinedType.PT_VOID); // use getVoidType() 293Debug.Assert(op1 is ExprCast 312Debug.Assert(pArrayType != null); 357Debug.Assert(typeDest != null); 385Debug.Assert(exprCast.Argument != null); 401Debug.Assert(mwi.Sym is MethodSymbol && (!mwi.Meth().isOverride || mwi.Meth().isHideByName)); 402Debug.Assert(pMemGroup != null); 431Debug.Assert(pResult.Type == VoidType.Instance); 447Debug.Assert(fwt.GetType() != null && fwt.Field().getClass() == fwt.GetType().OwningAggregate); 462Debug.Assert(BindingFlag.BIND_MEMBERSET == (BindingFlag)EXPRFLAG.EXF_MEMBERSET); 474Debug.Assert(pwt.Sym is PropertySymbol && 477Debug.Assert(pwt.Prop().Params.Count == 0 || pwt.Prop() is IndexerSymbol); 552Debug.Assert(pName != null); 610Debug.Assert(methCur.typeVars.Count == 0); 673Debug.Assert(arg.Type is NullableType); 732Debug.Assert(grp.SymKind == SYMKIND.SK_MethodSymbol || grp.SymKind == SYMKIND.SK_PropertySymbol && ((grp.Flags & EXPRFLAG.EXF_INDEXER) != 0)); 737Debug.Assert(grp.Name != null); 746Debug.Assert((grp.Flags & EXPRFLAG.EXF_INDEXER) != 0); 779Debug.Assert(arg != null); 813Debug.Assert(pOperand1 != null); 814Debug.Assert(pOperand1.Type != null); 822Debug.Assert(pOperand2.Type != null); 831Debug.Assert(kind >= CheckLvalueKind.Assignment && kind <= CheckLvalueKind.Increment); 841Debug.Assert(prop != null); 842Debug.Assert(prop.isLvalue()); 885Debug.Assert(!(expr is ExprLocal)); 886Debug.Assert(!(expr is ExprMemberGroup)); 892Debug.Assert(!prop.MethWithTypeSet || ExprProperty.HasIsExternalInitModifier(prop.MethWithTypeSet)); 920Debug.Assert(field.FieldWithType.Field().isReadOnly); 951Debug.Assert(prop != null); 971Debug.Assert(swt.GetType() != null && swt.GetType().OwningAggregate == swt.Sym.parent as AggregateSymbol); 1023Debug.Assert(swt.GetType().OwningAggregate == aggCalled); 1026Debug.Assert(pObject != null); 1073Debug.Assert( 1088Debug.Assert(call != null); 1102Debug.Assert(mp != null); 1103Debug.Assert(mp.Params != null); 1114Debug.Assert(!Array.Exists(@params.Items, p => p is ArgumentListType)); // We should never have picked a varargs method to bind to. 1161Debug.Assert(index != mp.Params.Count); 1215Debug.Assert(rval != null); 1357Debug.Assert(arg != null); 1358Debug.Assert(arg.Type != null); 1364Debug.Assert(iarg <= argInfo.carg); 1635Debug.Assert(ek >= ExpressionKind.FirstOp && (ek - ExpressionKind.FirstOp) < (int)EK2NAME.Length); 1674Debug.Assert(arg != null);
Microsoft\CSharp\RuntimeBinder\Semantics\EXPRExtensions.cs (2)
14Debug.Assert(f != null); 52Debug.Assert(expr?.Kind >= ExpressionKind.TypeLimit && 0 != (expr.Flags & EXPRFLAG.EXF_BINOP));
Microsoft\CSharp\RuntimeBinder\Semantics\ExprFactory.cs (11)
121Debug.Assert(type != null); 130Debug.Assert(type.FundamentalType > FUNDTYPE.FT_NONE); 131Debug.Assert(type.FundamentalType < FUNDTYPE.FT_COUNT); 179Debug.Assert(arg1 != null); 180Debug.Assert(exprKind.IsUnaryOperator() == (arg2 == null)); 195Debug.Assert(operand != null); 221Debug.Assert(wrap != null); 238Debug.Assert(last == first); 245Debug.Assert(last == first); 250Debug.Assert((last as ExprList)?.OptionalNextListNode != null); 251Debug.Assert((last as ExprList).OptionalNextListNode.Kind != ExpressionKind.List);
Microsoft\CSharp\RuntimeBinder\Semantics\GroupToArgsBinder.cs (26)
62Debug.Assert(grp != null); 63Debug.Assert(args != null); 94Debug.Assert(_pGroup.SymKind == SYMKIND.SK_MethodSymbol || _pGroup.SymKind == SYMKIND.SK_PropertySymbol && 0 != (_pGroup.Flags & EXPRFLAG.EXF_INDEXER)); 107Debug.Assert(pGroup != null); 243Debug.Assert(!_results.InaccessibleResult); 248Debug.Assert(!_misnamed); 255Debug.Assert(!_mpwiBogus); 275Debug.Assert(type.IsInterfaceType); 346Debug.Assert(pmethBest != null); 573Debug.Assert(optionalArgument != null); 632Debug.Assert(meth is MethodSymbol); 648Debug.Assert(method.parent is AggregateSymbol); 853Debug.Assert(_methList.IsEmpty() || _methList.Head().mpwi.MethProp() != _pCurrentSym); 875Debug.Assert(methSym.typeVars.Count > 0); 1035Debug.Assert(pMethod != null); 1037Debug.Assert(pMethod.IsParameterOptional(iParam)); 1077Debug.Assert(_pGroup.SymKind == SYMKIND.SK_MethodSymbol || _pGroup.SymKind == SYMKIND.SK_PropertySymbol && 0 != (_pGroup.Flags & EXPRFLAG.EXF_INDEXER)); 1078Debug.Assert(_pGroup.TypeArgs.Count == 0 || _pGroup.SymKind == SYMKIND.SK_MethodSymbol); 1079Debug.Assert(0 == (_pGroup.Flags & EXPRFLAG.EXF_USERCALLABLE) || _results.BestResult.MethProp().isUserCallable()); 1083Debug.Assert(_results.BestResult.MethProp() is MethodSymbol); 1102Debug.Assert(_methList.IsEmpty()); 1156Debug.Assert(!_results.BestResult || _results.BestResult.MethProp().getClass().IsDelegate()); 1157Debug.Assert(!_results.BestResult || _results.BestResult.GetType().OwningAggregate.IsDelegate()); 1175Debug.Assert(_results.UninferableResult.Sym is MethodSymbol); 1219Debug.Assert(0 == (_pGroup.Flags & EXPRFLAG.EXF_CTOR)); 1225Debug.Assert(!(_pGroup.ParentType is TypeParameterType));
Microsoft\CSharp\RuntimeBinder\Semantics\ImplicitConversion.cs (18)
88Debug.Assert(_typeSrc != null && _typeDest != null); // types must be supplied. 89Debug.Assert(_exprSrc == null || _typeSrc == _exprSrc.Type); // type of source should be correct if source supplied 90Debug.Assert(!_needsExprDest || _exprSrc != null); // need source expr to create dest expr 145Debug.Assert(ftDest != FUNDTYPE.FT_NONE || _typeDest is ParameterModifierType); 270Debug.Assert(0 != (~_flags & (CONVERTTYPE.STANDARD | CONVERTTYPE.ISEXPLICIT))); 271Debug.Assert(_exprSrc == null || _exprSrc.Type == _typeSrc); 272Debug.Assert(!_needsExprDest || _exprSrc != null); 273Debug.Assert(_typeSrc != nubDst); // BindImplicitConversion should have taken care of this already. 280Debug.Assert(atsDst != _typeSrc); 306Debug.Assert(_typeSrc == typeSrcBase); 349Debug.Assert(exprTmp.Type == nubDst); 674Debug.Assert(aggSrc.getThisType().IsSimpleType); 675Debug.Assert(_typeDest.IsSimpleType); 677Debug.Assert(aggSrc.IsPredefined() && _typeDest.IsPredefined); 682Debug.Assert((int)ptSrc < NUM_SIMPLE_TYPES && (int)ptDest < NUM_SIMPLE_TYPES); 704Debug.Assert(ptSrc == PredefinedType.PT_FLOAT || ptSrc == PredefinedType.PT_DOUBLE); 705Debug.Assert(0 != (_flags & CONVERTTYPE.ISEXPLICIT)); 711Debug.Assert(convertKind != ConvKind.Identity);
Microsoft\CSharp\RuntimeBinder\Semantics\MemberLookup.cs (30)
71Debug.Assert(type != null && sym != null); 86Debug.Assert(_csym == 1); 87Debug.Assert(_prgtype[0] == type); 118Debug.Assert(!(symCur is AggregateSymbol)); 229Debug.Assert(_fMulti || typeCur == _prgtype[0]); 300Debug.Assert(!fInaccess || !fFoundSome); 329Debug.Assert(sym is PropertySymbol); 361Debug.Assert(!_swtFirst || _fMulti); 362Debug.Assert(typeStart != null && !typeStart.IsInterfaceType && (ptypeEnd == null || typeStart != ptypeEnd)); 370Debug.Assert(!typeCur.IsInterfaceType); 396Debug.Assert(typeCur == typeEnd); 406Debug.Assert(!_swtFirst || _fMulti); 407Debug.Assert(typeStart == null || typeStart.IsInterfaceType); 408Debug.Assert(typeStart != null || types.Count != 0); 421Debug.Assert(type.IsInterfaceType); 431Debug.Assert(typeCur != null); 436Debug.Assert(typeCur != null && typeCur.IsInterfaceType); 445Debug.Assert(type.IsInterfaceType); 473Debug.Assert(CSemanticChecker.CheckBogus(swt.Sym)); 476Debug.Assert((meth1 ?? meth2) != null); 524Debug.Assert((flags & ~MemLookFlags.All) == 0); 525Debug.Assert(obj == null || obj.Type != null); 526Debug.Assert(typeSrc is AggregateType); 546Debug.Assert((_flags & (MemLookFlags.Ctor | MemLookFlags.NewObj | MemLookFlags.Operator | MemLookFlags.BaseCall)) == 0); 569Debug.Assert(typeCls2 != null && typeCls2.IsPredefType(PredefinedType.PT_OBJECT)); 597Debug.Assert(FError()); 601Debug.Assert(!_swtFirst || _swtAmbig); 618Debug.Assert(_typeSrc is AggregateType); 646Debug.Assert(_arity != 0); 647Debug.Assert(!(_swtBadArity.Sym is AggregateSymbol));
Microsoft\CSharp\RuntimeBinder\Semantics\MemberLookupResults.cs (2)
26Debug.Assert(containingTypes != null); 27Debug.Assert(containingTypes.Count != 0);
Microsoft\CSharp\RuntimeBinder\Semantics\MethodIterator.cs (3)
30Debug.Assert(name != null); 31Debug.Assert(containingTypes != null); 32Debug.Assert(containingTypes.Count != 0);
Microsoft\CSharp\RuntimeBinder\Semantics\MethodTypeInferrer.cs (55)
91Debug.Assert(pMethod != null); 92Debug.Assert(pMethod.typeVars.Count > 0); 93Debug.Assert(pMethod.isParamArray || pMethod.Params == pMethodFormalParameterTypes); 99Debug.Assert(pMethodArguments != null); 100Debug.Assert(pMethodFormalParameterTypes != null); 101Debug.Assert(pMethodArguments.carg <= pMethodFormalParameterTypes.Count); 148Debug.Assert(0 <= iParam); 149Debug.Assert(iParam < _pMethodTypeParameters.Count); 157Debug.Assert(pParam != null); 158Debug.Assert(pParam.IsMethodTypeParameter); 160Debug.Assert(_pMethodTypeParameters[iParam] == pParam); 182Debug.Assert(IsUnfixed(pParam)); 194Debug.Assert(IsUnfixed(pParam)); 206Debug.Assert(IsUnfixed(pParam)); 218Debug.Assert(0 <= iParam); 219Debug.Assert(iParam < _pMethodTypeParameters.Count); 255Debug.Assert(_pMethodFormalParameterTypes != null); 256Debug.Assert(_pMethodArguments != null); 257Debug.Assert(_pMethodArguments.carg <= _pMethodFormalParameterTypes.Count); 400Debug.Assert(res != NewInferenceResult.NoProgress); 580Debug.Assert(_ppDependencies == null); 594Debug.Assert(_ppDependencies != null); 600Debug.Assert(0 <= iParam && iParam < _pMethodTypeParameters.Count); 601Debug.Assert(0 <= jParam && jParam < _pMethodTypeParameters.Count); 615Debug.Assert(_ppDependencies != null); 616Debug.Assert(0 <= iParam && iParam < _pMethodTypeParameters.Count); 617Debug.Assert(0 <= jParam && jParam < _pMethodTypeParameters.Count); 655Debug.Assert(_ppDependencies != null); 678Debug.Assert(_ppDependencies != null); 695Debug.Assert(_ppDependencies != null); 729Debug.Assert(0 <= iParam && iParam < _pMethodTypeParameters.Count); 744Debug.Assert(0 <= iParam && iParam < _pMethodTypeParameters.Count); 872Debug.Assert(pSource != null); 873Debug.Assert(pDest != null); 874Debug.Assert(pSource.OwningAggregate == pDest.OwningAggregate); 879Debug.Assert(pSourceArgs != null); 880Debug.Assert(pDestArgs != null); 881Debug.Assert(pSourceArgs.Count == pDestArgs.Count); 1234Debug.Assert(pSource != null); 1235Debug.Assert(pDest != null); 1236Debug.Assert(pSource.OwningAggregate == pDest.OwningAggregate); 1242Debug.Assert(pTypeParams != null); 1243Debug.Assert(pSourceArgs != null); 1244Debug.Assert(pDestArgs != null); 1246Debug.Assert(pTypeParams.Count == pSourceArgs.Count); 1247Debug.Assert(pTypeParams.Count == pDestArgs.Count); 1541Debug.Assert(pSource != null); 1542Debug.Assert(pDest != null); 1543Debug.Assert(pSource.OwningAggregate == pDest.OwningAggregate); 1549Debug.Assert(pTypeParams != null); 1550Debug.Assert(pSourceArgs != null); 1551Debug.Assert(pDestArgs != null); 1553Debug.Assert(pTypeParams.Count == pSourceArgs.Count); 1554Debug.Assert(pTypeParams.Count == pDestArgs.Count); 1589Debug.Assert(IsUnfixed(iParam));
Microsoft\CSharp\RuntimeBinder\Semantics\Nullable.cs (5)
13Debug.Assert(expr != null); 31Debug.Assert(pExpr != null && !(pExpr is ExprList)); 42Debug.Assert(exprSrc != null && exprSrc.Type is NullableType); 48Debug.Assert(args != null && !(args is ExprList)); 67Debug.Assert(exprSrc != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Operators.cs (128)
187Debug.Assert(prgbofs != null); 204Debug.Assert(rgbofs != null); 249Debug.Assert(typeSig1.IsValueType); 276Debug.Assert(typeSig1.IsValueType); 333Debug.Assert(typeSig2.IsValueType); 361Debug.Assert(typeSig2.IsValueType); 411Debug.Assert(binopSignatures != null); 502Debug.Assert(arg1 != null); 503Debug.Assert(arg2 != null); 541Debug.Assert(binopSignatures.Count > 0); 567Debug.Assert(bestBinopSignature < binopSignatures.Count); 600Debug.Assert(bofs.fnkind != BinOpFuncKind.BoolBitwiseOp); 621Debug.Assert(bofs.Type1() is NullableType || bofs.Type2() is NullableType); 665Debug.Assert((exprRes.Flags & EXPRFLAG.EXF_LVALUE) == 0); 756Debug.Assert(!(typeDst is NullableType)); 790Debug.Assert(!(typeDst is NullableType)); 832Debug.Assert(info.type1 is NullableType); 843Debug.Assert(info.type2 is NullableType); 971Debug.Assert(type1.FundamentalType != FUNDTYPE.FT_VAR); 987Debug.Assert(type2.FundamentalType != FUNDTYPE.FT_VAR); 1022Debug.Assert( 1025Debug.Assert( 1073Debug.Assert(Enum.IsDefined(bt1)); 1074Debug.Assert(Enum.IsDefined(bt2)); 1181Debug.Assert(pArgument != null); 1184Debug.Assert(type != null); 1217Debug.Assert(pResult != null); 1284Debug.Assert(nBestSignature < pSignatures.Count); 1325Debug.Assert(pArgument != null); 1326Debug.Assert(pArgument.Type != null); 1342Debug.Assert(pRawType == pArgumentType); 1343Debug.Assert(pArgumentType is AggregateType); 1371Debug.Assert(!(pArgumentType is PointerType)); 1384Debug.Assert(pArgument != null); 1420Debug.Assert(pArgument != null); 1421Debug.Assert(pArgument.Type != null); 1544Debug.Assert(arg?.Type != null); 1558Debug.Assert((exprRes.Flags & EXPRFLAG.EXF_LVALUE) == 0); 1582Debug.Assert(Enum.IsDefined(bt)); 1597Debug.Assert(arg1.Type.IsPredefined && arg2.Type.IsPredefined && arg1.Type.PredefinedType == arg2.Type.PredefinedType); 1608Debug.Assert(arg.Type.IsPredefined); 1619Debug.Assert(arg1.Type.IsPredefined && arg2.Type.IsPredefined && arg1.Type.PredefinedType == arg2.Type.PredefinedType); 1630Debug.Assert(arg.Type.IsPredefined); 1642Debug.Assert(ek == ExpressionKind.Add || ek == ExpressionKind.Subtract); 1667Debug.Assert(ek == ExpressionKind.Add || ek == ExpressionKind.Subtract); 1676Debug.Assert(type.FundamentalType != FUNDTYPE.FT_PTR); // Can't have a pointer. 1680Debug.Assert(type.IsPredefType(PredefinedType.PT_DECIMAL)); 1741Debug.Assert(ek == ExpressionKind.Add || ek == ExpressionKind.Subtract); 1742Debug.Assert(!uofs.isLifted()); 1744Debug.Assert(arg != null); 1748Debug.Assert(!(type is NullableType)); 1769Debug.Assert(ek == ExpressionKind.Add || ek == ExpressionKind.Subtract); 1770Debug.Assert(uofs.isLifted()); 1773Debug.Assert(arg != null); 1804Debug.Assert(arg1.Type.IsPredefType(PredefinedType.PT_DECIMAL) && arg2.Type.IsPredefType(PredefinedType.PT_DECIMAL)); 1807Debug.Assert(typeDec != null); 1847Debug.Assert(arg.Type.IsPredefType(PredefinedType.PT_DECIMAL)); 1848Debug.Assert(ek == ExpressionKind.Negate || ek == ExpressionKind.UnaryPlus); 1851Debug.Assert(typeDec != null); 1868Debug.Assert(ek == ExpressionKind.Add); 1869Debug.Assert(arg1.Type.IsPredefType(PredefinedType.PT_STRING) || arg2.Type.IsPredefType(PredefinedType.PT_STRING)); 1881Debug.Assert(ek == ExpressionKind.LeftShirt || ek == ExpressionKind.RightShift); 1882Debug.Assert(arg1.Type.IsPredefined); 1883Debug.Assert(arg2.Type.IsPredefType(PredefinedType.PT_INT)); 1886Debug.Assert(ptOp == PredefinedType.PT_INT || ptOp == PredefinedType.PT_UINT || ptOp == PredefinedType.PT_LONG || ptOp == PredefinedType.PT_ULONG); 1900Debug.Assert(arg1 != null); 1901Debug.Assert(arg2 != null); 1902Debug.Assert(arg1.Type.IsPredefType(PredefinedType.PT_BOOL) || arg1.Type is NullableType argNubType1 && argNubType1.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL)); 1903Debug.Assert(arg2.Type.IsPredefType(PredefinedType.PT_BOOL) || arg2.Type is NullableType argNubType2 && argNubType2.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL)); 1912Debug.Assert(ek == ExpressionKind.BitwiseAnd || ek == ExpressionKind.BitwiseOr); 1913Debug.Assert(expr1.Type.IsPredefType(PredefinedType.PT_BOOL) || expr1.Type is NullableType expNubType1 && expNubType1.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL)); 1914Debug.Assert(expr2.Type.IsPredefType(PredefinedType.PT_BOOL) || expr2.Type is NullableType expNubType2 && expNubType2.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL)); 1940Debug.Assert((exprRes.Flags & EXPRFLAG.EXF_LVALUE) == 0); 1957Debug.Assert(arg.Type.IsPredefType(PredefinedType.PT_BOOL)); 1958Debug.Assert(ek == ExpressionKind.LogicalNot); 1983Debug.Assert(ek == ExpressionKind.Eq || ek == ExpressionKind.NotEq); 1984Debug.Assert(arg1.Type.IsPredefType(PredefinedType.PT_STRING) && arg2.Type.IsPredefType(PredefinedType.PT_STRING)); 2002Debug.Assert(ek == ExpressionKind.Eq || ek == ExpressionKind.NotEq); 2019Debug.Assert(ek == ExpressionKind.Add || ek == ExpressionKind.Subtract || ek == ExpressionKind.Eq || ek == ExpressionKind.NotEq); 2020Debug.Assert(arg1.Type == arg2.Type && (arg1.Type.IsDelegateType || arg1.Type.IsPredefType(PredefinedType.PT_DELEGATE))); 2063Debug.Assert(typeEnum != null); 2080Debug.Assert(!typeDst.IsPredefType(PredefinedType.PT_BOOL)); 2091Debug.Assert(ek == ExpressionKind.Add || ek == ExpressionKind.Subtract); 2105Debug.Assert(typeEnum != null); 2121Debug.Assert((exprRes.Flags & EXPRFLAG.EXF_LVALUE) == 0); 2139Debug.Assert(ek == ExpressionKind.BitwiseNot); 2140Debug.Assert((ExprCast)arg != null); 2141Debug.Assert(((ExprCast)arg).Argument.Type.IsEnumType); 2242Debug.Assert(ptOp == PredefinedType.PT_INT || ptOp == PredefinedType.PT_UINT || ptOp == PredefinedType.PT_LONG || ptOp == PredefinedType.PT_ULONG); 2244Debug.Assert(typeOp != null); 2245Debug.Assert(op1 != null && op1.Type == typeOp); 2246Debug.Assert(op2 == null || op2.Type == typeOp); 2247Debug.Assert((op2 == null) == (kind == ExpressionKind.Negate || kind == ExpressionKind.UnaryPlus || kind == ExpressionKind.BitwiseNot)); 2258Debug.Assert((exprRes.Flags & EXPRFLAG.EXF_LVALUE) == 0); 2297Debug.Assert(ptOp == PredefinedType.PT_INT || ptOp == PredefinedType.PT_UINT || ptOp == PredefinedType.PT_LONG || ptOp == PredefinedType.PT_ULONG); 2299Debug.Assert(typeOp != null); 2300Debug.Assert(op != null && op.Type == typeOp); 2313Debug.Assert(0 == (exprRes.Flags & EXPRFLAG.EXF_LVALUE)); 2329Debug.Assert(op2 == null || op1.Type == op2.Type); 2330Debug.Assert(op1.Type.IsPredefType(PredefinedType.PT_FLOAT) || op1.Type.IsPredefType(PredefinedType.PT_DOUBLE)); 2362Debug.Assert(op1 != null); 2363Debug.Assert(op2 != null); 2373Debug.Assert(op1 != null); 2389Debug.Assert(pCall != null); 2390Debug.Assert(pCall.MethWithInst.Meth() != null); 2391Debug.Assert(pCall.OptionalArguments != null); 2392Debug.Assert(kind == ExpressionKind.LogicalAnd || kind == ExpressionKind.LogicalOr); 2396Debug.Assert(pCall.MethWithInst.Meth().Params.Count == 2); 2404Debug.Assert(list != null); 2517Debug.Assert(method.typeVars.Count == 0); 2554Debug.Assert(name != null); 2606Debug.Assert(cats == 2); 2635Debug.Assert(pmethBest.ctypeLift == 2); 2685Debug.Assert(Params != paramsRaw); 2686Debug.Assert(paramsRaw[0] == Params[0].BaseOrParameterOrElementType); 2687Debug.Assert(paramsRaw[1] == Params[1].BaseOrParameterOrElementType); 2706Debug.Assert(paramsRaw[0] == paramsRaw[1]); 2707Debug.Assert(typeRetRaw.IsPredefType(PredefinedType.PT_BOOL)); 2715Debug.Assert(typeRetRaw.IsPredefType(PredefinedType.PT_BOOL)); 2723Debug.Assert(!(ek == ExpressionKind.Eq || ek == ExpressionKind.NotEq) || nonLiftedArg1.Type == nonLiftedArg2.Type); 2748Debug.Assert(argType1.IsEnumType || argType2.IsEnumType); 2755Debug.Assert(type1 == typeEnum || type1 == typeEnum.UnderlyingEnumType); 2756Debug.Assert(type2 == typeEnum || type2 == typeEnum.UnderlyingEnumType); 2765Debug.Assert(type1 == type2); 2769Debug.Assert(type1 != type2); 2778Debug.Assert(ek.IsRelational()); 2792Debug.Assert(methSym != null); 2808Debug.Assert(methSym != null);
Microsoft\CSharp\RuntimeBinder\Semantics\PredefinedMembers.cs (22)
216Debug.Assert(propertyName != null); 217Debug.Assert(propertyGetter >= 0 && propertyGetter < PREDEFMETH.PM_COUNT); 225Debug.Assert(property != null); 237Debug.Assert(signature != null); 257Debug.Assert(current >= 0 && (int)current < (int)PredefinedType.PT_COUNT); 279Debug.Assert(signature != null); 284Debug.Assert(count >= 0); 301Debug.Assert((int)GetMethInfo((PREDEFMETH)i).method == i); 305Debug.Assert((int)GetPropInfo((PREDEFPROP)i).property == i); 314Debug.Assert(property >= 0 && property < PREDEFPROP.PP_COUNT); 322Debug.Assert(method >= 0 && method < PREDEFMETH.PM_COUNT); 338Debug.Assert(signature != null); 339Debug.Assert(cMethodTyVars >= 0); 340Debug.Assert(methodName != null); 341Debug.Assert(type != null); 346Debug.Assert(returnType != null); 349Debug.Assert(argumentTypes != null); 404Debug.Assert(result >= 0 && result < PREDEFMETH.PM_COUNT); 422Debug.Assert(property >= 0 && property < PREDEFPROP.PP_COUNT); 423Debug.Assert(s_predefinedProperties[(int)property].property == property); 430Debug.Assert(method >= 0 && method < PREDEFMETH.PM_COUNT); 431Debug.Assert(s_predefinedMethods[(int)method].method == method);
Microsoft\CSharp\RuntimeBinder\Semantics\SemanticChecker.cs (13)
37Debug.Assert(symCheck != null); 38Debug.Assert(atsCheck == null || symCheck.parent == atsCheck.OwningAggregate); 39Debug.Assert(typeThru == null || 53Debug.Assert(atsCheck != null); 73Debug.Assert(atsCheck != null); 88Debug.Assert(type != null); 95Debug.Assert(type is VoidType || type is TypeParameterType); 123Debug.Assert(symCheck != null); 124Debug.Assert(atsCheck == null || symCheck.parent == atsCheck.OwningAggregate); 125Debug.Assert(typeThru == null || 214Debug.Assert(symCheck.GetAccess() == ACCESS.ACC_PROTECTED 232Debug.Assert(agg != aggCheck); // We checked for this above. 261Debug.Assert(!CheckAccess(swtBad.Sym, swtBad.GetType(), symWhere, typeQual) ||
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\AggregateSymbol.cs (3)
86Debug.Assert(GetTypeVars() == GetTypeVarsAll() || isNested()); 286Debug.Assert(GetOuterAgg().GetTypeVars() != null); 287Debug.Assert(GetOuterAgg().GetTypeVarsAll() != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\FieldSymbol.cs (1)
41Debug.Assert(isEvent);
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\MethodOrPropertySymbol.cs (10)
61Debug.Assert(_Params == null, "Should only be set once"); 92Debug.Assert(index < Params.Count); 103Debug.Assert(_optionalParameterIndex != null); 125Debug.Assert(index < Params.Count); 126Debug.Assert(_defaultParameterIndex != null); 132Debug.Assert(_defaultParameterIndex != null); 140Debug.Assert(HasDefaultParameterValue(index)); 141Debug.Assert(_defaultParameterIndex != null); 147Debug.Assert(HasDefaultParameterValue(index)); 164Debug.Assert(IsMarshalAsParameter(index));
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\MethodSymbol.cs (6)
40Debug.Assert(!_inferenceMustFail); 114Debug.Assert(isPropertyAccessor()); 120Debug.Assert(isPropertyAccessor()); 126Debug.Assert(isEventAccessor()); 132Debug.Assert(isEventAccessor()); 139Debug.Assert(MethKind == MethodKindEnum.ExplicitConv || MethKind == MethodKindEnum.ImplicitConv);
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\ParentSymbol.cs (5)
24Debug.Assert(sym != null /*&& this != null */); 27Debug.Assert(sym.parent == null || sym.parent == this); 29Debug.Assert(sym.nextChild == null); 33Debug.Assert(firstChild == null); 48Debug.Assert(_lastChild == psym || count == 0);
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\Symbol.cs (1)
86Debug.Assert(_access != ACCESS.ACC_UNKNOWN);
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\SymbolLoader.cs (28)
26Debug.Assert(atsDer != null); 27Debug.Assert(pBase != null); 51Debug.Assert(pDerived != null); 52Debug.Assert(pBase != null); 63Debug.Assert(pDerived != null); 64Debug.Assert(pBase != null); 102Debug.Assert(pSource != null); 103Debug.Assert(pDest != null); 115Debug.Assert(pSource != null); 116Debug.Assert(pDest != null); 131Debug.Assert(pSource != null); 132Debug.Assert(pDest != null); 165Debug.Assert(atsDest.TypeArgsAll.Count == 1); 174Debug.Assert(pSource != null); 175Debug.Assert(pDest != null); 176Debug.Assert(!(pSource is TypeParameterType)); 341Debug.Assert(pSource != null && pSource.IsInterfaceType); 342Debug.Assert(pDest != null && pDest.IsInterfaceType); 352Debug.Assert(pSource != null && pSource.IsDelegateType); 353Debug.Assert(pDest != null && pDest.IsDelegateType); 363Debug.Assert(pSource != null); 364Debug.Assert(pDest != null); 380Debug.Assert(pTypeParams.Count == pSourceArgs.Count); 381Debug.Assert(pTypeParams.Count == pDestArgs.Count); 419Debug.Assert(pSource != null); 420Debug.Assert(pDest != null); 421Debug.Assert(!(pSource is TypeParameterType)); 501Debug.Assert(!derived.IsEnum() && !@base.IsEnum());
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\SymbolStore.cs (3)
28Debug.Assert(child.nextSameName == null); 29Debug.Assert(child.parent == null || child.parent == parent); 54Debug.Assert(sym != null && sym.nextSameName == null);
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\SymFactory.cs (7)
91Debug.Assert(name != null); 92Debug.Assert(parent != null); 109Debug.Assert(name != null); 113Debug.Assert(sym != null); 136Debug.Assert(sym != null); 145Debug.Assert(sym != null); 185Debug.Assert(sym != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\TypeParameterSymbol.cs (1)
61Debug.Assert(index >= _nIndexInOwnParameters);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\BinaryOperator.cs (7)
13Debug.Assert(kind > ExpressionKind.TypeLimit); 14Debug.Assert(left != null); 15Debug.Assert(right != null); 24Debug.Assert(kind > ExpressionKind.TypeLimit); 25Debug.Assert(left != null); 26Debug.Assert(right != null); 27Debug.Assert(call != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\BoundAnonymousFunction.cs (3)
13Debug.Assert(type != null); 14Debug.Assert(type.IsDelegateType); 15Debug.Assert(argumentScope != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Call.cs (1)
13Debug.Assert(
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Cast.cs (2)
14Debug.Assert(argument != null); 15Debug.Assert((flags & ~(EXPRFLAG.EXF_CAST_ALL | EXPRFLAG.EXF_MASK_ANY)) == 0);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Class.cs (1)
13Debug.Assert(type != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\CompoundOperator.cs (3)
13Debug.Assert((flags & ~EXPRFLAG.EXF_MASK_ANY) == 0); 26Debug.Assert(left != null); 27Debug.Assert(op != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Concatenate.cs (4)
14Debug.Assert(first?.Type != null); 15Debug.Assert(second?.Type != null); 16Debug.Assert(first.Type.IsPredefType(PredefinedType.PT_STRING) || second.Type.IsPredefType(PredefinedType.PT_STRING)); 29Debug.Assert(second.Type.IsPredefType(PredefinedType.PT_STRING));
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Constant.cs (1)
40Debug.Assert(
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\EXPR.cs (2)
34Debug.Assert(!(this is ExprList)); 35Debug.Assert(_type != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\ExprOperator.cs (1)
13Debug.Assert(kind.IsUnaryOperator() || kind > ExpressionKind.TypeLimit);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\FieldInfo.cs (2)
13Debug.Assert(field != null); 14Debug.Assert(fieldType != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\MemberGroup.cs (1)
14Debug.Assert(
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\MethodInfo.cs (4)
17Debug.Assert(method != null); 18Debug.Assert(methodType != null); 57Debug.Assert(m.Name == methodInfo.Name && 126Debug.Assert(c.GetParameters() == null || c.GetParameters().Length == genericInstanceParams.Count);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\PropertyInfo.cs (3)
16Debug.Assert(propertySymbol != null); 17Debug.Assert(propertyType != null); 53Debug.Assert((p.Name == propertyInfo.Name) &&
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\UnaryOperator.cs (7)
13Debug.Assert(kind.IsUnaryOperator()); 14Debug.Assert(operand != null); 21Debug.Assert(kind.IsUnaryOperator()); 22Debug.Assert(operand != null); 23Debug.Assert(type != null); 24Debug.Assert(call != null); 25Debug.Assert(userMethod != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\UserDefinedConversion.cs (2)
15Debug.Assert(argument != null); 16Debug.Assert(call != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\UserDefinedLogicalOperator.cs (3)
13Debug.Assert(trueFalseCall != null); 14Debug.Assert((operatorCall?.OptionalArguments as ExprList)?.OptionalElement != null); 21Debug.Assert(FirstOperandToExamine != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Visitors\ExpressionTreeRewriter.cs (55)
19Debug.Assert(expr != null); 34Debug.Assert(assignment != null); 90Debug.Assert(anonmeth != null); 98Debug.Assert(createParameters != null); 99Debug.Assert(anonmeth.Expression != null); 101Debug.Assert(anonmeth.ArgumentScope.nextChild == null); 114Debug.Assert(expr != null); 121Debug.Assert(local != null); 122Debug.Assert(local.Local.wrap != null); 129Debug.Assert(expr != null); 146Debug.Assert(expr != null); 153Debug.Assert(pExpr != null); 187Debug.Assert(expr != null); 207Debug.Assert(expr != null); 221Debug.Assert(pExpr != null); 235Debug.Assert(pExpr != null); 249Debug.Assert(expr != null); 306Debug.Assert(!expr.MethWithInst.Meth().isVirtual || expr.MemberGroup.OptionalObject != null); 314Debug.Assert(expr != null); 338Debug.Assert(expr != null); 349Debug.Assert(expr != null); 356Debug.Assert(expr != null); 363Debug.Assert(expr != null); 365Debug.Assert(memberGroup.IsDelegate); 367Debug.Assert(oldObject != null); 377Debug.Assert(expr != null); 406Debug.Assert(origL != null); 407Debug.Assert(origR != null); 421Debug.Assert(expr.IsLifted); 428Debug.Assert(expr.IsLifted); 435Debug.Assert(expr.IsLifted); 442Debug.Assert(expr.IsLifted); 478Debug.Assert(expr != null); 495Debug.Assert(!(origOp.Type is NullableType nub) || !nub.UnderlyingType.IsEnumType); 502Debug.Assert(expr != null); 546Debug.Assert(udcall.Kind == ExpressionKind.Call || udcall.Kind == ExpressionKind.UserLogicalOp); 550Debug.Assert(args.OptionalNextListNode.Kind != ExpressionKind.List); 557Debug.Assert(userLogOp != null); 559Debug.Assert(args.OptionalNextListNode.Kind != ExpressionKind.List); 582Debug.Assert(expr != null); 593Debug.Assert(arg != null && arg.Kind != ExpressionKind.List); 633Debug.Assert(expr != null); 655Debug.Assert(args.OptionalNextListNode.Kind != ExpressionKind.List); 683Debug.Assert(pArgument != null); 776Debug.Assert(pUDConversion is ExprUserDefinedConversion); 814Debug.Assert(anonmeth.Expression != null); 834Debug.Assert(expr != null); 835Debug.Assert(expr.MethWithInst.Meth().IsConstructor()); 977Debug.Assert(expr != null); 978Debug.Assert(pp1 != null); 979Debug.Assert(pp1 != null); 980Debug.Assert(pp2 != null); 981Debug.Assert(pp2 != null); 985Debug.Assert(orig1 != null && orig2 != null); 1023Debug.Assert(pExpr != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Visitors\ExprVisitorBase.cs (17)
94Debug.Assert(pExpr != null); 125Debug.Assert(exprRet != null); 128Debug.Assert(exprRet != null); 134Debug.Assert(exprRet != null); 137Debug.Assert(exprRet != null); 155Debug.Assert(exprRet != null); 161Debug.Assert(exprRet != null); 164Debug.Assert(exprRet != null); 167Debug.Assert(exprRet != null); 176Debug.Assert(exprRet != null); 182Debug.Assert(exprRet != null); 200Debug.Assert(exprRet != null); 208Debug.Assert(exprRet != null); 254Debug.Assert(exprRet != null); 257Debug.Assert(exprRet != null); 263Debug.Assert(exprRet != null); 266Debug.Assert(exprRet != null);
Microsoft\CSharp\RuntimeBinder\Semantics\TypeBind.cs (11)
80Debug.Assert(typeVars.Count == typeArgsThis.Count); 127Debug.Assert(mwi.Meth() != null && mwi.GetType() != null && mwi.TypeArgs != null); 128Debug.Assert(mwi.Meth().typeVars.Count == mwi.TypeArgs.Count); 129Debug.Assert(mwi.GetType().OwningAggregate == mwi.Meth().getClass()); 145Debug.Assert(typeVars.Count == typeArgs.Count); 146Debug.Assert(typeVars.Count > 0); 147Debug.Assert(flags == CheckConstraintsFlags.None || flags == CheckConstraintsFlags.NoErrors); 168Debug.Assert(!(arg is PointerType)); 169Debug.Assert(!arg.IsStaticClass); 257Debug.Assert(typeBnd.IsInterfaceType); 339Debug.Assert(typeBnd is AggregateType || typeBnd is TypeParameterType || typeBnd is ArrayType);
Microsoft\CSharp\RuntimeBinder\Semantics\Types\AggregateType.cs (7)
30Debug.Assert(typeArgsThis != null); 62Debug.Assert(outerType == null || outerType.TypeArgsAll != null); 105Debug.Assert(baseClass != null); 194Debug.Assert(type.IsInterfaceType); 222Debug.Assert(IsPredefined); 298Debug.Assert(IsEnumType); 383Debug.Assert(
Microsoft\CSharp\RuntimeBinder\Semantics\Types\PredefinedTypes.cs (1)
189Debug.Assert(s_types[i].Type == (PredefinedType)i);
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeArray.cs (3)
88Debug.Assert(types != null); 101Debug.Assert(Count >= 0); 102Debug.Assert(Array.TrueForAll(Items, item => item != null));
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeManager.cs (42)
45Debug.Assert(iv >= 0); 62Debug.Assert(tpt != null); 70Debug.Assert(args > 0 && args < 32767); 71Debug.Assert(args == 1 || !isSZArray); 84Debug.Assert(pArray.Rank == args); 85Debug.Assert(pArray.ElementType == elementType); 93Debug.Assert(atsOuter == null || atsOuter.OwningAggregate == agg.Parent, ""); 97Debug.Assert(agg.GetTypeVars().Count == typeArgs.Count); 103Debug.Assert(!pAggregate.ConstraintError.HasValue); 108Debug.Assert(pAggregate.OwningAggregate == agg); 109Debug.Assert(pAggregate.TypeArgsThis != null && pAggregate.TypeArgsAll != null); 110Debug.Assert(pAggregate.TypeArgsThis == typeArgs); 118Debug.Assert(typeArgsAll != null && typeArgsAll.Count == agg.GetTypeVarsAll().Count); 129Debug.Assert(cvarOuter <= typeArgsAll.Count); 149Debug.Assert(pPointer.ReferentType == baseType); 157Debug.Assert(!(pUnderlyingType is NullableType), "Attempt to make nullable of nullable"); 179Debug.Assert(pParamModifier.ParameterType == paramType); 191Debug.Assert(typeSrc != null); 199Debug.Assert(typeSrc != null); 312Debug.Assert(tvs.GetIndexInOwnParameters() == tvs.GetIndexInTotalParameters()); 315Debug.Assert(pctx.MethodTypes != null); 332Debug.Assert(typeDst.Equals(SubstType(typeSrc, typeArgsCls, typeArgsMeth, denormMeth))); 393Debug.Assert(typeDst.TypeKind != typeSrc.TypeKind); 428Debug.Assert(atsSrc.TypeArgsAll.Count == atsDst.TypeArgsAll.Count); 449Debug.Assert(typeDst != typeSrc); 453Debug.Assert(tvs.GetIndexInOwnParameters() == index); 454Debug.Assert(tvs.GetIndexInTotalParameters() < pctx.MethodTypes.Length); 462Debug.Assert(index < pctx.ClassTypes.Length); 489Debug.Assert(typeFind.TypeKind != type.TypeKind); 603Debug.Assert(pSymbol.GetTypeParameterType() == null); // Should have been checked first before creating 621Debug.Assert(typeSrc != null); 622Debug.Assert(!(typeSrc is ParameterModifierType)); 623Debug.Assert(!(typeSrc is PointerType)); 632Debug.Assert(!(typeSrc is VoidType) && !(typeSrc is TypeParameterType)); 643Debug.Assert(CSemanticChecker.CheckTypeAccess(typeDst, context)); 674Debug.Assert(CSemanticChecker.CheckTypeAccess(typeDst, context)); 683Debug.Assert(typeSrc is NullableType); 693Debug.Assert(typeSrc != null); 694Debug.Assert(typeSrc.IsInterfaceType || typeSrc.IsDelegateType); 747Debug.Assert(CSemanticChecker.CheckTypeAccess(typeDst, context)); 755Debug.Assert(typeSrc != null); 768Debug.Assert(CSemanticChecker.CheckTypeAccess(typeDst, context));
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeParameterType.cs (1)
19Debug.Assert(symbol.GetTypeParameterType() == null);
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeTable.cs (5)
77Debug.Assert(LookupAggregate(aggregate, outer, args) == null); 92Debug.Assert(LookupArray(elementType, rankNum) == null); 106Debug.Assert(LookupParameterModifier(elementType, isOut) == null); 118Debug.Assert(LookupPointer(elementType) == null); 130Debug.Assert(LookupNullable(underlyingType) == null);
Microsoft\CSharp\RuntimeBinder\Semantics\UnaOpSig.cs (5)
44Debug.Assert(type != null); 62Debug.Assert(pt != PredefinedType.PT_UNDEFINEDINDEX); 73Debug.Assert((_grflt & LiftFlags.Lift2) == 0); 74Debug.Assert((_grflt & LiftFlags.Convert2) == 0); 80Debug.Assert(((_grflt & LiftFlags.Lift1) == 0) || ((_grflt & LiftFlags.Convert1) == 0));
Microsoft\CSharp\RuntimeBinder\Semantics\WithType.cs (2)
131Debug.Assert(ats == null || sym.parent == ats.OwningAggregate); 225Debug.Assert(ats == null || mps != null && mps.getClass() == ats.OwningAggregate);
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (25)
144Debug.Assert(!s_namesLoadedForEachType.Contains(key)); 215Debug.Assert(addedField == null); 416Debug.Assert(t1.IsGenericParameter && t2.IsGenericParameter); 466Debug.Assert(t.IsGenericParameter); 535Debug.Assert((agg != null && bIsAggregate) || (meth != null && !bIsAggregate)); 623Debug.Assert(!(ctype is AggregateType)); 641Debug.Assert(i + 1 < declarationChain.Count); 646Debug.Assert(o is string); 670Debug.Assert(meth != null); 709Debug.Assert(agg != null); 771Debug.Assert(!bAdded); 775Debug.Assert(bAdded); 829Debug.Assert(types != null); 841Debug.Assert(t != null); 936Debug.Assert(type.IsPublic || type.IsNestedPublic); 1080Debug.Assert(fieldInfo.IsFamilyAndAssembly); 1106Debug.Assert(ev.AssociatedEventInfo == eventInfo); 1131Debug.Assert(ev.methAdd != null || ev.methRemove != null); 1366Debug.Assert(method != null || member is ConstructorInfo); 1424Debug.Assert(member.IsFamilyAndAssembly); 1540Debug.Assert(Type.GetTypeCode(defValue.GetType()) != TypeCode.Decimal); // Handled above 1729Debug.Assert(baseMethod != null); 1743Debug.Assert(t is AggregateType); 1745Debug.Assert(aggregate != null); 1822Debug.Assert(t is AggregateType);
Microsoft\CSharp\RuntimeBinder\Syntax\NameManager.cs (3)
161Debug.Assert(key != null); 162Debug.Assert(key.Length >= length); 168Debug.Assert(id < PredefinedName.PN_COUNT);
Microsoft\CSharp\RuntimeBinder\Syntax\NameTable.cs (6)
67Debug.Assert(Array.TrueForAll(_entries, e => e?.Name.Text != name.Text)); 94Debug.Assert(key != null); 95Debug.Assert(length <= key.Length); 115Debug.Assert(candidate != null); 116Debug.Assert(key != null); 117Debug.Assert(length <= key.Length);
Microsoft.Data.Analysis (24)
DataFrameColumns\StringDataFrameColumn.cs (1)
511Debug.Assert(getter != null, "Excepted getter to be valid");
DataFrameColumns\VBufferDataFrameColumn.cs (1)
194Debug.Assert(getter != null, "Excepted getter to be valid");
PrimitiveDataFrameColumn.cs (1)
901Debug.Assert(getter != null, "Excepted getter to be valid");
TextFieldParser.cs (21)
627Debug.Assert(_buffer != null, "There's no buffer"); 628Debug.Assert(_reader != null, "There's no StreamReader"); 631Debug.Assert(BufferLength >= DEFAULT_BUFFER_LENGTH, "Buffer shrunk to below default"); 643Debug.Assert(_buffer != null, "There's no buffer"); 644Debug.Assert(_reader != null, "There's no StreamReader"); 645Debug.Assert((_position >= 0) && (_position <= _buffer.Length), "The cursor is out of range"); 662Debug.Assert(_buffer != null, "There's no buffer"); 663Debug.Assert(_reader != null, "There's no StreamReader"); 675Debug.Assert(_charsRead <= bufferSize, "We've read more chars than we have space for"); 712Debug.Assert(_buffer != null, "There's no buffer"); 713Debug.Assert((cursor >= 0) && (cursor <= _charsRead), "The cursor is out of range"); 878Debug.Assert(_fieldWidths != null, "No field widths"); 910Debug.Assert(line != null, "We are parsing null"); 912Debug.Assert(length > 0, "A blank line shouldn't be parsed"); 915Debug.Assert(!line[0].Equals('\r') && !line[0].Equals('\n'), "A blank line shouldn't be parsed"); 934Debug.Assert(line != null, "No Line sent"); 960Debug.Assert(_fieldWidths[i] > 0, "Bad field width, this should have been caught on input"); 972Debug.Assert(widths != null, "There are no field widths"); 1080Debug.Assert(((_delimitersCopy == null) && (_delimiters == null)) || ((_delimitersCopy != null) && (_delimiters != null)), "Delimiters and copy are not both Nothing or both not Nothing"); 1100Debug.Assert(((_fieldWidthsCopy == null) && (_fieldWidths == null)) || ((_fieldWidthsCopy != null) && (_fieldWidths != null)), "FieldWidths and copy are not both Nothing or both not Nothing"); 1142Debug.Assert(_delimiters != null, "No delimiters set!");
Microsoft.Data.Analysis.Tests (21)
src\Microsoft.Data.Analysis\TextFieldParser.cs (21)
627Debug.Assert(_buffer != null, "There's no buffer"); 628Debug.Assert(_reader != null, "There's no StreamReader"); 631Debug.Assert(BufferLength >= DEFAULT_BUFFER_LENGTH, "Buffer shrunk to below default"); 643Debug.Assert(_buffer != null, "There's no buffer"); 644Debug.Assert(_reader != null, "There's no StreamReader"); 645Debug.Assert((_position >= 0) && (_position <= _buffer.Length), "The cursor is out of range"); 662Debug.Assert(_buffer != null, "There's no buffer"); 663Debug.Assert(_reader != null, "There's no StreamReader"); 675Debug.Assert(_charsRead <= bufferSize, "We've read more chars than we have space for"); 712Debug.Assert(_buffer != null, "There's no buffer"); 713Debug.Assert((cursor >= 0) && (cursor <= _charsRead), "The cursor is out of range"); 878Debug.Assert(_fieldWidths != null, "No field widths"); 910Debug.Assert(line != null, "We are parsing null"); 912Debug.Assert(length > 0, "A blank line shouldn't be parsed"); 915Debug.Assert(!line[0].Equals('\r') && !line[0].Equals('\n'), "A blank line shouldn't be parsed"); 934Debug.Assert(line != null, "No Line sent"); 960Debug.Assert(_fieldWidths[i] > 0, "Bad field width, this should have been caught on input"); 972Debug.Assert(widths != null, "There are no field widths"); 1080Debug.Assert(((_delimitersCopy == null) && (_delimiters == null)) || ((_delimitersCopy != null) && (_delimiters != null)), "Delimiters and copy are not both Nothing or both not Nothing"); 1100Debug.Assert(((_fieldWidthsCopy == null) && (_fieldWidths == null)) || ((_fieldWidthsCopy != null) && (_fieldWidths != null)), "FieldWidths and copy are not both Nothing or both not Nothing"); 1142Debug.Assert(_delimiters != null, "No delimiters set!");
Microsoft.DotNet.ArcadeLogging (4)
MessageBuilder.cs (4)
27Debug.Assert(_state == State.NotStarted || _state == State.Finished); 35Debug.Assert(_state == State.Properties); 46Debug.Assert(_state == State.Properties); 58Debug.Assert(_state == State.Finished);
Microsoft.DotNet.Internal.SymbolHelper (4)
SymbolUploadHelper.cs (4)
63Debug.Assert(logger is not null); 64Debug.Assert(options is not null); 65Debug.Assert(!string.IsNullOrEmpty(symbolToolPath) && (File.Exists(symbolToolPath) || options.IsDryRun)); 281Debug.Assert(entry.Length == 0);
Microsoft.DotNet.NuGetRepack.Tests (2)
TestHelpers\DiffUtil.cs (2)
198Debug.Assert(lengthA >= 0 && lengthB >= 0); 212Debug.Assert(lcsLength <= max);
Microsoft.DotNet.Open.Api.Tools.Tests (1)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
47Debug.Assert(tfms.Length > 0);
Microsoft.DotNet.SignTool (21)
src\BatchSignInput.cs (3)
35Debug.Assert(!filesToSign.IsDefault); 36Debug.Assert(zipDataMap != null); 37Debug.Assert(!filesToCopy.IsDefault);
src\ByteSequenceComparer.cs (2)
68Debug.Assert(x != null); 74Debug.Assert(!x.IsDefault);
src\Configuration.cs (8)
125Debug.Assert(tempDir != null); 126Debug.Assert(itemsToSign != null && !itemsToSign.Any(i => i == null)); 127Debug.Assert(strongNameInfo != null); 128Debug.Assert(fileSignInfo != null); 223Debug.Assert(!isNested); 330Debug.Assert(parentContainer.FullPath != file.FullPath); 767Debug.Assert(Path.GetExtension(archivePath) == ".zip"); 771Debug.Assert(zipFileSignInfo.IsUnpackableContainer());
src\ExplicitCertificateKey.cs (1)
18Debug.Assert(fileName != null);
src\FileSignInfo.cs (3)
133Debug.Assert(pathWithHash.FullPath != null); 134Debug.Assert(!pathWithHash.ContentHash.IsDefault && pathWithHash.ContentHash.Length == 256 / 8); 135Debug.Assert(targetFramework != "");
src\PathWithHash.cs (2)
33Debug.Assert(!contentHash.IsDefault); 34Debug.Assert(fullPath != null);
src\SignedFileContentKey.cs (2)
34Debug.Assert(!contentHash.IsDefault); 35Debug.Assert(fileName != null);
Microsoft.DotNet.SignTool.Tests (1)
StreamUtilities.cs (1)
29Debug.Assert(count > 0);
Microsoft.Extensions.AI (7)
ChatCompletion\AnonymousDelegatingChatClient.cs (2)
122Debug.Assert(_getStreamingResponseFunc is not null, "Expected non-null streaming delegate."); 186Debug.Assert(_getResponseFunc is not null, "Expected non-null non-streaming delegate.");
ChatCompletion\FunctionInvokingChatClient.cs (2)
294Debug.Assert(responseMessages is not null, "Expected to only be here if we have response messages."); 566Debug.Assert(functionCallContents.Count > 0, "Expected at least one function call.");
ChatCompletion\OpenTelemetryChatClient.cs (1)
56Debug.Assert(innerClient is not null, "Should have been validated by the base ctor");
Embeddings\CachingEmbeddingGenerator.cs (1)
105Debug.Assert(results.All(e => e is not null), "Expected all values to be non-null");
Embeddings\OpenTelemetryEmbeddingGenerator.cs (1)
54Debug.Assert(innerGenerator is not null, "Should have been validated by the base ctor.");
Microsoft.Extensions.AI.Abstractions (9)
Contents\DataContent.cs (5)
151Debug.Assert(_data is not null, "Expected _data to be initialized."); 160Debug.Assert(wrote, "Expected to successfully write the data URI."); 201Debug.Assert(_dataUri is not null, "Expected dataUri to be initialized."); 205Debug.Assert(_data is not null, "Expected data to be initialized."); 219Debug.Assert(pos >= 0, "Expected comma to be present in the URI.");
Functions\AIFunctionFactory.cs (3)
556Debug.Assert(target is null, "Expected target to be null when we have a non-null target type"); 557Debug.Assert(!FunctionDescriptor.Method.IsStatic, "Expected an instance method"); 1006Debug.Assert(specializedType.IsGenericType && specializedType.GetGenericTypeDefinition() == genericMethodDefinition.DeclaringType, "generic member definition doesn't match type.");
Utilities\AIJsonUtilities.Schema.Transform.cs (1)
199Debug.Assert(path != null, "Path should not be null when TransformSchemaNode is provided.");
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceChatClient.cs (1)
511Debug.Assert(contents is { Count: > 0 }, "Expected non-empty contents");
Microsoft.Extensions.AI.Ollama (1)
OllamaUtilities.cs (1)
42Debug.Assert(!response.IsSuccessStatusCode, "must only be invoked for unsuccessful responses.");
Microsoft.Extensions.AI.OpenAI (19)
OpenAIResponseChatClient.cs (1)
106Debug.Assert(message.Contents is List<AIContent>, "Expected a List<AIContent> for message contents.");
src\Shared\ServerSentEvents\ArrayBuffer.cs (9)
41Debug.Assert(initialSize > 0 || usePool); 53Debug.Assert(buffer.Length > 0); 78Debug.Assert(_usePool); 79Debug.Assert(_bytes is not null); 118Debug.Assert(byteCount <= AvailableLength); 134Debug.Assert(AvailableLength < byteCount); 138Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0); 150Debug.Assert(byteCount <= AvailableLength); 179Debug.Assert(byteCount <= AvailableLength);
src\Shared\ServerSentEvents\Helpers.cs (4)
35Debug.Assert(buffer.Length >= MaxDecimalDigits); 38Debug.Assert(success); 53Debug.Assert(value.Length <= buffer.Length); 67Debug.Assert(maxByteCount <= buffer.Length);
src\Shared\ServerSentEvents\SseFormatter.cs (4)
104Debug.Assert(bufferWriter.WrittenCount is 0); 108Debug.Assert(!eventType.AsSpan().ContainsLineBreaks()); 120Debug.Assert(!eventId.AsSpan().ContainsLineBreaks()); 129Debug.Assert(retry >= TimeSpan.Zero);
src\Shared\ServerSentEvents\SseParser_1.cs (1)
292Debug.Assert(_newlineIndex - _lineOffset < _lineLength, "Expected to be positioned at a non-empty newline");
Microsoft.Extensions.ApiDescription.Client.Tests (1)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
47Debug.Assert(tfms.Length > 0);
Microsoft.Extensions.ApiDescription.Tool.Tests (1)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
47Debug.Assert(tfms.Length > 0);
Microsoft.Extensions.Caching.Hybrid (29)
Internal\BufferChunk.cs (10)
31Debug.Assert(array is not null, "expected valid array input"); 41Debug.Assert(!ReturnToPool, "do not return right-sized arrays"); 42Debug.Assert(Length == array.Length, "array length not respected"); 47Debug.Assert(array is not null, "expected valid array input"); 48Debug.Assert(length >= 0, "expected valid length"); 52Debug.Assert(ReturnToPool == returnToPool, "return-to-pool not respected"); 53Debug.Assert(Length == length, "length not respected"); 84Debug.Assert(OversizedArray is null && !ReturnToPool, "expected clean slate after recycle"); 98Debug.Assert(copy.Length == Length, "same length expected"); 99Debug.Assert(!copy.ReturnToPool, "do not return to pool");
Internal\DefaultHybridCache.CacheItem.cs (1)
65Debug.Assert(newCount >= 0, "over-release detected");
Internal\DefaultHybridCache.L2.cs (2)
86Debug.Assert(buffer.OversizedArray is not null, "array should be non-null"); 140Debug.Assert(HasBackendCache, "shouldn't be here without L2");
Internal\DefaultHybridCache.Stampede.cs (1)
99Debug.Assert(existingType != newType, "should be different types");
Internal\DefaultHybridCache.StampedeStateT.cs (8)
49Debug.Assert(_underlying is null, "should not already have factory field"); 50Debug.Assert(underlying is not null, "factory argument should be meaningful"); 67Debug.Assert(_underlying is null, "should not already have factory field"); 68Debug.Assert(underlying is not null, "factory argument should be meaningful"); 107Debug.Assert(ReferenceEquals(first, stampede.Task), "should not be cancelled"); 128Debug.Assert(_result is not null, "result should be assigned"); 447Debug.Assert(value.OversizedArray is not null, "expected buffer"); 475Debug.Assert((Key.Flags & FlagsDisableL1AndL2Write) == FlagsDisableL1AndL2Write, "Only expected if L1+L2 disabled");
Internal\HybridCacheEventSource.cs (1)
230Debug.Assert(IsEnabled(), $"Missing check to {nameof(HybridCacheEventSource)}.{nameof(Log)}.{nameof(IsEnabled)} from {caller}");
Internal\InbuiltTypeSerializer.cs (1)
59Debug.Assert(actual == length, "encoding length mismatch");
Internal\RecyclableArrayBufferWriter.cs (4)
120Debug.Assert(_buffer.Length > _index, "should have some space"); 127Debug.Assert(_buffer.Length > _index, "should have some space"); 181Debug.Assert(needed > currentLength, "should need to grow"); 201Debug.Assert(FreeCapacity > 0 && FreeCapacity >= sizeHint, "should be space");
Internal\TagSet.cs (1)
35Debug.Assert(tags is { Length: > 1 }, "should be non-trivial array");
Microsoft.Extensions.Caching.Memory (3)
CacheEntry.CacheEntryTokens.cs (1)
116Debug.Assert(entry._tokens != null);
CacheEntry.cs (1)
208Debug.Assert(_current.Value == this, "Entries disposed in invalid order");
MemoryCache.cs (1)
501Debug.Assert(entry.Key == priorEntry.Key);
Microsoft.Extensions.Configuration (5)
ConfigurationProvider.cs (2)
76Debug.Assert(ConfigurationPath.KeyDelimiter == ":"); 98Debug.Assert(ConfigurationPath.KeyDelimiter == ":");
ReferenceCountedProviders.cs (3)
48Debug.Assert(_refCount > 0); 53Debug.Assert(_refCount > 0); 63Debug.Assert(_refCount > 0);
Microsoft.Extensions.Configuration.Binder (9)
BindingPoint.cs (2)
60Debug.Assert(!IsReadOnly); 61Debug.Assert(!_valueSet);
ConfigurationBinder.cs (7)
470Debug.Assert(bindingPoint.Value is not null); 505Debug.Assert(section is not null); 720Debug.Assert(source is not null); 721Debug.Assert(addMethod is not null); 742Debug.Assert(dictionaryType.IsGenericType && 938Debug.Assert(source is not null); 939Debug.Assert(addMethod is not null);
Microsoft.Extensions.Configuration.Json (1)
JsonConfigurationFileParser.cs (1)
91Debug.Assert(_paths.Count > 0);
Microsoft.Extensions.DependencyInjection (16)
DependencyInjectionEventSource.cs (1)
283Debug.Assert(instance != null, "descriptor.ImplementationInstance != null");
ServiceLookup\CallSiteFactory.cs (10)
72Debug.Assert(implementationType != null); 105Debug.Assert(serviceTypeGenericArguments.Length == implementationTypeGenericArguments.Length); 405Debug.Assert(keyedSlotAssignment is not null); 498Debug.Assert(callSite != null); 532Debug.Assert(implementationType != null, "descriptor.ImplementationType != null"); 556Debug.Assert(site != null); 656Debug.Assert(parameterCallSites != null); 830Debug.Assert(_item != null); 841Debug.Assert(_items == null); 891Debug.Assert(_items == 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)
122Debug.Assert(!ServiceProvider.VerifyAotCompatibility || !elementType.IsValueType, "VerifyAotCompatibility=true will throw during building the IEnumerableCallSite if elementType is a ValueType."); 131Debug.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.");
ServiceProvider.cs (1)
215System.Diagnostics.Debug.Assert(result is null || CallSiteFactory.IsService(serviceIdentifier));
Microsoft.Extensions.DependencyInjection.Abstractions (10)
ActivatorUtilities.cs (8)
130Debug.Assert(!constructor.IsPreferred); 587Debug.Assert(false); 617Debug.Assert(parameterMap != null); 670Debug.Assert(parameterMap != null); 923Debug.Assert(parameters.Length >= 1 && parameters.Length <= FixedArgumentThreshold); 924Debug.Assert(FixedArgumentThreshold == 4); 980Debug.Assert(parameters.Length >= 1 && parameters.Length <= FixedArgumentThreshold); 981Debug.Assert(FixedArgumentThreshold == 4);
ServiceDescriptor.cs (2)
323Debug.Assert(typeArguments.Length == 2); 342Debug.Assert(typeArguments.Length == 3);
Microsoft.Extensions.DependencyModel (14)
DependencyContextJsonReader.cs (1)
81Debug.Assert(rented.Length >= utf8Bom.Length);
DependencyContextLoader.cs (1)
93Debug.Assert(_fileSystem.File.Exists(location));
DependencyContextWriter.cs (7)
159Debug.Assert(compilationLibrary.Serviceable == runtimeLibrary.Serviceable); 160Debug.Assert(compilationLibrary.Version == runtimeLibrary.Version); 161Debug.Assert(compilationLibrary.Hash == runtimeLibrary.Hash); 162Debug.Assert(compilationLibrary.Type == runtimeLibrary.Type); 163Debug.Assert(compilationLibrary.Path == runtimeLibrary.Path); 164Debug.Assert(compilationLibrary.HashPath == runtimeLibrary.HashPath); 165Debug.Assert(compilationLibrary.RuntimeStoreManifestName == null);
Resolution\AppBaseCompilationAssemblyResolver.cs (1)
85Debug.Assert(sharedDirectory != null);
Utf8JsonReaderExtensions.cs (4)
91Debug.Assert(reader.IsTokenTypeProperty()); 101Debug.Assert(!reader.IsTokenTypeProperty()); 107Debug.Assert(reader.IsTokenTypeProperty()); 122Debug.Assert(reader.IsTokenTypeProperty());
Microsoft.Extensions.Diagnostics (7)
Metrics\DebugConsoleMetricListener.cs (2)
44Debug.Assert(userState == this); 63Debug.Assert(state == this);
Metrics\DefaultMeterFactory.cs (1)
28Debug.Assert(options.Name is not null);
src\libraries\Common\src\System\Diagnostics\DiagnosticsHelper.cs (4)
141Debug.Assert(index >= 0); 142Debug.Assert(index < _maxIndex); 152Debug.Assert(index >= 0); 153Debug.Assert(index < _maxIndex);
Microsoft.Extensions.FileProviders.Embedded (1)
Manifest\EmbeddedFilesManifest.cs (1)
65Debug.Assert(path.Length > 0);
Microsoft.Extensions.FileProviders.Physical (5)
Internal\FileSystemInfoHelper.cs (1)
51Debug.Assert(fileInfo.Exists);
PhysicalFileProvider.cs (1)
153Debug.Assert(!_fileWatcherInitialized);
PhysicalFilesWatcher.cs (1)
470Debug.Assert(state != null);
PollingFileChangeToken.cs (1)
67Debug.Assert(_tokenSource == null, "We expect CancellationTokenSource to be initialized exactly once.");
PollingWildCardChangeToken.cs (1)
77Debug.Assert(_tokenSource == null, "We expect CancellationTokenSource to be initialized exactly once.");
Microsoft.Extensions.Hosting (4)
HostApplicationBuilder.cs (1)
122Debug.Assert(empty, "should only be called with empty: true");
Internal\ConsoleLifetime.netcoreapp.cs (1)
29Debug.Assert(context.Signal == PosixSignal.SIGINT || context.Signal == PosixSignal.SIGQUIT || context.Signal == PosixSignal.SIGTERM);
Internal\Host.cs (1)
240Debug.Assert(_hostedServices != null, "Hosted services are resolved when host is started.");
Internal\ServiceFactoryAdapter.cs (1)
36Debug.Assert(_factoryResolver != null && _contextResolver != null);
Microsoft.Extensions.Hosting.Systemd (1)
SystemdLifetime.netcoreapp.cs (1)
23Debug.Assert(context.Signal == PosixSignal.SIGTERM);
Microsoft.Extensions.Hosting.WindowsServices (3)
WindowsServiceLifetimeHostBuilderExtensions.cs (3)
110Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); 116Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); 137Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
Microsoft.Extensions.Http (9)
ActiveHandlerTrackingEntry.cs (3)
61Debug.Assert(Lifetime != Timeout.InfiniteTimeSpan); 78Debug.Assert(_callback != null); 79Debug.Assert(_timer != null);
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");
DependencyInjection\DefaultHttpClientBuilder.cs (1)
15Debug.Assert(tracker != null);
DependencyInjection\HttpClientBuilderExtensions.cs (1)
789Debug.Assert(registry != null);
src\libraries\Common\src\System\Net\Http\UriRedactionHelper.cs (1)
36Debug.Assert(pathAndQuery is not null);
Microsoft.Extensions.Identity.Core (5)
DefaultPersonalDataProtector.cs (1)
36Debug.Assert(data != null);
Rfc6238AuthenticationService.cs (4)
40Debug.Assert(res); 53Debug.Assert(res); 54Debug.Assert(written == hash.Length); 61Debug.Assert(offset + 4 < hash.Length);
Microsoft.Extensions.Logging (5)
LoggerFactoryScopeProvider.cs (2)
139Debug.Assert(activity != null); 140Debug.Assert(activityTrackingOption != ActivityTrackingOptions.None);
LoggerInformation.cs (2)
50Debug.Assert(logger != null || externalScopeProvider != null, "Logger can't be null when there isn't an ExternalScopeProvider"); 67Debug.Assert(Logger != null);
src\libraries\Common\src\Extensions\ProviderAliasUtilities\ProviderAliasUtilities.cs (1)
27Debug.Assert(arg.ArgumentType == typeof(string));
Microsoft.Extensions.Logging.Abstractions (6)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 281Debug.Assert(additionalCapacityBeyondPos > 0); 282Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.Extensions.Logging.Configuration (1)
src\libraries\Common\src\Extensions\ProviderAliasUtilities\ProviderAliasUtilities.cs (1)
27Debug.Assert(arg.ArgumentType == typeof(string));
Microsoft.Extensions.Logging.Console (16)
ConsoleLoggerProcessor.cs (2)
122Debug.Assert(FullMode == ConsoleLoggerQueueFullMode.Wait); 128Debug.Assert(_messageQueue.Count < MaxQueueLength);
src\libraries\Common\src\System\Net\ArrayBuffer.cs (9)
40Debug.Assert(initialSize > 0 || usePool); 52Debug.Assert(buffer.Length > 0); 77Debug.Assert(_usePool); 78Debug.Assert(_bytes is not null); 117Debug.Assert(byteCount <= AvailableLength); 133Debug.Assert(AvailableLength < byteCount); 137Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0); 149Debug.Assert(byteCount <= AvailableLength); 179Debug.Assert(byteCount <= AvailableLength);
src\libraries\Common\src\System\Text\Json\PooledByteBufferWriter.cs (5)
44Debug.Assert(initialCapacity > 0); 45Debug.Assert(_buffer.ActiveLength == 0); 56Debug.Assert(sizeHint > 0); 64Debug.Assert(sizeHint > 0); 78Debug.Assert(_stream is not null);
Microsoft.Extensions.Logging.Debug (1)
DebugLogger.cs (1)
59System.Diagnostics.Debug.Assert(exception != null);
Microsoft.Extensions.Logging.EventSource (17)
LoggingEventSource.cs (17)
151Debug.Assert(LoggerName != null); 152Debug.Assert(ActivityTraceId != null); 153Debug.Assert(ActivitySpanId != null); 154Debug.Assert(ActivityTraceFlags != null); 203Debug.Assert(LoggerName != null); 204Debug.Assert(Exception != null); 205Debug.Assert(ActivityTraceId != null); 206Debug.Assert(ActivitySpanId != null); 207Debug.Assert(ActivityTraceFlags != null); 268Debug.Assert(LoggerName != null); 269Debug.Assert(ExceptionJson != null); 270Debug.Assert(ArgumentsJson != null); 271Debug.Assert(ActivityTraceId != null); 272Debug.Assert(ActivitySpanId != null); 273Debug.Assert(ActivityTraceFlags != null); 563Debug.Assert(str != null); 567Debug.Assert(pinnedString == rePinnedString);
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Parser.cs (1)
104Debug.Assert(logMethodSymbol != null, "log method is present.");
Microsoft.Extensions.Options.DataAnnotations (2)
DataAnnotationValidateOptions.cs (2)
67Debug.Assert(errors is not null && errors.Count > 0); 76Debug.Assert(options is not null);
Microsoft.Extensions.Primitives (6)
CompositeChangeToken.cs (2)
124Debug.Assert(state != null); 149Debug.Assert(disposables != null);
StringSegment.cs (1)
108Debug.Assert(Buffer is not null);
StringValues.cs (1)
192Debug.Assert(value is string[]);
ThrowHelper.cs (2)
61Debug.Assert(Enum.IsDefined(typeof(ExceptionResource), resource), 79Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument),
Microsoft.Extensions.SecretManager.Tools.Tests (1)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
47Debug.Assert(tfms.Length > 0);
Microsoft.Extensions.ServiceDiscovery.Dns (5)
Resolver\DnsDataWriter.cs (1)
50Debug.Assert(label.Length <= 63, "Label length must not exceed 63 bytes.");
Resolver\DnsResolver.cs (4)
305Debug.Assert(record.Type == QueryType.CNAME, "Only CNAME records should be processed here."); 314Debug.Assert(gotArray, "Failed to get array segment"); 315Debug.Assert(segment.Array == messageBytes.Array, "record data backed by different array than the original message"); 330Debug.Assert(record.Type is QueryType.A or QueryType.AAAA, "Only CNAME records should be processed here.");
Microsoft.Extensions.ServiceDiscovery.Dns.Tests.Fuzzing (1)
Fuzzers\DnsResponseFuzzer.cs (1)
41Debug.Assert(task.IsCompleted, "Task should be completed synchronously");
Microsoft.Extensions.TimeProvider.Testing (1)
FakeTimeProvider.cs (1)
176Debug.Assert(TimestampFrequency == TimeSpan.TicksPerSecond, "Assuming frequency equals ticks per second");
Microsoft.Extensions.Validation.GeneratorTests (1)
ValidationsGeneratorTestBase.cs (1)
489Debug.Assert(_hostTcs.Task.IsCompleted);
Microsoft.Extensions.Validation.ValidationsGenerator (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.Gen.Logging (1)
Parsing\TemplateProcessor.cs (1)
142Debug.Assert(searchedBrace is '{' or '}', "Searched brace must be { or }");
Microsoft.Interop.LibraryImportGenerator (1)
LibraryImportGenerator.cs (1)
439Debug.Assert(!options.GenerateForwarders, "GenerateForwarders should have already been handled to use a forwarder stub");
Microsoft.JSInterop (4)
DotNetObjectReferenceOfT.cs (1)
51Debug.Assert(_objectId != 0, "Accessing ObjectId without tracking is always incorrect.");
Infrastructure\DotNetDispatcher.cs (1)
227Debug.Assert(count == receivedBytes);
JSRuntime.cs (1)
361Debug.Assert(dotNetObjectReference.ObjectId != 0);
src\Components\Shared\src\ArrayBuilder.cs (1)
180Debug.Assert(newCapacity > _items.Length);
Microsoft.JSInterop.Tests (2)
JSRuntimeTest.cs (2)
148Debug.Assert(poco != null); 173Debug.Assert(poco != null);
Microsoft.Maui (5)
Fonts\FileSystemEmbeddedFontLoader.cs (1)
46 Debug.Assert(_rootPath != null || _getRootPath != null, $"The ctor should have set either {nameof(_rootPath)} or {nameof(_getRootPath)}.");
Hosting\ImageSources\ImageSourceToImageSourceServiceTypeMapping.cs (1)
34 Debug.Assert(typeof(IImageSource).IsAssignableFrom(type));
Hosting\Internal\RegisteredHandlerServiceTypeSet.cs (1)
32 Debug.Assert(typeof(IElement).IsAssignableFrom(type));
Layouts\GridLayoutManager.cs (2)
615 Debug.Assert(starCount > 0, "The caller of ResolveStars has already checked that there are star values to resolve."); 895 Debug.Assert(starCount > 0, "Assume that the caller has already checked for the existence of star rows/columns before using this.");
Microsoft.Maui.Controls (1)
BindingExpression.cs (1)
162 Debug.Assert(part != null, "There should always be at least the self part in the expression.");
Microsoft.Maui.Controls.Xaml (5)
XamlParser.cs (5)
54 Debug.Assert(reader.NodeType == XmlNodeType.Element); 67 Debug.Assert(reader.Name == elementName); //make sure we close the right element 139 Debug.Assert(reader.NodeType == XmlNodeType.Element); 151 Debug.Assert(reader.Name == name); 206 Debug.Assert(reader.NodeType == XmlNodeType.Element);
Microsoft.Maui.Graphics (1)
Color.cs (1)
761 Debug.Assert(charsWritten == value.Length);
Microsoft.ML.Tokenizers (4)
Model\EnglishRobertaTokenizer.cs (1)
977Debug.Assert(pairs.Count != 0, "Pairs should not be empty.");
PreTokenizer\CompositePreTokenizer.cs (2)
92Debug.Assert(preTokenizerIndex < preTokenizers.Count, "Index out of range for pre-tokenizers."); 170Debug.Assert(preTokenizerIndex < preTokenizers.Count, "Index out of range for pre-tokenizers.");
Utils\ValueStringBuilder.cs (1)
395Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.ML.Tokenizers.Tests (14)
src\Microsoft.ML.Tokenizers\Utils\Helpers.cs (11)
32Debug.Assert(span.Length <= newSize); 69Debug.Assert(!text.IsEmpty); 70Debug.Assert(Encoding.UTF8.GetMaxByteCount(text.Length) <= destination.Length); 71Debug.Assert(indexMapping.Length >= destination.Length); 123Debug.Assert(!text.IsEmpty); 124Debug.Assert(destination.Length >= 4); 161Debug.Assert(!text.IsEmpty); 162Debug.Assert(Encoding.UTF8.GetMaxByteCount(text.Length) <= destination.Length); 163Debug.Assert(indexMapping.Length >= destination.Length); 237Debug.Assert(utf16Chars.Length >= GetUtf16LengthFromUtf8Bytes(utf8Bytes)); 321Debug.Assert(input.Length > 0);
src\Microsoft.ML.Tokenizers\Utils\Helpers.netcoreapp.cs (3)
45Debug.Assert(success); 46Debug.Assert(bytes.Length == bytesWritten); 81Debug.Assert(textIndex < text.Length);
Microsoft.Net.Http.Headers (3)
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.");
SetCookieHeaderValue.cs (1)
269Debug.Assert(formatted);
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") 999Debug.Assert(Me.IsWindowsRuntimeObject(), "Expected a Windows Runtime Object") 1146Debug.Assert(Me.IsArray, "expected array when getting array value") 1147Debug.Assert(indices IsNot Nothing, "expected valid indices") 1195Debug.Assert(Me.IsArray, "expected array when setting array value") 1196Debug.Assert(arguments IsNot Nothing, "expected valid indices") 1258Debug.Assert(callTarget IsNot Nothing, "must have valid MethodBase") 1260Debug.Assert(Not targetProcedure.IsGeneric OrElse 1478Debug.Assert(Me.ArgumentsValidated, "can't bind without validating arguments") 1479Debug.Assert(Me.IsMethod, "binding to a non-method") 1491Debug.Assert(Me.IsMethod, "casting a non-method to a method") 1496Debug.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.")
Microsoft.VisualStudio.LanguageServices (12)
GenerateType\GenerateTypeDialogViewModel.cs (3)
88Debug.Assert(_accessListMap.ContainsKey(SelectedAccessibilityString), "The Accessibility Key String not present"); 139Debug.Assert(_typeKindMap.ContainsKey(SelectedTypeKindString), "The TypeKind Key String not present"); 172Debug.Assert(languageName == LanguageNames.VisualBasic, "Currently only C# and VB are supported");
Interop\CleanableWeakComHandleTable.cs (1)
127Debug.Assert(_table.ContainsKey(key), "Key not found in table.");
Interop\ComAggregate.cs (2)
50Debug.Assert(value is T, "Why are you casting an object to an reference type it doesn't support?"); 62Debug.Assert(target is T, "Why are you casting an object to an reference type it doesn't support?");
Interop\ComHandle.cs (1)
75Debug.Assert(_handle == null || Marshal.IsComObject(_handle), "Invariant broken!");
LanguageService\AbstractLanguageService`2.cs (1)
82Debug.Assert(!this.Package.JoinableTaskFactory.Context.IsOnMainThread, "Language service should be instantiated on background thread");
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager.cs (1)
332Debug.Assert(rgSymbolNodes != null || ulcNodes > 0, "Invalid input parameters into CreateNavInfo");
ProjectSystem\InvisibleEditor.cs (1)
190=> Debug.Assert(Environment.HasShutdownStarted, GetType().Name + " was leaked without Dispose being called.");
ProjectSystem\Legacy\AbstractLegacyProject_IVsHierarchyEvents.cs (1)
18Debug.Assert(!this.AreHierarchyEventsConnected, "IVsHierarchyEvents are already connected!");
ProjectSystem\MetadataReferences\VisualStudioMetadataReferenceManager.cs (1)
294Debug.Assert(pImage != IntPtr.Zero, "Base address should not be zero if GetFileFlatMapping call succeeded.");
Microsoft.VisualStudio.LanguageServices.DevKit (5)
Logging\VSCodeTelemetryLogger.cs (5)
41Debug.Assert(_telemetrySession == null); 63Debug.Assert(_telemetrySession != null); 72Debug.Assert(_telemetrySession != null); 85Debug.Assert(found); 102Debug.Assert(_telemetrySession != null);
MSBuild (11)
CommandLineSwitches.cs (6)
449Debug.Assert(s_parameterlessSwitchesMap.Length == (int)ParameterlessSwitch.NumberOfParameterlessSwitches, 451Debug.Assert(s_parameterizedSwitchesMap.Length == (int)ParameterizedSwitch.NumberOfParameterizedSwitches, 456Debug.Assert(i == (int)(s_parameterlessSwitchesMap[i].parameterlessSwitch), 460Debug.Assert(!string.IsNullOrEmpty(s_parameterlessSwitchesMap[i].resourceId), "All parameterless switches should be cross-checked against the help message strings"); 466Debug.Assert(i == (int)(s_parameterizedSwitchesMap[i].parameterizedSwitch), 471Debug.Assert(!string.IsNullOrEmpty(s_parameterizedSwitchesMap[i].resourceId), "All parameterized switches should be cross-checked against the help message strings except from project switch");
InterningBinaryReader.cs (1)
173Debug.Assert(false, e.ToString());
QuotingUtilities.cs (1)
90Debug.Assert(false, "Null character in parameter");
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.");
XMake.cs (1)
3824Debug.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 || Array.IndexOf(AllWaves, wave) >= 0, $"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 (200)
Microsoft\Build\Tasks\Windows\GenerateTemporaryTargetAssembly.cs (4)
185Debug.Assert(targetOutputs.ContainsKey(CompileTargetName)); 186Debug.Assert(targetOutputs[CompileTargetName].Length == 1); 300Debug.Assert(targetOutputs.ContainsKey(CompileTargetName)); 301Debug.Assert(targetOutputs[CompileTargetName].Length == 1);
MS\Internal\MarkupCompiler\MarkupCompiler.cs (29)
259Debug.Assert(!cu.Pass2); 281Debug.Assert(!cu.Pass2); 292Debug.Assert(!cu.Pass2 || _pendingLocalFiles == null); 293Debug.Assert(_pendingLocalFiles == null || _pendingLocalFiles.Count == 0); 580Debug.Assert(_codeContexts.Count == 0); 958Debug.Assert(_ccRoot.StyleConnectorFn.Statements.Count > 0); 960Debug.Assert(ccsConnector != null); 1829Debug.Assert(desc != null); 1901Debug.Assert(pis != null && pis.Length == 2 && KnownTypes.Types[(int)KnownElements.DependencyObject].IsAssignableFrom(pis[0].ParameterType)); 2028Debug.Assert(_ccRoot != null && _ccRoot.SubClass.Length > 0); 2101Debug.Assert(CompilerInfo != null && CompilerInfo.IsCodeDomProviderTypeValid); 2303Debug.Assert(genericName.Length > 0 || t.IsGenericTypeDefinition); 2307Debug.Assert(genericName.Length == 0 && typeArgsList != null); 2393Debug.Assert(typeArgsList != null && typeArgsList.Length == refTypeParams.Length); 2460Debug.Assert(_typeArgsList == null || (baseClass.IsGenericType && baseClass.IsGenericTypeDefinition)); 2461Debug.Assert(_typeArgsList != null || !baseClass.IsGenericType); 2528Debug.Assert(!string.IsNullOrEmpty(baseName)); 2534Debug.Assert(_ccRoot == null); 2535Debug.Assert(_codeContexts == null || _codeContexts.Count == 0, "mismatched CodeContexts"); 2558Debug.Assert(HasLocalReference, "if we have a local event, there should be a local mapping PI for it"); 3037Debug.Assert(_codeContexts.Count == 0, "mismatched codecontext"); 3039Debug.Assert(_ccRoot != null); 3088Debug.Assert(cc != null); 3092Debug.Assert(_ccRoot == (cc as CodeContextRoot)); 3093Debug.Assert(_ccRoot.CodeClass != null); 3117Debug.Assert(_ccRoot.HookupFn == null); 3170Debug.Assert(_ccRoot == (_codeContexts.Peek() as CodeContextRoot)); 3171Debug.Assert(_ccRoot.ElementType == null || 3195Debug.Assert(_ccRoot == (_codeContexts.Peek() as CodeContextRoot));
MS\Internal\MarkupCompiler\ParserExtension.cs (5)
40Debug.Assert(bamlWriter != null, "Need a BamlRecordWriter for compiling to Baml"); 149Debug.Assert(_name == null && _nameField == null, "Name has already been set"); 344Debug.Assert(_name == null && _nameField == null, "Name has already been set"); 791Debug.Assert(_name == null && _nameField == null, "Name definition has already been set"); 905Debug.Assert(bamlMemStream != null);
MS\Internal\MarkupCompiler\PathInternal.cs (1)
40Debug.Assert(comparisonType == StringComparison.Ordinal || comparisonType == StringComparison.OrdinalIgnoreCase);
MS\Internal\MarkupCompiler\VersionHelper.cs (2)
61Debug.Assert(!allowWildcard || maxValue < ushort.MaxValue); 199Debug.Assert(revision < ushort.MaxValue);
MS\Internal\Tasks\CompilerLocalReference.cs (3)
176Debug.Assert(!String.IsNullOrEmpty(_localCacheFile), "_localCacheFile must not be empty."); 177Debug.Assert(mcPass1 != null, "A valid instance of MarkupCompilePass1 must be passed to method SaveCacheInformation."); 238Debug.Assert(!String.IsNullOrEmpty(_localCacheFile), "_localCacheFile must not be empty.");
MS\Internal\Tasks\CompilerState.cs (7)
90Debug.Assert(!String.IsNullOrEmpty(_stateFilePath), "StateFilePath must not be empty."); 91Debug.Assert(mcPass1 != null, "A valid instance of MarkupCompilePass1 must be passed to method SaveCacheInformation."); 92Debug.Assert(_cacheInfoList.Length == (int)CompilerStateType.MaxCount, "The Cache string array should be already allocated."); 151Debug.Assert(!String.IsNullOrEmpty(_stateFilePath), "_stateFilePath must be not be empty."); 152Debug.Assert(_cacheInfoList.Length == (int)CompilerStateType.MaxCount, "The Cache string array should be already allocated."); 260Debug.Assert(src[str.Length] == '\0', "src[str.Length] == '\\0'"); 261Debug.Assert(((int)src) % 4 == 0, "Managed string should start at 4 bytes boundary");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\MS\Internal\Globalization\LocalizationComments.cs (1)
346Debug.Assert(enumPrefix != null && enumNames != null);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlMapTable.cs (10)
61Debug.Assert(null != xamlTypeMapper); 149Debug.Assert(cmp > 0); 1004Debug.Assert(assemblyFullName.Length != 0, "empty assembly"); 1041Debug.Assert(bamlAssemblyInfoRecord.AssemblyId >= 0); 1078Debug.Assert( 1091Debug.Assert(bamlAssemblyInfoRecord.AssemblyId >= 0); 1271Debug.Assert(ownerTypeName != null); 1272Debug.Assert(attributeName != null); 1457Debug.Assert(GetHashTableData(stringValue) == null, 1492Debug.Assert(targetType != null && memberName != null);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecords.cs (24)
765Debug.Assert(null == _writeCache[(int)record.RecordType]); 855set { Debug.Assert (value == -1, "Setting fixed record to an invalid size"); } 902Debug.Assert( value <= 3 && value >= 0 ); 1090Debug.Assert(RecordSize < 0); 1500Debug.Assert(_valuePositionPosition != -1, 1683Debug.Assert(_valuePositionPosition != -1, 2048set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2118set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2179set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2386Debug.Assert(value <= ExtensionIdMask); 2406set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 2983set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 3197set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3284set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3433Debug.Assert(_contentSizePosition != -1, 3478set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3638set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 3736set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 3814set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 3999Debug.Assert(FilePos != -1,"UpdateWrite called but Write Never was"); 4542Debug.Assert( SerializerTypeId != 0 ); 4695Debug.Assert((propertyMember is MethodInfo) || (propertyMember is PropertyInfo) 4714Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null); 4757Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecordWriter.cs (21)
133Debug.Assert(null != DocumentStartRecord); 404Debug.Assert(_deferElementDepth == 0); 405Debug.Assert(_deferComplexPropertyDepth == 0); 406Debug.Assert(_staticResourceElementDepth == 0); 407Debug.Assert(_dynamicResourceElementDepth == 0); 408Debug.Assert(_staticResourceRecordList == null); 426Debug.Assert(_staticResourceElementDepth == 0); 463Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 562Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 598Debug.Assert(!InStaticResourceSection, "We do not support x:Shared within a StaticResource Section"); 782Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 838Debug.Assert(keyRecord.RecordList.Count == 0, "Should have empty record list"); 864Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 875Debug.Assert(_deferElementDepth == 2); 1064Debug.Assert(extensionTypeId != (short)KnownElements.TypeExtension); 1081Debug.Assert(typeValue != null); 1626Debug.Assert(keyRecord != null, "Unknown key record type in defer load dictionary"); 1634Debug.Assert(keyIndex == _deferKeys.Count, 1657Debug.Assert(_deferElementDepth > 0 && CollectingValues, 1665Debug.Assert(valueDeferRecord.Record != null && 1677Debug.Assert(valueDeferRecord.Record != null && valueDeferRecord.Record.RecordType == BamlRecordType.ElementEnd,
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlVersionHeader.cs (2)
102Debug.Assert(length == BamlVersionHeader.BinarySerializationSize, 107Debug.Assert((posEnd-posStart) == BamlVersionHeader.BinarySerializationSize,
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\KnownTypes.cs (3)
4755Debug.Assert(asmFramework != null, "asmFramework must not be null"); 4756Debug.Assert(asmCore != null, "asmCore must not be null"); 4757Debug.Assert(asmBase != null, "asmBase must not be null");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\MarkupExtensionParser.cs (3)
1181Debug.Assert(sb.Length > 0); 1182Debug.Assert(!Char.IsWhiteSpace(sb[0])); 1539Debug.Assert(null != info, "No property or method info for field Name");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\StyleXamlParser.cs (3)
504Debug.Assert(_inEventSetter); 1216Debug.Assert(!xamlClrEventNode.IsTemplateEvent && _inEventSetter); 1289Debug.Assert (mode != StyleMode.Base || xamlPropertyNode.PropName != XamlStyleSerializer.TargetTypePropertyName,
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\TemplateXamlParser.cs (3)
562Debug.Assert(_setterOrTriggerValueNode != null); 1331Debug.Assert(_styleModeStack.Mode == StyleMode.VisualTree); 1341Debug.Assert(!xamlClrEventNode.IsStyleSetterEvent);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\TreeBuilder.cs (1)
82Debug.Assert (false, "Parse Fragment was not overidden");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlParser.cs (4)
996Debug.Assert(null != assemblyName, "assembly name returned from GetBaseElement is null"); 997Debug.Assert(null != typeFullName, "Type name returned from GetBaseElement is null"); 1139Debug.Assert(SkipActionDepthCount == -1); 1245Debug.Assert(null == _bamlWriter || null == value, "XamlParser already had a bamlWriter");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (48)
115Debug.Assert(xamlParser != null, "Cannot have null xaml parser"); 116Debug.Assert(parserContext != null, "Cannot have null parser context"); 117Debug.Assert(xmlReader != null, "Cannot have null xmlReader"); 330Debug.Assert(null != xamlNode, "null returned from the collection"); 359Debug.Assert(null != XmlReader); 398Debug.Assert(!IsMoreData(), "Setting state to done but not done parsing."); 431Debug.Assert(null != xamlNode, "null returned from the collection"); 1177Debug.Assert(null != typeFullName, "type name not set"); 1178Debug.Assert(null != dynamicObjectName, "dynamicObject name not set"); 1179Debug.Assert(null != assemblyName, "assembly name not set"); 1506Debug.Assert( (null==ContentPropertyInfo && null==ContentPropertyName) 1830Debug.Assert(null == dynamicObject,"DynamicObject should be null for code"); 1998Debug.Assert(!endTagHasBeenRead, "Read past end tag on end tag"); 2069Debug.Assert(!endTagHasBeenRead); 2219Debug.Assert(IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri)); 2228Debug.Assert(IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri)); 2237Debug.Assert(IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri)); 2246Debug.Assert(IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri)); 2255Debug.Assert(IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri)); 2264Debug.Assert (attributeFound || !IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri)); 2757Debug.Assert(unknownTagName != null || null != parentType); 3180Debug.Assert(null != assemblyName, "property without an AssemblyName"); 3181Debug.Assert(null != declaringTypeFullName, "property without a type name"); 3182Debug.Assert(null != dynamicObjectName, "property without a field Name"); 3702Debug.Assert(typeAndSerializer == null || 3756Debug.Assert(CurrentContext.ContextType == ElementContextType.PropertyComplex || 4135Debug.Assert(null != assemblyName, "property without an AssemblyName"); 4136Debug.Assert(null != typeFullName, "property without a type name"); 4137Debug.Assert(null != dynamicObjectName, "property without a field Name"); 4816Debug.Assert( collectionTypeID >= 0 5087Debug.Assert( isWhitespace, 5265Debug.Assert(null != XmlReader, "XmlReader is not yet set"); 5494Debug.Assert(currentPos > 0 && currentPos < s.Length - 1); 5569Debug.Assert(null != text, "String passed to CollapseText cannot be null"); 5570Debug.Assert(textLength > 0, "String passed to Collapsed Text cannot be empty"); 5830Debug.Assert((_nodeIndex == 0 && _xamlNodes.Count == 0 ) || (_nodeIndex < _xamlNodes.Count), 5850Debug.Assert((_nodeIndex == 0 && _xamlNodes.Count == 0 ) || (_nodeIndex < _xamlNodes.Count), 5877Debug.Assert(!value || _insertionIndex == -1, "Attribute node collection is already marked for insertion."); 5936Debug.Assert(_nodeIndex == _xamlNodes.Count, "NodeIndex is larger than node count."); 6004Debug.Assert( _typeConverterDecisionState == TypeConverterDecisionState.ElementEnd, 6067Debug.Assert(((XamlNode)_xamlNodes[_typeConverterCandidateIndex]).TokenType==XamlNodeType.ElementStart, 6086Debug.Assert(((XamlNode)_xamlNodes[_typeConverterCandidateIndex])==xamlNode, 6110Debug.Assert(((XamlNode)_xamlNodes[_typeConverterCandidateIndex])==xamlNode, 6126Debug.Assert( _typeConverterTextWrittenAndNotProcessed != null, 6155Debug.Assert(((XamlNode)_xamlNodes[_typeConverterCandidateIndex]).TokenType==XamlNodeType.ElementStart, 6431Debug.Assert(null != textFlowData, "No data for TextFlow"); 6453Debug.Assert(null != typeRightTag, "ElementType not yet assigned to Node"); 6574Debug.Assert(0 == textFlowData.InlineCount, "Text stack still has an inline count");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlTypeMapper.cs (16)
935Debug.Assert(null != localName, "null localName"); 936Debug.Assert(null != xmlNamespace, "null xmlNamespace"); 1906Debug.Assert(typeInfo != null, "Must have cached type info at this point"); 2304Debug.Assert(memberName != null); 2307Debug.Assert(memberInfo != null); 2322Debug.Assert(targetType != null); 2398Debug.Assert(null != xmlNamespace,"null value passed for xmlNamespace"); 2399Debug.Assert(null != localName,"null value passed for localName"); 2437Debug.Assert(null != xmlNamespace,"null value passed for xmlNamespace"); 2438Debug.Assert(null != localName,"null value passed for localName"); 2590Debug.Assert(namespaceMap.ClrNamespace != null,"Null CLR Namespace"); 2591Debug.Assert(localName != null,"Null localName"); 3440Debug.Assert(null != type, "Null passed for type to GetTypeConverterType"); 3515Debug.Assert(null != propType, "Null passed for propType to GetPropertyConverterType"); 3744Debug.Assert(null != type, "null value for type passed to GetWhitespace"); 4006Debug.Assert(_dpLookupHashtable != null,
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XmlnsDictionary.cs (1)
708Debug.Assert(prefix != null);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\TokenizerHelper.cs (2)
171Debug.Assert(!Char.IsWhiteSpace(currentChar),"Token started on Whitespace"); 313Debug.Assert(null != numberFormat);
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (2)
128Debug.Assert(type is not null, "Type passed to IsInternalType is null"); 149Debug.Assert(type is not null, "Type passed to IsPublicType is null");
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\TypeConverterHelper.cs (2)
101Debug.Assert(null != memberInfo, "Null passed for memberInfo to GetConverterType"); 110Debug.Assert(type is not null, "Null passed for type to GetConverterType");
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlCompatibilityReader.cs (1)
340Debug.Assert(Scope.ShouldProcessContent(namespaceName, Reader.LocalName));
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlWrappingReader.cs (1)
34Debug.Assert( baseReader is not null);
src\Microsoft.DotNet.Wpf\src\WindowsBase\MS\Internal\IO\Packaging\CompoundFile\ContainerUtilities.cs (1)
83Debug.Assert(length >= 0, "The length cannot be negative. Caller must verify this");
PresentationCore (2121)
MS\Internal\AppModel\CookieHandler.cs (1)
108Debug.Assert(size > 0);
MS\Internal\DpiUtil\DpiUtil+ProcessDpiAwarenessHelper.cs (1)
101Debug.Assert(windowThreadProcessId != 0, "GetWindowThreadProcessId failed");
MS\Internal\FontCache\FamilyCollection.cs (1)
647Debug.Assert(i == FamilyCount);
MS\Internal\FontCache\FontCacheUtil.cs (1)
39Debug.Assert(stream.Position == 0);
MS\Internal\FontCache\FontResourceCache.cs (3)
59Debug.Assert(uri.IsAbsoluteUri && uri.Scheme == PackUriHelper.UriSchemePack && BaseUriHelper.IsPackApplicationUri(uri)); 72Debug.Assert(escapedPath.EndsWith(FakeFileName, StringComparison.OrdinalIgnoreCase)); 140Debug.Assert(!folderResourceMap.ContainsKey(resourceFullName));
MS\Internal\FontCache\FontSource.cs (3)
71Debug.Assert(_isInternalCompositeFont || String.IsNullOrEmpty(_fontUri.Fragment)); 334Debug.Assert(memoryFontSize <= fileReadBufferSize); 419Debug.Assert(_memoryHandle.IsAllocated);
MS\Internal\FontFace\CompositeFontInfo.cs (3)
203Debug.Assert(IsFamilyMapRangesValid(familyMapRanges)); 211Debug.Assert(begin < end && end <= _familyMaps.Count); 239Debug.Assert(count == FirstFamilyMapRange);
MS\Internal\FontFace\PhysicalFontFamily.cs (4)
119Debug.Assert(bestMatch != null); 203Debug.Assert(bestStyleTypeface != null); 331Debug.Assert(advance <= unicodeString.Length); 337Debug.Assert(advance + sizeofChar <= unicodeString.Length);
MS\Internal\FontFace\TypefaceCollection.cs (2)
81Debug.Assert((_family != null && _familyTypefaceCollection == null)|| (_familyTypefaceCollection != null && _family == null)); 132Debug.Assert((typefaceCollection._family != null && typefaceCollection._familyTypefaceCollection == null)
MS\Internal\Generic\Span.cs (2)
137Debug.Assert(fc <= first); 468Debug.Assert(
MS\Internal\Ink\Bezier.cs (2)
110Debug.Assert(to - from >= 4); 351Debug.Assert(data.Node(to) - data.Node(from) > data.Node(j) - data.Node(from));
MS\Internal\Ink\CuspData.cs (1)
279Debug.Assert(bReverse);
MS\Internal\Ink\EllipticalNodeOperations.cs (12)
23System.Diagnostics.Debug.Assert((nodeShape != null) && nodeShape.IsEllipse); 37Debug.Assert(_nodeShapeToCircle.HasInverse, "About to invert a non-invertible transform"); 49Debug.Assert(_nodeShapeToCircle.HasInverse, "Just rotated an invertible transform and produced a non-invertible one"); 65Debug.Assert(_nodeShapeToCircle.HasInverse, "Just scaled an invertible transform and produced a non-invertible one"); 170System.Diagnostics.Debug.Assert(!node.IsEmpty); 573System.Diagnostics.Debug.Assert(result.IsEmpty); 611System.Diagnostics.Debug.Assert(!DoubleUtil.AreClose(beginRadius, endRadius)); 643System.Diagnostics.Debug.Assert(!double.IsNaN(findex)); 652System.Diagnostics.Debug.Assert(!DoubleUtil.IsBetweenZeroAndOne(x)); 654System.Diagnostics.Debug.Assert(!double.IsNaN(findex)); 670System.Diagnostics.Debug.Assert(!double.IsNaN(findex)); 682System.Diagnostics.Debug.Assert(!double.IsNaN(findex));
MS\Internal\Ink\ErasingStroke.cs (6)
29System.Diagnostics.Debug.Assert(erasingShape != null); 55System.Diagnostics.Debug.Assert((path != null) && (IEnumerablePointHelper.GetCount(path) != 0)); 96System.Diagnostics.Debug.Assert(iterator != null); 135System.Diagnostics.Debug.Assert(iterator != null); 136System.Diagnostics.Debug.Assert(intersections != null); 258System.Diagnostics.Debug.Assert(path.Length > 1);
MS\Internal\Ink\ExtendedPropertyCollection.cs (2)
172System.Diagnostics.Debug.Assert(propertyToRemove != null); 309System.Diagnostics.Debug.Assert(!this.Contains(extendedProperty.Id), "ExtendedProperty already belongs to the collection");
MS\Internal\Ink\GestureRecognizer\NativeRecognizer.cs (11)
44Debug.Assert(NativeRecognizer.RecognizerHandleSingleton != null); 346Debug.Assert(recContext != null && !recContext.IsInvalid); 393Debug.Assert(recContext != null && !recContext.IsInvalid); 482Debug.Assert(stylusPoints != null); 483Debug.Assert(propertyGuids.Length == StylusPointDescription.RequiredCountOfProperties); 617Debug.Assert(ApplicationGestureHelper.IsDefined(gesture)); 666Debug.Assert(!(bestResultColumnCount != 0 && pRecoLattice->pLatticeColumns == IntPtr.Zero), "Invalid results!"); 680Debug.Assert(0 < recoColumn.cLatticeElements, "Invalid results!"); 687Debug.Assert((RECO_TYPE)(recoElement.type) == RECO_TYPE.RECO_TYPE_WCHAR, "The Application gesture has to be WCHAR type" ); 704Debug.Assert(pProps->cbPropertyValue == sizeof(uint) / sizeof(byte)); 716Debug.Assert(ApplicationGestureHelper.IsDefined(gesture));
MS\Internal\Ink\InkSerializedFormat\AlgoModule.cs (4)
210Debug.Assert(outputBufferIndex < outputBuffer.Length); 219Debug.Assert(outputBufferIndex < outputBuffer.Length); 271Debug.Assert(countPerItem == 4 || countPerItem == 2 || countPerItem == 1); 332Debug.Assert(countPerItem == 4 || countPerItem == 2 || countPerItem == 1);
MS\Internal\Ink\InkSerializedFormat\CustomAttributeSerializer.cs (2)
309Debug.Assert(strm != null); 424System.Diagnostics.Debug.Assert(guid == Guid.Empty);
MS\Internal\Ink\InkSerializedFormat\DrawingAttributeSerializer.cs (15)
331System.Diagnostics.Debug.Assert(penTip == PenTip.Rectangle); 420Debug.Assert(DrawingAttributes.MaxHeight == DrawingAttributes.MaxWidth && 449System.Diagnostics.Debug.Assert(compressionAlgorithm == 0); 450System.Diagnostics.Debug.Assert(fTag); 452Debug.Assert(stream != null); 478Debug.Assert(bw != null); 484Debug.Assert(bw != null); 498System.Diagnostics.Debug.Assert(da.Color != (Color)DrawingAttributes.GetDefaultDrawingAttributeValue(KnownIds.Color), "Color was put in the EPC for the default value!"); 504Debug.Assert(bw != null); 517Debug.Assert(bw != null); 535Debug.Assert(bw != null); 599System.Diagnostics.Debug.Assert(da.StylusTip != StylusTip.Ellipse, "StylusTip was put in the EPC for the default value!"); 604Debug.Assert(bw != null); 658Debug.Assert(bw != null); 669Debug.Assert(bw != null);
MS\Internal\Ink\InkSerializedFormat\GorillaCodec.cs (5)
217Debug.Assert(intReader != null); 218Debug.Assert(shortReader != null); 230Debug.Assert(shortReader != null); 528Debug.Assert(outputBufferIndex < outputBuffer.Length); 545Debug.Assert(outputBufferIndex < outputBuffer.Length);
MS\Internal\Ink\InkSerializedFormat\HuffCodec.cs (9)
80Debug.Assert(input != null); 81Debug.Assert(input.Length >= 2); 82Debug.Assert(startIndex == 1); 83Debug.Assert(outputBuffer != null); 84Debug.Assert(outputBuffer.Length != 0); 96Debug.Assert(outputBufferIndex < outputBuffer.Length); 111Debug.Assert(outputBufferIndex < outputBuffer.Length); 173Debug.Assert(nDataLen > 0 && nDataLen - 1 <= Int32.MaxValue); 177Debug.Assert(nDataLen <= Int32.MaxValue);
MS\Internal\Ink\InkSerializedFormat\InkSerializer.cs (7)
90System.Diagnostics.Debug.Assert(inkData.Length > isfBase64PrefixLength); 235Debug.Assert(inkdata != null); 293Debug.Assert(inputStream != null); 2087Debug.Assert(data != null); 2466Debug.Assert(sizeOfHeaderInBytes == bytesWritten); 2505Debug.Assert(sizes[i] == bytesWritten); 2704System.Diagnostics.Debug.Assert(strokes != null);
MS\Internal\Ink\InkSerializedFormat\LZCodec.cs (4)
27Debug.Assert(input != null); 28Debug.Assert(input.Length > 1); 29Debug.Assert(inputIndex < input.Length); 30Debug.Assert(inputIndex >= 0);
MS\Internal\Ink\InkSerializedFormat\MultiByteCodec.cs (3)
64Debug.Assert(input != null); 65Debug.Assert(inputIndex < input.Length); 99Debug.Assert(input != null); //already validated at the AlgoModule level
MS\Internal\Ink\InkSerializedFormat\StrokeSerializer.cs (1)
959Debug.Assert(stream != null);
MS\Internal\Ink\Lasso.cs (19)
48System.Diagnostics.Debug.Assert(_points != null); 62System.Diagnostics.Debug.Assert(_points != null); 76System.Diagnostics.Debug.Assert(_points != null); 77System.Diagnostics.Debug.Assert((0 <= index) && (index < _points.Count)); 89System.Diagnostics.Debug.Assert(null != points); 103System.Diagnostics.Debug.Assert(_points != null); 119System.Diagnostics.Debug.Assert(_points != null); 170System.Diagnostics.Debug.Assert(lassoSegment.Y != 0); 185System.Diagnostics.Debug.Assert(_points != null); 186System.Diagnostics.Debug.Assert(iterator != null); 334System.Diagnostics.Debug.Assert(!crossing.IsEmpty && crossing.StartNode.IsValid && crossing.EndNode.IsValid); 337System.Diagnostics.Debug.Assert(!mcrossing.IsEmpty && mcrossing.StartNode.IsValid && mcrossing.EndNode.IsValid); 344System.Diagnostics.Debug.Assert(!mcrossing.IsEmpty && mcrossing.StartNode.IsValid && mcrossing.EndNode.IsValid); 421System.Diagnostics.Debug.Assert(DoubleUtil.AreClose(si.InBegin, StrokeFIndices.BeforeFirst)); 556System.Diagnostics.Debug.Assert(!newFIndices.IsEmpty); 557System.Diagnostics.Debug.Assert(strokeNode.IsValid); 600System.Diagnostics.Debug.Assert(obj is LassoCrossing); 705System.Diagnostics.Debug.Assert(intersection >= 0 && intersection <= points.Count - 2); 812System.Diagnostics.Debug.Assert(hitEnd != hitBegin && orgBegin != orgEnd);
MS\Internal\Ink\Renderer.cs (8)
37Debug.Assert(renderer != null); 424System.Diagnostics.Debug.Assert(sender == _strokes); 474System.Diagnostics.Debug.Assert(_strokes.IndexOf(sender as Stroke) != -1); 525System.Diagnostics.Debug.Assert(_strokes != null); 531Debug.Assert(visual is not null); 625System.Diagnostics.Debug.Assert(stroke != null); 634System.Diagnostics.Debug.Assert(stroke != null); 646System.Diagnostics.Debug.Assert(drawingAttributes != null);
MS\Internal\Ink\StrokeFIndices.cs (1)
179System.Diagnostics.Debug.Assert(!double.IsNaN(_beginFIndex) && !double.IsNaN(_endFIndex) && DoubleUtil.LessThan(_beginFIndex, _endFIndex));
MS\Internal\Ink\StrokeIntersection.cs (6)
184System.Diagnostics.Debug.Assert(intersections != null); 185System.Diagnostics.Debug.Assert(intersections.Length > 0); 190System.Diagnostics.Debug.Assert(!intersections[j].IsEmpty); 216System.Diagnostics.Debug.Assert(intersections != null); 217System.Diagnostics.Debug.Assert(intersections.Length > 0); 222System.Diagnostics.Debug.Assert(!intersections[j].IsEmpty);
MS\Internal\Ink\StrokeNode.cs (17)
35System.Diagnostics.Debug.Assert(operations != null); 36System.Diagnostics.Debug.Assert((!nodeData.IsEmpty) && (index >= 0)); 285Debug.Assert(!endNodeRect.Contains(point)); 897System.Diagnostics.Debug.Assert(!double.IsNaN(cutAt.BeginFIndex) && !double.IsNaN(cutAt.EndFIndex)); 915System.Diagnostics.Debug.Assert(IsValid && (_index >= 0)); 922System.Diagnostics.Debug.Assert(fragment.BeginFIndex >= 0 && fragment.BeginFIndex <= 1); 927System.Diagnostics.Debug.Assert(fragment.EndFIndex >= 0 && fragment.EndFIndex <= 1); 946System.Diagnostics.Debug.Assert(IsValid); 958System.Diagnostics.Debug.Assert(DoubleUtil.GreaterThanOrClose(fragment.BeginFIndex, 0f)); 960System.Diagnostics.Debug.Assert(DoubleUtil.LessThanOrClose(fragment.BeginFIndex, 1f)); 974System.Diagnostics.Debug.Assert(DoubleUtil.GreaterThanOrClose(fragment.EndFIndex, 0f)); 976System.Diagnostics.Debug.Assert(DoubleUtil.LessThanOrClose(fragment.EndFIndex, 1f)); 1000System.Diagnostics.Debug.Assert(IsValid); 1018System.Diagnostics.Debug.Assert(IsValid); 1036System.Diagnostics.Debug.Assert(IsValid); 1040System.Diagnostics.Debug.Assert(findex == 0); 1044System.Diagnostics.Debug.Assert((findex >= _index - 1) && (findex <= _index));
MS\Internal\Ink\StrokeNodeData.cs (2)
44System.Diagnostics.Debug.Assert(DoubleUtil.GreaterThan((double)pressure, 0d)); 55Debug.Assert(DoubleUtil.AreClose(0, s_empty._pressure));
MS\Internal\Ink\StrokeNodeOperations.cs (19)
41System.Diagnostics.Debug.Assert(nodeShape != null); 72System.Diagnostics.Debug.Assert((boundingBox.X <= 0) && (boundingBox.Y <= 0)); 118System.Diagnostics.Debug.Assert(!node.IsEmpty); 316System.Diagnostics.Debug.Assert(!DoubleUtil.IsZero(pressureFactor)); 367System.Diagnostics.Debug.Assert(count > 0); 393System.Diagnostics.Debug.Assert(count > 0); 415System.Diagnostics.Debug.Assert(count > 0); 476System.Diagnostics.Debug.Assert(!DoubleUtil.IsZero(pressureFactor)); 617System.Diagnostics.Debug.Assert(findex >= 0 && findex <= 1); 631System.Diagnostics.Debug.Assert(findex >= 0 && findex <= 1); 768System.Diagnostics.Debug.Assert(DoubleUtil.IsBetweenZeroAndOne(findex)); 956System.Diagnostics.Debug.Assert(!DoubleUtil.IsZero(pressureFactor)); 981System.Diagnostics.Debug.Assert(!DoubleUtil.IsZero(pressureFactor)); 1013System.Diagnostics.Debug.Assert(!quad.IsEmpty); 1083System.Diagnostics.Debug.Assert(i < count); 1123System.Diagnostics.Debug.Assert(count > 0); 1145System.Diagnostics.Debug.Assert(count > 0); 1218System.Diagnostics.Debug.Assert(!DoubleUtil.IsZero(pressureFactor)); 1289System.Diagnostics.Debug.Assert(findex >= 0 && findex <= 1);
MS\Internal\Ink\StrokeNodeOperations2.cs (3)
39System.Diagnostics.Debug.Assert((null != vertices) && (2 < vertices.Length)); 77System.Diagnostics.Debug.Assert(!quad.IsEmpty); 503System.Diagnostics.Debug.Assert((!DoubleUtil.IsZero(shortest.X)) || (!DoubleUtil.IsZero(shortest.Y)));
MS\Internal\Ink\StrokeRenderer.cs (28)
36Debug.Assert(iterator != null); 37Debug.Assert(drawingAttributes != null); 70System.Diagnostics.Debug.Assert(strokeNode.IsValid); 152Debug.Assert(index == iterator.Count - 1); 210Debug.Assert(iterator != null && drawingAttributes != null); 347Debug.Assert(!prevStrokeNode.GetConnectingQuad().IsEmpty, "prevStrokeNode.GetConnectingQuad() is Empty!"); 453Debug.Assert(!strokeNode.GetConnectingQuad().IsEmpty, "strokeNode.GetConnectingQuad was empty, this is unexpected"); 482Debug.Assert(pathFigureDCSide.Count == 0); 624Debug.Assert(!strokeNode.IsValid); 646Debug.Assert(pathFigureDCSide.Count == 0); 672Debug.Assert(pathFigureABSide.Count == 0); 707Debug.Assert(pathFigureDCSide.Count == 0); 753Debug.Assert(pointBuffer1 != null); 754Debug.Assert(pointBuffer2 != null); 755Debug.Assert(pointBuffer3 != null); 756Debug.Assert(context != null); 829Debug.Assert(percentIntersect >= 0.0 && percentIntersect <= 100.0d); 865Debug.Assert(context != null); 866Debug.Assert(points != null); 867Debug.Assert(points.Count > 0); 893Debug.Assert(context != null); 894Debug.Assert(abPoints != null && dcPoints != null); 895Debug.Assert(abPoints.Count > 0 && dcPoints.Count > 0); 915Debug.Assert(context != null); 916Debug.Assert(abPoints != null && dcPoints != null); 917Debug.Assert(polyLinePoints != null); 946Debug.Assert(i + 2 < points.Count); 1096System.Diagnostics.Debug.Assert(da.IsHighlighter = true);
MS\Internal\Ink\StylusShape.cs (4)
156System.Diagnostics.Debug.Assert(value.HasInverse); 226System.Diagnostics.Debug.Assert(vertices.Length == 4); 251System.Diagnostics.Debug.Assert(clockWiseIndex == vertices.Length || counterClockIndex == vertices.Length); 269System.Diagnostics.Debug.Assert(m_tip == StylusTip.Ellipse);
MS\Internal\IO\Packaging\ByteRangeDownloader.cs (3)
73Debug.Assert(fileMutex != null, "FileMutex must be a valid mutex"); 74Debug.Assert(tempStream != null, "ByteRangeDownloader requires a stream to write to"); 190Debug.Assert(byteRanges.GetLength(0) == 1, "We don't support a request with multiple byte ranges");
MS\Internal\IO\Packaging\NetStream.cs (10)
720Debug.Assert(_fullStreamLength >= 0, "We assume _fullStreamLength is correct for Http cases - only Ftp can return bogus values"); 807Debug.Assert(offset >= 0); 808Debug.Assert(length >= 0); 833Debug.Assert(value >= 0); 846Debug.Assert(value >= 0); 892Debug.Assert(_offset <= b._offset); 893Debug.Assert(Mergeable(b)); 941Debug.Assert(block.Length > 0); 1041Debug.Assert(block.Length > 0); 1154Debug.Assert(_fullDownloadComplete, "Do not call this unless full download is complete.");
MS\Internal\IO\Packaging\PseudoWebRequest.cs (3)
44Debug.Assert(uri != null, "PackWebRequest uri cannot be null"); 45Debug.Assert(packageUri != null, "packageUri cannot be null"); 46Debug.Assert(partUri != null, "partUri cannot be null");
MS\Internal\IO\Packaging\ResponseStream.cs (4)
46Debug.Assert(container != null, "Logic error: use other constructor for full package request streams"); 47Debug.Assert(owningStream != null, "Logic error: use other constructor for full package request streams"); 70Debug.Assert(s != null, "Logic error: base stream cannot be null"); 71Debug.Assert(response != null, "Logic error: response cannot be null");
MS\Internal\LoadedOrUnloadedOperation.cs (1)
21Debug.Assert(callback != null && target != null);
MS\Internal\Media\VisualTreeUtils.cs (4)
113Debug.Assert(element == null); 235Debug.Assert((visual == null) != (visual3D == null), 256Debug.Assert(castSucceeded && ((visual == null) != (visual3D == null)), 263Debug.Assert(!castSucceeded && visual == null && visual3D == null,
MS\Internal\Media3D\GeneralTransform2DTo3DTo2D.cs (1)
470Debug.Assert(uv.Length == p.Length, "vertices and texture coordinate sizes should match");
MS\Internal\Media3D\GeneralTransform3DTo2DTo3D.cs (1)
27Debug.Assert(transform3DTo2D != null && transform2DTo3D != null);
MS\Internal\Media3D\M3DUtil.cs (4)
40Debug.Assert(!bounds.IsEmpty, 144Debug.Assert(matrix.IsAffine); 322Debug.Assert(!matrix.IsAffine); 384Debug.Assert(camera != null, "Caller is responsible for ensuring camera is not null.");
MS\Internal\PartialArray.cs (1)
22Debug.Assert(initialIndex >= 0 && initialIndex + count <= array.Length);
MS\Internal\Shaping\GlyphInfoList.cs (1)
51Debug.Assert(_glyphs.Offset + _glyphs.Length == cch, "Invalid glyph length!");
MS\Internal\Shaping\OpenTypeCommon.cs (7)
227Debug.Assert(TableTag==OpenTypeTags.GSUB || TableTag==OpenTypeTags.GPOS); 228Debug.Assert(FirstGlyph<AfterLastGlyph); 229Debug.Assert(AfterLastGlyph<=GlyphInfo.Length); 730Debug.Assert(featureDescription.Parameter != 0); 780Debug.Assert( FlagToSet==GlyphFlags.NotChanged || 924Debug.Assert(tableTag == OpenTypeTags.GSUB || tableTag == OpenTypeTags.GPOS); 1695Debug.Assert(Index < SubTableCount());
MS\Internal\Shaping\OpenTypeLayoutCache.cs (16)
73Debug.Assert(tableTag == OpenTypeTags.GSUB || tableTag == OpenTypeTags.GPOS); 313Debug.Assert(totalSize <= maxCacheSize); 317Debug.Assert(totalSize <= maxCacheSize); 384Debug.Assert(tableTag == OpenTypeTags.GSUB || tableTag == OpenTypeTags.GPOS); 404Debug.Assert(false); 537Debug.Assert(lastLookup >= 0); // There are lookups, so there was an index 564Debug.Assert(cacheSize > 0); // We've calcucalted them at least ones, and 565Debug.Assert(glyphCount > 0); // if there is no records, we already should've exited 631Debug.Assert((pList - pCache) * sizeof(ushort) < cacheSize); 636Debug.Assert((pList - pCache) * sizeof(ushort) < cacheSize); 669Debug.Assert((pList - pCache) * sizeof(ushort) < cacheSize); 674Debug.Assert((pList - pCache) * sizeof(ushort) < cacheSize); 686Debug.Assert((pList - pCache) * sizeof(ushort) == cacheSize); // We exactly filled up the cache 687Debug.Assert((pGlyphs - pCache) * sizeof(ushort) == (4 + glyphCount * 2) * sizeof(ushort)); // Glyphs ended where lists start. 833Debug.Assert(tableTag == OpenTypeTags.GSUB || tableTag == OpenTypeTags.GPOS); 1051Debug.Assert(recordCount > 0); // Otherwise, we would go into (glyph > maxGlyphLookup);
MS\Internal\Shaping\ShaperBuffers.cs (2)
98Debug.Assert(_charMap.Length == charCount); 109Debug.Assert(_glyphInfoList.Length == glyphCount);
MS\Internal\Shaping\TypefaceMap.cs (8)
158Debug.Assert(ichItem == unicodeString.Length); 173Debug.Assert(index >= 0); 390Debug.Assert(index >= 0, "Invalid scaled shapeable typeface index spans"); 574Debug.Assert(cchMap <= unicodeString.Length - ich); 811Debug.Assert(cchNextValid > 0 && cchNextValid <= unicodeString.Length - ich); 829Debug.Assert(cchNextValid == 0); 839Debug.Assert(recursionDepth > 0 || advance == unicodeString.Length); 1051Debug.Assert(cch > 0);
MS\Internal\Span.cs (2)
104Debug.Assert(cp >= 0); 156Debug.Assert(spanIndex > 0);
MS\Internal\SynchronizedInputHelper.cs (3)
185Debug.Assert(mbArgs != null); 233Debug.Assert(mbArgs != null); 283Debug.Assert(false);
MS\Internal\TextFormatting\Bidi.cs (30)
684Debug.Assert(CharProperty[1, (int) startClass]==1 || (startClass == DirectionClass.ArabicLetter), 687Debug.Assert(CharProperty[1, (int) endClass]==1, ("Cannot use non strong type to resolve neutrals")); 710Debug.Assert(CharProperty[2, (int) characterClass[counter + classIndex]]==0, 735Debug.Assert(CharProperty[2, (int) characterClass[counter + classIndex]]==0, "Changing class of a fixed class"); 846Debug.Assert(startOfNeutrals == PositionInvalid, 891Debug.Assert(startOfDelayed != PositionInvalid, 936Debug.Assert(startOfNeutrals == PositionInvalid, 941Debug.Assert(startOfDelayed != PositionInvalid, 1041Debug.Assert(startOfNeutrals != PositionInvalid, 1080Debug.Assert(startOfNeutrals != PositionInvalid, 1113Debug.Assert(startOfNeutrals == PositionInvalid, 1131Debug.Assert(startOfNeutrals == PositionInvalid, 1144Debug.Assert(startOfDelayed != PositionInvalid, 1158Debug.Assert(startOfNeutrals == PositionInvalid, 1163Debug.Assert(startOfDelayed != PositionInvalid, 1174Debug.Assert(startOfNeutrals != PositionInvalid, 1183Debug.Assert(startOfNeutrals == PositionInvalid, 1201Debug.Assert(startOfDelayed != PositionInvalid, 1205Debug.Assert(lastClass == DirectionClass.EuropeanTerminator, 1212Debug.Assert(startOfNeutrals == PositionInvalid, 1217Debug.Assert(startOfDelayed != PositionInvalid, 1266Debug.Assert(startOfNeutrals != PositionInvalid, 1280Debug.Assert(startOfNeutrals == PositionInvalid, 1285Debug.Assert(startOfDelayed != PositionInvalid, 1317Debug.Assert(startOfNeutrals == PositionInvalid, 1344Debug.Assert(startOfNeutrals == PositionInvalid, 1389Debug.Assert(startOfNeutrals == PositionInvalid, 1425Debug.Assert(startOfDelayed != PositionInvalid, 1567Debug.Assert(startOfNeutrals == PositionInvalid, 2454Debug.Assert(runLengthResolved == runLength,
MS\Internal\TextFormatting\FormatSettings.cs (3)
208Debug.Assert(offsetToFirstCp == 0); 216Debug.Assert(offsetToFirstCp == 0); 229Debug.Assert(offsetToFirstCp == 0);
MS\Internal\TextFormatting\FormattedTextSymbols.cs (6)
48Debug.Assert(symbols != null); 71Debug.Assert(shapeables != null && shapeables.Count > 0); 85Debug.Assert(current != null); 197Debug.Assert(_glyphs != null); 220Debug.Assert(_glyphs != null); 363Debug.Assert(glyphAdvances.Length <= glyphIndices.Length);
MS\Internal\TextFormatting\FullTextLine.cs (18)
194Debug.Assert(_metrics._formatter != null); 452Debug.Assert(_collapsingSymbol == null && symbol != null); 474Debug.Assert(lineLength > 0); 685Debug.Assert((_statusFlags & StatusFlags.BoundingBoxComputed) != 0); 739Debug.Assert(_fullText != null); 744Debug.Assert(_metrics._height > 0); 820Debug.Assert(HasCollapsed); 1220Debug.Assert(direction == CaretDirection.Backward || direction == CaretDirection.Backspace); 1409Debug.Assert(direction == CaretDirection.Backward || direction == CaretDirection.Backspace); 1461Debug.Assert(_collapsingSymbol != null); 1556Debug.Assert(false); 1714Debug.Assert(boundsList != null); 2078Debug.Assert(textRun != null); 2082Debug.Assert(cchAcc > 0); 2095Debug.Assert(cchAcc > 0); 2099Debug.Assert(cchLeft == 0); 2441Debug.Assert(_ploline != IntPtr.Zero); 2494Debug.Assert(_ploline != IntPtr.Zero);
MS\Internal\TextFormatting\FullTextState.cs (2)
287Debug.Assert(lsccp > 0, "Zero-length text line!"); 297Debug.Assert(!TextStore.IsMarker(plsrun));
MS\Internal\TextFormatting\LineServicesCallbacks.cs (21)
161Debug.Assert(TextStore.IsContent(plsrun), "Unrecognizable run!"); 162Debug.Assert(lsrun.RunProp != null, "invalid lsrun!"); 205Debug.Assert(lsrun.RunProp != null); 486Debug.Assert(Draw.CurrentLine.FullTextState != null); 494Debug.Assert(lsrun.Shapeable != null && stringLength > 0); 593Debug.Assert(markerStore != null, "No marker store, yet autonumbering is specified!"); 663Debug.Assert( 694Debug.Assert(ulInfo.dvpFirstUnderlineSize >= 0); 727Debug.Assert( 743Debug.Assert(stInfo.dvpLowerStrikethroughSize >= 0); 1603Debug.Assert(lsrunFirst.Shapeable != null); 1604Debug.Assert(cchText > 0); // LineServices should not pass in zero character count; 1763Debug.Assert(TextStore.IsContent(plsrun) && lsruns[i] != null); 1799Debug.Assert(TextStore.IsContent(plsrun) && lsrun.Shapeable != null); 2361Debug.Assert(textObject != null); 2421Debug.Assert(false); 2444Debug.Assert(lsrun.Type == Plsrun.InlineObject); 2456Debug.Assert(textObject != null); 2457Debug.Assert(textFlow != LsTFlow.lstflowWS || runDirection != 0); 2605Debug.Assert(fGeometryProvided == 0, "Line enumeration doesn't need geometry information"); 3156Debug.Assert(lsrun.Shapeable != null);
MS\Internal\TextFormatting\LineServicesRun.cs (2)
233Debug.Assert(_shapeable != null); 906Debug.Assert(lsruns != null && lsruns.Length > 0 && lsruns[0] != null);
MS\Internal\TextFormatting\SimpleTextLine.cs (1)
564Debug.Assert((_statusFlags & StatusFlags.BoundingBoxComputed) != 0);
MS\Internal\TextFormatting\TextFormatterImp.cs (2)
528Debug.Assert(context.Owner == null); 553Debug.Assert(context != null);
MS\Internal\TextFormatting\TextMarkerSource.cs (5)
48Debug.Assert(markerStyle != TextMarkerStyle.None); 96Debug.Assert(autoNumberingIndex > 0); 135Debug.Assert(_characterArray != null); 267Debug.Assert(number >= 0); 399Debug.Assert(number >= 0 && number <= 9);
MS\Internal\TextFormatting\TextMetrics.cs (1)
152Debug.Assert(_cchLength > 0);
MS\Internal\TextFormatting\TextRunCacheImp.cs (2)
172Debug.Assert(textRun != null && runLength > 0, "Invalid run!"); 245Debug.Assert(
MS\Internal\TextFormatting\TextStore.cs (16)
256Debug.Assert(stringLength > 0 && runInfo.Length > 0); 314Debug.Assert( 490Debug.Assert(textEffects != null && textEffects.Count != 0); 629Debug.Assert(runInfo.StringLength > 0 && runInfo.Length > 0); 833Debug.Assert(runInfo.StringLength >= stringLength); 858Debug.Assert(cch <= runInfo.StringLength); 1407Debug.Assert(ichRun < ichEnd); 1435Debug.Assert(ichRun == cchUniform); 1533Debug.Assert(runInfo.OffsetToFirstChar + offsetToFirstChar + lsrunLength <= runInfo.CharacterBuffer.Count); 1553Debug.Assert(offsetToFirstChar == 0); 1599Debug.Assert(uniformBidiLevel == (Pap.RightToLeft ? 1 : 0)); 1628Debug.Assert(lsrunLength > 0); 1695Debug.Assert(false); 1708Debug.Assert(cch > 0 && cch <= stringLength - ich); 1947Debug.Assert(i < _plsrunVector.Count); 2368Debug.Assert(metrics != null);
MS\Internal\TextFormatting\ThousandthOfEmRealDoubles.cs (2)
31Debug.Assert(capacity >= 0); 41Debug.Assert(realValues != null);
MS\Internal\TextFormatting\ThousandthOfEmRealPoints.cs (2)
27Debug.Assert(capacity >= 0); 36Debug.Assert(pointValues != null);
MS\Internal\UIElementHelper.cs (3)
16Debug.Assert(o != null, "UIElementHelper.IsHitTestVisible called with null argument"); 31Debug.Assert(o != null, "UIElementHelper.IsVisible called with null argument"); 46Debug.Assert(o != null, "UIElementHelper.PredictFocus called with null argument");
MS\Win32\UnsafeNativeMethodsTablet.cs (3)
90Debug.Assert(handle != IntPtr.Zero); 130Debug.Assert(handle != IntPtr.Zero); 142System.Diagnostics.Debug.Assert(_recognizerHandle == null);
src\Microsoft.DotNet.Wpf\src\Common\Graphics\exports.cs (26)
96Debug.Assert((cbData == 0) || ((Int64)(IntPtr)pbFrom) % 4 == 0); 97Debug.Assert((cbData == 0) || ((Int64)(IntPtr)pbTo) % 4 == 0); 98Debug.Assert(cbData % 4 == 0); 99Debug.Assert(cbData >= 0); 523Debug.Assert(!handle.IsNull); 553Debug.Assert(!handle.IsNull); 911Debug.Assert(channel != null); 931Debug.Assert(channel != null); 933Debug.Assert(_debugOnly_Channel == channel); 949Debug.Assert(_debugOnly_Channel == channel); 1071Debug.Assert(_others == null, "There shouldn't be anything stored in the others array."); 1126Debug.Assert(_others.Count > 0); 1151Debug.Assert(index == 0); 1385Debug.Assert(index <= 1); 1463Debug.Assert(index == 0); 1501Debug.Assert(channel != null); 1526Debug.Assert(sourceChannel != null); 1531Debug.Assert(found); 1538Debug.Assert(!(_map.Get(targetChannel, out duplicate))); 1564Debug.Assert(channel != null); 1569Debug.Assert(found); 1632Debug.Assert(channel != null); 1637Debug.Assert(found); 1905Debug.Assert(!hCompositionNode.IsNull); 1931Debug.Assert(!hCompositionNode.IsNull); 2109Debug.Assert(!hCompositionNode.IsNull);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\AppDomainShutdownMonitor.cs (1)
34Debug.Assert(listener.TryGetTarget(out _));
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\CharacterBuffer.cs (2)
244Debug.Assert(characterOffset >= 0 && characterOffset < _characterArray.Length, "Invalid character index"); 344Debug.Assert(characterOffset >= 0 && characterOffset < _string.Length, "Invalid character index");
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Ink\BitStream.cs (2)
22Debug.Assert(buffer != null); 35Debug.Assert(buffer != null);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\LegacyPriorityQueue.cs (2)
129Debug.Assert(_count > 0); 182Debug.Assert(_count != 0);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\PartialList.cs (1)
35Debug.Assert(initialIndex >= 0 && initialIndex + count <= list.Count);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SafeSecurityHelper.cs (1)
266Debug.Assert(target is not null);
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Media\TypeConverterHelper.cs (1)
69Debug.Assert(inputString is Uri);
System\IO\Packaging\PackWebRequest.cs (2)
66Debug.Assert(uri != null, "PackWebRequest uri cannot be null"); 67Debug.Assert(packageUri != null, "packageUri cannot be null");
System\Windows\Automation\Peers\AutomationPeer.cs (1)
1628Debug.Assert(caller._children != null, "iteration over a null family");
System\Windows\ClassHandlersStore.cs (4)
35Debug.Assert(index != -1, "There should exist a set of handlers for the given routedEvent"); 74Debug.Assert(index != -1, "There should exist a set of handlers for the given index"); 85Debug.Assert(GetHandlersIndex(routedEvent) == -1, "There should not exist a set of handlers for the given routedEvent"); 105Debug.Assert(baseClassListeners != null, "Update only when there are base class listeners to be updated");
System\Windows\DragDrop.cs (2)
565Debug.Assert(dragSource != null, "Invalid dragSource"); 566Debug.Assert(dataObject != null, "Invalid dataObject");
System\Windows\Duration.cs (1)
38Debug.Assert(durationType == DurationType.Automatic || durationType == DurationType.Forever);
System\Windows\DurationConverter.cs (1)
118Debug.Assert(duration == Duration.Automatic); // Only other legal duration type
System\Windows\EventHandlersStore.cs (2)
249Debug.Assert(key != null, "Search key cannot be null"); 267Debug.Assert(key != null, "Search key cannot be null");
System\Windows\FontStretch.cs (2)
25Debug.Assert(1 <= stretch && stretch <= 9); 54Debug.Assert(1 <= RealStretch && RealStretch <= 9);
System\Windows\FontStyle.cs (3)
22Debug.Assert(0 <= style && style <= 2); 117Debug.Assert(0 <= _style && _style <= 2); 136Debug.Assert(_style == 2);
System\Windows\FontWeight.cs (1)
23Debug.Assert(1 <= weight && weight <= 999);
System\Windows\FreezableCollection.cs (3)
158Debug.Assert(_collection.Count == 0); 980Debug.Assert(list != null, "list may not be null."); 1078Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Generated\TextDecorationCollection.cs (3)
86Debug.Assert(_collection.Count == 0); 745Debug.Assert(list != null, "list may not be null."); 844Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\GlobalEventManager.cs (3)
23Debug.Assert(GetRoutedEventFromName(name, ownerType, false) == null, 56Debug.Assert( 61Debug.Assert(routedEvent.IsLegalHandler(handler),
System\Windows\Ink\DrawingAttributes.cs (13)
40System.Diagnostics.Debug.Assert(extendedProperties != null); 51System.Diagnostics.Debug.Assert(_extendedProperties != null); 70Debug.Assert(Colors.Black == (Color)GetDefaultDrawingAttributeValue(KnownIds.Color)); 94Debug.Assert(StylusTip.Ellipse == (StylusTip)GetDefaultDrawingAttributeValue(KnownIds.StylusTip)); 100Debug.Assert(StylusTip.Rectangle == (StylusTip)GetExtendedPropertyBackedProperty(KnownIds.StylusTip)); 123Debug.Assert(Matrix.Identity == (Matrix)GetDefaultDrawingAttributeValue(KnownIds.StylusTipTransform)); 152Debug.Assert(DrawingAttributes.DefaultHeight == (double)GetDefaultDrawingAttributeValue(KnownIds.StylusHeight)); 179Debug.Assert(DrawingAttributes.DefaultWidth == (double)GetDefaultDrawingAttributeValue(KnownIds.StylusWidth)); 268Debug.Assert(!(bool)GetDefaultDrawingAttributeValue(KnownIds.IsHighlighter)); 273Debug.Assert((bool)GetExtendedPropertyBackedProperty(KnownIds.IsHighlighter)); 763System.Diagnostics.Debug.Assert(null != DrawingAttributes.GetDefaultDrawingAttributeValue(guid)); 785System.Diagnostics.Debug.Assert(sender != null); 786System.Diagnostics.Debug.Assert(args != null);
System\Windows\Ink\IncrementalHitTester.cs (18)
49System.Diagnostics.Debug.Assert(_strokes != null); 72System.Diagnostics.Debug.Assert(_strokes != null); 118System.Diagnostics.Debug.Assert(strokes != null); 161System.Diagnostics.Debug.Assert((_strokes != null) && (_strokeInfos != null) && (_strokes == sender)); 261Debug.Assert(_strokeInfos.Count == _strokes.Count); 264Debug.Assert(_strokeInfos[x].Stroke == _strokes[x]); 309System.Diagnostics.Debug.Assert((percentageWithinLasso >= 0) && (percentageWithinLasso <= 100)); 320System.Diagnostics.Debug.Assert((points != null) && (IEnumerablePointHelper.GetCount(points)!= 0)); 457System.Diagnostics.Debug.Assert(eventArgs != null); 498System.Diagnostics.Debug.Assert(eraserShape != null); 511System.Diagnostics.Debug.Assert((points != null) && (IEnumerablePointHelper.GetCount(points) != 0)); 512System.Diagnostics.Debug.Assert(_erasingStroke != null); 557System.Diagnostics.Debug.Assert(strokeHitEventArgCollection.Count != 0); 562System.Diagnostics.Debug.Assert(eventArgs.HitStroke != null); 573System.Diagnostics.Debug.Assert(eventArgs != null); 671System.Diagnostics.Debug.Assert(stroke != null && hitFragments != null && hitFragments.Length > 0); 712System.Diagnostics.Debug.Assert(stroke != null); 819System.Diagnostics.Debug.Assert(stylusPoints != null && index >= 0 && index < stylusPoints.Count);
System\Windows\Ink\Stroke.cs (21)
113Debug.Assert(_cachedGeometry == null || _cachedGeometry.IsFrozen); 250Debug.Assert(bezierPoints != null && bezierPoints.Count > 0); 303Debug.Assert(stylusPointsCount > stylusPointsIndex); 321Debug.Assert(bezierLength >= prevUnbezierLength); 714System.Diagnostics.Debug.Assert(cutAt != null); 715System.Diagnostics.Debug.Assert(cutAt.Length != 0); 746System.Diagnostics.Debug.Assert(DoubleUtil.AreClose(cutAt[cutAt.Length - 1].EndFIndex, StrokeFIndices.AfterLast) || 756System.Diagnostics.Debug.Assert(DoubleUtil.LessThan(fragment.BeginFIndex, fragment.EndFIndex)); 776System.Diagnostics.Debug.Assert(cutAt != null); 777System.Diagnostics.Debug.Assert(cutAt.Length != 0); 802System.Diagnostics.Debug.Assert(DoubleUtil.AreClose(cutAt[cutAt.Length - 1].EndFIndex, StrokeFIndices.AfterLast) || 820System.Diagnostics.Debug.Assert(DoubleUtil.LessThan(beginFIndex, fragment.BeginFIndex)); 849Debug.Assert(sourceStylusPoints != null); 862System.Diagnostics.Debug.Assert(pointCount >= 1); 872System.Diagnostics.Debug.Assert(sourceStylusPoints.Count > i + beginIndex); 876System.Diagnostics.Debug.Assert(stylusPoints.Count == pointCount); 1002System.Diagnostics.Debug.Assert(IsValidStrokeFIndices(fragments[0])); 1013System.Diagnostics.Debug.Assert(x == 0); 1016System.Diagnostics.Debug.Assert(IsValidStrokeFIndices(fragments[x]) && fragments[x].EndFIndex > current); 1146Debug.Assert(ienum != null); 1165Debug.Assert(ienum != null);
System\Windows\Ink\Stroke2.cs (10)
483System.Diagnostics.Debug.Assert(_cachedGeometry != null && _cachedGeometry.IsFrozen); 515System.Diagnostics.Debug.Assert(!_drawAsHollow); 544System.Diagnostics.Debug.Assert(geometry != null); 553System.Diagnostics.Debug.Assert(!newBounds.IsEmpty); 563System.Diagnostics.Debug.Assert(shape != null); 564System.Diagnostics.Debug.Assert(path != null); 583System.Diagnostics.Debug.Assert(lasso != null); 606System.Diagnostics.Debug.Assert(cutAt != null); 630System.Diagnostics.Debug.Assert(cutAt != null); 668System.Diagnostics.Debug.Assert(DoubleUtil.IsZero(originalDa.StylusTipTransform.OffsetX) && DoubleUtil.IsZero(originalDa.StylusTipTransform.OffsetY));
System\Windows\Ink\StrokeCollection.cs (5)
113Debug.Assert(stream != null); 114Debug.Assert(stream.CanRead); 533Debug.Assert(stroke != null && IndexOf(stroke) == -1); 641Debug.Assert(e.Removed.Count > 0); 708Debug.Assert(startingIndex >= 0);
System\Windows\Ink\StrokeCollection2.cs (2)
452System.Diagnostics.Debug.Assert(original != null && toReplace != null); 453System.Diagnostics.Debug.Assert(index >= 0 && index < this.Count);
System\Windows\Input\AccessKeyManager.cs (2)
240Debug.Assert(target != null, "Targets should only be UIElements"); 602Debug.Assert(element is IInputElement, "Element in AccessKeyManager store was not of type IInputElement");
System\Windows\Input\Command\CommandBinding.cs (2)
180Debug.Assert(Executed != null, nameof(Executed) + " != null"); 188Debug.Assert(PreviewExecuted != null, nameof(PreviewExecuted) + " != null");
System\Windows\Input\InputLanguageSource.cs (1)
193Debug.Assert(_ipp == null, "_EnsureInputProcesoorProfile has been called.");
System\Windows\Input\InputMethod.cs (5)
550Debug.Assert(value != InputMethodState.DoNotCare); 611Debug.Assert(value != InputMethodState.DoNotCare); 645Debug.Assert(value != InputMethodState.DoNotCare); 814Debug.Assert((value & ImeConversionModeValues.DoNotCare) == 0); 1065Debug.Assert((value & ImeSentenceModeValues.DoNotCare) == 0);
System\Windows\Input\InputProcessorProfiles.cs (5)
35Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "Initialize called on MTA thread!"); 37Debug.Assert(_ipp == null, "Initialize called twice"); 55Debug.Assert(_ipp != null, "Uninitialize called without initializing"); 131Debug.Assert(_cookie == UnsafeNativeMethods.TF_INVALID_COOKIE, "Cookie is already set."); 146Debug.Assert(_cookie != UnsafeNativeMethods.TF_INVALID_COOKIE, "Cookie is not set.");
System\Windows\Input\InputProcessorProfilesLoader.cs (1)
56Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "Load called on MTA thread!");
System\Windows\Input\Manipulation.cs (1)
40Debug.Assert(element != null, "element should be non-null.");
System\Windows\Input\ManipulationDevice.cs (7)
74Debug.Assert(element != null, "element should be non-null."); 103Debug.Assert(element != null, "element should be non-null."); 145Debug.Assert(manipulator != null); 163Debug.Assert(manipulator != null); 347Debug.Assert(!deltaEventArgs.IsInertial); 413Debug.Assert(!completedEventArgs.IsInertial); 442Debug.Assert(_manipulators == null || _manipulators.Count == 0);
System\Windows\Input\ManipulationLogic.cs (3)
221Debug.Assert(_lastManipulationBeforeInertia != null); 301Debug.Assert(_generatedEvent == null, "There is already a generated event waiting to be pushed."); 634Debug.Assert(_containerLayoutUpdated != null);
System\Windows\Input\MouseDevice.cs (1)
1454Debug.Assert(_mouseOver == null, "_mouseOver should be null because we have called ChangeMouseOver(null) already.");
System\Windows\Input\Stylus\Common\DynamicRenderer.cs (4)
499Debug.Assert(si!=null); // should never get here unless we are transitioning a stroke. 583Debug.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"); 935Debug.Assert(si.StrokeHV.Clip == null); 937Debug.Assert(_renderCompleteStrokeInfo == null);
System\Windows\Input\Stylus\Common\DynamicRendererThreadManager.cs (1)
166Debug.Assert(__inkingDispatcher != null); // We should have a valid ref here
System\Windows\Input\Stylus\Common\MultiTouchSystemGestureLogic.cs (2)
68Debug.Assert(_firstStylusDeviceId != null && _firstStylusDeviceId != stylusInputReport.StylusDeviceId); 69Debug.Assert(_secondStylusDeviceId == null);
System\Windows\Input\Stylus\Common\RawStylusInput.cs (1)
34System.Diagnostics.Debug.Assert(tabletToElementTransform.IsFrozen);
System\Windows\Input\Stylus\Common\StylusLogic.cs (2)
403Debug.Assert(_transformToDeviceMatrices[hwndSource.CompositionTarget.CurrentDpiScale].HasInverse); 721Debug.Assert(GetFlickAction(flickData) == FlickAction.Scroll); // Make sure scroll action is set in flickdata.
System\Windows\Input\Stylus\Common\StylusPlugInCollection.cs (4)
55System.Diagnostics.Debug.Assert(this.Count > 0); // If active must have more than one plugin already 564System.Diagnostics.Debug.Assert(_element.IsEnabled == (bool)e.NewValue); 570System.Diagnostics.Debug.Assert(_element.IsVisible == (bool)e.NewValue); 576System.Diagnostics.Debug.Assert(_element.IsHitTestVisible == (bool)e.NewValue);
System\Windows\Input\Stylus\Common\StylusPoint.cs (2)
248Debug.Assert(value != null && 504Debug.Assert(StylusPointDescription.AreCompatible(stylusPoint1.Description, stylusPoint2.Description));
System\Windows\Input\Stylus\Common\StylusPointCollection.cs (6)
144Debug.Assert(0 == rawPacketData.Length % lengthPerPoint, "Invalid assumption about packet length, there shouldn't be any remainder"); 363Debug.Assert(count <= this.Count); 532Debug.Assert(additionalData.Length == countToCopy); 558Debug.Assert(this.Count != 0, "Why are we serializing an empty StylusPointCollection???"); 608Debug.Assert( this.Description.ButtonCount > 0 ? 643Debug.Assert(e.Cancel, "This event should always be cancelled");
System\Windows\Input\Stylus\Common\StylusPointDescription.cs (4)
297Debug.Assert( stylusPointDescription1._stylusPointPropertyInfos.Length >= RequiredCountOfProperties && 302Debug.Assert( stylusPointDescription2._stylusPointPropertyInfos.Length >= RequiredCountOfProperties && 338Debug.Assert(stylusPointDescription._stylusPointPropertyInfos.Length >= 3 && 343Debug.Assert(stylusPointDescriptionPreserveInfo._stylusPointPropertyInfos.Length >= 3 &&
System\Windows\Input\Stylus\Common\StylusPointPropertyInfo.cs (1)
114Debug.Assert(( stylusPointPropertyInfo1.Id != StylusPointPropertyIds.X &&
System\Windows\Input\Stylus\Common\TabletDeviceBase.cs (1)
257Debug.Assert(properties != null);
System\Windows\Input\Stylus\Pointer\PointerStylusDevice.cs (2)
803Debug.Assert(transformToElement != null); 1117Debug.Assert(transformToElement != null);
System\Windows\Input\Stylus\Pointer\PointerStylusPlugInManager.cs (1)
159System.Diagnostics.Debug.Assert(data.Length % pointLength == 0);
System\Windows\Input\Stylus\Pointer\PointerTabletDeviceInfo.cs (3)
257Debug.Assert(properties[StylusPointDescription.RequiredXIndex /*0*/].Id == StylusPointPropertyIds.X || !seenX, 259Debug.Assert(properties[StylusPointDescription.RequiredYIndex /*1*/].Id == StylusPointPropertyIds.Y || !seenY, 261Debug.Assert(properties[StylusPointDescription.RequiredPressureIndex /*1*/].Id == StylusPointPropertyIds.NormalPressure /*2*/,
System\Windows\Input\Stylus\Wisp\PenContext.cs (9)
102Debug.Assert(!_contexts._inputSource.CheckAccess()); 105Debug.Assert(_pimcContext != null); 133Debug.Assert(_statusPropertyIndex != -1); // We should always see this. 149Debug.Assert(propertyInfos[StylusPointDescription.RequiredXIndex /*0*/].Id == StylusPointPropertyIds.X, "X isn't where we expect it! Fix PenImc to ask for X at index 0"); 150Debug.Assert(propertyInfos[StylusPointDescription.RequiredYIndex /*0*/].Id == StylusPointPropertyIds.Y, "Y isn't where we expect it! Fix PenImc to ask for Y at index 1"); 151Debug.Assert(pressureIndex == -1 || pressureIndex == StylusPointDescription.RequiredPressureIndex /*2*/, 322System.Diagnostics.Debug.Assert(stylusPointerId != 0); 425Debug.Assert(numPackets != 0); 426Debug.Assert(data != null);
System\Windows\Input\Stylus\Wisp\PenContexts.cs (2)
466System.Diagnostics.Debug.Assert(!inputReport.StylusDevice.CheckAccess()); 485System.Diagnostics.Debug.Assert(data.Length % pointLength == 0);
System\Windows\Input\Stylus\Wisp\PenThreadWorker.cs (6)
514Debug.Assert(penContext != null); 541Debug.Assert(penContext != null); 932Debug.Assert(properties[StylusPointDescription.RequiredXIndex /*0*/].Id == StylusPointPropertyIds.X, "X isn't where we expect it! Fix PenImc to ask for X at index 0"); 933Debug.Assert(properties[StylusPointDescription.RequiredYIndex /*1*/].Id == StylusPointPropertyIds.Y, "Y isn't where we expect it! Fix PenImc to ask for Y at index 1"); 1035Debug.Assert(pc != null && pc.CommHandle != IntPtr.Zero); 1089Debug.Assert(pc != null && pc.CommHandle != IntPtr.Zero);
System\Windows\Input\Stylus\Wisp\WispLogic.cs (13)
98Debug.Assert(systemGesture != SystemGesture.None); // We should ever see this as input. 832Debug.Assert((actions & ~(RawMouseActions.Button3Press | RawMouseActions.Button3Release | 1736Debug.Assert(ShouldPromoteToMouse(stylusDevice) && stylusDevice.TouchDevice.PromotingToOther); 2514Debug.Assert(stylusDevice.InAir); 2528Debug.Assert(stylusDevice.InAir); 2799System.Diagnostics.Debug.Assert(stylusDevice != null); 2828System.Diagnostics.Debug.Assert(stylusDevice != null); 2895System.Diagnostics.Debug.Assert(stylusDevice != null); 3041Debug.Assert(__stylusDeviceMap.ContainsKey(stylusDevice.Id)); 3051Debug.Assert(Dispatcher.CheckAccess()); 3237Debug.Assert(Dispatcher.CheckAccess()); 3285Debug.Assert(Dispatcher.CheckAccess()); 3304Debug.Assert(!_inputEnabled, "StylusLogic has been enabled unexpectly.");
System\Windows\Input\Stylus\Wisp\WispStylusDevice.cs (3)
1342Debug.Assert(transformToElement != null); 1398Debug.Assert(report.TabletDeviceId == _tabletDevice.Id); 1399Debug.Assert((report.Actions & RawStylusActions.None) == 0);
System\Windows\Input\Stylus\Wisp\WispTabletDevice.cs (2)
176Debug.Assert(_stylusDeviceCollection != null); 218Debug.Assert(CheckAccess());
System\Windows\Input\Stylus\Wisp\WispTabletDeviceCollection.cs (3)
539Debug.Assert(index <= Count); 540Debug.Assert(tabletDevice.Type != (TabletDeviceType)(-1)); // make sure not the mouse tablet device! 559System.Diagnostics.Debug.Assert(index < Count && Count > 0);
System\Windows\Input\TextComposition.cs (1)
305Debug.Assert((_resultText.Length == 1) && Char.IsControl(_resultText[0]));
System\Windows\Input\TextCompositionManager.cs (2)
737Debug.Assert(_altNumpadEntryMode); 857Debug.Assert(destination.Length == 2, "Invalid buffer length");
System\Windows\Input\TextServicesCompartment.cs (2)
86Debug.Assert(_cookie == UnsafeNativeMethods.TF_INVALID_COOKIE, "cookie is already set."); 107Debug.Assert(_cookie != UnsafeNativeMethods.TF_INVALID_COOKIE, "cookie is not set.");
System\Windows\Input\TextServicesContext.cs (1)
46Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "SetDispatcherThreaad on MTA thread");
System\Windows\Input\TouchDevice.cs (4)
601Debug.Assert(oldCapture != null, "oldCapture should be non-null."); 610Debug.Assert(captured != null, "captured should be non-null."); 848Debug.Assert(newDirectlyOver != _directlyOver, "ChangeDirectlyOver called when newDirectlyOver is the same as _directlyOver."); 930Debug.Assert(element != null);
System\Windows\InterOp\D3DImage.cs (8)
581Debug.Assert(timeout != Duration.Automatic); 622Debug.Assert(e.OldValue != e.NewValue); 659Debug.Assert(_isDirty); 660Debug.Assert(_isWaitingForPresent); 661Debug.Assert(_lockCount == 0); 682Debug.Assert(_duceResource.IsOnChannel(channel)); 764Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 838Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\InterOp\HwndAppCommandInputProvider.cs (1)
29Debug.Assert(null != _source);
System\Windows\InterOp\HwndKeyboardInputProvider.cs (4)
52Debug.Assert( null != _source ); 699Debug.Assert( null != _source ); 732Debug.Assert( null != _source ); 804Debug.Assert( null != _source );
System\Windows\InterOp\HwndMouseInputProvider.cs (3)
119Debug.Assert(_source is not null); 1181Debug.Assert(_source is not null); 1226Debug.Assert(_source is not null);
System\Windows\InterOp\HwndSource.cs (6)
738Debug.Assert(_weakMenuModeMessageHandler == null); 762Debug.Assert(_weakMenuModeMessageHandler != null); 1018Debug.Assert(_hwndTarget!= null, "HwndTarget is null"); 1019Debug.Assert(!_hwndTarget.IsDisposed, "HwndTarget is disposed"); 1523Debug.Assert(_adjustSizingForNonClientArea); 2263Debug.Assert(null!=ikis, "ChildSinkWithFocus called when none had focus");
System\Windows\InterOp\HwndTarget.cs (11)
473Debug.Assert(normalizedHwnd.Handle != IntPtr.Zero); 507Debug.Assert(normalizedHwnd.Handle != IntPtr.Zero); 595Debug.Assert(mode == RenderingMode.Software || mode == RenderingMode.Default); 721Debug.Assert(!_compositionTarget.IsOnChannel(channel)); 722Debug.Assert(!_compositionTarget.IsOnChannel(outOfBandChannel)); 741Debug.Assert(resourceCreated); 1341Debug.Assert(_restoreDT == sourceDT); 2375Debug.Assert(!_compositionTarget.IsOnChannel(channel)); 2579Debug.Assert(hwndTarget != null); 2596Debug.Assert(hwndTarget != null); 2599Debug.Assert(_hwndTargetCount >= 0);
System\Windows\Media\Animation\Animatable.cs (3)
62Debug.Assert(animatedPropertiesMap.Count > 0); 84Debug.Assert(animatedPropertiesMap.Count > 0); 298Debug.Assert(reference is WeakReference);
System\Windows\Media\Animation\AnimationClockResource.cs (6)
67Debug.Assert(sender as System.Windows.Threading.DispatcherObject != null); 68Debug.Assert(((System.Windows.Threading.DispatcherObject)sender).Dispatcher != null); 69Debug.Assert(_animationClock != null); 121Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 162Debug.Assert(_duceResource.IsOnChannel(channel)); 178Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\AnimationLayer.cs (19)
16Debug.Assert(ownerStorage != null); 27Debug.Assert( 34Debug.Assert(defaultDestinationValue != DependencyProperty.UnsetValue, 81Debug.Assert(handoffBehavior == HandoffBehavior.Compose, 83Debug.Assert(defaultDestinationValue == DependencyProperty.UnsetValue, 103Debug.Assert(_animationClocks != null); 118Debug.Assert(animationClocks != null); 119Debug.Assert(animationClocks.Count > 0); 120Debug.Assert(!animationClocks.Contains(null)); 121Debug.Assert(_animationClocks == null); 135Debug.Assert(_hasStickySnapshotValue, 145Debug.Assert(_animationClocks != null 153Debug.Assert(index >= 0, 185Debug.Assert(newAnimationClocks != null); 186Debug.Assert(newAnimationClocks.Count > 0); 187Debug.Assert(!newAnimationClocks.Contains(null)); 220Debug.Assert(defaultDestinationValue != DependencyProperty.UnsetValue); 240Debug.Assert(_snapshotValue != DependencyProperty.UnsetValue); 261Debug.Assert(count > 0);
System\Windows\Media\Animation\AnimationStorage.cs (41)
46Debug.Assert( _animationClocks == null 49Debug.Assert( _propertyTriggerLayers == null 78Debug.Assert(animationClock != null); 79Debug.Assert(_dependencyObject.Target != null); 80Debug.Assert(_currentTimeInvalidatedHandler != null); 106Debug.Assert(animationClock != null); 107Debug.Assert(_currentTimeInvalidatedHandler != null); 119Debug.Assert(_dependencyObject == null); 120Debug.Assert(_dependencyProperty == null); 144Debug.Assert(_propertyTriggerLayers != null); 145Debug.Assert(_propertyTriggerLayers.ContainsValue(layer)); 149Debug.Assert(index >= 0); 244Debug.Assert(animatedPropertyMap.Count > 0); 245Debug.Assert(animatedPropertyMap[_dependencyProperty.GlobalIndex] != DependencyProperty.UnsetValue); 501Debug.Assert( _animationClocks != null 509Debug.Assert(index > -1, 538Debug.Assert(_hasStickySnapshotValue, 550Debug.Assert(_animationClocks.Count > 0); 588Debug.Assert(animationClocks != null, 590Debug.Assert(animationClocks.Count > 0, 592Debug.Assert(!animationClocks.Contains(null), 594Debug.Assert(HandoffBehaviorEnum.IsDefined(handoffBehavior), 649Debug.Assert(animationClocks[i] != null); 657Debug.Assert(handoffBehavior == HandoffBehavior.Compose); 658Debug.Assert(storage != null); 659Debug.Assert(storage._animationClocks != null); 703Debug.Assert(animationClocks != null); 704Debug.Assert(!animationClocks.Contains(null)); 706Debug.Assert(HandoffBehaviorEnum.IsDefined(handoffBehavior), 776Debug.Assert(animation == null || IsAnimationValid(dp, animation)); 777Debug.Assert(IsPropertyAnimatable(d, dp)); 779Debug.Assert(HandoffBehaviorEnum.IsDefined(handoffBehavior), 848Debug.Assert(storage._animationClocks != null && storage._animationClocks.Count > 0, 895Debug.Assert(storage != null, 916Debug.Assert(storage._snapshotValue != DependencyProperty.UnsetValue); 928Debug.Assert(currentPropertyValue != DependencyProperty.UnsetValue); 938Debug.Assert(count > 0); 970Debug.Assert(clocksCount > 0); 971Debug.Assert(defaultDestinationValue != DependencyProperty.UnsetValue); 1082Debug.Assert( AnimatedPropertyMapField.GetValue(d)[dp.GlobalIndex] == DependencyProperty.UnsetValue 1144Debug.Assert(type == typeof(Vector3D), "Application is trying to create independent animation storage for an unsupported type.");
System\Windows\Media\Animation\Clock.cs (145)
51Debug.Assert(timeline != null); 161Debug.Assert(!IsTimeManager); 190Debug.Assert(!IsTimeManager); 208Debug.Assert(!IsTimeManager); 230Debug.Assert(!IsTimeManager); 268Debug.Assert(!IsTimeManager); 281Debug.Assert(!IsTimeManager); 299Debug.Assert(!IsTimeManager); 326Debug.Assert(!IsTimeManager); 354Debug.Assert(!IsTimeManager); 486Debug.Assert(!IsTimeManager); 572Debug.Assert(!clock.IsTimeManager); 622Debug.Assert(!current.IsTimeManager); // We should not yet be connected to the TimeManager 700Debug.Assert(!IsTimeManager); 775Debug.Assert(!IsTimeManager); 782Debug.Assert(!(IsInteractivelyPaused && PendingInteractivePause)); 783Debug.Assert(!(!IsInteractivelyPaused && PendingInteractiveResume)); 820Debug.Assert(!IsTimeManager); 827Debug.Assert( !(IsInteractivelyPaused && PendingInteractivePause)); 828Debug.Assert( !(!IsInteractivelyPaused && PendingInteractiveResume)); 855Debug.Assert(IsRoot); 877Debug.Assert(IsRoot); 948Debug.Assert(IsRoot); 959Debug.Assert(IsRoot); 990Debug.Assert(IsRoot); 1071Debug.Assert(!IsTimeManager); 1107Debug.Assert(!IsTimeManager); 1129Debug.Assert(!IsTimeManager); 1148Debug.Assert(!IsTimeManager); 1224Debug.Assert(!IsTimeManager); 1372Debug.Assert(!IsTimeManager); 1392Debug.Assert(_resolvedDuration != Duration.Automatic, "_resolvedDuration should never be set to Automatic."); 1409Debug.Assert(!IsTimeManager); 1410Debug.Assert(_parent != null && !_parent.IsTimeManager); 1782Debug.Assert(IsRoot); // root clocks only; non-roots have constant begin time 1783Debug.Assert(_rootData != null); 1788Debug.Assert(!RootBeginPending); // we can have either a begin or a seek, not both 1859Debug.Assert(_beginTime.HasValue); 1910Debug.Assert(IsRoot); 1916Debug.Assert(_rootData.DesiredFrameRate > 0); 1936Debug.Assert(!IsTimeManager); 1937Debug.Assert(!IsInteractivelyStopped); 1938Debug.Assert(_parent._currentClockState != ClockState.Stopped); 1939Debug.Assert(_currentClockState != ClockState.Stopped); 1940Debug.Assert(_currentDuration != Duration.Automatic, "_currentDuration should never be Automatic."); 1941Debug.Assert(_beginTime.HasValue); 1943Debug.Assert(parentTime >= _beginTime.Value); // We are active or in postfill 1958Debug.Assert(_currentClockState != ClockState.Active); 2166Debug.Assert(_currentDuration == Duration.Forever, "_currentDuration has an invalid enum value."); 2167Debug.Assert(_currentClockState == ClockState.Active 2185Debug.Assert(this is ClockGroup, "ComputeCurrentIterationWithGrow should only run on ClockGroups."); 2186Debug.Assert(CanGrow, "ComputeCurrentIterationWithGrow should only run on clocks with CanGrow."); 2187Debug.Assert(_currentIterationBeginTime.HasValue, "ComputeCurrentIterationWithGrow should only be called when _currentIterationBeginTime has a value."); 2188Debug.Assert(_resolvedDuration.HasTimeSpan, "ComputeCurrentIterationWithGrow should only be called when _resolvedDuration has a value."); // We must have a computed duration 2189Debug.Assert(_currentDuration.HasTimeSpan, "ComputeCurrentIterationWithGrow should only be called when _currentDuration has a value."); 2250Debug.Assert(!IsTimeManager); 2251Debug.Assert(!IsInteractivelyStopped); 2252Debug.Assert(_parent._currentClockState != ClockState.Stopped); 2253Debug.Assert(_beginTime.HasValue); 2302Debug.Assert(!IsTimeManager); 2303Debug.Assert(!IsInteractivelyStopped); 2304Debug.Assert(_parent._currentClockState != ClockState.Stopped); 2305Debug.Assert(_currentClockState == ClockState.Active); // Must be active at this point 2332Debug.Assert(!IsTimeManager); 2333Debug.Assert(!IsInteractivelyStopped); 2334Debug.Assert(_parent._currentClockState != ClockState.Stopped); 2335Debug.Assert(_currentClockState != ClockState.Stopped); 2336Debug.Assert(_currentDuration != Duration.Automatic, "_currentDuration should never be Automatic."); 2340Debug.Assert(_currentDuration.TimeSpan > TimeSpan.Zero, "ComputeCurrentTime was entered with _currentDuration <= 0"); 2347Debug.Assert(transitionTime <= 1, "The values of the accel and decel attributes incorrectly add to more than 1.0"); 2348Debug.Assert(transitionTime >= 0, "The values of the accel and decel attributes incorrectly add to less than 0.0"); 2411Debug.Assert(_currentDuration == Duration.Forever, "_currentDuration has an invalid enum value."); 2425Debug.Assert(!IsTimeManager); 2439Debug.Assert(_resolvedDuration == Duration.Forever, "_resolvedDuration should be Forever when NaturalDuration is Automatic."); 2467Debug.Assert(!IsTimeManager); 2468Debug.Assert(!IsInteractivelyStopped || IsRoot); 2472Debug.Assert(_resolvedDuration != Duration.Automatic, "_resolvedDuration should never be Automatic."); 2473Debug.Assert(_currentDuration != Duration.Automatic, "_currentDuration should never be Automatic."); 2495Debug.Assert(_currentDuration.HasTimeSpan, "_currentDuration is invalid, neither Forever nor a TimeSpan."); 2496Debug.Assert(_currentDuration == _resolvedDuration, "For clocks which cannot grow, _currentDuration must equal _resolvedDuration."); 2508Debug.Assert(_resolvedDuration.HasTimeSpan, "_resolvedDuration is invalid, neither Forever nor a TimeSpan."); 2509Debug.Assert(_currentDuration.HasTimeSpan, "_currentDuration is invalid, neither Forever nor a TimeSpan."); 2518Debug.Assert(_beginTime.HasValue); // _currentIterationBeginTime.HasValue implies _beginTime.HasValue 2547Debug.Assert(repeatBehavior == RepeatBehavior.Forever); // Only other valid enum value 2641Debug.Assert(!IsTimeManager); 2642Debug.Assert(!IsInteractivelyStopped || IsRoot); 2649Debug.Assert(!_currentIterationBeginTime.HasValue, "_currentIterationBeginTime should not have a value when _beginTime has no value."); 2654Debug.Assert(_beginTime.HasValue); 2683Debug.Assert(IsRoot); 2726Debug.Assert(_beginTime == null); 2727Debug.Assert(_currentClockState == ClockState.Stopped); 2751Debug.Assert(!IsInteractivelyPaused); // Enforce invariant: cannot be pausePending when already paused 2752Debug.Assert(!PendingInteractiveResume); // Enforce invariant: cannot be both pause and resumePending 2769Debug.Assert(IsInteractivelyPaused); 2770Debug.Assert(!PendingInteractivePause); 2798Debug.Assert(endOfActivePeriod.HasValue); 2873Debug.Assert(!IsTimeManager); 2898Debug.Assert(parentTime.HasValue); // If parent isn't stopped, it must have valid time and speed 2899Debug.Assert(parentSpeed.HasValue); 2925Debug.Assert(parentTime.HasValue); // Cannot be true unless parent is stopped 2946Debug.Assert(_beginTime.HasValue); 2947Debug.Assert(parentTime.HasValue); 2992Debug.Assert(!IsTimeManager); 2993Debug.Assert(!IsInteractivelyStopped); 2994Debug.Assert(_parent._currentClockState != ClockState.Stopped); 2995Debug.Assert(_beginTime.HasValue); 3067Debug.Assert(!IsTimeManager); 3068Debug.Assert(!IsInteractivelyStopped || IsRoot); 3072Debug.Assert(_rootData != null, "A root Clock must have the _rootData structure initialized."); 3150Debug.Assert(!IsTimeManager); 3151Debug.Assert(_parent != null); 3152Debug.Assert(_parent.CurrentState != ClockState.Stopped); 3155Debug.Assert(HasSeekOccuredAfterLastTick || 3159Debug.Assert(_syncData.SyncClock == this || _syncData.SyncClock._parent == this); 3160Debug.Assert(CanSlip || _timeline is ParallelTimeline && ((ParallelTimeline)_timeline).SlipBehavior == SlipBehavior.Slip); 3162Debug.Assert(_syncData != null); 3163Debug.Assert(!_syncData.IsInSyncPeriod); 3166Debug.Assert(!_timeline.AutoReverse); 3167Debug.Assert(_timeline.AccelerationRatio == 0); 3168Debug.Assert(_timeline.DecelerationRatio == 0); 3215Debug.Assert(syncClockDuration == Duration.Automatic); 3283Debug.Assert(!IsTimeManager); 3284Debug.Assert(_parent != null); 3285Debug.Assert(_syncData != null); 3286Debug.Assert(_syncData.IsInSyncPeriod); 3289Debug.Assert(_syncData.SyncClock == this || _syncData.SyncClock._parent == this); 3293Debug.Assert(!parentIntervalCollection.IsEmpty); // The parent isn't Stopped, so it must have a TIC 3297Debug.Assert(parentIntervalCollection.IsEmptyOfRealPoints || parentIntervalCollection.FirstNodeTime <= currentParentTimePT); 3298Debug.Assert(currentParentSpeed >= 0); 3386Debug.Assert(!current.IsRoot, "Root nodes never should reset their Slip amounts with ResetSlipOnSubtree(), even when seeking."); 3428Debug.Assert(!IsTimeManager); 3509Debug.Assert(_rootData.DesiredFrameRate > 0); 3537Debug.Assert(!IsTimeManager); 3560Debug.Assert(!IsTimeManager); 3561Debug.Assert(_parent == null); 3562Debug.Assert(_timeManager == null); 3653Debug.Assert(factor != 0); // Divide by zero 3737Debug.Assert(IsRoot); // This should only be called on root-child clocks 3773Debug.Assert(!IsTimeManager); 3852Debug.Assert(!IsTimeManager); 3970Debug.Assert(syncClock != null); 3971Debug.Assert(syncClock.GetCanSlip()); 3972Debug.Assert(syncClock.IsRoot || syncClock._timeline.BeginTime.HasValue); // Only roots may later validate their _beginTime 4061Debug.Assert(_syncClockBeginTime.HasValue); // This should never be queried on a root without beginTime 4163Debug.Assert(Math.Abs(optimizedInputTime - inputTime) <= error,
System\Windows\Media\Animation\ClockController.cs (1)
31Debug.Assert(owner != null, "ClockController must have a non-null owner.");
System\Windows\Media\Animation\ClockGroup.cs (19)
50Debug.Assert(!IsTimeManager); 63Debug.Assert(!IsTimeManager); 76Debug.Assert(IsTimeManager); 94Debug.Assert(timelineGroup != null); 183Debug.Assert(IsTimeManager); 211Debug.Assert(IsTimeManager); 248Debug.Assert(IsTimeManager); 294Debug.Assert(group != null); // We should only have this flag set for ClockGroups 308Debug.Assert(_children != null); 407Debug.Assert(!IsTimeManager, "Cannot associate a root with multiple timing trees"); 408Debug.Assert(this._timeManager == null, "Cannot use a timeline already in the timing tree as a root"); 409Debug.Assert(timeManager.TimeManagerClock == this, "Cannot associate more than one root per timing tree"); 410Debug.Assert(this._parent == null && _children == null, "Cannot use a timeline connected to other timelines as a root"); 432Debug.Assert(IsRoot); 457Debug.Assert(IsTimeManager, "Invalid call to RootActivate for a non-root Clock"); 458Debug.Assert(_timeManager != null); // RootActivate should be called by our own TimeManager 473Debug.Assert(IsTimeManager, "Invalid call to RootCleanChildren for a non-root Clock"); 496Debug.Assert(IsTimeManager, "Invalid call to RootHasChildren for a non-root Clock"); 507Debug.Assert(IsTimeManager, "Invalid call to RootDeactivate for a non-root Clock");
System\Windows\Media\Animation\DoubleAnimationUsingPath.cs (2)
163Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 256Debug.Assert(!_isValid);
System\Windows\Media\Animation\Generated\BooleanAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 531Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 538Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 588Debug.Assert(!_areKeyTimesValid, "KeyFrameBooleanAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 732Debug.Assert(index < keyFrameCount, 808Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\BooleanKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\ByteAnimation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\ByteAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameByteAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\ByteKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\CharAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 531Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 538Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 588Debug.Assert(!_areKeyTimesValid, "KeyFrameCharAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 732Debug.Assert(index < keyFrameCount, 808Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\CharKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\ColorAnimation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\ColorAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameColorAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\ColorIndependentAnimationStorage.cs (1)
36Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\ColorKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\DecimalAnimation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\DecimalAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameDecimalAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\DecimalKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\DoubleAnimation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\DoubleAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameDoubleAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\DoubleIndependentAnimationStorage.cs (1)
36Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\DoubleKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\Int16Animation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Int16AnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameInt16Animaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Int16KeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\Int32Animation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Int32AnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameInt32Animaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Int32KeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\Int64Animation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Int64AnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameInt64Animaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Int64KeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\MatrixAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 531Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 538Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 588Debug.Assert(!_areKeyTimesValid, "KeyFrameMatrixAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 732Debug.Assert(index < keyFrameCount, 808Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\MatrixIndependentAnimationStorage.cs (1)
36Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\MatrixKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\ObjectAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 531Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 538Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 588Debug.Assert(!_areKeyTimesValid, "KeyFrameObjectAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 732Debug.Assert(index < keyFrameCount, 808Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\ObjectKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\Point3DAnimation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Point3DAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFramePoint3DAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Point3DIndependentAnimationStorage.cs (1)
36Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\Point3DKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\PointAnimation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\PointAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFramePointAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\PointIndependentAnimationStorage.cs (1)
36Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\PointKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\QuaternionAnimation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\QuaternionAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameQuaternionAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\QuaternionIndependentAnimationStorage.cs (1)
36Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\QuaternionKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\RectAnimation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\RectAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameRectAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\RectIndependentAnimationStorage.cs (1)
36Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\RectKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\Rotation3DAnimation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Rotation3DAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameRotation3DAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Rotation3DKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\SingleAnimation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\SingleAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameSingleAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\SingleKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\SizeAnimation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\SizeAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameSizeAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\SizeIndependentAnimationStorage.cs (1)
36Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\SizeKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\StringAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 531Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 538Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 588Debug.Assert(!_areKeyTimesValid, "KeyFrameStringAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 732Debug.Assert(index < keyFrameCount, 808Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\StringKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\TimelineCollection.cs (3)
85Debug.Assert(_collection.Count == 0); 744Debug.Assert(list != null, "list may not be null."); 843Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Animation\Generated\TimelineGroup.cs (1)
171Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Animation\Generated\Vector3DAnimation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Vector3DAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameVector3DAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Vector3DIndependentAnimationStorage.cs (1)
36Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\Vector3DKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\VectorAnimation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\VectorAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameVectorAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\VectorKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\IndependentAnimationStorage.cs (14)
62Debug.Assert(d != null); 66Debug.Assert(d.Dispatcher != null); 69Debug.Assert(d.CheckAccess()); 91Debug.Assert(_duceResource.IsOnChannel(channel)); 107Debug.Assert(d != null); 110Debug.Assert(d.Dispatcher != null); 113Debug.Assert(d.CheckAccess()); 178Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 210Debug.Assert(d != null); 214Debug.Assert(_duceResource.IsOnAnyChannel); 230Debug.Assert(d != null); 231Debug.Assert(dp != null); 232Debug.Assert(d is Animatable ? ((Animatable)d).HasAnimatedProperties : true); 242Debug.Assert(storage._duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\KeySpline.cs (3)
253Debug.Assert(_isDirty); 305Debug.Assert(_isSpecified); 327Debug.Assert(_isSpecified);
System\Windows\Media\Animation\MatrixAnimationUsingPath.cs (2)
242Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 305Debug.Assert(!_isValid);
System\Windows\Media\Animation\PointAnimationUsingPath.cs (2)
134Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 207Debug.Assert(!_isValid);
System\Windows\Media\Animation\RepeatBehavior.cs (1)
67Debug.Assert(behaviorType == RepeatBehaviorType.Forever);
System\Windows\Media\Animation\TimeIntervalCollection.cs (83)
105Debug.Assert(_minimumCapacity >= 2); 132Debug.Assert(IsEmpty); // We should start with a new or Clear()-ed collection first 139Debug.Assert(!_nodeIsInterval[0]); 188Debug.Assert(_count == 0); // The boolean constructor already did the job for us 250Debug.Assert(_count > 0); 296Debug.Assert(IsSingleInterval); 298Debug.Assert(0 < _count && _count <= 2); 307Debug.Assert(beginTime <= _nodeTime[1]); 411Debug.Assert(_nodeTime[index] < time); 543Debug.Assert(fromIndex <= toIndex); 554Debug.Assert(toIndex >= 0); // Since fromIndex!=toIndex, toIndex must be >= 0 561Debug.Assert(fromIndex + 1 < toIndex); 617Debug.Assert(!_invertCollection); // Make sure we never leave inverted mode enabled 681Debug.Assert(!tic1.IsEmptyOfRealPoints); // We shouldn't reach here if either TIC is empty 682Debug.Assert(!tic2.IsEmptyOfRealPoints); 710Debug.Assert(!intersectionFound); // If an intersection was already found, we should not reach this far 720Debug.Assert(tic2.CurrentNodeIsPoint || tic2.CurrentNodeIsInterval); 738Debug.Assert(!tic1.CurrentIsAtLastNode); // Thus tic1._current can be safely advanced now 744Debug.Assert(tic1.CurrentNodeTime >= tic2.CurrentNodeTime); 747Debug.Assert(tic2.CurrentIsAtLastNode || (tic1.CurrentNodeTime < tic2.NextNodeTime)); 748Debug.Assert(tic1.CurrentIsAtLastNode || (tic2.CurrentNodeTime < tic1.NextNodeTime)); 780Debug.Assert(tic1.NextNodeTime == tic2.NextNodeTime); 788Debug.Assert(tic1.CurrentIsAtLastNode && tic2.CurrentIsAtLastNode); 796Debug.Assert(tic2.CurrentIsAtLastNode || (tic1.CurrentNodeTime < tic2.NextNodeTime)); 797Debug.Assert(tic1.CurrentIsAtLastNode || (tic2.CurrentNodeTime < tic1.NextNodeTime)); 808Debug.Assert(!_invertCollection); // Make sure we never leave inverted mode enabled 856Debug.Assert(!_invertCollection); // Make sure we never leave inverted mode enabled 875Debug.Assert(beginTime <= CurrentNodeTime); // The PTIC is clipped by the active period, and we are a subset of the active period 876Debug.Assert(CurrentIsAtLastNode || beginTime < NextNodeTime); 983Debug.Assert(!_invertCollection); // Make sure we never leave inverted mode enabled 1031Debug.Assert(projection.IsEmpty); // Make sure the projection was properly cleared first 1032Debug.Assert(!_invertCollection); // Make sure we never leave inverted mode enabled 1033Debug.Assert(beginTime <= endTime); // Ensure legitimate begin/end clipping parameters 1035Debug.Assert(!IsEmptyOfRealPoints); // We assume this function is ONLY called when this collection overlaps the postfill zone. So we cannot be empty. 1036Debug.Assert(!period.HasTimeSpan || period.TimeSpan > TimeSpan.Zero || beginTime == endTime); // Check the consistency of degenerate case where simple duration is zero; expiration time should equal beginTime 1037Debug.Assert(!_nodeIsInterval[_count - 1]); // We should not have an infinite domain set 1154Debug.Assert(projection.IsEmpty); 1155Debug.Assert(!_invertCollection); // Make sure we never leave inverted mode enabled 1156Debug.Assert(!endTime.HasValue || beginTime <= endTime); // Ensure legitimate begin/end clipping parameters 1158Debug.Assert(!IsEmptyOfRealPoints); // We assume this function is ONLY called when this collection overlaps the active zone. So we cannot be empty. 1159Debug.Assert(!endTime.HasValue || endTime >= _nodeTime[0]); // EndTime must come at or after our first node (it can be infinite) 1160Debug.Assert(_nodeTime[_count - 1] >= beginTime); // Our last node must come at least at begin time (since we must intersect the active period) 1161Debug.Assert(endTime.HasValue || fillDuration == TimeSpan.Zero); // Either endTime is finite, or it's infinite hence we cannot have any fill zone 1162Debug.Assert(!period.HasTimeSpan || period.TimeSpan > TimeSpan.Zero || (endTime.HasValue && beginTime == endTime)); // Check the consistency of degenerate case where simple duration is zero; expiration time should equal beginTime 1163Debug.Assert(!_nodeIsInterval[_count - 1]); // We should not have an infinite domain set 1237Debug.Assert(!IsEmptyOfRealPoints); 1238Debug.Assert(projection.IsEmpty); 1277Debug.Assert(_current > 0); // The only way _current could stay at zero is if the collection begins at (or past) the end of active period 1282Debug.Assert(endTime.HasValue && CurrentNodeTime >= endTime.Value); 1307Debug.Assert(!IsEmptyOfRealPoints); // The entire projection process assumes we are not empty (have an intersection with the active zone). 1308Debug.Assert(periodInTicks > 0); // We do not handle the degenerate case here. 1312Debug.Assert(CurrentNodeTime >= TimeSpan.Zero); // Verify that we are already clipped 1329Debug.Assert(CurrentNodeIsPoint); 1349Debug.Assert(CurrentNodeIsPoint); // We should only call this method when we project a legitimate point 1350Debug.Assert(!CurrentNodeIsInterval); 1421Debug.Assert(timeBeforeNextPeriod > 0); 1494Debug.Assert(intervalLength > 0); 1577Debug.Assert(index == -1 || _nodeTime[index] < point); 1608Debug.Assert(from < to); // Our code should never call MergeInterval for a point or reversed interval 1624Debug.Assert(_nodeTime.Length >= _minimumCapacity); // Assert that we indeed have memory allocated 1662Debug.Assert(_nodeTime[fromIndex] == from); 1693Debug.Assert(_nodeTime[toIndex] == to); 1694Debug.Assert(fromIndex < toIndex); 1725Debug.Assert(_count + netIncreaseInNodes >= 2); // We should never shrink past size 2 1773Debug.Assert(_nodeIsPoint == null); 1774Debug.Assert(_nodeIsInterval == null); 1782Debug.Assert(_nodeIsPoint != null); 1783Debug.Assert(_nodeIsInterval != null); 1814Debug.Assert(periodInTicks > 0); 1815Debug.Assert(accelRatio + decelRatio > 0); 2129Debug.Assert(_count > 0); // Count cannot be negative 2155Debug.Assert(right == _count - 1); 2185Debug.Assert(_current <= _count); 2200Debug.Assert(_current < _count); 2205Debug.Assert(_current < _count); 2214Debug.Assert(_current < _count); 2219Debug.Assert(_current < _count); 2228Debug.Assert(_current < _count); 2233Debug.Assert(_current < _count); 2242Debug.Assert(_current + 1 < _count); 2251Debug.Assert(_current + 1 < _count); 2260Debug.Assert(_current + 1 < _count); 2275Debug.Assert(_invertCollection != mode); // Make sure we aren't redundantly setting the mode
System\Windows\Media\Animation\Timeline.cs (1)
922Debug.Assert(sourceStore.Count > 0);
System\Windows\Media\Animation\TimelineClockCollection.cs (1)
417Debug.Assert(owner != null, "ClockCollection must have a non-null owner.");
System\Windows\Media\Animation\WeakRefEnumerator.cs (2)
54Debug.Assert(_valid); 72Debug.Assert(_valid);
System\Windows\Media\BitmapCacheBrush.cs (11)
177Debug.Assert(InternalTarget == AutoWrapVisual, 196Debug.Assert(!_pendingLayout); 254Debug.Assert(element != null); 274Debug.Assert(_pendingLayout); 278Debug.Assert(element != null); 289Debug.Assert(_DispatcherLayoutResult != null); 290Debug.Assert(_DispatcherLayoutResult.Status == DispatcherOperationStatus.Pending); 292Debug.Assert(abortStatus); 304Debug.Assert(_pendingLayout); 307Debug.Assert(element != null); 345Debug.Assert(_reentrancyFlag); // Exit must be matched with Enter. See Enter comments.
System\Windows\Media\BoundsDrawingContextWalker.cs (4)
501Debug.Assert(_pushTypeStack != null); 502Debug.Assert(_pushTypeStack.Count > 0); 511Debug.Assert(_transformStack != null); 512Debug.Assert(_transformStack.Count > 0);
System\Windows\Media\ByteStreamGeometryContext.cs (8)
312Debug.Assert(sizeof(MIL_PATHGEOMETRY) <= _currOffset); 313Debug.Assert(_currentPathGeometryData.Size == (uint)_currOffset); 417Debug.Assert(_chunkList.Count != 0); 542Debug.Assert(_currentPathFigureDataOffset + sizeof(MIL_PATHFIGURE) <= _currOffset); 582Debug.Assert(_currentPolySegmentDataOffset + sizeof(MIL_SEGMENT_POLY) <= _currOffset); 665Debug.Assert(points != null); 666Debug.Assert(count > 0); 715Debug.Assert((_currentPolySegmentDataOffset != -1) &&
System\Windows\Media\ColorContext.cs (2)
149Debug.Assert(_profileUri is null); 575Debug.Assert(stm != null);
System\Windows\Media\ColorTransformHelper.cs (2)
71Debug.Assert(success); 73Debug.Assert(success);
System\Windows\Media\CombinedGeometry.cs (1)
188Debug.Assert(false);
System\Windows\Media\CompositionTarget.cs (6)
48Debug.Assert(channel != null); 49Debug.Assert(!_contentRoot.IsOnChannel(channel)); 51Debug.Assert(outOfBandChannel != null); 52Debug.Assert(!_contentRoot.IsOnChannel(outOfBandChannel)); 63Debug.Assert(resourceCreated); 440Debug.Assert(_cachedRenderContext == null);
System\Windows\Media\Drawing.cs (1)
72Debug.Assert(ctx != null);
System\Windows\Media\DrawingContextDrawingContextWalker.cs (1)
25Debug.Assert (drawingContext != null);
System\Windows\Media\DrawingContextWalker.cs (2)
30Debug.Assert(false); 40Debug.Assert(false);
System\Windows\Media\DrawingDrawingContext.cs (3)
1288Debug.Assert(geometry != null); 1376Debug.Assert(newDrawing != null); 1382Debug.Assert(_currentDrawingGroup == null);
System\Windows\Media\DrawingGroup.cs (3)
80Debug.Assert(_open); 81Debug.Assert(rootDrawingGroupChildren != null); 160Debug.Assert(!ctx.ShouldStopWalking);
System\Windows\Media\DrawingGroupDrawingContext.cs (2)
20Debug.Assert(null != drawingGroup); 38Debug.Assert(null != _drawingGroup);
System\Windows\Media\DrawingVisual.cs (4)
50Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated); 135Debug.Assert(_proxy.IsOnChannel(channel)); 205Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentConnected)); 206Debug.Assert(_proxy.IsOnChannel(channel));
System\Windows\Media\DrawingVisualDrawingContext.cs (2)
22Debug.Assert(null != ownerVisual); 38Debug.Assert(null != _ownerVisual);
System\Windows\Media\Effects\Generated\BitmapEffectCollection.cs (3)
88Debug.Assert(_collection.Count == 0); 747Debug.Assert(list != null, "list may not be null."); 846Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Effects\Generated\BitmapEffectGroup.cs (1)
194Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Effects\Generated\BitmapEffectInput.cs (1)
227Debug.Assert(s_Input == null || s_Input.IsFrozen,
System\Windows\Media\Effects\Generated\BlurEffect.cs (2)
163Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 212Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Effects\Generated\DropShadowEffect.cs (2)
229Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 301Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Effects\Generated\ImplicitInputBrush.cs (2)
100Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 180Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Effects\Generated\PixelShader.cs (1)
166Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Effects\Generated\ShaderEffect.cs (3)
99Debug.Assert(!channel.IsOutOfBandChannel); 100Debug.Assert(!targetResource.GetHandle(channel).IsNull); 187Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Effects\PixelShader.cs (3)
81Debug.Assert(newUri.IsAbsoluteUri); 144Debug.Assert(len == lengthRead); 167Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel));
System\Windows\Media\Effects\ShaderEffect.cs (8)
400Debug.Assert(false); 540Debug.Assert(!channel.IsOutOfBandChannel); 541Debug.Assert(!targetResource.GetHandle(channel).IsNull); 554Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 708Debug.Assert(sizeof(DUCE.ResourceHandle) == sizeof(Int32)); 714Debug.Assert(!hBrush.IsNull || ss._brush == null, "If brush isn't null, hBrush better not be"); 787Debug.Assert(_duceResource.IsOnChannel(channel)); 937Debug.Assert(false);
System\Windows\Media\EventProxy.cs (2)
29Debug.Assert(((IntPtr)pEPD.m_handle) != IntPtr.Zero, "If this asserts fires: Why is it firing? It might be legal in future."); 104Debug.Assert(((IntPtr)epd.m_handle) != IntPtr.Zero, "Stream is disposed.");
System\Windows\Media\FactoryMaker.cs (2)
100Debug.Assert(s_pFactory != IntPtr.Zero); 116Debug.Assert(s_pImagingFactory != IntPtr.Zero);
System\Windows\Media\FamilyMap.cs (1)
350Debug.Assert(first <= last);
System\Windows\Media\FontFamilyConverter.cs (3)
163Debug.Assert(name != null); 168Debug.Assert(name != null); 173Debug.Assert(name != null);
System\Windows\Media\FormattedText.cs (6)
990Debug.Assert(_nextLine == null); 1010Debug.Assert(_totalHeight + _currentLine.Height <= _that._maxTextHeight); 1097Debug.Assert(_that._text.Length > 0 && textSourcePosition + line.Length <= _that._text.Length + 1); 1113Debug.Assert(_that._trimming == TextTrimming.WordEllipsis); 1716Debug.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."); 1717Debug.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\BitmapCache.cs (2)
170Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 219Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\BitmapCacheBrush.cs (10)
111Debug.Assert(!channel.IsOutOfBandChannel); 112Debug.Assert(!targetResource.GetHandle(channel).IsNull); 148Debug.Assert(element != null); 151Debug.Assert(target._DispatcherLayoutResult != null); 152Debug.Assert(target._DispatcherLayoutResult.Status == System.Windows.Threading.DispatcherOperationStatus.Pending); 154Debug.Assert(abortStatus); 172Debug.Assert(!channel.IsOutOfBandChannel); 173Debug.Assert(!targetResource.GetHandle(channel).IsNull); 307Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 398Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\Brush.cs (6)
114Debug.Assert(!channel.IsOutOfBandChannel); 115Debug.Assert(!targetResource.GetHandle(channel).IsNull); 162Debug.Assert(!channel.IsOutOfBandChannel); 163Debug.Assert(!targetResource.GetHandle(channel).IsNull); 438Debug.Assert(s_Transform == null || s_Transform.IsFrozen, 442Debug.Assert(s_RelativeTransform == null || s_RelativeTransform.IsFrozen,
System\Windows\Media\Generated\CombinedGeometry.cs (8)
111Debug.Assert(!channel.IsOutOfBandChannel); 112Debug.Assert(!targetResource.GetHandle(channel).IsNull); 159Debug.Assert(!channel.IsOutOfBandChannel); 160Debug.Assert(!targetResource.GetHandle(channel).IsNull); 252Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 320Debug.Assert(_duceResource.IsOnChannel(channel)); 441Debug.Assert(s_Geometry1 == null || s_Geometry1.IsFrozen, 445Debug.Assert(s_Geometry2 == null || s_Geometry2.IsFrozen,
System\Windows\Media\Generated\DashStyle.cs (3)
152Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 222Debug.Assert(_duceResource.IsOnChannel(channel)); 336Debug.Assert(s_Dashes == null || s_Dashes.IsFrozen,
System\Windows\Media\Generated\DoubleCollection.cs (2)
772Debug.Assert(list != null, "list may not be null."); 871Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\DrawingBrush.cs (4)
104Debug.Assert(!channel.IsOutOfBandChannel); 105Debug.Assert(!targetResource.GetHandle(channel).IsNull); 167Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 273Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\DrawingCollection.cs (2)
789Debug.Assert(list != null, "list may not be null."); 888Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\DrawingContextWalker.cs (24)
39Debug.Assert(false); 59Debug.Assert(false); 81Debug.Assert(false); 105Debug.Assert(false); 137Debug.Assert(false); 175Debug.Assert(false); 209Debug.Assert(false); 249Debug.Assert(false); 271Debug.Assert(false); 289Debug.Assert(false); 309Debug.Assert(false); 324Debug.Assert(false); 351Debug.Assert(false); 369Debug.Assert(false); 381Debug.Assert(false); 393Debug.Assert(false); 407Debug.Assert(false); 423Debug.Assert(false); 435Debug.Assert(false); 447Debug.Assert(false); 458Debug.Assert(false); 475Debug.Assert(false); 490Debug.Assert(false); 499Debug.Assert(false);
System\Windows\Media\Generated\DrawingGroup.cs (19)
124Debug.Assert(!channel.IsOutOfBandChannel); 125Debug.Assert(!targetResource.GetHandle(channel).IsNull); 137Debug.Assert(resource != null); 148Debug.Assert(resource != null); 195Debug.Assert(!channel.IsOutOfBandChannel); 196Debug.Assert(!targetResource.GetHandle(channel).IsNull); 250Debug.Assert(!channel.IsOutOfBandChannel); 251Debug.Assert(!targetResource.GetHandle(channel).IsNull); 298Debug.Assert(!channel.IsOutOfBandChannel); 299Debug.Assert(!targetResource.GetHandle(channel).IsNull); 346Debug.Assert(!channel.IsOutOfBandChannel); 347Debug.Assert(!targetResource.GetHandle(channel).IsNull); 557Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 669Debug.Assert(_duceResource.IsOnChannel(channel)); 725Debug.Assert(!channel.IsOutOfBandChannel); 726Debug.Assert(!thisResource.GetHandle(channel).IsNull); 750Debug.Assert(!channel.IsOutOfBandChannel); 751Debug.Assert(!thisResource.GetHandle(channel).IsNull); 858Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Generated\DrawingImage.cs (4)
104Debug.Assert(!channel.IsOutOfBandChannel); 105Debug.Assert(!targetResource.GetHandle(channel).IsNull); 167Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 214Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\EllipseGeometry.cs (2)
170Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 247Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\GeneralTransformCollection.cs (3)
95Debug.Assert(_collection.Count == 0); 754Debug.Assert(list != null, "list may not be null."); 853Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\GeneralTransformGroup.cs (1)
188Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Generated\Geometry.cs (3)
109Debug.Assert(!channel.IsOutOfBandChannel); 110Debug.Assert(!targetResource.GetHandle(channel).IsNull); 355Debug.Assert(s_Transform == null || s_Transform.IsFrozen,
System\Windows\Media\Generated\GeometryCollection.cs (2)
789Debug.Assert(list != null, "list may not be null."); 888Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\GeometryDrawing.cs (8)
104Debug.Assert(!channel.IsOutOfBandChannel); 105Debug.Assert(!targetResource.GetHandle(channel).IsNull); 152Debug.Assert(!channel.IsOutOfBandChannel); 153Debug.Assert(!targetResource.GetHandle(channel).IsNull); 200Debug.Assert(!channel.IsOutOfBandChannel); 201Debug.Assert(!targetResource.GetHandle(channel).IsNull); 293Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 350Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\GeometryGroup.cs (11)
131Debug.Assert(!channel.IsOutOfBandChannel); 132Debug.Assert(!targetResource.GetHandle(channel).IsNull); 144Debug.Assert(resource != null); 155Debug.Assert(resource != null); 232Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 319Debug.Assert(_duceResource.IsOnChannel(channel)); 369Debug.Assert(!channel.IsOutOfBandChannel); 370Debug.Assert(!thisResource.GetHandle(channel).IsNull); 394Debug.Assert(!channel.IsOutOfBandChannel); 395Debug.Assert(!thisResource.GetHandle(channel).IsNull); 488Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Generated\GlyphRunDrawing.cs (6)
85Debug.Assert(!channel.IsOutOfBandChannel); 86Debug.Assert(!targetResource.GetHandle(channel).IsNull); 133Debug.Assert(!channel.IsOutOfBandChannel); 134Debug.Assert(!targetResource.GetHandle(channel).IsNull); 211Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 263Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\GradientBrush.cs (1)
285Debug.Assert(s_GradientStops == null || s_GradientStops.IsFrozen,
System\Windows\Media\Generated\GradientStopCollection.cs (3)
95Debug.Assert(_collection.Count == 0); 857Debug.Assert(list != null, "list may not be null."); 956Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\GuidelineSet.cs (4)
178Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 255Debug.Assert(_duceResource.IsOnChannel(channel)); 361Debug.Assert(s_GuidelinesX == null || s_GuidelinesX.IsFrozen, 365Debug.Assert(s_GuidelinesY == null || s_GuidelinesY.IsFrozen,
System\Windows\Media\Generated\ImageBrush.cs (4)
104Debug.Assert(!channel.IsOutOfBandChannel); 105Debug.Assert(!targetResource.GetHandle(channel).IsNull); 167Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 273Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\ImageDrawing.cs (4)
104Debug.Assert(!channel.IsOutOfBandChannel); 105Debug.Assert(!targetResource.GetHandle(channel).IsNull); 189Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 244Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\Int32Collection.cs (2)
772Debug.Assert(list != null, "list may not be null."); 871Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\LinearGradientBrush.cs (1)
172Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\LineGeometry.cs (2)
148Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 219Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\MatrixTransform.cs (2)
126Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 173Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\PathFigure.cs (1)
263Debug.Assert(s_Segments == null || s_Segments.IsFrozen,
System\Windows\Media\Generated\PathFigureCollection.cs (3)
96Debug.Assert(_collection.Count == 0); 844Debug.Assert(list != null, "list may not be null."); 943Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\PathGeometry.cs (2)
176Debug.Assert(_duceResource.IsOnChannel(channel)); 286Debug.Assert(s_Figures == null || s_Figures.IsFrozen,
System\Windows\Media\Generated\PathSegmentCollection.cs (3)
95Debug.Assert(_collection.Count == 0); 754Debug.Assert(list != null, "list may not be null."); 853Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\Pen.cs (7)
104Debug.Assert(!channel.IsOutOfBandChannel); 105Debug.Assert(!targetResource.GetHandle(channel).IsNull); 194Debug.Assert(!channel.IsOutOfBandChannel); 195Debug.Assert(!targetResource.GetHandle(channel).IsNull); 362Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 429Debug.Assert(_duceResource.IsOnChannel(channel)); 562Debug.Assert(s_DashStyle == null || s_DashStyle.IsFrozen,
System\Windows\Media\Generated\PointCollection.cs (2)
774Debug.Assert(list != null, "list may not be null."); 873Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\PolyBezierSegment.cs (1)
201Debug.Assert(s_Points == null || s_Points.IsFrozen,
System\Windows\Media\Generated\PolyLineSegment.cs (1)
201Debug.Assert(s_Points == null || s_Points.IsFrozen,
System\Windows\Media\Generated\PolyQuadraticBezierSegment.cs (1)
201Debug.Assert(s_Points == null || s_Points.IsFrozen,
System\Windows\Media\Generated\RadialGradientBrush.cs (1)
216Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\RectangleGeometry.cs (2)
170Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 247Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\RenderData.cs (14)
513Debug.Assert(_duceResource.IsOnChannel(channel)); 525Debug.Assert(cbExtraData <= (uint)Int32.MaxValue); 537Debug.Assert((_curOffset > 0) || (_dependentResources.Count == 0)); 541Debug.Assert((_buffer != null) || (_curOffset == 0)); 544Debug.Assert((_buffer == null) || (_curOffset <= _buffer.Length)); 1086Debug.Assert(false); 1106Debug.Assert((_curOffset > 0) || (_dependentResources.Count == 0)); 1110Debug.Assert((_buffer != null) || (_curOffset == 0)); 1113Debug.Assert((_buffer == null) || (_curOffset <= _buffer.Length)); 1426Debug.Assert(false); 1446Debug.Assert((_curOffset > 0) || (_dependentResources.Count == 0)); 1450Debug.Assert((_buffer != null) || (_curOffset == 0)); 1453Debug.Assert((_buffer == null) || (_curOffset <= _buffer.Length)); 1778Debug.Assert(false);
System\Windows\Media\Generated\RenderDataDrawingContext.cs (25)
64Debug.Assert(sizeof(MILCMD_DRAW_LINE) == 40); 125Debug.Assert(sizeof(MILCMD_DRAW_LINE_ANIMATE) == 48); 180Debug.Assert(sizeof(MILCMD_DRAW_RECTANGLE) == 40); 242Debug.Assert(sizeof(MILCMD_DRAW_RECTANGLE_ANIMATE) == 48); 309Debug.Assert(sizeof(MILCMD_DRAW_ROUNDED_RECTANGLE) == 56); 393Debug.Assert(sizeof(MILCMD_DRAW_ROUNDED_RECTANGLE_ANIMATE) == 72); 462Debug.Assert(sizeof(MILCMD_DRAW_ELLIPSE) == 40); 548Debug.Assert(sizeof(MILCMD_DRAW_ELLIPSE_ANIMATE) == 56); 603Debug.Assert(sizeof(MILCMD_DRAW_GEOMETRY) == 16); 654Debug.Assert(sizeof(MILCMD_DRAW_IMAGE) == 40); 711Debug.Assert(sizeof(MILCMD_DRAW_IMAGE_ANIMATE) == 40); 758Debug.Assert(sizeof(MILCMD_DRAW_GLYPH_RUN) == 8); 801Debug.Assert(sizeof(MILCMD_DRAW_DRAWING) == 8); 850Debug.Assert(sizeof(MILCMD_DRAW_VIDEO) == 40); 905Debug.Assert(sizeof(MILCMD_DRAW_VIDEO_ANIMATE) == 40); 944Debug.Assert(sizeof(MILCMD_PUSH_CLIP) == 8); 984Debug.Assert(sizeof(MILCMD_PUSH_OPACITY_MASK) == 24); 1026Debug.Assert(sizeof(MILCMD_PUSH_OPACITY) == 8); 1074Debug.Assert(sizeof(MILCMD_PUSH_OPACITY_ANIMATE) == 16); 1113Debug.Assert(sizeof(MILCMD_PUSH_TRANSFORM) == 8); 1194Debug.Assert(sizeof(MILCMD_PUSH_GUIDELINE_SET) == 8); 1233Debug.Assert(sizeof(MILCMD_PUSH_GUIDELINE_Y1) == 8); 1279Debug.Assert(sizeof(MILCMD_PUSH_GUIDELINE_Y2) == 16); 1323Debug.Assert(sizeof(MILCMD_PUSH_EFFECT) == 8); 1367Debug.Assert(sizeof(MILCMD_POP) == 1);
System\Windows\Media\Generated\RotateTransform.cs (2)
170Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 229Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\ScaleTransform.cs (2)
192Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 257Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\SkewTransform.cs (2)
192Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 257Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\SolidColorBrush.cs (2)
126Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 212Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\TextEffectCollection.cs (3)
95Debug.Assert(_collection.Count == 0); 754Debug.Assert(list != null, "list may not be null."); 853Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\TransformCollection.cs (2)
789Debug.Assert(list != null, "list may not be null."); 888Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\TransformGroup.cs (11)
124Debug.Assert(!channel.IsOutOfBandChannel); 125Debug.Assert(!targetResource.GetHandle(channel).IsNull); 137Debug.Assert(resource != null); 148Debug.Assert(resource != null); 210Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 280Debug.Assert(_duceResource.IsOnChannel(channel)); 329Debug.Assert(!channel.IsOutOfBandChannel); 330Debug.Assert(!thisResource.GetHandle(channel).IsNull); 354Debug.Assert(!channel.IsOutOfBandChannel); 355Debug.Assert(!thisResource.GetHandle(channel).IsNull); 443Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Generated\TranslateTransform.cs (2)
148Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 201Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\VectorCollection.cs (2)
774Debug.Assert(list != null, "list may not be null."); 873Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\VideoDrawing.cs (4)
85Debug.Assert(!channel.IsOutOfBandChannel); 86Debug.Assert(!targetResource.GetHandle(channel).IsNull); 170Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 225Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\VisualBrush.cs (8)
86Debug.Assert(element != null); 89Debug.Assert(target._DispatcherLayoutResult != null); 90Debug.Assert(target._DispatcherLayoutResult.Status == System.Windows.Threading.DispatcherOperationStatus.Pending); 92Debug.Assert(abortStatus); 110Debug.Assert(!channel.IsOutOfBandChannel); 111Debug.Assert(!targetResource.GetHandle(channel).IsNull); 197Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 304Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Geometry.cs (5)
180Debug.Assert(pWorldMatrix != null); 286Debug.Assert(pbPathData != (byte*)0); 404Debug.Assert(pbPathData != (byte*)0); 603Debug.Assert(pbPathData != (byte*)0); 686Debug.Assert(pbPathData != (byte*)0);
System\Windows\Media\GeometryDrawing.cs (1)
55Debug.Assert(!ctx.ShouldStopWalking);
System\Windows\Media\GeometryGroup.cs (1)
48Debug.Assert(pg.CanFreeze);
System\Windows\Media\GeometryHitTestParameters.cs (1)
90Debug.Assert(_hitGeometryInternal.Transform.Value == _hitGeometryCache.Transform.Value,
System\Windows\Media\GlyphRun.cs (6)
602Debug.Assert(clusterMap[currentClusterStart] < lastGlyphInCluster); 1306Debug.Assert(!IsSideways); 1565Debug.Assert(!IsSideways); 1846Debug.Assert(_glyphTypeface != null); 2348Debug.Assert(!IsInitializing); 2359Debug.Assert(!IsInitialized);
System\Windows\Media\GlyphRunDrawing.cs (1)
51Debug.Assert(!ctx.ShouldStopWalking);
System\Windows\Media\GlyphsSerializer.cs (5)
89Debug.Assert(_clusters[characterIndex] > glyphClusterStart); 100Debug.Assert(_indices.Count > glyphClusterStart - _glyphClusterInitialOffset); 106Debug.Assert(_characters == null || _characters.Count == 0 || _indices.Count == _characters.Count); 154Debug.Assert(_glyphStringBuider.Length == 0); 306Debug.Assert(caretStopStringLength == sb.ToString().Length);
System\Windows\Media\GlyphTypeface.cs (2)
1383Debug.Assert(charBufferRange.Length > 0); 1458Debug.Assert(glyphIndices != null || glyphMetrics != null);
System\Windows\Media\GuidelineCollection.cs (2)
48Debug.Assert(!isDynamic || guidelinesX.Length % 2 == 0); 57Debug.Assert(!isDynamic || guidelinesY.Length % 2 == 0);
System\Windows\Media\HitTestWithGeometryDrawingContextWalker.cs (8)
29Debug.Assert(geometry != null); 329Debug.Assert(_modifierStack != null); 330Debug.Assert(_modifierStack.Count > 0); 340Debug.Assert((_modifierStack.Count > 0) || (_currentTransform == null)); 348Debug.Assert((_modifierStack.Count > 0) || (_currentClip == null)); 352Debug.Assert(currentModifier == null); 378Debug.Assert(_intersectionDetail != IntersectionDetail.FullyContains); 383Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated);
System\Windows\Media\HitTestWithPointDrawingContextWalker.cs (7)
333Debug.Assert(_pointStack != null); 334Debug.Assert(_pointStack.Count > 0); 370Debug.Assert(_noOpLayerDepth >= 1); 407Debug.Assert(!_currentLayerIsNoOp); 408Debug.Assert(_noOpLayerDepth == 0); 418Debug.Assert(_currentLayerIsNoOp); 419Debug.Assert(_noOpLayerDepth == 0);
System\Windows\Media\HostVisual.cs (10)
134Debug.Assert(target != null); 135Debug.Assert(target.Dispatcher.Thread == Thread.CurrentThread); 187Debug.Assert(_target != null); 188Debug.Assert(_target.Dispatcher.Thread == Thread.CurrentThread); 210Debug.Assert(!targetsHandle.IsNull); 246Debug.Assert(IsOnChannel(channel)); 259Debug.Assert(_target._contentRoot.IsOnChannel(channel)); 260Debug.Assert(_target.OutOfBandChannel == MediaContext.CurrentMediaContext.OutOfBandChannel); 262Debug.Assert(!created); 322Debug.Assert(channelDispatcher == this.Dispatcher, "HostVisual connecting on a second thread");
System\Windows\Media\ImageSourceConverter.cs (1)
214Debug.Assert(rawData != null, "rawData is null.");
System\Windows\Media\Imaging\BitmapCodecInfo.cs (9)
34Debug.Assert(codecInfoHandle != null); 85Debug.Assert(length >= 0); 128Debug.Assert(length >= 0); 171Debug.Assert(length >= 0); 214Debug.Assert(length >= 0); 257Debug.Assert(length >= 0); 300Debug.Assert(length >= 0); 343Debug.Assert(length >= 0); 386Debug.Assert(length >= 0);
System\Windows\Media\Imaging\BitmapDecoder.cs (4)
927Debug.Assert(_syncObject != null); 1009Debug.Assert((uri.Scheme == Uri.UriSchemeHttp) || (uri.Scheme == Uri.UriSchemeHttps)); 1010Debug.Assert(stream.CanSeek); 1162Debug.Assert(decoder != IntPtr.Zero);
System\Windows\Media\Imaging\BitmapDownload.cs (1)
381Debug.Assert(false);
System\Windows\Media\Imaging\BitmapEncoder.cs (2)
361Debug.Assert(_supportsGlobalThumbnail); 393Debug.Assert(_supportsGlobalMetadata);
System\Windows\Media\Imaging\BitmapFrame.cs (2)
49Debug.Assert((stream == null), "Both stream and uri are non-null"); 70Debug.Assert((stream != null), "Both stream and uri are null");
System\Windows\Media\Imaging\BitmapFrameDecode.cs (7)
35Debug.Assert(decoder != null); 125Debug.Assert(decoder != null); 427Debug.Assert(_decoder != null); 681Debug.Assert(_decoder is LateBoundBitmapDecoder); 682Debug.Assert(!IsDownloading); 687Debug.Assert(_decoder.InternalDecoder != null); 692Debug.Assert(_syncObject != null);
System\Windows\Media\Imaging\BitmapFrameEncode.cs (2)
33Debug.Assert(source != null); 162Debug.Assert(sourceBitmapFrameEncode._source != null);
System\Windows\Media\Imaging\BitmapImage.cs (5)
217Debug.Assert(_decoder != null); 355Debug.Assert(decoder.SyncObject != null); 361Debug.Assert(!_decoder.IsDownloading); 430Debug.Assert(oldWidth > 0 && oldHeight > 0); 457Debug.Assert(false);
System\Windows\Media\Imaging\BitmapMetadata.cs (4)
483Debug.Assert(blockWriter != null); 484Debug.Assert(blockWriter.MetadataBlocks != null); 911Debug.Assert(length >= 0); 953Debug.Assert(length >= 0);
System\Windows\Media\Imaging\BitmapMetadataEnumerator.cs (1)
162Debug.Assert(metadataHandle != null && !metadataHandle.IsInvalid);
System\Windows\Media\Imaging\BitmapPalette.cs (7)
148Debug.Assert(source != null); 151Debug.Assert(bitmapSource != null && !bitmapSource.IsInvalid); 185Debug.Assert(palette != null); 253Debug.Assert(palette != null && !palette.IsInvalid); 266Debug.Assert(_palette != null && !_palette.IsInvalid); 295Debug.Assert(_palette != null && !_palette.IsInvalid); 321Debug.Assert(cActualColors == numColors);
System\Windows\Media\Imaging\BitmapPalettes.cs (1)
286Debug.Assert(key < c_maxPalettes);
System\Windows\Media\Imaging\BitmapSizeOptions.cs (4)
200Debug.Assert(_preservesAspectRatio); 207Debug.Assert(_preservesAspectRatio); 214Debug.Assert(!_preservesAspectRatio); 255Debug.Assert(false);
System\Windows\Media\Imaging\BitmapSource.cs (5)
546Debug.Assert(_syncObject != null); 753Debug.Assert(_isSourceCached); 932Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 964Debug.Assert(_duceResource.IsOnChannel(channel)); 1150Debug.Assert(destFmt == colorConvertedBitmap.Format);
System\Windows\Media\Imaging\BitmapSourceSafeMILHandle.cs (1)
86Debug.Assert(wicBitmap != IntPtr.Zero);
System\Windows\Media\Imaging\BitmapVisualManager.cs (3)
77Debug.Assert ((sizeX > 0) && (sizeY > 0)); 78Debug.Assert ((dpiX > 0) && (dpiY > 0)); 93Debug.Assert (renderTargetBitmap != null, "Render Target is null");
System\Windows\Media\Imaging\Generated\ColorConvertedBitmap.cs (1)
359Debug.Assert(s_Source == null || s_Source.IsFrozen,
System\Windows\Media\Imaging\Generated\CroppedBitmap.cs (1)
301Debug.Assert(s_Source == null || s_Source.IsFrozen,
System\Windows\Media\Imaging\Generated\FormatConvertedBitmap.cs (1)
359Debug.Assert(s_Source == null || s_Source.IsFrozen,
System\Windows\Media\Imaging\Generated\TransformedBitmap.cs (2)
320Debug.Assert(s_Source == null || s_Source.IsFrozen, 324Debug.Assert(s_Transform == null || s_Transform.IsFrozen,
System\Windows\Media\Imaging\InteropBitmapSource.cs (4)
46Debug.Assert (_unmanagedSource != null && !_unmanagedSource.IsInvalid); 77Debug.Assert (_unmanagedSource != null && !_unmanagedSource.IsInvalid); 124Debug.Assert (_unmanagedSource != null && !_unmanagedSource.IsInvalid); 370Debug.Assert(_sizeOptions.Rotation == Rotation.Rotate0);
System\Windows\Media\Imaging\LateBoundBitmapDecoder.cs (1)
290Debug.Assert(newStream.CanSeek);
System\Windows\Media\Imaging\RenderTargetBitmap.cs (2)
248Debug.Assert(renderTargetBitmap != null && !renderTargetBitmap.IsInvalid); 254Debug.Assert(bitmapSource != null && !bitmapSource.IsInvalid);
System\Windows\Media\Imaging\TransformedBitmap.cs (1)
133Debug.Assert(DoubleUtil.IsZero(m.M11) && DoubleUtil.IsZero(m.M22));
System\Windows\Media\Imaging\WriteableBitmap.cs (12)
210Debug.Assert(locked); 577Debug.Assert(_pBackBufferLock == null); 624Debug.Assert(!_isWaitingForCommit); 799Debug.Assert(!(backwardsCompat && (sourceRect.X < 0 || sourceRect.Y < 0 || sourceRect.Width < 0 || sourceRect.Height < 0))); 836Debug.Assert(!(backwardsCompat && sourceBufferStride < 1)); 841Debug.Assert(!backwardsCompat); 1163Debug.Assert(_duceResource.IsOnChannel(channel)); 1206Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 1269Debug.Assert(_isWaitingForCommit); // How else are we here? 1272Debug.Assert(_lockCount == 0); // How else are we here? 1273Debug.Assert(_hasDirtyRects); // How else are we here? 1283Debug.Assert(_duceResource.IsOnChannel(channel)); // How else are we here?
System\Windows\Media\LinearGradientBrush.cs (1)
121Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel));
System\Windows\Media\MatrixStack.cs (4)
158Debug.Assert(!IsEmpty); 170Debug.Assert(!IsEmpty); 186Debug.Assert(_size == 0); // The stack must be empty before this is called. 187Debug.Assert(_highWaterMark <= _items.Length);
System\Windows\Media\MediaContext.cs (34)
188Debug.Assert(dispatcher.Reserved0 == null); 344Debug.Assert(CheckAccess()); 603Debug.Assert(InterlockIsEnabled, 700Debug.Assert(_interlockState == InterlockState.WaitingForResponse, 777Debug.Assert(!InterlockIsWaiting, 842Debug.Assert(InterlockIsWaiting, 1077Debug.Assert(IsClockSupported, "MediaContext.CurrentTime called when QueryPerformaceCounter is not supported"); 1336Debug.Assert(_interlockState == InterlockState.Disabled, 1345Debug.Assert(Channel != null); 1366Debug.Assert(dispatcher != null, "Dispatcher required"); 1371Debug.Assert(dispatcher.Reserved0 == cm); 1394Debug.Assert(CheckAccess()); 1403Debug.Assert(CheckAccess()); 1434Debug.Assert(_timeManager != null); 1463Debug.Assert(dispatcher != null); 1464Debug.Assert(iv != null); 1476Debug.Assert(!_isDisposed); 1477Debug.Assert(iv != null); 1504Debug.Assert(dispatcher != null); 1505Debug.Assert(iv != null); 1516Debug.Assert(iv != null); 1566Debug.Assert(callback != null); 1571Debug.Assert(arg != null); 1610Debug.Assert(op != null); 1648Debug.Assert(CheckAccess()); 1772Debug.Assert(CheckAccess()); 1773Debug.Assert( 2014Debug.Assert(CheckAccess()); 2016Debug.Assert(!_isDisposed); 2017Debug.Assert(_registeredICompositionTargets != null); 2120Debug.Assert(_needToCommitChannel, "CommitChannel called with nothing on the channel"); 2124Debug.Assert(!InterlockIsWaiting, 2190Debug.Assert(InterlockIsEnabled, 2514Debug.Assert(_interlockState == InterlockState.WaitingForNextFrame
System\Windows\Media\MediaContextNotificationWindow.cs (1)
132Debug.Assert(_ownerMediaContext != null);
System\Windows\Media\mediaeventshelper.cs (3)
84Debug.Assert((sender != null), "Sender is null"); 85Debug.Assert((sender.Dispatcher != null), "Dispatcher is null"); 251Debug.Assert((cb == size), "Invalid event packet");
System\Windows\Media\MediaPlayer.cs (1)
553Debug.Assert(_duceResource._duceResource.IsOnChannel(channel));
System\Windows\Media\MediaPlayerState.cs (2)
857Debug.Assert(absoluteUri.IsAbsoluteUri); 957Debug.Assert(_nativeMedia != null && !_nativeMedia.IsInvalid);
System\Windows\Media\MediaSystem.cs (2)
123Debug.Assert(s_refCount > 0); 268Debug.Assert(reference != null, "The reference object can not be null.");
System\Windows\Media\MILUtilities.cs (10)
83Debug.Assert(pD3DMatrix[2] == 0.0f || Single.IsNaN(pD3DMatrix[2])); 84Debug.Assert(pD3DMatrix[3] == 0.0f || Single.IsNaN(pD3DMatrix[3])); 92Debug.Assert(pD3DMatrix[6] == 0.0f || Single.IsNaN(pD3DMatrix[6])); 93Debug.Assert(pD3DMatrix[7] == 0.0f || Single.IsNaN(pD3DMatrix[7])); 99Debug.Assert(pD3DMatrix[8] == 0.0f || Single.IsNaN(pD3DMatrix[8])); 100Debug.Assert(pD3DMatrix[9] == 0.0f || Single.IsNaN(pD3DMatrix[9])); 101Debug.Assert(pD3DMatrix[10] == 1.0f || Single.IsNaN(pD3DMatrix[10])); 102Debug.Assert(pD3DMatrix[11] == 0.0f || Single.IsNaN(pD3DMatrix[11])); 110Debug.Assert(pD3DMatrix[14] == 0.0f || Single.IsNaN(pD3DMatrix[14])); 111Debug.Assert(pD3DMatrix[15] == 1.0f || Single.IsNaN(pD3DMatrix[15]));
System\Windows\Media\PathGeometry.cs (30)
113Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_PATHGEOMETRY)); 134Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_PATHFIGURE)); 154Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT)); 155Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_SEGMENT)); 164Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_LINE)); 165Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_SEGMENT_LINE)); 179Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_BEZIER)); 180Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_SEGMENT_BEZIER)); 196Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_QUADRATICBEZIER)); 197Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_SEGMENT_QUADRATICBEZIER)); 212Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_ARC)); 213Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_SEGMENT_ARC)); 233Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_POLY)); 234Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_SEGMENT_POLY)); 238Debug.Assert(pSegmentPoly->Count <= Int32.MaxValue); 245Debug.Assert(pathData.SerializedData.Length >= 249Debug.Assert(pathData.Size >= 343Debug.Assert(result != null); 362Debug.Assert(figureCollection != null); 479Debug.Assert(sameSegCount == 1); 510Debug.Assert(sameSegCount == 1); 569Debug.Assert(pbPathData != (byte*)0); 613Debug.Assert(pPathData1 != (byte*)0); 617Debug.Assert(pPathData2 != (byte*)0); 750Debug.Assert(!pathData.IsEmpty()); 766Debug.Assert(pbPathData != (byte*)0); 822Debug.Assert(pbPathData1 != (byte*)0); 826Debug.Assert(pbPathData2 != (byte*)0); 855Debug.Assert(detail != IntersectionDetail.NotCalculated); 977Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel));
System\Windows\Media\PathStreamGeometryContext.cs (21)
65Debug.Assert(_figures == null, "It is illegal to call SetFigureCount multiple times or after BeginFigure."); 66Debug.Assert(figureCount > 0); 74Debug.Assert(_figures != null, "It is illegal to call SetSegmentCount before BeginFigure."); 75Debug.Assert(_currentFigure != null, "It is illegal to call SetSegmentCount before BeginFigure."); 76Debug.Assert(_segments == null, "It is illegal to call SetSegmentCount multiple times per BeginFigure or after a *To method."); 77Debug.Assert(segmentCount > 0); 88Debug.Assert(_currentFigure != null); 103Debug.Assert(_currentFigure == null || _figures != null); 230Debug.Assert(_figures != null); 231Debug.Assert(_currentFigure != null); 288Debug.Assert(false); 300Debug.Assert(_currentSegmentPoints == null); 310Debug.Assert(points != null); 327Debug.Assert(_figures != null); 328Debug.Assert(_currentFigure != null); 330Debug.Assert(count != 0); 356Debug.Assert(_currentFigure != null); 360Debug.Assert(count > 0); 407Debug.Assert(count % 3 == 0); 428Debug.Assert(count % 2 == 0); 439Debug.Assert(false);
System\Windows\Media\Pen.cs (7)
83Debug.Assert((MIL_PEN_CAP)PenLineCap.Flat == MIL_PEN_CAP.MilPenCapFlat); 84Debug.Assert((MIL_PEN_CAP)PenLineCap.Square == MIL_PEN_CAP.MilPenCapSquare); 85Debug.Assert((MIL_PEN_CAP)PenLineCap.Round == MIL_PEN_CAP.MilPenCapRound); 86Debug.Assert((MIL_PEN_CAP)PenLineCap.Triangle == MIL_PEN_CAP.MilPenCapTriangle); 93Debug.Assert((MIL_PEN_JOIN)PenLineJoin.Miter == MIL_PEN_JOIN.MilPenJoinMiter); 94Debug.Assert((MIL_PEN_JOIN)PenLineJoin.Bevel == MIL_PEN_JOIN.MilPenJoinBevel); 95Debug.Assert((MIL_PEN_JOIN)PenLineJoin.Round == MIL_PEN_JOIN.MilPenJoinRound);
System\Windows\Media\PixelFormat.cs (7)
53Debug.Assert(mask != null); 150Debug.Assert(Unsafe.SizeOf<Guid>() == 16); 337Debug.Assert(pixelFormatInfo != IntPtr.Zero); 348Debug.Assert(channelCount >= 1); 359Debug.Assert(cbBytes > 0); 368Debug.Assert(cbBytes == channelMask.Length); 436Debug.Assert(pixelFormatInfo != IntPtr.Zero);
System\Windows\Media\RadialGradientBrush.cs (1)
62Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel));
System\Windows\Media\RenderCapability.cs (3)
35Debug.Assert(mediaContext != null); 162Debug.Assert(mediaContext != null); 173Debug.Assert(mediaContext != null);
System\Windows\Media\RenderContext.cs (1)
81Debug.Assert(channel != null);
System\Windows\Media\RenderData.cs (17)
75Debug.Assert(cbRecordSize >= 0); 78Debug.Assert((_curOffset % 8) == 0); 79Debug.Assert((cbRecordSize % 8) == 0); 80Debug.Assert((sizeof(RecordHeader) % 8) == 0); 98Debug.Assert((_buffer != null) && (_buffer.Length >= newOffset)); 101Debug.Assert(_buffer.Length > 0); 126Debug.Assert(ctx != null); 228Debug.Assert(!this.IsFrozen); 268Debug.Assert(_dependentResources[i] as Freezable == null); 357Debug.Assert(_duceResource.IsOnChannel(channel)); 384Debug.Assert(_duceResource.IsOnChannel(channel)); 436Debug.Assert(_duceResource.IsOnChannel(channel)); 451Debug.Assert(cbRequiredSize >= 0); 461Debug.Assert(_buffer.Length < cbRequiredSize); 471Debug.Assert(newSize >= cbRequiredSize); 497Debug.Assert(index <= (uint)Int32.MaxValue); 504Debug.Assert(_dependentResources.Count >= index);
System\Windows\Media\StreamAsIStream.cs (2)
53Debug.Assert(((IntPtr)pSD.m_handle) != IntPtr.Zero, "If this asserts fires: why is it firing. It might be legal in future."); 509Debug.Assert(((IntPtr)sd.m_handle) != IntPtr.Zero, "Stream is disposed.");
System\Windows\Media\StreamGeometry.cs (5)
91Debug.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 115Debug.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 135Debug.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 373Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 441Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\textformatting\TextCharacters.cs (3)
191Debug.Assert(characterBufferReference.CharacterBuffer == _characterBufferReference.CharacterBuffer); 192Debug.Assert(offsetToFirstChar >= 0 && offsetToFirstChar < _length); 282Debug.Assert(shapeables != null);
System\Windows\Media\Typeface.cs (1)
512Debug.Assert(i > 0);
System\Windows\Media\UniqueEventHelper.cs (4)
38Debug.Assert(sender != null, "Sender is null"); 41Debug.Assert(handler != null, "Event handler is null"); 69Debug.Assert(sender != null, "Sender is null"); 72Debug.Assert(handler != null, "Event handler is null");
System\Windows\Media\VideoDrawing.cs (1)
40Debug.Assert(!ctx.ShouldStopWalking);
System\Windows\Media\Visual.cs (29)
560Debug.Assert(BitmapEffectStateField.GetValue(this) != null); 638Debug.Assert(IsOnChannel(channel)); 639Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentNodeConnected)); 840Debug.Assert(channelsToCyclicBrushMap[channel] > 0); 866Debug.Assert(cyclicBrushToChannelsMap[cyclicBrush] > 0); 891Debug.Assert(cyclicBrushToChannelsMap != null); 892Debug.Assert(cyclicBrushToChannelsMap.ContainsKey(cyclicBrush)); 893Debug.Assert(cyclicBrushToChannelsMap[cyclicBrush] > 0); 913Debug.Assert(channelsToCyclicBrushMap != null); 914Debug.Assert(channelsToCyclicBrushMap.ContainsKey(channel)); 915Debug.Assert(channelsToCyclicBrushMap[channel] > 0); 1290Debug.Assert(CheckFlagsAnd(VisualFlags.ReentrancyFlag)); // Exit must be matched with Enter. See Enter comments. 1943Debug.Assert(Point.Equals(pointParams.HitPoint, backupHitPoint), 1974Debug.Assert(Matrix.Equals(geometryParams.InternalHitGeometry.Transform.Value, originalMatrix), 2069Debug.Assert(BitmapEffectStateField.GetValue(this) != null); 2200Debug.Assert(bitmapEffectState != null); 2239Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated); 2297Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated); 2361Debug.Assert(resultCallback != null); 2422Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated); 3033Debug.Assert(bed != null, "Must be non-null because otherwise the code would have earlied out where new value is compared against old value."); 3195Debug.Assert(currentBitmapEffect.IsFrozen == emulatingEffect.IsFrozen); 3264Debug.Assert(bitmapEffectState != null); 3278Debug.Assert(EffectField.GetValue(this) == null, "Not expecting both BitmapEffect and Effect to be set on the same node"); 3953Debug.Assert(_parent != null, "If oldParent is null, current parent should != null."); 4465Debug.Assert(ancestor != null); 4582Debug.Assert((group == null) || (group.Children.Count > 0)); 4657Debug.Assert(ancestor != null); 5216Debug.Assert(cyclicBrushToChannelsMap != null, "Visual brush roots need to have the visual brush to channels map!");
System\Windows\Media\VisualBrush.cs (10)
178Debug.Assert(!_pendingLayout); 221Debug.Assert(element != null); 243Debug.Assert(_pendingLayout); 247Debug.Assert(element != null); 258Debug.Assert(_DispatcherLayoutResult != null); 259Debug.Assert(_DispatcherLayoutResult.Status == DispatcherOperationStatus.Pending); 261Debug.Assert(abortStatus); 273Debug.Assert(_pendingLayout); 276Debug.Assert(element != null); 314Debug.Assert(_reentrancyFlag); // Exit must be matched with Enter. See Enter comments.
System\Windows\Media\VisualCollection.cs (19)
70Debug.Assert(_owner != null); 76Debug.Assert(_owner != null); 82Debug.Assert(_owner != null); 89Debug.Assert(_owner != null); 253Debug.Assert(_items != null); 260Debug.Assert(value == 0, "There shouldn't be a case where value != 0."); 261Debug.Assert(_size == 0, "Size must be 0 here."); 378Debug.Assert(value != null); 379Debug.Assert(_items[index] == null); 380Debug.Assert(value._parent == null); 381Debug.Assert(!value.IsRootElement); 396Debug.Assert(_items[index] != null); 452Debug.Assert(_items[addedPosition] == null); 531Debug.Assert(visual._parent != null); 643Debug.Assert(_items[i]._parent == _owner); 805Debug.Assert(visual._parent != null); 806Debug.Assert(destination == null || destination._parent == visual._parent); 807Debug.Assert(newIndex >= 0 && newIndex <= _size, "New index is invalid"); 952Debug.Assert(_index == -2);
System\Windows\Media\VisualProxy.cs (7)
151Debug.Assert(count == 0); 173Debug.Assert(count == 1); 289Debug.Assert(index != PROXY_NOT_FOUND); 344Debug.Assert(index >= 0 && index < Count); 387Debug.Assert(index >= 0 && index < Count); 466Debug.Assert(index >= 0 && index < Count); 567Debug.Assert(delta % 2 == 0 && newLength >= 2);
System\Windows\Media\VisualTarget.cs (5)
45Debug.Assert(!_connected); 70Debug.Assert(channel != null); 71Debug.Assert(outOfBandChannel != null); 93Debug.Assert(!resourceCreated); 183Debug.Assert(_connected);
System\Windows\Media\VisualTreeHelper.cs (1)
159Debug.Assert(reference == null);
System\Windows\Media3D\GeneralTransform2DTo3D.cs (1)
23Debug.Assert(child != null, "Going from 2D to 3D containingVisual3D.Visual should not be null");
System\Windows\Media3D\Generated\AmbientLight.cs (2)
105Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 170Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\AxisAngleRotation3D.cs (2)
150Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 203Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\Camera.cs (3)
102Debug.Assert(!channel.IsOutOfBandChannel); 103Debug.Assert(!targetResource.GetHandle(channel).IsNull); 338Debug.Assert(s_Transform == null || s_Transform.IsFrozen,
System\Windows\Media3D\Generated\DiffuseMaterial.cs (5)
116Debug.Assert(!channel.IsOutOfBandChannel); 117Debug.Assert(!targetResource.GetHandle(channel).IsNull); 209Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 258Debug.Assert(_duceResource.IsOnChannel(channel)); 373Debug.Assert(s_Brush == null || s_Brush.IsFrozen,
System\Windows\Media3D\Generated\DirectionalLight.cs (2)
124Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 195Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\EmissiveMaterial.cs (5)
109Debug.Assert(!channel.IsOutOfBandChannel); 110Debug.Assert(!targetResource.GetHandle(channel).IsNull); 187Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 235Debug.Assert(_duceResource.IsOnChannel(channel)); 345Debug.Assert(s_Brush == null || s_Brush.IsFrozen,
System\Windows\Media3D\Generated\GeneralTransform3DCollection.cs (3)
93Debug.Assert(_collection.Count == 0); 752Debug.Assert(list != null, "list may not be null."); 851Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Generated\GeneralTransform3DGroup.cs (1)
186Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media3D\Generated\GeometryModel3D.cs (8)
102Debug.Assert(!channel.IsOutOfBandChannel); 103Debug.Assert(!targetResource.GetHandle(channel).IsNull); 152Debug.Assert(!channel.IsOutOfBandChannel); 153Debug.Assert(!targetResource.GetHandle(channel).IsNull); 202Debug.Assert(!channel.IsOutOfBandChannel); 203Debug.Assert(!targetResource.GetHandle(channel).IsNull); 295Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 367Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\MaterialCollection.cs (2)
787Debug.Assert(list != null, "list may not be null."); 886Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Generated\MaterialGroup.cs (11)
122Debug.Assert(!channel.IsOutOfBandChannel); 123Debug.Assert(!targetResource.GetHandle(channel).IsNull); 135Debug.Assert(resource != null); 146Debug.Assert(resource != null); 208Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 278Debug.Assert(_duceResource.IsOnChannel(channel)); 327Debug.Assert(!channel.IsOutOfBandChannel); 328Debug.Assert(!thisResource.GetHandle(channel).IsNull); 352Debug.Assert(!channel.IsOutOfBandChannel); 353Debug.Assert(!thisResource.GetHandle(channel).IsNull); 441Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media3D\Generated\MatrixCamera.cs (2)
146Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 205Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\MatrixTransform3D.cs (2)
124Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 164Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\MeshGeometry3D.cs (6)
206Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 308Debug.Assert(_duceResource.IsOnChannel(channel)); 430Debug.Assert(s_Positions == null || s_Positions.IsFrozen, 434Debug.Assert(s_Normals == null || s_Normals.IsFrozen, 438Debug.Assert(s_TextureCoordinates == null || s_TextureCoordinates.IsFrozen, 442Debug.Assert(s_TriangleIndices == null || s_TriangleIndices.IsFrozen,
System\Windows\Media3D\Generated\Model3D.cs (3)
102Debug.Assert(!channel.IsOutOfBandChannel); 103Debug.Assert(!targetResource.GetHandle(channel).IsNull); 338Debug.Assert(s_Transform == null || s_Transform.IsFrozen,
System\Windows\Media3D\Generated\Model3DCollection.cs (2)
787Debug.Assert(list != null, "list may not be null."); 886Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Generated\Model3DGroup.cs (11)
122Debug.Assert(!channel.IsOutOfBandChannel); 123Debug.Assert(!targetResource.GetHandle(channel).IsNull); 135Debug.Assert(resource != null); 146Debug.Assert(resource != null); 208Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 294Debug.Assert(_duceResource.IsOnChannel(channel)); 344Debug.Assert(!channel.IsOutOfBandChannel); 345Debug.Assert(!thisResource.GetHandle(channel).IsNull); 369Debug.Assert(!channel.IsOutOfBandChannel); 370Debug.Assert(!thisResource.GetHandle(channel).IsNull); 458Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media3D\Generated\OrthographicCamera.cs (2)
124Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 219Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\PerspectiveCamera.cs (2)
124Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 219Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\Point3DCollection.cs (2)
773Debug.Assert(list != null, "list may not be null."); 872Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Generated\PointLight.cs (2)
105Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 200Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\QuaternionRotation3D.cs (2)
127Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 174Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\RotateTransform3D.cs (5)
131Debug.Assert(!channel.IsOutOfBandChannel); 132Debug.Assert(!targetResource.GetHandle(channel).IsNull); 243Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 310Debug.Assert(_duceResource.IsOnChannel(channel)); 420Debug.Assert(s_Rotation == null || s_Rotation.IsFrozen,
System\Windows\Media3D\Generated\ScaleTransform3D.cs (2)
252Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 329Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\SpecularMaterial.cs (5)
109Debug.Assert(!channel.IsOutOfBandChannel); 110Debug.Assert(!targetResource.GetHandle(channel).IsNull); 209Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 258Debug.Assert(_duceResource.IsOnChannel(channel)); 373Debug.Assert(s_Brush == null || s_Brush.IsFrozen,
System\Windows\Media3D\Generated\SpotLight.cs (2)
168Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 281Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\Transform3DCollection.cs (2)
787Debug.Assert(list != null, "list may not be null."); 886Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Generated\Transform3DGroup.cs (11)
122Debug.Assert(!channel.IsOutOfBandChannel); 123Debug.Assert(!targetResource.GetHandle(channel).IsNull); 135Debug.Assert(resource != null); 146Debug.Assert(resource != null); 208Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 278Debug.Assert(_duceResource.IsOnChannel(channel)); 327Debug.Assert(!channel.IsOutOfBandChannel); 328Debug.Assert(!thisResource.GetHandle(channel).IsNull); 352Debug.Assert(!channel.IsOutOfBandChannel); 353Debug.Assert(!thisResource.GetHandle(channel).IsNull); 441Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media3D\Generated\TranslateTransform3D.cs (2)
177Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 236Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\Vector3DCollection.cs (2)
773Debug.Assert(list != null, "list may not be null."); 872Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Geometry3D.cs (1)
77Debug.Assert(facesToHit != FaceType.None,
System\Windows\Media3D\HitTestParameters3D.cs (4)
60Debug.Assert(!HasModelTransformMatrix, 109Debug.Assert(HasWorldTransformMatrix, 142Debug.Assert(HasModelTransformMatrix, 182Debug.Assert(HasHitTestProjectionMatrix,
System\Windows\Media3D\Matrix3D.cs (11)
1030Debug.Assert(IsDistinguishedIdentity); 1042Debug.Assert(IsDistinguishedIdentity); 1058Debug.Assert(IsDistinguishedIdentity); 1184Debug.Assert(!IsDistinguishedIdentity); 1185Debug.Assert(IsAffine); 1201Debug.Assert(!IsDistinguishedIdentity); 1202Debug.Assert(IsAffine); 1213Debug.Assert(!(det < Determinant || det > Determinant), 1300Debug.Assert(!(det < Determinant || det > Determinant), 1395Debug.Assert( 1413Debug.Assert(IsDistinguishedIdentity == value,
System\Windows\Media3D\MeshGeometry3D.cs (5)
165Debug.Assert(hitTestableFaces != FaceType.None, 407Debug.Assert(!double.IsInfinity(pz / pw) && !double.IsNaN(pz / pw), 412Debug.Assert(dist > 0, "Distance is negative: " + dist); 493Debug.Assert(!double.IsInfinity(pz / pw) && !double.IsNaN(pz / pw), 529Debug.Assert(_cachedBounds.IsEmpty,
System\Windows\Media3D\Quaternion.cs (1)
518Debug.Assert(!(cosOmega < -1.0) && !(cosOmega > 1.0),
System\Windows\Media3D\Rect3D.cs (1)
41Debug.Assert(size.IsEmpty == IsEmpty);
System\Windows\Media3D\Viewport2DVisual3D.cs (9)
327Debug.Assert((newValue == null || newValue.InheritanceContext == null), 336Debug.Assert((newValue == null || newValue.InheritanceContext == null), 343Debug.Assert((newValue == null || newValue.InheritanceContext == null), 577Debug.Assert(Geometry == null || Geometry is MeshGeometry3D); 605Debug.Assert(Geometry == null || Geometry is MeshGeometry3D); 633Debug.Assert(Geometry == null || Geometry is MeshGeometry3D); 759Debug.Assert( (viewport2DVisual3D.InternalBitmapCacheBrush.InternalTarget == null 768Debug.Assert( (viewport2DVisual3D.InternalBitmapCacheBrush.InternalTarget == null 788Debug.Assert((viewport2DVisual3D.Visual == null || viewport2DVisual3D.Visual.InheritanceContext == null),
System\Windows\Media3D\Viewport3DVisual.cs (10)
250Debug.Assert(!e.IsASubPropertyChange, 328Debug.Assert(child != null); 329Debug.Assert(child.InternalVisualParent == null); 376Debug.Assert(child != null); 377Debug.Assert(child.InternalVisualParent == this); 636Debug.Assert( 656Debug.Assert( 710Debug.Assert(IsOnChannel(channel)); 758Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentNodeConnected), 799Debug.Assert(IsOnChannel(channel));
System\Windows\Media3D\Visual3D.cs (23)
236Debug.Assert(child != null); 237Debug.Assert(child.InternalVisualParent == null); 284Debug.Assert(child != null); 285Debug.Assert(child.InternalVisualParent == this); 457Debug.Assert(VisualTreeHelper.GetParent(this) != null, "If oldParent is null, current parent should != null."); 949Debug.Assert(InternalVisualParent == newParent); 957Debug.Assert(InternalVisualParent == newParent); 1057Debug.Assert(boundsAreEqual, errorString); 1079Debug.Assert(model != null); 1211Debug.Assert((flags & VisualProxyFlags.IsContentNodeConnected) == 0, 1259Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentConnected)); 1260Debug.Assert(IsOnChannel(channel)); 1451Debug.Assert(IsOnChannel(channel)); 1452Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentNodeConnected)); 1582Debug.Assert(child.InheritanceContext == this, 1649Debug.Assert(ancestor != null); 1791Debug.Assert(ancestor != null); 1828Debug.Assert(_2DParent.GetValue(this) == null, 1836Debug.Assert(parent2D == null || parent2D is Viewport3DVisual, 2040Debug.Assert(!e.CheckFlagsOr(VisualFlags.ShouldPostRender), 2042Debug.Assert(!e.CheckFlagsOr(VisualFlags.NodeIsCyclicBrushRoot), 2054Debug.Assert((viewport == null) == (e.InternalVisualParent == null), 2092Debug.Assert(_inheritanceContext.GetValue(this) == UseParentAsContext,
System\Windows\Media3D\Visual3DCollection.cs (7)
480Debug.Assert(InternalGetItem(i).ParentIndex == i - 1, 504Debug.Assert(InternalGetItem(i).ParentIndex == i + 1, 538Debug.Assert(_owner != null, "How did an Visual3DCollection get constructed without an owner?"); 546Debug.Assert(!duplicates.ContainsKey(visual), "How did the visual get re-inserted?"); 549Debug.Assert(visual.InternalVisualParent == _owner, "Why isn't our child's parent pointer the same as the collection owner?"); 550Debug.Assert(visual.ParentIndex == i, 600Debug.Assert(list != null, "list may not be null.");
System\Windows\Navigation\BaseUriHelper.cs (2)
162Debug.Assert(uri is not null && uri.IsAbsoluteUri && string.Equals(uri.Scheme, PackUriHelper.UriSchemePack, StringComparison.OrdinalIgnoreCase) && IsPackApplicationUri(uri)); 179Debug.Assert(string.Equals(partName, uri.GetComponents(UriComponents.Path, UriFormat.UriEscaped), StringComparison.OrdinalIgnoreCase));
System\Windows\PresentationSource.cs (1)
520Debug.Assert(uie is UIElement3D or UIElement);
System\Windows\ReverseInheritProperty.cs (1)
201Debug.Assert(originChangedAction != null);
System\Windows\UIElement.cs (9)
254Debug.Assert(MeasureRequest == null, "can't be clean and still have MeasureRequest"); 287Debug.Assert(ArrangeRequest == null, "can't be clean and still have MeasureRequest"); 1878Debug.Assert(routedEvent != null, "RoutedEvent must not be null"); 1914Debug.Assert(routedEvent != null, "RoutedEvent must not be null"); 3104Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated); 3189Debug.Assert(_proxy.IsOnChannel(channel)); 3256Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentConnected)); 3257Debug.Assert(_proxy.IsOnChannel(channel)); 4131Debug.Assert(value == Visibility.Visible || value == Visibility.Hidden || value == Visibility.Collapsed);
System\Windows\UIElement3D.cs (1)
1330Debug.Assert(value == Visibility.Visible || value == Visibility.Hidden || value == Visibility.Collapsed);
PresentationFramework (2113)
MS\Internal\Annotations\Anchoring\AttachedAnnotation.cs (8)
63Debug.Assert(manager != null, "LocatorManager can not be null"); 64Debug.Assert(annotation != null, "Annotation can not be null"); 65Debug.Assert(anchor != null, "Anchor can not be null"); 66Debug.Assert(attachedAnchor != null, "AttachedAnchor can not be null"); 233Debug.Assert(attachedAnchor != null, "AttachedAnchor can not be null"); 234Debug.Assert(attachmentLevel > AttachmentLevel.Unresolved && attachmentLevel <= AttachmentLevel.Incomplete, 249Debug.Assert(_selectionProcessor != null, SR.Format(SR.NoProcessorForSelectionType, attachedAnchor.GetType())); 259Debug.Assert(_attachmentLevel != AttachmentLevel.Full, "Should only set fully resolved anchor if attachment level is not full.");
MS\Internal\Annotations\Anchoring\DataIdProcessor.cs (2)
385Debug.Assert(node != null, "DependencyObject can not be null"); 406Debug.Assert(d != null, "DependencyObject can not be null");
MS\Internal\Annotations\Anchoring\FixedPageProcessor.cs (1)
318Debug.Assert(page >= 0, "page can not be negative");
MS\Internal\Annotations\Anchoring\FixedTextSelectionProcessor.cs (3)
111Debug.Assert(numOfPages >= 0, "start page number is bigger than the end page number"); 289Debug.Assert(tv != null); 603Debug.Assert((start != null) && (end != null), "null start/end TextPointer on a non empty page");
MS\Internal\Annotations\Anchoring\LocatorManager.cs (13)
307Debug.Assert(attachedAnchor != null, "AttachedAnchor cannot be null if attachmentLevel is not Unresolved."); 357Debug.Assert(processor != null, "SubtreeProcessor can not be null"); 634Debug.Assert(startNode != null, "startNode can not be null"); 746Debug.Assert(node != null, "node can not be null"); 813Debug.Assert(data != null, "dataBlob is either null or not of ProcessingTreeState type"); 818Debug.Assert(processor != null, "SubtreeProcessor can not be null"); // There is always a default processor 840Debug.Assert(data != null, "dataBlob is either null or not of ProcessingTreeState type"); 844Debug.Assert(processor != null, "SubtreeProcessor can not be null"); 879Debug.Assert(locator != null, "locator can not be null"); 880Debug.Assert(startNode != null, "startNode can not be null"); 916Debug.Assert(offset >= 0 && offset < realLocator.Parts.Count, "offset out of range"); 1089Debug.Assert(locator != null, "locator can not be null"); 1090Debug.Assert(data.LocatorPartIndex >= 0 && data.LocatorPartIndex < locator.Parts.Count,
MS\Internal\Annotations\Anchoring\PathNode.cs (5)
209Debug.Assert(node != null, "node can not be null"); 263Debug.Assert(node != null, "node can not be null"); 302Debug.Assert(path != null, "path can not be null"); 303Debug.Assert(branch != null, "branch can not be null"); 307Debug.Assert(path.Node.Equals(branch.Node), "path.Node is not equal to branch.Node");
MS\Internal\Annotations\Anchoring\TextSelectionProcessor.cs (2)
384Debug.Assert(target != null); 454Debug.Assert(startNode != null);
MS\Internal\Annotations\Anchoring\TextViewSelectionProcessor.cs (1)
222Debug.Assert(textView != null);
MS\Internal\Annotations\Component\AdornerPresentationContext.cs (1)
425Debug.Assert((adorners != null) && (adorner != null), "null adorners list or adorner");
MS\Internal\Annotations\Component\AnnotationComponentManager.cs (9)
55Debug.Assert(attachedAnnotation != null, "AttachedAnnotation should not be null"); 72Debug.Assert(attachedAnnotation != null, "AttachedAnnotation should not be null"); 139Debug.Assert(attachedAnnotation != null, "AttachedAnnotation should not be null"); 142Debug.Assert(annotatedElement != null, "the annotatedElement should inherit from UIElement"); 162Debug.Assert(annotatedElement != null, "the annotatedElement should inherit from UIElement"); 205Debug.Assert(attachedAnnotation != null, "attachedAnnotation should not be null"); 206Debug.Assert(previousAttachedAnchor != null, "previousAttachedAnchor should not be null"); 266Debug.Assert(attachedAnnotation != null, "attachedAnnotation should not be null"); 267Debug.Assert(component != null, "component should not be null");
MS\Internal\Annotations\Component\AnnotationHighlightLayer.cs (20)
72Debug.Assert(start != null, "start pointer is null"); 73Debug.Assert(end != null, "end pointer is null"); 74Debug.Assert(start.CompareTo(end) <= 0, "end pointer before start"); 110Debug.Assert(highlightRange != null, "null range data"); 340Debug.Assert(highlightRange != null, " null highlight range"); 342Debug.Assert((rangeSegments != null) && (rangeSegments.Count > 0), "invalid rangeSegments"); 353Debug.Assert(highlightSegment != null, "null highlight segment"); 377Debug.Assert(rangeEnumerator.Current.IsNull || !next || 635Debug.Assert(start != null, "start pointer is null"); 636Debug.Assert(end != null, "end pointer is null"); 637Debug.Assert(owners != null, "null owners list"); 638Debug.Assert(owners.Count > 0, "empty owners list"); 640Debug.Assert(owners[i] != null, "null owner"); 791Debug.Assert((ps1 != null) && (ps2 != null) && (ps1.CompareTo(ps2) <= 0), "invalid splitting points"); 865Debug.Assert(res.Count == 2, "unexpected resulting segment count after split"); 918Debug.Assert(textViews != null, "geometry text view not found"); 937Debug.Assert((view != null) && (parentView != null), "null text view"); 979Debug.Assert(!_segment.IsNull, "null TextSegment"); 1098Debug.Assert(TopOwner != null, "invalid TopOwner"); 1100Debug.Assert(parentView != null, "geometry parent text view not found");
MS\Internal\Annotations\Component\MarkedHighlightComponent.cs (26)
363Debug.Assert(anchor != null, "undefined anchor"); 364Debug.Assert(marker.Data != null || marker.Data == Geometry.Empty, "undefined geometry"); 368Debug.Assert(geometry != null, "unexpected geometry type"); 369Debug.Assert(geometry.Children.Count == 3, "unexpected geometry children count"); 433Debug.Assert(_uiParent != null, "No selection container"); 475Debug.Assert(textContainer != null, "TextAnchor does not belong to a TextContainer"); 627Debug.Assert(componentsRegister != null, "The selection is not registered"); 653Debug.Assert(anchor != null, "wrong attachedAnchor"); 886Debug.Assert(selection != null, "Unexpected sender of Changed event"); 896Debug.Assert(components != null, "No SN registered for this selection"); 904Debug.Assert(components[i].HighlightAnchor != null, "Missing highlight anchor component"); 925Debug.Assert(sender != null, "undefined sender"); 952Debug.Assert(pos != null, "null text pointer"); 966Debug.Assert((components != null) && (components.Count > 0), "invalid component registry"); 993Debug.Assert(selectionHandler != null, "SelectionHandler handler can not be null"); 994Debug.Assert(mouseMoveHandler != null, "MouseMoveHandler handler can not be null"); 1007Debug.Assert(component != null, "component is null"); 1008Debug.Assert(_components != null, "_components are null"); 1042Debug.Assert(component != null, "component is null"); 1043Debug.Assert(_components != null, "_components are null"); 1098Debug.Assert(first != null, "first component is null"); 1099Debug.Assert((first.AttachedAnnotations != null) && (first.AttachedAnnotations.Count > 0), "first AttachedAnchor is null"); 1100Debug.Assert(second != null, "second component is null"); 1101Debug.Assert((second.AttachedAnnotations != null) && (second.AttachedAnnotations.Count > 0), "second AttachedAnchor is null"); 1106Debug.Assert(firstAnchor != null, " first TextAnchor is null"); 1107Debug.Assert(secondAnchor != null, " second TextAnchor is null");
MS\Internal\Annotations\Storage\StoreAnnotationsMap.cs (2)
42Debug.Assert(authorChanged != null && anchorChanged != null && cargoChanged != null, 68Debug.Assert(FindAnnotation(annotation.Id) == null, "annotation not found");
MS\Internal\AppModel\IconHelper.cs (1)
338Debug.Assert(nBytesCount > 0, "The N-Byte has to be greater than 0!");
MS\Internal\AppModel\Journaling.cs (16)
92Debug.Assert(_contentId == 0 || _contentId == value, 120Debug.Assert(value.JEGroupState == this); 121Debug.Assert(_groupExitEntry == null || _groupExitEntry.ContentId == value.ContentId); 216Debug.Assert(this.KeepAliveRoot == contentObject); // set by ctor; shouldn't change 223Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward); 224Debug.Assert(this.KeepAliveRoot != null); 372Debug.Assert(endingPF.ParentPageFunctionId == Guid.Empty, 407Debug.Assert(pageFunction != null && pageFunction.KeepAlive); 452Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward); 457Debug.Assert(pf != null); 489Debug.Assert(!pageFunction.KeepAlive); 555Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward); 562Debug.Assert(ns != null, "Fragment navigation won't work when the INavigator doesn't have a NavigationService."); 568Debug.Assert(pageFunction != null); 649Debug.Assert(contentObject.GetType().AssemblyQualifiedName == this._typeName, 780Debug.Assert(_markupUri != null, "_markupUri in JournalEntryPageFunctionUri should be set.");
MS\Internal\AppModel\JournalNavigationScope.cs (4)
273Debug.Assert(journal != null); 312Debug.Assert(navigationService != null, "NavigationService cannot be null for journal navigations"); 414Debug.Assert(_journal == null && value != null, 449Debug.Assert(sender == _journal);
MS\Internal\AppModel\ReturnEventSaver.cs (1)
108Debug.Assert(caller != null, "Caller should not be null");
MS\Internal\Commands\CommandHelpers.cs (3)
95Debug.Assert(controlType != null); 96Debug.Assert(command != null); 97Debug.Assert(executedRoutedEventHandler != null);
MS\Internal\Controls\ActiveXContainer.cs (3)
58Debug.Assert(_host != null, "gotta have the avalon activex host"); 204Debug.Assert(_siteUIActive == null, "Object did not call OnUIDeactivate"); 215Debug.Assert(this.ActiveXHost == site, "deactivating when not active...");
MS\Internal\Controls\CustomCategoryAttribute.cs (1)
17Debug.Assert("Content".Equals(name, StringComparison.Ordinal)
MS\Internal\Controls\InkCanvasFeedbackAdorner.cs (1)
146Debug.Assert(_frameSize != new Size(0, 0));
MS\Internal\Controls\InkCanvasInnerCanvas.cs (2)
31Debug.Assert(inkCanvas != null); 277Debug.Assert(Children.Contains(hitElement), "The hit element should be a child of InnerCanvas.");
MS\Internal\Controls\InkCanvasSelectionAdorner.cs (1)
28Debug.Assert(adornedElement is InkCanvasInnerCanvas,
MS\Internal\Controls\ModelTreeEnumerator.cs (6)
137Debug.Assert(contentControl != null, "contentControl should be non-null."); 157Debug.Assert(headeredContentControl != null, "headeredContentControl should be non-null."); 158Debug.Assert(header != null, "Header should be non-null. If Header was null, the base ContentControl enumerator should have been used."); 217Debug.Assert(headeredItemsControl != null, "headeredItemsControl should be non-null."); 218Debug.Assert(items != null, "items should be non-null."); 219Debug.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 (13)
78Debug.Assert(annotation != null); 120Debug.Assert((token & AllValues) != 0); 608Debug.Assert(false); 623Debug.Assert(cargo != null); 647Debug.Assert(false); 695Debug.Assert(false); 804Debug.Assert(snc.IsExpanded); 812Debug.Assert(snc.IsExpanded); 1249Debug.Assert(_attachedAnnotation != null && _attachedAnnotation.Annotation == args.Annotation); 1263Debug.Assert(_attachedAnnotation != null && _attachedAnnotation.Annotation == args.Annotation); 1366Debug.Assert(((IAnnotationComponent)this).AnnotatedElement != null, "undefined annotated element"); 1393Debug.Assert(adornerTransform != null, "transform to AnnotatedElement is null"); 1559Debug.Assert(_attachedAnnotation != null, "This property should never be acccessed from outside of CAF");
MS\Internal\Controls\StickyNote\StickyNoteContentControl.cs (4)
200Debug.Assert(node != null && !IsEmpty); 227Debug.Assert(node != null); 372Debug.Assert(node != null && !IsEmpty); 394Debug.Assert(node != null, "Try to load data from an invalid node");
MS\Internal\Controls\StickyNote\StickyNoteHelper.cs (2)
58Debug.Assert(!helper.IsLocked(flag)); 68Debug.Assert(_helper.IsLocked(_flag));
MS\Internal\Controls\TemplatedAdorner.cs (3)
40Debug.Assert(adornedElement != null, "adornedElement should not be null"); 41Debug.Assert(adornerTemplate != null, "adornerTemplate should not be null"); 135Debug.Assert(_child != null, "_child should not be null");
MS\Internal\Controls\WebBrowserEvent.cs (7)
31Debug.Assert(parent != null, "WebBrowser control required for hooking webbrowser events"); 41Debug.Assert(url == null || url is string, "invalid url type"); 42Debug.Assert(targetFrameName == null || targetFrameName is string, "invalid targetFrameName type"); 43Debug.Assert(headers == null || headers is string, "invalid headers type"); 157Debug.Assert(url == null || url is string, "invalid url type"); 174Debug.Assert(psi != null, "The Document does not implement IPersistStreamInit"); 211Debug.Assert(url == null || url is string, "invalid url type");
MS\Internal\Data\BindingWorker.cs (1)
29Debug.Assert((int)Feature.LastFeatureId <= 32, "UncommonValueTable supports only 32 Ids");
MS\Internal\Data\CollectionViewGroupInternal.cs (2)
513Debug.Assert(subgroup != null); 534Debug.Assert(subgroup != null);
MS\Internal\Data\CollectionViewGroupRoot.cs (1)
151Debug.Assert(System.Windows.Controls.ItemsControl.EqualsEx(item, ProtectedItems[index]), "RemoveSpecialItem finds inconsistent data");
MS\Internal\Data\CompositeCollectionView.cs (2)
407Debug.Assert(startingIndex >= 0, "Source composite collection failed to supply an index"); 451Debug.Assert(args.Action == NotifyCollectionChangedAction.Remove);
MS\Internal\Data\DefaultValueConverter.cs (1)
471Debug.Assert(sourceType != targetType);
MS\Internal\Data\DisplayMemberTemplateSelector.cs (1)
24Debug.Assert(!(String.IsNullOrEmpty(displayMemberPath) && String.IsNullOrEmpty(stringFormat)));
MS\Internal\Data\IndexedEnumerable.cs (1)
395Debug.Assert(System.Windows.Controls.ItemsControl.EqualsEx(_cachedItem, current), "EnsureCacheCurrent: _cachedItem out of sync with _enumerator.Current");
MS\Internal\Data\LiveShapingBlock.cs (1)
87Debug.Assert(index < size, "FindPosition called with item not in its block");
MS\Internal\Data\LiveShapingList.cs (1)
258Debug.Assert(sdc.Count >= _compInfos.Length, "SortDescriptions don't match LivePropertyInfos");
MS\Internal\Data\PropertyPathWorker.cs (2)
606Debug.Assert(0 <= k && k < _arySVS.Length && _arySVS[k].collectionView == collectionView, "bad parameters to UpdateSourceValueState"); 1139Debug.Assert(_dependencySourcesChanged, "Cached accessor didn't change sources");
MS\Internal\Data\RBNode.cs (4)
418Debug.Assert(successor != null && successor.Size < MaxSize, "InsertAt: successor should have room"); 439Debug.Assert(succsucc.Size == MaxSize, "InsertAt: outer nodes should be full"); 517Debug.Assert(index >= node.LeftSize + node.Size, "InsertNode: index should fall between nodes"); 570Debug.Assert(!deleteHere || node.Size == 0, "DeleteNode: Deleted node should be empty");
MS\Internal\Data\StaticPropertyChangedEventManager.cs (4)
153Debug.Assert(handler != null && type != null && propertyName != null, 178Debug.Assert(handler != null && type != null && propertyName != null, 399Debug.Assert((String)de.Key != AllListenersKey, "special key should not appear"); 487Debug.Assert(_toRemove.Count == 0, "to-remove list should be empty");
MS\Internal\Data\ValueChangedEventManager.cs (3)
187Debug.Assert(_toRemove.Count == 0, "to-remove list should be empty"); 295Debug.Assert(listener != null && source != null && pd != null, 303Debug.Assert(listener != null && source != null && pd != null,
MS\Internal\Data\ViewManager.cs (1)
236Debug.Assert(cvs != null, "Required CVS key is missing");
MS\Internal\Data\XDeferredAxisSource.cs (1)
77Debug.Assert(aryMembers.Length == 1, "XLinq changed XDeferredAxis to have more than one indexer");
MS\Internal\Data\XmlBindingWorker.cs (2)
33Debug.Assert(_xpath != null); 441Debug.Assert(ContextNode != null);
MS\Internal\DataStreams.cs (1)
304Debug.Assert(state != null);
MS\Internal\Documents\Application\DocumentApplicationJournalEntry.cs (1)
69Debug.Assert(docViewer != null, "PUIDocumentApplicationDocumentViewer not found.");
MS\Internal\Documents\ColumnResult.cs (1)
172Debug.Assert(_paragraphs != null && _paragraphs.Count > 0);
MS\Internal\Documents\ContentElementCollection.cs (5)
35Debug.Assert(owner != null); 170Debug.Assert(Items[item.Index] == item); 306Debug.Assert(collection != null); 698Debug.Assert(BelongsToOwner(item) && Items[item.Index] == item); 708Debug.Assert(BelongsToOwner(Items[i + 1]));
MS\Internal\Documents\HostedElements.cs (5)
69Debug.Assert(_currentTextSegment == 0); 86Debug.Assert(((ITextPointer)_currentPosition).CompareTo(_textSegments[_currentTextSegment].Start) >= 0 && 97Debug.Assert(((ITextPointer)_currentPosition).CompareTo(_textSegments[_currentTextSegment].Start) >= 0); 175Debug.Assert(_currentPosition.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward) is IInputElement); 179Debug.Assert(_currentPosition.GetAdjacentElement(LogicalDirection.Forward) is IInputElement);
MS\Internal\Documents\PageCache.cs (1)
735Debug.Assert(changes != null, "Attempt to fire PageCacheChangedEvent with null change set.");
MS\Internal\Documents\TableColumnCollectionInternal.cs (8)
43Debug.Assert(Items[index] == null); 62Debug.Assert(BelongsToOwner(Items[i])); 109Debug.Assert(BelongsToOwner(Items[i])); 134Debug.Assert(item != null && item.Index == -1); 135Debug.Assert(Items[index] == null); 171Debug.Assert(item != null); 286Debug.Assert(BelongsToOwner(Items[i])); 294Debug.Assert(BelongsToOwner(Items[i + count]));
MS\Internal\Documents\TableTextElementCollectionInternal.cs (8)
67Debug.Assert(BelongsToOwner(Items[i])); 236Debug.Assert(BelongsToOwner(Items[i])); 256Debug.Assert(item != null && item.Index == -1); 257Debug.Assert(Items[index] == null); 285Debug.Assert(BelongsToOwner(item) && Items[item.Index] == item); 299Debug.Assert(BelongsToOwner(Items[i + 1])); 368Debug.Assert(BelongsToOwner(Items[i])); 385Debug.Assert(BelongsToOwner(item) && Items[item.Index] == item);
MS\Internal\Documents\TextBoxView.cs (1)
1174System.Diagnostics.Debug.Assert(_host != null && _host.TextContainer != null && _host.TextContainer.Highlights != null,
MS\Internal\Documents\TextParagraphView.cs (11)
148Debug.Assert(lines != null && lines.Count > 0); 154Debug.Assert(false); 266Debug.Assert(lines != null && lines.Count > 0); 270Debug.Assert(lineIndex >= 0 && lineIndex < lines.Count); 322Debug.Assert(lines != null && lines.Count > 0, "Line array is empty."); 326Debug.Assert(lineIndex < lines.Count); 412Debug.Assert(dcp >= lines[lineIndex].StartPositionCP); 413Debug.Assert(dcp < lines[lineIndex].EndPositionCP || 525Debug.Assert(lines != null && lines.Count > 0); 562Debug.Assert(lines != null && lines.Count > 0); 689Debug.Assert(lines != null && lines.Count > 0);
MS\Internal\Documents\UndoManager.cs (3)
110Debug.Assert(((UndoManager)undoManager)._scope == null); 145Debug.Assert(((UndoManager)undoManager)._scope == scope); 275Debug.Assert(false);
MS\Internal\Globalization\BamlResourceSerializer.cs (3)
51Debug.Assert(output != null, "The output stream given is null"); 52Debug.Assert(tree != null && tree.Root != null, "The tree to be serialized is null."); 73Debug.Assert(elementNode != null);
MS\Internal\Globalization\BamlTreeMap.cs (3)
38Debug.Assert(tree != null, "Baml Tree is empty"); 39Debug.Assert(localizer != null, "BamlLocalizer is null"); 559Debug.Assert(node.NodeType == BamlNodeType.StartElement);
MS\Internal\Globalization\BamlTreeNode.cs (4)
38Debug.Assert(root != null, "Baml tree root is null!"); 39Debug.Assert(size > 0, "Baml tree size is less than 1"); 568Debug.Assert(value.Category != LocalizationCategory.Ignore && value.Category != LocalizationCategory.Inherit); 702Debug.Assert(value.Category != LocalizationCategory.Ignore && value.Category != LocalizationCategory.Inherit);
MS\Internal\Globalization\BamlTreeUpdater.cs (3)
22Debug.Assert(tree != null && tree.Root != null, "Empty Tree!"); 23Debug.Assert(treeMap != null, "Empty map!"); 24Debug.Assert(dictionary != null, "Empty dictionary");
MS\Internal\Globalization\LocalizableResourceBuilder.cs (1)
445Debug.Assert(inheritableAttribute != null);
MS\Internal\Globalization\LocalizationComments.cs (1)
346Debug.Assert(enumPrefix != null && enumNames != null);
MS\Internal\Helper.cs (7)
399Debug.Assert( fe != null ); 591Debug.Assert(targetDependencyObject != null, "DependencyProperties can only be set on DependencyObjects"); 637Debug.Assert(targetMember is PropertyInfo || targetMember is MethodInfo, 650Debug.Assert(parameterInfos.Length == 2, "The signature of a static settor must contain two parameters"); 834Debug.Assert(item != null); 1248Debug.Assert(virtualizingElement != null, "Must have a virtualizingElement to clear"); 1326Debug.Assert(VisualTreeHelper.IsAncestorOf(pathEndElement, pathStartElement), "pathEndElement should be an ancestor of pathStartElement");
MS\Internal\Ink\ClipboardProcessor.cs (6)
78Debug.Assert(dataObject != null && _preferredClipboardData!= null); 124Debug.Assert(inkCanvasSelection.SelectedStrokes.Count == orderedStrokes.Count); 168Debug.Assert(false , "CopySelectData: InkCanvas should have a selection!"); 182Debug.Assert(dataObject != null && _preferredClipboardData!= null); 252Debug.Assert(_preferredClipboardData != null); 261Debug.Assert(value != null);
MS\Internal\Ink\EditingCoordinator.cs (20)
72Debug.Assert(ActiveEditingBehavior == SelectionEditor, 165Debug.Assert(currentBehavior is StylusEditingBehavior, 187Debug.Assert(currentBehavior is StylusEditingBehavior, 243Debug.Assert(behavior != null); 301Debug.Assert(_activationStack.Count == 1, "The behavior stack has to contain one behavior."); 347Debug.Assert(behavior == ActiveEditingBehavior); 357Debug.Assert(behavior == LassoSelectionBehavior || behavior == SelectionEditingBehavior, 368Debug.Assert(behavior != LassoSelectionBehavior && behavior != SelectionEditingBehavior, 437Debug.Assert((_capturedStylus != null && _capturedMouse == null) 595Debug.Assert(newEditingBehavior != null); 768Debug.Assert(stylusEditingBehavior != null || ActiveEditingBehavior == null, 851Debug.Assert(ActiveEditingBehavior == null || ActiveEditingBehavior is IStylusEditing, 920Debug.Assert(inputDevice != null, "A null device is passed in."); 921Debug.Assert(stylusEditingBehavior != null, "stylusEditingBehavior cannot be null."); 922Debug.Assert(!IsInMidStroke, "The previous device hasn't been released yet."); 967Debug.Assert(!resetDynamicRenderer, "The dynamic renderer shouldn't be reset for Mouse"); 1003Debug.Assert(IsInMidStroke || !releaseDevice, "The captured device has been release unexpectly."); 1045Debug.Assert(_capturedStylus == null || _capturedMouse == null, "InkCanvas cannot capture both stylus and mouse at the same time."); 1223Debug.Assert(!IsInMidStroke, "ChangeEditingBehavior cannot be called in a mid-stroke"); 1224Debug.Assert(_activationStack.Count <= 1, "The behavior stack has to contain at most one behavior when user is not editing.");
MS\Internal\Ink\EraserBehavior.cs (7)
78Debug.Assert(EditingCoordinator.IsInMidStroke, "SwitchToMode should only be called in a mid-stroke"); 96Debug.Assert(_cachedEraseMode != mode); 149Debug.Assert(newEraseMode == InkCanvasEditingMode.EraseByPoint 173Debug.Assert(_cachedPointEraserCursor != null, "_cachedPointEraserCursor shouldn't be null."); 341Debug.Assert(null != e.HitStroke); 379Debug.Assert(null != e.HitStroke, "e.HitStroke cannot be null"); 395Debug.Assert(eraseResult != null, "eraseResult cannot be null");
MS\Internal\Ink\InkCanvasSelection.cs (9)
129Debug.Assert( _inkCanvas.EditingCoordinator.UserIsEditing); 130Debug.Assert(activeSelectionHitResult != InkCanvasSelectionHitResult.None, "activeSelectionHitResult cannot be InkCanvasSelectionHitResult.None."); 140Debug.Assert(VisualTreeHelper.GetParent(feedbackAdorner) == null, 155Debug.Assert(VisualTreeHelper.GetParent(_inkCanvas.FeedbackAdorner) 173Debug.Assert(VisualTreeHelper.GetParent(feedbackAdorner) == adornerLayer, 195Debug.Assert(strokes != null && elements != null); 761Debug.Assert( SelectedElements.Count != 0, 879Debug.Assert(_inkCanvas.SelectionAdorner.Visibility == Visibility.Visible, 886Debug.Assert(_inkCanvas.SelectionAdorner.Visibility == Visibility.Collapsed,
MS\Internal\Ink\InkCollectionBehavior.cs (2)
104Debug.Assert(EditingCoordinator.IsInMidStroke, "SwitchToMode should only be called in a mid-stroke"); 290Debug.Assert(_strokeDrawingAttributes != null, "_strokeDrawingAttributes can not be null, did we not see a down?");
MS\Internal\Ink\LassoHelper.cs (1)
164System.Diagnostics.Debug.Assert((0 <= percentIntersect) && (100 >= percentIntersect));
MS\Internal\Ink\LassoSelectionBehavior.cs (9)
68Debug.Assert(EditingCoordinator.IsInMidStroke, "SwitchToMode should only be called in a mid-stroke"); 121Debug.Assert(stylusPoints.Count != 0, "An empty stylusPoints has been passed in."); 272Debug.Assert(tappedElement == null); 278Debug.Assert(tappedStroke == null); 367System.Diagnostics.Debug.Assert(null != _lassoHelper); 384Debug.Assert(canvas != null); 385Debug.Assert(childElement != null); 387Debug.Assert(canvas.CheckAccess()); 585Debug.Assert(!_disableLasso && _lassoHelper == null, "StartLasso is called unexpectedly.");
MS\Internal\Ink\PenCursorManager.cs (2)
58Debug.Assert(DoubleUtil.IsZero(tranform.OffsetX) && DoubleUtil.IsZero(tranform.OffsetY), "The EraserShape cannot be translated."); 59Debug.Assert(tranform.HasInverse, "The transform has to be invertable.");
MS\Internal\Ink\SelectionEditingBehavior.cs (3)
64Debug.Assert(_hitResult != InkCanvasSelectionHitResult.None); 321Debug.Assert(false); 375Debug.Assert(!EditingCoordinator.UserIsEditing, "Unexpect UserIsEditng state." );
MS\Internal\IO\Packaging\ByteStream.cs (3)
37Debug.Assert(stream != null); 43Debug.Assert(_access == FileAccess.Read); 112Debug.Assert(_length > 0);
MS\Internal\IO\Packaging\ManagedFilter.cs (2)
62System.Diagnostics.Debug.Assert(_propType == PropSpecType.Name, "ManagedPropSpec.PropName - PropName only meaningful if PropType is type string"); 83System.Diagnostics.Debug.Assert(_propType == PropSpecType.Id, "ManagedPropSpec.PropId - PropId only meaningful if PropType is numeric");
MS\Internal\IO\Packaging\PackageFilter.cs (7)
457Debug.Assert(false); 466Debug.Assert(false); 556Debug.Assert(contentType != null && contentType.ToString().Length > 0); 582Debug.Assert(dottedExtensionName != null); 610Debug.Assert(pathWithGaps != null && stopGaps != null); 619Debug.Assert(stopGaps.Length > nextStopGapToUse); 627Debug.Assert(stopGaps.Length == nextStopGapToUse);
MS\Internal\IO\Packaging\XamlFilter.cs (8)
272Debug.Assert(bufferCharacterCount >= 0); 338Debug.Assert(_fixedPageContentExtractor != null); 373Debug.Assert(_contextStack.Count == 0); 379Debug.Assert(_topLevelReader != null); 386Debug.Assert(false); 489Debug.Assert(topOfStack.HasIndexableContent); 751Debug.Assert(_xamlReader != null); 773Debug.Assert(string.Equals(_xamlReader.LocalName, _fixedPageName, StringComparison.Ordinal));
MS\Internal\IO\Packaging\XmlFixedPageInfo.cs (1)
34Debug.Assert(_pageNode != null);
MS\Internal\IO\Packaging\XmlGlyphRunInfo.cs (1)
38Debug.Assert(_glyphsNode != null
MS\Internal\LayoutDump.cs (5)
464Debug.Assert(dpv != null, "Dump function has to match element type."); 480Debug.Assert(text != null, "Dump function has to match element type."); 513Debug.Assert(fdsv != null, "Dump function has to match element type."); 539Debug.Assert(fdView != null, "Dump function has to match element type."); 579Debug.Assert(flowDocumentPage != null, "Dump function has to match page type.");
MS\Internal\Navigation\JournalEntryStack.cs (1)
117Debug.Assert(_current != null, "If we are returning true, our current cannot be null");
MS\Internal\PtsHost\BaseParaClient.cs (2)
64Debug.Assert(_paraHandle == IntPtr.Zero || _paraHandle == pfspara); 100Debug.Assert(oldParaClient._visual != null);
MS\Internal\PtsHost\BaseParagraph.cs (1)
178Debug.Assert(ParagraphEndCharacterPosition >= startPosition);
MS\Internal\PtsHost\CellParaClient.cs (4)
78Debug.Assert(calculatedColumns != null 355Debug.Assert(tableParaClient != null); 358Debug.Assert( calculatedColumns != null 372Debug.Assert(0 <= durCellWidth);
MS\Internal\PtsHost\CellParagraph.cs (6)
64Debug.Assert(Cell.Index != -1 && Cell.ColumnIndex != -1, 70Debug.Assert(Cell.Table != null); 136Debug.Assert(Cell.Index != -1 && Cell.ColumnIndex != -1, 139Debug.Assert(Cell.Table != null); 165Debug.Assert(Cell.Index != -1 && Cell.ColumnIndex != -1, 168Debug.Assert(Cell.Table != null);
MS\Internal\PtsHost\ColumnPropertiesGroup.cs (1)
38internal double ColumnWidth { get { Debug.Assert(!double.IsNaN(_columnWidth)); return _columnWidth; } }
MS\Internal\PtsHost\ContainerParagraph.cs (12)
216Debug.Assert(_ur.ChangeType == PTS.FSKCHANGE.fskchInside); // Inconsistent UpdateRecord data 283Debug.Assert(_ur == null); // UpdateRecord has been already created. 346Debug.Assert(StructuralCache.CurrentFormatContext.FinitePage || _ur != null); // For bottomless case UpdateRecord needs to be created in UpdGetFirstChangeInSegment. 351Debug.Assert(_ur == null); 464Debug.Assert(iArea == 0); 630Debug.Assert(iArea == 0); 715Debug.Assert(pmcsclientOut == IntPtr.Zero); 760Debug.Assert(iArea == 0); 845Debug.Assert(pmcsclientOut == IntPtr.Zero); 899Debug.Assert(ParagraphEndCharacterPosition >= startPosition); 1040Debug.Assert(textPointer is TextPointer); 1166Debug.Assert(ur.Next.FirstPara == null || ur.Next.FirstPara.Next == null);
MS\Internal\PtsHost\DtrList.cs (1)
310Debug.Assert(_dtrs.Length > 0);
MS\Internal\PtsHost\FigureParaClient.cs (4)
398Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is ContainerVisual); 419Debug.Assert(fskupd != PTS.FSKUPDATE.fskupdNoChange); 433Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is SectionVisual); 603Debug.Assert(arrayColumnDesc.Length == 1);
MS\Internal\PtsHost\FigureParagraph.cs (1)
428Debug.Assert(ParagraphEndCharacterPosition >= startPosition);
MS\Internal\PtsHost\FloaterParaClient.cs (4)
405Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is ContainerVisual); 426Debug.Assert(fskupd != PTS.FSKUPDATE.fskupdNoChange); 440Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is SectionVisual); 612Debug.Assert(arrayColumnDesc.Length == 1);
MS\Internal\PtsHost\FloaterParagraph.cs (4)
250Debug.Assert(pmcsclientOut == IntPtr.Zero); 500Debug.Assert(pmcsclientOut == IntPtr.Zero); 519Debug.Assert(pmcsclientOut == IntPtr.Zero); 602Debug.Assert(ParagraphEndCharacterPosition >= startPosition);
MS\Internal\PtsHost\FlowDocumentPage.cs (8)
313Debug.Assert(child != null); 456Debug.Assert(pageDetails.u.complex.cSections == 1); // Only one section is supported right now. 472Debug.Assert(sectionDetails.u.withpagenotes.cEndnoteColumns == 0); // Footnotes are not supported yet. 474Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 475Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0); 512Debug.Assert(false); // Complex columns are not supported yet. 917Debug.Assert(e != null); 920Debug.Assert(_structuralCache.TextContainer is not null);
MS\Internal\PtsHost\Line.cs (6)
58Debug.Assert(_line != null, "Line has been already disposed."); 344Debug.Assert(!double.IsNaN(_trackWidth), "Track width must be set for measure pass."); 403Debug.Assert(DoubleUtil.GreaterThanOrClose(rect.Width, 0), "Negative inline object's width."); 659Debug.Assert(dcp >= 0 && (dcp + cch <= _line.Length)); 679Debug.Assert(cchGlyphRuns > 0 && glyphRunsCollection.Count > 0); 1005Debug.Assert(runBounds.Count == 1, "Expecting exactly one TextRunBounds for a single text position.");
MS\Internal\PtsHost\LineBase.cs (2)
135Debug.Assert(element != null, "Cannot use ITextContainer that does not provide TextElement instances."); 257Debug.Assert(element != null, "Element should be here.");
MS\Internal\PtsHost\ListMarkerSourceInfo.cs (1)
340Debug.Assert(number >= 0 && number <= 9);
MS\Internal\PtsHost\PageVisual.cs (2)
66Debug.Assert(vc.Count <= 1); 72Debug.Assert(vc.Count <= 1);
MS\Internal\PtsHost\Pts.cs (3)
56Debug.Assert(ptsContext != null, "Null argument 'ptsContext' - required for return value validation."); 91Debug.Assert(ptsContext != null, "Null argument 'ptsContext' - required for return value validation."); 158Debug.Assert(false);
MS\Internal\PtsHost\PtsHelper.cs (3)
587Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 588Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0); 897Debug.Assert(cColumns > 0, "At least one column is required.");
MS\Internal\PtsHost\PtsHost.cs (5)
383Debug.Assert(cnms == 1); // Only one section is supported right now. 2548Debug.Assert(false); 2943Debug.Assert(false); 3163Debug.Assert(false); 3242Debug.Assert(false);
MS\Internal\PtsHost\PtsPage.cs (13)
156Debug.Assert(!canUpdate || _section.CanUpdate); 165Debug.Assert(breakRecord == null || !_section.StructuralCache.DestroyStructure, "Cannot format from dirty break record unless StructuralCache.DestroyStructure is not set."); 913Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 914Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0); 961Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 962Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0); 1041Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is ContainerVisual); 1124Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 1125Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0); 1327Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 1328Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0); 1388Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 1389Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0);
MS\Internal\PtsHost\RowParagraph.cs (3)
192Debug.Assert(cCells == Row.FormatCellCount); 256Debug.Assert (_spannedCells[j] != null); 275Debug.Assert(Row.Index - cell.RowIndex + 1 == cell.RowSpan);
MS\Internal\PtsHost\SubpageParaClient.cs (3)
334Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is ContainerVisual); 355Debug.Assert(fskupd != PTS.FSKUPDATE.fskupdNoChange); 369Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is SectionVisual);
MS\Internal\PtsHost\SubpageParagraph.cs (4)
185Debug.Assert(fSuppressTopSpace == 1, "Top space should be always suppressed at the top of broken paragraph."); 441Debug.Assert(pmcsclientOut == IntPtr.Zero); 600Debug.Assert(pmcsclientOut == IntPtr.Zero); 645Debug.Assert(ParagraphEndCharacterPosition >= startPosition);
MS\Internal\PtsHost\TableParaClient.cs (23)
58Debug.Assert( Table != null 317Debug.Assert( TableParagraph.Table != null 360Debug.Assert( TableParagraph.Table != null 431Debug.Assert(TableParagraph.Table != null 600Debug.Assert( TableParagraph.Table != null 819Debug.Assert( TableParagraph.Table != null 890Debug.Assert( TableParagraph.Table != null 944Debug.Assert( TableParagraph.Table != null 1025Debug.Assert( TableParagraph.Table != null 1119Debug.Assert( TableParagraph.Table != null 1147Debug.Assert(false); 1169Debug.Assert(Table != null); 1195Debug.Assert(Table != null); 1377Debug.Assert(TableParagraph == (TableParagraph)(PtsContext.HandleToObject(tableObjDetails.fsnmTable))); 1407Debug.Assert(tableDetails.cRows == cRowsActual); 1456Debug.Assert(tableRowDetails.cCells == cCellsActual); 1585Debug.Assert( cellParaClient.Visual != null 1714Debug.Assert( cellParaClient.Visual != null 2040Debug.Assert(_calculatedColumns[i].UserWidth.GridUnitType == GridUnitType.Auto || _calculatedColumns[i].UserWidth.GridUnitType == GridUnitType.Star || _calculatedColumns[i].UserWidth.GridUnitType == GridUnitType.Pixel, "Unexpected GridUnitType"); 2043Debug.Assert(0 <= _calculatedColumns[i].DurMinWidth && 0 <= _calculatedColumns[i].DurMaxWidth); 2098Debug.Assert(0 < iP || DoubleUtil.IsZero(iP)); 2368Debug.Assert(_calculatedColumns[i].UserWidth.IsAbsolute); 2392Debug.Assert(_calculatedColumns[i].DurMinWidth <= _calculatedColumns[i].DurMaxWidth);
MS\Internal\PtsHost\TableParagraph.cs (3)
302Debug.Assert(Table.RowGroups.Count > 0); 318Debug.Assert(currentRowGroup.Rows[nextRowIndex].Index != -1, 335Debug.Assert(Rows[0].Index != -1,
MS\Internal\PtsHost\TextFormatterHost.cs (6)
39Debug.Assert(Context != null, "TextFormatter host is not initialized."); 40Debug.Assert(textSourceCharacterIndex >= 0, "Character index must be non-negative."); 52Debug.Assert(Context != null, "TextFormatter host is not initialized."); 53Debug.Assert(textSourceCharacterIndexLimit >= 0, "Character index must be non-negative."); 66Debug.Assert(Context != null, "TextFormatter host is not initialized."); 67Debug.Assert(textSourceCharacterIndex>= 0, "Character index must be non-negative.");
MS\Internal\PtsHost\TextParaClient.cs (32)
130Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 157Debug.Assert(!((TextParagraph) Paragraph).HasFiguresFloatersOrInlineObjects()); 228Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 250Debug.Assert(Paragraph.Element as ContentElement != e); 317Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 370Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 712Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 793Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 825Debug.Assert(position is TextPointer); 856Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 875Debug.Assert(position is TextPointer); 906Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 1063Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 1365Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 1385Debug.Assert(!PTS.ToBoolean(textDetails.fLinesComposite)); 1465Debug.Assert(insertionIndex >= 0 && insertionIndex <= lineVisuals.Count); 2617Debug.Assert(index > 0); 2747Debug.Assert(index == 0); 2748Debug.Assert(elIndex == 0); 2762Debug.Assert(index > 0); 2786Debug.Assert(elIndex == arrayLineElement.Length - 1); 2787Debug.Assert(index == arrayLineDesc.Length - 1); 2907Debug.Assert(index > 0); 2955Debug.Assert(backspaceCaretPosition != null); 3004Debug.Assert(index == 0); 3005Debug.Assert(elIndex == 0); 3019Debug.Assert(index > 0); 3366Debug.Assert(!PTS.ToBoolean(textDetails.fLinesComposite)); 3484Debug.Assert(_lineIndexFirstVisual == lineIndexFirstVisible); 3513Debug.Assert(visualChildren.Count == (lineIndexFirstInvisible - lineIndexFirstVisible)); 3923Debug.Assert(localEnd > localStart); 4123Debug.Assert(localEnd > localStart);
MS\Internal\PtsHost\TextParagraph.cs (1)
137Debug.Assert(iArea == 0);
MS\Internal\PtsHost\TextParaLineResult.cs (4)
52Debug.Assert(false); 68Debug.Assert(false); 81Debug.Assert(false); 97Debug.Assert(false);
MS\Internal\PtsHost\UpdateRecord.cs (1)
38Debug.Assert(Next != null); // This is the last UR, cannot merge with next.
MS\Internal\PtsTable\CalculatedColumn.cs (1)
48Debug.Assert(0 <= durMinWidth && durMinWidth <= durMaxWidth);
MS\Internal\PtsTable\RowSpanVector.cs (10)
76Debug.Assert(cell != null 84Debug.Assert( start < _entries[i].Cell.ColumnIndex 90Debug.Assert(_index < _size); 91Debug.Assert(_index == 0 || _entries[_index - 1].Start < start); 92Debug.Assert(start < _entries[_index].Start); 138Debug.Assert(0 <= _index && _index < _size); 146Debug.Assert(0 <= _index && _index < _size); 178Debug.Assert(_entries[i].Cell != null); 179Debug.Assert(i >= j); 248Debug.Assert( _entries.Length > 0
MS\Internal\Text\ComplexLine.cs (12)
63Debug.Assert(run != null, "TextRun has not been created."); 64Debug.Assert(run.Length > 0, "TextRun has to have positive length."); 76Debug.Assert(dcp >= 0); 151Debug.Assert(runs != null, "Cannot retrieve runs collection."); 174Debug.Assert(DoubleUtil.GreaterThanOrClose(rect.Width, 0), "Negative inline object's width."); 226Debug.Assert(runs != null, "Cannot retrieve runs collection."); 330Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text, "TextPointer does not point to characters."); 377Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart, "TextPointer does not point to element start edge."); 382Debug.Assert(element != null, "Cannot use ITextContainer that does not provide TextElement instances."); 468Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd, "TextPointer does not point to element end edge."); 473Debug.Assert(element != null, "Element should be here."); 518Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.EmbeddedElement, "TextPointer does not point to embedded object.");
MS\Internal\Text\DynamicPropertyReader.cs (5)
37Debug.Assert(element != null); 49Debug.Assert(element != null); 67Debug.Assert(element != null); 226Debug.Assert(element != null); 251Debug.Assert(!position.IsNull);
MS\Internal\Text\Line.cs (7)
108Debug.Assert(_line != null, "Rendering line that has not been measured yet."); 115Debug.Assert(line.HasCollapsed, "Line has not been collapsed"); 308Debug.Assert(collapsedLine.HasCollapsed, "Line has not been collapsed"); 312Debug.Assert(collapsedRanges.Count == 1, "Multiple collapsed ranges are not supported."); 344Debug.Assert(collapsedLine.HasCollapsed, "Line has not been collapsed"); 475Debug.Assert(runBounds.Count == 1, "Expecting exactly one TextRunBounds for a single text position."); 498Debug.Assert(paraProperties.TextTrimming != TextTrimming.None, "Text trimming must be enabled.");
MS\Internal\Text\LineMetrics.cs (2)
111get { Debug.Assert((_packedData & HasBeenUpdatedMask) != 0); return _width; } 126get { Debug.Assert((_packedData & HasBeenUpdatedMask) != 0); return _start; }
MS\Internal\Text\SimpleLine.cs (3)
33Debug.Assert(dcp >= 0, "Character index must be non-negative."); 70Debug.Assert(dcp >= 0, "Character index must be non-negative."); 121Debug.Assert(content != null);
MS\Internal\Text\TextLineResult.cs (4)
51Debug.Assert(false); 63Debug.Assert(false); 74Debug.Assert(false); 86Debug.Assert(false);
MS\Internal\Text\TextProperties.cs (1)
254Debug.Assert(element != null);
MS\Internal\Text\TypographyProperties.cs (3)
102Debug.Assert((uint)PropertyId.PropertyCount <= 32); 775Debug.Assert((uint)propertyId < (uint)PropertyId.PropertyCount, "Invalid typography property id"); 791Debug.Assert((uint)propertyId < (uint)PropertyId.PropertyCount, "Invalid typography property id");
MS\Internal\WeakHashtable.cs (1)
53Debug.Assert(!key.GetType().IsValueType, "WeakHashtable doesn't support value-type keys. Use WeakObjectHashtable instead.");
MS\Internal\WindowsRuntime\Generated\WinRT.cs (1)
159System.Diagnostics.Debug.Assert(_CanUnloadNow == null || _CanUnloadNow() == 0); // S_OK
MS\Win32\UxThemeWrapper.cs (1)
397Debug.Assert(themeState.IsActive, "Queried ThemeColor while UxTheme is not active.");
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Context\XamlContextStack.cs (5)
26Debug.Assert(CurrentFrame is not null); 27Debug.Assert(CurrentFrame.Depth == Depth); 84Debug.Assert(iteratorFrame is not null); 110Debug.Assert(CurrentFrame.Depth == Depth); 123Debug.Assert(CurrentFrame.Depth == Depth);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Context\XamlFrame.cs (1)
40Debug.Assert(_depth != -1, "Context Frame is uninitialized");
System\Windows\Annotations\AnnotationHelper.cs (1)
624Debug.Assert((textSegments != null) && (textSegments.Count > 0), "Invalid selection TextSegments");
System\Windows\Annotations\Storage\XmlStreamStore.cs (2)
833Debug.Assert(knownNamespace != null, "null knownNamespace"); 852Debug.Assert(name != null, "null compatible namespace");
System\Windows\Application.cs (7)
107Debug.Assert(_appInstance == null, "_appInstance must be null here."); 517Debug.Assert(stream != null, "stream should not be null."); 518Debug.Assert(pc != null, "pc should not be null."); 701Debug.Assert(stream == null || sooPart != null, "When stream is not null, sooPart cannot be null either"); 1527Debug.Assert(CheckAccess(), "This should only be called on the Application thread"); 1588Debug.Assert(CheckAccess(), "DoShutdown can only be called on the Dispatcer thread"); 2007Debug.Assert(!uri.IsAbsoluteUri || BaseUriHelper.IsPackApplicationUri(uri));
System\Windows\Automation\Peers\DataGridAutomationPeer.cs (1)
198Debug.Assert(false);
System\Windows\Automation\Peers\DateTimeAutomationPeer.cs (1)
685Debug.Assert((int)owningButton.GetValue(Grid.RowProperty) > 0);
System\Windows\Automation\Peers\ItemAutomationPeer.cs (1)
690System.Diagnostics.Debug.Assert(Object.Equals(item, Item), "ItemPeer reuse for an unequal item is not supported");
System\Windows\BroadcastEventHelper.cs (9)
19Debug.Assert(d is FrameworkElement || d is FrameworkContentElement); 40Debug.Assert(d is FrameworkElement || d is FrameworkContentElement); 44Debug.Assert(loadedPending.Length == 3); 67Debug.Assert(d is FrameworkElement || d is FrameworkContentElement); 88Debug.Assert(d is FrameworkElement || d is FrameworkContentElement); 92Debug.Assert(unloadedPending.Length == 3); 165Debug.Assert(loadedPending != null && loadedPending.Length == 3, 202Debug.Assert(unloadedPending != null && unloadedPending.Length == 3, 506Debug.Assert( fo.IsFE );
System\Windows\Controls\AVElementHelper.cs (1)
52Debug.Assert((element != null), "Element is null");
System\Windows\Controls\Calendar.cs (14)
208Debug.Assert(c != null); 264Debug.Assert(c != null); 325Debug.Assert(c != null); 382Debug.Assert(c != null); 413Debug.Assert(false); 540Debug.Assert(c != null); 626Debug.Assert(c != null); 916Debug.Assert(false); 935Debug.Assert(false); 975Debug.Assert(false); 1008Debug.Assert(false); 1077Debug.Assert(false); 1179Debug.Assert(this.DisplayMode == CalendarMode.Year); 1192Debug.Assert(this.DisplayMode == CalendarMode.Decade);
System\Windows\Controls\CalendarBlackoutDatesCollection.cs (2)
112Debug.Assert(dayInterval != 0); 327Debug.Assert(day != null);
System\Windows\Controls\ColumnDefinition.cs (14)
91Debug.Assert(_items != null); 113Debug.Assert(_items != null); 153Debug.Assert( _items[i] != null 171Debug.Assert(_items[item.Index] == item); 186Debug.Assert(_items[value.Index] == value); 322Debug.Assert( _items[i] != null 331Debug.Assert( _items[i + count] != null 631Debug.Assert(value != null && value.Index == -1); 632Debug.Assert(_items[index] == null); 649Debug.Assert(value != null); 682Debug.Assert( _items[i] != null 700Debug.Assert( _items[value.Index] == value 713Debug.Assert( _items[i + 1] != null 742Debug.Assert(value >= _size);
System\Windows\Controls\ComboBox.cs (5)
621Debug.Assert(_editableTextBoxSite == sender); 1198Debug.Assert(_autoScrollTimer == null, "IsMouseCaptured went from true to true"); 1560Debug.Assert((increment > 0 && startIndex <= stopIndex) || (increment < 0 && startIndex >= stopIndex), "Infinite loop detected"); 1722Debug.Assert(!comboBox.CheckAccess() || Mouse.Captured != comboBox, "On the dispatcher thread, ComboBox should not have capture after closing the dropdown"); 1770Debug.Assert(!CheckAccess() || Mouse.Captured != this, "On the dispatcher thread, ComboBox should not have capture after closing the dropdown");
System\Windows\Controls\ContainerTracking.cs (2)
89Debug.Assert(IsInList(root), "This container should be in the tracking list."); 100Debug.Assert(!IsInList(root), "This container shouldn't be in our tracking list");
System\Windows\Controls\ContentPresenter.cs (3)
1018Debug.Assert(tc.CanConvertTo(typeof(UIElement))); 1088Debug.Assert(!(content is String) && !(content is UIElement)); // these are handled by different templates 1127Debug.Assert(!(tc != null && tc.CanConvertTo(typeof(UIElement)))); // this is handled by a different template
System\Windows\Controls\ContextMenu.cs (1)
480Debug.Assert(_parentPopup == null, "_parentPopup should be null");
System\Windows\Controls\DataGrid.cs (16)
1633Debug.Assert(info != null, "info is null."); 1634Debug.Assert(column != null, "column is null."); 1745Debug.Assert(_isDraggingSelection, "DoAutoScroll should only be called when dragging selection."); 3536Debug.Assert(CanUserAddRows, "AddNewItem called when the end-user cannot add new rows."); 3537Debug.Assert(!IsAddingNewItem, "AddNewItem called when a pending add is taking place."); 5235Debug.Assert(!IsUpdatingSelectedCells); 5241Debug.Assert(IsUpdatingSelectedCells); 6366Debug.Assert(RelativeMousePosition != RelativeMousePositions.Over, "The mouse is not supposed to be over the DataGrid."); 7086Debug.Assert(sortColumn != null, "column should not be null"); 7244Debug.Assert(e.NewItems.Count == 1, "SortDescriptionCollection should handle one element at a time"); 7255Debug.Assert(e.OldItems.Count == 1, "SortDescriptionCollection should handle one element at a time"); 7275Debug.Assert(e.OldItems.Count == 1 && e.NewItems.Count == 1, "SortDescriptionCollection should handle one element at a time"); 7389Debug.Assert(e.NewItems.Count == 1, "GroupDescriptionCollection should handle one element at a time"); 7397Debug.Assert(e.OldItems.Count == 1, "GroupDescriptionCollection should handle one element at a time"); 7408Debug.Assert(e.OldItems.Count == 1 && e.NewItems.Count == 1, "GroupDescriptionCollection should handle one element at a time"); 7828Debug.Assert(dataGrid != null || columnCollection != null, "Both dataGrid and columnCollection cannot not be null at the same time");
System\Windows\Controls\DataGridAutoGeneratingColumnEventArgs.cs (1)
105Debug.Assert(
System\Windows\Controls\DataGridCell.cs (5)
89Debug.Assert(_owner == null || _owner == ownerRow, "_owner should be null before PrepareCell is called or the same value as the ownerRow."); 137Debug.Assert(_owner == ownerRow, "_owner should be the same as the DataGridRow that is clearing the cell."); 570Debug.Assert(!IsEditing, "Should not call BeginEdit when IsEditing is true."); 583Debug.Assert(IsEditing, "Should not call CancelEdit when IsEditing is false."); 594Debug.Assert(IsEditing, "Should not call CommitEdit when IsEditing is false.");
System\Windows\Controls\DataGridCellInfo.cs (9)
53Debug.Assert(item != null, "item should not be null."); 54Debug.Assert(column != null, "column should not be null."); 55Debug.Assert(owner != null, "owner should not be null."); 64Debug.Assert(info != null, "item should not be null."); 65Debug.Assert(column != null, "column should not be null."); 66Debug.Assert(owner != null, "owner should not be null."); 78Debug.Assert(item == DependencyProperty.UnsetValue, "This should only be used to make an Unset CellInfo."); 104Debug.Assert(owner != null, "owner should not be null."); 116Debug.Assert(owner != null, "owner should not be null.");
System\Windows\Controls\DataGridCellsPanel.cs (17)
166Debug.Assert(blockList != null, "RealizedColumnsBlockList shouldn't be null at this point."); 633Debug.Assert(!children.Contains(child), "we incorrectly identified a recycled container"); 648Debug.Assert(child == InternalChildren[childIndex], "Wrong child was generated"); 678Debug.Assert(container != null, "Null container was generated"); 714Debug.Assert(children[visualTreeIndex] != null, "MoveVisualChild interprets a null destination as 'move to end'"); 1070Debug.Assert(columnIndex < columnCount, "columnIndex should be less than column count"); 1145Debug.Assert(startIndex >= 0); 1146Debug.Assert(children == _realizedChildren, "the given child list must be the _realizedChildren list when recycling"); 1328Debug.Assert( 1334Debug.Assert( 1413Debug.Assert(i >= arrangeState.FrozenColumnCount, "Frozen cells should have been realized or not visible"); 1447Debug.Assert(child != null, "child cannot be null."); 1462Debug.Assert(cell.Column != null, "column cannot be null."); 1567Debug.Assert(children.Count > blockElementCount, "Element count from blocks can't be less than total children count"); 1608Debug.Assert(columnIndex <= block.EndIndex, "Missing children for index in block list"); 1967Debug.Assert(ParentDataGrid != null, "ParentDataGrid should not be null"); 2085Debug.Assert((itemCount == itemUICount) || (itemUICount == 0), "Both ItemUICount and ItemCount should be equal or ItemUICount should be 0.");
System\Windows\Controls\DataGridColumn.cs (3)
591Debug.Assert(Width.IsStar); 892Debug.Assert(d is DataGridColumn, "d should be a DataGridColumn"); 1144Debug.Assert(itemProperty != null && itemProperty.PropertyType != null, "itemProperty and/or its PropertyType member cannot be null");
System\Windows\Controls\DataGridColumnCollection.cs (18)
20Debug.Assert(dataGridOwner != null, "We should have a valid DataGrid"); 226Debug.Assert(displayIndex >= 0 && displayIndex < DisplayIndexMap.Count, "displayIndex should have already been validated"); 324Debug.Assert(newDisplayIndex >= 0 && newDisplayIndex < Count, "The new DisplayIndex should have already been validated"); 357Debug.Assert(oldDisplayIndex != newDisplayIndex, "A column's display index must have changed for us to call OnColumnDisplayIndexChanged"); 358Debug.Assert(oldDisplayIndex >= 0 && oldDisplayIndex < Count, "The old DisplayIndex should be valid"); 409Debug.Assert( 412Debug.Assert(!IsUpdatingDisplayIndex, "We don't add new columns as part of a display index update operation"); 469Debug.Assert(DisplayIndexMap.Count == 0, "DisplayIndexMap should be empty until first measure call."); 542Debug.Assert(assignedDisplayIndexMap.ContainsKey(displayIndex)); 553Debug.Assert( 556Debug.Assert(!IsUpdatingDisplayIndex, "We don't remove columns as part of a display index update operation"); 561Debug.Assert(DisplayIndexMap.Count > Count, "Columns were just removed: the display index map shouldn't have yet been updated"); 597Debug.Assert(oldColumns.Count == 1 && newColumns.Count == 1, "Multi replace isn't possible with ObservableCollection"); 686Debug.Assert(removedDisplayIndex >= 0); 725Debug.Assert(Count == DisplayIndexMap.Count, "Display Index map is of the wrong size"); 728Debug.Assert(DisplayIndexMap[i] >= 0 && DisplayIndexMap[i] < Count, "DisplayIndex map entry doesn't point to a valid column"); 729Debug.Assert(ColumnFromDisplayIndex(i).DisplayIndex == i, "DisplayIndex map doesn't match column indices"); 896Debug.Assert(
System\Windows\Controls\DataGridColumnHeaderCollection.cs (2)
45Debug.Assert(e.Property == DataGridColumn.HeaderProperty, "We only want to know about the header property changing"); 46Debug.Assert(_columns.Contains(column));
System\Windows\Controls\DataGridHelper.cs (2)
236Debug.Assert((cell is DataGridCell) || (cell is DataGridColumnHeader), "provideColumn should be one of the cell or header containers."); 300Debug.Assert((cell is DataGridCell) || (cell is DataGridColumnHeader), "provideColumn should be one of the cell or header containers.");
System\Windows\Controls\DataGridHyperlinkColumn.cs (1)
283Debug.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)
254Debug.Assert(
System\Windows\Controls\DataGridRow.cs (3)
222Debug.Assert(stateCode != DATAGRIDROW_stateNullCode); 435Debug.Assert(_owner == null || _owner == owningDataGrid, "_owner should be null before PrepareRow is called or the same as the owningDataGrid."); 476Debug.Assert(_owner == owningDataGrid, "_owner should be the same as the DataGrid that is clearing the row.");
System\Windows\Controls\DataGridTextColumn.cs (1)
268Debug.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\DatePicker.cs (11)
205Debug.Assert(dp != null); 251Debug.Assert(dp != null); 316Debug.Assert(dp != null); 334Debug.Assert(dp != null); 361Debug.Assert(dp != null); 433Debug.Assert(dp != null); 529Debug.Assert(dp != null); 581Debug.Assert(dp != null); 946Debug.Assert(c != null); 947Debug.Assert(args != null); 969Debug.Assert(e.AddedItems.Count < 2);
System\Windows\Controls\DateTimeHelper.cs (1)
178Debug.Assert(DateTime.Compare(start, end) < 1);
System\Windows\Controls\DefinitionBase.cs (6)
318Debug.Assert(value >= -1 && _parentIndex != value); 709Debug.Assert(sharedSizeGroup != null); 725Debug.Assert(_registry.Contains(key)); 742Debug.Assert(sharedSizeScope != null && sharedSizeGroupId != null); 755Debug.Assert(!_registry.Contains(member)); 839Debug.Assert( _userSize.GridUnitType == GridUnitType.Auto
System\Windows\Controls\Frame.cs (21)
437Debug.Assert(_ownJournalScope != null); 449Debug.Assert(_ownJournalScope == null); 491Debug.Assert(_journalOwnership == (JournalOwnership)GetValue(JournalOwnershipProperty)); 613Debug.Assert(sender == this && _ownJournalScope != null); 619Debug.Assert(sender == this && _ownJournalScope != null); 626Debug.Assert(sender == this && _ownJournalScope != null); 632Debug.Assert(sender == this && _ownJournalScope != null); 639Debug.Assert(sender == this && _ownJournalScope != null); 658Debug.Assert(sender == this && _ownJournalScope != null); 663Debug.Assert(sender == this && _ownJournalScope != null); 670Debug.Assert(sender == this && _ownJournalScope != null); 733Debug.Assert(d as Frame != null && ((Frame)d).NavigationService != null); 806Debug.Assert(canGoFwd == (bool)GetValue(CanGoForwardProperty)); 821Debug.Assert(canGoBack == (bool)GetValue(CanGoBackProperty)); 980Debug.Assert(backStack == GetValue(BackStackProperty)); 992Debug.Assert(fwdStack == GetValue(ForwardStackProperty)); 1154Debug.Assert(GetValue(BackStackProperty) == _ownJournalScope.BackStack); 1198Debug.Assert(JournalEntry.GetType().IsSerializable); 1226Debug.Assert(_journalOwnership == JournalOwnership.OwnsJournal); 1316Debug.Assert(_ownJournalScope == null ^ _journalOwnership == JournalOwnership.OwnsJournal); 1346Debug.Assert(_ownJournalScope == null ^ _journalOwnership == JournalOwnership.OwnsJournal);
System\Windows\Controls\Grid.cs (22)
466Debug.Assert(DefinitionsU.Length > 0 && DefinitionsV.Length > 0); 722Debug.Assert(DefinitionsU.Length > 0 && DefinitionsV.Length > 0); 968Debug.Assert(0 <= cell.ColumnIndex && cell.ColumnIndex < DefinitionsU.Length); 969Debug.Assert(0 <= cell.RowIndex && cell.RowIndex < DefinitionsV.Length); 1067Debug.Assert(ExtData.DefinitionsU != null && ExtData.DefinitionsU.Length > 0); 1114Debug.Assert(ExtData.DefinitionsV != null && ExtData.DefinitionsV.Length > 0); 1162Debug.Assert(false); 1427Debug.Assert(0 < count && 0 <= start && (start + count) <= definitions.Length); 1454Debug.Assert(0 < count && 0 <= start && (start + count) <= definitions.Length); 1482Debug.Assert(1 < count && 0 <= start && (start + count) <= definitions.Length); 1515Debug.Assert( minSize <= preferredSize 1546Debug.Assert(tempDefinitions[i].UserSize.IsAuto); 1555Debug.Assert(!tempDefinitions[i].UserSize.IsAuto); 1563Debug.Assert(_IsZero(sizeToDistribute)); 1583Debug.Assert(!tempDefinitions[i].UserSize.IsAuto); 1594Debug.Assert(tempDefinitions[i].UserSize.IsAuto); 1603Debug.Assert(_IsZero(sizeToDistribute)); 1624Debug.Assert( !double.IsInfinity(totalRemainingSize) 2133Debug.Assert(!definitions[i].IsShared || !definitions[i].UserSize.IsStar); 2207Debug.Assert(nonStarIndex == starDefinitionsCount); 2423Debug.Assert(!def.IsShared, "*-defs cannot be shared"); 3922Debug.Assert(grid != null);
System\Windows\Controls\GridSplitter.cs (4)
420Debug.Assert(_decorator != null); 443Debug.Assert(_decorator != null); 634Debug.Assert(_resizeData == null, "_resizeData is not null, DragCompleted was not called"); 868Debug.Assert(_resizeData != null, "_resizeData should not be null when calling MoveSplitter");
System\Windows\Controls\GridViewColumnCollection.cs (3)
140Debug.Assert(!IsImmutable, "IsImmutable is true before BlockWrite"); 149Debug.Assert(IsImmutable, "IsImmutable is flase before UnblockWrite"); 240Debug.Assert(oldIndex != newIndex, "oldIndex==newIndex when perform move action.");
System\Windows\Controls\GridViewColumnCollectionChangedEventArgs.cs (12)
44Debug.Assert(action == NotifyCollectionChangedAction.Add || action == NotifyCollectionChangedAction.Remove, 46Debug.Assert(changedItem != null, "changedItem can't be null"); 47Debug.Assert(index >= 0, "index must >= 0"); 48Debug.Assert(actualIndex >= 0, "actualIndex must >= 0"); 59Debug.Assert(newItem != null, "newItem can't be null"); 60Debug.Assert(oldItem != null, "oldItem can't be null"); 61Debug.Assert(index >= 0, "index must >= 0"); 62Debug.Assert(actualIndex >= 0, "actualIndex must >= 0"); 73Debug.Assert(changedItem != null, "changedItem can't be null"); 74Debug.Assert(index >= 0, "index must >= 0"); 75Debug.Assert(oldIndex >= 0, "oldIndex must >= 0"); 76Debug.Assert(actualIndex >= 0, "actualIndex must >= 0");
System\Windows\Controls\GridViewColumnHeader.cs (3)
420Debug.Assert(flag != Flags.None && ignoreFlag != Flags.None, "Invalid parameter dp."); 752Debug.Assert(stream != null, "stream is null"); 776Debug.Assert(gripperCursor != null, "gripper cursor is null");
System\Windows\Controls\GridViewHeaderRowPresenter.cs (15)
300Debug.Assert(_paddingHeader != null, "padding header is null"); 310Debug.Assert(_indicator != null, "_indicator is null"); 311Debug.Assert(_floatingHeader != null, "_floatingHeader is null"); 384Debug.Assert(_paddingHeader != null, "padding header is null"); 453Debug.Assert(_draggingSrcHeader != null, "_draggingSrcHeader is null"); 636Debug.Assert(column != null); 854Debug.Assert(index >= 0 && index < InternalChildren.Count, "Error index when GetVisualIndex"); 983Debug.Assert(header != null || index != -1); 1066Debug.Assert(header != null); 1075Debug.Assert(header != null); 1190Debug.Assert(header != null, "Cannot instantiate GridViewColumnHeader in AddFloatingHeader"); 1203Debug.Assert(srcHeader != null, "srcHeader is null"); 1204Debug.Assert(_floatingHeader != null, "floating header is null"); 1370Debug.Assert(index >= 0 && index < HeadersPositionList.Count, "wrong index"); 1557Debug.Assert(Columns != null, "Columns is null in OnHeaderDragCompleted");
System\Windows\Controls\GridViewRowPresenter.cs (3)
282Debug.Assert(column != null); 574Debug.Assert(column != null, "column shouldn't be null"); 654Debug.Assert(cell is TextBlock, "cells are either TextBlocks or ContentPresenters");
System\Windows\Controls\InkCanvas.cs (18)
575Debug.Assert(e.Property == InkCanvas.RightProperty || e.Property == InkCanvas.BottomProperty, 1041Debug.Assert(e != null, "EventArg can not be null"); 1260Debug.Assert(e != null, "EventArg can not be null"); 1317Debug.Assert(e != null, "EventArg can not be null"); 1371Debug.Assert(e != null, "EventArg can not be null"); 1405Debug.Assert(e != null, "EventArg can not be null"); 1436Debug.Assert(e != null, "EventArg can not be null"); 1472Debug.Assert(e != null, "EventArg can not be null"); 1548Debug.Assert(e != null, "EventArg can not be null"); 1578Debug.Assert(e != null, "EventArg can not be null"); 1612Debug.Assert(e != null, "EventArg can not be null"); 1642Debug.Assert(e != null, "EventArg can not be null"); 2268System.Diagnostics.Debug.Assert(_dynamicallySelectedStrokes.Contains(s)); 2339Debug.Assert(strokes != null 2566System.Diagnostics.Debug.Assert(object.ReferenceEquals(sender, DefaultDrawingAttributes)); 2666Debug.Assert(removeSelectedStrokes || removeSelectedElements, "At least either Strokes or Elements should be removed!"); 2705Debug.Assert(inkCanvas != null); 2778Debug.Assert(inkCanvas != null);
System\Windows\Controls\InkPresenter.cs (5)
449Debug.Assert(newStrokes != null, "Cannot set a null to InkPresenter"); 472System.Diagnostics.Debug.Assert(sender == this.Strokes); 480Debug.Assert(addedStrokes != null, "The added StrokeCollection cannot be null."); 522System.Diagnostics.Debug.Assert(stroke != null); 531System.Diagnostics.Debug.Assert(stroke != null);
System\Windows\Controls\ItemCollection.cs (17)
708Debug.Assert(_deferLevel == 0 || _collectionView == null || _deferInnerRefresh != null); 711Debug.Assert(_deferLevel != 0 || _deferInnerRefresh == null); 1547Debug.Assert(!_isInitializing); 1555Debug.Assert(_isInitializing); 1902Debug.Assert(sender == _collectionView); 1908Debug.Assert(sender == _collectionView); 1935Debug.Assert(_collectionView != null); 1946Debug.Assert(_collectionView == null || _deferInnerRefresh != null); 2171Debug.Assert(e.NewStartingIndex >= 0); 2182Debug.Assert(e.OldStartingIndex >= 0); 2190Debug.Assert(e.OldStartingIndex >= 0); 2200Debug.Assert(e.OldStartingIndex >= 0); 2280Debug.Assert(IsShapingActive, "Shaping storage not available"); 2317Debug.Assert(!value, "Shaping storage not available"); 2349Debug.Assert(IsShapingActive, "Shaping storage not available"); 2382Debug.Assert(IsShapingActive, "Shaping storage not available"); 2415Debug.Assert(IsShapingActive, "Shaping storage not available");
System\Windows\Controls\ItemContainerGenerator.cs (6)
325Debug.Assert(!_recyclableContainers.Contains(container), "trying to add a container to the collection twice"); 930Debug.Assert(item == null || ItemsControl.EqualsEx(item, target), 2205Debug.Assert(ItemsControl.EqualsEx(rib.ItemAt(rib.ContainerCount - 1), 2271Debug.Assert(!container.HasExpression(entryIndex, dp), "DataContext set by expression (unexpectedly)"); 2336Debug.Assert(!container.HasExpression(entryIndex, dp), "DataContext set by expression (unexpectedly)"); 2369Debug.Assert(ItemsControl.EqualsEx(item, ItemsInternal[index]), "Event contains the wrong index");
System\Windows\Controls\ItemsControl.cs (4)
2590Debug.Assert(ScrollHost != null, "This operation to adjust the offset along an edge is only possible when there is a ScrollHost available"); 2751Debug.Assert(direction == FocusNavigationDirection.Up || direction == FocusNavigationDirection.Down, "Can only get the first item on a page using North or South"); 3065Debug.Assert(element != viewPort && element.IsArrangeValid && parent != null, "GetElementViewportPosition called in unsupported situation"); 3131Debug.Assert(direction == FocusNavigationDirection.Up ||
System\Windows\Controls\ListBox.cs (1)
615Debug.Assert(_autoScrollTimer == null, "IsMouseCaptured went from true to true");
System\Windows\Controls\MenuItem.cs (6)
1740Debug.Assert(IsSelected, "When IsSubmenuOpen = true, IsSelected should be true as well"); 1919Debug.Assert(IsHighlighted, "MenuItem got Key.Enter but was not highlighted -- focus did not follow highlight?"); 2184Debug.Assert(Role == MenuItemRole.TopLevelHeader || Role == MenuItemRole.TopLevelItem, "MenuItem was not top-level"); 2224Debug.Assert(!parentMenu.OpenOnMouseEnter || parentMenu.IsMenuMode, "OpenOnMouseEnter can only be true when IsMenuMode is true"); 2573Debug.Assert(timer != null, "timer should not be null."); 2574Debug.Assert(!timer.IsEnabled, "timer should not be running.");
System\Windows\Controls\MultipleCopiesCollection.cs (9)
28Debug.Assert(item != null, "item should not be null."); 29Debug.Assert(count >= 0, "count should not be negative."); 49Debug.Assert( 56Debug.Assert( 63Debug.Assert( 70Debug.Assert( 115Debug.Assert(RepeatCount == newCount, "We should have properly updated the RepeatCount"); 198Debug.Assert((index >= 0) && (index < RepeatCount), "Index out of range"); 284Debug.Assert(_item != null, "_item should be non-null.");
System\Windows\Controls\Page.cs (2)
725Debug.Assert( p != null, "DependencyObject must be of type Page." ); 770Debug.Assert(_currentIws != null, "_currentIws cannot be null here. Caller should always verify it");
System\Windows\Controls\Panel.cs (9)
568Debug.Assert(_itemContainerGenerator == null, "Attempted to connect to a generator when Panel._itemContainerGenerator is non-null."); 591Debug.Assert(_itemContainerGenerator != null, "Attempted to disconnect from a generator when Panel._itemContainerGenerator is null."); 612Debug.Assert(IsItemsHost, "Should be invoked only on an ItemsHost panel"); 672Debug.Assert(_itemContainerGenerator != null, "Encountered a null _itemContainerGenerator while receiving an ItemsChanged from a generator."); 711Debug.Assert(_itemContainerGenerator != null, "Encountered a null _itemContainerGenerator while receiving an Add action from a generator."); 740Debug.Assert(itemCount == containerCount, "Panel expects Replace to affect only realized containers"); 741Debug.Assert(_itemContainerGenerator != null, "Encountered a null _itemContainerGenerator while receiving an Replace action from a generator."); 751Debug.Assert(e != null && !isNewlyRealized, "Panel expects Replace to affect only realized containers"); 770Debug.Assert(_itemContainerGenerator != null, "Encountered a null _itemContainerGenerator while receiving an Move action from a generator.");
System\Windows\Controls\PasswordTextNavigator.cs (7)
27Debug.Assert(offset >= 0 && offset <= container.SymbolCount, "Bad PasswordTextPointer offset!"); 51Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 296Debug.Assert(false); 422Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 463Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 489Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 507Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!");
System\Windows\Controls\PopupControlService.cs (3)
416Debug.Assert(_currentToolTip == null); 1609Debug.Assert(hwndSource != null && rootElement != null, "expect non-null hwndSource and rootElement"); 1611Debug.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)
148Debug.Assert(child1 != null, "First child should be non-null."); 149Debug.Assert(child2 != null, "Second child should be non-null.");
System\Windows\Controls\Primitives\CalendarItem.cs (9)
225Debug.Assert(false); 390Debug.Assert(mode != CalendarMode.Month); 462Debug.Assert(false); 544Debug.Assert(e != null); 562Debug.Assert(b != null); 919Debug.Assert(this.Owner.DisplayMode == CalendarMode.Year); 1044Debug.Assert(childButton != null); 1234Debug.Assert(childButton != null); 1281Debug.Assert(childButton != null);
System\Windows\Controls\Primitives\DataGridCellsPresenter.cs (1)
345Debug.Assert(
System\Windows\Controls\Primitives\DataGridColumnHeader.cs (6)
102Debug.Assert(column != null, "This header must have been generated with for a particular column"); 103Debug.Assert(column.Header == item, "The data item for a ColumnHeader is the Header property of a column"); 316Debug.Assert(header != null, "Header should not be null"); 456Debug.Assert(Column != null, "column can't be null if we got a notification for this property change"); 466Debug.Assert(Column != null, "column can't be null if we got a notification for this property change"); 549Debug.Assert(Column != null, "column can't be null if we got a notification for this property change");
System\Windows\Controls\Primitives\DataGridColumnHeadersPresenter.cs (11)
226Debug.Assert(column != null, "We shouldn't have generated this column header if we don't have a column."); 262Debug.Assert(HeaderCollection != null, "This is a helper method for preparing and clearing a container; if it's called we must have a valid ItemSource"); 692Debug.Assert(ParentDataGrid != null, "ParentDataGrid is null"); 739Debug.Assert(_draggingSrcColumnHeader != null, "Dragging header is null"); 753Debug.Assert(_columnHeaderDragIndicator != null, "Drag indicator is null"); 754Debug.Assert(_draggingSrcColumnHeader != null, "Dragging header is null"); 772Debug.Assert(_draggingSrcColumnHeader != null, "Dragging header is null"); 786Debug.Assert(_columnHeaderDropLocationIndicator != null, "Drag indicator is null"); 787Debug.Assert(_draggingSrcColumnHeader != null, "Dragging header is null"); 804Debug.Assert(ParentDataGrid != null, "ParentDataGrid is null"); 914Debug.Assert(ParentDataGrid != null, "ParentDataGrid is null");
System\Windows\Controls\Primitives\DataGridRowHeader.cs (1)
488Debug.Assert(stateCode != DATAGRIDROWHEADER_stateNullCode);
System\Windows\Controls\Primitives\DatePickerTextBox.cs (3)
151Debug.Assert( 164Debug.Assert(e.NewValue is bool); 191Debug.Assert(datePickerTextBox != null, "The source is not an instance of a DatePickerTextBox!");
System\Windows\Controls\Primitives\MenuBase.cs (5)
234Debug.Assert(menu.HasPushedMenuMode); 798Debug.Assert(CheckAccess(), "IsMenuMode requires context access"); 888Debug.Assert(_pushedMenuMode == null); 890Debug.Assert(_pushedMenuMode != null); 899Debug.Assert(_pushedMenuMode != null);
System\Windows\Controls\Primitives\Popup.cs (12)
176Debug.Assert(popup != null, "Popup must be non-null"); 177Debug.Assert(placementTarget != null, "Placement target must be non-null."); 207Debug.Assert(popup != null, "Popup must be non-null"); 208Debug.Assert(placementTarget != null, "Placement target must be non-null."); 884Debug.Assert(!bindTreatMousePlacementAsBottomProperty || child is ToolTip, "child must be a Tooltip to bind TreatMousePlacementAsBottomProperty"); 1108Debug.Assert( Mouse.Captured == _popupRoot, "_cacheValid[(int)CacheBits.CaptureEngaged] == true but Mouse.Captured != _popupRoot"); 1400Debug.Assert(popup != null, "popup should be non-null."); 1401Debug.Assert(child != null, "child should be non-null."); 1424Debug.Assert(child != null, "child should be non-null"); 1938Debug.Assert(CheckAccess(), "AsyncReposition not called on the dispatcher thread."); 2503Debug.Assert(i >= 0 && i < GetNumberOfCombinations(placement)); 3296Debug.Assert(!IsChildPopup || (IsChildPopup && !transparent), "Child popups cannot be transparent");
System\Windows\Controls\Primitives\ResizeGrip.cs (1)
64Debug.Assert(rg != null, "DependencyObject must be of type ResizeGrip.");
System\Windows\Controls\Primitives\ScrollContentPresenter.cs (2)
790Debug.Assert(IsScrollClient); 825Debug.Assert(IsScrollClient);
System\Windows\Controls\Primitives\Selector.cs (22)
580Debug.Assert(String.IsNullOrEmpty(path) || path == "/InnerText"); 1034Debug.Assert(CanSelectMultiple, "CanSelectMultiple should be true when calling SelectAllImpl"); 1422Debug.Assert(!SelectionChange.IsActive, "SelectionChange is already active -- use SelectionChange.Select or Unselect"); 1496Debug.Assert(!((SelectedIndex >= 0) && (_selectedItems.Count == 0)), "SelectedIndex >= 0 implies _selectedItems nonempty"); 1523Debug.Assert(IsSynchronizedWithCurrentItemPrivate); 1551Debug.Assert(IsSynchronizedWithCurrentItemPrivate); 1594Debug.Assert(SelectionChange.IsActive, "SelectionChange.IsActive should be true"); 1676Debug.Assert(SelectionChange.IsActive, "SelectionChange.IsActive should be true"); 2039Debug.Assert(SelectionChange.IsActive, "SelectionChange.IsActive should be true"); 2171Debug.Assert(String.IsNullOrEmpty(path) || path == "/InnerText"); 2270Debug.Assert(_owner.CheckAccess()); 2271Debug.Assert(!_active, SR.SelectionChangeActive); 2283Debug.Assert(_owner.CheckAccess()); 2284Debug.Assert(_active, "There must be a selection change active when you call SelectionChange.End()"); 2318Debug.Assert(_toSelect.Count <= 1, "_toSelect.Count was > 1"); 2492Debug.Assert(_owner.CheckAccess()); 2493Debug.Assert(_active, SR.SelectionChangeNotActive); 2494Debug.Assert(info != null, "parameter info should not be null"); 2549Debug.Assert(_owner.CheckAccess()); 2550Debug.Assert(_active, SR.SelectionChangeNotActive); 2551Debug.Assert(info != null, "info should not be null"); 2587Debug.Assert(_owner.CheckAccess());
System\Windows\Controls\Primitives\ToolBarOverflowPanel.cs (1)
93Debug.Assert(childrenIndex == childrenCount, "ToolBarOverflowPanel.Children count mismatch after transferring children from GeneratedItemsCollection.");
System\Windows\Controls\Primitives\ToolBarPanel.cs (4)
141Debug.Assert(children[childrenIndex] == child, "InternalChildren is out of sync with _generatedItemsCollection."); 188Debug.Assert(children[childrenIndex] == child, "InternalChildren is out of sync with _generatedItemsCollection."); 453Debug.Assert(itemCount == containerCount, "ToolBarPanel expects Replace to affect only realized containers"); 463Debug.Assert(e != null && !isNewlyRealized, "ToolBarPanel expects Replace to affect only realized containers");
System\Windows\Controls\Primitives\Track.cs (7)
130Debug.Assert(_visualChildren[itemIndex] == oldValue, "Attempt to add a 4th item into _visualChildren"); 380Debug.Assert(_visualChildren == null || _visualChildren[1] == null, "Child[1] should be null if Child[0] == null)"); 381Debug.Assert(_visualChildren == null || _visualChildren[2] == null, "Child[2] should be null if Child[0] == null)"); 386Debug.Assert(_visualChildren[2] == null, "Child[2] should be null if Child[1] == null)"); 582Debug.Assert(decreaseButtonLength >= 0.0 && decreaseButtonLength <= remainingTrackLength, "decreaseButtonLength is outside bounds"); 583Debug.Assert(increaseButtonLength >= 0.0 && increaseButtonLength <= remainingTrackLength, "increaseButtonLength is outside bounds"); 597Debug.Assert(DoubleUtil.GreaterThanOrClose(offset, 0.0), "Invalid offest (negative value).");
System\Windows\Controls\RowDefinition.cs (14)
86Debug.Assert(_items != null); 108Debug.Assert(_items != null); 148Debug.Assert( _items[i] != null 166Debug.Assert(_items[item.Index] == item); 181Debug.Assert(_items[value.Index] == value); 317Debug.Assert( _items[i] != null 326Debug.Assert( _items[i + count] != null 626Debug.Assert(value != null && value.Index == -1); 627Debug.Assert(_items[index] == null); 644Debug.Assert(value != null); 677Debug.Assert( _items[i] != null 695Debug.Assert( _items[value.Index] == value 708Debug.Assert( _items[i + 1] != null 737Debug.Assert(value >= _size);
System\Windows\Controls\ScrollViewer.cs (4)
1317Debug.Assert(!MeasureDirty); 1723Debug.Assert(_panningInfo != null); 1857Debug.Assert(_panningInfo != null); 2386Debug.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)
47Debug.Assert(_addedCells.IsReadOnly, "_addedCells should have ended up as read-only."); 48Debug.Assert(_removedCells.IsReadOnly, "_removedCells should have ended up as read-only.");
System\Windows\Controls\SelectedDatesCollection.cs (3)
409Debug.Assert(false); 427Debug.Assert(!_isAddingRange); 433Debug.Assert(_isAddingRange);
System\Windows\Controls\SoundPlayerAction.cs (2)
141Debug.Assert(m_player.IsLoadCompleted); 219Debug.Assert(m_player.IsLoadCompleted);
System\Windows\Controls\Stack.cs (2)
803Debug.Assert(measureElement.IsScrolling); 828Debug.Assert(logicalOffset == 0 || (logicalOffset > 0 && logicalOffset < children.Count));
System\Windows\Controls\TextBlock.cs (27)
1407Debug.Assert(lineCount == LineCount); 1520Debug.Assert(lineCount == LineCount); 1672Debug.Assert(lineCount == LineCount); 1776Debug.Assert(lineCount == LineCount); 1781Debug.Assert(lineIndex < lineCount); 1792Debug.Assert(lineCount == LineCount); 1794Debug.Assert(lineIndex < lineCount); 1820Debug.Assert(lineBounds.Count > 0); 1945Debug.Assert(_complexContent != null, "Inline objects are supported only in complex content."); 1975Debug.Assert(((InlineObject)inlineObjects[index]).Element == inlineObject.Element, "InlineObject cache is out of sync."); 2041Debug.Assert(lineCount == LineCount); 2185Debug.Assert(lineCount == LineCount); 2456Debug.Assert(lineIndex > 0); 2459Debug.Assert(dcp >= 0); 2474Debug.Assert(lineIndex < lineCount - 1); 2584Debug.Assert(lineIndex > 0); 2587Debug.Assert(dcp >= 0); 2944Debug.Assert(sender == _complexContent.TextContainer, "Received text change for foreign TextContainer."); 3396Debug.Assert(IsLayoutDataValid); 3397Debug.Assert(CheckFlags(Flags.RequiresAlignment)); 3415Debug.Assert(lineCount == LineCount); 3426Debug.Assert(DoubleUtil.AreClose(lineHeight, lineMetrics.Height), "Line height is out of sync."); 3589Debug.Assert(lineCount == LineCount); 3626Debug.Assert(e != null); 3629Debug.Assert(_complexContent.TextContainer is TextContainer); 3900Debug.Assert(owner != null); 3901Debug.Assert(textContainer != null);
System\Windows\Controls\TextSearch.cs (5)
293Debug.Assert(!String.IsNullOrEmpty(matchedText), "matchedText cannot be null or empty"); 294Debug.Assert(!String.IsNullOrEmpty(newText), "newText cannot be null or empty"); 295Debug.Assert(matchedText.StartsWith(newText, ignoreCase, cultureInfo), "matchedText should start with newText"); 767Debug.Assert(_attachedTo != null); 782Debug.Assert(_attachedTo != null);
System\Windows\Controls\ToolTip.cs (1)
499Debug.Assert(_parentPopup == null, "_parentPopup should be null");
System\Windows\Controls\VirtualizedCellInfoCollection.cs (30)
23Debug.Assert(owner != null, "owner must not be null."); 36Debug.Assert(owner != null, "owner must not be null."); 86Debug.Assert(IsValidCell(cell), "The cell should be valid."); 87Debug.Assert(!Contains(cell), "VirtualizedCellInfoCollection does not support duplicate items."); 470Debug.Assert(left >= 0, "left must be positive."); 471Debug.Assert(top >= 0, "top must be positive."); 472Debug.Assert(width >= 0, "width must be positive."); 473Debug.Assert(height >= 0, "height must be positive."); 490Debug.Assert(value >= 0, "Value must be positive."); 504Debug.Assert(value >= 0, "Value must be positive."); 518Debug.Assert(value >= _left, "Right must be greater than or equal to Left."); 532Debug.Assert(value >= _top, "Bottom must be greater than or equal to Top."); 546Debug.Assert(value >= 0, "Value must be positive."); 560Debug.Assert(value >= 0, "Value must be positive."); 786Debug.Assert(!IsEmpty, "Don't call GetBoundingRegion when IsEmpty is true."); 818Debug.Assert(left <= right, "left should be less than or equal to right."); 819Debug.Assert(top <= bottom, "top should be less than or equal to bottom."); 829Debug.Assert(rowCount > 0, "rowCount should be greater than 0."); 830Debug.Assert(columnCount > 0, "columnCount should be greater than 0."); 974Debug.Assert(rowIndex >= 0); 1002Debug.Assert(rowIndex >= 0); 1041Debug.Assert(rowIndex >= 0); 1057Debug.Assert(oldIndex >= 0); 1058Debug.Assert(newIndex >= 0); 1147Debug.Assert(columnIndex >= 0); 1190Debug.Assert(columnIndex >= 0); 1229Debug.Assert(columnIndex >= 0); 1248Debug.Assert(oldIndex >= 0); 1249Debug.Assert(newIndex >= 0); 1633Debug.Assert(list != null, "list should not be null.");
System\Windows\Controls\VirtualizingStackPanel.cs (75)
401Debug.Assert(!IsPixelBased && IsScrolling && 478Debug.Assert(IsScrolling, "setting offset on non-scrolling panel"); 606Debug.Assert(IsScrolling, "setting offset on non-scrolling panel"); 797Debug.Assert(AnchorOperationField.GetValue(this) == null, "There is already a pending AnchorOperation."); 829Debug.Assert(_scrollData._firstContainerInViewport != null, "Must have an anchor element"); 855Debug.Assert(AnchorOperationField.GetValue(this) != null, "anchor state is inconsistent"); 886Debug.Assert(currFirstContainerInViewport != null, "Cannot find container in viewport"); 1141Debug.Assert(!IsPixelBased || !findTopContainer, "find 'top' container only makes sense when item-scrolling"); 1698Debug.Assert(IsVirtualizing && InRecyclingMode, "We should only modify the visual order when in recycling mode"); 2388Debug.Assert(!adjustToChangeInFirstItem || foundFirstItemInViewport, "This loop should only happen twice at most"); 3695Debug.Assert(args.Action == NotifyCollectionChangedAction.Reset && args.ItemCount == 1); 3849Debug.Assert(info != null, "Expected state from previous measure not found"); 3957Debug.Assert(IsScrolling && IsVirtualizing, "Only check viewport on scrolling panel when virtualizing"); 4352Debug.Assert(retryCount >=0, "retry MeasureCaches too often"); 4509Debug.Assert(effectiveOffsetInfo.ScrollGeneration <= scrollGeneration, 4708Debug.Assert(cacheUnit != VirtualizationCacheLengthUnit.Page, "Page cacheUnit is not expected here."); 4964Debug.Assert(IsScrolling, "The scrolling panel is the only one that should extend the viewport"); 5022Debug.Assert(virtualizationInfoProvider != null, "This method should only be invoked for a virtualizing owner"); 5023Debug.Assert(cacheUnit != VirtualizationCacheLengthUnit.Page, "Page after cache size is not expected here."); 5651Debug.Assert(itemIndex < items.Count, "index out of range"); 5751Debug.Assert(IsVirtualizing, "We should only need to extend the viewport beyond the generated items when virtualizing"); 6085Debug.Assert(!containerSize.IsEmpty, "We can't estimate an empty size"); 6101Debug.Assert(!IsVSP45Compat, "this method should not be called in VSP45Compat mode"); 6169Debug.Assert(!containerSize.IsEmpty, "We can't estimate an empty size"); 6381Debug.Assert(parentItemStorageProvider != null || container != null, 6424Debug.Assert(!IsVSP45Compat, "SetItemsHostInset should not be called in VSP45-compat mode"); 6605Debug.Assert(cacheUnit != VirtualizationCacheLengthUnit.Page, "Page cacheUnit is not expected here."); 6815Debug.Assert(virtualizingChild != null, "This method should only be invoked for a virtualizing child"); 7253Debug.Assert(DoubleUtil.AreClose(pixelSizeInViewport + pixelSizeBeforeViewport + pixelSizeAfterViewport, childPixelSize.Width), "The computed sizes within and outside the viewport should add up to the childPixelSize."); 7345Debug.Assert(DoubleUtil.AreClose(pixelSizeInViewport + pixelSizeBeforeViewport + pixelSizeAfterViewport, childPixelSize.Height), "The computed sizes within and outside the viewport should add up to the childPixelSize."); 7440Debug.Assert(IsVSP45Compat, "this method should only be called in VSP45Compat mode"); 7446Debug.Assert(evaluateAreContainersUniformlySized || !computedAreContainersUniformlySized, "AreContainersUniformlySized starts off true and can only be flipped to false."); 7592Debug.Assert(!IsVSP45Compat, "this method should not be called in VSP45Compat mode"); 7598Debug.Assert(evaluateAreContainersUniformlySized || !computedAreContainersUniformlySized, "AreContainersUniformlySized starts off true and can only be flipped to false."); 7881Debug.Assert(itemStorageProvider != null || item == this, "An item storage provider must be available."); 7882Debug.Assert(item != null, "An item must be available."); 7906Debug.Assert(itemStorageProvider != null || item == this, "An item storage provider must be available."); 7907Debug.Assert(item != null, "An item must be available."); 7950Debug.Assert(itemStorageProvider != null || item == this, "An item storage provider must be available."); 7951Debug.Assert(item != null, "An item must be available."); 8008Debug.Assert(itemStorageProvider != null || item == this, "An item storage provider must be available."); 8009Debug.Assert(item != null, "An item must be available."); 8731Debug.Assert(container != null, "Null container was generated"); 8776Debug.Assert(children[visualTreeIndex] != null, "MoveVisualChild interprets a null destination as 'move to end'"); 8901Debug.Assert(!children.Contains(child), "we incorrectly identified a recycled container"); 8922Debug.Assert(child == InternalChildren[childIndex], "Wrong child was generated"); 8944Debug.Assert(args.ItemUICount == args.ItemCount, "Both ItemUICount and ItemCount should be equal or ItemUICount should be 0."); 8954Debug.Assert(child != null, "Null child was generated"); 8955Debug.Assert(!newlyRealized, "newlyRealized should be false after Replace"); 8984Debug.Assert((itemCount == itemUICount) || (itemUICount == 0), "Both ItemUICount and ItemCount should be equal or ItemUICount should be 0."); 9025Debug.Assert(IsVirtualizing, "Can't clean up containers if not virtualizing"); 9026Debug.Assert(itemsControl != null, "We can't cleanup if we aren't the itemshost"); 9171Debug.Assert(InRecyclingMode, "This method only applies to recycling mode"); 9190Debug.Assert(IsVirtualizing && InRecyclingMode, "Realized children only exist when recycling"); 9191Debug.Assert(_realizedChildren != null, "Realized children must exist to verify it"); 9204Debug.Assert(!_realizedChildren.Contains(child), "_realizedChildren should not contain recycled containers"); 9210Debug.Assert(_realizedChildren[position.Index] == child, "_realizedChildren is corrupt!"); 9222Debug.Assert(_realizedChildren.Count == children.Count, "Realized and visual children must match"); 9226Debug.Assert(_realizedChildren[i] == children[i], "Realized and visual children must match"); 9327Debug.Assert(_cleanupDelay != null); 9348Debug.Assert(_cleanupOperation != null); 9372Debug.Assert(!InRecyclingMode, "This method only applies to standard virtualization"); 9439Debug.Assert(startIndex >= 0 && count > 0); 9440Debug.Assert(children == _realizedChildren, "the given child list must be the _realizedChildren list when recycling"); 9586Debug.Assert(IsScrolling, "ScrollData must only be set on a scrolling panel."); 9713Debug.Assert(DoubleUtil.AreClose(viewportSize.Width - Math.Floor(viewportSize.Width), 0.0), "The viewport size must not contain fractional values when in item scrolling mode."); 9714Debug.Assert(DoubleUtil.AreClose(extentSize.Width - Math.Floor(extentSize.Width), 0.0), "The extent size must not contain fractional values when in item scrolling mode."); 9718Debug.Assert(DoubleUtil.AreClose(viewportSize.Height - Math.Floor(viewportSize.Height), 0.0), "The viewport size must not contain fractional values when in item scrolling mode."); 9719Debug.Assert(DoubleUtil.AreClose(extentSize.Height - Math.Floor(extentSize.Height), 0.0), "The extent size must not contain fractional values when in item scrolling mode."); 10437Debug.Assert(IsScrolling, "ScrollData must only be set on a scrolling panel."); 10562Debug.Assert(DoubleUtil.AreClose(viewportSize.Width - Math.Floor(viewportSize.Width), 0.0), "The viewport size must not contain fractional values when in item scrolling mode."); 10563Debug.Assert(DoubleUtil.AreClose(extentSize.Width - Math.Floor(extentSize.Width), 0.0), "The extent size must not contain fractional values when in item scrolling mode."); 10567Debug.Assert(DoubleUtil.AreClose(viewportSize.Height - Math.Floor(viewportSize.Height), 0.0), "The viewport size must not contain fractional values when in item scrolling mode."); 10568Debug.Assert(DoubleUtil.AreClose(extentSize.Height - Math.Floor(extentSize.Height), 0.0), "The extent size must not contain fractional values when in item scrolling mode."); 12212Debug.Assert(tracer != null, "Trace called when not tracing");
System\Windows\Controls\WebBrowser.cs (2)
537Debug.Assert(clsid.ToString("D") == CLSID.WebBrowser); 575Debug.Assert(_axIWebBrowser2 != null);
System\Windows\Data\BindingBase.cs (1)
69Debug.Assert((int)Feature.LastFeatureId <= 32, "UncommonValueTable supports only 32 Ids");
System\Windows\Data\BindingExpression.cs (1)
2117Debug.Assert(NeedsValidation, "check NeedsValidation before calling this");
System\Windows\Data\BindingExpressionBase.cs (3)
117Debug.Assert((int)Feature.LastFeatureId <= 32, "UncommonValueTable supports only 32 Ids"); 1689Debug.Assert(RootBindingExpression == this, "Only call this with a root binding"); 2500Debug.Assert((_flags & PrivateFlags.iPropagationMask) != PrivateFlags.iPropDefault,
System\Windows\Data\BindingGroup.cs (2)
1320Debug.Assert(_bindingExpressions.Count == 0, "Unexpected Reset event"); 1764Debug.Assert(bindingExpression != null, "do not ask for source value from a [Multi,Priority]Binding");
System\Windows\Data\BindingListCollectionView.cs (5)
582Debug.Assert(_newItemIndex != -2 && newItem == _newItem, "AddNew did not raise expected events"); 609Debug.Assert(_newItemIndex == -2 && _newItem == NoNewItem, "unexpected call to BeginAddNew"); 727Debug.Assert(true); 1907Debug.Assert(_newItem == InternalList[index], "unexpected item while committing AddNew"); 1966Debug.Assert(item == InternalList[index], "unexpected item while committing AddNew");
System\Windows\Data\CollectionView.cs (1)
1806Debug.Assert(changeLog != null && changeLog.Count > 0, "don't defer when there's no work");
System\Windows\Data\ListCollectionView.cs (5)
768Debug.Assert(_newItemIndex != -2 && System.Windows.Controls.ItemsControl.EqualsEx(newItem, _newItem), "AddNew did not raise expected events"); 787Debug.Assert(_newItemIndex == -2 && _newItem == NoNewItem, "unexpected call to BeginAddNew"); 2434Debug.Assert(view != null, "lazyGetCollectionView should not return null"); 3116Debug.Assert(list.VerifyLiveSorting(lsi), "live sorting failed"); 3126Debug.Assert(list.VerifyLiveSorting(null), "live sorting not resotred");
System\Windows\Data\MultiBindingExpression.cs (2)
176Debug.Assert(ParentMultiBinding.Converter != null || !String.IsNullOrEmpty(EffectiveStringFormat), 868Debug.Assert(NeedsValidation, "check NeedsValidation before calling this");
System\Windows\Data\ObjectDataProvider.cs (4)
158Debug.Assert((_objectInstance == null) ? (_objectType == null) : (_objectType == _objectInstance.GetType())); 345Debug.Assert(_mode != SourceMode.FromType); 438Debug.Assert(_objectType != null); 508Debug.Assert(_objectType != null);
System\Windows\Data\PriorityBindingExpression.cs (2)
186Debug.Assert(MutableBindingExpressions.Count == 0, "expect to encounter empty BindingExpression collection when attaching MultiBinding"); 440Debug.Assert(NeedsValidation, "check NeedsValidation before calling this");
System\Windows\Data\RelativeSource.cs (3)
170Debug.Assert(_mode == RelativeSourceMode.FindAncestor); 208Debug.Assert((!IsUninitialized) || (_mode == RelativeSourceMode.FindAncestor)); 272Debug.Assert(IsUninitialized);
System\Windows\Data\XmlDataProvider.cs (2)
279Debug.Assert(_domSetDocument == null, "Should not be possible to be using Source and user-set Doc at the same time."); 760Debug.Assert(doc != null);
System\Windows\DataTrigger.cs (1)
187Debug.Assert( TriggerConditions != null && TriggerConditions.Length == 1,
System\Windows\DescendentsWalker.cs (1)
93Debug.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)
375Debug.Assert(result.Dictionary == null || result.Dictionary == rd, 416Debug.Assert(Object.Equals(result.Requester, requester), "Reverting a request for the wrong requester"); 425Debug.Assert(result.Dictionary != null, "simple lookup resolved incorrectly"); 452Debug.Assert(cachedDict == result.Dictionary, "conflicting dictionaries for a StaticResource reference"); 460Debug.Assert(cachedDict != null, "no dictionary found for StaticResource reference");
System\Windows\Documents\AdornerLayer.cs (5)
419Debug.Assert(adornerInfos != null, "No adorners found for element in AdornerLayer._zOrderMap"); 454Debug.Assert(adornerInfos != null, "No adorners found for element in AdornerLayer._zOrderMap"); 532Debug.Assert(adornerInfo != null, "Adorner should not be null"); 637Debug.Assert(adorner != null); 709Debug.Assert(element != null);
System\Windows\Documents\ChildDocumentBlock.cs (4)
46Debug.Assert(childContainer != null); 53Debug.Assert(docRef != null); 71Debug.Assert(newBlock != null); 123Debug.Assert(ChildContainer.Highlights.GetLayer(typeof(TextSelection)) == null);
System\Windows\Documents\ColumnResizeAdorner.cs (2)
32Debug.Assert(scope != null); 132Debug.Assert(_adornerLayer == null, "Attempt to overwrite existing AdornerLayer!");
System\Windows\Documents\CompositionAdorner.cs (4)
55Debug.Assert(textView != null && textView.RenderScope != null); 362Debug.Assert(_adornerLayer == null, "Attempt to overwrite existing AdornerLayer!"); 584Debug.Assert(start.CompareTo(startLinePointer) <= 0, "The start pointer is positioned after the composition start line pointer!"); 607Debug.Assert(endLinePointer.CompareTo(textSegment.End) == 0, "The end line pointer is positioned after the composition text range end pointer!");
System\Windows\Documents\DocumentSequence.cs (9)
251Debug.Assert(innerDP != null); 272Debug.Assert(innerDP != null); 552Debug.Assert(docRef != null); 559Debug.Assert(paginator != null); 567Debug.Assert(paginator != null); 1051Debug.Assert(documentSequence != null); 1052Debug.Assert(documentPaginator != null); 1053Debug.Assert(documentPage != null); 1161Debug.Assert(false);
System\Windows\Documents\DocumentSequenceHighlightLayer.cs (1)
74Debug.Assert(ranges.Count > 0);
System\Windows\Documents\DocumentSequenceTextContainer.cs (12)
28Debug.Assert(parent != null); 29Debug.Assert(parent is FixedDocumentSequence); 216Debug.Assert(_start != null); 229Debug.Assert(_end != null); 380Debug.Assert(docRef != null); 496Debug.Assert(_parent != null); 644Debug.Assert(sender != null); 645Debug.Assert(args != null); 646Debug.Assert(args.Ranges != null); 695Debug.Assert(args.Ranges.Count > 0 && args.Ranges[0].Start.CompareTo(args.Ranges[0].End) < 0); 989Debug.Assert(parentTextPointer != null); 1012Debug.Assert(parentChangePosition != null);
System\Windows\Documents\DocumentSequenceTextPointer.cs (11)
29Debug.Assert(childBlock != null); 30Debug.Assert(childPosition != null); 48Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 443Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 472Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 492Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 559Debug.Assert(_childTp != null); 887Debug.Assert(direction == LogicalDirection.Backward); 932Debug.Assert(tp != null); 944Debug.Assert(thisTp.ChildBlock.ChildContainer == tp.ChildBlock.ChildContainer); 988Debug.Assert(xGapAwareCompareTo(tp1, tp2) <= 0);
System\Windows\Documents\FixedDocument.cs (11)
338Debug.Assert(page != null); 654Debug.Assert(IsValidPageIndex(index)); 700Debug.Assert(fp != null); 1030Debug.Assert(sender != null); 1031Debug.Assert(args != null); 1032Debug.Assert(args.Ranges != null); 1035Debug.Assert(args.Ranges.Count > 0 && args.Ranges[0].Start.CompareTo(args.Ranges[0].End) < 0); 1103Debug.Assert(!highlightTransitionPosition.IsNull, "Highlight start not followed by highlight end!"); 1119Debug.Assert(!highlightTransitionPosition.IsNull, "Highlight start not followed by highlight end!"); 1161Debug.Assert(pageNo >= 0 && pageNo<PageCount); 1350Debug.Assert(panel != null && page != null);
System\Windows\Documents\FixedElement.cs (3)
132Debug.Assert((object)_start == (object)_end); 190Debug.Assert(_object == null && e._type == ElementType.Object); 257Debug.Assert(false);
System\Windows\Documents\FixedFindEngine.cs (13)
34Debug.Assert(start != null); 35Debug.Assert(end != null); 36Debug.Assert( ((start is DocumentSequenceTextPointer) && (end is DocumentSequenceTextPointer)) || 38Debug.Assert(findPattern != null); 47Debug.Assert(paginator != null); 84Debug.Assert(firstSearchPageStart != null); 85Debug.Assert(firstSearchPageEnd != null); 119Debug.Assert(fixedDoc != null); 305Debug.Assert(endAsFTP != null); 325Debug.Assert(startAsFTP != null); 336Debug.Assert(doc != null); 337Debug.Assert(translatedPageNo >= 0 && translatedPageNo < doc.PageCount); 362Debug.Assert(pageStream != null);
System\Windows\Documents\FixedFlowMap.cs (2)
129Debug.Assert(fp >= 0 && fp < _flowOrder.Count); 161Debug.Assert(flowOld.Type == FlowNodeType.Virtual || flowNew != null);
System\Windows\Documents\FixedHighlight.cs (3)
37Debug.Assert(element != null && beginOffset >= 0 && endOffset >= 0); 137Debug.Assert(_gBeginOffset >= 0); 138Debug.Assert(_gEndOffset <= chrct);
System\Windows\Documents\FixedNode.cs (5)
78Debug.Assert(childLevels >= 1); 94Debug.Assert(childPath != null); 132Debug.Assert(path != null && path.Length >= 2); // At least a page index and an element index 339Debug.Assert(level < _path.Length); 350Debug.Assert(_path.Length >= 2);
System\Windows\Documents\FixedPage.cs (5)
605Debug.Assert(dpo != null, "GetLinkUri shouldn't be called for non-DependencyObjects."); 856Debug.Assert(e != null); 892Debug.Assert(currentLevelIndex >= 0 && currentLevelIndex <= ((Canvas)element).Children.Count); 1023Debug.Assert(currentChildrens != null); 1165Debug.Assert(pageStructure != null);
System\Windows\Documents\FixedPageStructure.cs (13)
34Debug.Assert(pageIndex >= 0); 98Debug.Assert(lineResult != null); 110Debug.Assert(_lineResults != null); 148Debug.Assert(_lineResults != null); 202Debug.Assert(flowStart != null && flowStart.Type != FlowNodeType.Virtual); 203Debug.Assert(flowEnd != null && flowEnd.Type != FlowNodeType.Virtual); 212Debug.Assert(!rect.IsEmpty); 466Debug.Assert(false); 530Debug.Assert(glyphs!= null); 546Debug.Assert(false); 617Debug.Assert(false); 634Debug.Assert(false); 672Debug.Assert(_fixedSOMPageConstructor != null);
System\Windows\Documents\FixedSOMContainer.cs (7)
33Debug.Assert(compared != null); 34Debug.Assert(This != null); 42Debug.Assert(compareHor != SpatialComparison.None); 43Debug.Assert(compareVer != SpatialComparison.None); 98Debug.Assert(false); 105Debug.Assert(false); 219Debug.Assert(container != null);
System\Windows\Documents\FixedSOMFixedBlock.cs (1)
158Debug.Assert(SemanticBoxes[i] is FixedSOMTextRun || SemanticBoxes[i] is FixedSOMImage);
System\Windows\Documents\FixedSOMGroup.cs (5)
35Debug.Assert(compared != null); 46Debug.Assert(compareHor != SpatialComparison.None); 47Debug.Assert(compareVer != SpatialComparison.None); 97Debug.Assert(false); 104Debug.Assert(false);
System\Windows\Documents\FixedSOMImage.cs (1)
67Debug.Assert(path.Fill is ImageBrush);
System\Windows\Documents\FixedSOMLineCollection.cs (2)
53Debug.Assert(point1.X == point2.X); 59Debug.Assert(point1.Y == point2.Y);
System\Windows\Documents\FixedSOMPageConstructor.cs (11)
53Debug.Assert(stroke || fill, "should not be a nop"); 221Debug.Assert(fixedPage != null); 237Debug.Assert(_fixedPage != null); 242Debug.Assert(obj != null); 370Debug.Assert(obj is Image || obj is Path); 399Debug.Assert(glyphs != null); 573Debug.Assert (fixedBlock.SemanticBoxes.Count > 0); 628Debug.Assert(textRunRect.Height != 0 && fixedBlock.LineHeight != 0); 1006Debug.Assert(false); 1133Debug.Assert(currentPageElement != null); 1143Debug.Assert(nextPageElement != null);
System\Windows\Documents\FixedSOMSemanticBox.cs (3)
90Debug.Assert(o != null); 100Debug.Assert(compareHor != SpatialComparison.None && compareVer != SpatialComparison.None); 296Debug.Assert(false);
System\Windows\Documents\FixedSOMTable.cs (2)
163Debug.Assert(row != null); 179Debug.Assert(row != null);
System\Windows\Documents\FixedSOMTextRun.cs (1)
38Debug.Assert(otherRun != null);
System\Windows\Documents\FixedTextBuilder.cs (24)
180Debug.Assert(!_IsBoundaryPage(pageIndex)); 197Debug.Assert(page != null); 198Debug.Assert(page.IsInitialized); 367Debug.Assert(fn.Type == FlowNodeType.Start); 457Debug.Assert(pStart.CompareTo(pEnd) < 0); 496Debug.Assert(fixes.Length == 1); 572Debug.Assert(flowNode.Type == FlowNodeType.Run); 576Debug.Assert(flowNode.Type == FlowNodeType.Run); 577Debug.Assert(fixes != null); 790Debug.Assert(pathPrefix != null); 813Debug.Assert(prevRun != null); 814Debug.Assert(currentRun != null); 988Debug.Assert(pathPrefix == null); 989Debug.Assert(level1Index >= 0); 999Debug.Assert(newPathPrefix != null); 1005Debug.Assert(pathPrefix == null && newPathPrefix == null); 1069Debug.Assert(false); 1272Debug.Assert(false); 1295Debug.Assert(e is Image); 1392Debug.Assert(elem is FixedPage || elem is Canvas); 1542Debug.Assert(false); 1656Debug.Assert(run.EndIndex - run.StartIndex == run.Text.Length); 1732Debug.Assert(uiElement != null); 1753Debug.Assert(newLineResult != null);
System\Windows\Documents\FixedTextContainer.cs (8)
33Debug.Assert(parent != null && parent is FixedDocument); 185Debug.Assert(_start != null); 198Debug.Assert(_end != null); 376Debug.Assert(res); 392Debug.Assert(highlights != null); 510Debug.Assert(_fixedTextBuilder != null); 519Debug.Assert(_containerElement != null); 601Debug.Assert(start.CompareTo(end) <= 0);
System\Windows\Documents\FixedTextPointer.cs (5)
377Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 380Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 410Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 421Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 671Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!");
System\Windows\Documents\FixedTextView.cs (12)
112Debug.Assert(pos != null); 160Debug.Assert(ftp != null); 234Debug.Assert(startPosition != null && this.Contains(startPosition)); 235Debug.Assert(endPosition != null && this.Contains(endPosition)); 401Debug.Assert(pos != null); 459Debug.Assert(false); 850 Debug.Assert(itp != null); 948Debug.Assert(hitGlyphs != null); 1000Debug.Assert(charStart - charCount == 1); 1011Debug.Assert(charEnd - charCount == 1); 1118Debug.Assert(symbolType == TextPointerContext.Text || symbolType == TextPointerContext.EmbeddedElement); 1189Debug.Assert(!textPointer.IsFrozen, "Can't reposition a frozen pointer!");
System\Windows\Documents\FlowNode.cs (2)
50Debug.Assert( (type != FlowNodeType.Run) || ((int)cookie != 0)); 95Debug.Assert(_fp != fn._fp || (_fp == fn._fp) && (_scopeId == fn._scopeId));
System\Windows\Documents\FlowPosition.cs (12)
37Debug.Assert(!FlowNode.IsNull(node)); 126Debug.Assert(flow != null); 173Debug.Assert(dir == LogicalDirection.Forward || dir == LogicalDirection.Backward); 181Debug.Assert(GetPointerContext(dir) == TextPointerContext.Text); 198Debug.Assert(GetPointerContext(dir) == TextPointerContext.Text); 239Debug.Assert(type == FlowNodeType.Object || type == FlowNodeType.Noop || type == FlowNodeType.Start || type == FlowNodeType.End); 370Debug.Assert(this._OverlapAwareCompare(pEnd) < 0); 423Debug.Assert(dir == LogicalDirection.Backward); 581Debug.Assert(dir == LogicalDirection.Backward); 631Debug.Assert(dir == LogicalDirection.Backward); 721Debug.Assert(flow != null); 749Debug.Assert(this._flowNode.Equals(flow._flowNode));
System\Windows\Documents\Glyphs.cs (4)
62Debug.Assert(_glyphRunProperties != null); 226Debug.Assert(glyphRunProperties.glyphIndices != null); 250Debug.Assert(0 <= nibble && nibble <= 15); 324Debug.Assert(parsedGlyphs.Count == glyphCount);
System\Windows\Documents\HighlightVisual.cs (4)
165Debug.Assert(highlights != null); 236Debug.Assert(bg != null); 242Debug.Assert(highlightGeometry != null); 260Debug.Assert(highlightGeometry != null);
System\Windows\Documents\Hyperlink.cs (1)
560Debug.Assert(targetUri != null);
System\Windows\Documents\ImmComposition.cs (3)
287Debug.Assert(oldSource == null || newSource == null, 295Debug.Assert((oldSource == null) || (oldSource == _source)); 315Debug.Assert(newSource == _source);
System\Windows\Documents\NullTextContainer.cs (2)
178Debug.Assert(_start != null); 191Debug.Assert(_end != null);
System\Windows\Documents\NullTextNavigator.cs (11)
44Debug.Assert(position is NullTextPointer || position is NullTextPointer); 60Debug.Assert(position is NullTextPointer || position is NullTextPointer); 193Debug.Assert(distance == 0); 222Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 232Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 244Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 246Debug.Assert(distance == 0, "Single possible position in this empty container"); 256Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 266Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 310Debug.Assert(false); // must never call this 318Debug.Assert(false); // must never call this
System\Windows\Documents\PageContentAsyncResult.cs (2)
50Debug.Assert(source == null || source.IsAbsoluteUri); 89get { Debug.Assert(false); return null; }
System\Windows\Documents\RtfToXamlLexer.cs (1)
421Debug.Assert(false);
System\Windows\Documents\RtfToXamlReader.cs (39)
2710Debug.Assert(HasBorder); 5140Debug.Assert(dnRow != null); // Need row 5141Debug.Assert(dnRow != null && !dnRow.IsPending); // Row props attached when row is closed 5142Debug.Assert(dnRow != null && dnRow.FormatState.RowFormat != null); 5571Debug.Assert(Type == DocumentNodeType.dnTable); 5904Debug.Assert(value >= 0); 5905Debug.Assert(!IsPending); 5966Debug.Assert(value == null || !value.IsPending); 6235Debug.Assert(nUnfilledRowIndex != 0); 6327Debug.Assert(nStart + nChild < Count); 6413Debug.Assert(Count == 0 || (nStart >= 0 && nStart < Count)); 6424Debug.Assert(nStart + nChild < Count); 6442Debug.Assert(nAt + dn.ChildCount <= nEnd); 6443Debug.Assert(!dn.IsTerminated); 6452Debug.Assert(dnChild.ChildCount == 0 && dnChild.IsTerminated); 6474Debug.Assert(Count == 0 || (nStart >= 0 && nStart < Count)); 6485Debug.Assert(nStart + nChild < Count); 6503Debug.Assert(nAt + dn.ChildCount <= nEnd); 6504Debug.Assert(!dn.IsTerminated); 6516Debug.Assert(dnChild.ChildCount == 0 && dnChild.IsTerminated); 6541Debug.Assert(Count == 0 || (index >= 0 && index < Count)); 6542Debug.Assert(index + nChildCount < Count); 6571Debug.Assert(Count == 0 || (index >= 0 && index < Count)); 6613Debug.Assert(EntryAt(i).ClosedParent != null); 6616Debug.Assert(nAt + dn.ChildCount < Count); 6620Debug.Assert(dnPa.IsPending || (nAt > dnPa.Index && nAt <= dnPa.Index + dnPa.ChildCount)); 6638Debug.Assert(dnPa != null && dnPa.Type == DocumentNodeType.dnTable); 6641Debug.Assert(dnPa != null && dnPa.Type == DocumentNodeType.dnTableBody); 6644Debug.Assert(dnPa != null && dnPa.Type == DocumentNodeType.dnRow); 6647Debug.Assert(dnPa != null && dnPa.Type == DocumentNodeType.dnList); 6914Debug.Assert(false); 7091Debug.Assert(_fMain); 7138Debug.Assert(dnPa.LastChildIndex >= nAt + nExcise - 1); 8218Debug.Assert(dn.ChildCount == 0); 8246Debug.Assert(dn.ChildCount == 0); 9881Debug.Assert(nInsertAt >= 0 && nChildren > 0 && nInsertAt + nChildren - 1 < dna.Count); 10975Debug.Assert(dna.Count > 0 && dna.EntryAt(dna.Count - 1).Type == DocumentNodeType.dnParagraph); 11190Debug.Assert(!dnPara.IsTerminated); 11410Debug.Assert(!dnTop.IsTerminated);
System\Windows\Documents\RubberbandSelector.cs (2)
311Debug.Assert(range.first != null && range.second != null); 466Debug.Assert(end >= begin);
System\Windows\Documents\Table.cs (2)
412Debug.Assert(table != null); 464Debug.Assert(_currentChildType != ChildrenTypes.BeforeFirst);
System\Windows\Documents\TableCell.cs (1)
386Debug.Assert(value >= -1 && _parentIndex != value);
System\Windows\Documents\TableColumn.cs (1)
164Debug.Assert (value >= -1 && _parentIndex != value);
System\Windows\Documents\TableRow.cs (5)
184Debug.Assert(rowSpanVector != null); 211Debug.Assert(i <= firstAvailableIndex); 231Debug.Assert(_spannedCells != null); 241Debug.Assert(_cells.Count <= _formatCellCount); 297Debug.Assert(value >= -1 && _parentIndex != value);
System\Windows\Documents\TableRowGroup.cs (1)
235Debug.Assert(value >= -1 && _parentIndex != value);
System\Windows\Documents\TextServicesHost.cs (7)
61Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "OnRegisterTextStore must be called on STA thread"); 247Debug.Assert(_registeredtextstorecount > 0, "Overrelease TextStore!"); 265Debug.Assert(CheckAccess(), "OnDispatcherShutdownFinished called on bad thread!"); 266Debug.Assert(!_isDispatcherShutdownFinished, "Was this dispather finished???"); 294Debug.Assert(CheckAccess(), "RegisterTextStore called on bad thread!"); 299Debug.Assert(!_isDispatcherShutdownFinished, "Was this dispather finished?"); 300Debug.Assert(_registeredtextstorecount == 0, "TextStore was registered without ThreadMgr?");
System\Windows\Documents\TextStore.cs (1)
4797Debug.Assert(tracer != null, "Trace called when not tracing");
System\Windows\Documents\XamlToRtfWriter.cs (3)
230Debug.Assert(openLists.Count > 0); 404Debug.Assert(openLists.Count > 0); 435Debug.Assert(openLists.Count > 0);
System\Windows\EventTrigger.cs (1)
305Debug.Assert( eventTrigger._routedEventHandler == null && eventTrigger._source == null);
System\Windows\FrameworkContentElement.cs (7)
627Debug.Assert(entry.Value == DependencyProperty.UnsetValue); 1461Debug.Assert((uint)InternalFlags.InheritanceBehavior0 == 0x08); 1462Debug.Assert((uint)InternalFlags.InheritanceBehavior1 == 0x10); 1463Debug.Assert((uint)InternalFlags.InheritanceBehavior2 == 0x20); 1476Debug.Assert((uint)InternalFlags.InheritanceBehavior0 == 0x08); 1477Debug.Assert((uint)InternalFlags.InheritanceBehavior1 == 0x10); 1478Debug.Assert((uint)InternalFlags.InheritanceBehavior2 == 0x20);
System\Windows\FrameworkContextData.cs (1)
62Debug.Assert((walkerEntry.Data == data) && (walkerEntry.Walker == walker),
System\Windows\FrameworkElement.cs (19)
1166Debug.Assert(startNode.IsValid || unlinkedParent != null, 1377Debug.Assert(fo.IsValid, 1466Debug.Assert(target != null, "Don't call FindTemplateResource with a null target object"); 1472Debug.Assert(fo.IsValid, "Don't call FindTemplateResource with a target object that is neither a FrameworkElement nor a FrameworkContentElement"); 1910Debug.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."); 1922Debug.Assert( IsTemplatedParentAnFE ); 2334Debug.Assert( foTemplatedParent.IsFE ); 2341Debug.Assert(templatedParentTemplate != null , 2529Debug.Assert(fceParent == null, "Nearest framework parent via the visual tree has to be an FE. It cannot be an FCE"); 2599Debug.Assert((uint)InternalFlags.InheritanceBehavior0 == 0x08); 2600Debug.Assert((uint)InternalFlags.InheritanceBehavior1 == 0x10); 2601Debug.Assert((uint)InternalFlags.InheritanceBehavior2 == 0x20); 2614Debug.Assert((uint)InternalFlags.InheritanceBehavior0 == 0x08); 2615Debug.Assert((uint)InternalFlags.InheritanceBehavior1 == 0x10); 2616Debug.Assert((uint)InternalFlags.InheritanceBehavior2 == 0x20); 2973Debug.Assert(fe != null || fce != null); 3015Debug.Assert( feTemplatedParent != null ); 4083Debug.Assert(sourceTransform != null); 4092Debug.Assert(_transform != null);
System\Windows\FrameworkElementFactory.cs (5)
681Debug.Assert( treeNodeFO.IsValid || (treeNodeVisual3D != null), 714Debug.Assert( _frameworkTemplate != null ); 790Debug.Assert( _frameworkTemplate != null ); 1172Debug.Assert(_frameworkTemplate != null, "ContentPresenter is an FE and can only have a FrameworkTemplate"); 1215Debug.Assert(_frameworkTemplate != null, "GridViewRowPresenter is an FE and can only have a FrameworkTemplate");
System\Windows\FrameworkTemplate.cs (5)
57Debug.Assert(templatedParent != null, 432Debug.Assert(!_sealed, "call this method before template is sealed"); 757Debug.Assert(fo.TemplatedParent == templatedParent); 954Debug.Assert(templateReader != null, "PlayXaml returned null"); 1126Debug.Assert(!(rootElement is FrameworkElement) ||
System\Windows\Generated\FrameworkContentElement.cs (1)
1159Debug.Assert(value == true,
System\Windows\Generated\FrameworkElement.cs (1)
1196Debug.Assert(value == true,
System\Windows\Input\Command\CommandConverter.cs (2)
806System.Diagnostics.Debug.Assert( propertyInfo == null, "KnownCommand isn't known to CommandConverter.GetKnownCommand" ); 809System.Diagnostics.Debug.Assert( fieldInfo == null, "KnownCommand isn't known to CommandConverter.GetKnownCommand" );
System\Windows\Input\KeyboardNavigation.cs (20)
494Debug.Assert(adornedElement != null, "adornedElement should not be null"); 495Debug.Assert(focusVisualStyle != null, "focusVisual should not be null"); 511Debug.Assert(adornedElement != null, "adornedElement should not be null"); 512Debug.Assert(adornedElementParent != null, "adornedElementParent should not be null"); 513Debug.Assert(contentHostParent != null, "contentHostParent should not be null"); 514Debug.Assert(contentHostParent is Visual, "contentHostParent should be Visual"); 515Debug.Assert(focusVisualStyle != null, "focusVisual should not be null"); 977Debug.Assert(currentElement != null, "currentElement should not be null"); 1337Debug.Assert(container != null, "container cannot be null"); 1788Debug.Assert(e != null, "e should not be null"); 1789Debug.Assert(container != null, "container should not be null"); 1867Debug.Assert(e != null, "e cannot be null"); 2081Debug.Assert(container != null, "container should not be null"); 2117Debug.Assert(IsTabStopOrGroup(nextTabElement), "nextTabElement should be IsTabStop or group"); 2256Debug.Assert(e != null || container != null, "e or container should not be null"); 2635Debug.Assert(sourceElement != null, "sourceElement must not be null"); 2885Debug.Assert(!(sourceElement == null && container == null), "Both sourceElement and container cannot be null"); 2890Debug.Assert(container != null, "container cannot be null"); 3102Debug.Assert(DoubleUtil.GreaterThanOrClose(rangeEnd1, rangeStart1)); 3103Debug.Assert(DoubleUtil.GreaterThanOrClose(rangeEnd2, rangeStart2));
System\Windows\Interop\ActiveXHost.cs (21)
214Debug.Assert(args.Key.Length > 0, "got an empty access key"); 406Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Loaded, "Failed transition"); 411Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Running, "Failed transition"); 416Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.InPlaceActive, "Failed transition"); 421Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.UIActive, "Failed transition"); 462Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.InPlaceActive, "Failed transition"); 467Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Running, "Failed transition"); 472Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Loaded, "Failed transition"); 477Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Passive, "Failed transition"); 548Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Passive, "Wrong start state to transition from"); 553Debug.Assert(_axInstance == null, "_axInstance must be null"); 556Debug.Assert(_axInstance != null, "w/o an exception being thrown we must have an object..."); 571Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Loaded, "Wrong start state to transition from"); 605Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Loaded, "Wrong start state to transition from"); 630Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Running, "Wrong start state to transition from"); 647Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Running, "Wrong start state to transition from"); 674Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.InPlaceActive, "Wrong start state to transition from"); 689Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.InPlaceActive, "Wrong start state to transition from"); 702Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.UIActive, "Wrong start state to transition from"); 706Debug.Assert(NativeMethods.Succeeded(hr), "Failed in IOleInPlaceObject.UiDeactivate"); 938Debug.Assert(_axInstance != null, "The native control is null");
System\Windows\Interop\HwndHost.cs (1)
974Debug.Assert(hwnd != null);
System\Windows\Interop\WindowInteropHelper.cs (2)
70Debug.Assert(_window != null, "Cannot be null since we verify in the constructor"); 75Debug.Assert(_window != null, "Cannot be null since we verify in the constructor");
System\Windows\Localization.cs (1)
115Debug.Assert(property == AttributesProperty);
System\Windows\LogicalTreeHelper.cs (1)
405Debug.Assert(parentFE != null || parentFCE != null, "Either parentFE or parentFCE should be non-null");
System\Windows\Markup\Baml2006\Baml2006KeyRecord.cs (1)
66Debug.Assert(StaticResources[StaticResources.Count - 1] is StaticResource);
System\Windows\Markup\Baml2006\Baml2006Reader.cs (5)
1532Debug.Assert(dataByteSize == 1); 1672Debug.Assert(ownerType != null); 1960Debug.Assert(sr != null); 2113Debug.Assert(_context.CurrentFrame.XamlType != null, "BAML Xmlns record is only legal between ElementStart and ElementEnd"); 2584Debug.Assert(property.Type.UnderlyingType == typeof(DependencyProperty));
System\Windows\Markup\Baml2006\Baml2006SchemaContext.cs (1)
182Debug.Assert(wpfMember.DependencyProperty != null);
System\Windows\Markup\Baml2006\SharedStream.cs (1)
288System.Diagnostics.Debug.Assert(_baseStream != null, "Stream has already been disposed");
System\Windows\Markup\Baml2006\WpfSharedBamlSchemaContext.cs (2)
133Debug.Assert(bamlType != null); 163Debug.Assert(bamlMember != null);
System\Windows\Markup\Baml2006\WpfXamlMember.cs (1)
128Debug.Assert(!IsAttachable && !IsEvent);
System\Windows\Markup\BamlMapTable.cs (21)
61Debug.Assert(null != xamlTypeMapper); 149Debug.Assert(cmp > 0); 255Debug.Assert(type.IsEnum); 260Debug.Assert(ReflectionHelper.IsNullableType(type)); 537Debug.Assert(propType.IsEnum); 548Debug.Assert(ReflectionHelper.IsNullableType(propType)); 606Debug.Assert(-id <= _knownStrings.Length); 611Debug.Assert(id < StringIdMap.Count); 803Debug.Assert(attributeId >= 0, "Known Property Id must be a DependencyProperty."); 842Debug.Assert(memberId < 0); 1004Debug.Assert(assemblyFullName.Length != 0, "empty assembly"); 1078Debug.Assert( 1091Debug.Assert(bamlAssemblyInfoRecord.AssemblyId >= 0); 1102Debug.Assert(AssemblyIdMap.Count == record.AssemblyId || record.AssemblyFullName == AssemblyIdMap[record.AssemblyId].AssemblyFullName); 1256Debug.Assert(TypeIdMap.Count == record.TypeId || record.TypeFullName == TypeIdMap[record.TypeId].TypeFullName); 1271Debug.Assert(ownerTypeName != null); 1272Debug.Assert(attributeName != null); 1457Debug.Assert(GetHashTableData(stringValue) == null, 1492Debug.Assert(targetType != null && memberName != null); 1635Debug.Assert(AttributeIdMap.Count == record.AttributeId || record.Name == AttributeIdMap[record.AttributeId].Name); 1649Debug.Assert(StringIdMap.Count == record.StringId || record.Value == StringIdMap[record.StringId].Value);
System\Windows\Markup\BamlReader.cs (2)
1393Debug.Assert(dictKey != null, "Bad Key record"); 1426Debug.Assert(keyStartRecord != null, "Bad Key Element Start record");
System\Windows\Markup\BamlRecordReader.cs (44)
91Debug.Assert(null != bamlStream); 92Debug.Assert(null != parserContext && null != parserContext.XamlTypeMapper); 117Debug.Assert(null != parserContext && null != parserContext.XamlTypeMapper); 226Debug.Assert(!XamlReaderStream.IsWriteComplete, 326Debug.Assert(bamlRecord.RecordType == BamlRecordType.LinePosition); 509Debug.Assert( stackDepth == ReaderContextStack.Count ); 525Debug.Assert(bamlConnectionIdRecord.ConnectionId > 0); 537Debug.Assert(0 == ReaderContextStack.Count); // if not zero we missed an EndElement 621Debug.Assert(false); 710Debug.Assert(ReaderFlags.DependencyObject == CurrentContext.ContextType); 792Debug.Assert(ReaderFlags.DependencyObject == CurrentContext.ContextType || 997Debug.Assert(_rootElement != null); 1047Debug.Assert(null == ParentContext); 1200Debug.Assert(!CurrentContext.CheckFlag(ReaderFlags.NeedToAddToTree), "Failed to add Element to tree before popping stack"); 1214Debug.Assert( CurrentContext.ContextType != ReaderFlags.PropertyComplexClr ); 1215Debug.Assert( CurrentContext.ContextType != ReaderFlags.PropertyComplexDP ); 1267Debug.Assert(CurrentContext.ContextType == ReaderFlags.ConstructorParams); 1297Debug.Assert(parent is DependencyObject); 1416Debug.Assert(param is String); 1459Debug.Assert(paramString != null); 1497Debug.Assert(param != null && paramList == null, "Must have a single param"); 1511Debug.Assert(param == null && paramList != null, "Must have a paramList"); 1885Debug.Assert(staticResourceValues != null, "Must have a list of StaticResourceValues for lookup"); 1958Debug.Assert(staticResourceValues != null, "Must have a list of StaticResourceValues for lookup"); 2095Debug.Assert(serializerTypeId == (short)KnownElements.DependencyPropertyConverter); 2226Debug.Assert(element is DependencyObject, "Guaranteed by PropertyDefinition constructor"); 2522Debug.Assert(o is DependencyObject); 2696Debug.Assert( attributeUsage == BamlAttributeUsage.XmlSpace, 2738Debug.Assert(element is DependencyObject); 2971Debug.Assert(!holder.ReadOnly); // this is being checked in XamlReaderHelper, just assert 2996Debug.Assert(arrayExt != null); 3115Debug.Assert (holder.Collection == null); 3434Debug.Assert( CurrentContext.ObjectData == null && CurrentContext.ExpectedType != null, 3619Debug.Assert(null != CurrentContext && 3679Debug.Assert(false); 3688Debug.Assert(currentTarget is DependencyObject); 3702Debug.Assert(false); // We do not expect to be here after all checks done in propertyType identification above 3764Debug.Assert(genericType != null); 3807Debug.Assert(memberInfo is MethodInfo); 3823Debug.Assert(null != CurrentContext && 3872Debug.Assert(null != CurrentContext && 4875Debug.Assert(contentProperty != null); 5723Debug.Assert(_attributeInfo != null); 5818Debug.Assert(this.AttachedPropertyGetter != null);
System\Windows\Markup\BamlRecords.cs (26)
765Debug.Assert(null == _writeCache[(int)record.RecordType]); 855set { Debug.Assert (value == -1, "Setting fixed record to an invalid size"); } 902Debug.Assert( value <= 3 && value >= 0 ); 1090Debug.Assert(RecordSize < 0); 1500Debug.Assert(_valuePositionPosition != -1, 1683Debug.Assert(_valuePositionPosition != -1, 2048set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2118set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2179set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2386Debug.Assert(value <= ExtensionIdMask); 2406set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 2716Debug.Assert(!ValueObjectSet); 2795Debug.Assert (false, "Unknown custom serializer"); 2983set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 3197set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3284set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3433Debug.Assert(_contentSizePosition != -1, 3478set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3638set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 3736set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 3814set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 3999Debug.Assert(FilePos != -1,"UpdateWrite called but Write Never was"); 4542Debug.Assert( SerializerTypeId != 0 ); 4695Debug.Assert((propertyMember is MethodInfo) || (propertyMember is PropertyInfo) 4714Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null); 4757Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null);
System\Windows\Markup\BamlRecordWriter.cs (22)
115Debug.Assert(null != DocumentStartRecord); 133Debug.Assert(null != DocumentStartRecord); 404Debug.Assert(_deferElementDepth == 0); 405Debug.Assert(_deferComplexPropertyDepth == 0); 406Debug.Assert(_staticResourceElementDepth == 0); 407Debug.Assert(_dynamicResourceElementDepth == 0); 408Debug.Assert(_staticResourceRecordList == null); 426Debug.Assert(_staticResourceElementDepth == 0); 463Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 562Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 598Debug.Assert(!InStaticResourceSection, "We do not support x:Shared within a StaticResource Section"); 782Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 838Debug.Assert(keyRecord.RecordList.Count == 0, "Should have empty record list"); 864Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 875Debug.Assert(_deferElementDepth == 2); 1064Debug.Assert(extensionTypeId != (short)KnownElements.TypeExtension); 1081Debug.Assert(typeValue != null); 1626Debug.Assert(keyRecord != null, "Unknown key record type in defer load dictionary"); 1634Debug.Assert(keyIndex == _deferKeys.Count, 1657Debug.Assert(_deferElementDepth > 0 && CollectingValues, 1665Debug.Assert(valueDeferRecord.Record != null && 1677Debug.Assert(valueDeferRecord.Record != null && valueDeferRecord.Record.RecordType == BamlRecordType.ElementEnd,
System\Windows\Markup\BamlVersionHeader.cs (3)
71Debug.Assert((posEnd-posStart) == BamlVersionHeader.BinarySerializationSize, 102Debug.Assert(length == BamlVersionHeader.BinarySerializationSize, 107Debug.Assert((posEnd-posStart) == BamlVersionHeader.BinarySerializationSize,
System\Windows\Markup\BamlWriter.cs (6)
116Debug.Assert(null != assemblyName,"assembly name returned from GetBaseElement is null"); 117Debug.Assert(null != typeFullName,"Type name returned from GetBaseElement is null"); 384Debug.Assert(typeValue != null); 1273Debug.Assert(stackNode != null); 1281Debug.Assert(stackNode != null); 1289Debug.Assert(stackNode != null);
System\Windows\Markup\Localizer\BamlLocalizableResource.cs (1)
56Debug.Assert(other != null);
System\Windows\Markup\MarkupExtensionParser.cs (3)
1181Debug.Assert(sb.Length > 0); 1182Debug.Assert(!Char.IsWhiteSpace(sb[0])); 1539Debug.Assert(null != info, "No property or method info for field Name");
System\Windows\Markup\ParserContext.cs (1)
759Debug.Assert(canDecrement);
System\Windows\Markup\Primitives\ElementMarkupObject.cs (7)
40Debug.Assert(instance != null); 716Debug.Assert(obj != null); 740Debug.Assert(descriptor != null); 789Debug.Assert(DO != null); 931Debug.Assert(typeSerializer != null, "typeSerializer for Enum was null"); 991Debug.Assert(serializer != null && serializer.CanConvertToString(_object.Instance, _object.Context), 1016Debug.Assert(serializer != null && serializer.CanConvertToString(_object.Instance, _object.Context),
System\Windows\Markup\Primitives\ExtensionSimplifierMarkupObject.cs (2)
313Debug.Assert(typeSerializer != null, "Could not retrieve typeSerializer for Type"); 348Debug.Assert(!propertyWritten, "An argument was returned after a property was set. All arguments must be returned first and in order");
System\Windows\Markup\Primitives\FrameworkElementFactoryMarkupObject.cs (1)
23Debug.Assert(factory != null);
System\Windows\Markup\Primitives\MarkupWriter.cs (9)
254Debug.Assert( (object)key != null); 438Debug.Assert(item != null && _writer != null); 503Debug.Assert(!noOtherPropertiesAllowed || property.IsKey, 523Debug.Assert(first, "Problem with MarkupObject implemenation: Items returning a ValueAsString can have no other properties"); 539Debug.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"); 686Debug.Assert(!property.IsValueAsString, "Problem with MarkupObject implementation: String values cannnot be composite"); 828Debug.Assert(property.PropertyDescriptor != null); 1032Debug.Assert(property.Value != null); 1361Debug.Assert( ((bool)_xmlnsSpacePreserve) == _containingScope.XmlnsSpacePreserve ,
System\Windows\Markup\WpfXamlLoader.cs (2)
316System.Diagnostics.Debug.Assert(count == 0, "Mismatch StartMember/EndMember"); 383System.Diagnostics.Debug.Assert(xamlReader.Value is string, "XmlAttributeProperties.XmlSpaceProperty has the type string.");
System\Windows\Markup\XamlFigureLengthSerializer.cs (1)
237Debug.Assert( unit == FigureUnitType.Pixel
System\Windows\Markup\XamlGridLengthSerializer.cs (1)
237Debug.Assert( unit == GridUnitType.Pixel
System\Windows\Markup\XamlReader.cs (1)
1096Debug.Assert(parent == null || root == parent);
System\Windows\Markup\XamlStream.cs (12)
74Debug.Assert(!WriteComplete,"Write called after close"); 76Debug.Assert(null != buffer,"Null buffer past to the Writer"); 88Debug.Assert(null != writeBuffer,"Null writeBuffer returned"); 108Debug.Assert(0 < bufferWriteCount,"Not writing any bytes to the buffer"); 113Debug.Assert(bufferOffset < BufferSize,"Trying to Read past bufer"); 179Debug.Assert(!WriteComplete,"UpdateReaderLength called after close"); 224Debug.Assert(bufferOffset < BufferSize,"Calculated bufferOffset is greater than buffer"); 244Debug.Assert(0 < bufferReadCount,"Not reading any bytes to the buffer"); 249Debug.Assert(bufferOffset < BufferSize,"Trying ot read past buffer"); 372Debug.Assert(bufferOffset < BufferSize,"Calculated bufferOffset is greater than buffer"); 377Debug.Assert(bufferArray.Count == bufferIndex,"Need to allocate more than one buffer"); 378Debug.Assert(!reader, "Allocating a buffer on Read");
System\Windows\Markup\XamlTypeMapper.cs (32)
816Debug.Assert(null != attribInfo, "null attribInfo"); 817Debug.Assert(null != currentParentType, "null currentParentType"); 856Debug.Assert(propertyOwnerType != null); 885Debug.Assert(attachedPropertyInfo.IsPublic || 935Debug.Assert(null != localName, "null localName"); 936Debug.Assert(null != xmlNamespace, "null xmlNamespace"); 1587Debug.Assert(null != eventName, "null eventName"); 1588Debug.Assert(null != owner, "null owner"); 1632Debug.Assert(null != localName, "null localName"); 1633Debug.Assert(null != xmlNamespace, "null xmlNamespace"); 1670Debug.Assert(null != baseType, "baseType not set"); 1763Debug.Assert(null != localName, "null localName"); 1764Debug.Assert(null != xmlNamespace, "null xmlNamespace"); 1906Debug.Assert(typeInfo != null, "Must have cached type info at this point"); 2123Debug.Assert( propertyMember is DependencyProperty); 2304Debug.Assert(memberName != null); 2307Debug.Assert(memberInfo != null); 2322Debug.Assert(targetType != null); 2398Debug.Assert(null != xmlNamespace,"null value passed for xmlNamespace"); 2399Debug.Assert(null != localName,"null value passed for localName"); 2437Debug.Assert(null != xmlNamespace,"null value passed for xmlNamespace"); 2438Debug.Assert(null != localName,"null value passed for localName"); 2590Debug.Assert(namespaceMap.ClrNamespace != null,"Null CLR Namespace"); 2591Debug.Assert(localName != null,"Null localName"); 3440Debug.Assert(null != type, "Null passed for type to GetTypeConverterType"); 3471Debug.Assert(null != type, "Null passed for type to GetTypeConverter"); 3515Debug.Assert(null != propType, "Null passed for propType to GetPropertyConverterType"); 3559Debug.Assert(null != propType, "Null passed for propType to GetPropertyConverter"); 3678Debug.Assert(_constructors != null, "This operation is legal only after the constructors have been fetched"); 3744Debug.Assert(null != type, "null value for type passed to GetWhitespace"); 3756Debug.Assert(1 == trimAttribute.Length,"More than one TrimWhitespace Attribute"); 4006Debug.Assert(_dpLookupHashtable != null,
System\Windows\Markup\XmlnsDictionary.cs (1)
708Debug.Assert(prefix != null);
System\Windows\Media\Animation\BeginStoryboard.cs (3)
176Debug.Assert( fe != null || fce != null, "Caller of internal function failed to verify that we have a FE or FCE - we have neither." ); 185Debug.Assert( frameworkTemplate != null ); 195Debug.Assert( fe != null, "Invoke needs an object as starting point");
System\Windows\Media\Animation\ControllableStoryboardAction.cs (4)
59Debug.Assert( fe != null || fce != null, "Caller of internal function failed to verify that we have a FE or FCE - we have neither." ); 60Debug.Assert( targetStyle != null || frameworkTemplate != null, 70Debug.Assert( frameworkTemplate != null ); 79Debug.Assert( fe != null, "Invoke needs an object as starting point");
System\Windows\Media\Animation\Generated\ThicknessAnimation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\ThicknessAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameThicknessAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\ThicknessKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\PauseStoryboard.cs (1)
25Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\RemoveStoryboard.cs (1)
25Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\ResumeStoryboard.cs (1)
25Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\SeekStoryboard.cs (1)
91Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\SetStoryboardSpeedRatio.cs (1)
49Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\SkipStoryboardToFill.cs (1)
25Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\StopStoryboard.cs (1)
25Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\Storyboard.cs (7)
264Debug.Assert( nameScope == null ); 689Debug.Assert( i > 0, "The caller should not have set the PropertyPath context to a null object." ); 744Debug.Assert( i > 0, "The caller should not have set the PropertyPath context to a non DependencyObject." ); 809Debug.Assert(path.Length > 1, "This method shouldn't even be called for a simple property path."); 859Debug.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'."); 979Debug.Assert(cacheEntry.Source != DependencyProperty.UnsetValue, 2092Debug.Assert( target != null && clone != null && property != null && original != null,
System\Windows\MultiTrigger.cs (1)
127Debug.Assert( TriggerConditions[i].SourceChildIndex == 0,
System\Windows\Navigation\Journal.cs (13)
248Debug.Assert(ValidateIndexes()); 258Debug.Assert(ValidateIndexes()); 271Debug.Assert(journalEntry.ContentId != 0); 272Debug.Assert(!(journalEntry.IsAlive() && journalEntry.JEGroupState.JournalDataStreams != null), 302Debug.Assert(_uncommittedCurrentIndex == _currentEntryIndex, 321Debug.Assert(ValidateIndexes()); 415Debug.Assert(IsNavigable(target), "target must be navigable"); 416Debug.Assert(ValidateIndexes()); 464Debug.Assert(je.GetType().IsSerializable); 478Debug.Assert(index < TotalCount && index >= 0, "Invalid index passed to RemoveEntryInternal"); 479Debug.Assert(_uncommittedCurrentIndex == _currentEntryIndex, 483Debug.Assert(theEntry != null, "Journal list state is messed up"); 563Debug.Assert(ValidateIndexes());
System\Windows\Navigation\JournalEntry.cs (3)
261Debug.Assert(!_jeGroupState.JournalDataStreams.HasAnyData, 277Debug.Assert(_jeGroupState.JournalDataStreams == null); 294Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward);
System\Windows\Navigation\NavigationService.cs (44)
80Debug.Assert(_navigateQueueItem == null || !_navigateQueueItem.IsPosted); 89Debug.Assert(e != null, "Hyperlink fired Navigate event with null NavigateEventArgs"); 102Debug.Assert(dobj != null, "RequestNavigateEventArgs.OriginalSource should be DependencyObject"); 237Debug.Assert(_bp != null, "NavigationService should not handle a nav from a hyperlink thats not in its hosted tree"); 243Debug.Assert(IsConsistent(navInfo)); 275Debug.Assert(navMode != NavigationMode.Refresh); // because of !IsSameUri() above 296Debug.Assert(_navStatus == NavigationStatus.Navigating); 441Debug.Assert(!(_bp is Visual)); 574Debug.Assert(_parentNavigationService == newParent); 611Debug.Assert(ChildNavigationServices.Contains(ncChild), "Child NavigationService must already exist"); 671Debug.Assert(fe != null, "INavigatorHost needs to be FrameworkElement"); 844Debug.Assert(_navigateQueueItem == null && _navStatus == NavigationStatus.Navigated); 868Debug.Assert(finishingChildPageFunction == null || 887Debug.Assert(finishingChildPageFunction._Return == null); 918Debug.Assert(pfReturnInfo == null); 924Debug.Assert(pf.ParentPageFunctionId != Guid.Empty); 963Debug.Assert(IsConsistent(navInfo)); 988Debug.Assert(!JournalScope.Journal.HasUncommittedNavigation); 992Debug.Assert(_navigateQueueItem == null); 1101Debug.Assert(bpu == null || 1131Debug.Assert(navMode == NavigationMode.Refresh, 1149Debug.Assert(!JournalScope.Journal.HasUncommittedNavigation); 1166Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward); 1169Debug.Assert(_contentId != 0); 1173Debug.Assert(_journalEntryGroupState == null || 1893Debug.Assert(PendingNavigationList.Count == 0, 2003Debug.Assert(this.Application != null && 2054Debug.Assert(navigateInfo.IsConsistent); 2055Debug.Assert(source == null || 2105Debug.Assert(PendingNavigationList.Count == 0, 2115Debug.Assert(_navigateQueueItem == null, "Previous nav queue item should be cleared by now."); 2195Debug.Assert(_navStatus == NavigationStatus.Navigated); 2535Debug.Assert(sender == _bp); 3018Debug.Assert(IsConsistent(navigateInfo)); 3045Debug.Assert(navigationMode == NavigationMode.New || 3050Debug.Assert(destinationJournalEntry == null 3129Debug.Assert(_contentId != 0 && 3629Debug.Assert(ps._Resume); // should've been set by JournalEntryPFxx.ResumePageFunction() 3658Debug.Assert(_navigateQueueItem == null, 3733Debug.Assert(parentPF._Return == null); 3835Debug.Assert(parentEntryIndex < journal.CurrentIndex); 4340Debug.Assert(_postedOp == null); 4431Debug.Assert(child != null); 4454Debug.Assert(node != null, "Trying to dispose a null Logical Tree Node");
System\Windows\Navigation\NavigationWindow.cs (10)
211Debug.Assert(_navigationService == null && _JNS == null); 303Debug.Assert(_JNS != null); 996Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1003Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1011Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1018Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1026Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1033Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1040Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1052Debug.Assert(nw != null, "sender must be of type NavigationWindow.");
System\Windows\Navigation\PageFunction.cs (2)
268Debug.Assert((returnEventArgs == null) || (ra != null)); 272Debug.Assert(eh != null);
System\Windows\PropertyPath.cs (1)
431Debug.Assert(aryIPI.Length > 0);
System\Windows\ResourceDictionary.cs (15)
186Debug.Assert(classicResourceUri != null); 200Debug.Assert(genericResourceUri != null); 539Debug.Assert(_numDefer > 0, "The stream was closed before all deferred content was loaded."); 1009Debug.Assert(!IsInitialized, "Dictionary should not be initialized when EndInit is called"); 1070Debug.Assert(_numDefer > 0, "The stream was closed before all deferred content was loaded."); 1141Debug.Assert(deferrableContent.Stream != null); 1142Debug.Assert(deferrableContent.SchemaContext != null); 1143Debug.Assert(deferrableContent.ObjectWriterFactory != null); 1144Debug.Assert(deferrableContent.ServiceProvider != null); 1145Debug.Assert(deferrableContent.RootObject != null); 1324Debug.Assert(staticResources != null && staticResources.Count > 0); 1343Debug.Assert(keyValue != null, "Didn't find the ResourceKey property or x:PositionalParameters directive"); 1362Debug.Assert(obj is DeferredResourceReference); 1774Debug.Assert(resourceKey != null, "ResourceKey cannot be null"); 2320Debug.Assert(IsThemeDictionary || _ownerApps != null || IsReadOnly, "This must be an App/Theme/Style/Template ResourceDictionary");
System\Windows\ResourceDictionaryCollection.cs (1)
14Debug.Assert(owner != null, "ResourceDictionaryCollection's owner cannot be null");
System\Windows\ResourceReferenceExpression.cs (2)
103Debug.Assert(_targetObject == d, "TargetObject that this expression is attached to must be the same as the one on which its value is being queried"); 547Debug.Assert(!_resource.IsFrozen);
System\Windows\ResourcesChangeInfo.cs (1)
233Debug.Assert(_oldDictionaries != null || _newDictionaries != null || _key != null, "Must have a dictionary or a key that has changed");
System\Windows\Shapes\Shape.cs (5)
628Debug.Assert(mode != Stretch.None); 650Debug.Assert(mode == Stretch.UniformToFill); 682Debug.Assert(geometry != null); 722Debug.Assert(geometry != null); 733Debug.Assert(_renderedGeometry != null);
System\Windows\Shell\JumpList.cs (12)
445Debug.Assert(_initializing == false); 676Debug.Assert(removedList != null); 677Debug.Assert(shellObject != null); 751Debug.Assert(false); 757Debug.Assert(shellObjects != null); 794Debug.Assert(jumpItems.Count != 0); 795Debug.Assert(cdl != null); 850Debug.Assert(jumpItems.Count != linksOnlyList.Count); 856Debug.Assert(HRESULT.DESTS_E_NO_MATCHING_ASSOC_HANDLER != hr); 872Debug.Assert(jumpTask != null); 985Debug.Assert(jumpPath != null); 1055Debug.Assert(false);
System\Windows\Shell\ThumbButtonInfo.cs (1)
277Debug.Assert(command != null);
System\Windows\StaticResourceExtension.cs (1)
241Debug.Assert(ambientList != null, "IAmbientProvider.GetAllAmbientValues no longer returns List<>, please copy the list");
System\Windows\Style.cs (2)
341Debug.Assert(resourceKey != null, "Argument cannot be null"); 620Debug.Assert(setterBase != null, "Setter collection must contain non-null instances of SetterBase");
System\Windows\StyleHelper.cs (93)
54Debug.Assert(fe != null || fce != null); 93Debug.Assert(fe != null || fce != null); 157Debug.Assert((fe != null && fce == null)|| (fe == null && fce != null)); 347Debug.Assert(frameworkTemplate != null ); 364Debug.Assert( !frameworkTemplate.HasXamlNodeContent ); 368Debug.Assert(frameworkTemplate != null); 403Debug.Assert( frameworkTemplate != null ); 704Debug.Assert(freezable.IsFrozen, "Freezable within a Style or Template should have been frozen by now"); 762Debug.Assert(childIndex >= 0); 1122Debug.Assert(action.IsSealed, "TriggerAction should have already been sealed by this point."); 1276Debug.Assert( childIndex != 0 ); // This should go to the other AddDelegateToFireTrigger overload 1334Debug.Assert((fe != null && fce == null) || (fe == null && fce != null)); 1366Debug.Assert((fe != null && fce == null) || (fe == null && fce != null)); 1367Debug.Assert((fe != null && fe == container) || (fce != null && fce == container)); 1368Debug.Assert(newStyle != null || newFrameworkTemplate != null ); 1430Debug.Assert((fe != null && fce == null) || (fe == null && fce != null)); 1431Debug.Assert((fe != null && fe == container) || (fce != null && fce == container)); 1432Debug.Assert(oldStyle != null || oldFrameworkTemplate != null ); 1491Debug.Assert((container is FrameworkElement) || (container is FrameworkContentElement), "Caller has queried with non-framework element. Bad caller, bad!"); 1492Debug.Assert(dataType < InstanceStyleData.ArraySize, "Caller has queried using a value outside the range of the Enum. Bad caller, bad!"); 1595Debug.Assert(!freezable.CanFreeze, "If a freezable could have been frozen it would have been done by now."); 1622Debug.Assert(instanceValues != null, "InstanceValues hashtable should have been created at initialization time."); 1666Debug.Assert(oldStyle != null || oldFrameworkTemplate != null ); 1684Debug.Assert(dataField == ThemeStyleDataField); 1766Debug.Assert(frameworkTemplate != null ); 1807Debug.Assert(treeRoot is FrameworkElement || treeRoot is FrameworkContentElement, 1855Debug.Assert(treeRoot == null || treeRoot is FrameworkElement || treeRoot is FrameworkContentElement, 1883Debug.Assert( feContainer._buildVisualTreeVerification == VerificationState.WaitingForBuildVisualTree, 1891Debug.Assert(frameworkTemplate != null, "Only FrameworkTemplate has the ability to build a VisualTree by this means"); 1903Debug.Assert( feContainer._buildVisualTreeVerification == VerificationState.WaitingForBuildVisualTreeCompletion, 1908Debug.Assert( feContainer._buildVisualTreeVerification == VerificationState.WaitingForAddCustomTemplateRoot, 1943Debug.Assert( container._buildVisualTreeVerification != VerificationState.WaitingForBuildVisualTreeCompletion, 1945Debug.Assert( container._buildVisualTreeVerification == VerificationState.WaitingForAddCustomTemplateRoot, 1966Debug.Assert( null == VisualTreeHelper.GetParent(child), 2040Debug.Assert(frameworkTemplate != null ); 2054Debug.Assert( feWalkNode != null || fceWalkNode != null, 2127Debug.Assert(feContainer != null || fceContainer != null, 2146Debug.Assert(templatedChildren.Count > 0, 2175Debug.Assert(feContainer != null || fceContainer != null); 2210Debug.Assert(oldFrameworkTemplate != null ); 2259Debug.Assert( oldFrameworkTemplate != null ); 2387Debug.Assert(sender is FrameworkElement || sender is FrameworkContentElement, 2442Debug.Assert(sender is FrameworkElement || sender is FrameworkContentElement, 2473Debug.Assert( feTemplatedParent != null ); 2476Debug.Assert(templatedParentTemplate != null, "Must have a VisualTree owner"); 2497Debug.Assert(ownerStyle != null || frameworkTemplate != null ); 2509Debug.Assert( frameworkTemplate != null ); 2521Debug.Assert(action.ContainingTrigger is EventTrigger, 2612Debug.Assert(child.IsValid, "child should either be an FE or an FCE"); 2878Debug.Assert(dataField == ThemeStyleDataField); 2964Debug.Assert(value != NotYetApplied, "attempt to retrieve instance value that was never set"); 3017Debug.Assert(frameworkTemplate != null ); 3031Debug.Assert(frameworkTemplate != null ); 3142Debug.Assert(fe != null || fce != null); 3224Debug.Assert(fe != null || fce != null); 3296Debug.Assert(feContainer != null); 3305Debug.Assert(feContainer != null); 3345Debug.Assert(feContainer != null); 3368Debug.Assert(feContainer != null); 3396Debug.Assert(feContainer != null); 3440Debug.Assert(fe != null || fce != null); 3441Debug.Assert(container == fe || container == fce); 3481Debug.Assert(fe != null || fce != null); 3482Debug.Assert(container == fe || container == fce); 3483Debug.Assert( oldTemplate == null || oldTemplate is FrameworkTemplate, 3485Debug.Assert( newTemplate == null || newTemplate is FrameworkTemplate, 3487Debug.Assert( (oldTemplate == null || newTemplate == null ) || 3895Debug.Assert(sourceType == ValueLookupType.Simple || 3925Debug.Assert(sourceType == ValueLookupType.Trigger || 3979Debug.Assert(sourceType == ValueLookupType.Simple || 4079Debug.Assert(styledChildren != null, "Should reach here only if the template tree has already been created"); 4189Debug.Assert(child.FE != null || child.FCE != null); 4208Debug.Assert(dp != null, "dp must not be null"); 4298Debug.Assert(ownerStyle != null || frameworkTemplate != null ); 4369Debug.Assert(ownerStyle != null || frameworkTemplate != null ); 4440Debug.Assert( triggerBase is MultiDataTrigger, 4476Debug.Assert( triggerBase is MultiTrigger, 4540Debug.Assert( ft != null ); 4819Debug.Assert(!(action.ContainingTrigger is EventTrigger), 4835Debug.Assert( trigger.Property == changedProperty, 4842Debug.Assert( frameworkTemplate != null, 4850Debug.Assert( conditions != null && conditions.Length == 1, 4880Debug.Assert( conditions != null && conditions.Length == 1, 4913Debug.Assert( frameworkTemplate != null, 4924Debug.Assert(evaluationNode != null, 4986Debug.Assert( evaluationBinding != null, 5302Debug.Assert(frameworkTemplate != null ); 5309Debug.Assert(frameworkTemplate != null); 5333Debug.Assert(frameworkTemplate != null); 5378Debug.Assert(frameworkTemplate != null ); 5383Debug.Assert(frameworkTemplate != null); 5436Debug.Assert( 5546Debug.Assert(routedEvent != null);
System\Windows\SystemResources.cs (9)
350Debug.Assert(typeKey != null || resourceKey != null, "typeKey or resourceKey should be non-null"); 1088Debug.Assert(_hwndNotify != null); 1089Debug.Assert(_hwndNotifyHook != null); 1090Debug.Assert(callerName.Equals(nameof(EnsureResourceChangeListener), StringComparison.InvariantCulture)); 1118Debug.Assert(!_hwndNotify.ContainsKey(hwndDpiInfo)); 1119Debug.Assert(hwndDpiInfo.DpiAwarenessContextValue == dpiContextValue); 1156Debug.Assert(dpiContextValue == DpiAwarenessContextValue.Unaware || dpiContextValue == DpiAwarenessContextValue.SystemAware); 1547Debug.Assert(hwndDpiInfo != null); 1803Debug.Assert(_inflatedList != null);
System\Windows\SystemThemeKey.cs (1)
26Debug.Assert(id > SystemResourceKeyID.InternalSystemThemeStylesStart &&
System\Windows\TemplateContent.cs (12)
39Debug.Assert(_xamlType == null); 232Debug.Assert(TemplateLoadData.Reader != null); 320Debug.Assert(childIndex == lastIndex); 577Debug.Assert(iReader != null, "Template's Reader is not a Indexing Reader"); 608Debug.Assert(sharedValue != null); 748Debug.Assert(xamlReader.NodeType == Xaml.XamlNodeType.StartObject); 749Debug.Assert(xamlReader.Type.UnderlyingType == typeof(StaticResourceExtension)); 771Debug.Assert(resource != null); 794Debug.Assert(xamlReader.NodeType == System.Xaml.XamlNodeType.StartMember); 889Debug.Assert(xamlReader.NodeType == System.Xaml.XamlNodeType.StartObject); 1147Debug.Assert(xamlReader.NodeType == System.Xaml.XamlNodeType.EndMember); 1226Debug.Assert(templateChildName != null);
System\Windows\TemplateNameScope.cs (3)
50Debug.Assert(templatedParent == null || (templatedParent is FrameworkElement || templatedParent is FrameworkContentElement), 161Debug.Assert(_affectedChildren.Count == childIndex); 211Debug.Assert(fo.IsFE);
System\Windows\ThemeDictionaryExtension.cs (2)
187Debug.Assert(dictionary != null, "dictionary should not be null"); 188Debug.Assert(assemblyName != null, "assemblyName should not be null");
System\Windows\TreeChangeInfo.cs (2)
52Debug.Assert(d != null, "Must have non-null current node"); 111Debug.Assert(!inheritableProperties.Contains(dp), "EffectiveValues cache must not contains duplicate entries for the same DP");
System\Windows\TreeWalkHelper.cs (14)
39Debug.Assert(fe != null || fce != null, "Node with the tree change notification must be an FE or an FCE."); 40Debug.Assert(parent != null, "Must have a parent that the current node is connected to or disconnected from."); 241Debug.Assert(fe != null || fce != null, "Must have non-null current node"); 264Debug.Assert(inheritableProperty.IsPotentiallyInherited, "if we got here, it means that this property is inheritable by someone"); 281Debug.Assert(!currentInheritableProperties.Contains(inheritableProperty), "InheritableProperties list should not have duplicates"); 316Debug.Assert(d != null, "Must have non-null current node"); 319Debug.Assert(fMetadata.IsInherited, "This must be an inherited dependency property"); 322Debug.Assert(!wasSelfInheritanceParent || isSelfInheritanceParent, "IsSelfInheritanceParent changed from true to false"); 453Debug.Assert(fe != null || fce != null, "Node with the resources change notification must be an FE or an FCE."); 522Debug.Assert(d != null, "Must have non-null current node"); 684Debug.Assert(d != null, "Must have non-null current node"); 747Debug.Assert(d != null, "Must have non-null current node"); 909Debug.Assert(fo.IsValid, "Node with the resources change notification must be an FE or an FCE."); 941Debug.Assert(d != null, "Must have non-null current node");
System\Windows\Trigger.cs (2)
232Debug.Assert( TriggerConditions != null && TriggerConditions.Length == 1, 235Debug.Assert( TriggerConditions[0].SourceChildIndex == 0,
System\Windows\TriggerActionCollection.cs (1)
279Debug.Assert (Owner == null);
System\Windows\TriggerBase.cs (1)
366Debug.Assert( false,
System\Windows\TriggerCollection.cs (1)
104Debug.Assert (Owner == null);
System\Windows\Window.cs (55)
336Debug.Assert(_threadWindowHandles == null, "_threadWindowHandles must be null before enumerating the thread windows"); 720Debug.Assert(false); 1365Debug.Assert(!IsSourceWindowNull, "IsSourceWindowNull cannot be true when _showingAsDialog is true"); 2294Debug.Assert( _swh != null ); 2303Debug.Assert( _swh != null ); 3019Debug.Assert(!IsSourceWindowNull, "IsSourceWindowNull cannot be true when calling this function"); 3246Debug.Assert(Manager != null, "HwndStyleManager must have a valid value here"); 3579Debug.Assert(w != null, "Target must be of type Window."); 3602Debug.Assert(_threadWindowHandles != null, "_threadWindowHandles must not be null at this point"); 3625Debug.Assert(_threadWindowHandles != null, "_threadWindowHandles must not be null at this point"); 3762Debug.Assert(!IsSourceWindowNull, "_swh should not be null here"); 3879Debug.Assert(hMonitor != IntPtr.Zero); 3912Debug.Assert(workAreaWidthDeviceUnits >= 0, string.Create(CultureInfo.InvariantCulture, $"workAreaWidth ({hMonitor})for monitor ({workAreaWidthDeviceUnits}) is negative")); 3913Debug.Assert(workAreaHeightDeviceUnits >= 0, string.Create(CultureInfo.InvariantCulture, $"workAreaHeight ({hMonitor}) for monitor ({workAreaHeightDeviceUnits}) is negative")); 3923Debug.Assert(!IsSourceWindowNull, "_swh should not be null here"); 4427Debug.Assert(_showingAsDialog, "_showingAsDialog must be true when DoDialogHide is called"); 4468Debug.Assert(_threadWindowHandles != null, "_threadWindowHandles must not be null at this point"); 4509Debug.Assert(ownedWindows.Count == 0, "All owned windows should now be gone"); 5067Debug.Assert(w != null, "DependencyObject must be of type Window."); 5093Debug.Assert(w != null, "DependencyObject must be of type Window."); 5112Debug.Assert(w != null, "DependencyObject must be of type Window."); 5172Debug.Assert(w != null, "DependencyObject must be of type Window."); 5299Debug.Assert(w != null, "DependencyObject must be of type Window."); 5319Debug.Assert(w != null, "DependencyObject must be of type Window."); 5580Debug.Assert(_dispatcherFrame == null, "_dispatcherFrame must be null here"); 5639Debug.Assert(w != null, "DependencyObject must be of type Window."); 5650Debug.Assert(w != null, "DependencyObject must be of type Window."); 5710Debug.Assert(w != null, "d must be typeof Window"); 5733Debug.Assert(w != null, "d must be typeof Window"); 5772Debug.Assert(w != null, "d must be typeof Window"); 5810Debug.Assert(w != null, "d must be typeof Window"); 5831Debug.Assert(w != null, "d must be typeof Window"); 5872Debug.Assert(w != null, "d must be typeof Window"); 6102Debug.Assert( w != null, "DependencyObject must be of type Window." ); 6177Debug.Assert( w != null, "DependencyObject must be of type Window." ); 6234Debug.Assert(!IsSourceWindowNull, "IsSourceWindowNull cannot be true when calling this function"); 6256Debug.Assert( w != null, "DependencyObject must be of type Window." ); 6288Debug.Assert(w != null, "DependencyObject must be of type Window."); 6475Debug.Assert(0 != (int)_overlaySize.Width); 6476Debug.Assert(0 != (int)_overlaySize.Height); 6519Debug.Assert(null != _taskbarList); 6545Debug.Assert(false); 6564Debug.Assert(null != _taskbarList); 6578Debug.Assert(0 <= taskbarInfo.ProgressValue && taskbarInfo.ProgressValue <= 1); 6586Debug.Assert(null != _taskbarList); 6611Debug.Assert(null != _taskbarList); 6682Debug.Assert(null != _taskbarList); 6710Debug.Assert(null != _taskbarList); 7144Debug.Assert( _swh != null ); 7362Debug.Assert( sourceWindow != null ); 7445Debug.Assert(!IsSourceWindowNull, "IsSourceWindowNull cannot be true here"); 7536Debug.Assert(!IsSourceWindowNull, "Should only be invoked when we know Handle is non-null" ); 7546Debug.Assert(!IsSourceWindowNull, "Should only be invoked when we know Handle is non-null" ); 7571Debug.Assert(!IsSourceWindowNull, "IsSourceWindowNull can't be true here"); 7590Debug.Assert(!IsSourceWindowNull, "IsSourceWindowNull can't be true here");
System\Windows\WindowCollection.cs (1)
39Debug.Assert(count >= 0, "count must not be less than zero");
PresentationFramework.Aero (4)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
329Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 356Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 366Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
27Debug.Assert(_platformCulture != null);
PresentationFramework.Aero2 (4)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
329Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 356Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 366Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
27Debug.Assert(_platformCulture != null);
PresentationFramework.AeroLite (4)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
329Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 356Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 366Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
27Debug.Assert(_platformCulture != null);
PresentationFramework.Classic (22)
Microsoft\Windows\Themes\ClassicBorderDecorator.cs (18)
231Debug.Assert(rgbColor.Red >= 0 && rgbColor.Red <= 1, "Red must be between 0 and 1."); 232Debug.Assert(rgbColor.Green >= 0 && rgbColor.Green <= 1, "Green must be between 0 and 1."); 233Debug.Assert(rgbColor.Blue >= 0 && rgbColor.Blue <= 1, "Blue must be between 0 and 1."); 295Debug.Assert(hue >= 0 && hue <= 1, "Output hue should be between 0 and 1."); 296Debug.Assert(lightness >= 0 && lightness <= 1, "Output lightness should be between 0 and 1."); 297Debug.Assert(saturation >= 0 && saturation <= 1, "Output saturation should be between 0 and 1."); 299Debug.Assert(!isHueDefined || isSaturationDefined, "If hue is defined, saturation must also be defined."); 311Debug.Assert(hlsColor.Lightness >= 0 && hlsColor.Lightness <= 1, "Lightness must be between 0 and 1."); 312Debug.Assert(hlsColor.Saturation >= 0 && hlsColor.Saturation <= 1, "Saturation must be between 0 and 1."); 337Debug.Assert(red >= 0 && red <= 1, "Output red should be between 0 and 1."); 338Debug.Assert(green >= 0 && green <= 1, "Output green should be between 0 and 1."); 339Debug.Assert(blue >= 0 && blue <= 1, "Output blue should be between 0 and 1."); 346Debug.Assert(n1 >= 0 && n1 <= 1, "n1 must be between 0 and 1."); 347Debug.Assert(n2 >= 0 && n2 <= 1, "n2 must be between 0 and 1."); 348Debug.Assert(hue >= -6 && hue < 12, "Hue must be between -6 (inclusive) and 12 (exclusive)."); 1154Debug.Assert(_tabCache != null, "_tabCache is null. GetShadow1 should only be called after GetHighlight1"); 1167Debug.Assert(_tabCache != null, "_tabCache is null. GetHighlight2 should only be called after GetHighlight1"); 1180Debug.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)
329Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 356Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 366Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
27Debug.Assert(_platformCulture != null);
PresentationFramework.Luna (4)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
329Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 356Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 366Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
27Debug.Assert(_platformCulture != null);
PresentationFramework.Royale (4)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
329Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 356Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 366Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
27Debug.Assert(_platformCulture != null);
PresentationUI (5)
MS\Internal\Documents\Application\DocumentProperties.cs (1)
220System.Diagnostics.Debug.Assert(
MS\Internal\Documents\DocumentApplicationDocumentViewer.cs (1)
48System.Diagnostics.Debug.Assert(
MS\Internal\Documents\DocumentSignatureManager.cs (1)
822System.Diagnostics.Debug.Assert(
MS\Internal\Documents\RightsManagementManager.cs (1)
69System.Diagnostics.Debug.Assert(
MS\Internal\Documents\SignatureSummaryDialog.cs (1)
758Debug.Assert(item._displayImage != null, "Signature icon is null");
ReachFramework (100)
AlphaFlattener\BrushProxy.cs (45)
163Debug.Assert(pen != null, "pen expected"); 164Debug.Assert(brush != null, "brush expected"); 187Debug.Assert(_brush.BrushList == null, "Simple brush expected"); 269Debug.Assert(pen != null, "pen expected"); 270Debug.Assert(pen.Brush != null, "pen expected to have a brush"); 302Debug.Assert(pen != null, "pen expected"); 303Debug.Assert(pen.Brush != null, "pen expected to have a brush"); 540Debug.Assert(bp._opacityOnly == _opacityOnly, "Brush and OpacityMask can't mix in a single list"); 668Debug.Assert(Utility.IsRenderVisible(vb), "TileBrush.Viewbox area must be positive"); 735Debug.Assert(Utility.IsRenderVisible(vb), "TileBrush.Viewbox must be visible"); 1191Debug.Assert(tileBrush.ViewportUnits == BrushMappingMode.Absolute); 1223Debug.Assert(tileBrush.ViewportUnits == BrushMappingMode.Absolute); 1248Debug.Assert(drawingBrush.Drawing != null, "DrawingBrush where Drawing == null should've been culled"); 1314Debug.Assert(_drawing != null, "_drawing primitive changed, but it's null"); 1383Debug.Assert(!_bounds.IsEmpty); 1391Debug.Assert(_brushList != null && _bounds.IsEmpty); 1730Debug.Assert(brush.ViewboxUnits == BrushMappingMode.Absolute); 1731Debug.Assert(brush.ViewportUnits == BrushMappingMode.Absolute); 1986Debug.Assert(g.GradientStops != null); 2041Debug.Assert(g.GradientStops.Count > 0); 2130Debug.Assert(b._brush is SolidColorBrush, "SolidColorBrush expected"); 2131Debug.Assert(!b._opacityOnly, "OpacityMask not expected"); 2143Debug.Assert(first, "prefix only"); 2371Debug.Assert(bp != null, "Blending visible ImageBrush with another brush should yield non-empty brush"); 2648Debug.Assert(brush != null, "null brush"); 2691Debug.Assert(gb.MappingMode == BrushMappingMode.Absolute, "absolute brush"); 2699Debug.Assert(tb.ViewportUnits == BrushMappingMode.Absolute, "absolute brush required for BrushProxy"); 2940Debug.Assert(gsc != null && gsc.Count > 0, "BrushProxy.IsEmpty should return true upon GradientBrush with zero stops"); 2981Debug.Assert(!bounds.IsEmpty, "Bounds must not be empty for BitmapCacheBrush"); 3059Debug.Assert(!bounds.IsEmpty, "Bounds must not be empty for VisualBrush"); 3254Debug.Assert(brushB.Brush != null, "null brush not expected"); 3366Debug.Assert(Utility.NormalizeOpacity(value) == value, "BrushProxy.Opacity must always be normalized"); 3639Debug.Assert( 3706Debug.Assert(Utility.IsValid(opacity), "Opacity comes from BrushProxy, should be valid"); 3780Debug.Assert(false); // Optimization is needed before reaching here 3786Debug.Assert(false); // Optimization is needed before reaching here 3791Debug.Assert(steps > 0); 3831Debug.Assert((i >= 0) && (i < steps)); 3845Debug.Assert(false); 3942Debug.Assert(di >= 0); 4044Debug.Assert(_left <= left); 4045Debug.Assert(_right >= right); 4175Debug.Assert(Utility.IsValid(opacity), "Opacity comes from BrushProxy, should be valid"); 4271Debug.Assert(_left <= left); 4272Debug.Assert(_right >= right);
AlphaFlattener\DrawingContext.cs (10)
251Debug.Assert(b != null, "LinearGradientBrush expected"); 374Debug.Assert(b != null, "RadialGradientBrush expected"); 476Debug.Assert(one != null); 495Debug.Assert(one.BrushList.Count == 2, "Only two brushes allowed here"); 597Debug.Assert(brush != null, "brush expected"); 598Debug.Assert(shape != null, "shape expected"); 599Debug.Assert(!_costing, "in costing mode DrawImage"); 692Debug.Assert(brushTrans.IsIdentity, "brushTrans not supported"); 721Debug.Assert(pen == null, "no pen"); 929Debug.Assert(!_costing, "in costing mode DrawyGlyphs");
AlphaFlattener\Flattener.cs (1)
86Debug.Assert(Utility.IsValid(opacity) && Utility.IsValid(tree.Opacity), "Invalid opacity encountered, should've been normalized in conversion to Primitive");
AlphaFlattener\ImageProxy.cs (4)
55Debug.Assert(image != null); 127Debug.Assert( 169Debug.Assert(opacityBrush.ViewportUnits == BrushMappingMode.Absolute, "TileBrush must have absolute viewport by this point"); 297Debug.Assert(!opacityOnly, "Opaque image OpacityMask should not be blended with brush");
AlphaFlattener\MetroDevice.cs (2)
447Debug.Assert(ticket != null); 491Debug.Assert(ticketXMLString == null);
AlphaFlattener\Optimizer.cs (2)
72Debug.Assert(GetPrimitiveIntersectAction() == PrimitiveIntersectAction.ClipToCluster); 83Debug.Assert(geometry != null, "No geometry available for primitive");
AlphaFlattener\Primitive.cs (5)
260Debug.Assert(Utility.NormalizeOpacity(value) == value, "Opacity should be normalized during tree walking"); 675Debug.Assert(Brush == null, "no brush expected"); 749Debug.Assert(brush.ViewportUnits == BrushMappingMode.Absolute); 1311Debug.Assert((Brush != null) || (Pen != null), "empty primitive"); 1381Debug.Assert(tb.ViewboxUnits == BrushMappingMode.Absolute, "Absolute Viewbox expected");
AlphaFlattener\PrimitiveRenderer.cs (1)
61Debug.Assert(_brush == null, "no brush");
AlphaFlattener\SegmentTree.cs (1)
53Debug.Assert(count >= 2);
AlphaFlattener\Utility.cs (5)
1383Debug.Assert( 1668Debug.Assert(IsValidViewbox(viewbox, brush.Stretch != Stretch.None) && 1731Debug.Assert(brush.ViewboxUnits == BrushMappingMode.Absolute); 1732Debug.Assert(brush.ViewportUnits == BrushMappingMode.Absolute); 2366Debug.Assert(!rect.IsEmpty);
MS\Internal\Printing\MostFrequentlyUsedCache.cs (1)
32Debug.Assert(this._dictionary.Count <= this._maxEntries);
Packaging\XpsManager.cs (2)
1407Debug.Assert(package != null, "package cannot be null"); 1452Debug.Assert(package != null, "package cannot be null");
PrintConfig\PTProvider.cs (1)
595Debug.Assert(resultLength >= 0);
Serialization\DrawingContextFlattener.cs (9)
80Debug.Assert(Utility.IsValid(opacity), "Invalid opacity should clip subtree"); 90Debug.Assert(!BrushProxy.IsEmpty(opacityMask), "empty opacity mask should not result in Push"); 137Debug.Assert(_fullTransform.Count == _fullClip.Count); 359Debug.Assert(visual != null); 473Debug.Assert(rHalfChord2 >= rFuzz2); // Otherewise we have no guarantee that the radius is not 0, 570Debug.Assert(cPieces > 0); 640Debug.Assert(rDot >= -rRadSquared * .1); // angle < 90 degrees 641Debug.Assert(rDot <= rRadSquared * 1.1); // as dot product of 2 radius vectors 885Debug.Assert(context != null);
Serialization\Manager\MetroSerializationManager.cs (1)
846Debug.Assert(propertyInfo.PropertyType == dependencyProperty.PropertyType,
Serialization\VisualSerializer.cs (7)
256Debug.Assert(!BrushProxy.IsEmpty(brush), "Should not be serializing empty brush"); 386Debug.Assert(pos >= 0, "Missing offset"); 1434Debug.Assert(forFill || forStroke, "Either forFill or forStoke should be true"); 1677Debug.Assert(_nameAttr.Length > 0, "Empty _nameAttr"); 2006Debug.Assert(Utility.IsScaleTranslate(bitmapToDrawingTransform)); 2346Debug.Assert(nameAttr == null || nameAttr.Length > 0, "Bad name attribute"); 2381Debug.Assert(_nameAttr == null, "Empty");
Serialization\VisualTreeFlattener.cs (3)
345Debug.Assert(treeWalkProgress != null); 360Debug.Assert(treeWalkProgress != null); 631Debug.Assert(_visualDepth >= 0, "StartVisual/EndVisual mismatch");
Replay (9)
src\Compilers\Core\CommandLine\BuildProtocol.cs (2)
71Debug.Assert(!string.IsNullOrWhiteSpace(CompilerHash), "A hash value is required to communicate with the server"); 83Debug.Assert(!string.IsNullOrWhiteSpace(compilerHash), "CompilerHash is required to send request to the build server");
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (1)
138Debug.Assert(false, e.Message);
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (4)
19/// <inheritdoc cref="Debug.Assert(bool, string)"/> 22=> Debug.Assert(condition, message); 24/// <inheritdoc cref="Debug.Assert(bool, string)"/> 72Debug.Assert(false, message);
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
Roslyn.Diagnostics.Analyzers (59)
src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (2)
280Debug.Assert(_value is V, "Item must be a a V"); 315Debug.Assert(_value is V, "_value must be a V");
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (4)
19/// <inheritdoc cref="Debug.Assert(bool, string)"/> 22=> Debug.Assert(condition, message); 24/// <inheritdoc cref="Debug.Assert(bool, string)"/> 72Debug.Assert(false, message);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
133Debug.Assert(false, "Unreachable");
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
85Debug.Assert(false, message);
src\Dependencies\Collections\Internal\ArraySortHelper.cs (3)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\Dependencies\Collections\Internal\HashHelpers.cs (1)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\Dependencies\Collections\Segmented\SegmentedArray.cs (1)
491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (10)
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
277Debug.Assert(obj != null, "freeing null?"); 279Debug.Assert(_firstItem != obj, "freeing twice?"); 290Debug.Assert(value != obj, "freeing twice?");
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
321Debug.Assert(operation.Kind is OperationKind.None or OperationKind.Attribute, $"Unexpected root operation kind: {operation.Kind}");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (8)
85Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 89Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 98Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 107Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 117Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 121Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 147Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 153Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (1)
76Debug.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");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
416Debug.Assert(s_serializationVersion == 5, "After increasing the serialization version, add an upgrade path here.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (2)
185Debug.Assert(value == null || !value.GetType().GetTypeInfo().IsEnum, "Enum should not be written with WriteValue. Write them as ints instead."); 195Debug.Assert(!typeInfo.IsEnum, "Enums should not be written with WriteObject. Write them out as integers instead.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
1166Debug.Assert(parameter1.HasExplicitDefaultValue, "Expected all unspecified parameter to have default values");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (4)
492Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 499Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 532Debug.Assert(_completionRefCount == 0, $"Expected {nameof(_completionRefCount)} == 0, got {_completionRefCount}"); 560Debug.Assert(taskSet, "Complete should only be called once.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (1)
33Debug.Assert(span.Start >= start, "Bad generator.");
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
192Debug.Assert(false, message + ". " + diagnostics);
Roslyn.Diagnostics.CSharp.Analyzers (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (1)
358System.Diagnostics.Debug.Assert(false, "Invalid BinaryOperatorSpacingOptions");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
106Debug.Assert(speculativeSemanticModel != null ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
101Debug.Assert(!typeName.StripRefIfNeeded().IsVar, "'var' special case should have prevented analysis of this variable.");
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1231Debug.Assert(propertyDeclaration?.Type != null, "Property type should never be null");
Roslyn.Test.PdbUtilities (1)
EditAndContinue\EditAndContinueTest.GenerationVerifier.cs (1)
168Debug.Assert(updatedMethods.Length == 1, "Only supported for a single method update");
RunTests (4)
AssemblyScheduler.cs (1)
219Debug.Assert(tests.Any());
HelixTestRunner.cs (1)
104onOutputDataReceived: (e) => { Debug.Assert(e.Data is not null); ConsoleUtil.WriteLine(e.Data); },
ProcDumpUtil.cs (2)
16Debug.Assert(IsAdministrator()); 26Debug.Assert(IsAdministrator());
SemanticSearch.BuildTask (2)
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
Shared (25)
JsonSchemaExporter\JsonSchemaExporter.cs (9)
104Debug.Assert(typeInfo.IsReadOnly, "The specified contract must have been made read-only."); 148Debug.Assert(derivedType.TypeDiscriminator is null or int or string, "Type discriminator does not have the expected type."); 230Debug.Assert(elementTypeInfo.Type.IsEnum, "The enum keyword should only be populated by schemas for enum types."); 426Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.None, "The default case should handle unrecognize type kinds."); 639Debug.Assert(schemaType is JsonSchemaType.Integer or JsonSchemaType.Number, "schema type must be number or integer"); 640Debug.Assert(!isIeeeFloatingPoint || schemaType is JsonSchemaType.Number, "If specifying IEEE the schema type must be number"); 679Debug.Assert(converter is null || ReflectionHelpers.IsBuiltInConverter(converter), "If specified the converter must be built-in."); 708Debug.Assert(parameterTypeInfo.Type == parameter.ParameterType, "The typeInfo type must match the ParameterInfo type."); 732Debug.Assert(typeInfo.Type.IsEnum && ReflectionHelpers.IsBuiltInConverter(converter), "must be using a built-in enum converter.");
JsonSchemaExporter\JsonSchemaExporter.JsonSchema.cs (2)
455Debug.Assert(options.TransformSchemaNode != null, "context should only be populated if a callback is present."); 492Debug.Assert(_trueOrFalse is null, "Schema is not mutable");
JsonSchemaExporter\JsonSchemaExporter.ReflectionHelpers.cs (4)
38Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary, "TypeInfo must be of collection type"); 147Debug.Assert(type == typeInfo.Type, "The declaring type must match the typeInfo type."); 148Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Object, "Should only be passed object JSON kinds."); 179Debug.Assert(memberInfo is PropertyInfo or FieldInfo, "Member must be property or field.");
JsonSchemaExporter\NullabilityInfoContext\NullabilityInfoContext.cs (2)
484Debug.Assert(genericParameter.IsGenericParameter, "must be generic parameter"); 518Debug.Assert(genericParameter.IsGenericParameter && !genericParameter.IsGenericMethodParameter(), "must be generic parameter");
ServerSentEvents\ArrayBuffer.cs (1)
106Debug.Assert(byteCount <= ActiveLength, $"Expected {byteCount} <= {ActiveLength}");
ServerSentEvents\SseParser_1.cs (7)
282Debug.Assert(searchOffset >= _lineOffset, $"{searchOffset}, {_lineLength}"); 283Debug.Assert(searchOffset <= _lineOffset + _lineLength, $"{searchOffset}, {_lineOffset}, {_lineLength}"); 284Debug.Assert(searchOffset <= _lineBuffer.Length, $"{searchOffset}, {_lineBuffer.Length}"); 286Debug.Assert(searchLength >= 0, $"{searchLength}"); 287Debug.Assert(searchLength <= _lineLength, $"{searchLength}, {_lineLength}"); 292Debug.Assert(_newlineIndex - _lineOffset < _lineLength, "Expected to be positioned at a non-empty newline"); 548Debug.Assert(_lineOffset == 0, $"Expected _lineOffset == 0, got {_lineOffset}");
System.CodeDom (6)
Microsoft\CSharp\CSharpCodeGenerator.cs (1)
2400Debug.Assert(names.Length > 0);
Microsoft\VisualBasic\VBCodeGenerator.cs (2)
2326Debug.Assert(names.Length > 0); 2590Debug.Assert(_statementDepth >= 0, "statementDepth >= 0");
src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (1)
247Debug.Assert(q.Count == 1, "We should have one and only one in the rank queue.");
System\CodeDom\Compiler\CompilerInfo.cs (1)
49Debug.Assert(_providerOptions != null, "Created CompilerInfo w/ null _providerOptions");
System\CodeDom\Compiler\ExposedTabStringIndentedTextWriter.cs (1)
13Debug.Assert(tabString != null, "CodeGeneratorOptions can never have a null TabString");
System.Collections (101)
src\libraries\Common\src\System\Collections\Generic\BitHelper.cs (2)
24Debug.Assert(bitPosition >= 0); 38Debug.Assert(bitPosition >= 0);
src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
33Debug.Assert(Array.MaxLength == ArrayMaxLength);
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (3)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
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\Generic\OrderedDictionary.cs (33)
380Debug.Assert(modified); 406Debug.Assert(0 <= keyIndex && keyIndex < _count); 408Debug.Assert(_entries is not null); 413Debug.Assert(index < 0, "Expected index to be unspecied when overwriting an existing key."); 423Debug.Assert(index < 0, "Expected index to be unspecied when ignoring a duplicate key."); 434Debug.Assert(index <= _count); 444Debug.Assert(entries is not null); 474Debug.Assert(0 <= keyIndex && keyIndex < _count); 514Debug.Assert(collection is not null); 537Debug.Assert(_entries is not null); 601Debug.Assert(_entries is not null, "count must be positive, which means we must have entries"); 621Debug.Assert(key is not null, "Key nullness should have been validated by caller."); 638Debug.Assert(entries is not null, "expected entries to be is not null"); 673Debug.Assert(comparer is not null); 755Debug.Assert(_entries is not null); 783Debug.Assert(entries is not null); 805Debug.Assert(_entries is not null); 826Debug.Assert(_entries is not null); 840Debug.Assert(_comparer is not null); 941Debug.Assert(_entries is not null); 969Debug.Assert(entries is not null); 1019Debug.Assert(shiftAmount is 1 or -1); 1022Debug.Assert(entries is not null); 1086Debug.Assert(!forceNewHashCodes || !typeof(TKey).IsValueType, "Value types never rehash."); 1087Debug.Assert(newSize >= _count, "The requested size must accomodate all of the current elements."); 1112Debug.Assert(_comparer is NonRandomizedStringEqualityComparer); 1114Debug.Assert(_comparer is not null); 1115Debug.Assert(_comparer is not NonRandomizedStringEqualityComparer); 1147Debug.Assert(buckets is not null); 1182Debug.Assert(_entries is not null); 1442Debug.Assert(dictionary._entries is not null); 1521Debug.Assert(entries is not null); 1710Debug.Assert(entries is not null);
System\Collections\Generic\PriorityQueue.cs (10)
62Debug.Assert(Log2Arity > 0 && Math.Pow(2, Log2Arity) == Arity); 631Debug.Assert(_nodes.Length < minCapacity); 726Debug.Assert(_comparer is null); 727Debug.Assert(0 <= nodeIndex && nodeIndex < _size); 758Debug.Assert(_comparer is not null); 759Debug.Assert(0 <= nodeIndex && nodeIndex < _size); 792Debug.Assert(_comparer is null); 793Debug.Assert(0 <= nodeIndex && nodeIndex < _size); 840Debug.Assert(_comparer is not null); 841Debug.Assert(0 <= nodeIndex && nodeIndex < _size);
System\Collections\Generic\SortedList.cs (1)
158Debug.Assert(count == this.keys.Length);
System\Collections\Generic\SortedSet.cs (34)
96Debug.Assert(sortedSet.root != null); 355Debug.Assert(parent != null); 424Debug.Assert(parent.IsBlack); 448Debug.Assert(Node.IsNonNullBlack(sibling)); 609Debug.Assert(parent != null); 610Debug.Assert(grandParent != null); 659Debug.Assert(match != null); 664Debug.Assert(match.Right == null); 669Debug.Assert(parentOfSuccessor != null); 670Debug.Assert(successor.Left == null); 671Debug.Assert((successor.Right == null && successor.IsRed) || (successor.Right!.IsRed && successor.IsBlack)); 801Debug.Assert(set1 != null); 1139Debug.Assert(other != null); 1140Debug.Assert(HasEqualComparer(other)); 1145Debug.Assert(result); 1151Debug.Assert(other != null); 1152Debug.Assert(count >= 0 && count <= other.Length); 1168Debug.Assert(result); 1631Debug.Assert(count == GetCount()); 1665Debug.Assert(IsNonNullRed(sibling.Left) || IsNonNullRed(sibling.Right)); 1667Debug.Assert(HasChildren(current, sibling)); 1681Debug.Assert(node != null); 1682Debug.Assert(node == Left ^ node == Right); 1691Debug.Assert(Left != null); 1692Debug.Assert(Right != null); 1709Debug.Assert(removeRed.IsRed); 1714Debug.Assert(removeRed.IsRed); 1718Debug.Assert(Right!.Left!.IsRed); 1721Debug.Assert(Left!.Right!.IsRed); 1786Debug.Assert(IsRed); 1787Debug.Assert(Left!.Is2Node); 1788Debug.Assert(Right!.Is2Node); 1804Debug.Assert(HasChild(child)); 1824Debug.Assert(child1 != child2);
System\Collections\Generic\SortedSet.TreeSubSet.cs (8)
62Debug.Assert(this.versionUpToDate() && root == _underlying.FindRange(_min, _max)); 72Debug.Assert(versionUpToDate() && root == _underlying.FindRange(_min, _max)); 87Debug.Assert(versionUpToDate() && root == _underlying.FindRange(_min, _max)); 285Debug.Assert(this.versionUpToDate() && root == _underlying.FindRange(_min, _max)); 302Debug.Assert(this.versionUpToDate() && root == _underlying.FindRange(_min, _max)); 315Debug.Assert(_underlying != null); 335Debug.Assert(_underlying != null); 359Debug.Assert(versionUpToDate() && root == _underlying.FindRange(_min, _max));
System\Collections\Generic\Stack.cs (5)
111Debug.Assert(array != _array); 287Debug.Assert(_size == _array.Length); 315Debug.Assert(_array.Length < capacity); 348Debug.Assert(_size == 0); 409Debug.Assert(_index == -1 || _index == -2);
System.Collections.Concurrent (93)
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (3)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
System\Collections\Concurrent\BlockingCollection.cs (15)
212Debug.Assert(boundedCapacity > 0 || boundedCapacity == NON_BOUNDED); 226Debug.Assert(boundedCapacity > 0); 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."); 492Debug.Assert((_currentAdders & ~COMPLETE_ADDING_ON_MASK) > 0); 711Debug.Assert(_boundedCapacity != NON_BOUNDED); 767Debug.Assert(tryAddAnyReturnValue >= 0 && tryAddAnyReturnValue < collections.Length, 809Debug.Assert(tryAddAnyReturnValue >= 0 && tryAddAnyReturnValue < collections.Length, 998Debug.Assert((index == WaitHandle.WaitTimeout) || (index >= 0 && index < handles.Count)); 1033Debug.Assert(result); 1050Debug.Assert(collections != null); 1097Debug.Assert(originalWaitMillisecondsTimeout != Timeout.Infinite); 1168Debug.Assert(returnValue >= 0 && returnValue < collections.Length, 1396Debug.Assert((index == WaitHandle.WaitTimeout) || (index >= 0 && index < handles.Count));
System\Collections\Concurrent\ConcurrentBag.cs (22)
149Debug.Assert(Monitor.IsEntered(GlobalQueuesLock)); 304Debug.Assert(copied == count); 321Debug.Assert(Monitor.IsEntered(GlobalQueuesLock)); 392Debug.Assert(copied == count); 521Debug.Assert(count >= 0); 605Debug.Assert(_locals != null); 617Debug.Assert(!Monitor.IsEntered(GlobalQueuesLock)); 644Debug.Assert(Monitor.IsEntered(GlobalQueuesLock) == lockTaken); 724Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 739Debug.Assert(_tailIndex == tail, "No other thread should be changing _tailIndex"); 750Debug.Assert(_headIndex - _tailIndex <= 0); 844Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 861Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 936Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 1027Debug.Assert(Monitor.IsEntered(this)); 1028Debug.Assert(_frozen); 1029Debug.Assert(array != null); 1030Debug.Assert(arrayIndex >= 0 && arrayIndex <= array.Length); 1034Debug.Assert( 1039Debug.Assert(arrayIndex <= array.Length - count); 1060Debug.Assert(Monitor.IsEntered(this)); 1095Debug.Assert(array != null);
System\Collections\Concurrent\ConcurrentDictionary.cs (29)
308Debug.Assert(comparer is not null); 330Debug.Assert(comparer is not null); 470Debug.Assert((prev is null && curr == bucket) || prev!._next == curr); 542Debug.Assert(comparer is not null); 576Debug.Assert(comparer is not null); 638Debug.Assert(nullableHashcode is null || nullableHashcode == hashcode); 666Debug.Assert((prev is null && node == bucket) || prev!._next == node); 814Debug.Assert(index < int.MaxValue, "This method should only be called when there's no overflow risk"); 829Debug.Assert(index < int.MaxValue, "This method should only be called when there's no overflow risk"); 844Debug.Assert(index < int.MaxValue, "This method should only be called when there's no overflow risk"); 902Debug.Assert(buckets is not null); 926Debug.Assert(nullableHashcode is null || nullableHashcode == hashcode); 961Debug.Assert((prev is null && node == bucket) || prev!._next == node); 2071Debug.Assert(locksAcquired == _tables._locks.Length); 2084Debug.Assert(locksAcquired == 0); 2085Debug.Assert(!Monitor.IsEntered(locks[0])); 2101Debug.Assert(Monitor.IsEntered(locks[0])); 2102Debug.Assert(locksAcquired == 1); 2110Debug.Assert(locksAcquired == locks.Length); 2117Debug.Assert(locksAcquired >= 0); 2152Debug.Assert(i == count); 2188Debug.Assert(i == count); 2278Debug.Assert(typeof(TKey).IsValueType || comparer is not null); 2319Debug.Assert(tables is not null); 2328Debug.Assert(IsCompatibleKey<TAlternateKey>(tables)); 2342Debug.Assert(dictionary is not null); 2343Debug.Assert(IsCompatibleKey<TAlternateKey>(dictionary._tables)); 2426Debug.Assert((prev is null && node == bucket) || prev!._next == node); 2627Debug.Assert((prev is null && curr == bucket) || prev!._next == curr);
System\Collections\Concurrent\PartitionerStatic.cs (24)
418Debug.Assert(_currentChunkSize == null); 423Debug.Assert(_currentChunkSize != null); 437Debug.Assert(_localOffset.Value == _currentChunkSize.Value - 1 || _currentChunkSize.Value == 0); 458Debug.Assert(requestedChunkSize > 0 && requestedChunkSize <= _maxChunkSize); 462Debug.Assert(_currentChunkSize.Value <= requestedChunkSize && _currentChunkSize.Value > 0); 694Debug.Assert(_useSingleChunking, "Expected _useSingleChecking to be true"); 743Debug.Assert(requestedChunkSize > 0); 744Debug.Assert(!_useSingleChunking, "Did not expect to be in single-chunking mode"); 782Debug.Assert(_sharedIndex != null); //already been allocated in MoveNext() before calling GrabNextChunk 913Debug.Assert(requestedChunkSize > 0); 950Debug.Assert(_localList != null); 951Debug.Assert(_localOffset!.Value >= 0 && _localOffset.Value < _currentChunkSize.Value); 1084Debug.Assert(requestedChunkSize > 0); 1088Debug.Assert(_sharedIndex != null); 1130Debug.Assert(_sharedIndex != null); 1221Debug.Assert(_localOffset!.Value >= 0 && _localOffset.Value < _currentChunkSize.Value); 1305Debug.Assert(_localOffset!.Value >= 0 && _localOffset.Value < _currentChunkSize.Value); 1488Debug.Assert(list != null); 1514Debug.Assert(startIndex >= 0 && endIndex <= list.Count - 1); 1528Debug.Assert(_offset >= _startIndex && _offset <= _endIndex); 1546Debug.Assert(array != null); 1571Debug.Assert(startIndex >= 0 && endIndex <= array.Length - 1); 1585Debug.Assert(_offset >= _startIndex && _offset <= _endIndex); 1659Debug.Assert((DEFAULT_BYTES_PER_CHUNK % IntPtr.Size) == 0, "bytes per chunk should be a multiple of pointer size");
System.Collections.Immutable (183)
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (3)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
System\Collections\Frozen\FrozenDictionary.AlternateLookup.cs (4)
68Debug.Assert(Comparer is IAlternateEqualityComparer<TAlternateKey, TKey>, "Must have already been verified"); 84Debug.Assert(dictionary is not null); 85Debug.Assert(dictionary.Comparer is IAlternateEqualityComparer<TAlternateKey, TKey>); 86Debug.Assert(alternateLookupDelegate is not null);
System\Collections\Frozen\FrozenDictionary.cs (6)
151Debug.Assert(newDictionary is not null); 152Debug.Assert(newDictionary.Comparer.Equals(comparer)); 160Debug.Assert(source.Count > 0, "Empty sources should have been filtered out by caller"); 222Debug.Assert(minLength >= 0 && maxLength >= minLength); 391Debug.Assert(keys.Length == values.Length); 681Debug.Assert(keys.Length == values.Length);
System\Collections\Frozen\FrozenHashTable.cs (8)
30Debug.Assert(hashCodes.Length != 0); 31Debug.Assert(buckets.Length != 0); 112Debug.Assert(count == hashtableHashcodes.Length); 148Debug.Assert(hashCodes.Length != 0); 149Debug.Assert(!hashCodesAreUnique || new HashSet<int>(hashCodes.ToArray()).Count == hashCodes.Length); 173Debug.Assert(uniqueCodesCount != 0); 209Debug.Assert(maxPrimeIndexExclusive != 0); 303Debug.Assert(count > 0);
System\Collections\Frozen\FrozenSet.AlternateLookup.cs (4)
68Debug.Assert(Comparer is IAlternateEqualityComparer<TAlternate, T>, "Must have already been verified"); 84Debug.Assert(set is not null); 85Debug.Assert(set.Comparer is IAlternateEqualityComparer<TAlternate, T>); 86Debug.Assert(alternateLookupDelegate is not null);
System\Collections\Frozen\FrozenSet.cs (4)
90Debug.Assert(newSet is not null); 91Debug.Assert(newSet.Comparer.Equals(comparer)); 97Debug.Assert(source.Count > 0, "Empty sources should have been filtered out by caller"); 154Debug.Assert(minLength >= 0 && maxLength >= minLength);
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\Frozen\Int32\Int32FrozenDictionary.cs (2)
23Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<int>.Default)); 24Debug.Assert(source.Count != 0);
System\Collections\Frozen\Int32\Int32FrozenSet.cs (2)
21Debug.Assert(source.Count != 0); 22Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<int>.Default));
System\Collections\Frozen\ItemsFrozenSet.cs (1)
19Debug.Assert(source.Count != 0);
System\Collections\Frozen\KeysAndValuesFrozenDictionary.cs (1)
20Debug.Assert(source.Count != 0);
System\Collections\Frozen\SmallFrozenDictionary.cs (1)
26Debug.Assert(source.Count != 0);
System\Collections\Frozen\SmallValueTypeComparableFrozenDictionary.cs (4)
27Debug.Assert(default(TKey) is not null); 28Debug.Assert(typeof(TKey).IsValueType); 30Debug.Assert(source.Count != 0); 31Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<TKey>.Default));
System\Collections\Frozen\SmallValueTypeComparableFrozenSet.cs (5)
25Debug.Assert(default(T) is IComparable<T>); 26Debug.Assert(default(T) is not null); 27Debug.Assert(typeof(T).IsValueType); 29Debug.Assert(source.Count != 0); 30Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<T>.Default));
System\Collections\Frozen\SmallValueTypeDefaultComparerFrozenDictionary.cs (4)
20Debug.Assert(default(TKey) is not null); 21Debug.Assert(typeof(TKey).IsValueType); 23Debug.Assert(source.Count != 0); 24Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<TKey>.Default));
System\Collections\Frozen\SmallValueTypeDefaultComparerFrozenSet.cs (4)
18Debug.Assert(default(T) is not null); 19Debug.Assert(typeof(T).IsValueType); 21Debug.Assert(source.Count != 0); 22Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<T>.Default));
System\Collections\Frozen\String\Hashing.cs (1)
80Debug.Assert(KeyAnalyzer.IsAllAscii(s));
System\Collections\Frozen\String\KeyAnalyzer.cs (2)
34Debug.Assert(!uniqueStrings.IsEmpty); 246Debug.Assert(IsAllAscii(s));
System\Collections\Frozen\String\LengthBuckets.cs (2)
19Debug.Assert(comparer == EqualityComparer<string>.Default || comparer == StringComparer.Ordinal || comparer == StringComparer.OrdinalIgnoreCase); 20Debug.Assert(minLength >= 0 && maxLength >= minLength);
System\Collections\Frozen\String\LengthBucketsFrozenDictionary.AlternateLookup.cs (1)
22Debug.Assert(typeof(TAlternateKey) == typeof(ReadOnlySpan<char>));
System\Collections\Frozen\String\LengthBucketsFrozenDictionary.cs (2)
23Debug.Assert(comparer == EqualityComparer<string>.Default || comparer == StringComparer.Ordinal || comparer == StringComparer.OrdinalIgnoreCase); 35Debug.Assert(keys.Length != 0 && keys.Length == values.Length);
System\Collections\Frozen\String\LengthBucketsFrozenSet.AlternateLookup.cs (1)
22Debug.Assert(typeof(TAlternateKey) == typeof(ReadOnlySpan<char>));
System\Collections\Frozen\String\LengthBucketsFrozenSet.cs (2)
21Debug.Assert(comparer == EqualityComparer<string>.Default || comparer == StringComparer.Ordinal || comparer == StringComparer.OrdinalIgnoreCase); 32Debug.Assert(items.Length != 0);
System\Collections\Frozen\String\OrdinalStringFrozenDictionary.AlternateLookup.cs (1)
22Debug.Assert(typeof(TAlternateKey) == typeof(ReadOnlySpan<char>));
System\Collections\Frozen\String\OrdinalStringFrozenDictionary.cs (2)
30Debug.Assert(keys.Length != 0 && keys.Length == values.Length); 31Debug.Assert(comparer == EqualityComparer<string>.Default || comparer == StringComparer.Ordinal || comparer == StringComparer.OrdinalIgnoreCase);
System\Collections\Frozen\String\OrdinalStringFrozenSet.AlternateLookup.cs (1)
21Debug.Assert(typeof(TAlternateKey) == typeof(ReadOnlySpan<char>));
System\Collections\Frozen\ValueTypeDefaultComparerFrozenDictionary.cs (2)
18Debug.Assert(typeof(TKey).IsValueType); 19Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<TKey>.Default));
System\Collections\Frozen\ValueTypeDefaultComparerFrozenSet.cs (2)
15Debug.Assert(typeof(T).IsValueType); 16Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<T>.Default));
System\Collections\Immutable\ImmutableArray_1.Builder.cs (1)
1086Debug.Assert(lastIndexRemoved < indexToRemove);
System\Collections\Immutable\ImmutableArray_1.cs (4)
1496Debug.Assert(indexToRemove > lastIndexRemoved); // We require that the input be a sorted set. 1510Debug.Assert(array != null); 1511Debug.Assert(!IsEmpty); 1512Debug.Assert(!items.IsEmpty);
System\Collections\Immutable\ImmutableExtensions.Minimal.cs (3)
101Debug.Assert(sequence != null); 102Debug.Assert(array != null); 103Debug.Assert(arrayIndex >= 0 && arrayIndex <= array.Length);
System\Collections\Immutable\ImmutableHashSet_1.cs (2)
428Debug.Assert(result != null); 626Debug.Assert(result == OperationResult.SizeChanged);
System\Collections\Immutable\ImmutableList_1.Enumerator.cs (2)
201Debug.Assert(_stack != null); 275Debug.Assert(_stack != null);
System\Collections\Immutable\ImmutableList_1.Node.cs (31)
71Debug.Assert(this.IsEmpty); 86Debug.Assert(!frozen || (left._frozen && right._frozen)); 95Debug.Assert(!this.IsEmpty); 108Debug.Assert(!(_left == null ^ _right == null)); 153Debug.Assert(_left != null && _right != null); 183Debug.Assert(_left != null && _right != null); 401Debug.Assert(_left != null && _right != null); 488Debug.Assert(result != null); 501Debug.Assert(!this.IsEmpty); 1279Debug.Assert(!this.IsEmpty); 1280Debug.Assert(!_right!.IsEmpty); 1291Debug.Assert(!this.IsEmpty); 1292Debug.Assert(!_left!.IsEmpty); 1303Debug.Assert(!this.IsEmpty); 1304Debug.Assert(!_right!.IsEmpty); 1305Debug.Assert(!_right!._left!.IsEmpty); 1321Debug.Assert(!this.IsEmpty); 1322Debug.Assert(!_left!.IsEmpty); 1323Debug.Assert(!_left._right!.IsEmpty); 1343Debug.Assert(!this.IsEmpty); 1384Debug.Assert(!this.IsEmpty); 1385Debug.Assert(this.IsLeftHeavy); 1396Debug.Assert(!this.IsEmpty); 1397Debug.Assert(this.IsRightHeavy); 1413Debug.Assert(tree._left != null && tree._right != null); 1419Debug.Assert(tree._left != null); 1425Debug.Assert(tree._right != null); 1446Debug.Assert(!this.IsEmpty); 1471Debug.Assert(!this.IsEmpty); 1495Debug.Assert(!this.IsEmpty); 1535Debug.Assert(!this.IsEmpty);
System\Collections\Immutable\ImmutableQueue_1.cs (7)
52Debug.Assert(forwards != null); 53Debug.Assert(backwards != null); 64Debug.Assert(s_EmptyField.IsEmpty); 78Debug.Assert(!_forwards.IsEmpty || _backwards.IsEmpty); 90Debug.Assert(s_EmptyField.IsEmpty); 100Debug.Assert(s_EmptyField.IsEmpty); 116Debug.Assert(_backwardsReversed != null);
System\Collections\Immutable\ImmutableSortedDictionary_2.cs (1)
833Debug.Assert(this.IsEmpty);
System\Collections\Immutable\ImmutableSortedDictionary_2.Enumerator.cs (1)
210Debug.Assert(_stack != null);
System\Collections\Immutable\ImmutableSortedDictionary_2.Node.cs (13)
65Debug.Assert(this.IsEmpty); 82Debug.Assert(!frozen || (left._frozen && right._frozen)); 91Debug.Assert(!this.IsEmpty); 452Debug.Assert(!tree.IsEmpty); 471Debug.Assert(!tree.IsEmpty); 490Debug.Assert(!tree.IsEmpty); 509Debug.Assert(!tree.IsEmpty); 528Debug.Assert(!tree.IsEmpty); 543Debug.Assert(!tree.IsEmpty); 553Debug.Assert(!tree.IsEmpty); 565Debug.Assert(!tree.IsEmpty); 690Debug.Assert(_right != null && _left != null); 757Debug.Assert(_left != null && _right != null);
System\Collections\Immutable\ImmutableSortedSet_1.cs (4)
235Debug.Assert(newSet != null); 359Debug.Assert(result != null); 1144Debug.Assert(list.Count > 0); 1202Debug.Assert(list.Count > 0);
System\Collections\Immutable\ImmutableSortedSet_1.Node.cs (18)
70Debug.Assert(this.IsEmpty); 85Debug.Assert(!frozen || (left._frozen && right._frozen)); 207Debug.Assert(_left != null && _right != null); 237Debug.Assert(_left != null && _right != null); 396Debug.Assert(_left != null && _right != null); 476Debug.Assert(_left != null && _right != null); 531Debug.Assert(_left != null && _right != null); 584Debug.Assert(!tree.IsEmpty); 603Debug.Assert(!tree.IsEmpty); 622Debug.Assert(!tree.IsEmpty); 641Debug.Assert(!tree.IsEmpty); 660Debug.Assert(!tree.IsEmpty); 675Debug.Assert(!tree.IsEmpty); 685Debug.Assert(!tree.IsEmpty); 697Debug.Assert(!tree.IsEmpty); 724Debug.Assert(start >= 0); 725Debug.Assert(length >= 0); 748Debug.Assert(_left != null && _right != null);
System\Collections\Immutable\ImmutableStack_1.cs (6)
54Debug.Assert(tail != null); 67Debug.Assert(s_EmptyField.IsEmpty); 77Debug.Assert(s_EmptyField.IsEmpty); 166Debug.Assert(_tail != null); 240Debug.Assert(r != null); 241Debug.Assert(r.IsEmpty == IsEmpty);
System\Collections\Immutable\SortedInt32KeyNode.cs (11)
83Debug.Assert(!frozen || (left._frozen && right._frozen)); 265Debug.Assert(!tree.IsEmpty); 284Debug.Assert(!tree.IsEmpty); 303Debug.Assert(!tree.IsEmpty); 322Debug.Assert(!tree.IsEmpty); 341Debug.Assert(!tree.IsEmpty); 356Debug.Assert(!tree.IsEmpty); 366Debug.Assert(!tree.IsEmpty); 378Debug.Assert(!tree.IsEmpty); 471Debug.Assert(_right != null && _left != null); 538Debug.Assert(_right != null && _left != null);
System.Collections.NonGeneric (1)
System\Collections\SortedList.cs (1)
219Debug.Assert(_size == 0, "Size is not zero");
System.Collections.Specialized (14)
System\Collections\Specialized\HybridDictionary.cs (3)
101Debug.Assert(hashtable != null); 121Debug.Assert(list != null); 242Debug.Assert(hashtable != null);
System\Collections\Specialized\ListDictionary.cs (1)
256Debug.Assert(last != null);
System\Collections\Specialized\NameValueCollection.cs (2)
118Debug.Assert(list != null); 123Debug.Assert(list != null);
System\Collections\Specialized\OrderedDictionary.cs (8)
59Debug.Assert(dictionary != null); 465Debug.Assert(_arrayEnumerator.Current != null); 485Debug.Assert(_arrayEnumerator.Current != null); 497Debug.Assert(_arrayEnumerator.Current != null); 509Debug.Assert(_arrayEnumerator.Current != null); 563Debug.Assert(o != null); 584Debug.Assert(_objectsTable is not null); 590Debug.Assert(o != null);
System.ComponentModel.Annotations (13)
System\ComponentModel\DataAnnotations\EnumDataTypeAttribute.cs (1)
69Debug.Assert(valueType == value.GetType(), "The valueType should equal the Type of the value");
System\ComponentModel\DataAnnotations\MaxLengthAttribute.cs (1)
119Debug.Assert(value != null);
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 (4)
76Debug.Assert(populateErrorMessageResourceAccessor is false, "Use the default constructor instead"); 106Debug.Assert(_defaultErrorMessage is null && _errorMessageResourceName is null && _errorMessage is null && _errorMessageResourceType is null); 264Debug.Assert(_errorMessageResourceType != null); 265Debug.Assert(!string.IsNullOrEmpty(_errorMessageResourceName));
System\ComponentModel\DataAnnotations\ValidationAttributeStore.cs (2)
120Debug.Assert(type != null); 271Debug.Assert(propertyType != null);
System\ComponentModel\DataAnnotations\Validator.cs (3)
338Debug.Assert(validationContext != null); 408Debug.Assert(instance != null); 612Debug.Assert(validationContext != null);
System.ComponentModel.Composition (53)
Microsoft\Internal\Collections\CollectionServices.cs (1)
147Debug.Assert(value != null);
Microsoft\Internal\GenerationServices.cs (11)
71Debug.Assert(ilGenerator != null); 171Debug.Assert(ilGenerator != null); 190Debug.Assert(ilGenerator != null); 207Debug.Assert(ilGenerator != null); 218Debug.Assert(ilGenerator != null); 280Debug.Assert(ilGenerator != null); 294Debug.Assert(ilGenerator != null); 301Debug.Assert(ilGenerator != null); 308Debug.Assert(ilGenerator != null); 315Debug.Assert(ilGenerator != null); 322Debug.Assert(ilGenerator != null);
Microsoft\Internal\ReflectionServices.cs (5)
23Debug.Assert(member.DeclaringType != null); 34Debug.Assert(field.DeclaringType != null); 40Debug.Assert(method.DeclaringType != null); 134Debug.Assert(baseType != null); 158Debug.Assert(baseType != null);
System\ComponentModel\Composition\AttributedModelServices.cs (3)
144Debug.Assert(part != null); 186Debug.Assert(part != null); 218Debug.Assert(part != null);
System\ComponentModel\Composition\Hosting\AggregateCatalog.cs (1)
170Debug.Assert(_catalogs != null);
System\ComponentModel\Composition\Hosting\AggregateExportProvider.cs (2)
130Debug.Assert(_readOnlyProviders != null); 181Debug.Assert(exports != null);
System\ComponentModel\Composition\Hosting\AssemblyCatalog.cs (1)
470Debug.Assert(_assembly != null);
System\ComponentModel\Composition\Hosting\CatalogExportProvider.cs (2)
116Debug.Assert(_catalog != null); 720Debug.Assert(_importEngine != null);
System\ComponentModel\Composition\Hosting\CatalogExportProvider.ScopeFactoryExport.cs (1)
55Debug.Assert(childContainer.CatalogExportProvider != null);
System\ComponentModel\Composition\Hosting\ComposablePartCatalogChangeEventArgs.cs (2)
63Debug.Assert(_addedDefinitions != null); 80Debug.Assert(_removedDefinitions != null);
System\ComponentModel\Composition\Hosting\CompositionBatch.cs (2)
77Debug.Assert(_readOnlyPartsToAdd != null); 94Debug.Assert(_readOnlyPartsToRemove != null);
System\ComponentModel\Composition\Hosting\CompositionContainer.cs (1)
287Debug.Assert(_providers != null);
System\ComponentModel\Composition\Hosting\CompositionScopeDefinition.cs (2)
151Debug.Assert(_catalog != null); 183Debug.Assert(_catalog != null);
System\ComponentModel\Composition\Hosting\DirectoryCatalog.cs (3)
396Debug.Assert(_fullPath != null); 411Debug.Assert(_loadedFiles != null); 424Debug.Assert(_path != null);
System\ComponentModel\Composition\Hosting\ExportProvider.cs (1)
105Debug.Assert(exports != null);
System\ComponentModel\Composition\Hosting\ExportsChangeEventArgs.cs (2)
66Debug.Assert(_addedExports != null); 83Debug.Assert(_removedExports != null);
System\ComponentModel\Composition\Hosting\FilteredCatalog.DependenciesTraversal.cs (1)
66Debug.Assert(_exportersIndex != null);
System\ComponentModel\Composition\Hosting\FilteredCatalog.DependentsTraversal.cs (1)
70Debug.Assert(_importersIndex != null);
System\ComponentModel\Composition\Hosting\ImportSourceImportDefinitionHelpers.cs (1)
58Debug.Assert(reply != null);
System\ComponentModel\Composition\MetadataViewProvider.cs (1)
47Debug.Assert(implementationAttribute != null);
System\ComponentModel\Composition\Primitives\ComposablePartCatalog.cs (1)
116Debug.Assert(exports != null || _EmptyExportsList != null);
System\ComponentModel\Composition\Primitives\ContractBasedImportDefinition.cs (1)
215Debug.Assert(_requiredMetadata != null);
System\ComponentModel\Composition\Primitives\Export.cs (1)
173Debug.Assert(Definition.Metadata != null);
System\ComponentModel\Composition\Primitives\ExportDefinition.cs (1)
119Debug.Assert(_metadata != null);
System\ComponentModel\Composition\Primitives\ImportDefinition.cs (2)
133Debug.Assert(_contractName != null); 163Debug.Assert(_metadata != null);
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePart.cs (2)
354Debug.Assert(member != null); 479Debug.Assert(import != null);
System\ComponentModel\Composition\ReflectionModel\ReflectionModelServices.cs (1)
85Debug.Assert(reflectionParameterImportDefinition.ImportingLazyParameter != null);
System.ComponentModel.EventBasedAsync (1)
System\ComponentModel\BackgroundWorker.cs (1)
167Debug.Assert(_asyncOperation != null, "_asyncOperation not initialized");
System.ComponentModel.TypeConverter (93)
src\libraries\Common\src\System\Drawing\ColorConverterCommon.cs (2)
14Debug.Assert(culture != null); 105Debug.Assert(culture != null);
System\ComponentModel\AmbientValueAttribute.cs (1)
33Debug.Assert(IDesignerHost.IsSupported, "Runtime instantiation of this attribute is not allowed with trimming.");
System\ComponentModel\BindingList.cs (1)
519Debug.Assert(_itemTypeProperties != null);
System\ComponentModel\CultureInfoConverter.cs (4)
184Debug.Assert(invariantIndex >= 0 && invariantIndex < installedCultures.Length); 195Debug.Assert(array[0] == null); 232Debug.Assert(cultureConverter != null); 551Debug.Assert(result.Count == Count);
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 (2)
94Debug.Assert(_stream.Position != 0, "Expected the first byte to be read first"); 97Debug.Assert(_readFirstByte);
System\ComponentModel\Design\PropertyTabAttribute.cs (1)
102Debug.Assert(_tabClassNames != null);
System\ComponentModel\Design\Serialization\MemberRelationshipService.cs (3)
49Debug.Assert(source.Member != null); 62Debug.Assert(source.Member != null); 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\ExtenderProvidedPropertyAttribute.cs (4)
69Debug.Assert(other.Provider == null); 70Debug.Assert(other.ReceiverType == null); 71Debug.Assert(Provider == null); 72Debug.Assert(ReceiverType == null);
System\ComponentModel\GuidConverter.cs (1)
61Debug.Assert(ctor != null, "Expected constructor to exist.");
System\ComponentModel\Int128Converter.cs (2)
25Debug.Assert(radix == 16); 26Debug.Assert(value is not null);
System\ComponentModel\InterlockedBitVector32.cs (1)
43Debug.Assert(previous != unchecked((int)0x80000000));
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 (10)
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"); 770Debug.Assert(idx < extenderCount, "There are more extenders than we expect"); 775Debug.Assert(idx == extenderCount, "Wrong number of extenders"); 786Debug.Assert(idx < extenderCount, "There are more extenders than we expect"); 791Debug.Assert(idx == extenderCount, "Wrong number of extenders"); 912Debug.Assert(objectType != null, "Should have arg-checked before coming in here"); 925Debug.Assert(td != null); 933Debug.Assert(td != null); 1592Debug.Assert(callingType != typeof(Uri) && callingType != typeof(CultureInfo));
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)
856Debug.Assert(converter != null, "Unexpected null TypeConverter."); 866Debug.Assert(converter != null, "Unexpected null TypeConverter."); 1659Debug.Assert(type != null, "Caller should validate"); 1747Debug.Assert(instance != null, "Caller should validate"); 1846Debug.Assert(target.Next == null, "Delegating provider should always be the last provider in the chain."); 1886Debug.Assert(pipelineType != PIPELINE_ATTRIBUTES, "PipelineAttributeFilter is not supported for attributes"); 1976Debug.Assert(cache == null || list == null || !cache.Contains(s_pipelineFilterKeys[pipelineType]), "Earlier pipeline stage should have removed our cache"); 2034Debug.Assert(suffix != null, "Name collision with non-extender property."); 2937Debug.Assert(newAttrs[idx] != null, "_attributes contains a null member"); 3108Debug.Assert(attrs != null, "Someone should have handled this"); 3119Debug.Assert(className != null, "Someone should have handled this"); 3139Debug.Assert(converter != null, "Someone should have handled this"); 3181Debug.Assert(events != null, "Someone should have handled this"); 3193Debug.Assert(events != null, "Someone should have handled this"); 3205Debug.Assert(properties != null, "Someone should have handled this"); 3219Debug.Assert(properties != null, "Someone should have handled this");
System\ComponentModel\UInt128Converter.cs (2)
25Debug.Assert(radix == 16); 26Debug.Assert(value is not null);
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 (3)
System\Composition\Hosting\CompositionHost.cs (1)
27Debug.Assert(rootLifetimeContext != null);
System\Composition\Hosting\Core\CompositionDependency.cs (1)
142Debug.Assert(IsError, "Should be in error state.");
System\Composition\Hosting\Core\CompositionOperation.cs (1)
74Debug.Assert(sharingLock != null, "Expected a sharing lock to be passed.");
System.Composition.Runtime (2)
System\Composition\Runtime\Util\Formatters.cs (2)
24Debug.Assert(closedGenericType != null); 25Debug.Assert(closedGenericType.IsConstructedGenericType);
System.Configuration.ConfigurationManager (111)
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\Configuration\ApplicationSettingsBase.cs (1)
694Debug.Assert(provider != null, "Could not determine provider from which settings were loaded");
System\Configuration\BaseConfigurationRecord.cs (32)
454Debug.Assert(inputsPerConfigKey.Count > 0, "We won't get here unless we have inputs."); 546Debug.Assert(!_parent.IsInitDelayed, "!_parent.IsInitDelayed"); 652Debug.Assert(!sectionRecord.HasIndirectLocationInputs, 777Debug.Assert(requestIsHere || !checkPermission, "requestIsHere || !checkPermission"); 780Debug.Assert(getRuntimeObject, "getRuntimeObject == true"); 781Debug.Assert(requestIsHere, "requestIsHere == true"); 797Debug.Assert(!sectionRecord.HasErrors, "!sectionRecord.HasErrors"); 944Debug.Assert(factoryRecord != null, "factoryRecord != null"); 957Debug.Assert(factoryRecord != null, "factoryRecord != null"); 963Debug.Assert(!checkPermission || (factoryRecord != null), 1016Debug.Assert(success || getLkg, "success || getLkg"); 1020Debug.Assert(getLkg, "getLkg == true"); 1049Debug.Assert(!requestIsHere, "!requestIsHere"); 1089Debug.Assert(getLkg, "getLkg == true"); 1162Debug.Assert(!factoryRecord.HasErrors, "!factoryRecord.HasErrors"); 1165Debug.Assert(sectionRecord.HasInput, "sectionRecord.HasInput"); 1173Debug.Assert(!(IsLocationConfig && getLkg), 1183Debug.Assert(!sectionRecord.HasErrors, "!sectionRecord.HasErrors"); 1223Debug.Assert(IsLocationConfig, 1276Debug.Assert((locationInputs != null) || (indirectLocationInputs != null), 1297Debug.Assert(getLkg, "getLkg == true"); 1612Debug.Assert(_protectedConfig != null, 1674Debug.Assert(tConfigRecord._parent.IsRootConfig, 1728Debug.Assert(!rootFactoryRecord.HasErrors, "!rootFactoryRecord.HasErrors"); 2171Debug.Assert(UrlPath.IsSubpath(_parent.ConfigPath, input.SectionXmlInfo.TargetConfigPath)); 2249Debug.Assert(FindFactoryRecord(configKey, true) != null); 2265Debug.Assert(mode != OverrideMode.Inherit); // Remember that the default is never Inherit 2280Debug.Assert(mode != OverrideMode.Inherit); 2622Debug.Assert(!positionedAtNextElement, "!positionedAtNextElement"); 3668Debug.Assert(factoryRecord.HasErrors, 3750Debug.Assert(x.SectionXmlInfo.ConfigKey == y.SectionXmlInfo.ConfigKey); 3778Debug.Assert(StringUtil.EqualsIgnoreCase(yTargetConfigPath, xTargetConfigPath));
System\Configuration\ClientSettingsStore.cs (1)
70Debug.Assert(settingsGroup != null, "Failed to declare settings group");
System\Configuration\ConfigPathUtility.cs (5)
60Debug.Assert(string.IsNullOrEmpty(parentConfigPath) || IsValid(parentConfigPath), 62Debug.Assert(string.IsNullOrEmpty(childConfigPath) || IsValid(childConfigPath), 76Debug.Assert(IsValid(configPath), "IsValid(configPath)"); 86Debug.Assert(string.IsNullOrEmpty(configPath) || IsValid(configPath), 96Debug.Assert(index != configPath.Length - 1);
System\Configuration\ConfigurationElement.cs (10)
182Debug.Assert(Properties.Contains(propertyName), "Properties.Contains(propertyName)"); 732Debug.Assert(type != null, "type != null"); 762Debug.Assert(propertyInformation != null, "propertyInformation != null"); 785Debug.Assert((type != null) && (validator != null)); 786Debug.Assert(typeof(ConfigurationElement).IsAssignableFrom(type)); 796Debug.Assert(!s_perTypeValidators.ContainsKey(type)); 810Debug.Assert(root != null); 821Debug.Assert(elem != null); 1710Debug.Assert(prop != null, "prop != null"); 1711Debug.Assert(reader != null, "reader != null");
System\Configuration\ConfigurationProperty.cs (2)
70Debug.Assert(info != null, "info != null"); 150Debug.Assert(propertyAttribute != null, "attribProperty != null");
System\Configuration\ConfigurationValidatorAttribute.cs (1)
54Debug.Assert(_declaringType == declaringType,
System\Configuration\ConfigXmlReader.cs (1)
32Debug.Assert(!_lineNumberIsConstant || (_lineOffset > 0),
System\Configuration\ContextInformation.cs (1)
16Debug.Assert(configRecord != null, "configRecord != null");
System\Configuration\ErrorsHelper.cs (2)
23Debug.Assert(e != null, "e != null"); 53Debug.Assert(errors.Count != 0, "errors.Count != 0");
System\Configuration\InfiniteIntConverter.cs (1)
21Debug.Assert(data is string, "data is string");
System\Configuration\Internal\InternalConfigRoot.cs (2)
184Debug.Assert(!_hierarchyLock.IsWriterLockHeld, "!_hierarchyLock.IsWriterLockHeld"); 207Debug.Assert(!_hierarchyLock.IsReaderLockHeld, "!_hierarchyLock.IsReaderLockHeld");
System\Configuration\LocalFileSettingsProvider.cs (1)
358Debug.Assert(groupName != null, "SettingsContext did not have a GroupName!");
System\Configuration\MgmtConfigurationRecord.cs (28)
338Debug.Assert(sectionRecord != null); 342Debug.Assert(input.HasResult, "input.HasResult"); 349Debug.Assert(IsLocationConfig, "Indirect location inputs exist only in location config record"); 351Debug.Assert(input != null); 352Debug.Assert(input.HasResult, "input.HasResult"); 381Debug.Assert(!current.IsRootConfig, "An immediate parent result should have been found"); 965Debug.Assert(filename.Length > 0, "The caller should make sure that filename is not empty"); 1397Debug.Assert(!factoryRecord.IsUndeclared, "!factoryRecord.IsUndeclared"); 1398Debug.Assert(!IsImplicitSection(factoryRecord.ConfigKey), 1427Debug.Assert(!IsImplicitSection(sectionRecord.ConfigKey), 1429Debug.Assert(!factoryRecord.IsUndeclared, "!factoryRecord.IsUndeclared"); 1799Debug.Assert(sectionRecord.HasFileInput || sectionRecord.HasLocationInputs, 1821Debug.Assert(sectionRecord.HasFileInput || sectionRecord.HasLocationInputs, 1984Debug.Assert(!IsImplicitSection(configKey), "We should never write out an implicit section"); 2080Debug.Assert(IsLocationConfig, "IsLocationConfig"); 2209Debug.Assert((reader.NodeType == XmlNodeType.Element) && (reader.Name == ConfigurationTag), 2270Debug.Assert( 2345Debug.Assert( 2350Debug.Assert(!l.SectionUpdates.HasUnretrievedSections(), 2410Debug.Assert(!IsImplicitSection(configKey), "We should never write out an implicit section"); 2469Debug.Assert(!IsImplicitSection(configKey), "We should never write out an implicit section"); 2551Debug.Assert(groupUpdate.UpdatedXml == null, "groupUpdate.UpdatedXml == null"); 2552Debug.Assert(!declarationUpdatesChild.HasUnretrievedSections(), 2638Debug.Assert(locationPathApplies, nameof(locationPathApplies)); 2707Debug.Assert(LocationSubPath == null); 2731Debug.Assert(allowOverrideAttribute == null, 2983Debug.Assert(update.SectionRecord.HasFileInput, "update.SectionRecord.HasFileInput"); 3024Debug.Assert(hasFile, "hasFile");
System\Configuration\OverrideModeSetting.cs (3)
114Debug.Assert((x._mode & ApiDefinedAny) != 0); 192Debug.Assert(useLegacy || ((_mode & ApiDefinedNewMode) != 0)); 204Debug.Assert(useLegacy || ((_mode & XmlDefinedNewMode) != 0));
System\Configuration\SchemeSettingInternal.cs (1)
15Debug.Assert(name != null, "'name' must not be null.");
System\Configuration\SectionRecord.cs (1)
168Debug.Assert(sectionInput != null);
System\Configuration\SectionUpdates.cs (1)
37Debug.Assert(string.IsNullOrEmpty(_name), "FindSectionUpdates assumes search is from root record");
System\Configuration\UpdateConfigHost.cs (1)
33Debug.Assert(!string.IsNullOrEmpty(oldStreamname));
System\Configuration\ValidatorUtils.cs (1)
69Debug.Assert(resolution > 0, "resolution > 0");
System\Configuration\XmlUtil.cs (8)
109Debug.Assert(trueLinePosition > 0, "trueLinePosition > 0"); 364Debug.Assert(Reader.NodeType == XmlNodeType.Element, "Reader.NodeType == XmlNodeType.Element"); 397Debug.Assert(Reader.Depth == depth, "We should be at the same depth as the opening Element"); 452Debug.Assert(Reader.NodeType == XmlNodeType.Element, "_reader.NodeType == XmlNodeType.Element"); 507Debug.Assert(Reader.NodeType == XmlNodeType.Element, "_reader.NodeType== XmlNodeType.Element"); 722Debug.Assert(utilWriter.TrackPosition, 831Debug.Assert(Reader.NodeType == XmlNodeType.Element, 866Debug.Assert(Reader.NodeType == XmlNodeType.Element, "_reader.NodeType == NodeType.Element");
System\Diagnostics\ListenerElementsCollection.cs (3)
57Debug.Assert((listenerElement != null), "adding elements other than ListenerElement to ListenerElementsCollection?"); 184Debug.Assert(_allowReferences, "_allowReferences must be true if type name is null"); 310Debug.Assert(_allowReferences, "_allowReferences must be true if type name is null");
System\Diagnostics\TraceUtils.cs (2)
112Debug.Assert(tiexc.InnerException != null, "ill-formed TargetInvocationException!"); 127Debug.Assert(tiexc.InnerException != null, "ill-formed TargetInvocationException!");
System.Console (48)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
13Debug.Assert(errorInfo.Error != Error.SUCCESS); 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.GetPwUid.cs (1)
69Debug.Assert(passwd.Name != null);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 281Debug.Assert(additionalCapacityBeyondPos > 0); 282Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (1)
101Debug.Assert(passwd.HomeDirectory != null);
System\Console.cs (3)
198Debug.Assert(!Monitor.IsEntered(s_syncObject)); 578Debug.Assert(s_sigQuitRegistration is null); 986Debug.Assert(ctx.Signal == PosixSignal.SIGINT || ctx.Signal == PosixSignal.SIGQUIT);
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 (12)
256Debug.Assert(left >= 0); 433Debug.Assert(!Console.IsInputRedirected); 476Debug.Assert(!string.IsNullOrEmpty(TerminalFormatStrings.CursorPositionReport)); 513Debug.Assert(readBytesPos > 0 && readBytesPos <= readBytes.Length); 514Debug.Assert(escPos == 0 && bracketPos > escPos && semiPos > bracketPos && rPos > semiPos); 515Debug.Assert(readBytes[escPos] == Esc); 516Debug.Assert(readBytes[bracketPos] == '['); 517Debug.Assert(readBytes[semiPos] == ';'); 518Debug.Assert(readBytes[rPos] == 'R'); 605Debug.Assert(foundByteDstPos < foundByteDst.Length, "Should only be called when there's room for at least one byte."); 943Debug.Assert(result <= buffer.Length); 951Debug.Assert(handle is not null);
System\IO\ConsoleStream.cs (1)
18Debug.Assert(access == FileAccess.Read || access == FileAccess.Write);
System\IO\KeyParser.cs (3)
21Debug.Assert(length > 0); 371Debug.Assert(single != 'b' && single != '\t' && single != '\n' && single != '\r'); 384Debug.Assert(single == default || char.IsBetween(single, (char)28, (char)31));
System\IO\StdInReader.cs (7)
37Debug.Assert(!Console.IsInputRedirected); // stdin is a terminal. 75Debug.Assert(_endIndex > 0); 91Debug.Assert(result >= 0 && result <= bufferSize); // may be 0 if hits EOL 130Debug.Assert(!buffer.IsEmpty); 151Debug.Assert(_tmpKeys.Count == 0); 152Debug.Assert(consumeKeys || _availableKeys.Count == 0); 340Debug.Assert(_availableKeys.Count == 0);
System\IO\SyncTextReader.cs (1)
20Debug.Assert(reader != null);
System\IO\SyncTextReader.Unix.cs (1)
18Debug.Assert(inner != null);
System\TermInfo.cs (5)
188Debug.Assert(char.IsAsciiDigit(format[pos])); 199Debug.Assert(char.IsAsciiDigit(format[pos])); 207Debug.Assert(format[pos + 2] == '\''); 298Debug.Assert(format[pos] == 'e' || format[pos] == ';'); 361Debug.Assert(arg is string || arg is int);
System\TermInfo.Database.cs (3)
110Debug.Assert(index >= 0); 135Debug.Assert(name != null); 147Debug.Assert(index >= 0);
System.Data.Common (923)
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 (12)
142Debug.Assert(storageType == GetStorageType(type), "Incorrect storage type specified"); 297Debug.Assert(typeCode == GetStorageType(dataType), "Incorrect storage type specified"); 381Debug.Assert(storageType != StorageType.Empty); 465Debug.Assert(result == dataType.IsValueType, "typeCode mismatches dataType"); 478Debug.Assert(typeCode == GetStorageType(dataType), "typeCode mismatches dataType"); 505Debug.Assert(nullable == typeof(INullable).IsAssignableFrom(dataType), "INullable"); 506Debug.Assert(changeTracking == typeof(System.ComponentModel.IChangeTracking).IsAssignableFrom(dataType), "IChangeTracking"); 507Debug.Assert(revertibleChangeTracking == typeof(System.ComponentModel.IRevertibleChangeTracking).IsAssignableFrom(dataType), "IRevertibleChangeTracking"); 508Debug.Assert(xmlSerializable == typeof(IXmlSerializable).IsAssignableFrom(dataType), "IXmlSerializable"); 513Debug.Assert(dataType != null, "Type should not be null"); 524Debug.Assert(typeCode == GetStorageType(dataType), "typeCode mismatches dataType"); 595Debug.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\DbConnectionStringBuilder.cs (4)
150Debug.Assert(keyword != null); 447Debug.Assert(reflected != null); 476Debug.Assert(keyword != null); 561Debug.Assert(property != null);
System\Data\Common\DbDataAdapter.cs (23)
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"); 1366Debug.Assert(rowUpdatedEvent.Rows != null); 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\DbDataReaderExtensions.cs (1)
80Debug.Assert(row != null);
System\Data\Common\DbDataSource.cs (2)
103Debug.Assert(wrappedCommand.Connection is not null); 362Debug.Assert(wrappedBatch.Connection is not null);
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\FieldNameLookup.cs (1)
31Debug.Assert(null != fieldNames[i]);
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"); 424Debug.Assert(xmlReader is DataTextReader, "Invalid DataTextReader is being passed to customer"); 508Debug.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"); 118Debug.Assert(!DataStorage.IsObjectNull(value), "we should have null here"); 119Debug.Assert((value.GetType() == typeof(SqlBinary)), "wrong input type");
System\Data\Common\SQLTypes\SQlBooleanStorage.cs (3)
93Debug.Assert(null != value, "null value"); 152Debug.Assert(!DataStorage.IsObjectNull(value), "we should have null here"); 153Debug.Assert((value.GetType() == typeof(SqlBoolean)), "wrong input type");
System\Data\Common\SQLTypes\SQLBytesStorage.cs (2)
116Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 117Debug.Assert((value.GetType() == typeof(SqlBytes)), "wrong input type");
System\Data\Common\SQLTypes\SQLByteStorage.cs (3)
168Debug.Assert(null != value, "null value"); 228Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 229Debug.Assert((value.GetType() == typeof(SqlByte)), "wrong input type");
System\Data\Common\SQLTypes\SQLCharsStorage.cs (2)
119Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 120Debug.Assert((value.GetType() == typeof(SqlChars)), "wrong input type");
System\Data\Common\SQLTypes\SQLDateTimeStorage.cs (3)
95Debug.Assert(null != value, "null value"); 154Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 155Debug.Assert((value.GetType() == typeof(SqlDateTime)), "wrong input type");
System\Data\Common\SQLTypes\SQLDecimalStorage.cs (3)
167Debug.Assert(null != value, "null value"); 226Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 227Debug.Assert((value.GetType() == typeof(SqlDecimal)), "wrong input type");
System\Data\Common\SQLTypes\SQLDoubleStorage.cs (3)
168Debug.Assert(null != value, "null value"); 227Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 228Debug.Assert((value.GetType() == typeof(SqlDouble)), "wrong input type");
System\Data\Common\SQLTypes\SQLGuidStorage.cs (3)
60Debug.Assert(null != value, "null value"); 119Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 120Debug.Assert((value.GetType() == typeof(SqlGuid)), "wrong input type");
System\Data\Common\SQLTypes\SQLInt16Storage.cs (3)
168Debug.Assert(null != value, "null value"); 227Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 228Debug.Assert((value.GetType() == typeof(SqlInt16)), "wrong input type");
System\Data\Common\SQLTypes\SQLInt32Storage.cs (3)
168Debug.Assert(null != value, "null value"); 227Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 228Debug.Assert((value.GetType() == typeof(SqlInt32)), "wrong input type");
System\Data\Common\SQLTypes\SQLInt64Storage.cs (3)
169Debug.Assert(null != value, "null value"); 228Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 229Debug.Assert((value.GetType() == typeof(SqlInt64)), "wrong input type");
System\Data\Common\SQLTypes\SQLMoneyStorage.cs (3)
168Debug.Assert(null != value, "null value"); 227Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 228Debug.Assert((value.GetType() == typeof(SqlMoney)), "wrong input type");
System\Data\Common\SQLTypes\SQLSingleStorage.cs (3)
166Debug.Assert(null != value, "null value"); 225Debug.Assert(!DataStorage.IsObjectNull(value), "we should have null here"); 226Debug.Assert((value.GetType() == typeof(SqlSingle)), "wrong input type");
System\Data\Common\SQLTypes\SQLStringStorage.cs (3)
115Debug.Assert(null != value, "null value"); 180Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 181Debug.Assert((value.GetType() == typeof(SqlString)), "wrong input type");
System\Data\Common\SqlUDTStorage.cs (2)
191Debug.Assert(xmlReader is DataTextReader, "Invalid DataTextReader is being passed to customer"); 228Debug.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 (5)
32Debug.Assert(table != null); 284Debug.Assert(constraint != null, "Attempt to add null constraint to constraint array"); 564Debug.Assert(a1 != null && a2 != null, "Invalid Arguments"); 667Debug.Assert(name != null); 795Debug.Assert(constr._parentTableName != null);
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 (42)
405Debug.Assert(!string.IsNullOrEmpty(_encodedColumnName)); 456Debug.Assert(value != null); 647Debug.Assert(_defaultValue != null, "It should not have been set to null."); 859Debug.Assert(null != _storage, "no storage"); 868Debug.Assert(null != _storage, "no storage"); 877Debug.Assert(null != _storage, "no storage"); 888Debug.Assert(_simpleType.CanHaveMaxLength(), "expected simpleType to be string"); 1028Debug.Assert(2 <= _sortIndex.RefCount, "bad sortIndex refcount"); 1096Debug.Assert(table != null || !Unique); 1131Debug.Assert(null != _storage, "null storage"); 1139Debug.Assert(null != _storage, "no storage"); 1140Debug.Assert(null != value, "setting null, expecting dbnull"); 1142Debug.Assert(null != _table, "storage with no DataTable on column"); 1172Debug.Assert(null != _storage, "no storage"); 1181Debug.Assert(null != value, "setting null, expecting dbnull"); 1182Debug.Assert(null != _table, "storage with no DataTable on column"); 1183Debug.Assert(null != _storage, "no storage"); 1201Debug.Assert(null != _storage, "no storage"); 1240Debug.Assert(oldConstraint != null, "Should have found a column to remove from the collection."); 1255Debug.Assert(_table.Constraints.FindKeyConstraint(this) == null, "Should not be a duplication constraint in collection"); 1377Debug.Assert(IsStringType, "not a String or SqlString column"); 1397Debug.Assert(IsStringType, "not a String or SqlString column"); 1452Debug.Assert(null != _storage, "no storage"); 1472Debug.Assert(null != _storage, "null storage"); 1503Debug.Assert(null != _storage, "null storage"); 1509Debug.Assert(null != _storage, "null storage"); 1515Debug.Assert(null != _storage, "null storage"); 1592Debug.Assert(null != _storage, "no storage"); 1602Debug.Assert(null != _storage, "no storage"); 1637Debug.Assert(null != _storage, "no storage"); 1649Debug.Assert(rels != null, "Invalid ParentRelations"); 1653Debug.Assert(key.HasValue, "Invalid child key (null)"); 1661Debug.Assert(rels != null, "Invalid ChildRelations"); 1665Debug.Assert(key.HasValue, "Invalid parent key (null)"); 1762Debug.Assert(s != null, "Caller is responsible for missing element/attribute case"); 1777Debug.Assert(value != null && (value != DBNull.Value), "Caller is responsible for checking on DBNull"); 1785Debug.Assert(value != null && (value != DBNull.Value), "Caller is responsible for checking on DBNull"); 1796Debug.Assert(null != _storage, "no storage"); 1810Debug.Assert(!_dependentColumns.Contains(expressionColumn), "duplicate column - expected to be unique"); 1826Debug.Assert(_table != null); 1835Debug.Assert(null != col, "null datacolumn in expression dependencies"); 1964Debug.Assert(null != value && DataColumn.IsAutoIncrementType(value.GetType()) && !(value is BigInteger), "unexpected value for autoincrement");
System\Data\DataColumnCollection.cs (3)
548Debug.Assert(col.Computed, "invalid (non an expression) column in the expression dependent columns"); 821Debug.Assert(name != null); 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 (5)
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."); 716Debug.Assert(destination != null);
System\Data\DataRelationCollection.cs (2)
399Debug.Assert(name != null); 628Debug.Assert(relation != null);
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\DataRowComparer.cs (5)
96Debug.Assert(!ReferenceEquals(a, b)); 97Debug.Assert(a != null); 98Debug.Assert(b != null); 99Debug.Assert(a.Length == b.Length); 186Debug.Assert(row.Table != null);
System\Data\DataSet.cs (11)
328Debug.Assert(info != null); 878Debug.Assert(null != _culture, "DataSet.Locale: null culture"); 1318Debug.Assert(value && !_rowChanges[index], "setting twice or to false"); 1350Debug.Assert(0 <= bitMatrix[i].HasChanges, "negative change count"); 1362Debug.Assert(bitMatrix[i].HasChanges <= table.Rows.Count, "to many changes"); 1400Debug.Assert(DataRowState.Added == rowState || 2278Debug.Assert(root.NamespaceURI != null, "root.NamespaceURI should not ne null, it should be empty string"); 2514Debug.Assert(reader.NodeType != XmlNodeType.Whitespace, "Should not be on Whitespace node"); 3008Debug.Assert(dataSet != null); 3026Debug.Assert(dataSet != null); 3078Debug.Assert(table != null);
System\Data\DataTable.cs (74)
279Debug.Assert(ds.RemotingFormat == SerializationFormat.Xml, "RemotingFormat must be SerializationFormat.Xml"); 329Debug.Assert(ds.Tables.Count == 1, "There should be exactly 1 table here"); 455Debug.Assert(Columns.Count == 0, "There is column in Table"); 524Debug.Assert(DataSet != null); 554Debug.Assert(fk != null); 625Debug.Assert(con.Equals("F")); 868Debug.Assert(bitStates != null); 869Debug.Assert(bitStates.Length > bitIndex); 899Debug.Assert(Rows.Count > rowIndex); 900Debug.Assert(rowErrors != null); 901Debug.Assert(colErrors != null); 930Debug.Assert(Rows.Count > rowIndex); 931Debug.Assert(rowErrors != null); 932Debug.Assert(colErrors != null); 945Debug.Assert(columnsInError.Length == columnErrors.Length); 1409Debug.Assert(null != _culture, "null culture"); 1480Debug.Assert(null != culture, "SetLocaleValue: no locale"); 1569Debug.Assert(nRel.Length == _nestedParentRelations.Length, "nestedParent cache is broken"); 1572Debug.Assert(null != nRel[i], "null relation"); 1573Debug.Assert(null != _nestedParentRelations[i], "null relation"); 1574Debug.Assert(nRel[i] == _nestedParentRelations[i], "unequal relations"); 1636Debug.Assert(2 <= primayKeyConstraint.ConstraintIndex.RefCount, "bad primaryKey index RefCount"); 1730Debug.Assert(_primaryKey == null || Constraints.FindConstraint(_primaryKey) == _primaryKey, "PrimaryKey is not in ConstraintCollection"); 2098Debug.Assert(value != null, "Value should not be null ??"); 2099Debug.Assert(value.ColumnMapping == MappingType.SimpleContent, "should be text node here"); 2143Debug.Assert(ndx != null); 2163Debug.Assert(action == DataRowAction.Delete, "Unexpected SetNewRecord action in merge function."); 2250Debug.Assert(saveIdxRecord == ((saveRowState == DataRowState.Added) ? targetRow._newRecord : targetRow._oldRecord), "oops, you change index record without noticing it"); 2400Debug.Assert(clone != null, "The table passed in has to be newly created empty DataTable."); 2842Debug.Assert(null == _rowDiffId, "wasn't previously cleared"); 3131Debug.Assert(Enum.GetUnderlyingType(typeof(DataRowState)) == typeof(int), "Invalid DataRowState type"); 3373Debug.Assert(key.HasValue); 3556Debug.Assert(e != null, "e should not be null"); 3566Debug.Assert(e != null, "e should not be null"); 3622Debug.Assert((null != e) && ((null != _onRowChangedDelegate) || IsTypedDataTable), "OnRowChanged arguments"); 3635Debug.Assert((null != e) && ((null != _onRowChangingDelegate) || IsTypedDataTable), "OnRowChanging arguments"); 3648Debug.Assert((null != e) && ((null != _onRowDeletingDelegate) || IsTypedDataTable), "OnRowDeleting arguments"); 3661Debug.Assert((null != e) && ((null != _onRowDeletedDelegate) || IsTypedDataTable), "OnRowDeleted arguments"); 3764Debug.Assert(record != -1, "Record number must be given"); 3790Debug.Assert(oldIndex.Length == newIndex.Length, "Size oldIndexes and newIndexes should be the same"); 3791Debug.Assert(oldIndex.Length == _shadowIndexes!.Count, "Size of OldIndexes should be the same as size of Live indexes"); 4065Debug.Assert(null != _indexes, "unexpected null indexes"); 4284Debug.Assert(row != null, "Row can't be null."); 4299Debug.Assert(fireEvent, "SetNewRecord is called with wrong parameter"); 4305Debug.Assert(!row._inChangingEvent, "How can this row be in an infinite loop?"); 4556Debug.Assert(1 <= _shadowCount, "unexpected negative shadow count"); 4568Debug.Assert(0 == _shadowCount, "unexpected count"); 4574Debug.Assert(1 <= _shadowCount, "unexpected negative shadow count"); 4583Debug.Assert(0 < _indexes.Count, "unexpected"); 4606Debug.Assert(null == _loadIndex, "loadIndex should already be null"); 4695Debug.Assert(2 <= _loadIndex.RefCount, "bad loadIndex.RefCount"); 4702Debug.Assert(row != null, "Row can't be null for index record"); 4758Debug.Assert(_loadIndexwithCurrentDeleted != null, "loadIndexwithCurrentDeleted should not be null"); 4769Debug.Assert(_loadIndexwithOriginalAdded != null, "loadIndexwithOriginalAdded should not be null"); 4775Debug.Assert(2 <= indextoUse!.RefCount, "bad indextoUse.RefCount"); 4810Debug.Assert(row != null, "Row can't be null for index record"); 4883Debug.Assert(parentKey != null, "AddForeignKey: Invalid parameter.. related primary key is null"); 5036Debug.Assert(result.Max >= result.Min); 5201Debug.Assert(dataRow._tempRecord == recordNo, "tempRecord has been changed in event handler"); 5537Debug.Assert(tableList != null, "tableList shouldnot be null"); 6592Debug.Assert(DataSet != null); 6830Debug.Assert(_targetTable == null, "do not reuse this section"); 6831Debug.Assert(table != null); 6832Debug.Assert(table._rowDiffId == null, "rowDiffId wasn't previously cleared"); 6834Debug.Assert(t_usedTables == null || !t_usedTables.Contains(table), 6852Debug.Assert(t_usedTables != null && t_usedTables.Contains(_targetTable), "missing Prepare before Cleanup"); 6870Debug.Assert(t_usedTables != null, message); 6881Debug.Assert(_targetDS == null, "do not reuse this section"); 6882Debug.Assert(ds != null); 6894Debug.Assert(!RowDiffIdUsageSection.t_usedTables.Contains(table), "Nested call with same table can cause data corruption!"); 6897Debug.Assert(table._rowDiffId == null, "rowDiffId wasn't previously cleared"); 6909Debug.Assert(RowDiffIdUsageSection.t_usedTables != null, "missing Prepare before Cleanup"); 7074Debug.Assert(column._table != null); 7075Debug.Assert(column.Computed, "Only computed columns should be re-evaluated.");
System\Data\DataTableCollection.cs (2)
618Debug.Assert(_list.Count == tableList.Count, "Both lists should have equal numbers of tables"); 737Debug.Assert(name != null);
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 (3)
76Debug.Assert(!isDataViewable || table != null, "isDataViewable bug table is null"); 104Debug.Assert(null != enumerableRows, "null enumerableRows"); 280Debug.Assert(pred != null);
System\Data\EnumerableRowCollectionExtensions.cs (1)
153Debug.Assert(source != null);
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 (3)
144Debug.Assert(IsConstant()); 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 (5)
260Debug.Assert(row.Table.DataSet != null); 360Debug.Assert(row.Table.DataSet != null); 405Debug.Assert(Table?.DataSet != null && row.Table.DataSet != null); 498Debug.Assert(Table?.DataSet != null); 759Debug.Assert(Table == RelatedTable, "We call this clone just if we have the same datatable as parent and child ");
System\Data\LinqDataView.cs (3)
39Debug.Assert(table != null, "null DataTable"); 111Debug.Assert(base.Sort != null); 112Debug.Assert(!(!string.IsNullOrEmpty(base.Sort) && base.SortComparison != null),
System\Data\Merger.cs (6)
45Debug.Assert(_dataSet != null); 234Debug.Assert(_dataSet != null); 269Debug.Assert(MissingSchemaAction.Ignore == _missingSchemaAction, "MergeSchema failed"); 469Debug.Assert(_dataSet != null); 521Debug.Assert(_dataSet != null); 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 (26)
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"); 310Debug.Assert(_readerDataValues != null); 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"); 566Debug.Assert(_dataTable != null); 567Debug.Assert(_fieldNames != null); 568Debug.Assert(_tableMapping != null); 762Debug.Assert(_dataTable != null); 763Debug.Assert(_schemaTable != null); 764Debug.Assert(_fieldNames != null); 765Debug.Assert(_tableMapping != null); 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 (20)
60Debug.Assert(_candidateColumns != null); 183Debug.Assert(_candidateColumns != null); 237Debug.Assert(_candidateColumns != null); 316Debug.Assert(_candidateColumns != null); 475Debug.Assert(_candidateColumns != null); 480Debug.Assert(_matchedCandidates > 0 && _matchedCandidates <= lenId, "BuildLinearExpression : Invalid Index"); 484Debug.Assert(canColumn != null && canColumn.expr != null, "BuildLinearExpression : Must be a matched candidate"); 515Debug.Assert(_candidateColumns != null); 563Debug.Assert(!needSorting, "What are we doing here if no real reuse of this index ?"); 707default: Debug.Assert(true, "Unsupported Binary Search Operator!"); break; 714Debug.Assert(_index != null && _candidateColumns != null); 739Debug.Assert(candidateColumn != null, "How come this is not a candidate column"); 740Debug.Assert(candidateColumn.expr != null, "How come there is no associated expression"); 750Debug.Assert(_index != null); 769Debug.Assert(_index != null); 787Debug.Assert(_index != null); 793Debug.Assert(_matchedCandidates <= _index._indexFields.Length, "GetBinaryFilteredRecords : Invalid Index"); 800Debug.Assert(lo <= hi, "GetBinaryFilteredRecords : Invalid Search Results"); 806Debug.Assert(_index != null); 835Debug.Assert(_index != null);
System\Data\Selection.cs (27)
19Debug.Assert(column != null, "null column"); 113Debug.Assert(indexFields != null); 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\SortExpressionBuilder.cs (6)
52Debug.Assert(keySelector != null); 53Debug.Assert(compare != null); 64Debug.Assert(_currentSelector != null); 65Debug.Assert(_currentComparer != null); 97Debug.Assert(a != null && b != null && a.Count == Count); 119Debug.Assert(_selectors.Count == _comparers.Count);
System\Data\SQLTypes\SQLBinary.cs (3)
42Debug.Assert(!copy); 374Debug.Assert(length >= 0); 379Debug.Assert(rgbValue.Length >= length);
System\Data\SQLTypes\SQLBoolean.cs (1)
131Debug.Assert(x.m_value == x_Null);
System\Data\SQLTypes\SQLBytes.cs (5)
460Debug.Assert(_state >= SqlBytesCharsState.Null && _state <= SqlBytesCharsState.Stream); 467Debug.Assert((_lCurLen >= 0 && _lCurLen <= x_lMaxLen) || FStream()); 468Debug.Assert(FStream() || (_rgbBuf != null && _lCurLen <= _rgbBuf.Length)); 469Debug.Assert(!FStream() || (_lCurLen == x_lNull)); 478Debug.Assert(FStream());
System\Data\SQLTypes\SQLChars.cs (6)
425Debug.Assert(_state >= SqlBytesCharsState.Null && _state <= SqlBytesCharsState.Stream); 432Debug.Assert((_lCurLen >= 0 && _lCurLen <= x_lMaxLen) || FStream()); 433Debug.Assert(FStream() || (_rgchBuf != null && _lCurLen <= _rgchBuf.Length)); 434Debug.Assert(!FStream() || (_lCurLen == x_lNull)); 436Debug.Assert(_rgchWorkBuf == null || _rgchWorkBuf.Length == 1); 450Debug.Assert(FStream());
System\Data\SQLTypes\SQLDateTime.cs (2)
121Debug.Assert(timeticks == s_maxTime + 1); 242Debug.Assert(time == s_maxTime + 1);
System\Data\SQLTypes\SQLDecimal.cs (26)
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"); 786Debug.Assert(rglData.Length >= 4); 834Debug.Assert(!IsNull); 840Debug.Assert(!IsNull); 1252Debug.Assert(ResInteger <= MaxPrecision); 1256Debug.Assert(ResScale <= MaxScale); 1265Debug.Assert(ResPrec - ResInteger >= 0); 1315Debug.Assert(dwlAccum < s_ulInt32Base); 1515Debug.Assert(dwlAccum < s_ulInt32Base * 2); 1518Debug.Assert(dwlAccum < s_ulInt32Base); // can never final accum > 1 more UI4 1534Debug.Assert(s_NUMERIC_MAX_PRECISION == ResPrec); 2096Debug.Assert(Prec == 9 || Prec == 18 || Prec == 27); 2168Debug.Assert(dwlAccum < s_ulInt32Base); 2237Debug.Assert(dwlAccum < dwlDivisor); 2239Debug.Assert((dwlAccum / dwlDivisor) < s_ulInt32Base); 2266Debug.Assert(dwlAccum < s_ulInt32Base); 2504Debug.Assert(iulX > s_uiZero); 2537Debug.Assert(rgulU.Length == s_cNumeMax); 2605Debug.Assert(rgulU.Length == s_cNumeMax); 2606Debug.Assert(rgulD.Length == s_cNumeMax); 3018Debug.Assert(uiDigit < 10); 3025Debug.Assert(rguiData.Length == 4); 3034Debug.Assert(_bPrec >= 1);
System\Data\SQLTypes\SQLGuid.cs (4)
118Debug.Assert(!x.IsNull); 119Debug.Assert(!y.IsNull); 124Debug.Assert(xWrote); 128Debug.Assert(yWrote);
System\Data\SQLTypes\SQLInt64.cs (2)
164Debug.Assert(lHigh2 == 0); 171Debug.Assert(lHigh1 == 0);
System\Data\SQLTypes\SQLMoney.cs (1)
83Debug.Assert(snum.Scale == s_iMoneyScale);
System\Data\SQLTypes\SQLString.cs (4)
263Debug.Assert(!IsNull); 728Debug.Assert(cbX % 2 == 0); 729Debug.Assert(cbY % 2 == 0); 775Debug.Assert(!x.IsNull && !y.IsNull);
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\TypeLimiter.cs (4)
25Debug.Assert(scope != null); 200Debug.Assert(allowedTypes != null); 223Debug.Assert(type != null); 265Debug.Assert(type != 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)
692Debug.Assert(table != null, "Table to be loaded is null on LoadTopMostTable() entry"); 693Debug.Assert(_topMostNode != null, "topMostNode is null on LoadTopMostTable() entry"); 694Debug.Assert(!_isDiffgram, "Diffgram mode is on while we have topMostNode table. This is bad."); 709Debug.Assert(entryDepth >= 0, "Wrong entry Depth for top most element."); 877Debug.Assert(table != null, "Table to be loaded is null on LoadTable() entry");
System\Data\XMLDiffLoader.cs (2)
33Debug.Assert(reader.LocalName == Keywords.MSD_ERRORS && reader.NamespaceURI == Keywords.DFFNS, "something fishy"); 70Debug.Assert(reader.LocalName == Keywords.MSD_ERRORS && reader.NamespaceURI == Keywords.DFFNS, "something fishy");
System\Data\xmlsaver.cs (15)
799Debug.Assert(nodeApp != null, "Need to create <application..> node first."); 1018Debug.Assert(ds == null || dt == null); 1019Debug.Assert(_dsElement != null); 1243Debug.Assert(_prefixes != null); 1425Debug.Assert(_prefixes != null); 1426Debug.Assert(_dc != null); 1431Debug.Assert(col.ColumnMapping != MappingType.SimpleContent, "Illegal state"); 1729Debug.Assert(_prefixes != null); 1730Debug.Assert(_dc != null); 1731Debug.Assert(_dsElement != null); 2805Debug.Assert(_ds != null || _dt != null); 2849Debug.Assert(_ds != null || _dt != null); 2942Debug.Assert(_xmlw != null); 3108Debug.Assert(value != null, "Value can not be null"); 3324Debug.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"); 851Debug.Assert(schemaSet.Count == 1, "there should be one schema"); 923Debug.Assert(child == table, "table not the same"); 1072Debug.Assert(ct.BaseXmlSchemaType is XmlSchemaSimpleType, "Expected SimpleType or ComplexType"); 1090Debug.Assert(cContent is XmlSchemaComplexContentRestriction, "Expected complexContent extension or restriction"); 1102Debug.Assert(ct.ContentModel is XmlSchemaSimpleContent, "expected simpleContent or complexContent"); 1113Debug.Assert(ct.BaseXmlSchemaType is XmlSchemaSimpleType, "Expected SimpleType or ComplexType"); 1119Debug.Assert(cContent is XmlSchemaSimpleContentRestriction, "Expected SimpleContent extension or restriction"); 1156Debug.Assert(cContent is XmlSchemaComplexContentRestriction, "Expected complexContent extension or restriction"); 1162Debug.Assert(ct.ContentModel is XmlSchemaSimpleContent, "expected simpleContent or complexContent"); 1537Debug.Assert((node is XmlSchemaElement) || (node is XmlSchemaAttribute), "GetInstanceName should only be called on attribute or elements"); 1548Debug.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 (23)
52Debug.Assert(rowElem != null); 53Debug.Assert(rowElem.Row != null); 71Debug.Assert(rowElem.Row != null); 85Debug.Assert(_node == _doc || _node.OwnerDocument == _doc); 96Debug.Assert(node == _doc || node.OwnerDocument == _doc); 107Debug.Assert(node == _doc || node.OwnerDocument == _doc); 414Debug.Assert(name != null); 472Debug.Assert(name != null); 705Debug.Assert(_column == null); 710Debug.Assert(_column == null); 715Debug.Assert(_column == null); 732Debug.Assert(_column == null); 737Debug.Assert(_column == null); 742Debug.Assert(_column == null); 756Debug.Assert(_column == null); 780Debug.Assert(_column == null); 801Debug.Assert(_column == null); 822Debug.Assert(_column == null); 843Debug.Assert(rowElem != null); 846Debug.Assert(row != null); 849Debug.Assert(state == ElementState.Defoliated, "Region is accessed using column, but it's state is FOLIATED"); 853Debug.Assert(!Convert.IsDBNull(row[_column, rowVersion])); 856Debug.Assert((_column.ColumnMapping == MappingType.SimpleContent) ? _fOnValue : true);
System\Xml\DataSetMappper.cs (10)
32Debug.Assert(_dataSet == null); 89Debug.Assert(elem != null); 103Debug.Assert(rowElem.Row != null); 117Debug.Assert(a.Prefix != null && a.Prefix.Length == 0); 118Debug.Assert(a.NamespaceURI == (object)strReservedXmlns); 122Debug.Assert(a.NamespaceURI == (object)strReservedXmlns); 126Debug.Assert(a.NamespaceURI == (object)strReservedXmlns); 151Debug.Assert(rowElem != null); 153Debug.Assert((node is XmlBoundElement) ? ((XmlBoundElement)node).Row == null : true); 241Debug.Assert(rowElem.Row != null);
System\Xml\RegionIterator.cs (17)
25Debug.Assert(rowElement != null && rowElement.Row != null); 39Debug.Assert(oldState != ElementState.None); 48Debug.Assert(CurrentNode != null); 50Debug.Assert((oldState == ElementState.Defoliated) ? (_rowElement.ElementState == ElementState.Defoliated) : true); 72Debug.Assert(oldState != ElementState.None); 80Debug.Assert((oldState == ElementState.Defoliated) ? (_rowElement.ElementState == ElementState.Defoliated) : true); 83Debug.Assert(CurrentNode != null); 98Debug.Assert((oldState == ElementState.Defoliated) ? (_rowElement.ElementState == ElementState.Defoliated) : true); 105Debug.Assert(nextNode.NextSibling != null); 109Debug.Assert((oldState == ElementState.Defoliated) ? (_rowElement.ElementState == ElementState.Defoliated) : true); 113Debug.Assert(CurrentNode != null); 122Debug.Assert(CurrentNode != null); 123Debug.Assert(CurrentNode.NodeType == XmlNodeType.Element); 138Debug.Assert(oldState != ElementState.None); 145Debug.Assert((oldState == ElementState.Defoliated) ? (_rowElement.ElementState == ElementState.Defoliated) : true); 151Debug.Assert(!XmlDataDocument.Helpers.IsTextLikeNode(n)); 155Debug.Assert((oldState == ElementState.Defoliated) ? (_rowElement.ElementState == ElementState.Defoliated) : true);
System\Xml\TreeIterator.cs (2)
18Debug.Assert(nodeTop != null); 72Debug.Assert(nextNode.NextSibling != null);
System\Xml\XmlBoundElement.cs (4)
227Debug.Assert(element is XmlBoundElement); 267Debug.Assert(dp.NodeType == XmlNodeType.Element); 307Debug.Assert(dp.NodeType == XmlNodeType.Element); 380Debug.Assert(((IXmlDataVirtualNode)dp).IsOnColumn(null));
System\Xml\XmlDataDocument.cs (130)
56Debug.Assert(_pointers.ContainsValue(pointer) == false); 66Debug.Assert(temp != null); 102Debug.Assert(_dataSet == null); 103Debug.Assert(ds != null); 193Debug.Assert(_ignoreXmlEvents); 208Debug.Assert(DocumentElement == null || !fLoadFromDataSet); 241Debug.Assert(_fDataRowCreatedSpecial == false); 242Debug.Assert(_fBoundToDataSet == false && _fBoundToDocument == false); 249Debug.Assert(_fDataRowCreatedSpecial); 267Debug.Assert(_dataSet != null); 344Debug.Assert((_fBoundToDataSet == false) && (_fBoundToDocument == false)); 346Debug.Assert(_fBoundToDataSet ? _fBoundToDocument : (!_fBoundToDocument)); 360Debug.Assert(_fDataRowCreatedSpecial == false); 374Debug.Assert(be != null); 402Debug.Assert(rowElem.Row != null); 435Debug.Assert(_mapper.GetColumnSchemaForNode(rowElem, node) != null); 444Debug.Assert((node is XmlBoundElement) && (((XmlBoundElement)node).Row != null)); 490Debug.Assert(_ignoreXmlEvents); 492Debug.Assert(GetRowFromElement(DocumentElement) != null); 500Debug.Assert(docElem.LastChild == docElem.FirstChild); 518Debug.Assert(!_mapper.IsMapped()); 519Debug.Assert(!_fBoundToDocument); 520Debug.Assert(!_fBoundToDataSet); 532Debug.Assert(_fDataRowCreatedSpecial == false); 533Debug.Assert(_mapper.IsMapped()); 534Debug.Assert(_fBoundToDataSet && _fBoundToDocument); 538Debug.Assert(fAssociateDataRowOld == _fAssociateDataRow); 564Debug.Assert(fIsChildConnected == IsConnected(childElem)); 565Debug.Assert(IsRowLive(r) ? IsConnected(childElem) : !IsConnected(childElem)); 575Debug.Assert(newState == ElementState.WeakFoliation || newState == ElementState.StrongFoliation); 588Debug.Assert(rowElemState == ElementState.StrongFoliation || rowElemState == ElementState.WeakFoliation); 608Debug.Assert(node.Row != null); 654Debug.Assert(node.Row != null); 655Debug.Assert(node.Row.RowState != DataRowState.Deleted); 707Debug.Assert(col.ColumnMapping == MappingType.SimpleContent); 826Debug.Assert(c == row.Table.XmlText); 830Debug.Assert(cTextCols == 0 || cTextCols == 1); 832Debug.Assert(row.Table.XmlText == null); 880Debug.Assert(be != null); 896Debug.Assert(pointer != null); 956Debug.Assert(DataSet.EnforceConstraints == false); 968Debug.Assert(newNode != null); 986Debug.Assert(_ignoreDataSetEvents); 987Debug.Assert(_ignoreXmlEvents); 988Debug.Assert(IsFoliationEnabled == false); 1029Debug.Assert(clone.FirstChild == null); 1191Debug.Assert(reader is XmlTextReader); 1217Debug.Assert(DocumentElement != null); 1254Debug.Assert(r.Element == null); 1289Debug.Assert(node != null); 1299Debug.Assert(r == null); 1307Debug.Assert(be.Row != null); 1326Debug.Assert(row.RowState == DataRowState.Detached); 1337Debug.Assert(row.RowState == DataRowState.Detached); 1348Debug.Assert(row.Element == null); 1350Debug.Assert(row.RowState == DataRowState.Detached); 1357Debug.Assert(row.Element == null); 1370Debug.Assert(tb != null); 1380Debug.Assert(_ignoreXmlEvents); 1383Debug.Assert(rowElement != null); 1389Debug.Assert(rowElement != null); 1435Debug.Assert((pointer != null) && !((IXmlDataVirtualNode)pointer).IsOnColumn(col)); 1518Debug.Assert(e != null); 1578Debug.Assert(relation.ChildTable == row.Table); 1587Debug.Assert(args.Row.RowState != DataRowState.Deleted); 1605Debug.Assert(be != null); 1622Debug.Assert(row != null); 1623Debug.Assert(rowElement != null); 1651Debug.Assert(_ignoreXmlEvents); 1695Debug.Assert(pointer != null); 1724Debug.Assert(child.Element == childElement && childElement.Row == child); 1726Debug.Assert(_ignoreXmlEvents); 1756Debug.Assert(colInParent != null); 1770Debug.Assert(fChildElementConnected == IsConnected(childElement)); 1771Debug.Assert(IsRowLive(child) ? IsConnected(childElement) : !IsConnected(childElement)); 1794Debug.Assert(DataSet.EnforceConstraints == false); 1830Debug.Assert(DataSet.EnforceConstraints == false); 1843Debug.Assert(oldParent == null); 1884Debug.Assert(DataSet.EnforceConstraints == false); 1893Debug.Assert(args.NewParent == null); 1957Debug.Assert(!IsRowLive(row)); 1966Debug.Assert(!IsRowLive(be.Row)); 1998Debug.Assert(rowElement != null); 2209Debug.Assert(!(args.Action == CollectionChangeAction.Add || args.Action == CollectionChangeAction.Remove) || rel!.Nested == false); 2257Debug.Assert(child.ParentNode != prevSibling.ParentNode); 2259Debug.Assert(prevSibling.ParentNode != null); 2260Debug.Assert(IsFoliationEnabled == false); 2261Debug.Assert(IgnoreXmlEvents); 2263Debug.Assert(prevSibling != DocumentElement); 2267Debug.Assert(child.ParentNode == null); 2274Debug.Assert(parent != null); 2275Debug.Assert(parent.NodeType != XmlNodeType.Attribute); // We need to get the grand-parent region 2276Debug.Assert(parent != DocumentElement); // We cannot promote children of the DocumentElement 2286Debug.Assert(iter.CurrentNode is XmlBoundElement && ((XmlBoundElement)(iter.CurrentNode)).Row != null); 2296Debug.Assert(parent != null); 2379Debug.Assert(col.ColumnMapping != MappingType.Hidden); 2389Debug.Assert(xmlText != null); 2390Debug.Assert(row.Table.DataSet!.EnforceConstraints == false); 2396Debug.Assert(oVal != null && !(oVal is DBNull)); 2419Debug.Assert(row != null); 2456Debug.Assert(rowElement != null); 2457Debug.Assert(rowElement.Row != null); 2458Debug.Assert(DataSet.EnforceConstraints == false); 2461Debug.Assert(row != null); 2505Debug.Assert(c.Table == row.Table); 2694Debug.Assert(rowElemList[0] != null && rowElemList[0] is XmlBoundElement); 2698Debug.Assert(subRowElem != null); 2713Debug.Assert(!IsRowLive(be.Row!)); 2723Debug.Assert(rowElemList[0] != null && rowElemList[0] is XmlBoundElement); 2745Debug.Assert(rowElem.Row != null); 2756Debug.Assert(row.Table.DataSet!.EnforceConstraints == false); 2780Debug.Assert(row.Table.DataSet!.EnforceConstraints == false); 2801Debug.Assert(IsRowLive(rowElem.Row)); 2807Debug.Assert(rowElem.Row != null); 2818Debug.Assert(row.Table.DataSet!.EnforceConstraints == false); 2852Debug.Assert(!IsRowLive(rowElem.Row)); 2862Debug.Assert(row != null); 2878Debug.Assert(row != null); 2880Debug.Assert(row.RowState == DataRowState.Detached || row.RowState == DataRowState.Deleted); 2889Debug.Assert(childRowElem.Row != null); 2905Debug.Assert(parentRowElem.Row != null); 2945Debug.Assert(node.OwnerDocument == this || node == this); 2963Debug.Assert(be.IsFoliated); 2985Debug.Assert(IsRowLive(rowElement.Row)); 2990Debug.Assert(rowElement!.Row != null); 2991Debug.Assert(IsRowLive(rowElement.Row)); 3008Debug.Assert(!IsRowLive(rowElement.Row)); 3013Debug.Assert(rowElement!.Row != null); 3014Debug.Assert(!IsRowLive(rowElement.Row)); 3080Debug.Assert(tableList[readPos] != null, "Temp Array is not supposed to reach to null");
System\Xml\XPathNodePointer.cs (32)
51Debug.Assert(XmlDataDocument.Helpers.IsTextNode(node.NodeType)); 87Debug.Assert(xnt != -1); 107Debug.Assert(owner != null); 438Debug.Assert(rowElem != null); 439Debug.Assert(rowElem.Row != null); 455Debug.Assert(rowElem.Row != null); 479Debug.Assert(node == _doc || node.OwnerDocument == _doc); 488Debug.Assert(node == _doc || node.OwnerDocument == _doc); 608Debug.Assert(_node.Attributes != null); 690Debug.Assert(xntInt != -1); 713Debug.Assert(xntInt != -1); 733Debug.Assert(_column.ColumnMapping != MappingType.Attribute && _column.ColumnMapping != MappingType.Hidden); 1017Debug.Assert(_parentOfNS != null); 1105Debug.Assert(other.NodeType != XPathNodeType.Namespace); 1120Debug.Assert(NodeType != XPathNodeType.Namespace); 1141Debug.Assert(_fOnValue != other._fOnValue); 1149Debug.Assert(Row == other.Row); //in the same row 1164Debug.Assert(curNode1 != null); 1165Debug.Assert(curNode2 != null); 1283Debug.Assert(_column != null); 1468Debug.Assert(curAttr.NamespaceURI == StrReservedXmlns); 1470Debug.Assert(attrs != null); 1572Debug.Assert(_parentOfNS != null); 1577Debug.Assert(_column.Namespace == StrReservedXmlns); 1581Debug.Assert(be != null); 1583Debug.Assert(curRow != null); 1606Debug.Assert(attr != null); 1654Debug.Assert(rowElem != null); 1657Debug.Assert(row != null); 1661Debug.Assert(!Convert.IsDBNull(row[_column, rowVersion])); 1664Debug.Assert((_column.ColumnMapping == MappingType.SimpleContent) ? _fOnValue : true); 1667Debug.Assert(!_fOnValue);
System.Data.Odbc (215)
Common\System\Data\Common\AdapterUtil.Odbc.cs (2)
391Debug.Assert(null != value, "null value on conversion failure"); 392Debug.Assert(null != inner, "null inner on conversion failure");
Common\System\Data\Common\DbConnectionOptions.cs (1)
441Debug.Assert(!_useOdbcRules, "ExpandKeyword not ready for Odbc");
Common\System\Data\Common\DBConnectionString.cs (14)
67Debug.Assert(null != connectionOptions, "null connectionOptions"); 286Debug.Assert(!_hasPassword || ContainsKey(KEY.Password) || ContainsKey(KEY.Pwd), "OnDeserialized password mismatch this"); 287Debug.Assert(null == entry || !entry._hasPassword || entry.ContainsKey(KEY.Password) || entry.ContainsKey(KEY.Pwd), "OnDeserialized password mismatch entry"); 299Debug.Assert(combinedSet != null, "The combined connection string should not be null"); 309Debug.Assert(!combinedSet._restrictionValues.Except(componentSet._restrictionValues).Any(), "Combined set allows values not allowed by component set"); 328Debug.Assert(!combinedSet._restrictionValues.Intersect(componentSet._restrictionValues).Any(), "Combined values allows values prevented by component set"); 335Debug.Assert(!componentSet._restrictionValues.Except(combinedSet._restrictionValues).Any(), "Combined values does not prevent all of the values prevented by the component set"); 357Debug.Assert(!_hasPassword || ContainsKey(KEY.Password) || ContainsKey(KEY.Pwd), "OnDeserialized password mismatch this"); 358Debug.Assert(!entry._hasPassword || entry.ContainsKey(KEY.Password) || entry.ContainsKey(KEY.Pwd), "OnDeserialized password mismatch entry"); 442Debug.Assert(null != a && 0 < a.Length, "empty a"); 443Debug.Assert(null != b && 0 < b.Length, "empty b"); 537Debug.Assert(!string.IsNullOrEmpty(restrictionValues[i - 1]), "empty restriction"); 538Debug.Assert(!string.IsNullOrEmpty(restrictionValues[i]), "empty restriction"); 539Debug.Assert(0 >= StringComparer.Ordinal.Compare(restrictionValues[i - 1], restrictionValues[i]));
Common\System\Data\Common\DbConnectionStringCommon.cs (2)
157Debug.Assert(null != value, "ConvertToBoolean(null)"); 196Debug.Assert(null != value, "ConvertToIntegratedSecurity(null)");
Common\System\Data\ProviderBase\DbBuffer.cs (38)
61Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment"); 89Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment"); 115Debug.Assert(0 == offset % 4, "invalid alignment"); 147Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment"); 148Debug.Assert(null != destination, "null destination"); 149Debug.Assert(startIndex + length <= destination.Length, "destination too small"); 180Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment"); 181Debug.Assert(null != destination, "null destination"); 182Debug.Assert(startIndex + length <= destination.Length, "destination too small"); 213Debug.Assert(0 == offset % 2, "invalid alignment"); 239Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment"); 240Debug.Assert(null != destination, "null destination"); 241Debug.Assert(startIndex + length <= destination.Length, "destination too small"); 265Debug.Assert(0 == offset % 4, "invalid alignment"); 291Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment"); 292Debug.Assert(null != destination, "null destination"); 293Debug.Assert(startIndex + length <= destination.Length, "destination too small"); 317Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment"); 343Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment"); 385Debug.Assert(null != structure, "null structure"); 388Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment"); 412Debug.Assert(0 == offset % 4, "invalid alignment"); 436Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment"); 437Debug.Assert(null != source, "null source"); 438Debug.Assert(startIndex + length <= source.Length, "source too small"); 462Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment"); 463Debug.Assert(null != source, "null source"); 464Debug.Assert(startIndex + length <= source.Length, "source too small"); 493Debug.Assert(0 == offset % 2, "invalid alignment"); 517Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment"); 518Debug.Assert(null != source, "null source"); 519Debug.Assert(startIndex + length <= source.Length, "source too small"); 543Debug.Assert(0 == offset % 4, "invalid alignment"); 567Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment"); 568Debug.Assert(null != source, "null source"); 569Debug.Assert(startIndex + length <= source.Length, "source too small"); 593Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment"); 617Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
Common\System\Data\ProviderBase\DbConnectionFactory.cs (1)
15Debug.Assert(null != owningConnection, "null owningConnection?");
Common\System\Data\ProviderBase\DbConnectionInternal.cs (3)
24Debug.Assert(1 == activateCount, "activated multiple times?"); 68Debug.Assert(null != owningObject, "null owningObject"); 69Debug.Assert(null != connectionFactory, "null connectionFactory");
Common\System\Data\ProviderBase\DbConnectionPool.cs (19)
139Debug.Assert(null != connectionPoolGroup, "null connectionPoolGroup"); 300Debug.Assert(obj != null, "null connection is not expected"); 330Debug.Assert(obj != null, "null connection is not expected"); 333Debug.Assert(!obj.IsEmancipated, "pooled object not in pool"); 334Debug.Assert(obj.CanBePooled, "pooled object is not poolable"); 363Debug.Assert(obj != null, "null connection is not expected"); 368Debug.Assert(obj != null, "null connection is not expected"); 417Debug.Assert(oldConnectionPool._state == State.ShuttingDown, "Old connections pool should be shutting down"); 457Debug.Assert(timerIsNotDisposed, "ErrorCallback timer has been disposed"); 488Debug.Assert(_state == State.Running || _state == State.ShuttingDown); 530Debug.Assert(destroyObject == false); 543Debug.Assert(returnToGeneralPool || destroyObject); 556Debug.Assert(removed, "attempt to DestroyObject not in list"); 645Debug.Assert(connection != null, "connection should never be null in success case"); 789Debug.Assert(2 == CREATION_HANDLE, "creation handle changed value"); 907Debug.Assert(obj != null, "null connection is not expected"); 912Debug.Assert(obj != null, "null connection is not expected"); 1012Debug.Assert(null != obj, "why are we adding a null object to the pool?"); 1022Debug.Assert(null != obj, "null obj?");
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");
src\libraries\Common\src\System\Data\ProviderBase\DbConnectionClosed.cs (1)
100Debug.Assert(retry.Task.Status == TaskStatus.RanToCompletion, "retry task must be completed successfully");
src\libraries\Common\src\System\Data\ProviderBase\DbConnectionFactory.cs (17)
64Debug.Assert(key != null, "key cannot be null"); 83Debug.Assert(null != owningConnection, "null owningConnection?"); 84Debug.Assert(null != poolGroup, "null poolGroup?"); 97Debug.Assert(null != pool, "null pool?"); 119Debug.Assert(key != null, "key cannot be null"); 134Debug.Assert(Monitor.IsEntered(s_pendingOpenNonPooled), $"Expected {nameof(s_pendingOpenNonPooled)} lock to be held."); 142Debug.Assert(null != owningObject, "null owningObject?"); 143Debug.Assert(null != connectionPoolGroup, "null connectionPoolGroup?"); 161Debug.Assert(null != connectionOptions, "prevent expansion of connectionString"); 164Debug.Assert(null != connectionPoolGroup, "null connectionPoolGroup?"); 234Debug.Assert(!connectionPoolGroup.IsDisabled, "Disabled pool entry discovered"); 237Debug.Assert(null != connectionPoolGroup, "how did we not create a pool entry?"); 238Debug.Assert(null != userConnectionOptions, "how did we not have user connection options?"); 309Debug.Assert(!entry.Value.IsDisabled, "Disabled pool entry discovered"); 333Debug.Assert(null != pool, "null pool?"); 352Debug.Assert(null != poolGroup, "null poolGroup?"); 367Debug.Assert(connectionPoolGroup != null, "connectionPoolGroup may not be null.");
src\libraries\Common\src\System\Data\ProviderBase\DbConnectionInternal.cs (5)
110Debug.Assert(_pooledCount <= 1 && _pooledCount >= -1, "Pooled count for object is invalid"); 221Debug.Assert(Pool != null); 258Debug.Assert(outerConnection != null, "outerConnection may not be null."); 261Debug.Assert(metaDataFactory != null, "metaDataFactory may not be null."); 378Debug.Assert(!IsEmancipated, "pooled object not in pool");
src\libraries\Common\src\System\Data\ProviderBase\DbConnectionPoolGroup.cs (4)
48Debug.Assert(null != connectionOptions, "null connection options"); 181Debug.Assert(addResult, "No other pool with current identity should exist at this point"); 187Debug.Assert(PoolGroupStateDisabled == _state, "state should be disabled"); 197Debug.Assert(PoolGroupStateActive == _state, "state should be active since a pool exists and lock holds");
src\libraries\Common\src\System\Data\ProviderBase\DbMetaDataFactory.cs (3)
115Debug.Assert(requestedCollectionRow != null); 315Debug.Assert(dataSourceInfoTable.TableName == DbMetaDataCollectionNames.DataSourceInformation); 390Debug.Assert(_metaDataCollectionsDataSet != null);
src\libraries\Common\src\System\Data\ProviderBase\DbReferenceCollection.cs (8)
23Debug.Assert(!HasTarget, "Entry already has a valid target"); 24Debug.Assert(tag != 0, "Bad tag"); 25Debug.Assert(target != null, "Invalid target"); 88Debug.Assert(null != value && 0 != tag, "AddItem with null value or 0 tag"); 99Debug.Assert(_items[i].HasTarget, "missing expected target"); 121Debug.Assert(_items[i].HasTarget, "missing expected target"); 204Debug.Assert(!_items[index].HasTarget, "Unexpected target after notifying"); 234Debug.Assert(null != value, "RemoveItem with null");
src\libraries\Common\src\System\Data\ProviderBase\TimeoutTimer.cs (5)
47Debug.Assert(timeout != null); // Need a valid timeouttimer if no error 58Debug.Assert(0 <= milliseconds); 68Debug.Assert(timeout != null); // Need a valid timeouttimer if no error 81Debug.Assert(0 <= seconds || InfiniteTimeout == seconds); // no need to support negative seconds at present 162Debug.Assert(0 <= milliseconds); // This property guarantees no negative return values
System\Data\Odbc\Odbc32.cs (1)
722Debug.Assert(retcode != ODBC32.SQLRETURN.INVALID_HANDLE, "retcode must never be ODBC32.RetCode.INVALID_HANDLE");
System\Data\Odbc\OdbcCommand.cs (2)
253Debug.Assert(null == _cmdWrapper, "has CMDWrapper when setting connection"); 410Debug.Assert(null != _connection, "GetStatementHandle without connection?");
System\Data\Odbc\OdbcCommandBuilder.cs (1)
293Debug.Assert(adapter is OdbcDataAdapter, "!OdbcDataAdapter");
System\Data\Odbc\OdbcConnection.cs (8)
43Debug.Assert(null == _connectionHandle, "reopening a connection?"); 158Debug.Assert(null != this.PoolGroup, "PoolGroup must never be null when accessing ProviderInfo"); 267Debug.Assert((escapeCharString.Length <= 1), "Can't handle multichar quotes"); 280Debug.Assert((quoteCharString.Length <= 1), "Can't handle multichar quotes"); 518Debug.Assert(retcode != ODBC32.SQLRETURN.INVALID_HANDLE, "retcode must never be ODBC32.RetCode.INVALID_HANDLE"); 552Debug.Assert(null == e, "success exception"); 555Debug.Assert(null != e, "failure without exception"); 780Debug.Assert((short)odbcFunction != 0, "SQL_API_ALL_FUNCTIONS is not supported");
System\Data\Odbc\OdbcConnectionFactory.cs (4)
39Debug.Assert(!string.IsNullOrEmpty(connectionString), "empty connectionString"); 58Debug.Assert(internalConnection != null, "internalConnection may not be null."); 61Debug.Assert(odbcOuterConnection != null, "outer connection may not be null."); 68Debug.Assert(XMLStream != null, "XMLstream may not be null.");
System\Data\Odbc\OdbcConnectionHandle.cs (3)
58Debug.Assert(HandleState.Connected <= _handleState, "AutoCommitOff while in wrong state?"); 189Debug.Assert(HandleState.Allocated == _handleState, "SQLDriverConnect while in wrong state?"); 221Debug.Assert(HandleState.Allocated == _handleState, "not expected HandleState.Allocated");
System\Data\Odbc\OdbcConnectionHelper.cs (10)
124Debug.Assert(null != value, "null poolGroup"); 199Debug.Assert(DbConnectionClosedConnecting.SingletonInstance == _innerConnection, "not connecting"); 207Debug.Assert(null != userConnectionOptions, "null UserConnectionOptions"); 217Debug.Assert(null != _innerConnection, "null InnerConnection"); 218Debug.Assert(null != to, "to null InnerConnection"); 248Debug.Assert(null != _innerConnection, "null InnerConnection"); 249Debug.Assert(null != from, "from null InnerConnection"); 250Debug.Assert(null != to, "to null InnerConnection"); 257Debug.Assert(null != _innerConnection, "null InnerConnection"); 258Debug.Assert(null != to, "to null InnerConnection");
System\Data\Odbc\OdbcConnectionPoolProviderInfo.cs (1)
86Debug.Assert(_quoteChar != null, "QuoteChar getter called but no quote char was set");
System\Data\Odbc\OdbcDataReader.cs (24)
61Debug.Assert(command != null, "Command null on OdbcDataReader ctor"); 359Debug.Assert(null != Connection, "null cmd connection"); 966Debug.Assert(lengthOrIndicator >= 0 || lengthOrIndicator == ODBC32.SQL_NO_TOTAL, "unexpected lengthOrIndicator value"); 1009Debug.Assert(lengthOrIndicator >= 0 || lengthOrIndicator == ODBC32.SQL_NO_TOTAL, "unexpected lengthOrIndicator value"); 1023Debug.Assert(cbMissing == -1 && lengthOrIndicator <= cbMaxData); 1148Debug.Assert((cachedObj != null), "internalGetString should always return non-null or raise exception"); 1153Debug.Assert((cachedObj != null), "internalGetBytes should always return non-null or raise exception"); 1339Debug.Assert(bufferIndex >= 0, "Negative buffer index"); 1340Debug.Assert(bytesOrCharsLength >= 0, "Negative number of bytes or chars to read"); 1343Debug.Assert(buffer == null || bytesOrCharsLength <= (buffer.Length - bufferIndex), "Not enough space in user's buffer"); 1409Debug.Assert((cbTotal > 0), "GetData returned negative value, which is not SQL_NO_TOTAL"); 1486Debug.Assert(flag, "internalGetBytes - unexpected invalid result inside if-block"); 1725Debug.Assert(null != StatementHandle, "Statement handle is null in DateReader"); 1728Debug.Assert(_dataCache == null || !Convert.IsDBNull(_dataCache[i]), "Cannot call GetData without checking for cache first!"); 1733Debug.Assert(cb <= Buffer.Length - 2, "GetData needs to Reallocate. Perf bug"); 1911Debug.Assert(!disposing || !allresults, "both disposing & allresults are true"); 1989Debug.Assert(!disposing, "errors while disposing"); 2308Debug.Assert(_metadata != null); 2324Debug.Assert(buffer.Length >= 264, "Native buffer to small (_buffer.Length < 264)"); 2472Debug.Assert(_metadata != null); 2505Debug.Assert(buffer.Length >= 544, "Native buffer to small (_buffer.Length < 544)"); 2851Debug.Assert(str.Length > 1, "Illegal string, only one char that is a quote"); 2852Debug.Assert(str[str.Length - 1] == quoteChar, "Missing quote at end of string that begins with quote"); 2891Debug.Assert(quotePrefix != null && quoteSuffix != null);
System\Data\Odbc\OdbcHandle.cs (4)
30Debug.Assert(null == parentHandle, "did not expect a parent handle"); 36Debug.Assert(null != parentHandle, "expected a parent handle"); // safehandle can't be null 80Debug.Assert((ODBC32.SQL_ATTR.APP_PARAM_DESC == attribute) || (ODBC32.SQL_ATTR.APP_ROW_DESC == attribute), "invalid attribute"); 160Debug.Assert(ADP.PtrZero == handle, "unknown handle type");
System\Data\Odbc\OdbcMetaDataFactory.cs (2)
82Debug.Assert(restrictionCollectionName != null); 503Debug.Assert(allRestrictions.Length >= restrictionsCount);
System\Data\Odbc\OdbcParameter.cs (6)
336Debug.Assert((ODBC32.SQL_C.WCHAR == _bindtype._sql_c) || (ODBC32.SQL_C.BINARY == _bindtype._sql_c), "not wchar or binary"); 475Debug.Assert((ODBC32.SQL_C.WCHAR == _bindtype._sql_c) || (ODBC32.SQL_C.BINARY == _bindtype._sql_c), "not wchar or binary"); 622Debug.Assert(command.Connection != null); 792Debug.Assert(command.Connection != null); 978Debug.Assert(ODBC32.SQL_C.NUMERIC == _typemap._sql_c, "unexpected"); 1032Debug.Assert(null != _typemap, "GetParameterValue: null _typemap");
System\Data\Odbc\OdbcParameterCollectionHelper.cs (2)
258Debug.Assert((null != items) && (0 <= index) && (index < Count), "RemoveIndex, invalid"); 267Debug.Assert((null != items) && (0 <= index) && (index < Count), "Replace Index invalid");
System\Data\Odbc\OdbcUtils.cs (12)
37Debug.Assert((cb > 0), "Character count negative "); 38Debug.Assert((Length >= cb), "Native buffer too small "); 45Debug.Assert((cb > 0), "Character count negative "); 46Debug.Assert((Length >= cb), "Native buffer too small "); 168Debug.Assert(value is string || value is char[], "Only string or char[] can be marshaled to WCHAR"); 180Debug.Assert(rgChars.Length < (base.Length - valueOffset), "attempting to extend parameter buffer!"); 193Debug.Assert(rgChars.Length < (base.Length - valueOffset), "attempting to extend parameter buffer!"); 207Debug.Assert((valueOffset <= length), "Offset out of Range"); 222Debug.Assert(length < (base.Length - valueOffset), "attempting to extend parameter buffer!"); 456Debug.Assert((_sqlstatement[curidx] == '['), "GetTokenFromQuote: character at starting position must be same as quotechar"); 472Debug.Assert(_quote != ' ', "ODBC driver doesn't support quoted identifiers -- GetTokenFromQuote should not be used in this case"); 473Debug.Assert((_sqlstatement[curidx] == _quote), "GetTokenFromQuote: character at starting position must be same as quotechar");
System.Diagnostics.DiagnosticSource (83)
src\libraries\Common\src\System\Diagnostics\DiagnosticsHelper.cs (4)
141Debug.Assert(index >= 0); 142Debug.Assert(index < _maxIndex); 152Debug.Assert(index >= 0); 153Debug.Assert(index < _maxIndex);
src\libraries\Common\src\System\HexConverter.cs (3)
167Debug.Assert(chars.Length >= bytes.Length * 2); 359Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 360Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 281Debug.Assert(additionalCapacityBeyondPos > 0); 282Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Diagnostics\Activity.cs (9)
392Debug.Assert(activity != null); 1327Debug.Assert(!string.IsNullOrEmpty(Parent.Id)); 1333Debug.Assert(ParentId.Length != 0); 1422Debug.Assert(_traceId is null); 1444Debug.Assert(!W3CIdFlagsSet); 1694Debug.Assert(_last != null); 1783Debug.Assert(_last != null); 2008Debug.Assert(outBytes.Length == 16 || outBytes.Length == 8); 2025Debug.Assert(outBytes.Length * 2 == charData.Length);
System\Diagnostics\Activity.GenerateRootId.netcoreapp.cs (2)
16Debug.Assert(s_uniqSuffix.Length < 50); // Ensure stackalloc not too large 20Debug.Assert(formatted);
System\Diagnostics\ActivitySource.cs (3)
383Debug.Assert(activity != null); 395Debug.Assert(activity != null); 407Debug.Assert(activity != null);
System\Diagnostics\DiagLinkedList.cs (3)
29Debug.Assert(e is not null); 57Debug.Assert(_first is not null); 58Debug.Assert(_last is not null);
System\Diagnostics\DiagnosticListener.cs (2)
301Debug.Assert(!(cur.Observer == Observer && cur.IsEnabled1Arg == IsEnabled1Arg && cur.IsEnabled3Arg == IsEnabled3Arg), "Did not remove subscription!"); 360Debug.Assert(Monitor.IsEntered(s_allListenersLock)); // We should only be called when we hold this lock
System\Diagnostics\DiagnosticSourceEventSource.cs (1)
415Debug.Assert(str2 != null);
System\Diagnostics\DistributedContextPropagator.cs (1)
76Debug.Assert(s_current is not null);
System\Diagnostics\DsesActivitySourceListener.cs (7)
49Debug.Assert(activitySourceSpecs != null); 55Debug.Assert(currentActivitySourceSpec.SourceName != null); 56Debug.Assert(currentActivitySourceSpec.SampleFunc != null); 100Debug.Assert(_wildcardSpec != null || _specsBySourceNameAndActivityName != null); 120Debug.Assert(_activityListener == null); 121Debug.Assert(_wildcardSpec != null 221Debug.Assert(activitySourceName != null);
System\Diagnostics\DsesFilterAndTransform.cs (12)
112Debug.Assert(filterAndPayloadSpec != null && startIdx >= 0 && startIdx <= endIdx && endIdx <= filterAndPayloadSpec.Length); 207Debug.Assert(endIdx - startIdx >= 4); 208Debug.Assert(IsActivitySourceEntry(filterAndPayloadSpec, startIdx, endIdx)); 611Debug.Assert(transformSpec != null && startIdx >= 0 && startIdx < endIdx && endIdx <= transformSpec.Length); 704Debug.Assert(obj != null || IsStatic); 748Debug.Assert(type != null, "Type should only be null for the well-known static fetchers already checked"); 844Debug.Assert(typeof(TObject).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo())); 849Debug.Assert(obj is TObject); 863Debug.Assert(typeof(TStruct) == type); 868Debug.Assert(obj is TStruct); 902Debug.Assert(enumerable is not null); 965Debug.Assert(obj is IEnumerable<ElementType>);
System\Diagnostics\DsesSamplerBuilder.cs (1)
72Debug.Assert(maximumRatePerSecond > 0, "maximumRatePerSecond must be greater than 0");
System\Diagnostics\Metrics\AggregationManager.cs (5)
137Debug.Assert(collectionPeriod.TotalSeconds >= MinCollectionTimeSecs); 148Debug.Assert(cookie is not null); 176Debug.Assert(_collectThread == null && !_cts.IsCancellationRequested); 177Debug.Assert(CollectionPeriod.TotalSeconds >= MinCollectionTimeSecs); 259Debug.Assert(collectionIntervalSecs >= MinCollectionTimeSecs);
System\Diagnostics\Metrics\AggregatorStore.cs (1)
88Debug.Assert(match);
System\Diagnostics\Metrics\Base2ExponentialHistogramAggregator.cs (4)
222Debug.Assert(n == 0, "Increment should always succeed after scale down."); 235Debug.Assert(IsFinite(value), "IEEE-754 +Inf, -Inf and NaN should be filtered out before calling this method."); 236Debug.Assert(value != 0, "IEEE-754 zero values should be handled by ZeroCount."); 237Debug.Assert(value > 0, "IEEE-754 negative values should be normalized before calling this method.");
System\Diagnostics\Metrics\CircularBufferBuckets.cs (4)
55Debug.Assert(_trait is not null, "trait was null"); 124Debug.Assert(capacity >= 2, "The capacity must be at least 2."); 143Debug.Assert(level > 0, "The scale down level must be a positive integer."); 303Debug.Assert(divisor > 0, $"{nameof(divisor)} must be a positive integer.");
System\Diagnostics\Metrics\ExponentialHistogramAggregator.cs (1)
126Debug.Assert(count == 0);
System\Diagnostics\Metrics\Instrument.cs (1)
191Debug.Assert(false);
System\Diagnostics\Metrics\Meter.cs (5)
37Debug.Assert(options.Name is not null); 41Debug.Assert(Name is not null); 72Debug.Assert(Name is not null); 530Debug.Assert(instrumentList is not null); 557Debug.Assert(instrumentList is not null);
System\Diagnostics\Metrics\MeterOptions.cs (1)
53Debug.Assert(_name is not null);
System\Diagnostics\Metrics\MetricsEventSource.cs (1)
478Debug.Assert(AggregationManager.MinCollectionTimeSecs <= defaultIntervalSecs);
System\Diagnostics\Metrics\RuntimeMetrics.cs (1)
177Debug.Assert(!OperatingSystem.IsBrowser() && !OperatingSystem.IsWasi() &&!OperatingSystem.IsTvOS() && !(OperatingSystem.IsIOS() && !OperatingSystem.IsMacCatalyst()));
System\Diagnostics\Metrics\TagList.netcore.cs (1)
119Debug.Assert(_overflowTags is not null || _tagsCount == InlineTags.Length);
System\Diagnostics\RateLimiter.cs (1)
26Debug.Assert(maxOperationsPerSecond > 0, "maxOperationsPerSecond must be greater than 0");
System\Diagnostics\W3CPropagator.cs (3)
191Debug.Assert(traceState != null, "traceState cannot be null"); 192Debug.Assert(setter != null, "setter cannot be null"); 378Debug.Assert(span.Length > 0 && span[0] == Percent);
System.Diagnostics.Process (65)
Microsoft\Win32\SafeHandles\SafeProcessHandle.Unix.cs (1)
44Debug.Assert(_handle != null);
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.cs (2)
102Debug.Assert(!b || pid == ProcPid.Self|| (ProcPid)result.pid == pid, "Expected process ID from stat file to match supplied pid"); 109Debug.Assert(!b || result.pid == tid, "Expected thread ID from stat file to match supplied tid");
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.ParseMapModules.cs (1)
36Debug.Assert(lines != null);
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (3)
61Debug.Assert(!b || (ProcPid)result.Pid == pid || pid == ProcPid.Self, "Expected process ID from status file to match supplied pid"); 126Debug.Assert(valueParsed); 141Debug.Assert(!string.IsNullOrEmpty(path));
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ForkAndExecProcess.cs (1)
71Debug.Assert(bytesWritten == byteLength);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
69Debug.Assert(passwd.Name != null);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetSetPriority.cs (1)
40Debug.Assert((nice >= -20) && (nice <= 20));
src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (7)
25Debug.Assert(capacity >= 0); 54Debug.Assert(index >= 0 && index < _count); 78Debug.Assert(_count > 0); 87Debug.Assert(_count > 0); 104Debug.Assert(_array != null); // Nonzero _count should imply this 134Debug.Assert(_count < Capacity); 141Debug.Assert(minimum > Capacity);
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 (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 281Debug.Assert(additionalCapacityBeyondPos > 0); 282Debug.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.ConfigureTerminalForChildProcesses.Unix.cs (4)
15Debug.Assert(increment != 0); 20Debug.Assert(s_processStartLock.IsReadLockHeld); 21Debug.Assert(configureConsole); 28Debug.Assert(s_processStartLock.IsWriteLockHeld);
System\Diagnostics\Process.cs (1)
781Debug.Assert(waitHandleContext != null, "Process.CompletionCallback called with no waitHandleContext");
System\Diagnostics\Process.Linux.cs (1)
297Debug.Assert(bytesRead < buffer.Length);
System\Diagnostics\Process.Unix.cs (14)
161Debug.Assert(_haveProcessId, $"{nameof(ConfigureAfterProcessIdSet)} should only be called once a process ID is set"); 178Debug.Assert(_waitHandle == null); 179Debug.Assert(_registeredWaitHandle == null); 180Debug.Assert(Associated, "Process.EnsureWatchingForExit called with no associated process"); 206Debug.Assert(exited || milliseconds != Timeout.Infinite); 272Debug.Assert(pri >= -20 && pri <= 20); 294Debug.Assert(value == ProcessPriorityClass.Normal, "Input should have been validated by caller"); 468Debug.Assert(stdinFd >= 0); 475Debug.Assert(stdoutFd >= 0); 481Debug.Assert(stderrFd >= 0); 532Debug.Assert(childPid >= 0); 848Debug.Assert(fd >= 0); 969Debug.Assert(!string.IsNullOrEmpty(startInfo.UserName)); 973Debug.Assert(userId.HasValue == groupId.HasValue, "userId and groupId both need to have values, or both need to be null.");
System\Diagnostics\ProcessManager.Linux.cs (3)
23Debug.Assert(processNameFilter is null, "Not used on Linux"); 166Debug.Assert(pid >= 0); 283Debug.Assert(procSelfPid.HasValue);
System\Diagnostics\ProcessStartInfo.cs (1)
105Debug.Assert(!(e is IDisposable), "Environment.GetEnvironmentVariables should not be IDisposable.");
System\Diagnostics\ProcessWaitState.Unix.cs (11)
168Debug.Assert(foundState); 228Debug.Assert(processId >= 0); 238Debug.Assert(!Monitor.IsEntered(_gate)); 253Debug.Assert(Monitor.IsEntered(_gate)); 266Debug.Assert(!Monitor.IsEntered(_gate)); 299Debug.Assert(_exited); 348Debug.Assert(Monitor.IsEntered(_gate)); 397Debug.Assert(!Monitor.IsEntered(_gate)); 506Debug.Assert(Monitor.IsEntered(_gate)); 507Debug.Assert(!_isChild); 546Debug.Assert(!_exited);
System.Diagnostics.StackTrace (1)
System\Diagnostics\StackTraceSymbols.cs (1)
145Debug.Assert(inMemoryPdbAddress != IntPtr.Zero);
System.Diagnostics.TextWriterTraceListener (4)
System\Diagnostics\XmlWriterTraceListener.cs (4)
392Debug.Assert(typeof(T) == typeof(int) || typeof(T) == typeof(uint) || typeof(T) == typeof(long), "We only currently stackalloc enough space for these types."); 399Debug.Assert(charsWritten > 0); 411Debug.Assert(charsWritten == span.Length); 423Debug.Assert(charsWritten > 0);
System.Diagnostics.TraceSource (3)
System\Diagnostics\CorrelationManager.cs (1)
57Debug.Assert(stack != null);
System\Diagnostics\Switch.cs (1)
172Debug.Assert(switchValueString is not null, "Unexpected 'switchValueString' null value");
System\Diagnostics\TraceSource.cs (1)
105Debug.Assert(_listeners != null);
System.Drawing.Primitives (8)
src\libraries\Common\src\System\Drawing\ColorConverterCommon.cs (2)
14Debug.Assert(culture != null); 105Debug.Assert(culture != null);
System\Drawing\Color.cs (1)
395Debug.Assert(name != null);
System\Drawing\KnownColorNames.cs (1)
199Debug.Assert(color > 0 && color <= KnownColor.RebeccaPurple);
System\Drawing\KnownColorTable.cs (4)
477Debug.Assert((argb & Color.ARGBAlphaMask) == Color.ARGBAlphaMask); 478Debug.Assert(ColorValueTable.Length == ColorKindTable.Length); 495Debug.Assert(color > 0 && color <= KnownColor.RebeccaPurple); 541Debug.Assert(Color.IsKnownColorSystem(color));
System.Formats.Asn1 (85)
src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (3)
17Debug.Assert(arraySegment.Array != null); 18Debug.Assert(arraySegment.Offset == 0); 25Debug.Assert(clearSize <= array.Length);
System\Formats\Asn1\Asn1Tag.cs (3)
232Debug.Assert(bytesConsumed > 0); 338Debug.Assert(segment <= byte.MaxValue); 344Debug.Assert(idx == 0);
System\Formats\Asn1\AsnCharacterStringEncodings.cs (3)
216Debug.Assert(minCharAllowed <= maxCharAllowed); 217Debug.Assert(maxCharAllowed <= 0x7F); 237Debug.Assert(isAllowed[c] == false);
System\Formats\Asn1\AsnDecoder.BitString.cs (4)
367Debug.Assert(unusedBitCount == 0); 492Debug.Assert(length != null); 626Debug.Assert(bytesWritten == contentLength); 663Debug.Assert(contentsLength.HasValue);
System\Formats\Asn1\AsnDecoder.cs (5)
440Debug.Assert(bytesRead > 0); 533Debug.Assert(validity != LengthValidity.Valid); 647Debug.Assert(offset >= 0); 659Debug.Assert(offset >= 0); 695Debug.Assert(ruleSet >= AsnEncodingRules.BER && ruleSet <= AsnEncodingRules.DER);
System\Formats\Asn1\AsnDecoder.GeneralizedTime.cs (4)
192Debug.Assert(!contents.IsEmpty); 194Debug.Assert(state == GetNextState(octet)); 267Debug.Assert(!contents.IsEmpty); 269Debug.Assert(state == GetNextState(octet));
System\Formats\Asn1\AsnDecoder.Integer.cs (2)
434Debug.Assert(sizeLimit <= sizeof(long)); 473Debug.Assert(sizeLimit <= sizeof(ulong));
System\Formats\Asn1\AsnDecoder.NamedBitList.cs (1)
368Debug.Assert(valueSpan.Length <= sizeof(long));
System\Formats\Asn1\AsnDecoder.OctetString.cs (4)
212Debug.Assert(contentLength.HasValue); 355Debug.Assert(length != null); 472Debug.Assert(bytesWritten == contentLength); 485Debug.Assert(rented == null);
System\Formats\Asn1\AsnDecoder.Oid.cs (8)
85Debug.Assert(source.Length > 0); 198Debug.Assert(idx == nextStop); 199Debug.Assert(writeSpan.Length >= SemanticByteCount); 202Debug.Assert(accumValueBytes[7] == 0); 223Debug.Assert(paddingByteCount >= 0 && paddingByteCount < sizeof(long)); 288Debug.Assert(largeValue != null); 293Debug.Assert(firstIdentifier > long.MaxValue); 319Debug.Assert((smallValue == null) != (largeValue == null));
System\Formats\Asn1\AsnDecoder.UtcTime.cs (2)
177Debug.Assert( 193Debug.Assert(contents.IsEmpty);
System\Formats\Asn1\AsnWriter.BitString.cs (4)
111Debug.Assert(contentLength > MaxCERContentSize); 119Debug.Assert( 147Debug.Assert(payload.Length > MaxCERContentSize); 193Debug.Assert(_buffer == ensureNoExtraCopy, $"_buffer was replaced during {nameof(WriteConstructedCerBitString)}");
System\Formats\Asn1\AsnWriter.Boolean.cs (2)
31Debug.Assert(!tag.IsConstructed); 35Debug.Assert(_offset < _buffer.Length);
System\Formats\Asn1\AsnWriter.cs (17)
93Debug.Assert(_buffer != null); 181Debug.Assert(bytesWritten == _offset); 452Debug.Assert(length >= -1); 464Debug.Assert(length >= 0); 495Debug.Assert(idx == _offset); 605Debug.Assert(tag.IsConstructed); 623Debug.Assert(tag.IsConstructed); 633Debug.Assert(tagType == UniversalTagNumber.SetOf); 653Debug.Assert(containedLength >= 0); 693Debug.Assert(_offset == expectedEnd); 716Debug.Assert(_offset - lenOffset - 1 == shiftSize); 722Debug.Assert(buffer != null); 723Debug.Assert(end >= start); 760Debug.Assert(pos == end); 775Debug.Assert(pos == len); 878Debug.Assert(writer._nestingStack != null); 893Debug.Assert(_writer == null || _writer._nestingStack != null);
System\Formats\Asn1\AsnWriter.GeneralizedTime.cs (4)
65Debug.Assert(normalized.Year <= 9999, "DateTimeOffset guards against this internally"); 93Debug.Assert(fraction[0] == (byte)'0'); 94Debug.Assert(fraction[1] == (byte)'.'); 110Debug.Assert(!tag.IsConstructed);
System\Formats\Asn1\AsnWriter.Integer.cs (7)
141Debug.Assert(!tag.IsConstructed); 160Debug.Assert(_buffer[_offset] != 0xFF || _buffer[_offset + 1] < 0x80); 193Debug.Assert(!tag.IsConstructed); 212Debug.Assert(_buffer[_offset] != 0 || _buffer[_offset + 1] > 0x7F); 232Debug.Assert(!tag.IsConstructed); 270Debug.Assert(!tag.IsConstructed); 281Debug.Assert(!tag.IsConstructed);
System\Formats\Asn1\AsnWriter.Null.cs (1)
30Debug.Assert(!tag.IsConstructed);
System\Formats\Asn1\AsnWriter.OctetString.cs (3)
106Debug.Assert(payload.Length > MaxCERSegmentSize); 117Debug.Assert( 166Debug.Assert(_buffer == ensureNoExtraCopy, $"_buffer was replaced during {nameof(WriteConstructedCerOctetString)}");
System\Formats\Asn1\AsnWriter.Oid.cs (2)
135Debug.Assert(!tag.IsConstructed); 190Debug.Assert(dest.Length > 0);
System\Formats\Asn1\AsnWriter.Sequence.cs (2)
59Debug.Assert(tag.IsConstructed); 66Debug.Assert(tag.IsConstructed);
System\Formats\Asn1\AsnWriter.SetOf.cs (2)
68Debug.Assert(tag.IsConstructed); 75Debug.Assert(tag.IsConstructed);
System\Formats\Asn1\AsnWriter.Text.cs (1)
115Debug.Assert(size > AsnReader.MaxCERSegmentSize);
System\Formats\Asn1\AsnWriter.UtcTime.cs (1)
80Debug.Assert(!tag.IsConstructed);
System.Formats.Cbor (37)
System\Formats\Cbor\CborConformanceLevel.cs (1)
234Debug.Assert(!left.IsEmpty && !right.IsEmpty);
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 (9)
207Debug.Assert(_nestedDataItems?.Count > 0); 235Debug.Assert(_definiteLength is null || _definiteLength - _itemsRead > 0); 257Debug.Assert(_offset + length <= _data.Length); 266Debug.Assert(position <= _data.Length); 381Debug.Assert(restoreHeight >= 0, "Attempting to restore checkpoint outside of its original context."); 387Debug.Assert(_nestedDataItems != null); 388Debug.Assert(_nestedDataItems.ToArray()[restoreHeight - 1].FrameOffset == checkpoint.FrameOffset, 403Debug.Assert(checkpoint.FrameOffset == _frameOffset, "Attempting to restore checkpoint outside of its original context."); 420Debug.Assert(CurrentDepth == checkpoint.Depth);
System\Formats\Cbor\Reader\CborReader.Map.cs (4)
104Debug.Assert(_currentKeyOffset != null && _itemsRead % 2 == 0); 125Debug.Assert(_currentKeyOffset != null && _itemsRead % 2 != 0); 132Debug.Assert(_currentKeyOffset != null); 160Debug.Assert(_currentKeyOffset != null);
System\Formats\Cbor\Reader\CborReader.PeekState.cs (2)
32Debug.Assert(!AllowMultipleRootLevelValues); 74Debug.Assert(AllowMultipleRootLevelValues);
System\Formats\Cbor\Reader\CborReader.SkipValue.cs (1)
43Debug.Assert(0 <= depth && depth <= CurrentDepth);
System\Formats\Cbor\Reader\CborReader.String.cs (3)
344Debug.Assert(target.IsEmpty); 407Debug.Assert(target.IsEmpty); 485Debug.Assert(type == CborMajorType.ByteString || type == CborMajorType.TextString);
System\Formats\Cbor\Writer\CborWriter.Array.cs (1)
72Debug.Assert(majorType == CborMajorType.Array || majorType == CborMajorType.Map);
System\Formats\Cbor\Writer\CborWriter.cs (4)
245Debug.Assert(MaxArrayLength == Array.MaxLength); 303Debug.Assert(_nestedDataItems?.Count > 0); // implied by previous check 390Debug.Assert(_definiteLength == null); 405Debug.Assert(_itemsWritten % 2 == 0);
System\Formats\Cbor\Writer\CborWriter.Map.cs (4)
95Debug.Assert(_currentKeyOffset != null && _currentValueOffset == null); 119Debug.Assert(_currentKeyOffset != null && _currentValueOffset != null); 152Debug.Assert(_keyValuePairEncodingRanges != null); 171Debug.Assert(s.IsEmpty);
System\Formats\Cbor\Writer\CborWriter.String.cs (5)
49Debug.Assert(_currentIndefiniteLengthStringRanges != null); 143Debug.Assert(_currentIndefiniteLengthStringRanges != null); 194Debug.Assert(type == CborMajorType.ByteString || type == CborMajorType.TextString); 195Debug.Assert(_currentIndefiniteLengthStringRanges != null); 218Debug.Assert(s.IsEmpty);
System\Formats\Cbor\Writer\CborWriter.Tag.cs (1)
166Debug.Assert((flags & ScaleMask) == 0, "mantissa argument should be integral.");
System.Formats.Nrbf (19)
System\Formats\Nrbf\ArrayInfo.cs (1)
43Debug.Assert(FlattenedLength <= MaxArrayLength);
System\Formats\Nrbf\ArrayRecord.cs (3)
129Debug.Assert(incrementCount == 1, "IncrementCount other than 1 is allowed only for null records."); 159Debug.Assert(numElementsWritten == (uint)source.Count, "We should have traversed the entirety of the source records collection."); 160Debug.Assert(numElementsWritten == (ulong)destination.LongLength, "We should have traversed the entirety of the destination array.");
System\Formats\Nrbf\ArrayRectangularPrimitiveRecord.cs (2)
77Debug.Assert(numElementsWritten == (uint)_values.Count, "We should have traversed the entirety of the source values collection."); 78Debug.Assert(numElementsWritten == (ulong)result.LongLength, "We should have traversed the entirety of the destination array.");
System\Formats\Nrbf\ArraySingleObjectRecord.cs (1)
67Debug.Assert(valueIndex == values.Length, "We should have traversed the entirety of the newly created array.");
System\Formats\Nrbf\ArraySingleStringRecord.cs (2)
78Debug.Assert(nullCount > 0, "All implementations of NullsRecord are expected to return a positive value for NullCount."); 87Debug.Assert(valueIndex == values.Length, "We should have traversed the entirety of the newly created array.");
System\Formats\Nrbf\ClassInfo.cs (1)
38Debug.Assert(_typeName is not null);
System\Formats\Nrbf\ClassRecord.cs (1)
149Debug.Assert(nextRecord is not (ObjectNullMultiple256Record or ObjectNullMultipleRecord));
System\Formats\Nrbf\JaggedArrayRecord.cs (1)
36Debug.Assert(TypeName.GetElementType().IsArray, "Jagged arrays are required.");
System\Formats\Nrbf\RectangularArrayRecord.cs (2)
33Debug.Assert(elementType == typeof(string) || elementType == typeof(SerializationRecord)); 34Debug.Assert(!TypeName.GetElementType().IsArray, "Use JaggedArrayRecord instead.");
System\Formats\Nrbf\SZArrayOfRecords.cs (2)
62Debug.Assert(nullCount > 0, "All implementations of NullsRecord are expected to return a positive value for NullCount."); 72Debug.Assert(resultIndex == result.Length, "We should have traversed the entirety of the newly created array.");
System\Formats\Nrbf\Utils\BinaryReaderExtensions.cs (1)
217Debug.Assert(requiredBytes >= 0);
System\Formats\Nrbf\Utils\TypeNameHelpers.cs (2)
117Debug.Assert(payloadOptions.UndoTruncatedTypeNames); 118Debug.Assert(libraryRecord.RawLibraryName is not null);
System.Formats.Tar (124)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
13Debug.Assert(errorInfo.Error != Error.SUCCESS); 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.GetPwUid.cs (1)
69Debug.Assert(passwd.Name != null);
src\libraries\Common\src\System\IO\Archiving.Utils.cs (2)
14Debug.Assert(buffer != null); 15Debug.Assert(min > 0);
src\libraries\Common\src\System\IO\PathInternal.cs (1)
124Debug.Assert(rootLength > 0);
src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
31Debug.Assert(DirectorySeparatorChar == AltDirectorySeparatorChar);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 281Debug.Assert(additionalCapacityBeyondPos > 0); 282Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Formats\Tar\GnuTarEntry.cs (2)
62Debug.Assert(_header._aTime == default); 63Debug.Assert(_header._cTime == default);
System\Formats\Tar\PosixTarEntry.cs (2)
37Debug.Assert(other._header._uName != null); 38Debug.Assert(other._header._gName != null);
System\Formats\Tar\SeekableSubReadStream.cs (2)
57Debug.Assert(count >= 0); 58Debug.Assert(count <= origCount);
System\Formats\Tar\SubReadStream.cs (3)
119Debug.Assert(count >= 0); 120Debug.Assert(count <= origCount); 157Debug.Assert(!_hasReachedEnd);
System\Formats\Tar\TarEntry.cs (12)
31Debug.Assert(header._format == format); 41Debug.Assert(!isGea || entryType is TarEntryType.GlobalExtendedAttributes); 347Debug.Assert(!string.IsNullOrEmpty(destinationDirectoryPath)); 348Debug.Assert(Path.IsPathFullyQualified(destinationDirectoryPath)); 398Debug.Assert(PathInternal.EndsInDirectorySeparator(destinationDirectoryFullPath), "caller must ensure the path ends with a separator."); 442Debug.Assert(EntryType is not (TarEntryType.RegularFile or TarEntryType.V7RegularFile or TarEntryType.ContiguousFile)); 450Debug.Assert(Directory.Exists(Path.GetDirectoryName(filePath))); 451Debug.Assert(!Directory.Exists(filePath)); 464Debug.Assert(!string.IsNullOrEmpty(linkTargetPath)); 470Debug.Assert(!string.IsNullOrEmpty(linkTargetPath)); 535Debug.Assert(!Path.Exists(destinationFileName)); 551Debug.Assert(!Path.Exists(destinationFileName));
System\Formats\Tar\TarEntry.Unix.cs (6)
16Debug.Assert(EntryType is TarEntryType.BlockDevice); 23Debug.Assert(EntryType is TarEntryType.CharacterDevice); 30Debug.Assert(EntryType is TarEntryType.Fifo); 37Debug.Assert(EntryType is TarEntryType.HardLink); 38Debug.Assert(!string.IsNullOrEmpty(targetFilePath)); 39Debug.Assert(!string.IsNullOrEmpty(hardLinkFilePath));
System\Formats\Tar\TarFile.cs (12)
358Debug.Assert(!string.IsNullOrEmpty(sourceDirectoryName)); 359Debug.Assert(!string.IsNullOrEmpty(destinationFileName)); 477Debug.Assert(!string.IsNullOrEmpty(sourceFileName)); 478Debug.Assert(!string.IsNullOrEmpty(destinationDirectoryFullPath)); 523Debug.Assert(!string.IsNullOrEmpty(sourceDirectoryName)); 524Debug.Assert(destination != null); 525Debug.Assert(Path.IsPathFullyQualified(sourceDirectoryName)); 526Debug.Assert(destination.CanWrite); 532Debug.Assert(source != null); 533Debug.Assert(!string.IsNullOrEmpty(destinationDirectoryPath)); 534Debug.Assert(Path.IsPathFullyQualified(destinationDirectoryPath)); 535Debug.Assert(source.CanRead);
System\Formats\Tar\TarHeader.cs (2)
113Debug.Assert(_ea == null); 114Debug.Assert(existing != null);
System\Formats\Tar\TarHeader.Read.cs (1)
78Debug.Assert(header._format is TarEntryFormat.Ustar or TarEntryFormat.Pax or TarEntryFormat.Gnu);
System\Formats\Tar\TarHeader.Write.cs (46)
38Debug.Assert(format is > TarEntryFormat.Unknown and <= TarEntryFormat.Gnu); 39Debug.Assert(_dataStream == null || _dataStream.CanSeek); 54Debug.Assert(format is > TarEntryFormat.Unknown and <= TarEntryFormat.Gnu); 55Debug.Assert(_dataStream == null || _dataStream.CanSeek); 71Debug.Assert(destinationStream.CanSeek); 72Debug.Assert(_dataStream != null); 73Debug.Assert(!_dataStream.CanSeek); 123Debug.Assert(destinationStream.CanSeek); 124Debug.Assert(_dataStream != null); 125Debug.Assert(!_dataStream.CanSeek); 216Debug.Assert(_typeFlag is TarEntryType.GlobalExtendedAttributes); 217Debug.Assert(globalExtendedAttributesEntryNumber >= 0); 222Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 236Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 249Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 263Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 278Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 279Debug.Assert(_typeFlag is not TarEntryType.GlobalExtendedAttributes); 321Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 322Debug.Assert(_typeFlag is not TarEntryType.GlobalExtendedAttributes); 372Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 378Debug.Assert(longLinkHeader._dataStream != null && longLinkHeader._dataStream.CanSeek); // We generate the long metadata data stream, should always be seekable 387Debug.Assert(longPathHeader._dataStream != null && longPathHeader._dataStream.CanSeek); // We generate the long metadata data stream, should always be seekable 407Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 414Debug.Assert(longLinkHeader._dataStream != null && longLinkHeader._dataStream.CanSeek); // We generate the long metadata data stream, should always be seekable 423Debug.Assert(longPathHeader._dataStream != null && longPathHeader._dataStream.CanSeek); // We generate the long metadata data stream, should always be seekable 450Debug.Assert(_linkName != null); 464Debug.Assert(entryType is TarEntryType.LongPath or TarEntryType.LongLink); 498Debug.Assert(_dataStream == null || (extendedAttributes.Count > 0 && _dataStream.CanSeek)); // We generate the extended attributes data stream, should always be seekable 507Debug.Assert(_dataStream == null || (extendedAttributes.Count > 0 && _dataStream.CanSeek)); // We generate the extended attributes data stream, should always be seekable 514Debug.Assert(isGea && globalExtendedAttributesEntryNumber >= 0 || !isGea && globalExtendedAttributesEntryNumber < 0); 632Debug.Assert(prefix.Length != 1 || !PathInternal.Utf8DirectorySeparators.Contains(prefix[0])); 649Debug.Assert(!string.IsNullOrEmpty(_linkName) ^ (_typeFlag is not TarEntryType.SymbolicLink and not TarEntryType.HardLink)); 708Debug.Assert(_dataStream.CanSeek); 816Debug.Assert(paddingAfterData <= TarHelpers.RecordSize); 832Debug.Assert(paddingAfterData <= TarHelpers.RecordSize); 893Debug.Assert(length == CountDigits(length) + 3 + Encoding.UTF8.GetByteCount(attribute) + Encoding.UTF8.GetByteCount(value)); 907Debug.Assert(formatted); 930Debug.Assert(value >= 0); 954Debug.Assert(_typeFlag is TarEntryType.SymbolicLink or TarEntryType.HardLink); 1059Debug.Assert(destination.Length > 1); 1073Debug.Assert(destination.Length > 1); 1101Debug.Assert(destination.Length == 8, "8 byte field expected."); 1126Debug.Assert(destination.Length == 12, "12 byte field expected."); 1215Debug.Assert(globalExtendedAttributesEntryNumber >= 1); 1231Debug.Assert(GetUtf8TextLength(text) > utf8MaxLength);
System\Formats\Tar\TarHelpers.Unix.cs (2)
60Debug.Assert(pendingModes is not null); 104Debug.Assert(pendingModes is not null);
System\Formats\Tar\TarReader.cs (18)
123Debug.Assert(_archiveStream.CanRead); 188Debug.Assert(_archiveStream.CanRead); 209Debug.Assert(_previouslyReadEntry._header._endOfHeaderAndDataAndBlockAlignment > 0); 251Debug.Assert(_previouslyReadEntry._header._endOfHeaderAndDataAndBlockAlignment > 0); 319Debug.Assert(!_reachedEndMarkers); 361Debug.Assert(!_reachedEndMarkers); 504Debug.Assert(header._linkName != null); 505Debug.Assert(secondHeader._name != null); 512Debug.Assert(header._name != null); 513Debug.Assert(secondHeader._linkName != null); 525Debug.Assert(header._linkName != null); 530Debug.Assert(header._name != null); 580Debug.Assert(header._linkName != null); 581Debug.Assert(secondHeader._name != null); 588Debug.Assert(header._name != null); 589Debug.Assert(secondHeader._linkName != null); 601Debug.Assert(header._linkName != null); 606Debug.Assert(header._name != null);
System\Formats\Tar\TarWriter.cs (1)
325Debug.Assert(entry.Format == TarEntryFormat.Unknown, "Missing format handler");
System\Formats\Tar\TarWriter.Unix.cs (2)
21Debug.Assert(!string.IsNullOrEmpty(fullPath)); 102Debug.Assert(entry._header._dataStream == null);
System.IO.Compression (138)
System\IO\Compression\Crc32Helper.ZLib.cs (1)
14Debug.Assert((buffer != null) && (offset >= 0) && (length >= 0) && (offset <= buffer.Length - length));
System\IO\Compression\DeflateManaged\DeflateManagedStream.cs (2)
30Debug.Assert(method == ZipArchiveEntry.CompressionMethodValues.Deflate64); 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 (4)
351Debug.Assert(_literalLengthTree != null); 396Debug.Assert(_extraBits != 0, "We handle other cases separately!"); 425Debug.Assert(_distanceTree != null); 570Debug.Assert(_codeLengthTree != null);
System\IO\Compression\DeflateManaged\InputBuffer.cs (13)
35Debug.Assert(0 < count && count <= 16, "count is invalid."); 110Debug.Assert(0 < count && count <= 16, "count is invalid."); 131Debug.Assert(_bitsInBuffer % 8 == 0); 163Debug.Assert(output != null); 164Debug.Assert(offset >= 0); 165Debug.Assert(length >= 0); 166Debug.Assert(offset <= output.Length - length); 167Debug.Assert((_bitsInBuffer % 8) == 0); 202Debug.Assert(buffer != null); 203Debug.Assert(offset >= 0); 204Debug.Assert(length >= 0); 205Debug.Assert(offset <= buffer.Length - length); 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 (14)
33Debug.Assert(windowBits >= minWindowBits && windowBits <= maxWindowBits); 91Debug.Assert(NeedsInput(), "We have something left in previous input!"); 92Debug.Assert(!inputBuffer.IsEmpty); 105Debug.Assert(NeedsInput(), "We have something left in previous input!"); 106Debug.Assert(inputBufferPtr != null); 107Debug.Assert(count > 0); 118Debug.Assert(null != outputBuffer, "Can't pass in a null output buffer!"); 119Debug.Assert(!NeedsInput(), "GetDeflateOutput should only be called after providing input"); 139Debug.Assert(outputBuffer?.Length > 0); 158Debug.Assert(null != outputBuffer, "Can't pass in a null output buffer!"); 159Debug.Assert(outputBuffer.Length > 0, "Can't pass in an empty output buffer!"); 170Debug.Assert(null != outputBuffer, "Can't pass in a null output buffer!"); 171Debug.Assert(outputBuffer.Length > 0, "Can't pass in an empty output buffer!"); 172Debug.Assert(NeedsInput(), "We have something left in previous input!");
System\IO\Compression\DeflateZLib\DeflateStream.cs (26)
113Debug.Assert(stream != null); 143Debug.Assert(_buffer == null); 221Debug.Assert(_deflater != null && _buffer != null); 236Debug.Assert(flushSuccessful == (compressedBytes > 0)); 267Debug.Assert(_inflater != null); 297Debug.Assert(_inflater != null); 346Debug.Assert(bytesRead == 0); 435Debug.Assert(_inflater != null); 551Debug.Assert(_deflater != null); 568Debug.Assert(_deflater != null && _buffer != null); 587Debug.Assert(_deflater != null && _buffer != null); 598Debug.Assert(flushSuccessful == (compressedBytes > 0)); 618Debug.Assert(_deflater != null && _buffer != null); 665Debug.Assert(_deflater != null && _buffer != null); 849Debug.Assert(_deflater != null); 868Debug.Assert(_deflater != null && _buffer != null); 921Debug.Assert(deflateStream != null); 922Debug.Assert(destination != null); 923Debug.Assert(bufferSize > 0); 936Debug.Assert(_deflateStream._inflater != null); 972Debug.Assert(_deflateStream._inflater != null); 1004Debug.Assert(buffer != _arrayPoolBuffer); 1029Debug.Assert(_deflateStream._inflater is not null); 1052Debug.Assert(buffer != _arrayPoolBuffer); 1066Debug.Assert(_deflateStream._inflater != null); 1115Debug.Assert(_activeAsyncOperation);
System\IO\Compression\DeflateZLib\Inflater.cs (13)
36Debug.Assert(windowBits >= MinWindowBits && windowBits <= MaxWindowBits); 57Debug.Assert(bytesRead == 0 || bytesRead == 1); 68Debug.Assert(null != bytes, "Can't pass in a null output buffer!"); 146Debug.Assert(!NeedsInput()); 147Debug.Assert(IsGzipStream()); 148Debug.Assert(IsInputBufferHandleAllocated); 178Debug.Assert(NeedsInput(), "We have something left in previous input!"); 179Debug.Assert(inputBuffer != null); 180Debug.Assert(startIndex >= 0 && count >= 0 && count + startIndex <= inputBuffer.Length); 181Debug.Assert(!IsInputBufferHandleAllocated); 188Debug.Assert(NeedsInput(), "We have something left in previous input!"); 189Debug.Assert(!IsInputBufferHandleAllocated); 323Debug.Assert(IsInputBufferHandleAllocated);
System\IO\Compression\ZipArchive.Async.cs (3)
97Debug.Assert(mode == ZipArchiveMode.Update); 143Debug.Assert(_mode == ZipArchiveMode.Update || _mode == ZipArchiveMode.Create); 314Debug.Assert(_readEntries);
System\IO\Compression\ZipArchive.cs (6)
152Debug.Assert(mode == ZipArchiveMode.Update); 302Debug.Assert(_mode == ZipArchiveMode.Update || _mode == ZipArchiveMode.Create); 426internal void DebugAssertIsStillArchiveStreamOwner(ZipArchiveEntry entry) => Debug.Assert(_archiveStreamOwner == entry); 430Debug.Assert(_archiveStreamOwner == entry); 511Debug.Assert(currentHeader != null, "currentHeader should not be null here"); 762Debug.Assert(_readEntries);
System\IO\Compression\ZipArchiveEntry.Async.cs (4)
35Debug.Assert(_archive.Mode == ZipArchiveMode.Update); 151Debug.Assert(await GetIsOpenableAsync(false, true, cancellationToken).ConfigureAwait(false)); 165Debug.Assert(await GetIsOpenableAsync(false, true, cancellationToken).ConfigureAwait(false)); 320Debug.Assert(_compressedBytes != null);
System\IO\Compression\ZipArchiveEntry.cs (20)
360Debug.Assert(_archive.Mode == ZipArchiveMode.Update); 376Debug.Assert(entryStringBytes != null); 487Debug.Assert(_storedEntryNameBytes.Length <= ushort.MaxValue); 488Debug.Assert(_fileComment.Length <= ushort.MaxValue); 641Debug.Assert(IsOpenable(false, true, out _)); 671Debug.Assert(IsOpenable(false, true, out _)); 708Debug.Assert(CompressionMethod == CompressionMethodValues.Deflate 759Debug.Assert(CompressionMethod == CompressionMethodValues.Stored); 964Debug.Assert(_storedEntryNameBytes.Length <= ushort.MaxValue); 978Debug.Assert(_compressedSize == 0); 979Debug.Assert(_uncompressedSize == 0); 980Debug.Assert(_crc32 == 0); 992Debug.Assert(_crc32 == 0); 1130Debug.Assert(_compressedBytes != null); 1298Debug.Assert((_generalPurposeBitFlag & BitFlagValues.DataDescriptor) != 0); 1471Debug.Assert(CanWrite); 1491Debug.Assert(CanWrite); 1520Debug.Assert(CanWrite); 1543Debug.Assert(CanWrite); 1551Debug.Assert(CanWrite);
System\IO\Compression\ZipBlocks.Async.cs (2)
66Debug.Assert(zip64eocdLocatorProper && zip64EOCDLocator != null); // we just found this using the signature finder, so it should be okay 202Debug.Assert(bytesToRead == collatedHeader[remainingBufferLength..].Length);
System\IO\Compression\ZipBlocks.cs (5)
443Debug.Assert(zip64eocdLocatorProper && zip64EOCDLocator != null); // we just found this using the signature finder, so it should be okay 633Debug.Assert(blockBytes.Length == FieldLengths.FilenameLength + FieldLengths.ExtraFieldLength); 711Debug.Assert(buffer.Length >= BlockConstantSectionSize); 822Debug.Assert(bytesToRead == collatedHeader[remainingBufferLength..].Length); 894Debug.Assert(archiveComment.Length <= ZipFileCommentMaxLength);
System\IO\Compression\ZipCustomStreams.cs (8)
297Debug.Assert(count >= 0); 298Debug.Assert(count <= origCount); 320Debug.Assert(count >= 0); 321Debug.Assert(count <= origCount); 520Debug.Assert(CanWrite); 540Debug.Assert(CanWrite); 568Debug.Assert(CanWrite); 594Debug.Assert(CanWrite);
System\IO\Compression\ZipHelper.Async.cs (4)
37Debug.Assert(signatureToFind.Length != 0); 38Debug.Assert(maxBytesToRead > 0); 69Debug.Assert(bufferPointer < bufferMemory.Length); 110Debug.Assert(overlap <= buffer.Length);
System\IO\Compression\ZipHelper.cs (7)
91Debug.Assert(ValidZipDate_YearMin <= dateTime.Year && dateTime.Year <= ValidZipDate_YearMax); 108Debug.Assert(signatureToFind.Length != 0); 109Debug.Assert(maxBytesToRead > 0); 140Debug.Assert(bufferPointer < bufferSpan.Length); 179Debug.Assert(overlap <= buffer.Length); 229Debug.Assert(totalCodePoints > 0); 230Debug.Assert(totalCodePoints <= bytes.Length);
System.IO.Compression.Brotli (13)
System\IO\Compression\BrotliStream.cs (1)
193Debug.Assert(_activeAsyncOperation);
System\IO\Compression\dec\BrotliDecoder.cs (4)
58Debug.Assert(_state != null); 82Debug.Assert(availableInput <= (nuint)source.Length); 83Debug.Assert(availableOutput <= (nuint)destination.Length); 122Debug.Assert(success ? availableOutput <= (nuint)destination.Length : availableOutput == 0);
System\IO\Compression\dec\BrotliStream.Decompress.cs (2)
215Debug.Assert(lastResult == OperationStatus.DestinationTooSmall); 218Debug.Assert(bytesWritten == 0);
System\IO\Compression\enc\BrotliEncoder.cs (6)
75Debug.Assert(_state != null && !_state.IsInvalid && !_state.IsClosed); 93Debug.Assert(_state != null && !_state.IsInvalid && !_state.IsClosed); 145Debug.Assert(_state != null); 166Debug.Assert(availableInput <= (nuint)source.Length); 167Debug.Assert(availableOutput <= (nuint)destination.Length); 220Debug.Assert(success ? availableOutput <= (nuint)destination.Length : availableOutput == 0);
System.IO.Compression.ZipFile (6)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
13Debug.Assert(errorInfo.Error != Error.SUCCESS); 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\IO\Archiving.Utils.cs (2)
14Debug.Assert(buffer != null); 15Debug.Assert(min > 0);
System\IO\Compression\ZipFileExtensions.ZipArchive.Create.Unix.cs (2)
14Debug.Assert(!OperatingSystem.IsWindows()); 19Debug.Assert((uint)entry.ExternalAttributes == DefaultFileExternalAttributes);
System.IO.FileSystem.DriveInfo (2)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
13Debug.Assert(errorInfo.Error != Error.SUCCESS); 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 (29)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
13Debug.Assert(errorInfo.Error != Error.SUCCESS); 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\IO\PathInternal.cs (1)
124Debug.Assert(rootLength > 0);
src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
31Debug.Assert(DirectorySeparatorChar == AltDirectorySeparatorChar);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 281Debug.Assert(additionalCapacityBeyondPos > 0); 282Debug.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."); 579Debug.Assert(EnableRaisingEvents, "Expected EnableRaisingEvents to be true");
System\IO\FileSystemWatcher.Linux.cs (17)
292Debug.Assert(watcher != null); 293Debug.Assert(inotifyHandle != null && !inotifyHandle.IsInvalid && !inotifyHandle.IsClosed); 294Debug.Assert(directoryPath != null); 300Debug.Assert(_buffer != null && _buffer.Length > (c_INotifyEventSize + NAME_MAX + 1)); 492Debug.Assert(_includeSubdirectories); 530Debug.Assert(result >= 0); 547Debug.Assert(result >= 0); // ignore errors; they're non-fatal, but they also shouldn't happen 802Debug.Assert(_buffer != null); 803Debug.Assert(_buffer.Length > 0); 804Debug.Assert(_bufferAvailable >= 0 && _bufferAvailable <= _buffer.Length); 805Debug.Assert(_bufferPos >= 0 && _bufferPos <= _bufferAvailable); 819Debug.Assert(_bufferAvailable <= this._buffer.Length); 827Debug.Assert(_bufferAvailable >= 0); 834Debug.Assert(_bufferAvailable >= c_INotifyEventSize); 846Debug.Assert(_bufferPos + c_INotifyEventSize <= _bufferAvailable); 869Debug.Assert(position > 0); 870Debug.Assert(nameLength >= 0 && (position + nameLength) <= _buffer.Length);
System.IO.Hashing (67)
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 (2)
34Debug.Assert(CanBeVectorized(source), "source cannot be vectorized."); 86Debug.Assert(length >= 16);
System\IO\Hashing\Crc64.Vectorized.cs (2)
48Debug.Assert(CanBeVectorized(source), "source cannot be vectorized."); 119Debug.Assert(length >= 16);
System\IO\Hashing\NonCryptographicHashAlgorithm.cs (1)
284Debug.Assert(destination.Length == HashLengthInBytes);
System\IO\Hashing\XxHash128.cs (6)
255Debug.Assert(length >= 1 && length <= 3); 280Debug.Assert(length >= 4 && length <= 8); 306Debug.Assert(length >= 9 && length <= 16); 332Debug.Assert(length >= 17 && length <= 128); 358Debug.Assert(length >= 129 && length <= 240); 391Debug.Assert(length > 240);
System\IO\Hashing\XxHash3.cs (7)
226Debug.Assert(length >= 1 && length <= 3); 244Debug.Assert(length >= 4 && length <= 8); 261Debug.Assert(length >= 9 && length <= 16); 280Debug.Assert(length >= 17 && length <= 128); 309Debug.Assert(length >= 129 && length <= 240); 327Debug.Assert((length - 16 * 8) / 16 == 7); 358Debug.Assert(length > 240);
System\IO\Hashing\XxHash32.State.cs (1)
39Debug.Assert(source.Length >= StripeSize);
System\IO\Hashing\XxHash64.State.cs (1)
50Debug.Assert(source.Length >= StripeSize);
System\IO\Hashing\XxHashShared.cs (45)
117Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 120Debug.Assert(InternalBufferLengthBytes % StripeLengthBytes == 0); 123Debug.Assert(ReadLE64(defaultSecretUInt64[0]) == DefaultSecretUInt64_0); 124Debug.Assert(ReadLE64(defaultSecretUInt64[1]) == DefaultSecretUInt64_1); 125Debug.Assert(ReadLE64(defaultSecretUInt64[2]) == DefaultSecretUInt64_2); 126Debug.Assert(ReadLE64(defaultSecretUInt64[3]) == DefaultSecretUInt64_3); 127Debug.Assert(ReadLE64(defaultSecretUInt64[4]) == DefaultSecretUInt64_4); 128Debug.Assert(ReadLE64(defaultSecretUInt64[5]) == DefaultSecretUInt64_5); 129Debug.Assert(ReadLE64(defaultSecretUInt64[6]) == DefaultSecretUInt64_6); 130Debug.Assert(ReadLE64(defaultSecretUInt64[7]) == DefaultSecretUInt64_7); 131Debug.Assert(ReadLE64(defaultSecretUInt64[8]) == DefaultSecretUInt64_8); 132Debug.Assert(ReadLE64(defaultSecretUInt64[9]) == DefaultSecretUInt64_9); 133Debug.Assert(ReadLE64(defaultSecretUInt64[10]) == DefaultSecretUInt64_10); 134Debug.Assert(ReadLE64(defaultSecretUInt64[11]) == DefaultSecretUInt64_11); 135Debug.Assert(ReadLE64(defaultSecretUInt64[12]) == DefaultSecretUInt64_12); 136Debug.Assert(ReadLE64(defaultSecretUInt64[13]) == DefaultSecretUInt64_13); 137Debug.Assert(ReadLE64(defaultSecretUInt64[14]) == DefaultSecretUInt64_14); 138Debug.Assert(ReadLE64(defaultSecretUInt64[15]) == DefaultSecretUInt64_15); 141Debug.Assert(ReadLE64(defaultSecret3UInt64[0]) == DefaultSecret3UInt64_0); 142Debug.Assert(ReadLE64(defaultSecret3UInt64[1]) == DefaultSecret3UInt64_1); 143Debug.Assert(ReadLE64(defaultSecret3UInt64[2]) == DefaultSecret3UInt64_2); 144Debug.Assert(ReadLE64(defaultSecret3UInt64[3]) == DefaultSecret3UInt64_3); 145Debug.Assert(ReadLE64(defaultSecret3UInt64[4]) == DefaultSecret3UInt64_4); 146Debug.Assert(ReadLE64(defaultSecret3UInt64[5]) == DefaultSecret3UInt64_5); 147Debug.Assert(ReadLE64(defaultSecret3UInt64[6]) == DefaultSecret3UInt64_6); 148Debug.Assert(ReadLE64(defaultSecret3UInt64[7]) == DefaultSecret3UInt64_7); 149Debug.Assert(ReadLE64(defaultSecret3UInt64[8]) == DefaultSecret3UInt64_8); 150Debug.Assert(ReadLE64(defaultSecret3UInt64[9]) == DefaultSecret3UInt64_9); 151Debug.Assert(ReadLE64(defaultSecret3UInt64[10]) == DefaultSecret3UInt64_10); 152Debug.Assert(ReadLE64(defaultSecret3UInt64[11]) == DefaultSecret3UInt64_11); 153Debug.Assert(ReadLE64(defaultSecret3UInt64[12]) == DefaultSecret3UInt64_12); 154Debug.Assert(ReadLE64(defaultSecret3UInt64[13]) == DefaultSecret3UInt64_13); 204Debug.Assert(length > 240); 220Debug.Assert(stripes <= stripesPerBlock); // can handle max 1 scramble per invocation 221Debug.Assert(stripesSoFar < stripesPerBlock); 242Debug.Assert(state.BufferedCount <= InternalBufferLengthBytes); 272Debug.Assert(sourceIndex < source.Length); 278Debug.Assert(NumStripesPerBlock >= state.StripesProcessedInCurrentBlock); 282Debug.Assert(stripesToEnd <= stripes); 301Debug.Assert(sourceIndex < source.Length); // at least some bytes left 323Debug.Assert(sourceIndex < source.Length); 324Debug.Assert(remaining.Length <= InternalBufferLengthBytes); 325Debug.Assert(state.BufferedCount == 0); 362Debug.Assert(state.BufferedCount > 0); 778Debug.Assert(shift >= 0 && shift < 64);
System.IO.IsolatedStorage (5)
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 (3)
541Debug.Assert(partialPath != null, "partialPath should be non null"); 609Debug.Assert(parentDirectory != null); 628Debug.Assert(parentDirectory != null);
System.IO.MemoryMappedFiles (23)
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 (2)
13Debug.Assert(errorInfo.Error != Error.SUCCESS); 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\MemoryMappedFile.cs (10)
20Debug.Assert(handle != null); 21Debug.Assert(!handle.IsClosed); 22Debug.Assert(!handle.IsInvalid); 30Debug.Assert(handle != null); 31Debug.Assert(!handle.IsClosed); 32Debug.Assert(!handle.IsInvalid); 33Debug.Assert(fileHandle != null); 165Debug.Assert(handle != null); 166Debug.Assert(!handle.IsInvalid); 500Debug.Assert(access == MemoryMappedFileAccess.Write);
System\IO\MemoryMappedFiles\MemoryMappedFile.Unix.cs (2)
266Debug.Assert(charsWritten == 32); 269Debug.Assert(Encoding.UTF8.GetByteCount(span) <= MaxNameLength); // the standard uses Utf8
System\IO\MemoryMappedFiles\MemoryMappedView.cs (4)
18Debug.Assert(viewHandle != null); 75Debug.Assert(size >= 0); 76Debug.Assert(offset >= 0); 77Debug.Assert(allocationGranularity > 0);
System\IO\MemoryMappedFiles\MemoryMappedView.Unix.cs (2)
39Debug.Assert(pageSize > 0); 57Debug.Assert(!fd.IsInvalid);
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.Packaging (65)
System\IO\Packaging\ContentType.cs (2)
216Debug.Assert(!string.IsNullOrEmpty(_type) || !string.IsNullOrEmpty(_subType)); 254Debug.Assert(!IsLinearWhiteSpaceChar(contentType[0]) && !IsLinearWhiteSpaceChar(contentType[contentType.Length - 1]));
System\IO\Packaging\InterleavedZipPackagePartStream.cs (5)
69Debug.Assert(_dir.GetStartOffset(GetCurrentPieceNumber()) == 0); 149Debug.Assert(_dir.GetStartOffset(pieceNumber) == _currentOffset + totalBytesRead); 268Debug.Assert(newLength - _dir.GetStartOffset(lastPieceNumber) >= 0); 384Debug.Assert(totalBytesWritten == buffer.Length); 480Debug.Assert(CanSeek);
System\IO\Packaging\InterleavedZipPackagePartStream.PieceDirectory.cs (6)
78Debug.Assert(stream != null); 79Debug.Assert(pieceStart >= 0); 113Debug.Assert(sortedPieceInfoList.Count > 0); 192Debug.Assert(pieceNumber <= _lastPieceIndex, "We should have found the valid pieceNumber earlier"); 257Debug.Assert(pieceNumber <= _lastPieceIndex); 446Debug.Assert(_pieceStreamInfoList.Count == 0);
System\IO\Packaging\InternalRelationshipCollection.cs (6)
152Debug.Assert(id != null, "id should not be null"); 176Debug.Assert(package != null, "package parameter passed should never be null"); 224Debug.Assert(_package.FileOpenAccess == FileAccess.Read || _package.FileOpenAccess == FileAccess.ReadWrite, 366Debug.Assert(!reader.IsEmptyElement, "This method should only be called if the Relationship Element is not empty"); 552Debug.Assert(targetMode == TargetMode.Internal); 553Debug.Assert(!target.IsAbsoluteUri, "Uri should be relative at this stage");
System\IO\Packaging\Package.cs (2)
401Debug.Assert((parts != null), 981Debug.Assert(index >= 0, "Given uri must be present in the dictionary");
System\IO\Packaging\PackagePart.cs (3)
331Debug.Assert(!IsStreamClosed(s)); 582Debug.Assert(_deleted != true, "PackagePart.Flush should never be called on a deleted part"); 650Debug.Assert(_deleted != true, "PackagePart.FlushRelationsips should never be called on a deleted part");
System\IO\Packaging\PackagePartCollection.cs (1)
54Debug.Assert(partList != null, "partDictionary parameter cannot be null");
System\IO\Packaging\PackageRelationship.cs (3)
137Debug.Assert((targetMode == TargetMode.External || !targetUri.IsAbsoluteUri), 141Debug.Assert((targetMode >= TargetMode.Internal || targetMode <= TargetMode.External), 145Debug.Assert(relationshipType.Trim() != string.Empty,
System\IO\Packaging\PackageRelationshipCollection.cs (4)
53Debug.Assert(relationships != null, "relationships parameter cannot be null"); 86Debug.Assert((enumerator != null), "Enumerator cannot be null"); 87Debug.Assert(filter != null, "PackageRelationship filter string cannot be null"); 90Debug.Assert(filter.Trim() != string.Empty,
System\IO\Packaging\PackagingUtilities.cs (3)
31Debug.Assert(reader != null && reader.ReadState == ReadState.Initial); 85Debug.Assert(reader != null, "xmlReader should not be null"); 86Debug.Assert(reader.NodeType == XmlNodeType.Element, "XmlReader should be positioned at an Element");
System\IO\Packaging\PackUriHelper.cs (12)
208Debug.Assert((partName.Length - file.Length) > 0, 264Debug.Assert((path.Length - partNameWithoutExtension.Length - RelationshipPartExtensionName.Length - 1) > 0, 270Debug.Assert((path.Length - RelationshipPartSegmentName.Length) > 0, 347Debug.Assert(partUriString != null && partUriString.Length == 0); 352Debug.Assert(!string.IsNullOrEmpty(partUriString)); 360Debug.Assert(partUri != null, "Null reference check for this uri parameter should have been made earlier"); 522Debug.Assert(partUri != null, "Null reference check for this uri parameter should have been made earlier"); 523Debug.Assert(!(partUri is ValidatedPartUri), "This method should only be called when we have not already validated the part uri"); 557Debug.Assert(partName != null, "Null reference check for this partName parameter should have been made earlier"); 735Debug.Assert(!string.IsNullOrEmpty(partUriString)); 783Debug.Assert(segments.Length > 0 && segments[0].Length == 0); 786Debug.Assert(Path.GetExtension(segments[segments.Length - 1]) == RelationshipPartUpperCaseExtension);
System\IO\Packaging\PackUriHelper.PackUriScheme.cs (2)
304Debug.Assert(packUri != null, "packUri parameter cannot be null"); 324Debug.Assert(packUri != null, "packUri parameter cannot be null");
System\IO\Packaging\PartBasedPackageProperties.cs (7)
324Debug.Assert(_xmlWriter == null); 376Debug.Assert(!initializing || reader != null); 418Debug.Assert(_propertyPart == null); // This gets called exclusively from constructor. 739Debug.Assert(_xmlWriter != null); 768Debug.Assert(_xmlWriter != null); 773Debug.Assert(entry.Value != null); 815Debug.Assert(_xmlWriter != null);
System\IO\Packaging\XmlCompatibilityReader.cs (1)
316Debug.Assert(Scope.ShouldProcessContent(namespaceName, Reader.LocalName));
System\IO\Packaging\XmlWrappingReader.cs (1)
21Debug.Assert(baseReader != null);
System\IO\Packaging\ZipPackage.cs (7)
429Debug.Assert(opcName != null && opcName.Length > 0); 502Debug.Assert(zipItemName != null, "The parameter zipItemName should not be null"); 540Debug.Assert(sortedPieceInfoList != null); 735Debug.Assert(extensionA != null, "extension should not be null"); 736Debug.Assert(extensionB != null, "extension should not be null"); 747Debug.Assert(extension != null, "extension should not be null"); 1219Debug.Assert(!reader.IsEmptyElement, "This method should only be called it the Relationship Element is not empty");
System.IO.Pipelines (40)
System\IO\Pipelines\BufferSegment.cs (5)
27Debug.Assert(value <= AvailableMemory.Length); 83Debug.Assert(_array != null); 109Debug.Assert(segment != null); 110Debug.Assert(Next == null); 118Debug.Assert(segment.NextSegment != null);
System\IO\Pipelines\Pipe.cs (16)
232Debug.Assert(segment.MemoryOwner is null); 233Debug.Assert(sizeHint >= 0); 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!"); 301Debug.Assert(_writingHead != null); 416Debug.Assert(_writerAwaitable.IsCompleted || _readerAwaitable.IsCompleted); 497Debug.Assert(_unconsumedBytes >= 0, "Length has gone negative"); 498Debug.Assert(ResumeWriterThreshold >= 1, "ResumeWriterThreshold is less than 1"); 504Debug.Assert(examinedBytes > 0); 570Debug.Assert(_writerAwaitable.IsCompleted, "PipeWriter.FlushAsync isn't completed and will deadlock"); 802Debug.Assert(completionCallbacks != null); 836Debug.Assert(completionData.SynchronizationContext != null || completionData.ExecutionContext != null); 868Debug.Assert(completionData.ExecutionContext != null); 971Debug.Assert(_readTail != null); 1099Debug.Assert(_writingHead != null);
System\IO\Pipelines\PipeAwaitable.cs (4)
63Debug.Assert(previousAwaitableState == _awaitableState, "The awaitable state changed!"); 106Debug.Assert(_completion == null); 107Debug.Assert(_completionState == null); 108Debug.Assert(_schedulingContext == null);
System\IO\Pipelines\PipeCompletion.cs (3)
71Debug.Assert(IsCompleted); 86Debug.Assert(IsCompleted); 87Debug.Assert(_callbacks == null);
System\IO\Pipelines\PipeReaderStream.cs (1)
18Debug.Assert(pipeReader != null);
System\IO\Pipelines\PipeWriterStream.cs (1)
16Debug.Assert(pipeWriter != null);
System\IO\Pipelines\StreamPipeReader.cs (6)
112Debug.Assert(_bufferedBytes >= 0); 273Debug.Assert(length + reader._readTail.End <= reader._readTail.AvailableMemory.Length); 495Debug.Assert(_readTail == null); 501Debug.Assert(_readTail != null); 555Debug.Assert(segment != _readHead, "Returning _readHead segment that's in use!"); 556Debug.Assert(segment != _readTail, "Returning _readTail segment that's in use!");
System\IO\Pipelines\StreamPipeWriter.cs (4)
132Debug.Assert(_tail != null); 154Debug.Assert(sizeHint >= 0); 304Debug.Assert(_tail != null); 381Debug.Assert(_tail != null);
System.IO.Pipes (27)
Microsoft\Win32\SafeHandles\SafePipeHandle.Unix.cs (2)
52Debug.Assert(!IsInvalid); 110Debug.Assert(socket != null);
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
13Debug.Assert(errorInfo.Error != Error.SUCCESS); 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.GetPwUid.cs (1)
69Debug.Assert(passwd.Name != null);
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 (11)
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"); 250Debug.Assert(!string.IsNullOrEmpty(path)); 251Debug.Assert(maxCount >= 1); 280Debug.Assert(server._currentCount >= 0 && server._currentCount < server._maxCount); 290Debug.Assert(_currentCount >= 1 && _currentCount <= _maxCount); 295Debug.Assert(removed);
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\IO\Pipes\PipeStream.Unix.cs (3)
258Debug.Assert(_handle != null); 282Debug.Assert(_handle != null); 322Debug.Assert(bytesWritten > 0 && bytesWritten <= source.Length);
System.IO.Ports (23)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
13Debug.Assert(errorInfo.Error != Error.SUCCESS); 14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
System\IO\Ports\SafeSerialDeviceHandle.Unix.cs (1)
21Debug.Assert(portName != null);
System\IO\Ports\SerialPort.cs (13)
689Debug.Assert(CachedBytesToRead == 0, "there should be nothing left in our internal buffer"); 721Debug.Assert(IsOpen, "ReadOneChar - port not open"); 817Debug.Assert(IsOpen, "port not open!"); 818Debug.Assert(buffer != null, "invalid buffer!"); 819Debug.Assert(offset >= 0, "invalid offset!"); 820Debug.Assert(count >= 0, "invalid count!"); 821Debug.Assert(buffer.Length - offset >= count, "invalid offset/count!"); 889Debug.Assert(count != 0, "Count should never be zero. We will probably see bugs further down if count is 0."); 933Debug.Assert((lastFullCharPos + currentBytesToExamine) <= _readLen, "We should never be attempting to read more bytes than we have"); 951Debug.Assert((buffer.Length - offset - totalCharsFound) >= currentCharsFound, "internal buffer to read one full unicode char sequence is not sufficient!"); 1102Debug.Assert((char.IsSurrogate(_singleCharBuffer[i])), "number of chars read should be more than one only for surrogate characters!"); 1105Debug.Assert((numCharsRead > 0), "possible bug in ReadBufferIntoChars, reading surrogate char?"); 1332Debug.Assert(_inBuffer.Length >= _readLen, "ResizeBuffer - readLen > inBuffer.Length");
System\IO\Ports\SerialStream.Unix.cs (7)
278Debug.Assert(!(value < Handshake.None || value > Handshake.RequestToSendXOnXOff), 297Debug.Assert(!(value < MinDataBits || value > MaxDataBits), "An invalid value was passed to DataBits"); 314Debug.Assert(!(value < Parity.None || value > Parity.Space), "An invalid value was passed to Parity"); 332Debug.Assert(!(value < StopBits.One || value > StopBits.OnePointFive), "An invalid value was passed to StopBits"); 682Debug.Assert(_handle != null); 854Debug.Assert(ret >= 0); 1132Debug.Assert(Buffer.Length == 0);
System.Linq (217)
System\Linq\AppendPrepend.cs (8)
46Debug.Assert(source is not null); 52Debug.Assert(_enumerator is null); 62Debug.Assert(_enumerator is not null); 179Debug.Assert(prepended is not null || appended is not null); 180Debug.Assert(prependCount > 0 || appendCount > 0); 181Debug.Assert(prependCount + appendCount >= 2); 182Debug.Assert((prepended?.GetCount() ?? 0) == prependCount); 183Debug.Assert((appended?.GetCount() ?? 0) == appendCount);
System\Linq\AppendPrepend.SpeedOpt.cs (2)
15Debug.Assert(GetCount(onlyIfCheap: true) == -1); 189Debug.Assert(GetCount(onlyIfCheap: true) == -1);
System\Linq\Cast.cs (1)
62Debug.Assert(_enumerator is not null);
System\Linq\Chunk.cs (1)
111Debug.Assert(local.Length == size);
System\Linq\Concat.cs (10)
61Debug.Assert(first is not null); 62Debug.Assert(second is not null); 80Debug.Assert(index >= 0 && index <= 2); 142Debug.Assert(tail is not null); 143Debug.Assert(head is not null); 144Debug.Assert(headIndex >= 2); 172Debug.Assert(index >= 0); 190Debug.Assert(index == 0 || index == 1); 191Debug.Assert(node._tail is Concat2Iterator<TSource>); 243Debug.Assert(_enumerator is not null);
System\Linq\Concat.SpeedOpt.cs (7)
177Debug.Assert(!_hasOnlyCollections || collection is not null); 187Debug.Assert(node._tail is Concat2Iterator<TSource>); 197Debug.Assert(!_hasOnlyCollections); 229Debug.Assert(_hasOnlyCollections); 232Debug.Assert(count >= 0); 346Debug.Assert(node._tail is Concat2Iterator<TSource>); 363Debug.Assert(node._tail is Concat2Iterator<TSource>);
System\Linq\DefaultIfEmpty.cs (2)
37Debug.Assert(source is not null); 63Debug.Assert(_enumerator is not null);
System\Linq\Distinct.cs (3)
104Debug.Assert(source is not null); 130Debug.Assert(_enumerator is not null); 131Debug.Assert(_set is not null);
System\Linq\ElementAt.cs (2)
130Debug.Assert(source is not null); 153Debug.Assert(source is not null);
System\Linq\Grouping.cs (13)
161Debug.Assert(_g is not null); 162Debug.Assert(_lookup is not null); 175Debug.Assert(_g is not null); 217Debug.Assert(_g is not null); 218Debug.Assert(_lookup is not null); 231Debug.Assert(_g is not null); 273Debug.Assert(_g is not null); 274Debug.Assert(_lookup is not null); 287Debug.Assert(_g is not null); 326Debug.Assert(_g is not null); 327Debug.Assert(_lookup is not null); 340Debug.Assert(_g is not null); 391Debug.Assert(_count > 0, "A grouping should only have been created if an element was being added to it.");
System\Linq\Lookup.cs (10)
84Debug.Assert(source is not null); 85Debug.Assert(keySelector is not null); 86Debug.Assert(elementSelector is not null); 99Debug.Assert(source is not null); 100Debug.Assert(keySelector is not null); 147Debug.Assert(g is not null); 166Debug.Assert(g is not null); 173Debug.Assert(index == _count, "All list elements were not initialized."); 188Debug.Assert(g is not null); 279Debug.Assert(g is not null);
System\Linq\Lookup.SpeedOpt.cs (1)
21Debug.Assert(g is not null);
System\Linq\OfType.cs (1)
47Debug.Assert(_enumerator is not null);
System\Linq\OfType.SpeedOpt.cs (1)
159Debug.Assert(o is TResult);
System\Linq\OrderedEnumerable.cs (17)
128Debug.Assert(_buffer is not null); 129Debug.Assert(_map is not null); 130Debug.Assert(_map.Length == _buffer.Length); 173Debug.Assert(TypeIsImplicitlyStable<TElement>()); 202Debug.Assert(buffer is not null); 415Debug.Assert(typeof(TKey) == typeof(TElement)); 425Debug.Assert(keys is not null); 446Debug.Assert(typeof(TKey).IsValueType); 447Debug.Assert(_comparer == Comparer<TKey>.Default); 448Debug.Assert(_next is null); 449Debug.Assert(!_descending); 452Debug.Assert(keys is not null); 462Debug.Assert(typeof(TKey).IsValueType); 463Debug.Assert(_comparer == Comparer<TKey>.Default); 464Debug.Assert(_next is null); 465Debug.Assert(_descending); 468Debug.Assert(keys is not null);
System\Linq\OrderedEnumerable.SpeedOpt.cs (3)
392Debug.Assert(TypeIsImplicitlyStable<TElement>(), "Using Min/Max has different semantics for floating-point values."); 467Debug.Assert(_buffer is not null); 468Debug.Assert(_map is not null);
System\Linq\PartialArrayEnumerator.cs (1)
19Debug.Assert(array is not null);
System\Linq\Range.cs (2)
41Debug.Assert(int.CreateChecked(endExclusive - start) >= 0); 55Debug.Assert(_start != _endExclusive);
System\Linq\Repeat.cs (1)
37Debug.Assert(count > 0);
System\Linq\Repeat.SpeedOpt.cs (3)
38Debug.Assert(count > 0); 50Debug.Assert(count > 0); 86Debug.Assert(_count > 0);
System\Linq\Reverse.cs (3)
52Debug.Assert(source is not null); 66Debug.Assert(_state == -1 || _state == 0); 88Debug.Assert(_buffer is not null);
System\Linq\SegmentedArrayBuilder.cs (1)
62Debug.Assert(segmentsCount > 0);
System\Linq\Select.cs (11)
113Debug.Assert(source is not null); 114Debug.Assert(selector is not null); 142Debug.Assert(_enumerator is not null); 173Debug.Assert(source is not null); 174Debug.Assert(selector is not null); 175Debug.Assert(source.Length > 0); // Caller should check this beforehand and return a cached result 217Debug.Assert(source is not null); 218Debug.Assert(selector is not null); 267Debug.Assert(source is not null); 268Debug.Assert(selector is not null); 286Debug.Assert(_enumerator is not null);
System\Linq\Select.SpeedOpt.cs (35)
145Debug.Assert(source.Length > 0); 156Debug.Assert(source.Length > 0); 190Debug.Assert(count > 0); 201Debug.Assert(count > 0); 222Debug.Assert(_source.Length > 0); // See assert in constructor 230Debug.Assert(_source.Length > 0); // See assert in constructor 258Debug.Assert(start is not null); 259Debug.Assert(end is not null); 260Debug.Assert(selector is not null); 261Debug.Assert(uint.CreateTruncating(end - start) <= (uint)int.MaxValue); 282Debug.Assert(_start < _end - T.CreateChecked(index)); 332Debug.Assert(count > 0); 344Debug.Assert(count > 0); 368Debug.Assert(_end > _start); 375Debug.Assert(_end > _start); 448Debug.Assert(count > 0); 454Debug.Assert(count > 0); 566Debug.Assert(count > 0); 572Debug.Assert(count > 0); 642Debug.Assert(source is not null); 643Debug.Assert(selector is not null); 660Debug.Assert(_enumerator is not null); 690Debug.Assert(count > 0); 697Debug.Assert(count > 0); 728Debug.Assert(_source.GetCount(onlyIfCheap: true) == -1); 747Debug.Assert(count > 0); 748Debug.Assert(count == _source.GetCount(onlyIfCheap: true)); 768Debug.Assert(_source.GetCount(onlyIfCheap: true) == -1); 815Debug.Assert(index == results.Length, "All list elements were not initialized."); 855Debug.Assert(source is not null); 856Debug.Assert(selector is not null); 857Debug.Assert(minIndexInclusive >= 0); 858Debug.Assert(minIndexInclusive <= maxIndexInclusive); 890Debug.Assert(count > 0); 897Debug.Assert(count > 0);
System\Linq\SelectMany.cs (4)
155Debug.Assert(source is not null); 156Debug.Assert(selector is not null); 195Debug.Assert(_sourceEnumerator is not null); 209Debug.Assert(_subEnumerator is not null);
System\Linq\Sequence.cs (2)
124Debug.Assert(step > T.Zero); 150Debug.Assert(step < T.Zero);
System\Linq\Shuffle.cs (2)
38Debug.Assert(source is not null); 52Debug.Assert(buffer is not null);
System\Linq\Shuffle.SpeedOpt.cs (5)
101Debug.Assert(source is not null); 102Debug.Assert(takeCount > 0); 118Debug.Assert(buffer is not null); 209Debug.Assert(listCount > takeCount, "Known listCount <= takeCount should have been handled by Iterator.Take override"); 355Debug.Assert(_takeCount > 0, $"Expected positive {nameof(_takeCount)}.");
System\Linq\SingleLinkedNode.cs (4)
30Debug.Assert(linked is not null); 74Debug.Assert(index >= 0 && index < GetCount()); 80Debug.Assert(node is not null); 92Debug.Assert(count == GetCount());
System\Linq\SkipTake.SpeedOpt.cs (18)
24Debug.Assert(source is not null); 25Debug.Assert(minIndexInclusive >= 0); 26Debug.Assert(minIndexInclusive <= maxIndexInclusive); 227Debug.Assert(source is not null); 228Debug.Assert(!(source is IList<TSource>), $"The caller needs to check for {nameof(IList<TSource>)}."); 229Debug.Assert(minIndexInclusive >= 0); 230Debug.Assert(maxIndexInclusive >= -1); 234Debug.Assert(maxIndexInclusive == -1 || (maxIndexInclusive - minIndexInclusive < int.MaxValue), $"{nameof(Limit)} will overflow!"); 235Debug.Assert(maxIndexInclusive == -1 || minIndexInclusive <= maxIndexInclusive); 287Debug.Assert(count != (uint)int.MaxValue + 1 || _minIndexInclusive > 0, "Our return value will be incorrect."); 309Debug.Assert(_enumerator is not null); 319Debug.Assert(_enumerator is not null); 362Debug.Assert(minIndex >= 0, $"We should have taken care of all cases when {nameof(minIndex)} overflows."); 390Debug.Assert(maxIndex >= 0, $"We should have taken care of all cases when {nameof(maxIndex)} overflows."); 399Debug.Assert(_minIndexInclusive + index >= 0, $"Adding {nameof(index)} caused {nameof(_minIndexInclusive)} to overflow."); 420Debug.Assert(!HasLimit || Limit > 0); 540Debug.Assert(index >= 0); 546Debug.Assert(en is not null);
System\Linq\Sum.cs (3)
83Debug.Assert(span.Length >= Vector<T>.Count * 4); 84Debug.Assert(Vector<T>.Count > 2); 85Debug.Assert(Vector.IsHardwareAccelerated);
System\Linq\Take.cs (8)
54Debug.Assert(startIndex >= 0); 55Debug.Assert(endIndex >= 0); 79Debug.Assert(source is not null); 80Debug.Assert(isStartIndexFromEnd || isEndIndexFromEnd); 81Debug.Assert(isStartIndexFromEnd 144Debug.Assert(queue.Count == Math.Min(count, startIndex)); 149Debug.Assert(endIndex - startIndex <= queue.Count); 158Debug.Assert(!isStartIndexFromEnd && isEndIndexFromEnd);
System\Linq\Take.SizeOpt.cs (3)
13Debug.Assert(count > 0); 24Debug.Assert(source is not null); 25Debug.Assert(startIndex >= 0 && startIndex < endIndex);
System\Linq\Take.SpeedOpt.cs (4)
13Debug.Assert(source is not null && !IsEmptyArray(source)); 14Debug.Assert(count > 0); 24Debug.Assert(source is not null && !IsEmptyArray(source)); 25Debug.Assert(startIndex >= 0 && startIndex < endIndex);
System\Linq\Union.cs (8)
137Debug.Assert(_enumerator is not null); 148Debug.Assert(_enumerator is not null); 149Debug.Assert(_set is not null); 220Debug.Assert(first is not null); 221Debug.Assert(second is not null); 230Debug.Assert(index >= 0 && index <= 2); 258Debug.Assert(headIndex >= 2); 259Debug.Assert(sources?.GetCount() == headIndex + 1);
System\Linq\Where.cs (17)
96Debug.Assert(source is not null); 97Debug.Assert(predicate is not null); 124Debug.Assert(_enumerator is not null); 160Debug.Assert(source is not null && source.Length > 0); 161Debug.Assert(predicate is not null); 208Debug.Assert(source is not null); 209Debug.Assert(predicate is not null); 263Debug.Assert(source is not null && source.Length > 0); 264Debug.Assert(predicate is not null); 265Debug.Assert(selector is not null); 312Debug.Assert(source is not null); 313Debug.Assert(predicate is not null); 314Debug.Assert(selector is not null); 367Debug.Assert(source is not null); 368Debug.Assert(predicate is not null); 369Debug.Assert(selector is not null); 398Debug.Assert(_enumerator is not null);
System.Linq.AsyncEnumerable (34)
System\Linq\Chunk.cs (1)
79Debug.Assert(local.Length == size);
System\Linq\GroupBy.cs (1)
426Debug.Assert(_count > 0, "A grouping should only have been created if an element was being added to it.");
System\Linq\OrderBy.cs (13)
229Debug.Assert(keySelector is Func<TElement, TKey> or Func<TElement, CancellationToken, ValueTask<TKey>>); 327Debug.Assert(typeof(TKey) == typeof(TElement)); 357Debug.Assert(keys is not null); 389Debug.Assert(typeof(TKey).IsValueType); 390Debug.Assert(_comparer == Comparer<TKey>.Default); 391Debug.Assert(_next is null); 392Debug.Assert(!_descending); 395Debug.Assert(keys is not null); 405Debug.Assert(typeof(TKey).IsValueType); 406Debug.Assert(_comparer == Comparer<TKey>.Default); 407Debug.Assert(_next is null); 408Debug.Assert(_descending); 411Debug.Assert(keys is not null);
System\Linq\Sequence.cs (2)
98Debug.Assert(step > T.Zero); 124Debug.Assert(step < T.Zero);
System\Linq\Take.cs (10)
74Debug.Assert(startIndex >= 0); 75Debug.Assert(endIndex >= 0); 97Debug.Assert(source is not null); 98Debug.Assert(startIndex >= 0 && startIndex < endIndex); 129Debug.Assert(source is not null); 130Debug.Assert(isStartIndexFromEnd || isEndIndexFromEnd); 131Debug.Assert(isStartIndexFromEnd 173Debug.Assert(queue.Count == Math.Min(count, startIndex)); 178Debug.Assert(endIndex - startIndex <= queue.Count); 187Debug.Assert(!isStartIndexFromEnd && isEndIndexFromEnd);
System\Linq\ToLookupAsync.cs (7)
286Debug.Assert(source is not null); 287Debug.Assert(keySelector is not null); 308Debug.Assert(source is not null); 309Debug.Assert(keySelector is not null); 339Debug.Assert(g is not null); 417Debug.Assert(g is not null); 436Debug.Assert(g is not null);
System.Linq.Expressions (486)
src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (7)
25Debug.Assert(capacity >= 0); 54Debug.Assert(index >= 0 && index < _count); 78Debug.Assert(_count > 0); 87Debug.Assert(_count > 0); 104Debug.Assert(_array != null); // Nonzero _count should imply this 134Debug.Assert(_count < Capacity); 141Debug.Assert(minimum > Capacity);
System\Dynamic\BindingRestrictions.cs (5)
77Debug.Assert(obj != null); 241Debug.Assert(expression != null); 262Debug.Assert(parameter != null); 263Debug.Assert(type != null); 285Debug.Assert(parameter != null);
System\Dynamic\DynamicMetaObject.cs (1)
264Debug.Assert(expr != null, "Unexpected null expression; ctor should have caught this.");
System\Dynamic\DynamicObject.cs (3)
579Debug.Assert(binder is ConvertBinder && fallbackInvoke == null); 583Debug.Assert(convert.Method == null); 835Debug.Assert(Restrictions == BindingRestrictions.Empty, "We don't merge, restrictions are always empty");
System\Dynamic\ExpandoObject.cs (7)
144Debug.Assert(data[exactMatch] == Uninitialized); 154Debug.Assert(index != ExpandoObject.NoMatch); 242Debug.Assert(index >= 0 && index <= _data.Length); 265Debug.Assert(oldClass != newClass); 930Debug.Assert(originalClass != klass); 982Debug.Assert(index != ExpandoObject.NoMatch); 1010Debug.Assert(Restrictions == BindingRestrictions.Empty, "We don't merge, restrictions are always empty");
System\Dynamic\Utils\ContractUtils.cs (7)
41Debug.Assert(!string.IsNullOrEmpty(paramName)); 67Debug.Assert(!string.IsNullOrEmpty(paramName)); 110Debug.Assert(!string.IsNullOrEmpty(arrayName)); 125Debug.Assert(Monitor.IsEntered(lockObject), "Expected lock is not held."); 137Debug.Assert(!string.IsNullOrEmpty(offsetName)); 138Debug.Assert(!string.IsNullOrEmpty(countName)); 139Debug.Assert(array != null);
System\Dynamic\Utils\ExpressionUtils.cs (3)
102Debug.Assert(nodeKind == ExpressionType.Invoke || nodeKind == ExpressionType.Call || nodeKind == ExpressionType.Dynamic || nodeKind == ExpressionType.New); 248Debug.Assert(current != null); 264Debug.Assert(current != null);
System\Dynamic\Utils\ListArgumentProvider.cs (1)
97Debug.Assert(n > 0);
System\Dynamic\Utils\TypeExtensions.cs (2)
24Debug.Assert(types != null); 40Debug.Assert(argTypes != null);
System\Dynamic\Utils\TypeUtils.cs (26)
27Debug.Assert(type != null, "type cannot be null"); 95Debug.Assert(nullableType.IsNullableType()); 290Debug.Assert(source != null && dest != null); 321Debug.Assert(source != null && dest != null); 359Debug.Assert(source != typeof(object) && dest != typeof(object)); 441Debug.Assert(source.IsArray); 468Debug.Assert(dest.IsSZArray); 495Debug.Assert(t != null); 501Debug.Assert(t != null); 507Debug.Assert(t != null); 513Debug.Assert(t != null); 519Debug.Assert(source != null && dest != null); 547Debug.Assert(genericParameters != null); 548Debug.Assert(sourceArguments != null); 549Debug.Assert(destArguments != null); 550Debug.Assert(genericParameters.Length == sourceArguments.Length); 551Debug.Assert(genericParameters.Length == destArguments.Length); 558Debug.Assert(sourceArgument != null && destArgument != null); 568Debug.Assert(genericParameter != null); 670Debug.Assert(left.IsValueType); 868Debug.Assert(!definition.IsInterface); 896Debug.Assert(name == "op_False" || name == "op_True"); 969Debug.Assert(typeof(Delegate).IsAssignableFrom(delegateType)); 1010Debug.Assert(arrayType.IsArray); 1018Debug.Assert(arrayType.IsArray); 1026Debug.Assert(arrayType.IsArray);
System\Linq\Expressions\BinaryExpression.cs (13)
137Debug.Assert(IsOpAssignment(op)); 315Debug.Assert(nodeType != ExpressionType.Assign); 318Debug.Assert(method == null && TypeUtils.AreEquivalent(type, right.Type) && nodeType == ExpressionType.Coalesce); 395Debug.Assert(IsLiftedLogical); 401Debug.Assert(opTrueFalse != null); 633System.Diagnostics.Debug.Assert(method != null); 763Debug.Assert(method != null); 1393Debug.Assert(typeof(System.MulticastDelegate).IsAssignableFrom(delegateType) && delegateType != typeof(System.MulticastDelegate)); 1400Debug.Assert(pms.Length == conversion.ParameterCount); 1549Debug.Assert(typeof(System.MulticastDelegate).IsAssignableFrom(delegateType) && delegateType != typeof(System.MulticastDelegate)); 1552Debug.Assert(pms.Length == conversion.ParameterCount); 1561Debug.Assert(method != null); 2750Debug.Assert(method != null);
System\Linq\Expressions\BlockExpression.cs (31)
210Debug.Assert(expressions != null); 241Debug.Assert(args != null); 242Debug.Assert(args.Length == 2); 243Debug.Assert(variables == null || variables.Count == 0); 263Debug.Assert(expressions != null); 307Debug.Assert(args != null); 308Debug.Assert(args.Length == 3); 309Debug.Assert(variables == null || variables.Count == 0); 330Debug.Assert(expressions != null); 379Debug.Assert(args != null); 380Debug.Assert(args.Length == 4); 381Debug.Assert(variables == null || variables.Count == 0); 414Debug.Assert(expressions != null); 457Debug.Assert(args != null); 458Debug.Assert(args.Length == 5); 459Debug.Assert(variables == null || variables.Count == 0); 471Debug.Assert(expressions.Count != 0); 481Debug.Assert(index >= 0 && index < _expressions.Count); 495Debug.Assert(variables == null || variables.Count == 0); 496Debug.Assert(args != null); 554Debug.Assert(expressions != null); 590Debug.Assert(variables!.Count == Variables.Count); 594Debug.Assert(args.Length == 1); 595Debug.Assert(variables == null || variables.Count == Variables.Count); 629Debug.Assert(variables!.Count == Variables.Count); 633Debug.Assert(args.Length == ExpressionCount); 634Debug.Assert(variables == null || variables.Count == Variables.Count); 654Debug.Assert(variables!.Count == Variables.Count); 658Debug.Assert(args.Length == ExpressionCount); 659Debug.Assert(variables == null || variables.Count == Variables.Count); 770Debug.Assert(n > 0);
System\Linq\Expressions\Compiler\BoundConstants.cs (1)
97Debug.Assert(!ILGen.CanEmitConstant(value, type));
System\Linq\Expressions\Compiler\CompilerScope.cs (3)
187Debug.Assert(locals != null); 288Debug.Assert(_parent == null && parent != this); 402Debug.Assert(ShouldCache(v) && !_locals.ContainsKey(v));
System\Linq\Expressions\Compiler\DelegateHelpers.Generated.cs (2)
136Debug.Assert(types != null && types.Length > 0); 183Debug.Assert(result != null);
System\Linq\Expressions\Compiler\ILGen.cs (45)
21Debug.Assert(methodBase is MethodInfo || methodBase is ConstructorInfo); 38Debug.Assert(index >= 0); 39Debug.Assert(index < ushort.MaxValue); 46Debug.Assert(index >= 0); 47Debug.Assert(index < ushort.MaxValue); 54Debug.Assert(index >= 0); 55Debug.Assert(index < ushort.MaxValue); 65Debug.Assert(type != null); 118Debug.Assert(type != null); 163Debug.Assert(type != null); 215Debug.Assert(type != null); 258Debug.Assert(type != null); 270Debug.Assert(fi != null); 277Debug.Assert(fi != null); 284Debug.Assert(fi != null); 291Debug.Assert(ci != null); 292Debug.Assert(!ci.DeclaringType!.ContainsGenericParameters); 308Debug.Assert(value != null); 484Debug.Assert(value != null); 559Debug.Assert(typeFrom != typeof(void) && typeTo != typeof(void)); 603Debug.Assert(!typeTo.IsValueType); 652Debug.Assert(typeFrom != typeTo); 789Debug.Assert(typeFrom.IsNullableType()); 790Debug.Assert(typeTo.IsNullableType()); 823Debug.Assert(!typeFrom.IsNullableType()); 824Debug.Assert(typeTo.IsNullableType()); 833Debug.Assert(typeFrom.IsNullableType()); 834Debug.Assert(!typeTo.IsNullableType()); 844Debug.Assert(typeFrom.IsNullableType()); 845Debug.Assert(!typeTo.IsNullableType()); 846Debug.Assert(typeTo.IsValueType); 859Debug.Assert(typeFrom.IsNullableType()); 870Debug.Assert(isTypeFromNullable || isTypeToNullable); 881Debug.Assert(nullableType.IsNullableType()); 884Debug.Assert(nullableType.IsValueType); 890Debug.Assert(nullableType.IsNullableType()); 893Debug.Assert(nullableType.IsValueType); 899Debug.Assert(nullableType.IsNullableType()); 902Debug.Assert(nullableType.IsValueType); 936Debug.Assert(elementType != null); 937Debug.Assert(count >= 0); 952Debug.Assert(arrayType != null); 953Debug.Assert(arrayType.IsArray); 967Debug.Assert(ci != null); 1069Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Compiler\LabelInfo.cs (1)
382Debug.Assert(CanJumpInto);
System\Linq\Expressions\Compiler\LambdaCompiler.Address.cs (6)
24Debug.Assert(node != null); 68Debug.Assert(node.NodeType == ExpressionType.ArrayIndex && node.Method == null); 74Debug.Assert(node.Right.Type == typeof(int)); 209Debug.Assert(node.NodeType == ExpressionType.Unbox); 210Debug.Assert(type.IsValueType); 219Debug.Assert(TypeUtils.AreReferenceAssignable(type, node.Type));
System\Linq\Expressions\Compiler\LambdaCompiler.Binary.cs (21)
24Debug.Assert(b.NodeType != ExpressionType.AndAlso && b.NodeType != ExpressionType.OrElse && b.NodeType != ExpressionType.Coalesce); 41Debug.Assert(!b.IsLiftedToNull || b.Type == typeof(bool?)); 71Debug.Assert(e.Type.IsNullableType()); 72Debug.Assert(op == ExpressionType.Equal || op == ExpressionType.NotEqual); 107Debug.Assert(mc.Type == typeof(bool)); 108Debug.Assert(b.NodeType == ExpressionType.Equal 118Debug.Assert(TypeUtils.AreReferenceAssignable(p1.Type, b.Left.Type.GetNonNullableType())); 119Debug.Assert(TypeUtils.AreReferenceAssignable(p2.Type, b.Right.Type.GetNonNullableType())); 131Debug.Assert(op != ExpressionType.Coalesce); 134Debug.Assert(rightType == typeof(int)); 150Debug.Assert(!leftType.IsNullableType()); 151Debug.Assert(!rightType.IsNullableType()); 152Debug.Assert(leftType.IsPrimitive || (op == ExpressionType.Equal || op == ExpressionType.NotEqual) && (!leftType.IsValueType || leftType.IsEnum)); 237Debug.Assert(rightType == typeof(int)); 242Debug.Assert(rightType == typeof(int)); 268Debug.Assert(!resultType.IsNullableType()); 289Debug.Assert(leftType.IsNullableType() || rightType.IsNullableType()); 331Debug.Assert(leftType == rightType); 334Debug.Assert(resultType == typeof(bool?)); 339Debug.Assert(resultType == typeof(bool)); 422Debug.Assert(leftIsNullable || rightIsNullable);
System\Linq\Expressions\Compiler\LambdaCompiler.ControlFlow.cs (3)
47Debug.Assert(_labelBlock != null && _labelBlock.Kind == kind); 54Debug.Assert(node.Target != null); 72Debug.Assert(label != null);
System\Linq\Expressions\Compiler\LambdaCompiler.cs (5)
231Debug.Assert(local != null); 256Debug.Assert(_hasClosureArgument, "must have a Closure argument"); 257Debug.Assert(_method.IsStatic, "must be a static method"); 263Debug.Assert(_method is DynamicMethod); 288Debug.Assert(_method is DynamicMethod);
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (25)
39Debug.Assert(newValue == CompilationFlags.EmitAsTail || newValue == CompilationFlags.EmitAsMiddle || newValue == CompilationFlags.EmitAsNoTail); 49Debug.Assert(newValue == CompilationFlags.EmitExpressionStart || newValue == CompilationFlags.EmitNoExpressionStart); 59Debug.Assert(newValue == CompilationFlags.EmitAsDefaultType || newValue == CompilationFlags.EmitAsVoidType); 85Debug.Assert(node != null); 136Debug.Assert(TypeUtils.AreReferenceAssignable(type, node.Type)); 214Debug.Assert(wb.Count > 0); 251Debug.Assert(!node.IsByRef); 376Debug.Assert(obj != null); 516Debug.Assert(args.ArgumentCount + skipParameters == pis.Length); 567Debug.Assert(value != null); 588Debug.Assert(_method is DynamicMethod); 616Debug.Assert(siteType.IsGenericType && siteType.GetGenericTypeDefinition() == typeof(CallSite<>)); 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."); 681Debug.Assert(!type.IsValueType); 688Debug.Assert(result == AnalyzeTypeIsResult.Unknown); 787Debug.Assert(!node.IsByRef); 819Debug.Assert(member is PropertyInfo); 863Debug.Assert(member is PropertyInfo); 881Debug.Assert(instance.NodeType == ExpressionType.Parameter); 882Debug.Assert(type!.IsValueType); 966Debug.Assert(binding.Member is PropertyInfo); 1104Debug.Assert(member is FieldInfo || member is PropertyInfo); 1114Debug.Assert(TypeUtils.AreEquivalent(resultType.GetNonNullableType(), mc.Type.GetNonNullableType())); 1186Debug.Assert(nodeType == ExpressionType.LessThan
System\Linq\Expressions\Compiler\LambdaCompiler.Generated.cs (1)
24Debug.Assert(node != null);
System\Linq\Expressions\Compiler\LambdaCompiler.Lambda.cs (4)
28Debug.Assert(_method is DynamicMethod); 99Debug.Assert(dynamicMethod != null); 133Debug.Assert(_method is DynamicMethod); 246Debug.Assert(_labelBlock.Parent == null && _labelBlock.Kind == LabelScopeKind.Lambda);
System\Linq\Expressions\Compiler\LambdaCompiler.Logical.cs (19)
18Debug.Assert(node.Test.Type == typeof(bool)); 89Debug.Assert(b.Method == null); 97Debug.Assert(!b.Left.Type.IsValueType); 112Debug.Assert(b.Method == null); 126Debug.Assert(b.Conversion.ParameterCount == 1); 128Debug.Assert(p.Type.IsAssignableFrom(b.Left.Type) || 189Debug.Assert(b.Conversion!.ParameterCount == 1); 226Debug.Assert(!b.Left.Type.IsValueType); 278Debug.Assert(b.Method!.IsStatic); 284Debug.Assert(opFalse != null, "factory should check that the method exists"); 384Debug.Assert(b.Method!.IsStatic); 390Debug.Assert(opTrue != null, "factory should check that the method exists"); 458Debug.Assert(node.Type == typeof(bool)); 508Debug.Assert(node.NodeType == ExpressionType.Equal || node.NodeType == ExpressionType.NotEqual); 509Debug.Assert(!node.IsLiftedToNull); 530Debug.Assert(!node.Right.Type.IsValueType); 544Debug.Assert(!node.Left.Type.IsValueType); 583Debug.Assert(node.NodeType == ExpressionType.AndAlso || node.NodeType == ExpressionType.OrElse); 584Debug.Assert(!node.IsLiftedToNull);
System\Linq\Expressions\Compiler\LambdaCompiler.Statements.cs (6)
107Debug.Assert(_scope.Node == node); 179Debug.Assert(node.Type == typeof(void)); 222Debug.Assert(TypeUtils.AreReferenceAssignable(testValue.Type, test.Type)); 295Debug.Assert(key > buckets[buckets.Count - 1].Key); 623Debug.Assert(key == bucket[bucket.Count - 1].Key + 1); 624Debug.Assert(slot == jmpLabels.Length);
System\Linq\Expressions\Compiler\LambdaCompiler.Unary.cs (7)
34Debug.Assert(typeof(LambdaExpression).IsAssignableFrom(quote.Type)); 75Debug.Assert(type == node.Operand.Type); 149Debug.Assert(TypeUtils.AreEquivalent(operandType, resultType)); 274Debug.Assert(node.Type.IsValueType); 309Debug.Assert(pis != null && pis.Length == 1); 317Debug.Assert(operand.Method == null); 321Debug.Assert(node.Method == null);
System\Linq\Expressions\Compiler\StackSpiller.ChildRewriter.cs (3)
122Debug.Assert(!_done); 379Debug.Assert(_comma!.Capacity == _comma.Count + 1); 450Debug.Assert(first == 0);
System\Linq\Expressions\Compiler\StackSpiller.cs (9)
133Debug.Assert(result.Node != null); 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"); 1043Debug.Assert(original != null); 1044Debug.Assert(max < original.Count);
System\Linq\Expressions\Compiler\StackSpiller.Temps.cs (6)
143Debug.Assert(_freeTemps == null || !_freeTemps.Contains(temp)); 144Debug.Assert(_usedTemps == null || !_usedTemps.Contains(temp)); 160Debug.Assert(_freeTemps == null || !_freeTemps.Contains(temp)); 190Debug.Assert(_usedTemps == null || mark <= _usedTemps.Count); 192Debug.Assert(mark == 0 || _usedTemps != null); 211Debug.Assert(_usedTemps == null || _usedTemps.Count == 0);
System\Linq\Expressions\Compiler\VariableBinder.cs (1)
221Debug.Assert(referenceScope != null);
System\Linq\Expressions\DebugViewWriter.cs (8)
99Debug.Assert(string.IsNullOrEmpty(le.Name)); 105Debug.Assert(string.IsNullOrEmpty(p.Name)); 111Debug.Assert(string.IsNullOrEmpty(target.Name)); 120Debug.Assert(node != null); 121Debug.Assert(writer != null); 555Debug.Assert(parent != null); 598Debug.Assert(child.NodeType == parent.NodeType); 611Debug.Assert(binary != null);
System\Linq\Expressions\DynamicExpression.cs (7)
24Debug.Assert(delegateType.GetInvokeMethod().GetReturnType() == typeof(object) || GetType() != typeof(DynamicExpression)); 516Debug.Assert(args.Length == ((IArgumentProvider)this).ArgumentCount); 527Debug.Assert(delegateType.GetInvokeMethod().GetReturnType() == returnType); 574Debug.Assert(args.Length == 1); 643Debug.Assert(args.Length == 2); 718Debug.Assert(args.Length == 3); 799Debug.Assert(args.Length == 4);
System\Linq\Expressions\Expression.cs (2)
240Debug.Assert(items != null); 272Debug.Assert(member is FieldInfo);
System\Linq\Expressions\ExpressionStringBuilder.cs (6)
71Debug.Assert(node != null); 79Debug.Assert(node != null); 87Debug.Assert(node != null); 98Debug.Assert(node != null); 109Debug.Assert(node != null); 757Debug.Assert(node.Indexer != null);
System\Linq\Expressions\IndexExpression.cs (4)
30Debug.Assert(instance != null && instance.Type.IsArray); 31Debug.Assert(instance.Type.GetArrayRank() == arguments.Count); 122Debug.Assert(instance != null); 123Debug.Assert(arguments == null || arguments.Length == _arguments.Count);
System\Linq\Expressions\Interpreter\AddInstruction.cs (2)
165Debug.Assert(type.IsArithmetic()); 301Debug.Assert(type.IsArithmetic());
System\Linq\Expressions\Interpreter\BranchLabel.cs (4)
46Debug.Assert(_targetIndex != UnknownIndex && _stackDepth != UnknownDepth && _continuationStackDepth != UnknownDepth); 70Debug.Assert(((_targetIndex == UnknownIndex) == (_stackDepth == UnknownDepth))); 71Debug.Assert(((_targetIndex == UnknownIndex) == (_continuationStackDepth == UnknownDepth))); 86Debug.Assert(_targetIndex != UnknownIndex);
System\Linq\Expressions\Interpreter\CallInstruction.Generated.cs (1)
137Debug.Assert(pi.Length == 2);
System\Linq\Expressions\Interpreter\ControlFlowInstructions.cs (20)
25Debug.Assert(_offset == Unknown && offset != Unknown); 59Debug.Assert(_offset != Unknown); 81Debug.Assert(_offset != Unknown); 104Debug.Assert(_offset != Unknown); 148Debug.Assert(_offset != Unknown); 166Debug.Assert(_labelIndex != UnknownInstrIndex); 172Debug.Assert(_labelIndex != UnknownInstrIndex); 179Debug.Assert(_labelIndex != UnknownInstrIndex); 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"); 325Debug.Assert(!(unwrappedException is RethrowException)); 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"); 415Debug.Assert(tryHandler != null); 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"); 567Debug.Assert(!frame.IsJumpHappened()); 590Debug.Assert(!frame.IsJumpHappened());
System\Linq\Expressions\Interpreter\DecrementInstruction.cs (1)
157Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\DefaultValueInstruction.cs (2)
17Debug.Assert(type.IsValueType); 18Debug.Assert(!type.IsNullableType());
System\Linq\Expressions\Interpreter\DivInstruction.cs (1)
165Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\EqualInstruction.cs (2)
528Debug.Assert(type.GetNonNullableType().GetTypeCode() == TypeCode.Double); 550Debug.Assert(type.IsNullableOrReferenceType());
System\Linq\Expressions\Interpreter\FieldOperations.cs (2)
27Debug.Assert(field.IsStatic); 88Debug.Assert(field.IsStatic);
System\Linq\Expressions\Interpreter\GreaterThanInstruction.cs (1)
279Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\GreaterThanOrEqualInstruction.cs (1)
279Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\IncrementInstruction.cs (1)
157Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\InstructionList.cs (3)
194Debug.Assert(instruction.ConsumedStack >= 0 && instruction.ProducedStack >= 0 && 239Debug.Assert(Count > 0); 770Debug.Assert(_instructions[_instructions.Count - 1] == NullCheckInstruction.Instance);
System\Linq\Expressions\Interpreter\InterpretedFrame.cs (2)
213Debug.Assert(_pendingContinuation >= 0); 255Debug.Assert(!gotoExceptionHandler || (gotoExceptionHandler && _continuationIndex == target.ContinuationStackDepth),
System\Linq\Expressions\Interpreter\LabelInfo.cs (1)
329Debug.Assert(CanJumpInto);
System\Linq\Expressions\Interpreter\LessThanInstruction.cs (1)
278Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\LessThanOrEqualInstruction.cs (1)
279Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\LightCompiler.cs (36)
43Debug.Assert(exceptionType != null); 71Debug.Assert((FinallyStartIndex != Instruction.UnknownInstrIndex) == (FinallyEndIndex != Instruction.UnknownInstrIndex)); 86Debug.Assert(handlers != null, "catch blocks should exist"); 220Debug.Assert(d1 != null && d2 != null); 329Debug.Assert(_instructions.CurrentStackDepth == (node.ReturnType != typeof(void) ? 1 : 0)); 461Debug.Assert(local.IsBoxed); 692Debug.Assert(fi != null); 898Debug.Assert(node.Right.Type == typeof(int)); 979Debug.Assert(IsNullComparison(left, right) || left.Type == right.Type || !left.Type.IsValueType && !right.Type.IsValueType); 989Debug.Assert(IsNullComparison(left, right) || left.Type == right.Type || !left.Type.IsValueType && !right.Type.IsValueType); 1000Debug.Assert(left.Type == right.Type && left.Type.IsNumeric()); 1017Debug.Assert(left.Type == right.Type && left.Type.IsArithmetic()); 1043Debug.Assert(parameters.Length == 1); 1115Debug.Assert(typeFrom != typeof(void) && typeTo != typeof(void)); 1360Debug.Assert(opTrue != null, "factory should check that the method exists"); 1366Debug.Assert(expr.Method.IsStatic); 1548Debug.Assert(node.Type == typeof(void)); 1644Debug.Assert(!hasValue); 1688Debug.Assert(!hasValue); 1744Debug.Assert(label != null); 1787Debug.Assert(_labelBlock != null && _labelBlock.Kind == kind); 1990Debug.Assert(enterTryInstr != null); 2071Debug.Assert(startOfFinally != null); 2087Debug.Assert(exHandlers != null); 2100Debug.Assert(expr.Finally == null); 2101Debug.Assert(expr.Handlers.Count == 0); 2107Debug.Assert(enterTryInstr == _instructions.GetInstruction(tryStart)); 2154Debug.Assert(parameters.Length == arguments.ArgumentCount); 2324Debug.Assert(member.Member is PropertyInfo); 2426Debug.Assert(type.IsValueType); 2451Debug.Assert(!forBinding); 2517Debug.Assert(typeof(NewArrayExpression).GetCustomAttribute<RequiresDynamicCodeAttribute>() is not null); 2534Debug.Assert(node.NodeType == ExpressionType.NewArrayBounds); 2900Debug.Assert(expr.NodeType == ExpressionType.TypeEqual); 2923Debug.Assert(expr.NodeType == ExpressionType.TypeIs); 3009Debug.Assert(_instructions.CurrentStackDepth == startingStackDepth);
System\Linq\Expressions\Interpreter\LightDelegateCreator.cs (2)
18Debug.Assert(interpreter != null); 19Debug.Assert(lambda != null);
System\Linq\Expressions\Interpreter\LocalAccess.cs (3)
273Debug.Assert(defaultValue != null); 377Debug.Assert(type.IsValueType, "MutableValue only supports value types."); 416Debug.Assert(type.IsValueType, "MutableBox only supports value types.");
System\Linq\Expressions\Interpreter\LocalVariables.cs (1)
115Debug.Assert(!local.IsBoxed && !local.InClosure);
System\Linq\Expressions\Interpreter\ModuloInstruction.cs (1)
165Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\MulInstruction.cs (2)
165Debug.Assert(type.IsArithmetic()); 302Debug.Assert(type.IsArithmetic());
System\Linq\Expressions\Interpreter\NegateInstruction.cs (2)
106Debug.Assert(!type.IsEnum); 182Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\NotEqualInstruction.cs (2)
510Debug.Assert(type.GetNonNullableType().GetTypeCode() == TypeCode.Double); 532Debug.Assert(type.IsNullableOrReferenceType());
System\Linq\Expressions\Interpreter\SubInstruction.cs (2)
165Debug.Assert(type.IsArithmetic()); 301Debug.Assert(type.IsArithmetic());
System\Linq\Expressions\Interpreter\TypeOperations.cs (8)
153Debug.Assert(mi.ReturnType.IsValueType, "Nullable is only allowed on value types."); 154Debug.Assert(!mi.ReturnType.IsNullableType()); 356Debug.Assert(!t.IsEnum); 386Debug.Assert(t.IsEnum); 393Debug.Assert( 410Debug.Assert(t.IsEnum); 417Debug.Assert(from != null); 456Debug.Assert(_t.GetTypeCode() == TypeCode.Boolean);
System\Linq\Expressions\Interpreter\Utilities.cs (6)
178Debug.Assert(key != null); 201Debug.Assert(key != null); 222Debug.Assert(key != null); 272Debug.Assert(key != null); 284Debug.Assert(key != null); 340Debug.Assert(var != null);
System\Linq\Expressions\InvocationExpression.cs (14)
146Debug.Assert(lambda != null); 147Debug.Assert(arguments == null || arguments.Length == _arguments.Count); 174Debug.Assert(lambda != null); 175Debug.Assert(arguments == null || arguments.Length == 0); 207Debug.Assert(lambda != null); 208Debug.Assert(arguments == null || arguments.Length == 1); 247Debug.Assert(lambda != null); 248Debug.Assert(arguments == null || arguments.Length == 2); 290Debug.Assert(lambda != null); 291Debug.Assert(arguments == null || arguments.Length == 3); 336Debug.Assert(lambda != null); 337Debug.Assert(arguments == null || arguments.Length == 4); 385Debug.Assert(lambda != null); 386Debug.Assert(arguments == null || arguments.Length == 5);
System\Linq\Expressions\LambdaExpression.cs (13)
122Debug.Assert(lambdaExpressionType.IsAssignableTo(typeof(LambdaExpression))); 145Debug.Assert(CanInterpret); 225Debug.Assert(CanInterpret); 377Debug.Assert(body != null); 378Debug.Assert(parameters == null || parameters.Length == 0); 421Debug.Assert(body != null); 422Debug.Assert(parameters == null || parameters.Length == 1); 483Debug.Assert(body != null); 484Debug.Assert(parameters == null || parameters.Length == 2); 551Debug.Assert(body != null); 552Debug.Assert(parameters == null || parameters.Length == 3); 584Debug.Assert(body != null); 585Debug.Assert(parameters == null || parameters.Length == _parameters.Count);
System\Linq\Expressions\MemberExpression.cs (2)
35Debug.Assert(property != null); 41Debug.Assert(field != null);
System\Linq\Expressions\MethodCallExpression.cs (25)
159Debug.Assert(instance != null); 191Debug.Assert(instance == null); 192Debug.Assert(args == null || args.Count == _arguments.Count); 222Debug.Assert(instance != null); 223Debug.Assert(args == null || args.Count == _arguments.Count); 253Debug.Assert(instance == null); 254Debug.Assert(args == null || args.Count == 0); 300Debug.Assert(instance == null); 301Debug.Assert(args == null || args.Count == 1); 366Debug.Assert(instance == null); 367Debug.Assert(args == null || args.Count == 2); 437Debug.Assert(instance == null); 438Debug.Assert(args == null || args.Count == 3); 514Debug.Assert(instance == null); 515Debug.Assert(args == null || args.Count == 4); 597Debug.Assert(instance == null); 598Debug.Assert(args == null || args.Count == 5); 633Debug.Assert(instance != null); 634Debug.Assert(args == null || args.Count == 0); 682Debug.Assert(instance != null); 683Debug.Assert(args == null || args.Count == 1); 747Debug.Assert(instance != null); 748Debug.Assert(args == null || args.Count == 2); 818Debug.Assert(instance != null); 819Debug.Assert(args == null || args.Count == 3);
System\Linq\Expressions\NewArrayExpression.cs (1)
28Debug.Assert(type.IsArray);
System\Linq\Expressions\TryExpression.cs (3)
184Debug.Assert(tryBody != null); 208Debug.Assert(cb.Body != null); 221Debug.Assert(cb.Body != null);
System\Linq\Expressions\TypeBinaryExpression.cs (1)
77Debug.Assert(TypeUtils.AreReferenceAssignable(typeof(object), Expression.Type), "Expecting reference types only after this point.");
System\Linq\Expressions\UnaryExpression.cs (8)
124Debug.Assert(Operand.NodeType == ExpressionType.Parameter); 145Debug.Assert(NodeType == ExpressionType.PreDecrementAssign || NodeType == ExpressionType.PostDecrementAssign); 262Debug.Assert(i == temps.Length); 268Debug.Assert(i == temps.Length); 271Debug.Assert(i == block.Length); 382Debug.Assert(method != null); 428Debug.Assert(method != null); 1063Debug.Assert(kind == ExpressionType.PreDecrementAssign || kind == ExpressionType.PostDecrementAssign);
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\Runtime\CompilerServices\CallSiteBinder.cs (1)
221Debug.Assert(result != null);
System\Runtime\CompilerServices\RuntimeOps.ExpressionQuoter.cs (1)
28Debug.Assert(hoistedLocals != null && locals != null);
System\Runtime\CompilerServices\RuntimeOps.RuntimeVariableList.cs (2)
76Debug.Assert(data != null); 77Debug.Assert(indexes != null);
System.Linq.Parallel (665)
System\Linq\Parallel\Channels\AsynchronousChannel.cs (21)
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"); 258Debug.Assert(_producerChunk != null); 289Debug.Assert(chunk != null); 290Debug.Assert(!_done, "can't continue producing after the production is over"); 294Debug.Assert(!IsFull, "expected a non-full buffer"); 315Debug.Assert(_consumerEvent != null); 327Debug.Assert(_producerEvent != null); 383Debug.Assert(1 <= _producerChunkIndex && _producerChunkIndex <= _chunkSize); 410Debug.Assert(_consumerChunk == null); 418Debug.Assert(_consumerChunk != null, "consumer chunk is null"); 419Debug.Assert(0 <= _consumerChunkIndex && _consumerChunkIndex < _consumerChunk.Length, "chunk index out of bounds"); 488Debug.Assert(_consumerChunk == null); 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"); 606Debug.Assert(!IsChunkBufferEmpty); 630Debug.Assert(_producerEvent != null); 663Debug.Assert(_done, "Expected channel to be done before disposing"); 664Debug.Assert(_producerEvent != null); 665Debug.Assert(_consumerEvent != null);
System\Linq\Parallel\Channels\SynchronousChannel.cs (7)
67Debug.Assert(_queue != null); 69Debug.Assert(!_done, "trying to enqueue into the queue after production is done"); 89Debug.Assert(_queue != null); 91Debug.Assert(_done, "trying to dequeue before production is done -- this is not safe"); 117Debug.Assert(_queue != null && array != null); 119Debug.Assert(_done, "Can only copy from the channel after it's done being added to"); 132Debug.Assert(_queue != null);
System\Linq\Parallel\Enumerables\AggregationMinMaxHelpers.cs (4)
25Debug.Assert(source != null); 26Debug.Assert(sign == -1 || sign == 1); 101Debug.Assert(default(T) != null || element.Second != null, "nulls unexpected in final reduce"); 118Debug.Assert(accumulator.First || default(T) == null,
System\Linq\Parallel\Enumerables\EnumerableWrapperWeakToStrong.cs (2)
32Debug.Assert(wrappedEnumerable != null); 60Debug.Assert(wrappedEnumerator != null);
System\Linq\Parallel\Enumerables\OrderedParallelQuery.cs (1)
29Debug.Assert(sortOp is IOrderedEnumerable<TSource>);
System\Linq\Parallel\Enumerables\ParallelEnumerableWrapper.cs (3)
31Debug.Assert(source != null); 69Debug.Assert(wrappedEnumerable != null, "wrappedEnumerable must not be null."); 89Debug.Assert(_wrappedEnumerable != null);
System\Linq\Parallel\Enumerables\RepeatEnumerable.cs (1)
33Debug.Assert(count >= 0, "count not within range (must be >= 0)");
System\Linq\Parallel\Merging\ArrayMergeHelper.cs (1)
86Debug.Assert(_outputArray != null);
System\Linq\Parallel\Merging\AsynchronousChannelMergeEnumerator.cs (8)
48Debug.Assert(channels != null); 50foreach (AsynchronousChannel<T> c in channels) Debug.Assert(c != null); 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"); 226Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 227Debug.Assert(_consumerEvent != null); 271Debug.Assert(currChannelIndex == _channels.Length);
System\Linq\Parallel\Merging\DefaultMergeHelper.cs (8)
48Debug.Assert(partitions != null); 67Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 86Debug.Assert(_asyncChannels == null || _asyncChannels.Length == partitions.PartitionCount); 87Debug.Assert(_syncChannels == null || _syncChannels.Length == partitions.PartitionCount); 88Debug.Assert(_channelEnumerator != null, "enumerator can't be null if we're not ignoring output"); 103Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 118Debug.Assert(_partitions.PartitionCount == 1); 128Debug.Assert(_ignoreOutput || _channelEnumerator != null);
System\Linq\Parallel\Merging\MergeEnumerator.cs (2)
30Debug.Assert(taskGroupState != null); 68Debug.Assert(_taskGroupState.CancellationState.TopLevelDisposedFlag.Value);
System\Linq\Parallel\Merging\MergeExecutor.cs (9)
53Debug.Assert(partitions != null); 54Debug.Assert(partitions.PartitionCount > 0); 55Debug.Assert(!ignoreOutput || options == ParallelMergeOptions.FullyBuffered, "Pipelining with no output is not supported."); 62Debug.Assert(options == ParallelMergeOptions.NotBuffered || options == ParallelMergeOptions.AutoBuffered); 67Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 102Debug.Assert(_mergeHelper != null); 118Debug.Assert(_mergeHelper != null); 128Debug.Assert(_mergeHelper != null); 151Debug.Assert(options == ParallelMergeOptions.NotBuffered || options == ParallelMergeOptions.AutoBuffered);
System\Linq\Parallel\Merging\OrderPreservingMergeHelper.cs (2)
41Debug.Assert(partitions != null); 69Debug.Assert(_results.Value != null);
System\Linq\Parallel\Merging\OrderPreservingPipeliningMergeHelper.cs (8)
122Debug.Assert(partitions != null); 139Debug.Assert(typeof(TKey) == typeof(int)); 415Debug.Assert(_mergeHelper._producerDone[producer]); 421Debug.Assert(buffer.Count > 0, "Producer's buffer should not be empty here."); 427Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 452Debug.Assert(gotElement); 471Debug.Assert(_privateBuffer[producer]!.Count == 0); 535Debug.Assert(x.MaxKey >= 0 && y.MaxKey >= 0); // Guarantees no overflow on next line
System\Linq\Parallel\Merging\SynchronousChannelMergeEnumerator.cs (5)
36Debug.Assert(channels != null); 38foreach (SynchronousChannel<T> c in channels) Debug.Assert(c != null); 78Debug.Assert(_channels != null); 90Debug.Assert(current != null); 109Debug.Assert(_channelIndex == _channels.Length);
System\Linq\Parallel\Partitioning\HashRepartitionEnumerator.cs (15)
69Debug.Assert(source != null); 70Debug.Assert(keySelector != null || typeof(THashKey) == typeof(NoKeyMemoizationRequired)); 71Debug.Assert(repartitionStream != null); 72Debug.Assert(barrier != null); 73Debug.Assert(valueExchangeMatrix != null); 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)"); 76Debug.Assert(0 <= partitionIndex && partitionIndex < partitionCount); 88Debug.Assert(partitionCount == 1); 126Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 135Debug.Assert(mutables._currentBufferIndex != ENUMERATION_NOT_STARTED); 158Debug.Assert(mutables._currentBuffer == null || mutables._currentBuffer.Count > 0); 202Debug.Assert(mutables != null); 225Debug.Assert(typeof(THashKey) == typeof(NoKeyMemoizationRequired)); 229Debug.Assert(0 <= destinationIndex && destinationIndex < _partitionCount,
System\Linq\Parallel\Partitioning\HashRepartitionStream.cs (2)
54Debug.Assert(_keyComparer == null || _elementComparer == null); 55Debug.Assert(_elementComparer == null || typeof(THashKey) == typeof(NoKeyMemoizationRequired));
System\Linq\Parallel\Partitioning\OrderedHashRepartitionEnumerator.cs (19)
71Debug.Assert(source != null); 72Debug.Assert(keySelector != null || typeof(THashKey) == typeof(NoKeyMemoizationRequired)); 73Debug.Assert(repartitionStream != null); 74Debug.Assert(barrier != null); 75Debug.Assert(valueExchangeMatrix != null); 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)"); 78Debug.Assert(0 <= partitionIndex && partitionIndex < partitionCount); 124Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 133Debug.Assert(mutables._currentBufferIndex != ENUMERATION_NOT_STARTED); 145Debug.Assert(mutables._currentKeyBuffer != null); 151Debug.Assert(mutables._currentKeyBuffer != null, "expected same # of buffers/key-buffers"); 161Debug.Assert(mutables._currentBuffer == null || mutables._currentBuffer.Count > 0); 162Debug.Assert((mutables._currentBuffer == null) == (mutables._currentKeyBuffer == null)); 163Debug.Assert(mutables._currentBuffer == null || mutables._currentBuffer.Count == mutables._currentKeyBuffer!.Count); 208Debug.Assert(mutables != null); 232Debug.Assert(typeof(THashKey) == typeof(NoKeyMemoizationRequired)); 236Debug.Assert(0 <= destinationIndex && destinationIndex < _partitionCount, 249Debug.Assert(keyBuffer == null);
System\Linq\Parallel\Partitioning\PartitionedDataSource.cs (41)
74Debug.Assert(source != null); 75Debug.Assert(partitionCount > 0); 81Debug.Assert(source != null); 138Debug.Assert(partitions.Length == partitionCount); 161Debug.Assert(source != null); 162Debug.Assert(partitionCount > 0); 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"); 251Debug.Assert(sectionSize > 0); 277Debug.Assert(mutables != null); 278Debug.Assert(mutables._currentPositionInChunk >= mutables._currentChunkSize); 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"); 422Debug.Assert(sectionSize > 0); 448Debug.Assert(mutables != null); 449Debug.Assert(mutables._currentPositionInChunk >= mutables._currentChunkSize); 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"); 595Debug.Assert(source != null); 596Debug.Assert(sourceSyncLock != null); 597Debug.Assert(currentIndex != null); 614Debug.Assert(mutables._chunkBuffer != null); 624Debug.Assert(_source != null); 625Debug.Assert(chunkBuffer != null); 626Debug.Assert(mutables._currentChunkSize > 0); 627Debug.Assert(0 <= currentChunkIndex && currentChunkIndex < chunkBuffer.Length); 641Debug.Assert(0 <= mutables._nextChunkMaxSize && mutables._nextChunkMaxSize <= chunkBuffer.Length);
System\Linq\Parallel\Partitioning\PartitionedStream.cs (7)
40Debug.Assert(partitionCount > 0); 57Debug.Assert(_partitions != null); 58Debug.Assert(0 <= index && index < _partitions.Length, "index out of bounds"); 63Debug.Assert(_partitions != null); 64Debug.Assert(value != null); 65Debug.Assert(0 <= index && index < _partitions.Length, "index out of bounds"); 78Debug.Assert(_partitions != null);
System\Linq\Parallel\QueryOperators\AssociativeAggregationOperator.cs (15)
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"); 105Debug.Assert(_finalReduce != null); 106Debug.Assert(_resultSelector != null); 242Debug.Assert(source != null); 243Debug.Assert(reduceOperator != null); 261Debug.Assert(_reduceOperator != null); 262Debug.Assert(_reduceOperator._intermediateReduce != null, "expected a compiled operator"); 286Debug.Assert(typeof(TInput) == typeof(TIntermediate)); 319Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Binary\ConcatQueryOperator.cs (10)
42Debug.Assert(firstChild != null, "first child data source cannot be null"); 43Debug.Assert(secondChild != null, "second child data source cannot be null"); 90Debug.Assert(!ExchangeUtilities.IsWorseThan(leftStream.OrdinalIndexState, OrdinalIndexState.Increasing)); 109Debug.Assert(!ExchangeUtilities.IsWorseThan(rightStream.OrdinalIndexState, OrdinalIndexState.Increasing)); 172Debug.Assert(firstSource != null); 173Debug.Assert(secondSource != null); 189Debug.Assert(_firstSource != null); 190Debug.Assert(_secondSource != null); 257Debug.Assert(leftChildQueryResults.IsIndexible && rightChildQueryResults.IsIndexible); 272Debug.Assert(_leftChildCount >= 0 && _rightChildCount >= 0);
System\Linq\Parallel\QueryOperators\Binary\ExceptQueryOperator.cs (13)
34Debug.Assert(left != null && right != null, "child data sources cannot be null"); 56Debug.Assert(leftStream.PartitionCount == rightStream.PartitionCount); 156Debug.Assert(leftSource != null); 157Debug.Assert(rightSource != null); 171Debug.Assert(_leftSource != null); 172Debug.Assert(_rightSource != null); 199Debug.Assert(_outputLoopCount != null); 221Debug.Assert(_leftSource != null && _rightSource != null); 248Debug.Assert(leftSource != null); 249Debug.Assert(rightSource != null); 264Debug.Assert(_leftSource != null); 265Debug.Assert(_rightSource != null); 326Debug.Assert(_leftSource != null && _rightSource != null);
System\Linq\Parallel\QueryOperators\Binary\GroupJoinQueryOperator.cs (10)
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"); 75Debug.Assert(rightStream.PartitionCount == leftStream.PartitionCount); 224Debug.Assert(dataSource != null); 250Debug.Assert(baseLookup != null); 314Debug.Assert(dataSource != null); 354Debug.Assert(baseLookup != null); 434Debug.Assert(baseLookup != null);
System\Linq\Parallel\QueryOperators\Binary\HashJoinQueryOperatorEnumerator.cs (13)
69Debug.Assert(leftSource != null); 70Debug.Assert(rightLookupBuilder != null); 71Debug.Assert(resultSelector != null); 72Debug.Assert(outputKeyBuilder != null); 95Debug.Assert(_resultSelector != null, "expected a compiled result selector"); 96Debug.Assert(_leftSource != null); 97Debug.Assert(_rightLookupBuilder != null); 133Debug.Assert(mutables._rightHashLookup != null); 139Debug.Assert(mutables._currentRightMatches == null || mutables._currentRightMatches.Count > 0, 164Debug.Assert(mutables._currentRightMatches != null); 165Debug.Assert(0 <= mutables._currentRightMatchesIndex && mutables._currentRightMatchesIndex < mutables._currentRightMatches.Count); 179Debug.Assert(_leftSource != null && _rightLookupBuilder != null); 241Debug.Assert(dataSource != null);
System\Linq\Parallel\QueryOperators\Binary\IntersectQueryOperator.cs (13)
33Debug.Assert(left != null && right != null, "child data sources cannot be null"); 58Debug.Assert(leftPartitionedStream.PartitionCount == rightPartitionedStream.PartitionCount); 144Debug.Assert(leftSource != null); 145Debug.Assert(rightSource != null); 159Debug.Assert(_leftSource != null); 160Debug.Assert(_rightSource != null); 188Debug.Assert(_outputLoopCount != null); 210Debug.Assert(_leftSource != null && _rightSource != null); 247Debug.Assert(leftSource != null); 248Debug.Assert(rightSource != null); 263Debug.Assert(_leftSource != null); 264Debug.Assert(_rightSource != null); 325Debug.Assert(_leftSource != null && _rightSource != null);
System\Linq\Parallel\QueryOperators\Binary\JoinQueryOperator.cs (9)
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"); 78Debug.Assert(rightStream.PartitionCount == leftStream.PartitionCount); 201Debug.Assert(dataSource != null); 220Debug.Assert(_dataSource != null); 234Debug.Assert(baseLookup != null); 271Debug.Assert(baseLookup != null);
System\Linq\Parallel\QueryOperators\Binary\UnionQueryOperator.cs (11)
33Debug.Assert(left != null && right != null, "child data sources cannot be null"); 60Debug.Assert(leftStream.PartitionCount == rightStream.PartitionCount); 202Debug.Assert(leftSource != null); 203Debug.Assert(rightSource != null); 223Debug.Assert(_hashLookup != null); 263Debug.Assert(_outputLoopCount != null); 315Debug.Assert(leftSource != null); 316Debug.Assert(rightSource != null); 335Debug.Assert(_leftSource != null); 336Debug.Assert(_rightSource != null); 397Debug.Assert(_leftSource != null && _rightSource != null);
System\Linq\Parallel\QueryOperators\Binary\ZipQueryOperator.cs (7)
60Debug.Assert(resultSelector != null, "operator cannot be null"); 88Debug.Assert(settings.DegreeOfParallelism != null); 90Debug.Assert(settings.TaskScheduler != null); 97Debug.Assert(merger.MergeExecutor != null); 108Debug.Assert(merger.MergeExecutor != null); 181Debug.Assert(_leftChildResults.IsIndexible); 182Debug.Assert(_rightChildResults.IsIndexible);
System\Linq\Parallel\QueryOperators\BinaryQueryOperator.cs (5)
42Debug.Assert(leftChild != null && rightChild != null); 105Debug.Assert(IsIndexible == (_op.OrdinalIndexState == OrdinalIndexState.Indexable)); 106Debug.Assert(_settings.ExecutionMode != null); 110Debug.Assert(_settings.DegreeOfParallelism != null); 119Debug.Assert(_settings.DegreeOfParallelism != null);
System\Linq\Parallel\QueryOperators\Inlined\CountAggregationOperator.cs (2)
89Debug.Assert(source != null); 133Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DecimalAverageAggregationOperator.cs (2)
96Debug.Assert(source != null); 145Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DecimalMinMaxAggregationOperator.cs (3)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 114Debug.Assert(source != null); 175Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DecimalSumAggregationOperator.cs (2)
83Debug.Assert(source != null); 126Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DoubleAverageAggregationOperator.cs (2)
97Debug.Assert(source != null); 146Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DoubleMinMaxAggregationOperator.cs (3)
35Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 121Debug.Assert(source != null); 183Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DoubleSumAggregationOperator.cs (2)
83Debug.Assert(source != null); 125Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\FloatAverageAggregationOperator.cs (2)
97Debug.Assert(source != null); 146Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\FloatMinMaxAggregationOperator.cs (3)
34Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 119Debug.Assert(source != null); 180Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\FloatSumAggregationOperator.cs (2)
84Debug.Assert(source != null); 127Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\InlinedAggregationOperator.cs (1)
37Debug.Assert(child != null, "child data source cannot be null");
System\Linq\Parallel\QueryOperators\Inlined\IntAverageAggregationOperator.cs (2)
96Debug.Assert(source != null); 145Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\IntMinMaxAggregationOperator.cs (3)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 114Debug.Assert(source != null); 176Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\IntSumAggregationOperator.cs (2)
87Debug.Assert(source != null); 133Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\LongAverageAggregationOperator.cs (2)
96Debug.Assert(source != null); 145Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\LongCountAggregationOperator.cs (2)
87Debug.Assert(source != null); 132Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\LongMinMaxAggregationOperator.cs (3)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 115Debug.Assert(source != null); 177Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\LongSumAggregationOperator.cs (2)
86Debug.Assert(source != null); 132Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalAverageAggregationOperator.cs (2)
95Debug.Assert(source != null); 139Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalMinMaxAggregationOperator.cs (3)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 113Debug.Assert(source != null); 175Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalSumAggregationOperator.cs (2)
83Debug.Assert(source != null); 126Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleAverageAggregationOperator.cs (2)
95Debug.Assert(source != null); 139Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleMinMaxAggregationOperator.cs (3)
35Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 121Debug.Assert(source != null); 185Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleSumAggregationOperator.cs (2)
83Debug.Assert(source != null); 127Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableFloatAverageAggregationOperator.cs (2)
95Debug.Assert(source != null); 140Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableFloatMinMaxAggregationOperator.cs (3)
35Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 121Debug.Assert(source != null); 185Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableFloatSumAggregationOperator.cs (2)
83Debug.Assert(source != null); 126Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableIntAverageAggregationOperator.cs (2)
95Debug.Assert(source != null); 140Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableIntMinMaxAggregationOperator.cs (3)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 113Debug.Assert(source != null); 174Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableIntSumAggregationOperator.cs (2)
86Debug.Assert(source != null); 131Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableLongAverageAggregationOperator.cs (2)
96Debug.Assert(source != null); 140Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableLongMinMaxAggregationOperator.cs (3)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 114Debug.Assert(source != null); 176Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableLongSumAggregationOperator.cs (2)
87Debug.Assert(source != null); 133Debug.Assert(_source != null);
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\PartitionerQueryOperator.cs (3)
130Debug.Assert(_settings.DegreeOfParallelism.HasValue); 233Debug.Assert(_sourceEnumerator != null); 263Debug.Assert(_sourceEnumerator != null);
System\Linq\Parallel\QueryOperators\QueryOpeningEnumerator.cs (1)
50Debug.Assert(queryOperator != null);
System\Linq\Parallel\QueryOperators\QueryOperator.cs (14)
127Debug.Assert(querySettings.ExecutionMode != null); 138Debug.Assert(mergeOptions != null); 152Debug.Assert(querySettings.TaskScheduler != null); 166Debug.Assert(merger.MergeExecutor != null); 178Debug.Assert(querySettings.TaskScheduler != null); 179Debug.Assert(querySettings.DegreeOfParallelism.HasValue); 180Debug.Assert(querySettings.ExecutionMode.HasValue); 200Debug.Assert(querySettings.ExecutionMode != null); 233Debug.Assert(querySettings.TaskScheduler != null); 238Debug.Assert(merger.MergeExecutor != null); 241Debug.Assert(output != null); 287Debug.Assert(taskScheduler != null); 310Debug.Assert(source != null); 335Debug.Assert(sourceAsOperator != null);
System\Linq\Parallel\QueryOperators\QueryOperatorEnumerator.cs (1)
60Debug.Assert(operatorEnumerator != null);
System\Linq\Parallel\QueryOperators\QuerySettings.cs (13)
40Debug.Assert(_cancellationState != null); 93Debug.Assert(_cancellationState != null); 149Debug.Assert(topLevelCancellationTokenSource != null, "There should always be a top-level cancellation signal specified."); 159Debug.Assert(settings.CancellationState.InternalCancellationTokenSource != null); 160Debug.Assert(settings.CancellationState.MergedCancellationToken.CanBeCanceled); 161Debug.Assert(settings.CancellationState.TopLevelDisposedFlag != null); 185Debug.Assert(settings.TaskScheduler != null); 186Debug.Assert(settings.DegreeOfParallelism.HasValue); 187Debug.Assert(settings.DegreeOfParallelism.Value >= 1 && settings.DegreeOfParallelism <= Scheduling.MAX_SUPPORTED_DOP); 188Debug.Assert(settings.ExecutionMode != null); 189Debug.Assert(settings.MergeOptions != null); 191Debug.Assert(settings.MergeOptions != ParallelMergeOptions.Default); 207Debug.Assert(_cancellationState.MergedCancellationTokenSource != null);
System\Linq\Parallel\QueryOperators\ScanQueryOperator.cs (3)
33Debug.Assert(data != null); 59Debug.Assert(settings.DegreeOfParallelism.HasValue); 131Debug.Assert(_settings.DegreeOfParallelism != null);
System\Linq\Parallel\QueryOperators\Unary\AnyAllSearchOperator.cs (7)
54Debug.Assert(child != null, "child data source cannot be null"); 55Debug.Assert(predicate != null, "need a predicate function"); 166Debug.Assert(source != null); 167Debug.Assert(predicate != null); 168Debug.Assert(resultFoundFlag != null); 186Debug.Assert(_predicate != null); 234Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\ContainsSearchOperator.cs (6)
40Debug.Assert(child != null, "child data source cannot be null"); 144Debug.Assert(source != null); 145Debug.Assert(comparer != null); 146Debug.Assert(resultFoundFlag != null); 164Debug.Assert(_comparer != null); 211Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\DefaultIfEmptyQueryOperator.cs (8)
40Debug.Assert(child != null, "child data source cannot be null"); 62Debug.Assert(partitionCount == 1); 125Debug.Assert(source != null); 126Debug.Assert(0 <= partitionIndex && partitionIndex < partitionCount); 127Debug.Assert(partitionCount > 0); 128Debug.Assert(sharedEmptyCount != null); 129Debug.Assert(sharedLatch != null); 146Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\DistinctQueryOperator.cs (9)
34Debug.Assert(source != null, "child data source cannot be null"); 134Debug.Assert(source != null); 146Debug.Assert(_source != null); 147Debug.Assert(_hashLookup != null); 176Debug.Assert(_source != null); 210Debug.Assert(source != null); 226Debug.Assert(_source != null); 227Debug.Assert(_hashLookup != null); 272Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\ElementAtQueryOperator.cs (8)
40Debug.Assert(child != null, "child data source cannot be null"); 41Debug.Assert(index >= 0, "index can't be less than 0"); 75Debug.Assert(intKeyStream.OrdinalIndexState == OrdinalIndexState.Indexable); 152Debug.Assert(!e.MoveNext(), "expected enumerator to be empty"); 182Debug.Assert(source != null); 183Debug.Assert(index >= 0); 184Debug.Assert(resultFoundFlag != null); 225Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\FirstQueryOperator.cs (7)
39Debug.Assert(child != null, "child data source cannot be null"); 76Debug.Assert(partitionCount == 1); 143Debug.Assert(source != null); 144Debug.Assert(operatorState != null); 145Debug.Assert(sharedBarrier != null); 146Debug.Assert(keyComparer != null); 163Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\ForAllOperator.cs (8)
35Debug.Assert(child != null, "child data source cannot be null"); 36Debug.Assert(elementAction != null, "need a function"); 47Debug.Assert(_elementAction != null); 65Debug.Assert(enumerator == null); 136Debug.Assert(source != null); 137Debug.Assert(elementAction != null); 151Debug.Assert(_elementAction != null, "expected a compiled operator"); 173Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\GroupByQueryOperator.cs (25)
56Debug.Assert(child != null, "child data source cannot be null"); 57Debug.Assert(keySelector != null, "need a selector function"); 58Debug.Assert(elementSelector != null || 114Debug.Assert(typeof(TSource) == typeof(TElement)); 153Debug.Assert(typeof(TSource) == typeof(TElement)); 192Debug.Assert(typeof(TElement) == typeof(TSource)); 243Debug.Assert(source != null); 258Debug.Assert(_source != null); 271Debug.Assert(mutables._hashLookup != null); 345Debug.Assert(currentValue != null); 374Debug.Assert(elementSelector != null); 407Debug.Assert(currentValue != null); 446Debug.Assert(source != null); 447Debug.Assert(keySelector != null); 464Debug.Assert(_source != null); 465Debug.Assert(_keySelector != null); 478Debug.Assert(mutables._hashLookup != null); 582Debug.Assert(currentValue != null); 616Debug.Assert(elementSelector != null); 657Debug.Assert(currentValue != null); 689Debug.Assert(keyValues.Value != null); 711Debug.Assert(_keyValues.Value != null); 759Debug.Assert(_sortedValues != null); 774Debug.Assert(_values != null); 784Debug.Assert(_values != null);
System\Linq\Parallel\QueryOperators\Unary\IndexedSelectQueryOperator.cs (9)
47Debug.Assert(child != null, "child data source cannot be null"); 48Debug.Assert(selector != null, "need a selector function"); 71Debug.Assert(!ExchangeUtilities.IsWorseThan(indexState, OrdinalIndexState.Correct)); 103Debug.Assert(typeof(TKey) == typeof(int)); 145Debug.Assert(source != null); 146Debug.Assert(selector != null); 161Debug.Assert(_selector != null, "expected a compiled selection function"); 217Debug.Assert(_childQueryResults.IsIndexible); 226Debug.Assert(_childCount >= 0);
System\Linq\Parallel\QueryOperators\Unary\IndexedWhereQueryOperator.cs (7)
46Debug.Assert(child != null, "child data source cannot be null"); 47Debug.Assert(predicate != null, "need a filter function"); 97Debug.Assert(typeof(TKey) == typeof(int)); 152Debug.Assert(source != null); 153Debug.Assert(predicate != null); 165Debug.Assert(_predicate != null, "expected a compiled operator"); 188Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\LastQueryOperator.cs (7)
40Debug.Assert(child != null, "child data source cannot be null"); 76Debug.Assert(partitionCount == 1); 139Debug.Assert(source != null); 140Debug.Assert(operatorState != null); 141Debug.Assert(sharedBarrier != null); 142Debug.Assert(keyComparer != null); 159Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\ReverseQueryOperator.cs (9)
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."); 118Debug.Assert(source != null); 147Debug.Assert(_bufferIndex != null); 196Debug.Assert(_childQueryResults.IsIndexible); 209Debug.Assert(_count >= 0); 216Debug.Assert(_count >= 0); 217Debug.Assert(index >= 0); 218Debug.Assert(index < _count);
System\Linq\Parallel\QueryOperators\Unary\SelectManyQueryOperator.cs (21)
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, 208Debug.Assert(_indexedRightChildSelector != null); 261Debug.Assert(leftSource != null); 262Debug.Assert(selectManyOperator != null); 294Debug.Assert(_selectManyOperator._indexedRightChildSelector != null); 299Debug.Assert(rightChild != null); 302Debug.Assert(_currentRightSource != null); 313Debug.Assert(_currentRightSourceAsOutput == _currentRightSource, 320Debug.Assert(_mutables != null); 333Debug.Assert(_currentRightSourceAsOutput != null); 390Debug.Assert(leftSource != null); 391Debug.Assert(selectManyOperator != null); 424Debug.Assert(_selectManyOperator._rightChildSelector != null); 428Debug.Assert(rightChild != null); 431Debug.Assert(_currentRightSource != null); 442Debug.Assert(_currentRightSourceAsOutput == _currentRightSource, 449Debug.Assert(_mutables != null); 462Debug.Assert(_currentRightSourceAsOutput != null);
System\Linq\Parallel\QueryOperators\Unary\SelectQueryOperator.cs (9)
42Debug.Assert(child != null, "child data source cannot be null"); 43Debug.Assert(selector != null, "need a selector function"); 104Debug.Assert(source != null); 105Debug.Assert(selector != null); 120Debug.Assert(_selector != null, "expected a compiled operator"); 163Debug.Assert(op._selector != null); 165Debug.Assert(_childQueryResults.IsIndexible); 181Debug.Assert(index >= 0); 182Debug.Assert(index < ElementsCount);
System\Linq\Parallel\QueryOperators\Unary\SingleQueryOperator.cs (4)
39Debug.Assert(child != null, "child data source cannot be null"); 113Debug.Assert(source != null); 114Debug.Assert(totalElementCount != null); 127Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\SortQueryOperator.cs (5)
36Debug.Assert(keySelector != null, "key selector must not be null"); 180Debug.Assert(source != null); 181Debug.Assert(keySelector != null, "need a key comparer"); 195Debug.Assert(_source != null); 209Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipQueryOperator.cs (16)
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."); 112Debug.Assert(partitionCount == 1); 175Debug.Assert(source != null); 176Debug.Assert(sharedIndices != null); 177Debug.Assert(sharedBarrier != null); 178Debug.Assert(keyComparer != null); 195Debug.Assert(_sharedIndices != null); 243Debug.Assert(_buffer != null && _bufferIndex != null); 275Debug.Assert(_buffer != null && _bufferIndex != null); 298Debug.Assert(_count <= 0 || _keyComparer.Compare(currentKey, minKey) > 0, 360Debug.Assert(_childQueryResults.IsIndexible); 374Debug.Assert(_childCount >= 0); 388Debug.Assert(_childCount >= 0); 389Debug.Assert(index >= 0); 390Debug.Assert(index < ElementsCount);
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipWhileQueryOperator.cs (14)
71Debug.Assert(child != null, "child data source cannot be null"); 72Debug.Assert(predicate != null || indexedPredicate != null, "need a predicate function"); 131Debug.Assert(partitionCount == 1); 137Debug.Assert(_indexedPredicate == null || typeof(TKey) == typeof(int)); 176Debug.Assert(_predicate != null); 186Debug.Assert(_predicate != null); 232Debug.Assert(source != null); 233Debug.Assert(predicate != null || indexedPredicate != null); 234Debug.Assert(operatorState != null); 235Debug.Assert(sharedBarrier != null); 236Debug.Assert(keyComparer != null); 303Debug.Assert(_indexedPredicate != null); 342Debug.Assert(_bufferIndex != null); 390Debug.Assert(_keyComparer.Compare(currentKey, _operatorState._currentLowKey) > 0,
System\Linq\Parallel\QueryOperators\Unary\WhereQueryOperator.cs (6)
41Debug.Assert(child != null, "child data source cannot be null"); 42Debug.Assert(predicate != null, "need a filter function"); 116Debug.Assert(source != null); 117Debug.Assert(predicate != null); 130Debug.Assert(_predicate != null, "expected a compiled operator"); 152Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\UnaryQueryOperator.cs (2)
110Debug.Assert(IsIndexible == (_op.OrdinalIndexState == OrdinalIndexState.Indexable)); 112Debug.Assert(_settings.ExecutionMode != null && _settings.DegreeOfParallelism != null);
System\Linq\Parallel\Scheduling\OrderPreservingPipeliningSpoolingTask.cs (12)
67Debug.Assert(partition != null); 68Debug.Assert(taskGroupState != null); 69Debug.Assert(consumerWaiting != null); 70Debug.Assert(producerWaiting != null && producerWaiting.Length == consumerWaiting.Length); 71Debug.Assert(producerDone != null && producerDone.Length == consumerWaiting.Length); 72Debug.Assert(buffers != null && buffers.Length == consumerWaiting.Length); 73Debug.Assert(partitionIndex >= 0 && partitionIndex < consumerWaiting.Length); 153Debug.Assert(groupState != null); 154Debug.Assert(partitions != null); 155Debug.Assert(producerDone != null && producerDone.Length == partitions.PartitionCount); 156Debug.Assert(buffers != null && buffers.Length == partitions.PartitionCount); 157Debug.Assert(bufferLocks != null);
System\Linq\Parallel\Scheduling\OrderPreservingSpoolingTask.cs (9)
48Debug.Assert(groupState != null); 49Debug.Assert(results != null); 50Debug.Assert(sortHelper != null); 74Debug.Assert(groupState != null); 75Debug.Assert(partitions != null); 76Debug.Assert(results != null); 77Debug.Assert(results.Value == null); 131Debug.Assert(_sortHelper != null); 143Debug.Assert(sortedOutput != null);
System\Linq\Parallel\Scheduling\QueryTask.cs (6)
35Debug.Assert(groupState != null); 46Debug.Assert(o != null); 62Debug.Assert(taskScheduler == TaskScheduler.Default, "PLINQ queries can currently execute only on the default scheduler."); 75Debug.Assert(o != null); 81Debug.Assert(taskScheduler == TaskScheduler.Default, "PLINQ queries can currently execute only on the default scheduler."); 94Debug.Assert(unused == null);
System\Linq\Parallel\Scheduling\QueryTaskGroupState.cs (4)
73Debug.Assert(rootTask != null, "Expected a non-null task"); 74Debug.Assert(_rootTask == null, "Cannot begin a query more than once"); 86Debug.Assert(_rootTask != null); 158Debug.Assert(_cancellationState.TopLevelDisposedFlag.Value);
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\Scheduling\SpoolingTask.cs (8)
36Debug.Assert(partitions.PartitionCount == channels.Length); 37Debug.Assert(groupState != null); 92Debug.Assert(partitions.PartitionCount == channels.Length); 93Debug.Assert(groupState != null); 136Debug.Assert(groupState != null); 207Debug.Assert(source != null); 296Debug.Assert(source != null); 380Debug.Assert(source != null);
System\Linq\Parallel\Scheduling\SpoolingTaskBase.cs (1)
62Debug.Assert(_groupState.CancellationState.InternalCancellationTokenSource != null);
System\Linq\Parallel\Utils\ExchangeUtilities.cs (1)
71Debug.Assert(returnValue.PartitionCount == partitionCount);
System\Linq\Parallel\Utils\FixedMaxHeap.cs (3)
36Debug.Assert(comparer != null); 133Debug.Assert(_count > 0); 144Debug.Assert(_count > 0);
System\Linq\Parallel\Utils\GrowingArray.cs (1)
56Debug.Assert(newSize > _array.Length);
System\Linq\Parallel\Utils\ListChunk.cs (2)
31Debug.Assert(size > 0); 81Debug.Assert(curr._chunkCount == curr._chunk.Length || curr._nextChunk == null);
System\Linq\Parallel\Utils\Lookup.cs (2)
115Debug.Assert(_defaultKeyGrouping == null, "Cannot insert two groupings with the default key into a lookup."); 121Debug.Assert(!_dict.ContainsKey(grouping.Key));
System\Linq\Parallel\Utils\Sorting.cs (32)
62Debug.Assert(source != null); 63Debug.Assert(groupState != null); 64Debug.Assert(sharedIndices != null); 65Debug.Assert(sharedkeys != null); 66Debug.Assert(sharedValues != null); 67Debug.Assert(sharedBarriers != null); 68Debug.Assert(sharedIndices.Length <= sharedkeys.Length); 69Debug.Assert(sharedIndices.Length == sharedValues.Length); 86Debug.Assert(_sharedKeys.Length >= _sharedValues.Length); 194Debug.Assert(sourceValues != null, "values weren't populated"); 195Debug.Assert(sourceKeys != null, "keys weren't populated"); 203Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 267Debug.Assert(keys != null); 268Debug.Assert(values != null); 269Debug.Assert(keys.Count == values.Count); 425Debug.Assert(myKeysArr != null); 435Debug.Assert(myIndices != null); 451Debug.Assert(mergedIndices != null); 458Debug.Assert(rightIndices != null); 465Debug.Assert(mergedIndices != null); 499Debug.Assert(leftValues != null); 500Debug.Assert(leftKeys != null); 512Debug.Assert(myIndices != null); 522Debug.Assert(leftIndices != null); 529Debug.Assert(mergedIndices != null); 542Debug.Assert(mergedIndices != null); 584Debug.Assert(keys != null, "need a non-null keyset"); 585Debug.Assert(keys.Length >= indices.Length); 586Debug.Assert(left <= right); 587Debug.Assert(0 <= left && left < keys.Length); 588Debug.Assert(0 <= right && right < keys.Length); 608Debug.Assert(i >= left && j <= right, "(i>=left && j<=right) sort failed - bogus IComparer?");
System\Linq\Parallel\Utils\WrapperEqualityComparer.cs (2)
29Debug.Assert(_comparer != null); 35Debug.Assert(_comparer != null);
System\Linq\ParallelEnumerable.cs (11)
1524Debug.Assert(source != null); 1525Debug.Assert(reduce != null); 1526Debug.Assert(options.IsValidQueryAggregationOption(), "enum is out of range"); 1547Debug.Assert(source != null); 1548Debug.Assert(func != null); 1549Debug.Assert(seedIsSpecified || typeof(TSource) == typeof(TAccumulate)); 4888Debug.Assert(input != null); 5150Debug.Assert(groupings is QueryOperator<IGrouping<TKey, TSource>>); 5237Debug.Assert(groupings is QueryOperator<IGrouping<TKey, TElement>>); 5334Debug.Assert(queryOp != null, "expected query operator"); 5353Debug.Assert(!e.MoveNext(), "expected only a single element");
System.Linq.Queryable (3)
System\Linq\EnumerableRewriter.cs (3)
227Debug.Assert(matchingMethods.Length > 0, "All static methods with arguments on Queryable have equivalents on Enumerable."); 247Debug.Assert(matchingMethods.Length > 1); 278Debug.Assert(left.Length == right.Length);
System.Memory (55)
src\libraries\Common\src\System\Buffers\ArrayBufferWriter.cs (5)
95Debug.Assert(_buffer.Length >= _index); 164Debug.Assert(_buffer.Length > _index); 195Debug.Assert(_buffer.Length > _index); 227Debug.Assert(needed > currentLength); 240Debug.Assert(FreeCapacity > 0 && FreeCapacity >= sizeHint);
System\Buffers\ReadOnlySequence.cs (9)
81Debug.Assert((startSegment != null && endSegment != null) || 205Debug.Assert(startObject != null); 230Debug.Assert(beginObject != null); 305Debug.Assert(sliceEndIndex >= 0 && startIndex >= 0 && endIndex >= 0); 334Debug.Assert(start <= int.MaxValue - startIndex); 387Debug.Assert(sliceStartIndex >= 0 && startIndex >= 0 && endIndex >= 0); 417Debug.Assert(length <= int.MaxValue - sliceStartIndex); 560Debug.Assert(positionSequenceObject != null); 578Debug.Assert(currentSegment!.RunningIndex + positionIndex >= 0);
System\Buffers\ReadOnlySequence.Helpers.cs (27)
32Debug.Assert(positionObject is ReadOnlySequenceSegment<T>); 58Debug.Assert(positionObject is T[]); 64Debug.Assert(positionObject is string); 70Debug.Assert(type == SequenceType.MemoryManager); 71Debug.Assert(positionObject is MemoryManager<T>); 130Debug.Assert(startIndex < 0 || endIndex < 0); 135Debug.Assert(endIndex < 0); 206Debug.Assert(startIndex < 0 || endIndex < 0); 211Debug.Assert(endIndex < 0); 244Debug.Assert(startObject != null); 260Debug.Assert(startObject == endObject); 280Debug.Assert(startObject != null); 296Debug.Assert(startObject == endObject); 309Debug.Assert(currentSegment != null); // currentSegment parameter is marked as nullable as the parameter is reused/reassigned in the body 310Debug.Assert(offset >= 0); 359Debug.Assert(position.GetObject() != null); 397Debug.Assert(sliceStartIndex >= 0 && startIndex >= 0 && endIndex >= 0); 530Debug.Assert(_endObject != null); 547Debug.Assert(_startObject != null); 564Debug.Assert(_startObject != null); 575Debug.Assert(start <= int.MaxValue); 576Debug.Assert(end <= int.MaxValue); 577Debug.Assert(start <= end); 601Debug.Assert(start <= long.MaxValue); 602Debug.Assert(end <= long.MaxValue); 603Debug.Assert(start <= end); 678Debug.Assert(startIndex < 0);
System\Buffers\SequenceReader.cs (7)
148Debug.Assert(CurrentSpanIndex + offset >= 0); 153Debug.Assert(offset <= int.MaxValue); 335Debug.Assert(count >= 0); 350Debug.Assert(count >= 0); 355Debug.Assert(CurrentSpanIndex < CurrentSpan.Length); 381Debug.Assert(count >= 0); 434Debug.Assert(firstSpan.Length < destination.Length);
System\Buffers\SequenceReader.Search.cs (4)
78Debug.Assert(sequence.Length > 0); 195Debug.Assert(skip >= 0); 439Debug.Assert(sequence.Length > 0); 809Debug.Assert(currentSpan.Length < next.Length);
System\Buffers\SequenceReaderExtensions.Binary.cs (1)
39Debug.Assert(reader.UnreadSpan.Length < sizeof(T));
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 (833)
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 (3)
167Debug.Assert(chars.Length >= bytes.Length * 2); 359Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 360Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\IO\DelegatingStream.cs (1)
65Debug.Assert(innerStream != null);
src\libraries\Common\src\System\Net\ArrayBuffer.cs (9)
40Debug.Assert(initialSize > 0 || usePool); 52Debug.Assert(buffer.Length > 0); 77Debug.Assert(_usePool); 78Debug.Assert(_bytes is not null); 117Debug.Assert(byteCount <= AvailableLength); 133Debug.Assert(AvailableLength < byteCount); 137Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0); 149Debug.Assert(byteCount <= AvailableLength); 179Debug.Assert(byteCount <= AvailableLength);
src\libraries\Common\src\System\Net\CredentialCacheKey.cs (3)
20Debug.Assert(uriPrefix != null); 21Debug.Assert(authenticationType != null); 60Debug.Assert(uri != null);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\DynamicTable.cs (2)
76Debug.Assert(_count + 1 <= maxCapacity); 80Debug.Assert(newBufferSize > _count);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackDecoder.cs (3)
249Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 261Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 315Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackEncoder.cs (17)
95Debug.Assert(indexLength >= 1); 127Debug.Assert(indexLength >= 1); 159Debug.Assert(indexLength >= 1); 197Debug.Assert(indexLength >= 1); 369Debug.Assert(Ascii.IsValid(value)); 376Debug.Assert(integerLength >= 1); 382Debug.Assert(status == OperationStatus.Done); 383Debug.Assert(valueBytesWritten == value.Length); 397Debug.Assert(destination.Length >= value.Length); 406Debug.Assert(status == OperationStatus.Done); 407Debug.Assert(bytesWritten == value.Length); 426Debug.Assert(integerLength >= 1); 470Debug.Assert(integerLength >= 1); 481Debug.Assert(written == encodedStringLength); 528Debug.Assert(separator != null); 529Debug.Assert(Ascii.IsValid(separator)); 551Debug.Assert(integerLength >= 1);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\IntegerDecoder.cs (2)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8); 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\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
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 (9)
69Debug.Assert((firstByte & LengthMask) == InitialEightByteLengthMask); 73Debug.Assert(value >= 0 && value <= EightByteLimit, "Serialized values are within [0, 2^62)."); 118Debug.Assert(result); 119Debug.Assert(bytesRead == length); 149Debug.Assert(longToEncode >= 0); 150Debug.Assert(longToEncode <= EightByteLimit); 193Debug.Assert(res); 199Debug.Assert(value >= 0); 200Debug.Assert(value <= EightByteLimit);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\HeaderField.cs (1)
17Debug.Assert(name.Length > 0);
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\Http\aspnetcore\Http3\QPack\QPackEncoder.cs (14)
42Debug.Assert(res); 97Debug.Assert(res); 106Debug.Assert(res); 167Debug.Assert(res); 177Debug.Assert(res); 204Debug.Assert(written == encodedStringLength); 235Debug.Assert(separator != null); 236Debug.Assert(Ascii.IsValid(separator)); 303Debug.Assert(buffer.Length >= s.Length); 312Debug.Assert(status == OperationStatus.Done); 313Debug.Assert(bytesWritten == s.Length); 318Debug.Assert(Ascii.IsValid(s)); 331Debug.Assert(status == OperationStatus.Done); 332Debug.Assert(valueBytesWritten == s.Length);
src\libraries\Common\src\System\Net\Http\UriRedactionHelper.cs (1)
36Debug.Assert(pathAndQuery is not null);
src\libraries\Common\src\System\Net\HttpKnownHeaderNames.TryGetHeaderName.cs (2)
16Debug.Assert(name != null); 290Debug.Assert(potentialHeader != null);
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.Associate.cs (1)
35Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (32)
38Debug.Assert(initialBufferSize >= 0); 70Debug.Assert(byteCount >= 0); 112Debug.Assert(toReturn is not null); 120Debug.Assert(byteCount >= 0); 130Debug.Assert(byteCount >= 0); 131Debug.Assert(limit >= 0); 147Debug.Assert(byteCount >= 0); 157Debug.Assert(byteCount > AvailableMemory.Length); 169Debug.Assert(_allocatedEnd == 0); 170Debug.Assert(_activeStart == 0); 171Debug.Assert(_availableStart == 0); 183Debug.Assert(_allocatedEnd % BlockSize == 0); 184Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize); 225Debug.Assert(_allocatedEnd % BlockSize == 0); 227Debug.Assert(allocatedBlockCount == 0 || _blocks[allocatedBlockCount - 1] is not null); 230Debug.Assert(_blocks[allocatedBlockCount] is null); 237Debug.Assert(byteCount <= AvailableMemory.Length); 247Debug.Assert(_activeStart == 0); 248Debug.Assert(_availableStart == 0); 249Debug.Assert(_allocatedEnd == 0); 253Debug.Assert(_activeStart <= _availableStart); 254Debug.Assert(_availableStart <= _allocatedEnd); 255Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize); 264Debug.Assert(_blocks[i] is null); 269Debug.Assert(_blocks[i] is not null); 274Debug.Assert(_blocks[i] is null); 307Debug.Assert(blocks is not null); 308Debug.Assert(start <= int.MaxValue); 309Debug.Assert(length <= int.MaxValue); 310Debug.Assert(start + length <= blocks.Length * BlockSize); 349Debug.Assert(_length > 0, "Length should never be 0 here because BlockCount would be 0"); 350Debug.Assert(_blocks is not null);
src\libraries\Common\src\System\Net\Security\SslClientAuthenticationOptionsExtensions.cs (1)
43Debug.Assert(properties.Length == 15);
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\SimpleRegex.cs (1)
68Debug.Assert(patternPos <= pattern.Length);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 281Debug.Assert(additionalCapacityBeyondPos > 0); 282Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Net\Http\DiagnosticsHandler.cs (2)
27Debug.Assert(GlobalHttpSettings.DiagnosticsHandler.EnableActivityPropagation); 28Debug.Assert(innerHandler is not null && propagator is not null);
System\Net\Http\DiagnosticsHelper.cs (2)
60Debug.Assert(Enum.GetValues<HttpRequestError>().Length == 12, "We need to extend the mapping in case new values are added to HttpRequestError."); 99Debug.Assert(statusCode >= 400 && statusCode <= 599);
System\Net\Http\Headers\AltSvcHeaderParser.cs (3)
27Debug.Assert(startIndex >= 0); 28Debug.Assert(startIndex < value.Length); 308Debug.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 (4)
48Debug.Assert(source != null); 118Debug.Assert(startIndex >= 0); 236Debug.Assert(parseEndIndex < input.Length, "Expected string to have at least 1 char"); 237Debug.Assert(input[parseEndIndex] == ',');
System\Net\Http\Headers\ByteArrayHeaderParser.cs (1)
22Debug.Assert(value is byte[]);
System\Net\Http\Headers\CacheControlHeaderParser.cs (1)
48Debug.Assert(isInvalidValue || storeValue == null || temp != null, "'storeValue' is not of type CacheControlHeaderValue");
System\Net\Http\Headers\CacheControlHeaderValue.cs (5)
67Debug.Assert(sizeof(Flags) == sizeof(int)); 171Debug.Assert(source != null); 351Debug.Assert(startIndex >= 0); 371Debug.Assert(nameValue is not null); 491Debug.Assert(nameValue != null);
System\Net\Http\Headers\ContentDispositionHeaderValue.cs (5)
134Debug.Assert(source != null); 209Debug.Assert(startIndex >= 0); 255Debug.Assert((input != null) && (input.Length > 0) && (startIndex < input.Length)); 337Debug.Assert(nameParameter.Value != null); 447Debug.Assert(input != null);
System\Net\Http\Headers\ContentRangeHeaderValue.cs (2)
86Debug.Assert(source != null); 159Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\CookieHeaderParser.cs (1)
22Debug.Assert(index == 0);
System\Net\Http\Headers\DateHeaderParser.cs (1)
22Debug.Assert(value is DateTimeOffset);
System\Net\Http\Headers\EntityTagHeaderValue.cs (3)
47Debug.Assert(source != null); 87Debug.Assert(startIndex >= 0); 129Debug.Assert(tagLength != input.Length || (startIndex == 0 && !isWeak));
System\Net\Http\Headers\GenericHeaderParser.cs (1)
59Debug.Assert(getParsedValueLength != null);
System\Net\Http\Headers\HeaderDescriptor.cs (7)
61Debug.Assert(!string.IsNullOrEmpty(headerName)); 83Debug.Assert(headerName.Length > 0); 104Debug.Assert(index >= 0); 108Debug.Assert(qpackStaticTable.Length == 99); 127Debug.Assert(_descriptor is KnownHeader); 128Debug.Assert(HeaderType != HttpHeaderType.Custom); 253Debug.Assert(candidate is null || candidate.Length == contentTypeValue.Length);
System\Net\Http\Headers\HeaderUtilities.cs (8)
32Debug.Assert(parameters != null); 124Debug.Assert(parameters != null); 208Debug.Assert(xItem != null); 235Debug.Assert(Array.TrueForAll(alreadyFound, value => value), 244Debug.Assert(input != null); 245Debug.Assert(startIndex <= input.Length); // it's OK if index == value.Length. 275Debug.Assert(store != null); 292Debug.Assert(store != null);
System\Net\Http\Headers\HttpGeneralHeaders.cs (1)
151Debug.Assert(parent != null);
System\Net\Http\Headers\HttpHeaderParser.cs (4)
35Debug.Assert(!string.IsNullOrEmpty(separator)); 36Debug.Assert(Ascii.IsValid(separator)); 55Debug.Assert((value == null) || ((index >= 0) && (index <= value.Length))); 73Debug.Assert(value != null);
System\Net\Http\Headers\HttpHeaders.cs (62)
68Debug.Assert((allowedHeaderTypes & treatAsCustomHeaderTypes) == 0); 92Debug.Assert(!Contains(descriptor)); 124Debug.Assert(!Contains(descriptor)); 154Debug.Assert(currentValue is string); 292Debug.Assert(singleValue is not null ^ multiValue is not null); 304Debug.Assert(multiValue is not null && multiValue.Length > 0); 322Debug.Assert(singleValue is not null ^ multiValue is not null); 345Debug.Assert(_headerStore is not null); 348Debug.Assert(_count != 0 && entries is not null, "Caller should have validated the collection is not empty"); 387Debug.Assert(value != null); 388Debug.Assert(descriptor.Parser != null, "Can't add parsed value if there is no parser available."); 401Debug.Assert(value != null); 402Debug.Assert(descriptor.Parser != null, "Can't add parsed value if there is no parser available."); 430Debug.Assert(value != null); 436Debug.Assert(descriptor.Parser != null, "Can't add parsed value if there is no parser available."); 437Debug.Assert(descriptor.Parser.SupportsMultipleValues, 455Debug.Assert(parsedValue.GetType() == value.GetType(), 471Debug.Assert(item.GetType() == value.GetType(), 508Debug.Assert(value != null); 514Debug.Assert(descriptor.Parser != null, "Can't add parsed value if there is no parser available."); 515Debug.Assert(descriptor.Parser.SupportsMultipleValues, 533Debug.Assert(parsedValue.GetType() == value.GetType(), 545Debug.Assert(item.GetType() == value.GetType(), 564Debug.Assert(sourceHeaders != null); 565Debug.Assert(GetType() == sourceHeaders.GetType(), "Can only copy headers from an instance of the same type."); 604Debug.Assert(sourceValue is string); 656Debug.Assert(source is not InvalidValue); 702Debug.Assert(!Contains(descriptor)); 708Debug.Assert((descriptor.HeaderType & _treatAsCustomHeaderTypes) == 0); 760Debug.Assert(value is string); 780Debug.Assert(!info.IsEmpty); 793Debug.Assert(rawValue is not null); 798Debug.Assert(info.ParsedAndInvalidValues is not null); 806Debug.Assert(Monitor.IsEntered(info)); 845Debug.Assert(!Contains(descriptor)); 855Debug.Assert(info != null); 856Debug.Assert(descriptor.Parser != null); 888Debug.Assert(index < value.Length, "Parser must return an index value within the string length."); 931Debug.Assert(value != null); 941Debug.Assert(!(value is List<object>), 974Debug.Assert(currentStoreValue is T); 978Debug.Assert(value is T); 1022Debug.Assert(info != null); 1056Debug.Assert(index < value.Length, "Parser must return an index value within the string length."); 1146Debug.Assert(singleValue is not null ^ multiValue is not null); 1155Debug.Assert(sourceValues is string); 1174Debug.Assert(length > 1, "The header should have been removed when it became empty"); 1182Debug.Assert(currentIndex == length); 1193Debug.Assert(sourceValues is string); 1207Debug.Assert(length > 0); 1217Debug.Assert(currentIndex == length); 1225Debug.Assert(info != null); 1226Debug.Assert(Monitor.IsEntered(info)); 1251Debug.Assert(item != null); 1261Debug.Assert(value != null); 1278Debug.Assert(value is not null); 1294Debug.Assert(parser != null, "There should be no reason to call CanAddValue if there is no parser for the current header."); 1317Debug.Assert(item is not InvalidValue); 1322Debug.Assert(ParsedAndInvalidValues is not InvalidValue); 1366Debug.Assert(count == 1, "Only a single parsed value should be stored for this parser"); 1507Debug.Assert(dictionary.Count == _count - 1); 1525Debug.Assert(!Contains(entry.Key));
System\Net\Http\Headers\HttpHeadersNonValidated.cs (2)
69Debug.Assert(singleValue is not null ^ multiValue is not null); 146Debug.Assert(singleValue is not null ^ multiValue is not null);
System\Net\Http\Headers\HttpHeaderValueCollection.cs (5)
102Debug.Assert(storeValue is T); 116Debug.Assert(item is T); 153Debug.Assert(item is T); 159Debug.Assert(storeValue is T); 190Debug.Assert(typeof(T) == typeof(string));
System\Net\Http\Headers\HttpRequestHeaders.cs (1)
277Debug.Assert(sourceRequestHeaders != null);
System\Net\Http\Headers\HttpResponseHeaders.cs (1)
149Debug.Assert(sourceResponseHeaders != null);
System\Net\Http\Headers\Int32NumberHeaderParser.cs (1)
26Debug.Assert(value is int);
System\Net\Http\Headers\Int64NumberHeaderParser.cs (1)
26Debug.Assert(value is long);
System\Net\Http\Headers\KnownHeader.cs (5)
14Debug.Assert(!string.IsNullOrEmpty(name)); 15Debug.Assert(name[0] == ':' || HttpRuleParser.IsToken(name)); 20Debug.Assert(!string.IsNullOrEmpty(name)); 21Debug.Assert(name[0] == ':' || HttpRuleParser.IsToken(name)); 32Debug.Assert(asciiBytes == name.Length);
System\Net\Http\Headers\MediaTypeHeaderParser.cs (1)
19Debug.Assert(mediaTypeCreator != null);
System\Net\Http\Headers\MediaTypeHeaderValue.cs (4)
85Debug.Assert(source != null); 178Debug.Assert(mediaTypeCreator != null); 179Debug.Assert(startIndex >= 0); 228Debug.Assert((input != null) && (input.Length > 0) && (startIndex < input.Length));
System\Net\Http\Headers\NameValueHeaderValue.cs (10)
54Debug.Assert(source != null); 62Debug.Assert(_name != null); 168Debug.Assert(destination != null); 209Debug.Assert(input != null); 210Debug.Assert(startIndex >= 0); 211Debug.Assert(nameValueCreator != null); 268Debug.Assert(nameValueCollection != null); 269Debug.Assert(startIndex >= 0); 306Debug.Assert((name != null) && (name.Length > 0)); 325Debug.Assert(input != null);
System\Net\Http\Headers\NameValueWithParametersHeaderValue.cs (3)
98Debug.Assert(input != null); 99Debug.Assert(startIndex >= 0); 120Debug.Assert(nameValueWithParameters != null);
System\Net\Http\Headers\ObjectCollection.cs (5)
41Debug.Assert(item != null); 53Debug.Assert(_size == 1); 72Debug.Assert(_size > 0); 73Debug.Assert(_size == array.Length); 103Debug.Assert(_size == 0 || _size == 1);
System\Net\Http\Headers\ProductHeaderValue.cs (2)
45Debug.Assert(source != null); 106Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\ProductInfoHeaderValue.cs (4)
38Debug.Assert(source != null); 48Debug.Assert(_comment != null); 76Debug.Assert(_comment != null); 117Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\RangeConditionHeaderValue.cs (2)
38Debug.Assert(source != null); 75Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\RangeHeaderValue.cs (3)
43Debug.Assert(source != null); 133Debug.Assert(startIndex >= 0); 171Debug.Assert(current == input.Length, "GetRangeItemListLength() should consume the whole string or fail.");
System\Net\Http\Headers\RangeItemHeaderValue.cs (4)
46Debug.Assert(source != null); 82Debug.Assert(rangeCollection != null); 83Debug.Assert(startIndex >= 0); 129Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\RetryConditionHeaderValue.cs (2)
38Debug.Assert(source != null); 79Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\StringWithQualityHeaderValue.cs (2)
42Debug.Assert(source != null); 87Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\TimeSpanHeaderParser.cs (1)
20Debug.Assert(value is TimeSpan);
System\Net\Http\Headers\TransferCodingHeaderParser.cs (1)
25Debug.Assert(transferCodingCreator != null);
System\Net\Http\Headers\TransferCodingHeaderValue.cs (3)
28Debug.Assert(source != null); 63Debug.Assert(transferCodingCreator != null); 64Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\UriHeaderParser.cs (1)
90Debug.Assert(value is Uri);
System\Net\Http\Headers\ViaHeaderValue.cs (3)
71Debug.Assert(source != null); 139Debug.Assert(startIndex >= 0); 157Debug.Assert(protocolVersion != null);
System\Net\Http\Headers\WarningHeaderValue.cs (2)
67Debug.Assert(source != null); 137Debug.Assert(startIndex >= 0);
System\Net\Http\HttpClient.cs (2)
129Debug.Assert(HttpContent.MaxBufferSize <= int.MaxValue); 605Debug.Assert(_timeout.TotalSeconds > 0);
System\Net\Http\HttpContent.cs (36)
53Debug.Assert(encoding != null); 83Debug.Assert(IsBuffered); 98Debug.Assert(IsBuffered); 116Debug.Assert(firstBuffer.Length >= 4 || firstBuffer.Length == stream.Length); 194Debug.Assert(_bufferedContent != null); 612Debug.Assert(contentLength >= 0); 696Debug.Assert(StreamCopyExceptionNeedsWrapping(e)); 703Debug.Assert(encoding != null); 810Debug.Assert(maxBufferSize >= 0); 811Debug.Assert(expectedFinalSize >= 0); 829Debug.Assert(_pooledBuffers is null); 830Debug.Assert(!_lastBufferIsPooled); 843Debug.Assert(!_shouldPoolFinalSize || _expectedFinalSize == 0); 847Debug.Assert(_pooledBuffers is null); 864Debug.Assert(!_lastBufferIsPooled); 865Debug.Assert(_pooledBuffers is null); 879Debug.Assert(!_lastBufferIsPooled); 880Debug.Assert(_pooledBuffers is null); 881Debug.Assert(_lastBufferOffset == _totalLength); 882Debug.Assert(_lastBufferOffset <= _lastBuffer.Length); 889Debug.Assert(_lastBufferIsPooled || _pooledBuffers is null); 925Debug.Assert(_totalLength + buffer.Length <= _maxBufferSize); 953Debug.Assert(newBufferCapacity > 0); 980Debug.Assert(_pooledBuffers is null); 981Debug.Assert(_lastBufferOffset == 0); 982Debug.Assert(_totalLength == 0); 985Debug.Assert(_shouldPoolFinalSize || newBuffer.Length != _expectedFinalSize); 993Debug.Assert(_lastBufferIsPooled); 1000Debug.Assert(remainingInCurrentBuffer.Length < buffer.Length); 1026Debug.Assert(bufferCount <= 16); 1042Debug.Assert(destination.Length >= _totalLength); 1046Debug.Assert(buffers.Length > 0 && buffers[0] is not null); 1055Debug.Assert(destination.Length >= buffer.Length); 1062Debug.Assert(_lastBufferOffset <= _lastBuffer.Length); 1063Debug.Assert(_lastBufferOffset <= destination.Length); 1085Debug.Assert(_lastBuffer is not null);
System\Net\Http\HttpMethod.SocketsHttpHandler.cs (1)
56Debug.Assert(Ascii.IsValid(Method));
System\Net\Http\HttpRequestMessage.cs (1)
190Debug.Assert(value);
System\Net\Http\HttpResponseMessage.cs (1)
118Debug.Assert(headers.ContainsTrailingHeaders);
System\Net\Http\HttpRuleParser.cs (12)
38Debug.Assert(input is not null); 55Debug.Assert(IsToken(input)); 62Debug.Assert(input != null); 96Debug.Assert(input != null); 97Debug.Assert((startIndex >= 0) && (startIndex < input.Length)); 140Debug.Assert(input != null); 141Debug.Assert(startIndex >= 0); 191Debug.Assert(input != null); 192Debug.Assert((startIndex >= 0) && (startIndex < input.Length)); 227Debug.Assert(input != null); 228Debug.Assert((startIndex >= 0) && (startIndex < input.Length)); 323Debug.Assert(!ContainsNewLineOrNull(host.ToString()));
System\Net\Http\HttpTelemetry.AnyOS.cs (1)
27Debug.Assert(versionMajor is 1 or 2 or 3);
System\Net\Http\HttpTelemetry.cs (5)
50Debug.Assert(request.RequestUri != null && request.RequestUri.IsAbsoluteUri); 185Debug.Assert(redirectUri.IsAbsoluteUri); 203Debug.Assert(count >= 0); 218Debug.Assert(count >= 0); 233Debug.Assert(count >= 0);
System\Net\Http\MessageProcessingHandler.cs (1)
143Debug.Assert(handler != null);
System\Net\Http\Metrics\MetricsHandler.cs (2)
21Debug.Assert(GlobalHttpSettings.MetricsHandler.IsGloballyEnabled); 55Debug.Assert(GlobalHttpSettings.MetricsHandler.IsGloballyEnabled);
System\Net\Http\MultipartContent.cs (4)
158Debug.Assert(stream != null); 202Debug.Assert(stream != null); 236Debug.Assert(task.IsCompleted); 422Debug.Assert(streams != null);
System\Net\Http\NetEventSource.Http.cs (4)
24Debug.Assert(Log.IsEnabled()); 35Debug.Assert(Log.IsEnabled()); 58Debug.Assert(Log.IsEnabled()); 69Debug.Assert(Log.IsEnabled());
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.cs (5)
222Debug.Assert(pool.PreAuthCredentials != null); 228Debug.Assert(pool.PreAuthCredentials.GetCredential(authUri, NegotiateScheme) == null); 229Debug.Assert(pool.PreAuthCredentials.GetCredential(authUri, NtlmScheme) == null); 230Debug.Assert(pool.PreAuthCredentials.GetCredential(authUri, DigestScheme) == null); 367Debug.Assert(request.RequestUri != null);
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.Digest.cs (4)
108Debug.Assert(request.RequestUri != null); 222Debug.Assert(written == SHA256.HashSizeInBytes); 229Debug.Assert(written == MD5.HashSizeInBytes); 316Debug.Assert(currentIndex < data.Length && !CharIsSpaceOrTab(data[currentIndex]));
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.NtAuth.cs (1)
242Debug.Assert(request.RequestUri != null);
System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs (16)
25Debug.Assert(response != null, "The HttpResponseMessage cannot be null."); 71Debug.Assert(_connection.RemainingBuffer.Length == 0); 72Debug.Assert(buffer.Length != 0); 154Debug.Assert(_state == ParsingState.Done); 166Debug.Assert(_connection != null); 187Debug.Assert(_connection.RemainingBuffer.Length == 0); 188Debug.Assert(buffer.Length != 0); 296Debug.Assert(buffer.Length > 0); 305Debug.Assert(bytesRead.Length <= buffer.Length); 315Debug.Assert(_connection != null); 359Debug.Assert(_chunkBytesRemaining > 0); 368Debug.Assert(bytesToConsume > 0 || maxBytesToRead == 0); 470Debug.Assert(_connection != null); 528Debug.Assert(_connection is not null); 532Debug.Assert(fillTask.IsCompleted); 538Debug.Assert(_connection is not null);
System\Net\Http\SocketsHttpHandler\ChunkedEncodingWriteStream.cs (3)
26Debug.Assert(connection._currentRequest != null); 36Debug.Assert(writeTask.IsCompleted); 50Debug.Assert(connection._currentRequest != null);
System\Net\Http\SocketsHttpHandler\ConnectHelper.cs (1)
48Debug.Assert(localRequest != null);
System\Net\Http\SocketsHttpHandler\ConnectionPool\ConnectionSetupDistributedTracing.cs (4)
42Debug.Assert(activity is not null); 60Debug.Assert(exception is not null); 67Debug.Assert(errorType is not null, "DiagnosticsHelper.TryGetErrorType() should succeed whenever an exception is provided."); 85Debug.Assert(connectionSetupActivity is not null);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (41)
83Debug.Assert(host is not null || (kind == HttpConnectionKind.Proxy && proxyUri is not null)); 96Debug.Assert(host != null); 97Debug.Assert(port != 0); 98Debug.Assert(sslHostName == null); 99Debug.Assert(proxyUri == null); 105Debug.Assert(host != null); 106Debug.Assert(port != 0); 107Debug.Assert(sslHostName != null); 108Debug.Assert(proxyUri == null); 112Debug.Assert(host == null); 113Debug.Assert(port == 0); 114Debug.Assert(sslHostName == null); 115Debug.Assert(proxyUri != null); 122Debug.Assert(host != null); 123Debug.Assert(port != 0); 124Debug.Assert(sslHostName == null); 125Debug.Assert(proxyUri != null); 132Debug.Assert(host != null); 133Debug.Assert(port != 0); 134Debug.Assert(sslHostName != null); 135Debug.Assert(proxyUri != null); 141Debug.Assert(host != null); 142Debug.Assert(port != 0); 143Debug.Assert(sslHostName == null); 144Debug.Assert(proxyUri != null); 157Debug.Assert(host != null); 158Debug.Assert(port != 0); 159Debug.Assert(proxyUri != null); 192Debug.Assert(Encoding.ASCII.GetString(_hostHeaderLineBytes) == $"Host: {hostHeader}\r\n"); 263Debug.Assert(sslHostName != null); 297Debug.Assert(!Monitor.IsEntered(_http11Connections)); 408Debug.Assert(async); 447Debug.Assert(connection is not null || !_http2Enabled); 496Debug.Assert(retryCount >= 0 && retryCount <= MaxConnectionFailureRetries); 546Debug.Assert(http11ConnectionWaiter is null || http2ConnectionWaiter?.ConnectionCancellationTokenSource is null); 607Debug.Assert(stream != null); 798Debug.Assert(_proxyUri != null); 808Debug.Assert(e is not HttpRequestException); 854Debug.Assert(desiredVersion == 2 || desiredVersion == 3); 867Debug.Assert(!HasSyncObjLock); 937Debug.Assert((_availableHttp2Connections?.Count ?? 0) == 0, $"Expected {nameof(_availableHttp2Connections)}.{nameof(_availableHttp2Connections.Count)} == 0");
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http1.cs (11)
126Debug.Assert(success == waiter is not null); 173Debug.Assert(connection is not null); 221Debug.Assert(HasSyncObjLock); 289Debug.Assert(connectionException is not null); 316Debug.Assert(_associatedHttp11ConnectionCount > 0); 317Debug.Assert(_pendingHttp11ConnectionCount > 0); 344Debug.Assert(_pendingHttp11ConnectionCount > 0); 416Debug.Assert(_associatedHttp11ConnectionCount > 0); 417Debug.Assert(!disposing || Array.IndexOf(_http11Connections.ToArray(), connection) < 0); 435Debug.Assert(pool.HasSyncObjLock); 436Debug.Assert(connections.Count <= pool._associatedHttp11ConnectionCount);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http2.cs (19)
66Debug.Assert(_kind == HttpConnectionKind.Https || _kind == HttpConnectionKind.SslProxyTunnel || _kind == HttpConnectionKind.Http || _kind == HttpConnectionKind.SocksTunnel || _kind == HttpConnectionKind.SslSocksTunnel); 140Debug.Assert(HasSyncObjLock); 241Debug.Assert(connectionException is not null); 279Debug.Assert(_associatedHttp2ConnectionCount > 0); 280Debug.Assert(_pendingHttp2Connection); 297Debug.Assert(_pendingHttp2Connection); 298Debug.Assert(_associatedHttp2ConnectionCount > 0); 367Debug.Assert(!HasSyncObjLock); 368Debug.Assert(isNewConnection || initialRequestWaiter is null, "Shouldn't have a request unless the connection is new"); 374Debug.Assert(_availableHttp2Connections is null || !_availableHttp2Connections.Contains(connection)); 375Debug.Assert(_associatedHttp2ConnectionCount > (_availableHttp2Connections?.Count ?? 0)); 393Debug.Assert(_availableHttp2Connections is null || !_availableHttp2Connections.Contains(connection), $"HTTP2 connection already in available list"); 399Debug.Assert(_pendingHttp2Connection); 436Debug.Assert(!added); 455Debug.Assert(_disposed); 466Debug.Assert(initialRequestWaiter is not null, "Expect request for a new connection"); 518Debug.Assert(_availableHttp2Connections is null || !_availableHttp2Connections.Contains(connection)); 519Debug.Assert(_associatedHttp2ConnectionCount > 0); 544Debug.Assert(_associatedHttp2ConnectionCount >= _availableHttp2Connections.Count);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (33)
70Debug.Assert(IsHttp3Supported()); 72Debug.Assert(_kind == HttpConnectionKind.Https); 73Debug.Assert(_http3Enabled); 138Debug.Assert(IsHttp3Supported()); 213Debug.Assert(IsHttp3Supported()); 215Debug.Assert(HasSyncObjLock); 252Debug.Assert(IsHttp3Supported()); 296Debug.Assert(connectionSetupActivity?.IsStopped is not true); 335Debug.Assert(IsHttp3Supported()); 351Debug.Assert(_associatedHttp3ConnectionCount > 0); 352Debug.Assert(_pendingHttp3Connection); 366Debug.Assert(IsHttp3Supported()); 370Debug.Assert(!HasSyncObjLock); 371Debug.Assert(isNewConnection || initialRequestWaiter is null, "Shouldn't have a request unless the connection is new"); 377Debug.Assert(_availableHttp3Connections is null || !_availableHttp3Connections.Contains(connection)); 378Debug.Assert(_associatedHttp3ConnectionCount > (_availableHttp3Connections?.Count ?? 0)); 396Debug.Assert(_availableHttp3Connections is null || !_availableHttp3Connections.Contains(connection), $"HTTP3 connection already in available list"); 402Debug.Assert(_pendingHttp3Connection); 439Debug.Assert(!added); 460Debug.Assert(_disposed); 488Debug.Assert(IsHttp3Supported()); 509Debug.Assert(_availableHttp3Connections is null || !_availableHttp3Connections.Contains(connection)); 510Debug.Assert(_associatedHttp3ConnectionCount > 0); 531Debug.Assert(IsHttp3Supported()); 540Debug.Assert(_associatedHttp3ConnectionCount >= _availableHttp3Connections.Count); 567Debug.Assert(IsHttp3Supported()); 665Debug.Assert(parsedValue is not null); 677Debug.Assert(_authorityExpireTimer != null || _disposed); 776Debug.Assert(HasSyncObjLock); 815Debug.Assert(badAuthority != null); 865Debug.Assert(_authorityExpireTimer != null); 869Debug.Assert(_altSvcBlocklistTimerCancellation != null); 902Debug.Assert(_authorityExpireTimer != null || _disposed);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionWaiter.cs (2)
33Debug.Assert(typeof(T) == typeof(HttpConnection) || typeof(T) == typeof(Http2Connection)); 68Debug.Assert(connection is not null);
System\Net\Http\SocketsHttpHandler\ConnectionPool\RequestQueue.cs (2)
50Debug.Assert(_size > 0); 166Debug.Assert(_attemptedConnectionsOffset >= 0);
System\Net\Http\SocketsHttpHandler\ContentLengthReadStream.cs (12)
19Debug.Assert(contentLength > 0, "Caller should have checked for 0."); 31Debug.Assert(_contentBytesRemaining > 0); 44Debug.Assert((ulong)bytesRead <= _contentBytesRemaining); 67Debug.Assert(_contentBytesRemaining > 0); 106Debug.Assert((ulong)bytesRead <= _contentBytesRemaining); 146Debug.Assert(_connection != null); 174Debug.Assert(maxBytesToRead > 0); 175Debug.Assert(_contentBytesRemaining > 0); 176Debug.Assert(_connection != null); 185Debug.Assert(bytesToConsume > 0); 197Debug.Assert(_connection != null); 198Debug.Assert(_contentBytesRemaining > 0);
System\Net\Http\SocketsHttpHandler\ContentLengthWriteStream.cs (2)
32Debug.Assert(connection._currentRequest != null); 46Debug.Assert(connection._currentRequest != null);
System\Net\Http\SocketsHttpHandler\CookieHelper.cs (2)
18Debug.Assert(valuesArray.Length > 0, "No values for header??"); 19Debug.Assert(response.RequestMessage != null && response.RequestMessage.RequestUri != null);
System\Net\Http\SocketsHttpHandler\CreditManager.cs (7)
22Debug.Assert(owner != null); 23Debug.Assert(!string.IsNullOrWhiteSpace(name)); 97Debug.Assert(_current <= 0 || _waitersTail is null, "Shouldn't have waiters when credit is available"); 105Debug.Assert(waiter != null); 111Debug.Assert(_waitersTail == waiter); 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\DecompressionHandler.cs (9)
28Debug.Assert(decompressionMethods != DecompressionMethods.None); 29Debug.Assert(innerHandler != null); 71Debug.Assert(response.Content != null); 157Debug.Assert(task.IsCompleted); 333Debug.Assert(_firstByteStatus == FirstByteStatus.None); 349Debug.Assert(_firstByteStatus == FirstByteStatus.None); 379Debug.Assert(_firstByteStatus == FirstByteStatus.Consumed); 397Debug.Assert(_firstByteStatus == FirstByteStatus.Consumed); 403Debug.Assert(_firstByteStatus != FirstByteStatus.None);
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (53)
228Debug.Assert(requiredSpace == _outgoingBuffer.ActiveLength); 272Debug.Assert(Monitor.IsEntered(SyncObject)); 273Debug.Assert(!_pool.HasSyncObjLock); 293Debug.Assert(!_pool.HasSyncObjLock); 316Debug.Assert(!_pool.HasSyncObjLock); 322Debug.Assert(_availableStreamsWaiter is null || _streamsInUse >= _maxConcurrentStreams); 326Debug.Assert(_streamsInUse >= _httpStreams.Count); 347Debug.Assert(!_pool.HasSyncObjLock); 351Debug.Assert(_availableStreamsWaiter is null, "As used currently, shouldn't already have a waiter"); 373Debug.Assert(Monitor.IsEntered(SyncObject)); 377Debug.Assert(_shutdown != result); 506Debug.Assert(InitialSettingsReceived.Task.IsCompleted); 547Debug.Assert(bytesRead >= 0); 648Debug.Assert(frameHeader.Type == FrameType.Headers); 751Debug.Assert(frameHeader.Type == FrameType.AltSvc); 752Debug.Assert(!Monitor.IsEntered(SyncObject)); 780Debug.Assert(frameHeader.Type == FrameType.Data); 809Debug.Assert(frameHeader.Type == FrameType.Settings); 845Debug.Assert((settings.Length % 6) == 0); 935Debug.Assert(_availableStreamsWaiter is null || _streamsInUse >= _maxConcurrentStreams); 948Debug.Assert(newSize >= 0); 965Debug.Assert(frameHeader.Type == FrameType.Priority); 979Debug.Assert(frameHeader.Type == FrameType.Ping); 994Debug.Assert(sizeof(long) == FrameHeader.PingLength); 1013Debug.Assert(frameHeader.Type == FrameType.WindowUpdate); 1023Debug.Assert(amount >= 0); 1050Debug.Assert(frameHeader.Type == FrameType.RstStream); 1083Debug.Assert(lastStreamId >= 0); 1098Debug.Assert(streamId == kvp.Value.StreamId); 1116Debug.Assert(frameHeader.Type == FrameType.GoAway); 1152Debug.Assert(canceled, "Callback should have been unregistered if the operation was completing successfully."); 1199Debug.Assert(_shutdown && _streamsInUse == 0); 1304Debug.Assert(sizeof(long) == FrameHeader.PingLength); 1328Debug.Assert(!_pool.HasSyncObjLock); 1438Debug.Assert(headerValuesCount > 0, "No values for header??"); 1513Debug.Assert(request.RequestUri != null); 1645Debug.Assert(headerBytes.Length > 0); 1691Debug.Assert(span.Length == 0); 1771Debug.Assert(amount > 0); 1787Debug.Assert(amount > 0); 1788Debug.Assert(_pendingWindowUpdate < ConnectionWindowThreshold); 1837Debug.Assert(streamId == kvp.Value.StreamId); 1854Debug.Assert(_shutdown); 1855Debug.Assert(_streamsInUse == 0); 1862Debug.Assert(completed, "FinalTeardown was called twice"); 1915Debug.Assert(streamId >= 0); 1931Debug.Assert(buffer.Length >= Size); 1943Debug.Assert(destination.Length >= Size); 1944Debug.Assert(type <= FrameType.Last); 1945Debug.Assert((flags & FrameFlags.ValidBits) == flags); 1946Debug.Assert((uint)payloadLength <= MaxPayloadLength); 1998Debug.Assert(async); 1999Debug.Assert(!_pool.HasSyncObjLock);
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (67)
170Debug.Assert(_response != null); 182Debug.Assert(_requestCompletionState == StreamCompletionState.Completed); 187Debug.Assert(_requestBodyCancellationSource != null); 245Debug.Assert(!Monitor.IsEntered(SyncObject)); 255Debug.Assert(_responseCompletionState == StreamCompletionState.Completed); 257Debug.Assert(!ConnectProtocolEstablished); 265Debug.Assert(!sendReset); 269Debug.Assert(!ConnectProtocolEstablished); 287Debug.Assert(!Monitor.IsEntered(SyncObject)); 322Debug.Assert(!ConnectProtocolEstablished); 335Debug.Assert(_request?.Content != null); 364Debug.Assert(Monitor.IsEntered(SyncObject)); 365Debug.Assert(_requestCompletionState != StreamCompletionState.InProgress); 366Debug.Assert(_responseCompletionState != StreamCompletionState.InProgress); 367Debug.Assert(_requestCompletionState == StreamCompletionState.Failed || _responseCompletionState == StreamCompletionState.Failed, 383Debug.Assert(Monitor.IsEntered(SyncObject)); 384Debug.Assert(_requestCompletionState != StreamCompletionState.InProgress); 385Debug.Assert(_responseCompletionState != StreamCompletionState.InProgress); 410Debug.Assert(!Monitor.IsEntered(SyncObject)); 416Debug.Assert(requestBodyCancellationSource != null); 453Debug.Assert(Monitor.IsEntered(SyncObject)); 555Debug.Assert(index >= FirstHPackRequestPseudoHeaderId && index <= LastHPackNormalHeaderId); 578Debug.Assert(index >= FirstHPackRequestPseudoHeaderId && index <= LastHPackNormalHeaderId); 619Debug.Assert(!Monitor.IsEntered(SyncObject)); 641Debug.Assert(_response != null); 683Debug.Assert(!Monitor.IsEntered(SyncObject)); 710Debug.Assert(_trailers != null); 716Debug.Assert(_response != null && _response.Content != null); 722Debug.Assert(_response != null); 731Debug.Assert(name.Length > 0); 763Debug.Assert(!Monitor.IsEntered(SyncObject)); 786Debug.Assert(!Monitor.IsEntered(SyncObject)); 850Debug.Assert(_requestCompletionState != StreamCompletionState.Failed); 869Debug.Assert(!Monitor.IsEntered(SyncObject)); 924Debug.Assert(_requestCompletionState != StreamCompletionState.Failed); 949Debug.Assert(!Monitor.IsEntered(SyncObject)); 988Debug.Assert(requestBodyCancellationSource != null); 1001Debug.Assert(_requestBodyAbandoned); 1002Debug.Assert(!cancel); 1013Debug.Assert(Monitor.IsEntered(SyncObject)); 1034Debug.Assert(!Monitor.IsEntered(SyncObject)); 1040Debug.Assert(!_hasWaiter); 1067Debug.Assert(!wait); 1070Debug.Assert(_response is not null); 1079Debug.Assert(_response != null && _response.Content != null); 1108Debug.Assert(!Monitor.IsEntered(SyncObject)); 1127Debug.Assert(_responseProtocolState == ResponseProtocolState.ExpectingData || _responseProtocolState == ResponseProtocolState.ExpectingTrailingHeaders); 1129Debug.Assert(!_hasWaiter); 1143Debug.Assert(bytesRead == 0); 1146Debug.Assert(!wait); 1167Debug.Assert(bytesRead == 0); 1170Debug.Assert(!wait); 1197Debug.Assert(bytesRead == 0); 1200Debug.Assert(!wait); 1233Debug.Assert(bytesRead == 0); 1236Debug.Assert(!wait); 1268Debug.Assert(_requestBodyCancellationSource != null); 1311Debug.Assert(_creditWaiter != null); 1324Debug.Assert(sendSize > 0); 1376Debug.Assert(!Monitor.IsEntered(SyncObject)); 1421Debug.Assert(!Monitor.IsEntered(SyncObject)); 1435Debug.Assert(!_waitSource.RunContinuationsAsynchronously); 1441Debug.Assert(_waitSource.RunContinuationsAsynchronously); 1459Debug.Assert(!Monitor.IsEntered(thisRef.SyncObject)); 1517Debug.Assert(contentLength >= -1); 1551Debug.Assert(http2Stream != null); 1552Debug.Assert(http2Stream._response != null);
System\Net\Http\SocketsHttpHandler\Http2StreamWindowManager.cs (5)
48Debug.Assert(_lastWindowUpdate != default); // Make sure Start() has been invoked, otherwise we should not be receiving DATA. 49Debug.Assert(bytesConsumed > 0); 50Debug.Assert(_deliveredBytes < StreamWindowThreshold); 120Debug.Assert(_streamWindowSize <= MaxStreamWindowSize); 244Debug.Assert(payload < 0);
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (16)
67Debug.Assert(Monitor.IsEntered(SyncObj)); 131Debug.Assert(Monitor.IsEntered(SyncObj)); 132Debug.Assert(ShuttingDown); 191Debug.Assert(singleConnection || _availableRequestStreamsCount >= 0); 212Debug.Assert(!_pool.Settings.EnableMultipleHttp3Connections || _availableRequestStreamsCount >= 0); 224Debug.Assert(_connection is null || connection == _connection); 228Debug.Assert(_availableStreamsWaiter is null || _availableRequestStreamsCount >= 0); 243Debug.Assert(_pool.Settings.EnableMultipleHttp3Connections, "Calling WaitForAvailableStreamsAsync() is invalid when EnableMultipleHttp3Connections is false."); 247Debug.Assert(_availableRequestStreamsCount >= 0); 258Debug.Assert(_availableStreamsWaiter is null); 503Debug.Assert(ex.ApplicationErrorCode.HasValue); 520Debug.Assert(payloadLength <= VariableLengthIntegerHelper.OneByteLimit); 564Debug.Assert(ex.ApplicationErrorCode.HasValue); 699Debug.Assert(ex.ApplicationErrorCode.HasValue); 964Debug.Assert(!Started); 997Debug.Assert(_activity?.IsStopped != false);
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (17)
237Debug.Assert(_response != null && _response.Content != null); 277Debug.Assert(ex.ApplicationErrorCode.HasValue); 301Debug.Assert(ex.ApplicationErrorCode.HasValue); 339Debug.Assert(_requestBodyCancellationSource.IsCancellationRequested); 392Debug.Assert(_response == null); 409Debug.Assert(_response != null); 625Debug.Assert(_sendBuffer.ActiveLength == 0); 649Debug.Assert(request.RequestUri != null); 709Debug.Assert(actualHeadersLengthEncodedSize == headersLengthEncodedSize); 737Debug.Assert(headerValuesCount > 0, "No values for header??"); 959Debug.Assert(name.Length > 0); 1155Debug.Assert(_response == null); 1228Debug.Assert(_response == null); 1307Debug.Assert(e.ApplicationErrorCode.HasValue); 1312Debug.Assert(e.ApplicationErrorCode.HasValue); 1475Debug.Assert(_response != null); 1488Debug.Assert(_response != null);
System\Net\Http\SocketsHttpHandler\HttpAuthority.cs (1)
21Debug.Assert(host != null);
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (75)
80Debug.Assert(stream != null); 137Debug.Assert(_readAheadTaskStatus is ReadAheadTask_Started or ReadAheadTask_Completed); 161Debug.Assert(_readAheadTaskStatus == ReadAheadTask_NotStarted); 195Debug.Assert(_readAheadTaskStatus != ReadAheadTask_CompletionReserved); 205Debug.Assert(_readAheadTaskStatus != ReadAheadTask_Started); 232Debug.Assert(_readAheadTask == default); 246Debug.Assert(_readAheadTask == default); 247Debug.Assert(_readBuffer.ActiveLength == 0); 279Debug.Assert(_readAheadTaskStatus is ReadAheadTask_Started or ReadAheadTask_CompletionReserved); 305Debug.Assert(bytesToConsume <= _readBuffer.ActiveLength); 311Debug.Assert(request.RequestUri is not null); 332Debug.Assert(request.RequestUri.Scheme == Uri.UriSchemeHttp); 341Debug.Assert(request.Version.Major >= 0 && request.Version.Minor >= 0); // guaranteed by Version class 351Debug.Assert(Kind != HttpConnectionKind.Proxy); 356Debug.Assert(Kind == HttpConnectionKind.Proxy); 411Debug.Assert(success); 419Debug.Assert(_currentRequest is not null); 437Debug.Assert(headerValuesCount > 0, "No values for header??"); 491Debug.Assert(Ascii.IsValid(s)); 496Debug.Assert(status == OperationStatus.Done); 497Debug.Assert(bytesWritten == s.Length); 516Debug.Assert(status == OperationStatus.Done); 517Debug.Assert(bytesWritten == s.Length); 534Debug.Assert(_currentRequest == null, $"Expected null {nameof(_currentRequest)}."); 535Debug.Assert(_readBuffer.ActiveLength == 0, "Unexpected data in read buffer"); 536Debug.Assert(_readAheadTaskStatus != ReadAheadTask_Started, 603Debug.Assert(_readBuffer.ActiveLength == 0); 612Debug.Assert(_readAheadTask != default); 613Debug.Assert(_readAheadTaskStatus is ReadAheadTask_CompletionReserved or ReadAheadTask_Completed); 858Debug.Assert(_readAheadTaskStatus is ReadAheadTask_CompletionReserved or ReadAheadTask_Completed); 946Debug.Assert(request.Content is not null); 972Debug.Assert(stream.BytesWritten == 0); 1145Debug.Assert(_allowedReadLineBytes >= 0); 1322Debug.Assert(added); 1376Debug.Assert(source.Length <= _writeBuffer.AvailableLength); 1534Debug.Assert(formatted); 1540Debug.Assert(_writeBuffer.Capacity >= 8); 1626Debug.Assert(!ReadAheadTaskHasStarted); 1627Debug.Assert(_readBuffer.AvailableLength == _readBuffer.Capacity); 1628Debug.Assert(_readBuffer.AvailableLength >= InitialReadBufferSize); 1642Debug.Assert(_readAheadTask == default); 1682Debug.Assert(_readBuffer.ActiveStartOffset == 0); 1683Debug.Assert(_readBuffer.ActiveLength > searchOffset); 1696Debug.Assert(searchOffset == readLength - 1 && _readBuffer.ActiveReadOnlySpan[searchOffset] == '\n'); 1713Debug.Assert(buffer.Length > 0); 1769Debug.Assert(_readAheadTask == default, "Read ahead task should have been consumed as part of the headers."); 1787Debug.Assert(_readAheadTask == default, "Read ahead task should have been consumed as part of the headers."); 1808Debug.Assert(_readAheadTask == default, "Read ahead task should have been consumed as part of the headers."); 1815Debug.Assert(_readBuffer.AvailableLength == _readBuffer.Capacity); 1846Debug.Assert(_readAheadTask == default, "Read ahead task should have been consumed as part of the headers."); 1848Debug.Assert(_readBuffer.AvailableLength == _readBuffer.Capacity); 1861Debug.Assert(count <= _readBuffer.ActiveLength); 1881Debug.Assert(destination != null); 1900Debug.Assert(remaining > 0); 1917Debug.Assert(destination != null); 1918Debug.Assert(length > 0); 1936Debug.Assert(_readBuffer.ActiveLength == 0, "HttpConnection's buffer should have been empty."); 1986Debug.Assert(origReadBuffer.Length > 0); 2007Debug.Assert(_currentRequest == null); 2008Debug.Assert(!_inUse); 2015Debug.Assert(_inUse); 2033Debug.Assert(_inUse); 2040Debug.Assert(_currentRequest != null, "Expected the connection to be associated with a request."); 2041Debug.Assert(_writeBuffer.ActiveLength == 0, "Everything in write buffer should have been flushed."); 2076Debug.Assert(_inUse); 2083Debug.Assert(response.Content != null); 2087Debug.Assert(responseStream != null || stream is EmptyReadStream); 2091Debug.Assert(response.RequestMessage == _currentRequest); 2100Debug.Assert(_currentRequest == null); 2107Debug.Assert(!_disposed, "Connection should not be disposed."); 2108Debug.Assert(_currentRequest == null, "Connection should no longer be associated with a request."); 2109Debug.Assert(_readAheadTask == default, "Expected a previous initial read to already be consumed."); 2110Debug.Assert(_readAheadTaskStatus == ReadAheadTask_NotStarted, "Expected SendAsync to reset the read-ahead task status."); 2111Debug.Assert(_readBuffer.ActiveLength == 0, "Unexpected data in connection read buffer."); 2128Debug.Assert(!_detachedFromPool, "Should not be detached from pool unless _connectionClose is true");
System\Net\Http\SocketsHttpHandler\HttpConnectionBase.cs (5)
45Debug.Assert(this is HttpConnection or Http2Connection or Http3Connection); 46Debug.Assert(pool != null); 61Debug.Assert(_pool.Settings._metrics is not null); 143Debug.Assert(cache is not null); 212Debug.Assert(task.IsFaulted);
System\Net\Http\SocketsHttpHandler\HttpConnectionPoolManager.cs (5)
262Debug.Assert(uri != null); 266Debug.Assert(uri == proxyUri); 289Debug.Assert(HttpUtilities.IsSupportedProxyScheme(proxyUri.Scheme)); 388Debug.Assert(request.RequestUri != null); 478Debug.Assert(_cleaningTimer != null);
System\Net\Http\SocketsHttpHandler\HttpConnectionResponseContent.cs (3)
18Debug.Assert(stream != null); 19Debug.Assert(stream.CanRead); 20Debug.Assert(!_consumedStream);
System\Net\Http\SocketsHttpHandler\HttpContentReadStream.cs (1)
75Debug.Assert(connection != null);
System\Net\Http\SocketsHttpHandler\HttpContentWriteStream.cs (1)
18Debug.Assert(connection != null);
System\Net\Http\SocketsHttpHandler\Metrics\SocketsHttpHandlerMetrics.cs (1)
34Debug.Assert(versionMajor is 1 or 2 or 3);
System\Net\Http\SocketsHttpHandler\MultiProxy.cs (9)
51Debug.Assert(failedProxyCache != null); 80Debug.Assert(failedProxyCache != null); 98Debug.Assert(_failedProxyCache != null); 115Debug.Assert(_failedProxyCache != null); 141Debug.Assert(uri != null); 155Debug.Assert(_uris != null || _proxyConfig != null, $"{nameof(ReadNext)} must not be called on a default-initialized {nameof(MultiProxy)}."); 171Debug.Assert(_proxyConfig != null); 177Debug.Assert(_currentIndex <= _proxyConfig.Length); 264Debug.Assert(charactersConsumed > 0);
System\Net\Http\SocketsHttpHandler\PreAuthCredentialCache.cs (6)
18Debug.Assert(uriPrefix != null); 19Debug.Assert(authType != null); 31Debug.Assert(uriPrefix != null); 32Debug.Assert(authType != null); 46Debug.Assert(uriPrefix != null); 47Debug.Assert(authType != null);
System\Net\Http\SocketsHttpHandler\RedirectHandler.cs (3)
19Debug.Assert(innerHandler != null); 20Debug.Assert(maxAutomaticRedirections > 0); 33Debug.Assert(request.RequestUri != null);
System\Net\Http\SocketsHttpHandler\SocketsHttpHandler.cs (1)
550Debug.Assert(_decompressionHandlerFactory is not null);
System\Net\Http\SocketsHttpHandler\SocksHelper.cs (6)
162Debug.Assert(bytesWritten == 4); 167Debug.Assert(hostIP.AddressFamily == AddressFamily.InterNetworkV6); 170Debug.Assert(bytesWritten == 16); 270Debug.Assert(isVersion4a); 279Debug.Assert(bytesWritten == 4); 328Debug.Assert(Encoding.UTF8.GetByteCount(chars) > 255);
System\Net\Http\StreamContent.cs (2)
50Debug.Assert(stream != null); 67Debug.Assert(stream != null);
System\Net\Http\StreamToStreamCopy.cs (6)
25Debug.Assert(source != null); 26Debug.Assert(destination != null); 27Debug.Assert(bufferSize >= 0); 52Debug.Assert(source != null); 53Debug.Assert(destination != null); 54Debug.Assert(bufferSize >= 0);
System\Net\Http\StringContent.cs (1)
51Debug.Assert(DefaultStringEncoding.WebName == "utf-8");
System.Net.Http.Json (5)
System\Net\Http\Json\HttpClientJsonExtensions.cs (1)
120Debug.Assert(client.MaxResponseContentBufferSize is > 0 and <= int.MaxValue);
System\Net\Http\Json\JsonContent.cs (2)
27Debug.Assert(jsonTypeInfo is not null); 28Debug.Assert(inputValue is null || jsonTypeInfo.Type.IsAssignableFrom(inputValue.GetType()));
System\Net\Http\Json\JsonHelpers.cs (2)
19Debug.Assert(type is not null); 53Debug.Assert(encoding != null);
System.Net.HttpListener (44)
src\libraries\Common\src\System\HexConverter.cs (3)
167Debug.Assert(chars.Length >= bytes.Length * 2); 359Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 360Debug.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(fieldInfo != null, "We need to use an internal field named IsQuotedDomain that is declared on Cookie."); 574Debug.Assert(fieldInfo != null, "We need to use an internal field named IsQuotedVersion that is declared on Cookie.");
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (3)
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."); 402Debug.Assert(state is LazyAsyncResult);
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.Associate.cs (1)
35Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\WebHeaderEncoding.cs (1)
23Debug.Assert(bytes != null && (uint)byteIndex <= (uint)bytes.Length && (uint)(byteIndex + byteCount) <= (uint)bytes.Length);
src\libraries\Common\src\System\Net\WebSockets\WebSocketValidate.cs (1)
97Debug.Assert(!string.IsNullOrEmpty(parameterName), "'parameterName' MUST NOT be NULL or string.Empty");
System\Net\HttpListener.cs (1)
210Debug.Assert(operationStatus == OperationStatus.Done);
System\Net\HttpListenerRequestUriBuilder.cs (14)
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."); 176Debug.Assert(_rawPath != null); 229Debug.Assert(_requestUriString != null); 288Debug.Assert(_rawOctets != null); 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\Managed\ChunkStream.cs (1)
137Debug.Assert(offset == 0);
System\Net\Managed\HttpListenerRequest.Managed.cs (1)
152Debug.Assert(_rawUrl != null);
System\Net\Managed\HttpRequestStream.Managed.cs (2)
122Debug.Assert(nread <= _remainingBody); 208Debug.Assert(nread <= _remainingBody);
System\Net\ServiceNameStore.cs (2)
137Debug.Assert(!string.IsNullOrEmpty(uriPrefix)); 166Debug.Assert(!string.IsNullOrEmpty(uriPrefix));
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 (45)
src\libraries\Common\src\System\HexConverter.cs (3)
167Debug.Assert(chars.Length >= bytes.Length * 2); 359Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 360Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.Associate.cs (1)
35Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 281Debug.Assert(additionalCapacityBeyondPos > 0); 282Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Net\Base64Stream.cs (1)
65Debug.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 (5)
34Debug.Assert(_host != null, 37Debug.Assert(userName != null, 40Debug.Assert(displayName != null, 76Debug.Assert(parseSuccess); 291Debug.Assert(Address != null, "address was null");
System\Net\Mail\MailAddressParser.cs (2)
45Debug.Assert(index == -1 || data[index] == MailBnfHelper.Comma, 69Debug.Assert(!string.IsNullOrEmpty(data));
System\Net\Mail\MailBnfHelper.cs (2)
363Debug.Assert(index >= 0); 364Debug.Assert(index < data.Length);
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\MailPriority.cs (1)
411System.Diagnostics.Debug.Assert(_headersEncoding != null);
System\Net\Mail\MailWriter.cs (1)
55Diagnostics.Debug.Assert(_contentStream == sender);
System\Net\Mail\SmtpCommands.cs (1)
60System.Diagnostics.Debug.Assert(lines.Length == 1, "Did not expect more than one line response for auth command");
System\Net\Mail\SmtpReplyReaderFactory.cs (1)
267System.Diagnostics.Debug.Assert(_readState == ReadState.Status0);
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"); 77Debug.Assert(codepointSize == 1 || codepointSize == 2, "codepointSize was not 1 or 2");
System\Net\Mime\SmtpDateTime.cs (7)
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"); 268Debug.Assert(dateValue.Kind == DateTimeKind.Unspecified);
System\Net\TrackingValidationObjectDictionary.cs (1)
45Debug.Assert(key != null, "key was null");
System.Net.NameResolution (13)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (4)
28Debug.Assert(ipv4 > 0); 29Debug.Assert(ipv6 > 0); 30Debug.Assert(uds > 0); 31Debug.Assert(max >= ipv4 && max >= ipv6 && max >= uds);
System\Net\Dns.cs (3)
425Debug.Assert(!activityOrDefault.HasValue); 492Debug.Assert(name != null); 748Debug.Assert(!Monitor.IsEntered(s_tasks));
System\Net\NameResolutionPal.Unix.cs (1)
175Debug.Assert(bytesWritten == rawAddressLength);
System\Net\NameResolutionTelemetry.cs (3)
128Debug.Assert(hostNameOrAddress is not null); 203Debug.Assert(answerValues is not null); 208Debug.Assert(exception is not null);
System.Net.NetworkInformation (22)
src\libraries\Common\src\System\HexConverter.cs (3)
167Debug.Assert(chars.Length >= bytes.Length * 2); 359Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 360Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\IO\RowConfigReader.cs (1)
66Debug.Assert(_buffer != null);
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\NetEventSource.NetworkInformation.cs (1)
24Debug.Assert(IsEnabled());
System\Net\NetworkInformation\NetworkAddressChange.Unix.cs (8)
24Debug.Assert(Monitor.IsEntered(s_gate)); 29Debug.Assert(Monitor.IsEntered(s_gate)); 74Debug.Assert(Socket == null, 125Debug.Assert(Socket == null, 152Debug.Assert(Monitor.IsEntered(s_gate)); 153Debug.Assert(Socket == null, "Socket is not null, must close existing socket before opening another."); 177Debug.Assert(Monitor.IsEntered(s_gate)); 178Debug.Assert(Socket != null, "Socket was null when CloseSocket was called.");
System\Net\NetworkInformation\StringParsingHelpers.Connections.cs (1)
360Debug.Assert(hexAddress.Length == 32);
System\Net\NetworkInformation\UnicastIPAddressInformation.cs (3)
72Debug.Assert((0 <= prefixLength) && (prefixLength <= 126)); 73Debug.Assert((family == AddressFamily.InterNetwork) || (family == AddressFamily.InterNetworkV6)); 80Debug.Assert(prefixLength <= (addressBytes.Length * 8));
System.Net.Ping (6)
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (1)
46Debug.Assert(written == IPAddressParserStatics.IPv6AddressBytes);
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (4)
28Debug.Assert(ipv4 > 0); 29Debug.Assert(ipv6 > 0); 30Debug.Assert(uds > 0); 31Debug.Assert(max >= ipv4 && max >= ipv6 && max >= uds);
System\Net\NetworkInformation\Ping.RawSocket.cs (1)
397Debug.Assert(Marshal.SizeOf<IcmpHeader>() == 8, "The size of an ICMP Header must be 8 bytes.");
System.Net.Primitives (71)
src\libraries\Common\src\System\HexConverter.cs (3)
167Debug.Assert(chars.Length >= bytes.Length * 2); 359Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 360Debug.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(fieldInfo != null, "We need to use an internal field named IsQuotedDomain that is declared on Cookie."); 574Debug.Assert(fieldInfo != null, "We need to use an internal field named IsQuotedVersion that is declared on Cookie.");
src\libraries\Common\src\System\Net\CredentialCacheKey.cs (3)
20Debug.Assert(uriPrefix != null); 21Debug.Assert(authenticationType != null); 60Debug.Assert(uri != null);
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (1)
46Debug.Assert(written == IPAddressParserStatics.IPv6AddressBytes);
src\libraries\Common\src\System\Net\IPv4AddressHelper.Common.cs (10)
26Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 37Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 130Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 216Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 326Debug.Assert(parts[0] <= 0xFF); 333Debug.Assert(parts[0] <= 0xFF); 334Debug.Assert(parts[1] <= 0xFF); 341Debug.Assert(parts[0] <= 0xFF); 342Debug.Assert(parts[1] <= 0xFF); 343Debug.Assert(parts[2] <= 0xFF);
src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (3)
101Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 125Debug.Assert(start < end); 314Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\NetworkInformation\InterfaceInfoPal.Unix.cs (2)
21Debug.Assert(typeof(TChar) == typeof(byte) || typeof(TChar) == typeof(char)); 41Debug.Assert(bufferSize <= int.MaxValue - 1);
src\libraries\Common\src\System\Net\SocketAddress.cs (4)
107Debug.Assert(bytesWritten == IPAddressParserStatics.IPv6AddressBytes); 117Debug.Assert(ipAddress.AddressFamily == AddressFamily.InterNetwork); 180Debug.Assert(formatted); 195Debug.Assert(formatted);
src\libraries\Common\src\System\Net\SocketAddressExtensions.cs (1)
14Debug.Assert(socketAddress.Family == AddressFamily.InterNetwork || socketAddress.Family == AddressFamily.InterNetworkV6);
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (4)
28Debug.Assert(ipv4 > 0); 29Debug.Assert(ipv6 > 0); 30Debug.Assert(uds > 0); 31Debug.Assert(max >= ipv4 && max >= ipv6 && max >= uds);
System\Net\Cookie.cs (3)
80Debug.Assert(MaxSupportedVersion.ToString(NumberFormatInfo.InvariantInfo).Equals(MaxSupportedVersionString, StringComparison.Ordinal)); 343Debug.Assert(idxOfSeparator == -1); 416Debug.Assert(m_domainKey is not null);
System\Net\CookieContainer.cs (4)
323Debug.Assert(m_maxCookies != 0); 324Debug.Assert(m_maxCookiesPerDomain != 0); 367Debug.Assert(cc != null); 918Debug.Assert(value != null);
System\Net\CredentialCache.cs (7)
177Debug.Assert(cache != null); 200Debug.Assert(cache != null); 250Debug.Assert(table != null); 275Debug.Assert(cache._cacheForHosts != null); 356Debug.Assert(!string.IsNullOrEmpty(host)); 357Debug.Assert(port >= 0); 358Debug.Assert(authenticationType != null);
System\Net\IPAddress.cs (14)
77Debug.Assert(IsIPv4); 82Debug.Assert(IsIPv4); 93Debug.Assert(IsIPv4 || IsIPv4MappedToIPv6); 107Debug.Assert(IsIPv6); 112Debug.Assert(IsIPv6); 159Debug.Assert(numbers.Length == NumberOfLabels); 167Debug.Assert(numbers != null); 168Debug.Assert(numbers.Length == NumberOfLabels); 355Debug.Assert(numbers is { Length: NumberOfLabels }); 395Debug.Assert(_numbers is { Length: NumberOfLabels }); 521Debug.Assert(tmpDestination.Length >= IPAddressParser.MaxIPv4StringLength); 689Debug.Assert(comparand != null); 703Debug.Assert(_numbers.Length == IPAddressParserStatics.IPv6AddressShorts); 704Debug.Assert(comparand._numbers!.Length == IPAddressParserStatics.IPv6AddressShorts);
System\Net\IPAddressParser.cs (3)
40Debug.Assert(typeof(TChar) == typeof(byte) || typeof(TChar) == typeof(char)); 93Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 94Debug.Assert(numbersLength >= IPAddressParserStatics.IPv6AddressShorts);
System\Net\IPNetwork.cs (5)
114Debug.Assert(bytesWritten == IPAddressParserStatics.IPv6AddressBytes); 116Debug.Assert(bytesWritten == IPAddressParserStatics.IPv6AddressBytes); 209Debug.Assert(prefixLength >= 0); // Parsing with NumberStyles.None should ensure that prefixLength is always non-negative. 238Debug.Assert(prefixLength >= 0); // Parsing with NumberStyles.None should ensure that prefixLength is always non-negative. 267Debug.Assert(bytesWritten == IPAddressParserStatics.IPv6AddressBytes);
System.Net.Quic (117)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs (2)
66Debug.Assert(bytesNeeded != 0, "OBJ_obj2txt reported a zero-length response"); 86Debug.Assert(
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs (1)
156Debug.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 (3)
41Debug.Assert(currentHandle.IsInvalid); 51Debug.Assert(handle != null); 53Debug.Assert(!isCachedInvalidHandle || handle.IsInvalid, "The cached invalid handle must still be invalid.");
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (1)
46Debug.Assert(addedRef);
src\libraries\Common\src\System\HexConverter.cs (3)
167Debug.Assert(chars.Length >= bytes.Length * 2); 359Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 360Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Net\ArrayBuffer.cs (9)
40Debug.Assert(initialSize > 0 || usePool); 52Debug.Assert(buffer.Length > 0); 77Debug.Assert(_usePool); 78Debug.Assert(_bytes is not null); 117Debug.Assert(byteCount <= AvailableLength); 133Debug.Assert(AvailableLength < byteCount); 137Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0); 149Debug.Assert(byteCount <= AvailableLength); 179Debug.Assert(byteCount <= AvailableLength);
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (1)
46Debug.Assert(written == IPAddressParserStatics.IPv6AddressBytes);
src\libraries\Common\src\System\Net\IPv4AddressHelper.Common.cs (10)
26Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 37Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 130Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 216Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 326Debug.Assert(parts[0] <= 0xFF); 333Debug.Assert(parts[0] <= 0xFF); 334Debug.Assert(parts[1] <= 0xFF); 341Debug.Assert(parts[0] <= 0xFF); 342Debug.Assert(parts[1] <= 0xFF); 343Debug.Assert(parts[2] <= 0xFF);
src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (3)
101Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 125Debug.Assert(start < end); 314Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (32)
38Debug.Assert(initialBufferSize >= 0); 70Debug.Assert(byteCount >= 0); 112Debug.Assert(toReturn is not null); 120Debug.Assert(byteCount >= 0); 130Debug.Assert(byteCount >= 0); 131Debug.Assert(limit >= 0); 147Debug.Assert(byteCount >= 0); 157Debug.Assert(byteCount > AvailableMemory.Length); 169Debug.Assert(_allocatedEnd == 0); 170Debug.Assert(_activeStart == 0); 171Debug.Assert(_availableStart == 0); 183Debug.Assert(_allocatedEnd % BlockSize == 0); 184Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize); 225Debug.Assert(_allocatedEnd % BlockSize == 0); 227Debug.Assert(allocatedBlockCount == 0 || _blocks[allocatedBlockCount - 1] is not null); 230Debug.Assert(_blocks[allocatedBlockCount] is null); 237Debug.Assert(byteCount <= AvailableMemory.Length); 247Debug.Assert(_activeStart == 0); 248Debug.Assert(_availableStart == 0); 249Debug.Assert(_allocatedEnd == 0); 253Debug.Assert(_activeStart <= _availableStart); 254Debug.Assert(_availableStart <= _allocatedEnd); 255Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize); 264Debug.Assert(_blocks[i] is null); 269Debug.Assert(_blocks[i] is not null); 274Debug.Assert(_blocks[i] is null); 307Debug.Assert(blocks is not null); 308Debug.Assert(start <= int.MaxValue); 309Debug.Assert(length <= int.MaxValue); 310Debug.Assert(start + length <= blocks.Length * BlockSize); 349Debug.Assert(_length > 0, "Length should never be 0 here because BlockCount would be 0"); 350Debug.Assert(_blocks is not null);
src\libraries\Common\src\System\Net\SafeHandleCache.cs (3)
94Debug.Assert(handle.IsClosed); 141Debug.Assert(removed); 145Debug.Assert(handle.IsClosed);
src\libraries\Common\src\System\Net\Security\SslKeyLogger.cs (3)
46Debug.Assert(s_fileStream != null); 71Debug.Assert(s_fileStream != null); 72Debug.Assert(!clientRandom.IsEmpty);
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (4)
28Debug.Assert(ipv4 > 0); 29Debug.Assert(ipv6 > 0); 30Debug.Assert(uds > 0); 31Debug.Assert(max >= ipv4 && max >= ipv6 && max >= uds);
src\libraries\Common\src\System\Net\StreamBuffer.cs (17)
39Debug.Assert(!Monitor.IsEntered(SyncObject)); 51Debug.Assert(!Monitor.IsEntered(SyncObject)); 63Debug.Assert(!Monitor.IsEntered(SyncObject)); 80Debug.Assert(!Monitor.IsEntered(SyncObject)); 95Debug.Assert(buffer.Length > 0); 97Debug.Assert(!Monitor.IsEntered(SyncObject)); 145Debug.Assert(bytesWritten == buffer.Length); 168Debug.Assert(bytesWritten == buffer.Length); 179Debug.Assert(!Monitor.IsEntered(SyncObject)); 195Debug.Assert(!Monitor.IsEntered(SyncObject)); 229Debug.Assert(bytesRead == 0); 232Debug.Assert(!wait); 245Debug.Assert(bytesRead == 0); 248Debug.Assert(!wait); 258Debug.Assert(!Monitor.IsEntered(SyncObject)); 303Debug.Assert(!_hasWaiter); 323Debug.Assert(cancellationToken.IsCancellationRequested);
System\Net\Quic\Internal\MsQuicApi.cs (2)
227Debug.Assert(IsQuicSupported); 239Debug.Assert(MsQuicOpenVersion != null);
System\Net\Quic\Internal\MsQuicBuffers.cs (3)
52Debug.Assert(index < _count); 53Debug.Assert(_buffers[index].Buffer is null); 54Debug.Assert(_buffers[index].Length == 0);
System\Net\Quic\Internal\MsQuicConfiguration.Cache.cs (2)
49Debug.Assert(success); 58Debug.Assert(success);
System\Net\Quic\Internal\MsQuicSafeHandle.cs (1)
107Debug.Assert(_disposable is null);
System\Net\Quic\Internal\ResettableValueTaskSource.cs (2)
101Debug.Assert(!_keepAlive.IsAllocated); 176Debug.Assert(final);
System\Net\Quic\Internal\ValueTaskSource.cs (1)
84Debug.Assert(!_keepAlive.IsAllocated);
System\Net\Quic\QuicConnection.cs (3)
390Debug.Assert(host is not null); 849Debug.Assert(_connectedTcs.IsCompleted); 850Debug.Assert(_connectionCloseTcs.Task.IsCompleted);
System\Net\Quic\QuicConnection.SslConnectionOptions.cs (2)
131Debug.Assert(certificate == null); 208Debug.Assert(X509Certificate2.GetCertContentType(chainData) is X509ContentType.Pkcs7);
System\Net\Quic\QuicListener.cs (1)
297Debug.Assert(task.IsCompleted);
System\Net\Quic\QuicStream.cs (3)
253Debug.Assert(!_startedTcs.IsCompleted); 537Debug.Assert(_decrementStreamCapacity is not null); 749Debug.Assert(_startedTcs.IsCompleted);
System.Net.Requests (27)
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 (3)
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."); 402Debug.Assert(state is LazyAsyncResult);
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.Associate.cs (1)
35Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
System\Net\FtpControlStream.cs (2)
175Debug.Assert(_dataStream != null, "Data stream is null"); 695Debug.Assert(port != -1, "'port' not set.");
System\Net\FtpWebRequest.cs (1)
1447Debug.Assert(stream is ICloseEx, "The _stream member is not CloseEx hence the risk of connection been orphaned.");
System\Net\HttpWebRequest.cs (4)
1027Debug.Assert(_sendRequestCts != null); 1721Debug.Assert(handler.UseCookies); // Default of handler.UseCookies is true. 1735Debug.Assert(handler.UseProxy); // Default of handler.UseProxy is true. 1736Debug.Assert(handler.Proxy == null); // Default of handler.Proxy is null.
System\Net\NetworkStreamWrapper.cs (1)
56Debug.Assert(value is SslStream, "Expected SslStream");
System\Net\RequestBufferingStream.cs (1)
109Debug.Assert(success); // Buffer should always be visible since default MemoryStream constructor was used.
System\Net\RequestStreamContent.cs (1)
20Debug.Assert(stream is not null);
System\Net\ServicePoint\ServicePoint.cs (1)
24Debug.Assert(address != null);
System\Net\TaskExtensions.cs (1)
35Debug.Assert(tcs.Task.IsCanceled);
System\Net\TimerThread.cs (1)
200Debug.Assert(_timers.Prev!.Next == _timers, $"Tail corruption.");
System\Net\WebException.cs (1)
82Debug.Assert(exception != null);
System.Net.Security (190)
src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssBuffer.cs (2)
21Debug.Assert(destination != null, "target destination cannot be null"); 74Debug.Assert(sizeof(GssBuffer) == 16);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs (2)
66Debug.Assert(bytesNeeded != 0, "OBJ_obj2txt reported a zero-length response"); 86Debug.Assert(
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs (1)
156Debug.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 (24)
60Debug.Assert(success); 66Debug.Assert(success); 97Debug.Assert( 135Debug.Assert((sslAuthenticationOptions.EnabledSslProtocols & FakeAlpnSslProtocol) == 0); 231Debug.Assert(cipherList.IsEmpty || cipherList[^1] == 0); 234Debug.Assert(cipherSuites == null || (cipherSuites.Length >= 1 && cipherSuites[cipherSuites.Length - 1] == 0)); 268Debug.Assert(result == 1); 323Debug.Assert(sslAuthenticationOptions.CertificateContext.CertificateHandle != null); 324Debug.Assert(sslAuthenticationOptions.CertificateContext.KeyHandle != null); 373Debug.Assert(sslAuthenticationOptions.CertificateContext != null); 394Debug.Assert(sslHandle != null, "Expected non-null return value from SafeSslHandle.Create"); 416Debug.Assert(success); 429Debug.Assert(Interop.Ssl.SslGetData(sslHandle) == IntPtr.Zero); 486Debug.Assert(certList != null); 652Debug.Assert(size < 10 * 1024, "The buffer should not grow too large."); 935Debug.Assert(ssl != IntPtr.Zero); 936Debug.Assert(session != IntPtr.Zero); 949Debug.Assert(name != IntPtr.Zero); 968Debug.Assert(ctx != IntPtr.Zero && session != IntPtr.Zero); 985Debug.Assert(name != IntPtr.Zero); 998Debug.Assert(count >= 0); 999Debug.Assert(buffer.Length >= count); 1049Debug.Assert(certPtr != null && !certPtr.IsInvalid); 1050Debug.Assert(keyPtr != null && !keyPtr.IsInvalid);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (3)
255Debug.Assert(GetAlpnProtocolListSerializedLength(applicationProtocols) == buffer.Length, 304Debug.Assert(stapledResponse.Length > 0); 498Debug.Assert(!IsInvalid, "Expected a valid context in Disconnect");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtx.cs (10)
147Debug.Assert(_gch.IsAllocated); 159Debug.Assert(_sslSessions == null); 163Debug.Assert(_gch.IsAllocated); 170Debug.Assert(_sslSessions != null && session != IntPtr.Zero); 178Debug.Assert(targetName != null); 196Debug.Assert(added); 220Debug.Assert(_sslSessions != null); 223Debug.Assert(targetName != null); 249Debug.Assert(_sslSessions != null); 258Debug.Assert(Interop.Ssl.SslGetData(sslHandle) == IntPtr.Zero);
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 (3)
41Debug.Assert(currentHandle.IsInvalid); 51Debug.Assert(handle != null); 53Debug.Assert(!isCachedInvalidHandle || handle.IsInvalid, "The cached invalid handle must still be invalid.");
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (1)
46Debug.Assert(addedRef);
src\libraries\Common\src\System\HexConverter.cs (3)
167Debug.Assert(chars.Length >= bytes.Length * 2); 359Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 360Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Net\ArrayBuffer.cs (9)
40Debug.Assert(initialSize > 0 || usePool); 52Debug.Assert(buffer.Length > 0); 77Debug.Assert(_usePool); 78Debug.Assert(_bytes is not null); 117Debug.Assert(byteCount <= AvailableLength); 133Debug.Assert(AvailableLength < byteCount); 137Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0); 149Debug.Assert(byteCount <= AvailableLength); 179Debug.Assert(byteCount <= AvailableLength);
src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (1)
32Debug.Assert(task.IsCompletedSuccessfully);
src\libraries\Common\src\System\Net\IPv4AddressHelper.Common.cs (10)
26Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 37Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 130Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 216Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 326Debug.Assert(parts[0] <= 0xFF); 333Debug.Assert(parts[0] <= 0xFF); 334Debug.Assert(parts[1] <= 0xFF); 341Debug.Assert(parts[0] <= 0xFF); 342Debug.Assert(parts[1] <= 0xFF); 343Debug.Assert(parts[2] <= 0xFF);
src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (3)
101Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 125Debug.Assert(start < end); 314Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\SafeHandleCache.cs (3)
94Debug.Assert(handle.IsClosed); 141Debug.Assert(removed); 145Debug.Assert(handle.IsClosed);
src\libraries\Common\src\System\Net\Security\MD4.cs (2)
65Debug.Assert(destination.Length == 128 >> 3); 83Debug.Assert(padLen is >= 0 and <= 120);
src\libraries\Common\src\System\Net\Security\RC4.cs (2)
78Debug.Assert(input.Length == output.Length); 79Debug.Assert(state != null);
src\libraries\Common\src\System\Net\Security\SslKeyLogger.cs (3)
46Debug.Assert(s_fileStream != null); 71Debug.Assert(s_fileStream != null); 72Debug.Assert(!clientRandom.IsEmpty);
src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (3)
17Debug.Assert(arraySegment.Array != null); 18Debug.Assert(arraySegment.Offset == 0); 25Debug.Assert(clearSize <= array.Length);
src\libraries\Common\src\System\Text\UrlBase64Encoding.cs (2)
26Debug.Assert(charsWritten == base64Len); 65Debug.Assert(source[0] == '=');
System\Net\CertificateValidationPal.Unix.cs (2)
124Debug.Assert(session != IntPtr.Zero); 182Debug.Assert(storeLocation == StoreLocation.CurrentUser);
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (18)
233Debug.Assert(clientOptions.Package == NegotiationInfoClass.NTLM); 271Debug.Assert(incomingBlob.IsEmpty); 287Debug.Assert(!incomingBlob.IsEmpty); 297Debug.Assert(HeaderLength == NtlmHeader.Length); 298Debug.Assert(asBytes.Length == sizeof(NegotiateMessage)); 384Debug.Assert(written == HMACMD5.HashSizeInBytes); 400Debug.Assert(serverChallenge.Length == ChallengeLength); 401Debug.Assert(clientChallenge.Length == ChallengeLength); 402Debug.Assert(ntlm2hash.Length == DigestLength); 448Debug.Assert(written == MD5.HashSizeInBytes); 524Debug.Assert(bytesWritten == spnSize); 650Debug.Assert(payloadOffset == sizeof(AuthenticateMessage) + ChallengeResponseLength + sizeof(NtChallengeResponse) + targetInfoBuffer.Length); 661Debug.Assert(flags.HasFlag(Flags.NegotiateSign) && flags.HasFlag(Flags.NegotiateKeyExchange)); 666Debug.Assert(sessionKeyWritten == HMACMD5.HashSizeInBytes); 678Debug.Assert(_negotiateMessage != null); 697Debug.Assert(payloadOffset == responseBytes.Length); 753Debug.Assert(_clientSeal is not null); 754Debug.Assert(_clientSigningKey is not null);
System\Net\NegotiateAuthenticationPal.ManagedSpnego.cs (1)
83Debug.Assert(clientOptions.Package == NegotiationInfoClass.Negotiate);
System\Net\NegotiateAuthenticationPal.Unix.cs (11)
121Debug.Assert(_securityContext is not null && _isAuthenticated, "Trying to get the client SPN before handshaking is done!"); 136Debug.Assert(_securityContext is not null); 334Debug.Assert(_securityContext is not null); 365Debug.Assert(_securityContext is not null); 393Debug.Assert(_securityContext is not null); 424Debug.Assert(_securityContext is not null); 450Debug.Assert(_securityContext is not null); 489Debug.Assert(username != null && password != null, "Username and Password can not be null"); 593Debug.Assert(appDataOffset < channelBinding.Size); 657Debug.Assert(resultBlob != null, "Unexpected null buffer returned by GssApi"); 711Debug.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 (2)
173Debug.Assert(!OperatingSystem.IsTvOS(), "Server authentication is not supported on tvOS"); 406Debug.Assert(_extendedProtectionPolicy != null);
System\Net\Security\NegotiateStream.cs (8)
310Debug.Assert(vt.IsCompleted, "Should have completed synchroously with sync adapter"); 341Debug.Assert(_context is not null); 506Debug.Assert(_context is not null); 507Debug.Assert(_writeBuffer is not null); 724Debug.Assert(_context != null); 753Debug.Assert(_context != null); 862Debug.Assert(_framer != null); 888Debug.Assert(_context != null);
System\Net\Security\NetSecurityTelemetry.cs (5)
148Debug.Assert(sizeof(SslProtocols) == 4); 183Debug.Assert(Enum.GetValues<SslProtocols>()[^1] == SslProtocols.Tls13, "Make sure to add a counter for new SslProtocols"); 249Debug.Assert(count >= 0); 252Debug.Assert(count >= 0); 340Debug.Assert(protocolVersion is not null);
System\Net\Security\Pal.Managed\SafeChannelBindingHandle.cs (3)
23Debug.Assert(certHashBytes != null, "check certHashBytes is not null"); 24Debug.Assert(certHashBytes.Length <= CertHashMaxSize); 33Debug.Assert(kind == ChannelBindingKind.Endpoint || kind == ChannelBindingKind.Unique);
System\Net\Security\SslApplicationProtocol.cs (1)
29Debug.Assert(protocol != null);
System\Net\Security\SslSessionsCache.cs (1)
160Debug.Assert(creds != null, "creds == null");
System\Net\Security\SslStream.cs (11)
88Debug.Assert(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"); 775Debug.Assert(bytesRead == 0 || bytesRead == 1); 790Debug.Assert(vt.IsCompleted, "Sync operation must have completed synchronously"); 805Debug.Assert(vt.IsCompleted, "Sync operation must have completed synchronously"); 822Debug.Assert(vt.IsCompleted, "Sync operation must have completed synchronously"); 840Debug.Assert(vt.IsCompleted, "Sync operation must have completed synchronously");
System\Net\Security\SslStream.IO.cs (7)
46Debug.Assert(e != null, $"Expected non-null Exception to be passed to {nameof(SetException)}"); 301Debug.Assert(consumed == (reAuthenticationData?.Length ?? 0)); 305Debug.Assert(token.Payload != null); 752Debug.Assert(_buffer.AvailableLength > 0, "_buffer.AvailableBytes > 0"); 854Debug.Assert(_buffer.EncryptedLength == 0); 859Debug.Assert(_buffer.DecryptedLength == 0); 999Debug.Assert(_buffer.DecryptedLength > 0);
System\Net\Security\SslStream.Protocol.cs (9)
212Debug.Assert(ret && written == certHash.Length); 279Debug.Assert(certificate != null); 525Debug.Assert((object?)clientCertificate == (object?)selectedCert || clientCertificate!.Equals(selectedCert), "'selectedCert' does not match 'clientCertificate'."); 739Debug.Assert(localCertificate.Equals(selectedCert), "'selectedCert' does not match 'localCertificate'."); 743Debug.Assert(_sslAuthenticationOptions.CertificateContext != null); 970Debug.Assert(_securityContext != null); 992Debug.Assert(_maxDataSize > 0); 1372Debug.Assert(Payload == null); 1409Debug.Assert(Payload != null || Size == 0);
System\Net\Security\SslStreamCertificateContext.Linux.cs (8)
271Debug.Assert(_rootCertificate != null); 274Debug.Assert(_ocspUrls is not null); 275Debug.Assert(_ocspUrls.Count > 0); 276Debug.Assert(caCert is not null); 280Debug.Assert(subject != 0); 281Debug.Assert(issuer != 0); 389Debug.Assert(baseUri.Length > 0); 390Debug.Assert(encodedRequest.Count > 0);
System\Net\Security\SslStreamPal.Unix.cs (1)
193Debug.Assert(sslAuthenticationOptions.IsClient);
System\Net\Security\TlsFrameHelper.cs (1)
237Debug.Assert(gotHeader);
System\Net\SslStreamContext.cs (1)
16Debug.Assert(sslStream != null);
System\Security\Authentication\ExtendedProtection\ServiceNameCollection.cs (4)
45Debug.Assert(list != null); 46Debug.Assert(additionalCapacity >= 0); 109Debug.Assert(serviceNames != null); 122Debug.Assert(serviceNames != null);
System.Net.ServerSentEvents (18)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (9)
40Debug.Assert(initialSize > 0 || usePool); 52Debug.Assert(buffer.Length > 0); 77Debug.Assert(_usePool); 78Debug.Assert(_bytes is not null); 117Debug.Assert(byteCount <= AvailableLength); 133Debug.Assert(AvailableLength < byteCount); 137Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0); 149Debug.Assert(byteCount <= AvailableLength); 179Debug.Assert(byteCount <= AvailableLength);
System\Net\ServerSentEvents\Helpers.cs (4)
18Debug.Assert(MaxDecimalDigits <= buffer.Length); 21Debug.Assert(success); 36Debug.Assert(value.Length <= buffer.Length); 50Debug.Assert(maxByteCount <= buffer.Length);
System\Net\ServerSentEvents\SseFormatter.cs (4)
101Debug.Assert(bufferWriter.WrittenCount is 0); 105Debug.Assert(!eventType.ContainsLineBreaks()); 117Debug.Assert(!eventId.ContainsLineBreaks()); 126Debug.Assert(retry >= TimeSpan.Zero);
System\Net\ServerSentEvents\SseParser_1.cs (1)
276Debug.Assert(_newlineIndex - _lineOffset < _lineLength, "Expected to be positioned at a non-empty newline");
System.Net.Sockets (134)
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (1)
46Debug.Assert(written == IPAddressParserStatics.IPv6AddressBytes);
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\SocketAddressExtensions.cs (1)
14Debug.Assert(socketAddress.Family == AddressFamily.InterNetwork || socketAddress.Family == AddressFamily.InterNetworkV6);
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (4)
28Debug.Assert(ipv4 > 0); 29Debug.Assert(ipv6 > 0); 30Debug.Assert(uds > 0); 31Debug.Assert(max >= ipv4 && max >= ipv6 && max >= uds);
System\Net\Sockets\SafeSocketHandle.cs (1)
173Debug.Assert(!IsClosed);
System\Net\Sockets\SafeSocketHandle.Unix.OptionTracking.cs (3)
34Debug.Assert(values.Length == TrackableOptionCount); 85Debug.Assert(values.Length == TrackableOptionCount); 89Debug.Assert((_trackedOptions & lingerFlag) == lingerFlag);
System\Net\Sockets\Socket.cs (11)
89Debug.Assert(_handle.IsInvalid); 95Debug.Assert(!_handle.IsInvalid); 139Debug.Assert(SocketPal.MaximumAddressSize <= 512); 151Debug.Assert(bufferLength <= buffer.Length); 1077Debug.Assert(acceptedSocketHandle.IsInvalid); 1088Debug.Assert(!acceptedSocketHandle.IsInvalid); 3566Debug.Assert(boundAddress != null, "Not Bound"); 3778Debug.Assert(fd != null && !fd.IsInvalid); 3836Debug.Assert(_nonBlockingConnectInProgress == false); 4055Debug.Assert(t.IsCanceled || t.IsFaulted); 4062Debug.Assert(t.Exception != null);
System\Net\Sockets\Socket.Tasks.cs (14)
65Debug.Assert(saea.BufferList is null); 66Debug.Assert(saea.AcceptSocket is null); 113Debug.Assert(cancellationToken.CanBeCanceled); 206Debug.Assert(endPoint.Port == port); 218Debug.Assert(lastException != null); 323Debug.Assert(saea.BufferList == null); 413Debug.Assert(saea.BufferList == null); 453Debug.Assert(saea.BufferList == null); 514Debug.Assert(saea.BufferList == null); 569Debug.Assert(saea.BufferList == null); 587Debug.Assert(saea.BufferList == null); 677Debug.Assert(saea.BufferList == null); 707Debug.Assert(saea.BufferList == null); 805Debug.Assert(index == packetsCount);
System\Net\Sockets\Socket.Unix.cs (3)
60Debug.Assert(!_handle.LastConnectFailed); 94Debug.Assert(e == Interop.Error.SUCCESS, e.ToString()); 114Debug.Assert(rv == 0 || blocking); // ignore failures
System\Net\Sockets\SocketAsyncContext.Unix.cs (39)
169Debug.Assert(_state is State.Running or State.RunningWithPendingCancellation, "Unexpected operation state"); 246Debug.Assert(_state == State.Canceled); 285Debug.Assert(Event == null); 471Debug.Assert(SocketAddress.Length == 0); 716Debug.Assert(lockObject != null); 720Debug.Assert(!Monitor.IsEntered(_lockObject)); 724Debug.Assert(success, "Timed out waiting for queue lock"); 732Debug.Assert(Monitor.IsEntered(_lockObject)); 798Debug.Assert(_queueLock == null); 817Debug.Assert(sizeof(QueueState) == sizeof(int)); 857Debug.Assert(observedSequenceNumber - _sequenceNumber < 10000, "Very large sequence number increase???"); 869Debug.Assert(operation.Next == operation, "Expected operation.Next == operation"); 873Debug.Assert(!_isNextOperationSynchronous); 896Debug.Assert(_tail == null); 923Debug.Assert(error != Interop.Error.SUCCESS); 957Debug.Assert(_tail == null, "State == Ready but queue is not empty!"); 963Debug.Assert(_tail != null, "State == Waiting but queue is empty!"); 965Debug.Assert(_isNextOperationSynchronous == (op.Event != null)); 978Debug.Assert(_tail != null, "State == Processing but queue is empty!"); 984Debug.Assert(_tail == null); 1004Debug.Assert(!skipAsyncEvents); 1013Debug.Assert(op.Event == null, "Sync operation encountered in ProcessAsyncOperation"); 1040Debug.Assert(_tail == null); 1047Debug.Assert(_tail != null, "Unexpected empty queue while processing I/O"); 1048Debug.Assert(op == _tail.Next, "Operation is not at head of queue???"); 1068Debug.Assert(_tail == null); 1080Debug.Assert(observedSequenceNumber - _sequenceNumber < 10000, "Very large sequence number increase???"); 1100Debug.Assert(_tail == null); 1106Debug.Assert(_tail.Next == op, "Queue modified while processing queue"); 1128Debug.Assert(result != OperationResult.Pending); 1135Debug.Assert(op.Event != null); 1144Debug.Assert(_tail == null); 1148Debug.Assert(_tail != null, "Unexpected empty queue in CancelAndContinueProcessing"); 1218Debug.Assert(_state != QueueState.Stopped); 1224Debug.Assert(_state != QueueState.Stopped); 1288Debug.Assert(_isHandleNonBlocking); 1477Debug.Assert(callback != null, "Expected non-null callback"); 1542Debug.Assert(callback != null, "Expected non-null callback"); 2252Debug.Assert((events & Interop.Sys.SocketEvents.Error) == 0);
System\Net\Sockets\SocketAsyncEngine.Unix.cs (8)
126Debug.Assert(context.GlobalContextIndex == -1); 145Debug.Assert(s_registeredContexts[index] is null); 164Debug.Assert(context.GlobalContextIndex >= 0); 165Debug.Assert(ReferenceEquals(s_registeredContexts[context.GlobalContextIndex], context)); 268Debug.Assert(stageBeforeUpdate != EventQueueProcessingStage.NotScheduled); 284Debug.Assert(_eventQueueProcessingStage == EventQueueProcessingStage.Scheduled); 307Debug.Assert(stageBeforeUpdate != EventQueueProcessingStage.NotScheduled); 371Debug.Assert((uint)socketEvent.Data < (uint)s_registeredContexts.Length);
System\Net\Sockets\SocketAsyncEventArgs.cs (4)
124Debug.Assert(success); 682Debug.Assert(endPoint.AddressFamily == AddressFamily.Unspecified || 769Debug.Assert(existing.Port == port); 1044Debug.Assert(socketError != SocketError.IOPending);
System\Net\Sockets\SocketAsyncEventArgs.Unix.cs (3)
189Debug.Assert(socketAddress.Length == socketAddressSize); 246Debug.Assert(_sendPacketsElements != null); 333Debug.Assert(NetEventSource.Log.IsEnabled());
System\Net\Sockets\SocketPal.Unix.cs (28)
68Debug.Assert(fd != (IntPtr)(-1), "fd should not be -1"); 107Debug.Assert(!handle.IsSocket); 122Debug.Assert(socket.IsSocket); 146Debug.Assert(socket.IsSocket); 158Debug.Assert(socketAddress.Length != 0 || sockAddr == null); 187Debug.Assert(!handle.IsSocket); 216Debug.Assert(socket.IsSocket); 243Debug.Assert(socket.IsSocket); 287Debug.Assert(socket.IsSocket); 382Debug.Assert(socket.IsSocket); 485Debug.Assert(socket.IsSocket); 501Debug.Assert(socketAddress.Length != 0 || rawSocketAddress == null); 543Debug.Assert(socket.IsSocket); 650Debug.Assert(fd != (IntPtr)(-1), "Expected fd != -1"); 782Debug.Assert(flags == SocketFlags.None); 841Debug.Assert(flags == SocketFlags.None); 842Debug.Assert(buffers == null); 980Debug.Assert(flags == SocketFlags.None); 981Debug.Assert(buffers == null); 1686Debug.Assert((uint)optionLength <= optionValue.Length); 1798Debug.Assert(count > 0, $"Expected at least one entry."); 1881Debug.Assert(refsAdded == 0); 1894Debug.Assert(buffer.Length == socketList.Count); 1940Debug.Assert(eventsLength == checkReadInitialCount + checkWriteInitialCount + checkErrorInitialCount, "Invalid eventsLength"); 1989Debug.Assert(refsAdded == 0); 2001Debug.Assert(arrOffset < arrLength, "IList.Count must have been faulty, returning a negative value and/or returning a different value across calls."); 2036Debug.Assert(arrEndOffset >= 0, "IList.Count must have been faulty, returning a negative value and/or returning a different value across calls."); 2088Debug.Assert(elements.Length == fileHandles.Length);
System\Net\Sockets\SocketsTelemetry.cs (5)
148Debug.Assert(newCount >= 0); 163Debug.Assert(exceptionMessage is null); 197Debug.Assert(exceptionMessage is null); 211Debug.Assert(count >= 0); 218Debug.Assert(count >= 0);
System\Net\Sockets\TCPClient.cs (1)
373Debug.Assert(_clientSocket == null);
System\Net\Sockets\TCPListener.cs (1)
285Debug.Assert(OperatingSystem.IsWindows());
System\Net\Sockets\UnixDomainSocketEndPoint.cs (2)
57Debug.Assert(bufferLength - (isAbstract ? 0 : 1) == bytesEncoded); 69Debug.Assert(AddressFamily.Unix == SocketAddressPal.GetAddressFamily(socketAddress));
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 (23)
src\libraries\Common\src\System\HexConverter.cs (3)
167Debug.Assert(chars.Length >= bytes.Length * 2); 359Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 360Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\IO\ChunkedMemoryStream.cs (3)
29Debug.Assert(chunk._next == null || chunk._freeOffset == chunk._buffer.Length); 97Debug.Assert(_headChunk == null); 102Debug.Assert(_headChunk != null);
src\libraries\Common\src\System\IO\DelegatingStream.cs (1)
65Debug.Assert(innerStream != null);
src\libraries\Common\src\System\Threading\Tasks\BeginEndAwaitableAdapter.cs (3)
13Debug.Assert(asyncResult != null); 14Debug.Assert(asyncResult.IsCompleted); 15Debug.Assert(asyncResult.AsyncState is BeginEndAwaitableAdapter);
src\libraries\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs (8)
45Debug.Assert(c == null || c == s_completionSentinel); 55Debug.Assert(_continuation != null); 96Debug.Assert(exception != null); 109Debug.Assert(c != s_completionSentinel); 125Debug.Assert(continuation != null); 130Debug.Assert(c == s_completionSentinel); 145Debug.Assert(_resultSet ^ (_error != null)); 149Debug.Assert(!_resultSet && _error == null);
System\Net\WebClient.cs (5)
516Debug.Assert(conversionStatus == OperationStatus.Done); 871Debug.Assert(_progress != null, "ProgressData should have been initialized"); 872Debug.Assert(asyncOp != null); 1009Debug.Assert(asyncOp != null); 1010Debug.Assert(_progress != null, "ProgressData should have been initialized");
System.Net.WebHeaderCollection (1)
System\Net\HeaderInfoTable.cs (1)
142Debug.Assert(headers.Count == Items);
System.Net.WebProxy (1)
System\Net\WebProxy.cs (1)
180Debug.Assert(formatted);
System.Net.WebSockets (72)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.Associate.cs (1)
35Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\WebSockets\WebSocketValidate.cs (1)
97Debug.Assert(!string.IsNullOrEmpty(parameterName), "'parameterName' MUST NOT be NULL or string.Empty");
System\Net\WebSockets\AsyncMutex.cs (9)
118Debug.Assert(_waitersTail.Next != null && _waitersTail.Prev != null); 141Debug.Assert(w.Prev != null); 156Debug.Assert(m._waitersTail == w); 205Debug.Assert(_lockedSemaphoreFull); 214Debug.Assert(w.Next != null && w.Prev != null); 215Debug.Assert(w.Next != w || w.Prev == w); 216Debug.Assert(w.Prev != w || w.Next == w); 225Debug.Assert(w.Next != null && w.Prev != null); 226Debug.Assert(w.Next != w && w.Prev != w);
System\Net\WebSockets\Compression\WebSocketDeflater.cs (10)
43Debug.Assert(_buffer is null, "Invalid state, ReleaseBuffer not called."); 60Debug.Assert(consumed == payload.Length); 95Debug.Assert(written == output.Length); 106Debug.Assert(output.Slice(written - WebSocketInflater.FlushMarkerLength, WebSocketInflater.FlushMarkerLength) 124Debug.Assert(_stream is not null); 155Debug.Assert(_stream is not null); 156Debug.Assert(_stream.AvailIn == 0); 157Debug.Assert(output.Length > 0); 171Debug.Assert(errorCode is ErrorCode.Ok or ErrorCode.BufError); 185Debug.Assert(errorCode == ErrorCode.Ok);
System\Net\WebSockets\Compression\WebSocketInflater.cs (6)
74Debug.Assert(_available > 0); 89Debug.Assert(totalBytesReceived == 0 || _buffer is not null, "Prepare must be called."); 98Debug.Assert(_available == 0); 166Debug.Assert(_stream is not null && _stream.AvailIn == 0); 167Debug.Assert(_available == 0); 230Debug.Assert(destination.Length > 0);
System\Net\WebSockets\ManagedWebSocket.cs (21)
142Debug.Assert(StateUpdateLock != null, $"Expected {nameof(StateUpdateLock)} to be non-null"); 143Debug.Assert(stream != null, $"Expected non-null {nameof(stream)}"); 144Debug.Assert(stream.CanRead, $"Expected readable {nameof(stream)}"); 145Debug.Assert(stream.CanWrite, $"Expected writeable {nameof(stream)}"); 236Debug.Assert(Monitor.IsEntered(StateUpdateLock), $"Expected {nameof(StateUpdateLock)} to be held"); 425Debug.Assert(_sentCloseFrame); 453Debug.Assert(Monitor.IsEntered(StateUpdateLock), $"Expected {nameof(StateUpdateLock)} to be held"); 493Debug.Assert(_sendMutex.IsHeld, $"Caller should hold the {nameof(_sendMutex)}"); 646Debug.Assert(_sendBuffer != null); 907Debug.Assert(_inflater is not null); 917Debug.Assert(receiveBufferBytesToCopy > 0); 1165Debug.Assert(_receiveMutex.IsHeld, $"Caller should hold the {nameof(_receiveMutex)}"); 1291Debug.Assert(_receiveBufferCount >= 2, "Expected to at least have the first two bytes of the header."); 1309Debug.Assert(_receiveBufferCount >= 2, "Expected to have two bytes for the payload length."); 1315Debug.Assert(_receiveBufferCount >= 8, "Expected to have eight bytes for the payload length."); 1527Debug.Assert(count - 2 == encodedLength, $"{nameof(s_textEncoding.GetByteCount)} and {nameof(s_textEncoding.GetBytes)} encoded count didn't match"); 1618Debug.Assert(_sendBuffer == null); // would only fail if had some catastrophic error previously that prevented cleaning up 1625Debug.Assert(_sendMutex.IsHeld, $"Caller should hold the {nameof(_sendMutex)}"); 1657Debug.Assert(maskIndex < sizeof(int)); 1775Debug.Assert((b & 0x80) != 0, "Should have already skipped past ASCII"); 1883Debug.Assert(task.IsFaulted);
System\Net\WebSockets\ManagedWebSocket.KeepAlive.cs (5)
38Debug.Assert((opcode is MessageOpcode.Pong) || (!IsUnsolicitedPongKeepAlive && opcode is MessageOpcode.Ping)); 53Debug.Assert(_keepAlivePingState != null); 115Debug.Assert(_keepAlivePingState != null); 190Debug.Assert(Monitor.IsEntered(StateUpdateLock)); 207Debug.Assert(Monitor.IsEntered(StateUpdateLock));
System\Net\WebSockets\NetEventSource.WebSockets.cs (12)
56Debug.Assert(Log.IsEnabled()); 63Debug.Assert(Log.IsEnabled()); 70Debug.Assert(Log.IsEnabled()); 93Debug.Assert(Log.IsEnabled()); 112Debug.Assert(Log.IsEnabled()); 119Debug.Assert(Log.IsEnabled()); 138Debug.Assert(Log.IsEnabled()); 145Debug.Assert(Log.IsEnabled()); 164Debug.Assert(Log.IsEnabled()); 171Debug.Assert(Log.IsEnabled()); 190Debug.Assert(Log.IsEnabled()); 197Debug.Assert(Log.IsEnabled());
System\Net\WebSockets\ValueWebSocketReceiveResult.cs (3)
26Debug.Assert(count == Count); 27Debug.Assert(messageType == MessageType); 28Debug.Assert(endOfMessage == EndOfMessage);
System\Net\WebSockets\WebSocketStateHelper.cs (2)
35Debug.Assert(state == ManagedWebSocketStates.Aborted); 46Debug.Assert(Enum.IsDefined(flag));
System.Net.WebSockets.Client (15)
src\libraries\Common\src\System\Net\WebSockets\WebSocketValidate.cs (1)
97Debug.Assert(!string.IsNullOrEmpty(parameterName), "'parameterName' MUST NOT be NULL or string.Empty");
System\Net\WebSockets\ClientWebSocket.cs (4)
49Debug.Assert(_state == InternalState.Disposed); 140Debug.Assert(_state == InternalState.Disposed); 177Debug.Assert(_innerWebSocket != null); 178Debug.Assert(_innerWebSocket.WebSocket != null);
System\Net\WebSockets\ClientWebSocketOptions.cs (1)
282Debug.Assert(!_isReadOnly, "Already set");
System\Net\WebSockets\WebSocketHandle.Managed.cs (9)
152Debug.Assert(subprotocolEnumerableValues is string[]); 194Debug.Assert(connectedStream.CanWrite); 195Debug.Assert(connectedStream.CanRead); 301Debug.Assert(handler.SslOptions.ClientCertificates == null); 440Debug.Assert(builder.Length <= ClientWebSocketDeflateConstants.MaxExtensionLength); 449Debug.Assert(response.Version == HttpVersion.Version11 || response.Version == HttpVersion.Version20); 458Debug.Assert(secValue != null); 494Debug.Assert(success); 503Debug.Assert(bytesWritten == 20 /* SHA1 hash length */);
System.Numerics.Tensors (386)
System\Buffers\NIndex.cs (1)
180Debug.Assert(formatted);
System\Buffers\NRange.cs (2)
75Debug.Assert(formatted); 86Debug.Assert(formatted);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IAggregationOperator.cs (54)
190Debug.Assert(((nuint)xPtr % (uint)sizeof(Vector128<T>)) == 0); 372Debug.Assert(((nuint)xPtr % (uint)sizeof(Vector256<T>)) == 0); 554Debug.Assert(((nuint)xPtr % (uint)sizeof(Vector512<T>)) == 0); 712Debug.Assert(sizeof(T) == 8); 720Debug.Assert(sizeof(T) == 1); 758Debug.Assert(Vector256.IsHardwareAccelerated); 772Debug.Assert(Vector256.IsHardwareAccelerated); 797Debug.Assert(Vector128.IsHardwareAccelerated); 811Debug.Assert(Vector128.IsHardwareAccelerated); 891Debug.Assert(sizeof(T) == 2); 913Debug.Assert(Vector256.IsHardwareAccelerated); 927Debug.Assert(Vector256.IsHardwareAccelerated); 944Debug.Assert(Vector128.IsHardwareAccelerated); 958Debug.Assert(Vector128.IsHardwareAccelerated); 1006Debug.Assert(sizeof(T) == 4); 1019Debug.Assert(Vector256.IsHardwareAccelerated); 1032Debug.Assert(Vector256.IsHardwareAccelerated); 1044Debug.Assert(Vector128.IsHardwareAccelerated); 1057Debug.Assert(Vector128.IsHardwareAccelerated); 1095Debug.Assert(sizeof(T) == 8); 1104Debug.Assert(Vector256.IsHardwareAccelerated); 1117Debug.Assert(Vector256.IsHardwareAccelerated); 1127Debug.Assert(Vector128.IsHardwareAccelerated); 1140Debug.Assert(Vector128.IsHardwareAccelerated); 1316Debug.Assert(((nuint)xPtr % (uint)sizeof(Vector128<T>)) == 0); 1523Debug.Assert(((nuint)xPtr % (uint)sizeof(Vector256<T>)) == 0); 1730Debug.Assert(((nuint)xPtr % (uint)sizeof(Vector512<T>)) == 0); 1908Debug.Assert(sizeof(T) == 8); 1916Debug.Assert(sizeof(T) == 1); 1954Debug.Assert(Vector256.IsHardwareAccelerated); 1970Debug.Assert(Vector256.IsHardwareAccelerated); 1996Debug.Assert(Vector128.IsHardwareAccelerated); 2012Debug.Assert(Vector128.IsHardwareAccelerated); 2093Debug.Assert(sizeof(T) == 2); 2115Debug.Assert(Vector256.IsHardwareAccelerated); 2131Debug.Assert(Vector256.IsHardwareAccelerated); 2149Debug.Assert(Vector128.IsHardwareAccelerated); 2165Debug.Assert(Vector128.IsHardwareAccelerated); 2214Debug.Assert(sizeof(T) == 4); 2227Debug.Assert(Vector256.IsHardwareAccelerated); 2242Debug.Assert(Vector256.IsHardwareAccelerated); 2255Debug.Assert(Vector128.IsHardwareAccelerated); 2270Debug.Assert(Vector128.IsHardwareAccelerated); 2311Debug.Assert(sizeof(T) == 8); 2320Debug.Assert(Vector256.IsHardwareAccelerated); 2335Debug.Assert(Vector256.IsHardwareAccelerated); 2346Debug.Assert(Vector128.IsHardwareAccelerated); 2361Debug.Assert(Vector128.IsHardwareAccelerated); 2414Debug.Assert(sizeof(T) == 8); 2450Debug.Assert(sizeof(T) == 8); 2486Debug.Assert(sizeof(T) == 8); 2522Debug.Assert(sizeof(T) == 8); 2558Debug.Assert(sizeof(T) == 8); 2594Debug.Assert(sizeof(T) == 8);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IBinaryOperator.cs (49)
198Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector128<T>)) == 0); 440Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector256<T>)) == 0); 682Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector512<T>)) == 0); 897Debug.Assert(sizeof(T) == 8); 905Debug.Assert(sizeof(T) == 1); 942Debug.Assert(Vector256.IsHardwareAccelerated); 958Debug.Assert(Vector256.IsHardwareAccelerated); 984Debug.Assert(Vector128.IsHardwareAccelerated); 1000Debug.Assert(Vector128.IsHardwareAccelerated); 1093Debug.Assert(sizeof(T) == 2); 1114Debug.Assert(Vector256.IsHardwareAccelerated); 1130Debug.Assert(Vector256.IsHardwareAccelerated); 1148Debug.Assert(Vector128.IsHardwareAccelerated); 1164Debug.Assert(Vector128.IsHardwareAccelerated); 1217Debug.Assert(sizeof(T) == 4); 1229Debug.Assert(Vector256.IsHardwareAccelerated); 1244Debug.Assert(Vector256.IsHardwareAccelerated); 1257Debug.Assert(Vector128.IsHardwareAccelerated); 1272Debug.Assert(Vector128.IsHardwareAccelerated); 1311Debug.Assert(sizeof(T) == 8); 1319Debug.Assert(Vector256.IsHardwareAccelerated); 1334Debug.Assert(Vector256.IsHardwareAccelerated); 1345Debug.Assert(Vector128.IsHardwareAccelerated); 1360Debug.Assert(Vector128.IsHardwareAccelerated); 1529Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector128<T>)) == 0); 1767Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector256<T>)) == 0); 2005Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector512<T>)) == 0); 2217Debug.Assert(sizeof(T) == 8); 2225Debug.Assert(sizeof(T) == 1); 2262Debug.Assert(Vector256.IsHardwareAccelerated); 2280Debug.Assert(Vector256.IsHardwareAccelerated); 2306Debug.Assert(Vector128.IsHardwareAccelerated); 2324Debug.Assert(Vector128.IsHardwareAccelerated); 2417Debug.Assert(sizeof(T) == 2); 2438Debug.Assert(Vector256.IsHardwareAccelerated); 2456Debug.Assert(Vector256.IsHardwareAccelerated); 2474Debug.Assert(Vector128.IsHardwareAccelerated); 2492Debug.Assert(Vector128.IsHardwareAccelerated); 2545Debug.Assert(sizeof(T) == 4); 2557Debug.Assert(Vector256.IsHardwareAccelerated); 2574Debug.Assert(Vector256.IsHardwareAccelerated); 2587Debug.Assert(Vector128.IsHardwareAccelerated); 2604Debug.Assert(Vector128.IsHardwareAccelerated); 2643Debug.Assert(sizeof(T) == 8); 2651Debug.Assert(Vector256.IsHardwareAccelerated); 2668Debug.Assert(Vector256.IsHardwareAccelerated); 2679Debug.Assert(Vector128.IsHardwareAccelerated); 2696Debug.Assert(Vector128.IsHardwareAccelerated); 2761Debug.Assert(sizeof(T) == 8);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IBooleanUnaryOperator.cs (7)
96Debug.Assert(!x.IsEmpty); 229Debug.Assert(sizeof(T) == sizeof(bool)); 337Debug.Assert(sizeof(T) == 2 * sizeof(bool)); 454Debug.Assert(sizeof(T) == 4 * sizeof(bool)); 589Debug.Assert(sizeof(T) == 8 * sizeof(bool)); 637Debug.Assert(sizeof(T) == 8 * sizeof(bool)); 685Debug.Assert(sizeof(T) == 8 * sizeof(bool));
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IIndexOfOperator.cs (1)
75Debug.Assert(sizeof(T) == 1);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IStatefulUnaryOperator.cs (24)
158Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector128<T>)) == 0); 369Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector256<T>)) == 0); 580Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector512<T>)) == 0); 769Debug.Assert(sizeof(T) == 8); 777Debug.Assert(sizeof(T) == 1); 814Debug.Assert(Vector256.IsHardwareAccelerated); 828Debug.Assert(Vector256.IsHardwareAccelerated); 853Debug.Assert(Vector128.IsHardwareAccelerated); 867Debug.Assert(Vector128.IsHardwareAccelerated); 945Debug.Assert(sizeof(T) == 2); 966Debug.Assert(Vector256.IsHardwareAccelerated); 980Debug.Assert(Vector256.IsHardwareAccelerated); 997Debug.Assert(Vector128.IsHardwareAccelerated); 1011Debug.Assert(Vector128.IsHardwareAccelerated); 1057Debug.Assert(sizeof(T) == 4); 1069Debug.Assert(Vector256.IsHardwareAccelerated); 1082Debug.Assert(Vector256.IsHardwareAccelerated); 1094Debug.Assert(Vector128.IsHardwareAccelerated); 1107Debug.Assert(Vector128.IsHardwareAccelerated); 1143Debug.Assert(sizeof(T) == 8); 1151Debug.Assert(Vector256.IsHardwareAccelerated); 1164Debug.Assert(Vector256.IsHardwareAccelerated); 1174Debug.Assert(Vector128.IsHardwareAccelerated); 1187Debug.Assert(Vector128.IsHardwareAccelerated);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.ITernaryOperator.cs (72)
191Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector128<T>)) == 0); 464Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector256<T>)) == 0); 737Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector512<T>)) == 0); 978Debug.Assert(sizeof(T) == 8); 986Debug.Assert(sizeof(T) == 1); 1023Debug.Assert(Vector256.IsHardwareAccelerated); 1041Debug.Assert(Vector256.IsHardwareAccelerated); 1068Debug.Assert(Vector128.IsHardwareAccelerated); 1086Debug.Assert(Vector128.IsHardwareAccelerated); 1194Debug.Assert(sizeof(T) == 2); 1215Debug.Assert(Vector256.IsHardwareAccelerated); 1233Debug.Assert(Vector256.IsHardwareAccelerated); 1252Debug.Assert(Vector128.IsHardwareAccelerated); 1270Debug.Assert(Vector128.IsHardwareAccelerated); 1330Debug.Assert(sizeof(T) == 4); 1342Debug.Assert(Vector256.IsHardwareAccelerated); 1359Debug.Assert(Vector256.IsHardwareAccelerated); 1373Debug.Assert(Vector128.IsHardwareAccelerated); 1390Debug.Assert(Vector128.IsHardwareAccelerated); 1432Debug.Assert(sizeof(T) == 8); 1440Debug.Assert(Vector256.IsHardwareAccelerated); 1457Debug.Assert(Vector256.IsHardwareAccelerated); 1469Debug.Assert(Vector128.IsHardwareAccelerated); 1486Debug.Assert(Vector128.IsHardwareAccelerated); 1665Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector128<T>)) == 0); 1934Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector256<T>)) == 0); 2203Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector512<T>)) == 0); 2441Debug.Assert(sizeof(T) == 8); 2449Debug.Assert(sizeof(T) == 1); 2486Debug.Assert(Vector256.IsHardwareAccelerated); 2506Debug.Assert(Vector256.IsHardwareAccelerated); 2533Debug.Assert(Vector128.IsHardwareAccelerated); 2553Debug.Assert(Vector128.IsHardwareAccelerated); 2661Debug.Assert(sizeof(T) == 2); 2682Debug.Assert(Vector256.IsHardwareAccelerated); 2702Debug.Assert(Vector256.IsHardwareAccelerated); 2721Debug.Assert(Vector128.IsHardwareAccelerated); 2741Debug.Assert(Vector128.IsHardwareAccelerated); 2801Debug.Assert(sizeof(T) == 4); 2813Debug.Assert(Vector256.IsHardwareAccelerated); 2832Debug.Assert(Vector256.IsHardwareAccelerated); 2846Debug.Assert(Vector128.IsHardwareAccelerated); 2865Debug.Assert(Vector128.IsHardwareAccelerated); 2907Debug.Assert(sizeof(T) == 8); 2915Debug.Assert(Vector256.IsHardwareAccelerated); 2934Debug.Assert(Vector256.IsHardwareAccelerated); 2946Debug.Assert(Vector128.IsHardwareAccelerated); 2965Debug.Assert(Vector128.IsHardwareAccelerated); 3149Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector128<T>)) == 0); 3413Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector256<T>)) == 0); 3677Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector512<T>)) == 0); 3912Debug.Assert(sizeof(T) == 8); 3920Debug.Assert(sizeof(T) == 1); 3957Debug.Assert(Vector256.IsHardwareAccelerated); 3978Debug.Assert(Vector256.IsHardwareAccelerated); 4005Debug.Assert(Vector128.IsHardwareAccelerated); 4026Debug.Assert(Vector128.IsHardwareAccelerated); 4134Debug.Assert(sizeof(T) == 2); 4155Debug.Assert(Vector256.IsHardwareAccelerated); 4176Debug.Assert(Vector256.IsHardwareAccelerated); 4195Debug.Assert(Vector128.IsHardwareAccelerated); 4216Debug.Assert(Vector128.IsHardwareAccelerated); 4276Debug.Assert(sizeof(T) == 4); 4288Debug.Assert(Vector256.IsHardwareAccelerated); 4308Debug.Assert(Vector256.IsHardwareAccelerated); 4322Debug.Assert(Vector128.IsHardwareAccelerated); 4342Debug.Assert(Vector128.IsHardwareAccelerated); 4384Debug.Assert(sizeof(T) == 8); 4392Debug.Assert(Vector256.IsHardwareAccelerated); 4412Debug.Assert(Vector256.IsHardwareAccelerated); 4424Debug.Assert(Vector128.IsHardwareAccelerated); 4444Debug.Assert(Vector128.IsHardwareAccelerated);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryOneToFourOperator.cs (7)
33Debug.Assert(sizeof(TInput) * 4 == sizeof(TOutput)); 46Debug.Assert(Vector512<TInput>.IsSupported); 47Debug.Assert(Vector512<TOutput>.IsSupported); 83Debug.Assert(Vector256<TInput>.IsSupported); 84Debug.Assert(Vector256<TOutput>.IsSupported); 120Debug.Assert(Vector128<TInput>.IsSupported); 121Debug.Assert(Vector128<TOutput>.IsSupported);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryOneToTwoOperator.cs (7)
33Debug.Assert(sizeof(TInput) * 2 == sizeof(TOutput)); 46Debug.Assert(Vector512<TInput>.IsSupported); 47Debug.Assert(Vector512<TOutput>.IsSupported); 79Debug.Assert(Vector256<TInput>.IsSupported); 80Debug.Assert(Vector256<TOutput>.IsSupported); 112Debug.Assert(Vector128<TInput>.IsSupported); 113Debug.Assert(Vector128<TOutput>.IsSupported);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryOperator.cs (24)
198Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector128<TInput>)) == 0); 409Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector256<TInput>)) == 0); 620Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector512<TInput>)) == 0); 809Debug.Assert(sizeof(TInput) == 8); 817Debug.Assert(sizeof(TInput) == 1); 854Debug.Assert(Vector256.IsHardwareAccelerated); 868Debug.Assert(Vector256.IsHardwareAccelerated); 893Debug.Assert(Vector128.IsHardwareAccelerated); 907Debug.Assert(Vector128.IsHardwareAccelerated); 985Debug.Assert(sizeof(TInput) == 2); 1006Debug.Assert(Vector256.IsHardwareAccelerated); 1020Debug.Assert(Vector256.IsHardwareAccelerated); 1037Debug.Assert(Vector128.IsHardwareAccelerated); 1051Debug.Assert(Vector128.IsHardwareAccelerated); 1097Debug.Assert(sizeof(TInput) == 4); 1109Debug.Assert(Vector256.IsHardwareAccelerated); 1122Debug.Assert(Vector256.IsHardwareAccelerated); 1134Debug.Assert(Vector128.IsHardwareAccelerated); 1147Debug.Assert(Vector128.IsHardwareAccelerated); 1183Debug.Assert(sizeof(TInput) == 8); 1191Debug.Assert(Vector256.IsHardwareAccelerated); 1204Debug.Assert(Vector256.IsHardwareAccelerated); 1214Debug.Assert(Vector128.IsHardwareAccelerated); 1227Debug.Assert(Vector128.IsHardwareAccelerated);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryTwoToOneOperator.cs (7)
33Debug.Assert(sizeof(TInput) == sizeof(TOutput) * 2); 46Debug.Assert(Vector512<TInput>.IsSupported); 47Debug.Assert(Vector512<TOutput>.IsSupported); 79Debug.Assert(Vector256<TInput>.IsSupported); 80Debug.Assert(Vector256<TOutput>.IsSupported); 112Debug.Assert(Vector128<TInput>.IsSupported); 113Debug.Assert(Vector128<TOutput>.IsSupported);
System\Numerics\Tensors\netcore\Tensor.cs (1)
2265Debug.Assert(maximumLengths.Length != tensor.Rank);
System\Numerics\Tensors\netcore\Tensor_1.cs (3)
258Debug.Assert((int)(linearOffset) == linearOffset); 274Debug.Assert((int)(linearOffset) == linearOffset); 290Debug.Assert((int)(linearOffset) == linearOffset);
System\Numerics\Tensors\netcore\TensorOperation.cs (10)
460Debug.Assert(destination.Length == 1); 478Debug.Assert(destination.Length == 1); 2256Debug.Assert(destination.Length == 1); 2274Debug.Assert(destination.Length == 1); 2345Debug.Assert(destination.Length == 1); 2363Debug.Assert(destination.Length == 1); 2434Debug.Assert(destination.Length == 1); 2452Debug.Assert(destination.Length == 1); 2523Debug.Assert(destination.Length == 1); 2541Debug.Assert(destination.Length == 1);
System\Numerics\Tensors\netcore\TensorPrimitives.Cbrt.cs (3)
41Debug.Assert(typeof(T) == typeof(double)); 54Debug.Assert(typeof(T) == typeof(double)); 67Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.Ceiling.cs (3)
46Debug.Assert(typeof(T) == typeof(double)); 59Debug.Assert(typeof(T) == typeof(double)); 72Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.Cos.cs (3)
85Debug.Assert(typeof(T) == typeof(float)); 110Debug.Assert(typeof(T) == typeof(float)); 135Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.Cosh.cs (3)
92Debug.Assert(typeof(T) == typeof(double)); 113Debug.Assert(typeof(T) == typeof(double)); 134Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.CosPi.cs (3)
61Debug.Assert(typeof(T) == typeof(double)); 84Debug.Assert(typeof(T) == typeof(double)); 107Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.DegreesToRadians.cs (3)
48Debug.Assert(typeof(T) == typeof(float)); 65Debug.Assert(typeof(T) == typeof(float)); 82Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.Exp.cs (3)
58Debug.Assert(typeof(T) == typeof(float)); 83Debug.Assert(typeof(T) == typeof(float)); 108Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.Floor.cs (3)
46Debug.Assert(typeof(T) == typeof(double)); 59Debug.Assert(typeof(T) == typeof(double)); 72Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.FusedMultiplyAdd.cs (3)
133Debug.Assert(typeof(T) == typeof(float)); 186Debug.Assert(typeof(T) == typeof(float)); 211Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.Half.cs (13)
52Debug.Assert(typeof(T) == typeof(Half)); 69Debug.Assert(typeof(T) == typeof(Half)); 86Debug.Assert(typeof(T) == typeof(Half)); 104Debug.Assert(typeof(T) == typeof(Half)); 122Debug.Assert(typeof(T) == typeof(Half)); 140Debug.Assert(typeof(T) == typeof(Half)); 158Debug.Assert(typeof(T) == typeof(Half)); 176Debug.Assert(typeof(T) == typeof(Half)); 194Debug.Assert(typeof(T) == typeof(Half)); 228Debug.Assert(typeof(T) == typeof(Half)); 247Debug.Assert(typeof(T) == typeof(Half)); 266Debug.Assert(typeof(T) == typeof(Half)); 285Debug.Assert(typeof(T) == typeof(Half));
System\Numerics\Tensors\netcore\TensorPrimitives.Hypot.cs (3)
52Debug.Assert(typeof(T) == typeof(float)); 69Debug.Assert(typeof(T) == typeof(float)); 86Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.IndexOfMax.cs (3)
150Debug.Assert(sizeof(T) is 1 or 2 or 4 or 8); 241Debug.Assert(sizeof(T) is 1 or 2 or 4 or 8); 332Debug.Assert(sizeof(T) is 1 or 2 or 4 or 8);
System\Numerics\Tensors\netcore\TensorPrimitives.LeadingZeroCount.cs (2)
80Debug.Assert(AdvSimd.IsSupported); 85Debug.Assert(sizeof(T) == 4);
System\Numerics\Tensors\netcore\TensorPrimitives.Lerp.cs (3)
112Debug.Assert(typeof(T) == typeof(float)); 129Debug.Assert(typeof(T) == typeof(float)); 146Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.Log.cs (3)
114Debug.Assert(typeof(T) == typeof(float)); 139Debug.Assert(typeof(T) == typeof(float)); 164Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.Log2.cs (3)
60Debug.Assert(typeof(T) == typeof(float)); 85Debug.Assert(typeof(T) == typeof(float)); 110Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.PopCount.cs (3)
120Debug.Assert(sizeof(T) == 4); 168Debug.Assert(sizeof(T) == 4); 216Debug.Assert(sizeof(T) == 4);
System\Numerics\Tensors\netcore\TensorPrimitives.Pow.cs (3)
74Debug.Assert(typeof(T) == typeof(double)); 87Debug.Assert(typeof(T) == typeof(double)); 100Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.RadiansToDegrees.cs (3)
41Debug.Assert(typeof(T) == typeof(float)); 58Debug.Assert(typeof(T) == typeof(float)); 75Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.RootN.cs (3)
43Debug.Assert(typeof(T) == typeof(double)); 56Debug.Assert(typeof(T) == typeof(double)); 69Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.Round.cs (8)
125Debug.Assert(typeof(T) == typeof(double)); 200Debug.Assert(typeof(T) == typeof(float)); 219Debug.Assert(typeof(T) == typeof(float)); 238Debug.Assert(typeof(T) == typeof(float)); 274Debug.Assert(typeof(T) == typeof(double)); 287Debug.Assert(typeof(T) == typeof(double)); 300Debug.Assert(typeof(T) == typeof(double)); 315Debug.Assert(typeof(T) == typeof(float) || typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.Sin.cs (3)
74Debug.Assert(typeof(T) == typeof(float)); 99Debug.Assert(typeof(T) == typeof(float)); 124Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.Sinh.cs (3)
76Debug.Assert(typeof(T) == typeof(double)); 101Debug.Assert(typeof(T) == typeof(double)); 126Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.SinPi.cs (3)
61Debug.Assert(typeof(T) == typeof(double)); 84Debug.Assert(typeof(T) == typeof(double)); 107Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.Tan.cs (3)
76Debug.Assert(typeof(T) == typeof(double)); 89Debug.Assert(typeof(T) == typeof(double)); 102Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.TrailingZeroCount.cs (3)
44Debug.Assert(PopCountOperator<T>.Vectorizable); 51Debug.Assert(PopCountOperator<T>.Vectorizable); 58Debug.Assert(PopCountOperator<T>.Vectorizable);
System\Numerics\Tensors\netcore\TensorPrimitives.Truncate.cs (3)
49Debug.Assert(typeof(T) == typeof(float)); 85Debug.Assert(typeof(T) == typeof(float)); 119Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorShape.cs (18)
80Debug.Assert(rank >= 1); 311Debug.Assert((flattenedLength == minimumLinearLength) || (strides.Length != 0)); 323Debug.Assert(lengths.Length == rank); 324Debug.Assert(strides.Length == rank); 325Debug.Assert(linearRankOrder.Length == rank); 487Debug.Assert(indexes.Length >= Rank); 488Debug.Assert(indexes.Length == destinationShape.Rank); 515Debug.Assert((length == 1) && (stride == 0)); 552Debug.Assert(indexes.Length >= Rank); 553Debug.Assert(indexes.Length == destinationShape.Rank); 580Debug.Assert((length == 1) && (stride == 0)); 650Debug.Assert(rankDelta > 0); 1097Debug.Assert(FlattenedLength == LinearLength); 1098Debug.Assert(HasAnyDenseDimensions); 1102Debug.Assert(HasAnyDenseDimensions == CalculateHasAnyDenseDimensions(Lengths, Strides)); 1104Debug.Assert(IsBroadcast == Strides.Contains(0)); 1262Debug.Assert(minimumLinearLength <= _linearLength); 1293Debug.Assert(computedOffset == GetLinearOffset<TGetOffsetAndLength, T>(state));
System\Numerics\Tensors\TensorPrimitives.Helpers.cs (4)
31Debug.Assert(destination1.Length >= inputLength); 32Debug.Assert(destination1.Length >= inputLength); 51Debug.Assert(sizeof(TFrom) == sizeof(TTo)); 67Debug.Assert(sizeof(TFrom) == sizeof(TTo));
System.ObjectModel (4)
System\Collections\ObjectModel\KeyedCollection.cs (2)
51Debug.Assert(base.Items is List<TItem>); 273Debug.Assert(key != null, "key shouldn't be null!");
System\Collections\ObjectModel\ObservableCollection.cs (1)
307Debug.Assert(collection != null);
System\Collections\Specialized\NotifyCollectionChangedEventArgs.cs (1)
282Debug.Assert(list != null);
System.Private.CoreLib (4103)
src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\ExceptionHandling.cs (11)
687Debug.Assert(isValid, "Unwind and intercept failed unexpectedly"); 705Debug.Assert(false); 766Debug.Assert(exInfo._passNumber == 1, "expected asm throw routine to set the pass"); 790Debug.Assert(isValid, "RhThrowEx called with an unexpected context"); 877Debug.Assert(pCatchHandler != null || pReversePInvokePropagationCallback != IntPtr.Zero || unwoundReversePInvoke || isExceptionIntercepted, "We should have a handler if we're starting the second pass"); 878Debug.Assert(!isExceptionIntercepted || (pCatchHandler == null), "No catch handler should be returned for intercepted exceptions in the first pass"); 902Debug.Assert(isValid, "second-pass EH unwind failed unexpectedly"); 917Debug.Assert(frameIter.SP == handlingFrameSP, "Encountered a different reverse P/Invoke frame in the second pass."); 975Debug.Assert(ip != null, "IP address must not be null"); 981Debug.Assert(handlingFrameSP != MaxSP, "Handling frame must have an SP value"); 982Debug.Assert(((UIntPtr*)handlingFrameSP) > &handlingFrameSP,
src\libraries\Common\src\Internal\VersionResilientHashCode.cs (1)
87Debug.Assert(hashCode == NameHashCode("System.Array`1"));
src\libraries\Common\src\Interop\Interop.ICU.cs (2)
17Debug.Assert(icuuc != IntPtr.Zero); 18Debug.Assert(icuin != IntPtr.Zero);
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (3)
61Debug.Assert(!b || (ProcPid)result.Pid == pid || pid == ProcPid.Self, "Expected process ID from status file to match supplied pid"); 126Debug.Assert(valueParsed); 141Debug.Assert(!string.IsNullOrEmpty(path));
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
13Debug.Assert(errorInfo.Error != Error.SUCCESS); 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.GetPwUid.cs (1)
69Debug.Assert(passwd.Name != null);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetUnixVersion.cs (1)
39Debug.Assert(Array.IndexOf<byte>(version, 0) != -1);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadDir.cs (3)
35Debug.Assert(Name != null, "should not have a null name"); 41Debug.Assert(nameBytes.Length > 0, "we shouldn't have gotten a garbage value from the OS"); 47Debug.Assert(!result.Contains('\0'), "should not have embedded nulls");
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 is not 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 is not null, "Expected a non-null segment."); 180Debug.Assert(array is not null, "Expected a non-null item array."); 253Debug.Assert(segment is not null, "Expected a non-null segment."); 254Debug.Assert(array is not null, "Expected a non-null item array."); 368Debug.Assert(syncObj is not null, "The syncObj parameter is null."); 390Debug.Assert((size & (size - 1)) == 0, "Size must be a power of 2"); 429Debug.Assert(queue is not null, "Expected a non-null queue.");
src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (7)
25Debug.Assert(capacity >= 0); 54Debug.Assert(index >= 0 && index < _count); 78Debug.Assert(_count > 0); 87Debug.Assert(_count > 0); 104Debug.Assert(_array != null); // Nonzero _count should imply this 134Debug.Assert(_count < Capacity); 141Debug.Assert(minimum > Capacity);
src\libraries\Common\src\System\Collections\Generic\BitHelper.cs (2)
24Debug.Assert(bitPosition >= 0); 38Debug.Assert(bitPosition >= 0);
src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
33Debug.Assert(Array.MaxLength == ArrayMaxLength);
src\libraries\Common\src\System\HexConverter.cs (9)
100Debug.Assert(Ssse3.IsSupported || AdvSimd.Arm64.IsSupported); 116Debug.Assert(bytes.Length >= Vector128<int>.Count); 167Debug.Assert(chars.Length >= bytes.Length * 2); 262Debug.Assert(Ssse3.IsSupported || AdvSimd.Arm64.IsSupported || PackedSimd.IsSupported); 263Debug.Assert(chars.Length <= bytes.Length * 2); 264Debug.Assert(chars.Length % 2 == 0); 265Debug.Assert(chars.Length >= Vector128<ushort>.Count * 2); 359Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 360Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\IO\PathInternal.cs (1)
124Debug.Assert(rootLength > 0);
src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
31Debug.Assert(DirectorySeparatorChar == AltDirectorySeparatorChar);
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\IO\Win32Marshal.cs (1)
29Debug.Assert(errorCode != Interop.Errors.ERROR_SUCCESS);
src\libraries\Common\src\System\Number.Formatting.Common.cs (12)
144Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 281Debug.Assert(format is 'G' or 'g'); 293Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 716Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 750Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 820Debug.Assert(p >= spanPtr - 1, "Underflow"); 865Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 886Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 913Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 935Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 959Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 1013Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte));
src\libraries\Common\src\System\Number.NumberBuffer.cs (6)
37Debug.Assert(digits != null); 45Debug.Assert(!digits.IsEmpty); 65Debug.Assert((Kind == NumberBufferKind.Integer) || (Kind == NumberBufferKind.Decimal) || (Kind == NumberBufferKind.FloatingPoint)); 66Debug.Assert(Digits[0] != '0', "Leading zeros should never be stored in a Number"); 81Debug.Assert(numDigits == DigitsCount, "Null terminator found in unexpected location in Number"); 82Debug.Assert(numDigits < Digits.Length, "Null terminator not found in Number");
src\libraries\Common\src\System\Number.Parsing.Common.cs (11)
16Debug.Assert(str != null); 17Debug.Assert(strEnd != null); 18Debug.Assert(str <= strEnd); 19Debug.Assert((styles & (NumberStyles.AllowHexSpecifier | NumberStyles.AllowBinarySpecifier)) == 0); 28Debug.Assert(number.DigitsCount == 0); 29Debug.Assert(number.Scale == 0); 30Debug.Assert(!number.IsNegative); 31Debug.Assert(!number.HasNonZeroTail); 228Debug.Assert(numberOfTrailingZeros >= 0); 283Debug.Assert(info != null); 339Debug.Assert((p != null) && (pEnd != null) && (p <= pEnd));
src\libraries\Common\src\System\Reflection\AssemblyNameFormatter.cs (1)
23Debug.Assert(name.Length != 0);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 281Debug.Assert(additionalCapacityBeyondPos > 0); 282Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\libraries\Common\src\System\Threading\Tasks\TaskToAsyncResult.cs (1)
121Debug.Assert(task is not null);
src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeFileHandle.ThreadPoolValueTaskSource.cs (3)
82Debug.Assert(_operation >= Operation.Read && _operation <= Operation.WriteGather); 105Debug.Assert(_readScatterBuffers != null); 109Debug.Assert(_writeGatherBuffers != null);
src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeFileHandle.Unix.cs (9)
74Debug.Assert(value == false); // We should only use the setter to disable random access. 95Debug.Assert(path != null); 140Debug.Assert(_path is not null); 180Debug.Assert(fileLength >= 0); 347Debug.Assert(Interop.Sys.LSeek(this, 0, Interop.Sys.SeekWhence.SEEK_CUR) >= 0); 452Debug.Assert(mode == FileMode.Create || mode == FileMode.CreateNew); 467Debug.Assert(lockOperation == Interop.Sys.LockOperations.LOCK_EX || lockOperation == Interop.Sys.LockOperations.LOCK_SH); 515Debug.Assert(!IsClosed); 516Debug.Assert(!IsInvalid);
src\libraries\System.Private.CoreLib\src\System\AggregateException.cs (1)
175Debug.Assert(_innerExceptions[i] != null);
src\libraries\System.Private.CoreLib\src\System\AppContext.AnyOS.cs (1)
72Debug.Assert(s_dataStore is not null);
src\libraries\System.Private.CoreLib\src\System\AppContext.cs (1)
178Debug.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 (11)
69Debug.Assert(array != null); 612Debug.Assert(low <= hi); 613Debug.Assert(hi - low >= 0, "Length overflow!"); 2317Debug.Assert(hi >= lo); 2318Debug.Assert(depthLimit >= 0); 2325Debug.Assert(partitionSize >= 2); 2360Debug.Assert(hi - lo >= IntrosortSizeThreshold); 2534Debug.Assert(hi >= lo); 2535Debug.Assert(depthLimit >= 0); 2542Debug.Assert(partitionSize >= 2); 2577Debug.Assert(hi - lo >= IntrosortSizeThreshold);
src\libraries\System.Private.CoreLib\src\System\Array.Enumerators.cs (1)
117Debug.Assert(array == null || endIndex == array.Length);
src\libraries\System.Private.CoreLib\src\System\ArraySegment.cs (6)
203Debug.Assert(index < 0 || 244Debug.Assert(index < 0 || 290Debug.Assert(arraySegment.Array != null); 291Debug.Assert(arraySegment.Offset >= 0); 292Debug.Assert(arraySegment.Count >= 0); 293Debug.Assert(arraySegment.Offset + arraySegment.Count <= arraySegment.Array.Length);
src\libraries\System.Private.CoreLib\src\System\Attribute.cs (1)
116Debug.Assert(thisValueArray.Rank == 1 && thatValueArray.Rank == 1);
src\libraries\System.Private.CoreLib\src\System\BitConverter.cs (12)
59Debug.Assert(success); 87Debug.Assert(success); 115Debug.Assert(success); 143Debug.Assert(success); 171Debug.Assert(success); 200Debug.Assert(success); 230Debug.Assert(success); 260Debug.Assert(success); 290Debug.Assert(success); 319Debug.Assert(success); 347Debug.Assert(success); 375Debug.Assert(success);
src\libraries\System.Private.CoreLib\src\System\Buffer.cs (1)
196Debug.Assert(byteCount > BulkMoveWithWriteBarrierChunk);
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\StandardFormat.cs (1)
160Debug.Assert(destination.Length == FormatStringLength);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Helper\Base64DecoderHelper.cs (6)
112Debug.Assert(destLength < (int.MaxValue / 4 * 3)); 167Debug.Assert(typeof(TBase64Decoder) == typeof(Base64DecoderByte) ? remaining == 4 : remaining < 8); 609Debug.Assert(source.Length == sourceIndex); 828Debug.Assert((Ssse3.IsSupported || AdvSimd.Arm64.IsSupported) && BitConverter.IsLittleEndian); 991Debug.Assert((Ssse3.IsSupported || AdvSimd.Arm64.IsSupported) && BitConverter.IsLittleEndian); 1176Debug.Assert(value >= 0 && value <= ushort.MaxValue);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Url\Base64UrlDecoder.cs (5)
95Debug.Assert(status is OperationStatus.Done); 129Debug.Assert(status is OperationStatus.InvalidData); 151Debug.Assert(status is OperationStatus.Done or OperationStatus.DestinationTooSmall); 172Debug.Assert(status is OperationStatus.Done or OperationStatus.InvalidData); 346Debug.Assert(status == OperationStatus.InvalidData);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Url\Base64UrlEncoder.cs (4)
76Debug.Assert(status == OperationStatus.DestinationTooSmall); 90Debug.Assert(destination.Length == bytesWritten); 127Debug.Assert(status == OperationStatus.DestinationTooSmall); 141Debug.Assert(destination.Length == charsWritten);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\FormattingHelpers.CountDigits.cs (3)
25Debug.Assert(log2ToPow10.Length == 64); 54Debug.Assert((elementOffset + 1) <= powersOf10.Length); 102Debug.Assert(table.Length == 32, "Every result of uint.Log2(value) needs a long entry in the table.");
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\FormattingHelpers.CountDigits.Int128.cs (2)
36Debug.Assert(value.Upper == 0); 46Debug.Assert(digits == 21);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.Date.cs (1)
108Debug.Assert(bytesWritten == DateTimeFormat.FormatRLength);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Date.cs (1)
83Debug.Assert(kind == DateTimeKind.Unspecified);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Date.Helpers.cs (2)
113Debug.Assert(year <= 9999); // All of our callers to date parse the year from fixed 4-digit fields so this value is trusted. 146Debug.Assert(fraction >= 0 && fraction <= Utf8Constants.MaxDateTimeFraction); // All of our callers to date parse the fraction from fixed 7-digit fields so this value is trusted.
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Date.O.cs (1)
227Debug.Assert(offsetChar == Utf8Constants.Plus || offsetChar == Utf8Constants.Minus);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Number.cs (5)
18Debug.Assert(number.DigitsCount == 0); 19Debug.Assert(number.Scale == 0); 20Debug.Assert(!number.IsNegative); 21Debug.Assert(!number.HasNonZeroTail); 112Debug.Assert(dstIndex == 0);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.TimeSpan.cs (2)
109Debug.Assert(digitCount == 1); 133Debug.Assert(fraction <= Utf8Constants.MaxDateTimeFraction); // This value comes from TryParseTimeSpanFraction() which already rejects any fraction string longer than 7 digits.
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.TimeSpanSplitter.cs (4)
98Debug.Assert(result == ComponentParseResult.Colon || result == ComponentParseResult.Period); 118Debug.Assert(result == ComponentParseResult.Colon || result == ComponentParseResult.Period); 138Debug.Assert(result == ComponentParseResult.Colon || result == ComponentParseResult.Period); 158Debug.Assert(result == ComponentParseResult.Colon || result == ComponentParseResult.Period);
src\libraries\System.Private.CoreLib\src\System\Buffers\Utilities.cs (1)
27Debug.Assert(maxSize >= 0);
src\libraries\System.Private.CoreLib\src\System\Char.cs (2)
97Debug.Assert(IsLatin1(c), "char.GetLatin1UnicodeCategory(): c should be <= 00ff"); 395Debug.Assert(IsLatin1(c));
src\libraries\System.Private.CoreLib\src\System\Collections\BitArray.cs (5)
941Debug.Assert(bitLength >= 0); 948Debug.Assert(bitLength >= 0); 965Debug.Assert(byteLength >= 0, "byteLength should be non-negative."); 966Debug.Assert(byteLength % sizeof(int) == 0, "byteLength should be a multiple of sizeof(int)."); 1046Debug.Assert(index >= _bitArray._bitLength);
src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentQueue.cs (22)
240Debug.Assert(count == i); 335Debug.Assert(s._frozenForEnqueues, "Internal segment must be frozen as there's a following segment."); 369Debug.Assert(head._preservedForObservation); 370Debug.Assert(head._frozenForEnqueues); 371Debug.Assert(tail._preservedForObservation); 372Debug.Assert(tail._frozenForEnqueues); 403Debug.Assert(s._preservedForObservation); 404Debug.Assert(s._frozenForEnqueues); 469Debug.Assert(count == i - index); 499Debug.Assert(head != null); 500Debug.Assert(tail != null); 501Debug.Assert(tail._nextSegment == null); 509Debug.Assert(s._frozenForEnqueues); // any non-tail should already be marked 524Debug.Assert(segment._preservedForObservation); 544Debug.Assert(head._preservedForObservation); 545Debug.Assert(head._frozenForEnqueues); 546Debug.Assert(tail._preservedForObservation); 547Debug.Assert(tail._frozenForEnqueues); 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"); 719Debug.Assert(head._frozenForEnqueues); 782Debug.Assert(next == s._nextSegment);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ArraySortHelper.cs (46)
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!"); 101Debug.Assert(i != j); 114Debug.Assert(i != j); 123Debug.Assert(comparer != null); 136Debug.Assert(!keys.IsEmpty); 137Debug.Assert(depthLimit >= 0); 138Debug.Assert(comparer != null); 181Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold); 182Debug.Assert(comparer != null); 219Debug.Assert(comparer != null); 220Debug.Assert(!keys.IsEmpty); 237Debug.Assert(comparer != null); 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!"); 401Debug.Assert(!Unsafe.AreSame(ref i, ref j)); 413Debug.Assert(!keys.IsEmpty); 414Debug.Assert(depthLimit >= 0); 460Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold); 509Debug.Assert(!keys.IsEmpty); 635Debug.Assert(comparer != null); 636Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 637Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 638Debug.Assert(i != j); 655Debug.Assert(i != j); 668Debug.Assert(comparer != null); 669Debug.Assert(keys.Length == values.Length); 679Debug.Assert(!keys.IsEmpty); 680Debug.Assert(values.Length == keys.Length); 681Debug.Assert(depthLimit >= 0); 682Debug.Assert(comparer != null); 725Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold); 726Debug.Assert(comparer != null); 763Debug.Assert(comparer != null); 764Debug.Assert(!keys.IsEmpty); 781Debug.Assert(comparer != null); 808Debug.Assert(comparer != null); 878Debug.Assert(i != j); 896Debug.Assert(i != j); 909Debug.Assert(!keys.IsEmpty); 910Debug.Assert(values.Length == keys.Length); 911Debug.Assert(depthLimit >= 0); 954Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold); 999Debug.Assert(!keys.IsEmpty); 1113Debug.Assert(typeof(TKey) == typeof(double) || typeof(TKey) == typeof(float));
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (47)
129Debug.Assert(source._entries is not null); 130Debug.Assert(_entries is not null); 131Debug.Assert(_entries.Length >= source.Count); 132Debug.Assert(_count == 0); 199Debug.Assert(_comparer is not null, "The comparer should never be null for a reference type."); 244Debug.Assert(modified); 251Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 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"); 444Debug.Assert(comparer is not null); 519Debug.Assert(_buckets != null); 522Debug.Assert(entries != null, "expected entries to be non-null"); 525Debug.Assert(comparer is not null || typeof(TKey).IsValueType); 567Debug.Assert(comparer is not null); 602Debug.Assert((StartOfFreeList - entries[_freeList].next) >= -1, "shouldn't overflow because `next` cannot underflow"); 695Debug.Assert(dictionary is not null); 696Debug.Assert(IsCompatibleKey(dictionary)); 730Debug.Assert(dictionary is not null); 738Debug.Assert(IsCompatibleKey(dictionary)); 781Debug.Assert(actualKey is not null); 808Debug.Assert(dictionary._entries != null, "expected entries to be != null"); 878Debug.Assert(dictionary._entries != null, "entries should be non-null"); 905Debug.Assert((StartOfFreeList - dictionary._freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 970Debug.Assert(dictionary._buckets != null); 973Debug.Assert(entries != null, "expected entries to be non-null"); 981Debug.Assert(comparer is not null); 1012Debug.Assert((StartOfFreeList - entries[dictionary._freeList].next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1051Debug.Assert(!Unsafe.IsNullRef(ref value), "the lookup result cannot be a null ref here"); 1084Debug.Assert(dictionary._buckets != null); 1087Debug.Assert(entries != null, "expected entries to be non-null"); 1090Debug.Assert(comparer is not null || typeof(TKey).IsValueType); 1123Debug.Assert(comparer is not null); 1149Debug.Assert((StartOfFreeList - entries[dictionary._freeList].next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1188Debug.Assert(!Unsafe.IsNullRef(ref value), "the lookup result cannot be a null ref here"); 1250Debug.Assert(!forceNewHashCodes || !typeof(TKey).IsValueType); 1251Debug.Assert(_entries != null, "_entries should be non-null"); 1252Debug.Assert(newSize >= _entries.Length); 1261Debug.Assert(_comparer is NonRandomizedStringEqualityComparer); 1304Debug.Assert(_entries != null, "entries should be non-null"); 1308Debug.Assert(typeof(TKey).IsValueType || comparer is not null); 1331Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 1377Debug.Assert(_entries != null, "entries should be non-null"); 1381Debug.Assert(typeof(TKey).IsValueType || comparer is not null); 1406Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 1602Debug.Assert(oldEntries is not null); 1609Debug.Assert(_entries is not null);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (32)
148Debug.Assert(EffectiveEqualityComparersAreEqual(this, source), "must use identical effective comparers."); 187Debug.Assert(Count == source.Count); 202Debug.Assert(_buckets != null, "_buckets should be non-null"); 203Debug.Assert(_entries != null, "_entries should be non-null"); 225Debug.Assert(entries != null, "Expected _entries to be initialized"); 255Debug.Assert(comparer is not null); 297Debug.Assert(entries != null, "entries should be non-null"); 303Debug.Assert(typeof(T).IsValueType || comparer is not null); 327Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 426Debug.Assert(set is not null); 427Debug.Assert(IsCompatibleItem(set)); 438Debug.Assert(set is not null); 446Debug.Assert(IsCompatibleItem(set)); 462Debug.Assert(set._buckets != null); 465Debug.Assert(entries != null, "expected entries to be non-null"); 472Debug.Assert(comparer is not null); 502Debug.Assert((StartOfFreeList - entries![set._freeList].Next) >= -1, "shouldn't overflow because `next` cannot underflow"); 549Debug.Assert(entries != null, "entries should be non-null"); 574Debug.Assert((StartOfFreeList - set._freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 634Debug.Assert(set._entries != null, "expected entries to be != null"); 1245Debug.Assert(_comparer is not null, "The comparer should never be null for a reference type."); 1289Debug.Assert(!forceNewHashCodes || !typeof(T).IsValueType); 1290Debug.Assert(_entries != null, "_entries should be non-null"); 1291Debug.Assert(newSize >= _entries.Length); 1300Debug.Assert(_comparer is NonRandomizedStringEqualityComparer); 1417Debug.Assert(_buckets != null); 1420Debug.Assert(entries != null, "expected entries to be non-null"); 1456Debug.Assert(comparer is not null); 1484Debug.Assert((StartOfFreeList - entries![_freeList].Next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1517Debug.Assert(location >= 0); 1575Debug.Assert(_buckets != null, "_buckets shouldn't be null; callers should check first"); 1733Debug.Assert((_buckets != null) && (_count > 0), "_buckets was null but count greater than 0");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\List.cs (3)
216Debug.Assert(_size == _items.Length); 466Debug.Assert(insertionCount > 0); 490Debug.Assert(_items.Length < capacity);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\NonRandomizedStringEqualityComparer.cs (3)
31Debug.Assert(underlyingComparer != null); 87Debug.Assert(obj != null, "This implementation is only called from first-party collection types that guarantee non-null parameters."); 119Debug.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\Queue.cs (4)
312Debug.Assert(capacity >= _size); 349Debug.Assert(_size == 0); 397Debug.Assert(_array.Length < capacity); 495Debug.Assert(_index == -1 || _index == -2);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (6)
31Debug.Assert(value >= 0); 32Debug.Assert(value <= _span.Length); 41Debug.Assert(index < _pos); 94Debug.Assert(index == 0, "Implementation currently only supports index == 0"); 109Debug.Assert(length >= 0); 137Debug.Assert(_pos == _span.Length);
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (3)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
src\libraries\System.Private.CoreLib\src\System\Collections\Hashtable.cs (12)
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."); 536Debug.Assert(array != null); 537Debug.Assert(array.Rank == 1); 555Debug.Assert(array != null); 556Debug.Assert(array.Rank == 1); 607Debug.Assert(array != null); 608Debug.Assert(array.Rank == 1); 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); // 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\ComAwareWeakReference.cs (5)
64Debug.Assert(pComWeakRef != IntPtr.Zero); 80Debug.Assert(weakHandle != 0); 152Debug.Assert((taggedHandle & ComAwareBit) != 0); 158Debug.Assert((taggedHandle & ComAwareBit) != 0); 175Debug.Assert((taggedHandle & ComAwareBit) == 0);
src\libraries\System.Private.CoreLib\src\System\Convert.Base64.cs (1)
153Debug.Assert((consumed % 4) == 0);
src\libraries\System.Private.CoreLib\src\System\Convert.cs (17)
172Debug.Assert(value != null, "[Convert.DefaultToType]value!=null"); 2422Debug.Assert(converted == charLengthRequired); 2461Debug.Assert(converted == charLengthRequired); 2477Debug.Assert(bytes.Length >= Base64VectorizationLengthThreshold); 2478Debug.Assert(chars.Length >= charLengthRequired); 2479Debug.Assert(charLengthRequired % 4 == 0); 2483Debug.Assert(status == OperationStatus.Done && charLengthRequired == bytesWritten); 2543Debug.Assert(Unsafe.AreSame(ref srcBeginning, ref src)); 2544Debug.Assert(Unsafe.AreSame(ref srcBeginning, ref Unsafe.As<ushort, byte>(ref dest)), 2688Debug.Assert(chars.Length != 0); // If TryDecodeFromUtf16() consumed the entire buffer, it could not have returned false. 2717Debug.Assert(chars.Length != 0 && !chars[0].IsSpace()); 2765Debug.Assert(tempBuffer.Length != 0); // We only bound-check after writing a character to the tempBuffer. 2828Debug.Assert(0 <= inputLength); 2843Debug.Assert(0 <= resultLength); 2873Debug.Assert(0 <= inputLength); 2896Debug.Assert(0 <= usefulInputLength); 2900Debug.Assert(0 <= padding);
src\libraries\System.Private.CoreLib\src\System\DateOnly.cs (5)
38Debug.Assert(dayNumber <= MaxDayNumber); 692Debug.Assert(result != ParseFailureKind.None); 699Debug.Assert(result == ParseFailureKind.Format_DateTimeOnlyContainsNoneDateParts); 757Debug.Assert(charsWritten == destination.Length); 763Debug.Assert(charsWritten == destination.Length);
src\libraries\System.Private.CoreLib\src\System\DateTime.cs (5)
151Debug.Assert((dateData & TicksMask) <= MaxTicks); 201Debug.Assert(kind == DateTimeKind.Local, "Internal Constructor is for local times only"); 1130Debug.Assert(ticks <= MaxTicks, "Input parameters validated already"); 1143Debug.Assert(ticks <= MaxTicks, "Input parameters validated already"); 2022Debug.Assert(ticks <= MaxTicks, "Input parameters validated already");
src\libraries\System.Private.CoreLib\src\System\DateTimeOffset.cs (4)
73Debug.Assert(validOffsetMinutes is >= MinOffsetMinutes and <= MaxOffsetMinutes); 74Debug.Assert(validDateTime.Kind == DateTimeKind.Unspecified); 75Debug.Assert((ulong)(validDateTime.Ticks + validOffsetMinutes * TimeSpan.TicksPerMinute) <= DateTime.MaxTicks); 937Debug.Assert(offset.Ticks >= MinOffset && offset.Ticks <= MaxOffset, "Offset not validated.");
src\libraries\System.Private.CoreLib\src\System\Decimal.cs (3)
382Debug.Assert((exponent >= 67) && (exponent <= 95)); 630Debug.Assert(buffer.Length >= 16); 640Debug.Assert(span.Length >= 16);
src\libraries\System.Private.CoreLib\src\System\Decimal.DecCalc.cs (20)
366Debug.Assert(den > bufNum->High64); 391Debug.Assert(den > bufNum.High64); 483Debug.Assert(bufDen.U2 > bufNum.U3); 609Debug.Assert(hiRes < Buf24.Length); 737Debug.Assert(cur + 1 < Buf24.Length); 807Debug.Assert(bufQuo.U2 == 0); 1084Debug.Assert(cur < Buf24.Length); 1096Debug.Assert(hiProd + 1 < Buf24.Length); 1132Debug.Assert(cur < Buf24.Length); 1134Debug.Assert(hiProd < Buf24.Length); 1159Debug.Assert(cur < Buf24.Length); 1613Debug.Assert(dbl < 1E7); 1618Debug.Assert(dbl >= 1E6); 1773Debug.Assert(dbl < 1E15); 1778Debug.Assert(dbl >= 1E14); 1818Debug.Assert(power <= 14); 2275Debug.Assert(d2.High == 0); 2276Debug.Assert(scale == 0); 2333Debug.Assert(high + 1 < Buf28.Length); 2495Debug.Assert(mode == MidpointRounding.ToPositiveInfinity);
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\Contracts\ContractFailedEventArgs.cs (1)
19Debug.Assert(originalException == null || failureKind == ContractFailureKind.PostconditionOnException);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Debug.cs (1)
91Assert(condition, message.ToStringAndClear());
src\libraries\System.Private.CoreLib\src\System\Diagnostics\StackTrace.cs (3)
377Debug.Assert(mb != null); 437Debug.Assert(method != null); 438Debug.Assert(method.DeclaringType != null);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\ActivityTracker.cs (3)
61Debug.Assert((options & EventActivityOptions.Disable) == 0); 505Debug.Assert(value < 16); 506Debug.Assert(ptr < endPtr);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\CounterGroup.cs (10)
48Debug.Assert(e.Command == EventCommand.Enable || e.Command == EventCommand.Disable); 54Debug.Assert(e.Arguments != null); 76Debug.Assert(e.Command == EventCommand.Disable); 93Debug.Assert((s_counterGroupEnabledList == null && !_eventSource.IsEnabled()) 111Debug.Assert(Monitor.IsEntered(s_counterGroupLock)); 130Debug.Assert(s_counterGroups != null); 151Debug.Assert(pollingIntervalInSeconds > 0); 152Debug.Assert(Monitor.IsEntered(s_counterGroupLock)); 188Debug.Assert(Monitor.IsEntered(s_counterGroupLock)); 204Debug.Assert(Monitor.IsEntered(s_counterGroupLock));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\DiagnosticCounter.cs (6)
42Debug.Assert(_group is null); 43Debug.Assert(Name != null); 44Debug.Assert(EventSource != null); 117Debug.Assert(Monitor.IsEntered(this)); 127Debug.Assert(_metadata.Count > 0); 129Debug.Assert(gotOne);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventCounter.cs (2)
80Debug.Assert(Monitor.IsEntered(this)); 174Debug.Assert(Monitor.IsEntered(this));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventDispatcher.cs (5)
68Debug.Assert(Monitor.IsEntered(m_dispatchControlLock)); 125Debug.Assert(Volatile.Read(ref m_sessionID) == 0); 134Debug.Assert(Monitor.IsEntered(m_dispatchControlLock)); 142Debug.Assert(sessionID != 0); 182Debug.Assert((syncTimeUtc.Ticks != 0) && (syncTimeQPC != 0) && (timeQPCFrequency != 0));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventDispatcher.Threads.cs (3)
13Debug.Assert(Monitor.IsEntered(m_dispatchControlLock)); 14Debug.Assert(sessionID != 0); 23Debug.Assert(sessionID != 0);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventProvider.cs (2)
75Debug.Assert(!_gcHandle.IsAllocated); 125Debug.Assert(userDataCount >= 0);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeMetadataGenerator.cs (10)
177Debug.Assert(offset == v1MetadataLength); 207Debug.Assert(totalMetadataLength == offset); 225Debug.Assert(bufferLength >= (offset + srcLength)); 235Debug.Assert(bufferLength >= (offset + sizeof(T))); 311Debug.Assert(property != null); 312Debug.Assert(pMetadataBlob != null); 385Debug.Assert(pMetadataBlob != null); 405Debug.Assert(typeInfo != null); 406Debug.Assert(pMetadataBlob != null); 612Debug.Assert(property != null);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventProvider.cs (4)
165Debug.Assert(!Monitor.IsEntered(EventListener.EventListenersLock)); 481Debug.Assert(EtwAPIMaxRefObjCount == 8, $"{nameof(EtwAPIMaxRefObjCount)} must equal the number of fields in {nameof(EightObjects)}"); 678Debug.Assert((EventOpcode)eventDescriptor.Opcode == EventOpcode.Send || 1349Debug.Assert(filterData != null);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (69)
475Debug.Assert(EventListener.s_EventSources != null); 785Debug.Assert(m_eventData != null); 786Debug.Assert(m_eventPipeProvider != null); 813Debug.Assert(eventHandle != IntPtr.Zero); 1373Debug.Assert(m_eventData != null); // You must have initialized this if you enabled the source. 1538Debug.Assert(!Monitor.IsEntered(EventListener.EventListenersLock)); 1716Debug.Assert(!m_eventSourceEnabled); // We can't be enabled until we are completely initted. 1790Debug.Assert(data->Size == 4); 1802Debug.Assert(dataType.IsEnum); 1822Debug.Assert(*(int*)dataPointer == (data + 1)->Size); 1837Debug.Assert(!dataType.IsEnum); 1840Debug.Assert(size == 1); 1845Debug.Assert(size == 1); 1850Debug.Assert(size == 2); 1855Debug.Assert(size == 2); 1860Debug.Assert(size == 2); 1897Debug.Assert(size == 16); 1902Debug.Assert(size == 16); 1946Debug.Assert(data->Size >= 0 && data->Size % 2 == 0, "String size should be even"); 1951Debug.Assert(*(charPointer + i) != 0, "String may not contain null chars"); 1953Debug.Assert(*(charPointer + charLength) == 0, "String must be null terminated"); 1978Debug.Assert(m_eventData != null); // You must have initialized this if you enabled the source. 2086Debug.Assert(m_eventData != null); 2105Debug.Assert(m_eventData != null); 2134Debug.Assert(m_eventData != null); 2164Debug.Assert(data->Size == 4); 2185Debug.Assert(dispatcher.m_EventEnabled != null); 2360Debug.Assert(m_eventData != null); 2652Debug.Assert(Monitor.IsEntered(EventListener.EventListenersLock)); 2667Debug.Assert(m_eventData != null); 2725Debug.Assert(commandArgs.perEventSourceSessionId >= -1 && commandArgs.perEventSourceSessionId <= SessionMask.MAX); 2743Debug.Assert(m_eventData != null); 2759Debug.Assert(dispatcher.m_EventEnabled != null); 2820Debug.Assert(m_eventData != null); 2836Debug.Assert(dispatcher.m_EventEnabled != null); 2853Debug.Assert(m_eventData != null); 2868Debug.Assert(Monitor.IsEntered(EventListener.EventListenersLock)); 2872Debug.Assert(m_rawManifest == null); 2874Debug.Assert(m_eventData != null); 2879Debug.Assert(EventListener.s_EventSources != null, "should be called within lock on EventListener.EventListenersLock which ensures s_EventSources to be initialized"); 2920Debug.Assert(!SelfDescribingEvents); 3024Debug.Assert(attributeType == typeof(EventAttribute) || attributeType == typeof(EventSourceAttribute)); 3039Debug.Assert(data.ConstructorArguments.Count <= 1); 3327Debug.Assert(0 <= startEventId); 3370Debug.Assert(eventData != null); 3404Debug.Assert(eventData != null); 3606Debug.Assert(eventAttribute.Task != EventTask.None || eventAttribute.Opcode != EventOpcode.Info); 3853Debug.Assert(((m_config & EventSourceSettings.EtwManifestEventFormat) != 0) != 4313Debug.Assert(s_EventSources != null); 4372Debug.Assert(EventSource.IsSupported); 4376Debug.Assert(s_EventSources != null); 4388Debug.Assert(!Monitor.IsEntered(EventListenersLock)); 4435Debug.Assert(Monitor.IsEntered(EventListenersLock)); 4437Debug.Assert(s_EventSources != null); 4511Debug.Assert(s_EventSources != null); 4528Debug.Assert(eventSource.m_id == id, "Unexpected event source ID."); 4534Debug.Assert(allListeners.ContainsKey(dispatcher.m_Listener), "EventSource has a listener not on the global list."); 4544Debug.Assert(dispatcher != null, "Listener is not on all eventSources."); 4578Debug.Assert(s_EventSources != null); 5167Debug.Assert(perEventSourceSessionId < MAX); 5185Debug.Assert(perEventSourceSessionId < MAX); 5190Debug.Assert(perEventSourceSessionId < MAX); 5420Debug.Assert(channel >= EventChannel.Admin && channel <= EventChannel.Debug); 5462Debug.Assert(numParams == 0); 5463Debug.Assert(this.eventName == null); 5541Debug.Assert(eventName != null); 5660Debug.Assert(channelInfo.Name != null); 5693Debug.Assert(localEnumType.IsEnum); 5921Debug.Assert(info!.Attribs != null);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\NativeRuntimeEventSource.Threading.NativeSinks.cs (5)
91Debug.Assert(IsEnabled(EventLevel.Informational, Keywords.ContentionKeyword)); 112Debug.Assert(IsEnabled(EventLevel.Informational, Keywords.ContentionKeyword)); 131Debug.Assert(IsEnabled(EventLevel.Informational, Keywords.ContentionKeyword)); 361Debug.Assert(IsEnabled(EventLevel.Verbose, Keywords.WaitHandleKeyword)); 375Debug.Assert(IsEnabled(EventLevel.Verbose, Keywords.WaitHandleKeyword));
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\DataCollector.cs (6)
98Debug.Assert(buffer != null); 133Debug.Assert(buffer != null); 172Debug.Assert(buffer != null); 213Debug.Assert(value != null && buffer != null); 238Debug.Assert(buffer != null); 271Debug.Assert(buffer != null);
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\EventPayload.cs (1)
19Debug.Assert(payloadNames.Length == payloadValues.Length);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\FieldMetadata.cs (1)
214Debug.Assert(custom != null);
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\SimpleEventTypes.cs (1)
33Debug.Assert(instance != null);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\SimpleTypeInfos.cs (1)
319Debug.Assert(typeArgs.Length == 1);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingEventHandleTable.cs (1)
41Debug.Assert(Monitor.IsEntered(this));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingEventSource.cs (6)
420Debug.Assert(eventHandle != IntPtr.Zero); 530Debug.Assert(eventHandle != IntPtr.Zero); 598Debug.Assert(eventHandle != IntPtr.Zero); 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"); 790Debug.Assert(ProviderMetadata.SequenceEqual(m_providerMetadata));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\XplatEventLogger.cs (1)
151Debug.Assert(byteArray != null);
src\libraries\System.Private.CoreLib\src\System\Double.cs (7)
295Debug.Assert(IsNaN(value)); 1591Debug.Assert(ax >= ay); 1679Debug.Assert(n == 0); 1718Debug.Assert(IsPositiveInfinity(x)); 1723Debug.Assert(IsNegativeInfinity(x)); 1763Debug.Assert(IsPositiveInfinity(x)); 1768Debug.Assert(IsNegativeInfinity(x));
src\libraries\System.Private.CoreLib\src\System\Enum.cs (22)
258Debug.Assert(enumType.IsActualEnum); 341Debug.Assert(enumType.IsActualEnum); 371Debug.Assert(enumType.IsActualEnum); 584Debug.Assert(success && result is not null); 604Debug.Assert(success && result is not null); 646Debug.Assert(success); 663Debug.Assert(success); 1545Debug.Assert(success); 1546Debug.Assert(charsWritten == sizeof(TStorage) * 2); 1805Debug.Assert(typeof(TEnum).IsEnum); 1806Debug.Assert(value is not null); 1897Debug.Assert(!format.IsEmpty); 1933Debug.Assert(names.Length == values.Length); 1964Debug.Assert(!isDestinationTooSmall); 1968Debug.Assert(names.Length == values.Length); 2296Debug.Assert( 2311if (typeof(TUnderlying) == typeof(sbyte)) Debug.Assert(typeof(TStorage) == typeof(byte)); 2312else if (typeof(TUnderlying) == typeof(short)) Debug.Assert(typeof(TStorage) == typeof(ushort)); 2313else if (typeof(TUnderlying) == typeof(int)) Debug.Assert(typeof(TStorage) == typeof(uint)); 2314else if (typeof(TUnderlying) == typeof(long)) Debug.Assert(typeof(TStorage) == typeof(ulong)); 2315else if (typeof(TUnderlying) == typeof(nint)) Debug.Assert(typeof(TStorage) == typeof(nuint)); 2316else Debug.Assert(typeof(TUnderlying) == typeof(TStorage));
src\libraries\System.Private.CoreLib\src\System\Enum.EnumInfo.cs (1)
38Debug.Assert(sizeof(TStorage) == sizeof(TResult));
src\libraries\System.Private.CoreLib\src\System\Environment.cs (4)
176Debug.Assert(processId != 0); 202Debug.Assert(processPath != null); 225Debug.Assert(osVersion != null); 258Debug.Assert(target != EnvironmentVariableTarget.Process);
src\libraries\System.Private.CoreLib\src\System\Environment.GetFolderPathCore.Unix.cs (5)
24Debug.Assert(path != null); 42Debug.Assert(option == SpecialFolderOption.Create); 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\Environment.Variables.Windows.cs (1)
130Debug.Assert(success != Interop.BOOL.FALSE);
src\libraries\System.Private.CoreLib\src\System\Exception.cs (1)
175Debug.Assert(resultSpan.Length == 0);
src\libraries\System.Private.CoreLib\src\System\Gen2GcCallback.cs (2)
69Debug.Assert(_callback1 != null); 91Debug.Assert(_callback0 != null);
src\libraries\System.Private.CoreLib\src\System\Globalization\Calendar.cs (2)
98Debug.Assert(BaseCalendarID != CalendarId.UNINITIALIZED_VALUE, "[Calendar.CurrentEraValue] Expected a real calendar ID"); 369Debug.Assert(offset >= 0, "Calendar.GetFirstDayWeekOfYear(): offset >= 0");
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.cs (1)
104Debug.Assert(!GlobalizationMode.Invariant);
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Icu.cs (9)
37Debug.Assert(!GlobalizationMode.UseNls); 61Debug.Assert(this.saMonthNames != null); 64Debug.Assert(calendarId == CalendarId.HEBREW && saMonthNames.Length == 13); 88Debug.Assert(!GlobalizationMode.Invariant); 89Debug.Assert(!GlobalizationMode.UseNls); 116Debug.Assert(!GlobalizationMode.UseNls); 124Debug.Assert(!GlobalizationMode.Invariant); 222Debug.Assert(index + 3 < modifiedPattern.Length); 385Debug.Assert(calendarId == CalendarId.HEBREW && callbackContext.Results.Count == 14);
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Nls.cs (3)
15Debug.Assert(!GlobalizationMode.Invariant); 16Debug.Assert(GlobalizationMode.UseNls); 72Debug.Assert(context->strings != null);
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Unix.cs (1)
27Debug.Assert(!GlobalizationMode.UseNls);
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendricalCalculationsHelper.cs (7)
146Debug.Assert(gregorianYear < 1620 || 2020 <= gregorianYear); 155Debug.Assert(1988 <= gregorianYear && gregorianYear <= 2019); 161Debug.Assert(1900 <= gregorianYear && gregorianYear <= 1987); 168Debug.Assert(1800 <= gregorianYear && gregorianYear <= 1899); 175Debug.Assert(1700 <= gregorianYear && gregorianYear <= 1799); 182Debug.Assert(1620 <= gregorianYear && gregorianYear <= 1699); 388Debug.Assert(day != upperBoundNewYearDay);
src\libraries\System.Private.CoreLib\src\System\Globalization\CharUnicodeInfo.cs (10)
56Debug.Assert(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); 377Debug.Assert(str != null, "str can not be null"); 378Debug.Assert(str.Length > 0); 379Debug.Assert(index >= 0 && index < str.Length); 411Debug.Assert(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."); 1483Debug.Assert(level1BitCount == 11, "Unexpected level 1 bit count."); 1484Debug.Assert(level2BitCount == 5, "Unexpected level 2 bit count."); 1485Debug.Assert(level3BitCount == 4, "Unexpected level 3 bit count.");
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.cs (6)
222Debug.Assert(m_name != null, "CompareInfo.OnSerializing - expected m_name to be set already"); 239Debug.Assert(m_name != null, "CompareInfo.Name Expected _name to be set"); 367Debug.Assert(!Unsafe.IsNullRef(ref MemoryMarshal.GetReference(span1))); 368Debug.Assert(!Unsafe.IsNullRef(ref MemoryMarshal.GetReference(span2))); 396Debug.Assert(offset2 > (string2 == null ? 0 : string2.Length) - length2); 1048Debug.Assert(matchLengthPtr != null);
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Icu.cs (50)
39Debug.Assert(!GlobalizationMode.UseNls); 40Debug.Assert(interopCultureName != null); 52Debug.Assert(!GlobalizationMode.Invariant); 53Debug.Assert(!GlobalizationMode.UseNls); 54Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 68Debug.Assert(!GlobalizationMode.Invariant); 69Debug.Assert(!GlobalizationMode.UseNls); 70Debug.Assert(target.Length != 0); 106Debug.Assert(!GlobalizationMode.Invariant); 108Debug.Assert(!target.IsEmpty); 109Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 221Debug.Assert(!GlobalizationMode.Invariant); 223Debug.Assert(!target.IsEmpty); 224Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 316Debug.Assert(!GlobalizationMode.Invariant); 317Debug.Assert(!GlobalizationMode.UseNls); 319Debug.Assert(!prefix.IsEmpty); 320Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 345Debug.Assert(!GlobalizationMode.Invariant); 347Debug.Assert(!prefix.IsEmpty); 348Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 427Debug.Assert(!GlobalizationMode.Invariant); 429Debug.Assert(!prefix.IsEmpty); 430Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 500Debug.Assert(!GlobalizationMode.Invariant); 501Debug.Assert(!GlobalizationMode.UseNls); 503Debug.Assert(!suffix.IsEmpty); 504Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 529Debug.Assert(!GlobalizationMode.Invariant); 531Debug.Assert(!suffix.IsEmpty); 532Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 612Debug.Assert(!GlobalizationMode.Invariant); 614Debug.Assert(!suffix.IsEmpty); 615Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 686Debug.Assert(!GlobalizationMode.Invariant); 687Debug.Assert(!GlobalizationMode.UseNls); 743Debug.Assert(!GlobalizationMode.Invariant); 744Debug.Assert(!GlobalizationMode.UseNls); 745Debug.Assert((options & ValidCompareMaskOffFlags) == 0); 792Debug.Assert(!GlobalizationMode.Invariant); 793Debug.Assert(!GlobalizationMode.UseNls); 794Debug.Assert((options & ValidCompareMaskOffFlags) == 0); 822Debug.Assert(!GlobalizationMode.Invariant); 823Debug.Assert(!GlobalizationMode.UseNls); 824Debug.Assert(!text.IsEmpty); 847Debug.Assert(!GlobalizationMode.Invariant); 848Debug.Assert(!GlobalizationMode.UseNls); 849Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 946Debug.Assert(!GlobalizationMode.Invariant); 947Debug.Assert(!GlobalizationMode.UseNls);
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Invariant.cs (6)
46Debug.Assert(sortKey.Length >= source.Length * sizeof(char)); 58Debug.Assert(sortKey.Length >= source.Length * sizeof(char)); 86Debug.Assert(GlobalizationMode.Invariant); 87Debug.Assert((options & ValidCompareMaskOffFlags) == 0); 112Debug.Assert(GlobalizationMode.Invariant); 113Debug.Assert((options & ValidCompareMaskOffFlags) == 0);
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Nls.cs (64)
14Debug.Assert(GlobalizationMode.UseNls); 50Debug.Assert(!GlobalizationMode.Invariant); 51Debug.Assert(!source.IsEmpty); 52Debug.Assert(!value.IsEmpty); 57Debug.Assert(pSource != null); 58Debug.Assert(pValue != null); 68Debug.Assert(ret >= -1 && ret <= source.Length); 71Debug.Assert(ret >= 0 || Marshal.GetLastPInvokeError() == Interop.Errors.ERROR_SUCCESS); 79Debug.Assert(!GlobalizationMode.Invariant); 80Debug.Assert(GlobalizationMode.UseNls); 82Debug.Assert(source.Length != 0); 83Debug.Assert(value.Length != 0); 91Debug.Assert(!GlobalizationMode.Invariant); 92Debug.Assert(GlobalizationMode.UseNls); 94Debug.Assert(source != null); 95Debug.Assert(value != null); 108Debug.Assert(!GlobalizationMode.Invariant); 109Debug.Assert(GlobalizationMode.UseNls); 110Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 186Debug.Assert(!GlobalizationMode.Invariant); 187Debug.Assert(GlobalizationMode.UseNls); 189Debug.Assert(count1 > 0); 190Debug.Assert(count2 > 0); 195Debug.Assert(char1 != null); 196Debug.Assert(char2 != null); 210Debug.Assert(!GlobalizationMode.Invariant); 211Debug.Assert(GlobalizationMode.UseNls); 212Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 234Debug.Assert(*pString1 >= 0); // assert that we can always dereference this 235Debug.Assert(*pString2 >= 0); // assert that we can always dereference this 264Debug.Assert(!GlobalizationMode.Invariant); 265Debug.Assert(!lpStringValue.IsEmpty); 286Debug.Assert(pSource != null && pValue != null); 300Debug.Assert(result >= -1 && result <= lpStringSource.Length); 303Debug.Assert(result >= 0 || Marshal.GetLastPInvokeError() == Interop.Errors.ERROR_SUCCESS); 311Debug.Assert(!GlobalizationMode.Invariant); 312Debug.Assert(GlobalizationMode.UseNls); 314Debug.Assert(target.Length != 0); 322Debug.Assert(!GlobalizationMode.Invariant); 323Debug.Assert(GlobalizationMode.UseNls); 325Debug.Assert(!prefix.IsEmpty); 326Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 343Debug.Assert(!GlobalizationMode.Invariant); 344Debug.Assert(GlobalizationMode.UseNls); 346Debug.Assert(!suffix.IsEmpty); 347Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 373Debug.Assert(!GlobalizationMode.Invariant); 374Debug.Assert(GlobalizationMode.UseNls); 425Debug.Assert(!GlobalizationMode.Invariant); 426Debug.Assert((options & ValidCompareMaskOffFlags) == 0); 467Debug.Assert(pSource != null); 468Debug.Assert(pSortKey != null); 503Debug.Assert(actualSortKeyLength == 0, "LCMapStringEx should never return a negative value."); 519Debug.Assert(actualSortKeyLength <= destination.Length); 525Debug.Assert(!GlobalizationMode.Invariant); 526Debug.Assert((options & ValidCompareMaskOffFlags) == 0); 545Debug.Assert(pSource != null); 555Debug.Assert(sortKeyLength == 0, "LCMapStringEx should never return a negative value."); 568Debug.Assert(!GlobalizationMode.Invariant); 569Debug.Assert(GlobalizationMode.UseNls); 570Debug.Assert(!text.IsEmpty); 607Debug.Assert(((options & ~(CompareOptions.IgnoreCase | 621Debug.Assert(!GlobalizationMode.Invariant); 622Debug.Assert(GlobalizationMode.UseNls);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.cs (19)
915Debug.Assert(_sRealName != null, "[CultureData.CultureName] Expected _sRealName to be populated by already"); 1095Debug.Assert(_sSpecificCulture != null, "[CultureData.SpecificCultureName] Expected this.sSpecificCulture to be populated by culture data initialization already"); 1657Debug.Assert(_sWindowsName != null, "[CultureData.CalendarIds] Expected _sWindowsName to be populated by already"); 1725Debug.Assert(calendarId > 0 && calendarId <= CalendarId.LAST_CALENDAR, 1741Debug.Assert(_sWindowsName != null, "[CultureData.GetCalendar] Expected _sWindowsName to be populated by already"); 1770Debug.Assert(_sRealName != null, "[CultureData.IsRightToLeft] Expected _sRealName to be populated by already"); 1794Debug.Assert(_sRealName != null, "[CultureData.TextInfoName] Expected _sRealName to be populated by already"); 1806Debug.Assert(_sRealName != null, "[CultureData.SortName] Expected _sRealName to be populated by already"); 1879Debug.Assert(_sRealName != null, "[CultureData.LCID] Expected this.sRealName to be populated already"); 1922Debug.Assert(calendarId > 0, "[CultureData.saEraNames] Expected Calendar.ID > 0"); 1928Debug.Assert(calendarId > 0, "[CultureData.saAbbrevEraNames] Expected Calendar.ID > 0"); 1934Debug.Assert(calendarId > 0, "[CultureData.saAbbrevEraNames] Expected Calendar.ID > 0"); 2012Debug.Assert(str != null); 2013Debug.Assert(start >= 0); 2014Debug.Assert(end >= 0); 2099Debug.Assert(startIndex >= 0, "startIndex cannot be negative"); 2100Debug.Assert(!timeParts.AsSpan().ContainsAny('\'', '\\'), "timeParts cannot include quote characters"); 2220Debug.Assert(_sWindowsName != null, "[CultureData.GetNFIValues] Expected _sWindowsName to be populated by already"); 2240Debug.Assert(_sRealName != null);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Icu.cs (28)
35Debug.Assert(name is not null); 36Debug.Assert(name.Length <= ICU_ULOC_FULLNAME_CAPACITY); 115Debug.Assert(_sRealName != null); 116Debug.Assert(!GlobalizationMode.Invariant); 153Debug.Assert(_sWindowsName != null); 214Debug.Assert(!GlobalizationMode.Invariant); 215Debug.Assert(!GlobalizationMode.UseNls); 216Debug.Assert(_sWindowsName != null, "[CultureData.IcuGetLocaleInfo] Expected _sWindowsName to be populated already"); 230Debug.Assert(!GlobalizationMode.UseNls); 231Debug.Assert(localeName != null, "[CultureData.IcuGetLocaleInfo] Expected localeName to be not be null"); 254Debug.Assert(!GlobalizationMode.UseNls); 256Debug.Assert(_sWindowsName != null, "[CultureData.IcuGetLocaleInfo(LocaleNumberData)] Expected _sWindowsName to be populated already"); 279Debug.Assert(!GlobalizationMode.UseNls); 280Debug.Assert(_sWindowsName != null, "[CultureData.IcuGetLocaleInfo(LocaleGroupingData)] Expected _sWindowsName to be populated already"); 302Debug.Assert(!GlobalizationMode.UseNls); 303Debug.Assert(_sWindowsName != null, "[CultureData.GetTimeFormatString(bool shortFormat)] Expected _sWindowsName to be populated already"); 352Debug.Assert(!GlobalizationMode.UseNls); 367Debug.Assert(icuFormatString.Length < ICU_ULOC_FULLNAME_CAPACITY); 454Debug.Assert(!GlobalizationMode.Invariant); 455Debug.Assert(!GlobalizationMode.UseNls); 463Debug.Assert(!GlobalizationMode.UseNls); 473Debug.Assert(!GlobalizationMode.UseNls); 480Debug.Assert(!GlobalizationMode.UseNls); 481Debug.Assert(cultureName != null); 514Debug.Assert(!GlobalizationMode.UseNls); 520Debug.Assert(!GlobalizationMode.Invariant); 521Debug.Assert(!GlobalizationMode.UseNls); 593Debug.Assert(!GlobalizationMode.UseNls);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Nls.cs (25)
42Debug.Assert(!GlobalizationMode.Invariant); 49Debug.Assert(ShouldUseUserOverrideNlsData); 50Debug.Assert(_sRealName != null, "[CultureData.DoGetLocaleInfo] Expected _sRealName to be populated by already"); 58Debug.Assert(ShouldUseUserOverrideNlsData); 66Debug.Assert(IsWin32Installed); 77Debug.Assert(_sRealName != null, "[CultureData.DoGetLocaleInfoInt] Expected _sRealName to be populated by already"); 83Debug.Assert(ShouldUseUserOverrideNlsData); 84Debug.Assert(_sRealName != null, "[CultureData.DoGetLocaleInfoInt] Expected _sRealName to be populated by already"); 90Debug.Assert(GlobalizationMode.UseNls); 96Debug.Assert(ShouldUseUserOverrideNlsData); 97Debug.Assert(_sRealName != null, "[CultureData.DoGetLocaleInfoInt] Expected _sRealName to be populated by already"); 103Debug.Assert(ShouldUseUserOverrideNlsData); 104Debug.Assert(_sRealName != null, "[CultureData.DoGetLocaleInfoInt] Expected _sRealName to be populated by already"); 116Debug.Assert(!GlobalizationMode.Invariant); 117Debug.Assert(GlobalizationMode.UseNls); 118Debug.Assert(regionName != null); 140Debug.Assert(GlobalizationMode.UseNls); 160Debug.Assert(GlobalizationMode.UseNls); 176Debug.Assert(localeName != null, "[CultureData.GetLocaleInfoFromLCType] Expected localeName to be not be null"); 447Debug.Assert(!GlobalizationMode.Invariant); 454Debug.Assert(GlobalizationMode.UseNls); 460Debug.Assert(!GlobalizationMode.Invariant); 461Debug.Assert(GlobalizationMode.UseNls); 511Debug.Assert(GlobalizationMode.UseNls); 519Debug.Assert(GlobalizationMode.UseNls);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Unix.cs (1)
17Debug.Assert(!GlobalizationMode.Invariant);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureInfo.cs (6)
175Debug.Assert(cultureData != null); 183Debug.Assert(name != null); 453Debug.Assert(s_InvariantCultureInfo != null, "[CultureInfo.InvariantCulture] s_InvariantCultureInfo is null"); 575Debug.Assert(_name != null, "[CultureInfo.DisplayName] Always expect _name to be set"); 786Debug.Assert(!GlobalizationMode.Invariant); 802Debug.Assert(calType != CalendarId.GREGORIAN, "calType!=CalendarId.GREGORIAN");
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureInfo.Unix.cs (1)
18Debug.Assert(localeName != null);
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (22)
166Debug.Assert(value >= 0, "DateTimeFormat.FormatDigits(): value >= 0"); 167Debug.Assert(minimumLength <= 16); 209Debug.Assert(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"); 755Debug.Assert(typeof(TChar) == typeof(byte)); 770Debug.Assert(typeof(TChar) == typeof(byte)); 782Debug.Assert(charCount != 0); 841Debug.Assert(tokenLen >= 3); 934Debug.Assert(charsWritten == FormatSLength); 941Debug.Assert(charsWritten == FormatInvariantGMinLength); 960Debug.Assert(charsWritten == FormatInvariantGMaxLength); 979Debug.Assert(charsWritten is >= FormatOMinLength and <= FormatOMaxLength); 986Debug.Assert(charsWritten == str.Length); 993Debug.Assert(charsWritten == str.Length); 1000Debug.Assert(charsWritten == str.Length); 1034Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1410Debug.Assert(dayAbbrev.Length == 3); 1413Debug.Assert(monthAbbrev.Length == 3); 1617Debug.Assert(dayAbbrev.Length == 3); 1620Debug.Assert(monthAbbrev.Length == 3); 1721Debug.Assert(dtfi != null);
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfo.cs (49)
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, 243Debug.Assert(cultureData != null); 244Debug.Assert(cal != null); 254Debug.Assert(cultureData != null); 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"); 351Debug.Assert(amDesignator != null, "DateTimeFormatInfo.AMDesignator, amDesignator != null"); 370Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 380Debug.Assert(calendar != null, "DateTimeFormatInfo.Calendar: calendar != null"); 584Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.AbbreviatedEnglishEraNames] Expected Calendar.ID > 0"); 600Debug.Assert(dateSeparator != null, "DateTimeFormatInfo.DateSeparator, dateSeparator != null"); 619Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 633Debug.Assert(firstDayOfWeek != -1, "DateTimeFormatInfo.FirstDayOfWeek, firstDayOfWeek != -1"); 665Debug.Assert(calendarWeekRule != -1, "DateTimeFormatInfo.CalendarWeekRule, calendarWeekRule != -1"); 779Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.MonthDayPattern] Expected calID > 0"); 783Debug.Assert(monthDayPattern != null, "DateTimeFormatInfo.MonthDayPattern, monthDayPattern != null"); 803Debug.Assert(pmDesignator != null, "DateTimeFormatInfo.PMDesignator, pmDesignator != null"); 822Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 985Debug.Assert(timeSeparator != null, "DateTimeFormatInfo.TimeSeparator, timeSeparator != null"); 1004Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1048Debug.Assert(values != null, "value != null"); 1049Debug.Assert(values.Length >= length); 1207Debug.Assert(m_genitiveAbbreviatedMonthNames.Length == 13, 1217Debug.Assert(genitiveMonthNames.Length == 13, 1233Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.InternalGetLeapYearMonthNames] Expected Calendar.ID > 0"); 1235Debug.Assert(leapYearMonthNames.Length == 13, 1274Debug.Assert(patterns1 != null); 1275Debug.Assert(patterns2 != null); 1377Debug.Assert(patterns != null && patterns.Length > 0, 1379Debug.Assert(defaultPattern != null, 1455Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.UnclonedYearMonthPatterns] Expected Calendar.ID > 0"); 1457Debug.Assert(allYearMonthPatterns.Length > 0, 1476Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.UnclonedShortDatePatterns] Expected Calendar.ID > 0"); 1478Debug.Assert(allShortDatePatterns.Length > 0, 1497Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.UnclonedLongDatePatterns] Expected Calendar.ID > 0"); 1499Debug.Assert(allLongDatePatterns.Length > 0, 1519Debug.Assert(allShortTimePatterns.Length > 0, 1539Debug.Assert(allLongTimePatterns.Length > 0, 1704Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2257Debug.Assert(state == HebrewNumberParsingState.ContinueParsing || state == HebrewNumberParsingState.FoundEndOfHebrewNumber, 2306Debug.Assert(str.Index < str.Value.Length, "DateTimeFormatInfo.Tokenize(): start < value.Length");
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeParse.cs (20)
97Debug.Assert(dtfi != null, "dtfi == null"); 190Debug.Assert(dtfi != null, "dtfi == null"); 553Debug.Assert(hourOffset >= 0 && hourOffset <= 99); 554Debug.Assert(minuteOffset >= 0 && minuteOffset <= 99); 2053Debug.Assert(raw.numCount >= 2); 2075Debug.Assert(raw.numCount >= 3); 2497Debug.Assert(dtfi != null, "dtfi == null"); 2793Debug.Assert(result.parsedDate.Kind == DateTimeKind.Unspecified); 3129Debug.Assert(minDigitLen > 0); 3130Debug.Assert(maxDigitLen < 9); 3131Debug.Assert(minDigitLen <= maxDigitLen); 3166Debug.Assert(maxDigitLen <= DateTimeFormat.MaxSecondsFractionDigits); 5409Debug.Assert(dtfi != null, "Expected non-null DateTimeFormatInfo"); 5448Debug.Assert(Index + count <= Length, "__DTString::Advance: Index + count <= len"); 5775Debug.Assert(Index >= 0 && Index < Length, "Index >= 0 && Index < len"); 5784Debug.Assert(Index >= 0 && Index < Length, "Index >= 0 && Index < len"); 5785Debug.Assert(char.IsAsciiDigit(Value[Index]), "IsDigit(Value[Index])"); 5937Debug.Assert(number >= 0 && number <= 9); 5959Debug.Assert(sub.index == Index); 5960Debug.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 (3)
102Debug.Assert(Number > 0 && Number <= 999, "Number is out of range."); 213Debug.Assert(typeof(TChar) == typeof(byte)); 399Debug.Assert(s_numberPassingState.Length == HebrewTokenCount * ((int)HS.S9_DQ + 1));
src\libraries\System.Private.CoreLib\src\System\Globalization\IcuLocaleData.cs (3)
3779Debug.Assert(CulturesCount == (ThreeLetterWindowsLanguageName.Length / 3)); 3815Debug.Assert(ch <= 'z'); 3821Debug.Assert(CulturesCount * 2 == LocalesNamesIndexes.Length);
src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.cs (13)
157Debug.Assert(inputLength > 0); 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\IdnMapping.Icu.cs (9)
12Debug.Assert(!GlobalizationMode.Invariant); 13Debug.Assert(!GlobalizationMode.UseNls); 14Debug.Assert(unicodeString != null && unicodeString.Length >= count); 56Debug.Assert(!GlobalizationMode.Invariant); 57Debug.Assert(!GlobalizationMode.UseNls); 58Debug.Assert(asciiString != null && asciiString.Length >= count); 81Debug.Assert(!GlobalizationMode.Invariant); 82Debug.Assert(!GlobalizationMode.UseNls); 83Debug.Assert(asciiString != null && asciiString.Length >= count);
src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.Nls.cs (14)
14Debug.Assert(!GlobalizationMode.Invariant); 15Debug.Assert(GlobalizationMode.UseNls); 16Debug.Assert(unicodeString != null && unicodeString.Length >= count); 46Debug.Assert(!GlobalizationMode.Invariant); 47Debug.Assert(GlobalizationMode.UseNls); 48Debug.Assert(unicodeString != null && unicodeString.Length >= count); 55Debug.Assert(length == outputLength); 61Debug.Assert(!GlobalizationMode.Invariant); 62Debug.Assert(GlobalizationMode.UseNls); 63Debug.Assert(asciiString != null && asciiString.Length >= count); 93Debug.Assert(!GlobalizationMode.Invariant); 94Debug.Assert(GlobalizationMode.UseNls); 95Debug.Assert(asciiString != null && asciiString.Length >= count); 102Debug.Assert(length == outputLength);
src\libraries\System.Private.CoreLib\src\System\Globalization\InvariantModeCasing.cs (13)
113Debug.Assert(GlobalizationMode.Invariant); 114Debug.Assert(source.Length <= destination.Length); 139Debug.Assert(GlobalizationMode.Invariant); 140Debug.Assert(source.Length <= destination.Length); 183Debug.Assert(GlobalizationMode.Invariant); 199Debug.Assert(codePointLengthA == codePointLengthB); 211Debug.Assert(codePointLengthA == codePointLengthB); 226Debug.Assert(value.Length > 0); 227Debug.Assert(value.Length <= source.Length); 228Debug.Assert(GlobalizationMode.Invariant); 288Debug.Assert(value.Length > 0); 289Debug.Assert(value.Length <= source.Length); 290Debug.Assert(GlobalizationMode.Invariant);
src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseCalendar.Icu.cs (3)
20Debug.Assert(!GlobalizationMode.UseNls); 114Debug.Assert(abbrevEnglishEraNames == s_abbreviatedEnglishEraNames || eras.Count <= abbrevEnglishEraNames.Length); 141Debug.Assert(!GlobalizationMode.Invariant);
src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Icu.cs (16)
15Debug.Assert(!GlobalizationMode.Invariant); 16Debug.Assert(!GlobalizationMode.UseNls); 17Debug.Assert(!source.IsEmpty); 19Debug.Assert(normalizationForm is NormalizationForm.FormC or NormalizationForm.FormD or NormalizationForm.FormKC or NormalizationForm.FormKD); 49Debug.Assert(!GlobalizationMode.Invariant); 50Debug.Assert(!GlobalizationMode.UseNls); 51Debug.Assert(normalizationForm == NormalizationForm.FormC || normalizationForm == NormalizationForm.FormD || normalizationForm == NormalizationForm.FormKC || normalizationForm == NormalizationForm.FormKD); 95Debug.Assert(realLen > StackallocThreshold); 124Debug.Assert(!GlobalizationMode.Invariant); 125Debug.Assert(!GlobalizationMode.UseNls); 126Debug.Assert(!source.IsEmpty); 127Debug.Assert(normalizationForm == NormalizationForm.FormC || normalizationForm == NormalizationForm.FormD || normalizationForm == NormalizationForm.FormKC || normalizationForm == NormalizationForm.FormKD); 170Debug.Assert(!GlobalizationMode.Invariant); 171Debug.Assert(!GlobalizationMode.UseNls); 172Debug.Assert(!source.IsEmpty); 173Debug.Assert(normalizationForm == NormalizationForm.FormC || normalizationForm == NormalizationForm.FormD || normalizationForm == NormalizationForm.FormKC || normalizationForm == NormalizationForm.FormKD);
src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Nls.cs (18)
16Debug.Assert(!GlobalizationMode.Invariant); 17Debug.Assert(GlobalizationMode.UseNls); 18Debug.Assert(!source.IsEmpty); 19Debug.Assert(normalizationForm == NormalizationForm.FormC || normalizationForm == NormalizationForm.FormD || normalizationForm == NormalizationForm.FormKC || normalizationForm == NormalizationForm.FormKD); 37Debug.Assert(!GlobalizationMode.Invariant); 38Debug.Assert(GlobalizationMode.UseNls); 39Debug.Assert(strInput != null); 40Debug.Assert(normalizationForm == NormalizationForm.FormC || normalizationForm == NormalizationForm.FormD || normalizationForm == NormalizationForm.FormKC || normalizationForm == NormalizationForm.FormKD); 80Debug.Assert(realLength > buffer.Length, "Buffer overflow should have iLength > cBuffer.Length"); 88Debug.Assert(realLength > StackallocThreshold); 117Debug.Assert(!GlobalizationMode.Invariant); 118Debug.Assert(GlobalizationMode.UseNls); 119Debug.Assert(!source.IsEmpty); 120Debug.Assert(normalizationForm == NormalizationForm.FormC || normalizationForm == NormalizationForm.FormD || normalizationForm == NormalizationForm.FormKC || normalizationForm == NormalizationForm.FormKD); 167Debug.Assert(!GlobalizationMode.Invariant); 168Debug.Assert(GlobalizationMode.UseNls); 169Debug.Assert(!source.IsEmpty); 170Debug.Assert(normalizationForm == NormalizationForm.FormC || normalizationForm == NormalizationForm.FormD || normalizationForm == NormalizationForm.FormKC || normalizationForm == NormalizationForm.FormKD);
src\libraries\System.Private.CoreLib\src\System\Globalization\NumberFormatInfo.cs (14)
270Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 362Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 384Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 430Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 515Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 538Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 574Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 595Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 632Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 655Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 691Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 712Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 733Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 755Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
src\libraries\System.Private.CoreLib\src\System\Globalization\Ordinal.cs (5)
84Debug.Assert(length >= TVector.ElementCount); 248Debug.Assert(length == 1); 272Debug.Assert(length == 0); 465Debug.Assert(offset + ch1ch2Distance + Vector256<ushort>.Count <= source.Length); 531Debug.Assert(offset + ch1ch2Distance + Vector128<ushort>.Count <= source.Length);
src\libraries\System.Private.CoreLib\src\System\Globalization\Ordinal.Utf8.cs (10)
107Debug.Assert(lengthA >= Vector128<byte>.Count); 108Debug.Assert(lengthB >= Vector128<byte>.Count); 109Debug.Assert(Vector128.IsHardwareAccelerated); 275Debug.Assert(length == 1); 302Debug.Assert(length == 0); 417Debug.Assert(sourceLength >= Vector128<byte>.Count); 418Debug.Assert(prefixLength >= Vector128<byte>.Count); 419Debug.Assert(Vector128.IsHardwareAccelerated); 585Debug.Assert(length == 1); 616Debug.Assert(length == 0);
src\libraries\System.Private.CoreLib\src\System\Globalization\OrdinalCasing.Icu.cs (15)
158Debug.Assert(!GlobalizationMode.Invariant); 159Debug.Assert(!GlobalizationMode.UseNls); 188Debug.Assert(!GlobalizationMode.Invariant); 189Debug.Assert(!GlobalizationMode.UseNls); 260Debug.Assert(lowSurrogateA != '\0'); 261Debug.Assert(lowSurrogateB != '\0'); 290Debug.Assert(value.Length > 0); 291Debug.Assert(value.Length <= source.Length); 293Debug.Assert(!GlobalizationMode.Invariant); 294Debug.Assert(!GlobalizationMode.UseNls); 354Debug.Assert(value.Length > 0); 355Debug.Assert(value.Length <= source.Length); 357Debug.Assert(!GlobalizationMode.Invariant); 358Debug.Assert(!GlobalizationMode.UseNls); 431Debug.Assert(pageNumber >= 0 && pageNumber < 256);
src\libraries\System.Private.CoreLib\src\System\Globalization\PersianCalendar.cs (13)
126Debug.Assert(ordinalDay <= 366); 138Debug.Assert(1 <= month && month <= 12); 155Debug.Assert(y >= 1); 170Debug.Assert(ordinalDay >= 1); 171Debug.Assert(m >= 1 && m <= 12); 178Debug.Assert(1 <= d); 179Debug.Assert(d <= 31); 205Debug.Assert(year >= 1); 211Debug.Assert(ordinalDay >= 1); 212Debug.Assert(month >= 1 && month <= 12); 215Debug.Assert(1 <= day); 216Debug.Assert(day <= 31); 282Debug.Assert(daysInMonth == 30);
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); 55Debug.Assert(key2Data != null);
src\libraries\System.Private.CoreLib\src\System\Globalization\SurrogateCasing.cs (8)
15Debug.Assert(char.IsHighSurrogate(h)); 16Debug.Assert(char.IsLowSurrogate(l)); 20Debug.Assert(char.IsHighSurrogate(hr)); 21Debug.Assert(char.IsLowSurrogate(lr)); 27Debug.Assert(char.IsHighSurrogate(h)); 28Debug.Assert(char.IsLowSurrogate(l)); 32Debug.Assert(char.IsHighSurrogate(hr)); 33Debug.Assert(char.IsLowSurrogate(lr));
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 (12)
186Debug.Assert(!GlobalizationMode.Invariant); 213Debug.Assert(destination.Length >= source.Length); 220Debug.Assert(destination.Length >= source.Length); 227Debug.Assert(!GlobalizationMode.Invariant); 228Debug.Assert(typeof(TConversion) == typeof(ToUpperConversion) || typeof(TConversion) == typeof(ToLowerConversion)); 246Debug.Assert(operationStatus == OperationStatus.Done); 260Debug.Assert(typeof(TConversion) == typeof(ToUpperConversion) || typeof(TConversion) == typeof(ToLowerConversion)); 263Debug.Assert(!GlobalizationMode.Invariant); 264Debug.Assert(source != null); 475Debug.Assert(_isAsciiCasingSameAsInvariant == Tristate.True || _isAsciiCasingSameAsInvariant == Tristate.False); 630Debug.Assert(charLen == 1 || charLen == 2, "[TextInfo.AddNonLetter] CharUnicodeInfo.InternalGetUnicodeCategory returned an unexpected charLen!"); 646Debug.Assert(charLen == 1 || charLen == 2, "[TextInfo.AddTitlecaseLetter] CharUnicodeInfo.InternalGetUnicodeCategory returned an unexpected charLen!");
src\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.Icu.cs (3)
14Debug.Assert(localeName != null); 21Debug.Assert(!GlobalizationMode.Invariant); 22Debug.Assert(!GlobalizationMode.UseNls);
src\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.Nls.cs (8)
12Debug.Assert(!GlobalizationMode.Invariant); 13Debug.Assert(GlobalizationMode.UseNls); 14Debug.Assert(pSource != null); 15Debug.Assert(pResult != null); 16Debug.Assert(pSourceLen >= 0); 17Debug.Assert(pResultLen >= 0); 18Debug.Assert(pSourceLen <= pResultLen); 39Debug.Assert(ret == pSourceLen, "Expected getting the same length of the original string");
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanFormat.cs (26)
53Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 111Debug.Assert(format == StandardFormat.C || format == StandardFormat.G || format == StandardFormat.g); 127Debug.Assert(ticks == long.MinValue /* -9223372036854775808 */); 144Debug.Assert(fraction < 10_000_000); 152Debug.Assert(decimalSeparator.IsEmpty); 167Debug.Assert(format == StandardFormat.g); 182Debug.Assert(seconds < 60); 190Debug.Assert(minutes < 60); 194Debug.Assert(totalHoursRemaining <= uint.MaxValue); 201Debug.Assert(hours < 24); 216Debug.Assert(dayDigits <= 8); 251Debug.Assert(hourDigits == 1 || hourDigits == 2); 289Debug.Assert(p - dest == requiredOutputLength); 299Debug.Assert(dtfi != null); 522Debug.Assert(field >= 0 && field <= 5); 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"); 597Debug.Assert(field == 5); 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 (19)
109Debug.Assert(_ttt == TTT.Num); 110Debug.Assert(_num > -1); 146Debug.Assert(_zeroes > 0); // Already validated that in the condition _zeroes == 0 && _num > MaxFraction 155Debug.Assert(totalDigitsCount - MaxFractionDigits <= MaxFractionDigits); 159Debug.Assert(_num < MaxFraction); 187Debug.Assert(pos > -1); 407Debug.Assert(dtfi != null); 447Debug.Assert(_tokenCount == (_sepCount + _numCount), "tokenCount == (SepCount + NumCount)"); 540Debug.Assert(argumentName != null); 591Debug.Assert(powersOfTen.Length == MaxFractionDigits + 1); 631Debug.Assert(success, "Should have thrown on failure"); 653Debug.Assert(success, "Should have thrown on failure"); 675Debug.Assert(success, "Should have thrown on failure"); 719Debug.Assert(tokenizer.EOL); 774Debug.Assert(raw._numCount == 5); 844Debug.Assert(raw._numCount == 4); 970Debug.Assert(raw._numCount == 3); 1096Debug.Assert(raw._numCount == 2); 1165Debug.Assert(raw._numCount == 1);
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 (9)
272Debug.Assert(success, "GuidParseThrowStyle.All means throw on all failures"); 343Debug.Assert(success, "GuidParseThrowStyle.AllButOverflow means throw on all failures"); 352Debug.Assert(success, "GuidParseThrowStyle.AllButOverflow means throw on all failures"); 426Debug.Assert(success, "GuidParseThrowStyle.AllButOverflow means throw on all failures"); 819Debug.Assert(lookup.Length == 256); 922Debug.Assert(typeof(TChar) == typeof(byte)); 1239Debug.Assert(result && bytesWritten == guidString.Length, "Formatting guid should have succeeded."); 1433Debug.Assert(p == guidChars + charsWritten - ((byte)flags != 0 ? 1 : 0)); 1507Debug.Assert((Ssse3.IsSupported || AdvSimd.Arm64.IsSupported) && BitConverter.IsLittleEndian);
src\libraries\System.Private.CoreLib\src\System\Half.cs (2)
465Debug.Assert(IsNaN(other)); 1538Debug.Assert(IsSubnormal(x));
src\libraries\System.Private.CoreLib\src\System\HashCode.cs (4)
340Debug.Assert(Unsafe.ByteOffset(ref pos, ref end) >= sizeof(int)); 345Debug.Assert(Unsafe.ByteOffset(ref pos, ref end) >= sizeof(int)); 350Debug.Assert(Unsafe.ByteOffset(ref pos, ref end) >= sizeof(int)); 362Debug.Assert(Unsafe.ByteOffset(ref pos, ref blockEnd) >= (sizeof(int) * 4));
src\libraries\System.Private.CoreLib\src\System\Index.cs (1)
160Debug.Assert(formatted);
src\libraries\System.Private.CoreLib\src\System\Int128.cs (5)
526Debug.Assert(value >= -TwoPow127); 527Debug.Assert(double.IsFinite(value)); 528Debug.Assert(value < TwoPow127); 761Debug.Assert((sign == 0) || (sign == -1)); 843Debug.Assert((sign == 0) || (sign == -1));
src\libraries\System.Private.CoreLib\src\System\Int16.cs (2)
309Debug.Assert((sign == 0) || (sign == -1)); 384Debug.Assert((sign == 0) || (sign == -1));
src\libraries\System.Private.CoreLib\src\System\Int32.cs (2)
329Debug.Assert((sign == 0) || (sign == -1)); 411Debug.Assert((sign == 0) || (sign == -1));
src\libraries\System.Private.CoreLib\src\System\Int64.cs (2)
326Debug.Assert((sign == 0) || (sign == -1)); 408Debug.Assert((sign == 0) || (sign == -1));
src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (2)
331Debug.Assert((sign == 0) || (sign == -1)); 413Debug.Assert((sign == 0) || (sign == -1));
src\libraries\System.Private.CoreLib\src\System\IO\BinaryReader.cs (7)
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!"); 180Debug.Assert(charsRead > 0); 317Debug.Assert(!_disposed); 359Debug.Assert(_stream is MemoryStream); 474Debug.Assert(buffer.Length != 1, "length of 1 should use ReadByte."); 479Debug.Assert(_stream is MemoryStream);
src\libraries\System.Private.CoreLib\src\System\IO\BufferedStream.cs (79)
92Debug.Assert(_stream != null); 100Debug.Assert(_stream != null); 108Debug.Assert(_stream != null); 116Debug.Assert(_buffer != null); 117Debug.Assert(_bufferSize > 0); 132Debug.Assert(_bufferSize > 0); 199Debug.Assert(!(_writePos > 0 && _readPos != _readLen), "Read and Write buffers cannot both have data in them at the same time."); 270Debug.Assert(_writePos == 0 && _readPos == 0 && _readLen == 0); 292Debug.Assert(_writePos == 0 && (!_stream.CanSeek || (_readPos == 0 && _readLen == 0))); 315Debug.Assert(_stream != null); 323Debug.Assert(_writePos == 0 && _readPos == 0 && _readLen == 0); 344Debug.Assert(_writePos == 0 && (!_stream.CanSeek || (_readPos == 0 && _readLen == 0))); 353Debug.Assert(_writePos == 0 && _readPos == _readLen); 367Debug.Assert(_stream != null); 368Debug.Assert(_writePos == 0, "BufferedStream: Write buffer must be empty in FlushRead!"); 382Debug.Assert(_stream != null); 393Debug.Assert(_readPos < _readLen); 406Debug.Assert(_stream != null); 407Debug.Assert(_readPos == 0 && _readLen == 0, 409Debug.Assert(_buffer != null && _bufferSize >= _writePos, 419Debug.Assert(_stream != null); 420Debug.Assert(_readPos == 0 && _readLen == 0, 422Debug.Assert(_buffer != null && _bufferSize >= _writePos, 433Debug.Assert(readbytes >= 0); 449Debug.Assert(readbytes >= 0); 477Debug.Assert(_stream != null); 499Debug.Assert(_readLen == _readPos, "The read buffer must now be empty"); 532Debug.Assert(_stream != null); 549Debug.Assert(_readLen == _readPos, "The read buffer must now be empty"); 675Debug.Assert(_stream != null); 676Debug.Assert(_stream.CanRead); 677Debug.Assert(_bufferSize > 0); 678Debug.Assert(_asyncActiveSemaphore != null); 679Debug.Assert(semaphoreLockTask != null); 699Debug.Assert(_readLen == _readPos); 742Debug.Assert(_readPos == _readLen); 751Debug.Assert(_stream != null); 798Debug.Assert(_stream != null); 863Debug.Assert(_writePos < _bufferSize); 880Debug.Assert(count == 0); 884Debug.Assert(count >= 0); 885Debug.Assert(_writePos == _bufferSize); 886Debug.Assert(_buffer != null); 893Debug.Assert(count == 0); 894Debug.Assert(_writePos < _bufferSize); 901Debug.Assert(_buffer != null); 902Debug.Assert(totalUserbytes >= _bufferSize); 927Debug.Assert(_stream != null); 952Debug.Assert(bytesWritten == buffer.Length); 957Debug.Assert(_writePos == _bufferSize); 958Debug.Assert(_buffer != null); 966Debug.Assert(bytesWritten == buffer.Length); 968Debug.Assert(_writePos < _bufferSize); 975Debug.Assert(_buffer != null); 976Debug.Assert(totalUserbytes >= _bufferSize); 1028Debug.Assert(_writePos < _bufferSize); 1035Debug.Assert(bytesWritten == buffer.Length); 1058Debug.Assert(_stream != null); 1059Debug.Assert(_stream.CanWrite); 1060Debug.Assert(_bufferSize > 0); 1061Debug.Assert(_asyncActiveSemaphore != null); 1062Debug.Assert(semaphoreLockTask != null); 1090Debug.Assert(buffer.Length == 0); 1094Debug.Assert(buffer.Length >= 0); 1095Debug.Assert(_writePos == _bufferSize); 1096Debug.Assert(_buffer != null); 1102Debug.Assert(bytesWritten == buffer.Length); 1104Debug.Assert(_writePos < _bufferSize); 1112Debug.Assert(_buffer != null); 1113Debug.Assert(totalUserBytes >= _bufferSize); 1171Debug.Assert(_stream != null); 1178Debug.Assert(_writePos < _bufferSize); 1185Debug.Assert(_stream != null); 1206Debug.Assert(oldPos == _stream.Position + (_readPos - _readLen)); 1240Debug.Assert(_stream != null); 1251Debug.Assert(_stream != null); 1259Debug.Assert(_writePos == 0, "Write buffer must be empty if there's data in the read buffer"); 1286Debug.Assert(_stream != null); 1298Debug.Assert(_writePos == 0, "Write buffer must be empty if there's data in the read buffer");
src\libraries\System.Private.CoreLib\src\System\IO\Directory.Unix.cs (1)
55Debug.Assert(path[^1] == 0);
src\libraries\System.Private.CoreLib\src\System\IO\DirectoryInfo.cs (1)
191Debug.Assert(path != null);
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEntry.Unix.cs (1)
89Debug.Assert(charsWritten > 0, "didn't write any chars to buffer");
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (11)
106Debug.Assert(path != null, "File.Exists: GetFullPath returned null"); 935Debug.Assert(writer != null); 936Debug.Assert(contents != null); 1098Debug.Assert(!string.IsNullOrEmpty(path)); 1099Debug.Assert(encoding != null); 1244Debug.Assert(bytesRead < rentedArray.Length); 1306Debug.Assert(!string.IsNullOrEmpty(path)); 1307Debug.Assert(encoding != null); 1356Debug.Assert(writer != null); 1357Debug.Assert(contents != null); 1487Debug.Assert(bytesRead < buffer.Length);
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\FileStatus.Unix.cs (6)
42Debug.Assert(_state != Uninitialized); // Use this after EnsureCachesInitialized has been called. 53Debug.Assert(_state != Uninitialized); // Use this after EnsureCachesInitialized has been called. 136Debug.Assert(_state != Uninitialized); // Use this after EnsureCachesInitialized has been called. 195Debug.Assert(handle is not null || path.Length > 0); 500Debug.Assert(handle is not null || path.Length > 0); 522Debug.Assert(errorInfo.RawErrno > 0); // Expect a positive integer
src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.Unix.cs (7)
249Debug.Assert(directoryName != null); 285Debug.Assert(fullPath.Length > 0); 286Debug.Assert(PathInternal.IsDirectorySeparator(fullPath[0])); 333Debug.Assert(!PathInternal.IsDirectorySeparator(fullPath[i])); 400Debug.Assert(!isCaseSensitiveRename || !PathInternal.IsCaseSensitive); 472Debug.Assert(recursive); 713Debug.Assert(sb.Length > 0);
src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (4)
243Debug.Assert(_position + n >= 0); // len is less than 2^31 -1. 330Debug.Assert(_position + n >= 0); // len is less than 2^31 -1. 533Debug.Assert(_position >= _origin); 555Debug.Assert(MemStreamMaxLength == int.MaxValue); // Check parameter validation logic in this method if this fails.
src\libraries\System.Private.CoreLib\src\System\IO\Path.cs (10)
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"); 781Debug.Assert(fourth.Length == destination.Length); 797Debug.Assert(bytes != null); 798Debug.Assert(byteCount == 8, $"Unexpected {nameof(byteCount)}"); 799Debug.Assert(chars.Length == 12, $"Unexpected {nameof(chars)}.Length"); 829Debug.Assert((b2 & 0xF8) == 0, "Unexpected set bits"); 869Debug.Assert(comparisonType == StringComparison.Ordinal || comparisonType == StringComparison.OrdinalIgnoreCase);
src\libraries\System.Private.CoreLib\src\System\IO\Path.Unix.cs (4)
56Debug.Assert(!string.IsNullOrEmpty(path)); 57Debug.Assert(!path.Contains('\0')); 68Debug.Assert(collapsedString.Length < path.Length || collapsedString.ToString() == path, 120Debug.Assert(path[^1] == 0);
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (1)
101Debug.Assert(passwd.HomeDirectory != null);
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\ReadLinesIterator.cs (4)
36Debug.Assert(path != null); 37Debug.Assert(path.Length > 0); 38Debug.Assert(encoding != null); 39Debug.Assert(reader != null);
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs (36)
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!"); 254Debug.Assert(_readPos == _readLen); 301Debug.Assert(!_strategy.IsClosed, "FileStream ensures that strategy is not closed"); 302Debug.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), 352Debug.Assert(!_strategy.CanSeek); 380Debug.Assert(_writePos == 0, "Win32FileStream must not have buffered write data here! Pipes should be unidirectional."); 393Debug.Assert(_asyncActiveSemaphore != null); 394Debug.Assert(_strategy.CanSeek); 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."); 575Debug.Assert(_writePos <= _bufferSize); 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), 660Debug.Assert(!_strategy.CanSeek); 676Debug.Assert(_asyncActiveSemaphore != null); 677Debug.Assert(_strategy.CanSeek); 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), 780Debug.Assert(_writePos == 0 && (!_strategy.CanSeek || (_readPos == 0 && _readLen == 0))); 804Debug.Assert(_writePos == 0 && _readPos == 0 && _readLen == 0); 819Debug.Assert(_writePos == 0 && (!_strategy.CanSeek || (_readPos == 0 && _readLen == 0))); 824Debug.Assert(_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"); 917Debug.Assert(oldPos == _strategy.Position + (_readPos - _readLen)); 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!"); 987Debug.Assert(_readPos < _readLen); 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); 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 (17)
238Debug.Assert(thisTask != null && thisTask._stream != null, 428Debug.Assert(minimumBytes <= buffer.Length); 512Debug.Assert(thisTask != null && thisTask._stream != null, 550Debug.Assert(readWriteTask != null); 551Debug.Assert(asyncWaiter != null); 556Debug.Assert(asyncWaiter.IsCompletedSuccessfully, "The semaphore wait should always complete successfully."); 563Debug.Assert(t.IsCompletedSuccessfully, "The semaphore wait should always complete successfully."); 565Debug.Assert(rwt._stream != null, "Validates that this code isn't run a second time."); 573Debug.Assert(readWriteTask != null); 585Debug.Assert(_asyncActiveSemaphore != null, "Must have been initialized in order to get here."); 610Debug.Assert(writeTask.Status == TaskStatus.RanToCompletion); 659Debug.Assert(function != null); 660Debug.Assert(stream != null); 685Debug.Assert(completedTask is ReadWriteTask); 688Debug.Assert(callback != null); 704Debug.Assert(callback != null); 888Debug.Assert(minimumBytes <= buffer.Length);
src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (34)
99Debug.Assert(this is NullStreamReader); 461Debug.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?"); 470Debug.Assert(_byteLen >= 2, "Caller should've validated that at least 2 bytes were available."); 548Debug.Assert(_checkPreamble); 551Debug.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?"); 565Debug.Assert(_bytePos <= preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 596Debug.Assert(_bytePos <= _encoding.Preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 598Debug.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 610Debug.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?"); 612Debug.Assert(_byteLen >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 641Debug.Assert(_charPos == 0 && _charLen == 0, "We shouldn't be trying to decode more data if we made progress in an earlier iteration."); 651Debug.Assert(_charPos == 0 && _charLen == 0, "We shouldn't be looking for EOF unless we have an empty char buffer."); 696Debug.Assert(charsRead == 0); 700Debug.Assert(_bytePos <= _encoding.Preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 702Debug.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 714Debug.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?"); 716Debug.Assert(_byteLen >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 748Debug.Assert(charsRead == 0 && _charPos == 0 && _charLen == 0, "We shouldn't be trying to decode more data if we made progress in an earlier iteration."); 766Debug.Assert(charsRead == 0 && _charPos == 0 && _charLen == 0, "We shouldn't be looking for EOF unless we have an empty char buffer."); 811Debug.Assert(!charBufferSpan.IsEmpty, "ReadBuffer returned > 0 but didn't bump _charLen?"); 922Debug.Assert(charPos < charLen, "ReadBuffer returned > 0 but didn't bump _charLen?"); 1134Debug.Assert(n == 0); 1138Debug.Assert(_bytePos <= _encoding.Preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 1141Debug.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 1162Debug.Assert(n == 0); 1174Debug.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?"); 1178Debug.Assert(_byteLen >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 1210Debug.Assert(n == 0); 1333Debug.Assert(_bytePos <= _encoding.Preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 1336Debug.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 1348Debug.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?"); 1350Debug.Assert(_byteLen >= 0, "Stream.Read returned a negative number! Bug in stream class."); 1379Debug.Assert(_charPos == 0 && _charLen == 0, "We shouldn't be trying to decode more data if we made progress in an earlier iteration."); 1389Debug.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 (3)
165Debug.Assert(GetType() == typeof(NullStreamWriter)); 252Debug.Assert(GetType() == typeof(StreamWriter)); 790Debug.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\TextWriter.CreateBroadcasting.cs (1)
49Debug.Assert(writers is { Length: > 0 });
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryAccessor.cs (1)
465Debug.Assert(intsWritten == 4);
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStream.cs (3)
382Debug.Assert(pos + nInt >= 0, "_position + n >= 0"); // len is less than 2^63 -1. 435Debug.Assert(ex is not OperationCanceledException); 712Debug.Assert(ex is not OperationCanceledException);
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)
54Debug.Assert(loopCount > 0, "Shouldn't reach this code path for small inputs."); 99Debug.Assert(count >= 4, "Only should've gotten here if the original count was >= 4."); 112Debug.Assert(count >= 4, "Only should've gotten here if the original count was >= 4.");
src\libraries\System.Private.CoreLib\src\System\Marvin.OrdinalIgnoreCase.cs (4)
41Debug.Assert(ucount < 2); 77Debug.Assert(ucount <= int.MaxValue); // this should fit into a signed int 83Debug.Assert(count > 0); 89Debug.Assert(charsWritten == count); // invariant case conversion should involve simple folding; preserve code unit count
src\libraries\System.Private.CoreLib\src\System\Math.cs (1)
897Debug.Assert(double.IsSubnormal(x));
src\libraries\System.Private.CoreLib\src\System\MathF.cs (1)
212Debug.Assert(float.IsSubnormal(x));
src\libraries\System.Private.CoreLib\src\System\Memory.cs (7)
123Debug.Assert(manager != null); 147Debug.Assert(manager != null); 163Debug.Assert((obj == null) 302Debug.Assert(tmpObject is T[]); 315Debug.Assert(tmpObject is MemoryManager<T>); 408Debug.Assert(tmpObject is T[]); 427Debug.Assert(tmpObject is MemoryManager<T>);
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (11)
2156Debug.Assert(lowInclusive is null || highInclusive is null); 4967Debug.Assert(span.Length == other.Length); 5300Debug.Assert(startInclusive <= endExclusive); 5802Debug.Assert(index > 2); 5892Debug.Assert(treatAsSingleSeparator, "Should only ever be called as true; exists to differentiate from separators overload"); 6274Debug.Assert(alignment > value.Length); 6358Debug.Assert(_hasCustomFormatter); 6359Debug.Assert(_provider != null); 6362Debug.Assert(formatter != null, "An incorrectly written provider said it implemented ICustomFormatter, and then didn't"); 6377Debug.Assert(startingPos >= 0 && startingPos <= _pos); 6378Debug.Assert(alignment != 0);
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Globalization.cs (6)
64Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); 116Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); 147Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); 182Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); 316Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); 354Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase);
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Globalization.Utf8.cs (1)
58Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase);
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Trim.cs (3)
167Debug.Assert((uint)start <= span.Length); 499Debug.Assert((uint)start <= span.Length); 862Debug.Assert((uint)start <= span.Length);
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Trim.Utf8.cs (1)
20Debug.Assert(!Rune.IsWhiteSpace(Rune.ReplacementChar));
src\libraries\System.Private.CoreLib\src\System\Net\WebUtility.cs (6)
622Debug.Assert(_numBytes > 0); 663Debug.Assert(_numChars > 0); 678Debug.Assert(s_lookupTable[ToUInt64Key("quot")] == '\x0022'); 679Debug.Assert(s_lookupTable[ToUInt64Key("alpha")] == '\x03b1'); 680Debug.Assert(s_lookupTable[ToUInt64Key("diams")] == '\x2666'); 978Debug.Assert(entity.Length <= 8);
src\libraries\System.Private.CoreLib\src\System\Number.BigInteger.cs (26)
369Debug.Assert(carry == 1); 370Debug.Assert(resultIndex == resultLength); 371Debug.Assert(unchecked((uint)(resultLength)) < MaxBlockCount); 390Debug.Assert(unchecked((uint)(lhs._length)) <= MaxBlockCount); 391Debug.Assert(unchecked((uint)(rhs._length)) <= MaxBlockCount); 405Debug.Assert(rhsLength == 0); 451Debug.Assert(!rhs.IsZero()); 587Debug.Assert(carry == t + 1); 593Debug.Assert(carry == 1); 756Debug.Assert(unchecked((uint)(resultLength)) < MaxBlockCount); 805Debug.Assert(unchecked((uint)(maxResultLength)) <= MaxBlockCount); 863Debug.Assert(unchecked((uint)result._length) <= MaxBlockCount); 912Debug.Assert((Pow10BigNumTableIndices[^1] + MaxBlockCount + 2) == Pow10BigNumTable.Length); 954Debug.Assert(lhsLength >= 0); 955Debug.Assert(rhsLength >= 0); 956Debug.Assert(lhsLength >= rhsLength); 976Debug.Assert(q <= 0xFFFFFFFF); 1009Debug.Assert(lhsLength >= 0); 1010Debug.Assert(rhsLength >= 0); 1011Debug.Assert(lhsLength >= rhsLength); 1012Debug.Assert(q <= uint.MaxValue); 1064Debug.Assert(unchecked((uint)(length)) < MaxBlockCount); 1082Debug.Assert(index < _length); 1137Debug.Assert(unchecked((uint)(length)) < MaxBlockCount); 1226Debug.Assert(unchecked((uint)(length)) < MaxBlockCount); 1255Debug.Assert(unchecked((uint)(length)) < MaxBlockCount);
src\libraries\System.Private.CoreLib\src\System\Number.DiyFp.cs (5)
43Debug.Assert(TNumber.IsFinite(value)); 44Debug.Assert(value > TNumber.Zero); 92Debug.Assert(f != 0); 102Debug.Assert(e == other.e); 103Debug.Assert(f >= other.f);
src\libraries\System.Private.CoreLib\src\System\Number.Dragon4.cs (17)
18Debug.Assert(v > TNumber.Zero); 19Debug.Assert(TNumber.IsFinite(v)); 33Debug.Assert(mantissa != 0); 60Debug.Assert(buffer.Length > 0); 67Debug.Assert(mantissa != 0); 249Debug.Assert(cutoffNumber > 0); 255Debug.Assert(cutoffNumber >= 0); 273Debug.Assert(scale.GetLength() > 0); 282Debug.Assert(hiBlock != 0); 284Debug.Assert((hiBlockLog2 < 3) || (hiBlockLog2 > 27)); 304Debug.Assert(isSignificantDigits); 305Debug.Assert(digitExponent >= cutoffExponent); 314Debug.Assert(outputDigit < 10); 357Debug.Assert((cutoffNumber > 0) || ((cutoffNumber == 0) && !isSignificantDigits)); 367Debug.Assert(outputDigit < 10); 395Debug.Assert((0 < outputDigit) && (outputDigit < 10)); 478Debug.Assert(outputLen <= buffer.Length);
src\libraries\System.Private.CoreLib\src\System\Number.Formatting.cs (84)
326Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 507Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 512Debug.Assert(s is null || typeof(TChar) == typeof(char)); 530Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 584Debug.Assert(((precision != -1) && (precision < TNumber.MaxRoundTripDigits)) || (TNumber.FloatToBits(value) == TNumber.FloatToBits(NumberToFloat<TNumber>(ref number)))); 590Debug.Assert((fmt == 'G') || (fmt == 'g') || (fmt == 'R') || (fmt == 'r')); 604Debug.Assert(precision == TNumber.MaxPrecisionCustomFormat); 612Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 613Debug.Assert(source != null); 815Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 931Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1047Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1164Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1282Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1377Debug.Assert(value < 0); 1389Debug.Assert(p == buffer + sNegative.Length); 1395Debug.Assert(p == buffer); 1402Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1403Debug.Assert(value < 0); 1421Debug.Assert(p == buffer + sNegative.Length); 1427Debug.Assert(p == buffer); 1444Debug.Assert(p == buffer); 1451Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1469Debug.Assert(p == buffer); 1477Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1500Debug.Assert(p == buffer); 1507Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1525Debug.Assert(p == buffer); 1533Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1570Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1571Debug.Assert(value <= 99); 1586Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1587Debug.Assert(value <= 9999); 1615Debug.Assert(value < 10); 1616Debug.Assert(cur == ptr); 1623Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1652Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1686Debug.Assert(value < SmallNumberCacheLength); 1703Debug.Assert(p == buffer); 1719Debug.Assert(p == buffer); 1726Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1735Debug.Assert(p == buffer); 1746Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1759Debug.Assert(p == buffer); 1810Debug.Assert(value < 0); 1822Debug.Assert(p == buffer + sNegative.Length); 1828Debug.Assert(p == buffer); 1835Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1836Debug.Assert(value < 0); 1854Debug.Assert(p == buffer + sNegative.Length); 1860Debug.Assert(p == buffer); 1877Debug.Assert(p == buffer); 1884Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1902Debug.Assert(p == buffer); 1912Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1949Debug.Assert(p == buffer); 1956Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1974Debug.Assert(p == buffer); 1984Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2045Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2084Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2129Debug.Assert(p == buffer); 2147Debug.Assert(p == buffer); 2154Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2164Debug.Assert(p == buffer); 2186Debug.Assert(p == buffer); 2236Debug.Assert(Int128.IsNegative(value)); 2250Debug.Assert(p == buffer + sNegative.Length); 2256Debug.Assert(p == buffer); 2263Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2264Debug.Assert(Int128.IsNegative(value)); 2284Debug.Assert(p == buffer + sNegative.Length); 2290Debug.Assert(p == buffer); 2309Debug.Assert(p == buffer); 2316Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2336Debug.Assert(p == buffer); 2372Debug.Assert(p == buffer); 2379Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2399Debug.Assert(p == buffer); 2455Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2467Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2491Debug.Assert(p == buffer); 2509Debug.Assert(p == buffer); 2527Debug.Assert(p == buffer);
src\libraries\System.Private.CoreLib\src\System\Number.Grisu3.cs (39)
329Debug.Assert(v > TNumber.Zero); 330Debug.Assert(TNumber.IsFinite(v)); 349Debug.Assert((requestedDigits == -1) || (length == requestedDigits)); 364Debug.Assert(requestedDigits > 0); 371Debug.Assert(MinimalTargetExponent <= (w.e + tenMk.e + DiyFp.SignificandSize)); 372Debug.Assert(MaximalTargetExponent >= (w.e + tenMk.e + DiyFp.SignificandSize)); 416Debug.Assert(boundaryPlus.e == w.e); 423Debug.Assert(MinimalTargetExponent <= (w.e + tenMk.e + DiyFp.SignificandSize)); 424Debug.Assert(MaximalTargetExponent >= (w.e + tenMk.e + DiyFp.SignificandSize)); 437Debug.Assert(scaledW.e == (boundaryPlus.e + tenMk.e + DiyFp.SignificandSize)); 472Debug.Assert(number < (1U << (numberBits + 1))); 476Debug.Assert((uint)(exponentGuess) < SmallPowersOfTen.Length); 515Debug.Assert(MinimalTargetExponent <= w.e); 516Debug.Assert(w.e <= MaximalTargetExponent); 517Debug.Assert(MinimalTargetExponent >= -60); 518Debug.Assert(MaximalTargetExponent <= -32); 544Debug.Assert(buffer[0] == '\0'); 562Debug.Assert(digit <= 9); 598Debug.Assert(one.e >= MinimalTargetExponent); 599Debug.Assert(fractionals < one.f); 600Debug.Assert((ulong.MaxValue / 10) >= one.f); 609Debug.Assert(digit <= 9); 684Debug.Assert(low.e == w.e); 685Debug.Assert(w.e == high.e); 687Debug.Assert((low.f + 1) <= (high.f - 1)); 689Debug.Assert(MinimalTargetExponent <= w.e); 690Debug.Assert(w.e <= MaximalTargetExponent); 741Debug.Assert(digit <= 9); 780Debug.Assert(one.e >= MinimalTargetExponent); 781Debug.Assert(fractionals < one.f); 782Debug.Assert((ulong.MaxValue / 10) >= one.f); 793Debug.Assert(digit <= 9); 820Debug.Assert(CachedPowersSignificand.Length == CachedPowersBinaryExponent.Length); 821Debug.Assert(CachedPowersSignificand.Length == CachedPowersDecimalExponent.Length); 826Debug.Assert((uint)(index) < CachedPowersSignificand.Length); 828Debug.Assert(minExponent <= CachedPowersBinaryExponent[index]); 829Debug.Assert(CachedPowersBinaryExponent[index] <= maxExponent); 849Debug.Assert(rest < tenKappa); 995Debug.Assert(rest <= unsafeInterval);
src\libraries\System.Private.CoreLib\src\System\Number.NumberToFloatingPointBits.cs (11)
829Debug.Assert((TFloat.DenormalMantissaMask & (1UL << TFloat.DenormalMantissaBits)) == 0); 831Debug.Assert((shiftedExponent & TFloat.DenormalMantissaMask) == 0); 832Debug.Assert((mantissa & ~TFloat.DenormalMantissaMask) == 0); 833Debug.Assert((shiftedExponent & ~(((1UL << TFloat.ExponentBits) - 1) << TFloat.DenormalMantissaBits)) == 0); // exponent fits in its place 895Debug.Assert((1 <= count) && (count <= 9)); 919Debug.Assert((1 <= count) && (count <= 19)); 975Debug.Assert(TFloat.DenormalMantissaBits <= FloatingPointMaxDenormalMantissaBits); 977Debug.Assert(number.DigitsPtr[0] != '0'); 979Debug.Assert(number.Scale <= FloatingPointMaxExponent); 980Debug.Assert(number.Scale >= FloatingPointMinExponent); 982Debug.Assert(number.DigitsCount != 0);
src\libraries\System.Private.CoreLib\src\System\Number.Parsing.cs (6)
130Debug.Assert(p != null); 238Debug.Assert((styles & ~NumberStyles.Integer) == 0, "Only handles subsets of Integer format"); 821Debug.Assert((c == 0) || !hasZeroTail); 904Debug.Assert(typeof(TChar) == typeof(byte)); 922Debug.Assert(typeof(TChar) == typeof(byte)); 940Debug.Assert(typeof(TChar) == typeof(byte));
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector.cs (10)
410Debug.Assert(Vector<double>.Count == Vector128<double>.Count); 433Debug.Assert(Vector<double>.Count == Vector128<double>.Count); 541Debug.Assert(Vector<float>.Count == Vector128<float>.Count); 708Debug.Assert(Vector<T>.Count == Vector128<T>.Count); 1365Debug.Assert(Vector<T>.Count == Vector128<T>.Count); 1611Debug.Assert(Vector<T>.Count == Vector128<T>.Count); 2662Debug.Assert(Vector<uint>.Count == Vector128<uint>.Count); 2688Debug.Assert(Vector<ulong>.Count == Vector128<ulong>.Count); 3488Debug.Assert((index >= 0) && (index < Vector<T>.Count)); 3496Debug.Assert((index >= 0) && (index < Vector<T>.Count));
src\libraries\System.Private.CoreLib\src\System\ParseNumbers.cs (2)
242Debug.Assert(radix == 2 || radix == 8 || radix == 10 || radix == 16); 301Debug.Assert(radix == 2 || radix == 8 || radix == 10 || radix == 16);
src\libraries\System.Private.CoreLib\src\System\Progress.cs (1)
35Debug.Assert(_synchronizationContext != null);
src\libraries\System.Private.CoreLib\src\System\Random.CompatImpl.cs (4)
83Debug.Assert(minValue == maxValue || minValue + 1 == maxValue); 206Debug.Assert(minValue == maxValue || minValue + 1 == maxValue); 275Debug.Assert(_seedArray is null); 340Debug.Assert(_seedArray is not null);
src\libraries\System.Private.CoreLib\src\System\Random.cs (1)
50Debug.Assert(isThreadSafeRandom);
src\libraries\System.Private.CoreLib\src\System\Random.Xoshiro256StarStarImpl.cs (5)
93Debug.Assert(maxValue >= 0); 100Debug.Assert(minValue <= maxValue); 122Debug.Assert(maxValue >= 0); 129Debug.Assert(minValue <= maxValue); 160Debug.Assert(buffer.Length < sizeof(ulong));
src\libraries\System.Private.CoreLib\src\System\Range.cs (2)
79Debug.Assert(formatted); 90Debug.Assert(formatted);
src\libraries\System.Private.CoreLib\src\System\ReadOnlyMemory.cs (5)
98Debug.Assert((obj == null) 224Debug.Assert(tmpObject is T[]); 237Debug.Assert(tmpObject is MemoryManager<T>); 323Debug.Assert(tmpObject is T[]); 342Debug.Assert(tmpObject is MemoryManager<T>);
src\libraries\System.Private.CoreLib\src\System\ReadOnlySpan.cs (1)
127Debug.Assert(length >= 0);
src\libraries\System.Private.CoreLib\src\System\Reflection\AssemblyName.cs (3)
340Debug.Assert(stringToEscape.EnumerateRunes() is { } e && e.MoveNext() && e.Current == r); 341Debug.Assert(charsConsumed is 1 or 2); 365Debug.Assert(charsToCopy > 0);
src\libraries\System.Private.CoreLib\src\System\Reflection\ConstructorInvoker.cs (3)
245Debug.Assert(_argCount <= MaxStackAllocArgCount); 397Debug.Assert(copyOfParameters[i] != null); 398Debug.Assert(((RuntimeType)copyOfParameters[i]!.GetType()).IsNullableOfT);
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\Emit\TypeNameBuilder.cs (6)
37Debug.Assert(_instNesting != 0); 53Debug.Assert(_instNesting != 0); 69Debug.Assert(_instNesting != 0); 81Debug.Assert(name != null); 93Debug.Assert(rank > 0); 134Debug.Assert(_instNesting == 0);
src\libraries\System.Private.CoreLib\src\System\Reflection\FieldAccessor.cs (11)
21Debug.Assert(_fieldInfo.m_declaringType != null); 130Debug.Assert(obj != null); 139Debug.Assert(obj != null); 146Debug.Assert(obj != null); 221Debug.Assert(obj != null); 229Debug.Assert(obj != null); 237Debug.Assert(obj != null); 245Debug.Assert(obj != null); 253Debug.Assert(obj != null); 350Debug.Assert(!IsStatic()); 384Debug.Assert(IsStatic());
src\libraries\System.Private.CoreLib\src\System\Reflection\InvokerEmitUtil.cs (5)
21Debug.Assert(!method.ContainsGenericParameters); 88Debug.Assert(!method.ContainsGenericParameters); 145Debug.Assert(!method.ContainsGenericParameters); 203Debug.Assert(parameterType.IsValueType); 254Debug.Assert(method is DynamicMethod);
src\libraries\System.Private.CoreLib\src\System\Reflection\InvokeUtils.cs (4)
107Debug.Assert(dstObject != null); 108Debug.Assert(dstObject.GetType() == dstType); 121Debug.Assert(srcObject is not Pointer); 265Debug.Assert(destElType == CorElementType.ELEMENT_TYPE_R8);
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs (9)
48Debug.Assert(_argCount == 0); 72Debug.Assert(_argCount == 1); 118Debug.Assert(_argCount <= MaxStackAllocArgCount); 155Debug.Assert(_argCount <= MaxStackAllocArgCount); 189Debug.Assert(_argCount > MaxStackAllocArgCount); 289Debug.Assert(_argCount == 1); 332Debug.Assert(copyOfParameters[i] != null); 333Debug.Assert(((RuntimeType)copyOfParameters[i]!.GetType()).IsNullableOfT); 399Debug.Assert(!sigElementType.IsNullableOfT, "A true boxed Nullable<T> should never be here.");
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInvoker.cs (4)
292Debug.Assert(_method is RuntimeConstructorInfo); 298Debug.Assert(_argCount <= MaxStackAllocArgCount); 450Debug.Assert(copyOfParameters[i] != null); 451Debug.Assert(((RuntimeType)copyOfParameters[i]!.GetType()).IsNullableOfT);
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInvokerCommon.cs (1)
90Debug.Assert(!method.IsStatic);
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedFunctionPointerType.cs (1)
21Debug.Assert(unmodifiedType.IsFunctionPointer);
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedGenericType.cs (1)
16Debug.Assert(unmodifiedType.IsGenericType);
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedHasElementType.cs (1)
19Debug.Assert(unmodifiedType.HasElementType);
src\libraries\System.Private.CoreLib\src\System\Reflection\NullabilityInfoContext.cs (2)
485Debug.Assert(genericParameter.IsGenericParameter); 523Debug.Assert(genericParameter.IsGenericParameter &&
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureArrayType.cs (2)
13Debug.Assert(rank > 0); 14Debug.Assert(rank == 1 || isMultiDim);
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureConstructedGenericType.cs (3)
15Debug.Assert(genericTypeDefinition != null); 16Debug.Assert(typeArguments != null); 17Debug.Assert(genericTypeDefinition.IsGenericTypeDefinition);
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureGenericParameterType.cs (1)
12Debug.Assert(position >= 0);
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureHasElementType.cs (1)
12Debug.Assert(elementType != 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\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 (22)
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"); 112Debug.Assert(_mediator.NeutralResourcesCulture != null); 128Debug.Assert(a != null, "assembly != null"); 168Debug.Assert(store != null, "I need a Stream!"); 208Debug.Assert(_mediator.MainAssembly != null); 225Debug.Assert(readerTypeName != null, "Reader Type name should be set"); 226Debug.Assert(resSetTypeName != null, "ResourceSet Type name should be set"); 300Debug.Assert(resSetTypeName != null, "We should have a ResourceSet type name from the custom resource file here."); 315Debug.Assert(satellite != null, "satellite shouldn't be null; check caller"); 316Debug.Assert(fileName != null, "fileName shouldn't be null; check caller"); 328Debug.Assert(satellite != null, "satellite shouldn't be null; check caller"); 329Debug.Assert(name != null, "name shouldn't be null; check caller"); 357Debug.Assert(_mediator.MainAssembly != null); 392Debug.Assert(readerTypeName != null, "readerTypeName shouldn't be null; check caller"); 393Debug.Assert(resSetTypeName != null, "resSetTypeName shouldn't be null; check caller"); 419Debug.Assert(_mediator.MainAssembly != null); 427Debug.Assert(_mediator.NeutralResourcesCulture != null); 462Debug.Assert(_mediator.BaseName != null); 473Debug.Assert(_mediator.MainAssembly != null);
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceManager.cs (7)
252Debug.Assert(MainAssembly != null); 289Debug.Assert(_resourceSets != null); 410Debug.Assert(MainAssembly != null); 415Debug.Assert(localResourceSets != null); 430Debug.Assert(culture != null); 431Debug.Assert(_resourceSets != null); 556Debug.Assert(asmTypeName != null, "asmTypeName was unexpectedly null");
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.Core.cs (6)
29Debug.Assert(stream != null, "Need a stream!"); 30Debug.Assert(stream.CanRead, "Stream should be readable!"); 31Debug.Assert(resCache != null, "Need a Dictionary!"); 65Debug.Assert(_binaryFormatter is not null, "BinaryFormatter should be initialized or we should have thrown an exception!"); 163Debug.Assert(index >= 0 && index < _numResources, "Couldn't find data position within sorted data positions array!"); 166Debug.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 (30)
46Debug.Assert(value >= 0, "negative ResourceTypeCode. What?"); 199Debug.Assert(_nameHashes != null && _nameHashesPtr == null, "Internal state mangled."); 204Debug.Assert(_nameHashes == null && _nameHashesPtr != null, "Internal state mangled."); 215Debug.Assert(_namePositions != null && _namePositionsPtr == null, "Internal state mangled."); 220Debug.Assert(_namePositions == null && _namePositionsPtr != null, "Internal state mangled."); 256Debug.Assert(_store != null, "ResourceReader is closed!"); 337Debug.Assert(_store != null, "ResourceReader is closed!"); 338Debug.Assert(Monitor.IsEntered(this)); // uses _store 380Debug.Assert(_store != null, "ResourceReader is closed!"); 451Debug.Assert(_store != null, "ResourceReader is closed!"); 475Debug.Assert(_store != null, "ResourceReader is closed!"); 537Debug.Assert(_store != null, "ResourceReader is closed!"); 538Debug.Assert(_version == 1, ".resources file was not a V1 .resources file!"); 539Debug.Assert(Monitor.IsEntered(this)); // uses _store 559Debug.Assert(Monitor.IsEntered(this)); // uses _store 619Debug.Assert(_store != null, "ResourceReader is closed!"); 620Debug.Assert(_version >= 2, ".resources file was not a V2 (or higher) .resources file!"); 621Debug.Assert(Monitor.IsEntered(this)); // uses _store 641Debug.Assert(Monitor.IsEntered(this)); // uses _store 727Debug.Assert(r == len, "ResourceReader needs to use a blocking read here. (Call _store.ReadBytes(len)?)"); 779Debug.Assert(!Monitor.IsEntered(this)); // only called during init 780Debug.Assert(_store != null, "ResourceReader is closed!"); 802Debug.Assert(!Monitor.IsEntered(this)); // only called during init 991Debug.Assert(Monitor.IsEntered(this)); // uses _store 999Debug.Assert(_typeTable[typeIndex] != null, "Should have found a type!"); 1030Debug.Assert(typeCode >= 0, "can't be negative"); 1031Debug.Assert(Monitor.IsEntered(this)); // uses _store 1035Debug.Assert(!string.Equals(typeCode.ToString(), "LastPrimitive"), "Change ResourceTypeCode metadata order so LastPrimitive isn't what Enum.ToString prefers."); 1041Debug.Assert(typeIndex >= 0 && typeIndex < _typeTable.Length, "TypeCode is broken or corrupted!"); 1115Debug.Assert(!Monitor.IsEntered(_reader));
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceSet.cs (2)
189Debug.Assert(_table != null); 190Debug.Assert(Reader != null);
src\libraries\System.Private.CoreLib\src\System\Resources\RuntimeResourceSet.cs (1)
281Debug.Assert(!Monitor.IsEntered(reader));
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncMethodBuilderCore.cs (4)
91Debug.Assert(stateMachine != null); 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\AsyncTaskMethodBuilder.cs (1)
86Debug.Assert(m_task == null);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilderT.cs (8)
290Debug.Assert(s is AsyncStateMachineBox<TStateMachine>); 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."); 354Debug.Assert(!IsCompleted); 365Debug.Assert(StateMachine != null); 395Debug.Assert(IsCompleted); 442Debug.Assert(m_task == null); 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\CastCache.cs (4)
39Debug.Assert(BitOperations.PopCount((uint)initialCacheSize) == 1 && initialCacheSize > 1); 40Debug.Assert(BitOperations.PopCount((uint)maxCacheSize) == 1 && maxCacheSize >= initialCacheSize); 217Debug.Assert(size > 1); 219Debug.Assert((size & (size - 1)) == 0);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConditionalWeakTable.cs (24)
399Debug.Assert(table != null, "Must provide a valid table"); 400Debug.Assert(Monitor.IsEntered(table._lock), "Must hold the _lock lock to construct the enumerator"); 401Debug.Assert(table._container != null, "Should not be used on a finalized table"); 402Debug.Assert(table._container.FirstFreeEntry > 0, "Should have returned an empty enumerator instead"); 406Debug.Assert(table._activeEnumeratorRefCount >= 0, "Should never have a negative ref count before incrementing"); 433Debug.Assert(table._activeEnumeratorRefCount >= 0, "Should never have a negative ref count after decrementing"); 500Debug.Assert(Monitor.IsEntered(_lock)); 501Debug.Assert(key != null); // key already validated as non-null and not already in table. 568Debug.Assert(parent != null); 569Debug.Assert(BitOperations.IsPow2(InitialCapacity)); 588Debug.Assert(parent != null); 589Debug.Assert(buckets != null); 590Debug.Assert(entries != null); 591Debug.Assert(buckets.Length == entries.Length); 592Debug.Assert(BitOperations.IsPow2(buckets.Length)); 607Debug.Assert(key != null); // key already validated as non-null and not already in table. 608Debug.Assert(HasCapacity); 631Debug.Assert(key != null); // Key already validated as non-null 645Debug.Assert(key != null); // Key already validated as non-null. 724Debug.Assert(entryIndex >= 0 && entryIndex < _firstFreeEntry); 739Debug.Assert(entryIndex != -1); 755Debug.Assert(!HasCapacity); 796Debug.Assert(newSize >= _buckets.Length); 797Debug.Assert(BitOperations.IsPow2(newSize));
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConfiguredValueTaskAwaitable.cs (6)
55Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 77Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 97Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 160Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 182Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 202Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\DefaultInterpolatedStringHandler.cs (8)
525Debug.Assert(provider is not null); 526Debug.Assert(provider is not CultureInfo || provider.GetFormat(typeof(ICustomFormatter)) is null, "Expected CultureInfo to not provide a custom formatter"); 543Debug.Assert(_hasCustomFormatter); 544Debug.Assert(_provider != null); 547Debug.Assert(formatter != null, "An incorrectly written provider said it implemented ICustomFormatter, and then didn't"); 560Debug.Assert(startingPos >= 0 && startingPos <= _pos); 561Debug.Assert(alignment != 0); 629Debug.Assert(additionalChars > _chars.Length - _pos);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\GenericCache.cs (4)
77Debug.Assert(BitOperations.PopCount((uint)initialCacheSize) == 1 && initialCacheSize > 1); 78Debug.Assert(BitOperations.PopCount((uint)maxCacheSize) == 1 && maxCacheSize >= initialCacheSize); 202Debug.Assert(size > 1); 204Debug.Assert((size & (size - 1)) == 0);
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\RuntimeHelpers.cs (1)
138Debug.Assert(srcET.IsPrimitiveType() && dstET.IsPrimitiveType());
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs (13)
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."); 195Debug.Assert(stateMachineBox != null); 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."); 395Debug.Assert((options & ~(ConfigureAwaitOptions.ContinueOnCapturedContext | ConfigureAwaitOptions.SuppressThrowing | ConfigureAwaitOptions.ForceYielding)) == 0); 476Debug.Assert(task != null, "Constructing an awaiter requires a task to await."); 477Debug.Assert((options & ~(ConfigureAwaitOptions.ContinueOnCapturedContext | ConfigureAwaitOptions.ForceYielding)) == 0);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\Unsafe.cs (2)
951Debug.Assert(nuint.IsPow2(alignment)); 963Debug.Assert(nuint.IsPow2(alignment));
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ValueTaskAwaiter.cs (6)
50Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 70Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 89Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 132Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 152Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 171Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\YieldAwaitable.cs (1)
117Debug.Assert(box != null);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\CollectionsMarshal.cs (2)
30Debug.Assert(items is not null, "Implementation depends on List<T> always having an array."); 38Debug.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\ComWrappers.cs (11)
242Debug.Assert(GetComCount(RefCount) != 0); 261Debug.Assert(GetTrackerCount(RefCount) != 0); 310Debug.Assert(Holder is not null); 352Debug.Assert(GetComCount(RefCount) == 0 || HolderHandle == IntPtr.Zero); 674Debug.Assert(flags.HasFlag(CreateObjectFlags.TrackerObject)); 675Debug.Assert(trackerObject != IntPtr.Zero); 1252Debug.Assert(wrapper.ProxyHandle.Target == comProxy); 1253Debug.Assert(wrapper.IsUniqueInstance || _rcwCache.FindProxyForComInstance(wrapper.ExternalComObject) == comProxy); 1262Debug.Assert(registeredWrapper.ExternalComObject != wrapper.ExternalComObject); 1299Debug.Assert(wrapper.ProxyHandle.Target == comProxy); 1309Debug.Assert(rcwEntry.IsAllocated);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\GCHandle.cs (1)
141Debug.Assert(target is Array);
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\InteropServices\Marshalling\BStrStringMarshaller.cs (1)
96Debug.Assert(lengthInBytes == Marshal.SysStringByteLen((IntPtr)ptrToFirstChar));
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ComVariant.cs (3)
29Debug.Assert(variantSize == (4 * IntPtr.Size)); 33Debug.Assert(IntPtr.Size == 8); 34Debug.Assert(variantSize == (3 * IntPtr.Size));
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\MemoryMarshal.cs (4)
298Debug.Assert(obj is MemoryManager<T>); 359Debug.Assert(length >= 0); 448Debug.Assert(offset >= 0); 449Debug.Assert(count >= 0);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\PosixSignalRegistration.Unix.cs (1)
96Debug.Assert(tokens.Length != 0);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\RuntimeInformation.Unix.cs (1)
46Debug.Assert(osArch >= 0);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\SafeHandle.cs (4)
121Debug.Assert(_fullyInitialized); 127Debug.Assert(_fullyInitialized); 160Debug.Assert(_fullyInitialized); 198Debug.Assert(_fullyInitialized || disposeOrFinalizeOperation);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\TrackerObjectManager.cs (2)
19Debug.Assert(referenceTracker != IntPtr.Zero); 42Debug.Assert(referenceTracker != IntPtr.Zero);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\TypeMapLazyDictionary.cs (9)
34Debug.Assert(_currAssembly != null); 124Debug.Assert(context != null); 125Debug.Assert(arg != null); 126Debug.Assert(arg->Utf8String1 != null); 127Debug.Assert(arg->Utf8String2 != null); 151Debug.Assert(context != null); 152Debug.Assert(arg != null); 153Debug.Assert(arg->Utf8String1 != null); 154Debug.Assert(arg->Utf8String2 != null);
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.cs (2)
4374Debug.Assert((index >= 0) && (index < Vector128<T>.Count)); 4382Debug.Assert((index >= 0) && (index < Vector128<T>.Count));
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.Numerics.cs (2)
138Debug.Assert(Vector<T>.Count >= Vector128<T>.Count); 217Debug.Assert(Vector<T>.Count >= Vector128<T>.Count);
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector256.cs (2)
4336Debug.Assert((index >= 0) && (index < Vector256<T>.Count)); 4344Debug.Assert((index >= 0) && (index < Vector256<T>.Count));
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector512.cs (4)
290Debug.Assert(Vector512<T>.Count >= Vector<T>.Count); 307Debug.Assert(Vector512<T>.Count >= Vector<T>.Count); 4313Debug.Assert((index >= 0) && (index < Vector512<T>.Count)); 4321Debug.Assert((index >= 0) && (index < Vector512<T>.Count));
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector64.cs (2)
4270Debug.Assert((index >= 0) && (index < Vector64<T>.Count)); 4278Debug.Assert((index >= 0) && (index < Vector64<T>.Count));
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\VectorMath.cs (25)
317Debug.Assert((typeof(T) != typeof(byte)) 670Debug.Assert(TVectorDouble.GreaterThanOrEqualAll(ax, ay)); 1567Debug.Assert((typeof(T) == typeof(sbyte)) 1654Debug.Assert((typeof(T) == typeof(sbyte)) 2590Debug.Assert(typeof(TVectorSingle) == typeof(Vector64<float>)); 2604Debug.Assert(typeof(TVectorSingle) == typeof(Vector128<float>)); 2618Debug.Assert(typeof(TVectorSingle) == typeof(Vector256<float>)); 2647Debug.Assert(typeof(TVectorSingle) == typeof(Vector<float>)); 2652Debug.Assert(typeof(TVectorSingle) == typeof(Vector64<float>)); 2657Debug.Assert(typeof(TVectorSingle) == typeof(Vector128<float>)); 2662Debug.Assert(typeof(TVectorSingle) == typeof(Vector256<float>)); 2667Debug.Assert(typeof(TVectorSingle) == typeof(Vector512<float>)); 2903Debug.Assert(typeof(TVectorDouble) == typeof(Vector128<double>)); 2921Debug.Assert(typeof(TVectorDouble) == typeof(Vector256<double>)); 2939Debug.Assert(typeof(TVectorDouble) == typeof(Vector512<double>)); 2972Debug.Assert(typeof(TVectorDouble) == typeof(Vector<double>)); 2977Debug.Assert(typeof(TVectorDouble) == typeof(Vector64<double>)); 2982Debug.Assert(typeof(TVectorDouble) == typeof(Vector128<double>)); 2987Debug.Assert(typeof(TVectorDouble) == typeof(Vector256<double>)); 2992Debug.Assert(typeof(TVectorDouble) == typeof(Vector512<double>)); 3012Debug.Assert(typeof(TVectorDouble) == typeof(Vector<double>)); 3017Debug.Assert(typeof(TVectorDouble) == typeof(Vector64<double>)); 3022Debug.Assert(typeof(TVectorDouble) == typeof(Vector128<double>)); 3027Debug.Assert(typeof(TVectorDouble) == typeof(Vector256<double>)); 3032Debug.Assert(typeof(TVectorDouble) == typeof(Vector512<double>));
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (4)
121Debug.Assert(IsCollectible); 123Debug.Assert(_state != InternalState.Unloading); 279Debug.Assert(allContexts != null, "Creating the default context should have initialized the contexts collection."); 749Debug.Assert(assemblyName.CultureName?.Length > 0);
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\SerializationInfo.SerializationGuard.cs (1)
46Debug.Assert(!string.IsNullOrWhiteSpace(switchSuffix));
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\FrameworkName.cs (4)
26Debug.Assert(_identifier != null); 35Debug.Assert(_version != null); 44Debug.Assert(_profile != null); 57Debug.Assert(_fullName != null);
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\RuntimeType.cs (16)
437Debug.Assert(IsSetField); 457Debug.Assert(flds != null); 545Debug.Assert(!IsSetField); 552Debug.Assert(isSetProperty); 554Debug.Assert(!IsGetField); 579Debug.Assert(semiFinalist != null); 597Debug.Assert(results.Count > 1); 602Debug.Assert(finalists == null || finalist != null); 649Debug.Assert(results.Count > 1); 797Debug.Assert(!IsGenericParameter); 841Debug.Assert(!IsGenericParameter); 865Debug.Assert(value != null); 907Debug.Assert(type.IsValueType); 908Debug.Assert(!type.IsByRefLike); 913Debug.Assert(type.IsEquivalentTo(value.GetType())); 932Debug.Assert(!sigElementType.IsGenericParameter);
src\libraries\System.Private.CoreLib\src\System\SByte.cs (2)
312Debug.Assert((sign == 0) || (sign == -1)); 365Debug.Assert((sign == 0) || (sign == -1));
src\libraries\System.Private.CoreLib\src\System\SearchValues\Any1CharPackedIgnoreCaseSearchValues.cs (1)
20Debug.Assert((value | 0x20) == value);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Any1SearchValues.cs (2)
19Debug.Assert(sizeof(T) == sizeof(TImpl)); 20Debug.Assert(values.Length == 1);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Any2CharPackedIgnoreCaseSearchValues.cs (2)
23Debug.Assert((value0 | 0x20) == value0 && char.IsAscii(value0)); 24Debug.Assert((value1 | 0x20) == value1 && char.IsAscii(value1));
src\libraries\System.Private.CoreLib\src\System\SearchValues\Any2SearchValues.cs (2)
19Debug.Assert(sizeof(T) == sizeof(TImpl)); 20Debug.Assert(values.Length == 2);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Any3SearchValues.cs (2)
19Debug.Assert(sizeof(T) == sizeof(TImpl)); 20Debug.Assert(values.Length == 3);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Any4SearchValues.cs (2)
19Debug.Assert(sizeof(T) == sizeof(TImpl)); 20Debug.Assert(values.Length == 4);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Any5SearchValues.cs (2)
19Debug.Assert(sizeof(T) == sizeof(TImpl)); 20Debug.Assert(values.Length == 5);
src\libraries\System.Private.CoreLib\src\System\SearchValues\AsciiByteSearchValues.cs (1)
23Debug.Assert(Ascii.IsValid(values) || (AdvSimd.IsSupported && TUniqueLowNibble.Value));
src\libraries\System.Private.CoreLib\src\System\SearchValues\AsciiCharSearchValues.cs (1)
24Debug.Assert(Ascii.IsValid(values) || (AdvSimd.IsSupported && TUniqueLowNibble.Value));
src\libraries\System.Private.CoreLib\src\System\SearchValues\BitmapCharSearchValues.cs (1)
17Debug.Assert(maxInclusive <= char.MaxValue);
src\libraries\System.Private.CoreLib\src\System\SearchValues\BitVector256.cs (2)
28Debug.Assert(c < 256); 45Debug.Assert(b < 256);
src\libraries\System.Private.CoreLib\src\System\SearchValues\IndexOfAnyAsciiSearcher.cs (18)
38Debug.Assert((uint)value <= 127); 76Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(char)); 101Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(char)); 143Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(char)); 211Debug.Assert(searchSpaceLength >= Vector128<short>.Count); 238Debug.Assert(searchSpaceLength >= Vector128<short>.Count); 345Debug.Assert(searchSpaceLength >= Vector256<short>.Count, "We expect that the input is long enough for us to load a whole vector."); 398Debug.Assert(searchSpaceLength >= Vector128<short>.Count, "We expect that the input is long enough for us to load a whole vector."); 477Debug.Assert(searchSpaceLength >= Vector256<short>.Count, "We expect that the input is long enough for us to load a whole vector."); 528Debug.Assert(searchSpaceLength >= Vector128<short>.Count, "We expect that the input is long enough for us to load a whole vector."); 627Debug.Assert(searchSpaceLength >= Vector128<byte>.Count, "We expect that the input is long enough for us to load a Vector128."); 676Debug.Assert(searchSpaceLength >= sizeof(ulong), "We expect that the input is long enough for us to load a ulong."); 752Debug.Assert(searchSpaceLength >= Vector128<byte>.Count, "We expect that the input is long enough for us to load a Vector128."); 801Debug.Assert(searchSpaceLength >= sizeof(ulong), "We expect that the input is long enough for us to load a ulong."); 899Debug.Assert(searchSpaceLength >= Vector128<byte>.Count, "We expect that the input is long enough for us to load a Vector128."); 951Debug.Assert(searchSpaceLength >= sizeof(ulong), "We expect that the input is long enough for us to load a ulong."); 1027Debug.Assert(searchSpaceLength >= Vector128<byte>.Count, "We expect that the input is long enough for us to load a Vector128."); 1079Debug.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\ProbabilisticMap.cs (17)
423Debug.Assert(Avx512Vbmi.VL.IsSupported); 424Debug.Assert(searchSpaceLength >= 16); 467Debug.Assert(searchSpaceLength is > 32 and <= 64); 484Debug.Assert(searchSpaceLength is >= 16 and <= 32); 507Debug.Assert(Sse41.IsSupported || AdvSimd.Arm64.IsSupported); 508Debug.Assert(searchSpaceLength >= 16); 598Debug.Assert(Avx512Vbmi.VL.IsSupported); 599Debug.Assert(searchSpaceLength >= 16); 615Debug.Assert(Unsafe.ByteOffset(ref searchSpace, ref cur) >= 64 * sizeof(char)); 643Debug.Assert(searchSpaceLength is > 32 and <= 64); 644Debug.Assert(Unsafe.ByteOffset(ref searchSpace, ref cur) >= 32 * sizeof(char)); 661Debug.Assert(searchSpaceLength is >= 16 and <= 32); 662Debug.Assert(Unsafe.ByteOffset(ref searchSpace, ref cur) >= 16 * sizeof(char)); 685Debug.Assert(Sse41.IsSupported || AdvSimd.Arm64.IsSupported); 686Debug.Assert(searchSpaceLength >= 16); 704Debug.Assert(Unsafe.ByteOffset(ref searchSpace, ref cur) >= 32 * sizeof(char)); 746Debug.Assert(Unsafe.ByteOffset(ref searchSpace, ref cur) >= 16 * sizeof(char));
src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticMapState.cs (18)
35Debug.Assert(!values.IsEmpty); 57Debug.Assert((IntPtr)valuesPtr != IntPtr.Zero); 65Debug.Assert(_hashEntries is not null); 76Debug.Assert(_hashEntries is not null); 77Debug.Assert((IntPtr)_slowContainsValuesPtr == IntPtr.Zero); 86Debug.Assert(offset < (ulong)hashEntries.Length); 94Debug.Assert(_hashEntries is null); 95Debug.Assert((IntPtr)_slowContainsValuesPtr != IntPtr.Zero); 106Debug.Assert(_hashEntries is null); 107Debug.Assert((IntPtr)_slowContainsValuesPtr != IntPtr.Zero); 131Debug.Assert(maxInclusive <= char.MaxValue); 167Debug.Assert(modulus < MaxModulus); 211Debug.Assert(divisor > 0); 212Debug.Assert(divisor <= MaxModulus); 221Debug.Assert(multiplier == GetFastModMultiplier(divisor)); 225Debug.Assert(result == (value % divisor)); 239Debug.Assert(state._hashEntries is not null); 279Debug.Assert(state._hashEntries is not null);
src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticWithAsciiCharSearchValues.cs (8)
22Debug.Assert(IndexOfAnyAsciiSearcher.IsVectorizationSupported); 23Debug.Assert(values.ContainsAnyInRange((char)0, (char)127)); 53Debug.Assert(_asciiState.Lookup.Contains(0) != _inverseAsciiState.Lookup.Contains(0)); 57Debug.Assert(_inverseAsciiState.Lookup.Contains(0), "The inverse bitmap did not contain a 0."); 66Debug.Assert(!(Ssse3.IsSupported || PackedSimd.IsSupported) || !_inverseAsciiState.Lookup.Contains(0), 150Debug.Assert(_asciiState.Lookup.Contains(0) != _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\SearchValues.cs (1)
55Debug.Assert(values.Length is 2 or 3 or 4 or 5);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\AsciiStringSearchValuesTeddyBase.cs (11)
121Debug.Assert(!TBucketized.Value); 122Debug.Assert(n is 2 or 3); 137Debug.Assert(TBucketized.Value); 138Debug.Assert(n is 2 or 3); 252Debug.Assert(span.Length >= CharsPerIterationAvx2 + MatchStartOffsetN2); 304Debug.Assert(span.Length >= CharsPerIterationAvx512 + MatchStartOffsetN2); 429Debug.Assert(span.Length >= CharsPerIterationAvx2 + MatchStartOffsetN3); 484Debug.Assert(span.Length >= CharsPerIterationAvx512 + MatchStartOffsetN3); 561Debug.Assert(bucket is not null); 606Debug.Assert(bucket is not null); 651Debug.Assert(bucket is not null);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasick.cs (22)
79Debug.Assert(typeof(TCaseSensitivity) != typeof(StringSearchValuesHelper.CaseInsensitiveUnicode)); 87Debug.Assert(nodeIndex == 0); 122Debug.Assert((uint)i < (uint)span.Length); 127Debug.Assert((uint)nodeIndex < (uint)_nodes.Length); 135Debug.Assert((uint)nodeIndex < (uint)_nodes.Length); 140Debug.Assert(result == -1 || result >= i + 1 - matchLength); 168Debug.Assert(nodeIndex == -1); 169Debug.Assert(result >= 0); 231Debug.Assert((uint)i < (uint)span.Length); 258Debug.Assert(lowSurrogateUpper != LowSurrogateNotSet); 269Debug.Assert(c == destination[0]); 270Debug.Assert(lowSurrogateUpper == LowSurrogateNotSet || lowSurrogateUpper == destination[1]); 276Debug.Assert((uint)nodeIndex < (uint)_nodes.Length); 284Debug.Assert((uint)nodeIndex < (uint)_nodes.Length); 289Debug.Assert(result == -1 || result >= i + 1 - matchLength); 317Debug.Assert(nodeIndex == -1); 318Debug.Assert(result >= 0); 331Debug.Assert(char.IsHighSurrogate(h)); 332Debug.Assert(char.IsLowSurrogate(l)); 338Debug.Assert(written == 2); 343Debug.Assert(char.IsHighSurrogate(hr)); 344Debug.Assert(char.IsLowSurrogate(lr));
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasickBuilder.cs (4)
24Debug.Assert(!values.IsEmpty); 25Debug.Assert(!string.IsNullOrEmpty(values[0])); 31Debug.Assert(values[i - 1].Length <= values[i].Length); 44Debug.Assert(_nodes[0].MatchLength == 0, "The root node shouldn't have a match.");
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasickNode.cs (3)
40Debug.Assert(children is int[] || children is Dictionary<char, int>); 96Debug.Assert(ReferenceEquals(_children, EmptyChildrenSentinel)); 139Debug.Assert(children.Count > 0);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\CharacterFrequencyHelper.cs (5)
34Debug.Assert(value.Length > 1); 35Debug.Assert(!ignoreCase || char.IsAscii(value[0])); 43Debug.Assert(!ignoreCase); 74Debug.Assert(ch2Offset != 0); 75Debug.Assert(ch2Offset != ch3Offset);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\RabinKarp.cs (7)
42Debug.Assert(values.Length <= MaxValues); 50Debug.Assert(minimumLength > 1); 111Debug.Assert(typeof(TCaseSensitivity) != typeof(CaseInsensitiveUnicode)); 112Debug.Assert(span.Length <= MaxInputLength, "Teddy should have handled short inputs."); 128Debug.Assert(_buckets is not null); 164Debug.Assert(span.Length <= MaxInputLength, "Teddy should have handled long inputs."); 175Debug.Assert(charsWritten == upperCase.Length);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\StringSearchValuesHelper.cs (19)
20Debug.Assert(searchSpaceLength >= 0); 28Debug.Assert(offset >= 0); 31Debug.Assert(currentByteOffset >= 0); 32Debug.Assert((currentByteOffset & 1) == 0); 36Debug.Assert(offset <= availableLength); 58Debug.Assert(lengthRemaining > 0); 86Debug.Assert(typeof(TCaseSensitivity) == typeof(CaseInsensitiveUnicode)); 120Debug.Assert(value.Length >= 2); 162Debug.Assert(value.Length is 2 or 3); 185Debug.Assert(Value.Length is >= 9 and <= 16); 186Debug.Assert(ToUpperMask256 == default); 207Debug.Assert(Value.Length is >= 9 and <= 16); 208Debug.Assert(ToUpperMask256 != default); 272Debug.Assert(state.Value.Length is 2 or 3); 273Debug.Assert(matchStart == state.Value[0], "This should only be called after the first character has been checked"); 321Debug.Assert(state.Value.Length is 2 or 3); 322Debug.Assert(TransformInput(matchStart) == state.Value[0], "This should only be called after the first character has been checked"); 394Debug.Assert(state.Value.Length is 2 or 3); 395Debug.Assert((matchStart & ~0x20) == (state.Value[0] & ~0x20));
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\TeddyBucketizer.cs (9)
17Debug.Assert(values.Length <= 8); 29Debug.Assert(char.IsAscii(c)); 50Debug.Assert(valueBuckets.Length <= 8); 62Debug.Assert(char.IsAscii(c)); 77Debug.Assert(bucketCount == 8, "This may change if we end up supporting the 'fat Teddy' variant."); 78Debug.Assert(values.Length > bucketCount, "Should be using a non-bucketized implementation."); 79Debug.Assert(values.Length <= RabinKarp.MaxValues); 97Debug.Assert(char.IsAscii(value[j])); 129Debug.Assert(count == strings.Length);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\SingleStringSearchValuesThreeChars.cs (4)
49Debug.Assert(value.Length > 1); 53Debug.Assert(ch3Offset == 0 || ch3Offset > ch2Offset); 334Debug.Assert(bitPos % 2 == 0); 362Debug.Assert(bitPos % 2 == 0);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValues.cs (13)
64Debug.Assert(i == normalizedValues.Length); 91Debug.Assert(charsWritten == upperCase.Length); 109Debug.Assert(newCount <= values.Length - unreachableValues.Count); 110Debug.Assert(newCount > 0); 252Debug.Assert(!(asciiStartLettersOnly && asciiStartUnaffectedByCaseConversion)); 292Debug.Assert(typeof(TStartCaseSensitivity) != typeof(CaseInsensitiveUnicode)); 293Debug.Assert(values.Length > 1); 294Debug.Assert(n is 2 or 3); 317Debug.Assert(n is 2 or 3); 318Debug.Assert(values.Length < maxValues); 329Debug.Assert(char.IsAscii(c)); 340Debug.Assert(newValuesCount > values.Length, "Shouldn't have been called if there were no letters present"); 373Debug.Assert(newValuesCount == newValues.Length);
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 (10)
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"); 59Debug.Assert(_buffer != null); 82Debug.Assert(_buffer != null); 102Debug.Assert(_buffer != null); 132Debug.Assert(_buffer != null); 183Debug.Assert(_buffer != null); 230Debug.Assert(_buffer != null); 262Debug.Assert(_buffer != null); 427Debug.Assert(byteLength >= 0);
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\Single.cs (7)
294Debug.Assert(IsNaN(value)); 1562Debug.Assert(IsNaN(x) || IsNaN(y)); 1595Debug.Assert(n == 0); 1634Debug.Assert(IsPositiveInfinity(x)); 1639Debug.Assert(IsNegativeInfinity(x)); 1679Debug.Assert(IsPositiveInfinity(x)); 1684Debug.Assert(IsNegativeInfinity(x));
src\libraries\System.Private.CoreLib\src\System\Span.cs (1)
132Debug.Assert(length >= 0);
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Byte.cs (24)
18Debug.Assert(searchSpaceLength >= 0); 19Debug.Assert(valueLength >= 0); 83Debug.Assert(offset >= 0); 85Debug.Assert(offset + ch1ch2Distance + Vector512<byte>.Count <= searchSpaceLength); 144Debug.Assert(offset >= 0); 146Debug.Assert(offset + ch1ch2Distance + Vector256<byte>.Count <= searchSpaceLength); 205Debug.Assert(offset >= 0); 207Debug.Assert(offset + ch1ch2Distance + Vector128<byte>.Count <= searchSpaceLength); 254Debug.Assert(searchSpaceLength >= 0); 255Debug.Assert(valueLength >= 0); 276Debug.Assert(0 <= offset && offset <= searchSpaceLength); // Ensures no deceptive underflows in the computation of "remainingSearchSpaceLength". 828Debug.Assert(lengthToExamine < length); 858Debug.Assert(lengthToExamine < length); 888Debug.Assert(lengthToExamine < length); 918Debug.Assert(length <= (nuint)sizeof(nuint) * 2); 929Debug.Assert(length >= (nuint)sizeof(nuint)); 934Debug.Assert(lengthToExamine < length); 965Debug.Assert(firstLength >= 0); 966Debug.Assert(secondLength >= 0); 1014Debug.Assert(result != 0); 1055Debug.Assert(result != 0); 1092Debug.Assert(result != 0); 1202Debug.Assert(length >= (uint)Vector128<byte>.Count); 1301Debug.Assert(length > 1);
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.ByteMemOps.cs (14)
56Debug.Assert(len > 16 && len <= 64); 97Debug.Assert(len > 16 && len <= 64); 115Debug.Assert(len >= 8 && len <= 16); 131Debug.Assert(len >= 4 && len < 8); 138Debug.Assert(len < 4); 172Debug.Assert(len > 64 && len <= MemmoveNativeThreshold); 228Debug.Assert(len > 0); 239Debug.Assert(len > 0); 260Debug.Assert(len > 16 && len <= 64); 301Debug.Assert(len > 16 && len <= 64); 319Debug.Assert(len >= 8 && len <= 16); 335Debug.Assert(len >= 4 && len < 8); 342Debug.Assert(len < 4); 371Debug.Assert(len > 64 && len <= ZeroMemoryNativeThreshold);
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Char.cs (20)
16Debug.Assert(searchSpaceLength >= 0); 17Debug.Assert(valueLength >= 0); 89Debug.Assert(offset + ch1ch2Distance + Vector512<ushort>.Count <= searchSpaceLength); 156Debug.Assert(offset + ch1ch2Distance + Vector256<ushort>.Count <= searchSpaceLength); 218Debug.Assert(offset + ch1ch2Distance + Vector128<ushort>.Count <= searchSpaceLength); 266Debug.Assert(searchSpaceLength >= 0); 267Debug.Assert(valueLength >= 0); 288Debug.Assert(0 <= offset && offset <= searchSpaceLength); // Ensures no deceptive underflows in the computation of "remainingSearchSpaceLength". 467Debug.Assert(firstLength >= 0); 468Debug.Assert(secondLength >= 0); 585Debug.Assert(length - offset >= Vector128<ushort>.Count); 646Debug.Assert(lengthToExamine >= Vector512<ushort>.Count); 675Debug.Assert(lengthToExamine >= Vector256<ushort>.Count); 698Debug.Assert(lengthToExamine >= Vector128<ushort>.Count); 729Debug.Assert(length - offset >= Vector128<ushort>.Count); 763Debug.Assert(lengthToExamine >= Vector256<ushort>.Count); 786Debug.Assert(lengthToExamine >= Vector128<ushort>.Count); 817Debug.Assert(length - offset >= Vector128<ushort>.Count); 824Debug.Assert(lengthToExamine >= Vector128<ushort>.Count); 889Debug.Assert(length > 1);
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.cs (9)
15Debug.Assert(Unsafe.IsOpportunisticallyAligned(ref ip, (uint)sizeof(IntPtr)), "Should've been aligned on natural word boundary."); 33Debug.Assert(pointerSizeLength <= 7); 66Debug.Assert(pointerSizeLength >= 4); 75Debug.Assert(pointerSizeLength >= 2); 82Debug.Assert(pointerSizeLength >= 1); 90Debug.Assert(length > 1); 195Debug.Assert(length > 1); 301Debug.Assert(length > 1); 333Debug.Assert(length > 1);
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Packed.cs (24)
24Debug.Assert(PackedIndexOfIsSupported); 25Debug.Assert(RuntimeHelpers.IsBitwiseEquatable<T>()); 26Debug.Assert(sizeof(T) == sizeof(ushort)); 65Debug.Assert((value | 0x20) == value); 74Debug.Assert((value | 0x20) == value); 83Debug.Assert((value0 | 0x20) == value0); 84Debug.Assert((value1 | 0x20) == value1); 93Debug.Assert((value0 | 0x20) == value0); 94Debug.Assert((value1 | 0x20) == value1); 112Debug.Assert(CanUsePackedIndexOf(value)); 316Debug.Assert(CanUsePackedIndexOf(value)); 519Debug.Assert(CanUsePackedIndexOf(value0)); 520Debug.Assert(CanUsePackedIndexOf(value1)); 732Debug.Assert(CanUsePackedIndexOf(value0)); 733Debug.Assert(CanUsePackedIndexOf(value1)); 734Debug.Assert(CanUsePackedIndexOf(value2)); 950Debug.Assert(CanUsePackedIndexOf(lowInclusive)); 951Debug.Assert(CanUsePackedIndexOf((short)(lowInclusive + rangeInclusive))); 952Debug.Assert(rangeInclusive >= 0); 1145Debug.Assert(Avx512BW.IsSupported); 1157Debug.Assert(Avx2.IsSupported); 1169Debug.Assert(Sse2.IsSupported); 1303Debug.Assert(Avx2.IsSupported); 1315Debug.Assert(Avx512F.IsSupported);
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.T.cs (60)
193Debug.Assert(searchSpaceLength >= 0); 194Debug.Assert(valueLength >= 0); 206Debug.Assert(0 <= index && index <= searchSpaceLength); // Ensures no deceptive underflows in the computation of "remainingSearchSpaceLength". 229Debug.Assert(length >= 0); 235Debug.Assert(value is not null); 301Debug.Assert(length >= 0); 306Debug.Assert(value is not null); 390Debug.Assert(length >= 0); 396Debug.Assert(value0 is not null && value1 is not null); 496Debug.Assert(length >= 0); 502Debug.Assert(value0 is not null && value1 is not null && value2 is not null); 601Debug.Assert(searchSpaceLength >= 0); 602Debug.Assert(valueLength >= 0); 672Debug.Assert(searchSpaceLength >= 0); 673Debug.Assert(valueLength >= 0); 691Debug.Assert(0 <= index && index <= searchSpaceLength); // Ensures no deceptive underflows in the computation of "remainingSearchSpaceLength". 712Debug.Assert(length >= 0); 716Debug.Assert(value is not null); 795Debug.Assert(length >= 0); 800Debug.Assert(value0 is not null && value1 is not null); 900Debug.Assert(length >= 0); 905Debug.Assert(value0 is not null && value1 is not null && value2 is not null); 1005Debug.Assert(searchSpaceLength >= 0); 1006Debug.Assert(valueLength >= 0); 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"); 1197Debug.Assert(length >= 0); 1289Debug.Assert(firstLength >= 0); 1290Debug.Assert(secondLength >= 0); 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"); 3064Debug.Assert(oldValue is not null); 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\StartupHookProvider.cs (5)
147Debug.Assert(Path.IsPathFullyQualified(startupHook.Path)); 152Debug.Assert(startupHook.AssemblyName != null); 168Debug.Assert(assembly != null); 194Debug.Assert(initializeMethod == null); 206Debug.Assert(initializeMethod != null &&
src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (21)
25Debug.Assert(strA != null); 26Debug.Assert(strB != null); 27Debug.Assert(strA.Length == strB.Length); 38Debug.Assert(strA != null); 39Debug.Assert(strB != null); 40Debug.Assert(indexA >= 0 && indexB >= 0); 41Debug.Assert(countA >= 0 && countB >= 0); 42Debug.Assert(indexA + countA <= strA.Length && indexB + countB <= strB.Length); 71Debug.Assert(strA.Length == strB.Length); 78Debug.Assert(strA != null); 79Debug.Assert(strB != null); 83Debug.Assert(strA._firstChar == strB._firstChar, 190Debug.Assert(*(a + 1) != *(b + 1), "This char must be different if we reach here!"); 420Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); // CheckStringComparison validated these earlier 834Debug.Assert(src[Length] == '\0', "src[Length] == '\\0'"); 835Debug.Assert(((int)src) % 4 == 0, "Managed string should start at 4 bytes boundary"); 931Debug.Assert(src[Length] == '\0', "src[this.Length] == '\\0'"); 932Debug.Assert(((int) src) % 4 == 0, "Managed string should start at 4 bytes boundary"); 1068Debug.Assert(charsWritten == length); 1196Debug.Assert((uint)comparisonType <= (uint)StringComparison.OrdinalIgnoreCase); 1216Debug.Assert(comparisonType == StringComparison.Ordinal || comparisonType == StringComparison.OrdinalIgnoreCase);
src\libraries\System.Private.CoreLib\src\System\String.cs (6)
227Debug.Assert(numBytes >= 0); 228Debug.Assert(pb <= (pb + numBytes)); 536Debug.Assert(bytes != null); 537Debug.Assert(byteLength >= 0); 541Debug.Assert(stringLength >= 0); 552Debug.Assert(stringLength == doubleCheck,
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (23)
47Debug.Assert(char.IsWhiteSpace((char)i) == sv.Contains((char)i)); 58Debug.Assert(dest != null); 59Debug.Assert(src != null); 60Debug.Assert(src.Length <= dest.Length - destPos); 138Debug.Assert(s != null); 139Debug.Assert(position <= totalLength - s.Length, "We didn't allocate enough space for the result string!"); 684Debug.Assert(index > 2); 1222Debug.Assert(!oldValue.IsEmpty); 1223Debug.Assert(compareInfo != null); 1413Debug.Assert(indices.Length > 0); 1444Debug.Assert(this.Length - thisIdx == dstSpan.Length - dstIdx); 1818Debug.Assert(count >= 0); 1862Debug.Assert(count >= 2); 1899Debug.Assert(count >= 2); 1952Debug.Assert(arrIndex < maxItems); 2038Debug.Assert(sourceSpan.Length >= Vector128<ushort>.Count); 2150Debug.Assert(!separator.IsEmpty, "Empty separator"); 2178Debug.Assert(!separators.IsEmpty, "Zero separators"); 2257Debug.Assert(startIndex == 0); 2281Debug.Assert(startIndex >= 0 && startIndex <= this.Length, "StartIndex is out of range!"); 2282Debug.Assert(length >= 0 && startIndex <= this.Length - length, "length is out of range!"); 2499Debug.Assert(trimChars != null); 2500Debug.Assert(trimCharsLength > 0);
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.CaseConversion.cs (9)
185Debug.Assert(numElementsActuallyConverted <= numElementsToConvert); 199Debug.Assert(numElementsActuallyConverted <= (nuint)buffer.Length); 211Debug.Assert(typeof(TFrom) == typeof(byte) || typeof(TFrom) == typeof(ushort)); 212Debug.Assert(typeof(TTo) == typeof(byte) || typeof(TTo) == typeof(ushort)); 213Debug.Assert(typeof(TCasing) == typeof(ToUpperConversion) || typeof(TCasing) == typeof(ToLowerConversion)); 268Debug.Assert((nuint)(&pDest[i]) % expectedWriteAlignment == 0, "Destination buffer wasn't properly aligned!"); 275Debug.Assert(i <= elementCount, "We overran a buffer somewhere."); 346Debug.Assert(Vector128.IsHardwareAccelerated); 405Debug.Assert(Vector128.IsHardwareAccelerated);
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.cs (3)
50Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort)); 146Debug.Assert((int)i > 3 * Vector256<T>.Count); 198Debug.Assert((int)i > 3 * Vector128<T>.Count);
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Equality.cs (6)
47Debug.Assert( 71Debug.Assert(Vector512<TLeft>.Count == Vector512<TRight>.Count 101Debug.Assert(Vector256<TLeft>.Count == Vector256<TRight>.Count 201Debug.Assert( 556Debug.Assert(Vector256<byte>.Count == Vector256<ushort>.Count * 2); 581Debug.Assert(Vector512<byte>.Count == Vector512<ushort>.Count * 2);
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Transcoding.cs (2)
40Debug.Assert(numElementsActuallyConverted <= numElementsToConvert); 75Debug.Assert(numElementsActuallyConverted <= numElementsToConvert);
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Utility.cs (87)
56Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort)); 83Debug.Assert((mask != 0) ? index < 16 : index >= 16); 156Debug.Assert(0 < numBytesRead && numBytesRead <= Vector512.Size, "We should've made forward progress of at least one byte."); 157Debug.Assert((nuint)numBytesRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 160Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 164Debug.Assert((nuint)pBuffer % Vector512.Size == 0, "Vector read should be aligned."); 192Debug.Assert(0 < numBytesRead && numBytesRead <= Vector256.Size, "We should've made forward progress of at least one byte."); 193Debug.Assert((nuint)numBytesRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 196Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 200Debug.Assert((nuint)pBuffer % Vector256.Size == 0, "Vector read should be aligned."); 228Debug.Assert(0 < numBytesRead && numBytesRead <= Vector128.Size, "We should've made forward progress of at least one byte."); 229Debug.Assert((nuint)numBytesRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 232Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 236Debug.Assert((nuint)pBuffer % Vector128.Size == 0, "Vector read should be aligned."); 337Debug.Assert(!AllBytesInUInt32AreAscii(currentUInt32), "Shouldn't have reached this point if we have an all-ASCII input."); 352Debug.Assert(sseMask != uint.MaxValue); 353Debug.Assert(Sse2.IsSupported); 360Debug.Assert(advSimdIndex != uint.MaxValue); 361Debug.Assert(AdvSimd.IsSupported); 372Debug.Assert(Sse2.IsSupported || AdvSimd.Arm64.IsSupported, "Sse2 or AdvSimd64 required."); 373Debug.Assert(BitConverter.IsLittleEndian, "This SSE2/Arm64 implementation assumes little-endian."); 430Debug.Assert(0 < numBytesRead && numBytesRead <= SizeOfVector128, "We should've made forward progress of at least one byte."); 431Debug.Assert((nuint)numBytesRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 597Debug.Assert(ContainsNonAsciiByte_Sse2(currentSseMask), "Shouldn't be here unless we see non-ASCII data."); 602Debug.Assert(ContainsNonAsciiByte_AdvSimd(currentAdvSimdIndex), "Shouldn't be here unless we see non-ASCII data."); 615Debug.Assert(!AllBytesInUInt32AreAscii(currentDWord), "Shouldn't be here unless we see non-ASCII data."); 626Debug.Assert(bufferLength < SizeOfVector128); 757Debug.Assert(bufferLength <= nuint.MaxValue / sizeof(char)); 778Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector512InChars, "We should've made forward progress of at least one char."); 779Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 782Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 786Debug.Assert((nuint)pBuffer % Vector512.Size == 0, "Vector read should be aligned."); 814Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector256InChars, "We should've made forward progress of at least one char."); 815Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 818Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 822Debug.Assert((nuint)pBuffer % Vector256.Size == 0, "Vector read should be aligned."); 849Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector128InChars, "We should've made forward progress of at least one char."); 850Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 853Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 857Debug.Assert((nuint)pBuffer % Vector128.Size == 0, "Vector read should be aligned."); 936Debug.Assert(totalNumBytesRead % sizeof(char) == 0, "Total number of bytes read should be even since we're working with chars."); 941Debug.Assert(!AllCharsInUInt32AreAscii(currentUInt32), "Shouldn't have reached this point if we have an all-ASCII input."); 970Debug.Assert(Sse2.IsSupported || AdvSimd.Arm64.IsSupported, "Should've been checked by caller."); 971Debug.Assert(BitConverter.IsLittleEndian, "This SSE2/Arm64 assumes little-endian."); 987Debug.Assert(bufferLength <= nuint.MaxValue / sizeof(char)); 1017Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector128InChars, "We should've made forward progress of at least one char."); 1018Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 1096Debug.Assert(((nuint)pBuffer - (nuint)pOriginalBuffer) % 2 == 0, "Shouldn't have incremented any pointer by an odd byte count."); 1139Debug.Assert(currentMask != 0, "Shouldn't be here unless we see non-ASCII data."); 1164Debug.Assert(!AllCharsInUInt32AreAscii(currentDWord), "Shouldn't be here unless we see non-ASCII data."); 1182Debug.Assert(bufferLength < SizeOfVector128InChars); 1267Debug.Assert(AllCharsInUInt64AreAscii(value)); 1322Debug.Assert(AllCharsInUInt32AreAscii(value)); 1388Debug.Assert(currentOffset <= elementCount); 1504Debug.Assert(!AllCharsInUInt32AreAscii(utf16Data32BitsHigh), "Shouldn't have reached this point if we have an all-ASCII input."); 1601Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort)); 1612Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort)); 1635Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort)); 1653Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort)); 1721Debug.Assert(Vector128.IsHardwareAccelerated, "Vector128 is required."); 1722Debug.Assert(BitConverter.IsLittleEndian, "This implementation assumes little-endian."); 1723Debug.Assert(elementCount >= 2 * SizeOfVector128); 1774Debug.Assert(0 < currentOffsetInElements && currentOffsetInElements <= SizeOfVector128, "We wrote at least 1 byte but no more than a whole vector."); 1775Debug.Assert(currentOffsetInElements <= elementCount, "Shouldn't have overrun the destination buffer."); 1776Debug.Assert(elementCount - currentOffsetInElements >= SizeOfVector128, "We should be able to run at least one whole vector."); 1794Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % SizeOfVector128 == 0, "Write should be aligned."); 1817Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % sizeof(ulong) == 0, "Destination should be ulong-aligned."); 1839Debug.Assert(Vector256.IsHardwareAccelerated, "Vector256 is required."); 1840Debug.Assert(BitConverter.IsLittleEndian, "This implementation assumes little-endian."); 1841Debug.Assert(elementCount >= 2 * Vector256.Size); 1891Debug.Assert(0 < currentOffsetInElements && currentOffsetInElements <= Vector256.Size, "We wrote at least 1 byte but no more than a whole vector."); 1892Debug.Assert(currentOffsetInElements <= elementCount, "Shouldn't have overrun the destination buffer."); 1893Debug.Assert(elementCount - currentOffsetInElements >= Vector256.Size, "We should be able to run at least one whole vector."); 1911Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % Vector256.Size == 0, "Write should be aligned."); 1934Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % Vector128.Size == 0, "Destination should be 128-bit-aligned."); 1956Debug.Assert(Vector512.IsHardwareAccelerated, "Vector512 is required."); 1957Debug.Assert(BitConverter.IsLittleEndian, "This implementation assumes little-endian."); 1958Debug.Assert(elementCount >= 2 * Vector512.Size); 2009Debug.Assert(0 < currentOffsetInElements && currentOffsetInElements <= Vector512.Size, "We wrote at least 1 byte but no more than a whole vector."); 2010Debug.Assert(currentOffsetInElements <= elementCount, "Shouldn't have overrun the destination buffer."); 2011Debug.Assert(elementCount - currentOffsetInElements >= Vector512.Size, "We should be able to run at least one whole vector."); 2029Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % Vector512.Size == 0, "Write should be aligned."); 2052Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % Vector256.Size == 0, "Destination should be 256-bit-aligned."); 2090Debug.Assert(currentOffset <= elementCount); 2162Debug.Assert(!AllBytesInUInt32AreAscii(asciiData), "Shouldn't have reached this point if we have an all-ASCII input."); 2261Debug.Assert(typeof(TVectorByte) == typeof(Vector128<byte>)); 2275Debug.Assert(AllBytesInUInt32AreAscii(value));
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Utility.Helpers.cs (1)
49Debug.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 (9)
35Debug.Assert(format is not null); 39Debug.Assert(segments is not null); 46Debug.Assert((segment.Literal is not null) ^ (segment.ArgIndex >= 0), "The segment should represent a literal or a format hole, but not both."); 60Debug.Assert(literalLength >= 0); 61Debug.Assert(formattedCount >= 0); 62Debug.Assert(formattedCount == 0 || argsRequired > 0); 184Debug.Assert(format[pos - 1] == '{'); 185Debug.Assert(ch != '{'); 316Debug.Assert(format[pos] == '}');
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 (11)
76Debug.Assert(_encoding is not null); 129Debug.Assert(_encoding is not null); 183Debug.Assert(_encoding is not null); 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."); 237Debug.Assert(_encoding is not null); 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."); 295Debug.Assert(_encoding is not null); 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 (5)
124Debug.Assert(!chars.IsEmpty, "Caller shouldn't invoke this if there's no data to fall back."); 197Debug.Assert(encoding != null); 247Debug.Assert(encoding != null); 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 (8)
72Debug.Assert(_encoding is not null); 115Debug.Assert(_encoding is not null); 169Debug.Assert(_encoding is not null); 213Debug.Assert(_encoding is not null); 284Debug.Assert(_encoding is not null); 287Debug.Assert(byteCount >= 0, "Encoding shouldn't have returned a negative byte count."); 307Debug.Assert(_fallbackBuffer is not null); 358Debug.Assert(_encoding is not null);
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 (8)
631Debug.Assert(byteCount == bytesReceived); 657Debug.Assert(byteCount == bytesReceived); 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 (66)
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."); 312Debug.Assert(!chars.IsEmpty, "Caller shouldn't invoke this method with an empty input buffer."); 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."); 588Debug.Assert(!chars.IsEmpty, "Caller shouldn't invoke this method with an empty input buffer."); 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."); 688Debug.Assert(encoder is null); 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."); 912Debug.Assert(!bytes.IsEmpty, "Caller shouldn't invoke this method with an empty input buffer."); 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."); 1189Debug.Assert(!bytes.IsEmpty, "Caller shouldn't invoke this method with an empty input buffer."); 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."); 1272Debug.Assert(fallbackBuffer.Remaining == 0); 1285Debug.Assert(decoder is null); 1294Debug.Assert(originalBytesLength >= bytes.Length, "About to report a negative number of bytes used?");
src\libraries\System.Private.CoreLib\src\System\Text\EncodingTable.cs (6)
57Debug.Assert(EncodingNameIndices.Length == CodePagesByName.Length + 1); 58Debug.Assert(EncodingNameIndices[^1] == EncodingNames.Length); 68Debug.Assert(index < EncodingNameIndices.Length - 1); 91Debug.Assert(left < EncodingNameIndices.Length - 1); 131Debug.Assert(arrayEncodingInfoIdx == arrayEncodingInfo.Length); 137Debug.Assert(encodingInfoList != null);
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 (33)
40Debug.Assert(bufferLength <= nuint.MaxValue / sizeof(char)); 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."); 204Debug.Assert(bufferLength <= nuint.MaxValue / sizeof(char)); 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."); 451Debug.Assert(bufferLength < SizeOfVector128InChars); 550Debug.Assert(BitConverter.IsLittleEndian, "Assume little endian if SSE2 is supported."); 630Debug.Assert(currentOffset <= elementCount); 746Debug.Assert(!AllCharsInUInt32AreLatin1(utf16Data32BitsHigh), "Shouldn't have reached this point if we have an all-Latin-1 input."); 779Debug.Assert(Sse2.IsSupported); 780Debug.Assert(BitConverter.IsLittleEndian); 781Debug.Assert(elementCount >= 2 * SizeOfVector128); 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."); 971Debug.Assert(Sse2.IsSupported); 972Debug.Assert(BitConverter.IsLittleEndian); 997Debug.Assert(0 < currentOffset && currentOffset <= SizeOfVector128 / sizeof(char)); 1027Debug.Assert(elementCount - currentOffset < SizeOfVector128, "Case where 2 vectors remained should've been in the hot loop."); 1071Debug.Assert(!Sse2.IsSupported); 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\Latin1Utility.Helpers.cs (2)
51Debug.Assert(AllCharsInUInt64AreLatin1(value)); 95Debug.Assert(AllCharsInUInt32AreLatin1(value));
src\libraries\System.Private.CoreLib\src\System\Text\Rune.cs (11)
197Debug.Assert(codeUnitCount > 0 && codeUnitCount <= MaxUtf16CharsPerRune); 214Debug.Assert(codeUnitCount > 0 && codeUnitCount <= MaxUtf8BytesPerRune); 227Debug.Assert(!GlobalizationMode.Invariant, "This should've been checked by the caller."); 228Debug.Assert(textInfo != null, "This should've been checked by the caller."); 467Debug.Assert(UnicodeUtility.IsInRangeInclusive(tempValue, 0x0080, 0x07FF)); 518Debug.Assert(UnicodeUtility.IsInRangeInclusive(tempValue, 0x0800, 0xFFFF)); 547Debug.Assert(1 <= bytesConsumed && bytesConsumed <= 4); // Valid subsequences are always length [1..4] 553Debug.Assert(0 <= index && index <= 3); // Incomplete subsequences are always length 0..3 560Debug.Assert(1 <= index && index <= 3); // Invalid subsequences are always length 1..3 710Debug.Assert(!source.IsEmpty, "Shouldn't reach this for empty inputs."); 1248Debug.Assert(!value.IsAscii, "Shouldn't use this non-optimized code path for ASCII characters.");
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (62)
238Debug.Assert(m_ChunkOffset + m_ChunkChars.Length >= m_ChunkOffset, "The length of the string is greater than int.MaxValue."); 245Debug.Assert(currentBlock.m_MaxCapacity == maxCapacity); 246Debug.Assert(currentBlock.m_ChunkChars != null); 248Debug.Assert(currentBlock.m_ChunkLength <= currentBlock.m_ChunkChars.Length); 249Debug.Assert(currentBlock.m_ChunkLength >= 0); 250Debug.Assert(currentBlock.m_ChunkOffset >= 0); 255Debug.Assert(currentBlock.m_ChunkOffset == 0); 259Debug.Assert(currentBlock.m_ChunkOffset == prevBlock.m_ChunkOffset + prevBlock.m_ChunkLength); 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."); 559Debug.Assert(next.m_ChunkPrevious != null); 585Debug.Assert(stringBuilder != null); 638Debug.Assert(stringBuilder != null); 684Debug.Assert(repeatCount > 0, "Invalid length; should have been validated by caller."); 706Debug.Assert(m_ChunkLength == 0, "A new block was not created."); 849Debug.Assert(m_ChunkLength == 0 && m_ChunkChars.Length >= count); 905Debug.Assert(chunk != null); 957Debug.Assert(insertingChars + this.Length < int.MaxValue); 1025Debug.Assert(m_ChunkLength == 0, "A new block was not created."); 1058Debug.Assert(typeof(T).Assembly.Equals(typeof(object).Assembly), "Implementation trusts the results of TryFormat because T is expected to be something known"); 1071Debug.Assert(typeof(T).Assembly.Equals(typeof(object).Assembly), "Implementation trusts the results of TryFormat because T is expected to be something known"); 1237Debug.Assert(values != null); 1238Debug.Assert(!Unsafe.IsNullRef(ref separator)); 1239Debug.Assert(separatorLength >= 0); 1414Debug.Assert(typeof(T).Assembly.Equals(typeof(object).Assembly), "Implementation trusts the results of TryFormat because T is expected to be something known"); 1590Debug.Assert(format[pos - 1] == '{'); 1591Debug.Assert(ch != '{'); 1694Debug.Assert(format[pos] == '}'); 1922Debug.Assert(index > 2); 2011Debug.Assert(thisChunk != null && sbChunk != null); 2048Debug.Assert(offset == Length); 2103Debug.Assert(chunk != null, "chunk was null in replace"); 2127Debug.Assert(count >= 0, "count should never go negative"); 2183Debug.Assert(chunk != null || count == 0, "Chunks ended prematurely!"); 2243Debug.Assert(chunk.m_ChunkPrevious != null); 2269Debug.Assert(valueCount >= 0, "Invalid length; should have been validated by caller."); 2321Debug.Assert(m_ChunkLength == 0, "A new block was not created."); 2338Debug.Assert((uint)index <= (uint)Length, "Callers should check that index is a legal value."); 2359Debug.Assert(!replacements.IsEmpty); 2392Debug.Assert(gapStart < sourceChunk.m_ChunkChars.Length, "gap starts at end of buffer. Should not happen"); 2393Debug.Assert(gapStart <= gapEnd, "negative gap size"); 2394Debug.Assert(gapEnd <= sourceChunk.m_ChunkLength, "gap too big"); 2403Debug.Assert(targetIndexInChunk <= targetChunk.m_ChunkLength, "gap not in chunk"); 2472Debug.Assert(chunk != null, "chunk should not be null at this point"); 2474Debug.Assert(lengthInChunk >= 0, "Index isn't in the chunk."); 2506Debug.Assert(0 <= index && index <= Length); 2511Debug.Assert(result.m_ChunkPrevious != null); 2515Debug.Assert(result != null); 2548Debug.Assert(Capacity == Length, nameof(ExpandByABlock) + " should only be called when there is no space left."); 2549Debug.Assert(minBlockCharCount > 0); 2639Debug.Assert(count > 0); 2640Debug.Assert(index >= 0); 2651Debug.Assert(chunk.m_ChunkPrevious != null); 2708Debug.Assert(size > 0); 2709Debug.Assert(maxCapacity > 0); 2734Debug.Assert(startIndex >= 0 && startIndex < Length); 2762Debug.Assert(chunk.m_ChunkPrevious != null); 2765Debug.Assert(chunk != null, "We fell off the beginning of the string!"); 2797Debug.Assert(chunk != null, "We fell off the beginning of the string!"); 3149Debug.Assert(_hasCustomFormatter); 3150Debug.Assert(_provider != null); 3153Debug.Assert(formatter != null, "An incorrectly written provider said it implemented ICustomFormatter, and then didn't");
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.Debug.cs (2)
24Debug.Assert(head.m_ChunkPrevious != null); 35Debug.Assert(current.m_ChunkPrevious != null);
src\libraries\System.Private.CoreLib\src\System\Text\TranscodingStream.cs (5)
55Debug.Assert(innerStream != null); 56Debug.Assert(innerEncoding != null); 57Debug.Assert(thisEncoding != null); 93Debug.Assert(disposing, "This type isn't finalizable."); 150Debug.Assert(pendingData.Count != 0);
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf16Utility.cs (10)
44Debug.Assert(AllCharsInUInt32AreAscii(value)); 74Debug.Assert(AllCharsInUInt32AreAscii(value)); 103Debug.Assert(AllCharsInUInt64AreAscii(value)); 132Debug.Assert(AllCharsInUInt64AreAscii(value)); 160Debug.Assert(AllCharsInUInt32AreAscii(value)); 185Debug.Assert(AllCharsInUInt32AreAscii(value)); 211Debug.Assert(AllCharsInUInt32AreAscii(valueA)); 212Debug.Assert(AllCharsInUInt32AreAscii(valueB)); 268Debug.Assert(AllCharsInUInt64AreAscii(valueA)); 269Debug.Assert(AllCharsInUInt64AreAscii(valueB));
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf16Utility.Validation.cs (8)
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."); 33Debug.Assert(0 <= numAsciiCharsConsumedJustNow && numAsciiCharsConsumedJustNow <= inputLength); 75Debug.Assert(pHighestAddressWhereCanReadOneVector >= pInputBuffer); 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, 271Debug.Assert(pHighestAddressWhereCanReadOneVector >= pInputBuffer);
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8.cs (11)
199Debug.Assert(!source.IsEmpty, "Expected 'Done' if source is fully consumed."); 286Debug.Assert(!source.IsEmpty, "Expected 'Done' if source is fully consumed."); 663Debug.Assert(_hasCustomFormatter); 664Debug.Assert(_provider is not null); 667Debug.Assert(formatter is not null, "An incorrectly written provider said it implemented ICustomFormatter, and then didn't"); 684Debug.Assert(value is ISpanFormattable); 694Debug.Assert(value is ISpanFormattable); 731Debug.Assert(typeof(T).IsEnum); 741Debug.Assert(value is ISpanFormattable); 775Debug.Assert(startingPos >= 0 && startingPos <= _pos); 776Debug.Assert(alignment != 0);
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.cs (8)
64Debug.Assert(AllBytesInUInt32AreAscii(value)); 94Debug.Assert(AllBytesInUInt32AreAscii(value)); 123Debug.Assert(AllBytesInUInt64AreAscii(value)); 152Debug.Assert(AllBytesInUInt64AreAscii(value)); 181Debug.Assert(AllBytesInUInt32AreAscii(valueA)); 182Debug.Assert(AllBytesInUInt32AreAscii(valueB)); 244Debug.Assert(AllBytesInUInt64AreAscii(valueA)); 245Debug.Assert(AllBytesInUInt64AreAscii(valueB));
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.Helpers.cs (12)
20Debug.Assert(UInt32BeginsWithUtf8ThreeByteMask(value)); 45Debug.Assert(UInt32BeginsWithUtf8TwoByteMask(value) && !UInt32BeginsWithOverlongUtf8TwoByteSequence(value)); 108Debug.Assert(IsWellFormedUtf16SurrogatePair(value)); 186Debug.Assert(IsFirstCharTwoUtf8Bytes(value) && IsSecondCharTwoUtf8Bytes(value)); 214Debug.Assert(IsFirstCharTwoUtf8Bytes(value)); 456Debug.Assert(UInt32BeginsWithUtf8TwoByteMask(value)); 575Debug.Assert(UInt32EndsWithUtf8TwoByteMask(value)); 639Debug.Assert(BitConverter.IsLittleEndian); 658Debug.Assert(BitConverter.IsLittleEndian); 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 (18)
24Debug.Assert(inputLength >= 0, "Input length must not be negative."); 25Debug.Assert(pInputBuffer != null || inputLength == 0, "Input length must be zero if input buffer pointer is null."); 27Debug.Assert(outputCharsRemaining >= 0, "Destination length must not be negative."); 28Debug.Assert(pOutputBuffer != null || outputCharsRemaining == 0, "Destination length must be zero if destination buffer pointer is null."); 64Debug.Assert(pInputBuffer <= pFinalPosWhereCanReadDWordFromInputBuffer); 74Debug.Assert(pLastBufferPosProcessed < pInputBuffer, "Algorithm should've made forward progress since last read."); 134Debug.Assert(!Ascii.AllBytesInUInt32AreAscii(secondDWord)); 152Debug.Assert(!Ascii.AllBytesInUInt32AreAscii(thisDWord)); // this should have been handled earlier 224Debug.Assert(outputCharsRemaining == 1); 844Debug.Assert(inputLength >= 0, "Input length must not be negative."); 845Debug.Assert(pInputBuffer != null || inputLength == 0, "Input length must be zero if input buffer pointer is null."); 847Debug.Assert(outputBytesRemaining >= 0, "Destination length must not be negative."); 848Debug.Assert(pOutputBuffer != null || outputBytesRemaining == 0, "Destination length must be zero if destination buffer pointer is null."); 900Debug.Assert(pInputBuffer <= pFinalPosWhereCanReadDWordFromInputBuffer); 910Debug.Assert(pLastBufferPosProcessed < pInputBuffer, "Algorithm should've made forward progress since last read."); 1073Debug.Assert(!Utf16Utility.AllCharsInUInt64AreAscii(possibleNonAsciiQWord)); // this condition should've been checked earlier 1141Debug.Assert(!Utf16Utility.AllCharsInUInt32AreAscii(thisDWord)); // this should have been handled earlier 1418Debug.Assert(inputLength < CharsPerDWord);
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.Validation.cs (9)
28Debug.Assert(inputLength >= 0, "Input length must not be negative."); 29Debug.Assert(pInputBuffer != null || inputLength == 0, "Input length must be zero if input buffer pointer is null."); 79Debug.Assert(pLastBufferPosProcessed < pInputBuffer, "Algorithm should've made forward progress since last read."); 184Debug.Assert((AdvSimd.Arm64.IsSupported && BitConverter.IsLittleEndian) || Sse2.IsSupported); 192Debug.Assert(trailingZeroCount < 16); 229Debug.Assert(!Ascii.AllBytesInUInt32AreAscii(thisDWord)); // this should have been handled earlier 655Debug.Assert(inputLength < 4); 665Debug.Assert(inputBufferRemainingBytes < 4); 737Debug.Assert(pOriginalInputBuffer + originalInputLength == pInputBuffer, "About to return an unexpected value.");
src\libraries\System.Private.CoreLib\src\System\Text\UnicodeEncoding.cs (32)
347Debug.Assert(chars is not null, "[UnicodeEncoding.GetByteCount]chars!=null"); 348Debug.Assert(count >= 0, "[UnicodeEncoding.GetByteCount]count >=0"); 491Debug.Assert(chars > charStart, 559Debug.Assert(chars > charStart, 626Debug.Assert(fallbackBuffer is null || fallbackBuffer.Remaining == 0, 636Debug.Assert(chars is not null, "[UnicodeEncoding.GetBytes]chars!=null"); 637Debug.Assert(byteCount >= 0, "[UnicodeEncoding.GetBytes]byteCount >=0"); 638Debug.Assert(charCount >= 0, "[UnicodeEncoding.GetBytes]charCount >=0"); 639Debug.Assert(bytes is not null, "[UnicodeEncoding.GetBytes]bytes!=null"); 776Debug.Assert(chars > charStart, 844Debug.Assert(chars > charStart + 1 || bytes == byteStart, 873Debug.Assert(chars > charStart, 908Debug.Assert(chars > charStart, 975Debug.Assert((encoder is not null && !encoder.MustFlush) || charLeftOver == (char)0, 978Debug.Assert(fallbackBuffer is null || fallbackBuffer.Remaining == 0 || 987Debug.Assert(bytes is not null, "[UnicodeEncoding.GetCharCount]bytes!=null"); 988Debug.Assert(count >= 0, "[UnicodeEncoding.GetCharCount]count >=0"); 1022Debug.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, 1293Debug.Assert(fallbackBuffer is null || fallbackBuffer.Remaining == 0, 1302Debug.Assert(chars is not null, "[UnicodeEncoding.GetChars]chars!=null"); 1303Debug.Assert(byteCount >= 0, "[UnicodeEncoding.GetChars]byteCount >=0"); 1304Debug.Assert(charCount >= 0, "[UnicodeEncoding.GetChars]charCount >=0"); 1305Debug.Assert(bytes is not null, "[UnicodeEncoding.GetChars]bytes!=null"); 1321Debug.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, 1473Debug.Assert(bytes >= byteStart + 2 || chars == charStart, 1522Debug.Assert(bytes >= byteStart + 2 || chars == charStart, 1539Debug.Assert(bytes >= byteStart + 2 || chars == charStart, 1581Debug.Assert(bytes >= byteStart + 2 || chars == charStart, 1598Debug.Assert(bytes >= byteStart + 2 || chars == charStart, 1643Debug.Assert(bytes >= byteStart + 2 || chars == charStart, 1699Debug.Assert(!decoder.MustFlush || ((lastChar == (char)0) && (lastByte == -1)), 1709Debug.Assert(fallbackBuffer is null || fallbackBuffer.Remaining == 0,
src\libraries\System.Private.CoreLib\src\System\Text\UTF32Encoding.cs (26)
355Debug.Assert(chars is not null, "[UTF32Encoding.GetByteCount]chars!=null"); 356Debug.Assert(count >= 0, "[UTF32Encoding.GetByteCount]count >=0"); 419Debug.Assert(chars > charStart, 477Debug.Assert(fallbackBuffer.Remaining == 0, 487Debug.Assert(chars is not null, "[UTF32Encoding.GetBytes]chars!=null"); 488Debug.Assert(bytes is not null, "[UTF32Encoding.GetBytes]bytes!=null"); 489Debug.Assert(byteCount >= 0, "[UTF32Encoding.GetBytes]byteCount >=0"); 490Debug.Assert(charCount >= 0, "[UTF32Encoding.GetBytes]charCount >=0"); 560Debug.Assert(chars > charStart + 1 || bytes == byteStart, 588Debug.Assert(chars > charStart, 633Debug.Assert(chars > charStart, 670Debug.Assert(highSurrogate == 0 || (encoder is not null && !encoder.MustFlush), 688Debug.Assert(bytes is not null, "[UTF32Encoding.GetCharCount]bytes!=null"); 689Debug.Assert(count >= 0, "[UTF32Encoding.GetCharCount]count >=0"); 714Debug.Assert(fallbackBuffer.Remaining == 0, 821Debug.Assert(fallbackBuffer.Remaining == 0, 831Debug.Assert(chars is not null, "[UTF32Encoding.GetChars]chars!=null"); 832Debug.Assert(bytes is not null, "[UTF32Encoding.GetChars]bytes!=null"); 833Debug.Assert(byteCount >= 0, "[UTF32Encoding.GetChars]byteCount >=0"); 834Debug.Assert(charCount >= 0, "[UTF32Encoding.GetChars]charCount >=0"); 858Debug.Assert(baseDecoder is not null); 863Debug.Assert(fallbackBuffer.Remaining == 0, 928Debug.Assert(bytes >= byteStart + 4 || chars == charStart, 951Debug.Assert(bytes >= byteStart + 4 || chars == charStart, 968Debug.Assert(bytes >= byteStart + 4 || chars == charStart, 1036Debug.Assert(fallbackBuffer.Remaining == 0,
src\libraries\System.Private.CoreLib\src\System\Text\UTF7Encoding.cs (15)
62Debug.Assert(_base64Bytes.Length == 64); 391Debug.Assert(chars is not null, "[UTF7Encoding.GetByteCount]chars!=null"); 392Debug.Assert(count >= 0, "[UTF7Encoding.GetByteCount]count >=0"); 401Debug.Assert(byteCount >= 0, "[UTF7Encoding.GetBytes]byteCount >=0"); 402Debug.Assert(chars is not null, "[UTF7Encoding.GetBytes]chars!=null"); 403Debug.Assert(charCount >= 0, "[UTF7Encoding.GetBytes]charCount >=0"); 540Debug.Assert(count >= 0, "[UTF7Encoding.GetCharCount]count >=0"); 541Debug.Assert(bytes is not null, "[UTF7Encoding.GetCharCount]bytes!=null"); 550Debug.Assert(byteCount >= 0, "[UTF7Encoding.GetChars]byteCount >=0"); 551Debug.Assert(bytes is not null, "[UTF7Encoding.GetChars]bytes!=null"); 552Debug.Assert(charCount >= 0, "[UTF7Encoding.GetChars]charCount >=0"); 571Debug.Assert(!firstByte || decoder.bitCount <= 0, 849Debug.Assert(iCount < 0, "[DecoderUTF7FallbackBuffer.Fallback] Can't have recursive fallbacks"); 850Debug.Assert(bytesUnknown.Length == 1, "[DecoderUTF7FallbackBuffer.Fallback] Only possible fallback case should be 1 unknown byte"); 902Debug.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\Text\UTF8Encoding.Sealed.cs (6)
57Debug.Assert(s != null); 58Debug.Assert(s.Length <= MaxSmallInputElementCount); 68Debug.Assert(0 <= bytesWritten && bytesWritten <= s.Length * MaxUtf8BytesPerChar); 135Debug.Assert(bytes != null); 136Debug.Assert(bytes.Length <= MaxSmallInputElementCount); 146Debug.Assert(0 <= charsWritten && charsWritten <= sourceLength); // should never have more output chars than input bytes
src\libraries\System.Private.CoreLib\src\System\Text\ValueStringBuilder.AppendFormat.cs (3)
85Debug.Assert(format[pos - 1] == '{'); 86Debug.Assert(ch != '{'); 189Debug.Assert(format[pos] == '}');
src\libraries\System.Private.CoreLib\src\System\Threading\AsyncLocal.cs (6)
51Debug.Assert(_valueChangedHandler is not null); 104Debug.Assert(asyncLocalValueMap is not null); 105Debug.Assert(asyncLocalValueMap == Empty || asyncLocalValueMap.GetType() != typeof(EmptyAsyncLocalValueMap)); 392Debug.Assert(keyValues.Length is >= 5 and <= MaxMultiElements); 522Debug.Assert(index == MultiElementAsyncLocalValueMap.MaxMultiElements); 535Debug.Assert(map.Count == count - 1);
src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (20)
327Debug.Assert(IsCancellationRequested); 346Debug.Assert(IsCancellationCompleted, "Expected cancellation to have finished"); 589Debug.Assert(this != s_neverCanceledSource, "This source should never be exposed via a CancellationToken."); 590Debug.Assert(callback is Action<object?> || callback is Action<object?, CancellationToken>); 625Debug.Assert(node.Prev == null, "Nodes in the free list should all have a null Prev"); 683Debug.Assert(id != 0, "IDs should never be the reserved value 0."); 701Debug.Assert(IsCancellationCompleted, "Expected cancellation to have finished"); 737Debug.Assert(IsCancellationRequested, "ExecuteCallbackHandlers should only be called after setting IsCancellationRequested->true"); 774Debug.Assert(node.Registrations.Source == this); 775Debug.Assert(node.Prev == null); 991Debug.Assert(d is Action<object?> || d is Action<object?, CancellationToken>); 1037Debug.Assert(_locked); 1059Debug.Assert(node != null, "Expected non-null node"); 1060Debug.Assert(node.Registrations == this, "Expected node to come from this registrations instance"); 1088Debug.Assert(node.Prev == null); 1093Debug.Assert(node.Prev != null); 1187Debug.Assert(_locked); 1207Debug.Assert(registrations != null, "Expected non-null parent registrations"); 1216Debug.Assert(Callback != null); 1224Debug.Assert(node.Callback != null);
src\libraries\System.Private.CoreLib\src\System\Threading\DeferredDisposableLifetime.cs (1)
81Debug.Assert(oldCount != 0 && oldCount != -1);
src\libraries\System.Private.CoreLib\src\System\Threading\EventWaitHandle.cs (4)
94Debug.Assert(result != null, "result should be non-null on success"); 107Debug.Assert(result != null, "result should be non-null on success"); 114Debug.Assert(openExistingResult != OpenExistingResult.Success); 125Debug.Assert(openExistingResult == OpenExistingResult.ObjectIncompatibleWithCurrentUserOnly);
src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs (23)
84Debug.Assert(isFlowSuppressed != m_isFlowSuppressed); 250Debug.Assert(threadPoolThread == Thread.CurrentThread); 298Debug.Assert(executionContext != null && !executionContext.m_isDefault, "ExecutionContext argument is Default."); 314Debug.Assert(currentThread == Thread.CurrentThread); 315Debug.Assert(contextToRestore != currentContext); 350Debug.Assert(!Thread.IsThreadStartSupported || Thread.CurrentThread.IsThreadPoolThread); // there are no dedicated threadpool threads on runtimes where we can't start threads 351Debug.Assert(Thread.CurrentThread._executionContext == null, "ThreadPool thread not on Default ExecutionContext."); 352Debug.Assert(Thread.CurrentThread._synchronizationContext == null, "ThreadPool thread not on Default SynchronizationContext."); 357Debug.Assert(previousExecutionCtx != nextExecutionCtx); 364Debug.Assert(previousChangeNotifications != null || nextChangeNotifications != null); 372Debug.Assert(previousExecutionCtx!.m_localValues != null); 373Debug.Assert(nextExecutionCtx!.m_localValues != null); 407Debug.Assert(previousExecutionCtx!.m_localValues != null); 421Debug.Assert(nextExecutionCtx!.m_localValues != null); 456Debug.Assert(!current.IsDefault); 457Debug.Assert(current.m_localValues != null, "Only the default context should have null, and we shouldn't be here on the default context"); 470Debug.Assert(!current.IsDefault); 471Debug.Assert(current.m_localValues != null, "Only the default context should have null, and we shouldn't be here on the default context"); 493Debug.Assert(!current.IsDefault); 494Debug.Assert(current.m_localValues != null, "Only the default context should have null, and we shouldn't be here on the default context"); 513Debug.Assert(newChangeNotifications != null); 514Debug.Assert(Array.IndexOf(newChangeNotifications, local) >= 0); 556Debug.Assert(currentThread == Thread.CurrentThread);
src\libraries\System.Private.CoreLib\src\System\Threading\Interlocked.cs (2)
283Debug.Assert(sizeof(T) == 8); 538Debug.Assert(sizeof(T) == 8);
src\libraries\System.Private.CoreLib\src\System\Threading\IOCompletionCallbackHelper.cs (3)
28Debug.Assert(helper != null, "IOCompletionCallbackHelper cannot be null"); 34Debug.Assert(pNativeOverlapped != null); 52Debug.Assert(callback is IOCompletionCallbackHelper);
src\libraries\System.Private.CoreLib\src\System\Threading\LazyInitializer.cs (3)
70Debug.Assert(target != null); 116Debug.Assert(target != null); 272Debug.Assert(target != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Lock.cs (55)
77Debug.Assert(currentThreadId.IsInitialized); 84Debug.Assert(currentThreadId.IsInitialized); 85Debug.Assert(currentThreadId.Id == _owningThreadId); 234Debug.Assert(timeoutMs >= -1); 239Debug.Assert(!new ThreadId(_owningThreadId).IsInitialized); 240Debug.Assert(_recursionCount == 0); 273Debug.Assert(currentThreadId.IsInitialized); 274Debug.Assert(currentThreadId.Id == ThreadId.Current_NoInitialize.Id); 287Debug.Assert(new ThreadId(_owningThreadId).IsInitialized); 288Debug.Assert(_owningThreadId == ThreadId.Current_NoInitialize.Id); 289Debug.Assert(new State(this).IsLocked); 312Debug.Assert(timeoutMs >= -1); 319Debug.Assert(_owningThreadId != currentThreadId.Id); 327Debug.Assert(new State(this).IsLocked); 372Debug.Assert(IsAdaptiveSpinEnabled(minSpinCountForAdaptiveSpin)); 429Debug.Assert(tryLockResult == TryLockResult.Wait); 451Debug.Assert(tryLockResult == TryLockResult.Wait); 458Debug.Assert(tryLockResult != TryLockResult.Spin); 464Debug.Assert(tryLockResult == TryLockResult.Locked); 467Debug.Assert(!new ThreadId(_owningThreadId).IsInitialized); 468Debug.Assert(_recursionCount == 0); 559Debug.Assert(!new ThreadId(_owningThreadId).IsInitialized); 560Debug.Assert(_recursionCount == 0); 636Debug.Assert(_waitEvent != null); 638Debug.Assert(signaled); 651Debug.Assert(!isHeld || new State(this).IsLocked); 663Debug.Assert(_waitEvent != null); 729Debug.Assert(!IsLocked); 737Debug.Assert(!ShouldNotPreemptWaiters); 738Debug.Assert(HasAnyWaiters); 745Debug.Assert(ShouldNotPreemptWaiters); 753Debug.Assert(HasAnyWaiters || !ShouldNotPreemptWaiters); 773Debug.Assert(HasAnySpinners); 781Debug.Assert(HasAnyWaiters); 782Debug.Assert(NeedToSignalWaiter); 789Debug.Assert(IsWaiterSignaledToWake); 801Debug.Assert(lockObj._state == 0); 824Debug.Assert(HasAnyWaiters); 832Debug.Assert(HasAnyWaiters); 881Debug.Assert(IsLockedMask == 1); 884Debug.Assert(!state.IsLocked); 920Debug.Assert(spinCount >= 0); 942Debug.Assert(!newState.ShouldNotPreemptWaiters); 976Debug.Assert(state.HasAnySpinners); 1004Debug.Assert(new State(state._state + SpinnerCountIncrement).HasAnySpinners); 1008Debug.Assert(state.HasAnyWaiters || !state.ShouldNotPreemptWaiters); 1068Debug.Assert(state.HasAnyWaiters || waiterStartTimeWasReset); 1092Debug.Assert(state.HasAnyWaiters); 1093Debug.Assert(state.IsWaiterSignaledToWake); 1124Debug.Assert(!state.ShouldNotPreemptWaiters || waiterStartTimeWasRecorded); 1148Debug.Assert(new State(state._state + IsWaiterSignaledToWakeMask).IsWaiterSignaledToWake); 1153Debug.Assert(state.HasAnyWaiters); 1183Debug.Assert(!state.ShouldNotPreemptWaiters || waiterStartTimeWasRecorded); 1207Debug.Assert(state.HasAnyWaiters); 1237Debug.Assert(state.HasAnyWaiters);
src\libraries\System.Private.CoreLib\src\System\Threading\Lock.NonNativeAot.cs (4)
53Debug.Assert(!IsInitialized); 54Debug.Assert(t_threadId == 0); 65Debug.Assert(id != 0); 76Debug.Assert(IsInitialized);
src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelLifoSemaphore.cs (19)
26Debug.Assert(initialSignalCount >= 0); 27Debug.Assert(initialSignalCount <= maximumSignalCount); 28Debug.Assert(maximumSignalCount > 0); 29Debug.Assert(spinCount >= 0); 42Debug.Assert(timeoutMs >= -1); 57Debug.Assert(counts.SignalCount <= _maximumSignalCount); 153Debug.Assert(timeoutMs > 0 || timeoutMs == -1); 173Debug.Assert(counts.WaiterCount != 0); 211Debug.Assert(releaseCount > 0); 212Debug.Assert(releaseCount <= _maximumSignalCount); 248Debug.Assert(releaseCount <= _maximumSignalCount - counts.SignalCount); 287Debug.Assert(value <= uint.MaxValue - SignalCount); 295Debug.Assert(SignalCount != 0); 307Debug.Assert(WaiterCount < ushort.MaxValue); 313Debug.Assert(WaiterCount != 0); 320Debug.Assert(countsAfterUpdate.WaiterCount != ushort.MaxValue); // underflow check 331Debug.Assert(SpinnerCount < byte.MaxValue); 337Debug.Assert(SpinnerCount != 0); 359Debug.Assert(CountOfWaitersSignaledToWake != 0);
src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelLock.cs (9)
62Debug.Assert(!isLocked || (_state & LockedMask) != 0); 72Debug.Assert(_ownerThread == Thread.CurrentThread); 74Debug.Assert((_state & LockedMask) != 0); 82Debug.Assert(_ownerThread != Thread.CurrentThread); 90Debug.Assert(_ownerThread == null); 159Debug.Assert((_state & LockedMask) != 0); 187Debug.Assert((uint)state >= WaiterCountIncrement); 192Debug.Assert((_state & LockedMask) != 0); 198Debug.Assert((_state & LockedMask) != 0);
src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelMonitor.cs (4)
36Debug.Assert(IsLocked); 44Debug.Assert(!IsLocked); 52Debug.Assert(_ownerThread == null); 97Debug.Assert(timeoutMilliseconds >= -1);
src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelMonitor.Unix.cs (1)
49Debug.Assert(timeoutMilliseconds >= -1);
src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelSpinWaiter.cs (3)
21Debug.Assert(condition != null); 56Debug.Assert(spinIndex >= 0); 57Debug.Assert(sleep0Threshold >= 0);
src\libraries\System.Private.CoreLib\src\System\Threading\ManualResetEventSlim.cs (11)
86Debug.Assert(m_eventObj != null); 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."); 195Debug.Assert(DEFAULT_SPIN_SP >= 0, "Internal error - DEFAULT_SPIN_SP is outside the legal range."); 196Debug.Assert(DEFAULT_SPIN_SP <= SpinCountState_MaxValue, "Internal error - DEFAULT_SPIN_SP is outside the legal range."); 242Debug.Assert(currentIsSet, 282Debug.Assert(m_lock != null); // if waiters>0, then m_lock has already been created. 658Debug.Assert(obj is ManualResetEventSlim, "Expected a ManualResetEventSlim"); 660Debug.Assert(mre.m_lock != null); // the lock should have been created before this callback is registered for use. 680Debug.Assert((newBits | updateBitsMask) == updateBitsMask, "newBits do not fall within the updateBitsMask.");
src\libraries\System.Private.CoreLib\src\System\Threading\Mutex.cs (4)
116Debug.Assert(result != null, "result should be non-null on success"); 128Debug.Assert(result != null, "result should be non-null on success"); 135Debug.Assert(openExistingResult != OpenExistingResult.Success); 146Debug.Assert(openExistingResult == OpenExistingResult.ObjectIncompatibleWithCurrentUserOnly);
src\libraries\System.Private.CoreLib\src\System\Threading\NamedWaitHandleOptions.cs (4)
82Debug.Assert(WasSpecified); 91Debug.Assert(WasSpecified); 100Debug.Assert(!string.IsNullOrEmpty(name)); 101Debug.Assert(WasSpecified);
src\libraries\System.Private.CoreLib\src\System\Threading\Overlapped.cs (3)
181Debug.Assert(GCHandleCountRef(pNativeOverlapped) == handleCount); 227Debug.Assert(target is Overlapped); 230Debug.Assert(overlapped._pNativeOverlapped == pNativeOverlapped);
src\libraries\System.Private.CoreLib\src\System\Threading\PeriodicTimer.cs (2)
218Debug.Assert(!_stopped, "Unexpectedly stopped without _signaled being true."); 258Debug.Assert(!Monitor.IsEntered(this));
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.Blocking.cs (5)
44Debug.Assert(_numBlockedThreads > 0); 70Debug.Assert(BlockingConfig.IsCooperativeBlockingEnabled); 71Debug.Assert(Thread.CurrentThread.IsThreadPoolThread); 77Debug.Assert(_numBlockedThreads > 0); 123Debug.Assert(_pendingBlockingAdjustment != PendingBlockingAdjustment.None);
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.cs (2)
326Debug.Assert(t_completionCountObject == null); 349Debug.Assert(threadLocalCompletionCountObject != null);
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.GateThread.cs (4)
252Debug.Assert(numRuns >= 0); 253Debug.Assert(numRuns <= MaxRuns); 322Debug.Assert(nextDelay <= GateActivitiesPeriodMs); 340Debug.Assert(HasBlockingAdjustmentDelay);
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.HillClimbing.cs (3)
438Debug.Assert(numSamples >= period); // can't measure a wave that doesn't fit 439Debug.Assert(period >= 2); // can't measure above the Nyquist frequency 440Debug.Assert(numSamples <= samples.Length); // can't measure more samples than we have
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.ThreadCounts.cs (6)
37Debug.Assert(value >= 0); 42Debug.Assert(value >= 0); 55Debug.Assert(value >= 0); 60Debug.Assert(value >= 0); 73Debug.Assert(value > 0); 78Debug.Assert(value > 0);
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WaitThread.cs (11)
127Debug.Assert(current != null, "The wait thread to remove was not found in the list of thread pool wait threads."); 220Debug.Assert(registeredWait != null); 250Debug.Assert(signaledHandleIndex != WaitHandle.WaitAbandoned); // the first wait handle is an event 262Debug.Assert(signaledHandle != null); 276Debug.Assert(registeredHandle != null); 295Debug.Assert(_numPendingRemoves >= 0); 296Debug.Assert(_numPendingRemoves <= _pendingRemoves.Length); 297Debug.Assert(_numUserWaits >= 0); 298Debug.Assert(_numUserWaits <= _registeredWaits.Length); 317Debug.Assert(j < numUserWaits); 405Debug.Assert(success);
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WorkerTracking.cs (3)
87Debug.Assert(Current == HighWatermark); 88Debug.Assert(Current != short.MaxValue); 95Debug.Assert(Current > 0);
src\libraries\System.Private.CoreLib\src\System\Threading\ProcessorIdCache.cs (1)
40Debug.Assert(s_processorIdRefreshRate <= ProcessorIdCacheCountDownMask);
src\libraries\System.Private.CoreLib\src\System\Threading\ReaderWriterLockSlim.cs (30)
149Debug.Assert(_spinLock.IsHeld); 157Debug.Assert(_spinLock.IsHeld); 553Debug.Assert(_fIsReentrant); 554Debug.Assert(_fUpgradeThreadHoldingRead); 587Debug.Assert(_numWriteUpgradeWaiters == 0, "There can be at most one thread with the upgrade lock held."); 611Debug.Assert((_owners & WRITER_HELD) > 0); 615Debug.Assert(lrwc != null, "Initialized based on _fIsReentrant earlier in the method"); 692Debug.Assert((_owners & WRITER_HELD) > 0); 756Debug.Assert(lrwc != null, "Initialized based on _fIsReentrant earlier in the method"); 795Debug.Assert(_owners > 0, "ReleasingReaderLock: releasing lock and no read lock taken"); 799Debug.Assert(lrwc.readercount == 1); 843Debug.Assert((_owners & WRITER_HELD) > 0, "Calling ReleaseWriterLock when no write lock is held"); 907Debug.Assert(_spinLock.IsHeld); 908Debug.Assert(waitEvent == null); 931Debug.Assert(enterLockType == EnterLockType.UpgradeToWrite); 954Debug.Assert(_spinLock.IsHeld); 975Debug.Assert(enterLockType == EnterLockType.UpgradeToWrite); 1067Debug.Assert(_spinLock.IsHeld); 1129Debug.Assert(_spinLock.IsHeld); 1138Debug.Assert(_numReadWaiters != 0 || _numUpgradeWaiters != 0); 1470Debug.Assert( 1490Debug.Assert(DeprioritizeEnterAnyReadIncrement == (1 << 16)); 1499Debug.Assert(DeprioritizeEnterAnyWriteIncrement == 1); 1506Debug.Assert((reason & EnterSpinLockReason.Wait) != 0 || reason == (reason & EnterSpinLockReason.OperationMask)); 1507Debug.Assert( 1516Debug.Assert( 1527Debug.Assert((GetEnterDeprioritizationStateChange(reason) & DeprioritizeEnterAnyWriteIncrement) == 0); 1531Debug.Assert((GetEnterDeprioritizationStateChange(reason) & DeprioritizeEnterAnyWriteIncrement) != 0); 1596Debug.Assert( 1610Debug.Assert(_isLocked, "Exiting spin lock that is not held");
src\libraries\System.Private.CoreLib\src\System\Threading\RegisteredWaitHandle.Portable.cs (8)
91Debug.Assert(!IsInfiniteTimeout); 99Debug.Assert(WaitThread != null); 175Debug.Assert(handleValue == handle!.DangerousGetHandle()); 197Debug.Assert(_numRequestedCallbacks != 0); 275Debug.Assert(IsBlocking); 276Debug.Assert(_unregisterCalled); // Should only be called when the wait is unregistered by the user. 285Debug.Assert(!IsBlocking); 286Debug.Assert(_unregisterCalled); // Should only be called when the wait is unregistered by the user.
src\libraries\System.Private.CoreLib\src\System\Threading\RegisteredWaitHandle.Unix.cs (1)
35Debug.Assert(_waitHandle != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Semaphore.cs (4)
107Debug.Assert(result != null, "result should be non-null on success"); 120Debug.Assert(result != null, "result should be non-null on success"); 127Debug.Assert(openExistingResult != OpenExistingResult.Success); 138Debug.Assert(openExistingResult == OpenExistingResult.ObjectIncompatibleWithCurrentUserOnly);
src\libraries\System.Private.CoreLib\src\System\Threading\SemaphoreSlim.cs (14)
370Debug.Assert(m_asyncTail is not null, "tail should not be null if head isn't"); 402Debug.Assert(!waitSuccessful || m_currentCount > 0, 652Debug.Assert(m_currentCount == 0, "m_currentCount should never be negative"); 665Debug.Assert(Monitor.IsEntered(m_lockObjAndDisposed), "Requires the lock be held"); 673Debug.Assert(m_asyncTail is null, "If head is null, so too should be tail"); 679Debug.Assert(m_asyncTail is not null, "If head is not null, neither should be tail"); 694Debug.Assert(task is not null, "Expected non-null task"); 695Debug.Assert(Monitor.IsEntered(m_lockObjAndDisposed), "Requires the lock be held"); 705Debug.Assert((m_asyncHead is null) == (m_asyncTail is null), "Head is null iff tail is null"); 721Debug.Assert(asyncWaiter is not null, "Waiter should have been constructed"); 722Debug.Assert(Monitor.IsEntered(m_lockObjAndDisposed), "Requires the lock be held"); 811Debug.Assert(m_countOfWaitersPulsedToWake <= waitCount); 839Debug.Assert(m_asyncTail is not null, "tail should not be null if head isn't null"); 913Debug.Assert(obj is SemaphoreSlim, "Expected a SemaphoreSlim");
src\libraries\System.Private.CoreLib\src\System\Threading\SpinLock.cs (4)
117Debug.Assert(!IsThreadOwnerTrackingEnabled, "property should be false by now"); 365Debug.Assert((newOwner & WAITERS_MASK) >= 0); 397Debug.Assert(!IsThreadOwnerTrackingEnabled); // Make sure the waiters never be negative which will cause the thread tracking bit to be flipped 409Debug.Assert(IsThreadOwnerTrackingEnabled);
src\libraries\System.Private.CoreLib\src\System\Threading\SpinWait.cs (4)
105Debug.Assert(value >= 0); 162Debug.Assert(sleep1Threshold >= -1); 163Debug.Assert(sleep1Threshold < 0 || sleep1Threshold >= YieldThreshold); 267Debug.Assert(result);
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 (26)
200Debug.Assert(ReadyToComplete, "The block must be ready to complete to be here."); 211Debug.Assert(state is ConcurrentExclusiveSchedulerPair); 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 (6)
402Debug.Assert(!IsCompleted, "The promise must not yet be completed."); 410Debug.Assert(success); 444Debug.Assert(!IsWaitNotificationEnabledOrNotRanToCompletion, 463Debug.Assert(IsCompletedSuccessfully, "Task<T>.Result getter: Expected result to have been set."); 487Debug.Assert(m_action != null); 1424Debug.Assert(task != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\FutureFactory.cs (31)
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"); 1270Debug.Assert(thisRef != null); 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"); 1634Debug.Assert(continuationAction != null); 1655Debug.Assert((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 1679Debug.Assert(state is Func<Task[], TResult>); 1686Debug.Assert(continuationAction != null); 1691Debug.Assert(state is Action<Task[]>); 1979Debug.Assert((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 1999Debug.Assert(state is Func<Task, TResult>); 2006Debug.Assert(continuationAction != null); 2010Debug.Assert(state is Action<Task>); 2029Debug.Assert((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 2052Debug.Assert(continuationAction != 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 (121)
185Debug.Assert(task != null, "Null Task objects can't be added to the ActiveTasks collection"); 326Debug.Assert(promiseStyle, "Promise CTOR: promiseStyle was false"); 519Debug.Assert(m_contingentProperties == null || m_contingentProperties.m_capturedContext == null, 563Debug.Assert(illegalInternalOptions == 0, "TaskConstructorCore: Illegal internal options"); 567Debug.Assert(m_stateFlags == 0, "TaskConstructorCore: non-zero m_stateFlags"); 568Debug.Assert((((int)creationOptions) | (int)TaskStateFlags.OptionsMask) == (int)TaskStateFlags.OptionsMask, "TaskConstructorCore: options take too many bits"); 595Debug.Assert((internalOptions & InternalTaskOptions.ContinuationTask) == 0, "TaskConstructorCore: Did not expect to see cancelable token for continuation task."); 637Debug.Assert(continuation != null); 683Debug.Assert(((int)TaskStateFlags.OptionsMask & 1) == 1, "OptionsMask needs a shift in Options.get"); 738Debug.Assert((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) != 0, 746Debug.Assert(success, "Tried to set enabled on completed Task"); 776Debug.Assert(tasks != null, "Expected non-null array of tasks"); 813Debug.Assert(isWaitNotificationEnabled, "Should only be called if the wait completion bit is set."); 832Debug.Assert(IsWaitNotificationEnabled, "Should only be called if the wait completion bit is set."); 873Debug.Assert(InternalCurrent == this, "Task.AddNewChild(): Called from an external context"); 894Debug.Assert(InternalCurrent == this, "Task.DisregardChild(): Called from an external context"); 897Debug.Assert(props.m_completionCountdown >= 2, "Task.DisregardChild(): Expected parent count to be >= 2"); 1042Debug.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"); 1991Debug.Assert(userDelegateExecute || m_contingentProperties != null); 2153Debug.Assert(childTask != null); 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"); 2198Debug.Assert(props != null); 2216Debug.Assert(task.IsCompleted, "Expected all tasks in list to be completed"); 2220Debug.Assert(exceptionHolder != null); 2382Debug.Assert(obj is Task); 2393Debug.Assert(m_action != null, "Null action in InnerInvoke()"); 2415Debug.Assert(unhandledException != null); 2487Debug.Assert(continuationAction != null); 2532Debug.Assert(!flowExecutionContext, "We already determined we're not required to flow context."); 2558Debug.Assert(stateMachineBox != null); 2631Debug.Assert(waitResult, "expected wait to succeed"); 2787Debug.Assert((m_stateFlags & (int)TaskStateFlags.Faulted) == 0, "Task.Wait() completing when in Faulted state."); 2864Debug.Assert(source != null); 2865Debug.Assert(millisecondsDelay != 0); 2919Debug.Assert(completingTask.IsCompleted); 3012Debug.Assert(IsCompleted || millisecondsTimeout != Timeout.Infinite); 3168Debug.Assert((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) == 0, "Task.InternalCancel() did not expect promise-style task"); 3240Debug.Assert((m_stateFlags & IllegalFlags) == 0, "The continuation was in an invalid state."); 3241Debug.Assert((m_stateFlags & (int)TaskStateFlags.WaitingForActivation) != 0, "Expected continuation to be waiting for activation"); 3242Debug.Assert(m_contingentProperties is null || m_contingentProperties.m_cancellationToken == default); 3260Debug.Assert((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) != 0, "Task.RecordInternalCancellationRequest(CancellationToken) only valid for promise-style task"); 3263Debug.Assert(m_contingentProperties!.m_cancellationToken == default); 3280Debug.Assert(edi != null, "Expected either an OCE or an EDI"); 3282Debug.Assert(oce != null, "Expected EDI to contain an OCE"); 3284Debug.Assert(oce.CancellationToken == tokenToRecord, 3295Debug.Assert((m_stateFlags & ((int)TaskStateFlags.Canceled | (int)TaskStateFlags.CompletionReserved)) != 0, "Task.CancellationCleanupLogic(): Task not canceled or reserved."); 3327Debug.Assert(this == InternalCurrent, "SetCancellationAcknowledged() should only be called while this is still the current task"); 3328Debug.Assert(IsCancellationRequested, "SetCancellationAcknowledged() should not be called if the task's CT wasn't signaled"); 3365Debug.Assert(exceptionObject != null, "Expected non-null exceptionObject argument"); 3368Debug.Assert( 3410Debug.Assert( 3456Debug.Assert(continuationObject != null); 3558Debug.Assert(currentContinuation is TaskContinuation); 3595Debug.Assert(currentContinuation is ITaskCompletionAction); 4454Debug.Assert(continuationTask != null, "Task.ContinueWithCore(): null continuationTask"); 4455Debug.Assert(scheduler != null, "Task.ContinueWithCore(): null scheduler"); 4456Debug.Assert(!continuationTask.IsCompleted, "Did not expect continuationTask to be completed"); 4538Debug.Assert(tc != null, "Expected non-null tc object in AddTaskContinuationComplex"); 4541Debug.Assert(oldValue is not null, "Expected non-null m_continuationObject object"); 4577Debug.Assert(oldValue == s_taskCompletionSentinel, "Expected m_continuationObject to be list or sentinel"); 4615Debug.Assert(tc != null); 4714Debug.Assert(waitResult, "expected wait to succeed"); 4737Debug.Assert(waitResult, "expected wait to succeed"); 5059Debug.Assert(exceptions != null, "Should have seen at least one exception"); 5088Debug.Assert(tasks != null, "Expected a non-null list of tasks"); 5089Debug.Assert(tasks.Count > 0, "Expected at least one task"); 5135Debug.Assert(count > 0, "Expected count > 0"); 5142Debug.Assert(_count >= 0, "Count should never go below 0"); 5185Debug.Assert(tasks.Length == 0 || waitResult != -1, "expected wait to succeed"); 5360Debug.Assert(firstCompleted.Status == TaskStatus.RanToCompletion); 5362Debug.Assert(signaledTaskIndex >= 0); 5447Debug.Assert(succeeded, "This should always succeed on a new task."); 5461Debug.Assert(succeeded, "This should always succeed on a new task."); 5491Debug.Assert(exception != null); 5495Debug.Assert(succeeded, "This should always succeed on a new task."); 5505Debug.Assert(exception != null); 5509Debug.Assert(succeeded, "This should always succeed on a new task."); 5798Debug.Assert(millisecondsDelay != 0); 5857Debug.Assert(token.CanBeCanceled); 6038Debug.Assert(tasks.Length != 0, "Expected a non-zero length task array"); 6039Debug.Assert(m_stateObject is null, "Expected to be able to use the state object field for faulted/canceled tasks."); 6123Debug.Assert(failedOrCanceled is List<Task>); 6146Debug.Assert(completed); 6178Debug.Assert(failedOrCanceled is Task); 6184Debug.Assert(observedExceptions.Count > 0, "Expected at least one exception"); 6196Debug.Assert(IsCompleted); 6199Debug.Assert(_remainingToComplete >= 0, "Count should never go below 0"); 6392Debug.Assert(tasks != null, "Expected a non-null task array"); 6393Debug.Assert(tasks.Length > 0, "Expected a non-zero length task array"); 6431Debug.Assert(task != null, "Constituent task in WhenAll should never be null"); 6444Debug.Assert(task.Status == TaskStatus.RanToCompletion); 6456Debug.Assert(observedExceptions.Count > 0, "Expected at least one exception"); 6477Debug.Assert(m_count >= 0, "Count should never go below 0"); 6618Debug.Assert(task1 != null && task2 != null); 6654Debug.Assert(task1 != null && task2 != null); 6655Debug.Assert(task1.IsCompleted || task2.IsCompleted); 6678Debug.Assert(success, "Only one task should have gotten to this point, and thus this must be successful."); 6926Debug.Assert(_waitForNextCompletedTask.GetStatus(_waitForNextCompletedTask.Version) == ValueTaskSourceStatus.Pending); 7047Debug.Assert(outerTask != null); 7390Debug.Assert(outerTask != null, "Expected non-null outerTask"); 7444Debug.Assert(result, "Expected TrySetFromTask from inner task to succeed"); 7471Debug.Assert(task != null && task.IsCompleted, "Expected non-null, completed outer task"); 7472Debug.Assert(_state == STATE_WAITING_ON_OUTER_TASK, "We're in the wrong state!"); 7484Debug.Assert(result, "Expected TrySetFromTask from outer task to succeed"); 7501Debug.Assert(task != null && task.IsCompleted, "TrySetFromTask: Expected task to have completed.");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskAsyncEnumerableExtensions.ToBlockingEnumerable.cs (2)
48Debug.Assert(moveNextTask.IsCompleted); 66Debug.Assert(disposeTask.IsCompleted);
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 (30)
18Debug.Assert(action is Action<Task> || action is Action<Task, object?>, 31Debug.Assert(antecedent != null, 39Debug.Assert(m_action != null); 64Debug.Assert(function is Func<Task, TResult> || function is Func<Task, object?, TResult>, 77Debug.Assert(antecedent != null, 85Debug.Assert(m_action != null); 110Debug.Assert(action is Action<Task<TAntecedentResult>> || action is Action<Task<TAntecedentResult>, object?>, 123Debug.Assert(antecedent != null, 131Debug.Assert(m_action != null); 156Debug.Assert(function is Func<Task<TAntecedentResult>, TResult> || function is Func<Task<TAntecedentResult>, object?, TResult>, 169Debug.Assert(antecedent != null, 177Debug.Assert(m_action != null); 216Debug.Assert(task != null); 217Debug.Assert(task.m_taskScheduler != null); 274Debug.Assert(task != null, "TaskContinuation ctor: task is null"); 275Debug.Assert(scheduler != null, "TaskContinuation ctor: scheduler is null"); 291Debug.Assert(completedTask != null); 292Debug.Assert(completedTask.IsCompleted, "ContinuationTask.Run(): completedTask not completed"); 295Debug.Assert(continuationTask != null); 369Debug.Assert(state is Action); 385Debug.Assert(context != null); 418Debug.Assert(state is SynchronizationContextAwaitTaskContinuation); 466Debug.Assert(scheduler != null); 534Debug.Assert(action != null); 549Debug.Assert(action != null); 550Debug.Assert(scheduler != null); 669Debug.Assert(state is Action); 683Debug.Assert(callback != null); 684Debug.Assert(currentTask == Task.t_currentTask); 826Debug.Assert(m_action != null);
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 (10)
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"); 1598Debug.Assert(tasksCopy != null); 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"); 1668Debug.Assert(tasksCopy != null); 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."); 2338Debug.Assert(tasks != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskScheduler.cs (3)
226Debug.Assert(task != null); 506Debug.Assert(scheduler != null, "Table returned an incorrect Count or CopyTo failed"); 599Debug.Assert(s is Task);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ThreadPoolTaskScheduler.cs (1)
34Debug.Assert(s is Task);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TplEventSource.cs (1)
546Diagnostics.Debug.Assert(stateMachineBox != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ValueTask.cs (13)
175Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 301Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 324Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 346Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 373Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 394Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 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."); 576Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 708Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 731Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 753Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 780Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 804Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>);
src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs (10)
43Debug.Assert(state != null); 295Debug.Assert(startHelper != null); 415Debug.Assert(ThreadState.HasFlag(ThreadState.Unstarted) || this == CurrentThread); 416Debug.Assert(IsThreadPoolThread); 428Debug.Assert(this == CurrentThread); 429Debug.Assert(!IsThreadStartSupported || IsThreadPoolThread); // there are no dedicated threadpool threads on runtimes where we can't start threads 440Debug.Assert(this == CurrentThread); 441Debug.Assert(!IsThreadStartSupported || IsThreadPoolThread); // there are no dedicated threadpool threads on runtimes where we can't start threads 442Debug.Assert(_mayNeedResetForThreadPool); 714Debug.Assert(slot.Data != null);
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadBlockingInfo.cs (8)
66Debug.Assert(objectPtr != null); 77Debug.Assert(_objectPtr != null); 78Debug.Assert(t_first != null); 79Debug.Assert(t_first->_next == _next); 95Debug.Assert(_objectPtr != null); 114Debug.Assert(_objectKind == ObjectKind.Condition); 134Debug.Assert(_objectPtr != null); 147Debug.Assert(_objectKind == ObjectKind.Condition);
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadInt64PersistentCounter.cs (7)
31Debug.Assert(threadLocalCountObject is ThreadLocalNode); 38Debug.Assert(threadLocalCountObject is ThreadLocalNode); 45Debug.Assert(threadLocalCountObject is ThreadLocalNode); 118Debug.Assert(counter != null); 170Debug.Assert(count != 0); 185Debug.Assert(count != 0); 211Debug.Assert(node != null);
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadLocal.cs (8)
178Debug.Assert(id >= 0 || !_initialized, "expected id >= 0 if initialized"); 185Debug.Assert(_linkedSlot != null, "Should be non-null if not yet disposed"); 353Debug.Assert(ts_finalizationHelper != null, "Should have been initialized when this thread's slot array was created."); 396Debug.Assert(_linkedSlot != null, "Should only be null if disposed"); 519Debug.Assert(table.Length < minLength); 557Debug.Assert(minSize > 0); 712Debug.Assert(slotArray != null); 751Debug.Assert(linkedSlot._previous != null);
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolBoundHandle.Portable.cs (1)
81Debug.Assert(wrapper._boundHandle != null);
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (37)
42Debug.Assert(queue != null); 46Debug.Assert(Array.IndexOf(oldQueues, queue) < 0); 60Debug.Assert(queue != null); 193Debug.Assert(m_headIndex <= m_tailIndex); 211Debug.Assert(unused == null || unused == obj); 476Debug.Assert(s_assignableWorkItemQueueCount > 0); 487Debug.Assert(count >= 0); 518Debug.Assert(s_assignableWorkItemQueueCount > 0); 533Debug.Assert(_assignedWorkItemQueueThreadCounts[queueIndex] >= 0); 556Debug.Assert(s_assignableWorkItemQueueCount > 0); 564Debug.Assert(newCount >= 0); 592Debug.Assert(ThreadPoolWorkQueueThreadLocals.threadLocals == null); 633Debug.Assert((callback is IThreadPoolWorkItem) ^ (callback is Task)); 702Debug.Assert((workItem is IThreadPoolWorkItem) ^ (workItem is Task)); 845Debug.Assert(c > 0, "There must at least be a queue for this thread."); 869Debug.Assert(!tl.isProcessingHighPriorityWorkItems); 967Debug.Assert(workQueue._separated.queueProcessingStage == QueueProcessingStage.Scheduled); 996Debug.Assert(workQueue._separated.queueProcessingStage != QueueProcessingStage.NotScheduled); 1010Debug.Assert(stageBeforeUpdate != QueueProcessingStage.NotScheduled); 1043Debug.Assert(workQueue._nextWorkItemToProcess == null); 1054Debug.Assert(workQueue._separated.queueProcessingStage != QueueProcessingStage.NotScheduled); 1068Debug.Assert(stageBeforeUpdate != QueueProcessingStage.NotScheduled); 1226Debug.Assert(ThreadPool.EnableWorkerTracking); 1227Debug.Assert(currentThread == Thread.CurrentThread); 1254Debug.Assert(workItem is IThreadPoolWorkItem); 1477Debug.Assert(_executed, "A QueueUserWorkItemCallback was never called!"); 1485Debug.Assert(!Interlocked.Exchange(ref _executed, true), "A QueueUserWorkItemCallback was called twice!"); 1498Debug.Assert(quwi._callback != null); 1507Debug.Assert(context != null); 1530Debug.Assert(callback != null); 1541Debug.Assert(_callback != null); 1556Debug.Assert(callback != null); 1567Debug.Assert(_callback != null); 1584Debug.Assert(callback != null); 1595Debug.Assert(_callback != null); 1640Debug.Assert(helper != null, "Null state passed to PerformWaitOrTimerCallback!"); 1940Debug.Assert(null != workItem);
src\libraries\System.Private.CoreLib\src\System\Threading\TimeoutHelper.cs (1)
33Debug.Assert(originalWaitMillisecondsTimeout != Timeout.Infinite);
src\libraries\System.Private.CoreLib\src\System\Threading\Timer.cs (10)
206Debug.Assert(timer._dueTime != Timeout.UnsignedInfinite, "A timer in the list must have a valid due time."); 376Debug.Assert(timer._dueTime != Timeout.UnsignedInfinite, "Expected timer to be on a list."); 377Debug.Assert(timer._short != shortList, "Unnecessary if timer is already on the right list."); 408Debug.Assert(timer._short); 413Debug.Assert(!timer._short); 434Debug.Assert(ActiveCount >= 0); 585Debug.Assert(toSignal != null); 651Debug.Assert( 702Debug.Assert(toSignal is WaitHandle || toSignal is Task); 740Debug.Assert(state is TimerQueueTimer);
src\libraries\System.Private.CoreLib\src\System\Threading\TimerQueue.Portable.cs (2)
31Debug.Assert(s_scheduledTimers == null); 52Debug.Assert((int)actualDuration >= 0);
src\libraries\System.Private.CoreLib\src\System\Threading\WaitHandle.cs (9)
113Debug.Assert(millisecondsTimeout >= -1); 242Debug.Assert(waitHandles.Length > 0); 243Debug.Assert(waitHandles.Length <= MaxWaitHandles); 282Debug.Assert(lastSafeWaitHandle != null); 367Debug.Assert(safeWaitHandles.Length != 0); 368Debug.Assert(safeWaitHandles.Length <= MaxWaitHandles); 369Debug.Assert(millisecondsTimeout >= -1); 380Debug.Assert(safeWaitHandles[i] != null); 390Debug.Assert(safeWaitHandles[i] != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Win32ThreadPoolNativeOverlapped.cs (6)
109Debug.Assert(dataArray![dataIndex] == data); 117Debug.Assert(callback != null); 188Debug.Assert(!data._completed); 193Debug.Assert(data._callback != null, "Does CompleteWithCallback called after Reset?"); 218Debug.Assert(state != null); 230Debug.Assert(data._callback != null, "Does OnExecutionContextCallback called after Reset?");
src\libraries\System.Private.CoreLib\src\System\Threading\Win32ThreadPoolNativeOverlapped.OverlappedData.cs (1)
23Debug.Assert(_boundHandle == null); //not in use
src\libraries\System.Private.CoreLib\src\System\ThrowHelper.cs (1)
714Debug.Assert(array.Length - offset < count);
src\libraries\System.Private.CoreLib\src\System\TimeOnly.cs (4)
862Debug.Assert(result != ParseFailureKind.None); 869Debug.Assert(result == ParseFailureKind.Format_DateTimeOnlyContainsNoneDateParts); 929Debug.Assert(charsWritten == destination.Length); 935Debug.Assert(charsWritten == destination.Length);
src\libraries\System.Private.CoreLib\src\System\TimeSpan.cs (2)
442System.Diagnostics.Debug.Assert(minUnits < 0); 443System.Diagnostics.Debug.Assert(maxUnits > 0);
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 (9)
315Debug.Assert(rule.NoDaylightTransitions, "GetPreviousAdjustmentRule should only be used with NoDaylightTransitions rules."); 316Debug.Assert(_adjustmentRules != null); 615Debug.Assert(e is InvalidTimeZoneException, 842Debug.Assert(dateTime.Kind != DateTimeKind.Utc); 1173Debug.Assert(result == null || ruleIndex.HasValue, "If an AdjustmentRule was found, ruleIndex should also be set."); 1895Debug.Assert(rule == null || ruleIndex.HasValue, 2044Debug.Assert(zone != null); 2055Debug.Assert(Monitor.IsEntered(cachedData)); 2123Debug.Assert(!Invariant);
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.FullGlobalizationData.Unix.cs (1)
77Debug.Assert(!GlobalizationMode.Invariant);
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.cs (5)
289Debug.Assert(Monitor.IsEntered(cachedData)); 315Debug.Assert(Monitor.IsEntered(cachedData)); 925Debug.Assert(!date.IsEmpty); 926Debug.Assert(date[0] == 'J'); 957Debug.Assert(i > 0 && i < days.Length);
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.NonAndroid.cs (5)
75Debug.Assert(!Invariant); 309Debug.Assert(!Invariant); 351Debug.Assert(!Invariant); 414Debug.Assert(!Invariant); 488Debug.Assert(!Invariant);
src\libraries\System.Private.CoreLib\src\System\TypedReference.cs (1)
56Debug.Assert(targetType.IsValueType);
src\libraries\System.Private.CoreLib\src\System\UInt128.cs (12)
547Debug.Assert(value >= 0); 548Debug.Assert(double.IsFinite(value)); 549Debug.Assert(value < TwoPow128); 1094Debug.Assert(left.Length >= right.Length); 1114Debug.Assert(q <= 0xFFFFFFFF); 1168Debug.Assert(left.Length >= 1); 1169Debug.Assert(right.Length >= 1); 1170Debug.Assert(left.Length >= right.Length); 1234Debug.Assert(carry == (t + 1)); 1240Debug.Assert(carry == 1); 1264Debug.Assert(left.Length >= right.Length); 1265Debug.Assert(q <= 0xFFFFFFFF);
src\libraries\System.Private.CoreLib\src\System\Version.cs (3)
85Debug.Assert(version != null); 175Debug.Assert(success); 205Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
src\libraries\System.Private.CoreLib\src\System\WeakReference.cs (1)
223Debug.Assert(this.GetType() != typeof(WeakReference));
src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeName.cs (2)
345Debug.Assert(_fullName is not null); 391Debug.Assert(rootTypeName._fullName is not null);
src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeNameParser.cs (1)
275Debug.Assert(nestedNameLength > 0, "TryGetTypeNameInfo should return error on zero lengths");
src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeNameParserHelpers.cs (1)
188Debug.Assert(rankOrModifier >= 2);
src\System\Array.CoreCLR.cs (12)
111Debug.Assert(elementType.IsPrimitiveType()); 128Debug.Assert(sourceArray.Rank == destinationArray.Rank); 251Debug.Assert(!destTH.IsTypeDesc && destTH.AsMethodTable()->IsValueType); 252Debug.Assert(!RuntimeHelpers.GetMethodTable(sourceArray)->GetArrayElementTypeHandle().AsMethodTable()->IsValueType); 293Debug.Assert(!srcTH.IsTypeDesc && srcTH.AsMethodTable()->IsValueType); 294Debug.Assert(!RuntimeHelpers.GetMethodTable(destinationArray)->GetArrayElementTypeHandle().AsMethodTable()->IsValueType); 380Debug.Assert(totalByteLength % (nuint)sizeof(IntPtr) == 0); 427Debug.Assert(Rank == 1); 443Debug.Assert(indices.Length == Rank); 457Debug.Assert((nuint)flattenedIndex < (nuint)LongLength); 482Debug.Assert((nuint)flattenedIndex < NativeLength); 523Debug.Assert((nuint)flattenedIndex < NativeLength);
src\System\Attribute.CoreCLR.cs (13)
18Debug.Assert(element != null); 19Debug.Assert(type != null); 20Debug.Assert(type.IsSubclassOf(typeof(Attribute)) || type == typeof(Attribute)); 88Debug.Assert(property != null); 122Debug.Assert(element != null); 123Debug.Assert(type != null); 124Debug.Assert(type.IsSubclassOf(typeof(Attribute)) || type == typeof(Attribute)); 162Debug.Assert(ev != null); 180Debug.Assert(element != null); 211Debug.Assert(param != null); 239Debug.Assert(param != null); 328Debug.Assert(param != null); 329Debug.Assert(type != null);
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\Collections\Generic\ComparerHelpers.cs (2)
30Debug.Assert(type != null && type is RuntimeType); 64Debug.Assert(type != null && type is RuntimeType);
src\System\Delegate.CoreCLR.cs (4)
203Debug.Assert( 437Debug.Assert(type.IsAssignableTo(typeof(MulticastDelegate))); 498Debug.Assert(ptr != null); 499Debug.Assert(ptr == GetMulticastInvoke(pMT));
src\System\Enum.CoreCLR.cs (4)
20Debug.Assert(rt.IsActualEnum); 69Debug.Assert(s_underlyingTypes[(int)CorElementType.ELEMENT_TYPE_U] == typeof(nuint)); 74Debug.Assert(underlyingType != null); 116Debug.Assert(values!.GetType() == typeof(TStorage[]));
src\System\Exception.CoreCLR.cs (1)
71Debug.Assert(methodInfo != null);
src\System\GC.CoreCLR.cs (7)
541Debug.Assert(status == StartNoGCRegionStatus.Succeeded); 734Debug.Assert(false); 747Debug.Assert(pWorkItem->scheduled); 882Debug.Assert(name != null); 883Debug.Assert(configurationContext != null); 886Debug.Assert(context.Configurations != null); 997Debug.Assert(status == RefreshMemoryStatus.Succeeded);
src\System\MulticastDelegate.CoreCLR.cs (7)
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"); 125Debug.Assert(d != null); 126Debug.Assert(_invocationList is object[]); 135Debug.Assert(invocationList[i] is Delegate); 200Debug.Assert(!IsUnmanagedFunctionPtr(), "dynamic method and unmanaged fntptr delegate combined"); 297Debug.Assert(_invocationList is object[]);
src\System\Object.CoreCLR.cs (1)
31Debug.Assert(clone != this);
src\System\Reflection\Associates.cs (3)
48Debug.Assert(declaredType != null); 49Debug.Assert(reflectedType != null); 67Debug.Assert(!associateMethodHandle.IsNullHandle(), "Failed to resolve associateRecord methodDef token");
src\System\Reflection\Emit\DynamicILGenerator.cs (2)
300Debug.Assert(opcode.Equals(OpCodes.Calli), 745Debug.Assert(m_exceptions != null);
src\System\Reflection\Emit\DynamicMethod.CoreCLR.cs (2)
105Debug.Assert(_methodHandle != null); 106Debug.Assert(_parameterTypes != null);
src\System\Reflection\Emit\RuntimeAssemblyBuilder.cs (1)
89Debug.Assert(name is not null);
src\System\Reflection\Emit\RuntimeILGenerator.cs (22)
30Debug.Assert(incoming != null); 87Debug.Assert(methodBuilder != null); 88Debug.Assert(methodBuilder is MethodBuilder || methodBuilder is DynamicMethod); 158Debug.Assert(m_depthAdjustment >= 0); 159Debug.Assert(m_curDepth >= 0); 317Debug.Assert(depth >= -1); 318Debug.Assert(targetDepth >= -1); 332Debug.Assert(m_depthAdjustment >= 0); 362Debug.Assert(m_RelocFixupList == null); 659Debug.Assert(opcode.Equals(OpCodes.Calli), 689Debug.Assert(opcode.Equals(OpCodes.Call) || 697Debug.Assert(opcode.Equals(OpCodes.Call) || 1105Debug.Assert(depth >= -1); 1315Debug.Assert(m_catchEndAddr[currentCatch - 1] == -1, "m_catchEndAddr[m_currentCatch-1] == -1"); 1332Debug.Assert(m_catchEndAddr[currentCatch - 1] == -1, "m_catchEndAddr[m_currentCatch-1] == -1"); 1378Debug.Assert(m_currentCatch > 0); 1379Debug.Assert(m_catchAddr[m_currentCatch - 1] > 0); 1380Debug.Assert(m_catchEndAddr[m_currentCatch - 1] == -1); 1455Debug.Assert(exc != null); 1456Debug.Assert(m_currentCatch > 0); 1457Debug.Assert(exc.m_currentCatch > 0); 1467Debug.Assert(exc.GetEndAddress() != GetEndAddress());
src\System\Reflection\Emit\RuntimeMethodBuilder.cs (10)
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"); 837Debug.Assert(tryStartOffset >= 0); 838Debug.Assert(tryEndOffset >= 0); 839Debug.Assert(filterOffset >= 0); 840Debug.Assert(handlerStartOffset >= 0); 841Debug.Assert(handlerEndOffset >= 0); 842Debug.Assert(IsValidKind((ExceptionHandlingClauseOptions)kind)); 843Debug.Assert(kind != (int)ExceptionHandlingClauseOptions.Clause || (exceptionTypeToken & 0x00FFFFFF) != 0);
src\System\Reflection\Emit\RuntimeModuleBuilder.cs (9)
129Debug.Assert(method != null); 139Debug.Assert(method != null); 152Debug.Assert(runtimeField != null); 216Debug.Assert(!type.IsByRef, "Must not be ByRef. Get token from TypeSpec."); 217Debug.Assert(!type.IsGenericType || type.IsGenericTypeDefinition, "Must not have generic arguments."); 413Debug.Assert(methodBase is RuntimeMethodInfo || methodBase is RuntimeConstructorInfo); 417Debug.Assert(masmi != null); 457Debug.Assert(method is RuntimeMethodInfo || method is RuntimeConstructorInfo); 1065Debug.Assert(methodInfo != null);
src\System\Reflection\Emit\RuntimeTypeBuilder.cs (5)
47Debug.Assert(m_con != null); 234Debug.Assert(destType is RuntimeType, "destType is not a runtime type, an EnumBuilder, or a TypeBuilder."); 360Debug.Assert(declMeth != null); 374Debug.Assert(declType != null); 1474Debug.Assert(m_isHiddenGlobalType || typeInfo != null);
src\System\Reflection\Emit\SignatureHelper.cs (6)
275Debug.Assert(clsArgument != null); 293Debug.Assert(!MetadataToken.IsNullToken(token)); 315Debug.Assert(!MetadataToken.IsNullToken(token)); 736Debug.Assert(clsArgument != null); 756Debug.Assert(!MetadataToken.IsNullToken(token)); 779Debug.Assert(!MetadataToken.IsNullToken(token));
src\System\Reflection\MdImport.cs (3)
194Debug.Assert(0 <= index && index < Length); 284Debug.Assert(marshalTypeName is not null); 363Debug.Assert(stringMetadataEncoding != null);
src\System\Reflection\RuntimeAssembly.cs (1)
766Debug.Assert((type != null) != (exception != null)); // Exactly one of these must be non-null.
src\System\Reflection\RuntimeConstructorInfo.CoreCLR.cs (2)
39Debug.Assert((flags & InvocationFlags.Initialized) == InvocationFlags.Initialized); 207Debug.Assert((InvocationFlags & InvocationFlags.RunClassConstructor) != 0);
src\System\Reflection\RuntimeCustomAttributeData.cs (70)
20Debug.Assert(target is not null); 30Debug.Assert(target is not null); 40Debug.Assert(target is not null); 50Debug.Assert(target is not null); 57Debug.Assert(target is not null); 64Debug.Assert(target is not null); 71Debug.Assert(target is not null); 81Debug.Assert(target is not null); 90Debug.Assert(target is not null); 100Debug.Assert(pseudoAttributes.Count != 0); 404Debug.Assert(allCtors.Length == 1); 405Debug.Assert(allCtors[0].GetParametersAsSpan().Length == 0); 475Debug.Assert(p.MemberInfo is not null); 546Debug.Assert(type is not null); 671Debug.Assert(customAttributeCtorParameters is not null); 672Debug.Assert(customAttributeNamedParameters is not null); 784Debug.Assert(namedArgType.EncodedEnumType == argType.EncodedEnumType); 930Debug.Assert(size <= (_blob.Length - _curr)); 1080Debug.Assert(parameterType is not null); 1118Debug.Assert(type is not null); 1147Debug.Assert(method is not null); 1148Debug.Assert(caType is not null); 1174Debug.Assert(ctor is not null); 1175Debug.Assert(caType is not null); 1184Debug.Assert(property is not null); 1185Debug.Assert(caType is not null); 1194Debug.Assert(e is not null); 1195Debug.Assert(caType is not null); 1204Debug.Assert(field is not null); 1205Debug.Assert(caType is not null); 1215Debug.Assert(parameter is not null); 1216Debug.Assert(caType is not null); 1226Debug.Assert(assembly is not null); 1227Debug.Assert(caType is not null); 1235Debug.Assert(module is not null); 1236Debug.Assert(caType is not null); 1245Debug.Assert(type is not null); 1246Debug.Assert(caType is not null); 1290Debug.Assert(method is not null); 1291Debug.Assert(caType is not null); 1332Debug.Assert(ctor != null); 1333Debug.Assert(caType != null); 1342Debug.Assert(property is not null); 1343Debug.Assert(caType is not null); 1352Debug.Assert(e is not null); 1353Debug.Assert(caType is not null); 1362Debug.Assert(field is not null); 1363Debug.Assert(caType is not null); 1374Debug.Assert(parameter is not null); 1375Debug.Assert(caType is not null); 1386Debug.Assert(assembly is not null); 1387Debug.Assert(caType is not null); 1397Debug.Assert(module is not null); 1398Debug.Assert(caType is not null); 1431Debug.Assert(attributeCtorToken == 0); 1450Debug.Assert(attributeFilterType is null); 1451Debug.Assert(!MetadataToken.IsNullToken(attributeCtorToken)); 1691Debug.Assert(decoratedToken.IsModule || decoratedToken.IsAssembly, 1968Debug.Assert(pca.BaseType == typeof(Attribute), "Pseudo CA Error - Incorrect base type"); 1970Debug.Assert(!usage.Inherited, "Pseudo CA Error - Unexpected Inherited value"); 1973Debug.Assert(usage.AllowMultiple, "Pseudo CA Error - Unexpected AllowMultiple value"); 1977Debug.Assert(!usage.AllowMultiple, "Pseudo CA Error - Unexpected AllowMultiple value"); 1985Debug.Assert(type is not null); 1986Debug.Assert(caType is not null); 2029Debug.Assert(method is not null); 2030Debug.Assert(caType is not null); 2069Debug.Assert(parameter is not null); 2070Debug.Assert(caType is not null); 2125Debug.Assert(field is not null); 2126Debug.Assert(caType is not null);
src\System\Reflection\RuntimeEventInfo.cs (3)
30Debug.Assert(declaredType != null); 31Debug.Assert(reflectedTypeCache != null); 32Debug.Assert(!reflectedTypeCache.IsGlobal);
src\System\Reflection\RuntimeLocalVariableInfo.cs (1)
16public override Type LocalType { get { Debug.Assert(_type != null, "type must be set!"); return _type; } }
src\System\Reflection\RuntimeMethodInfo.CoreCLR.cs (3)
38Debug.Assert((flags & InvocationFlags.Initialized) == InvocationFlags.Initialized); 59Debug.Assert(!handle.IsNullHandle()); 60Debug.Assert(methodAttributes == RuntimeMethodHandle.GetAttributes(handle));
src\System\Reflection\RuntimeParameterInfo.cs (15)
16Debug.Assert(method is RuntimeMethodInfo || method is RuntimeConstructorInfo); 23Debug.Assert(method is RuntimeMethodInfo || method is RuntimeConstructorInfo); 35Debug.Assert(ReferenceEquals(methodHandle, member)); 130Debug.Assert(result != null); 164Debug.Assert(m_originalMember != null); 183Debug.Assert(member != null); 184Debug.Assert(MdToken.IsNullToken(tkParamDef) == scope.Equals((MetadataImport)default)); 185Debug.Assert(MdToken.IsNullToken(tkParamDef) || MdToken.IsTokenOfType(tkParamDef, MetadataTokenType.ParamDef)); 221Debug.Assert(m_signature != null); 229Debug.Assert(parameterType != null); 335Debug.Assert(!m_noMetadata); 376Debug.Assert(attr.Constructor.DeclaringType == typeof(DecimalConstantAttribute)); 378Debug.Assert(args.Count == 5); 397Debug.Assert(attr.Constructor.DeclaringType == typeof(DateTimeConstantAttribute)); 398Debug.Assert(attr.ConstructorArguments.Count == 1);
src\System\Reflection\RuntimePropertyInfo.cs (6)
34Debug.Assert(declaredType != null); 35Debug.Assert(reflectedTypeCache != null); 36Debug.Assert(!reflectedTypeCache.IsGlobal); 106Debug.Assert(Name.Equals(target.Name)); 107Debug.Assert(this != target); 108Debug.Assert(this.ReflectedType == target.ReflectedType);
src\System\Reflection\TypeNameResolver.CoreCLR.cs (3)
126Debug.Assert(type != null); 243Debug.Assert(_throwOnError); // Unbound generic support currently always throws. 265Debug.Assert(_unsafeAccessorMethod != IntPtr.Zero);
src\System\Runtime\CompilerServices\AsyncHelpers.CoreCLR.cs (8)
169Debug.Assert(pMT->IsValueType); 250Debug.Assert(finalResult == finalContinuation); 283Debug.Assert(finalResult == finalContinuation); 316Debug.Assert(finalResult == finalContinuation); 349Debug.Assert(finalResult == finalContinuation); 362Debug.Assert(continuation != null); 390Debug.Assert(continuation != null); 403Debug.Assert(continuation.Next != null);
src\System\Runtime\CompilerServices\CastHelpers.cs (13)
257Debug.Assert(result != CastResult.CannotCast); 358Debug.Assert(mt != toTypeHnd, "The check for the trivial cases should be inlined by the JIT"); 429Debug.Assert(index >= 0); 446Debug.Assert(index >= 0); 488Debug.Assert(obj != null); 502Debug.Assert(obj != null); 505Debug.Assert(elementType != RuntimeHelpers.GetMethodTable(obj)); // Should be handled by caller 520Debug.Assert(obj != null); 532Debug.Assert(srcMT->IsNullable); 548Debug.Assert(typeMT != null); 549Debug.Assert(typeMT->IsValueType); 599Debug.Assert(typeMT->InstantiationArg0() == **typeMT->PerInstInfo); 674Debug.Assert(pMT1->IsValueType);
src\System\Runtime\CompilerServices\RuntimeHelpers.CoreCLR.cs (17)
53Debug.Assert(!elementTH.AsMethodTable()->ContainsGCPointers); 102Debug.Assert(!th.IsTypeDesc); // TypeDesc can't be used as generic parameter 109Debug.Assert(uint.IsPow2(targetTypeSize)); 412Debug.Assert(ObjectHasComponentSize(array)); 420Debug.Assert(GetMultiDimensionalArrayRank(array) > 0); 830Debug.Assert(HasComponentSize); 842Debug.Assert(HasComponentSize); 895Debug.Assert(HasComponentSize); 922Debug.Assert(IsNullable); 923Debug.Assert((NullableValueAddrOffset + NullableValueSize) == GetNumInstanceFieldBytes()); 932Debug.Assert(ContainsGCPointers); 933Debug.Assert((BaseSize - (nuint)(2 * sizeof(IntPtr)) == GetNumInstanceFieldBytes())); 1022Debug.Assert(HasCheckedCanCompareBitsOrUseFastGetHashCode); 1033Debug.Assert(HasCheckedStreamOverride); 1042Debug.Assert(HasCheckedStreamOverride); 1116Debug.Assert(!IsTypeDesc); 1128Debug.Assert(IsTypeDesc);
src\System\RuntimeHandles.cs (23)
230Debug.Assert(type.GetConstructor(Type.EmptyTypes) is ConstructorInfo c && c.IsPublic, 254Debug.Assert(type.GetConstructor(Type.EmptyTypes) is ConstructorInfo c && c.IsPublic, 293Debug.Assert(!type.GetNativeTypeHandle().IsTypeDesc); 336Debug.Assert(rt != null); 481Debug.Assert(type.IsFunctionPointer); 543Debug.Assert(!IsGenericVariable(type)); 564Debug.Assert(!IsGenericVariable(type)); 617Debug.Assert(type != null); 729Debug.Assert(IsGenericVariable(type)); 1096Debug.Assert(!method.IsNullHandle()); 1113Debug.Assert(method != null); 1125Debug.Assert(method != null); 1202Debug.Assert(destNullableType.IsNullableOfT); 1525Debug.Assert(!field.IsNullHandle()); 1527Debug.Assert(pMT != null); 1556Debug.Assert(!Unsafe.IsNullRef(ref fieldDataRef.Get())); 1563Debug.Assert(!Unsafe.IsNullRef(ref target)); 1669Debug.Assert(!th.IsTypeDesc); 2047Debug.Assert(_returnTypeORfieldType != null); 2060Debug.Assert((_managedCallingConventionAndArgIteratorFlags & 0xffffff00) == 0); 2095Debug.Assert(_arguments != null); 2133Debug.Assert(offset == -1); 2151Debug.Assert(offset == -1);
src\System\RuntimeType.ActivatorCache.cs (6)
38Debug.Assert(rt != null); 80Debug.Assert(Nullable.GetUnderlyingType(rt) != null, 98Debug.Assert(_ctorIsPublic); // implicit parameterless ctor is always considered public 108Debug.Assert(_ctorIsPublic); // implicit parameterless ctor is always considered public 113Debug.Assert(_pfnValueCtor == null); // Non-value types shouldn't have a value constructor. 147Debug.Assert(_originalRuntimeType.IsValueType);
src\System\RuntimeType.BoxCache.cs (2)
34Debug.Assert(rt != null); 114Debug.Assert(rt != null);
src\System\RuntimeType.CoreCLR.cs (59)
76Debug.Assert(index < Count); 175Debug.Assert(retVal || RequiresStringComparison()); 555Debug.Assert(false); 570Debug.Assert(cachedMembers![freeSlotIndex] == null); 587Debug.Assert(declaringType != null); 602Debug.Assert(!methodHandle.IsNullHandle()); 607Debug.Assert( 660Debug.Assert(!methodHandle.IsNullHandle()); 666Debug.Assert( 698Debug.Assert( 715Debug.Assert((methodAttributes & (MethodAttributes.Virtual | MethodAttributes.Abstract)) == 0); 764Debug.Assert(!methodHandle.IsNullHandle()); 770Debug.Assert( 845Debug.Assert(count > result.Length); 858Debug.Assert(declaringType != null); 859Debug.Assert(ReflectedType != null); 874Debug.Assert(!runtimeFieldHandle.IsNullHandle()); 904Debug.Assert(declaringType != null); 905Debug.Assert(ReflectedType != null); 921Debug.Assert(MdToken.IsTokenOfType(tkField, MetadataTokenType.FieldDef)); 922Debug.Assert(!MdToken.IsNullToken(tkField)); 1008Debug.Assert(interfaceType.IsInterface); 1114Debug.Assert(ReflectedType != null); 1163Debug.Assert(!MdToken.IsNullToken(tkEvent)); 1164Debug.Assert(MdToken.IsTokenOfType(tkEvent, MetadataTokenType.Event)); 1206Debug.Assert(ReflectedType != null); 1212Debug.Assert(declaringType != null); 1268Debug.Assert((declaringType.IsInterface && isInterface && csPropertyInfos == null) || 1275Debug.Assert(!MdToken.IsNullToken(tkProperty)); 1276Debug.Assert(MdToken.IsTokenOfType(tkProperty, MetadataTokenType.Property)); 1317Debug.Assert(associateMethod.IsVirtual); 1392Debug.Assert(listType == MemberListType.All); 1482Debug.Assert(type.IsFunctionPointer); 1566Debug.Assert(enclosingType != typeof(void)); 1612Debug.Assert(m_runtimeType.IsGenericType); 1794Debug.Assert(!methodHandle.IsNullHandle()); 2011Debug.Assert(genericArguments.Length == genericParameters.Length); 2040Debug.Assert(fullname.Equals(ns + "." + name)); 2128Debug.Assert(name != null); 2149Debug.Assert(memberInfo != null); 2150Debug.Assert(name is null || (bindingFlags & BindingFlags.IgnoreCase) == 0 || (name.ToLowerInvariant().Equals(name))); 2223Debug.Assert(type is not null); 2224Debug.Assert(type is RuntimeType); 2256Debug.Assert(methodBase != null); 2304Debug.Assert((callConv & CallingConventions.VarArgs) != 0); 2423Debug.Assert(cache == null || cache is RuntimeTypeCache); 2440Debug.Assert(cache is RuntimeTypeCache); 2469Debug.Assert(cache != null); 2705Debug.Assert(i == members.Length); 2723Debug.Assert(interfaceType.IsInterface); // VerifyInterfaceIsImplemented enforces this invariant 2724Debug.Assert(!IsInterface); // VerifyInterfaceIsImplemented enforces this invariant 2745Debug.Assert(ifaceMethodBase is RuntimeMethodInfo); 2762Debug.Assert(rtTypeMethodBase is null || rtTypeMethodBase is RuntimeMethodInfo); 3105Debug.Assert(i == compressMembers.Length); 3709Debug.Assert(targetType.IsPointer || targetType.IsEnum || targetType.IsPrimitive || targetType.IsFunctionPointer); 3791Debug.Assert(parameters.Length > 0); 3924Debug.Assert((invokeMethod.CallingConvention & CallingConventions.VarArgs) == 4025Debug.Assert(IsValueType); 4406Debug.Assert(!hit.Equals(key), "Key was already in CerHashtable! Potential race condition (or bug) in the Reflection cache?");
src\System\RuntimeType.CreateUninitializedCache.CoreCLR.cs (2)
31Debug.Assert(rt != null); 64Debug.Assert(rt != null);
src\System\String.CoreCLR.cs (1)
23Debug.Assert(ptr != null);
src\System\StubHelpers.cs (9)
34Debug.Assert(cbAllocLength <= 512); // Some arbitrary upper limit, in most cases SystemMaxDBCSCharSize is expected to be 1 or 2. 39Debug.Assert(cbLength > 0, "Zero bytes returned from DoAnsiConversion in AnsiCharMarshaler.ConvertToNative"); 258Debug.Assert(length >= lengthInBytes + 6, "BSTR localloc'ed buffer is too small"); 367Debug.Assert(nbytesused >= 0 && nbytesused < nbytes, "Insufficient buffer allocated in VBByValStrMarshaler.ConvertToNative"); 902Debug.Assert(pvArrayMarshaler != IntPtr.Zero, "pvArrayMarshaler must not be null"); 1059Debug.Assert(length < allocSize, "Expected a length less than the allocated size"); 1518Debug.Assert(success); 1537Debug.Assert(success); 1556Debug.Assert(success);
src\System\Text\StringBuilder.CoreCLR.cs (1)
15Debug.Assert(requiredCapacity <= m_MaxCapacity);
src\System\Threading\LowLevelLifoSemaphore.Unix.cs (7)
20Debug.Assert(maximumSignalCount > 0); 26Debug.Assert(_semaphore != null); 27Debug.Assert(timeoutMs >= -1); 30Debug.Assert(waitResult == WaitHandle.WaitSuccess || waitResult == WaitHandle.WaitTimeout); 39Debug.Assert(_semaphore != null); 40Debug.Assert(count > 0); 47Debug.Assert(_semaphore != null);
src\System\Threading\Monitor.CoreCLR.cs (1)
124Debug.Assert(lockTaken);
src\System\Threading\Thread.CoreCLR.cs (7)
105Debug.Assert(startHelper != null); 246Debug.Assert(value); 247Debug.Assert(!_isDead); 248Debug.Assert(((ThreadState & ThreadState.Unstarted) != 0) 462Debug.Assert(this == CurrentThread); 473Debug.Assert(this == CurrentThread); 474Debug.Assert(_mayNeedResetForThreadPool);
src\System\TypedReference.CoreCLR.cs (1)
59Debug.Assert(pMethodTable is not null);
src\System\ValueType.cs (2)
138Debug.Assert(fieldSize != 0); 143Debug.Assert(fieldMT != null);
System.Private.CoreLib.Generators (1)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (1)
94Debug.Assert(index == 0, "Implementation currently only supports index == 0");
System.Private.DataContractSerialization (347)
src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (1)
247Debug.Assert(q.Count == 1, "We should have one and only one in the rank queue.");
src\libraries\Common\src\System\HexConverter.cs (3)
167Debug.Assert(chars.Length >= bytes.Length * 2); 359Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 360Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
System\Runtime\Serialization\ClassDataContract.cs (6)
189Debug.Assert(UnderlyingType != Globals.TypeOfSchemaDefinedType); 219Debug.Assert(UnderlyingType != Globals.TypeOfSchemaDefinedType); 385Debug.Assert(context != null); 957Debug.Assert(Members != null); 1105Debug.Assert(method.DeclaringType != null); 1122Debug.Assert(method.DeclaringType != null);
System\Runtime\Serialization\CodeGenerator.cs (7)
25Debug.Assert(s_getTypeFromHandle != null); 39Debug.Assert(s_objectEquals != null); 53Debug.Assert(s_arraySetValue != null); 67Debug.Assert(s_objectToString != null); 81Debug.Assert(s_stringFormat != null); 91Debug.Assert(typeof(Delegate).IsAssignableFrom(delegateType)); 362Debug.Assert(cmp == Cmp.GreaterThanOrEqualTo, "Unexpected cmp");
System\Runtime\Serialization\CollectionDataContract.cs (10)
617Debug.Assert(KeyName != null); 618Debug.Assert(ValueName != null); 843Debug.Assert(Kind != CollectionKind.Array, "GetCollectionElementType should not be called on Arrays"); 844Debug.Assert(GetEnumeratorMethod != null, "GetEnumeratorMethod should be non-null for non-Arrays"); 1161Debug.Assert(knownInterfaceType != null); 1171Debug.Assert(getEnumeratorMethod != null); 1232Debug.Assert(addMethodTypeArray != null); 1237Debug.Assert(getEnumeratorMethod != null); 1561Debug.Assert(context != null); 1572Debug.Assert(context != null);
System\Runtime\Serialization\DataContract.cs (3)
1025Debug.Assert(value != null); 1035Debug.Assert(value != null); 2424Debug.Assert(_paramGenericInfos != null);
System\Runtime\Serialization\EnumDataContract.cs (1)
112Debug.Assert(retVal != null); // Enums can only have certain base types. We shouldn't come up empty here.
System\Runtime\Serialization\ExtensionDataReader.cs (5)
537Debug.Assert(_element != null); 556Debug.Assert(_element != null); 575Debug.Assert(_element != null); 610Debug.Assert(dataNode.OwnerDocument != null); // OwnerDocument is always set on initialized dataNodes 659Debug.Assert(dataNode.Value != null);
System\Runtime\Serialization\Json\JsonClassDataContract.cs (1)
108Debug.Assert(context != null);
System\Runtime\Serialization\Json\JsonCollectionDataContract.cs (2)
131Debug.Assert(context != null); 153Debug.Assert(context != null);
System\Runtime\Serialization\Json\JsonDataContract.cs (2)
133Debug.Assert(context != null); 142Debug.Assert(context != null);
System\Runtime\Serialization\Json\JsonEncodingStreamWrapper.cs (6)
185Debug.Assert(_bytes != null); 186Debug.Assert(_chars != null); 261Debug.Assert(_bytes != null); 262Debug.Assert(_chars != null); 356Debug.Assert(_bytes != null); 420Debug.Assert(_bytes != null);
System\Runtime\Serialization\Json\JsonFormatGeneratorStatics.cs (33)
96Debug.Assert(s_boxPointer != null); 109Debug.Assert(s_collectionItemNameProperty != null); 129Debug.Assert(s_ienumeratorGetCurrentMethod != null); 142Debug.Assert(s_getItemContractMethod != null); 155Debug.Assert(s_getJsonDataContractMethod != null); 168Debug.Assert(s_getJsonMemberIndexMethod != null); 181Debug.Assert(s_getRevisedItemContractMethod != null); 194Debug.Assert(s_getUninitializedObjectMethod != null); 207Debug.Assert(s_isStartElementMethod0 != null); 219Debug.Assert(s_isStartElementMethod2 != null); 231Debug.Assert(s_localNameProperty != null); 243Debug.Assert(s_namespaceProperty != null); 255Debug.Assert(s_ienumeratorMoveNextMethod != null); 267Debug.Assert(s_moveToContentMethod != null); 279Debug.Assert(s_nodeTypeProperty != null); 291Debug.Assert(s_onDeserializationMethod != null); 305Debug.Assert(s_readJsonValueMethod != null); 317Debug.Assert(s_serializationExceptionCtor != null); 330Debug.Assert(s_throwDuplicateMemberExceptionMethod != null); 342Debug.Assert(s_throwMissingRequiredMembersMethod != null); 354Debug.Assert(s_typeHandleProperty != null); 366Debug.Assert(s_unboxPointer != null); 378Debug.Assert(s_useSimpleDictionaryFormatReadProperty != null); 390Debug.Assert(s_useSimpleDictionaryFormatWriteProperty != null); 402Debug.Assert(s_writeAttributeStringMethod != null); 414Debug.Assert(s_writeEndElementMethod != null); 427Debug.Assert(s_writeJsonISerializableMethod != null); 439Debug.Assert(s_writeJsonNameWithMappingMethod != null); 452Debug.Assert(s_writeJsonValueMethod != null); 464Debug.Assert(s_writeStartElementMethod != null); 477Debug.Assert(s_writeStartElementStringMethod != null); 490Debug.Assert(s_parseEnumMethod != null); 503Debug.Assert(s_getJsonMemberNameMethod != null);
System\Runtime\Serialization\Json\JsonFormatReaderGenerator.cs (3)
685Debug.Assert(growingCollection != null); 1010Debug.Assert(collectionContract.AddMethod != null); 1020Debug.Assert(collectionContract.AddMethod != null);
System\Runtime\Serialization\Json\JsonFormatWriterGenerator.cs (3)
339Debug.Assert(collectionContract.GetEnumeratorMethod != null); 426Debug.Assert(keyValueTypes != null); 437Debug.Assert(keyValueTypes != null);
System\Runtime\Serialization\Json\ReflectionJsonFormatReader.cs (7)
25Debug.Assert(classDataContract != null); 34Debug.Assert(_classContract != null); 65Debug.Assert(jsonContext != null); 120Debug.Assert(jsonContext != null); 121Debug.Assert(collectionContract.Kind == CollectionKind.Dictionary || collectionContract.Kind == CollectionKind.GenericDictionary); 133Debug.Assert(jsonContext != null); 240Debug.Assert(dictionary != null);
System\Runtime\Serialization\Json\ReflectionJsonFormatWriter.cs (1)
204Debug.Assert(memberNames != null);
System\Runtime\Serialization\Json\XmlJsonReader.cs (2)
418Debug.Assert(_charactersToSkipOnNextRead != null); 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\ReflectionClassWriter.cs (1)
53Debug.Assert(memberValue != null);
System\Runtime\Serialization\ReflectionReader.cs (4)
37Debug.Assert(context != null); 49Debug.Assert(memberNames != null); 229Debug.Assert(dataMember != null); 241Debug.Assert(memberInfo != null);
System\Runtime\Serialization\ReflectionXmlFormatReader.cs (4)
25Debug.Assert(classDataContract != null); 63Debug.Assert(memberNamespaces != null); 74Debug.Assert(reflectedMemberCount == memberCount, "The value returned by ReflectionGetMembers() should equal to memberCount."); 126Debug.Assert(collectionContract.Kind == CollectionKind.Dictionary || collectionContract.Kind == CollectionKind.GenericDictionary);
System\Runtime\Serialization\SchemaExporter.cs (1)
309Debug.Assert(genericArgumentCounts != null);
System\Runtime\Serialization\SchemaImporter.cs (6)
484Debug.Assert(dataContract != null); // Throws above if false 664Debug.Assert(dataContract.BaseClassContract != null); // ImportBaseContract will always set this... or throw. 836Debug.Assert(dataContract.BaseClassContract != null); // ImportBaseContract will always set this... or throw. 997Debug.Assert(dataContract.Members != null); // This method is only called from ImportClass() after that method has initialized the Members collection. 998Debug.Assert(memberName != null); // At this point, elements without a name should have been handled. 1060Debug.Assert(element.Name != null);
System\Runtime\Serialization\XmlFormatGeneratorStatics.cs (74)
23Debug.Assert(s_writeStartElementMethod2 != null); 37Debug.Assert(s_writeStartElementMethod3 != null); 51Debug.Assert(s_writeEndElementMethod != null); 65Debug.Assert(s_writeNamespaceDeclMethod != null); 85Debug.Assert(s_dictionaryEnumeratorCtor != null); 99Debug.Assert(s_ienumeratorMoveNextMethod != null); 113Debug.Assert(s_ienumeratorGetCurrentMethod != null); 128Debug.Assert(s_getItemContractMethod != null); 142Debug.Assert(s_isStartElementMethod2 != null); 156Debug.Assert(s_isStartElementMethod0 != null); 171Debug.Assert(s_getUninitializedObjectMethod != null); 185Debug.Assert(s_onDeserializationMethod != null); 202Debug.Assert(s_nodeTypeProperty != null); 224Debug.Assert(s_hashtableCtor != null); 238Debug.Assert(s_getStreamingContextMethod != null); 252Debug.Assert(s_getCollectionMemberMethod != null); 266Debug.Assert(s_storeCollectionMemberInfoMethod != null); 280Debug.Assert(s_resetCollectionMemberInfoMethod != null); 294Debug.Assert(s_storeIsGetOnlyCollectionMethod != null); 308Debug.Assert(s_resetIsGetOnlyCollection != null); 322Debug.Assert(s_throwNullValueReturnedForGetOnlyCollectionExceptionMethod != null); 336Debug.Assert(s_throwArrayExceededSizeExceptionMethod != null); 350Debug.Assert(s_incrementItemCountMethod != null); 365Debug.Assert(s_internalDeserializeMethod != null); 379Debug.Assert(s_moveToNextElementMethod != null); 394Debug.Assert(s_getMemberIndexMethod != null); 409Debug.Assert(s_getMemberIndexWithRequiredMembersMethod != null); 423Debug.Assert(s_throwRequiredMemberMissingExceptionMethod != null); 437Debug.Assert(s_skipUnknownElementMethod != null); 452Debug.Assert(s_readIfNullOrRefMethod != null); 466Debug.Assert(s_readAttributesMethod != null); 480Debug.Assert(s_resetAttributesMethod != null); 494Debug.Assert(s_getObjectIdMethod != null); 508Debug.Assert(s_getArraySizeMethod != null); 522Debug.Assert(s_addNewObjectMethod != null); 536Debug.Assert(s_addNewObjectWithIdMethod != null); 550Debug.Assert(s_replaceDeserializedObjectMethod != null); 565Debug.Assert(s_getExistingObjectMethod != null); 579Debug.Assert(s_getRealObjectMethod != null); 593Debug.Assert(s_ensureArraySizeMethod != null); 607Debug.Assert(s_trimArraySizeMethod != null); 621Debug.Assert(s_checkEndOfArrayMethod != null); 635Debug.Assert(s_getArrayLengthMethod != null); 650Debug.Assert(s_readSerializationInfoMethod != null); 664Debug.Assert(s_createUnexpectedStateExceptionMethod != null); 679Debug.Assert(s_internalSerializeReferenceMethod != null); 694Debug.Assert(s_internalSerializeMethod != null); 709Debug.Assert(s_writeNullMethod != null); 723Debug.Assert(s_incrementArrayCountMethod != null); 737Debug.Assert(s_incrementCollectionCountMethod != null); 751Debug.Assert(s_incrementCollectionCountGenericMethod != null); 765Debug.Assert(s_getDefaultValueMethod != null); 787Debug.Assert(s_getNullableValueMethod != null); 801Debug.Assert(s_throwRequiredMemberMustBeEmittedMethod != null); 815Debug.Assert(s_getHasValueMethod != null); 830Debug.Assert(s_writeISerializableMethod != null); 852Debug.Assert(s_writeXmlValueMethod != null); 867Debug.Assert(s_readXmlValueMethod != null); 881Debug.Assert(s_namespaceProperty != null); 895Debug.Assert(s_contractNamespacesField != null); 909Debug.Assert(s_memberNamesField != null); 927Debug.Assert(s_childElementNamespacesProperty != null); 941Debug.Assert(s_collectionItemNameProperty != null); 956Debug.Assert(s_childElementNamespaceProperty != null); 970Debug.Assert(s_getDateTimeOffsetMethod != null); 984Debug.Assert(s_getDateTimeOffsetAdapterMethod != null); 998Debug.Assert(s_getMemoryStreamMethod != null); 1012Debug.Assert(s_getMemoryStreamAdapterMethod != null); 1026Debug.Assert(s_getTypeHandleMethod != null); 1040Debug.Assert(s_getTypeMethod != null); 1054Debug.Assert(s_throwInvalidDataContractExceptionMethod != null); 1068Debug.Assert(s_serializeReadOnlyTypesProperty != null); 1082Debug.Assert(s_classSerializationExceptionMessageProperty != null); 1096Debug.Assert(s_collectionSerializationExceptionMessageProperty != null);
System\Runtime\Serialization\XmlFormatReaderGenerator.cs (12)
292Debug.Assert(_objectLocal != null); 293Debug.Assert(_objectType != null); 309Debug.Assert(_objectLocal != null); 310Debug.Assert(_objectType != null); 331Debug.Assert(_objectLocal != null); 417Debug.Assert(_objectLocal != null); 418Debug.Assert(_objectType != null); 490Debug.Assert(_objectLocal != null); 491Debug.Assert(_objectType != null); 715Debug.Assert(growingCollection != null); 841Debug.Assert(_objectLocal != null); 915Debug.Assert(collectionContract.AddMethod != null);
System\Runtime\Serialization\XmlFormatWriterGenerator.cs (1)
418Debug.Assert(collectionContract.GetEnumeratorMethod != null);
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (10)
153Debug.Assert(attributes != null); 296Debug.Assert(attributes != null); 327Debug.Assert(attributes != null); 339Debug.Assert(attributes != null); 592Debug.Assert(attributes != null); 713Debug.Assert(attributes != null); 767Debug.Assert(attributes != null); 809Debug.Assert(attributes != null); 866Debug.Assert(attributes != null); 1099Debug.Assert(attributes != null);
System\Runtime\Serialization\XmlObjectSerializerReadContextComplex.cs (2)
63Debug.Assert(_serializationSurrogateProvider != null); 123Debug.Assert(attributes != null);
System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (2)
146Debug.Assert(rootTypeDataContract != null); 602Debug.Assert(DataContractResolver != null);
System\Text\Base64Encoding.cs (5)
73Debug.Assert(pch + 4 <= pchMax); 133Debug.Assert(pch + 4 <= pchMax); 206Debug.Assert(pch + 4 <= pchMax); 331Debug.Assert(pb - pbMax == 3); 416Debug.Assert(pb - pbMax == 3);
System\Xml\EncodingStreamWrapper.cs (5)
596Debug.Assert(_bytes != null); 597Debug.Assert(_chars != null); 633Debug.Assert(_bytes != null); 695Debug.Assert(_bytes != null); 696Debug.Assert(_chars != null);
System\Xml\PrefixHandle.cs (4)
37Debug.Assert(type != PrefixHandleType.Buffer); 121Debug.Assert(type != PrefixHandleType.Buffer); 127Debug.Assert(index >= 0 && index < 26); 133Debug.Assert(type != PrefixHandleType.Buffer);
System\Xml\StringHandle.cs (9)
103Debug.Assert(_type == StringHandleType.UTF8); 117Debug.Assert(type == StringHandleType.EscapedUTF8, "Should be EscapedUTF8"); 131Debug.Assert(type == StringHandleType.EscapedUTF8, "Should be EscapedUTF8"); 160Debug.Assert(type == StringHandleType.EscapedUTF8); 197Debug.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString); 208Debug.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString); 219Debug.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString); 230Debug.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString); 243Debug.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString);
System\Xml\ValueHandle.cs (20)
511Debug.Assert(bytes != null); 542Debug.Assert(str[i] < 128); 690Debug.Assert(offset + count <= chars.Length, string.Format("offset '{0}' + count '{1}' MUST BE <= chars.Length '{2}'", offset, count, chars.Length)); 844Debug.Assert(_type == ValueHandleType.UTF8); 852Debug.Assert(_type == ValueHandleType.Unicode); 858Debug.Assert(_type == ValueHandleType.EscapedUTF8); 876Debug.Assert(_type == ValueHandleType.Char); 882Debug.Assert(_type == ValueHandleType.Int8); 888Debug.Assert(_type == ValueHandleType.Int16); 894Debug.Assert(_type == ValueHandleType.Int32); 900Debug.Assert(_type == ValueHandleType.Int64 || _type == ValueHandleType.TimeSpan || _type == ValueHandleType.DateTime); 906Debug.Assert(_type == ValueHandleType.UInt64); 912Debug.Assert(_type == ValueHandleType.Single); 918Debug.Assert(_type == ValueHandleType.Double); 924Debug.Assert(_type == ValueHandleType.Decimal); 930Debug.Assert(_type == ValueHandleType.UniqueId); 936Debug.Assert(_type == ValueHandleType.Guid); 942Debug.Assert(_type == ValueHandleType.Base64); 948Debug.Assert(_type == ValueHandleType.Dictionary); 954Debug.Assert(_type == ValueHandleType.QName);
System\Xml\XmlBaseReader.cs (23)
661Debug.Assert(qnameType == QNameType.Xmlns); 749Debug.Assert(qnameType == QNameType.Xmlns); 892Debug.Assert(qnameType == QNameType.Xmlns); 1068Debug.Assert(qnameType == QNameType.Xmlns); 1109Debug.Assert(qnameType == QNameType.Xmlns); 1423Debug.Assert(_trailBytes != null); 1930Debug.Assert(qnameType == QNameType.Xmlns); 2104public StringHandle LocalName { get { Debug.Assert(_qnameType != QNameType.Xmlns); return _localName; } } 2105public PrefixHandle Prefix { get { Debug.Assert(_qnameType != QNameType.Xmlns); return _prefix; } } 2110public ValueHandle Value { get { Debug.Assert(_qnameType != QNameType.Xmlns); return _value; } } 2206Debug.Assert(_qnameType == QNameType.Xmlns); 2219Debug.Assert(_qnameType == QNameType.Xmlns); 2232Debug.Assert(_qnameType == QNameType.Xmlns); 2245Debug.Assert(_qnameType == QNameType.Xmlns); 2258Debug.Assert(_qnameType == QNameType.Xmlns); 2271Debug.Assert(_qnameType == QNameType.Xmlns); 2284Debug.Assert(_qnameType == QNameType.Xmlns); 2297Debug.Assert(_qnameType == QNameType.Xmlns); 2311Debug.Assert(_qnameType == QNameType.Xmlns); 2325Debug.Assert(_qnameType == QNameType.Xmlns); 2340Debug.Assert(_qnameType == QNameType.Xmlns); 2681Debug.Assert(qnameType == QNameType.Xmlns); 3067Debug.Assert(s != null);
System\Xml\XmlBaseWriter.cs (3)
1745Debug.Assert(_trailBytes != null); 1761Debug.Assert(_trailBytes != null); 2373Debug.Assert(nsCount >= 1 && _namespaces![0].Prefix!.Length == 0 && _namespaces[0].Uri!.Length == 0);
System\Xml\XmlBinaryReader.cs (1)
415Debug.Assert(_arrayState == ArrayState.Element);
System\Xml\XmlBinaryWriter.cs (16)
38Debug.Assert(XmlBinaryNodeType.MaxAttribute < XmlBinaryNodeType.MinElement && 71Debug.Assert(nodeType >= XmlBinaryNodeType.MinText && nodeType <= XmlBinaryNodeType.MaxText && ((byte)nodeType & 1) == 0, "Invalid nodeType"); 87Debug.Assert(nodeType == XmlBinaryNodeType.Chars8Text || nodeType == XmlBinaryNodeType.Bytes8Text || nodeType == XmlBinaryNodeType.UnicodeChars8Text); 109Debug.Assert(offset >= 0 && offset + 1 + sizeof(T) <= buffer.Length, "WriteTextNodeRaw"); 124Debug.Assert(offset >= 0 && offset + sizeof(T) <= buffer.Length, "WriteRaw"); 228Debug.Assert(nodeType >= XmlBinaryNodeType.MinText && nodeType <= XmlBinaryNodeType.MaxText && ((byte)nodeType & 1) == 0); 357Debug.Assert(t.Dictionary == _dictionary); 406Debug.Assert(length < 128); 630Debug.Assert(charCount > 0); 666Debug.Assert(length <= byte.MaxValue); 779Debug.Assert(intsWritten == 4); 826Debug.Assert(!_inList); 837Debug.Assert(_inList); 962Debug.Assert(intsWritten == 4); 1066Debug.Assert(result); 1136Debug.Assert(result);
System\Xml\XmlBufferReader.cs (19)
193Debug.Assert(_offsetMax < _windowOffsetMax); 214Debug.Assert(_offset <= int.MaxValue - count); 225Debug.Assert(newOffsetMax <= _windowOffsetMax); 235Debug.Assert(needed > 0); 248Debug.Assert(_offset + count <= _offsetMax); 254Debug.Assert(_stream != null); 295Debug.Assert(value >= _offsetMin && value <= _offsetMax); 302Debug.Assert(count >= 0); 706Debug.Assert(buffer[offset + 0] == '&'); 707Debug.Assert(buffer[offset + 1] == '#'); 708Debug.Assert(buffer[offset + length - 1] == ';'); 725Debug.Assert(buffer[offset + 0] == '&'); 726Debug.Assert(buffer[offset + 1] == '#'); 727Debug.Assert(buffer[offset + 2] == 'x'); 728Debug.Assert(buffer[offset + length - 1] == ';'); 736Debug.Assert(digit >= 0 && digit < 16); 749Debug.Assert(buffer[offset] == '&'); 750Debug.Assert(buffer[offset + length - 1] == ';'); 1023Debug.Assert(nodeType != XmlBinaryNodeType.StartListText);
System\Xml\XmlCanonicalWriter.cs (3)
279Debug.Assert(_xmlnsBuffer != null); 623Debug.Assert(_xmlnsBuffer != null); 783Debug.Assert(attribute.nsOffset == 0 && attribute.nsLength == 0);
System\Xml\XmlConverter.cs (6)
706Debug.Assert(value >= int.MinValue && value <= int.MaxValue); 788Debug.Assert(s[i] < 128); 1004Debug.Assert(value >= 0 && value < 100); 1021Debug.Assert(value >= 0 && value < 10000); 1029Debug.Assert(value >= 0 && value < 10000000); 1140Debug.Assert(count == chars.Length);
System\Xml\XmlDictionaryAsyncCheckWriter.cs (1)
22Debug.Assert(writer is IXmlTextWriterInitializer);
System\Xml\XmlSigningNodeWriter.cs (5)
85Debug.Assert(prefix != null); 99Debug.Assert(prefix != null); 112Debug.Assert(prefix != null); 119Debug.Assert(prefix != null); 133Debug.Assert(prefix != null);
System\Xml\XmlStreamNodeWriter.cs (9)
69Debug.Assert(count >= 0 && count <= bufferLength); 81Debug.Assert(offset + count <= bufferLength); 93Debug.Assert(count >= 0 && count <= bufferLength); 105Debug.Assert(offset + count <= bufferLength); 116Debug.Assert(_offset + count <= bufferLength); 155Debug.Assert(ch < 0x80); 161Debug.Assert(ch < 0x80); 202Debug.Assert(ch1 < 0x80 && ch2 < 0x80); 208Debug.Assert(ch1 < 0x80 && ch2 < 0x80);
System\Xml\XmlUTF8TextReader.cs (2)
879Debug.Assert(buffer[offset] == 0xEF, "buffer[offset] MUST be 0xEF."); 1088Debug.Assert(BufferReader.GetByte() == '&');
System.Private.Uri (103)
src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (7)
25Debug.Assert(capacity >= 0); 54Debug.Assert(index >= 0 && index < _count); 78Debug.Assert(_count > 0); 87Debug.Assert(_count > 0); 104Debug.Assert(_array != null); // Nonzero _count should imply this 134Debug.Assert(_count < Capacity); 141Debug.Assert(minimum > Capacity);
src\libraries\Common\src\System\HexConverter.cs (3)
167Debug.Assert(chars.Length >= bytes.Length * 2); 359Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 360Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Net\IPv4AddressHelper.Common.cs (10)
26Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 37Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 130Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 216Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 326Debug.Assert(parts[0] <= 0xFF); 333Debug.Assert(parts[0] <= 0xFF); 334Debug.Assert(parts[1] <= 0xFF); 341Debug.Assert(parts[0] <= 0xFF); 342Debug.Assert(parts[1] <= 0xFF); 343Debug.Assert(parts[2] <= 0xFF);
src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (3)
101Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 125Debug.Assert(start < end); 314Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 281Debug.Assert(additionalCapacityBeyondPos > 0); 282Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\DomainNameHelper.cs (4)
61Debug.Assert(!str.AsSpan(start, index).Contains(':'), 75Debug.Assert(index == -1 || char.IsAsciiLetterUpper(str[start + index])); 220Debug.Assert(ReferenceEquals(hostname, UriHelper.StripBidiControlCharacters(hostname, hostname))); 277Debug.Assert(charsWritten == label.Length);
System\IPv6AddressHelper.cs (5)
38Debug.Assert(success); 43Debug.Assert(success); 48Debug.Assert(success); 53Debug.Assert(success); 82Debug.Assert(success);
System\IriHelper.cs (3)
32Debug.Assert(char.IsHighSurrogate(highSurr)); 118Debug.Assert(ch < 0xFF, "Expecting ASCII character."); 134Debug.Assert(charactersRead > 0);
System\PercentEncodingHelper.cs (14)
18Debug.Assert(length >= 3); 19Debug.Assert(input[0] == '%'); 20Debug.Assert(UriHelper.DecodeHexChars(input[1], input[2]) != Uri.c_DummyChar); 21Debug.Assert(UriHelper.DecodeHexChars(input[1], input[2]) >= 128); 61Debug.Assert(value >= 128); 80Debug.Assert(totalCharsConsumed % 3 == 0); 81Debug.Assert(bytesLeftInBuffer == 2 || bytesLeftInBuffer == 3 || bytesLeftInBuffer == 4); 82Debug.Assert((fourByteBuffer & (BitConverter.IsLittleEndian ? 0x00000080 : 0x80000000)) != 0); 83Debug.Assert((fourByteBuffer & (BitConverter.IsLittleEndian ? 0x00008000 : 0x00800000)) != 0); 84Debug.Assert(bytesLeftInBuffer < 3 || (fourByteBuffer & (BitConverter.IsLittleEndian ? 0x00800000 : 0x00008000)) != 0); 85Debug.Assert(bytesLeftInBuffer < 4 || (fourByteBuffer & (BitConverter.IsLittleEndian ? 0x80000000 : 0x00000080)) != 0); 116Debug.Assert(bytesLeftInBuffer < 4); 121Debug.Assert(bytesLeftInBuffer == 2 || bytesLeftInBuffer == 3); 164Debug.Assert(bytesLeftInBuffer == 0 || bytesLeftInBuffer == 1);
System\Uri.cs (22)
148Debug.Assert((_flags & Flags.Debug_LeftConstructor) == 0); 202Debug.Assert(_syntax != null); 207Debug.Assert(sizeof(Flags) == sizeof(ulong)); 327Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 714Debug.Assert(IsAbsoluteUri); 965Debug.Assert(_info != null); 966Debug.Assert(_info.Host != null); 1908Debug.Assert((flags & Flags.Debug_LeftConstructor) == 0); 1933Debug.Assert((err is ParsingError.None) == (syntax is not null)); 1951Debug.Assert(_syntax != null && !_syntax.IsSimple); 1952Debug.Assert((_flags & Flags.CustomParser_ParseMinimalAlreadyCalled) != 0); 1978Debug.Assert(_syntax != null); 1989Debug.Assert(ReferenceEquals(_string, OriginalString)); 2663Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 2702Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 2900Debug.Assert(success); 3370Debug.Assert(_syntax.InFact(UriSyntaxFlags.MayHaveFragment)); 3622Debug.Assert(err == ParsingError.None); 3623Debug.Assert((flags & Flags.Debug_LeftConstructor) == 0); 3721Debug.Assert(error == ParsingError.None); 3791Debug.Assert((_flags & Flags.Debug_LeftConstructor) == 0 || (!_syntax.IsSimple && Monitor.IsEntered(_info))); 3801Debug.Assert((_flags & Flags.HasUserInfo) == 0 && (_flags & Flags.HostTypeMask) == 0);
System\UriBuilder.cs (3)
247Debug.Assert(_uri is not null); 280Debug.Assert(_uri is not null); 363Debug.Assert(success);
System\UriExt.cs (8)
31Debug.Assert(_originalUnicodeString is null && _info is null && _syntax is null && _flags == Flags.Zero); 595Debug.Assert(backingString is null || backingString.Length == charsToUnescape.Length); 666Debug.Assert(newLength <= charsToUnescape.Length); 681Debug.Assert(vsb.RawChars.Overlaps(destination)); 782Debug.Assert(syntax != null); 800Debug.Assert(!syntax!.IsSimple, "A UriPraser threw on InitializeAndValidate."); 814Debug.Assert(!baseUri.IsNotAbsoluteUri && !baseUri.UserDrivenParsing, "Uri::ResolveHelper()|baseUri is not Absolute or is controlled by User Parser."); 1065Debug.Assert(!InFact(Flags.HasUnicode) || otherUri.IsNotAbsoluteUri);
System\UriHelper.cs (13)
18Debug.Assert(charsWritten == buffer.Length); 155Debug.Assert(newLength > charsToEscape.Length); 170Debug.Assert(vsb.RawChars.Overlaps(destination)); 191Debug.Assert(!noEscape.Contains('%'), "Need to treat % specially; it should be part of any escaped set"); 192Debug.Assert(backingString is null || backingString.Length == charsToEscape.Length); 218Debug.Assert(!noEscape.Contains('%'), "Need to treat % specially; it should be part of any escaped set"); 238Debug.Assert(!stringToEscape.IsEmpty && !noEscape.Contains(stringToEscape[0])); 254Debug.Assert(stringToEscape.EnumerateRunes() is { } e && e.MoveNext() && e.Current == r); 255Debug.Assert(charsConsumed is 1 or 2); 297Debug.Assert(charsToCopy > 0); 500Debug.Assert(charactersRead > 0); 596Debug.Assert(backingString is null || strToClean.Length == backingString.Length); 629Debug.Assert(buffer.Length == destIndex);
System\UriScheme.cs (1)
77Debug.Assert(sizeof(Uri.Flags) == sizeof(ulong));
System\UriSyntax.cs (1)
271Debug.Assert(sizeof(Uri.Flags) == sizeof(ulong));
System.Private.Windows.Core (52)
System\Collections\Generic\ArrayBuilder.cs (4)
57Debug.Assert(_count == _items.Length); 60Debug.Assert(_items.Length > 0); 70Debug.Assert(_count == _maxCount); 71Debug.Assert(_count == _items.Length);
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (1)
803Debug.Assert(ex is ArgumentException or SerializationException, "Unexpected write exception.");
System\Private\Windows\BinaryFormat\Deserializer\ArrayRecordDeserializer.cs (1)
22Debug.Assert(arrayRecord.RecordType is not (SerializationRecordType.ArraySingleString or SerializationRecordType.ArraySinglePrimitive));
System\Private\Windows\BinaryFormat\Deserializer\ClassRecordFieldInfoDeserializer.cs (1)
43Debug.Assert(_fieldInfo is not null);
System\Private\Windows\BinaryFormat\Deserializer\DefaultTypeResolver.cs (1)
36Debug.Assert(typeName.AssemblyName is not null);
System\Private\Windows\BinaryFormat\Deserializer\Deserializer.cs (2)
261Debug.Assert(Options.SurrogateSelector is not null); 358Debug.Assert(_pendingUpdates is not null);
System\Private\Windows\Nrbf\CoreNrbfSerializer.cs (1)
98Debug.Assert(s_knownTypes.Count == 60);
System\Private\Windows\Nrbf\FullyQualifiedTypeName.cs (2)
15Debug.Assert(!string.IsNullOrWhiteSpace(assemblyName)); 16Debug.Assert(!string.IsNullOrWhiteSpace(fullTypeName));
System\Private\Windows\Nrbf\SerializationRecordExtensions.cs (1)
308Debug.Assert(record.RecordType is SerializationRecordType.MemberPrimitiveTyped);
System\Private\Windows\Ole\BinaryFormatUtilities.cs (2)
26Debug.Assert(data is not null); 79Debug.Assert(request.TypedRequest || typeof(T) == typeof(object), "Untyped requests should always be asking for object");
System\Private\Windows\Ole\ClipboardCore.cs (1)
231Debug.Assert(proxyDataObject.IsNull);
System\Private\Windows\Ole\Composition.NativeToManagedAdapter.cs (2)
278Debug.Assert(e is NotSupportedException, e.Message); 547Debug.Assert(!nativeDataObject.IsNull, "You must have an innerData on all DataObjects");
System\Private\Windows\Ole\DataStore.cs (1)
40Debug.Assert(mappedFormat != format);
System\Private\Windows\Ole\TypeBinder.cs (4)
47Debug.Assert(request.TypedRequest || request.Resolver is null, "Untyped methods should not provide a resolver."); 48Debug.Assert(request.TypedRequest || rootType == typeof(object), "Untyped requests should always be asking for object"); 62Debug.Assert(CoreAppContextSwitches.ClipboardDragDropEnableUnsafeBinaryFormatterSerialization); 63Debug.Assert(FeatureSwitches.EnableUnsafeBinaryFormatterSerialization);
System\SpanHelpers.cs (1)
15Debug.Assert(!destination.IsEmpty);
System\SpanReader.cs (3)
259Debug.Assert((uint)count <= (uint)_unread.Length); 269Debug.Assert((uint)length <= (uint)span.Length); 279Debug.Assert((uint)start <= (uint)span.Length && (uint)length <= (uint)(span.Length - start));
System\SpanWriter.cs (2)
95Debug.Assert((uint)count <= (uint)_unwritten.Length); 102Debug.Assert((uint)start <= (uint)span.Length && (uint)length <= (uint)(span.Length - start));
System\Text\ValueStringBuilder.cs (6)
53Debug.Assert(value >= 0); 54Debug.Assert(value <= _chars.Length); 64Debug.Assert(capacity >= 0); 101Debug.Assert(index < _pos); 323Debug.Assert(additionalCapacityBeyondPos > 0); 324Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\TypeExtensions.cs (1)
29Debug.Assert(type is not null);
System\Value.cs (2)
56Debug.Assert(type.IsArray); 671Debug.Assert(Unsafe.SizeOf<T>() <= sizeof(ulong));
System\Value.PackedDateTimeOffset.cs (1)
57Debug.Assert(hours is >= 0 and <= 28);
Windows\Win32\Foundation\HRESULT.cs (1)
38Debug.Assert(IsNtStatus);
Windows\Win32\Graphics\Gdi\ARGB.cs (2)
27Debug.Assert(BitConverter.IsLittleEndian); 37Debug.Assert(BitConverter.IsLittleEndian);
Windows\Win32\Graphics\Gdi\RegionScope.cs (1)
45Debug.Assert(result != -1, "GetClipRgn failed");
Windows\Win32\Graphics\GdiPlus\GdiPlusInitialization.cs (1)
15Debug.Assert(s_initToken == 0, "GdiplusInitialization: Initialize should not be called more than once!");
Windows\Win32\Graphics\GdiPlus\StatusExtensions.cs (1)
21Debug.Assert(status != Status.Ok, "Throwing an exception for an 'Ok' return code");
Windows\Win32\PInvokeCore.GetSysColorBrush.cs (1)
27Debug.Assert(systemColor.IsSystemColor);
Windows\Win32\System\Com\AgileComPointer.cs (1)
89Debug.Assert(count >= 0);
Windows\Win32\System\Com\GlobalInterfaceTable.UnknownStrategy.cs (1)
20Debug.Assert(_cookie == 0, "A cookie has already been generated for this instance.");
Windows\Win32\System\Com\Lifetime.cs (1)
29Debug.Assert(lifetime->_refCount > 0);
Windows\Win32\System\Variant\VARIANT.cs (2)
275Debug.Assert(hr == HRESULT.S_OK); 433Debug.Assert(hr == HRESULT.S_OK);
System.Private.Windows.GdiPlus (1)
Windows\Win32\PInvokeGdiPlus.cs (1)
25Debug.Assert(initialized);
System.Private.Xml (2850)
src\libraries\Common\src\System\HexConverter.cs (3)
167Debug.Assert(chars.Length >= bytes.Length * 2); 359Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 360Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 281Debug.Assert(additionalCapacityBeyondPos > 0); 282Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Xml\Base64Decoder.cs (5)
86Debug.Assert(buffer != null); 87Debug.Assert(count >= 0); 88Debug.Assert(index >= 0); 89Debug.Assert(buffer.Length - index >= count); 90Debug.Assert((buffer as byte[]) != null);
System\Xml\BinaryXml\SqlUtils.cs (5)
85Debug.Assert(rgulU.Length == s_cNumeMax); 136Debug.Assert(uiDigit < 10); 323Debug.Assert(val >= 0 && val < 100); 329Debug.Assert(val > -10000 && val < 10000); 341Debug.Assert(val >= 0 && val < 1000);
System\Xml\BinaryXml\XmlBinaryReader.cs (41)
356Debug.Assert(len >= 2 && (data[0] == 0xdf && data[1] == 0xff)); 457Debug.Assert(_textXmlReader != null); 496Debug.Assert(_textXmlReader != null); 525Debug.Assert(_textXmlReader != null); 585Debug.Assert(_textXmlReader != null); 607Debug.Assert(_textXmlReader != null); 638Debug.Assert(_textXmlReader != null); 651Debug.Assert(_textXmlReader != null); 670Debug.Assert(_textXmlReader != null); 686Debug.Assert(_textXmlReader != null); 701Debug.Assert(_textXmlReader != null); 723Debug.Assert(_textXmlReader != null); 742Debug.Assert(_textXmlReader != null); 758Debug.Assert(_textXmlReader != null); 785Debug.Assert(_textXmlReader != null); 817Debug.Assert(_textXmlReader != null); 866Debug.Assert(_textXmlReader != null); 904Debug.Assert(_textXmlReader != null); 911Debug.Assert(decl != null); 943Debug.Assert(_textXmlReader != null); 1810Debug.Assert(_textXmlReader != null); 1850Debug.Assert(_textXmlReader != null); 2004Debug.Assert(_mark <= _end, "Mark should never be past End"); 2005Debug.Assert(_mark <= _pos, "Mark should never be after Pos"); 2025Debug.Assert((_attributes[i].contentPos >= 0) && (_attributes[i].contentPos <= (end))); 2032Debug.Assert(_attrCount == 0); 2049Debug.Assert((_pos + require) >= _end); 2089Debug.Assert(0 != (b & 0x80)); 2322Debug.Assert(pos >= 0 && cch >= 0); 2756Debug.Assert(_stringValue == null, "this.stringValue == null"); 2757Debug.Assert(_token == BinXmlToken.CData, "this.token == BinXmlToken.CData"); 2950Debug.Assert(_mark < 0); 3072Debug.Assert(_pos >= 3); 3077Debug.Assert(_pos >= 1); 3083Debug.Assert(_pos >= 2); 3179Debug.Assert(_prevNameInfo != null); 3231Debug.Assert(_textXmlReader != null); 3485Debug.Assert(_checkCharacters, "this.checkCharacters"); 3491Debug.Assert(data.Length % 2 == 0, "Data size should not be odd"); 3540Debug.Assert(!_checkCharacters, "!this.checkCharacters"); 3543Debug.Assert(0 == ((_pos - _tokDataPos) & 1), "Data size should not be odd");
System\Xml\BinHexDecoder.cs (5)
90Debug.Assert(buffer != null); 91Debug.Assert(count >= 0); 92Debug.Assert(index >= 0); 93Debug.Assert(buffer.Length - index >= count); 94Debug.Assert((buffer as byte[]) != null);
System\Xml\BitStack.cs (2)
50Debug.Assert(_curr != 0x1, "Stack empty"); 71Debug.Assert(_curr != 0x1, "Stack empty");
System\Xml\Cache\XPathDocumentBuilder.cs (29)
153Debug.Assert(prefix != null && localName != null && ns != null && localName.Length != 0 && baseUri != null); 214Debug.Assert(_pageParent != null && _pageParent[_idxParent].NodeType == XPathNodeType.Element); 288Debug.Assert(namespaceName != null); 289Debug.Assert(prefix != null && !prefix.Equals("xmlns")); 290Debug.Assert(_idxParent == 0 || (_pageParent != null && _pageParent[_idxParent].NodeType == XPathNodeType.Element)); 291Debug.Assert(_idxSibling == 0 || (_pageSibling != null && _pageSibling[_idxSibling].NodeType == XPathNodeType.Attribute)); 308Debug.Assert(_pageSibling != null); 309Debug.Assert(_pageSibling[_idxSibling].NodeType == XPathNodeType.Attribute); 320Debug.Assert(_idxParent != 0 && _pageParent != null, "ID attribute must have an element parent"); 322Debug.Assert(id != null); 482Debug.Assert(_pageParent != null && _pageParent[_idxParent].NodeType == XPathNodeType.Element); 494Debug.Assert(_idxSibling == 0 || (_pageSibling != null && _pageSibling[_idxSibling].NodeType == XPathNodeType.Attribute)); 495Debug.Assert(!prefix.Equals("xmlns") && !namespaceName.Equals(XmlReservedNs.NsXmlNs)); 496Debug.Assert(_idxParent == 0 || _idxNmsp != 0); 497Debug.Assert(_idxParent == 0 || (_pageParent != null && _pageParent[_idxParent].NodeType == XPathNodeType.Element)); 530Debug.Assert(pageOrig != null); 554Debug.Assert(prefix.Equals("xml"), "xmlns:xml namespace declaration should always be present in the list."); 569Debug.Assert(_pageParent != null); 632Debug.Assert(pageElem == null || pageElem[idxElem].NodeType == XPathNodeType.Element); 662Debug.Assert(xptyp != XPathNodeType.Namespace); 705Debug.Assert(_lineInfo.HasLineInfo(), "HasLineInfo should have been checked before this."); 734Debug.Assert(xptyp != XPathNodeType.Root && xptyp != XPathNodeType.Namespace); 744Debug.Assert(_pageParent != null); 751Debug.Assert(_idxParent + 1 == idxNew || idxNew == 1); 755Debug.Assert(_pageSibling != null); 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."); 903Debug.Assert((int)XPathNodeType.Text < (int)XPathNodeType.SignificantWhitespace); 904Debug.Assert((int)XPathNodeType.SignificantWhitespace < (int)XPathNodeType.Whitespace);
System\Xml\Cache\XPathDocumentNavigator.cs (17)
36Debug.Assert(pageCurrent != null && idxCurrent != 0); 37Debug.Assert((pageParent == null) == (idxParent == 0)); 88Debug.Assert(_idxParent != 0 && _pageParent![_idxParent].HasCollapsedText, 97Debug.Assert(_pageCurrent[_idxCurrent].NodeType == XPathNodeType.Text); 100Debug.Assert(value != null); 120Debug.Assert(page[idx].NodeType == XPathNodeType.Element || page[idx].IsText); 122Debug.Assert(value != null); 373Debug.Assert(page != null); 434Debug.Assert(_pageCurrent != null); 454Debug.Assert(_pageParent != null); 494Debug.Assert(page != null); 496Debug.Assert(page[idx].NodeType == XPathNodeType.Element); 584Debug.Assert(_pageCurrent != null); 663Debug.Assert(_pageCurrent != null); 695Debug.Assert(page[idx].HasCollapsedText); 697Debug.Assert(_pageCurrent != null); 704Debug.Assert(page[idx].IsText);
System\Xml\Cache\XPathNode.cs (11)
154Debug.Assert(HasCollapsedText, "Do not call CollapsedLinePosition unless HasCollapsedText is true."); 173Debug.Assert(pageNode != null); 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."); 361Debug.Assert(info != null && idxParent <= ushort.MaxValue); 400Debug.Assert(NodeType == XPathNodeType.Element); 411Debug.Assert(NodeType == XPathNodeType.Element); 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 (34)
26Debug.Assert(pageElem[idxElem].NodeType == XPathNodeType.Element); 70Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 75Debug.Assert(pageNode[idxNode].NodeType == XPathNodeType.Attribute); 89Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 109Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 119Debug.Assert(idx != 0); 120Debug.Assert(page != null); 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)"); 180Debug.Assert(idxNode <= ushort.MaxValue); 181Debug.Assert(pageNode[0].PageInfo!.PageNumber <= short.MaxValue); 194Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 200Debug.Assert(idx != 0); 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)"); 312Debug.Assert(typ != XPathNodeType.Attribute && typ != XPathNodeType.Namespace); 331Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 332Debug.Assert(pageNode[idxNode].NodeType != XPathNodeType.Attribute); 348Debug.Assert(pagePrec != null); 369Debug.Assert(idxAnc != 0 && pageAnc != null); 394Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 428Debug.Assert(pageCurrent != null && idxCurrent != 0, "Cannot pass null argument(s)"); 454Debug.Assert(page != null); 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."); 669Debug.Assert(pageNode != null);
System\Xml\Cache\XPathNodeInfoAtom.cs (6)
123Debug.Assert(localName != null && namespaceUri != null && prefix != null && doc != null); 291Debug.Assert(other != null); 292Debug.Assert((object?)_doc == (object?)other._doc); 293Debug.Assert(_pageInfo == null); 326Debug.Assert(_localName != null); 333Debug.Assert(_prefix != null);
System\Xml\Core\CharEntityEncoderFallback.cs (3)
35Debug.Assert(_textContentMarks != null); 128Debug.Assert(_charEntityIndex < _charEntity.Length); 141Debug.Assert(_charEntityIndex <= _charEntity.Length);
System\Xml\Core\HtmlEncodedRawTextWriter.cs (21)
50Debug.Assert(name != null && name.Length > 0); 97Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 103Debug.Assert(prefix.Length == 0); 143Debug.Assert(prefix.Length == 0); 168Debug.Assert(prefix.Length == 0); 288Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 292Debug.Assert(prefix.Length == 0); 356Debug.Assert(!string.IsNullOrEmpty(target) && text != null); 378Debug.Assert(text != null); 413Debug.Assert(buffer != null); 414Debug.Assert(index >= 0); 415Debug.Assert(count >= 0 && index + count <= buffer.Length); 440Debug.Assert((int)ElementProperties.URI_PARENT == (int)AttributeProperties.URI); 441Debug.Assert((int)ElementProperties.BOOL_PARENT == (int)AttributeProperties.BOOLEAN); 442Debug.Assert((int)ElementProperties.NAME_PARENT == (int)AttributeProperties.NAME); 564Debug.Assert(pSrc <= pSrcEnd); 652Debug.Assert(pSrc <= pSrcEnd); 702Debug.Assert(_uriEscapingBuffer?.Length > 0); 816Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 824Debug.Assert(prefix.Length == 0); 880Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null);
System\Xml\Core\HtmlUtf8RawTextWriter.cs (21)
45Debug.Assert(name != null && name.Length > 0); 90Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 96Debug.Assert(prefix.Length == 0); 134Debug.Assert(prefix.Length == 0); 157Debug.Assert(prefix.Length == 0); 275Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 279Debug.Assert(prefix.Length == 0); 339Debug.Assert(!string.IsNullOrEmpty(target) && text != null); 359Debug.Assert(text != null); 392Debug.Assert(buffer != null); 393Debug.Assert(index >= 0); 394Debug.Assert(count >= 0 && index + count <= buffer.Length); 417Debug.Assert((int)ElementProperties.URI_PARENT == (int)AttributeProperties.URI); 418Debug.Assert((int)ElementProperties.BOOL_PARENT == (int)AttributeProperties.BOOLEAN); 419Debug.Assert((int)ElementProperties.NAME_PARENT == (int)AttributeProperties.NAME); 541Debug.Assert(pSrc <= pSrcEnd); 629Debug.Assert(pSrc <= pSrcEnd); 679Debug.Assert(_uriEscapingBuffer?.Length > 0); 788Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 794Debug.Assert(prefix.Length == 0); 850Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null);
System\Xml\Core\IncrementalReadDecoders.cs (17)
63Debug.Assert(_buffer != null); 64Debug.Assert(chars != null); 65Debug.Assert(len >= 0); 66Debug.Assert(startPos >= 0); 67Debug.Assert(chars.Length - startPos >= len); 69Debug.Assert(len > 0); 85Debug.Assert(_buffer != null); 86Debug.Assert(str != null); 87Debug.Assert(len >= 0); 88Debug.Assert(startPos >= 0); 89Debug.Assert(str.Length - startPos >= len); 91Debug.Assert(len > 0); 111Debug.Assert(buffer != null); 112Debug.Assert(count >= 0); 113Debug.Assert(index >= 0); 114Debug.Assert(buffer.Length - index >= count); 116Debug.Assert((buffer as char[]) != null);
System\Xml\Core\QueryOutputWriter.cs (2)
138Debug.Assert(!_outputDocType); 351Debug.Assert(!_inCDataSection);
System\Xml\Core\QueryOutputWriterV1.cs (6)
128Debug.Assert(!_outputDocType); 161Debug.Assert(_qnameCData != null); 162Debug.Assert(_bitsCData != null); 178Debug.Assert(_bitsCData != null); 191Debug.Assert(_bitsCData != null); 319Debug.Assert(!_inCDataSection);
System\Xml\Core\ReadContentAsBinaryHelper.cs (7)
97Debug.Assert(_state == State.InReadContent); 140Debug.Assert(_state == State.InReadContent); 183Debug.Assert(_state == State.InReadElementContent); 226Debug.Assert(_state == State.InReadElementContent); 276Debug.Assert(_reader.NodeType == XmlNodeType.Element); 330Debug.Assert(_decoder != null); 355Debug.Assert(_valueOffset == _valueChunkLength);
System\Xml\Core\ReadContentAsBinaryHelperAsync.cs (7)
48Debug.Assert(_state == State.InReadContent); 92Debug.Assert(_state == State.InReadContent); 136Debug.Assert(_state == State.InReadElementContent); 180Debug.Assert(_state == State.InReadElementContent); 224Debug.Assert(_reader.NodeType == XmlNodeType.Element); 252Debug.Assert(_decoder != null); 277Debug.Assert(_valueOffset == _valueChunkLength);
System\Xml\Core\XmlAsyncCheckReader.cs (3)
36Debug.Assert(!(reader is IXmlSchemaInfo)); 41Debug.Assert(!(reader is IXmlSchemaInfo)); 44Debug.Assert(!(reader is IXmlSchemaInfo));
System\Xml\Core\XmlAutoDetectWriter.cs (6)
33Debug.Assert(writerSettings.OutputMethod == XmlOutputMethod.AutoDetect); 106Debug.Assert(_wrapped != null); 309Debug.Assert(_wrapped != null); 315Debug.Assert(_wrapped != null); 321Debug.Assert(_wrapped != null); 399Debug.Assert(_wrapped == null);
System\Xml\Core\XmlCharCheckingReader.cs (2)
51Debug.Assert(checkCharacters || ignoreWhitespace || ignoreComments || ignorePis || (int)dtdProcessing != -1); 643Debug.Assert(readerAsNSResolver != null);
System\Xml\Core\XmlCharCheckingWriter.cs (1)
33Debug.Assert(checkValues || replaceNewLines);
System\Xml\Core\XmlEncodedRawTextWriter.cs (45)
114Debug.Assert(writer != null && settings != null); 136Debug.Assert(stream != null && settings != null); 253Debug.Assert(name != null && name.Length > 0); 294Debug.Assert(localName != null && localName.Length > 0); 295Debug.Assert(prefix != null); 326Debug.Assert(localName != null && localName.Length > 0); 327Debug.Assert(prefix != null); 358Debug.Assert(localName != null && localName.Length > 0); 359Debug.Assert(prefix != null); 378Debug.Assert(localName != null && localName.Length > 0); 379Debug.Assert(prefix != null); 412Debug.Assert(prefix != null && namespaceName != null); 429Debug.Assert(prefix != null); 468Debug.Assert(text != null); 475Debug.Assert(_bufPos >= 4); 505Debug.Assert(text != null); 524Debug.Assert(name != null && name.Length > 0); 525Debug.Assert(text != null); 546Debug.Assert(name != null && name.Length > 0); 593Debug.Assert(ws != null); 615Debug.Assert(text != null); 652Debug.Assert(buffer != null); 653Debug.Assert(index >= 0); 654Debug.Assert(count >= 0 && index + count <= buffer.Length); 676Debug.Assert(buffer != null); 677Debug.Assert(index >= 0); 678Debug.Assert(count >= 0 && index + count <= buffer.Length); 694Debug.Assert(data != null); 791Debug.Assert(_stream != null || _writer != null); 811Debug.Assert(_textContentMarks![0] == 1); 875Debug.Assert(_bufPos == 1); 912Debug.Assert(pSrc <= pSrcEnd); 1035Debug.Assert(pSrc <= pSrcEnd); 1136Debug.Assert(s != null); 1166Debug.Assert(pSrc <= pSrcEnd); 1231Debug.Assert(pSrc <= pSrcEnd); 1351Debug.Assert(pSrc <= pSrcEnd); 1502Debug.Assert(pSrc <= pSrcEnd); 1610Debug.Assert(XmlCharType.IsSurrogate(*pSrc)); 1636Debug.Assert(!XmlCharType.IsWhiteSpace((char)ch)); 1637Debug.Assert(!XmlCharType.IsAttributeValueChar((char)ch)); 1686Debug.Assert(_inTextContent != value); 1687Debug.Assert(_inTextContent || ((_lastMarkPos & 1) == 0)); 1698Debug.Assert(_lastMarkPos + 1 == _textContentMarks!.Length); 1963Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null);
System\Xml\Core\XmlEncodedRawTextWriterAsync.cs (42)
135Debug.Assert(name != null && name.Length > 0); 177Debug.Assert(localName != null && localName.Length > 0); 178Debug.Assert(prefix != null); 205Debug.Assert(localName != null && localName.Length > 0); 206Debug.Assert(prefix != null); 240Debug.Assert(localName != null && localName.Length > 0); 241Debug.Assert(prefix != null); 262Debug.Assert(localName != null && localName.Length > 0); 263Debug.Assert(prefix != null); 307Debug.Assert(prefix != null && namespaceName != null); 317Debug.Assert(prefix != null); 362Debug.Assert(text != null); 369Debug.Assert(_bufPos >= 4); 400Debug.Assert(text != null); 420Debug.Assert(name != null && name.Length > 0); 421Debug.Assert(text != null); 443Debug.Assert(name != null && name.Length > 0); 492Debug.Assert(ws != null); 511Debug.Assert(text != null); 548Debug.Assert(buffer != null); 549Debug.Assert(index >= 0); 550Debug.Assert(count >= 0 && index + count <= buffer.Length); 570Debug.Assert(buffer != null); 571Debug.Assert(index >= 0); 572Debug.Assert(count >= 0 && index + count <= buffer.Length); 586Debug.Assert(data != null); 623Debug.Assert(_stream != null || _writer != null); 643Debug.Assert(_textContentMarks![0] == 1); 707Debug.Assert(_bufPos == 1); 747Debug.Assert(pSrc <= pSrcEnd); 952Debug.Assert(pSrc <= pSrcEnd); 1192Debug.Assert(pSrc <= pSrcEnd); 1259Debug.Assert(text1 != null); 1260Debug.Assert(text2 != null || (text3 == null && text4 == null)); 1261Debug.Assert(text3 != null || (text4 == null)); 1317Debug.Assert(text1 != null); 1318Debug.Assert(text2 != null || (text3 == null && text4 == null)); 1319Debug.Assert(text3 != null || (text4 == null)); 1368Debug.Assert(pSrc <= pSrcEnd); 1570Debug.Assert(pSrc <= pSrcEnd); 1760Debug.Assert(pSrc <= pSrcEnd); 1922Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null);
System\Xml\Core\XmlEventCache.cs (2)
125Debug.Assert(idxPage + 1 == _pages.Count); 279Debug.Assert(idxPage + 1 == _pages.Count);
System\Xml\Core\XmlRawWriter.cs (1)
309Debug.Assert(_base64Encoder != null);
System\Xml\Core\XmlRawWriterAsync.cs (1)
223Debug.Assert(_base64Encoder != null);
System\Xml\Core\XmlReader.cs (58)
964Debug.Assert(parentDepth == 0); 988Debug.Assert(NodeType == XmlNodeType.EndElement || NodeType == XmlNodeType.None || ReadState == ReadState.Error); 1005Debug.Assert(parentDepth == 0); 1030Debug.Assert(NodeType == XmlNodeType.EndElement); 1306Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.None))); 1307Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Element))); 1308Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Attribute))); 1309Debug.Assert(0 != (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Text))); 1310Debug.Assert(0 != (IsTextualNodeBitmap & (1 << (int)XmlNodeType.CDATA))); 1311Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.EntityReference))); 1312Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Entity))); 1313Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.ProcessingInstruction))); 1314Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Comment))); 1315Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Document))); 1316Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.DocumentType))); 1317Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.DocumentFragment))); 1318Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Notation))); 1319Debug.Assert(0 != (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Whitespace))); 1320Debug.Assert(0 != (IsTextualNodeBitmap & (1 << (int)XmlNodeType.SignificantWhitespace))); 1321Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.EndElement))); 1322Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.EndEntity))); 1323Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.XmlDeclaration))); 1333Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.None))); 1334Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Element))); 1335Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Attribute))); 1336Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Text))); 1337Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.CDATA))); 1338Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.EntityReference))); 1339Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Entity))); 1340Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.ProcessingInstruction))); 1341Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Comment))); 1342Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Document))); 1343Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.DocumentType))); 1344Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.DocumentFragment))); 1345Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Notation))); 1346Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Whitespace))); 1347Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.SignificantWhitespace))); 1348Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.EndElement))); 1349Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.EndEntity))); 1350Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.XmlDeclaration))); 1360Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.None))); 1361Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.Element))); 1362Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.Attribute))); 1363Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.Text))); 1364Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.CDATA))); 1365Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.EntityReference))); 1366Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.Entity))); 1367Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.ProcessingInstruction))); 1368Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.Comment))); 1369Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.Document))); 1370Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.DocumentType))); 1371Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.DocumentFragment))); 1372Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.Notation))); 1373Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.Whitespace))); 1374Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.SignificantWhitespace))); 1375Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.EndElement))); 1376Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.EndEntity))); 1377Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.XmlDeclaration)));
System\Xml\Core\XmlReaderSettings.cs (1)
473Debug.Assert(_addValidationFunc != null);
System\Xml\Core\XmlSubtreeReader.cs (41)
432Debug.Assert(reader.NodeType == XmlNodeType.Element); 457Debug.Assert(_curNode.type == XmlNodeType.Attribute); 479Debug.Assert(reader.Depth >= _initialDepth); 489Debug.Assert(reader.NodeType == XmlNodeType.Element && !reader.IsEmptyElement); 550Debug.Assert(reader.Depth >= _initialDepth); 587Debug.Assert(reader.Depth >= _initialDepth); 601Debug.Assert(reader.NodeType == XmlNodeType.EndElement || 616Debug.Assert(reader.Depth >= _initialDepth); 868Debug.Assert(_binDecoder != null); 875Debug.Assert(AttributeCount > 0); 1006Debug.Assert(_binDecoder != null); 1013Debug.Assert(AttributeCount > 0); 1338Debug.Assert(_state == State.ClearNsAttributes || _state == State.Interactive || _state == State.PopNamespaceScope); 1366Debug.Assert(index >= 0 && index <= _nsAttrCount); 1399Debug.Assert(_state == State.Interactive); 1406Debug.Assert(_state == State.ReadElementContentAsBase64 || _state == State.ReadElementContentAsBinHex); 1440Debug.Assert(_state == State.ReadContentAsBase64 || _state == State.ReadContentAsBinHex); 1470Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.Initial))); 1471Debug.Assert(0 != (AttributeActiveStates & (1 << (int)State.Interactive))); 1472Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.Error))); 1473Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.EndOfFile))); 1474Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.Closed))); 1475Debug.Assert(0 != (AttributeActiveStates & (1 << (int)State.PopNamespaceScope))); 1476Debug.Assert(0 != (AttributeActiveStates & (1 << (int)State.ClearNsAttributes))); 1477Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.ReadElementContentAsBase64))); 1478Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.ReadElementContentAsBinHex))); 1479Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.ReadContentAsBase64))); 1480Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.ReadContentAsBinHex))); 1491Debug.Assert(0 == (NamespaceActiveStates & (1 << (int)State.Initial))); 1492Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.Interactive))); 1493Debug.Assert(0 == (NamespaceActiveStates & (1 << (int)State.Error))); 1494Debug.Assert(0 == (NamespaceActiveStates & (1 << (int)State.EndOfFile))); 1495Debug.Assert(0 == (NamespaceActiveStates & (1 << (int)State.Closed))); 1496Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.PopNamespaceScope))); 1497Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.ClearNsAttributes))); 1498Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.ReadElementContentAsBase64))); 1499Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.ReadElementContentAsBinHex))); 1500Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.ReadContentAsBase64))); 1501Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.ReadContentAsBinHex))); 1509Debug.Assert(_tmpNode.localName == string.Empty && _tmpNode.prefix == string.Empty && _tmpNode.name == string.Empty && _tmpNode.namespaceUri == string.Empty); 1560Debug.Assert(_state == State.Interactive ||
System\Xml\Core\XmlSubtreeReaderAsync.cs (12)
42Debug.Assert(reader.Depth >= _initialDepth); 52Debug.Assert(reader.NodeType == XmlNodeType.Element && !reader.IsEmptyElement); 113Debug.Assert(reader.Depth >= _initialDepth); 127Debug.Assert(reader.NodeType == XmlNodeType.EndElement || 142Debug.Assert(reader.Depth >= _initialDepth); 274Debug.Assert(_binDecoder != null); 281Debug.Assert(AttributeCount > 0); 412Debug.Assert(_binDecoder != null); 419Debug.Assert(AttributeCount > 0); 583Debug.Assert(_state == State.Interactive); 590Debug.Assert(_state == State.ReadElementContentAsBase64 || _state == State.ReadElementContentAsBinHex); 624Debug.Assert(_state == State.ReadContentAsBase64 || _state == State.ReadContentAsBinHex);
System\Xml\Core\XmlTextEncoder.cs (11)
74Debug.Assert(_attrValue != null); 88Debug.Assert(_attrValue != null); 120Debug.Assert(_attrValue != null); 208Debug.Assert((ch < 0x20 && !XmlCharType.IsWhiteSpace(ch)) || (ch > 0xFFFD)); 228Debug.Assert(_attrValue != null); 247Debug.Assert(_attrValue != null); 364Debug.Assert((ch < 0x20 && !XmlCharType.IsWhiteSpace(ch)) || (ch > 0xFFFD)); 387Debug.Assert(_attrValue != null); 446Debug.Assert(_attrValue != null); 465Debug.Assert(_attrValue != null); 478Debug.Assert(_attrValue != null);
System\Xml\Core\XmlTextReaderImpl.cs (275)
317Debug.Assert(nt != null); 330Debug.Assert(_index == 0); 371Debug.Assert(_nameTableFromSettings == false); 393Debug.Assert(_index == 0); 601Debug.Assert(baseUri == null); 629Debug.Assert(_laterInitParam != null); 630Debug.Assert(_laterInitParam.inputUriResolver != null); 631Debug.Assert(_laterInitParam.inputbaseUri != null); 632Debug.Assert(_reportedBaseUri != null); 699Debug.Assert(baseUri == null); 730Debug.Assert(_laterInitParam != null); 731Debug.Assert(_laterInitParam.inputStream != null); 732Debug.Assert(_reportedBaseUri != null); 763Debug.Assert(baseUriStr == string.Empty, "BaseURI can come either from XmlParserContext or from the constructor argument, not from both"); 789Debug.Assert(_laterInitParam != null); 790Debug.Assert(_laterInitParam.inputTextReader != null); 791Debug.Assert(_reportedBaseUri != null); 812Debug.Assert(xmlFragment != null); 1195Debug.Assert(_laterInitParam != null); 1234Debug.Assert(_nextParsingFunction == ParsingFunction.DocumentContent); 1237Debug.Assert(!_ps.appendMode); 1265Debug.Assert(_parsingFunction == ParsingFunction.ElementContent || 1270Debug.Assert(_curNode.type == XmlNodeType.Element); 1394Debug.Assert(_curNode.type == XmlNodeType.EndElement); 1395Debug.Assert(_parsingFunction != ParsingFunction.Eof); 1415Debug.Assert(_namespaceManager != null); 1498Debug.Assert(_parsingMode == ParsingMode.Full); 1559Debug.Assert(value is XmlTextReader); 1578Debug.Assert(_outerReader is XmlTextReaderImpl); 1867Debug.Assert(_ps.chars != null); 1891Debug.Assert(_ps.chars != null); 1944Debug.Assert(_namespaceManager != null); 1952Debug.Assert(_namespaceManager != null); 1988Debug.Assert(_namespaceManager != null); 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."); 2137Debug.Assert(_namespaceManager != null); 2165Debug.Assert(_v1Compat, "XmlTextReaderImpl.GetRemainder cannot be called on reader created via XmlReader.Create."); 2166Debug.Assert(_stringBuilder.Length == 0); 2206Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadChars cannot be called on reader created via XmlReader.Create."); 2207Debug.Assert(_outerReader is XmlTextReader); 2242Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadBase64 cannot be called on reader created via XmlReader.Create."); 2243Debug.Assert(_outerReader is XmlTextReader); 2276Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadBinHex cannot be called on reader created via XmlReader.Create."); 2277Debug.Assert(_outerReader is XmlTextReader); 2404Debug.Assert(value >= 0 && value <= _ps.charsUsed); 2490Debug.Assert(_parsingMode == ParsingMode.Full); 2578Debug.Assert(_parsingStatesStackTop == -1); 2579Debug.Assert((systemId != null && systemId.Length > 0) || (publicId != null && publicId.Length > 0)); 2586Debug.Assert(_xmlResolver != null); 2598Debug.Assert(_ps.appendMode); 2614Debug.Assert(_parsingStatesStackTop == -1); 2615Debug.Assert(internalDtd != null); 2788Debug.Assert(InAttributeValueIterator); 2825Debug.Assert(baseUriStr != null); 2831Debug.Assert(baseUri != null); 2842Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0 && _ps.textReader == null); 2843Debug.Assert(baseUriStr != null); 2844Debug.Assert(baseUri == null || (baseUri.ToString().Equals(baseUriStr))); 2917Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0 && _ps.stream == null); 2918Debug.Assert(baseUriStr != null); 2946Debug.Assert(_ps.stream == null && _ps.textReader == null); 2947Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0); 2948Debug.Assert(baseUriStr != null); 2949Debug.Assert(str != null); 3004Debug.Assert(_parsingFunction == ParsingFunction.SwitchToInteractiveXmlDecl); 3008Debug.Assert(_parsingFunction == ParsingFunction.SwitchToInteractiveXmlDecl); 3009Debug.Assert(_nextParsingFunction == ParsingFunction.DocumentContent); 3034Debug.Assert(context != null && context.HasDtdInfo); 3056Debug.Assert(_url != null && _url.Length > 0); 3081Debug.Assert(_ps.stream != null); 3089Debug.Assert(_ps.bytes != null); 3090Debug.Assert(_ps.bytePos == 0); 3176Debug.Assert(_ps.charPos == 0); 3194Debug.Assert(_ps.encoding != null); 3195Debug.Assert(_ps.bytes != null); 3206Debug.Assert(_ps.encoding != null); 3209Debug.Assert(_ps.stream != null); 3221Debug.Assert(_ps.encoding != null); 3270Debug.Assert(newEncoding != null); 3271Debug.Assert(newEncoding.EncodingName != "UTF-8"); 3285Debug.Assert(_ps.stream != null && _ps.decoder != null && _ps.bytes != null); 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, 3314Debug.Assert(_ps.encoding != null); 3315Debug.Assert(_ps.chars != null); 3341Debug.Assert(_ps.chars != null); 3364Debug.Assert(_ps.bytes != null); 3423Debug.Assert(_ps.bytes != null); 3438Debug.Assert(_ps.bytes != null); 3477Debug.Assert(_ps.charsUsed < _ps.chars.Length); 3488Debug.Assert(_ps.stream != null && _ps.decoder != null && _ps.bytes != null); 3489Debug.Assert(_ps.chars != null); 3490Debug.Assert(maxCharsCount <= _ps.chars.Length - _ps.charsUsed - 1); 3514Debug.Assert(maxCharsCount >= charsCount); 3529Debug.Assert(_ps.decoder != null); 3530Debug.Assert(_ps.bytes != null); 3531Debug.Assert(_ps.chars != null); 3579Debug.Assert(_ps.chars != null); 3609Debug.Assert(_stringBuilder.Length == 0 || isTextDecl); 3653Debug.Assert(_ps.encoding != null); 3730Debug.Assert(attr != null); 3762Debug.Assert(attr != null); 3788Debug.Assert(attr != null); 3804Debug.Assert(attr != null); 3819Debug.Assert(!isTextDecl); 3825Debug.Assert(attr != null); 3871Debug.Assert(_ps.encoding != null); 3895Debug.Assert(_ps.chars != null); 4077Debug.Assert(pos == _ps.charsUsed && !_ps.isEof); 4097Debug.Assert(_index == 0); 4120Debug.Assert(_ps.chars != null); 4294Debug.Assert(_ps.chars != null); 4360Debug.Assert(_namespaceManager != null); 4452Debug.Assert(_curNode.type == XmlNodeType.Element); 4453Debug.Assert(_dtdInfo != null); 4545Debug.Assert(_ps.chars != null); 4634Debug.Assert(_index > 0); 4639Debug.Assert(_curNode == startTagNode); 4656Debug.Assert(_ps.chars != null); 4666Debug.Assert(startTag.type == XmlNodeType.EntityReference); 4675Debug.Assert(_ps.chars != null); 4679Debug.Assert(_attrCount == 0); 4728Debug.Assert(_curNode.type == XmlNodeType.Element); 4736Debug.Assert(_curNode.type == XmlNodeType.Element); 4840Debug.Assert(attrNameLineNo == _ps.LineNo); 4887Debug.Assert(val == XmlComplianceUtil.CDataNormalize(val), "The attribute value is not CDATA normalized!"); 4962Debug.Assert(_curNode.type == XmlNodeType.Element); 5096Debug.Assert(_ps.chars != null); 5103Debug.Assert(_stringBuilder.Length == 0); 5258Debug.Assert(_ps.entity != null); 5315Debug.Assert(_ps.isEof); 5373Debug.Assert(attr.nextAttrValueChunk == null); 5402Debug.Assert(_stringBuilder.Length == 0); 5418Debug.Assert(endPos - startPos > 0); 5419Debug.Assert(_ps.chars != null); 5442Debug.Assert(_stringBuilder.Length > 0); 5463Debug.Assert(endPos - startPos > 0); 5464Debug.Assert(_ps.chars != null); 5539Debug.Assert(_ps.chars != null); 5729Debug.Assert(_ps.isEof); 5771Debug.Assert(_stringBuilder.Length == 0); 5772Debug.Assert(_parsingFunction == ParsingFunction.PartialTextValue || 5786Debug.Assert(_stringBuilder.Length > 0); 5840Debug.Assert(_parsingFunction == ParsingFunction.PartialTextValue || _parsingFunction == ParsingFunction.InReadValueChunk || 5850Debug.Assert(_parsingFunction == ParsingFunction.InReadValueChunk); 5855Debug.Assert((_index > 0) ? _nextParsingFunction == ParsingFunction.ElementContent : _nextParsingFunction == ParsingFunction.DocumentContent); 5867Debug.Assert(_parsingFunction == ParsingFunction.InReadContentAsBinary || _parsingFunction == ParsingFunction.InReadElementContentAsBinary); 5872Debug.Assert((_index > 0) ? _nextParsingFunction == ParsingFunction.ElementContent : _nextParsingFunction == ParsingFunction.DocumentContent); 5900Debug.Assert(_stringBuilder.Length == 0); 5904Debug.Assert(_ps.chars != null); 5942Debug.Assert(_ps.chars != null); 5943Debug.Assert(_ps.chars[_ps.charPos] == '&'); 5952Debug.Assert(_ps.chars != null); 5953Debug.Assert(_ps.chars[_ps.charPos] == '&'); 5968Debug.Assert(entityType == EntityType.CharacterDec || entityType == EntityType.CharacterHex); 6046Debug.Assert(entity != null); 6163Debug.Assert(_lastEntity != null); 6169Debug.Assert(_curNode.depth == _index); 6182Debug.Assert(_curNode.type == XmlNodeType.EntityReference); 6183Debug.Assert(_lastEntity != null); 6184Debug.Assert(Ref.Equal(_lastEntity.Name, _curNode.localName)); 6203Debug.Assert(_stringBuilder.Length == 0); 6207Debug.Assert(_ps.chars != null); 6230Debug.Assert(_ps.charPos < _ps.charsUsed); 6274Debug.Assert(_stringBuilder.Length == 0); 6308Debug.Assert(_ps.chars != null); 6330Debug.Assert(!_ps.eolNormalized); 6477Debug.Assert(_stringBuilder.Length == 0); 6480Debug.Assert(_ps.chars != null); 6513Debug.Assert(_ps.chars != null); 6537Debug.Assert(!_ps.eolNormalized); 6686Debug.Assert(_ps.chars != null); 6719Debug.Assert(_dtdProcessing == DtdProcessing.Ignore); 6751Debug.Assert(_ps.chars != null); 6848Debug.Assert(_ps.chars != null); 6867Debug.Assert(_ps.chars != null); 7048Debug.Assert(_ps.isEof); 7064Debug.Assert(_ps.chars != null); 7149Debug.Assert(_ps.isEof); 7158Debug.Assert(_ps.chars != null); 7159Debug.Assert(_ps.chars[startPos] == '&'); 7192Debug.Assert(_ps.chars != null); 7193Debug.Assert(_ps.chars[_ps.charPos] == '&'); 7213Debug.Assert(_ps.chars != null); 7214Debug.Assert(_ps.chars[startPos] == '&' && _ps.chars[startPos + 1] == '#'); 7269Debug.Assert(badDigitExceptionString != null); 7321Debug.Assert(pos > 0); 7355Debug.Assert(_ps.chars != null); 7356Debug.Assert(_ps.chars[_ps.charPos] == '&'); 7376Debug.Assert(startPos < _ps.charsUsed); 7377Debug.Assert(_ps.chars != null); 7378Debug.Assert(_ps.chars[startPos] == '&'); 7379Debug.Assert(_ps.chars[startPos + 1] != '#'); 7487Debug.Assert(pos > 0); 7512Debug.Assert(_ps.chars != null); 7575Debug.Assert(_ps.chars != null); 7608Debug.Assert(_ps.chars != null); 7623Debug.Assert(nodeIndex < _nodes.Length); 7624Debug.Assert(_nodes[_nodes.Length - 1] == null); 7637Debug.Assert(nodeIndex < _nodes.Length); 7644Debug.Assert(nodeIndex < _nodes.Length); 7661Debug.Assert(_ps.chars != null); 7714Debug.Assert(attr.type == XmlNodeType.Attribute); 7730Debug.Assert(_namespaceManager != null); 7749Debug.Assert(_ps.isEof); 7762Debug.Assert(_namespaceManager != null); 7800Debug.Assert(_namespaceManager != null); 7813Debug.Assert(_xmlContext.defaultNamespace == uri); 7850Debug.Assert(_curNode.xmlContextPushed); 7892Debug.Assert(_xmlResolver != null); 7950Debug.Assert(_xmlResolver != null); 7967Debug.Assert(_xmlResolver.SupportsType(uri, typeof(Stream)), "Stream must always be a supported type in XmlResolver"); 7987Debug.Assert(entity.IsExternal); 7991Debug.Assert(_xmlResolver != null); 8002Debug.Assert(_ps.appendMode); 8033Debug.Assert(!entity.IsExternal); 8099Debug.Assert(_parsingStatesStackTop == -1); 8115Debug.Assert(_parsingStatesStackTop >= 0); 8116Debug.Assert(_parsingStatesStack != null); 8163Debug.Assert(_incReadDecoder != null); 8173Debug.Assert(_incReadDecoder != null); 8174Debug.Assert(_ps.chars != null); 8223Debug.Assert(_ps.chars.AsSpan(_ps.charPos - 2).StartsWith("?>")); 8231Debug.Assert(_ps.chars.AsSpan(_ps.charPos - 3).StartsWith("-->")); 8239Debug.Assert(_ps.chars.AsSpan(_ps.charPos - 3).StartsWith("]]>")); 8264Debug.Assert(_incReadState == IncrementalReadState.Text || 8373Debug.Assert(_ps.charPos - pos == 0); 8374Debug.Assert(_ps.charPos - startPos == 0); 8413Debug.Assert(_ps.charPos - pos == 0); 8414Debug.Assert(_ps.charPos - startPos == 0); 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!"); 8534Debug.Assert(_fragmentType == XmlNodeType.Attribute); 8551Debug.Assert(_parsingFunction == ParsingFunction.InReadAttributeValue); 8564Debug.Assert(_ps.chars != null); 8579Debug.Assert(_stringBuilder.Length == 0); 8590Debug.Assert(_ps.eolNormalized, "Entity replacement text for attribute values should be EOL-normalized!"); 8783Debug.Assert(_ps.chars != null); 8796Debug.Assert(_ps.charPos < _ps.charsUsed); 8861Debug.Assert(_ps.chars != null); 8874Debug.Assert(_dtdInfo == null && _fragmentParserContext != null && _fragmentParserContext.HasDtdInfo); 8890Debug.Assert(_parsingFunction != ParsingFunction.InReadContentAsBinary); 8917Debug.Assert(_parsingFunction != ParsingFunction.InReadElementContentAsBinary); 8918Debug.Assert(_curNode.type == XmlNodeType.Element); 9001Debug.Assert(context != null); 9022Debug.Assert(nt != null); 9023Debug.Assert(context.NameTable == null || context.NameTable == nt, "This check should have been done in XmlParserContext constructor."); 9039Debug.Assert(_nameTableFromSettings == false); 9064Debug.Assert(_dtdInfo == null); 9122Debug.Assert(_curNode.type == XmlNodeType.Whitespace && newNodeType == XmlNodeType.SignificantWhitespace, "Incorrect node type change!"); 9224Debug.Assert(attr != null); 9245Debug.Assert(_namespaceManager != null); 9248Debug.Assert(prefix != null); 9266Debug.Assert(attr != null); 9298Debug.Assert(_nodes[_index].type == XmlNodeType.Element); 9316Debug.Assert(_nodes[_index].type == XmlNodeType.Element); 9317Debug.Assert(_namespaceManager != null); 9351Debug.Assert(_incReadDecoder != null); 9385Debug.Assert(_ps.chars != null); 9464Debug.Assert(_parsingFunction != ParsingFunction.InReadElementContentAsBinary); 9520Debug.Assert(characters >= 0); 9562Debug.Assert(startPos >= 0); 9563Debug.Assert(endPos < chars.Length); 9564Debug.Assert(startPos <= endPos); 9571Debug.Assert(startPos >= 0); 9572Debug.Assert(endPos < str.Length); 9573Debug.Assert(startPos <= endPos);
System\Xml\Core\XmlTextReaderImplAsync.cs (74)
94Debug.Assert(_reportedBaseUri != null); 125Debug.Assert(_reportedBaseUri != null); 178Debug.Assert(!_ps.appendMode); 198Debug.Assert(_parsingFunction == ParsingFunction.ElementContent || 203Debug.Assert(_curNode.type == XmlNodeType.Element); 356Debug.Assert(_curNode.type == XmlNodeType.EndElement); 357Debug.Assert(_parsingFunction != ParsingFunction.Eof); 762Debug.Assert(_parsingMode == ParsingMode.Full); 828Debug.Assert(_parsingStatesStackTop == -1); 829Debug.Assert((systemId != null && systemId.Length > 0) || (publicId != null && publicId.Length > 0)); 846Debug.Assert(_ps.appendMode); 862Debug.Assert(baseUri != null); 868Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0 && _ps.textReader == null); 869Debug.Assert(baseUriStr != null); 870Debug.Assert(baseUri == null || (baseUri.ToString().Equals(baseUriStr))); 944Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0 && _ps.stream == null); 945Debug.Assert(baseUriStr != null); 977Debug.Assert(context != null && context.HasDtdInfo); 1003Debug.Assert(_ps.stream != null); 1161Debug.Assert(_ps.charsUsed < _ps.chars.Length); 1193Debug.Assert(_stringBuilder.Length == 0 || isTextDecl); 1399Debug.Assert(!isTextDecl); 1597Debug.Assert(pos == _ps.charsUsed && !_ps.isEof); 1712Debug.Assert(_index == 0); 2252Debug.Assert(_index > 0); 2257Debug.Assert(_curNode == startTagNode); 2299Debug.Assert(startTag.type == XmlNodeType.EntityReference); 2311Debug.Assert(_attrCount == 0); 2361Debug.Assert(_curNode.type == XmlNodeType.Element); 2369Debug.Assert(_curNode.type == XmlNodeType.Element); 2483Debug.Assert(attrNameLineNo == _ps.LineNo); 2530Debug.Assert(val == XmlComplianceUtil.CDataNormalize(val), "The attribute value is not CDATA normalized!"); 2613Debug.Assert(_stringBuilder.Length == 0); 2830Debug.Assert(_ps.isEof); 2899Debug.Assert(_stringBuilder.Length == 0); 2929Debug.Assert(endPos - startPos > 0); 2967Debug.Assert(_stringBuilder.Length == 0); 2988Debug.Assert(endPos - startPos > 0); 3018Debug.Assert(_stringBuilder.Length > 0); 3039Debug.Assert(endPos - startPos > 0); 3475Debug.Assert(_ps.isEof); 3529Debug.Assert(_stringBuilder.Length == 0); 3530Debug.Assert(_parsingFunction == ParsingFunction.PartialTextValue || 3555Debug.Assert(_stringBuilder.Length > 0); 3609Debug.Assert(_parsingFunction == ParsingFunction.PartialTextValue || _parsingFunction == ParsingFunction.InReadValueChunk || 3625Debug.Assert(_parsingFunction == ParsingFunction.InReadValueChunk); 3630Debug.Assert((_index > 0) ? _nextParsingFunction == ParsingFunction.ElementContent : _nextParsingFunction == ParsingFunction.DocumentContent); 3644Debug.Assert(_parsingFunction == ParsingFunction.InReadContentAsBinary || _parsingFunction == ParsingFunction.InReadElementContentAsBinary); 3649Debug.Assert((_index > 0) ? _nextParsingFunction == ParsingFunction.ElementContent : _nextParsingFunction == ParsingFunction.DocumentContent); 3677Debug.Assert(_stringBuilder.Length == 0); 3718Debug.Assert(_ps.chars[_ps.charPos] == '&'); 3729Debug.Assert(_ps.chars[_ps.charPos] == '&'); 3749Debug.Assert(entityType == EntityType.CharacterDec || entityType == EntityType.CharacterHex); 3908Debug.Assert(_stringBuilder.Length == 0); 3934Debug.Assert(_ps.charPos < _ps.charsUsed); 3988Debug.Assert(_stringBuilder.Length == 0); 4053Debug.Assert(!_ps.eolNormalized); 4202Debug.Assert(_stringBuilder.Length == 0); 4279Debug.Assert(!_ps.eolNormalized); 4460Debug.Assert(_dtdProcessing == DtdProcessing.Ignore); 4791Debug.Assert(_ps.isEof); 4891Debug.Assert(_ps.isEof); 4920Debug.Assert(_ps.chars[_ps.charPos] == '&'); 4954Debug.Assert(_ps.chars[_ps.charPos] == '&'); 5161Debug.Assert(_xmlResolver != null); 5178Debug.Assert(_xmlResolver.SupportsType(uri, typeof(Stream)), "Stream must always be a supported type in XmlResolver"); 5197Debug.Assert(entity.IsExternal); 5211Debug.Assert(_ps.appendMode); 5255Debug.Assert(_dtdInfo == null && _fragmentParserContext != null && _fragmentParserContext.HasDtdInfo); 5270Debug.Assert(_parsingFunction != ParsingFunction.InReadContentAsBinary); 5296Debug.Assert(_parsingFunction != ParsingFunction.InReadElementContentAsBinary); 5297Debug.Assert(_curNode.type == XmlNodeType.Element); 5359Debug.Assert(_incReadDecoder != null); 5473Debug.Assert(_parsingFunction != ParsingFunction.InReadElementContentAsBinary);
System\Xml\Core\XmlTextReaderImplHelpers.cs (23)
284Debug.Assert(internalDtd != null); 417Debug.Assert(type == XmlNodeType.Element); 430Debug.Assert(type == XmlNodeType.Attribute); 447Debug.Assert(_valueStartPos >= 0 || _value != null, "Value not ready."); 451Debug.Assert(_chars != null); 462Debug.Assert(_chars != null); 467Debug.Assert(_value != null); 511Debug.Assert(value != null); 537Debug.Assert(localName != null); 538Debug.Assert(localName.Length > 0); 567Debug.Assert(_valueStartPos != -1); 568Debug.Assert(_chars != null); 578Debug.Assert(_valueStartPos != -1); 579Debug.Assert(_chars != null); 599Debug.Assert(_valueStartPos != -1); 600Debug.Assert(_chars != null); 625Debug.Assert(_valueStartPos != -1); 626Debug.Assert(_chars != null); 643Debug.Assert(_chars != null); 648Debug.Assert(_value != null); 668Debug.Assert(nameWPrefix == null); 725Debug.Assert(x == null || x is NodeData || x is IDtdDefaultAttributeInfo); 726Debug.Assert(y == null || y is NodeData || y is IDtdDefaultAttributeInfo);
System\Xml\Core\XmlTextWriter.cs (8)
1471Debug.Assert(declared, "Unexpected situation!!"); 1549Debug.Assert(_useNsHashtable); 1550Debug.Assert(_nsHashtable != null); 1565Debug.Assert(_useNsHashtable); 1566Debug.Assert(_nsHashtable != null); 1570Debug.Assert(_nsHashtable.ContainsKey(_nsStack[i].prefix)); 1607Debug.Assert(_nsHashtable != null); 1632Debug.Assert(_nsHashtable != null);
System\Xml\Core\XmlUtf8RawTextWriter.cs (40)
99Debug.Assert(stream != null && settings != null); 199Debug.Assert(name != null && name.Length > 0); 238Debug.Assert(localName != null && localName.Length > 0); 239Debug.Assert(prefix != null); 268Debug.Assert(localName != null && localName.Length > 0); 269Debug.Assert(prefix != null); 298Debug.Assert(localName != null && localName.Length > 0); 299Debug.Assert(prefix != null); 316Debug.Assert(localName != null && localName.Length > 0); 317Debug.Assert(prefix != null); 347Debug.Assert(prefix != null && namespaceName != null); 364Debug.Assert(prefix != null); 398Debug.Assert(text != null); 403Debug.Assert(_bufPos >= 4); 433Debug.Assert(text != null); 450Debug.Assert(name != null && name.Length > 0); 451Debug.Assert(text != null); 470Debug.Assert(name != null && name.Length > 0); 513Debug.Assert(ws != null); 533Debug.Assert(text != null); 567Debug.Assert(buffer != null); 568Debug.Assert(index >= 0); 569Debug.Assert(count >= 0 && index + count <= buffer.Length); 589Debug.Assert(buffer != null); 590Debug.Assert(index >= 0); 591Debug.Assert(count >= 0 && index + count <= buffer.Length); 605Debug.Assert(data != null); 672Debug.Assert(_stream != null); 731Debug.Assert(pSrc <= pSrcEnd); 853Debug.Assert(pSrc <= pSrcEnd); 953Debug.Assert(s != null); 983Debug.Assert(pSrc <= pSrcEnd); 1047Debug.Assert(pSrc <= pSrcEnd); 1166Debug.Assert(pSrc <= pSrcEnd); 1316Debug.Assert(pSrc <= pSrcEnd); 1430Debug.Assert(XmlCharType.IsSurrogate(*pSrc)); 1463Debug.Assert(!XmlCharType.IsWhiteSpace((char)ch)); 1464Debug.Assert(!XmlCharType.IsAttributeValueChar((char)ch)); 1519Debug.Assert(ch >= 0x80 && !XmlCharType.IsSurrogate(ch)); 1820Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null);
System\Xml\Core\XmlUtf8RawTextWriterAsync.cs (40)
113Debug.Assert(name != null && name.Length > 0); 153Debug.Assert(localName != null && localName.Length > 0); 154Debug.Assert(prefix != null); 179Debug.Assert(localName != null && localName.Length > 0); 180Debug.Assert(prefix != null); 212Debug.Assert(localName != null && localName.Length > 0); 213Debug.Assert(prefix != null); 232Debug.Assert(localName != null && localName.Length > 0); 233Debug.Assert(prefix != null); 273Debug.Assert(prefix != null && namespaceName != null); 283Debug.Assert(prefix != null); 322Debug.Assert(text != null); 327Debug.Assert(_bufPos >= 4); 358Debug.Assert(text != null); 376Debug.Assert(name != null && name.Length > 0); 377Debug.Assert(text != null); 397Debug.Assert(name != null && name.Length > 0); 442Debug.Assert(ws != null); 459Debug.Assert(text != null); 492Debug.Assert(buffer != null); 493Debug.Assert(index >= 0); 494Debug.Assert(count >= 0 && index + count <= buffer.Length); 512Debug.Assert(buffer != null); 513Debug.Assert(index >= 0); 514Debug.Assert(count >= 0 && index + count <= buffer.Length); 526Debug.Assert(data != null); 558Debug.Assert(_stream != null); 618Debug.Assert(pSrc <= pSrcEnd); 822Debug.Assert(pSrc <= pSrcEnd); 1061Debug.Assert(pSrc <= pSrcEnd); 1127Debug.Assert(text1 != null); 1128Debug.Assert(text2 != null || (text3 == null && text4 == null)); 1129Debug.Assert(text3 != null || (text4 == null)); 1185Debug.Assert(text1 != null); 1186Debug.Assert(text2 != null || (text3 == null && text4 == null)); 1187Debug.Assert(text3 != null || (text4 == null)); 1236Debug.Assert(pSrc <= pSrcEnd); 1437Debug.Assert(pSrc <= pSrcEnd); 1626Debug.Assert(pSrc <= pSrcEnd); 1787Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null);
System\Xml\Core\XmlValidatingReaderImpl.cs (4)
746Debug.Assert(value is XmlValidatingReader); 1013Debug.Assert(_parserContext != null); 1014Debug.Assert(_coreReaderImpl.DtdInfo == null); 1052Debug.Assert(_coreReader.NodeType == XmlNodeType.EntityReference);
System\Xml\Core\XmlValidatingReaderImplAsync.cs (3)
175Debug.Assert(_parserContext != null); 176Debug.Assert(_coreReaderImpl.DtdInfo == null); 193Debug.Assert(_coreReader.NodeType == XmlNodeType.EntityReference);
System\Xml\Core\XmlWellFormedWriter.cs (21)
240Debug.Assert(writer != null); 241Debug.Assert(settings != null); 242Debug.Assert(MaxNamespacesWalkCount <= 3); 456Debug.Assert(prefix.Length == 0); 484Debug.Assert(_attrHashTable != null); 743Debug.Assert(_attrValueCache != null); 785Debug.Assert(_curDeclPrefix != null); 1262Debug.Assert(i >= 0); 1273Debug.Assert(i >= 0); 1581Debug.Assert(_stateTable == s_stateTableAuto); 1625Debug.Assert(prefix == "xmlns"); 1779Debug.Assert(_nsHashtable != null); 1795Debug.Assert(_nsHashtable != null); 1817Debug.Assert(_useNsHashtable); 1818Debug.Assert(_nsHashtable != null); 1819Debug.Assert(indexFrom <= indexTo); 1822Debug.Assert(_nsHashtable.ContainsKey(_nsStack[i].prefix)); 2031Debug.Assert(ncname != null && ncname.Length > 0); 2123Debug.Assert(_attrHashTable.Count == 0); 2148Debug.Assert(_attrHashTable != null); 2166Debug.Assert(prev >= 0 && _attrStack[prev].localName == localName);
System\Xml\Core\XmlWellFormedWriterAsync.cs (3)
229Debug.Assert(prefix.Length == 0); 645Debug.Assert(_attrValueCache != null); 690Debug.Assert(_curDeclPrefix != null);
System\Xml\Core\XmlWellFormedWriterHelpers.cs (3)
96Debug.Assert(kind == NamespaceKind.NeedToWrite); 505Debug.Assert(_singleStringValue != null); 506Debug.Assert(_lastItem == -1);
System\Xml\Core\XmlWellFormedWriterHelpersAsync.cs (1)
31Debug.Assert(kind == NamespaceKind.NeedToWrite);
System\Xml\Core\XmlWrappingReader.cs (1)
25Debug.Assert(baseReader != null);
System\Xml\Core\XmlWrappingWriter.cs (1)
23Debug.Assert(baseWriter != null);
System\Xml\Core\XmlWriterSettings.cs (2)
367Debug.Assert(Encoding.UTF8.WebName == "utf-8"); 603Debug.Assert(Encoding.Equals(Encoding.GetEncoding(Encoding.CodePage)), "Cannot serialize encoding correctly");
System\Xml\Core\XsdCachingReader.cs (8)
483Debug.Assert(_coreReader.NodeType == XmlNodeType.EndElement || (_coreReader.NodeType == XmlNodeType.Element && _coreReader.IsEmptyElement)); 488Debug.Assert(endElementNode.NodeType == XmlNodeType.EndElement); 496Debug.Assert(_coreReader.NodeType == XmlNodeType.EndElement || (_coreReader.NodeType == XmlNodeType.Element && _coreReader.IsEmptyElement)); 561Debug.Assert(_cacheState == CachingReaderState.Replay); 591Debug.Assert(_cacheState == CachingReaderState.Replay); 653Debug.Assert(attIndex < _attributeEvents.Length); 671Debug.Assert(_contentIndex <= _contentEvents.Length); 692Debug.Assert(_coreReader.NodeType == XmlNodeType.Element);
System\Xml\Core\XsdCachingReaderAsync.cs (1)
127Debug.Assert(_cacheState == CachingReaderState.Replay);
System\Xml\Core\XsdValidatingReader.cs (48)
219Debug.Assert(_cachedNode != null); 243Debug.Assert(_cachedNode != null); 264Debug.Assert(_cachedNode != null); 279Debug.Assert(_cachedNode != null); 294Debug.Assert(_cachedNode != null); 323Debug.Assert(_cachedNode != null); 338Debug.Assert(_cachedNode != null); 425Debug.Assert(_xmlSchemaInfo.SchemaType!.Datatype != null); 434Debug.Assert(AttributeSchemaInfo.SchemaType!.Datatype != null); 1177Debug.Assert(attNode != null); 1208Debug.Assert(_readBinaryHelper != null); 1235Debug.Assert(_attributePSVI != null); 1263Debug.Assert(_readBinaryHelper != null); 1304Debug.Assert(_readBinaryHelper != null); 1342Debug.Assert(_readBinaryHelper != null); 1356Debug.Assert(moveTo); 1384Debug.Assert(_readBinaryHelper != null); 1456Debug.Assert(_readBinaryHelper != null); 1570Debug.Assert(_readBinaryHelper != null); 1579Debug.Assert(_cachedNode != null); 1617Debug.Assert(_readBinaryHelper != null); 1644Debug.Assert(_readBinaryHelper != null); 1671Debug.Assert(_readBinaryHelper != null); 1698Debug.Assert(_readBinaryHelper != null); 1927Debug.Assert(_nsManager != null); 1940Debug.Assert(_nsManager != null); 1953Debug.Assert(_nsManager != null); 1990Debug.Assert(_attributePSVI != null); 2072Debug.Assert(_nsManager != null); 2111Debug.Assert(_nsManager != null); 2137Debug.Assert(_atomicValue != null); 2140Debug.Assert(_cachingReader != null); 2148Debug.Assert(_nsManager != null); 2236Debug.Assert(_coreReaderNameTable.Get(localName) != null); 2237Debug.Assert(_coreReaderNameTable.Get(ns) != null); 2281Debug.Assert(_coreReaderNameTable.Get(attrLocalName) != null); 2282Debug.Assert(_coreReaderNameTable.Get(ns) != null); 2304Debug.Assert(attIndex < _attributePSVINodes.Length); 2330Debug.Assert(_inlineSchemaParser != null); 2440Debug.Assert(this.NodeType == XmlNodeType.Element); 2552Debug.Assert(_nsManager != null); 2587Debug.Assert(_coreReader.NodeType == XmlNodeType.EndElement); 2626Debug.Assert(_cachingReader != null); 2646Debug.Assert(_cachingReader != null); 2709Debug.Assert(_cachingReader != null); 2723Debug.Assert(xmlType != null && xmlType.Datatype != null); 2727Debug.Assert(listType != null); 2740Debug.Assert(NodeType != XmlNodeType.Attribute);
System\Xml\Core\XsdValidatingReaderAsync.cs (19)
24Debug.Assert(_cachedNode != null); 321Debug.Assert(_readBinaryHelper != null); 400Debug.Assert(_readBinaryHelper != null); 427Debug.Assert(_readBinaryHelper != null); 454Debug.Assert(_readBinaryHelper != null); 481Debug.Assert(_readBinaryHelper != null); 571Debug.Assert(_nsManager != null); 609Debug.Assert(_nsManager != null); 635Debug.Assert(_atomicValue != null); 638Debug.Assert(_cachingReader != null); 646Debug.Assert(_nsManager != null); 653Debug.Assert(_inlineSchemaParser != null); 716Debug.Assert(_originalAtomicValueString != null); 735Debug.Assert(value != null); 737Debug.Assert(_originalAtomicValueString != null); 776Debug.Assert(this.NodeType == XmlNodeType.Element); 790Debug.Assert(_originalAtomicValueString != null); 816Debug.Assert(_originalAtomicValueString != null); 890Debug.Assert(_nsManager != null);
System\Xml\Dom\DocumentSchemaValidator.cs (15)
67Debug.Assert(schemas != null && schemas.Count > 0); 89Debug.Assert(nodeToValidate.SchemaInfo != null); 115Debug.Assert(schemaElement.ElementSchemaType == schemaInfo.SchemaType); 324Debug.Assert(elementNode != null); 338Debug.Assert(_nameTable.Get(attr.NamespaceURI) != null); 339Debug.Assert(_nameTable.Get(attr.LocalName) != null); 435Debug.Assert(_attributeSchemaInfo != null); 447Debug.Assert(simpleValue != null); 485Debug.Assert(elementToValidate.ParentNode!.NodeType != XmlNodeType.Document); //Handle if it is the documentElement separately 608Debug.Assert(_nodeSequenceToValidate![0] == elementToValidate.ParentNode); 673Debug.Assert(elementNode != null); 687Debug.Assert(_nameTable.Get(attr.NamespaceURI) != null); 688Debug.Assert(_nameTable.Get(attr.LocalName) != null); 757Debug.Assert(child == childToStopAt); 791Debug.Assert(ex != null);
System\Xml\Dom\DocumentXmlWriter.cs (3)
433Debug.Assert(elem != null); 438Debug.Assert(attr != null); 449Debug.Assert(attr != null);
System\Xml\Dom\DocumentXPathNavigator.cs (38)
179Debug.Assert(_source.Value != null); 220Debug.Assert(value != null); 527Debug.Assert(attributes != null); 547Debug.Assert(attributes != null && attributes.parent != null); 578Debug.Assert(_namespaceParent != null); 640Debug.Assert(attributes != null); 641Debug.Assert(0 <= index && index < attributes.Count); 661Debug.Assert(attributes != null && attributes.parent != null); 724Debug.Assert(parent != null); 760Debug.Assert(parent != null); 788Debug.Assert(sibling != null); 1271Debug.Assert(ownerDocument != null); 1307Debug.Assert(node1 != null); 1308Debug.Assert(node2 != null); 1309Debug.Assert(node1 != node2, "Should be handled by ComparePosition()"); 1311Debug.Assert(OwnerNode(node1) == OwnerNode(node2)); 1317Debug.Assert(element != null); 1393Debug.Assert(node1 != node2); 1412Debug.Assert(node2 != null); 1427Debug.Assert(node1 != null); 1436Debug.Assert(node1 != node2); 1456Debug.Assert(this.NodeType != XPathNodeType.Attribute && this.NodeType != XPathNodeType.Namespace && this.NodeType != XPathNodeType.All); 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"); 2257Debug.Assert(((XmlNode)nav.UnderlyingObject).NodeType != XmlNodeType.Attribute); 2270Debug.Assert(node != null); 2311Debug.Assert(((XmlNode)nav.UnderlyingObject).NodeType != XmlNodeType.Attribute); 2312Debug.Assert(Ref.Equal(nav.NameTable.Get(nsAtom), nsAtom)); 2326Debug.Assert(node != null); 2327Debug.Assert(node.NodeType == XmlNodeType.Element); 2369Debug.Assert(((XmlNode)nav.UnderlyingObject).NodeType != XmlNodeType.Attribute); 2370Debug.Assert(Ref.Equal(nav.NameTable.Get(localNameAtom), localNameAtom)); 2371Debug.Assert(Ref.Equal(nav.NameTable.Get(nsAtom), nsAtom)); 2372Debug.Assert(localNameAtom.Length > 0); // Use DocumentXPathNodeIterator_ElemChildren_NoLocalName class for special magic value of localNameAtom 2391Debug.Assert(node != null); 2392Debug.Assert(node.NodeType == XmlNodeType.Element); 2402Debug.Assert(localNameAtom.Length > 0); // Use DocumentXPathNodeIterator_ElemChildren_AndSelf_NoLocalName if localName == String.Empty
System\Xml\Dom\DomNameTable.cs (1)
26Debug.Assert((_entries.Length & _mask) == 0); // entries.Length must be a power of two
System\Xml\Dom\XmlAttribute.cs (3)
21Debug.Assert(name != null); 22Debug.Assert(doc != null); 54Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlAttributeCollection.cs (10)
194Debug.Assert(offset != -1); // the if statement above guarantees that the ref node is in the collection 223Debug.Assert(offset != -1); // the if statement above guarantees that the ref node is in the collection 303Debug.Assert(retNode is XmlAttribute); 319Debug.Assert(retNode is XmlAttribute); 386Debug.Assert(parentElem != null); 388Debug.Assert(doc != null); 403Debug.Assert(parentElem != null); 405Debug.Assert(doc != null); 418Debug.Assert(-1 == FindNodeOffset(node)); 421Debug.Assert(retNode is XmlAttribute);
System\Xml\Dom\XmlCDataSection.cs (1)
72Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlCharacterData.cs (1)
201Debug.Assert(XmlDocument.IsTextNode(n.NodeType) || (n.ParentNode != null && n.ParentNode.NodeType == XmlNodeType.EntityReference));
System\Xml\Dom\XmlComment.cs (1)
37Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlDeclaration.cs (1)
160Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlDocument.cs (12)
217Debug.Assert((prefix == null) ? (n.Prefix.Length == 0) : (prefix == n.Prefix)); 218Debug.Assert(n.LocalName == localName); 219Debug.Assert((namespaceURI == null) ? (n.NamespaceURI.Length == 0) : (n.NamespaceURI == namespaceURI)); 226Debug.Assert(n == null || ((prefix == null) ? (n.Prefix.Length == 0) : (prefix == n.Prefix))); 227Debug.Assert(n == null || n.LocalName == localName); 228Debug.Assert(n == null || ((namespaceURI == null) ? (n.NamespaceURI.Length == 0) : (n.NamespaceURI == namespaceURI))); 235Debug.Assert((prefix == null) ? (xmlName.Prefix.Length == 0) : (prefix == xmlName.Prefix)); 236Debug.Assert(xmlName.LocalName == localName); 237Debug.Assert((namespaceURI == null) ? (xmlName.NamespaceURI.Length == 0) : (xmlName.NamespaceURI == namespaceURI)); 977Debug.Assert(((XmlAttribute)node).Specified); 1042Debug.Assert(toNode.NodeType != XmlNodeType.EntityReference); 1772Debug.Assert(doc == this);
System\Xml\Dom\XmlDocumentFragment.cs (3)
109Debug.Assert(OwnerDocument != null); 155Debug.Assert(newChild != null); //should be checked that newChild is not null before this function call 171Debug.Assert(newChild != null); //should be checked that newChild is not null before this function call
System\Xml\Dom\XmlDocumentType.cs (2)
30Debug.Assert(doc != null); 61Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlElement.cs (5)
23Debug.Assert(name != null); 54Debug.Assert(OwnerDocument != null); 481Debug.Assert(n != null); 495Debug.Assert(n != null); 503Debug.Assert(n != null);
System\Xml\Dom\XmlElementList.cs (11)
29Debug.Assert(parent != null); 30Debug.Assert(parent.NodeType == XmlNodeType.Element || parent.NodeType == XmlNodeType.Document); 32Debug.Assert(parent.Document != null); 72Debug.Assert(parent.Document != null); 74Debug.Assert(nt != null); 83Debug.Assert(parent.Document != null); 85Debug.Assert(nt != null); 108Debug.Assert(curNode != null); 135Debug.Assert(curNode != null); 183Debug.Assert(n != null); 197Debug.Assert(n != null);
System\Xml\Dom\XmlEntityReference.cs (1)
84Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlLoader.cs (18)
57Debug.Assert(_reader != null); 58Debug.Assert(parentDoc != null); 86Debug.Assert(n != null); 149Debug.Assert(parent.NodeType == XmlNodeType.Element); 171Debug.Assert(parent == null); 226Debug.Assert(node != null); 252Debug.Assert(_reader!.NodeType == XmlNodeType.Attribute); 293Debug.Assert(node != null); 302Debug.Assert(_reader!.IsDefault); 351Debug.Assert(node != null); 359Debug.Assert(_reader!.NodeType == XmlNodeType.EntityReference); 382Debug.Assert(_reader!.NodeType == XmlNodeType.XmlDeclaration); 420Debug.Assert(_reader!.NodeType == XmlNodeType.DocumentType); 495Debug.Assert(parent!.NodeType == XmlNodeType.Element); 550Debug.Assert(node != null); 750Debug.Assert(parentNode.NodeType != XmlNodeType.Document); 752Debug.Assert(_doc != null); 945Debug.Assert(tr.EntityHandling == EntityHandling.ExpandCharEntities);
System\Xml\Dom\XmlName.cs (2)
89Debug.Assert(_prefix != null); 109Debug.Assert(Ref.Equal(_name, ownerDoc.NameTable.Get(_name)));
System\Xml\Dom\XmlNode.cs (10)
44Debug.Assert(doc != null); 56Debug.Assert(nodeIterator.Current != null); 128Debug.Assert(parentNode != null); 187Debug.Assert(parentNode != null); 791Debug.Assert(firstNode.NodeType == XmlNodeType.Text 809Debug.Assert(true, "shouldn't have fall through here."); 1433Debug.Assert(prevNode.IsText); 1434Debug.Assert(nextNode.IsText); 1441Debug.Assert(prevNode.IsText); 1442Debug.Assert(nextNode.IsText);
System\Xml\Dom\XmlNodeReader.cs (11)
110Debug.Assert(nt == XmlNodeType.XmlDeclaration || nt == XmlNodeType.DocumentType); 131Debug.Assert(_curNode.NodeType == XmlNodeType.XmlDeclaration || _curNode.NodeType == XmlNodeType.DocumentType); 136Debug.Assert(_nAttrInd >= 0 && _nAttrInd < AttributeCount); 214Debug.Assert(_curNode.NodeType == XmlNodeType.XmlDeclaration || _curNode.NodeType == XmlNodeType.DocumentType); 215Debug.Assert(_nAttrInd >= 0 && _nAttrInd < AttributeCount); 235Debug.Assert(nt == XmlNodeType.XmlDeclaration || nt == XmlNodeType.DocumentType); 236Debug.Assert(_nAttrInd >= 0 && _nAttrInd < AttributeCount); 608Debug.Assert(IsOnDeclOrDocType); 1053Debug.Assert(_curNode.NodeType == XmlNodeType.XmlDeclaration || _curNode.NodeType == XmlNodeType.DocumentType); 1082Debug.Assert(_curNode != null); 1627Debug.Assert(_curDepth == 0);
System\Xml\Dom\XmlProcessingInstruction.cs (1)
82Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlSignificantWhiteSpace.cs (1)
72Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlText.cs (1)
76Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlWhitespace.cs (1)
88Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XPathNodeList.cs (1)
49Debug.Assert(_nodeIterator.Current != null);
System\Xml\Resolvers\XmlPreloadedResolver.cs (2)
214Debug.Assert(s_rss091_Dtd.Length == 1); 352Debug.Assert(uri != null);
System\Xml\Schema\BaseProcessor.cs (2)
25Debug.Assert(nameTable != null); 146Debug.Assert(item is XmlSchemaElement);
System\Xml\Schema\BaseValidator.cs (6)
49Debug.Assert(schemaCollection == null || schemaCollection.NameTable == reader.NameTable); 171Debug.Assert(context != null); 191Debug.Assert(names.Count > 0); 209Debug.Assert(context != null); 232Debug.Assert(textString != null); 239Debug.Assert(textValue != null);
System\Xml\Schema\BitSet.cs (1)
73Debug.Assert(startFrom >= -1 && startFrom <= _count);
System\Xml\Schema\Chameleonkey.cs (1)
66Debug.Assert((chameleonLocation.OriginalString.Length == 0 && originalSchema != null)
System\Xml\Schema\CompiledidEntityConstraint.cs (1)
61Debug.Assert(fields.Count > 0);
System\Xml\Schema\ConstraintStruct.cs (5)
211Debug.Assert(_dstruct != null); 219Debug.Assert(_dstruct != null); 363Debug.Assert(arr1 != null); 378Debug.Assert(arr2 != null); 398Debug.Assert(dim > 0);
System\Xml\Schema\ContentValidator.cs (17)
86Debug.Assert(_particles.Count == _last + 1); 123Debug.Assert(_particles.Count == _last + 1); 138Debug.Assert(name != null); 910Debug.Assert(parent is SequenceNode); 911Debug.Assert(this == parent.RightChild); 1234Debug.Assert(ContentType == XmlSchemaContentType.ElementOnly || ContentType == XmlSchemaContentType.Mixed); 1243Debug.Assert(!IsOpen); 1328Debug.Assert(lrNode != null); 1346Debug.Assert(lrNode1 != null); 1394Debug.Assert(lrNode != null); 1463Debug.Assert(state == stateTable[statePosSet]); // just make sure that statePosSet is for correct state 1852Debug.Assert(_minMaxNodesCount != 0); 1951Debug.Assert(_minMaxNodesCount > 0); 1973Debug.Assert(lrNode != null); 2046Debug.Assert(runningPositions[i].curpos != null); 2089Debug.Assert(runningPositions[i].curpos != null); 2149Debug.Assert(_elements.Count > 0);
System\Xml\Schema\DataTypeImplementation.cs (13)
172Debug.Assert(qname != null && dataType != null); 188Debug.Assert(derivedType != null && baseType != null); 363Debug.Assert(currentType != null); 538Debug.Assert(typedValue != null); 559Debug.Assert(typedValue != null); 953Debug.Assert(arr1 != null && arr2 != null); 964Debug.Assert(atomicValues2 != null); 1030Debug.Assert(valuesToCheck != null); 1111Debug.Assert(unionTypedValue != null); 1128Debug.Assert(_itemType.ListValueType.GetElementType() == _itemType.ValueType); 1259Debug.Assert(typedValue != null); 1315Debug.Assert(memberType != null); 2627Debug.Assert(uri != null);
System\Xml\Schema\DtdParser.cs (34)
208Debug.Assert((int)Token.CDATA == (int)XmlTokenizedType.CDATA && (int)XmlTokenizedType.CDATA == 0); 209Debug.Assert((int)Token.ID == (int)XmlTokenizedType.ID && (int)XmlTokenizedType.ID == 1); 210Debug.Assert((int)Token.IDREF == (int)XmlTokenizedType.IDREF && (int)XmlTokenizedType.IDREF == 2); 211Debug.Assert((int)Token.IDREFS == (int)XmlTokenizedType.IDREFS && (int)XmlTokenizedType.IDREFS == 3); 212Debug.Assert((int)Token.ENTITY == (int)XmlTokenizedType.ENTITY && (int)XmlTokenizedType.ENTITY == 4); 213Debug.Assert((int)Token.ENTITIES == (int)XmlTokenizedType.ENTITIES && (int)XmlTokenizedType.ENTITIES == 5); 214Debug.Assert((int)Token.NMTOKEN == (int)XmlTokenizedType.NMTOKEN && (int)XmlTokenizedType.NMTOKEN == 6); 215Debug.Assert((int)Token.NMTOKENS == (int)XmlTokenizedType.NMTOKENS && (int)XmlTokenizedType.NMTOKENS == 7); 216Debug.Assert((int)Token.NOTATION == (int)XmlTokenizedType.NOTATION && (int)XmlTokenizedType.NOTATION == 8); 235Debug.Assert(readerAdapter != null); 492Debug.Assert(ParsingInternalSubset); 498Debug.Assert(_externalEntitiesDepth == 0); 519Debug.Assert(_readerAdapter.EntityStackLength == 0 || 589Debug.Assert(_curPos > 0 && _chars[_curPos - 1] == ']'); 601Debug.Assert(_readerAdapter.EntityStackLength == 0 || 625Debug.Assert(_scanningFunction == ScanningFunction.SubsetContent); 1494Debug.Assert(idTokenType == Token.PUBLIC); 2393Debug.Assert(_chars[_curPos] == '"' || _chars[_curPos] == '\''); 2609Debug.Assert(_curPos - _tokenStartPos == 0); 3109Debug.Assert(_chars[_curPos] == 'P'); 3128Debug.Assert(_chars[_curPos] == 'S'); 3150Debug.Assert(_curPos - _tokenStartPos > 0); 3172Debug.Assert(_curPos - _tokenStartPos > 0); 3195Debug.Assert(_curPos == 0 || _chars[_curPos - 1] == '"' || _chars[_curPos - 1] == '\''); 3228Debug.Assert(_internalSubsetValueSb != null); 3244Debug.Assert(_chars[_curPos] == '&' || _chars[_curPos] == '%'); 3252Debug.Assert(_chars[_curPos - 1] == ';'); 3317Debug.Assert(!ParsingInternalSubset || _freeFloatingDtd); 3318Debug.Assert(_currentEntityId == 0); 3342Debug.Assert(_chars[_curPos - 1] == ';'); 3398Debug.Assert(_validate); 3404Debug.Assert(_validate); 3410Debug.Assert(_validate); 3528Debug.Assert(startPos < _charsUsed);
System\Xml\Schema\DtdParserAsync.cs (15)
136Debug.Assert(ParsingInternalSubset); 142Debug.Assert(_externalEntitiesDepth == 0); 163Debug.Assert(_readerAdapter.EntityStackLength == 0 || 233Debug.Assert(_curPos > 0 && _chars[_curPos - 1] == ']'); 245Debug.Assert(_readerAdapter.EntityStackLength == 0 || 269Debug.Assert(_scanningFunction == ScanningFunction.SubsetContent); 993Debug.Assert(_internalSubsetValueSb != null); 1021Debug.Assert(_internalSubsetValueSb != null); 1119Debug.Assert(idTokenType == Token.PUBLIC); 1839Debug.Assert(_chars[_curPos] == '"' || _chars[_curPos] == '\''); 2055Debug.Assert(_curPos - _tokenStartPos == 0); 2522Debug.Assert(_chars[_curPos] == 'P'); 2541Debug.Assert(_chars[_curPos] == 'S'); 2574Debug.Assert(_chars[_curPos] == '&' || _chars[_curPos] == '%'); 2582Debug.Assert(_chars[_curPos - 1] == ';');
System\Xml\Schema\DtdValidator.cs (2)
46Debug.Assert(reader != null); 149Debug.Assert(reader.NodeType == XmlNodeType.Element);
System\Xml\Schema\FacetChecker.cs (5)
1017Debug.Assert(restriction != null); 1500Debug.Assert(restriction != null); 1629Debug.Assert(values != null); 1675Debug.Assert(list != null); 1683Debug.Assert(enumValue != null);
System\Xml\Schema\Inference\Infer.cs (8)
253Debug.Assert(_rootSchema != null, "rootSchema is null"); 278Debug.Assert(compiledAttributes != null); //AttributeUses is never null 483Debug.Assert(targetNS == null || targetNS.Length > 0, "targetns for schema is empty"); 1003Debug.Assert(elem.ElementDecl == null); 1202Debug.Assert(_xtr!.NodeType == XmlNodeType.Attribute); 1242Debug.Assert(ct != null); 1253Debug.Assert(ct != null); //either the user-defined type itself is a complex type or we switched from a simple type to a complex type 1257Debug.Assert(sce != null);
System\Xml\Schema\NamespaceList.cs (5)
29Debug.Assert(targetNamespace != null); 69Debug.Assert(_set != null); 179Debug.Assert(super._type == ListType.Set); 197Debug.Assert(o1 != o2); 315Debug.Assert(o1 != o2); //clause 1
System\Xml\Schema\Parser.cs (7)
89Debug.Assert(_schemaType == SchemaType.XDR); 241Debug.Assert(_parentNode != null); 324Debug.Assert(currentNode != null); 325Debug.Assert(_parentNode != null); 333Debug.Assert(_reader!.NodeType == XmlNodeType.Element); 418Debug.Assert(_reader!.NodeType == XmlNodeType.Attribute); 444Debug.Assert(_reader!.NodeType == XmlNodeType.EntityReference);
System\Xml\Schema\ParserAsync.cs (1)
50Debug.Assert(_schemaType == SchemaType.XDR);
System\Xml\Schema\Preprocessor.cs (3)
304Debug.Assert(import != null); 823Debug.Assert(_currentSchema != null); 977Debug.Assert((currentSchemaObject as XmlSchema) == null); // The current object should not be schema
System\Xml\Schema\SchemaCollectionCompiler.cs (7)
54Debug.Assert(!members.Contains(element)); 514Debug.Assert(group.CanonicalParticle != null); 1030Debug.Assert(baseType.ElementDecl.ContentValidator != null); 1859Debug.Assert(attribute.Use != XmlSchemaUse.Prohibited); 2252Debug.Assert(xe.ElementSchemaType != null); 2486Debug.Assert(particle == XmlSchemaParticle.Empty); 2531Debug.Assert(!p.IsEmpty);
System\Xml\Schema\SchemaSetCompiler.cs (10)
128Debug.Assert(_schemaForSchema != null); 499Debug.Assert(examplar != null); //Headelement presence is checked while building subst groups 596Debug.Assert(group.CanonicalParticle != null); 2224Debug.Assert(attribute.Use != XmlSchemaUse.Prohibited); 2711Debug.Assert(xe.ElementSchemaType != null); 2730Debug.Assert(decl != null); 2912Debug.Assert(!((XmlSchemaParticle)particles[i]).IsEmpty); 3086Debug.Assert(baseFixedValue != null); 3093Debug.Assert(derivedFixedValue != null); 3109Debug.Assert(simpleFixedValue != null);
System\Xml\Schema\XdrBuilder.cs (1)
623Debug.Assert(_GroupDef != null);
System\Xml\Schema\XmlAtomicValue.cs (1)
169Debug.Assert(qname != null); //string representation is handled in a different overload
System\Xml\Schema\XmlSchema.cs (2)
232Debug.Assert(_isPreprocessed); 529Debug.Assert(extList != null && schema != null);
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 (11)
21Debug.Assert(!_table.ContainsKey(name), "XmlSchemaObjectTable.Add: entry already exists"); 32Debug.Assert(oldValue != null); 34Debug.Assert(matchedIndex >= 0); 36Debug.Assert(_entries[matchedIndex].qname == name); 51Debug.Assert(oldValue != null); 53Debug.Assert(_entries[matchedIndex].qname == name); 71Debug.Assert(matchedIndex >= 0); 72Debug.Assert(_entries[matchedIndex].qname == name); 94Debug.Assert(_table.Count == _entries.Count); 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\XmlSchemaSet.cs (2)
869Debug.Assert(ns != null); 880Debug.Assert(schema.BaseUri!.Equals(schemaUri));
System\Xml\Schema\XmlSchemaSimpleType.cs (1)
15Debug.Assert(SchemaContentType == XmlSchemaContentType.TextOnly);
System\Xml\Schema\XmlSchemaValidator.cs (32)
333Debug.Assert(_validatedNamespaces != null); 586Debug.Assert(_currentState == ValidatorState.TopLevelAttribute); //Re-set state back to start on error with partial validation type 596Debug.Assert(currentElementDecl != null); 598Debug.Assert(ct != null); 615Debug.Assert(attributeDef != null); 636Debug.Assert(simpleValue != null); 782Debug.Assert(names.Count > 0); 910Debug.Assert(_context.Validity != XmlSchemaValidity.Valid); 1059Debug.Assert(attSchemaInfo != null); 1282Debug.Assert(typedValue != null); 1429Debug.Assert(currentElementDecl.Datatype != null); 1491Debug.Assert(simpleValue != null); 1505Debug.Assert(decl != null && decl.SchemaType != null); 1547Debug.Assert(_validationStack.Length > 1); 1628Debug.Assert(_partialValidationType is XmlSchemaAttribute); 1666Debug.Assert(elementDecl.DefaultValueTyped != null); 1818Debug.Assert(elementDecl.ContentValidator!.ContentType == XmlSchemaContentType.Mixed && elementDecl.DefaultValueTyped != null); 1831Debug.Assert(decl != null); 1842Debug.Assert(_xmlResolver != null); 1934Debug.Assert(dtype != null); 1950Debug.Assert(typedValue != null); 1973Debug.Assert(dtype != null); 1982Debug.Assert(typedValue != null); 2098Debug.Assert(currentElementDecl != null); 2312Debug.Assert(datatype != null); 2519Debug.Assert(contentValidator is DfaContentValidator || contentValidator is NfaContentValidator || contentValidator is RangeContentValidator || contentValidator is AllElementsContentValidator); 2543Debug.Assert(names.Count > 0); 2576Debug.Assert(schemaSet != null); 2595Debug.Assert(names.Count > 0); 2634Debug.Assert(builder.Length != 0); 2645Debug.Assert(nextParticle != null); 2745Debug.Assert(nsList.Length > 0);
System\Xml\Schema\XmlValueConverter.cs (8)
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"); 282Debug.Assert(_clrTypeDefault!.IsArray); 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"); 3146Debug.Assert(schemaType.DerivedBy == XmlSchemaDerivationMethod.Union);
System\Xml\Schema\XsdBuilder.cs (2)
705Debug.Assert(_currentEntry.InitFunc != null); 708Debug.Assert(_xso != null);
System\Xml\Schema\XsdDateTime.cs (3)
170Debug.Assert(BitOperations.IsPow2((uint)kinds), "One and only one DateTime type code can be set."); 214Debug.Assert(BitOperations.IsPow2((uint)kinds), "Only one DateTime type code can be set."); 491Debug.Assert(success);
System\Xml\Schema\XsdDuration.cs (3)
117Debug.Assert(durationType == DurationType.Duration || durationType == DurationType.DayTimeDuration); 347Debug.Assert(success); 426Debug.Assert(successCopy);
System\Xml\Schema\XsdValidator.cs (1)
494Debug.Assert(attnDef.SchemaType != null);
System\Xml\Serialization\CodeGenerator.cs (33)
46System.Diagnostics.Debug.Assert(typeBuilder != null); 60Debug.Assert(iType.IsInterface); 131System.Diagnostics.Debug.Assert(_argList != null && _argList.ContainsKey(name)); 137System.Diagnostics.Debug.Assert(_currentScope != null && _currentScope.ContainsKey(name)); 212Debug.Assert(_currentScope!.parent != null); 221Debug.Assert(_freeLocals != null); 243Debug.Assert(!_currentScope!.ContainsKey(name)); 259Debug.Assert(local.LocalType == type); 281Debug.Assert(forState != null); 308Debug.Assert(ICollection_get_Count.IsVirtual && !ICollection_get_Count.DeclaringType!.IsValueType); 402Debug.Assert(methodInfo != null); 411Debug.Assert(ctor != null); 417Debug.Assert(constructorInfo != null); 552System.Diagnostics.Debug.Assert(memberInfo is PropertyInfo); 559System.Diagnostics.Debug.Assert(getMethod != null); 585System.Diagnostics.Debug.Assert(memberInfo is PropertyInfo); 592System.Diagnostics.Debug.Assert(getMethod != null); 620System.Diagnostics.Debug.Assert(memberInfo is PropertyInfo); 626System.Diagnostics.Debug.Assert(setMethod != null); 930Debug.Assert(_currentScope!.ContainsKey(name)); 942Debug.Assert(local.LocalType == type); 953Debug.Assert(_currentScope!.ContainsKey(name)); 955Debug.Assert(local.LocalType == type); 1039Debug.Assert(!opCode.Equals(OpCodes.Nop)); 1246Debug.Assert(ifState != null); 1280Debug.Assert(_initElseIfStack == -1); 1290Debug.Assert(_initIfStack == -1); 1310Debug.Assert(_initIfStack == -1 && _initElseIfStack == -1); 1331Debug.Assert(_initIfStack == -1 && _initElseIfStack == -1); 1615Debug.Assert(this.MethodBuilder.ReturnType == returnType); 1616Debug.Assert(this.MethodBuilder.Attributes == attributes); 1617Debug.Assert(this.ParameterTypes.Length == parameterTypes.Length); 1620Debug.Assert(this.ParameterTypes[i] == parameterTypes[i]);
System\Xml\Serialization\CodeIdentifier.cs (1)
175Debug.Assert(ident != null);
System\Xml\Serialization\Compiler.cs (1)
75Debug.Assert(originalAssemblyInfo != null);
System\Xml\Serialization\Mappings.cs (4)
754Debug.Assert(a1 != null); 755Debug.Assert(a2 != null); 867Debug.Assert(m1 != null); 868Debug.Assert(m2 != null);
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (6)
601Debug.Assert(o != null, "Object o should not be null"); 602Debug.Assert(!string.IsNullOrEmpty(memberName), "memberName must have a value"); 613Debug.Assert(memberInfo != null, "memberInfo could not be retrieved"); 1254Debug.Assert(!mapping.IsSoap, "mapping.IsSoap was true. Use WriteEnumMethodSoap for reading SOAP encoded enum value."); 1934Debug.Assert(xmlnsMember.XmlnsSource != null, "Xmlns member's source was not set."); 2114Debug.Assert(!typeof(TObj).IsValueType);
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (3)
169Debug.Assert(a != null); 365Debug.Assert(o is byte[]); 875Debug.Assert(ai is byte[]);
System\Xml\Serialization\SourceInfo.cs (4)
117Debug.Assert(get_Item != null); 194Debug.Assert(match.Groups["arg"].Value == Arg); 195Debug.Assert(match.Groups["cast"].Value == CodeIdentifier.GetCSharpName(Type!)); 222System.Diagnostics.Debug.Assert(targetType == nullableType || targetType.IsAssignableFrom(nullableType.GetGenericArguments()[0]));
System\Xml\Serialization\Types.cs (2)
1107Debug.Assert(propertyInfo != null); 1108Debug.Assert(typeDesc != null);
System\Xml\Serialization\XmlSerializationILGen.cs (5)
49System.Diagnostics.Debug.Assert(access == "public"); 64get { System.Diagnostics.Debug.Assert(_moduleBuilder != null); return _moduleBuilder; } 65set { System.Diagnostics.Debug.Assert(_moduleBuilder == null && value != null); _moduleBuilder = value; } 103System.Diagnostics.Debug.Assert(_methodBuilders.ContainsKey(methodName)); 581System.Diagnostics.Debug.Assert(memberInfos.ContainsKey(source.Substring(3)));
System\Xml\Serialization\XmlSerializationReaderILGen.cs (20)
254Debug.Assert(_idNameFields.ContainsKey(id)); 311Debug.Assert(node == "null" || node == "(object)p"); 680System.Diagnostics.Debug.Assert(source == "Reader.ReadElementString()" || source == "Reader.ReadString()" 790System.Diagnostics.Debug.Assert(source == "Reader.Value" || source == "Reader.ReadElementString()" || source == "vals[i]"); 908System.Diagnostics.Debug.Assert(source == "false"); 1052Debug.Assert(get_TableName != null); 1742System.Diagnostics.Debug.Assert(source == "Reader"); 2011System.Diagnostics.Debug.Assert(elseCall == "UnknownNode"); 2310Debug.Assert(anyText != null); 2631Debug.Assert(!soapRefs); 2711Debug.Assert(match.Groups["locA1"].Value == match.Groups["locA2"].Value); 2712Debug.Assert(match.Groups["locA1"].Value == match.Groups["locA3"].Value); 2713Debug.Assert(match.Groups["locI1"].Value == match.Groups["locI2"].Value); 2757System.Diagnostics.Debug.Assert(CodeGenerator.GetVariableType(ilg.GetVariable(match.Groups["a"].Value)).IsArray); 2781Debug.Assert(elementType != null && variable is LocalBuilder); 2791Debug.Assert(memberInfos.ContainsKey(source.Substring(3))); 2819Debug.Assert(!localA.LocalType.IsGenericType || (localA.LocalType.GetGenericArguments().Length == 1 && localA.LocalType.GetGenericArguments()[0].IsAssignableFrom(elementType))); 2825Debug.Assert(Add != null); 2838System.Diagnostics.Debug.Assert(varType.IsArray); 2865Debug.Assert(memberInfos.ContainsKey(source.Substring(3)));
System\Xml\Serialization\XmlSerializationWriter.cs (2)
412Debug.Assert(tryFormatResult.Value, "Something goes wrong with formatting primitives to the buffer."); 416Debug.Assert(!span.Slice(0, charsWritten).ContainsAny(escapeChars), "Primitive value contains illegal xml char.");
System\Xml\Serialization\XmlSerializationWriterILGen.cs (11)
1042System.Diagnostics.Debug.Assert(xmlnsSource.StartsWith("o.@", StringComparison.Ordinal)); 1362System.Diagnostics.Debug.Assert(parent == "o" || parent == "p"); 2184Debug.Assert(!local.LocalType.IsValueType); 2366Debug.Assert(type.IsValueType); 2501Debug.Assert(initValue.MemberInfo != null); 2502Debug.Assert(initValue.MemberInfo.Name == initValue.Arg.Substring(3)); 2549Debug.Assert(typeName == arrayTypeDesc.CSharpName || typeName == $"{arrayTypeDesc.CSharpName}[]"); 2558Debug.Assert(type != null); 2559Debug.Assert(ilg != null); 2566Debug.Assert(arrayType != null); 2567Debug.Assert(ilg != null);
System\Xml\ValidateNames.cs (7)
38Debug.Assert(s != null && offset <= s.Length); 69Debug.Assert(s != null && offset <= s.Length); 107Debug.Assert(s != null && offset <= s.Length); 157Debug.Assert(s != null && offset <= s.Length); 376Debug.Assert(offsetBadChar < s.Length); 396Debug.Assert(offsetBadChar < s.Length); 453Debug.Assert(prefix != null && localName != null && ns != null);
System\Xml\XmlCharType.cs (7)
23Debug.Assert(PublicIdChars.Contains(c) == IsPubidChar(c)); 24Debug.Assert(AsciiCharDataChars.Contains(c) == IsCharData(c)); 25Debug.Assert(WhiteSpaceChars.Contains(c) == IsWhiteSpace(c)); 168Debug.Assert(str != null); 169Debug.Assert(startPos <= str.Length); 170Debug.Assert(startPos + len <= str.Length); 181Debug.Assert(start <= end);
System\Xml\XmlEncoding.cs (1)
408Debug.Assert(i == 1);
System\Xml\XmlException.cs (5)
92Debug.Assert(message == null || !message.StartsWith("Xml_", StringComparison.Ordinal), "Do not pass a resource here!"); 227Debug.Assert(invCharIndex < data.Length); 228Debug.Assert(invCharIndex < length); 229Debug.Assert(length <= data.Length); 294Debug.Assert(e != null, "Unexpected null exception");
System\Xml\XmlNamespacemanager.cs (18)
102Debug.Assert(_nsdecls != null); 108Debug.Assert(_hashTable != null); 113Debug.Assert(decl >= 2); 126Debug.Assert(_nameTable != null); 127Debug.Assert(_nsdecls != null); 170Debug.Assert(_hashTable != null); 177Debug.Assert(_hashTable == null); 193Debug.Assert(_nsdecls != null); 208Debug.Assert(_nsdecls != null); 226Debug.Assert(_nsdecls != null); 242Debug.Assert(i >= 2); 253Debug.Assert(prefix != null); 274Debug.Assert(_nsdecls != null); 281Debug.Assert(_nsdecls != null); 285Debug.Assert(_hashTable != null); 322Debug.Assert(_nsdecls != null); 341Debug.Assert(_nsdecls != null); 367Debug.Assert(_nsdecls != null);
System\Xml\XPath\Internal\AbsoluteQuery.cs (1)
16Debug.Assert(context.Current != null);
System\Xml\XPath\Internal\AttributeQuery.cs (2)
42Debug.Assert(currentNode != null); 48Debug.Assert(!currentNode.NamespaceURI.Equals(XmlReservedNs.NsXmlNs));
System\Xml\XPath\Internal\Axis.cs (2)
39Debug.Assert(prefix != null); 40Debug.Assert(name != null);
System\Xml\XPath\Internal\BaseAxisQuery.cs (4)
34Debug.Assert(qyInput != null); 64Debug.Assert(context != null); 89Debug.Assert(_nsUri != null); 120Debug.Assert(this is AttributeQuery || this is ChildrenQuery);
System\Xml\XPath\Internal\BooleanExpr.cs (2)
19Debug.Assert(op == Operator.Op.AND || op == Operator.Op.OR); 20Debug.Assert(opnd1 != null && opnd2 != null);
System\Xml\XPath\Internal\BooleanFunctions.cs (2)
65Debug.Assert(result is XPathNavigator, "Unknown value type"); 79Debug.Assert(nodeIterator.Current != null);
System\Xml\XPath\Internal\CacheAxisQuery.cs (2)
40Debug.Assert(0 <= count && count <= outputBuffer.Count); 52Debug.Assert(0 <= count && count <= outputBuffer.Count);
System\Xml\XPath\Internal\CacheOutputQuery.cs (2)
51Debug.Assert(0 <= count && count <= outputBuffer.Count); 63Debug.Assert(0 <= count && count <= outputBuffer.Count);
System\Xml\XPath\Internal\CompiledXPathExpr.cs (2)
46Debug.Assert(_query != null, "In case of error in XPath we create ErrorXPathExpression"); 124Debug.Assert(prefix != null);
System\Xml\XPath\Internal\DescendantoverDescendantQuery.cs (4)
63Debug.Assert(currentNode != null); 75Debug.Assert(currentNode != null); 86Debug.Assert(currentNode != null); 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\ForwardPositionQuery.cs (1)
13Debug.Assert(input != null);
System\Xml\XPath\Internal\FunctionQuery.cs (3)
77Debug.Assert(nodeIterator.Current != null); 83Debug.Assert(_function != null); 87Debug.Assert(retVal != null);
System\Xml\XPath\Internal\IdQuery.cs (1)
18Debug.Assert(context.Current != null);
System\Xml\XPath\Internal\IteratorFilter.cs (1)
36Debug.Assert(_innerIterator.Current != null);
System\Xml\XPath\Internal\LogicalExpr.cs (6)
19Debug.Assert( 70Debug.Assert(cmp != null); 97Debug.Assert(op == Operator.Op.EQ || op == Operator.Op.NE); 130Debug.Assert( 254Debug.Assert(op == Operator.Op.EQ || op == Operator.Op.NE, 366Debug.Assert(op == Operator.Op.EQ || op == Operator.Op.NE,
System\Xml\XPath\Internal\MergeFilterQuery.cs (1)
62Debug.Assert(current != null);
System\Xml\XPath\Internal\NamespaceQuery.cs (2)
58Debug.Assert(e.NodeType == XPathNodeType.Namespace); 61Debug.Assert(e.LocalName.Length == 0, "Only xmlns='' can have empty string as a value");
System\Xml\XPath\Internal\NumberFunctions.cs (5)
58Debug.Assert(nodeIterator!.Current != null); 86Debug.Assert(_arg != null); 98Debug.Assert(_arg != null); 104Debug.Assert(_arg != null); 110Debug.Assert(_arg != null);
System\Xml\XPath\Internal\NumericExpr.cs (3)
19Debug.Assert( 24Debug.Assert(opnd1 != null && opnd2 != null); 59Debug.Assert(op == Operator.Op.PLUS || op == Operator.Op.MINUS || op == Operator.Op.MOD || op == Operator.Op.DIV || op == Operator.Op.MUL);
System\Xml\XPath\Internal\Operator.cs (1)
49Debug.Assert(Op.EQ <= op && op <= Op.GE);
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 (2)
147Debug.Assert(0 <= l && l < r); 191Debug.Assert(value is XPathNavigator, "Unknown value type");
System\Xml\XPath\Internal\QueryBuilder.cs (3)
420Debug.Assert(root.Prefix != null); 421Debug.Assert(root.Name != null); 464Debug.Assert(root != null);
System\Xml\XPath\Internal\SortQuery.cs (9)
22Debug.Assert(qyInput != null, "Sort Query needs an input query tree to work on"); 54Debug.Assert(numSorts > 0, "Why was the sort query created?"); 82Debug.Assert(0 <= count && count <= _results.Count); 94Debug.Assert(0 <= count && count <= _results.Count); 159Debug.Assert(_expressions.Length == _comparers.Length); 160Debug.Assert(0 < _expressions.Length); 161Debug.Assert(0 <= _numSorts && _numSorts <= _expressions.Length); 175Debug.Assert(_numSorts < _expressions.Length); 197Debug.Assert(x != null && y != null, "Oops!! what happened?");
System\Xml\XPath\Internal\StringFunctions.cs (11)
22Debug.Assert(argList != null, "Use 'new Query[]{}' instead."); 91Debug.Assert(GetXPathType(argVal) == XPathResultType.Number); 95Debug.Assert(nodeIterator.Current != null); 131Debug.Assert(_argList.Count > 1); 139Debug.Assert(_argList.Count > 1); 147Debug.Assert(_argList.Count > 1); 157Debug.Assert(_argList.Count > 1); 167Debug.Assert(_argList.Count > 0); 212Debug.Assert(nodeIterator!.Current != null); 225Debug.Assert(nodeIterator!.Current != null); 257Debug.Assert(_argList.Count > 2);
System\Xml\XPath\Internal\VariableQuery.cs (2)
48Debug.Assert(_variable != null); 52Debug.Assert(retVal != null);
System\Xml\XPath\Internal\XPathArrayIterator.cs (3)
35Debug.Assert(nodeIterator.Current != null); 54Debug.Assert(index <= list.Count); 69Debug.Assert(index <= list.Count);
System\Xml\XPath\Internal\XPathMultyIterator.cs (5)
26Debug.Assert(iterator != null); 69Debug.Assert(firstNotEmpty <= item && item < arr.Length); 74Debug.Assert(it.Current != null && itNext.Current != null); 127Debug.Assert(position != 0, "MoveNext() wasn't called"); 128Debug.Assert(firstNotEmpty < arr.Length, "MoveNext() returned false");
System\Xml\XPath\Internal\XPathParser.cs (5)
415Debug.Assert(nodeType != XPathNodeType.Root); 464Debug.Assert(IsPrimaryExpr); 498Debug.Assert(opnd != null, "IsPrimaryExpr() was true. We should recognize this lex."); 655Debug.Assert(_scanner.CanBeFunction); 867Debug.Assert(_scanner.Kind == XPathScanner.LexKind.Axe);
System\Xml\XPath\Internal\XPathScanner.cs (19)
43Debug.Assert(0 <= _xpathExprIndex && _xpathExprIndex <= _xpathExpr.Length); 64Debug.Assert(_kind == LexKind.Name || _kind == LexKind.Axe); 65Debug.Assert(_name != null); 74Debug.Assert(_kind == LexKind.Name); 75Debug.Assert(_prefix != null); 84Debug.Assert(_kind == LexKind.String); 85Debug.Assert(_stringValue != null); 94Debug.Assert(_kind == LexKind.Number); 95Debug.Assert(!double.IsNaN(_numberValue)); 106Debug.Assert(_kind == LexKind.Name); 122Debug.Assert(XmlCharType.IsWhiteSpace(CurrentChar)); 277Debug.Assert(CurrentChar == '.' || char.IsAsciiDigit(CurrentChar)); 297Debug.Assert(char.IsAsciiDigit(CurrentChar)); 299Debug.Assert(0 <= start && _xpathExpr[start] == '.'); 322Debug.Assert(CurrentChar == endChar); 331Debug.Assert(!span.IsEmpty); 332Debug.Assert(span[0] == CurrentChar); 333Debug.Assert(XmlCharType.IsStartNCNameSingleChar(span[0])); 334Debug.Assert(XmlCharType.IsNCNameSingleChar(span[0]));
System\Xml\XPath\Internal\XPathSingletonIterator.cs (1)
16Debug.Assert(nav != null);
System\Xml\XPath\XPathDocument.cs (5)
178Debug.Assert((object?)_nameTable.Get(string.Empty) == (object)string.Empty, "NameTable must contain atomized string.Empty"); 210Debug.Assert(reader.LocalName == "xmlns"); 215Debug.Assert(reader.Prefix == "xmlns"); 385Debug.Assert(pageElem[idxElem].NodeType == XPathNodeType.Element && pageNmsp[idxNmsp].NodeType == XPathNodeType.Namespace); 398Debug.Assert(pageElem[idxElem].NodeType == XPathNodeType.Element);
System\Xml\XPath\XPathNavigator.cs (11)
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); 1091Debug.Assert(args != null); 1191Debug.Assert(context.Current != null); 1821Debug.Assert(!n1.IsSamePosition(n2)); 1823Debug.Assert(p1.MoveToParent() && p2.MoveToParent() && p1.IsSamePosition(p2)); 2055Debug.Assert(reader.LocalName == "xmlns"); 2060Debug.Assert(reader.Prefix == "xmlns"); 2116Debug.Assert(reader.LocalName == "xmlns"); 2121Debug.Assert(reader.Prefix == "xmlns");
System\Xml\XPath\XPathNavigatorReader.cs (2)
515Debug.Assert(value == null); 641Debug.Assert(XPathNodeType.Namespace == _nav.NodeType);
System\Xml\XPath\XPathNodeIterator.cs (1)
66Debug.Assert(_current.Current != null);
System\Xml\Xsl\IlGen\GenerateHelper.cs (14)
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), 1098Debug.Assert(nameType == GenerateNameType.TagNameAndNamespace); 1134Debug.Assert(_locXOut != null); 1411Debug.Assert(keyType.IsAtomicValue, "Sort key must have atomic value type."); 1468Debug.Assert(_isDebug && _lastSourceInfo != null); 1469Debug.Assert(sourceInfo != null); 1501Debug.Assert(_module.EmitSymbols); 1613Debug.Assert(opcode.OperandType == OperandType.InlineI || opcode.OperandType == OperandType.InlineVar); 1623Debug.Assert(opcode.OperandType == OperandType.InlineI8); 1633Debug.Assert(!opcode.Equals(OpCodes.Br) && !opcode.Equals(OpCodes.Br_S), "Use EmitUnconditionalBranch and be careful not to emit unverifiable code."); 1734Debug.Assert(opcode.Equals(OpCodes.Brtrue) || opcode.Equals(OpCodes.Brtrue_S) ||
System\Xml\Xsl\IlGen\IteratorDescriptor.cs (5)
337Debug.Assert(_hasNext); 406Debug.Assert(_storage.IsCached); 479Debug.Assert(brctxt != BranchingContext.None); 681Debug.Assert(_storage.ItemStorageType == typeof(XPathItem) || storageTypeDest == typeof(XPathItem), 725Debug.Assert(storageTypeDest == typeof(XPathItem), "Must be converting from XPathNavigator to XPathItem");
System\Xml\Xsl\IlGen\OptimizerPatterns.cs (5)
209Debug.Assert(!_isReadOnly, "This OptimizerPatterns instance is read-only."); 245Debug.Assert(Enum.IsDefined(pattern)); 246Debug.Assert((int)pattern < 32); 247Debug.Assert(!_isReadOnly, "This OptimizerPatterns instance is read-only."); 256Debug.Assert(Enum.IsDefined(pattern));
System\Xml\Xsl\IlGen\StaticDataManager.cs (2)
119Debug.Assert(ndNmspDecl != null); 120Debug.Assert(ndNmspDecl.Left is QilLiteral && ndNmspDecl.Right is QilLiteral);
System\Xml\Xsl\IlGen\TailCallAnalyzer.cs (1)
36Debug.Assert(XmlILConstructInfo.Read(nd).PushToWriterLast,
System\Xml\Xsl\IlGen\XmlILConstructAnalyzer.cs (29)
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."); 196Debug.Assert(value); 219Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 220Debug.Assert(value); 243Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 244Debug.Assert(value); 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."); 442Debug.Assert(ndContent != null); 491case QilNodeType.NamespaceDecl: Debug.Assert(ndContent == null); break; 492case QilNodeType.TextCtor: Debug.Assert(ndContent == null); break; 493case QilNodeType.RawTextCtor: Debug.Assert(ndContent == null); break; 497case QilNodeType.XsltCopyOf: Debug.Assert(ndContent == null); break; 715Debug.Assert(!typ.IsSingleton); 751Debug.Assert(!typ.IsSingleton); 801Debug.Assert(ndElem!.NodeType == QilNodeType.ElementCtor); 839Debug.Assert(binaryNode != null); 858Debug.Assert(ndName != null); 1059Debug.Assert(nd.NodeType == QilNodeType.NamespaceDecl); 1095Debug.Assert(nd.NodeType != QilNodeType.NamespaceDecl || !_nsmgr.HasNamespace(prefix) || _nsmgr.LookupNamespace(prefix) == ns,
System\Xml\Xsl\IlGen\XmlILModule.cs (4)
79Debug.Assert(!(useLRE && emitSymbols)); 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 (3)
5297Debug.Assert(nd is QilLiteral, "All literals except True, False, and QName must use QilLiteral"); 5489Debug.Assert(left.NodeType == right.NodeType); 5639Debug.Assert(nd.NodeType == QilNodeType.Let || nd.NodeType == QilNodeType.Parameter, "Unexpected type of a global");
System\Xml\Xsl\IlGen\XmlIlVisitor.cs (75)
76Debug.Assert(_iterCurr.Storage.Location == ItemLocation.None, "Root expression should have been pushed to the writer."); 93Debug.Assert(iter.NodeType == QilNodeType.Let || iter.NodeType == QilNodeType.Parameter); 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"); 223Debug.Assert(iter.NodeType == QilNodeType.Parameter); 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, 758Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None); 843Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None); 909Debug.Assert(info.ConstructMethod == XmlILConstructMethod.Iterator); 912Debug.Assert(ndCond.Left.XmlType!.TypeCode == XmlTypeCode.Boolean); 949Debug.Assert(!ndCond.Center.XmlType!.IsSingleton || !ndCond.Right.XmlType!.IsSingleton); 981Debug.Assert(ndBranch.XmlType!.IsSingleton, "Conditional must produce a singleton"); 986Debug.Assert(itemStorageType == typeof(bool)); 1012Debug.Assert(XmlILConstructInfo.Read(ndChoice).PushToWriterFirst); 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"); 1630Debug.Assert(ndParsedTagName.Right.XmlType.IsSingleton); 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."); 2110Debug.Assert(ndIter != null); 2123Debug.Assert(ndIter.NodeType == QilNodeType.Let || ndIter.NodeType == QilNodeType.Parameter); 2124Debug.Assert(!patt.MatchesPattern(OptimizerPatternName.IsPositional)); 2141Debug.Assert(ndFor.XmlType!.IsSingleton); 2203Debug.Assert(!ndLet.XmlType!.IsSingleton); 2234Debug.Assert(ndIter != null); 2248Debug.Assert(ndIter.NodeType == QilNodeType.For); 2251Debug.Assert(locPos != null); 2265Debug.Assert(ndSort.Variable.NodeType == QilNodeType.For); 2286Debug.Assert(!_iterNested!.Storage.IsCached); 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"); 2552Debug.Assert(!XmlILConstructInfo.Read(ndInvoke).PushToWriterFirst || useWriter); 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."); 3375Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None); 3439Debug.Assert(ndVal.Child.XmlType!.IsNode, "XPathNodeValue node may only be applied to a sequence of Nodes."); 3562Debug.Assert(XmlILConstructInfo.Read(ndInvoke).ConstructMethod != XmlILConstructMethod.Writer); 3649Debug.Assert(ndActualArg.XmlType!.IsSubtypeOf(xmlTypeFormalArg), "Xml type of actual arg must be a subtype of the Xml type of the formal arg"); 3745Debug.Assert(XmlILConstructInfo.Read(ndCopy).PushToWriterFirst); 3751Debug.Assert(ndCopy.Left.XmlType!.IsNode); 3763Debug.Assert(ndCopy.Left.XmlType.IsNode); 3779Debug.Assert(XmlILConstructInfo.Read(ndCopyOf).PushToWriterFirst, "XsltCopyOf should always be pushed to writer."); 3988Debug.Assert(ndDod.NodeType == QilNodeType.DocOrderDistinct && ndLoop != null); 4105Debug.Assert(ndName.XmlType!.TypeCode == XmlTypeCode.QName, "Element or attribute name must have QName type."); 4124Debug.Assert(ValidateNames.ValidateName(prefix, localName, ns, nodeType, ValidateNames.Flags.AllExceptPrefixMapping)); 4201Debug.Assert(relOp == QilNodeType.Eq || relOp == QilNodeType.Ne); 4240Debug.Assert(relOp == QilNodeType.Eq || relOp == QilNodeType.Ne); 4267Debug.Assert(ndSecond.NodeType == QilNodeType.NameOf); 4345Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None); 4378Debug.Assert(relOp == QilNodeType.Eq || relOp == QilNodeType.Ne); 4398Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None); 4583Debug.Assert(xmlTypes == XmlNodeKindFlags.PI); 4616Debug.Assert(xmlTypes == XmlNodeKindFlags.Element); 4623Debug.Assert(!isXmlTypeUnion || (xmlTypes & XmlNodeKindFlags.Content) == XmlNodeKindFlags.Content); 4772Debug.Assert(!XmlILConstructInfo.Read(nd).PushToWriterLast); 4786Debug.Assert(!XmlILConstructInfo.Read(nd).PushToWriterLast); 4805Debug.Assert(!XmlILConstructInfo.Read(nd).PushToWriterLast); 4815Debug.Assert(!XmlILConstructInfo.Read(nd).PushToWriterLast); 4825Debug.Assert(nd.XmlType!.IsSingleton && !XmlILConstructInfo.Read(nd).PushToWriterLast); 4839Debug.Assert(!XmlILConstructInfo.Read(nd).PushToWriterLast); 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 (8)
26Debug.Assert(f != null); 228Debug.Assert(arg != null, "Argument shouldn't be null"); 229Debug.Assert(arg.XmlType!.TypeCode == XmlTypeCode.Boolean && arg.XmlType.IsSingleton, 595Debug.Assert(args.NodeType == QilNodeType.FormalParameterList); 600Debug.Assert(args.NodeType == QilNodeType.FormalParameterList); 606Debug.Assert(args.NodeType == QilNodeType.ActualParameterList); 607Debug.Assert(func.Arguments.Count == args.Count); 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\QilValidationVisitor.cs (1)
36Debug.Assert(node != null);
System\Xml\Xsl\QIL\SubstitutionList.cs (1)
51Debug.Assert(_s.Count % 2 == 0);
System\Xml\Xsl\QIL\WhitespaceRule.cs (1)
77Debug.Assert(this.GetType() == typeof(WhitespaceRule), "Serialization of WhitespaceRule subclasses is not implemented");
System\Xml\Xsl\QueryReaderSettings.cs (1)
26Debug.Assert(xmlNameTable != null);
System\Xml\Xsl\Runtime\ContentIterators.cs (2)
116Debug.Assert(nodeType != XPathNodeType.Attribute && nodeType != XPathNodeType.Namespace); 440Debug.Assert(_state == IteratorState.HaveCurrentHaveNext);
System\Xml\Xsl\Runtime\DecimalFormatter.cs (3)
43Debug.Assert(formatPicture != null && decimalFormat != null); 266Debug.Assert(i + 1 < result.Length); 268Debug.Assert(char.IsAsciiDigit(ch) || ch == EscChar);
System\Xml\Xsl\Runtime\DocumentOrderComparer.cs (1)
40Debug.Assert(GetDocumentIndex(navThis) != GetDocumentIndex(navThat!));
System\Xml\Xsl\Runtime\DodSequenceMerge.cs (1)
94Debug.Assert(_sequencesToMerge.Count == 1, "While loop should terminate when count == 1");
System\Xml\Xsl\Runtime\EarlyBoundInfo.cs (1)
22Debug.Assert(namespaceUri != null && ebType != null);
System\Xml\Xsl\Runtime\NumberFormatter.cs (3)
81Debug.Assert(1 <= val && val <= MaxAlphabeticValue); 82Debug.Assert(Math.Pow(totalChars, MaxAlphabeticLength) >= MaxAlphabeticValue); 104Debug.Assert(1 <= val && val <= MaxRomanValue);
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\StringConcat.cs (1)
55Debug.Assert(value != null);
System\Xml\Xsl\Runtime\TreeIterators.cs (3)
498Debug.Assert(_state == IteratorState.HaveCurrentHaveNext || _state == IteratorState.HaveCurrentNoNext); 523Debug.Assert(_state == IteratorState.HaveCurrentHaveNext || _state == IteratorState.HaveCurrentNoNext); 834Debug.Assert(_state == IteratorState.HaveCurrentHaveNext || _state == IteratorState.HaveCurrentNoNext);
System\Xml\Xsl\Runtime\WhitespaceRuleLookup.cs (7)
39Debug.Assert(rules != null); 89Debug.Assert(_nameTable != null && _ruleTemp != null); 90Debug.Assert(localName != null && (object?)_nameTable.Get(localName) == (object)localName); 91Debug.Assert(namespaceName != null && (object?)_nameTable.Get(namespaceName) == (object)namespaceName); 173Debug.Assert(obj is InternalWhitespaceRule); 176Debug.Assert(LocalName != null && that!.LocalName != null); 177Debug.Assert(NamespaceName != null && that.NamespaceName != null);
System\Xml\Xsl\Runtime\WhitespaceRuleReader.cs (1)
49Debug.Assert(wsRules != null);
System\Xml\Xsl\Runtime\XmlAttributeCache.cs (7)
87Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 96Debug.Assert(_numEntries != 0); 144Debug.Assert(text != null); 145Debug.Assert(_arrAttrs != null && _numEntries != 0); 156Debug.Assert(value is XmlAtomicValue, "value should always be an XmlAtomicValue, as XmlAttributeCache is only used by XmlQueryOutput"); 157Debug.Assert(_arrAttrs != null && _numEntries != 0); 361Debug.Assert(_numEntries == _arrAttrs.Length);
System\Xml\Xsl\Runtime\XmlCollation.cs (3)
104Debug.Assert(((int)value & Mask) == 0); 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 (4)
221Debug.Assert(methMatch.ContainsGenericParameters == false); 281Debug.Assert(_meth != null, "Must call Bind() before calling Invoke."); 282Debug.Assert(args.Length == _argClrTypes!.Length, "Mismatched number of actual and formal arguments."); 308Debug.Assert(that != null);
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\XmlNavigatorFilter.cs (2)
159Debug.Assert(s_typeFilters[(int)nodeType] != null); 168Debug.Assert(nodeType != XPathNodeType.Attribute && nodeType != XPathNodeType.Namespace);
System\Xml\Xsl\Runtime\XmlNavigatorStack.cs (2)
53Debug.Assert(!IsEmpty); 62Debug.Assert(!IsEmpty);
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 (27)
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"); 231Debug.Assert(ValidateNames.ValidateName(prefix, localName, ns, XPathNodeType.Attribute, ValidateNames.Flags.All)); 538Debug.Assert(prefix != null && ns != null); 542Debug.Assert(prefix.Length == 0 || ns.Length != 0); 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."); 699Debug.Assert(prefix != null && ns != null); 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"); 1037Debug.Assert(navigator != null); 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"); 1205Debug.Assert(navigator.NodeType == XPathNodeType.Element); 1219Debug.Assert(navigator.NodeType == XPathNodeType.Element, "Only elements have namespaces to copy"); 1224Debug.Assert(navigator.LocalName.Length != 0, "xmlns:foo='' isn't allowed"); 1257Debug.Assert(rootType == XPathNodeType.Element || rootType == XPathNodeType.Comment || rootType == XPathNodeType.ProcessingInstruction); 1288Debug.Assert(rootType == XPathNodeType.Attribute || rootType == XPathNodeType.Namespace); 1319Debug.Assert(_nsmgr != null); 1351Debug.Assert(prefix.Length != 0 && ns.Length != 0); 1399Debug.Assert(prefix != null && !string.IsNullOrEmpty(ns)); 1505Debug.Assert(ValidateNames.ParseNCName(name.Name, 0) == name.Name.Length); 1554Debug.Assert(_stkNames != null);
System\Xml\Xsl\Runtime\XmlQueryRuntime.cs (18)
72Debug.Assert(data != null); 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."); 332Debug.Assert(_atomizedNames != null); 341Debug.Assert(_filters != null); 395Debug.Assert(_prefixMappingsList != null); 462Debug.Assert(_types != null); 480Debug.Assert(XmlILTypeHelper.GetStorageType(xmlType).IsAssignableFrom(value.GetType()), 499Debug.Assert(xmlType != XmlQueryTypeFactory.Node && xmlType != XmlQueryTypeFactory.NodeS, 829Debug.Assert(_collations != null); 890Debug.Assert(context != null); 927Debug.Assert(context != null); 1078Debug.Assert(node.NodeType == XPathNodeType.Namespace);
System\Xml\Xsl\Runtime\XmlQuerySequence.cs (2)
387Debug.Assert(keys.Length >= _size, "Number of keys must be >= number of items."); 582Debug.Assert(cmp == XmlNodeOrder.Before || cmp == XmlNodeOrder.Unknown);
System\Xml\Xsl\Runtime\XmlQueryStaticData.cs (2)
41Debug.Assert(defaultWriterSettings != null && staticData != null); 184Debug.Assert(formatVersion != CurrentFormatVersion || dataReader.Read() == -1, "Extra data at the end of the stream");
System\Xml\Xsl\Runtime\XmlSortKey.cs (8)
70Debug.Assert(_nextKey != null && that._nextKey != null); 74Debug.Assert(_priority != that._priority); 85Debug.Assert(that != null && !(this is XmlEmptySortKey)); 125Debug.Assert(obj is XmlSortKey); 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"); 342Debug.Assert(_dblVal == double.NegativeInfinity || _dblVal == double.PositiveInfinity); 348Debug.Assert(that._dblVal == double.NegativeInfinity || that._dblVal == double.PositiveInfinity);
System\Xml\Xsl\Runtime\XslNumber.cs (9)
27Debug.Assert(isSeparator == (formatString != null), "AssertSeparator"); 33Debug.Assert(startIdx >= 0 && tokLen > 0); 50Debug.Assert(startIdx >= 0 && tokLen > 0); 128Debug.Assert(groupingSeparator.Length <= 1); 270Debug.Assert(item.ValueType == typeof(double), "Item must be either of type int, or double"); 274Debug.Assert(1 <= dblVal && dblVal < double.PositiveInfinity); 308Debug.Assert(val >= 0 && val == Math.Round(val), "ConvertToArabic operates on non-negative integer numbers only"); 319Debug.Assert(groupSeparator.Length == 1); 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\XsltFunctions.cs (6)
69Debug.Assert(value.Length < startIndex || double.IsNaN(startIndex)); 91Debug.Assert(0 <= startIndex && startIndex <= endIndex && endIndex <= value.Length); 96Debug.Assert(endIndex <= startIndex || double.IsNaN(endIndex)); 283Debug.Assert(item is XPathNavigator); 345Debug.Assert(stringValue != null); 531Debug.Assert(lang != null);
System\Xml\Xsl\Runtime\XsltLibrary.cs (11)
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"); 384Debug.Assert(op == ComparisonOperator.Eq || op == ComparisonOperator.Ne); 391Debug.Assert(compType == TypeCode.Boolean); 399Debug.Assert(compType == TypeCode.Boolean || compType == TypeCode.Double || compType == TypeCode.String); 439Debug.Assert(op == ComparisonOperator.Eq || op == ComparisonOperator.Ne); 487Debug.Assert(ComparisonOperator.Lt <= op && op <= ComparisonOperator.Ge); 526Debug.Assert(XPathNodeType.SignificantWhitespace == XPathNodeType.Text + 1); 527Debug.Assert(XPathNodeType.Whitespace == XPathNodeType.Text + 2); 539Debug.Assert((object)nav1.NameTable == (object)nav2.NameTable, "Ref.Equal cannot be used if navigators have different name tables");
System\Xml\Xsl\SourceLineInfo.cs (6)
70Debug.Assert(lineInfo.Start.Line == lineInfo.End.Line); 71Debug.Assert(lineInfo.Start.Pos == 0 && lineInfo.End.Pos == 0); 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"); 84Debug.Assert(uriString != null);
System\Xml\Xsl\XmlILCommand.cs (2)
29Debug.Assert(delExec != null && staticData != null); 83Debug.Assert(results != null);
System\Xml\Xsl\XmlIlGenerator.cs (3)
136Debug.Assert(_qil.Root != null); 210Debug.Assert(ndParam.NodeType == QilNodeType.Parameter); 341Debug.Assert(methInfo != null, "MethodInfo for global value should have been created previously.");
System\Xml\Xsl\XmlQueryCardinality.cs (1)
24Debug.Assert(0x00 <= value && value <= 0x07);
System\Xml\Xsl\XmlQueryType.cs (11)
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"); 509Debug.Assert(IsAtomicValue && baseType.IsAtomicValue); 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 (13)
63Debug.Assert(schemaType.DerivedBy == XmlSchemaDerivationMethod.Union); 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."); 470Debug.Assert(!isNillable); 504Debug.Assert(nameTest != null, "nameTest cannot be null"); 505Debug.Assert(schemaType != null, "schemaType cannot be null"); 513Debug.Assert(!IsAtomicValue || schemaType.Datatype!.Variety == XmlSchemaDatatypeVariety.Atomic); 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 (26)
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"); 115Debug.Assert(op != XPathOperator.Unknown); 118Debug.Assert((opGroup != XPathOperatorGroup.Negate && right != null) || (opGroup == XPathOperatorGroup.Negate && right == null)); 136Debug.Assert(op == XPathOperator.Or || op == XPathOperator.And); 147Debug.Assert(compType == XmlTypeCode.Boolean || compType == XmlTypeCode.Double || compType == XmlTypeCode.String); 148Debug.Assert(compType == XmlTypeCode.Boolean || left.XmlType!.IsSingleton && right.XmlType!.IsSingleton, "Both comparison operands must be singletons"); 169Debug.Assert(val.XmlType!.IsSingleton); 170Debug.Assert(compType == XmlTypeCode.Boolean || compType == XmlTypeCode.Double || compType == XmlTypeCode.String, "I don't know what to do with RTF here"); 214Debug.Assert(op == XPathOperator.Eq || op == XPathOperator.Ne); 247Debug.Assert(op == XPathOperator.Lt || op == XPathOperator.Le || op == XPathOperator.Gt || op == XPathOperator.Ge); 278Debug.Assert(op == XPathOperator.UnaryMinus); 301Debug.Assert(op == XPathOperator.Union); 457Debug.Assert(nodeset.NodeType == QilNodeType.DocOrderDistinct, 561Debug.Assert(!args.IsReadOnly, "Writable collection expected"); 853Debug.Assert(current != null); 866Debug.Assert(environment != null); 890Debug.Assert(unknown.NodeType == QilNodeType.Unknown); 933Debug.Assert(_last != null); 938Debug.Assert(unknown != null); 988Debug.Assert(maxArgs == 0 || maxArgs == Infinity || argTypes != null && argTypes.Length == maxArgs); 1024Debug.Assert(numArgs > maxArgs); 1046Debug.Assert(args.Count == 0 || argTypes != null);
System\Xml\Xsl\XPath\XPathParser.cs (6)
26Debug.Assert(_scanner == null && _builder == null); 27Debug.Assert(scanner != null && builder != null); 57Debug.Assert(_posInfo.Count == 0, "PushPosInfo() and PopPosInfo() calls have been unbalanced"); 262Debug.Assert(scanner.Name == "processing-instruction"); 509Debug.Assert(IsPrimaryExpr()); 536Debug.Assert(
System\Xml\Xsl\XPath\XPathQilFactory.cs (10)
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"); 133Debug.Assert(op == QilNodeType.Eq || op == QilNodeType.Ne); 149Debug.Assert(op == QilNodeType.Lt || op == QilNodeType.Le || op == QilNodeType.Gt || op == QilNodeType.Ge);
System\Xml\Xsl\XPath\XPathScanner.cs (20)
78Debug.Assert(xpathExpr != null); 93Debug.Assert(0 <= index && index <= _xpathExpr.Length); 100Debug.Assert(-1 <= _curIndex && _curIndex < _xpathExpr.Length); 108Debug.Assert(_curIndex == _xpathExpr.Length); 117Debug.Assert(_kind == LexKind.Name); 118Debug.Assert(_name != null); 127Debug.Assert(_kind == LexKind.Name); 128Debug.Assert(_prefix != null); 152Debug.Assert(_kind == LexKind.String); 153Debug.Assert(_stringValue != null); 167Debug.Assert(_kind == LexKind.Name); 176Debug.Assert(_kind == LexKind.Axis); 177Debug.Assert(_axis != XPathAxis.Unknown); 424Debug.Assert(_prefix != null); 425Debug.Assert(_name != null); 485Debug.Assert(IsAsciiDigit(_curChar) || _curChar == '.'); 530Debug.Assert(XmlCharType.IsStartNCNameSingleChar(_curChar)); 554Debug.Assert(LexKind.FirstStringable <= t); 571Debug.Assert(LexKind.FirstStringable <= t); 575Debug.Assert("()[].@,*/$}".Contains((char)t));
System\Xml\Xsl\XPathConvert.cs (118)
163Debug.Assert(0 != (u & 0x80000000)); 224Debug.Assert(dec.MantissaSize > 0); 235Debug.Assert(dec[ib] > 0 && dec[ib] <= 9); 246Debug.Assert(dec[ib] >= 0 && dec[ib] <= 9); 279Debug.Assert(exponent > 0 && exponent < 512); 296Debug.Assert(digit <= 9); 297Debug.Assert(0 != (_u2 & 0x80000000)); 301Debug.Assert(_exp >= 4); 351Debug.Assert(1 == rgu[4]); 378Debug.Assert(this.IsZero); 444Debug.Assert(0 != (_u2 & 0x80000000)); 445Debug.Assert(0 != (numOp._u2 & 0x80000000)); 459Debug.Assert(uHi < 0xFFFFFFFF); 464Debug.Assert(uHi < 0xFFFFFFFF); 472Debug.Assert(uHi < 0xFFFFFFFF); 480Debug.Assert(uHi < 0xFFFFFFFF); 488Debug.Assert(uHi < 0xFFFFFFFF); 494Debug.Assert(0 != uT); 496Debug.Assert(uHi < 0xFFFFFFFF); 504Debug.Assert(uHi < 0xFFFFFFFF); 512Debug.Assert(uHi < 0xFFFFFFFF); 521Debug.Assert(_error <= 2 || numOp._error <= 2); 545Debug.Assert(0 != (rgu5 & 0x40000000)); 568Debug.Assert(0 == rgu3); 569Debug.Assert(0 == rgu4); 570Debug.Assert(0 == rgu5); 596Debug.Assert(0 != (bn._u2 & 0x80000000)); 618Debug.Assert(wT >= 12 && wT < 32); 635Debug.Assert(wT > 0 && wT < 32); 673Debug.Assert(_exp <= 32); 683Debug.Assert(_error < 0xFFFFFFFF); 688Debug.Assert(0 == _u2 && 0 == _u1); 699Debug.Assert(_error < 0xFFFFFFFF); 735Debug.Assert(!IsSpecial(dbl)); 736Debug.Assert(0 < dbl); 813Debug.Assert(iT >= 0 && iT < 16); 817Debug.Assert(numHH._exp + tenPower._exp > 1); 826Debug.Assert(iT > 0 && iT <= 32); 828Debug.Assert(numHH._exp + tenPower._exp > 1); 837Debug.Assert(iT >= 0 && iT < 16); 841Debug.Assert(numHH._exp + tenPower._exp <= 32); 850Debug.Assert(iT > 0 && iT <= 32); 852Debug.Assert(numHH._exp + tenPower._exp <= 32); 859Debug.Assert(numHH._exp > 0 && numHH._exp < 32); 872Debug.Assert(uLL <= uLH && uLH <= uHL && uHL <= uHH); 900Debug.Assert(uHH >= uScale && uHH / uScale < 10); 904Debug.Assert(uLL <= uHH); 915Debug.Assert(0 != uHH || !numHH.IsZero); 948Debug.Assert(0 <= bLL && bLL < bHH && bHH <= 9); 992Debug.Assert(dblInt == Math.Floor(dblInt) && 1 <= dblInt && dblInt <= 9007199254740991.0d); 1011Debug.Assert(iT >= 0 && iT <= 15); 1012Debug.Assert(dblInt >= C10toN[iT] && dblInt < C10toN[iT + 1]); 1017Debug.Assert(iT >= 0); 1020Debug.Assert(dblInt == Math.Floor(dblInt) && 0 <= dblInt && dblInt < C10toN[iT]); 1035Debug.Assert(exponent == exponentPrec && mantissaSize == mantissaSizePrec); 1045Debug.Assert(equal, "DblToRgbFast and DblToRgbPrecise should give the same result"); 1083Debug.Assert(!IsSpecial(dbl)); 1084Debug.Assert(0 < dbl); 1098Debug.Assert(0 == (dblHi & 0x7FF00000)); 1108Debug.Assert(0 != (DblHi(dblT) & 0x7FF00000)); 1150Debug.Assert(1 <= dblT && dblT < 2); 1196Debug.Assert(0 == c5Den); 1217Debug.Assert(cu <= 2); 1234Debug.Assert(c2Num > 0 && c2Den > 0); 1241Debug.Assert(0 == (biDen[biDen.Length - 1] & 0xF0000000)); 1242Debug.Assert(0 != (biDen[biDen.Length - 1] & 0x08000000)); 1714Debug.Assert(0 <= idx && idx < _length); 1722Debug.Assert(_capacity >= InitCapacity); 1723Debug.Assert(_length >= 0 && _length <= _capacity); 1730Debug.Assert(0 == _length || 0 != _digits[_length - 1]); 1759Debug.Assert(cu >= 0); 1779Debug.Assert(2 <= _capacity); 1796Debug.Assert((object)this != (object)biSrc); 1810Debug.Assert(dec.MantissaSize >= 0); 1823Debug.Assert(dec[ib] >= 0 && dec[ib] <= 9); 1833Debug.Assert(1 < uMul); 1843Debug.Assert(0 != uMul); 1867Debug.Assert(c5 >= 0); 1899Debug.Assert(cbit >= 0); 1966Debug.Assert(cu >= 0); 1987Debug.Assert(cbit >= 0); 2023Debug.Assert(obj != null); 2050Debug.Assert(idx >= 0 && idx < _length); 2051Debug.Assert(_digits[idx] != bi._digits[idx]); 2060Debug.Assert((object)this != (object)bi); 2114Debug.Assert((object)this != (object)bi); 2127Debug.Assert(0 == wCarry || 1 == wCarry); 2174Debug.Assert((object)this != (object)bi); 2182Debug.Assert(_length <= cu); 2190Debug.Assert(uQuo >= 0 && uQuo <= 9); 2205Debug.Assert(0 == wCarry || 1 == wCarry); 2217Debug.Assert(1 == wCarry); 2218Debug.Assert(idx == cu); 2241Debug.Assert(CompareTo(bi) < 0); 2342Debug.Assert(value <= MaxDigits); 2351Debug.Assert(0 <= ib && ib < _mantissaSize); 2370Debug.Assert(dbl == (double)this); 2375Debug.Assert(!this.Equals(decAfter)); 2380Debug.Assert(!this.Equals(decBefore)); 2472Debug.Assert(0 != mantissaSize && 0 != dec[0] && 0 != dec[mantissaSize - 1]); 2485Debug.Assert(dec[ib] >= 0 && dec[ib] <= 9); 2496Debug.Assert(dec[ib] >= 0 && dec[ib] <= 9); 2561Debug.Assert(dbl == dblLo); 2579Debug.Assert(dbl == (double)num); 2581Debug.Assert(dbl == dblLo || double.IsNaN(dblLo)); 2600Debug.Assert(double.IsNaN(dblLowPrec) || dblLowPrec == dbl); 2719Debug.Assert(c2Dbl < 32 || 0 != biDec[0]); 2737Debug.Assert(0 == c2Dbl || 0 == c2Dec); 2738Debug.Assert(0 == c5Dbl || 0 == c5Dec); 2857Debug.Assert(('0' & 0xF) == 0, "We use (char)(d |'0') to convert digit to char"); 2874Debug.Assert(double.IsInfinity(dbl)); 2880Debug.Assert(0 != dec.MantissaSize); 2921Debug.Assert(dec[ib] >= 0 && dec[ib] <= 9); 2939Debug.Assert(0 != cntDigits); 2940Debug.Assert(sizeFract == cntDigits || sizeFract > cntDigits && pch[-1] == '0'); 2950Debug.Assert(sizeFract == cntDigits); 2954Debug.Assert(dec[ib] >= 0 && dec[ib] <= 9); 2960Debug.Assert(0 == sizeInt && 0 == cntDigits);
System\Xml\Xsl\XslException.cs (1)
164Debug.Assert(lineInfo == null || lineInfo.Uri != null);
System\Xml\Xsl\Xslt\Compiler.cs (14)
63Debug.Assert(CompilerErrorColl == null, "Compiler cannot be reused"); 75Debug.Assert(stylesheet != null); 76Debug.Assert(Root == null, "Compiler cannot be reused"); 119Debug.Assert(importPrecedence <= oldNsAlias.ImportPrecedence, "Stylesheets must be processed in the order of decreasing import precedence"); 163Debug.Assert(var.NodeType == XslNodeType.Variable || var.NodeType == XslNodeType.Param); 201Debug.Assert(qname != null); 218Debug.Assert(nameTest != null); 235Debug.Assert(name != null); 279Debug.Assert(value <= ErrorCount); 291Debug.Assert(_savedErrorCount == -1, "Nested EnterForwardsCompatible calls"); 298Debug.Assert(_savedErrorCount != -1, "ExitForwardsCompatible without EnterForwardsCompatible"); 302Debug.Assert((_savedErrorCount = -1) < 0); 305Debug.Assert((_savedErrorCount = -1) < 0); 452Debug.Assert(characters.Length == 8);
System\Xml\Xsl\Xslt\CompilerScopeManager.cs (13)
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, 201Debug.Assert(varName.LocalName != null && varName.NamespaceUri != null); 209Debug.Assert(prefix != null); 249Debug.Assert(nsUri != null); 257Debug.Assert(recPrefix == null); 301Debug.Assert(localName != null); 414Debug.Assert(LastPredefRecord <= _currentRecord && _currentRecord <= _scope._lastRecord, "MoveNext() either was not called or returned false"); 415Debug.Assert(_scope._records[_currentRecord].IsNamespace);
System\Xml\Xsl\Xslt\Focus.cs (11)
47Debug.Assert(focusType != SingletonFocusType.Iterator); 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"); 109Debug.Assert(_current.Name!.NamespaceUri == XmlReservedNs.NsXslDebug && _current.Name.LocalName == "current"); 114Debug.Assert(_position.Name!.NamespaceUri == XmlReservedNs.NsXslDebug && _position.Name.LocalName == "position"); 119Debug.Assert(_last.Name!.NamespaceUri == XmlReservedNs.NsXslDebug && _last.Name.LocalName == "last"); 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 (8)
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"); 104Debug.Assert(argName != null); 132Debug.Assert(_formalArgs![prevArg] != null, "formalArg must be in the list"); 133Debug.Assert(_invokeArgs![prevArg] != null, "This arg should be compiled already"); 151Debug.Assert(_invokeArgs[prevArg] is QilIterator);
System\Xml\Xsl\Xslt\KeyMatchBuilder.cs (7)
29Debug.Assert(0 <= _depth && _depth <= 1, "this shouldn't happen"); 41Debug.Assert(0 <= _depth && _depth <= 1, "this shouldn't happen"); 48Debug.Assert(base.numFixupLast == 0); 49Debug.Assert(base.numFixupPosition == 0); 77Debug.Assert(node != null); 78Debug.Assert(fixup != null); 110Debug.Assert(content.Child == _fixup, "Unexpected content node");
System\Xml\Xsl\Xslt\MatcherBuilder.cs (7)
135Debug.Assert( 234Debug.Assert(!double.IsNaN(x!._priority)); 235Debug.Assert(!double.IsNaN(y!._priority)); 398Debug.Assert(patternList.Count > 0); 423Debug.Assert((int)(QilLiteral)matcher == NoMatch); 450Debug.Assert(pattern.Priority > lastPriority); 522Debug.Assert(priority == branches.Length - 1);
System\Xml\Xsl\Xslt\OutputScopeManager.cs (4)
60Debug.Assert(prefix != null); 61Debug.Assert(uri != null); 142Debug.Assert(prefix != null); 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 (54)
136Debug.Assert(compiler != null); 227Debug.Assert(IsDebug && _curLoop.IsFocusSet); 234Debug.Assert(!_curLoop.IsFocusSet && !_funcFocus.IsFocusSet, "Must be compiled using singleton focus"); 432Debug.Assert(IsDebug, "This is debug only logic"); 436Debug.Assert(var.XmlType!.IsSubtypeOf(T.NamespaceS)); 437Debug.Assert(var.Binding is QilList); 446Debug.Assert(nsList[i].NodeType == QilNodeType.NamespaceDecl); 447Debug.Assert(varList[i].NodeType == QilNodeType.NamespaceDecl); 478Debug.Assert(tmpl != null && tmpl.Function == null); 479Debug.Assert(tmpl.NodeType == XslNodeType.AttributeSet || tmpl.NodeType == XslNodeType.Template); 508Debug.Assert(tmpl.NodeType == XslNodeType.Template); 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"); 643Debug.Assert(tmpl != null && tmpl.Function != null && tmpl.Function.Definition.NodeType == QilNodeType.Unknown); 653Debug.Assert(tmpl is Template, "Only templates can have explicit arguments"); 656Debug.Assert(arg.DefaultValue == null, "Argument must not be compiled yet"); 700Debug.Assert(instructions != null); 747Debug.Assert(result != null, "Result of compilation should not be null"); 983Debug.Assert(pos < source.Length); 1019Debug.Assert(i == source.Length || source[i] == '{'); 1073Debug.Assert(avt != null); 1125Debug.Assert(_curLoop.IsFocusSet); 1179Debug.Assert(withParam.NodeType == XslNodeType.WithParam); 1215Debug.Assert(node.NodeType == XslNodeType.ApplyImports); 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"); 1417Debug.Assert(when.NodeType == XslNodeType.If || when.NodeType == XslNodeType.Otherwise); 1421Debug.Assert(result == null, "xsl:otherwise must be the last child of xsl:choose"); 1460Debug.Assert(node.NodeType == XslNodeType.Variable); 1470Debug.Assert(node.NodeType == XslNodeType.Variable || node.NodeType == XslNodeType.Param || node.NodeType == XslNodeType.WithParam); 1502Debug.Assert(varValue.SourceLine == null); 1508Debug.Assert(withParam.NodeType == XslNodeType.WithParam); 1718Debug.Assert(result.XmlType == T.StringX); 1726Debug.Assert(sort.NodeType == XslNodeType.Sort); 1818Debug.Assert(0 < list.Count, "Pattern should have at least one filter"); 2119Debug.Assert(num.Level == NumberLevel.Any); 2139Debug.Assert(sheet.TemplateMatches.Count == 0); 2223Debug.Assert(varPar.NodeType == XslNodeType.Variable || varPar.NodeType == XslNodeType.Param); 2259Debug.Assert(varPar.NodeType == XslNodeType.Variable || varPar.NodeType == XslNodeType.Param); 2346Debug.Assert(expr != null); 2375Debug.Assert(pttrn != null); 2401Debug.Assert(pttrn != null); 2515Debug.Assert( 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"); 2800Debug.Assert(n.SourceLine == null); 2824Debug.Assert(nsVar.XmlType!.IsSubtypeOf(T.NamespaceS)); 2869Debug.Assert(let.NodeType == QilNodeType.Let); 2875Debug.Assert(0 <= varScope && varScope <= _vars.Count); 2886Debug.Assert(_vars.Count == 0, "Accumulated variables left unclaimed");
System\Xml\Xsl\Xslt\QilGeneratorEnv.cs (8)
26Debug.Assert(args == null || args.Length == 0, "Error message must already be composed in res"); 76Debug.Assert(ns != null); 103Debug.Assert(!args.IsReadOnly, "Writable collection expected"); 146Debug.Assert(ns != null); 409Debug.Assert(name.XmlType == T.StringX && key.XmlType == T.StringX); 439Debug.Assert(defList != null && defList.Count > 0); 456Debug.Assert(defList != null && defList.Count > 0); 667Debug.Assert(propValue.ValueType == typeof(double));
System\Xml\Xsl\Xslt\QilStrConcatenator.cs (6)
28Debug.Assert(!_inUse); 46Debug.Assert(_inUse, "Reset() wasn't called"); 52Debug.Assert(_inUse, "Reset() wasn't called"); 58Debug.Assert(_inUse, "Reset() wasn't called"); 61Debug.Assert(value.XmlType!.TypeCode == XmlTypeCode.String); 76Debug.Assert(_inUse); // If we want allow multiple calls to ToQil() this logic should be changed
System\Xml\Xsl\Xslt\Stylesheet.cs (4)
86Debug.Assert(var.NodeType == XslNodeType.Variable || var.NodeType == XslNodeType.Param); 87Debug.Assert(var.Name!.NamespaceUri != null, "Name must be resolved in XsltLoader"); 104Debug.Assert(template.ImportPrecedence == 0); 120Debug.Assert(template.ImportPrecedence <= old.ImportPrecedence, "Global objects are processed in order of decreasing import precedence");
System\Xml\Xsl\Xslt\XPathPatternBuilder.cs (33)
28Debug.Assert(environment != null); 44Debug.Assert(!_inTheBuild, "XPathBuilder is busy!"); 52Debug.Assert(filter.NodeType == QilNodeType.Filter, "XPathPatternBuilder expected to generate list of Filters on top level"); 53Debug.Assert(filter.Variable.XmlType!.IsSubtypeOf(T.NodeNotRtf)); 54Debug.Assert(filter.Variable.Binding!.NodeType == QilNodeType.Unknown); // fixupNode 55Debug.Assert(filter.Body.XmlType!.IsSubtypeOf(T.Boolean)); 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"); 80Debug.Assert(op == XPathOperator.Union); 81Debug.Assert(left != null); 82Debug.Assert(right != null); 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"); 122Debug.Assert( 133Debug.Assert(nodeType == XPathNodeType.All && prefix == null && name == null, " // is the only d-o-s axes that we can have in pattern"); 190Debug.Assert(left != null); 191Debug.Assert(right != null); 195Debug.Assert(nop.Child == _fixupNode); 199Debug.Assert(GetLastParent(left) == left, "Left is always single axis and never the step"); 200Debug.Assert(left.NodeType == QilNodeType.Filter); 209Debug.Assert(nop.Child != null); 213Debug.Assert(right.NodeType == QilNodeType.Filter); 215Debug.Assert(lastParent != null); 291Debug.Assert(prefix.Length == 0); 297Debug.Assert( 305Debug.Assert(name == "key", "Unexpected function"); 306Debug.Assert( 355Debug.Assert(parent.NodeType == QilNodeType.Filter); 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."); 430Debug.Assert(current != null);
System\Xml\Xsl\Xslt\XPathPatternParser.cs (7)
27Debug.Assert(_scanner == null && _ptrnBuilder == null); 28Debug.Assert(scanner != null && ptrnBuilder != null); 124Debug.Assert(_scanner!.CanBeFunction); 125Debug.Assert(_scanner.Prefix.Length == 0); 126Debug.Assert(_scanner.Name == "id" || _scanner.Name == "key"); 258Debug.Assert(_scanner!.Kind == LexKind.LBracket); 261Debug.Assert(_scanner.Kind == LexKind.RBracket);
System\Xml\Xsl\Xslt\XslAst.cs (5)
68Debug.Assert(nsUri != null || Prefix == null); 119Debug.Assert(node != null); 162Debug.Assert(node != null && node.NodeType == XslNodeType.List); 250Debug.Assert(list != null && list.Count > 0); 265Debug.Assert(name != null);
System\Xml\Xsl\Xslt\XslAstAnalyzer.cs (17)
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"); 286Debug.Assert(tmpl.Match != null); 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"); 408Debug.Assert(target != null); 429Debug.Assert(instr.NodeType == XslNodeType.WithParam); 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"); 1014Debug.Assert(op != XPathOperator.Unknown); 1407Debug.Assert(split > 0); 1436Debug.Assert(scoperecord.IsNamespace || scoperecord.ncName == null); 1437Debug.Assert(!Compiler.IsPhantomNamespace(scoperecord.nsUri!)); 1478Debug.Assert(parent.Content.Count == split + 1);
System\Xml\Xsl\Xslt\XsltInput.cs (37)
43Debug.Assert(reader != null); 44Debug.Assert(atoms != null); 77Debug.Assert(tr.Settings == null, "XmlReader created with XmlReader.Create should always expand entities."); 201Debug.Assert( 244Debug.Assert(_reader.NodeType == XmlNodeType.EntityReference); 246Debug.Assert(local[0] == '#' || local == "lt" || local == "gt" || local == "quot" || local == "apos"); 258Debug.Assert(_reader.NodeType == XmlNodeType.Text || _reader.NodeType == XmlNodeType.Whitespace || _reader.NodeType == XmlNodeType.SignificantWhitespace); 261Debug.Assert(_reader.NodeType == XmlNodeType.EndEntity); 273Debug.Assert(_reader.NodeType == XmlNodeType.Attribute, "reader.NodeType == XmlNodeType.Attribute"); 323Debug.Assert(_reader.NodeType == XmlNodeType.Text, "Unexpected node type inside attribute value"); 332Debug.Assert(_reader.NodeType != XmlNodeType.EntityReference); 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()"); 441Debug.Assert(_nodeType == XmlNodeType.Text || _nodeType == XmlNodeType.Whitespace || _nodeType == XmlNodeType.SignificantWhitespace); 488Debug.Assert(_reader.NodeType == XmlNodeType.Element); 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"); 650Debug.Assert(IsKeyword(_atoms.Version)); 714Debug.Assert(NodeType == XmlNodeType.Element); 715Debug.Assert(attributes.Length <= _xsltAttributeNumber.Length); 750Debug.Assert(SS, "First we parse xsl:stylesheet element"); 843Debug.Assert(NodeType == XmlNodeType.Element); 921Debug.Assert(NodeType == XmlNodeType.Element && IsXsltNamespace()); 948Debug.Assert(extensions ? IsKeyword(_atoms.ExtensionElementPrefixes) : IsKeyword(_atoms.ExcludeResultPrefixes)); 1001Debug.Assert(IsKeyword(_atoms.XPathDefaultNamespace)); 1013Debug.Assert(IsKeyword(_atoms.DefaultCollation)); 1095Debug.Assert(prefix != null); 1099Debug.Assert(Ref.Equal(_atoms.NameTable.Get(nsUri), nsUri), "Namespaces must be atomized"); 1179Debug.Assert(input.NodeType == XmlNodeType.EndElement); 1184Debug.Assert(input.NodeType == XmlNodeType.Element || input.NodeType == XmlNodeType.Attribute);
System\Xml\Xsl\Xslt\XsltLoader.cs (40)
43Debug.Assert(compiler != null); 102Debug.Assert(compiler.Root != null); 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"); 298Debug.Assert(_input.NodeType == XmlNodeType.Element); 323Debug.Assert(!_input.IsXsltNamespace()); 324Debug.Assert(_curTemplate == null); 355Debug.Assert(_input.IsXsltNamespace() && (_input.IsKeyword(_atoms.Stylesheet) || _input.IsKeyword(_atoms.Transform))); 468Debug.Assert(_input.NodeType == XmlNodeType.Text); 825Debug.Assert(attSet != null); 836Debug.Assert(attSet.CycleCheck == CycleCheck.Processing); 837Debug.Assert(attSet.Content[0].SourceLine != null); 957Debug.Assert(NumCharAttrs == DefaultValues.Length); 973Debug.Assert(dummy, "One of the attrs should have lineInfo. If both are default they can't conflict."); 993Debug.Assert(name.Equals(format.Name)); 1067Debug.Assert(setName != null, "Required attribute always != null"); 1112Debug.Assert(_input.NodeType == XmlNodeType.Text); 1123Debug.Assert(_curTemplate == null); 1124Debug.Assert(_input.CanHaveApplyImports == false); 1141Debug.Assert(_curTemplate == null); 1455Debug.Assert(_input.NodeType == XmlNodeType.Text); 1503Debug.Assert(_input.NodeType == XmlNodeType.Text); 1716Debug.Assert(_input.NodeType == XmlNodeType.Text); 1921Debug.Assert(nodeType != XslNodeType.Unknown); 2034Debug.Assert(_input.NodeType == XmlNodeType.Element); 2480Debug.Assert(_input.NodeType == XmlNodeType.Element); 2523Debug.Assert(content != null && withParam != null); 2524Debug.Assert(withParam.NodeType == XslNodeType.WithParam); 2537Debug.Assert(content != null); 2546Debug.Assert(content != 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."); 3073Debug.Assert(node != null); 3080Debug.Assert(node != null); 3090Debug.Assert(to != null);
System\Xml\Xsl\Xslt\XsltQilFactory.cs (6)
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 && ( 140Debug.Assert(format != null); 153Debug.Assert(format != null);
System\Xml\Xsl\XsltOld\ActionFrame.cs (10)
100Debug.Assert(_variables != null && index < _variables.Length); 106Debug.Assert(_variables != null && index < _variables.Length); 113Debug.Assert(!_withParams.Contains(name), "We should check duplicate params at compile time"); 129Debug.Assert(nodeSet != null); 136Debug.Assert(nodeSet != null); 143Debug.Assert(0 < sortarray.Count); 155Debug.Assert(proc.ActionStack.Peek() == this, "the trick we are doing with proc.Current will work only if this is topmost frame"); 184Debug.Assert(parent != null); 221Debug.Assert(_action is ContainerAction); 327Debug.Assert(index > 0, "MoveNext() wasn't called");
System\Xml\Xsl\XsltOld\ApplyImportsAction.cs (1)
29Debug.Assert(processor != null && frame != null);
System\Xml\Xsl\XsltOld\ApplyTemplatesAction.cs (7)
32Debug.Assert(s_BuiltInRule != null); 45Debug.Assert(mode != null); 65Debug.Assert(_mode == null); 133Debug.Assert(processor != null && frame != null); 169Debug.Assert(frame.State == ProcessNextNode); 170Debug.Assert(frame.NewNodeSet != null); 184Debug.Assert(frame.State == PositionAdvanced);
System\Xml\Xsl\XsltOld\AttributeAction.cs (1)
118Debug.Assert(processor != null && frame != null);
System\Xml\Xsl\XsltOld\AttributeSetAction.cs (1)
34Debug.Assert(this.name == null);
System\Xml\Xsl\XsltOld\Avt.cs (6)
21Debug.Assert(constAvt != null); 27Debug.Assert(eventList != null); 45Debug.Assert(_constAvt != null); 50Debug.Assert(processor != null && frame != null); 65Debug.Assert(compiler != null); 66Debug.Assert(avtText != null);
System\Xml\Xsl\XsltOld\AvtEvent.cs (2)
18Debug.Assert(key != Compiler.InvalidQueryKey); 24Debug.Assert(_key != Compiler.InvalidQueryKey);
System\Xml\Xsl\XsltOld\BeginEvent.cs (3)
26Debug.Assert(input != null); 27Debug.Assert(input.NodeType != XPathNodeType.Namespace); 46Debug.Assert(!_replaceNSAliasesDone, "Second attempt to replace NS aliases!. This bad.");
System\Xml\Xsl\XsltOld\BuilderInfo.cs (1)
85Debug.Assert(info.NodeType != XmlNodeType.Text || XmlCharType.IsOnlyWhitespace(info.Value));
System\Xml\Xsl\XsltOld\CallTemplateAction.cs (2)
30Debug.Assert(_name == null); 84Debug.Assert(processor != null && frame != null);
System\Xml\Xsl\XsltOld\CommentAction.cs (1)
26Debug.Assert(processor != null && frame != null);
System\Xml\Xsl\XsltOld\Compiler.cs (42)
100Debug.Assert(_atoms != null); 123Debug.Assert(Document != null); 129Debug.Assert(Document != null); 135Debug.Assert(Document != null); 149Debug.Assert(_rootAction == null); 151Debug.Assert(_currentTemplate == null); 172Debug.Assert(input != null); 173Debug.Assert(xmlResolver != null); 174Debug.Assert(_input == null && _atoms == null); 186Debug.Assert(_input != null && _atoms != null); 216Debug.Assert(_rootAction != null); 217Debug.Assert(this.stylesheet != null); 218Debug.Assert(_queryStore != null); 219Debug.Assert(_input == null && _atoms == null); 321Debug.Assert(_rootAction != null); 326Debug.Assert(_currentTemplate != null); 327Debug.Assert(variable.VarType == VariableType.LocalVariable || variable.VarType == VariableType.LocalParameter || variable.VarType == VariableType.WithParameter); 464Debug.Assert(value != null); 465Debug.Assert((object)value == (object)Input!.Value); // this is always true. Why we passing value to this function. 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"); 568Debug.Assert(_xmlResolver != null); 580Debug.Assert(_xmlResolver != null); 605Debug.Assert(newInput != null); 618Debug.Assert(_input != null); 619Debug.Assert(_input.Atoms == _atoms); 654Debug.Assert(this.stylesheet == _stylesheets!.Peek()); 666Debug.Assert(this.stylesheet == _stylesheets!.Peek()); 676Debug.Assert(this.stylesheet == _stylesheets!.Peek()); 682Debug.Assert(_currentTemplate != null); 690Debug.Assert(_currentTemplate != null); 709Debug.Assert(_queryStore != null); 781Debug.Assert( 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 {"); 898Debug.Assert(start <= avt.Length); 915Debug.Assert(saveStart < start, "We have to read something. Otherwise it's dead loop."); 922Debug.Assert(avtText != null); 944Debug.Assert(!constant || list.Count <= 1, "We can't have more then 1 text event if now {avt} found");
System\Xml\Xsl\XsltOld\ContainerAction.cs (7)
168Debug.Assert(compiler.Input.NodeType == XPathNodeType.Element); 230Debug.Assert(uri != null); 674Debug.Assert(Ref.Equal(input.NamespaceURI, input.Atoms.UriXsl)); 758Debug.Assert(action != null); 854Debug.Assert((object)this == (object)compiler.RootAction); 953Debug.Assert(processor != null && frame != null); 981Debug.Assert(actionIndex == 0 || this.containedActions != null);
System\Xml\Xsl\XsltOld\CopyAction.cs (1)
52Debug.Assert(processor != null && frame != null);
System\Xml\Xsl\XsltOld\CopyAttributesAction.cs (13)
22Debug.Assert(s_Action != null); 28Debug.Assert(processor != null && frame != null); 45Debug.Assert(frame.State == BeginEvent); 46Debug.Assert(frame.Node!.NodeType == XPathNodeType.Attribute); 57Debug.Assert(frame.State == TextEvent); 58Debug.Assert(frame.Node!.NodeType == XPathNodeType.Attribute); 69Debug.Assert(frame.State == EndEvent); 70Debug.Assert(frame.Node!.NodeType == XPathNodeType.Attribute); 81Debug.Assert(frame.State == Advance); 82Debug.Assert(frame.Node!.NodeType == XPathNodeType.Attribute); 102Debug.Assert(node.NodeType == XPathNodeType.Attribute); 108Debug.Assert(node.NodeType == XPathNodeType.Attribute); 114Debug.Assert(node.NodeType == XPathNodeType.Attribute);
System\Xml\Xsl\XsltOld\CopyCodeAction.cs (5)
31Debug.Assert(copyEvents != null); 46Debug.Assert(processor != null && frame != null); 47Debug.Assert(_copyEvents != null && _copyEvents.Count > 0); 57Debug.Assert(frame.State == Outputting); 61Debug.Assert(frame.Counter < _copyEvents.Count);
System\Xml\Xsl\XsltOld\CopyNamespacesAction.cs (8)
19Debug.Assert(s_Action != null); 25Debug.Assert(processor != null && frame != null); 42Debug.Assert(frame.State == BeginEvent); 43Debug.Assert(frame.Node!.NodeType == XPathNodeType.Namespace); 54Debug.Assert(frame.State == EndEvent); 55Debug.Assert(frame.Node!.NodeType == XPathNodeType.Namespace); 66Debug.Assert(frame.State == Advance); 67Debug.Assert(frame.Node!.NodeType == XPathNodeType.Namespace);
System\Xml\Xsl\XsltOld\CopyNodeSetAction.cs (5)
24Debug.Assert(s_Action != null); 30Debug.Assert(processor != null && frame != null); 47Debug.Assert(frame.State == BeginEvent); 58Debug.Assert(frame.State == Contents); 97Debug.Assert(frame.State == EndEvent);
System\Xml\Xsl\XsltOld\CopyOfAction.cs (4)
44Debug.Assert(processor != null && frame != null); 49Debug.Assert(frame.NodeSet != null); 83Debug.Assert(frame.StoredOutput != null); 89Debug.Assert(frame.State == NodeSetCopied);
System\Xml\Xsl\XsltOld\DocumentScope.cs (4)
28Debug.Assert(prefix != null && prefix.Length > 0); 34Debug.Assert(scope.Uri != null); 44Debug.Assert(prefix != null && prefix.Length > 0); 50Debug.Assert(scope.Uri != null);
System\Xml\Xsl\XsltOld\ElementAction.cs (2)
70Debug.Assert(_empty == false); 103Debug.Assert(processor != null && frame != null);
System\Xml\Xsl\XsltOld\EndEvent.cs (1)
17Debug.Assert(nodeType != XPathNodeType.Namespace);
System\Xml\Xsl\XsltOld\ForEachAction.cs (4)
54Debug.Assert(processor != null && frame != null); 71Debug.Assert(processor.SortArray.Count != 0); 78Debug.Assert(frame.State == ProcessNextNode); 79Debug.Assert(frame.NewNodeSet != null);
System\Xml\Xsl\XsltOld\IfAction.cs (3)
65Debug.Assert(processor != null && frame != null); 72Debug.Assert(_testKey != Compiler.InvalidQueryKey); 88Debug.Assert(frame.Container != null);
System\Xml\Xsl\XsltOld\InputScope.cs (1)
92Debug.Assert(variable != null);
System\Xml\Xsl\XsltOld\InputScopeManager.cs (16)
32Debug.Assert(_scopeStack != null); 33Debug.Assert(_scopeStack.Parent != null); 59Debug.Assert(_scopeStack != null, "Push/Pop disbalance"); 75Debug.Assert(_scopeStack != null, "PushScope wasn't called"); 76Debug.Assert(prefix != null); 77Debug.Assert(nspace != null); 95Debug.Assert(_scopeStack != null, "PushScope wasn't called"); 96Debug.Assert(!string.IsNullOrEmpty(prefix)); 119Debug.Assert(prefix != null); 129Debug.Assert(prefix != null); 139Debug.Assert(_scopeStack != null, "PushScope wasn't called"); 140Debug.Assert(nsList != null); 149Debug.Assert(_scopeStack != null, "PushScope wasn't called"); 162Debug.Assert(_scopeStack != null, "PushScope wasn't called"); 163Debug.Assert(nsList != null); 172Debug.Assert(_scopeStack != null, "PushScope wasn't called");
System\Xml\Xsl\XsltOld\MessageAction.cs (2)
46Debug.Assert(processor != null && frame != null); 58Debug.Assert(recOutput != null);
System\Xml\Xsl\XsltOld\NameSpaceEvent.cs (4)
18Debug.Assert(input != null); 19Debug.Assert(input.NodeType == XPathNodeType.Namespace); 44Debug.Assert(res); // Namespace node as any other attribute can't fail because it doesn't signal record change 46Debug.Assert(res);
System\Xml\Xsl\XsltOld\NavigatorInput.cs (2)
212Debug.Assert(navigator.NameTable != null); 237Debug.Assert(_Navigator != null);
System\Xml\Xsl\XsltOld\NavigatorOutput.cs (2)
28Debug.Assert(record != null); 40Debug.Assert(record.AttributeList[attrib] is BuilderInfo);
System\Xml\Xsl\XsltOld\newinstructionaction.cs (1)
51Debug.Assert(processor != null && frame != null);
System\Xml\Xsl\XsltOld\NumberAction.cs (12)
84Debug.Assert(dblVal >= 1); 256Debug.Assert( 342Debug.Assert(nav.NodeType != XPathNodeType.Attribute && nav.NodeType != XPathNodeType.Namespace); 343Debug.Assert(MatchCountKey(processor, contextNode, nav)); 371Debug.Assert(!(value is int)); 394Debug.Assert(processor != null && frame != null); 399Debug.Assert(frame != null); 400Debug.Assert(frame.NodeSet != null); 445Debug.Assert(frame.StoredOutput != null); 515Debug.Assert(prefix == null || prefix.isSeparator); 536Debug.Assert(thisSeparator.isSeparator); 541Debug.Assert(!thisFormat.isSeparator);
System\Xml\Xsl\XsltOld\OutKeywords.cs (3)
17Debug.Assert(nameTable != null); 115Debug.Assert(keyword != null); 116Debug.Assert((object)keyword == (object?)_NameTable.Get(keyword));
System\Xml\Xsl\XsltOld\OutputScope.cs (1)
85Debug.Assert(urn != null);
System\Xml\Xsl\XsltOld\OutputScopeManager.cs (14)
30Debug.Assert(_elementScopesStack.Peek() != null); // We adding rootElementScope to garantee this 47Debug.Assert(nameTable != null); 48Debug.Assert(atoms != null); 68Debug.Assert(prefix != null); 69Debug.Assert(nspace != null); 80Debug.Assert(name != null); 81Debug.Assert(nspace != null); 82Debug.Assert(prefix != null); 92Debug.Assert(elementScope != null); 100Debug.Assert(elementScope != null); // We're adding rootElementScope to guarantee this 115Debug.Assert(prefix != null); 135Debug.Assert(_elementScopesStack[i] is OutputScope); 152Debug.Assert(nspace != null); 155Debug.Assert(_elementScopesStack[i] is OutputScope);
System\Xml\Xsl\XsltOld\PrefixQName.cs (1)
36Debug.Assert(qname != null);
System\Xml\Xsl\XsltOld\ProcessingInstructionAction.cs (2)
61Debug.Assert(processor != null && frame != null); 88Debug.Assert(frame.StoredOutput != null);
System\Xml\Xsl\XsltOld\Processor.cs (39)
128Debug.Assert(_execResult == ExecResult.Continue); 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"); 280Debug.Assert(!_stringBuilderLocked); 437Debug.Assert(_actionStack != null); 445Debug.Assert(_builder != null); 477Debug.Assert(frame != null); 506Debug.Assert(_templateLookup != null); 513Debug.Assert(key != Compiler.InvalidQueryKey); 519Debug.Assert(key != Compiler.InvalidQueryKey); 534Debug.Assert(key != Compiler.InvalidQueryKey); 603Debug.Assert(nav.NodeType == XPathNodeType.Element); 722Debug.Assert(_builder != null); 732Debug.Assert(_xsm != null); 746Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State); 747Debug.Assert(ExecutionResult == ExecResult.Continue); 751Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State); 775Debug.Assert(_xsm != null); 788Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State); 789Debug.Assert(ExecutionResult == ExecResult.Continue); 793Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State); 810Debug.Assert(_xsm != null); 824Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State); 828Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State, 934Debug.Assert(navigator != null); 957Debug.Assert(output != null); 968Debug.Assert(_builder != null); 1017Debug.Assert(saveStackSize == _actionStack.Length); 1019Debug.Assert(result != null, "Variable was just calculated and result can't be null"); 1030Debug.Assert(1 < _actionStack.Length); 1043Debug.Assert(2 < _actionStack.Length); 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"); 1086Debug.Assert(2 <= _debuggerStack!.Length); 1092Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger");
System\Xml\Xsl\XsltOld\ReaderOutput.cs (29)
43Debug.Assert(processor != null); 44Debug.Assert(processor.NameTable != null); 190Debug.Assert(ordinal >= 0); 195Debug.Assert(ordinal == -1); 205Debug.Assert(ordinal >= 0); 210Debug.Assert(ordinal == -1); 236Debug.Assert(ordinal >= 0); 242Debug.Assert(ordinal == -1); 252Debug.Assert(ordinal >= 0); 258Debug.Assert(ordinal == -1); 274Debug.Assert(_attributeCount == 0); 308Debug.Assert(_processor != null || _state == ReadState.Closed); 344Debug.Assert(Value.Length != 0, "It whould be Whitespace in this case"); 360Debug.Assert(_processor.ExecutionDone); 446Debug.Assert(_builder != null); 450Debug.Assert(NodeType == XmlNodeType.EndElement); 484Debug.Assert(_builder != null); 518Debug.Assert(_nameTable != null); 536Debug.Assert(NodeType != XmlNodeType.EntityReference); 604Debug.Assert(0 <= attrib && attrib < _attributeCount); 605Debug.Assert(0 <= attrib && attrib < _attributeList!.Count); 606Debug.Assert(_attributeList[attrib] is BuilderInfo); 617Debug.Assert(_attributeList![attrib] is BuilderInfo); 629Debug.Assert(_attributeList![index] is BuilderInfo); 649Debug.Assert(_attributeList![index] is BuilderInfo); 676Debug.Assert(_currentInfo != null); 677Debug.Assert(_attributeCount == 0 || _attributeList != null); 678Debug.Assert((_currentIndex == -1) == (_currentInfo == _mainNode)); 679Debug.Assert((_currentIndex == -1) || (_currentInfo == _attributeValue || _attributeList![_currentIndex] is BuilderInfo && _attributeList[_currentIndex] == _currentInfo));
System\Xml\Xsl\XsltOld\RecordBuilder.cs (24)
55Debug.Assert(output != null); 110Debug.Assert(_recordState != HaveRecord); 134Debug.Assert(_recordState == NoRecord || (state & StateMachine.BeginRecord) == 0); 186Debug.Assert(_recordState == NoRecord || (state & StateMachine.BeginRecord) == 0); 257Debug.Assert(_attributeCount <= _attributeList.Count); 261Debug.Assert(_attributeList[attrib] != null && _attributeList[attrib] is BuilderInfo); 284Debug.Assert(_attributeCount == 0); 298Debug.Assert(_attributeCount == 0); 312Debug.Assert(_attributeCount == _attributeList.Count); 327Debug.Assert(_attributeList[attrib] != null && _attributeList[attrib] is BuilderInfo); 413Debug.Assert(_recordState == NoRecord || _recordState == SomeRecord); 440Debug.Assert(_recordState == NoRecord || _recordState == SomeRecord); 458Debug.Assert(_recordState == NoRecord || _recordState == SomeRecord); 476Debug.Assert(_mainNode != null); 487Debug.Assert(_mainNode.NodeType == XmlNodeType.Element); 491Debug.Assert(_attributeList[attr] is BuilderInfo); 512Debug.Assert(_mainNode.NodeType == XmlNodeType.Element); 562Debug.Assert(_attributeList[attr] is BuilderInfo); 614Debug.Assert(_mainNode.NodeType == XmlNodeType.Comment); 615Debug.Assert((object?)_currentInfo == (object)_mainNode); 667Debug.Assert(_mainNode.NodeType == XmlNodeType.ProcessingInstruction || _mainNode.NodeType == XmlNodeType.XmlDeclaration); 740Debug.Assert(_namespaceCount == _namespaceList.Count); 750Debug.Assert(_namespaceList[index] != null && _namespaceList[index] is BuilderInfo); 781Debug.Assert(prefix != null && prefix.Length > 0);
System\Xml\Xsl\XsltOld\RootAction.cs (5)
187Debug.Assert(mark == null); 252Debug.Assert(processor != null && frame != null); 269Debug.Assert(frame.State == QueryInitialized); 271Debug.Assert(Processor.IsRoot(frame.Node!)); 284Debug.Assert(frame.State == RootProcessed);
System\Xml\Xsl\XsltOld\SequentialOutput.cs (18)
109Debug.Assert(record.MainNode.NodeType == XmlNodeType.Element); 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"); 407Debug.Assert(_outputCache[record] is BuilderInfo); 536Debug.Assert(value != null); 542Debug.Assert(value != null); 574Debug.Assert(value != null); 575Debug.Assert(_isHtmlOutput); 630Debug.Assert(value != null); 631Debug.Assert(find.Length == replace.Length); 660Debug.Assert(0 <= i, "find char wasn't really find"); 681Debug.Assert(value != null); 687Debug.Assert(count <= list.Count); 690Debug.Assert(list[attrib] is BuilderInfo);
System\Xml\Xsl\XsltOld\SortAction.cs (2)
174Debug.Assert(processor != null && frame != null); 175Debug.Assert(frame.State == Initialized);
System\Xml\Xsl\XsltOld\StateMachine.cs (4)
100Debug.Assert(newState != Assrt); 107Debug.Assert(newState != Assrt); 119Debug.Assert(newState != Assrt); 126Debug.Assert(newState != Assrt);
System\Xml\Xsl\XsltOld\Stylesheet.cs (18)
150Debug.Assert(attributeSet.Name != null); 172Debug.Assert(_templateNameTable != null); 202Debug.Assert(_templates == null); 206Debug.Assert(manager != null); 220Debug.Assert(enumerator.Value is TemplateManager); 230Debug.Assert(_imports[importIndex] is Stylesheet); 232Debug.Assert(stylesheet != null); 283Debug.Assert(processor != null && navigator != null); 284Debug.Assert(mode != null); 296Debug.Assert(manager.Mode.Equals(mode)); 320Debug.Assert(_imports[importIndex] is Stylesheet); 322Debug.Assert(stylesheet != null); 342Debug.Assert(processor != null && navigator != null); 343Debug.Assert(_templates == null && _modeManagers == null || _templates == _modeManagers![XmlQualifiedName.Empty]); 388Debug.Assert(_imports[importIndex] is Stylesheet); 390Debug.Assert(stylesheet != null); 420Debug.Assert(_imports[importIndex] is Stylesheet); 422Debug.Assert(stylesheet != null);
System\Xml\Xsl\XsltOld\TemplateAction.cs (7)
48Debug.Assert(_templateId == 0); 96Debug.Assert(_matchKey == Compiler.InvalidQueryKey); 101Debug.Assert(_name == null); 106Debug.Assert(double.IsNaN(_priority)); 115Debug.Assert(_mode == null); 139Debug.Assert(!(union.qy2 is UnionExpr), "only qy1 can be union"); 225Debug.Assert(processor != null && frame != null);
System\Xml\Xsl\XsltOld\TemplateLookupAction.cs (7)
25Debug.Assert(processor != null && frame != null); 26Debug.Assert(frame.State == Initialized); 59Debug.Assert(node != null); 98Debug.Assert(processor != null && frame != null); 99Debug.Assert(frame.State == Initialized); 100Debug.Assert(processor.Debugger != null); 108Debug.Assert(this.mode != Compiler.BuiltInMode);
System\Xml\Xsl\XsltOld\TemplateManager.cs (8)
22Debug.Assert(x != null && x is TemplateAction); 23Debug.Assert(y != null && y is TemplateAction); 28Debug.Assert(!double.IsNaN(tx.Priority)); 29Debug.Assert(!double.IsNaN(ty.Priority)); 33Debug.Assert(tx.TemplateId != ty.TemplateId || tx == ty); 58Debug.Assert(template != null); 59Debug.Assert( 82Debug.Assert(this.templates != null);
System\Xml\Xsl\XsltOld\TextAction.cs (1)
69Debug.Assert(processor != null && frame != null);
System\Xml\Xsl\XsltOld\TextEvent.cs (2)
19Debug.Assert(text != null); 26Debug.Assert(input.NodeType == XPathNodeType.Text || input.NodeType == XPathNodeType.SignificantWhitespace);
System\Xml\Xsl\XsltOld\UseAttributeSetsAction.cs (2)
26Debug.Assert(Ref.Equal(compiler.Input.LocalName, compiler.Atoms.UseAttributeSets)); 29Debug.Assert(_useAttributeSets == null);
System\Xml\Xsl\XsltOld\ValueOfAction.cs (9)
22Debug.Assert(s_BuiltInRule != null); 56Debug.Assert(processor != null && frame != null); 61Debug.Assert(frame != null); 62Debug.Assert(frame.NodeSet != null); 78Debug.Assert(frame.StoredOutput != null); 95Debug.Assert(processor != null && frame != null); 100Debug.Assert(frame != null); 101Debug.Assert(frame.NodeSet != null); 117Debug.Assert(frame.StoredOutput != null);
System\Xml\Xsl\XsltOld\VariableAction.cs (4)
98Debug.Assert(this.name == null && this.nameStr == null); 116Debug.Assert(processor != null && frame != null && frame.State != ValueCalculated); 169Debug.Assert(recOutput is NavigatorOutput); 174Debug.Assert(value != null);
System\Xml\Xsl\XsltOld\WithParamAction.cs (2)
34Debug.Assert(processor != null && frame != null); 61Debug.Assert(recOutput is NavigatorOutput);
System\Xml\Xsl\XsltOld\WriterOutput.cs (2)
91Debug.Assert(list.Count >= count); 94Debug.Assert(list[attrib] is BuilderInfo);
System\Xml\Xsl\XsltOld\XsltCompileContext.cs (10)
255Debug.Assert(thisUri != null && baseUri != null); 329Debug.Assert( 344Debug.Assert( 656Debug.Assert(it != null); 920Debug.Assert(resultCollection.Count != 0); 921Debug.Assert(newList.Count != 0); 925Debug.Assert(resultCollection[0] is XPathNavigator); 962Debug.Assert(extension != null); 963Debug.Assert(method != null); 995Debug.Assert(args.Length <= this.Minargs, "We are checking this on resolve time");
System\Xml\Xsl\XsltOld\XsltOutput.cs (1)
147Debug.Assert(_encoding != null);
System\Xml\Xslt\XslTransform.cs (6)
112Debug.Assert(_QueryStore != null); 113Debug.Assert(_RootAction != null); 245Debug.Assert(stylesheet != null); 251Debug.Assert(compiler.CompiledStylesheet != null); 252Debug.Assert(compiler.QueryStore != null); 253Debug.Assert(compiler.RootAction != null);
System.Private.Xml.Linq (26)
src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
33Debug.Assert(Array.MaxLength == ArrayMaxLength);
System\Xml\Linq\XContainer.cs (3)
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."); 1247Debug.Assert(content != null);
System\Xml\Linq\XElement.cs (1)
1982Debug.Assert(e != null);
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\XHelper.cs (1)
13Debug.Assert(type != 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\XNode.cs (1)
65Debug.Assert(parent.content != null);
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\Xml\Linq\XObject.cs (1)
144Debug.Assert(type != null);
System\Xml\Schema\XNodeValidator.cs (6)
95Debug.Assert(sa.AttributeSchemaType != null); 98Debug.Assert(st.Datatype != null); 102Debug.Assert(st.Content != null); 108Debug.Assert(mt.Datatype != null); 109Debug.Assert(value != null); 313Debug.Assert(si.SchemaElement != null);
System\Xml\XPath\XNodeNavigator.cs (1)
883Debug.Assert(navigator.UnderlyingObject != null);
System.Reflection.Context (72)
System\Reflection\Context\Custom\AttributeUtils.cs (2)
156Debug.Assert(attributeFilterType.IsInstanceOfType(newAttribute)); 162Debug.Assert(attributeFilterType.IsAssignableFrom(attributeType));
System\Reflection\Context\Custom\CustomType.cs (2)
265Debug.Assert(types == null || types.Length == 0); 277Debug.Assert(getPropertySetter && types != null && types.Length == 1);
System\Reflection\Context\CustomReflectionContext.Projector.cs (16)
27Debug.Assert(ReflectionContext.SourceContext != null); 40Debug.Assert(ReflectionContext.SourceContext != null); 55Debug.Assert(NeedsProjection(value)); 66Debug.Assert(NeedsProjection(value)); 77Debug.Assert(NeedsProjection(value)); 88Debug.Assert(NeedsProjection(value)); 99Debug.Assert(NeedsProjection(value)); 110Debug.Assert(NeedsProjection(value)); 121Debug.Assert(NeedsProjection(value)); 149Debug.Assert(NeedsProjection(value)); 160Debug.Assert(NeedsProjection(value)); 171Debug.Assert(NeedsProjection(value)); 182Debug.Assert(NeedsProjection(value)); 193Debug.Assert(NeedsProjection(value)); 204Debug.Assert(NeedsProjection(value)); 215Debug.Assert(NeedsProjection(value));
System\Reflection\Context\Delegation\DelegatingAssembly.cs (1)
20Debug.Assert(null != assembly);
System\Reflection\Context\Delegation\DelegatingConstructorInfo.cs (1)
14Debug.Assert(null != constructor);
System\Reflection\Context\Delegation\DelegatingCustomAttributeData.cs (1)
13Debug.Assert(null != attribute);
System\Reflection\Context\Delegation\DelegatingEventInfo.cs (1)
13Debug.Assert(null != @event);
System\Reflection\Context\Delegation\DelegatingExceptionHandlingClause.cs (1)
14Debug.Assert(clause != null);
System\Reflection\Context\Delegation\DelegatingFieldInfo.cs (1)
14Debug.Assert(null != field);
System\Reflection\Context\Delegation\DelegatingLocalVariableInfo.cs (1)
12Debug.Assert(variable != null);
System\Reflection\Context\Delegation\DelegatingManifestResourceInfo.cs (1)
13Debug.Assert(null != resource);
System\Reflection\Context\Delegation\DelegatingMethodBody.cs (1)
15Debug.Assert(null != body);
System\Reflection\Context\Delegation\DelegatingMethodInfo.cs (1)
16Debug.Assert(null != method);
System\Reflection\Context\Delegation\DelegatingModule.cs (1)
14Debug.Assert(null != module);
System\Reflection\Context\Delegation\DelegatingParameterInfo.cs (1)
13Debug.Assert(null != parameter);
System\Reflection\Context\Delegation\DelegatingPropertyInfo.cs (1)
14Debug.Assert(null != property);
System\Reflection\Context\Delegation\DelegatingType.cs (2)
18Debug.Assert(null != type); 398Debug.Assert(bindingAttr == (BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public));
System\Reflection\Context\Projection\ProjectingAssembly.cs (1)
18Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingConstructorInfo.cs (1)
16Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingCustomAttributeData.cs (1)
18Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingEventInfo.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingExceptionHandlingClause.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingFieldInfo.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingLocalVariableInfo.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingManifestResourceInfo.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingMethodBody.cs (1)
18Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingMethodInfo.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingModule.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingParameterInfo.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingPropertyInfo.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingType.cs (2)
19Debug.Assert(null != projector); 255Debug.Assert(i == members.Length);
System\Reflection\Context\Projection\Projector.cs (5)
37Debug.Assert(!(value is IProjectable) || ((IProjectable)value).Projector != this); 107Debug.Assert(value != null); 125Debug.Assert(null != project); 126Debug.Assert(values != null && values.Count > 0); 134Debug.Assert(NeedsProjection(value));
System\Reflection\Context\Virtual\InheritedMethodInfo.cs (4)
18Debug.Assert(reflectedType != null); 19Debug.Assert(reflectedType.IsSubclassOf(baseMethod.DeclaringType!)); 20Debug.Assert(baseMethod is VirtualMethodBase); 23Debug.Assert(baseMethod.ReflectedType!.Equals(baseMethod.DeclaringType));
System\Reflection\Context\Virtual\InheritedPropertyInfo.cs (4)
18Debug.Assert(reflectedType != null); 19Debug.Assert(reflectedType.IsSubclassOf(baseProperty.DeclaringType!)); 20Debug.Assert(baseProperty is VirtualPropertyBase); 23Debug.Assert(baseProperty.ReflectedType!.Equals(baseProperty.DeclaringType));
System\Reflection\Context\Virtual\VirtualParameter.cs (1)
16Debug.Assert(position >= -1);
System\Reflection\Context\Virtual\VirtualPropertyBase.cs (3)
28Debug.Assert(context != null); 87Debug.Assert(getMethod != null || setMethod != null); 218Debug.Assert(null != method);
System\Reflection\Context\Virtual\VirtualPropertyBase.FuncPropertyAccessorBase.cs (1)
14Debug.Assert(null != declaringProperty);
System\Reflection\Context\Virtual\VirtualPropertyInfo.cs (2)
47Debug.Assert(_getter == null || _getter.IsPublic); 54Debug.Assert(_setter == null || _setter.IsPublic);
System\Reflection\Context\Virtual\VirtualPropertyInfo.PropertyGetter.cs (1)
21Debug.Assert(null != getter);
System\Reflection\Context\Virtual\VirtualPropertyInfo.PropertySetter.cs (1)
22Debug.Assert(null != setter);
System.Reflection.DispatchProxy (11)
System\Reflection\DispatchProxyGenerator.cs (11)
68Debug.Assert(baseType != null); 69Debug.Assert(interfaceType != null); 72Debug.Assert(alc != null); 291Debug.Assert(baseCtor != null); 400Debug.Assert(ei.EventHandlerType != null); 618Debug.Assert(!target.IsByRef); 624Debug.Assert(!isAddress); 635Debug.Assert(!opCode.Equals(OpCodes.Nop)); 640Debug.Assert(source.IsAssignableFrom(target)); 657Debug.Assert(source.IsAssignableFrom(target) || target.IsInterface || source.IsInterface); 717Debug.Assert(_paramTypes[i].IsByRef);
System.Reflection.Emit (30)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeNameBuilder.cs (6)
37Debug.Assert(_instNesting != 0); 53Debug.Assert(_instNesting != 0); 69Debug.Assert(_instNesting != 0); 81Debug.Assert(name != null); 93Debug.Assert(rank > 0); 134Debug.Assert(_instNesting == 0);
System\Reflection\Emit\FieldBuilderImpl.cs (1)
59Debug.Assert(binaryAttribute.Length >= 6);
System\Reflection\Emit\ILGeneratorImpl.cs (5)
434Debug.Assert(opcode.Equals(OpCodes.Call) || 443Debug.Assert(opcode.Equals(OpCodes.Call) || 482Debug.Assert(labelStartDepth >= -1); 483Debug.Assert(targetDepth >= -1); 579Debug.Assert(opcode.Equals(OpCodes.Calli), "Unexpected opcode encountered for StackBehaviour VarPop.");
System\Reflection\Emit\ModuleBuilderImpl.cs (8)
157Debug.Assert(typeBuilder._handle.Equals(typeHandle)); 368Debug.Assert(method._handle == handle); 498Debug.Assert(previousNonHiddenStartColumn < 0); 576Debug.Assert(deltaLines != 0 || deltaColumns != 0 || sequencePoint.IsHidden); 586Debug.Assert(deltaLines > 0); 639Debug.Assert(field._handle == handle); 1004Debug.Assert(tb.IsCreated()); 1011Debug.Assert(eb._typeBuilder.IsCreated());
System\Reflection\Emit\PseudoCustomAttributesData.cs (10)
151Debug.Assert(_marshalArrayElementCount >= 0); 181Debug.Assert(_marshalArrayElementType >= 0); 241Debug.Assert(parameterIndex == null || parameterIndex >= 0 && parameterIndex <= MaxMarshalInteger); 249Debug.Assert(elementCount == null || elementCount >= 0 && elementCount <= MaxMarshalInteger); 250Debug.Assert(parameterIndex == null || parameterIndex >= 0); 260Debug.Assert(elementCount == null || elementCount >= 0 && elementCount <= MaxMarshalInteger); 261Debug.Assert(elementType == null || elementType >= 0 && (int)elementType <= MaxMarshalInteger); 270Debug.Assert(elementType == null || elementType >= 0 && (int)elementType <= MaxMarshalInteger); 279Debug.Assert(elementCount >= 0 && elementCount <= MaxMarshalInteger); 287Debug.Assert(type >= 0 && (int)type <= MaxMarshalInteger);
System.Reflection.Metadata (371)
src\libraries\Common\src\System\HexConverter.cs (3)
167Debug.Assert(chars.Length >= bytes.Length * 2); 359Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 360Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Reflection\AssemblyNameFormatter.cs (1)
23Debug.Assert(name.Length != 0);
src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (1)
66Debug.Assert(input.Length > 0);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 281Debug.Assert(additionalCapacityBeyondPos > 0); 282Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Reflection\Internal\MemoryBlocks\ByteArrayMemoryProvider.cs (2)
19Debug.Assert(!array.IsDefault); 25Debug.Assert(disposing);
System\Reflection\Internal\MemoryBlocks\ExternalMemoryBlockProvider.cs (1)
38Debug.Assert(disposing);
System\Reflection\Internal\MemoryBlocks\StreamMemoryBlockProvider.cs (2)
40Debug.Assert(stream.CanSeek && stream.CanRead); 51Debug.Assert(disposing);
System\Reflection\Internal\Utilities\BitArithmetic.cs (3)
49Debug.Assert(CountBits(alignment) == 1); 62Debug.Assert(position >= 0 && alignment > 0); 63Debug.Assert(CountBits(alignment) == 1);
System\Reflection\Internal\Utilities\BlobUtilities.cs (6)
16Debug.Assert(buffer.Length > 0); 88Debug.Assert(written); 128Debug.Assert(byteCount >= charCount); 140Debug.Assert(*charPtr <= 0x7f); 194Debug.Assert(ptr == bufferPtr + start + byteCount); 195Debug.Assert(charPtr == strEnd);
System\Reflection\Internal\Utilities\EncodingHelper.netcoreapp.cs (2)
19Debug.Assert(utf8Decoder != null); 36Debug.Assert(utf8Decoder != null);
System\Reflection\Internal\Utilities\MemoryBlock.cs (9)
21Debug.Assert(length >= 0 && (buffer != null || length == 0)); 297Debug.Assert(terminator <= 0x7F); 316Debug.Assert(terminator <= 0x7f); 338Debug.Assert(asciiChar != 0 && asciiChar <= 0x7f); 377Debug.Assert(result == FastComparisonResult.Inconclusive); 397Debug.Assert(terminator <= 0x7F); 460Debug.Assert(asciiPrefix[i] > 0 && asciiPrefix[i] <= 0x7f); 484Debug.Assert(asciiString[i] > 0 && asciiString[i] <= 0x7f); 848Debug.Assert(i == result.Length);
System\Reflection\Internal\Utilities\PooledStringBuilder.cs (2)
24Debug.Assert(pool != null); 67Debug.Assert(builder.Builder.Length == 0);
System\Reflection\Internal\Utilities\StreamExtensions.cs (1)
30Debug.Assert(count > 0);
System\Reflection\Metadata\BlobBuilder.cs (18)
124Debug.Assert(_buffer != null); 125Debug.Assert(Length >= 0 && Length <= _buffer.Length); 126Debug.Assert(_nextOrPrevious != null); 130Debug.Assert(_previousLengthOrFrozenSuffixLengthDelta >= 0); 136Debug.Assert(chunk.IsHead || chunk.Length > 0); 140Debug.Assert(totalLength == Count); 150Debug.Assert(IsHead); 155Debug.Assert(IsHead); 231Debug.Assert(leftStart == 0 || rightStart == 0); 283Debug.Assert(bufferStart >= chunkStart); 288Debug.Assert(bytesToCopy >= 0); 302Debug.Assert(bufferStart == bufferEnd); 597Debug.Assert(byteCount >= 0); 616Debug.Assert(byteCount <= MinChunkSize); 945Debug.Assert(unchecked((ushort)reference) == reference); 1077Debug.Assert(start >= 0); 1078Debug.Assert(length >= 0); 1079Debug.Assert(start + length <= str.Length);
System\Reflection\Metadata\BlobBuilder.Enumerators.cs (1)
22Debug.Assert(builder.IsHead);
System\Reflection\Metadata\BlobReader.cs (4)
40Debug.Assert(block.Length >= 0 && (block.Pointer != null || block.Length == 0)); 137Debug.Assert((alignment & (alignment - 1)) == 0, "Alignment must be a power of two."); 138Debug.Assert(remainder >= 0 && remainder < alignment); 514Debug.Assert(bytesRead == 4);
System\Reflection\Metadata\BlobWriter.cs (5)
40Debug.Assert(buffer != null); 41Debug.Assert(count >= 0); 42Debug.Assert(count <= buffer.Length - start); 109Debug.Assert(value >= 0); 359Debug.Assert(unchecked((ushort)reference) == reference);
System\Reflection\Metadata\BlobWriterImpl.cs (1)
18Debug.Assert(value <= MaxCompressedIntegerValue);
System\Reflection\Metadata\Ecma335\BlobDictionary.cs (1)
58Debug.Assert(immutableKey.AsSpan().SequenceEqual(key));
System\Reflection\Metadata\Ecma335\Encoding\ControlFlowBuilder.cs (9)
119Debug.Assert(operandOffset >= 0); 120Debug.Assert(_branches.Count == 0 || operandOffset > _branches[_branches.Count - 1].OperandOffset); 126Debug.Assert(opCode.GetBranchOperandSize() == 1); 129Debug.Assert(opCode == ILOpCode.Switch || opCode.GetBranchOperandSize() == 4); 132Debug.Assert(instructionEndDisplacement > 4 && instructionEndDisplacement % 4 == 0 && opCode == ILOpCode.Switch); 141Debug.Assert(ilOffset >= 0); 295Debug.Assert( 319Debug.Assert( 414Debug.Assert(_lazyExceptionHandlers != null);
System\Reflection\Metadata\Ecma335\Encoding\ExceptionRegionEncoder.cs (2)
82Debug.Assert(exceptionRegionCount > 0); 99Debug.Assert(dataSize <= 0x00ffffff);
System\Reflection\Metadata\Ecma335\Encoding\LabelHandle.cs (1)
18Debug.Assert(id >= 1);
System\Reflection\Metadata\Ecma335\Encoding\SwitchInstructionEncoder.cs (1)
22Debug.Assert(encoder.ControlFlowBuilder is not null);
System\Reflection\Metadata\Ecma335\MetadataAggregator.cs (3)
67Debug.Assert(baseTableRowCounts != null); 271Debug.Assert(sizes[generation] == size); 304Debug.Assert(sizes[generation].AggregateInserts == rowId);
System\Reflection\Metadata\Ecma335\MetadataBuilder.cs (5)
17Debug.Assert(HeapIndex.UserString == 0); 18Debug.Assert((int)HeapIndex.String == 1); 19Debug.Assert((int)HeapIndex.Blob == 2); 20Debug.Assert((int)HeapIndex.Guid == 3); 97Debug.Assert(endOffset - startOffset == sizes.MetadataHeaderSize);
System\Reflection\Metadata\Ecma335\MetadataBuilder.Tables.cs (2)
1872Debug.Assert(metadataSizes.MetadataTableStreamSize == endPosition - startPosition); 1919Debug.Assert(metadataSizes.CalculateTableStreamHeaderSize() == endPosition - startPosition);
System\Reflection\Metadata\Ecma335\MetadataReaderExtensions.cs (2)
126Debug.Assert(reader != null); 227Debug.Assert(reader != null);
System\Reflection\Metadata\Ecma335\MetadataRootBuilder.cs (1)
61Debug.Assert(BlobUtilities.GetUTF8ByteCount(DefaultMetadataVersionString) == DefaultMetadataVersionString.Length);
System\Reflection\Metadata\Ecma335\MetadataSizes.cs (18)
127Debug.Assert(rowCounts.Length == MetadataTokens.TableCount); 128Debug.Assert(externalRowCounts.Length == MetadataTokens.TableCount); 129Debug.Assert(heapSizes.Length == MetadataTokens.HeapCount); 155Debug.Assert((PresentTablesMask & ExternalTablesMask) == 0); 275Debug.Assert(rowCounts[(int)TableIndex.FieldPtr] == 0); 277Debug.Assert(rowCounts[(int)TableIndex.MethodPtr] == 0); 279Debug.Assert(rowCounts[(int)TableIndex.ParamPtr] == 0); 291Debug.Assert(rowCounts[(int)TableIndex.EventPtr] == 0); 294Debug.Assert(rowCounts[(int)TableIndex.PropertyPtr] == 0); 305Debug.Assert(rowCounts[(int)TableIndex.AssemblyProcessor] == 0); 306Debug.Assert(rowCounts[(int)TableIndex.AssemblyOS] == 0); 308Debug.Assert(rowCounts[(int)TableIndex.AssemblyRefProcessor] == 0); 309Debug.Assert(rowCounts[(int)TableIndex.AssemblyRefOS] == 0); 362Debug.Assert(RegularStreamHeaderSizes == 369Debug.Assert(EncDeltaMarkerStreamHeaderSize == GetMetadataStreamHeaderSize("#JTD")); 370Debug.Assert(StandalonePdbStreamHeaderSize == GetMetadataStreamHeaderSize("#Pdb")); 445Debug.Assert(result % StreamAlignment == 0); 480Debug.Assert(RowCounts[(int)table] == 0 || ExternalRowCounts[(int)table] == 0);
System\Reflection\Metadata\Ecma335\PortablePdbBuilder.cs (3)
63Debug.Assert(BlobUtilities.GetUTF8ByteCount(MetadataVersion) == MetadataVersion.Length); 116Debug.Assert(_serializedMetadata.Sizes.CalculateStandalonePdbStreamSize() == endPosition - startPosition); 150Debug.Assert(idWriter.RemainingBytes == 0);
System\Reflection\Metadata\Ecma335\SignatureDecoder.cs (1)
323Debug.Assert(handle.IsNil); // will fall through to throw in release.
System\Reflection\Metadata\EntityHandle.cs (1)
93Debug.Assert(!IsVirtual);
System\Reflection\Metadata\Handle.cs (9)
38Debug.Assert(value >= 0); 45Debug.Assert(IsHeapHandle && value <= HeapHandleType.OffsetMask || 54Debug.Assert(!IsHeapHandle); 64Debug.Assert(IsHeapHandle); 92Debug.Assert((_value & TokenTypeIds.RIDMask) == _value); 104Debug.Assert((_value & TokenTypeIds.RIDMask) == _value); 155Debug.Assert(IsEntityOrUserStringHandle); 156Debug.Assert(!IsVirtual); 157Debug.Assert((_value & TokenTypeIds.RIDMask) == _value);
System\Reflection\Metadata\IL\MethodBodyBlock.cs (1)
29Debug.Assert(!exceptionRegions.IsDefault);
System\Reflection\Metadata\Internal\MetadataWriterUtilities.cs (1)
19Debug.Assert(!value.GetType().GetTypeInfo().IsEnum);
System\Reflection\Metadata\Internal\NamespaceCache.cs (14)
21Debug.Assert(reader != null); 36Debug.Assert(!handle.HasFullName); // we should not hit the cache in this case. 44Debug.Assert(_rootNamespace != null); 78Debug.Assert(!handleContainingSegment.IsVirtual); 93Debug.Assert(lastFoundIndex >= 0 || currentSegment == 0); 178Debug.Assert(data.Namespaces!.Count == 0); 208Debug.Assert(realChild.HasFullName); 233Debug.Assert(child != null && parent != null); 234Debug.Assert(!child.Handle.IsNil); 247Debug.Assert(realChild.Handle.HasFullName); 327Debug.Assert(table != null); 359Debug.Assert(table != null); 377Debug.Assert(namespaceHandle.HasFullName); 397Debug.Assert(_namespaceTable != null);
System\Reflection\Metadata\Internal\StringHeap.cs (14)
164Debug.Assert(handle.StringKind != StringKind.Virtual); 172Debug.Assert(handle.StringKind != StringKind.Virtual); 183Debug.Assert(handle.StringKind != StringKind.Virtual); 194Debug.Assert(handle.IsVirtual); 206Debug.Assert(handle.IsVirtual); 249Debug.Assert(value != null); 268Debug.Assert(value != null); 290Debug.Assert(!rawHandle.IsVirtual); 291Debug.Assert(rawHandle.StringKind != StringKind.DotTerminated, "Not supported"); 300Debug.Assert(asciiChar != 0 && asciiChar <= 0x7f); 309Debug.Assert(!rawHandle.IsVirtual); 310Debug.Assert(rawHandle.StringKind != StringKind.DotTerminated, "Not supported"); 319Debug.Assert(!rawHandle.IsVirtual); 320Debug.Assert(rawHandle.StringKind != StringKind.DotTerminated, "Not supported");
System\Reflection\Metadata\Internal\Tables.cs (11)
44Debug.Assert(NumberOfRows > 0); 50Debug.Assert(NumberOfRows > 0); 56Debug.Assert(NumberOfRows > 0); 62Debug.Assert(NumberOfRows > 0); 68Debug.Assert(NumberOfRows > 0); 1955Debug.Assert(NumberOfRows == 1); 1961Debug.Assert(NumberOfRows == 1); 1971Debug.Assert(NumberOfRows == 1); 1977Debug.Assert(NumberOfRows == 1); 1983Debug.Assert(NumberOfRows == 1); 1989Debug.Assert(NumberOfRows == 1);
System\Reflection\Metadata\MetadataReader.cs (5)
129Debug.Assert(AssemblyTable.NumberOfRows <= 1); 787Debug.Assert(local.Length == external.Length); 1449Debug.Assert(!enclosingClass.IsNil); 1463Debug.Assert(builder == groupedNestedTypes[enclosingClass]); 1486Debug.Assert(_lazyNestedTypesMap != null);
System\Reflection\Metadata\MetadataReader.WinMD.cs (10)
96Debug.Assert(s_projectionInfos != null && projectionIndex >= 0 && projectionIndex < s_projectionInfos.Length); 102Debug.Assert(s_projectionInfos != null && projectionIndex >= 0 && projectionIndex < s_projectionInfos.Length); 108Debug.Assert(s_projectionInfos != null && projectionIndex >= 0 && projectionIndex < s_projectionInfos.Length); 114Debug.Assert(s_projectionInfos != null && projectionIndex >= 0 && projectionIndex < s_projectionInfos.Length); 187Debug.Assert(k == keys.Length && v == keys.Length && k == v); 200Debug.Assert(string.CompareOrdinal(keys[i], keys[i + 1]) < 0); 223Debug.Assert(_metadataKind != MetadataKind.Ecma335); 320Debug.Assert(_metadataKind != MetadataKind.Ecma335); 513Debug.Assert(!namespaceHandle.IsVirtual && !nameHandle.IsVirtual); 667Debug.Assert(_metadataKind != MetadataKind.Ecma335);
System\Reflection\Metadata\MetadataReaderProvider.cs (2)
35Debug.Assert(metadataBlock != null); 41Debug.Assert(blockProvider != null);
System\Reflection\Metadata\MetadataStringComparer.cs (1)
54Debug.Assert(reader != null);
System\Reflection\Metadata\MetadataStringDecoder.cs (1)
70Debug.Assert(Encoding != null);
System\Reflection\Metadata\PortablePdb\CustomDebugInformation.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\PortablePdb\Document.cs (2)
23Debug.Assert(reader != null); 24Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\PortablePdb\DocumentNameBlobHandle.cs (1)
28Debug.Assert(HeapHandleType.IsValidHeapOffset((uint)heapOffset));
System\Reflection\Metadata\PortablePdb\HandleCollections.Debug.cs (8)
20Debug.Assert(reader != null); 119Debug.Assert(reader != null); 218Debug.Assert(reader != null); 426Debug.Assert(reader != null); 532Debug.Assert(reader != null); 638Debug.Assert(reader != null); 737Debug.Assert(reader != null); 746Debug.Assert(reader != null);
System\Reflection\Metadata\PortablePdb\Handles.Debug.cs (7)
18Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 101Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 196Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 279Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 362Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 445Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 528Debug.Assert(TokenTypeIds.IsValidRowId(rowId));
System\Reflection\Metadata\PortablePdb\ImportDefinition.cs (1)
24Debug.Assert(
System\Reflection\Metadata\PortablePdb\ImportScope.cs (2)
23Debug.Assert(reader != null); 24Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\PortablePdb\LocalConstant.cs (2)
23Debug.Assert(reader != null); 24Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\PortablePdb\LocalScope.cs (2)
23Debug.Assert(reader != null); 24Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\PortablePdb\LocalVariable.cs (2)
23Debug.Assert(reader != null); 24Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\PortablePdb\MethodDebugInformation.cs (1)
23Debug.Assert(reader != null);
System\Reflection\Metadata\PortablePdb\SequencePointCollection.cs (1)
101Debug.Assert(_previousNonHiddenStartColumn == 0);
System\Reflection\Metadata\TypeName.cs (2)
345Debug.Assert(_fullName is not null); 391Debug.Assert(rootTypeName._fullName is not null);
System\Reflection\Metadata\TypeNameParser.cs (1)
275Debug.Assert(nestedNameLength > 0, "TryGetTypeNameInfo should return error on zero lengths");
System\Reflection\Metadata\TypeNameParserHelpers.cs (1)
188Debug.Assert(rankOrModifier >= 2);
System\Reflection\Metadata\TypeSystem\AssemblyDefinition.cs (1)
14Debug.Assert(reader != null);
System\Reflection\Metadata\TypeSystem\AssemblyFile.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\AssemblyReference.cs (3)
20Debug.Assert(reader != null); 21Debug.Assert(treatmentAndRowId != 0); 24Debug.Assert((treatmentAndRowId & ~(TokenTypeIds.VirtualBit | TokenTypeIds.RIDMask)) == 0);
System\Reflection\Metadata\TypeSystem\Constant.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(rowId != 0);
System\Reflection\Metadata\TypeSystem\CustomAttribute.cs (2)
18Debug.Assert(reader != null); 19Debug.Assert(treatmentAndRowId != 0);
System\Reflection\Metadata\TypeSystem\DeclarativeSecurityAttribute.cs (2)
18Debug.Assert(reader != null); 19Debug.Assert(rowId != 0);
System\Reflection\Metadata\TypeSystem\EventDefinition.cs (2)
19Debug.Assert(reader != null); 20Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\ExportedType.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(rowId != 0);
System\Reflection\Metadata\TypeSystem\FieldDefinition.cs (2)
18Debug.Assert(reader != null); 19Debug.Assert(treatmentAndRowId != 0);
System\Reflection\Metadata\TypeSystem\GenericParameter.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\GenericParameterConstraint.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\HandleCollections.TypeSystem.cs (23)
237Debug.Assert(reader != null); 245Debug.Assert(reader != null); 357Debug.Assert(reader != null); 365Debug.Assert(reader != null); 366Debug.Assert(!handle.IsNil); 464Debug.Assert(reader != null); 472Debug.Assert(reader != null); 473Debug.Assert(!containingType.IsNil); 584Debug.Assert(reader != null); 592Debug.Assert(reader != null); 593Debug.Assert(!containingType.IsNil); 704Debug.Assert(reader != null); 712Debug.Assert(reader != null); 713Debug.Assert(!containingType.IsNil); 824Debug.Assert(reader != null); 832Debug.Assert(reader != null); 833Debug.Assert(!containingType.IsNil); 942Debug.Assert(reader != null); 1047Debug.Assert(reader != null); 1048Debug.Assert(!containingMethod.IsNil); 1159Debug.Assert(reader != null); 1160Debug.Assert(!implementingType.IsNil); 1660Debug.Assert(reader != null);
System\Reflection\Metadata\TypeSystem\Handles.TypeSystem.cs (43)
18Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 101Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 184Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 267Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 362Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 445Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 528Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 611Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 694Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 777Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 860Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 943Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1026Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1109Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1192Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1275Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1358Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1441Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1524Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1629Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1635Debug.Assert(virtualIndex < VirtualIndex.Count); 1725Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1808Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1891Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1974Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 2057Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 2149Debug.Assert((offset & 0xFF000000) == 0); 2299Debug.Assert((value & StringHandleType.TypeMask) == StringHandleType.String || 2314Debug.Assert(virtualIndex < VirtualIndex.Count); 2325Debug.Assert(StringKind == StringKind.Plain); 2331Debug.Assert(StringKind == StringKind.Plain); 2337Debug.Assert(StringKind == StringKind.Plain); 2338Debug.Assert(prefixByteLength >= 0); 2383Debug.Assert(!IsVirtual || StringKind == StringKind.WinRTPrefixed); 2389Debug.Assert(IsVirtual && StringKind != StringKind.WinRTPrefixed); 2395Debug.Assert(IsNil || IsVirtual && StringKind == StringKind.Virtual); 2462Debug.Assert(virtualIndex != 0); 2507Debug.Assert(!IsVirtual); 2518Debug.Assert(HasFullName); 2588Debug.Assert(virtualIndex < VirtualIndex.Count); 2596Debug.Assert(blob.Length >= TemplateParameterOffset_AttributeUsageTarget + 4); 2633Debug.Assert(!IsVirtual); 2639Debug.Assert(IsVirtual);
System\Reflection\Metadata\TypeSystem\InterfaceImplementation.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\ManifestResource.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\MemberReference.cs (2)
18Debug.Assert(reader != null); 19Debug.Assert(treatmentAndRowId != 0);
System\Reflection\Metadata\TypeSystem\MethodDefinition.cs (2)
18Debug.Assert(reader != null); 19Debug.Assert(treatmentAndRowId != 0);
System\Reflection\Metadata\TypeSystem\MethodImplementation.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\MethodSpecification.cs (2)
18Debug.Assert(reader != null); 19Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\ModuleDefinition.cs (1)
14Debug.Assert(reader != null);
System\Reflection\Metadata\TypeSystem\ModuleReference.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\NamespaceDefinition.cs (1)
16Debug.Assert(data != null);
System\Reflection\Metadata\TypeSystem\Parameter.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\PropertyDefinition.cs (2)
19Debug.Assert(reader != null); 20Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\StandaloneSignature.cs (2)
19Debug.Assert(reader != null); 20Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\TypeDefinition.cs (2)
19Debug.Assert(reader != null); 20Debug.Assert(treatmentAndRowId != 0);
System\Reflection\Metadata\TypeSystem\TypeReference.cs (2)
18Debug.Assert(reader != null); 19Debug.Assert(treatmentAndRowId != 0);
System\Reflection\Metadata\TypeSystem\TypeSpecification.cs (2)
18Debug.Assert(reader != null); 19Debug.Assert(!handle.IsNil);
System\Reflection\PortableExecutable\DebugDirectory\CodeViewDebugDirectoryData.cs (1)
27Debug.Assert(path != null);
System\Reflection\PortableExecutable\DebugDirectory\PdbChecksumDebugDirectoryData.cs (2)
23Debug.Assert(!string.IsNullOrEmpty(algorithmName)); 24Debug.Assert(!checksum.IsDefaultOrEmpty);
System\Reflection\PortableExecutable\ManagedPEBuilder.cs (2)
187Debug.Assert(_nativeResourcesOpt != null); 207Debug.Assert(builder.Count == 0);
System\Reflection\PortableExecutable\ManagedTextSection.cs (12)
246Debug.Assert(builder.Count == 0); 247Debug.Assert(metadataBuilder.Count == MetadataSize); 248Debug.Assert(metadataBuilder.Count % 4 == 0); 249Debug.Assert(ilBuilder.Count == ILStreamSize); 250Debug.Assert((mappedFieldDataBuilderOpt?.Count ?? 0) == MappedFieldDataSize); 251Debug.Assert((resourceBuilderOpt?.Count ?? 0) == ResourceDataSize); 305Debug.Assert(builder.Count == ComputeSizeOfTextSection()); 327Debug.Assert(builder.Count - start == SizeOfImportAddressTable); 364Debug.Assert(builder.Count - start == SizeOfImportTable); 374Debug.Assert(builder.Count - start == SizeOfNameTable); 429Debug.Assert(builder.Count - start == CorHeaderSize); 430Debug.Assert(builder.Count % 4 == 0);
System\Reflection\PortableExecutable\PEBinaryReader.cs (4)
28Debug.Assert(size >= 0 && size <= (stream.Length - stream.Position)); 112Debug.Assert(count <= sizeof(long)); // Error message assumes we're trying to read constant small number of bytes. 113Debug.Assert(_reader.BaseStream.Position >= 0 && _maxOffset >= 0); 124Debug.Assert(startPosition >= 0 && _maxOffset >= 0);
System\Reflection\PortableExecutable\PEBuilder.cs (5)
118Debug.Assert(stampWriter.RemainingBytes == 0); 157Debug.Assert(DosHeader.Length == DosHeaderSize); 497Debug.Assert(peImage != null); 498Debug.Assert(signatureProvider != null); 533Debug.Assert(segment.Count > 0);
System\Reflection\PortableExecutable\PEHeader.cs (1)
307Debug.Assert(magic == PEMagic.PE32);
System\Reflection\PortableExecutable\PEMemoryBlock.cs (2)
19Debug.Assert(block != null); 20Debug.Assert(offset >= 0 && offset <= block.Size);
System\Reflection\PortableExecutable\PEReader.cs (4)
320Debug.Assert(imageStart >= 0 && imageStart <= stream.Length); 381Debug.Assert(index >= 0 && index < PEHeaders.SectionHeaders.Length); 537Debug.Assert(PEHeaders.PEHeader != null); 761Debug.Assert(errorToReport is BadImageFormatException || errorToReport is IOException);
System.Reflection.MetadataLoadContext (147)
System\CoreRtBridge.cs (1)
21Debug.Assert(t.IsGenericTypeDefinition);
System\Reflection\DefaultBinder.cs (1)
234Debug.Assert(returnType != null);
System\Reflection\MetadataLoadContext.CoreAssembly.cs (1)
17Debug.Assert(_coreAssembly == null);
System\Reflection\MetadataLoadContext.Resolving.cs (3)
27Debug.Assert(refName != null); 48Debug.Assert(refName != null); 59Debug.Assert(refName != null);
System\Reflection\PathAssemblyResolver.cs (1)
56Debug.Assert(assemblyName.Name != null);
System\Reflection\Runtime\BindingFlagSupport\ConstructorPolicies.cs (1)
22Debug.Assert(reflectedType.Equals(type)); // Constructor queries are always performed as if BindingFlags.DeclaredOnly are set so the reflectedType should always be the declaring type.
System\Reflection\Runtime\BindingFlagSupport\NestedTypePolicies.cs (1)
28Debug.Assert(reflectedType.Equals(type)); // NestedType queries are always performed as if BindingFlags.DeclaredOnly are set so the reflectedType should always be the declaring type.
System\Reflection\Runtime\BindingFlagSupport\QueriedMemberList.cs (6)
70Debug.Assert(index >= 0 && index < _totalCount); 78Debug.Assert(index >= 0 && index < _totalCount); 174Debug.Assert((allFlagsThatMustMatch & ~validBits) == 0); 175Debug.Assert(((allFlagsThatMustMatch & BindingFlags.Public) == 0) != ((allFlagsThatMustMatch & BindingFlags.NonPublic) == 0)); 176Debug.Assert(((allFlagsThatMustMatch & BindingFlags.Instance) == 0) != ((allFlagsThatMustMatch & BindingFlags.Static) == 0)); 177Debug.Assert((allFlagsThatMustMatch & BindingFlags.FlattenHierarchy) == 0 || (allFlagsThatMustMatch & BindingFlags.Static) != 0);
System\Reflection\Runtime\BindingFlagSupport\Shared.cs (2)
25Debug.Assert(methodBase != null); 26Debug.Assert(argumentTypes != null);
System\Reflection\Runtime\General\ListBuilder.cs (2)
28Debug.Assert(index < Count); 38Debug.Assert(!_toArrayAlreadyCalled, "Cannot call ListBuilder.ToArray() a second time. Copy the one you already got.");
System\Reflection\Runtime\SignatureTypeExtensions.cs (3)
35Debug.Assert(pattern.IsSignatureType()); 107Debug.Assert(signatureType.IsSignatureType()); 113Debug.Assert(signatureType.IsSignatureType());
System\Reflection\TypeLoading\Assemblies\AssemblyFileInfo.cs (1)
16Debug.Assert(name != null);
System\Reflection\TypeLoading\Assemblies\Ecma\EcmaAssembly.cs (4)
22Debug.Assert(loader != null); 23Debug.Assert(peReader != null); 24Debug.Assert(reader != null); 25Debug.Assert(location != null);
System\Reflection\TypeLoading\Assemblies\RoAssembly.GetForwardedTypes.cs (1)
38Debug.Assert((type != null) != (exception != null)); // Exactly one of these must be non-null.
System\Reflection\TypeLoading\Assemblies\RoAssembly.Modules.cs (1)
108Debug.Assert(afi.RowIndex != 0); // Since we excluded the manifest module from the search.
System\Reflection\TypeLoading\Constructors\RoDefinitionConstructor.cs (2)
21Debug.Assert(declaringType != null); 51Debug.Assert(ReflectedType == other.ReflectedType);
System\Reflection\TypeLoading\Constructors\RoSyntheticConstructor.cs (1)
23Debug.Assert(declaringType != null);
System\Reflection\TypeLoading\Events\Ecma\EcmaEvent.cs (4)
24Debug.Assert(!handle.IsNil); 25Debug.Assert(declaringType != null); 26Debug.Assert(reflectedType != null); 27Debug.Assert(declaringType.Module is EcmaModule);
System\Reflection\TypeLoading\Events\RoEvent.cs (2)
19Debug.Assert(declaringType != null); 20Debug.Assert(reflectedType != null);
System\Reflection\TypeLoading\Fields\Ecma\EcmaField.cs (4)
23Debug.Assert(!handle.IsNil); 24Debug.Assert(declaringType != null); 25Debug.Assert(reflectedType != null); 26Debug.Assert(declaringType.Module is EcmaModule);
System\Reflection\TypeLoading\Fields\RoField.cs (2)
21Debug.Assert(declaringType != null); 22Debug.Assert(reflectedType != null);
System\Reflection\TypeLoading\General\Assignability.cs (4)
184Debug.Assert(!(fromTypeInfo.IsArray || fromTypeInfo.IsByRef || fromTypeInfo.IsPointer || fromTypeInfo.IsGenericParameter)); 185Debug.Assert(!(toTypeInfo.IsArray || toTypeInfo.IsByRef || toTypeInfo.IsPointer || toTypeInfo.IsGenericParameter)); 335Debug.Assert(fromTypeInfo.IsArray); 336Debug.Assert(toTypeInfo.IsInterface);
System\Reflection\TypeLoading\General\Ecma\EcmaResolver.cs (10)
16Debug.Assert(!handle.IsNil); 17Debug.Assert(module != null); 30Debug.Assert(!handle.IsNil); 31Debug.Assert(module != null); 41Debug.Assert(!handle.IsNil); 42Debug.Assert(module != null); 120Debug.Assert(!handle.IsNil); 121Debug.Assert(module != null); 128Debug.Assert(!handle.IsNil); 129Debug.Assert(module != null);
System\Reflection\TypeLoading\General\Ecma\EcmaToStringHelpers.cs (2)
21Debug.Assert(!handle.IsNil); 22Debug.Assert(reader != null);
System\Reflection\TypeLoading\General\Ecma\GuardedPEReader.cs (3)
29Debug.Assert(loader != null); 30Debug.Assert(peReader != null); 31Debug.Assert(reader != null);
System\Reflection\TypeLoading\General\Ecma\MetadataTable.cs (2)
31Debug.Assert(!handle.IsNil); 32Debug.Assert(factory != null);
System\Reflection\TypeLoading\General\Helpers.cs (5)
92Debug.Assert(rank == 1 || multiDim); 209Debug.Assert(fullName != null); 232Debug.Assert(ns != null, "For top level types, the namespace must be string.Empty, not null"); 233Debug.Assert(name != null); 315Debug.Assert(assembly is RoAssembly);
System\Reflection\TypeLoading\General\MethodSig.cs (3)
25Debug.Assert(parameterCount >= 0); 33Debug.Assert(position >= -1 && position < Parameters.Length); 39Debug.Assert(position >= -1 && position < Parameters.Length);
System\Reflection\TypeLoading\General\RoAssemblyName.cs (2)
38Debug.Assert(name != null); 54Debug.Assert(other is not null);
System\Reflection\TypeLoading\Methods\RoConstructedGenericMethod.cs (2)
21Debug.Assert(genericMethodDefinition != null); 22Debug.Assert(genericMethodArguments != null);
System\Reflection\TypeLoading\Methods\RoDefinitionMethod.cs (2)
19Debug.Assert(reflectedType != null); 39Debug.Assert(declaringType != null);
System\Reflection\TypeLoading\Methods\RoMethod.cs (1)
20Debug.Assert(reflectedType != null);
System\Reflection\TypeLoading\Methods\RoSyntheticMethod.cs (1)
24Debug.Assert(declaringType != null);
System\Reflection\TypeLoading\Modules\Ecma\EcmaModule.cs (4)
28Debug.Assert(assembly != null); 29Debug.Assert(fullyQualifiedName != null); 30Debug.Assert(peReader != null); 31Debug.Assert(reader != null);
System\Reflection\TypeLoading\Modules\GetTypeCoreCache.cs (6)
155Debug.Assert(newNextFreeEntry <= _nextFreeEntry); 177Debug.Assert(_nextFreeEntry >= 0 && _nextFreeEntry <= _entries.Length); 186Debug.Assert(walk1 >= 0 && walk1 < _nextFreeEntry); 187Debug.Assert(walk2 >= -1 && walk2 < _nextFreeEntry); 190Debug.Assert(storedBucket == bucket); 202Debug.Assert(numEntriesEncountered <= _nextFreeEntry);
System\Reflection\TypeLoading\Modules\RoModule.cs (1)
25Debug.Assert(fullyQualifiedName != null);
System\Reflection\TypeLoading\Modules\RoResourceModule.cs (2)
24Debug.Assert(assembly != null); 25Debug.Assert(fullyQualifiedName != null);
System\Reflection\TypeLoading\Parameters\Ecma\EcmaFatMethodParameter.cs (4)
23Debug.Assert(roMethodBase != null); 24Debug.Assert(parameterType != null); 25Debug.Assert(!handle.IsNil); 28Debug.Assert(roMethodBase.MethodBase.Module is EcmaModule);
System\Reflection\TypeLoading\Parameters\RoFatMethodParameter.cs (2)
18Debug.Assert(roMethodBase != null); 19Debug.Assert(parameterType != null);
System\Reflection\TypeLoading\Parameters\RoMethodParameter.cs (2)
19Debug.Assert(roMethodBase != null); 20Debug.Assert(parameterType != null);
System\Reflection\TypeLoading\Parameters\RoParameter.cs (1)
19Debug.Assert(member != null);
System\Reflection\TypeLoading\Parameters\RoPropertyIndexParameter.cs (2)
20Debug.Assert(member != null); 21Debug.Assert(backingParameter != null);
System\Reflection\TypeLoading\Parameters\RoThinMethodParameter.cs (2)
18Debug.Assert(roMethodBase != null); 19Debug.Assert(parameterType != null);
System\Reflection\TypeLoading\Properties\Ecma\EcmaProperty.cs (4)
23Debug.Assert(!handle.IsNil); 24Debug.Assert(declaringType != null); 25Debug.Assert(reflectedType != null); 26Debug.Assert(declaringType.Module is EcmaModule);
System\Reflection\TypeLoading\Properties\RoProperty.cs (2)
20Debug.Assert(declaringType != null); 21Debug.Assert(reflectedType != null);
System\Reflection\TypeLoading\RuntimeTypeInfo.BindingFlags.cs (9)
16Debug.Assert(types != null); 66Debug.Assert(name != null); 72Debug.Assert(genericParameterCount == GenericParameterCountAny); 73Debug.Assert(binder == null); 74Debug.Assert(callConvention == CallingConventions.Any); 75Debug.Assert(modifiers == null); 110Debug.Assert(name != null); 116Debug.Assert(binder == null); 117Debug.Assert(modifiers == null);
System\Reflection\TypeLoading\RuntimeTypeInfo.GetMember.cs (1)
83Debug.Assert(numCopied == numMatches);
System\Reflection\TypeLoading\Types\Ecma\EcmaDefinitionType.cs (2)
21Debug.Assert(module != null); 22Debug.Assert(!handle.IsNil);
System\Reflection\TypeLoading\Types\Ecma\EcmaGenericMethodParameterType.cs (1)
17Debug.Assert(!handle.IsNil);
System\Reflection\TypeLoading\Types\Ecma\EcmaGenericParameterType.cs (1)
20Debug.Assert(!handle.IsNil);
System\Reflection\TypeLoading\Types\RoArrayType.cs (2)
20Debug.Assert(elementType != null); 21Debug.Assert(multiDim || rank == 1);
System\Reflection\TypeLoading\Types\RoArrayType.Key.cs (1)
18Debug.Assert(elementType != null);
System\Reflection\TypeLoading\Types\RoByRefType.cs (1)
17Debug.Assert(elementType != null);
System\Reflection\TypeLoading\Types\RoConstructedGenericType.cs (2)
23Debug.Assert(genericTypeDefinition != null); 24Debug.Assert(genericTypeArguments != null);
System\Reflection\TypeLoading\Types\RoConstructedGenericType.Key.cs (2)
15Debug.Assert(genericTypeDefinition != null); 16Debug.Assert(genericTypeArguments != null);
System\Reflection\TypeLoading\Types\RoDefinitionType.cs (3)
38Debug.Assert(!IsConstructedGenericType); 39Debug.Assert(!IsGenericParameter); 40Debug.Assert(!HasElementType);
System\Reflection\TypeLoading\Types\RoFunctionPointerType.cs (1)
32Debug.Assert(module != null);
System\Reflection\TypeLoading\Types\RoHasElementType.cs (1)
21Debug.Assert(elementType != null);
System\Reflection\TypeLoading\Types\RoModifiedFunctionPointerType.cs (1)
23Debug.Assert(functionPointerType.IsFunctionPointer);
System\Reflection\TypeLoading\Types\RoModifiedGenericType.cs (1)
18Debug.Assert(genericType.IsGenericType);
System\Reflection\TypeLoading\Types\RoModifiedHasElementType.cs (1)
18Debug.Assert(unmodifiedType.HasElementType);
System\Reflection\TypeLoading\Types\RoModifiedType.cs (2)
60Debug.Assert(_requiredModifiers == null); 67Debug.Assert(_optionalModifiers == null);
System\Reflection\TypeLoading\Types\RoPointerType.cs (1)
17Debug.Assert(elementType != null);
System\Reflection\TypeLoading\Types\RoWrappedType.cs (1)
16Debug.Assert(unmodifiedType != null);
System.Resources.Extensions (50)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (6)
137Debug.Assert(_resourceList != null); 276Debug.Assert(resMgrHeaderBlob.Length > 0, "ResourceWriter: Expected non empty header"); 370Debug.Assert((bw.BaseStream.Position & 7) == 0, "ResourceWriter: Name hashes array won't be 8 byte aligned! Ack!"); 381Debug.Assert((bw.BaseStream.Position & 3) == 0, "ResourceWriter: Name positions array won't be 4 byte aligned! Ack!"); 407Debug.Assert(startOfDataSection == bw.Seek(0, SeekOrigin.Current), "ResourceWriter::Generate - start of data section is wrong!"); 499Debug.Assert(writer != null);
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 (30)
46Debug.Assert(value >= 0, "negative ResourceTypeCode. What?"); 199Debug.Assert(_nameHashes != null && _nameHashesPtr == null, "Internal state mangled."); 204Debug.Assert(_nameHashes == null && _nameHashesPtr != null, "Internal state mangled."); 215Debug.Assert(_namePositions != null && _namePositionsPtr == null, "Internal state mangled."); 220Debug.Assert(_namePositions == null && _namePositionsPtr != null, "Internal state mangled."); 256Debug.Assert(_store != null, "ResourceReader is closed!"); 337Debug.Assert(_store != null, "ResourceReader is closed!"); 338Debug.Assert(Monitor.IsEntered(this)); // uses _store 380Debug.Assert(_store != null, "ResourceReader is closed!"); 451Debug.Assert(_store != null, "ResourceReader is closed!"); 475Debug.Assert(_store != null, "ResourceReader is closed!"); 537Debug.Assert(_store != null, "ResourceReader is closed!"); 538Debug.Assert(_version == 1, ".resources file was not a V1 .resources file!"); 539Debug.Assert(Monitor.IsEntered(this)); // uses _store 559Debug.Assert(Monitor.IsEntered(this)); // uses _store 619Debug.Assert(_store != null, "ResourceReader is closed!"); 620Debug.Assert(_version >= 2, ".resources file was not a V2 (or higher) .resources file!"); 621Debug.Assert(Monitor.IsEntered(this)); // uses _store 641Debug.Assert(Monitor.IsEntered(this)); // uses _store 727Debug.Assert(r == len, "ResourceReader needs to use a blocking read here. (Call _store.ReadBytes(len)?)"); 779Debug.Assert(!Monitor.IsEntered(this)); // only called during init 780Debug.Assert(_store != null, "ResourceReader is closed!"); 802Debug.Assert(!Monitor.IsEntered(this)); // only called during init 991Debug.Assert(Monitor.IsEntered(this)); // uses _store 999Debug.Assert(_typeTable[typeIndex] != null, "Should have found a type!"); 1030Debug.Assert(typeCode >= 0, "can't be negative"); 1031Debug.Assert(Monitor.IsEntered(this)); // uses _store 1035Debug.Assert(!string.Equals(typeCode.ToString(), "LastPrimitive"), "Change ResourceTypeCode metadata order so LastPrimitive isn't what Enum.ToString prefers."); 1041Debug.Assert(typeIndex >= 0 && typeIndex < _typeTable.Length, "TypeCode is broken or corrupted!"); 1115Debug.Assert(!Monitor.IsEntered(_reader));
src\libraries\System.Private.CoreLib\src\System\Resources\RuntimeResourceSet.cs (1)
281Debug.Assert(!Monitor.IsEntered(reader));
System\Resources\Extensions\BinaryFormat\BinaryFormattedObject.TypeResolver.cs (1)
40Debug.Assert(typeName.AssemblyName is not null);
System\Resources\Extensions\BinaryFormat\Deserializer\ArrayRecordDeserializer.cs (1)
25Debug.Assert(arrayRecord.RecordType is not (SerializationRecordType.ArraySingleString or SerializationRecordType.ArraySinglePrimitive));
System\Resources\Extensions\BinaryFormat\Deserializer\ClassRecordFieldInfoDeserializer.cs (1)
48Debug.Assert(_fieldInfo is not null);
System\Resources\Extensions\BinaryFormat\Deserializer\Deserializer.cs (2)
266Debug.Assert(Options.SurrogateSelector is not null); 363Debug.Assert(_pendingUpdates is not null);
System\Resources\Extensions\PreserializedResourceWriter.cs (2)
100Debug.Assert(primitiveValue.GetType() == primitiveType); 197Debug.Assert(record != null);
System.Resources.Writer (7)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (6)
137Debug.Assert(_resourceList != null); 276Debug.Assert(resMgrHeaderBlob.Length > 0, "ResourceWriter: Expected non empty header"); 370Debug.Assert((bw.BaseStream.Position & 7) == 0, "ResourceWriter: Name hashes array won't be 8 byte aligned! Ack!"); 381Debug.Assert((bw.BaseStream.Position & 3) == 0, "ResourceWriter: Name positions array won't be 4 byte aligned! Ack!"); 407Debug.Assert(startOfDataSection == bw.Seek(0, SeekOrigin.Current), "ResourceWriter::Generate - start of data section is wrong!"); 499Debug.Assert(writer != null);
System\Resources\ResourceWriter.core.cs (1)
51Debug.Assert(data != null);
System.Runtime.Caching (122)
System\Runtime\Caching\CacheExpires.cs (49)
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"); 594Debug.Assert(cacheEntry == entries[entryIndex]._cacheEntry); 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"); 775Debug.Assert(NUMBUCKETS < byte.MaxValue);
System\Runtime\Caching\CacheMemoryMonitor.cs (1)
173Debug.Assert(SAMPLE_COUNT == 2);
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)
254Debug.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\MemoryCacheKeyEqualityComparer.cs (2)
13Debug.Assert(x != null && x is MemoryCacheKey); 14Debug.Assert(y != null && y is MemoryCacheKey);
System\Runtime\Caching\MemoryCacheStore.cs (3)
112Debug.Assert(entry.State == EntryState.RemovingFromCache, "entry.State = EntryState.RemovingFromCache"); 282Debug.Assert(_useInsertBlock == false, "_useInsertBlock == false"); 376Debug.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.InteropServices (3)
System\Runtime\InteropServices\Marshalling\ComObject.cs (3)
47Debug.Assert(Marshal.IsComObject(_runtimeCallableWrapper)); 144Debug.Assert(found); 165Debug.Assert(_runtimeCallableWrapper != null);
System.Runtime.Numerics (282)
src\libraries\Common\src\System\Number.Formatting.Common.cs (12)
144Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 281Debug.Assert(format is 'G' or 'g'); 293Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 716Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 750Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 820Debug.Assert(p >= spanPtr - 1, "Underflow"); 865Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 886Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 913Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 935Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 959Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 1013Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte));
src\libraries\Common\src\System\Number.NumberBuffer.cs (6)
37Debug.Assert(digits != null); 45Debug.Assert(!digits.IsEmpty); 65Debug.Assert((Kind == NumberBufferKind.Integer) || (Kind == NumberBufferKind.Decimal) || (Kind == NumberBufferKind.FloatingPoint)); 66Debug.Assert(Digits[0] != '0', "Leading zeros should never be stored in a Number"); 81Debug.Assert(numDigits == DigitsCount, "Null terminator found in unexpected location in Number"); 82Debug.Assert(numDigits < Digits.Length, "Null terminator not found in Number");
src\libraries\Common\src\System\Number.Parsing.Common.cs (11)
16Debug.Assert(str != null); 17Debug.Assert(strEnd != null); 18Debug.Assert(str <= strEnd); 19Debug.Assert((styles & (NumberStyles.AllowHexSpecifier | NumberStyles.AllowBinarySpecifier)) == 0); 28Debug.Assert(number.DigitsCount == 0); 29Debug.Assert(number.Scale == 0); 30Debug.Assert(!number.IsNegative); 31Debug.Assert(!number.HasNonZeroTail); 228Debug.Assert(numberOfTrailingZeros >= 0); 283Debug.Assert(info != null); 339Debug.Assert((p != null) && (pEnd != null) && (p <= pEnd));
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 281Debug.Assert(additionalCapacityBeyondPos > 0); 282Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\FormattingHelpers.CountDigits.cs (3)
25Debug.Assert(log2ToPow10.Length == 64); 54Debug.Assert((elementOffset + 1) <= powersOf10.Length); 102Debug.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 (6)
31Debug.Assert(value >= 0); 32Debug.Assert(value <= _span.Length); 41Debug.Assert(index < _pos); 94Debug.Assert(index == 0, "Implementation currently only supports index == 0"); 109Debug.Assert(length >= 0); 137Debug.Assert(_pos == _span.Length);
System\Number.BigInteger.cs (29)
275Debug.Assert(leading != 0); 362Debug.Assert(intDigits.Length % PowersOf1e9.MaxPartialDigits == 0); 369Debug.Assert(intDigits.Length == 0); 445Debug.Assert(bits.Trim(0u).Length == 0); 446Debug.Assert(BigIntegerParseNaiveThresholdInRecursive > 1); 463Debug.Assert(multiplier1E9Length < base1E9.Length && base1E9.Length <= multiplier1E9Length * 2); 505Debug.Assert(bits[resultLength] == 0); 514Debug.Assert(bits[resultLength] == 0); 530Debug.Assert(bits[resultLength] == 0); 553Debug.Assert(format == 'x' || format == 'X'); 562Debug.Assert(success); 643Debug.Assert(success); 647Debug.Assert(!bytes.IsEmpty); 656Debug.Assert(arrayToReturnToPool is not null); 664Debug.Assert(digits < Array.MaxLength); 703Debug.Assert(sb.Length == charsIncludeDigits); 749Debug.Assert(formatString == null || formatString.Length == formatSpan.Length); 779Debug.Assert(formatString != null); 791Debug.Assert((long)BigInteger.MaxLength * (MaxPartialDigits + 1) / MaxPartialDigits + 1 < (long)int.MaxValue); // won't overflow 805Debug.Assert(base1E9Buffer[iuDst] < TenPowMaxPartial); 926Debug.Assert(base1E9Value[^1] != 0, "Leading zeros should be trimmed by caller."); 1055Debug.Assert(pow1E9.Length >= 1); 1056Debug.Assert(Indexes[6] == LeadingPowers1E9.Length); 1069Debug.Assert(2 * src.Length - (Indexes[i + 1] - Indexes[i]) is 0 or 1); 1077Debug.Assert(toExclusive == pow1E9.Length || pow1E9[toExclusive] == 0); 1114Debug.Assert(trailingZeroCount >= 0); 1151Debug.Assert(fi + 1 < Indexes.Length); 1176Debug.Assert(Unsafe.AreSame(ref bits[0], ref powersOfTen2[0])); 1237Debug.Assert(destination.Length * TParser.DigitsPerBlock == input.Length);
System\Number.Polyfill.cs (11)
84Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 92Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 100Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 108Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 116Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 124Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 132Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 140Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 148Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 156Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 164Debug.Assert(typeof(TChar) == typeof(Utf16Char));
System\Numerics\BigInteger.cs (49)
171Debug.Assert(sign == +1 || sign == -1); 179Debug.Assert(man < (1UL << 53)); 180Debug.Assert(exp <= 0 || man >= (1UL << 52)); 209Debug.Assert(0 <= cbit && cbit < kcbitUint); 210Debug.Assert(cu >= 1); 230Debug.Assert(bits.Length == 4 && (bits[3] & DecimalScaleFactorMask) == 0); 559Debug.Assert((int)value[length - 1] < 0); 769Debug.Assert(dividend._bits != null); 796Debug.Assert(divisor._bits != null); 889Debug.Assert(right._bits != null); 897Debug.Assert(left._bits != null); 903Debug.Assert(left._bits != null && right._bits != null); 917Debug.Assert(BigIntegerCalculator.Compare(leftBits, rightBits) >= 0); 1329Debug.Assert(mode == GetBytesMode.Span || destination.IsEmpty, $"If we're not in span mode, we shouldn't have been passed a destination."); 1379Debug.Assert(bits.Length > 0); 1380Debug.Assert(bits[bits.Length - 1] != 0); 1390Debug.Assert(highDword <= uint.MaxValue - 1); 1396Debug.Assert(sign == 1); 1504Debug.Assert(msbIndex >= 0 && msbIndex <= 3); 1523Debug.Assert(isBigEndian || (!needExtraByte && curByte == length - 1) || (needExtraByte && curByte == length - 2)); 1525Debug.Assert(!isBigEndian || (!needExtraByte && curByte == 0) || (needExtraByte && curByte == 1)); 1544Debug.Assert(_bits is null || _sign == 0 ? buffer.Length == 2 : buffer.Length >= _bits.Length + 1); 1676Debug.Assert(!(trivialLeft && trivialRight), "Trivial cases should be handled on the caller operator"); 1683Debug.Assert(!rightBits.IsEmpty); 1695Debug.Assert(!leftBits.IsEmpty); 1707Debug.Assert(!leftBits.IsEmpty && !rightBits.IsEmpty); 1719Debug.Assert(!leftBits.IsEmpty && !rightBits.IsEmpty); 1754Debug.Assert(!(trivialLeft && trivialRight), "Trivial cases should be handled on the caller operator"); 1761Debug.Assert(!rightBits.IsEmpty); 1773Debug.Assert(!leftBits.IsEmpty); 1795Debug.Assert(!leftBits.IsEmpty && !rightBits.IsEmpty); 2729Debug.Assert(!(trivialLeft && trivialRight), "Trivial cases should be handled on the caller operator"); 2736Debug.Assert(!right.IsEmpty); 2748Debug.Assert(!left.IsEmpty); 2770Debug.Assert(!left.IsEmpty && !right.IsEmpty); 2783Debug.Assert(!left.IsEmpty && !right.IsEmpty); 2825Debug.Assert(dividend._bits != null); 2845Debug.Assert(dividend._bits != null && divisor._bits != null); 2890Debug.Assert(dividend._bits != null); 2895Debug.Assert(dividend._bits != null && divisor._bits != null); 3140Debug.Assert(_bits is null ? xd.Length == 1 : xd.Length == _bits.Length); 3159Debug.Assert(_sign == 1 || _sign == -1); 3161Debug.Assert(_bits.Length > 0); 3163Debug.Assert(_bits.Length > 1 || _bits[0] >= kuMaskHighBit); 3165Debug.Assert(_bits[_bits.Length - 1] != 0); 3167Debug.Assert(_bits.Length <= MaxLength); 3172Debug.Assert(_sign > int.MinValue); 3748Debug.Assert(Unsafe.AreSame(ref startAddress, ref Unsafe.Add(ref address, sizeof(uint)))); 3849Debug.Assert(Unsafe.AreSame(ref lastAddress, ref Unsafe.Subtract(ref address, sizeof(uint))));
System\Numerics\BigIntegerCalculator.AddSub.cs (15)
21Debug.Assert(left.Length >= 1); 22Debug.Assert(bits.Length == left.Length + 1); 29Debug.Assert(right.Length >= 1); 30Debug.Assert(left.Length >= right.Length); 31Debug.Assert(bits.Length == left.Length + 1); 61Debug.Assert(left.Length >= right.Length); 87Debug.Assert(carry == 0); 92Debug.Assert(left.Length >= 1); 93Debug.Assert(left[0] >= right || left.Length >= 2); 94Debug.Assert(bits.Length == left.Length); 101Debug.Assert(right.Length >= 1); 102Debug.Assert(left.Length >= right.Length); 103Debug.Assert(CompareActual(left, right) >= 0); 104Debug.Assert(bits.Length == left.Length); 134Debug.Assert(left.Length >= right.Length);
System\Numerics\BigIntegerCalculator.DivRem.cs (68)
36Debug.Assert(left.Length >= 1); 37Debug.Assert(quotient.Length == left.Length); 55Debug.Assert(left.Length >= 1); 70Debug.Assert(left.Length >= 1); 71Debug.Assert(right.Length >= 1); 72Debug.Assert(left.Length >= right.Length); 73Debug.Assert(quotient.Length == left.Length - right.Length + 1); 74Debug.Assert(remainder.Length == left.Length); 91Debug.Assert(left.Length >= 1); 92Debug.Assert(right.Length >= 1); 93Debug.Assert(left.Length >= right.Length); 94Debug.Assert(quotient.Length == left.Length - right.Length + 1); 123Debug.Assert(left.Length >= 1); 124Debug.Assert(right.Length >= 1); 125Debug.Assert(left.Length >= right.Length); 126Debug.Assert(remainder.Length == left.Length); 161Debug.Assert(left.Length >= 1); 162Debug.Assert(right.Length >= 1); 163Debug.Assert(left.Length >= right.Length); 164Debug.Assert(quotient.Length == left.Length - right.Length + 1 210Debug.Assert(left.Length >= 1); 211Debug.Assert(right.Length >= 1); 212Debug.Assert(left.Length >= right.Length); 213Debug.Assert( 274Debug.Assert(carry == t + 1); 280Debug.Assert(carry == 1); 295Debug.Assert(left.Length >= right.Length); 314Debug.Assert(left.Length >= right.Length); 315Debug.Assert(q <= 0xFFFFFFFF); 339Debug.Assert(q <= 0xFFFFFFFF); 357Debug.Assert(left.Length >= 1); 358Debug.Assert(right.Length >= 1); 359Debug.Assert(left.Length >= right.Length); 360Debug.Assert(quotient.Length == left.Length - right.Length + 1); 361Debug.Assert(remainder.Length == left.Length 405Debug.Assert((uint)sigmaSmall <= 32); 406Debug.Assert(src.Length + sigmaDigit <= bits.Length); 426Debug.Assert(carry == 0); 435Debug.Assert(t < a.Length || (t == a.Length && (int)a[^1] >= 0)); 459Debug.Assert(!q.Slice(quotientUpper.Length).ContainsAnyExcept(0u)); 485Debug.Assert(r[^1] == 0); 486Debug.Assert(!r.Slice(0, sigmaDigit).ContainsAnyExcept(0u)); 495Debug.Assert((uint)sigmaSmall <= 32); 506Debug.Assert(carry == 0); 523Debug.Assert(left.Length == 2 * right.Length); 524Debug.Assert(CompareActual(left.Slice(right.Length), right) < 0); 525Debug.Assert(quotient.Length == right.Length); 526Debug.Assert(remainder.Length >= right.Length + 1); 527Debug.Assert(right[^1] > 0); 528Debug.Assert(right.Length < DivideBurnikelZieglerThreshold); 544Debug.Assert(quotient.Length + 1 == left.Length); 545Debug.Assert(left[^1] < right[0]); 583Debug.Assert(!r1.Slice(remainder.Length).ContainsAnyExcept(0u)); 595Debug.Assert(left.Length == 2 * right.Length); 596Debug.Assert(CompareActual(left.Slice(right.Length), right) < 0); 597Debug.Assert(quotient.Length == right.Length); 598Debug.Assert(remainder.Length >= right.Length + 1); 599Debug.Assert(right[^1] > 0); 624Debug.Assert(right.Length % 2 == 0); 625Debug.Assert(left12.Length == right.Length); 626Debug.Assert(2 * left3.Length == right.Length); 627Debug.Assert(2 * quotient.Length == right.Length); 628Debug.Assert(remainder.Length >= right.Length + 1); 629Debug.Assert(right[^1] > 0); 630Debug.Assert(CompareActual(left12, right) < 0); 652Debug.Assert(CompareActual(a1, b1) == 0); 673Debug.Assert((uint)qi < (uint)quotient.Length); 685Debug.Assert(bits.Length == left.Length + right.Length);
System\Numerics\BigIntegerCalculator.FastReducer.cs (9)
25Debug.Assert(!modulus.IsEmpty); 26Debug.Assert(r.Length == modulus.Length * 2 + 1); 27Debug.Assert(mu.Length == r.Length - modulus.Length + 1); 28Debug.Assert(q1.Length == modulus.Length * 2 + 2); 29Debug.Assert(q2.Length == modulus.Length * 2 + 2); 46Debug.Assert(value.Length <= _modulus.Length * 2); 70Debug.Assert(!right.IsEmpty); 71Debug.Assert(!bits.IsEmpty); 72Debug.Assert(bits.Length + k >= left.Length + right.Length);
System\Numerics\BigIntegerCalculator.GcdInv.cs (20)
46Debug.Assert(left.Length >= 1); 47Debug.Assert(right != 0); 59Debug.Assert(left.Length >= 2); 60Debug.Assert(right.Length >= 2); 61Debug.Assert(CompareActual(left, right) >= 0); 62Debug.Assert(result.Length == left.Length); 80Debug.Assert(left.Length >= 2); 81Debug.Assert(right.Length >= 2); 82Debug.Assert(left.Length >= right.Length); 205Debug.Assert(buffer.Length >= 2); 225Debug.Assert(xBuffer.Length >= 3); 226Debug.Assert(yBuffer.Length >= 3); 227Debug.Assert(xBuffer.Length >= yBuffer.Length); 272Debug.Assert(x >= y); 280Debug.Assert(x.Length >= 1); 281Debug.Assert(y.Length >= 1); 282Debug.Assert(x.Length >= y.Length); 283Debug.Assert(a <= 0x7FFFFFFF && b <= 0x7FFFFFFF); 284Debug.Assert(c <= 0x7FFFFFFF && d <= 0x7FFFFFFF); 306Debug.Assert(bits.Length >= maxLength);
System\Numerics\BigIntegerCalculator.PowMod.cs (11)
23Debug.Assert(bits.Length == PowBound(power, value.Length)); 50Debug.Assert(value.Length >= valueLength); 51Debug.Assert(temp.Length == result.Length); 52Debug.Assert(value.Length == temp.Length); 72Debug.Assert(leftLength <= left.Length); 95Debug.Assert(valueLength <= value.Length); 96Debug.Assert(temp.Length >= valueLength + valueLength); 211Debug.Assert(!modulus.IsEmpty); 212Debug.Assert(bits.Length == modulus.Length + modulus.Length); 260Debug.Assert(!modulus.IsEmpty); 261Debug.Assert(bits.Length == modulus.Length + modulus.Length);
System\Numerics\BigIntegerCalculator.SquMul.cs (18)
23Debug.Assert(bits.Length == value.Length + value.Length); 133Debug.Assert(bits.Length == left.Length + 1); 161Debug.Assert(left.Length >= right.Length); 162Debug.Assert(bits.Length >= left.Length + right.Length); 163Debug.Assert(bits.Trim(0u).IsEmpty); 164Debug.Assert(MultiplyKaratsubaThreshold >= 2); 214Debug.Assert(leftLow.Length >= leftHigh.Length); 249Debug.Assert(left.Length >= right.Length); 250Debug.Assert(2 * n - left.Length is 0 or 1); 251Debug.Assert(right.Length > n); 252Debug.Assert(bits.Length >= left.Length + right.Length); 272Debug.Assert(leftLow.Length >= leftHigh.Length); 273Debug.Assert(rightLow.Length >= rightHigh.Length); 274Debug.Assert(bitsLow.Length >= bitsHigh.Length); 320Debug.Assert(ActualLength(core) <= left.Length + 1); 333Debug.Assert(right.Length < MultiplyKaratsubaThreshold); 364Debug.Assert(left.Length >= right.Length); 365Debug.Assert(core.Length >= left.Length);
System\Numerics\BigIntegerCalculator.Utils.cs (2)
20Debug.Assert(left.Length <= right.Length || left.Slice(right.Length).ContainsAnyExcept(0u)); 21Debug.Assert(left.Length >= right.Length || right.Slice(left.Length).ContainsAnyExcept(0u));
System\Numerics\Complex.cs (4)
300Debug.Assert((x >= 0.0) || double.IsNaN(x)); 529Debug.Assert((x >= 0.0) || double.IsNaN(x)); 530Debug.Assert((y >= 0.0) || double.IsNaN(y)); 2209Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
System\Numerics\NumericsHelpers.cs (2)
59Debug.Assert((man & 0xFFF0000000000000) == 0x0010000000000000); 82Debug.Assert(bits != 0);
System.Runtime.Serialization.Formatters (54)
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (3)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
System\Runtime\Serialization\FormatterServices.cs (4)
27Debug.Assert(type != null); 205Debug.Assert(fi != null); 344Debug.Assert(rank >= 1); 378Debug.Assert(innerSurrogate != null);
System\Runtime\Serialization\ObjectManager.cs (41)
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"); 181Debug.Assert(holder.SerializationInfo != null); 197Debug.Assert(holder.ObjectValue is ISerializable, "holder.m_object is ISerializable"); 224Debug.Assert(holder.IsIncompleteObjectReference); 243Debug.Assert(holder.ObjectValue != null); 284Debug.Assert(holder != null, "[TypedReferenceBuilder.ctor]holder!=null"); 285Debug.Assert(holder.RequiresValueTypeFixup, "[TypedReferenceBuilder.ctor]holder.RequiresValueTypeFixup"); 313Debug.Assert(tempHolder != null); 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"); 443Debug.Assert(holderValue != null); 499Debug.Assert(holder.ObjectValue is Array); 510Debug.Assert(fixupInfo is MemberInfo); 596Debug.Assert(temp != null); 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\SerializationFieldInfo.cs (2)
17Debug.Assert(field != null); 18Debug.Assert(namePrefix != null);
System\Runtime\Serialization\SurrogateSelector.cs (3)
26Debug.Assert(selector != null, "[HasCycle]selector!=null"); 122Debug.Assert(tempPrev != null); 182Debug.Assert(type != null);
System.Runtime.Serialization.Schema (34)
System\Runtime\Serialization\Schema\CodeExporter.cs (31)
262Debug.Assert(classContract.Is(DataContractType.ClassDataContract)); 314Debug.Assert(contractCodeDomInfo.TypeReference != null); 577Debug.Assert(typeReference != null); 602Debug.Assert(collectionContract.Is(DataContractType.CollectionDataContract)); 631Debug.Assert(collectionContract.Is(DataContractType.CollectionDataContract)); 649Debug.Assert(collectionContract.Is(DataContractType.CollectionDataContract)); 661Debug.Assert(itemContract != null); 662Debug.Assert(itemContract.DataMembers.Count >= 2); 780Debug.Assert(classDataContract.Is(DataContractType.ClassDataContract)); 787Debug.Assert(contractCodeDomInfo.TypeDeclaration != null); 821Debug.Assert(baseContractCodeDomInfo.IsProcessed, "Cannot generate code for type if code for base type has not been generated"); 827Debug.Assert(actualType != null); // If we're in this if condition, then we should be able to get a Type 935Debug.Assert(classDataContract.Is(DataContractType.ClassDataContract)); 972Debug.Assert(classDataContract.Is(DataContractType.ClassDataContract)); 973Debug.Assert(classDataContract.KnownDataContracts != null); 985Debug.Assert(classDataContract.Is(DataContractType.ClassDataContract)); 995Debug.Assert(contractCodeDomInfo.TypeDeclaration != null); 1060Debug.Assert(enumDataContract.Is(DataContractType.EnumDataContract)); 1067Debug.Assert(contractCodeDomInfo.TypeDeclaration != null); 1109Debug.Assert(classDataContract.Is(DataContractType.ClassDataContract)); 1123Debug.Assert(contractCodeDomInfo.TypeDeclaration != null); 1159Debug.Assert(actualType != null); // If we're in this if condition, then we should be able to get a Type 1169Debug.Assert(keyValueContract == null || keyValueContract.Is(DataContractType.ClassDataContract)); 1191Debug.Assert(collectionContract.Is(DataContractType.CollectionDataContract)); 1237Debug.Assert(contractCodeDomInfo.TypeDeclaration != null); 1250Debug.Assert(keyName != null); 1251Debug.Assert(valueName != null); 1268Debug.Assert(contractCodeDomInfo.TypeDeclaration != null); 1374Debug.Assert(contractCodeDomInfo.TypeDeclaration != null); 1495Debug.Assert(clrNamespace != null); 1496Debug.Assert(codeNamespace != null);
System\Runtime\Serialization\Schema\ContractCodeDomInfo.cs (1)
60Debug.Assert(!names.Contains(memberName));
System\Runtime\Serialization\Schema\DiagnosticUtility.cs (1)
70Debug.Assert(condition, message);
System\Runtime\Serialization\Schema\XsdDataContractImporter.cs (1)
140Debug.Assert(elementNames != null && elementNames.Count > 0);
System.Security.Cryptography (616)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
69Debug.Assert(passwd.Name != null);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs (2)
66Debug.Assert(bytesNeeded != 0, "OBJ_obj2txt reported a zero-length response"); 86Debug.Assert(
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs (1)
156Debug.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 (5)
46Debug.Assert(size * 2 < DsaEncodedSignatureSize(dsa)); 92Debug.Assert( 181Debug.Assert(i >= 0); 194Debug.Assert(value1 >= 0); 195Debug.Assert(value2 >= 0);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Encode.cs (2)
43Debug.Assert(size == size2); 79Debug.Assert(size == size2);
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.EVP.Kdf.cs (4)
87Debug.Assert(ret == 0); 112Debug.Assert(ret == 0); 137Debug.Assert(ret == 0); 165Debug.Assert(ret == 0);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EVP.KdfAlgs.cs (1)
41Debug.Assert(kdf.IsInvalid);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EVP.Mac.cs (6)
83Debug.Assert(ret == 0); 95Debug.Assert(ret == 0); 107Debug.Assert(ret == 0); 136Debug.Assert(ret == 0); 148Debug.Assert(ret == 0); 160Debug.Assert(ret == 0);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EVP.MacAlgs.cs (1)
38Debug.Assert(mac.IsInvalid);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EvpPkey.cs (8)
160Debug.Assert(written == size); 211Debug.Assert(written == size); 233Debug.Assert(engineName is not null); 234Debug.Assert(keyName is not null); 263Debug.Assert(engineName is not null); 264Debug.Assert(keyName is not null); 303Debug.Assert(evpPKeyHandle == IntPtr.Zero && extraHandle == IntPtr.Zero, "both handles should be null if provider is not supported"); 309Debug.Assert(evpPKeyHandle == IntPtr.Zero, "extraHandle should not be null if evpPKeyHandle is not null");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EvpPkey.Ecdh.cs (5)
24Debug.Assert(pkey != null); 25Debug.Assert(!pkey.IsInvalid); 26Debug.Assert(peerKey != null); 27Debug.Assert(!peerKey.IsInvalid); 38Debug.Assert(written == 0);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EvpPkey.EcDsa.cs (2)
38Debug.Assert(written == -1); 77Debug.Assert(ret == -1);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EvpPkey.MLDsa.cs (1)
65Debug.Assert(handle != null, "handle != null");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EvpPkey.Rsa.cs (5)
19Debug.Assert(rsa != IntPtr.Zero); 78Debug.Assert(written == -1); 115Debug.Assert(written == -1); 156Debug.Assert(written == -1); 205Debug.Assert(ret == -1);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EvpPkey.SlhDsa.cs (1)
21Debug.Assert(handle != null, "handle != null");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Hmac.cs (1)
50Debug.Assert(result == 0);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.RAND.cs (1)
13Debug.Assert(count >= 0);
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\SafeDsaHandle.Unix.cs (1)
32Debug.Assert(handle != IntPtr.Zero);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeEcKeyHandle.Unix.cs (1)
32Debug.Assert(handle != IntPtr.Zero);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (3)
41Debug.Assert(currentHandle.IsInvalid); 51Debug.Assert(handle != null); 53Debug.Assert(!isCachedInvalidHandle || handle.IsInvalid, "The cached invalid handle must still be invalid.");
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (1)
46Debug.Assert(addedRef);
src\libraries\Common\src\System\HexConverter.cs (3)
167Debug.Assert(chars.Length >= bytes.Length * 2); 359Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 360Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (1)
32Debug.Assert(task.IsCompletedSuccessfully);
src\libraries\Common\src\System\Security\Cryptography\AesGcm.cs (1)
304Debug.Assert(tagSizeInBytes.IsLegalSize(TagByteSizes));
src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs12\PfxAsn.manual.cs (2)
19Debug.Assert(MacData.HasValue); 59Debug.Assert((uint)expectedOutputSize <= 64); // SHA512 is the largest digest size we know about
src\libraries\Common\src\System\Security\Cryptography\AsymmetricAlgorithmHelpers.Der.cs (1)
54Debug.Assert(payloadLength >= 0);
src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsa.cs (5)
656Debug.Assert(read == source.Length); 846Debug.Assert(read == source.Length); 1704Debug.Assert(writer.GetEncodedLength() <= capacity); 1729Debug.Assert(initialSize > 0); 1762Debug.Assert(algorithm is not null, "Algorithm identifier should have been pre-validated by KeyFormatHelper.");
src\libraries\Common\src\System\Security\Cryptography\CryptographicAttributeObjectCollection.cs (1)
80Debug.Assert(attribute != null);
src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (3)
17Debug.Assert(arraySegment.Array != null); 18Debug.Assert(arraySegment.Offset == 0); 25Debug.Assert(clearSize <= array.Length);
src\libraries\Common\src\System\Security\Cryptography\DSAOpenSsl.cs (1)
246Debug.Assert(bytesWritten == p1363SignatureSize);
src\libraries\Common\src\System\Security\Cryptography\EccKeyFormatHelper.cs (7)
167Debug.Assert((x == null) == (y == null)); 538Debug.Assert(oid.FriendlyName != null); 546Debug.Assert(ecParameters.Curve.IsPrime || ecParameters.Curve.IsCharacteristic2); 588Debug.Assert(ecParameters.Curve.IsCharacteristic2); 614Debug.Assert(k2 < 0); 615Debug.Assert(k1 > 0); 853Debug.Assert(ecParameters.Q.Y != null);
src\libraries\Common\src\System\Security\Cryptography\ECDiffieHellmanDerivation.cs (11)
23Debug.Assert(otherPartyPublicKey != null); 24Debug.Assert(!string.IsNullOrEmpty(hashAlgorithm.Name)); 32Debug.Assert(secretAgreement == null); 48Debug.Assert(otherPartyPublicKey != null); 49Debug.Assert(!string.IsNullOrEmpty(hashAlgorithm.Name)); 63Debug.Assert(hmacKey != null); 82Debug.Assert(secretAgreement == null); 109Debug.Assert(otherPartyPublicKey != null); 121Debug.Assert(secretAgreement != null); 151Debug.Assert(ret.Length == OutputSize); 198Debug.Assert(hashOutputSize is Sha1Size or Md5Size);
src\libraries\Common\src\System\Security\Cryptography\ECDiffieHellmanOpenSsl.Derive.cs (3)
79Debug.Assert(secretAgreement is not null); 88Debug.Assert(otherPartyPublicKey != null); 89Debug.Assert(_key is not null); // Callers should validate prior.
src\libraries\Common\src\System\Security\Cryptography\ECDsaOpenSsl.cs (1)
132Debug.Assert(bytesWritten == encodedSize);
src\libraries\Common\src\System\Security\Cryptography\ECOpenSsl.cs (5)
46Debug.Assert(currentKey != null, "key is null"); 53Debug.Assert(key != null); 54Debug.Assert(!key.IsInvalid); 55Debug.Assert(!key.IsClosed); 121Debug.Assert(keySize == createdKeySize);
src\libraries\Common\src\System\Security\Cryptography\ECOpenSsl.ImportExport.cs (4)
109Debug.Assert(parameters.Curve.IsNamed); 126Debug.Assert(parameters.Curve.IsPrime); 146Debug.Assert(parameters.Curve.IsCharacteristic2); 232Debug.Assert(curveName != null);
src\libraries\Common\src\System\Security\Cryptography\KeyBlobHelpers.cs (1)
71Debug.Assert(!integer.IsEmpty);
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\MLDsa.cs (2)
911Debug.Assert(read == source.Length); 1475Debug.Assert(writer.GetEncodedLength() <= capacity);
src\libraries\Common\src\System\Security\Cryptography\MLDsaImplementation.cs (1)
28Debug.Assert(key is not MLDsaImplementation);
src\libraries\Common\src\System\Security\Cryptography\MLKem.cs (3)
1175Debug.Assert(read == source.Length); 1237Debug.Assert(read == source.Length); 1666Debug.Assert(algorithm is not null, "Algorithm identifier should have been pre-validated by KeyFormatHelper.");
src\libraries\Common\src\System\Security\Cryptography\MLKemImplementation.cs (1)
19Debug.Assert(key is not (MLKemImplementation or MLKemOpenSsl));
src\libraries\Common\src\System\Security\Cryptography\Oids.Shared.cs (2)
82Debug.Assert(oidValue != null); 163Debug.Assert(oid is not null);
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (15)
29Debug.Assert(pbeParameters != null); 32Debug.Assert(pbeParameters.IterationCount > 0); 75Debug.Assert(destination.Length >= encryptedData.Length); 148Debug.Assert(digestAlgorithmName.Name != null); 149Debug.Assert(cipher != null); 201Debug.Assert(written == buf.Length); 238Debug.Assert(pbeParameters != null); 305Debug.Assert(hmacOid == Oids.HmacWithSha1 || !isPkcs12); 353Debug.Assert(password.Length > 0 || passwordBytes.IsEmpty); 354Debug.Assert(pbeParameters.HashAlgorithm == HashAlgorithmName.SHA1); 378Debug.Assert(pwdTmpBytes!.Length == passwordBytes.Length); 393Debug.Assert(pwdTmpBytes!.Length == 0); 406Debug.Assert(encryptor.CanTransformMultipleBlocks); 486Debug.Assert(written == buf.Length); 940Debug.Assert(decryptor.CanTransformMultipleBlocks);
src\libraries\Common\src\System\Security\Cryptography\PemKeyHelpers.Factory.cs (2)
84Debug.Assert(bytesWritten == base64size); 149Debug.Assert(bytesWritten == base64size);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Builder.cs (1)
197Debug.Assert(macKey.Length <= 128);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeBag.cs (1)
37Debug.Assert(value != null);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeContents.cs (3)
358Debug.Assert(pbeParameters != null); 359Debug.Assert(pbeParameters.IterationCount >= 1); 442Debug.Assert(ConfidentialityMode == Pkcs12ConfidentialityMode.None);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeContentsBag.cs (2)
26Debug.Assert(copyFrom != null); 27Debug.Assert(copyFrom.ConfidentialityMode == Pkcs12ConfidentialityMode.None);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SecretBag.cs (1)
52Debug.Assert(secretTypeOid != null && secretTypeOid.Value != null);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs8PrivateKeyInfo.cs (3)
51Debug.Assert(algorithmId != null); 188Debug.Assert(!ret.PrivateKeyBytes.Span.Overlaps(decryptedMemory.Span)); 219Debug.Assert(!ret.PrivateKeyBytes.Span.Overlaps(decryptedMemory.Span));
src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (5)
86Debug.Assert(iterationCount >= 1); 104Debug.Assert(v <= 1024); 238Debug.Assert(into.Length == addend.Length); 252Debug.Assert(bytes.Length > 0); 273Debug.Assert(destination.Length % 2 == 0);
src\libraries\Common\src\System\Security\Cryptography\RSAKeyFormatHelper.cs (1)
210Debug.Assert(copyFrom == null || pkcs1PrivateKey.IsEmpty);
src\libraries\Common\src\System\Security\Cryptography\RSAOpenSsl.cs (13)
174Debug.Assert(!key.IsInvalid); 193Debug.Assert(padding.OaepHashAlgorithm.Name != null); 260Debug.Assert(padding.OaepHashAlgorithm.Name != null); 271Debug.Assert(written == rsaSize); 389Debug.Assert(read == spki.Length); 400Debug.Assert(read == spki.Length); 443Debug.Assert(read == spki.Length); 547Debug.Assert(!newKey.IsInvalid); 594Debug.Assert(!newKey.IsInvalid); 770Debug.Assert(bytesWritten == bytesRequired); 812Debug.Assert(read == pkcs8.Length); 865Debug.Assert(padding == RSASignaturePadding.Pkcs1); 869Debug.Assert(padding == RSASignaturePadding.Pss);
src\libraries\Common\src\System\Security\Cryptography\RsaPaddingProcessor.cs (13)
182Debug.Assert(source.Length > 11); 206Debug.Assert(lenIfBad < 0); 234Debug.Assert((selector | (selector - 1)) == -1); 321Debug.Assert(hasher.HashLengthInBytes == hLen); 357Debug.Assert(hLen is >= 0 and <= 64); 426Debug.Assert(hasher.HashLengthInBytes == hLen); 428Debug.Assert(hLen is >= 0 and <= 64); 486Debug.Assert(em.Length >= emLen); 526Debug.Assert(hasher.HashLengthInBytes == hLen); 564Debug.Assert(hLen is >= 0 and <= 64); 609Debug.Assert(bytesWritten == hLen); 614Debug.Assert(hLen is >= 0 and <= 64); 623Debug.Assert(bytesWritten == hLen);
src\libraries\Common\src\System\Security\Cryptography\SlhDsa.cs (7)
653Debug.Assert(secretKeySizeInBytes is <= 128); 678Debug.Assert(writer.GetEncodedLength() <= capacity); 1224Debug.Assert(read == source.Length); 1304Debug.Assert(read == source.Length); 1868Debug.Assert(publicKeySizeInBytes is <= 64); 1889Debug.Assert(writer.GetEncodedLength() <= capacity); 1986Debug.Assert(algorithm is not null, "Algorithm identifier should have been pre-validated by KeyFormatHelper.");
src\libraries\Common\src\System\Security\Cryptography\SlhDsaImplementation.cs (2)
25Debug.Assert(key is not SlhDsaImplementation); 26Debug.Assert(key.Algorithm.SecretKeySizeInBytes <= 128);
src\libraries\Common\src\System\Security\Cryptography\SP800108HmacCounterKdfImplementationManaged.cs (2)
81Debug.Assert(current > 0); 94Debug.Assert(newReferenceCount >= 0, newReferenceCount.ToString());
src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.cs (2)
567Debug.Assert(rented is null != mapped is null); 641Debug.Assert(decoded.HasValue);
src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.Pkcs12.cs (10)
664Debug.Assert(_decryptBuffer.Length >= upperBound); 673Debug.Assert(_decryptBuffer is not null); 674Debug.Assert(_decryptBuffer.Length - _decryptBufferOffset >= encryptedContent.Length); 740Debug.Assert(_certBags is not null); 749Debug.Assert(_keyBags is not null); 769Debug.Assert(_keyBags is not null); 857Debug.Assert(decrypted.Array is not null); 858Debug.Assert(_keyDecryptBuffer.Length - _keyDecryptBufferOffset >= decrypted.Count); 886Debug.Assert(_certBags is not null); 887Debug.Assert(_keyBags is not null);
src\libraries\Common\src\System\Text\UrlBase64Encoding.cs (2)
26Debug.Assert(charsWritten == base64Len); 65Debug.Assert(source[0] == '=');
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 281Debug.Assert(additionalCapacityBeyondPos > 0); 282Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (1)
101Debug.Assert(passwd.HomeDirectory != null);
System\Security\Cryptography\AesCcm.OpenSsl.cs (1)
22Debug.Assert(_keyBox is null);
System\Security\Cryptography\AesImplementation.cs (1)
18Debug.Assert(_keyBox is not null);
System\Security\Cryptography\AsnFormatter.cs (2)
21Debug.Assert(sArray != null && sArray.Length != 0); 41Debug.Assert(j == hexOrder.Length);
System\Security\Cryptography\AsymmetricAlgorithmHelpers.Der.cs (3)
34Debug.Assert(input.Length % 2 == 0); 35Debug.Assert(input.Length > 1); 67Debug.Assert(destination.Length >= encodedSize);
System\Security\Cryptography\AsymmetricSignatureDeformatter.cs (1)
20Debug.Assert(hash.Hash != null);
System\Security\Cryptography\AsymmetricSignatureFormatter.cs (1)
20Debug.Assert(hash.Hash != null);
System\Security\Cryptography\Base64Transforms.cs (11)
53Debug.Assert(status == OperationStatus.Done); 54Debug.Assert(consumed == input.Length); 55Debug.Assert(written == output.Length); 78Debug.Assert(written == output.Length); 79Debug.Assert(status == OperationStatus.Done); 80Debug.Assert(consumed == inputCount); 226Debug.Assert(written == outputSize); 295Debug.Assert(bytesToTransform >= 4); 300Debug.Assert(_inputIndex < _inputBuffer.Length); 308Debug.Assert(consumed == bytesToTransform); 312Debug.Assert(status == OperationStatus.InvalidData);
System\Security\Cryptography\CapiHelper.DSA.Shared.cs (3)
132Debug.Assert(dsaParameters.Y != null); 162Debug.Assert(cspPublicBlob == null); 299Debug.Assert(dsaParameters.Y.Length > 0);
System\Security\Cryptography\CngAlgorithm.cs (3)
57Debug.Assert(_algorithm != null); 74Debug.Assert(_algorithm != null); 80Debug.Assert(_algorithm != null);
System\Security\Cryptography\CngAlgorithmGroup.cs (3)
58Debug.Assert(_algorithmGroup != null); 75Debug.Assert(_algorithmGroup != null); 81Debug.Assert(_algorithmGroup != null);
System\Security\Cryptography\CngKeyBlobFormat.cs (3)
58Debug.Assert(_format != null); 75Debug.Assert(_format != null); 81Debug.Assert(_format != null);
System\Security\Cryptography\CngProvider.cs (3)
55Debug.Assert(_provider != null); 72Debug.Assert(_provider != null); 78Debug.Assert(_provider != null);
System\Security\Cryptography\CryptoConfig.cs (3)
101Debug.Assert(ht.Count <= capacity); // if more entries are added in the future, increase initial capacity. 279Debug.Assert(ht.Count <= capacity); // // if more entries are added in the future, increase initial capacity. 608Debug.Assert(encodedOidNumsIndex == encodedOidNumsLength);
System\Security\Cryptography\CryptographicOperations.cs (17)
119Debug.Assert(hashAlgorithm.Name is not null); 123Debug.Assert(written == hashSizeInBytes); 188Debug.Assert(hashAlgorithm.Name is not null); 197Debug.Assert(bytesWritten == hashSizeInBytes); 230Debug.Assert(hashAlgorithm.Name is not null); 266Debug.Assert(hashAlgorithm.Name is not null); 270Debug.Assert(written == hashSizeInBytes); 316Debug.Assert(hashAlgorithm.Name is not null); 364Debug.Assert(hashAlgorithm.Name is not null); 423Debug.Assert(hashAlgorithm.Name is not null); 427Debug.Assert(written == hashSizeInBytes); 503Debug.Assert(hashAlgorithm.Name is not null); 512Debug.Assert(bytesWritten == hashSizeInBytes); 578Debug.Assert(hashAlgorithm.Name is not null); 616Debug.Assert(hashAlgorithm.Name is not null); 708Debug.Assert(hashAlgorithm.Name is not null); 754Debug.Assert(hashAlgorithm.Name is not null);
System\Security\Cryptography\CryptoStream.cs (11)
144Debug.Assert(_outputBufferIndex == 0, "The output index can only ever be non-zero when in read mode."); 265Debug.Assert(_outputBuffer != null); 296Debug.Assert(completedValueTask.IsCompleted); 328Debug.Assert(_outputBufferIndex == 0); 331Debug.Assert(_inputBufferIndex == 0); 543Debug.Assert(_inputBuffer != null); 563Debug.Assert(_outputBufferIndex == 0, "The output index can only ever be non-zero when in read mode."); 569Debug.Assert(_inputBuffer != null && _outputBuffer != null); 624Debug.Assert(_outputBuffer != null); 639Debug.Assert(_inputBuffer != null); 654Debug.Assert(segment.Array is not null);
System\Security\Cryptography\CspParameters.cs (1)
31Debug.Assert((CspProviderFlags.UseMachineKeyStore |
System\Security\Cryptography\DSA.cs (1)
883Debug.Assert(tmp.Length == HashBufferStackSize);
System\Security\Cryptography\DSA.Xml.cs (1)
106Debug.Assert(keyParameters.P != null);
System\Security\Cryptography\DSAWrapper.cs (1)
16Debug.Assert(wrapped != null);
System\Security\Cryptography\ECCurve.cs (1)
242Debug.Assert(CurveType == ECCurveType.Implicit);
System\Security\Cryptography\ECDiffieHellmanWrapper.cs (2)
14Debug.Assert(wrapped != null); 179Debug.Assert(wrapped != null);
System\Security\Cryptography\ECDsa.cs (1)
1203Debug.Assert(tmp.Length == HashBufferStackSize);
System\Security\Cryptography\ECDsaWrapper.cs (1)
16Debug.Assert(wrapped != null);
System\Security\Cryptography\HashProvider.cs (1)
45Debug.Assert(written == HashSizeInBytes);
System\Security\Cryptography\HashProviderDispenser.OpenSsl.cs (3)
41Debug.Assert(macHandle is not null); 48Debug.Assert(evpType != IntPtr.Zero); 55Debug.Assert(ret == 0);
System\Security\Cryptography\HashProviderDispenser.Unix.cs (5)
41Debug.Assert(evpType != IntPtr.Zero); 52Debug.Assert(written == hashSize); 59Debug.Assert(evpType != IntPtr.Zero); 75Debug.Assert(ret == 0); 79Debug.Assert(length == hashSize);
System\Security\Cryptography\Helpers.cs (2)
129Debug.Assert(index < cbHex); 140Debug.Assert(index == cbHex);
System\Security\Cryptography\HKDF.cs (2)
154Debug.Assert(hashLength <= 512 / 8, "hashLength is larger than expected, consider increasing this value or using regular allocation"); 187Debug.Assert(hashLength <= 512 / 8, "hashLength is larger than expected, consider increasing this value or using regular allocation");
System\Security\Cryptography\HKDF.OpenSsl.cs (6)
21Debug.Assert(Interop.Crypto.EvpKdfAlgs.Hkdf is not null); 22Debug.Assert(hashAlgorithmName.Name is not null); 41Debug.Assert(Interop.Crypto.EvpKdfAlgs.Hkdf is not null); 42Debug.Assert(hashAlgorithmName.Name is not null); 62Debug.Assert(Interop.Crypto.EvpKdfAlgs.Hkdf is not null); 63Debug.Assert(hashAlgorithmName.Name is not null);
System\Security\Cryptography\HKDFManagedImplementation.cs (3)
14Debug.Assert(Helpers.HashLength(hashAlgorithmName) == hashLength); 21Debug.Assert(Helpers.HashLength(hashAlgorithmName) == hashLength); 69Debug.Assert(hashLength <= 512 / 8, "hashLength is larger than expected, consider increasing this value or using regular allocation");
System\Security\Cryptography\HMACCommon.cs (7)
30Debug.Assert(!string.IsNullOrEmpty(hashAlgorithmId)); 31Debug.Assert(blockSize > 0 || blockSize == -1); 44Debug.Assert(!string.IsNullOrEmpty(hashAlgorithmId)); 45Debug.Assert(blockSize is > 0 or -1); 83Debug.Assert(SHA3_256.IsSupported); 87Debug.Assert(SHA3_384.IsSupported); 91Debug.Assert(SHA3_512.IsSupported);
System\Security\Cryptography\HMACMD5.cs (3)
48Debug.Assert(HashSizeValue == HashSizeInBits); 109Debug.Assert(written == buffer.Length); 159Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\HMACSHA1.cs (3)
47Debug.Assert(HashSizeValue == HashSizeInBits); 113Debug.Assert(written == buffer.Length); 161Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\HMACSHA256.cs (3)
46Debug.Assert(HashSizeValue == HashSizeInBits); 105Debug.Assert(written == buffer.Length); 153Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\HMACSHA3_256.cs (3)
68Debug.Assert(HashSizeValue == _hMacCommon.HashSizeInBits); 141Debug.Assert(written == buffer.Length); 191Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\HMACSHA3_384.cs (3)
68Debug.Assert(HashSizeValue == _hMacCommon.HashSizeInBits); 141Debug.Assert(written == buffer.Length); 191Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\HMACSHA3_512.cs (3)
68Debug.Assert(HashSizeValue == _hMacCommon.HashSizeInBits); 141Debug.Assert(written == buffer.Length); 191Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\HMACSHA384.cs (3)
45Debug.Assert(HashSizeValue == HashSizeInBits); 122Debug.Assert(written == buffer.Length); 170Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\HMACSHA512.cs (2)
119Debug.Assert(written == buffer.Length); 167Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\IncrementalHash.cs (15)
30Debug.Assert(!string.IsNullOrEmpty(name.Name)); 31Debug.Assert(hash != null); 40Debug.Assert(!string.IsNullOrEmpty(name.Name)); 41Debug.Assert(hmac != null); 104Debug.Assert((_hash != null) ^ (_hmac != null)); 128Debug.Assert(written == HashLengthInBytes); 175Debug.Assert(destination.Length >= HashLengthInBytes); 177Debug.Assert((_hash != null) ^ (_hmac != null)); 200Debug.Assert(written == HashLengthInBytes); 265Debug.Assert(destination.Length >= HashLengthInBytes); 267Debug.Assert((_hash != null) ^ (_hmac != null)); 282Debug.Assert((_hash != null) ^ (_hmac != null)); 395Debug.Assert(!HMACSHA3_256.IsSupported); 398Debug.Assert(!HMACSHA3_384.IsSupported); 401Debug.Assert(!HMACSHA3_512.IsSupported);
System\Security\Cryptography\Kmac128.cs (4)
112Debug.Assert(written == outputLength); 130Debug.Assert(written == destination.Length); 153Debug.Assert(written == outputLength); 170Debug.Assert(written == destination.Length);
System\Security\Cryptography\Kmac256.cs (4)
112Debug.Assert(written == outputLength); 130Debug.Assert(written == destination.Length); 153Debug.Assert(written == outputLength); 170Debug.Assert(written == destination.Length);
System\Security\Cryptography\KmacXof128.cs (4)
112Debug.Assert(written == outputLength); 130Debug.Assert(written == destination.Length); 153Debug.Assert(written == outputLength); 170Debug.Assert(written == destination.Length);
System\Security\Cryptography\KmacXof256.cs (4)
112Debug.Assert(written == outputLength); 130Debug.Assert(written == destination.Length); 153Debug.Assert(written == outputLength); 170Debug.Assert(written == destination.Length);
System\Security\Cryptography\LiteHash.OpenSsl.cs (1)
40Debug.Assert(!algorithm.IsInvalid);
System\Security\Cryptography\LiteHash.Unix.cs (13)
40Debug.Assert(algorithm != IntPtr.Zero); 109Debug.Assert(result == 0); 125Debug.Assert(algorithm != IntPtr.Zero); 159Debug.Assert(destination.Length >= _hashSizeInBytes); 164Debug.Assert(length == _hashSizeInBytes); 177Debug.Assert(length == _hashSizeInBytes); 199Debug.Assert(result == 0); 214Debug.Assert(algorithm != IntPtr.Zero); 245Debug.Assert(destination.Length >= _hashSizeInBytes); 249Debug.Assert(length == _hashSizeInBytes); 255Debug.Assert(destination.Length >= _hashSizeInBytes); 259Debug.Assert(length == _hashSizeInBytes); 286Debug.Assert(result == 0);
System\Security\Cryptography\LiteHashProvider.cs (3)
24Debug.Assert(written == hashSizeInBytes); 76Debug.Assert(written == hashSizeInBytes); 179Debug.Assert(written == result.Length);
System\Security\Cryptography\LiteHashProvider.Xof.cs (4)
17Debug.Assert(written == destination.Length); 25Debug.Assert(written == outputLength); 39Debug.Assert(written == destination.Length); 53Debug.Assert(written == outputLength);
System\Security\Cryptography\MD5.cs (2)
71Debug.Assert(written == buffer.Length); 117Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\MLDsaImplementation.OpenSsl.cs (3)
23Debug.Assert(key is not null); 24Debug.Assert(!key.IsInvalid); 25Debug.Assert(SupportsAny());
System\Security\Cryptography\MLKemImplementation.OpenSsl.cs (7)
32Debug.Assert(IsSupported); 40Debug.Assert(IsSupported); 41Debug.Assert(source.Length == algorithm.PrivateSeedSizeInBytes); 49Debug.Assert(IsSupported); 50Debug.Assert(source.Length == algorithm.DecapsulationKeySizeInBytes); 58Debug.Assert(IsSupported); 59Debug.Assert(source.Length == algorithm.EncapsulationKeySizeInBytes);
System\Security\Cryptography\Oid.cs (2)
140Debug.Assert(value != null); 141Debug.Assert(friendlyName != null);
System\Security\Cryptography\OidCollection.cs (1)
21Debug.Assert(initialCapacity >= 0);
System\Security\Cryptography\OidLookup.OpenSsl.cs (1)
26Debug.Assert(friendlyNamePtr != IntPtr.Zero);
System\Security\Cryptography\OpenSslCipher.cs (4)
44Debug.Assert(input.Length > 0); 45Debug.Assert((input.Length % PaddingSizeInBytes) == 0); 51Debug.Assert((input.Length % PaddingSizeInBytes) == 0); 52Debug.Assert(input.Length <= output.Length);
System\Security\Cryptography\OpenSslCipherLite.cs (1)
32Debug.Assert(algorithm != IntPtr.Zero);
System\Security\Cryptography\PasswordDeriveBytes.cs (1)
201Debug.Assert(_hash != null);
System\Security\Cryptography\Pbkdf2Implementation.OpenSsl.cs (2)
17Debug.Assert(!destination.IsEmpty); 18Debug.Assert(hashAlgorithmName.Name is not null);
System\Security\Cryptography\PemEncoding.cs (11)
235Debug.Assert(destination.Length >= size); 246Debug.Assert(startPosition <= str.Length); 389Debug.Assert(Utf16PemEncoder.PostEBPrefix.Length == Utf8PemEncoder.PostEBPrefix.Length); 390Debug.Assert(Utf16PemEncoder.PreEBPrefix.Length == Utf8PemEncoder.PreEBPrefix.Length); 391Debug.Assert(Utf16PemEncoder.Ending.Length == Utf8PemEncoder.Ending.Length); 472Debug.Assert(encodedSize == charsWritten); 535Debug.Assert(encodedSize == bytesWritten); 584Debug.Assert(byteWritten == encodedSize); 614Debug.Assert(remainingData.Length < BytesPerLine); 668Debug.Assert(charsWritten == encodedSize); 792Debug.Assert(bytesConsumed == bytes.Length);
System\Security\Cryptography\PemKeyHelpers.cs (2)
150Debug.Assert(bytesWritten == base64size); 236Debug.Assert(bytesWritten == base64size);
System\Security\Cryptography\PKCS1MaskGenerationMethod.cs (1)
46Debug.Assert(hasher.Hash != null);
System\Security\Cryptography\RandomNumberGenerator.cs (2)
308Debug.Assert(!destination.IsEmpty); 351Debug.Assert(choices.Length > 0);
System\Security\Cryptography\RandomNumberGeneratorImplementation.OpenSsl.cs (1)
12Debug.Assert(count > 0);
System\Security\Cryptography\RC2Implementation.cs (5)
78Debug.Assert(EffectiveKeySize == KeySize); 91Debug.Assert(EffectiveKeySize == KeySize); 115Debug.Assert(EffectiveKeySize == KeySize); 140Debug.Assert(EffectiveKeySize == KeySize); 165Debug.Assert(EffectiveKeySize == KeySize);
System\Security\Cryptography\Rfc2898DeriveBytes.cs (5)
185Debug.Assert(_blockSize > 0); 207Debug.Assert(_startIndex == 0 && _endIndex == 0, "Invalid start or end index in the internal buffer."); 290Debug.Assert(_blockSize == _buffer.Length); 300Debug.Assert(bytesWritten == _blockSize); 308Debug.Assert(bytesWritten == _blockSize);
System\Security\Cryptography\Rfc2898DeriveBytes.OneShot.cs (4)
268Debug.Assert(hashAlgorithm.Name is not null); 269Debug.Assert(iterations > 0); 309Debug.Assert(hashAlgorithm.Name is not null); 310Debug.Assert(iterations > 0);
System\Security\Cryptography\RijndaelImplementation.cs (1)
35Debug.Assert(BlockSizeValue == 128);
System\Security\Cryptography\RijndaelManaged.cs (1)
31Debug.Assert(BlockSizeValue == 128);
System\Security\Cryptography\RSAOpenSsl.cs (1)
48Debug.Assert(!pkey.IsInvalid);
System\Security\Cryptography\RSAWrapper.cs (1)
16Debug.Assert(wrapped != null);
System\Security\Cryptography\SHA1.cs (2)
68Debug.Assert(written == buffer.Length); 112Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\SHA256.cs (2)
67Debug.Assert(written == buffer.Length); 112Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\SHA3_256.cs (2)
93Debug.Assert(written == buffer.Length); 145Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\SHA3_384.cs (2)
93Debug.Assert(written == buffer.Length); 146Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\SHA3_512.cs (2)
93Debug.Assert(written == buffer.Length); 145Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\SHA384.cs (2)
67Debug.Assert(written == buffer.Length); 111Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\SHA512.cs (2)
67Debug.Assert(written == buffer.Length); 111Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\SlhDsaImplementation.OpenSsl.cs (14)
16Debug.Assert(key is not null); 17Debug.Assert(!key.IsInvalid); 18Debug.Assert(SupportsAny()); 31Debug.Assert(supportsSlhDsaSha2_128s == Interop.Crypto.EvpPKeySlhDsaAlgs.SlhDsaShake128s is not null); 32Debug.Assert(supportsSlhDsaSha2_128s == Interop.Crypto.EvpPKeySlhDsaAlgs.SlhDsaSha2_128f is not null); 33Debug.Assert(supportsSlhDsaSha2_128s == Interop.Crypto.EvpPKeySlhDsaAlgs.SlhDsaShake128f is not null); 34Debug.Assert(supportsSlhDsaSha2_128s == Interop.Crypto.EvpPKeySlhDsaAlgs.SlhDsaSha2_192s is not null); 35Debug.Assert(supportsSlhDsaSha2_128s == Interop.Crypto.EvpPKeySlhDsaAlgs.SlhDsaShake192s is not null); 36Debug.Assert(supportsSlhDsaSha2_128s == Interop.Crypto.EvpPKeySlhDsaAlgs.SlhDsaSha2_192f is not null); 37Debug.Assert(supportsSlhDsaSha2_128s == Interop.Crypto.EvpPKeySlhDsaAlgs.SlhDsaShake192f is not null); 38Debug.Assert(supportsSlhDsaSha2_128s == Interop.Crypto.EvpPKeySlhDsaAlgs.SlhDsaSha2_256s is not null); 39Debug.Assert(supportsSlhDsaSha2_128s == Interop.Crypto.EvpPKeySlhDsaAlgs.SlhDsaShake256s is not null); 40Debug.Assert(supportsSlhDsaSha2_128s == Interop.Crypto.EvpPKeySlhDsaAlgs.SlhDsaSha2_256f is not null); 41Debug.Assert(supportsSlhDsaSha2_128s == Interop.Crypto.EvpPKeySlhDsaAlgs.SlhDsaShake256f is not null);
System\Security\Cryptography\SP800108HmacCounterKdfImplementationManaged.cs (2)
33Debug.Assert(destination.Length <= 0x1FFFFFFF); 68Debug.Assert(hmacBufferWritten > destination.Length);
System\Security\Cryptography\SP800108HmacCounterKdfImplementationOpenSsl.cs (2)
29Debug.Assert(Interop.Crypto.EvpKdfAlgs.Kbkdf is { IsInvalid: false }); 79Debug.Assert(Interop.Crypto.EvpKdfAlgs.Kbkdf is { IsInvalid: false });
System\Security\Cryptography\SymmetricPadding.cs (1)
13Debug.Assert(plaintextLength >= 0);
System\Security\Cryptography\TripleDES.cs (4)
81Debug.Assert(start1 >= 0); 82Debug.Assert(start2 >= 0); 83Debug.Assert((start1 + count) <= rgbKey.Length); 84Debug.Assert((start2 + count) <= rgbKey.Length);
System\Security\Cryptography\UniversalCryptoDecryptor.cs (3)
54Debug.Assert(inputBuffer.Length >= _heldoverCipher.Length); 57Debug.Assert(inputBuffer.Length % InputBlockSize == 0, "Did not remove whole blocks for depadding"); 157Debug.Assert(written == buffer.Length);
System\Security\Cryptography\UniversalCryptoEncryptor.cs (3)
35Debug.Assert(!inputBuffer.Overlaps(outputBuffer)); 42Debug.Assert(padWritten == transformWritten); 52Debug.Assert(written == buffer.Length);
System\Security\Cryptography\UniversalCryptoOneShot.cs (4)
116Debug.Assert(input.Length > cipher.BlockSizeInBytes); 129Debug.Assert(paddedBlock.Length % cipher.BlockSizeInBytes == 0); 130Debug.Assert(paddedBlock.Length <= MaxInStackDecryptionBuffer); 231Debug.Assert(padWritten == bytesWritten);
System\Security\Cryptography\UniversalCryptoTransform.cs (1)
86Debug.Assert(numBytesWritten >= 0 && numBytesWritten <= inputCount);
System\Security\Cryptography\X509Certificates\CertCollectionLoader.cs (2)
28Debug.Assert(collection != null); 31Debug.Assert(localCerts != null);
System\Security\Cryptography\X509Certificates\CertificateRequest.cs (1)
638Debug.Assert(_generator != null);
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.cs (1)
31Debug.Assert(revoked != null);
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.Load.cs (1)
285Debug.Assert(bytesConsumed == bytesWritten);
System\Security\Cryptography\X509Certificates\ChainPal.OpenSsl.cs (2)
196Debug.Assert(reportedLeaf != null); 197Debug.Assert(!ReferenceEquals(cert, reportedLeaf.Pal));
System\Security\Cryptography\X509Certificates\ECDsaX509SignatureGenerator.cs (2)
16Debug.Assert(key != null); 100Debug.Assert(ecParameters.Q.X!.Length == ecParameters.Q.Y!.Length);
System\Security\Cryptography\X509Certificates\FindPal.cs (2)
32Debug.Assert(s_keyUsages.Count == NamedKeyUsageFlagsCount); 164Debug.Assert(findValue != null);
System\Security\Cryptography\X509Certificates\ManagedCertificateFinder.cs (2)
298Debug.Assert(written == SHA1.HashSizeInBytes); 348Debug.Assert(!ReferenceEquals(cert, clone));
System\Security\Cryptography\X509Certificates\MLDsaX509SignatureGenerator.cs (4)
16Debug.Assert(key != null); 34Debug.Assert(writer.GetEncodedLength() <= InitialCapacity); 48Debug.Assert(written == signature.Length); 57Debug.Assert(written == pkBytes.Length);
System\Security\Cryptography\X509Certificates\OpenSslCachedDirectoryStoreProvider.cs (1)
81Debug.Assert(ret != null);
System\Security\Cryptography\X509Certificates\OpenSslCachedSystemStoreProvider.cs (7)
108Debug.Assert(ret != null); 114Debug.Assert( 144Debug.Assert( 166Debug.Assert(s_rootStoreDirectories is not null); 167Debug.Assert(s_directoryLastWrite is not null); 309Debug.Assert( 364Debug.Assert(set.Count == 0);
System\Security\Cryptography\X509Certificates\OpenSslCrlCache.cs (1)
164Debug.Assert(
System\Security\Cryptography\X509Certificates\OpenSslDirectoryBasedStoreProvider.cs (4)
38Debug.Assert( 51Debug.Assert(!X509Store.DisallowedStoreName.Equals(storeName, StringComparison.OrdinalIgnoreCase)); 79Debug.Assert(collection != null); 335Debug.Assert(storeName != null);
System\Security\Cryptography\X509Certificates\OpenSslPkcsFormatReader.cs (1)
221Debug.Assert(readPals != null); // null if single == true
System\Security\Cryptography\X509Certificates\OpenSslSingleCertLoader.cs (2)
26Debug.Assert(collection != null); 29Debug.Assert(localCert != null);
System\Security\Cryptography\X509Certificates\OpenSslX509CertificateReader.cs (8)
35Debug.Assert(cert.Pal != null); 44Debug.Assert(password != null); 53Debug.Assert(cert is not null); 110Debug.Assert(bioPosition >= 0); 875Debug.Assert(bytes != null); 876Debug.Assert( 879Debug.Assert( 918Debug.Assert(exported != null);
System\Security\Cryptography\X509Certificates\OpenSslX509ChainProcessor.cs (8)
379Debug.Assert(revocationFlag == X509RevocationFlag.EntireChain); 482Debug.Assert(refErrors.HasRevocationUnknown()); 518Debug.Assert(chainSize == 1 || revocationFlag != X509RevocationFlag.EndCertificateOnly); 566Debug.Assert(workingChain.LastError <= start - 1); 676Debug.Assert(!verify, "verify should have returned false for signature error"); 690Debug.Assert(verify, "verify should have returned true"); 830Debug.Assert(baseUri.Length > 0); 831Debug.Assert(resource.Length > 0);
System\Security\Cryptography\X509Certificates\OpenSslX509Encoder.cs (1)
102Debug.Assert(bioPosition >= 0);
System\Security\Cryptography\X509Certificates\Pkcs10CertificationRequestInfo.cs (3)
40Debug.Assert(signatureGenerator != null); 41Debug.Assert(Subject != null); 42Debug.Assert(PublicKey != null);
System\Security\Cryptography\X509Certificates\RSAPkcs1X509SignatureGenerator.cs (1)
15Debug.Assert(key != null);
System\Security\Cryptography\X509Certificates\RSAPssX509SignatureGenerator.cs (3)
17Debug.Assert(key != null); 18Debug.Assert(padding != null); 19Debug.Assert(padding.Mode == RSASignaturePaddingMode.Pss);
System\Security\Cryptography\X509Certificates\SlhDsaX509SignatureGenerator.cs (2)
16Debug.Assert(key != null); 35Debug.Assert(writer.GetEncodedLength() <= InitialCapacity);
System\Security\Cryptography\X509Certificates\StorePal.cs (1)
58Debug.Assert(_coll is not null);
System\Security\Cryptography\X509Certificates\StorePal.OpenSsl.cs (5)
21Debug.Assert(password != null); 30Debug.Assert(singleCert != null); 40Debug.Assert(certPals != null); 79Debug.Assert(bioPosition >= 0); 153Debug.Assert(storeLocation == StoreLocation.LocalMachine);
System\Security\Cryptography\X509Certificates\UnixExportProvider.cs (2)
47Debug.Assert(password != null); 114Debug.Assert(_certs is not null);
System\Security\Cryptography\X509Certificates\X500DistinguishedNameBuilder.cs (1)
231Debug.Assert(written == 2);
System\Security\Cryptography\X509Certificates\X500NameEncoder.cs (11)
114Debug.Assert(dnSeparators.Length != 0); 288Debug.Assert(tagStart >= 0); 390Debug.Assert(hasTagOid); 391Debug.Assert(valueEnd != -1); 392Debug.Assert(valueStart != -1); 452Debug.Assert(!hadEscapedQuote); 459Debug.Assert(valueStart != -1); 460Debug.Assert(valueEnd != -1); 562Debug.Assert(destination.Length >= chars.Length); 577Debug.Assert(skippedQuote == (c == '"')); 641Debug.Assert(lookup.Count == LookupDictionarySize);
System\Security\Cryptography\X509Certificates\X500NameEncoder.ManagedDecode.cs (1)
151Debug.Assert(tavReader.RuleSet == AsnEncodingRules.DER);
System\Security\Cryptography\X509Certificates\X500RelativeDistinguishedName.cs (2)
64Debug.Assert(overlaps, "AsnValueReader.ReadEncodedValue returns a slice of the source"); 65Debug.Assert(offset > 0);
System\Security\Cryptography\X509Certificates\X509AuthorityInformationAccessExtension.cs (1)
179Debug.Assert(_decoded is not null);
System\Security\Cryptography\X509Certificates\X509Certificate.cs (1)
142Debug.Assert(pal != null);
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (6)
800Debug.Assert(!OperatingSystem.IsBrowser()); 802Debug.Assert(publicKey is not null); // The precondition check should ensure this is not null. 903Debug.Assert(!OperatingSystem.IsBrowser()); 1005Debug.Assert(!OperatingSystem.IsBrowser()); 1658Debug.Assert(rawSAN.GetType() == typeof(X509Extension)); 1694Debug.Assert(firstDot != 0, "Leading periods should have been rejected.");
System\Security\Cryptography\X509Certificates\X509Certificate2Enumerator.cs (1)
16Debug.Assert(collection != null);
System\Security\Cryptography\X509Certificates\X509CertificateLoader.netcore.cs (6)
26Debug.Assert(pal is not null); 35Debug.Assert(pal is not null); 48Debug.Assert(loaderLimits is not null); 72Debug.Assert(loaderLimits is not null); 132Debug.Assert(_pal is not null); 140Debug.Assert(_pal is not null);
System\Security\Cryptography\X509Certificates\X509CertificateLoader.OpenSsl.cs (4)
34Debug.Assert(bioPosition >= 0); 100Debug.Assert(impl is not null, "MLKem implementation is not handled for duplicating a handle."); 107Debug.Assert(impl is not null, "MLDsa implementation is not handled for duplicating a handle."); 114Debug.Assert(impl is not null, "SlhDsa implementation is not handled for duplicating a handle.");
System\Security\Cryptography\X509Certificates\X509CertificateLoader.Unix.cs (10)
57Debug.Assert(matchIndex >= 0); 152Debug.Assert(!string.IsNullOrEmpty(path)); 227Debug.Assert(safeBag.BagId == Oids.Pkcs12CertBag); 232Debug.Assert(certBag.CertId == Oids.Pkcs12X509CertBagType); 236Debug.Assert(pal is not null); 285Debug.Assert(safeBag.BagId == Oids.Pkcs12ShroudedKeyBag); 509Debug.Assert(sizeHint > 0); 574Debug.Assert(bytesRead == pkcs8.Length); 593Debug.Assert(_rented is null); 711Debug.Assert(bytesRead == pkcs8.Length);
System\Security\Cryptography\X509Certificates\X509Chain.cs (1)
31Debug.Assert(_pal != null);
System\Security\Cryptography\X509Certificates\X509ChainElementCollection.cs (1)
21Debug.Assert(chainElements != null);
System\Security\Cryptography\X509Certificates\X509Store.cs (1)
82Debug.Assert(_storePal != null);
System\Security\Cryptography\X509Certificates\X509SubjectAlternativeNameExtension.cs (1)
72Debug.Assert(value.Length is 4 or 16);
System\Security\Cryptography\X509Certificates\X509SubjectKeyIdentifierExtension.cs (2)
174Debug.Assert(written == SHA1.HashSizeInBytes); 211Debug.Assert(written >= TruncateSize);
System\Security\Cryptography\XmlKeyHelper.cs (4)
79Debug.Assert(buf != null); 124Debug.Assert(name.Length > 0); 125Debug.Assert(value.Length > 0); 126Debug.Assert(builder != null);
System.Security.Cryptography.Cose (42)
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\CoseHeaderMap.cs (2)
353Debug.Assert(!map.ContainsKey(CoseHeaderLabel.Algorithm)); 377Debug.Assert(bytesWritten == ComputeEncodedSize(map, algHeaderValueToSlip));
System\Security\Cryptography\Cose\CoseKey.cs (13)
195Debug.Assert(_ecdsaKey != null); 198Debug.Assert(_rsaKey != null); 199Debug.Assert(HashAlgorithm != null); 200Debug.Assert(RSASignaturePadding != null); 204Debug.Assert(_mldsaKey != null); 241Debug.Assert(_ecdsaKey != null); 246Debug.Assert(_rsaKey != null); 247Debug.Assert(RSASignaturePadding != null); 248Debug.Assert(HashAlgorithm != null); 254Debug.Assert(_mldsaKey != null); 268Debug.Assert(signaturePadding != null); 281Debug.Assert(signaturePadding == RSASignaturePadding.Pkcs1); 331Debug.Assert(HashAlgorithm != null);
System\Security\Cryptography\Cose\CoseMessage.cs (10)
161Debug.Assert(reader.BytesRemaining == 0); 246Debug.Assert(reader.BytesRemaining == 0); 401Debug.Assert(reader.BytesRemaining == 0); 497Debug.Assert(context == SigStructureContext.Signature1); 498Debug.Assert(signProtected.Length == 0); 509Debug.Assert(bytesWritten == ComputeToBeSignedEncodedSize(context, bodyProtected.Length, signProtected.Length, associatedData.Length, content.Length)); 528Debug.Assert(context == SigStructureContext.Signature1); 529Debug.Assert(signProtectedLength == 0); 566Debug.Assert(length > 0); 597Debug.Assert(bytesWritten == buffer.Length);
System\Security\Cryptography\Cose\CoseMultiSignMessage.cs (5)
215Debug.Assert(expectedSize == bytesWritten); 283Debug.Assert(buffer.Length == bytesWritten); 357Debug.Assert(expectedSize == bytesWritten); 510Debug.Assert(protectedHeadersSize == 1); 625Debug.Assert(bytesWritten == GetEncodedLength());
System\Security\Cryptography\Cose\CoseSign1Message.cs (6)
169Debug.Assert(contentStream == null || (isDetached && contentBytes.Length == 0)); 177Debug.Assert(expectedSize == bytesWritten); 226Debug.Assert(buffer.Length == bytesWritten); 288Debug.Assert(expectedSize == bytesWritten); 773Debug.Assert(contentStream == null || contentBytes.Length == 0); 1034Debug.Assert(bytesWritten == GetEncodedLength());
System\Security\Cryptography\Cose\CoseSignature.cs (1)
63Debug.Assert(_message != null);
System\Security\Cryptography\Cose\CoseSigner.cs (1)
176Debug.Assert(alg.HasValue, "Algorithm (alg) is a known header and should have been validated in Set[Encoded]Value()");
System\Security\Cryptography\Cose\HashToBeSignedBuilder.cs (1)
31Debug.Assert(_incrementalHash.HashLengthInBytes <= 512 / 8); // largest hash we can get (SHA512).
System\Security\Cryptography\Cose\PureDataToBeSignedBuilder.cs (1)
37Debug.Assert(_stream.Length <= int.MaxValue);
System.Security.Cryptography.Pkcs (97)
Internal\Cryptography\Pal\AnyOS\AsnHelpers.cs (1)
141Debug.Assert(asn.Parameters != null);
Internal\Cryptography\Pal\AnyOS\ManagedPal.cs (2)
35Debug.Assert(certificate != null); 161Debug.Assert(algorithmIdentifier != null);
Internal\Cryptography\Pal\AnyOS\ManagedPal.Decrypt.cs (2)
43Debug.Assert((cert != null) ^ (privateKey != null)); 136Debug.Assert(encoded[0] == 0x04);
Internal\Cryptography\Pal\AnyOS\ManagedPal.KeyTrans.cs (1)
99Debug.Assert(cert != null);
Internal\Cryptography\PkcsHelpers.cs (5)
32Debug.Assert(oid != null); 88Debug.Assert(arr != null); 89Debug.Assert(idx >= 0); 90Debug.Assert(idx < arr.Length); 286Debug.Assert((normalizedString.Length & 0x1) == 0);
src\libraries\Common\src\System\HexConverter.cs (3)
167Debug.Assert(chars.Length >= bytes.Length * 2); 359Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 360Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs12\PfxAsn.manual.cs (2)
19Debug.Assert(MacData.HasValue); 59Debug.Assert((uint)expectedOutputSize <= 64); // SHA512 is the largest digest size we know about
src\libraries\Common\src\System\Security\Cryptography\CryptographicAttributeObjectCollection.cs (1)
80Debug.Assert(attribute != null);
src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (3)
17Debug.Assert(arraySegment.Array != null); 18Debug.Assert(arraySegment.Offset == 0); 25Debug.Assert(clearSize <= array.Length);
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\Oids.Shared.cs (2)
82Debug.Assert(oidValue != null); 163Debug.Assert(oid is not null);
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (15)
29Debug.Assert(pbeParameters != null); 32Debug.Assert(pbeParameters.IterationCount > 0); 75Debug.Assert(destination.Length >= encryptedData.Length); 148Debug.Assert(digestAlgorithmName.Name != null); 149Debug.Assert(cipher != null); 201Debug.Assert(written == buf.Length); 238Debug.Assert(pbeParameters != null); 305Debug.Assert(hmacOid == Oids.HmacWithSha1 || !isPkcs12); 353Debug.Assert(password.Length > 0 || passwordBytes.IsEmpty); 354Debug.Assert(pbeParameters.HashAlgorithm == HashAlgorithmName.SHA1); 378Debug.Assert(pwdTmpBytes!.Length == passwordBytes.Length); 393Debug.Assert(pwdTmpBytes!.Length == 0); 406Debug.Assert(encryptor.CanTransformMultipleBlocks); 486Debug.Assert(written == buf.Length); 940Debug.Assert(decryptor.CanTransformMultipleBlocks);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Builder.cs (1)
197Debug.Assert(macKey.Length <= 128);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeBag.cs (1)
37Debug.Assert(value != null);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeContents.cs (3)
358Debug.Assert(pbeParameters != null); 359Debug.Assert(pbeParameters.IterationCount >= 1); 442Debug.Assert(ConfidentialityMode == Pkcs12ConfidentialityMode.None);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeContentsBag.cs (2)
26Debug.Assert(copyFrom != null); 27Debug.Assert(copyFrom.ConfidentialityMode == Pkcs12ConfidentialityMode.None);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SecretBag.cs (1)
52Debug.Assert(secretTypeOid != null && secretTypeOid.Value != null);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs8PrivateKeyInfo.cs (3)
51Debug.Assert(algorithmId != null); 188Debug.Assert(!ret.PrivateKeyBytes.Span.Overlaps(decryptedMemory.Span)); 219Debug.Assert(!ret.PrivateKeyBytes.Span.Overlaps(decryptedMemory.Span));
src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (5)
86Debug.Assert(iterationCount >= 1); 104Debug.Assert(v <= 1024); 238Debug.Assert(into.Length == addend.Length); 252Debug.Assert(bytes.Length > 0); 273Debug.Assert(destination.Length % 2 == 0);
System\Security\Cryptography\Pkcs\CmsSignature.cs (2)
91Debug.Assert(processor is not null); 96Debug.Assert(processor is not null);
System\Security\Cryptography\Pkcs\CmsSignature.DSA.cs (2)
65Debug.Assert(Helpers.IsDSASupported); 118Debug.Assert(Helpers.IsDSASupported);
System\Security\Cryptography\Pkcs\CmsSigner.cs (1)
196Debug.Assert(privateKey is null or AsymmetricAlgorithm or SlhDsa);
System\Security\Cryptography\Pkcs\EnvelopedCms.cs (1)
72Debug.Assert(_decryptorPal != null);
System\Security\Cryptography\Pkcs\PublicKeyInfo.cs (2)
13Debug.Assert(algorithm != null); 14Debug.Assert(keyValue != null);
System\Security\Cryptography\Pkcs\RecipientInfo.cs (2)
19Debug.Assert(pal is KeyTransRecipientInfoPal); 23Debug.Assert(pal is KeyAgreeRecipientInfoPal);
System\Security\Cryptography\Pkcs\Rfc3161TimestampRequest.cs (2)
64Debug.Assert(status == Rfc3161RequestResponseStatus.Accepted); 386Debug.Assert(token != null);
System\Security\Cryptography\Pkcs\Rfc3161TimestampToken.cs (6)
44Debug.Assert(_signerInfo != null, "_signerInfo != null"); 204Debug.Assert(tsaCertificate != null); 205Debug.Assert(signer != null); 206Debug.Assert(tokenInfo != null); 480Debug.Assert(signerCert != null); 481Debug.Assert(certId.HasValue || certId2.HasValue);
System\Security\Cryptography\Pkcs\Rfc3161TimestampTokenInfo.cs (1)
161Debug.Assert(_tsaNameBytes.HasValue);
System\Security\Cryptography\Pkcs\SignedCms.cs (8)
142Debug.Assert(_signedData.EncapContentInfo.Content != null); 292Debug.Assert(contentType != Oids.Pkcs7Data); 383Debug.Assert(_heldContent != null); 384Debug.Assert(_contentType == contentType); 423Debug.Assert(_heldContent.HasValue); 468Debug.Assert(_heldContent != null); 618Debug.Assert(signers != null); 644Debug.Assert(signers != null);
System\Security\Cryptography\Pkcs\SignerInfo.cs (2)
56Debug.Assert(_signedAttributes != null); 493Debug.Assert(_signatureAlgorithm == Oids.NoSignature);
System\Security\Cryptography\Pkcs\SignerInfoCollection.cs (3)
23Debug.Assert(signerInfos != null); 30Debug.Assert(signedDataSignerInfos != null); 81Debug.Assert(signer != null);
System\Security\Cryptography\Pkcs\SignerInfoEnumerator.cs (1)
16Debug.Assert(signerInfos != null);
System\Security\Cryptography\Pkcs\SubjectIdentifier.cs (3)
23Debug.Assert(value != null); 28Debug.Assert(value is X509IssuerSerial); 32Debug.Assert(value is string);
System\Security\Cryptography\Pkcs\SubjectIdentifierOrKey.cs (4)
14Debug.Assert(value != null); 19Debug.Assert(value is X509IssuerSerial); 23Debug.Assert(value is string); 27Debug.Assert(value is PublicKeyInfo);
System\Security\Cryptography\Xml\X509IssuerSerial.cs (2)
14Debug.Assert(!string.IsNullOrEmpty(issuerName)); 15Debug.Assert(!string.IsNullOrEmpty(serialNumber));
System.Security.Cryptography.ProtectedData (8)
System\Security\Cryptography\ProtectedData.cs (8)
31Debug.Assert(result); 32Debug.Assert(outputData != null); 69Debug.Assert(result); 70Debug.Assert(outputData != null); 183Debug.Assert(result); 184Debug.Assert(outputData != null); 222Debug.Assert(result); 223Debug.Assert(outputData != null);
System.Security.Cryptography.Xml (62)
src\libraries\Common\src\System\HexConverter.cs (3)
167Debug.Assert(chars.Length >= bytes.Length * 2); 359Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 360Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
System\Security\Cryptography\Xml\CryptoHelpers.cs (1)
98Debug.Assert(!typeof(Transform).IsAssignableFrom(typeof(T)));
System\Security\Cryptography\Xml\SignedXml.cs (5)
579System.Diagnostics.Debug.Assert(cloneElem != null); 813Debug.Assert(_refProcessed != null); 814Debug.Assert(_refLevelCache != null); 964System.Diagnostics.Debug.Assert(a != null); 965System.Diagnostics.Debug.Assert(b != null);
System\Security\Cryptography\Xml\SignedXmlDebugLog.cs (52)
212Debug.Assert(key != null, "key != null"); 255Debug.Assert(o != null, "o != null"); 265Debug.Assert(oid != null, "oid != null"); 281Debug.Assert(signedXml != null, "signedXml != null"); 282Debug.Assert(canonicalizationTransform != null, "canonicalizationTransform != null"); 316Debug.Assert(signedXml != null, "signedXml != null"); 317Debug.Assert(formatValidator != null, "formatValidator != null"); 339Debug.Assert(signedXml != null, "signedXml != null"); 340Debug.Assert(signedInfo != null, " signedInfo != null"); 358Debug.Assert(signedXml != null, "signedXml != null"); 388Debug.Assert(signedXml != null, "signedXml != null"); 418Debug.Assert(signedXml != null, "signedXml != null"); 419Debug.Assert(canonicalizationTransform != null, "canonicalizationTransform != null"); 443Debug.Assert(signedXml != null, "signedXml != null"); 462Debug.Assert(signedXml != null, "signedXml != null"); 463Debug.Assert(validAlgorithms != null, "validAlgorithms != null"); 501Debug.Assert(signedXml != null, "signedXml != null"); 502Debug.Assert(validC14nAlgorithms != null, "validC14nAlgorithms != null"); 503Debug.Assert(validTransformAlgorithms != null, "validTransformAlgorithms != null"); 544Debug.Assert(signedXml != null, "signedXml != null"); 635Debug.Assert(signedXml != null, "signedXml != null"); 636Debug.Assert(signatureDescription != null, "signatureDescription != null"); 637Debug.Assert(hash != null, "hash != null"); 638Debug.Assert(asymmetricSignatureFormatter != null, "asymmetricSignatureFormatter != null"); 663Debug.Assert(signedXml != null, "signedXml != null"); 664Debug.Assert(key != null, "key != null"); 687Debug.Assert(signedXml != null, "signedXml != null"); 688Debug.Assert(reference != null, "reference != null"); 738Debug.Assert(signedXml != null, "signedXml != null"); 739Debug.Assert(key != null, "key != null"); 764Debug.Assert(signedXml != null, "signedXml != null"); 765Debug.Assert(certificate != null, "certificate != null"); 789Debug.Assert(signedXml != null, "signedXml != null"); 790Debug.Assert(reference != null, "reference != null"); 821Debug.Assert(signedXml != null, "signedXml != null"); 822Debug.Assert(reference != null, "reference != null"); 823Debug.Assert(actualHash != null, "actualHash != null"); 824Debug.Assert(expectedHash != null, "expectedHash != null"); 864Debug.Assert(signedXml != null, "signedXml != null"); 865Debug.Assert(signatureDescription != null, "signatureDescription != null"); 866Debug.Assert(hashAlgorithm != null, "hashAlgorithm != null"); 867Debug.Assert(asymmetricSignatureDeformatter != null, "asymmetricSignatureDeformatter != null"); 910Debug.Assert(signedXml != null, "signedXml != null"); 911Debug.Assert(mac != null, "mac != null"); 946Debug.Assert(signedXml != null, "signedXml != null"); 947Debug.Assert(certificate != null, "certificate != null"); 948Debug.Assert(chain != null, "chain != null"); 1038Debug.Assert(signedXml != null, "signedXml != null"); 1039Debug.Assert(reference != null, "reference != null"); 1067Debug.Assert(source != null, "source != null"); 1068Debug.Assert(!string.IsNullOrEmpty(data), "!string.IsNullOrEmpty(data)"); 1069Debug.Assert(InformationLoggingEnabled, "InformationLoggingEnabled");
System\Security\Cryptography\Xml\Utils.cs (1)
120Debug.Assert(IsNamespaceNode(a) || IsXmlNamespaceNode(a));
System.ServiceModel.Federation (1)
System\Runtime\OperationWithTimeoutAsyncResult.cs (1)
159Debug.Assert(_manualResetEvent == null, "No ManualResetEvent should be created for a synchronous AsyncResult.");
System.ServiceModel.Syndication (27)
System\ServiceModel\Syndication\Atom10FeedFormatter.cs (1)
567Debug.Assert(!FeedUtils.IsXmlns(attr.Name, attr.Namespace), "XML namespace attributes should not be added to the list.");
System\ServiceModel\Syndication\ServiceDocumentFormatter.cs (3)
36Debug.Assert(categories != null); 44Debug.Assert(collection != null); 52Debug.Assert(workspace != null);
System\ServiceModel\Syndication\SyndicationElementExtension.cs (8)
198Debug.Assert(_extensionDataWriter != null, "outer name is null only for datacontract and xmlserializer cases"); 213Debug.Assert(extensionData != null && dataContractSerializer != null, "null check"); 222Debug.Assert(extensionData != null && serializer != null, "null check"); 231Debug.Assert((_dataContractSerializer == null && _outerName == null && _outerNamespace == null), "Xml serializer cannot have outer name, ns"); 236Debug.Assert(_xmlSerializer == null, "Xml serializer cannot be configured"); 252Debug.Assert(_outerName == null, "All callers of this function should already check for a null outer name."); 255Debug.Assert(_xmlSerializer == null, "only one of xmlserializer or datacontract serializer can be present"); 271Debug.Assert(_dataContractSerializer == null, "only one of xmlserializer or datacontract serializer can be present");
System\ServiceModel\Syndication\SyndicationElementExtensionCollection.cs (4)
146Debug.Assert(_initialized, "The constructor should never clear the collection."); 166Debug.Assert(_initialized, "The constructor should never remove items from the collection."); 175Debug.Assert(_initialized, "The constructor should never set items in the collection."); 224Debug.Assert((dcSerializer == null) != (xmlSerializer == null), "exactly one serializer should be supplied");
System\ServiceModel\Syndication\SyndicationFeedFormatter.cs (5)
420Debug.Assert(item != null); 428Debug.Assert(category != null); 436Debug.Assert(link != null); 444Debug.Assert(person != null); 452Debug.Assert(reader != null, "reader != null");
System\ServiceModel\Syndication\TextSyndicationContent.cs (1)
31Debug.Assert(source != null, "The base constructor already checks if source is valid.");
System\ServiceModel\Syndication\UrlSyndicationContent.cs (1)
24Debug.Assert(source != null, "The base constructor already checks if source is valid.");
System\ServiceModel\Syndication\XmlSyndicationContent.cs (4)
75Debug.Assert(source != null, "The base constructor already checks if source is valid."); 104Debug.Assert(_contentBuffer != null, "contentBuffer cannot be null"); 123Debug.Assert(_contentBuffer != null, "contentBuffer cannot be null"); 144Debug.Assert(_contentBuffer != null, "contentBuffer cannot be null");
System.Text.Encoding.CodePages (169)
System\Text\BaseCodePageEncoding.cs (11)
105Debug.Assert(stream is UnmanagedMemoryStream, "UnmanagedMemoryStream will read a full buffer on one call to Read."); 107Debug.Assert(bytesRead == codePageDataFileHeader.Length); 143Debug.Assert(stream is UnmanagedMemoryStream, "UnmanagedMemoryStream will read a full buffer on one call to Read."); 145Debug.Assert(bytesRead == codePageIndex.Length); 189Debug.Assert(stream is UnmanagedMemoryStream, "UnmanagedMemoryStream will read a full buffer on one call to Read."); 191Debug.Assert(bytesRead == codePageHeader.Length); 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"); 370Debug.Assert(pNativeMemory != null); 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 (2)
16Debug.Assert(stream is UnmanagedMemoryStream, "UnmanagedMemoryStream will read a full buffer on one call to Read."); 18Debug.Assert(bytesRead == codePageIndex.Length);
System\Text\DBCSCodePageEncoding.cs (38)
87Debug.Assert(m_codePageHeader?.Length > 0); 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 (5)
25Debug.Assert(_fallbackBuffer != null); 46Debug.Assert(byteStart != null, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize"); 47Debug.Assert(_fallbackBuffer != null); 102Debug.Assert(byteStart != null, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize"); 103Debug.Assert(_fallbackBuffer != null);
System\Text\EncoderBestFitFallback.cs (2)
187Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length, 208Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length,
System\Text\EncoderFallbackBufferHelper.cs (4)
34Debug.Assert(_fallbackBuffer != null); 56Debug.Assert(_fallbackBuffer != null); 74Debug.Assert(charStart != null, "[EncoderFallback.InternalFallbackBuffer]Fallback buffer is not initialized"); 75Debug.Assert(_fallbackBuffer != null);
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, 113Debug.Assert(_bytes < _byteEnd, "[EncodingCharBuffer.GetNextByte]Expected more date");
System\Text\EncodingTable.cs (7)
111Debug.Assert(encodingNameIndices.Length == CodePagesByName.Length + 1); 112Debug.Assert(encodingNameIndices[encodingNameIndices.Length - 1] == EncodingNames.Length); 122Debug.Assert(index < encodingNameIndices.Length - 1); 144Debug.Assert(left < encodingNameIndices.Length - 1); 185Debug.Assert(MappedCodePages.Length + 1 == indices.Length); 186Debug.Assert(indices[indices.Length - 1] == names.Length); 201Debug.Assert(i < indices.Length - 1);
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 (35)
62Debug.Assert(m_codePageHeader?.Length > 0); 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 (33)
src\libraries\Common\src\System\HexConverter.cs (3)
167Debug.Assert(chars.Length >= bytes.Length * 2); 359Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 360Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 281Debug.Assert(additionalCapacityBeyondPos > 0); 282Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\IO\TextWriterExtensions.cs (2)
19Debug.Assert(writer != null); 20Debug.Assert(value != null);
System\Text\Encodings\Web\AllowedBmpCodePointsBitmap.cs (2)
70Debug.Assert(definedCharsBitmapAsLittleEndian.Length == thisAllowedCharactersBitmap.Length * sizeof(uint)); 81Debug.Assert(thisAllowedCharactersBitmap.IsEmpty, "Both vectors should've been fully consumed.");
System\Text\Encodings\Web\AsciiByteMap.cs (2)
20Debug.Assert(key < BufferSize); 21Debug.Assert(value != 0);
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)
45Debug.Assert(encodedCharCount > 0 && encodedCharCount <= 6, "Inner encoder returned bad length."); 52Debug.Assert(thisChar <= 0x7F, "Inner encoder returned non-ASCII data.");
System\Text\Encodings\Web\OptimizedInboxTextEncoder.cs (5)
36Debug.Assert(scalarEscaper != null); 119Debug.Assert(innerCharsWritten <= bufferLength, "Mustn't overflow the buffer."); 120Debug.Assert(innerCharsWritten != 0, "Inner escaper succeeded with 0-char output?"); 312Debug.Assert(scalarValue == Rune.ReplacementChar); // DecodeFromUtfXX should've set replacement character on failure 453Debug.Assert(0 <= idx && idx <= lengthInChars);
System\Text\Encodings\Web\TextEncoder.cs (6)
345Debug.Assert(scalarValue == Rune.ReplacementChar); // DecodeFromUtf8 should've performed substitution 467Debug.Assert(scalarValue == Rune.ReplacementChar); // should be replacement char 514Debug.Assert(output != null); 515Debug.Assert(!value.IsEmpty, "Caller should've special-cased 'no encoding needed'."); 578Debug.Assert(!string.IsNullOrEmpty(source)); 598Debug.Assert(unicodeScalar < ushort.MaxValue);
System\Text\Encodings\Web\ThrowHelper.cs (1)
25Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument),
System\Text\Unicode\UnicodeHelpers.cs (2)
29Debug.Assert(0x10000 <= scalar && scalar <= UNICODE_LAST_CODEPOINT); 45Debug.Assert(scalar <= UNICODE_LAST_CODEPOINT);
System.Text.Json (1390)
src\libraries\Common\src\System\HexConverter.cs (3)
167Debug.Assert(chars.Length >= bytes.Length * 2); 359Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 360Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Net\ArrayBuffer.cs (9)
40Debug.Assert(initialSize > 0 || usePool); 52Debug.Assert(buffer.Length > 0); 77Debug.Assert(_usePool); 78Debug.Assert(_bytes is not null); 117Debug.Assert(byteCount <= AvailableLength); 133Debug.Assert(AvailableLength < byteCount); 137Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0); 149Debug.Assert(byteCount <= AvailableLength); 179Debug.Assert(byteCount <= AvailableLength);
src\libraries\Common\src\System\Text\Json\PooledByteBufferWriter.cs (5)
44Debug.Assert(initialCapacity > 0); 45Debug.Assert(_buffer.ActiveLength == 0); 56Debug.Assert(sizeHint > 0); 64Debug.Assert(sizeHint > 0); 78Debug.Assert(_stream is not null);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 281Debug.Assert(additionalCapacityBeyondPos > 0); 282Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\libraries\System.Private.CoreLib\src\System\Marvin.cs (3)
54Debug.Assert(loopCount > 0, "Shouldn't reach this code path for small inputs."); 99Debug.Assert(count >= 4, "Only should've gotten here if the original count was >= 4."); 112Debug.Assert(count >= 4, "Only should've gotten here if the original count was >= 4.");
src\libraries\System.Text.Json\Common\JsonHelpers.cs (2)
158Debug.Assert(childlessQueue.Count > 0, "The graph contains cycles."); 186Debug.Assert(idx == 0, "should have populated the entire sortedNodes array.");
src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (1)
18Debug.Assert(char.IsPunctuation(separator));
src\libraries\System.Text.Json\Common\ReflectionExtensions.cs (8)
49Debug.Assert(baseType.IsGenericType); 50Debug.Assert(!baseType.IsInterface); 51Debug.Assert(baseType == baseType.GetGenericTypeDefinition()); 86Debug.Assert(interfaceType.IsGenericType); 87Debug.Assert(interfaceType.IsInterface); 88Debug.Assert(interfaceType == interfaceType.GetGenericTypeDefinition()); 162Debug.Assert(type.IsImmutableDictionaryType()); 183Debug.Assert(type.IsImmutableEnumerableType());
System\Text\Json\BitStack.cs (6)
144Debug.Assert(_array != null); 164Debug.Assert(_array != null); 166Debug.Assert(minSize >= 0 && minSize >= _array.Length); 169Debug.Assert(nextDouble > minSize); 179Debug.Assert(_currentDepth == 0, "Only call SetFirstBit when depth is 0"); 189Debug.Assert(_currentDepth == 0, "Only call ResetFirstBit when depth is 0");
System\Text\Json\Document\JsonDocument.cs (21)
44Debug.Assert(!utf8Json.IsEmpty); 47Debug.Assert(isDisposable || 51Debug.Assert(extraRentedArrayPoolBytes == null || extraPooledByteBufferWriter == null); 124Debug.Assert(!isPropertyName || row.TokenType is JsonTokenType.PropertyName); 255Debug.Assert(row.TokenType == JsonTokenType.PropertyName); 317Debug.Assert(status != OperationStatus.DestinationTooSmall); 325Debug.Assert(status == OperationStatus.Done); 366Debug.Assert(idx != -1); 390Debug.Assert(row.TokenType is JsonTokenType.PropertyName); 412Debug.Assert(segment.IndexOf(JsonConstants.BackSlash) == -1); 709Debug.Assert(segment.IndexOf(JsonConstants.BackSlash) == -1); 838Debug.Assert(row.TokenType == JsonTokenType.String || row.TokenType == JsonTokenType.PropertyName); 869Debug.Assert(row.TokenType == JsonTokenType.PropertyName); 923Debug.Assert(reader.TokenStartIndex <= int.MaxValue); 1010Debug.Assert(tokenStart < int.MaxValue); 1019Debug.Assert(!inArray); 1023Debug.Assert(tokenType >= JsonTokenType.String && tokenType <= JsonTokenType.Null); 1035Debug.Assert(tokenStart < int.MaxValue); 1053Debug.Assert(reader.BytesConsumed == utf8JsonSpan.Length); 1067Debug.Assert(document.RootElement.ValueKind is JsonValueKind.Array or JsonValueKind.Object); 1158Debug.Assert(readerOptions.CommentHandling >= 0 && readerOptions.CommentHandling <= JsonCommentHandling.Allow);
System\Text\Json\Document\JsonDocument.DbRow.cs (5)
57Debug.Assert(jsonTokenType > JsonTokenType.None && jsonTokenType <= JsonTokenType.Null); 58Debug.Assert((byte)jsonTokenType < 1 << 4); 59Debug.Assert(location >= 0); 60Debug.Assert(sizeOrLength >= UnknownSize); 61Debug.Assert(Unsafe.SizeOf<DbRow>() == Size);
System\Text\Json\Document\JsonDocument.MetadataDb.cs (11)
159Debug.Assert(!_isLocked, "Dispose called on a locked database"); 178Debug.Assert(_data != null); 219Debug.Assert( 235Debug.Assert(!_isLocked, "Appending to a locked database"); 244Debug.Assert(MaxArrayLength == Array.MaxLength); 269Debug.Assert(index >= 0); 277Debug.Assert(length >= 0); 285Debug.Assert(numberOfRows >= 1 && numberOfRows <= 0x0FFFFFFF); 309Debug.Assert(lookupType == JsonTokenType.StartObject || lookupType == JsonTokenType.StartArray); 353Debug.Assert(endIndex <= Length); 395Debug.Assert(newDbInts[i] >= locationOffset);
System\Text\Json\Document\JsonDocument.Parse.cs (17)
127Debug.Assert(drained.Array != null); 157Debug.Assert(utf8Json != null); 160Debug.Assert(drained.Array != null); 188Debug.Assert(json != null); 224Debug.Assert(drained.Array != null); 248Debug.Assert(drained.Array != null); 291Debug.Assert(expectedByteCount == actualByteCount); 317Debug.Assert(expectedByteCount == actualByteCount); 441Debug.Assert(ret, "TryParseValue returned false with shouldThrow: true."); 442Debug.Assert(document != null, "null document returned with shouldThrow: true."); 528Debug.Assert( 579Debug.Assert(payloadLength > 1); 623Debug.Assert(!reader.HasValueSequence); 703Debug.Assert(tokenType == JsonTokenType.Null); 760Debug.Assert( 826Debug.Assert(rented.Length >= utf8Bom.Length); 909Debug.Assert(rented.Length >= JsonConstants.Utf8Bom.Length);
System\Text\Json\Document\JsonDocument.PropertyNameSet.cs (2)
73Debug.Assert(dbRow.TokenType is JsonTokenType.PropertyName); 102Debug.Assert(_hashSet is not null);
System\Text\Json\Document\JsonDocument.StackRow.cs (2)
23Debug.Assert(sizeOrLength >= 0); 24Debug.Assert(numberOfRows >= -1);
System\Text\Json\Document\JsonDocument.StackRowStack.cs (2)
55Debug.Assert(_rentedBuffer != null); 56Debug.Assert(_topOfStack <= _rentedBuffer!.Length - StackRow.Size);
System\Text\Json\Document\JsonDocument.TryGetProperty.cs (7)
59Debug.Assert(row.TokenType != JsonTokenType.PropertyName); 68Debug.Assert(row.NumberOfRows > 0); 73Debug.Assert(row.TokenType == JsonTokenType.PropertyName); 150Debug.Assert(row.TokenType != JsonTokenType.PropertyName); 159Debug.Assert(row.NumberOfRows > 0); 164Debug.Assert(row.TokenType == JsonTokenType.PropertyName); 175Debug.Assert(idx >= 0);
System\Text\Json\Document\JsonDocumentOptions.cs (1)
32Debug.Assert(value >= 0);
System\Text\Json\Document\JsonElement.ArrayEnumerator.cs (1)
27Debug.Assert(target.TokenType == JsonTokenType.StartArray);
System\Text\Json\Document\JsonElement.cs (7)
27Debug.Assert(idx >= 0); 1306Debug.Assert(success, "enumerators must have matching length"); 1314Debug.Assert(!arrayEnumerator2.MoveNext()); 1318Debug.Assert(kind is JsonValueKind.Object); 1336Debug.Assert(success, "enumerators should have matching lengths"); 1355Debug.Assert(!objectEnumerator2.MoveNext()); 1663Debug.Assert(_parent != null);
System\Text\Json\Document\JsonElement.ObjectEnumerator.cs (1)
27Debug.Assert(target.TokenType == JsonTokenType.StartObject);
System\Text\Json\Document\JsonElement.Parse.cs (4)
51Debug.Assert(ret, "TryParseValue returned false with shouldThrow: true."); 52Debug.Assert(document != null, "null document returned with shouldThrow: true."); 65Debug.Assert(ret, "TryParseValue returned false with shouldThrow: true."); 66Debug.Assert(document != null, "null document returned with shouldThrow: true.");
System\Text\Json\JsonEncodedText.cs (2)
34Debug.Assert(utf8Value != null); 91Debug.Assert(expectedByteCount == utf8Bytes.Length);
System\Text\Json\JsonHelpers.cs (16)
24Debug.Assert(reader.TokenType is JsonTokenType.String or JsonTokenType.PropertyName); 50Debug.Assert(reader.AllowMultipleValues, "only supported by readers that support multiple values."); 51Debug.Assert(reader.CurrentDepth == 0, "should only invoked for top-level values."); 105Debug.Assert(tokenType == reader.TokenType); 174Debug.Assert(result); 184Debug.Assert(success, "The skipped value should have already been buffered."); 224Debug.Assert(dictionary.Comparer is IAlternateEqualityComparer<ReadOnlySpan<char>, string>); 336Debug.Assert(left.Length > 0 && right.Length > 0); 402Debug.Assert(leftFirst.Length == rightFirst.Length); 403Debug.Assert(leftMiddle.Length == rightMiddle.Length); 404Debug.Assert(leftLast.Length == rightLast.Length); 431Debug.Assert(span.Length > 0); 440Debug.Assert(char.IsDigit((char)span[0]), "leading plus not allowed in valid JSON numbers."); 473Debug.Assert(span[i] is (byte)'e' or (byte)'E'); 476Debug.Assert(span.Length >= 10); 491Debug.Assert(intg.Length == 1, "Leading zeros not permitted in JSON numbers.");
System\Text\Json\JsonHelpers.Date.cs (7)
146Debug.Assert(source.Length >= 10); 240Debug.Assert(source.Length >= 16); 273Debug.Assert(source.Length >= 19); 332Debug.Assert(sourceIndex <= source.Length); 386Debug.Assert(source.Length == 2); 504Debug.Assert(parseData.Year <= 9999); // All of our callers to date parse the year from fixed 4-digit fields so this value is trusted. 539Debug.Assert(parseData.Fraction >= 0 && parseData.Fraction <= JsonConstants.MaxDateTimeFraction); // All of our callers to date parse the fraction from fixed 7-digit fields so this value is trusted.
System\Text\Json\JsonHelpers.Escaping.cs (4)
33Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length); 34Debug.Assert(firstEscapeIndexVal >= 0 && firstEscapeIndexVal < utf8Value.Length); 61Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length); 62Debug.Assert(firstEscapeIndexVal >= 0 && firstEscapeIndexVal < utf8Value.Length);
System\Text\Json\Nodes\JsonArray.cs (4)
205Debug.Assert(element.ValueKind == JsonValueKind.Array); 248Debug.Assert(index >= 0); 254Debug.Assert(formatted); 303Debug.Assert(jElement.ValueKind == JsonValueKind.Array);
System\Text\Json\Nodes\JsonObject.cs (3)
71Debug.Assert(element.ValueKind == JsonValueKind.Object); 248Debug.Assert(index >= 0); 265Debug.Assert(_dictionary != null, "Cannot have detachable nodes without a materialized dictionary.");
System\Text\Json\Nodes\JsonValue.cs (3)
156Debug.Assert(child == null); 163Debug.Assert(jsonTypeInfo.IsConfigured); 164Debug.Assert(value != null);
System\Text\Json\Nodes\JsonValueOfElement.cs (3)
16Debug.Assert(value.ValueKind is JsonValueKind.False or JsonValueKind.True or JsonValueKind.Number or JsonValueKind.String); 145Debug.Assert(result != null); 174Debug.Assert(result != null);
System\Text\Json\Nodes\JsonValueOfT.cs (4)
17Debug.Assert(value != null); 18Debug.Assert(value is not JsonElement or JsonElement { ValueKind: not JsonValueKind.Null }); 19Debug.Assert(value is not JsonNode); 65Debug.Assert(s_valueKind is not null, "Should only be invoked for types that are supported primitives.");
System\Text\Json\Nodes\JsonValueOfTCustomized.cs (2)
22Debug.Assert(jsonTypeInfo.IsConfigured); 56Debug.Assert(success);
System\Text\Json\Nodes\JsonValueOfTPrimitive.cs (1)
21Debug.Assert(converter is { IsInternalConverter: true, ConverterStrategy: ConverterStrategy.Value });
System\Text\Json\Reader\JsonReaderHelper.cs (11)
96Debug.Assert(segment.IndexOf(JsonConstants.BackSlash) == -1); 110Debug.Assert(source.Length <= JsonConstants.MaximumEscapedDateTimeOffsetParseLength); 114Debug.Assert(written > 0); 117Debug.Assert(!sourceUnescaped.IsEmpty); 144Debug.Assert(segment.IndexOf(JsonConstants.BackSlash) == -1); 158Debug.Assert(source.Length <= JsonConstants.MaximumEscapedDateTimeOffsetParseLength); 162Debug.Assert(written > 0); 165Debug.Assert(!sourceUnescaped.IsEmpty); 180Debug.Assert(source.Length <= JsonConstants.MaximumEscapedGuidLength); 184Debug.Assert(written > 0); 187Debug.Assert(!utf8Unescaped.IsEmpty);
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (40)
23Debug.Assert(written > 0); 26Debug.Assert(!utf8Unescaped.IsEmpty); 53Debug.Assert(written > 0); 56Debug.Assert(!utf8Unescaped.IsEmpty); 80Debug.Assert(written > 0); 83Debug.Assert(propertyName.Length is not 0); 96Debug.Assert(utf8Source.Length >= other.Length && utf8Source.Length / JsonConstants.MaxExpansionFactorWhileEscaping <= other.Length); 105Debug.Assert(written > 0); 108Debug.Assert(!utf8Unescaped.IsEmpty); 123Debug.Assert(!utf8Source.IsSingleSegment); 124Debug.Assert(utf8Source.Length >= other.Length && utf8Source.Length / JsonConstants.MaxExpansionFactorWhileEscaping <= other.Length); 143Debug.Assert(written > 0); 146Debug.Assert(!utf8Unescaped.IsEmpty); 152Debug.Assert(escapedArray != null); 167Debug.Assert(index1 >= 0, "the first parameter is not escaped"); 168Debug.Assert(index2 >= 0, "the second parameter is not escaped"); 183Debug.Assert(!utf8Unescaped1.IsEmpty); 187Debug.Assert(!utf8Unescaped2.IsEmpty); 240Debug.Assert(bytesConsumed == utf8Unescaped.Length); 446Debug.Assert(destination.Length >= source.Length); 449Debug.Assert(idx >= 0); 452Debug.Assert(result); 457Debug.Assert(idx >= 0 && idx < source.Length); 458Debug.Assert(source[idx] == JsonConstants.BackSlash); 459Debug.Assert(destination.Length >= source.Length); 462Debug.Assert(result); 471Debug.Assert(idx >= 0); 481Debug.Assert(idx >= 0 && idx < source.Length); 482Debug.Assert(source[idx] == JsonConstants.BackSlash); 494Debug.Assert(source[idx] == JsonConstants.BackSlash); 528Debug.Assert(source[idx] == 'u', "invalid escape sequences must have already been caught by Utf8JsonReader.Read()"); 532Debug.Assert(source.Length >= idx + 5); 535Debug.Assert(result); 536Debug.Assert(bytesConsumed == 4); 547Debug.Assert(JsonHelpers.IsInRangeInclusive((uint)scalar, JsonConstants.HighSurrogateStartValue, JsonConstants.HighSurrogateEndValue)); 558Debug.Assert(result); 559Debug.Assert(bytesConsumed == 4); 582Debug.Assert(bytesWritten <= 4); 606Debug.Assert(nextUnescapedSegmentLength > 0); 628Debug.Assert(idx == source.Length || source[idx] == JsonConstants.BackSlash);
System\Text\Json\Reader\JsonReaderOptions.cs (1)
32Debug.Assert(value >= 0);
System\Text\Json\Reader\Utf8JsonReader.cs (53)
84Debug.Assert(_totalConsumed == 0); 112Debug.Assert(readerDepth >= 1); 173Debug.Assert(_currentPosition.GetObject() != null); 324Debug.Assert(_isFinalBlock); 331Debug.Assert(result); 342Debug.Assert(result); 398Debug.Assert(0 <= targetDepth && targetDepth <= CurrentDepth); 429Debug.Assert(targetDepth == CurrentDepth); 553Debug.Assert(status != OperationStatus.DestinationTooSmall); 561Debug.Assert(status == OperationStatus.Done); 576Debug.Assert(HasValueSequence); 585Debug.Assert(!localSequence.IsSingleSegment); 612Debug.Assert(!HasValueSequence); 621Debug.Assert(idx != -1); 633Debug.Assert(HasValueSequence); 634Debug.Assert(!ValueSequence.IsSingleSegment); 1044Debug.Assert((_trailingCommaBeforeComment && _readerOptions.CommentHandling == JsonCommentHandling.Allow) || !_trailingCommaBeforeComment); 1045Debug.Assert((_trailingCommaBeforeComment && marker != JsonConstants.Slash) || !_trailingCommaBeforeComment); 1089Debug.Assert(_readerOptions.CommentHandling == JsonCommentHandling.Skip); 1136Debug.Assert(span.Length > 0); 1137Debug.Assert(span[0] == 'n' || span[0] == 't' || span[0] == 'f'); 1153Debug.Assert(span.Length > 0 && span[0] == literal[0]); 1174Debug.Assert(indexOfFirstMismatch > 0 && indexOfFirstMismatch < literal.Length); 1198Debug.Assert(firstByte == 'n'); 1218Debug.Assert(IsLastSpan); 1229Debug.Assert( 1281Debug.Assert(_buffer.Length >= _consumed + 1); 1282Debug.Assert(_buffer[_consumed] == JsonConstants.Quote); 1326Debug.Assert(idx >= 0 && idx < data.Length); 1327Debug.Assert(data[idx] != JsonConstants.Quote); 1328Debug.Assert(data[idx] == JsonConstants.BackSlash || data[idx] < JsonConstants.Space); 1428Debug.Assert(data.Length > 0); 1439Debug.Assert(signResult == ConsumeNumberResult.OperationIncomplete); 1442Debug.Assert(nextByte >= '0' && nextByte <= '9'); 1456Debug.Assert(result == ConsumeNumberResult.OperationIncomplete); 1472Debug.Assert(result == ConsumeNumberResult.OperationIncomplete); 1481Debug.Assert(nextByte == '.' || nextByte == 'E' || nextByte == 'e'); 1496Debug.Assert(result == ConsumeNumberResult.OperationIncomplete); 1505Debug.Assert(nextByte == 'E' || nextByte == 'e'); 1514Debug.Assert(signResult == ConsumeNumberResult.OperationIncomplete); 1527Debug.Assert(resultExponent == ConsumeNumberResult.OperationIncomplete); 1567Debug.Assert(data[i] == (byte)'0'); 1740Debug.Assert(_readerOptions.CommentHandling == JsonCommentHandling.Skip); 1840Debug.Assert(_readerOptions.CommentHandling == JsonCommentHandling.Allow); 1841Debug.Assert(_tokenType == JsonTokenType.Comment); 1852Debug.Assert(_tokenType != JsonTokenType.Comment); 1882Debug.Assert(first != JsonConstants.Slash); 2004Debug.Assert(first != JsonConstants.CloseBrace); 2026Debug.Assert(first != JsonConstants.CloseBracket); 2043Debug.Assert(_tokenType is JsonTokenType.EndArray or JsonTokenType.EndObject); 2046Debug.Assert(first != JsonConstants.CloseBrace); 2063Debug.Assert(first != JsonConstants.CloseBracket); 2356Debug.Assert(localBuffer[idx] == JsonConstants.CarriageReturn);
System\Text\Json\Reader\Utf8JsonReader.MultiSegment.cs (54)
94Debug.Assert(!_nextPosition.Equals(_currentPosition)); 229Debug.Assert(_isNotPrimitive && IsLastSpan); 303Debug.Assert(!_isMultiSegment || _currentPosition.GetObject() != null); 320Debug.Assert(!_isMultiSegment || _currentPosition.GetObject() != null); 404Debug.Assert((_trailingCommaBeforeComment && _readerOptions.CommentHandling == JsonCommentHandling.Allow) || !_trailingCommaBeforeComment); 405Debug.Assert((_trailingCommaBeforeComment && marker != JsonConstants.Slash) || !_trailingCommaBeforeComment); 455Debug.Assert(_readerOptions.CommentHandling == JsonCommentHandling.Skip); 513Debug.Assert(span.Length > 0); 514Debug.Assert(span[0] == 'n' || span[0] == 't' || span[0] == 'f'); 540Debug.Assert(span.Length > 0 && span[0] == literal[0] && literal.Length <= JsonConstants.MaximumLiteralLength); 635Debug.Assert(span.Length > 0); 652Debug.Assert(indexOfFirstMismatch >= 0 && indexOfFirstMismatch < literal.Length); 671Debug.Assert(firstByte == 'n'); 690Debug.Assert(IsLastSpan); 701Debug.Assert( 753Debug.Assert(_buffer.Length >= _consumed + 1); 754Debug.Assert(_buffer[_consumed] == JsonConstants.Quote); 962Debug.Assert(idx >= 0 && idx < data.Length); 963Debug.Assert(data[idx] != JsonConstants.Quote); 964Debug.Assert(data[idx] == JsonConstants.BackSlash || data[idx] < JsonConstants.Space); 1127Debug.Assert(data.Length > 0); 1141Debug.Assert(signResult == ConsumeNumberResult.OperationIncomplete); 1144Debug.Assert(nextByte >= '0' && nextByte <= '9'); 1159Debug.Assert(result == ConsumeNumberResult.OperationIncomplete); 1175Debug.Assert(result == ConsumeNumberResult.OperationIncomplete); 1184Debug.Assert(nextByte == '.' || nextByte == 'E' || nextByte == 'e'); 1201Debug.Assert(result == ConsumeNumberResult.OperationIncomplete); 1210Debug.Assert(nextByte == 'E' || nextByte == 'e'); 1221Debug.Assert(signResult == ConsumeNumberResult.OperationIncomplete); 1236Debug.Assert(resultExponent == ConsumeNumberResult.OperationIncomplete); 1259Debug.Assert(i == 0); 1282Debug.Assert(i == 1); 1301Debug.Assert(data[i] == (byte)'0'); 1302Debug.Assert(i == 0 || i == 1); 1579Debug.Assert(_readerOptions.CommentHandling == JsonCommentHandling.Skip); 1688Debug.Assert(_readerOptions.CommentHandling == JsonCommentHandling.Allow); 1689Debug.Assert(_tokenType == JsonTokenType.Comment); 1700Debug.Assert(_tokenType != JsonTokenType.Comment); 1730Debug.Assert(first != JsonConstants.Slash); 1861Debug.Assert(first != JsonConstants.CloseBrace); 1885Debug.Assert(first != JsonConstants.CloseBracket); 1902Debug.Assert(_tokenType == JsonTokenType.EndArray || _tokenType == JsonTokenType.EndObject); 1905Debug.Assert(first != JsonConstants.CloseBrace); 1922Debug.Assert(first != JsonConstants.CloseBracket); 2193Debug.Assert( 2343Debug.Assert(dangerousLineSeparatorBytesConsumed >= 0 && dangerousLineSeparatorBytesConsumed <= 2); 2357Debug.Assert(localBuffer[idx] == JsonConstants.CarriageReturn); 2417Debug.Assert(dangerousLineSeparatorBytesConsumed >= 0 && dangerousLineSeparatorBytesConsumed <= 2); 2427Debug.Assert(dangerousLineSeparatorBytesConsumed >= 1 && dangerousLineSeparatorBytesConsumed <= 2 && localBuffer.Length <= 1); 2458Debug.Assert(localBuffer.Length < 2); 2467Debug.Assert(dangerousLineSeparatorBytesConsumed == 1 || dangerousLineSeparatorBytesConsumed == 2); 2521Debug.Assert(localBuffer.Length > 0); 2567Debug.Assert(marker == JsonConstants.CarriageReturn); 2601Debug.Assert(!localBuffer.IsEmpty);
System\Text\Json\Reader\Utf8JsonReader.TryGet.cs (13)
46Debug.Assert(span.IndexOf(JsonConstants.BackSlash) == -1); 81Debug.Assert(_tokenType is JsonTokenType.String or JsonTokenType.PropertyName or JsonTokenType.Number); 82Debug.Assert(_tokenType != JsonTokenType.Number || !ValueIsEscaped, "Numbers can't contain escape characters."); 145Debug.Assert(_tokenType is JsonTokenType.String or JsonTokenType.PropertyName or JsonTokenType.Number); 146Debug.Assert(_tokenType != JsonTokenType.Number || !ValueIsEscaped, "Numbers can't contain escape characters."); 161Debug.Assert(success); 197Debug.Assert(_tokenType is JsonTokenType.String or JsonTokenType.PropertyName); 198Debug.Assert(ValueIsEscaped); 228Debug.Assert(bytesWritten < source.Length, "source buffer must contain at least one escape sequence"); 262Debug.Assert((HasValueSequence ? ValueSequence.ToArray() : ValueSpan).Length == 4); 271Debug.Assert((HasValueSequence ? ValueSequence.ToArray() : ValueSpan).Length == 5); 841Debug.Assert(span.IndexOf(JsonConstants.BackSlash) == -1); 1368Debug.Assert(span.IndexOf(JsonConstants.BackSlash) == -1);
System\Text\Json\Schema\JsonSchema.cs (2)
264Debug.Assert(options.TransformSchemaNode != null, "context should only be populated if a callback is present."); 304Debug.Assert(_trueOrFalse is null, "Schema is not mutable");
System\Text\Json\Schema\JsonSchemaExporter.cs (9)
68Debug.Assert(typeInfo.IsConfigured); 109Debug.Assert(derivedType.TypeDiscriminator is null or int or string); 187Debug.Assert(elementTypeInfo.Type.IsEnum, "The enum keyword should only be populated by schemas for enum types."); 263Debug.Assert(typeInfo.ElementTypeInfo != null); 313Debug.Assert(typeInfo.ElementTypeInfo != null); 341Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.None); 385Debug.Assert(typeInfo.PolymorphismOptions is not null); 419Debug.Assert(CurrentDepth > 0); 486Debug.Assert(span[pos] == '/');
System\Text\Json\Serialization\Converters\CastingConverter.cs (2)
27Debug.Assert(typeof(T).IsInSubtypeRelationshipWith(sourceConverter.Type!)); 28Debug.Assert(sourceConverter.SourceConverterForCastingConverter is null, "casting converters should not be layered.");
System\Text\Json\Serialization\Converters\Collection\IAsyncEnumerableOfTConverter.cs (4)
76Debug.Assert(state.Current.AsyncDisposable is IAsyncEnumerator<TElement>); 82Debug.Assert(state.PendingTask is Task<bool> && state.PendingTask.IsCompleted); 95Debug.Assert(moveNextTask.IsCompleted); 129Debug.Assert(state.PendingTask is null);
System\Text\Json\Serialization\Converters\Collection\ICollectionOfTConverter.cs (1)
45Debug.Assert(Type.IsInterface);
System\Text\Json\Serialization\Converters\Collection\IDictionaryConverter.cs (1)
111Debug.Assert(Type.IsInterface);
System\Text\Json\Serialization\Converters\Collection\IDictionaryOfTKeyTValueConverter.cs (1)
59Debug.Assert(Type.IsInterface);
System\Text\Json\Serialization\Converters\Collection\IEnumerableConverterFactory.cs (2)
172Debug.Assert(typeof(IEnumerable).IsAssignableFrom(typeToConvert)); 195Debug.Assert(numberOfGenericArgs == 3);
System\Text\Json\Serialization\Converters\Collection\IEnumerableConverterFactoryHelpers.cs (2)
72Debug.Assert(type.IsImmutableEnumerableType()); 85Debug.Assert(type.IsImmutableDictionaryType());
System\Text\Json\Serialization\Converters\Collection\IEnumerableDefaultConverter.cs (2)
19Debug.Assert(value is not null); 34Debug.Assert(state.Current.CollectionEnumerator is IEnumerator<TElement>);
System\Text\Json\Serialization\Converters\Collection\IListConverter.cs (1)
84Debug.Assert(Type.IsInterface);
System\Text\Json\Serialization\Converters\Collection\IListOfTConverter.cs (1)
45Debug.Assert(Type.IsInterface);
System\Text\Json\Serialization\Converters\Collection\ImmutableDictionaryOfTKeyTValueConverter.cs (1)
45Debug.Assert(creator != null);
System\Text\Json\Serialization\Converters\Collection\ImmutableEnumerableOfTConverter.cs (1)
33Debug.Assert(creator != null);
System\Text\Json\Serialization\Converters\Collection\ISetOfTConverter.cs (1)
42Debug.Assert(Type.IsInterface);
System\Text\Json\Serialization\Converters\Collection\JsonCollectionConverter.cs (10)
41Debug.Assert(state.Current.ReturnValue is TCollection); 57Debug.Assert(state.Current.JsonPropertyInfo != null); 166Debug.Assert(!IsValueType); 184Debug.Assert(state.ReferenceId != null); 185Debug.Assert(options.ReferenceHandlingStrategy == JsonKnownReferenceHandler.Preserve); 186Debug.Assert(state.Current.ReturnValue is TCollection); 266Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 269Debug.Assert(JsonSerializer.IsMetadataPropertyName(reader.GetUnescapedSpan(), (state.Current.BaseJsonTypeInfo ?? jsonTypeInfo).PolymorphicTypeResolver), "should only be hit if metadata property."); 271Debug.Assert(result, "Metadata reader must have buffered all contents."); 272Debug.Assert(reader.TokenType is JsonTokenType.EndObject);
System\Text\Json\Serialization\Converters\Collection\JsonDictionaryConverter.cs (8)
56Debug.Assert(state.Current.ReturnValue is TDictionary); 113Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 139Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 188Debug.Assert(!IsValueType); 207Debug.Assert(state.ReferenceId != null); 208Debug.Assert(options.ReferenceHandlingStrategy == JsonKnownReferenceHandler.Preserve); 209Debug.Assert(state.Current.ReturnValue is TDictionary); 246Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Collection\MemoryConverterFactory.cs (1)
26Debug.Assert(CanConvert(typeToConvert));
System\Text\Json\Serialization\Converters\Collection\RootLevelListConverter.cs (1)
28Debug.Assert(reader.AllowMultipleValues, "Can only be used by readers allowing trailing content.");
System\Text\Json\Serialization\Converters\Collection\StackOrQueueConverter.cs (2)
19Debug.Assert(addMethodDelegate != null); 40Debug.Assert(typeInfo.AddMethodDelegate != null);
System\Text\Json\Serialization\Converters\FSharp\FSharpTypeConverterFactory.cs (2)
31Debug.Assert(CanConvert(typeToConvert)); 66Debug.Assert(objectFactory.CanConvert(typeToConvert));
System\Text\Json\Serialization\Converters\JsonMetadataServicesConverter.cs (1)
54Debug.Assert(jsonTypeInfo is JsonTypeInfo<T> typeInfo && typeInfo.SerializeHandler != null);
System\Text\Json\Serialization\Converters\Node\JsonArrayConverter.cs (1)
46Debug.Assert(reader.TokenType == JsonTokenType.StartArray);
System\Text\Json\Serialization\Converters\Node\JsonNodeConverter.cs (2)
53Debug.Assert(false); 74Debug.Assert(false);
System\Text\Json\Serialization\Converters\Node\JsonNodeConverterFactory.cs (1)
33Debug.Assert(typeof(JsonNode) == typeToConvert);
System\Text\Json\Serialization\Converters\Node\JsonObjectConverter.cs (4)
26Debug.Assert(success); // Node converters are not resumable. 28Debug.Assert(obj is JsonObject); 31Debug.Assert(value == null || value is JsonNode); 84Debug.Assert(reader.TokenType == JsonTokenType.StartObject);
System\Text\Json\Serialization\Converters\Node\JsonValueConverter.cs (1)
45Debug.Assert(reader.TokenType is JsonTokenType.String or JsonTokenType.False or JsonTokenType.True or JsonTokenType.Number);
System\Text\Json\Serialization\Converters\Object\ObjectConverter.cs (2)
104Debug.Assert(options.UnknownTypeHandling == JsonUnknownTypeHandling.JsonNode); 130Debug.Assert(options.UnknownTypeHandling == JsonUnknownTypeHandling.JsonNode);
System\Text\Json\Serialization\Converters\Object\ObjectConverterFactory.cs (1)
33Debug.Assert(!typeof(IEnumerable).IsAssignableFrom(typeToConvert));
System\Text\Json\Serialization\Converters\Object\ObjectDefaultConverter.cs (15)
50Debug.Assert(obj != null); 91Debug.Assert(!IsValueType); 127Debug.Assert(state.ReferenceId != null); 128Debug.Assert(options.ReferenceHandlingStrategy == JsonKnownReferenceHandler.Preserve); 142Debug.Assert(obj != null); 172Debug.Assert(tokenType == JsonTokenType.PropertyName); 178Debug.Assert(options.AllowOutOfOrderMetadataProperties); 196Debug.Assert(state.Current.JsonPropertyInfo != null); 257Debug.Assert(obj != null); 290Debug.Assert(tokenType == JsonTokenType.PropertyName); 293Debug.Assert(!isAlreadyReadMetadataProperty, "Only possible for types that can read metadata, which do not call into the fast-path method."); 348Debug.Assert(success); 363Debug.Assert(success); 397Debug.Assert(jsonPropertyInfo.EffectiveConverter.ConverterStrategy != ConverterStrategy.Value); 475Debug.Assert(success, "Serializer should guarantee sufficient read-ahead has been done.");
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.cs (20)
75Debug.Assert(properties != null); 94Debug.Assert(tempReader.TokenType == JsonTokenType.PropertyName); 104Debug.Assert(jsonPropertyInfo == state.Current.JsonTypeInfo.ExtensionDataProperty); 154Debug.Assert(!IsValueType); 209Debug.Assert(state.ReferenceId != null); 210Debug.Assert(options.ReferenceHandlingStrategy == JsonKnownReferenceHandler.Preserve); 227Debug.Assert(jsonPropertyInfo.Set != null); 236Debug.Assert(jsonPropertyInfo == state.Current.JsonTypeInfo.ExtensionDataProperty); 277Debug.Assert(obj != null); 316Debug.Assert(tokenType == JsonTokenType.PropertyName); 321Debug.Assert(options.AllowOutOfOrderMetadataProperties); 346Debug.Assert(success, "Serializer should guarantee sufficient read-ahead has been done."); 352Debug.Assert(jsonParameterInfo.MatchingProperty != null); 426Debug.Assert(tokenType == JsonTokenType.PropertyName); 431Debug.Assert(options.AllowOutOfOrderMetadataProperties); 457Debug.Assert(jsonPropertyInfo == null); 554Debug.Assert(jsonPropertyInfo.CanDeserialize); 605Debug.Assert(state.Current.CtorArgumentState != null); 620Debug.Assert(state.Current.JsonTypeInfo.Kind is JsonTypeInfoKind.Object); 621Debug.Assert(state.Current.CtorArgumentState != null);
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.Large.cs (3)
19Debug.Assert(jsonParameterInfo.ShouldDeserialize); 38Debug.Assert(frame.CtorArgumentState != null); 39Debug.Assert(frame.JsonTypeInfo.CreateObjectWithArgs != null);
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.Small.cs (3)
30Debug.Assert(state.Current.CtorArgumentState!.Arguments != null); 63Debug.Assert(jsonParameterInfo.ShouldDeserialize); 93Debug.Assert(typeInfo.CreateObjectWithArgs != null);
System\Text\Json\Serialization\Converters\Value\BooleanConverter.cs (1)
25Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\ByteConverter.cs (1)
29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\CharConverter.cs (1)
49Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\DateOnlyConverter.cs (3)
27Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 69Debug.Assert(formattedSuccessfully && charsWritten == FormatLength); 77Debug.Assert(formattedSuccessfully && charsWritten == FormatLength);
System\Text\Json\Serialization\Converters\Value\DateTimeConverter.cs (1)
23Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\DateTimeOffsetConverter.cs (1)
23Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\DecimalConverter.cs (1)
28Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\DoubleConverter.cs (1)
29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (13)
58Debug.Assert(EnumConverterFactory.Helpers.IsSupportedTypeCode(s_enumTypeCode)); 147Debug.Assert(s_isFlagsEnum, "Should only be entered by flags enums."); 207Debug.Assert(s_isFlagsEnum || dictionaryKeyPolicy != null, "Should only be entered by flags enums or dictionary key policy."); 238Debug.Assert(reader.TokenType is JsonTokenType.String or JsonTokenType.PropertyName); 368Debug.Assert(s_isSignedEnum); 398Debug.Assert(IsDefinedValueOrCombinationOfValues(key), "must only be invoked against valid enum values."); 399Debug.Assert( 432Debug.Assert(remainingBits == 0 && sb.Length > 0, "unexpected remaining bits or empty string."); 437Debug.Assert(dictionaryKeyPolicy != null); 523Debug.Assert(names.Length == values.Length); 593Debug.Assert(JsonName.Equals(other.JsonName, StringComparison.OrdinalIgnoreCase), "The conflicting entry must be equal up to case insensitivity."); 638Debug.Assert(input.Equals(JsonName.AsSpan(), StringComparison.OrdinalIgnoreCase), "Must equal the field name up to case insensitivity."); 648Debug.Assert(conflictingFields.Count > 0);
System\Text\Json\Serialization\Converters\Value\EnumConverterFactory.cs (1)
24Debug.Assert(CanConvert(type));
System\Text\Json\Serialization\Converters\Value\GuidConverter.cs (1)
24Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\HalfConverter.cs (3)
61Debug.Assert(!Half.IsNaN(result) && !Half.IsInfinity(result)); 74Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 183Debug.Assert(formattedSuccessfully);
System\Text\Json\Serialization\Converters\Value\Int128Converter.cs (2)
68Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 117Debug.Assert(formattedSuccessfully);
System\Text\Json\Serialization\Converters\Value\Int16Converter.cs (1)
30Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\Int32Converter.cs (1)
30Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\Int64Converter.cs (1)
29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\JsonPrimitiveConverter.cs (3)
35Debug.Assert(schemaType is JsonSchemaType.Integer or JsonSchemaType.Number); 36Debug.Assert(!isIeeeFloatingPoint || schemaType is JsonSchemaType.Number); 38Debug.Assert(isIeeeFloatingPoint == (typeof(T) == typeof(double) || typeof(T) == typeof(float) || typeof(T) == typeof(Half)));
System\Text\Json\Serialization\Converters\Value\NullableConverterFactory.cs (2)
21Debug.Assert(typeToConvert.IsNullableOfT()); 37Debug.Assert(valueTypeToConvert.IsValueType && !valueTypeToConvert.IsNullableOfT());
System\Text\Json\Serialization\Converters\Value\SByteConverter.cs (1)
29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\SingleConverter.cs (1)
30Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\StringConverter.cs (1)
32Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\TimeOnlyConverter.cs (5)
29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 35Debug.Assert(reader.TokenType is JsonTokenType.String or JsonTokenType.PropertyName); 75Debug.Assert(TimeOnly.MinValue.ToTimeSpan() <= timespan && timespan <= TimeOnly.MaxValue.ToTimeSpan()); 84Debug.Assert(result); 94Debug.Assert(result);
System\Text\Json\Serialization\Converters\Value\TimeSpanConverter.cs (4)
29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 35Debug.Assert(reader.TokenType is JsonTokenType.String or JsonTokenType.PropertyName); 82Debug.Assert(result); 92Debug.Assert(result);
System\Text\Json\Serialization\Converters\Value\UInt128Converter.cs (2)
68Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 117Debug.Assert(formattedSuccessfully);
System\Text\Json\Serialization\Converters\Value\UInt16Converter.cs (1)
30Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\UInt32Converter.cs (1)
30Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\UInt64Converter.cs (1)
29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\UnsupportedTypeConverterFactory.cs (1)
35Debug.Assert(CanConvert(type));
System\Text\Json\Serialization\Converters\Value\UriConverter.cs (1)
30Debug.Assert(reader.TokenType is JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\VersionConverter.cs (3)
37Debug.Assert(reader.TokenType is JsonTokenType.PropertyName or JsonTokenType.String); 96Debug.Assert(formattedSuccessfully && charsWritten >= MinimumVersionLength); 119Debug.Assert(formattedSuccessfully && charsWritten >= MinimumVersionLength);
System\Text\Json\Serialization\IgnoreReferenceResolver.cs (2)
16Debug.Assert(_stackForCycleDetection != null); 29Debug.Assert(!_stackForCycleDetection.Contains(wrappedValue));
System\Text\Json\Serialization\JsonConverter.cs (2)
122Debug.Assert(this is not JsonConverterFactory); 191Debug.Assert(state.FlushThreshold == 0 || (state.PipeWriter is { CanGetUnflushedBytes: true }),
System\Text\Json\Serialization\JsonConverter.MetadataHandling.cs (23)
16Debug.Assert(!IsValueType); 17Debug.Assert(CanHaveMetadata); 18Debug.Assert((state.Current.MetadataPropertyNames & MetadataPropertyName.Type) != 0); 19Debug.Assert(state.Current.PolymorphicSerializationState != PolymorphicSerializationState.PolymorphicReEntryStarted); 20Debug.Assert(jsonTypeInfo.PolymorphicTypeResolver?.UsesTypeDiscriminators == true); 27Debug.Assert(!state.IsContinuation); 28Debug.Assert(state.PolymorphicTypeDiscriminator != null); 33Debug.Assert(Type!.IsAssignableFrom(resolvedType.Type)); 51Debug.Assert(Type!.IsAssignableFrom(polymorphicConverter.Type)); 55Debug.Assert(state.Current.PolymorphicJsonTypeInfo is null); 71Debug.Assert(!IsValueType); 72Debug.Assert(value != null && Type!.IsAssignableFrom(value.GetType())); 73Debug.Assert(CanBePolymorphic || jsonTypeInfo.PolymorphicTypeResolver != null); 74Debug.Assert(state.PolymorphicTypeDiscriminator is null); 81Debug.Assert(!state.IsContinuation); 87Debug.Assert(Type == typeof(object)); 94Debug.Assert(jsonTypeInfo.Converter.CanHaveMetadata); 121Debug.Assert(state.IsContinuation); 123Debug.Assert(Type.IsAssignableFrom(polymorphicConverter.Type)); 127Debug.Assert(state.IsContinuation); 140Debug.Assert(!IsValueType); 141Debug.Assert(!state.IsContinuation); 142Debug.Assert(value != null);
System\Text\Json\Serialization\JsonConverterFactory.cs (1)
37Debug.Assert(CanConvert(typeToConvert));
System\Text\Json\Serialization\JsonConverterOfT.cs (23)
166Debug.Assert(!state.IsContinuation); 208Debug.Assert(IsInternalConverter); 220Debug.Assert(this is ObjectConverter); 222Debug.Assert(success); 235Debug.Assert(Type == state.Current.JsonTypeInfo.Type); 241Debug.Assert(state.Current.OriginalTokenType == JsonTokenType.None); 244Debug.Assert(state.Current.OriginalDepth == 0); 277Debug.Assert(ReferenceEquals(originalJsonTypeInfo, state.Current.JsonTypeInfo)); 344Debug.Assert(!state.IsContinuation); 361Debug.Assert(IsInternalConverter); 378Debug.Assert(jsonTypeInfo.Converter.Type == Type); 415Debug.Assert(Type == state.Current.JsonTypeInfo.Type); 421Debug.Assert(state.Current.OriginalDepth == 0); 440Debug.Assert(ReferenceEquals(originalJsonTypeInfo, state.Current.JsonTypeInfo)); 447Debug.Assert(value != null); 461Debug.Assert(Type == typeof(Nodes.JsonObject)); 477Debug.Assert(state.Current.OriginalDepth == 0); 501Debug.Assert(isValueConverter == (ConverterStrategy == ConverterStrategy.Value)); 530Debug.Assert(IsRootLevelMultiContentStreamingConverter); 553Debug.Assert(reader.TokenType == tokenType); 605Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 644Debug.Assert(!IsInternalConverter && Type == typeof(string)); 670Debug.Assert(defaultConverter != this);
System\Text\Json\Serialization\JsonConverterOfT.ReadCore.cs (1)
28Debug.Assert(!reader.AllowMultipleValues, "should not be entered by converters allowing multiple values.");
System\Text\Json\Serialization\JsonSerializer.Helpers.cs (3)
35Debug.Assert(inputType != null); 55Debug.Assert(context != null); 56Debug.Assert(inputType != null);
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (16)
27Debug.Assert(state.Current.ObjectState == StackFrameObjectState.StartToken); 28Debug.Assert(state.Current.CanContainMetadata); 58Debug.Assert(!allowOutOfOrderMetadata, "Object must have already been buffered in this mode."); 74Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 161Debug.Assert(state.Current.LatestMetadataPropertyName == MetadataPropertyName.None); 202Debug.Assert(!allowOutOfOrderMetadata, "Object must have already been buffered in this mode."); 209Debug.Assert(state.Current.PropertyState == StackFramePropertyState.ReadValue); 242Debug.Assert(state.PolymorphicTypeDiscriminator == null); 270Debug.Assert(!isReadingAheadOfNonMetadataProperties, "must have already verified if non-metadata properties precede $values"); 285Debug.Assert(state.Current.LatestMetadataPropertyName == MetadataPropertyName.None); 286Debug.Assert(allowOutOfOrderMetadata, "should only be reached if reading ahead is required."); 473Debug.Assert(metadataValueKind != JsonValueKind.Undefined); 497Debug.Assert(state.Current.MetadataPropertyNames is MetadataPropertyName.None || state.Current.MetadataPropertyNames.HasFlag(MetadataPropertyName.Values)); 509Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 518Debug.Assert(!typeof(T).IsValueType); 519Debug.Assert(state.ReferenceId != null);
System\Text\Json\Serialization\JsonSerializer.Read.HandlePropertyName.cs (8)
46Debug.Assert(jsonTypeInfo.ExtensionDataProperty is null, "jsonTypeInfo.Configure() should have caught conflicting configuration."); 58Debug.Assert(obj != null, "obj is null"); 110Debug.Assert(jsonPropertyInfo != null); 120Debug.Assert(underlyingIDictionaryType.IsGenericType); 121Debug.Assert(genericArgs.Length == 2); 122Debug.Assert(genericArgs[0].UnderlyingSystemType == typeof(string)); 123Debug.Assert( 146Debug.Assert(jsonPropertyInfo.Set != null);
System\Text\Json\Serialization\JsonSerializer.Read.Span.cs (4)
137Debug.Assert(jsonTypeInfo.IsConfigured); 148Debug.Assert(reader.BytesConsumed == (actualByteCount ?? utf8Json.Length) || reader.CurrentState.Options.AllowMultipleValues); 154Debug.Assert(jsonTypeInfo.IsConfigured); 165Debug.Assert(reader.BytesConsumed == (actualByteCount ?? utf8Json.Length) || reader.CurrentState.Options.AllowMultipleValues);
System\Text\Json\Serialization\JsonSerializer.Read.Stream.cs (2)
462Debug.Assert(jsonTypeInfo.IsConfigured); 484Debug.Assert(listTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializer.Read.String.cs (2)
383Debug.Assert(jsonTypeInfo.IsConfigured); 414Debug.Assert(jsonTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializer.Read.Utf8JsonReader.cs (5)
272Debug.Assert(jsonTypeInfo.IsConfigured); 297Debug.Assert(jsonTypeInfo.IsConfigured); 374Debug.Assert(reader.TokenType is JsonTokenType.EndObject or JsonTokenType.EndArray); 402Debug.Assert(payloadLength > 1); 453Debug.Assert(!valueSpan.IsEmpty ^ !valueSequence.IsEmpty);
System\Text\Json\Serialization\JsonSerializer.Write.ByteArray.cs (2)
131Debug.Assert(jsonTypeInfo.IsConfigured); 148Debug.Assert(jsonTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializer.Write.Document.cs (2)
124Debug.Assert(jsonTypeInfo.IsConfigured); 145Debug.Assert(jsonTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializer.Write.Element.cs (2)
125Debug.Assert(jsonTypeInfo.IsConfigured); 144Debug.Assert(options != null);
System\Text\Json\Serialization\JsonSerializer.Write.HandleMetadata.cs (8)
22Debug.Assert(jsonConverter.CanHaveMetadata); 23Debug.Assert(!state.IsContinuation); 24Debug.Assert(state.CurrentContainsMetadata); 37Debug.Assert(state.PolymorphicTypeResolver != null); 50Debug.Assert(discriminator is int); 58Debug.Assert(writtenMetadata != MetadataPropertyName.None); 79Debug.Assert(state.NewReferenceId == null); 82Debug.Assert(referenceId != null);
System\Text\Json\Serialization\JsonSerializer.Write.Node.cs (2)
126Debug.Assert(jsonTypeInfo.IsConfigured); 144Debug.Assert(jsonTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializer.Write.String.cs (2)
148Debug.Assert(jsonTypeInfo.IsConfigured); 165Debug.Assert(jsonTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializerContext.cs (2)
42Debug.Assert(!options.IsReadOnly); 54Debug.Assert(options != null);
System\Text\Json\Serialization\JsonSerializerOptions.Caching.cs (11)
27Debug.Assert(IsReadOnly); 106Debug.Assert(!fallBackToNearestAncestorType || IsReadOnly, "ancestor resolution should only be invoked in read-only options."); 107Debug.Assert(ensureNotNull is null or true, "Explicitly passing false will result in invalid result annotation."); 161Debug.Assert(rootValue != null); 187Debug.Assert(IsReadOnly); 274Debug.Assert(!entry.HasResult); 299Debug.Assert(!entry.HasResult); 401Debug.Assert(options.IsReadOnly, "Cannot create caching contexts for mutable JsonSerializerOptions instances"); 402Debug.Assert(options._typeInfoResolver != null); 436Debug.Assert(weakRef.TryGetTarget(out _) is false); 486Debug.Assert(left != null && right != null);
System\Text\Json\Serialization\JsonSerializerOptions.cs (7)
657Debug.Assert(value >= 0); 883Debug.Assert(IsReadOnly); 884Debug.Assert(TypeInfoResolver != null); 954Debug.Assert(IsReadOnly); 1003Debug.Assert(_typeInfoResolver != null); 1044Debug.Assert(_effectiveJsonTypeInfoResolver is null, "an effective resolver always returns metadata"); 1144Debug.Assert(item is not null);
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Converters.cs (5)
84Debug.Assert(converters.Count <= NumberOfSimpleConverters); 115Debug.Assert(converter != null); 135Debug.Assert(memberInfo is FieldInfo or PropertyInfo); 136Debug.Assert(typeToConvert != null); 201Debug.Assert(converter != null);
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (11)
98Debug.Assert(!typeInfo.IsReadOnly); 99Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Object); 147Debug.Assert(!typeInfo.IsReadOnly); 148Debug.Assert(currentType.IsAssignableFrom(typeInfo.Type)); 216Debug.Assert(jsonPropertyInfo.Name != null); 288Debug.Assert(typeInfo.Converter.ConstructorInfo != null); 300Debug.Assert(typeInfo.Converter.ConstructorInfo.DeclaringType != null); 331Debug.Assert(jsonPropertyInfo.AttributeProvider == null); 412Debug.Assert(memberInfo is FieldInfo or PropertyInfo); 432Debug.Assert(fieldInfo.IsPublic || useNonPublicAccessors); 484Debug.Assert(propertyInfo.MemberType is MemberTypes.Field);
System\Text\Json\Serialization\Metadata\FSharpCoreReflectionProxy.cs (9)
90Debug.Assert(s_singletonInstance is not null, "should be initialized via a successful IsFSharpType call."); 99Debug.Assert(fsharpCoreAssembly.GetName().Name == "FSharp.Core"); 149Debug.Assert(typeof(TFSharpOption).GetGenericTypeDefinition() == _fsharpOptionType); 158Debug.Assert(typeof(TFSharpOption).GetGenericTypeDefinition() == _fsharpOptionType); 168Debug.Assert(typeof(TFSharpValueOption).GetGenericTypeDefinition() == _fsharpValueOptionType); 177Debug.Assert(typeof(TFSharpOption).GetGenericTypeDefinition() == _fsharpValueOptionType); 186Debug.Assert(typeof(TFSharpList).GetGenericTypeDefinition() == _fsharpListType); 194Debug.Assert(typeof(TFSharpSet).GetGenericTypeDefinition() == _fsharpSetType); 202Debug.Assert(typeof(TFSharpMap).GetGenericTypeDefinition() == _fsharpMapType);
System\Text\Json\Serialization\Metadata\JsonDerivedType.cs (1)
47Debug.Assert(typeDiscriminator is null or int or string);
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Helpers.cs (8)
88Debug.Assert(typeInfo.Kind != JsonTypeInfoKind.None); 118Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Object); 119Debug.Assert(!typeInfo.IsReadOnly); 133Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Object); 134Debug.Assert(!typeInfo.IsConfigured); 135Debug.Assert(typeInfo.Type != JsonTypeInfo.ObjectType); 136Debug.Assert(typeInfo.Converter.ElementType is null); 151Debug.Assert(jsonPropertyInfo.MemberName != null, "MemberName is not set by source gen");
System\Text\Json\Serialization\Metadata\JsonParameterInfo.cs (2)
17Debug.Assert(matchingProperty.PropertyType == parameterInfoValues.ParameterType); 98Debug.Assert(MatchingProperty.DeclaringTypeInfo != null, "Declaring type metadata must have already been configured.");
System\Text\Json\Serialization\Metadata\JsonParameterInfoOfT.cs (2)
21Debug.Assert(parameterInfoValues.ParameterType == typeof(T)); 22Debug.Assert(!matchingPropertyInfo.IsConfigured);
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (35)
29Debug.Assert(_effectiveConverter != null); 142Debug.Assert(!IsConfigured); 376Debug.Assert(declaringTypeInfo is null || declaringType.IsAssignableFrom(declaringTypeInfo.Type)); 390Debug.Assert(!info.IsForTypeInfo); 391Debug.Assert(!info.CanSerialize); 392Debug.Assert(!info.CanDeserialize); 418Debug.Assert(DeclaringTypeInfo != null); 419Debug.Assert(!IsConfigured); 463Debug.Assert(!IgnoreNullTokensOnRead); 477Debug.Assert(Name != null); 506Debug.Assert(Options.DefaultIgnoreCondition == JsonIgnoreCondition.Never); 528Debug.Assert(EffectiveConverter != null, "Must have calculated the effective converter."); 532Debug.Assert(MemberType is 0 or MemberTypes.Field or MemberTypes.Property); 565Debug.Assert(DeclaringTypeInfo != null, "We should have ensured parent is assigned in JsonTypeInfo"); 566Debug.Assert(!DeclaringTypeInfo.IsConfigured); 593Debug.Assert(DeclaringTypeInfo != null, "We should have ensured parent is assigned in JsonTypeInfo"); 594Debug.Assert(!IsConfigured, "Should not be called post-configuration."); 595Debug.Assert(_jsonTypeInfo != null, "Must have already been determined on configuration."); 620Debug.Assert(EffectiveConverter != null, "Must have calculated the effective converter."); 621Debug.Assert(DeclaringTypeInfo != null, "We should have ensured parent is assigned in JsonTypeInfo"); 622Debug.Assert(!IsConfigured, "Should not be called post-configuration."); 662Debug.Assert(_jsonTypeInfo != null); 663Debug.Assert(_jsonTypeInfo.IsConfigurationStarted); 709Debug.Assert(EffectiveConverter.ElementType != null); 755Debug.Assert(MemberType == MemberTypes.Property || MemberType == MemberTypes.Field || MemberType == default); 793Debug.Assert(_name != null); 875Debug.Assert(propValue is Nodes.JsonObject); 890Debug.Assert(dictionaryValueInfo is JsonTypeInfo<TValue>); 925Debug.Assert(this == state.Current.JsonTypeInfo.ExtensionDataProperty); 968Debug.Assert(EffectiveConverter.CanPopulate, "Property is marked with Populate but converter cannot populate. This should have been validated in Configure"); 969Debug.Assert(state.Parent.ReturnValue != null, "Parent object is null"); 970Debug.Assert(!state.Current.IsPopulating, "We've called TryGetPrePopulatedValue more than once"); 981Debug.Assert(_jsonTypeInfo?.IsConfigurationStarted == true); 1080Debug.Assert(IsConfigured); 1085Debug.Assert(!IsConfigured);
System\Text\Json\Serialization\Metadata\JsonPropertyInfoOfT.cs (17)
38Debug.Assert(getter is null or Func<object, object?> or Func<object, T>); 39Debug.Assert(!IsConfigured); 61Debug.Assert(setter is null or Action<object, object?> or Action<object, T>); 62Debug.Assert(!IsConfigured); 92Debug.Assert(predicate is null or Func<object, object?, bool> or Func<object, T?, bool>); 93Debug.Assert(!IsConfigured); 117Debug.Assert(!IsConfigured); 118Debug.Assert(AssociatedParameter is null); 135Debug.Assert(_typedEffectiveConverter != null); 149Debug.Assert(jsonTypeInfo is JsonTypeInfo<T>); 167Debug.Assert(HasGetter); 190Debug.Assert(value == null); 210Debug.Assert(PropertyTypeCanBeNull); 287Debug.Assert(CanDeserialize || EffectiveObjectCreationHandling == JsonObjectCreationHandling.Populate); 311Debug.Assert(!state.IsContinuation); 312Debug.Assert(EffectiveObjectCreationHandling != JsonObjectCreationHandling.Populate, "Populating should not be possible for simple types"); 385Debug.Assert(!state.IsContinuation);
System\Text\Json\Serialization\Metadata\JsonTypeInfo.Cache.cs (7)
26Debug.Assert(IsConfigured && _parameterCache is not null); 35Debug.Assert(IsConfigured); 47Debug.Assert(IsConfigured && _propertyCache is not null); 59Debug.Assert(IsConfigured && _propertyIndex is not null); 78Debug.Assert(IsConfigured); 175Debug.Assert(frame.PropertyRefCacheBuilder is { Count: > 0 }); 183Debug.Assert(newCache.Length <= PropertyRefCacheBuilder.MaxCapacity);
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (41)
280Debug.Assert(!IsReadOnly); 281Debug.Assert(_properties is null, "must not be set if a property list has been initialized."); 390Debug.Assert(IsConfigured); 391Debug.Assert(_elementTypeInfo is null or { IsConfigurationStarted: true }); 402Debug.Assert(!IsReadOnly); 403Debug.Assert(value is null || value.Type == ElementType); 416Debug.Assert(IsConfigured); 417Debug.Assert(_keyTypeInfo is null or { IsConfigurationStarted: true }); 428Debug.Assert(!IsReadOnly); 429Debug.Assert(value is null || value.Type == KeyType); 660Debug.Assert(!IsReadOnly); 743Debug.Assert(Monitor.IsEntered(Options.CacheContext), "Configure called directly, use EnsureConfigured which synchronizes access to this method"); 744Debug.Assert(Options.IsReadOnly); 745Debug.Assert(IsReadOnly); 792Debug.Assert(IsConfigured); 793Debug.Assert(Type != typeof(object)); 820Debug.Assert(IsReadOnly); 821Debug.Assert(!IsConfigured); 833Debug.Assert(property.IsConfigured); 857Debug.Assert(IsCompatibleWithCurrentOptions); 971Debug.Assert(jsonTypeInfo.Type == type); 1026Debug.Assert(jsonPropertyInfo.PropertyType == propertyType); 1067Debug.Assert(Kind == JsonTypeInfoKind.Object); 1068Debug.Assert(_propertyCache is null); 1069Debug.Assert(_propertyIndex is null); 1070Debug.Assert(ExtensionDataProperty is null); 1084Debug.Assert(property.DeclaringTypeInfo == this); 1165Debug.Assert( 1184Debug.Assert(Kind == JsonTypeInfoKind.Object); 1185Debug.Assert(DetermineUsesParameterizedConstructor()); 1186Debug.Assert(_propertyCache is not null); 1187Debug.Assert(_parameterCache is null); 1217Debug.Assert(ExtensionDataProperty.MemberName != null, "Custom property info cannot be data extension property"); 1240Debug.Assert(!IsReadOnly); 1252Debug.Assert(!IsReadOnly); 1280Debug.Assert(!IsReadOnly); 1319Debug.Assert(IsConfigurationStarted); 1337Debug.Assert(converter is ObjectConverter); 1348Debug.Assert(converter is JsonConverterFactory); 1395Debug.Assert(!_jsonTypeInfo.IsConfigured); 1396Debug.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 (7)
60Debug.Assert(createObject is null or Func<object> or Func<T>); 66Debug.Assert(_createObject == null); 67Debug.Assert(_typedCreateObject == null); 73Debug.Assert(_createObject is null); 74Debug.Assert(_typedCreateObject == null); 93Debug.Assert(createObject is Func<object>); 132Debug.Assert(!IsReadOnly, "We should not mutate read-only JsonTypeInfo");
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.ReadHelper.cs (6)
19Debug.Assert(IsConfigured); 21Debug.Assert(success, "Should only return false for async deserialization"); 27Debug.Assert(IsConfigured); 60Debug.Assert(IsConfigured); 120Debug.Assert(reader.BytesConsumed <= bufferState.Bytes.Length); 121Debug.Assert(!bufferState.IsFinalBlock || reader.AllowMultipleValues || reader.BytesConsumed == bufferState.Bytes.Length,
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.WriteHelpers.cs (25)
24Debug.Assert(IsConfigured); 25Debug.Assert(rootValueBoxed is null || rootValueBoxed is T); 33Debug.Assert(SerializeHandler != null); 34Debug.Assert(Converter is JsonMetadataServicesConverter<T>); 47Debug.Assert(typeof(T) == typeof(object)); 57Debug.Assert(success); 91Debug.Assert(IsConfigured); 92Debug.Assert(rootValueBoxed is null || rootValueBoxed is T); 98Debug.Assert(SerializeHandler != null); 99Debug.Assert(CanUseSerializeHandler); 100Debug.Assert(Converter is JsonMetadataServicesConverter<T>); 142Debug.Assert(typeof(T) == typeof(object)); 175Debug.Assert(!isFinalBlock); 176Debug.Assert(state.PendingTask is not null); 227Debug.Assert(writer.BytesPending == 0); 257Debug.Assert(IsConfigured); 258Debug.Assert(rootValueBoxed is null || rootValueBoxed is T); 264Debug.Assert(SerializeHandler != null); 265Debug.Assert(CanUseSerializeHandler); 266Debug.Assert(Converter is JsonMetadataServicesConverter<T>); 292Debug.Assert(typeof(T) == typeof(object)); 305Debug.Assert(bufferWriter.CanGetUnflushedBytes); 320Debug.Assert(state.PendingTask == null); 328Debug.Assert(writer.BytesPending == 0); 370Debug.Assert(CanUseSerializeHandler);
System\Text\Json\Serialization\Metadata\JsonTypeInfoResolverWithAddedModifiers.cs (1)
15Debug.Assert(modifiers.Length > 0);
System\Text\Json\Serialization\Metadata\PolymorphicTypeResolver.cs (13)
37Debug.Assert(typeDiscriminator is null or int or string); 73Debug.Assert(_discriminatorIdtoType != null, "Discriminator index must have been populated."); 121Debug.Assert(BaseType.IsAssignableFrom(runtimeType)); 165Debug.Assert(typeDiscriminator is int or string); 166Debug.Assert(UsesTypeDiscriminators); 167Debug.Assert(_discriminatorIdtoType != null); 171Debug.Assert(typeDiscriminator.Equals(result.TypeDiscriminator)); 201Debug.Assert(!type.IsAbstract); 202Debug.Assert(BaseType.IsAssignableFrom(type)); 203Debug.Assert(UnknownDerivedTypeHandling == JsonUnknownDerivedTypeHandling.FallBackToNearestAncestor); 215Debug.Assert(candidate != null); 256Debug.Assert(typeInfo.IsConfigured); 334Debug.Assert(typeDiscriminator is null or int or string);
System\Text\Json\Serialization\Metadata\PropertyRef.cs (1)
75Debug.Assert(
System\Text\Json\Serialization\Metadata\PropertyRefCacheBuilder.cs (1)
28Debug.Assert(TotalCount < MaxCapacity, "Should have been checked by the caller.");
System\Text\Json\Serialization\Metadata\ReflectionEmitMemberAccessor.cs (18)
23Debug.Assert(type != null); 24Debug.Assert(constructorInfo is null || constructorInfo.GetParameters().Length == 0); 47Debug.Assert(type.IsValueType); 78Debug.Assert(type != null); 79Debug.Assert(!type.IsAbstract); 80Debug.Assert(constructor.IsPublic && !constructor.IsStatic); 119Debug.Assert(type != null); 120Debug.Assert(!type.IsAbstract); 121Debug.Assert(!constructor.IsStatic); 137Debug.Assert(index <= JsonConstants.UnboxedParameterCountThreshold); 236Debug.Assert(realMethod != null); 239Debug.Assert(declaringType != null); 266Debug.Assert(!runtimePropertyType.IsValueType); 282Debug.Assert(realMethod != null); 285Debug.Assert(declaringType != null); 303Debug.Assert(!runtimePropertyType.IsValueType); 320Debug.Assert(declaringType != null); 354Debug.Assert(declaringType != null);
System\Text\Json\Serialization\Metadata\ReflectionMemberAccessor.cs (7)
21Debug.Assert(type != null); 22Debug.Assert(ctorInfo is null || ctorInfo.GetParameters().Length == 0); 43Debug.Assert(!type.IsAbstract); 44Debug.Assert(constructor.DeclaringType == type && constructor.IsPublic && !constructor.IsStatic); 78Debug.Assert(!type.IsAbstract); 79Debug.Assert(constructor.DeclaringType == type && constructor.IsPublic && !constructor.IsStatic); 83Debug.Assert(parameterCount <= JsonConstants.UnboxedParameterCountThreshold);
System\Text\Json\Serialization\PreserveReferenceResolver.cs (3)
33Debug.Assert(_referenceIdToObjectMap != null); 43Debug.Assert(_objectToReferenceIdMap != null); 62Debug.Assert(_referenceIdToObjectMap != null);
System\Text\Json\Serialization\ReadBufferState.cs (2)
123Debug.Assert(bytesConsumed <= _count); 169Debug.Assert(_buffer.Length >= JsonConstants.Utf8Bom.Length);
System\Text\Json\Serialization\ReadStack.cs (14)
29Debug.Assert(_count > 1); 30Debug.Assert(_stack is not null); 166Debug.Assert(_count > 0); 167Debug.Assert(JsonPath() is not null); 198Debug.Assert(_continuationCount == 0); 212Debug.Assert(!IsContinuation); 213Debug.Assert(Current.PolymorphicJsonTypeInfo == null); 214Debug.Assert(Current.PolymorphicSerializationState == PolymorphicSerializationState.None); 232Debug.Assert(Current.PolymorphicJsonTypeInfo != null); 233Debug.Assert(Current.PolymorphicSerializationState == PolymorphicSerializationState.PolymorphicReEntrySuspended); 246Debug.Assert(Current.PolymorphicJsonTypeInfo != null); 247Debug.Assert(Current.PolymorphicSerializationState == PolymorphicSerializationState.PolymorphicReEntryStarted); 375Debug.Assert(!IsContinuation); 385Debug.Assert(Current.JsonTypeInfo.UsesParameterizedConstructor);
System\Text\Json\Serialization\ReadStackFrame.cs (3)
150Debug.Assert(AssignedProperties is null); 164Debug.Assert(AssignedProperties is not null); 165Debug.Assert(typeInfo.OptionalPropertiesMask is not null);
System\Text\Json\Serialization\WriteStack.cs (14)
35Debug.Assert(_count - _indexOffset > 0); 36Debug.Assert(_stack is not null); 150Debug.Assert(!supportAsync || supportContinuation, "supportAsync must imply supportContinuation"); 151Debug.Assert(!IsContinuation); 152Debug.Assert(CurrentDepth == 0); 163Debug.Assert(options.ReferenceHandler != null); 180Debug.Assert(Current.PolymorphicSerializationState != PolymorphicSerializationState.PolymorphicReEntryStarted); 188Debug.Assert(Current.PolymorphicSerializationState != PolymorphicSerializationState.PolymorphicReEntrySuspended); 236Debug.Assert(_count > 0); 268Debug.Assert(_continuationCount == 0); 283Debug.Assert(CompletedAsyncDisposables?.Count > 0); 314Debug.Assert(Current.AsyncDisposable is null); 320Debug.Assert(_stack[i].AsyncDisposable is null); 368Debug.Assert(!(collectionEnumerator is not null && asyncDisposable is not null));
System\Text\Json\Serialization\WriteStackFrame.cs (4)
120Debug.Assert(PolymorphicSerializationState == PolymorphicSerializationState.None); 142Debug.Assert(PolymorphicSerializationState is PolymorphicSerializationState.None or PolymorphicSerializationState.PolymorphicReEntryStarted); 154Debug.Assert(PolymorphicSerializationState == PolymorphicSerializationState.PolymorphicReEntrySuspended); 155Debug.Assert(PolymorphicTypeInfo is not null);
System\Text\Json\ThrowHelper.cs (8)
148Debug.Assert(value.Length > JsonConstants.MaxUnescapedTokenSize); 162Debug.Assert(value.Length > JsonConstants.MaxCharacterTokenSize); 176Debug.Assert(value.Length > JsonConstants.MaxUnescapedTokenSize); 190Debug.Assert(value.Length > JsonConstants.MaxCharacterTokenSize); 205Debug.Assert(propertyName.Length > JsonConstants.MaxCharacterTokenSize); 214Debug.Assert(currentDepth >= maxDepth); 258Debug.Assert(propertyName.Length > JsonConstants.MaxCharacterTokenSize); 615Debug.Assert(token == JsonConstants.CloseBracket || token == JsonConstants.CloseBrace);
System\Text\Json\ThrowHelper.Node.cs (1)
58Debug.Assert(supportedTypeNames.Length > 0);
System\Text\Json\ThrowHelper.Serialization.cs (11)
156Debug.Assert(propertyName == null); 160Debug.Assert(propertyName != null); 169Debug.Assert(memberInfo == null); 173Debug.Assert(memberInfo != null); 427Debug.Assert(!jsonPropertyInfo.IsForTypeInfo); 472Debug.Assert(ex.Path == null); 505Debug.Assert(ex.Path is null); // do not overwrite existing path information 543Debug.Assert(ex.Path is null); // do not overwrite existing path information 612Debug.Assert(!message.Contains(" Path: ")); 640Debug.Assert(!message.Contains(" Path: ")); 830Debug.Assert(propertyInfo.DeclaringTypeInfo != null, "We should not throw this exception when ParentTypeInfo is null");
System\Text\Json\ValueQueue.cs (2)
40Debug.Assert(_multiple != null); 61Debug.Assert(_multiple != null);
System\Text\Json\Writer\JsonWriterHelper.cs (5)
15Debug.Assert(buffer.Length >= indent); 158Debug.Assert(!utf8FormattedNumber.IsEmpty); 211Debug.Assert(i < utf8FormattedNumber.Length); 294Debug.Assert(status is OperationStatus.Done or OperationStatus.DestinationTooSmall or OperationStatus.InvalidData); 295Debug.Assert(charsRead == source.Length || status is not OperationStatus.Done);
System\Text\Json\Writer\JsonWriterHelper.Date.cs (4)
19Debug.Assert(result); 28Debug.Assert(result); 51Debug.Assert(buffer.Length == maxDateTimeLength || 102Debug.Assert(buffer[maxDateTimeLength] == 'Z');
System\Text\Json\Writer\JsonWriterHelper.Escaping.cs (16)
82Debug.Assert(textLength > 0); 83Debug.Assert(firstIndexToEscape >= 0 && firstIndexToEscape < textLength); 89Debug.Assert(encoder != null); 93Debug.Assert(result != OperationStatus.DestinationTooSmall); 94Debug.Assert(result != OperationStatus.NeedMoreData || !isFinalBlock); 101Debug.Assert(encoderBytesConsumed == value.Length || (result == OperationStatus.NeedMoreData && !isFinalBlock)); 112Debug.Assert(indexOfFirstByteToEscape >= 0 && indexOfFirstByteToEscape < value.Length); 194Debug.Assert(result); 195Debug.Assert(bytesWritten == 4); 207Debug.Assert(encoder != null); 211Debug.Assert(result != OperationStatus.DestinationTooSmall); 212Debug.Assert(result != OperationStatus.NeedMoreData || !isFinalBlock); 219Debug.Assert(encoderBytesConsumed == value.Length || (result == OperationStatus.NeedMoreData && !isFinalBlock)); 230Debug.Assert(indexOfFirstByteToEscape >= 0 && indexOfFirstByteToEscape < value.Length); 279Debug.Assert(IsAsciiValue(value)); 315Debug.Assert(charsWritten == 4);
System\Text\Json\Writer\Utf8JsonWriter.cs (51)
125Debug.Assert(_enclosingContainer == EnclosingContainerType.Utf8StringSequence); 128Debug.Assert(partialStringDataBytes.Length == 3); 131Debug.Assert(length < 4); 138Debug.Assert(value.Length <= 3); 154Debug.Assert(_enclosingContainer == EnclosingContainerType.Utf16StringSequence); 157Debug.Assert(partialStringDataBytes.Length == 3); 160Debug.Assert(length is 2 or 0); 166Debug.Assert(value.Length <= 1); 182Debug.Assert(_enclosingContainer == EnclosingContainerType.Base64StringSequence); 185Debug.Assert(partialStringDataBytes.Length == 3); 188Debug.Assert(length < 3); 194Debug.Assert(value.Length < 3); 254Debug.Assert(options.NewLine is "\n" or "\r\n", "Invalid NewLine string."); 354Debug.Assert(_output is null && _stream is null && _arrayBufferWriter is null); 409Debug.Assert(_arrayBufferWriter != null); 428Debug.Assert(_output != null); 518Debug.Assert(_arrayBufferWriter != null); 533Debug.Assert(_output != null); 606Debug.Assert(_options.Indented || !_options.SkipValidation); 619Debug.Assert(!_options.SkipValidation); 645Debug.Assert(!HasPartialStringData); 649Debug.Assert(_tokenType != JsonTokenType.PropertyName); 650Debug.Assert(_tokenType != JsonTokenType.None && _tokenType != JsonTokenType.StartArray); 655Debug.Assert(_tokenType != JsonTokenType.PropertyName); 656Debug.Assert(_tokenType != JsonTokenType.StartObject); 657Debug.Assert(CurrentDepth == 0 && _tokenType != JsonTokenType.None); 665Debug.Assert(indent <= _indentLength * _options.MaxDepth); 722Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 786Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 814Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 815Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 935Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 963Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 964Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 1040Debug.Assert(_options.Indented || !_options.SkipValidation); 1052Debug.Assert(!_options.SkipValidation); 1074Debug.Assert(token == JsonConstants.CloseBrace); 1105Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1106Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.None); 1130Debug.Assert(_newLineLength is 1 or 2, "Invalid new line length."); 1153Debug.Assert(token == JsonConstants.OpenBrace); 1161Debug.Assert(requiredSize > 0); 1171Debug.Assert(BytesPending != 0); 1175Debug.Assert(_arrayBufferWriter != null); 1182Debug.Assert(_memory.Length >= sizeHint); 1186Debug.Assert(_output != null); 1203Debug.Assert(_memory.Length == 0); 1204Debug.Assert(BytesPending == 0); 1210Debug.Assert(_arrayBufferWriter != null); 1212Debug.Assert(_memory.Length >= sizeHint); 1216Debug.Assert(_output != null);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Bytes.cs (15)
23Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 106Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 122Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 136Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 137Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 159Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 160Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 210Debug.Assert(escapedPropertyName.Length * JsonConstants.MaxExpansionFactorWhileTranscoding < int.MaxValue - encodedLength - 6); 245Debug.Assert(escapedPropertyName.Length < int.MaxValue - encodedLength - 6); 280Debug.Assert(indent <= _indentLength * _options.MaxDepth); 284Debug.Assert(escapedPropertyName.Length * JsonConstants.MaxExpansionFactorWhileTranscoding < int.MaxValue - indent - encodedLength - 7 - _newLineLength); 302Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 330Debug.Assert(indent <= _indentLength * _options.MaxDepth); 334Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - encodedLength - 7 - _newLineLength); 352Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTime.cs (15)
27Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 113Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 129Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 143Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 144Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 166Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 167Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 215Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatDateTimeOffsetLength - 6); 249Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatDateTimeOffsetLength - 6); 284Debug.Assert(indent <= _indentLength * _options.MaxDepth); 286Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatDateTimeOffsetLength - 7 - _newLineLength); 304Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 333Debug.Assert(indent <= _indentLength * _options.MaxDepth); 335Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatDateTimeOffsetLength - 7 - _newLineLength); 352Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTimeOffset.cs (15)
26Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 112Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 128Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 142Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 143Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 165Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 166Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 214Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatDateTimeOffsetLength - 6); 248Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatDateTimeOffsetLength - 6); 283Debug.Assert(indent <= _indentLength * _options.MaxDepth); 285Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatDateTimeOffsetLength - 7 - _newLineLength); 303Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 332Debug.Assert(indent <= _indentLength * _options.MaxDepth); 334Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatDateTimeOffsetLength - 7 - _newLineLength); 351Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Decimal.cs (20)
26Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 112Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 128Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 142Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 143Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 165Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 166Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 214Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatDecimalLength - 4); 239Debug.Assert(result); 245Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatDecimalLength - 4); 270Debug.Assert(result); 277Debug.Assert(indent <= _indentLength * _options.MaxDepth); 279Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatDecimalLength - 5 - _newLineLength); 297Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 316Debug.Assert(result); 323Debug.Assert(indent <= _indentLength * _options.MaxDepth); 325Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatDecimalLength - 5 - _newLineLength); 342Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 362Debug.Assert(result); 370Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Double.cs (20)
26Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 116Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 132Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 146Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 147Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 169Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 170Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 218Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatDoubleLength - 4); 243Debug.Assert(result); 249Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatDoubleLength - 4); 274Debug.Assert(result); 281Debug.Assert(indent <= _indentLength * _options.MaxDepth); 283Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatDoubleLength - 5 - _newLineLength); 301Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 320Debug.Assert(result); 327Debug.Assert(indent <= _indentLength * _options.MaxDepth); 329Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatDoubleLength - 5 - _newLineLength); 346Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 366Debug.Assert(result); 375Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Float.cs (20)
26Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 116Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 132Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 146Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 147Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 169Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 170Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 218Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatSingleLength - 4); 243Debug.Assert(result); 249Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatSingleLength - 4); 274Debug.Assert(result); 281Debug.Assert(indent <= _indentLength * _options.MaxDepth); 283Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatSingleLength - 5 - _newLineLength); 301Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 320Debug.Assert(result); 327Debug.Assert(indent <= _indentLength * _options.MaxDepth); 329Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatSingleLength - 5 - _newLineLength); 346Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 366Debug.Assert(result); 374Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.FormattedNumber.cs (6)
86Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 102Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 116Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 117Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 139Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 140Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Guid.cs (20)
26Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 112Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 128Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 142Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 143Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 165Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 166Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 214Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatGuidLength - 6); 241Debug.Assert(result); 249Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatGuidLength - 6); 276Debug.Assert(result); 285Debug.Assert(indent <= _indentLength * _options.MaxDepth); 287Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatGuidLength - 7 - _newLineLength); 305Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 326Debug.Assert(result); 335Debug.Assert(indent <= _indentLength * _options.MaxDepth); 337Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatGuidLength - 7 - _newLineLength); 354Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 376Debug.Assert(result); 386Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Helpers.cs (12)
42Debug.Assert(_tokenType != JsonTokenType.StartObject); 55Debug.Assert(_tokenType != JsonTokenType.StartObject); 71Debug.Assert(_enclosingContainer != EnclosingContainerType.Object || _tokenType == JsonTokenType.PropertyName); 77Debug.Assert(escapedPropertyName.Length < int.MaxValue - 5); 106Debug.Assert(indent <= _indentLength * _options.MaxDepth); 108Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - 6 - _newLineLength); 125Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 149Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - 5); 178Debug.Assert(indent <= _indentLength * _options.MaxDepth); 180Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - 6 - _newLineLength); 198Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 223Debug.Assert(status == OperationStatus.Done);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Literal.cs (23)
38Debug.Assert(escapedPropertyNameSection.Length <= JsonConstants.MaxUnescapedTokenSize - 3); 51Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 231Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 247Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 261Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 262Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 284Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 285Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 333Debug.Assert(value.Length <= JsonConstants.MaxUnescapedTokenSize); 334Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - value.Length - 4); 364Debug.Assert(value.Length <= JsonConstants.MaxUnescapedTokenSize); 365Debug.Assert(escapedPropertyName.Length < int.MaxValue - value.Length - 4); 397Debug.Assert(value.Length <= JsonConstants.MaxUnescapedTokenSize); 398Debug.Assert(escapedPropertyNameSection.Length < int.MaxValue - value.Length - 1); 424Debug.Assert(indent <= _indentLength * _options.MaxDepth); 426Debug.Assert(value.Length <= JsonConstants.MaxUnescapedTokenSize); 427Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - value.Length - 5 - _newLineLength); 445Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 470Debug.Assert(indent <= _indentLength * _options.MaxDepth); 472Debug.Assert(value.Length <= JsonConstants.MaxUnescapedTokenSize); 473Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - value.Length - 5 - _newLineLength); 490Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 518Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.SignedNumber.cs (20)
26Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 185Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 201Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 215Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 216Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 238Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 239Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 287Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatInt64Length - 4); 312Debug.Assert(result); 318Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatInt64Length - 4); 343Debug.Assert(result); 350Debug.Assert(indent <= _indentLength * _options.MaxDepth); 352Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatInt64Length - 5 - _newLineLength); 370Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 389Debug.Assert(result); 396Debug.Assert(indent <= _indentLength * _options.MaxDepth); 398Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatInt64Length - 5 - _newLineLength); 415Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 435Debug.Assert(result); 447Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.String.cs (76)
33Debug.Assert(escapedPropertyNameSection.Length <= JsonConstants.MaxUnescapedTokenSize - 3); 45Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 95Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length && propertyIdx < int.MaxValue / 2); 112Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 158Debug.Assert(escapedPropertyName.Length <= JsonConstants.MaxEscapedTokenSize); 159Debug.Assert(escapedPropertyName.Length < (int.MaxValue - 4) / JsonConstants.MaxExpansionFactorWhileTranscoding); 187Debug.Assert(indent <= _indentLength * _options.MaxDepth); 189Debug.Assert(escapedPropertyName.Length <= JsonConstants.MaxEscapedTokenSize); 190Debug.Assert(escapedPropertyName.Length < (int.MaxValue - 5 - indent - _newLineLength) / JsonConstants.MaxExpansionFactorWhileTranscoding); 244Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length && propertyIdx < int.MaxValue / 2); 271Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 319Debug.Assert(escapedPropertyName.Length <= JsonConstants.MaxEscapedTokenSize); 320Debug.Assert(escapedPropertyName.Length < int.MaxValue - 4); 349Debug.Assert(escapedPropertyNameSection.Length <= JsonConstants.MaxEscapedTokenSize - 3); 350Debug.Assert(escapedPropertyNameSection.Length < int.MaxValue - 4); 375Debug.Assert(indent <= _indentLength * _options.MaxDepth); 377Debug.Assert(escapedPropertyName.Length <= JsonConstants.MaxEscapedTokenSize); 378Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - 5 - _newLineLength); 395Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 428Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize && utf8Value.Length <= JsonConstants.MaxUnescapedTokenSize); 595Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 601Debug.Assert(valueIdx >= -1 && valueIdx < value.Length && valueIdx < int.MaxValue / 2); 682Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 688Debug.Assert(valueIdx >= -1 && valueIdx < utf8Value.Length && valueIdx < int.MaxValue / 2); 769Debug.Assert(utf8Value.Length <= JsonConstants.MaxUnescapedTokenSize); 775Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length && propertyIdx < int.MaxValue / 2); 841Debug.Assert(utf8Value.Length <= JsonConstants.MaxUnescapedTokenSize); 847Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length && propertyIdx < int.MaxValue / 2); 896Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length); 897Debug.Assert(firstEscapeIndex >= 0 && firstEscapeIndex < utf8Value.Length); 919Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= value.Length); 920Debug.Assert(firstEscapeIndex >= 0 && firstEscapeIndex < value.Length); 942Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 943Debug.Assert(firstEscapeIndex >= 0 && firstEscapeIndex < propertyName.Length); 965Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 966Debug.Assert(firstEscapeIndex >= 0 && firstEscapeIndex < utf8PropertyName.Length); 991Debug.Assert(valueIdx >= -1 && valueIdx < value.Length && valueIdx < int.MaxValue / 2); 992Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length && propertyIdx < int.MaxValue / 2); 1010Debug.Assert(valueIdx >= -1 && valueIdx < utf8Value.Length && valueIdx < int.MaxValue / 2); 1011Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length && propertyIdx < int.MaxValue / 2); 1029Debug.Assert(valueIdx >= -1 && valueIdx < utf8Value.Length && valueIdx < int.MaxValue / 2); 1030Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length && propertyIdx < int.MaxValue / 2); 1048Debug.Assert(valueIdx >= -1 && valueIdx < value.Length && valueIdx < int.MaxValue / 2); 1049Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length && propertyIdx < int.MaxValue / 2); 1064Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= value.Length); 1065Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 1124Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length); 1125Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 1184Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length); 1185Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 1244Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= value.Length); 1245Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 1357Debug.Assert(escapedValue.Length <= JsonConstants.MaxUnescapedTokenSize); 1358Debug.Assert(escapedPropertyName.Length < ((int.MaxValue - 6) / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length); 1392Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1393Debug.Assert(escapedPropertyName.Length < int.MaxValue - escapedValue.Length - 6); 1428Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1429Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length - 6); 1464Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1465Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length - 6); 1501Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1503Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1504Debug.Assert(escapedPropertyName.Length < ((int.MaxValue - 7 - indent - _newLineLength) / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length); 1522Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 1551Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1553Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1554Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - escapedValue.Length - 7 - _newLineLength); 1571Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 1602Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1604Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1605Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length - 7 - indent - _newLineLength); 1623Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 1653Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1655Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1656Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length - 7 - indent - _newLineLength); 1674Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.UnsignedNumber.cs (20)
27Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 194Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 210Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 224Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 225Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 247Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 248Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 296Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatUInt64Length - 4); 321Debug.Assert(result); 327Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatUInt64Length - 4); 352Debug.Assert(result); 359Debug.Assert(indent <= _indentLength * _options.MaxDepth); 361Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatUInt64Length - 5 - _newLineLength); 379Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 398Debug.Assert(result); 405Debug.Assert(indent <= _indentLength * _options.MaxDepth); 407Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatUInt64Length - 5 - _newLineLength); 424Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 444Debug.Assert(result); 456Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Bytes.cs (4)
62Debug.Assert(encodingLength <= int.MaxValue - 3); 67Debug.Assert((uint)maxRequired <= int.MaxValue); 91Debug.Assert(indent <= _indentLength * _options.MaxDepth); 107Debug.Assert((uint)maxRequired <= int.MaxValue - 3);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Comment.cs (8)
80Debug.Assert(value.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - 4); 97Debug.Assert(status != OperationStatus.DestinationTooSmall); 112Debug.Assert(indent <= _indentLength * _options.MaxDepth); 114Debug.Assert(value.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - 4 - _newLineLength); 138Debug.Assert(status != OperationStatus.DestinationTooSmall); 195Debug.Assert(utf8Value.Length < int.MaxValue - 4); 219Debug.Assert(indent <= _indentLength * _options.MaxDepth); 221Debug.Assert(utf8Value.Length < int.MaxValue - indent - 4 - _newLineLength);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.DateTime.cs (1)
69Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.DateTimeOffset.cs (1)
70Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Decimal.cs (4)
59Debug.Assert(result); 66Debug.Assert(indent <= _indentLength * _options.MaxDepth); 93Debug.Assert(result); 101Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Double.cs (4)
63Debug.Assert(result); 70Debug.Assert(indent <= _indentLength * _options.MaxDepth); 97Debug.Assert(result); 149Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Float.cs (4)
63Debug.Assert(result); 70Debug.Assert(indent <= _indentLength * _options.MaxDepth); 97Debug.Assert(result); 149Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.FormattedNumber.cs (2)
70Debug.Assert(indent <= _indentLength * _options.MaxDepth); 72Debug.Assert(utf8Value.Length < int.MaxValue - indent - 1 - _newLineLength);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Guid.cs (3)
61Debug.Assert(result); 70Debug.Assert(indent <= _indentLength * _options.MaxDepth); 100Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Helpers.cs (15)
54Debug.Assert(!_options.SkipValidation); 61Debug.Assert(!HasPartialStringData); 65Debug.Assert(_tokenType != JsonTokenType.PropertyName); 66Debug.Assert(_tokenType != JsonTokenType.None && _tokenType != JsonTokenType.StartArray); 71Debug.Assert(_tokenType != JsonTokenType.PropertyName); 72Debug.Assert(CurrentDepth == 0 && _tokenType != JsonTokenType.None); 79Debug.Assert(currentSegmentEncoding is EnclosingContainerType.Utf8StringSequence or EnclosingContainerType.Utf16StringSequence or EnclosingContainerType.Base64StringSequence); 101Debug.Assert(!HasPartialStringData); 105Debug.Assert(_tokenType != JsonTokenType.PropertyName); 106Debug.Assert(_tokenType != JsonTokenType.None && _tokenType != JsonTokenType.StartArray); 111Debug.Assert(_tokenType != JsonTokenType.PropertyName); 112Debug.Assert(CurrentDepth == 0 && _tokenType != JsonTokenType.None); 124Debug.Assert(!HasPartialStringData); 132Debug.Assert(status == OperationStatus.Done); 133Debug.Assert(consumed == bytes.Length);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Literal.cs (3)
66Debug.Assert(utf8Value.Length <= 5); 89Debug.Assert(indent <= _indentLength * _options.MaxDepth); 90Debug.Assert(utf8Value.Length <= 5);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Raw.cs (2)
168Debug.Assert(utf8JsonLen < int.MaxValue); 241Debug.Assert(len < int.MaxValue);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.SignedNumber.cs (4)
72Debug.Assert(result); 79Debug.Assert(indent <= _indentLength * _options.MaxDepth); 106Debug.Assert(result); 114Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.String.cs (13)
21Debug.Assert(utf8Value.Length <= JsonConstants.MaxUnescapedTokenSize); 86Debug.Assert(valueIdx >= -1 && valueIdx < value.Length); 118Debug.Assert(escapedValue.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - 3); 146Debug.Assert(indent <= _indentLength * _options.MaxDepth); 148Debug.Assert(escapedValue.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - 3 - _newLineLength); 185Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= value.Length); 186Debug.Assert(firstEscapeIndexVal >= 0 && firstEscapeIndexVal < value.Length); 233Debug.Assert(valueIdx >= -1 && valueIdx < utf8Value.Length); 265Debug.Assert(escapedValue.Length < int.MaxValue - 3); 293Debug.Assert(indent <= _indentLength * _options.MaxDepth); 295Debug.Assert(escapedValue.Length < int.MaxValue - indent - 3 - _newLineLength); 332Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length); 333Debug.Assert(firstEscapeIndexVal >= 0 && firstEscapeIndexVal < utf8Value.Length);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.StringSegment.cs (33)
66Debug.Assert(HasPartialStringData); 67Debug.Assert(_enclosingContainer == EnclosingContainerType.Utf16StringSequence); 77Debug.Assert(value.Length + partialStringDataBuffer.Length < 2); 78Debug.Assert(charsConsumed == value.Length + partialStringDataBuffer.Length); 84Debug.Assert(charsConsumed > partialStringDataBuffer.Length); 85Debug.Assert(charsConsumed <= 2); 91Debug.Assert(charsConsumed >= partialStringDataBuffer.Length); 92Debug.Assert(charsConsumed <= 2); 135Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= value.Length); 136Debug.Assert(firstEscapeIndexVal >= 0 && firstEscapeIndexVal < value.Length); 150Debug.Assert(consumed == value.Length || !isFinalSegment); 153Debug.Assert(!isFinalSegment); 154Debug.Assert(value.Length - consumed < 2); 166Debug.Assert(escapedValue.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding)); 234Debug.Assert(HasPartialStringData); 235Debug.Assert(_enclosingContainer == EnclosingContainerType.Utf8StringSequence); 245Debug.Assert(utf8Value.Length + partialStringDataBuffer.Length < 4); 246Debug.Assert(bytesConsumed == utf8Value.Length + partialStringDataBuffer.Length); 252Debug.Assert(bytesConsumed > partialStringDataBuffer.Length); 253Debug.Assert(bytesConsumed <= 4); 259Debug.Assert(bytesConsumed >= partialStringDataBuffer.Length); 260Debug.Assert(bytesConsumed <= 4); 304Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length); 305Debug.Assert(firstEscapeIndexVal >= 0 && firstEscapeIndexVal < utf8Value.Length); 316Debug.Assert(consumed == utf8Value.Length || !isFinalSegment); 319Debug.Assert(!isFinalSegment); 320Debug.Assert(utf8Value.Length - consumed < 4); 332Debug.Assert(escapedValue.Length < int.MaxValue - 3); 401Debug.Assert(HasPartialStringData); 402Debug.Assert(_enclosingContainer == EnclosingContainerType.Base64StringSequence); 416Debug.Assert(combinedBuffer.Length is 1 or 2); 418Debug.Assert(bytes.Length + partialStringDataBuffer.Length < 3); 476Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.UnsignedNumber.cs (4)
74Debug.Assert(result); 81Debug.Assert(indent <= _indentLength * _options.MaxDepth); 108Debug.Assert(result); 116Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriterCache.cs (4)
66Debug.Assert(t_threadLocalState != null); 73Debug.Assert((rentedWriters == 0) == (ReferenceEquals(state.BufferWriter, bufferWriter) && ReferenceEquals(state.Writer, writer))); 78Debug.Assert(t_threadLocalState != null); 84Debug.Assert((rentedWriters == 0) == ReferenceEquals(state.Writer, writer));
System.Text.Json.SourceGeneration (6)
Helpers\RoslynExtensions.cs (1)
23Debug.Assert(!type.IsArray, "Resolution logic only capable of handling named types.");
JsonSourceGenerator.Parser.cs (2)
507Debug.Assert(IsSymbolAccessibleWithin(typeToGenerate.Type, within: contextType), "should not generate metadata for inaccessible types."); 793Debug.Assert(arraySymbol.Rank == 1, "multi-dimensional arrays should have been handled earlier.");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (1)
94Debug.Assert(index == 0, "Implementation currently only supports index == 0");
src\libraries\System.Text.Json\Common\JsonHelpers.cs (2)
158Debug.Assert(childlessQueue.Count > 0, "The graph contains cycles."); 186Debug.Assert(idx == 0, "should have populated the entire sortedNodes array.");
System.Text.RegularExpressions (497)
src\libraries\Common\src\System\HexConverter.cs (3)
167Debug.Assert(chars.Length >= bytes.Length * 2); 359Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 360Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 281Debug.Assert(additionalCapacityBeyondPos > 0); 282Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (6)
31Debug.Assert(value >= 0); 32Debug.Assert(value <= _span.Length); 41Debug.Assert(index < _pos); 94Debug.Assert(index == 0, "Implementation currently only supports index == 0"); 109Debug.Assert(length >= 0); 137Debug.Assert(_pos == _span.Length);
System\Text\RegularExpressions\CaptureCollection.cs (2)
58Debug.Assert(_captures != null); 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\Match.cs (4)
101Debug.Assert(Text != null); 267Debug.Assert(mode != RegexRunnerMode.ExistenceRequired); 275Debug.Assert(_textbeg == 0); 296Debug.Assert(!_balancing);
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 (8)
76Debug.Assert(value >= 0); 104Debug.Assert(s_cacheList.Count == value); 105Debug.Assert(s_cacheDictionary.Count == value); 199Debug.Assert(s_cacheList.Count == s_cacheDictionary.Count); 271Debug.Assert(s_cacheList.Count <= s_maxCacheSize); 272Debug.Assert(s_cacheList.Count == s_cacheDictionary.Count); 286Debug.Assert(pattern != null, "Pattern must be provided"); 287Debug.Assert(culture != null, "Culture must be provided");
System\Text\RegularExpressions\Regex.cs (6)
463Debug.Assert(mode <= RegexRunnerMode.BoundsRequired); 467Debug.Assert(startat <= input.Length); 529Debug.Assert(inputString is null || inputSpan.SequenceEqual(inputString)); 530Debug.Assert((uint)startat <= (uint)inputSpan.Length); 547Debug.Assert(match is not null); 612Debug.Assert(match is not null);
System\Text\RegularExpressions\RegexCaseEquivalences.cs (4)
81Debug.Assert(cultureName[0] is >= 'a' and <= 'z'); 82Debug.Assert(cultureName[1] is >= 'a' and <= 'z'); 133Debug.Assert((c / CharactersPerRange) < 0xFF); 145Debug.Assert(((c % CharactersPerRange) + firstLevelLookupValue) < 0xFFFF);
System\Text\RegularExpressions\RegexCharClass.cs (20)
337Debug.Assert(whitespaceSet.Contains((char)i) == char.IsWhiteSpace((char)i)); 371Debug.Assert(cc.CanMerge && CanMerge, "Both character classes added together must be able to merge"); 409Debug.Assert(!set.IsEmpty); 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"); 701Debug.Assert(c != 0); 869Debug.Assert(count <= evaluated); 913Debug.Assert(set1Negated == set2Negated); 947Debug.Assert(!IsNegated(set1) && !IsNegated(set2)); 998Debug.Assert((uint)comparison <= char.MaxValue); 1063Debug.Assert(twoChars.Length >= 2); 1149Debug.Assert(!hasSubtraction); 1270Debug.Assert(asciiLazyCache is null || asciiLazyCache.Length == CacheArrayLength, "set lookup should be able to store two bits for each of the first 128 characters"); 1278Debug.Assert(ch < 128); 1296Debug.Assert(ch < 128); 1377Debug.Assert((SetStartIndex & 0x1) == 1, "If SetStartIndex is not odd, the calculation below this will be reversed"); 1467Debug.Assert(curcat < 0); 1552Debug.Assert(chars[index] < chars[index + 1]); 1611Debug.Assert(i == span.Length); 1859Debug.Assert(!string.IsNullOrEmpty(set), "Found a null/empty element in RegexCharClass prop table");
System\Text\RegularExpressions\RegexCompiler.cs (51)
380Debug.Assert(_pool != null); 381Debug.Assert(_local != null); 382Debug.Assert(!_pool.Contains(_local)); 391Debug.Assert(_regexTree != null); 412Debug.Assert(minRequiredLength >= 0); 757Debug.Assert(opts.FindMode is FindNextStartingPositionMode.LeadingString_LeftToRight or 812Debug.Assert(!string.IsNullOrEmpty(prefix)); 844Debug.Assert(_regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 }); 918Debug.Assert(primarySet.Chars.Length > 0); 1100Debug.Assert(needLoop); 1116Debug.Assert(setIndex is 0 or 1); 1119Debug.Assert(needLoop); 1175Debug.Assert(_regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 }); 1178Debug.Assert(set.Distance == 0); 1182Debug.Assert(!set.Negated); 1246Debug.Assert(_regexTree.FindOptimizations.LiteralAfterLoop is not null); 1249Debug.Assert(target.LoopNode.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic); 1250Debug.Assert(target.LoopNode.N == int.MaxValue); 1280Debug.Assert(target.Literal.StringComparison is StringComparison.Ordinal); 1426Debug.Assert(_regexTree != null); 1432Debug.Assert(node.Kind == RegexNodeKind.Capture, "Every generated tree should begin with a capture node"); 1433Debug.Assert(node.ChildCount() == 1, "Capture nodes should have one child"); 1614Debug.Assert(requiredLength > 0); 1652Debug.Assert(childCount >= 2); 1659Debug.Assert(node.Parent is not null); 1847Debug.Assert(sliceStaticPos == 0); 2127Debug.Assert(needsEndConditional); 2333Debug.Assert(resumeAt is not null); 2491Debug.Assert(startingCapturePos != null); 2694Debug.Assert(sliceStaticPos == 0, "This should be the first node and thus static position shouldn't have advanced."); 2965Debug.Assert(!rtl || offset is null); 3071Debug.Assert(node.Kind == RegexNodeKind.NonECMABoundary); 3082Debug.Assert((node.Options & RegexOptions.RightToLeft) == 0 || sliceStaticPos == 0); 3083Debug.Assert(sliceStaticPos >= 0); 3085Debug.Assert(sliceStaticPos >= 0); 3225Debug.Assert(str.Length >= 2); 3229Debug.Assert(emitLengthCheck); 3291Debug.Assert(node.M < node.N); 3504Debug.Assert(node.M < node.N); 3860Debug.Assert(!isAtomic, "An atomic lazy should have had its upper bound lowered to its lower bound."); 3953Debug.Assert(sliceStaticPos == 0); 4033Debug.Assert(entriesPerIteration >= 1); 4372Debug.Assert(node.N > node.M); 4604Debug.Assert(node.M == 0 && node.N == 1); 4855Debug.Assert(sliceStaticPos == 0); 5009Debug.Assert(startingStackpos is not null); 5164Debug.Assert(!negate, "Negation isn't appropriate for a multi"); 5285Debug.Assert(count >= 1); 5704Debug.Assert(rangeLower.LowInclusive != rangeUpper.LowInclusive); 6195Debug.Assert(values is char[] or string[]); 6196Debug.Assert(comparison is StringComparison.Ordinal || values is string[]);
System\Text\RegularExpressions\RegexFindOptimizations.cs (13)
49Debug.Assert(!isLeadingPartial || !rightToLeft, "RightToLeft unexpected when isLeadingPartial"); 142Debug.Assert(!RegexCharClass.IsNegated(charClass)); 149Debug.Assert(!RegexCharClass.IsNegated(charClass) || chars is null); 202Debug.Assert(fixedDistanceSets is null || fixedDistanceSets.Count != 0); 384Debug.Assert(chars is { Length: 1 }); 409Debug.Assert(LeadingAnchor != RegexNodeKind.Bol, "BOL isn't enabled for RTL"); 512Debug.Assert(FindMode == FindNextStartingPositionMode.NoSearch); 693Debug.Assert(FixedDistanceLiteral.Distance <= MinRequiredLength); 708Debug.Assert(FixedDistanceLiteral.Distance <= MinRequiredLength); 725Debug.Assert(LeadingStrings is not null); 819Debug.Assert(LiteralAfterLoop is not null); 822Debug.Assert(loopNode.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic); 823Debug.Assert(loopNode.N == int.MaxValue);
System\Text\RegularExpressions\RegexInterpreter.cs (7)
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."); 326Debug.Assert(runregex is not null); 327Debug.Assert(runtrack is not null); 328Debug.Assert(runstack is not null); 329Debug.Assert(runcrawl is not null); 1131Debug.Assert(!_rightToLeft, "UpdateBumpalongs aren't added for RTL");
System\Text\RegularExpressions\RegexNode.cs (65)
89Debug.Assert(Kind is RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or 92Debug.Assert(M > 0); 115Debug.Assert(culture is not null); 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"); 332Debug.Assert(rootNode.Kind == RegexNodeKind.Capture); 333Debug.Assert(rootNode.Parent is null); 334Debug.Assert(rootNode.ChildCount() == 1); 560Debug.Assert(Kind is RegexNodeKind.Alternate or RegexNodeKind.Concatenate); 577Debug.Assert(Kind == RegexNodeKind.Group); 582Debug.Assert(u.ChildCount() == 1); 605Debug.Assert(Kind == RegexNodeKind.Atomic); 606Debug.Assert(ChildCount() == 1); 647Debug.Assert(branches is not null && branches.Count != 0); 767Debug.Assert(Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop); 876Debug.Assert(Kind is RegexNodeKind.Set or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy); 877Debug.Assert(!string.IsNullOrEmpty(Str)); 925Debug.Assert(Kind == RegexNodeKind.Alternate); 1077Debug.Assert(alternation.Kind == RegexNodeKind.Alternate); 1078Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 }); 1098Debug.Assert(children[startingIndex].Children is List<RegexNode> { Count: >= 2 }); 1176Debug.Assert(node.Kind == RegexNodeKind.Alternate); 1177Debug.Assert(node.ChildCount() >= 2); 1219Debug.Assert(alternation.Kind == RegexNodeKind.Alternate); 1220Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 }); 1251Debug.Assert(startingSpan.Length > 0); 1280Debug.Assert(startingNode.Kind == RegexNodeKind.Multi); 1281Debug.Assert(startingNode.Str!.Length > 0); 1304Debug.Assert(startingSpan.Length > 0); 1327Debug.Assert(startingSpan.Length == 1); 1328Debug.Assert(startingSpan[0] == node.Ch); 1334Debug.Assert(node.Kind == RegexNodeKind.Multi); 1335Debug.Assert(node.Str.AsSpan().StartsWith(startingSpan, StringComparison.Ordinal)); 1389Debug.Assert(Kind is RegexNodeKind.One or RegexNodeKind.Multi || (IsOneFamily && M > 0)); 1390Debug.Assert((Options & RegexOptions.RightToLeft) == 0); 1449Debug.Assert(lowInclusive < highInclusive); 1485Debug.Assert(@string is not null); 1491Debug.Assert(setChars is not null); 1504Debug.Assert(Kind == RegexNodeKind.Concatenate); 1546Debug.Assert(Kind == RegexNodeKind.Concatenate); 1547Debug.Assert(Children is List<RegexNode>); 1629Debug.Assert(Kind == RegexNodeKind.Concatenate); 1630Debug.Assert(Children is List<RegexNode>); 1740Debug.Assert(matchingCharsInMulti < nextNode.Str.Length); 1802Debug.Assert((Options & RegexOptions.NonBacktracking) == 0, "Atomic groups aren't supported and don't help performance with NonBacktracking"); 1834Debug.Assert(Children is List<RegexNode>); 1939Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop); 1973Debug.Assert(Kind is RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround); 1974Debug.Assert(ChildCount() == 1); 2001Debug.Assert(Kind == RegexNodeKind.BackreferenceConditional); 2002Debug.Assert(ChildCount() is 1 or 2); 2019Debug.Assert(Kind == RegexNodeKind.ExpressionConditional); 2020Debug.Assert(ChildCount() is 2 or 3); 2073Debug.Assert(subsequent.Kind != RegexNodeKind.Group); 2224Debug.Assert(currentIndex >= 0, "Node should have been in its parent's child list"); 2297Debug.Assert(childCount >= 2); 2330Debug.Assert(ChildCount() == 1); 2414Debug.Assert(childCount >= 2); 2468Debug.Assert(ChildCount() == 1); 2697Debug.Assert(max >= 2); 2742Debug.Assert(Children is List<RegexNode>); 2753Debug.Assert(Children != null); 2754Debug.Assert(index < ChildCount()); 2784Debug.Assert(Children is RegexNode);
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\RegexPrefixAnalyzer.cs (8)
247Debug.Assert(childCount >= 2); // otherwise it would have been optimized out 266Debug.Assert(alternateBranchResults.Count > 0); 521results.ForEach(r => Debug.Assert( 773Debug.Assert(sameDistance.HasValue); 813Debug.Assert(!s2Negated); 1129Debug.Assert(node.ChildCount() >= 2); 1175Debug.Assert( 1406Debug.Assert(leading);
System\Text\RegularExpressions\RegexReplacement.cs (2)
215Debug.Assert(_rules.Length <= 1); 216Debug.Assert(_rules.Length == 0 || (_rules[0] == 0 && _strings.Length == 1));
System\Text\RegularExpressions\RegexTree.cs (9)
47Debug.Assert(captureNumberSparseMapping is null || captureNames is not null); 48Debug.Assert((captureNames is null) == (captureNameToNumberMapping is null)); 49Debug.Assert(captureNames is null || captureCount == captureNames.Length); 50Debug.Assert(captureNumberSparseMapping is null || captureCount == captureNumberSparseMapping.Count); 51Debug.Assert(captureNameToNumberMapping is null || captureCount == captureNameToNumberMapping.Count); 54Debug.Assert(captureNameToNumberMapping is not null); 60Debug.Assert(captureNumber is not null); 65Debug.Assert(captureNumber is not null); 68Debug.Assert(captureNumber == i);
System\Text\RegularExpressions\RegexWriter.cs (2)
31Debug.Assert(!Enum.IsDefined(BeforeChild)); 32Debug.Assert(!Enum.IsDefined(AfterChild));
System\Text\RegularExpressions\Symbolic\BDD.cs (13)
68Debug.Assert((one is null) == (zero is null), "Neither or both children should be null."); 90Debug.Assert((One is null) == (Zero is null)); 112Debug.Assert(!set.IsEmpty); 174Debug.Assert(nodes[nodes.Length - 1] == this); 175Debug.Assert(nodes.Length <= (1 << 24)); 224Debug.Assert(v >= 0); 315Debug.Assert(serialized[i] > 0); 344Debug.Assert(bytes.Length > 1, "All inputs are expected to be larger than a single byte, which would map to False or True."); 353Debug.Assert((bytes.Length - 1) % bytesPerLong == 0); 381Debug.Assert(oneId < i && zeroId < i); 382Debug.Assert(nodes[oneId] is not null); 383Debug.Assert(nodes[zeroId] is not null); 502Debug.Assert(leaf is not null, "this should never happen because there must exist another leaf besides False");
System\Text\RegularExpressions\Symbolic\BDDRangeConverter.cs (1)
101Debug.Assert(!set.IsLeaf);
System\Text\RegularExpressions\Symbolic\BitVector.cs (7)
32Debug.Assert(length > 0); 42Debug.Assert(length > 0); 73Debug.Assert(i >= 0 && i < Length); 81Debug.Assert(i >= 0 && i < Length); 89Debug.Assert(x.Length == y.Length); 106Debug.Assert(x.Length == y.Length); 123Debug.Assert(!bitVectors.IsEmpty);
System\Text\RegularExpressions\Symbolic\CharSetSolver.cs (5)
207Debug.Assert(!set.IsLeaf, "Did not expect multi-terminal"); 223Debug.Assert(op is BooleanOperation.Or or BooleanOperation.And or BooleanOperation.Xor); 257Debug.Assert(!set1.IsLeaf || !set2.IsLeaf, "Did not expect multi-terminal case"); 264Debug.Assert(!set2.IsLeaf); 364Debug.Assert(terminal >= 0);
System\Text\RegularExpressions\Symbolic\DoublyLinkedList.cs (6)
44Debug.Assert(_first is not null); 54Debug.Assert(other != this, "self append not allowed to avoid circularity"); 74Debug.Assert(_last is not null); 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\MatchingState.cs (3)
58Debug.Assert(IsNullableFor(nextCharKind)); 59Debug.Assert(CharKind.IsValidCharKind(nextCharKind)); 107Debug.Assert(nextCharKind is >= 0 and < CharKind.CharKindCount);
System\Text\RegularExpressions\Symbolic\MatchReversal.cs (3)
14Debug.Assert(kind is MatchReversalKind.MatchStart or MatchReversalKind.FixedLength or MatchReversalKind.PartialFixedLength); 15Debug.Assert(fixedLength >= 0); 16Debug.Assert((adjustedStartState is not null) == (kind is MatchReversalKind.PartialFixedLength));
System\Text\RegularExpressions\Symbolic\MintermClassifier.cs (2)
37Debug.Assert(minterms.Length > 0, "Requires at least"); 107Debug.Assert(_intLookup is not null);
System\Text\RegularExpressions\Symbolic\MintermGenerator.cs (3)
73Debug.Assert(_right is null); 79Debug.Assert(_right is not null); 102Debug.Assert(node._left is not null && node._right is not null);
System\Text\RegularExpressions\Symbolic\RegexNodeConverter.cs (17)
31Debug.Assert(_builder is not null); 47Debug.Assert(childResults is null || childResults.Length != 0); 73Debug.Assert(str is not null); 90Debug.Assert(childResults is not null && childResults.Length == node.ChildCount()); 126Debug.Assert(set is not null); 204Debug.Assert(node.ChildCount() > 0); 205Debug.Assert(childResults is not null); 206Debug.Assert(childResults.Length == node.ChildCount()); 207Debug.Assert(result.Count == 0); 253Debug.Assert(childResults.Length == 1); 267Debug.Assert(node.Kind == RegexNodeKind.Capture && node.N == -1); 269Debug.Assert(childResults.Length == 1); 285Debug.Assert(rootResult.Count == 1 || root.Kind == RegexNodeKind.Concatenate || root.Kind == RegexNodeKind.Capture); 312Debug.Assert(node.Kind == RegexNodeKind.Set); 315Debug.Assert(set is not null); 378Debug.Assert(!Enum.IsDefined((UnicodeCategory)UnicodeCategoryCount)); 516Debug.Assert(result is not null);
System\Text\RegularExpressions\Symbolic\SparseIntMap.cs (4)
41Debug.Assert(entryKey < sparse.Length); 68Debug.Assert(0 <= index && index < _dense.Count); 69Debug.Assert(_dense[index].Key == key); 76Debug.Assert(newLength > _sparse.Length);
System\Text\RegularExpressions\Symbolic\SymbolicRegexBuilder.cs (6)
234Debug.Assert(node._set is not null); 244Debug.Assert(node._left is not null); 324Debug.Assert(node._set is not null); 328Debug.Assert(node._left is not null); 332Debug.Assert(node._left is not null && node._right is not null); 356Debug.Assert(node._left is not null);
System\Text\RegularExpressions\Symbolic\SymbolicRegexInfo.cs (5)
34Debug.Assert(!isAlwaysNullable || canBeNullable); 35Debug.Assert(!startsWithLineAnchor || containsLineAnchor); 36Debug.Assert(!startsWithLineAnchor || startsWithSomeAnchor); 37Debug.Assert(!containsLineAnchor || containsSomeAnchor); 38Debug.Assert(!startsWithSomeAnchor || containsSomeAnchor);
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Automata.cs (16)
111Debug.Assert(newSize >= array.Length); 129Debug.Assert(Monitor.IsEntered(this)); 143Debug.Assert(Monitor.IsEntered(this)); 167Debug.Assert(Monitor.IsEntered(this)); 206Debug.Assert(left is not null); 236Debug.Assert(pos >= 0); 260Debug.Assert(_stateArray is not null); 295Debug.Assert(Monitor.IsEntered(this)); 296Debug.Assert(node.Kind != SymbolicRegexNodeKind.Alternate); 328Debug.Assert(nfaStateId < _nfaCoreIdArray.Length); 342Debug.Assert(stateId > 0); 344Debug.Assert(state is not null); 351Debug.Assert(nfaStateId < _nfaCoreIdArray.Length); 352Debug.Assert(_nfaCoreIdArray[nfaStateId] < _stateArray.Length); 360Debug.Assert(offset < _dfaDelta.Length); 389Debug.Assert(nfaOffset < _nfaDelta.Length);
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.cs (33)
178Debug.Assert(solverMinterms is not null); 221Debug.Assert(CharKind.General == 0); 295Debug.Assert(Solver.IsEmpty(Solver.And(Solver.Not(_builder._wordLetterForBoundariesSet), minterm))); 340Debug.Assert(_checkTimeout); 357Debug.Assert(perThreadData is not null); 416Debug.Assert(matchEnd >= startat - 1); 886Debug.Assert(i >= matchStartBoundary); 892Debug.Assert(lastStart != -1, "We expected to find a starting position but didn't."); 928Debug.Assert(lastStart != -1); 975Debug.Assert(lastStart != -1); 1019Debug.Assert(perThreadData.Current is not null && perThreadData.Next is not null); 1030Debug.Assert(next.Count == 0); 1059Debug.Assert(coreStateId != _deadStateId); 1080Debug.Assert(current.Count > 0); 1157Debug.Assert(CaptureStarts.Length == other.CaptureStarts.Length); 1158Debug.Assert(CaptureEnds.Length == other.CaptureEnds.Length); 1270Debug.Assert(dfaStateId > 0, $"Expected non-zero {nameof(dfaStateId)}."); 1342Debug.Assert(state.DfaStateId < 0, $"Expected negative {nameof(state.DfaStateId)}."); 1343Debug.Assert(state.NfaState is not null, $"Expected non-null {nameof(state.NfaState)}."); 1439Debug.Assert(state.DfaStateId < 0, $"Expected negative {nameof(state.DfaStateId)}."); 1440Debug.Assert(state.NfaState is not null, $"Expected non-null {nameof(state.NfaState)}."); 1451Debug.Assert(nextStates.Count == 0 || sourceStates.Count > 0); 1546Debug.Assert(matcher._findOpts is not null); 1558Debug.Assert(pos == input.Length); 1577Debug.Assert(matcher._findOpts is not null); 1578Debug.Assert(lookup is not null, $"{nameof(NoZAnchorFindOptimizationsInitialStateHandler)} must only be used with call sites that pass non-null {nameof(lookup)}."); 1589Debug.Assert(pos == input.Length); 1608Debug.Assert(!matcher._containsAnyAnchor); 1609Debug.Assert(matcher._findOpts is not null); 1610Debug.Assert(currentStateId == matcher._initialStateId, "There are no anchors, so the current state should be the sole initial state."); 1619Debug.Assert(pos == input.Length); 1657Debug.Assert(!matcher._pattern._info.ContainsSomeAnchor); 1686Debug.Assert(!matcher._pattern._info.ContainsSomeAnchor);
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Dgml.cs (1)
152Debug.Assert(deltas.Length == matcher._minterms.Length);
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Sample.cs (4)
54Debug.Assert(_minterms is not null); 82Debug.Assert(states.NfaStateSet.Count > 0); 138Debug.Assert(success); 176Debug.Assert(!bdd.IsEmpty);
System\Text\RegularExpressions\Symbolic\SymbolicRegexNode.cs (133)
80Debug.Assert(kind != SymbolicRegexNodeKind.Singleton || set is not null); 114Debug.Assert(node.CanBeNullable); 128Debug.Assert(node._left is not null && node._right is not null); 141Debug.Assert(node._left is not null); 153Debug.Assert(node._kind is SymbolicRegexNodeKind.BeginningAnchor or 174Debug.Assert(_info.CanBeNullable || !_info.IsNullable); 187Debug.Assert(listKind is SymbolicRegexNodeKind.Concat or SymbolicRegexNodeKind.Alternate); 203Debug.Assert(node._left is not null && node._right is not null); 244Debug.Assert(context < CharKind.ContextLimit); 258Debug.Assert(_left is not null); 263Debug.Assert(_left is not null && _right is not null); 268Debug.Assert(_left is not null && _right is not null); 315Debug.Assert(_left is not null); 323Debug.Assert(_kind == SymbolicRegexNodeKind.EndAnchorZReverse); 339Debug.Assert(_left is not null); 342Debug.Assert(_left._set is not null); 355Debug.Assert(_set is not null); 392Debug.Assert(kind is 411Debug.Assert(lower >= 0 && lower <= upper); 416Debug.Assert(body._left is not null); 432Debug.Assert(node._left is not null && node._right is not null); 462Debug.Assert(right._kind is not SymbolicRegexNodeKind.Effect); 465Debug.Assert(left._left is not null && left._right is not null); 521Debug.Assert(current._left is not null && current._right is not null); 523Debug.Assert(current._left._kind != SymbolicRegexNodeKind.Alternate); 583Debug.Assert(left._kind != SymbolicRegexNodeKind.Alternate); 584Debug.Assert(deduplicated); 653Debug.Assert(left._left is not null && left._right is not null); 661Debug.Assert(right._left is not null && right._right is not null); 669Debug.Assert(left._left is not null && right._left is not null && right._right is not null); 673Debug.Assert(rl._left is not null); 683Debug.Assert(left._left is not null && left._right is not null); 687Debug.Assert(ll._left is not null); 696Debug.Assert(left._left is not null && left._right is not null); 715Debug.Assert(prefix._left is not null && prefix._right is not null); 719Debug.Assert(node._left is not null && node._right is not null); 731Debug.Assert(node._left is not null && node._right is not null); 752Debug.Assert(current._left is not null); 775Debug.Assert(right.Subsumes(builder, left)); 791Debug.Assert(left._left is not null && left._right is not null); 792Debug.Assert(right.Subsumes(builder, left._left)); 814Debug.Assert(right._left is not null && right._right is not null); 815Debug.Assert(right._left.Subsumes(builder, left)); 823Debug.Assert(right._left is not null && right._right is not null); 844Debug.Assert(suffix._left is not null && suffix._right is not null); 846Debug.Assert(suffix.Subsumes(builder, left)); 911Debug.Assert(_left is not null); 929Debug.Assert(_left is not null && _right is not null); 948Debug.Assert(_left is not null && _right is not null); 962Debug.Assert(_left is not null); 990Debug.Assert(_left is not null && _right is not null); 997Debug.Assert(_left is not null && _right is not null); 1013Debug.Assert(_lower == lengthSoFar); 1069Debug.Assert(_left is not null); 1103Debug.Assert(_left is not null && _right is not null); 1114Debug.Assert(_left is not null && _right is not null); 1145Debug.Assert(_left is not null && _right is not null); 1160Debug.Assert(loop.Kind == SymbolicRegexNodeKind.Loop && loop._left is not null); 1199Debug.Assert(loop._left.IsNullableFor(context)); 1214Debug.Assert(_kind == SymbolicRegexNodeKind.Loop && _left is not null); 1267Debug.Assert(_set is not null); 1285Debug.Assert(_left is not null && _right is not null); 1317Debug.Assert(_left is not null); 1318Debug.Assert(_upper > 0); 1338Debug.Assert(_left is not null && _right is not null); 1379Debug.Assert(_left is not null && _right is not null); 1384Debug.Assert(_left is not null && _right is not null); 1385Debug.Assert(_left._info.ContainsEffect && !_right._info.ContainsEffect); 1389Debug.Assert(_left is not null && _right is not null); 1398Debug.Assert(_left is not null); 1402Debug.Assert(_left is not null); 1451Debug.Assert(_left is not null && _right is not null); 1463Debug.Assert(_left is not null && _right is not null); 1464Debug.Assert(_left._info.ContainsEffect && !_right._info.ContainsEffect); 1478Debug.Assert(_left is not null && _right is not null); 1487Debug.Assert(_left is not null); 1504Debug.Assert(_left is not null); 1542Debug.Assert(_left is not null && _right is not null); 1543Debug.Assert(_left.IsNullableFor(context) && _right.IsNullableFor(context)); 1549Debug.Assert(_left is not null); 1553Debug.Assert(_left.IsNullableFor(context)); 1559Debug.Assert(_left is not null && _right is not null); 1568Debug.Assert(_right.IsNullableFor(context)); 1582Debug.Assert(_left is not null); 1649Debug.Assert(_left is not null && _right is not null); 1658Debug.Assert(_left is not null && _right is not null); 1669Debug.Assert(_set is not null); 1674Debug.Assert(_left is not null); 1733Debug.Assert(_left is not null && _right is not null); 1747Debug.Assert(_lower >= 0); 1753Debug.Assert(_lower >= 0); 1759Debug.Assert(_left is not null); 1854Debug.Assert(_set is not null); 1859Debug.Assert(_left is not null); 1864Debug.Assert(_left is not null && _right is not null); 1874Debug.Assert(conc._left is not null && conc._right is not null); 1882Debug.Assert(_left is not null); 1914Debug.Assert(_left is not null); 1919Debug.Assert(_left is not null && _right is not null); 1924Debug.Assert(rest._left is not null && rest._right is not null); 1935Debug.Assert(_left is not null && _right is not null); 1965Debug.Assert(_left is not null); 1991Debug.Assert(_left is not null && _right is not null); 1995Debug.Assert(_left is not null && _right is not null); 1999Debug.Assert(_left is not null); 2012Debug.Assert(kind != SymbolicRegexNodeKind.Singleton); 2032Debug.Assert(left is not null); 2036Debug.Assert(left is not null && right is not null); 2040Debug.Assert(left is not null && right is not null); 2045Debug.Assert(left is not null); 2117Debug.Assert(_left is not null); 2125Debug.Assert(_left is not null && _right is not null); 2129Debug.Assert(left1 is not null && right1 is not null); 2137Debug.Assert(_left is not null && _right is not null); 2141Debug.Assert(left1 is not null && right1 is not null); 2149Debug.Assert(_left is not null && _right is not null); 2157Debug.Assert(_left is not null); 2177Debug.Assert(IsNullableFor(context)); 2191Debug.Assert(_left is not null && _right is not null); 2200Debug.Assert(_right.IsNullableFor(context)); 2205Debug.Assert(_left is not null && _right is not null); 2223Debug.Assert(_left is not null); 2225Debug.Assert(_left._kind is not SymbolicRegexNodeKind.DisableBacktrackingSimulation); 2237Debug.Assert(current._left is not null && current._right is not null); 2238Debug.Assert(current._left._kind is not SymbolicRegexNodeKind.Alternate); 2287Debug.Assert(_left is not null && _right is not null); 2292Debug.Assert(_left is not null && _right is null); 2293Debug.Assert(_lower >= 0 && _upper > 0 && _upper >= _lower); 2303Debug.Assert(_lower > 0); 2318Debug.Assert(_left is not null); 2322Debug.Assert(_left is null && _right is null); 2332Debug.Assert(m >= 0 && n >= 0); 2339Debug.Assert(m >= 0 && n >= 0);
System\Text\RegularExpressions\Symbolic\SymbolicRegexRunnerFactory.cs (5)
17Debug.Assert((options & (RegexOptions.RightToLeft | RegexOptions.ECMAScript)) == 0); 27Debug.Assert(threshold > 0); 86Debug.Assert(pos.CaptureEnds != null); 87Debug.Assert(pos.CaptureStarts.Length == pos.CaptureEnds.Length); 92Debug.Assert(pos.CaptureEnds[cap] >= pos.CaptureStarts[cap]);
System\Text\RegularExpressions\Symbolic\UInt64Solver.cs (1)
17Debug.Assert(minterms.Length <= 64);
System\Text\RegularExpressions\Symbolic\UnicodeCategoryConditions.cs (1)
30Debug.Assert(Enum.GetValues<UnicodeCategory>().Length == UnicodeCategoryValueCount);
System\Text\RegularExpressions\Symbolic\UnicodeCategoryRangesGenerator.cs (3)
23Debug.Assert(namespacename != null); 24Debug.Assert(classname != null); 25Debug.Assert(path != null);
System\Text\StructListBuilder.cs (1)
61Debug.Assert(array.Length == _count);
System.Text.RegularExpressions.Generator (85)
RegexGenerator.Emitter.cs (48)
1484Debug.Assert(node.Kind == RegexNodeKind.Capture, "Every generated tree should begin with a capture node"); 1485Debug.Assert(node.ChildCount() == 1, "Capture nodes should have one child"); 1666Debug.Assert(node.Kind is RegexNodeKind.Alternate, $"Unexpected type: {node.Kind}"); 1667Debug.Assert(node.ChildCount() >= 2, $"Expected at least 2 children, found {node.ChildCount()}"); 1804Debug.Assert(startingLiteralNode is not null, "Unexpectedly couldn't find the branch starting node."); 1889Debug.Assert(multi.Kind is RegexNodeKind.Multi, $"Expected a Multi node, got {multi.Kind}"); 2116Debug.Assert(node.Kind is RegexNodeKind.Backreference, $"Unexpected type: {node.Kind}"); 2185Debug.Assert(node.Kind is RegexNodeKind.BackreferenceConditional, $"Unexpected type: {node.Kind}"); 2186Debug.Assert(node.ChildCount() == 2, $"Expected 2 children, found {node.ChildCount()}"); 2358Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.Kind}"); 2359Debug.Assert(node.ChildCount() == 3, $"Expected 3 children, found {node.ChildCount()}"); 2545Debug.Assert(node.Kind is RegexNodeKind.Capture, $"Unexpected type: {node.Kind}"); 2546Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 2638Debug.Assert(node.Kind is RegexNodeKind.PositiveLookaround, $"Unexpected type: {node.Kind}"); 2639Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 2686Debug.Assert(node.Kind is RegexNodeKind.NegativeLookaround, $"Unexpected type: {node.Kind}"); 2687Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 2797Debug.Assert(sliceStaticPos == 0, "This should be the first node and thus static position shouldn't have advanced."); 2961Debug.Assert(node.Kind is RegexNodeKind.Atomic or RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround or RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.Kind}"); 2962Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional ? node.ChildCount() >= 1 : node.ChildCount() == 1, $"Unexpected number of children: {node.ChildCount()}"); 2963Debug.Assert(rm.Analysis.MayBacktrack(node.Child(0)), "Expected child to potentially backtrack"); 2990Debug.Assert(node.Kind is RegexNodeKind.UpdateBumpalong, $"Unexpected type: {node.Kind}"); 3002Debug.Assert(node.Kind is RegexNodeKind.Concatenate, $"Unexpected type: {node.Kind}"); 3003Debug.Assert(node.ChildCount() >= 2, $"Expected at least 2 children, found {node.ChildCount()}"); 3132Debug.Assert(node.IsOneFamily || node.IsNotoneFamily || node.IsSetFamily, $"Unexpected type: {node.Kind}"); 3176Debug.Assert(node.Kind is RegexNodeKind.Boundary or RegexNodeKind.NonBoundary or RegexNodeKind.ECMABoundary or RegexNodeKind.NonECMABoundary, $"Unexpected kind: {node.Kind}"); 3203Debug.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}"); 3269Debug.Assert(node.Kind is RegexNodeKind.Multi, $"Unexpected type: {node.Kind}"); 3318Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Notoneloop or RegexNodeKind.Setloop, $"Unexpected type: {node.Kind}"); 3456Debug.Assert(node.Kind is RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy or RegexNodeKind.Setlazy, $"Unexpected type: {node.Kind}"); 3703Debug.Assert(node.Kind is RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 3704Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}"); 3705Debug.Assert(node.N >= node.M, $"Unexpected M={node.M}, N={node.N}"); 3706Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 3729Debug.Assert(!isAtomic, "An atomic lazy should have had its upper bound lowered to its lower bound."); 4013Debug.Assert(node.IsOneFamily || node.IsNotoneFamily || node.IsSetFamily, $"Unexpected type: {node.Kind}"); 4127Debug.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}"); 4259Debug.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}"); 4297Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 4298Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}"); 4299Debug.Assert(node.M == node.N, $"Unexpected M={node.M} == N={node.N}"); 4300Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 4301Debug.Assert(!rm.Analysis.MayBacktrack(node.Child(0)), $"Expected non-backtracking node {node.Kind}"); 4317Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 4318Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}"); 4319Debug.Assert(node.N >= node.M, $"Unexpected M={node.M}, N={node.N}"); 4320Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 4941Debug.Assert(!negate, "Negation isn't appropriate for a multi");
src\libraries\Common\src\System\HexConverter.cs (2)
359Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 360Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
282Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (1)
94Debug.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"); 1859Debug.Assert(!string.IsNullOrEmpty(set), "Found a null/empty element in RegexCharClass prop table");
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexFindOptimizations.cs (2)
49Debug.Assert(!isLeadingPartial || !rightToLeft, "RightToLeft unexpected when isLeadingPartial"); 86Debug.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"); 1802Debug.Assert((Options & RegexOptions.NonBacktracking) == 0, "Atomic groups aren't supported and don't help performance with NonBacktracking"); 2224Debug.Assert(currentIndex >= 0, "Node should have been in its parent's child list"); 2520Debug.Assert(Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {Kind}"); 2636Debug.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");
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (1)
521results.ForEach(r => Debug.Assert(
System.Threading (77)
System\Threading\Barrier.cs (2)
511Debug.Assert(result); 735Debug.Assert(phase < CurrentPhaseNumber);
System\Threading\CountdownEvent.cs (3)
176Debug.Assert(_event != null); 219Debug.Assert(_event != null); 249Debug.Assert(_currentCount >= 0, "latch was decremented below zero");
System\Threading\ReaderWriterLock.cs (72)
87Debug.Assert(threadLocalLockEntry._readerLevel == 0); 92Debug.Assert((_state & LockStates.ReadersMask) != 0); 105Debug.Assert(threadLocalLockEntry.IsFree); 202Debug.Assert(threadLocalLockEntry.HasLockID(_lockID)); 207Debug.Assert((_state & LockStates.ReaderSignaled) != 0); 208Debug.Assert((_state & LockStates.ReadersMask) < LockStates.ReadersMask); 231Debug.Assert(readerEvent != null); 237Debug.Assert((_state & LockStates.ReadersMask) < LockStates.ReadersMask); 248Debug.Assert(threadLocalLockEntry.IsFree); 258Debug.Assert((knownState & LockStates.ReaderSignaled) != 0); 259Debug.Assert((knownState & LockStates.ReadersMask) < LockStates.ReadersMask); 272Debug.Assert((_state & LockStates.Writer) == 0); 273Debug.Assert((_state & LockStates.ReadersMask) != 0); 289Debug.Assert((_state & LockStates.ReadersMask) == 0); 373Debug.Assert((_state & LockStates.WriterSignaled) != 0); 389Debug.Assert(writerEvent != null); 408Debug.Assert((knownState & LockStates.WriterSignaled) != 0); 409Debug.Assert((knownState & LockStates.Writer) == 0); 413Debug.Assert(_writerLevel == 0); 430Debug.Assert((_state & LockStates.Writer) != 0); 431Debug.Assert((_state & LockStates.ReadersMask) == 0); 432Debug.Assert(_writerID == InvalidThreadID); 458Debug.Assert((_state & LockStates.Writer) == 0); 459Debug.Assert((_state & LockStates.ReadersMask) != 0); 460Debug.Assert(threadLocalLockEntry._readerLevel > 0); 494Debug.Assert(currentState != knownState); 519Debug.Assert(currentState != knownState); 531Debug.Assert((knownState & LockStates.Writer) == 0); 532Debug.Assert((knownState & LockStates.ReadersMask) != 0); 542Debug.Assert((_state & LockStates.WriterSignaled) != 0); 543Debug.Assert(writerEvent != null); 549Debug.Assert((_state & LockStates.ReaderSignaled) != 0); 550Debug.Assert(readerEvent != null); 560Debug.Assert(threadLocalLockEntry.IsFree); 570Debug.Assert((_state & LockStates.ReadersMask) == 0); 571Debug.Assert((_state & LockStates.Writer) != 0); 572Debug.Assert(_writerLevel > 0); 614Debug.Assert(currentState != knownState); 628Debug.Assert(currentState != knownState); 639Debug.Assert((knownState & LockStates.ReadersMask) == 0); 640Debug.Assert((knownState & LockStates.Writer) != 0); 647Debug.Assert((_state & LockStates.ReaderSignaled) != 0); 648Debug.Assert(readerEvent != null); 654Debug.Assert((_state & LockStates.WriterSignaled) != 0); 655Debug.Assert(writerEvent != null); 694Debug.Assert((_state & LockStates.ReadersMask) != 0); 695Debug.Assert(threadLocalLockEntry._readerLevel > 0); 707Debug.Assert(threadLocalLockEntry.IsFree); 770Debug.Assert(_writerLevel > 0); 804Debug.Assert(currentState != knownState); 810Debug.Assert((knownState & LockStates.ReadersMask) == 0); 817Debug.Assert((_state & LockStates.ReaderSignaled) != 0); 818Debug.Assert(readerEvent != null); 851Debug.Assert(_writerLevel > 0); 852Debug.Assert(_writerLevel > requestedWriterLevel); 865Debug.Assert((flags & LockCookieFlags.OwnedWriter) != 0 || _writerID != threadID); 897Debug.Assert((_state & LockStates.ReadersMask) != 0); 898Debug.Assert(threadLocalLockEntry._readerLevel > 0); 954Debug.Assert(threadLocalLockEntry.IsFree); 995Debug.Assert(threadLocalLockEntry != null); 1003Debug.Assert(threadID != InvalidThreadID); 1090Debug.Assert((_state & LockStates.CachingEvents) == LockStates.CachingEvents); 1225Debug.Assert(lockID != 0); 1226Debug.Assert(afterEntry != null); 1232Debug.Assert(currentEntry._lockID != lockID || currentEntry.IsFree); 1238Debug.Assert(lockID != 0); 1257Debug.Assert(lockID != 0); 1271Debug.Assert(lockID != 0); 1272Debug.Assert(headEntry == t_lockEntryHead); 1273Debug.Assert(headEntry == null || headEntry._lockID != lockID); 1319Debug.Assert(emptyEntry == headEntry); 1332Debug.Assert(entry._lockID == lockID);
System.Threading.Channels (102)
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 is not 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 is not null, "Expected a non-null segment."); 180Debug.Assert(array is not null, "Expected a non-null item array."); 253Debug.Assert(segment is not null, "Expected a non-null segment."); 254Debug.Assert(array is not null, "Expected a non-null item array."); 368Debug.Assert(syncObj is not null, "The syncObj parameter is null."); 390Debug.Assert((size & (size - 1)) == 0, "Size must be a power of 2"); 429Debug.Assert(queue is not null, "Expected a non-null queue.");
src\libraries\Common\src\System\Collections\Generic\Deque.cs (6)
52Debug.Assert(!IsEmpty); // caller's responsibility to make sure there are elements remaining 68Debug.Assert(!IsEmpty); // caller's responsibility to make sure there are elements remaining 74Debug.Assert(!IsEmpty); // caller's responsibility to make sure there are elements remaining 85Debug.Assert(!IsEmpty); // caller's responsibility to make sure there are elements remaining 112Debug.Assert(_size == _array.Length); 113Debug.Assert(_head == _tail);
System\Threading\Channels\AsyncOperation.cs (14)
106Debug.Assert(!pooled || !cancellationToken.CanBeCanceled); 114Debug.Assert(cancellationCallback is not null, "Expected a non-null cancellation callback when the token is cancelable"); 115Debug.Assert(!_pooled, "Cancelable operations can't be pooled"); 192Debug.Assert( 209Debug.Assert(_continuation != s_completedSentinel, $"The continuation was the completion sentinel."); 210Debug.Assert(_continuation != s_availableSentinel, $"The continuation was the available sentinel."); 247Debug.Assert(ts is not null, "Expected a TaskScheduler"); 311Debug.Assert(_capturedContext is null); 357Debug.Assert(IsCompleted, $"Expected IsCompleted"); 360Debug.Assert(prevContinuation != s_availableSentinel, "Continuation was the available sentinel."); 381Debug.Assert(ts is not null); 386Debug.Assert(_capturedContext is ExecutionContext); 401Debug.Assert(executionContext is not null, $"{nameof(executionContext)} is null"); 519Debug.Assert(_pooled, "Should only be used for pooled objects");
System\Threading\Channels\BoundedChannel.cs (17)
56Debug.Assert(bufferedCapacity > 0); 242Debug.Assert(Monitor.IsEntered(parent.SyncObj)); 455Debug.Assert(waitingReadersHead is null); 460Debug.Assert(waitingReadersHead is not null); 630Debug.Assert(waitingReadersHead is null); 635Debug.Assert(waitingReadersHead is not null); 695Debug.Assert(SyncObj is not null, "The sync obj must not be null."); 696Debug.Assert(Monitor.IsEntered(SyncObj), "Invariants can only be validated while holding the lock."); 700Debug.Assert(_blockedReadersHead is null, "There are items available, so there shouldn't be any blocked readers."); 701Debug.Assert(_waitingReadersHead is null, "There are items available, so there shouldn't be any waiting readers."); 706Debug.Assert(_blockedWritersHead is null, "There's space available, so there shouldn't be any blocked writers."); 707Debug.Assert(_waitingWritersHead is null, "There's space available, so there shouldn't be any waiting writers."); 712Debug.Assert(_items.IsEmpty, "There shouldn't be queued items if there's a blocked reader."); 713Debug.Assert(_blockedWritersHead is null, "There shouldn't be any blocked writer if there's a blocked reader."); 718Debug.Assert(_items.Count == _bufferedCapacity, "We should have a full buffer if there's a blocked writer."); 719Debug.Assert(_blockedReadersHead is null, "There shouldn't be any blocked readers if there's a blocked writer."); 724Debug.Assert(_doneWriting is not null, "We can only complete if we're done writing.");
System\Threading\Channels\ChannelUtilities.cs (23)
59Debug.Assert(error is not null); 100Debug.Assert(head.Previous is not null); 101Debug.Assert(head.Next is not null); 116Debug.Assert(op is not null); 127Debug.Assert(op.Next is null && op.Previous is null); 136Debug.Assert(last is not null); 151Debug.Assert(op is not null); 152Debug.Assert(op.Next is null == op.Previous is null); 160Debug.Assert(op.Previous is not null); 164Debug.Assert(op.Previous == op); 165Debug.Assert(head == op); 210Debug.Assert(current is not null); 213Debug.Assert(next is not null); 238Debug.Assert(current is not null); 241Debug.Assert(next is not null); 266Debug.Assert(current is not null); 269Debug.Assert(next is not null); 294Debug.Assert(error is not null); 301Debug.Assert(current is not null); 304Debug.Assert(next is not null); 329Debug.Assert(current is not null); 330Debug.Assert(condition(current), message); 351Debug.Assert(current is not null);
System\Threading\Channels\RendezvousChannel.cs (12)
172Debug.Assert(reader is null); 173Debug.Assert(waitingWriters is null); 179Debug.Assert(reader is not null); 412Debug.Assert(blockedReader is null); 423Debug.Assert(parent._dropWrites); 492Debug.Assert(SyncObj is not null, "The sync obj must not be null."); 493Debug.Assert(Monitor.IsEntered(SyncObj), "Invariants can only be validated while holding the lock."); 497Debug.Assert(_blockedWritersHead is null, "There shouldn't be any blocked writer if there's a blocked reader."); 498Debug.Assert(_waitingWritersHead is null, "There shouldn't be any waiting writers if there's a blocked reader."); 503Debug.Assert(_blockedReadersHead is null, "There shouldn't be any blocked readers if there's a blocked writer."); 504Debug.Assert(_waitingReadersHead is null, "There shouldn't be any waiting readers if there's a blocked writer."); 509Debug.Assert(_doneWriting is not null, "We can only complete if we're done writing.");
System\Threading\Channels\SingleConsumerUnboundedChannel.cs (2)
316Debug.Assert((blockedReader is not null) ^ (waitingReader is not null), "Expected either a blocked or waiting reader, but not both"); 330Debug.Assert(blockedReader is not null);
System\Threading\Channels\UnboundedChannel.cs (7)
334Debug.Assert(SyncObj is not null, "The sync obj must not be null."); 335Debug.Assert(Monitor.IsEntered(SyncObj), "Invariants can only be validated while holding the lock."); 341Debug.Assert(_blockedReadersHead is null, "There's data available, so there shouldn't be any blocked readers."); 342Debug.Assert(_waitingReadersHead is null, "There's data available, so there shouldn't be any waiting readers."); 344Debug.Assert(!_completion.Task.IsCompleted, "We still have data available, so shouldn't be completed."); 349Debug.Assert(_items.IsEmpty, "There are blocked/waiting readers, so there shouldn't be any data available."); 354Debug.Assert(_doneWriting is not null, "We're completed, so we must be done writing.");
System\Threading\Channels\UnboundedPriorityChannel.cs (8)
138Debug.Assert(Monitor.IsEntered(parent.SyncObj)); 340Debug.Assert(SyncObj is not null, "The sync obj must not be null."); 341Debug.Assert(Monitor.IsEntered(SyncObj), "Invariants can only be validated while holding the lock."); 347Debug.Assert(_blockedReadersHead is null, "There's data available, so there shouldn't be any blocked readers."); 348Debug.Assert(_waitingReadersHead is null, "There's data available, so there shouldn't be any waiting readers."); 350Debug.Assert(!_completion.Task.IsCompleted, "We still have data available, so shouldn't be completed."); 355Debug.Assert(_items.Count == 0, "There are blocked/waiting readers, so there shouldn't be any data available."); 360Debug.Assert(_doneWriting is not null, "We're completed, so we must be done writing.");
System.Threading.RateLimiting (42)
src\libraries\Common\src\System\Collections\Generic\Deque.cs (6)
52Debug.Assert(!IsEmpty); // caller's responsibility to make sure there are elements remaining 68Debug.Assert(!IsEmpty); // caller's responsibility to make sure there are elements remaining 74Debug.Assert(!IsEmpty); // caller's responsibility to make sure there are elements remaining 85Debug.Assert(!IsEmpty); // caller's responsibility to make sure there are elements remaining 112Debug.Assert(_size == _array.Length); 113Debug.Assert(_head == _tail);
System\Threading\RateLimiting\ConcurrencyLimiter.cs (9)
141Debug.Assert(_options.QueueLimit >= _queueCount); 151Debug.Assert(_queueCount >= 0); 185Debug.Assert(_queueCount <= _options.QueueLimit); 212Debug.Assert(_permitCount >= 0); 240Debug.Assert(_permitCount <= _options.PermitLimit); 278Debug.Assert(_permitCount >= 0); 303Debug.Assert(_queueCount >= 0); 313Debug.Assert(_idleSince is null); 379Debug.Assert(count == 0 ? limiter is null : true);
System\Threading\RateLimiting\FixedWindowRateLimiter.cs (8)
159Debug.Assert(_options.QueueLimit >= _queueCount); 169Debug.Assert(_queueCount >= 0); 203Debug.Assert(_queueCount <= _options.QueueLimit); 239Debug.Assert(_permitCount >= 0); 270Debug.Assert(limiter is not null); 335Debug.Assert(_permitCount >= 0); 358Debug.Assert(_queueCount >= 0); 369Debug.Assert(_idleSince is null);
System\Threading\RateLimiting\SlidingWindowRateLimiter.cs (9)
171Debug.Assert(_options.QueueLimit >= _queueCount); 181Debug.Assert(_queueCount >= 0); 215Debug.Assert(_queueCount <= _options.QueueLimit); 243Debug.Assert(_permitCount >= 0); 276Debug.Assert(limiter is not null); 315Debug.Assert(_permitCount <= _options.PermitLimit); 347Debug.Assert(_permitCount >= 0); 371Debug.Assert(_queueCount >= 0); 382Debug.Assert(_idleSince is null);
System\Threading\RateLimiting\TokenBucketRateLimiter.cs (10)
164Debug.Assert(_options.QueueLimit >= _queueCount); 174Debug.Assert(_queueCount >= 0); 208Debug.Assert(_queueCount <= _options.QueueLimit); 219Debug.Assert(_options.TokensPerPeriod > 0); 246Debug.Assert(_tokenCount >= 0); 277Debug.Assert(limiter is not null); 321Debug.Assert(_tokenCount <= _options.TokenLimit); 349Debug.Assert(_tokenCount >= 0); 372Debug.Assert(_queueCount >= 0); 383Debug.Assert(_idleSince is null);
System.Threading.Tasks.Dataflow (407)
Base\DataflowBlock.cs (49)
108Debug.Assert(source != null, "Filtered link requires a source to filter on."); 109Debug.Assert(target != null, "Filtered link requires a target to filter to."); 110Debug.Assert(predicate != null, "Filtered link requires a predicate to filter with."); 123Debug.Assert(_userProvidedPredicate != null, "User-provided predicate is required."); 155Debug.Assert(messageHeader.IsValid, "Only valid messages may be consumed."); 164Debug.Assert(messageHeader.IsValid, "Only valid messages may be consumed."); 173Debug.Assert(messageHeader.IsValid, "Only valid messages may be consumed."); 210Debug.Assert(filter != null, "Need a filter with which to construct the debug view."); 334Debug.Assert(source != null, "The SendAsyncSource instance must have been constructed."); 390Debug.Assert(target != null, "A valid target to send to is required."); 494Debug.Assert(completionAction != null, "Completion action to run is required."); 503Debug.Assert(_cancellationRegistration != default(CancellationTokenRegistration), 543Debug.Assert(source._cancellationState != CANCELLATION_STATE_NONE, 584Debug.Assert(_cancellationState == CANCELLATION_STATE_COMPLETING, 639Debug.Assert( 740Debug.Assert(source != null, "Need a source with which to construct the debug view."); 974Debug.Assert(source != null, "Need a source from which to receive."); 1228Debug.Assert(Volatile.Read(ref _cleanupReserved), "Should only be called once by whomever reserved the right."); 1527Debug.Assert(target != null, "The target should never be null; this should be checked by all internal usage."); 1528Debug.Assert(source != null, "The source should never be null; this should be checked by all internal usage."); 1622Debug.Assert(propagator != null, "Need a block with which to construct the debug view."); 1825Debug.Assert(source1 != null && action1 != null, "The first source and action should not be null."); 1826Debug.Assert(source2 != null && action2 != null, "The second source and action should not be null."); 1827Debug.Assert((source3 == null) == (action3 == null), "The third action should be null iff the third source is null."); 1828Debug.Assert(dataflowBlockOptions != null, "Options are required."); 1872Debug.Assert(source != null, "Expected a non-null source"); 1873Debug.Assert(action != null, "Expected a non-null action"); 1874Debug.Assert(branchId >= 0, "Expected a valid branch ID (> 0)"); 1875Debug.Assert(scheduler != null, "Expected a non-null scheduler"); 1910Debug.Assert(source1 != null && action1 != null, "The first source and action should not be null."); 1911Debug.Assert(source2 != null && action2 != null, "The second source and action should not be null."); 1912Debug.Assert((source3 == null) == (action3 == null), "The third action should be null iff the third source is null."); 1913Debug.Assert(dataflowBlockOptions != null, "Options are required."); 1961Debug.Assert(resultBranchId < tasks.Length, "Expected a valid branch ID"); 1962Debug.Assert(successfulBranchId == -1, "There should be at most one successful branch."); 1965else Debug.Assert(resultBranchId == -1, "Expected -1 as a signal of a non-successful branch"); 2087Debug.Assert(completed != null, "Requires a shared target to complete."); 2184Debug.Assert(source != null, "Requires a source for which to retrieve the observable."); 2202Debug.Assert(source != null, "The observable requires a source to wrap."); 2248Debug.Assert(_observersState.Unlinker == null, "The source should not be linked to the target."); 2273Debug.Assert(observer != null, "Expected an observer."); 2279Debug.Assert(currentState != null, "Observer state should never be null."); 2307Debug.Assert(currentState != null, "Observer state should never be null."); 2308Debug.Assert(currentState.Unlinker != null, "The target should be linked."); 2309Debug.Assert(currentState.Canceler != null, "The target should have set up continuations."); 2341Debug.Assert(observable != null, "Need a block with which to construct the debug view."); 2376Debug.Assert(observable != null, "Observe state must be mapped to a source observable."); 2470Debug.Assert(Target.Completion.IsCompleted, "The target must have already completed in order to notify of completion."); 2539Debug.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 (11)
106Debug.Assert(asyncAction != null, "action is of incorrect delegate type"); 122Debug.Assert((_spscTarget != null) ^ (_defaultTarget != null), "One and only one of the two targets must be non-null after construction"); 130Debug.Assert(_defaultTarget != null); 153Debug.Assert(action != null, "action needed for processing"); 154Debug.Assert(_defaultTarget != null); 198Debug.Assert(completed != null, "Need completed task for processing"); 199Debug.Assert(completed.IsCompleted, "The task to be processed must be completed by now."); 200Debug.Assert(_defaultTarget != null); 226Debug.Assert(_spscTarget != null); 242Debug.Assert(_spscTarget != null); 327Debug.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."); 199Debug.Assert(batchBlock != null, "Need a block with which to construct the debug view"); 290Debug.Assert(batchSize > 0, "A positive batch size is required"); 306Debug.Assert(owningBatch != null, "This batch target core must be associated with a batch block."); 307Debug.Assert(batchSize >= 1, "Batch sizes must be positive."); 308Debug.Assert(batchCompletedAction != null, "Completion action must be specified."); 309Debug.Assert(dataflowBlockOptions != null, "Options required to configure the block."); 378Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 406Debug.Assert(_nonGreedyState != null, "_nonGreedyState must have been initialized during construction in non-greedy mode."); 458Debug.Assert(_nonGreedyState != null && _nonGreedyState.TaskForInputProcessing != null, 619Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 634Debug.Assert(BatchesNeedProcessing, "There must be a batch that needs processing."); 663Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 752Debug.Assert(!_dataflowBlockOptions.Greedy, "This method may only be used in non-greedy mode."); 753Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 770Debug.Assert(_messages.Count == 0, "The queue must be empty between batches in non-greedy mode"); 782Debug.Assert(allowFewerThanBatchSize ? poppedInitially > 0 : poppedInitially == _batchSize, 816Debug.Assert(reserved.Count <= _batchSize, "Expected the number of reserved sources to be <= the number needed for a batch."); 869Debug.Assert(_dataflowBlockOptions.Greedy, "This method may only be used in greedy mode."); 870Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 871Debug.Assert(_boundingState != null, "Bounding state is required when in bounded mode."); 899Debug.Assert(poppedInitially > 0, "We received fewer than we expected based on the previous check."); 928Debug.Assert(reserved.Count <= itemCountNeededToCompleteBatch, "Expected the number of reserved sources to be <= the number needed for a batch."); 978Debug.Assert(!_dataflowBlockOptions.Greedy, "This method may only be used in non-greedy mode."); 979Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 980Debug.Assert(_nonGreedyState.ReservedSourcesTemp != null, "ReservedSourcesTemp should have been initialized."); 1028Debug.Assert(_dataflowBlockOptions.Greedy, "This method may only be used in greedy mode."); 1029Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 1030Debug.Assert(_nonGreedyState.ReservedSourcesTemp != null, "ReservedSourcesTemp should have been initialized."); 1031Debug.Assert(_boundingState != null, "Bounded state is required for bounded mode."); 1083Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 1084Debug.Assert(_nonGreedyState.ReservedSourcesTemp != null, "Should have been initialized"); 1114Debug.Assert(numItemsRemoved > 0, "Should only be called for a positive number of items removed."); 1125Debug.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"); 161Debug.Assert(_sharedResources != null, "_sharedResources not initialized"); 162Debug.Assert(_sharedResources._incomingLock != null, "_sharedResources._incomingLock not initialized"); 163Debug.Assert(_source != null, "_source not initialized"); 227Debug.Assert(batchedJoinBlock != null, "Need a block with which to construct the debug view."); 351Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 401Debug.Assert(_target1 != null, "_target1 not initialized"); 402Debug.Assert(_target2 != null, "_target2 not initialized"); 403Debug.Assert(_target3 != null, "_target3 not initialized"); 415Debug.Assert(_sharedResources != null, "_sharedResources not initialized"); 416Debug.Assert(_sharedResources._incomingLock != null, "_sharedResources._incomingLock not initialized"); 417Debug.Assert(_source != null, "_source not initialized"); 482Debug.Assert(batchedJoinBlock != null, "Need a block with which to construct the debug view."); 540Debug.Assert(sharedResources != null, "Targets require a shared resources through which to communicate."); 580Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 643Debug.Assert(batchedJoinBlockTarget != null, "Need a block with which to construct the debug view."); 676Debug.Assert(batchSize >= 1, "A positive batch size is required."); 677Debug.Assert(batchSizeReachedAction != null, "Need an action to invoke for each batch."); 678Debug.Assert(allTargetsDecliningAction != null, "Need an action to invoke when all targets have declined.");
Blocks\BroadcastBlock.cs (25)
76Debug.Assert(dataflowBlockOptions.BoundedCapacity > 0, "Positive bounding count expected; should have been verified by options ctor"); 91Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 121Debug.Assert(storeExceptionEvenIfAlreadyCompleting || !revertProcessingState, 136Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 188Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 203Debug.Assert(_boundingState != null && _boundingState.PostponedMessages != null, 218Debug.Assert(numItemsRemoved > 0, "Should only be called for a positive number of items removed."); 229Debug.Assert(_boundingState.CurrentCount - numItemsRemoved >= 0, 244Debug.Assert(_boundingState != null, "Must be in bounded mode."); 279Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 281Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 325Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 327Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 458Debug.Assert(broadcastBlock != null, "Need a block with which to construct the debug view."); 547Debug.Assert(owningSource != null, "Must be associated with a broadcast block."); 548Debug.Assert(dataflowBlockOptions != null, "Options are required to configure this block."); 668Debug.Assert(target != null, "Target required to offer messages to."); 705else Debug.Assert(result != DataflowMessageStatus.NotAvailable, "Messages from a Broadcast should never be missed."); 738Debug.Assert(_messages.Count > 0, "There must be at least one message to dequeue."); 938Debug.Assert(_taskForOutputProcessing == null, "There must be no processing tasks."); 939Debug.Assert( 1150Debug.Assert(exception != null, "An exception to add is required."); 1151Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions."); 1162Debug.Assert(exceptions != null, "A list of exceptions 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.");
Blocks\BufferBlock.cs (13)
73Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 116Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 132Debug.Assert(_boundingState != null && _boundingState.PostponedMessages != null, 156Debug.Assert(storeExceptionEvenIfAlreadyCompleting || !revertProcessingState, 171Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 219Debug.Assert(numItemsRemoved > 0, "A positive number of items to remove is required."); 230Debug.Assert(_boundingState.CurrentCount - numItemsRemoved >= 0, 245Debug.Assert(_boundingState != null, "Must be in bounded mode."); 281Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 283Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 327Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 329Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 442Debug.Assert(bufferBlock != null, "Need a block with which to construct the debug view.");
Blocks\JoinBlock.cs (42)
95Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 133Debug.Assert(_target1 != null, "_target1 not initialized"); 134Debug.Assert(_target2 != null, "_target2 not initialized"); 145Debug.Assert(_sharedResources != null, "_sharedResources not initialized"); 146Debug.Assert(_sharedResources._exceptionAction != null, "_sharedResources._exceptionAction not initialized"); 205Debug.Assert(joinBlock != null, "Need a block with which to construct the debug view."); 314Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 352Debug.Assert(_target1 != null, "_target1 not initialized"); 353Debug.Assert(_target2 != null, "_target2 not initialized"); 354Debug.Assert(_target3 != null, "_target3 not initialized"); 366Debug.Assert(_sharedResources != null, "_sharedResources not initialized"); 367Debug.Assert(_sharedResources._exceptionAction != null, "_sharedResources._exceptionAction not initialized"); 429Debug.Assert(joinBlock != null, "Need a block with which to construct the debug view."); 502Debug.Assert(sharedResources != null, "Targets need shared resources through which to communicate."); 518Debug.Assert(_messages != null, "_messages must have been initialized in greedy mode"); 519Debug.Assert(_messages.Count >= 0, "A message must have been consumed by this point."); 524Debug.Assert(_nonGreedy!.ConsumedMessage.Key, "A message must have been consumed by this point."); 549Debug.Assert(_messages != null, "_messages must have been initialized in greedy mode"); 584Debug.Assert(_sharedResources._dataflowBlockOptions.Greedy, "This is only valid in greedy mode"); 601Debug.Assert(!_sharedResources._dataflowBlockOptions.Greedy, "This is only used in non-greedy mode"); 608Debug.Assert(!HasAtLeastOneMessageAvailable, "The queue must be empty between joins in non-greedy mode"); 641Debug.Assert(!_sharedResources._dataflowBlockOptions.Greedy, "This is only used in non-greedy mode"); 642Debug.Assert(_nonGreedy!.ReservedMessage.Key != null, "This target must have a reserved message"); 668Debug.Assert(!_nonGreedy.ConsumedMessage.Key, "There must be no other consumed message"); 683Debug.Assert(_sharedResources._dataflowBlockOptions.Greedy, "This is only used in greedy mode"); 684Debug.Assert(_sharedResources._boundingState != null, "This is only used in bounding mode"); 768Debug.Assert(_nonGreedy != null, "Only valid in non-greedy mode."); 779Debug.Assert(_nonGreedy == null || _nonGreedy.ReservedMessage.Key == null, 843Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 867Debug.Assert(_nonGreedy != null, "_nonGreedy must have been initialized during construction in non-greedy mode."); 898Debug.Assert(_messages != null, "_messages must be initialized in greedy mode."); 962Debug.Assert(joinBlockTarget != null, "Need a target with which to construct the debug view."); 1028Debug.Assert(ownerJoin != null, "Resources must be associated with a join."); 1029Debug.Assert(targets != null, "Resources must be shared between multiple targets."); 1030Debug.Assert(joinFilledAction != null, "An action to invoke when a join is created must be provided."); 1031Debug.Assert(exceptionAction != null, "An action to invoke for faults must be provided."); 1032Debug.Assert(dataflowBlockOptions != null, "Options must be provided to configure the resources."); 1262Debug.Assert(JoinNeedsProcessing, "There must be a join that needs processing."); 1343Debug.Assert(!_dataflowBlockOptions.Greedy || _boundingState != null, "This only makes sense in non-greedy or bounding mode"); 1382Debug.Assert(_targets.Length > 0, "A join must have targets."); 1409Debug.Assert(numItemsRemoved > 0, "Number of items removed needs to be positive."); 1420Debug.Assert(_boundingState.CurrentCount - numItemsRemoved >= 0,
Blocks\TransformBlock.cs (7)
98Debug.Assert(transformSync == null ^ transformAsync == null, "Exactly one of transformSync and transformAsync must be null."); 129Debug.Assert(transformAsync != null, "Incorrect delegate type."); 154Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 225Debug.Assert(transform != null, "Function to invoke is required."); 270Debug.Assert(completed != null, "Completed task is required."); 271Debug.Assert(completed.IsCompleted, "Task must be completed to be here."); 417Debug.Assert(transformBlock != null, "Need a block with which to construct the debug view.");
Blocks\TransformManyBlock.cs (10)
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."); 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."); 626Debug.Assert(transformManyBlock != null, "Need a block with which to construct the debug view.");
Blocks\TransformManyBlock.IAsyncEnumerable.cs (3)
40t.ContinueWith(static t => Debug.Assert(t.IsCompletedSuccessfully), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default); 119Debug.Assert(_reorderingBuffer is not null, "Expected a reordering buffer"); 120Debug.Assert(id != Common.INVALID_REORDERING_ID, "This ID should never have been handed out.");
Blocks\WriteOnceBlock.cs (6)
111Debug.Assert(_decliningPermanently, "We may get here only after we have started to decline permanently."); 112Debug.Assert(_completionReserved, "We may get here only after we have reserved completion."); 170Debug.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."); 221Debug.Assert(exception != null || !storeExceptionEvenIfAlreadyCompleting, 425Debug.Assert(_header.IsValid, "A valid header is required."); 522Debug.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."); 258Debug.Assert(!_enableOffering, "Offering should have been disabled if there was a valid reservation"); 365Debug.Assert(items != null); 406Debug.Assert(items != null, "Items list must be valid."); 456Debug.Assert(exception != null, "Valid exception must be provided to be added."); 457Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions."); 468Debug.Assert(exceptions != null, "Valid exceptions must be provided to be added."); 469Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions."); 483Debug.Assert(aggregateException != null && aggregateException.InnerExceptions.Count > 0, "Aggregate must be valid and contain inner exceptions to unwrap."); 484Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions."); 573Debug.Assert(linkToTarget != null, "Must have a valid target to offer to."); 667Debug.Assert(target != null, "Valid target to offer to is required."); 672Debug.Assert(result != DataflowMessageStatus.NotAvailable, "Messages are not being offered concurrently, so nothing should be missed."); 690Debug.Assert(result == DataflowMessageStatus.Postponed, 735Debug.Assert(_taskForOutputProcessing == null && _enableOffering && !_messages.IsEmpty, 794Debug.Assert(_taskForOutputProcessing != null && _taskForOutputProcessing.Id == Task.CurrentId, 852Debug.Assert(_taskForOutputProcessing != null && _taskForOutputProcessing.Id == Task.CurrentId, 906Debug.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 is not 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 is not null, "Expected a non-null segment."); 180Debug.Assert(array is not null, "Expected a non-null item array."); 253Debug.Assert(segment is not null, "Expected a non-null segment."); 254Debug.Assert(array is not null, "Expected a non-null item array."); 368Debug.Assert(syncObj is not null, "The syncObj parameter is null."); 390Debug.Assert((size & (size - 1)) == 0, "Size must be a power of 2"); 429Debug.Assert(queue is not null, "Expected a non-null queue.");
System.Threading.Tasks.Parallel (38)
System\Threading\Tasks\Parallel.cs (16)
923Debug.Assert(typeof(TInt) == typeof(int) || typeof(TInt) == typeof(long)); 924Debug.Assert(((body == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) + (bodyWithLocal == null ? 0 : 1)) == 1, 926Debug.Assert(bodyWithLocal != null || (localInit == null && localFinally == null), 1024Debug.Assert(sharedPStateFlags != null); 1029Debug.Assert(sharedPStateFlags != null); 1645Debug.Assert(((body == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) + 1648Debug.Assert((bodyWithStateAndLocal != null) || (bodyWithEverything != null) || (localInit == null && localFinally == null), 1703Debug.Assert(array != null); 1704Debug.Assert(parallelOptions != null, "ForEachWorker(array): parallelOptions is null"); 1762Debug.Assert(list != 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), 2821Debug.Assert(exObj is Exception); 2833Debug.Assert(first is OperationCanceledException);
System\Threading\Tasks\Parallel.ForEachAsync.cs (14)
80Debug.Assert(fromInclusive != null); 81Debug.Assert(toExclusive != null); 82Debug.Assert(scheduler != null); 83Debug.Assert(body != null); 249Debug.Assert(source != null); 250Debug.Assert(scheduler != null); 251Debug.Assert(body != null); 404Debug.Assert(source != null); 405Debug.Assert(scheduler != null); 406Debug.Assert(body != null); 601Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 608Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 653Debug.Assert(!Cancellation.IsCancellationRequested); 665Debug.Assert(taskSet, "Complete should only be called once.");
System\Threading\Tasks\ParallelLoopState.cs (3)
186Debug.Assert(typeof(TInt) == typeof(int) || typeof(TInt) == typeof(long)); 237Debug.Assert(typeof(TInt) == typeof(int) || typeof(TInt) == typeof(long)); 365Debug.Assert(typeof(TInt) == typeof(long));
System\Threading\Tasks\ParallelRangeManager.cs (5)
178Debug.Assert(typeof(TInt) == typeof(int) || typeof(TInt) == typeof(long)); 182Debug.Assert( 241Debug.Assert((uSpan / uRangeSize) < int.MaxValue); 275Debug.Assert(i == nNumRanges - 1); 291Debug.Assert(_indexRanges != null && _indexRanges.Length != 0);
System.Transactions.Local (146)
System\Transactions\CommittableTransaction.cs (6)
64Debug.Assert(_internalTransaction.State != null); 98Debug.Assert(_internalTransaction.State != null); 133Debug.Assert(_internalTransaction.State != null); 173Debug.Assert(_internalTransaction.State != null); 203Debug.Assert(_internalTransaction.State != null); 223Debug.Assert(_internalTransaction.State != null);
System\Transactions\DependentTransaction.cs (2)
20Debug.Assert(_internalTransaction.State != null); 51Debug.Assert(_internalTransaction.State != null);
System\Transactions\DurableEnlistmentState.cs (8)
182Debug.Assert(enlistment.Transaction.State != null); 192Debug.Assert(enlistment.Transaction.State != null); 202Debug.Assert(enlistment.Transaction.State != null); 214Debug.Assert(enlistment.Transaction.State != null); 231Debug.Assert(enlistment.PromotableSinglePhaseNotification != null); 239Debug.Assert(enlistment.Transaction.State != null); 251Debug.Assert(enlistment.Transaction.State != null); 263Debug.Assert(enlistment.Transaction.State != null);
System\Transactions\Enlistment.cs (11)
93Debug.Assert(this is RecoveringInternalEnlistment); 103Debug.Assert(this is PromotableInternalEnlistment); 142Debug.Assert(_twoPhaseState != null); 164Debug.Assert(_transaction != null, "this.transaction != null"); 234Debug.Assert(Transaction._phase0Volatiles._preparedVolatileEnlistments <= 260Debug.Assert(_singlePhaseNotifications != null); 275Debug.Assert(_twoPhaseNotifications != null); 282Debug.Assert(_twoPhaseNotifications != null); 289Debug.Assert(_twoPhaseNotifications != null); 296Debug.Assert(_twoPhaseNotifications != null); 388Debug.Assert(_transaction._phase1Volatiles._preparedVolatileEnlistments <=
System\Transactions\EnlistmentState.cs (7)
118Debug.Assert(enlistment.PromotedEnlistment != null); 132Debug.Assert(enlistment.PromotedEnlistment != null); 146Debug.Assert(enlistment.PromotedEnlistment != null); 160Debug.Assert(enlistment.PromotedEnlistment != null); 174Debug.Assert(enlistment.PromotedEnlistment != null); 188Debug.Assert(enlistment.PromotedEnlistment != null); 202Debug.Assert(enlistment.PromotedEnlistment != null);
System\Transactions\InternalTransaction.cs (4)
129Debug.Assert(_promotedTransaction == null, "A transaction can only be promoted once!"); 300Debug.Assert(tx.PromotedTransaction != null); 304Debug.Assert(tx.State! != null); 355Debug.Assert(_committableTransaction != null);
System\Transactions\Transaction.cs (12)
461Debug.Assert(_internalTransaction.State != null); 502Debug.Assert(_internalTransaction.State != null); 550Debug.Assert(_internalTransaction.State != null); 576Debug.Assert(_internalTransaction.State != null); 600Debug.Assert(_internalTransaction.State != null); 637Debug.Assert(_internalTransaction.State != null); 676Debug.Assert(_internalTransaction.State != null); 797Debug.Assert(_internalTransaction.State != null); 919Debug.Assert(_internalTransaction.State != null); 964Debug.Assert(_internalTransaction.State != null); 1002Debug.Assert(_internalTransaction.State != null); 1019Debug.Assert(_internalTransaction.State != null);
System\Transactions\TransactionInformation.cs (2)
59Debug.Assert(_internalTransaction.State != null); 88Debug.Assert(_internalTransaction.State != null);
System\Transactions\TransactionScope.cs (8)
538Debug.Assert(_threadContextData != null); 559Debug.Assert(rollbackTransaction != null); 792Debug.Assert(rollbackTransaction != null); 804Debug.Assert(null != _dependentTransaction, "null != this.dependentTransaction"); 818Debug.Assert(_expectedCurrent != null); 938Debug.Assert(ContextKey != null); 985Debug.Assert(_savedCurrentScope.ContextKey != null); 1027Debug.Assert(_threadContextData != null);
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 (57)
163Debug.Assert(tx.State != this, "Changing to the same state."); 615Debug.Assert(tx._phase0Volatiles._dependentClones >= 0); 618Debug.Assert(tx._phase0Volatiles._preparedVolatileEnlistments <= 636Debug.Assert(tx._phase1Volatiles._dependentClones >= 0); 664Debug.Assert(tx.promotedToken != null); 788Debug.Assert(tx._promoterType != Guid.Empty, "InternalTransaction.PromoterType was not set in PSPEInitialize"); 835Debug.Assert(tx._promoter != null, "Transaction Promoter is Null entering SubordinateActive"); 845Debug.Assert(tx._promoter != null); 1077Debug.Assert(tx._promoterType != Guid.Empty, "InternalTransaction.PromoterType was not set in Phase0PSPEInitialize"); 1183Debug.Assert(tx._committableTransaction != null); 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."); 1879Debug.Assert(tx._phase0Volatiles._preparedVolatileEnlistments <= 1893Debug.Assert(tx._phase0WaveDependentCloneCount >= 0); 1927Debug.Assert(tx._phase1Volatiles._dependentClones >= 0); 1934Debug.Assert(0 <= tx._abortingDependentCloneCount); 1969Debug.Assert(tx.PromotedTransaction != null); 1991Debug.Assert(tx.PromotedTransaction != null); 2007Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 2065Debug.Assert(tx.PromotedTransaction != null); 2101Debug.Assert(tx.promotedToken != null, "InternalTransaction.promotedToken is null in TransactionStateDelegatedNonMSDTCBase or one of its derived classes."); 2131Debug.Assert(tx.PromotedTransaction != null && tx.PromotedTransaction.RealTransaction != null); 2145Debug.Assert((tx._promoterType == Guid.Empty) || (tx._promoterType == TransactionInterop.PromoterTypeDtc), "Promoted to MSTC but PromoterType is not TransactionInterop.PromoterTypeDtc"); 2255Debug.Assert(tx.PromotedTransaction != null); 2271Debug.Assert(tx.PromotedTransaction != null); 2296Debug.Assert(tx.PromotedTransaction != null && tx.PromotedTransaction.RealTransaction != null); 2300Debug.Assert(tx.State != null); 2536Debug.Assert(tx._phase0Volatiles.VolatileDemux != null, "Volatile Demux must exist for VolatilePrepareDone when promoted."); 2541Debug.Assert(tx._phase0Volatiles.VolatileDemux._promotedEnlistment != null); 2644Debug.Assert(tx._phase1Volatiles.VolatileDemux != null, "Volatile Demux must exist for VolatilePrepareDone when promoted."); 2649Debug.Assert(tx._phase1Volatiles.VolatileDemux._promotedEnlistment != null); 2766Debug.Assert(tx._phase0Volatiles.VolatileDemux._promotedEnlistment != null); 2777Debug.Assert(tx.PromotedTransaction != null); 2801Debug.Assert(tx._phase1Volatiles.VolatileDemux != null, "Volatile Demux must exist."); 2808Debug.Assert(tx._phase1Volatiles.VolatileDemux._promotedEnlistment != null); 2864Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 2894Debug.Assert(tx.PromotedTransaction != null); 3364Debug.Assert(tx._durableEnlistment != null); 3494Debug.Assert(tx._durableEnlistment != null, "PromotedNonMSDTC state is not valid for transaction"); 3535Debug.Assert(tx._phase0Volatiles._preparedVolatileEnlistments <= 3554Debug.Assert(tx._phase1Volatiles._dependentClones >= 0); 3633Debug.Assert(tx.promotedToken != null, "InternalTransaction.promotedToken is null in TransactionStateDelegatedNonMSDTCBase or one of its derived classes."); 3746Debug.Assert(tx._committableTransaction != null); 3847Debug.Assert(tx._durableEnlistment != null); 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."); 4307Debug.Assert(tx.PromotedTransaction != null); 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 || 4422Debug.Assert(tx._promoter != null); 4616Debug.Assert(tx._durableEnlistment != null); 4652Debug.Assert(tx._durableEnlistment != null);
System\Transactions\TransactionTable.cs (3)
332Debug.Assert(lastBucketSet != null); 377Debug.Assert(tx._tableBucket != null); 671Debug.Assert(transactionCount == _index, "Index changed timing out transactions");
System\Transactions\VolatileEnlistmentMultiplexing.cs (9)
258Debug.Assert(_promotedEnlistment != null && _transaction.State != null); 285Debug.Assert(_promotedEnlistment != null && _transaction.State != null); 295Debug.Assert(_promotedEnlistment != null && _transaction.State != null); 305Debug.Assert(_transaction.State != null); 349Debug.Assert(_promotedEnlistment != null && _transaction.State != null); 377Debug.Assert(_promotedEnlistment != null && _transaction.State != null); 388Debug.Assert(_promotedEnlistment != null && _transaction.State != null); 399Debug.Assert(_transaction.State != null); 454Debug.Assert(_volatileDemux == null, "volatileDemux can only be set once.");
System\Transactions\VolatileEnlistmentState.cs (10)
147Debug.Assert(enlistment.EnlistmentNotification != null); 179Debug.Assert(enlistment.Transaction.State != null); 222Debug.Assert(enlistment.SinglePhaseNotification != null); 241Debug.Assert(enlistment.Transaction.State != null); 248Debug.Assert(enlistment.Transaction.State != null); 256Debug.Assert(enlistment.Transaction.State != null); 266Debug.Assert(enlistment.Transaction.State != null); 372Debug.Assert(enlistment.EnlistmentNotification != null); 415Debug.Assert(enlistment.EnlistmentNotification != null); 449Debug.Assert(enlistment.EnlistmentNotification != null);
System.Web.HttpUtility (10)
src\libraries\Common\src\System\HexConverter.cs (3)
167Debug.Assert(chars.Length >= bytes.Length * 2); 359Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 360Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 281Debug.Assert(additionalCapacityBeyondPos > 0); 282Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Web\Util\HttpEncoder.cs (1)
632Debug.Assert(!_byteBuffer.IsEmpty);
System.Windows.Controls.Ribbon (79)
Microsoft\Windows\Controls\KeyTipAdorner.cs (1)
92Debug.Assert(_keyTipControl == null && keyTipControl.KeyTipAdorner == null);
Microsoft\Windows\Controls\KeyTipService.cs (3)
240Debug.Assert(element != null); 1111Debug.Assert(_currentGlobalScope != null); 1175Debug.Assert(_scopeStack.Count > 0);
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonGalleryCategoriesPanel.cs (1)
142Debug.Assert(IsScrolling);
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonGalleryItemsPanel.cs (1)
330Debug.Assert(maxColumnCount >= minColumnCount);
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonGroupsPanel.cs (4)
436Debug.Assert(DoubleUtil.GreaterThan(remainingSpace, 0)); 474Debug.Assert(index >= 0 && index < starInfoList.Count); 501Debug.Assert(distributionCount > 0 && distributionCount <= starInfoList.Count); 502Debug.Assert(DoubleUtil.GreaterThan(remainingSpace, 0));
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonQuickAccessToolBarOverflowPanel.cs (2)
24Debug.Assert(child != null, "child not expected to be null"); 25Debug.Assert(RibbonQuickAccessToolBar.GetIsOverflowItem(child), "child expected to have IsOverflowItem == true");
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonQuickAccessToolBarPanel.cs (16)
183Debug.Assert(generatedChild != null); 222Debug.Assert(overflowPanel.Children.Count >= overflowIndex, "overflowIndex should never get above overflowPanel.Children.Count"); 305Debug.Assert(GeneratedChildren.Count > InternalChildren.Count); 307Debug.Assert(QAT.OverflowPanel.Children.Count == numItemsExpectedInOverflowPanel); 313Debug.Assert(object.ReferenceEquals(InternalChildren[j], GeneratedChildren[j])); 315Debug.Assert(currentChild != null); 316Debug.Assert(!RibbonQuickAccessToolBar.GetIsOverflowItem(currentChild)); 317Debug.Assert(this.Children.Contains(currentChild)); 318Debug.Assert(!QAT.OverflowPanel.Children.Contains(currentChild)); 319Debug.Assert(currentChild.IsVisible == this.IsVisible); 320Debug.Assert(currentChild.DesiredSize.Width > 0.0); 327Debug.Assert(object.ReferenceEquals(QAT.OverflowPanel.Children[overflowPanelIndex], GeneratedChildren[k])); 329Debug.Assert(currentChild != null); 330Debug.Assert(RibbonQuickAccessToolBar.GetIsOverflowItem(currentChild)); 331Debug.Assert(!this.Children.Contains(currentChild)); 332Debug.Assert(QAT.OverflowPanel.Children.Contains(currentChild));
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonTabHeadersPanel.cs (3)
246Debug.Assert(ribbon.TabDisplayIndexToIndexMap.ContainsKey(i)); 248Debug.Assert(children.Count > index && index >= 0); 729Debug.Assert(child != null);
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonWindowSmallIconConverter.cs (2)
88Debug.Assert(size.Width != 0, "input param width should not be zero"); 89Debug.Assert(size.Height != 0, "input param height should not be zero");
Microsoft\Windows\Controls\Ribbon\Ribbon.cs (1)
1645Debug.Assert(ItemContainerGenerator.Status == GeneratorStatus.ContainersGenerated, "Expected: containers should be generated before calling this method.");
Microsoft\Windows\Controls\Ribbon\RibbonComboBox.cs (1)
619Debug.Assert(_editableTextBoxSite == sender);
Microsoft\Windows\Controls\Ribbon\RibbonControlLengthConverter.cs (1)
233Debug.Assert(unit == RibbonControlLengthUnitType.Pixel || unit == RibbonControlLengthUnitType.Item ||
Microsoft\Windows\Controls\Ribbon\RibbonGallery.cs (10)
103Debug.Assert(_filterMenuButton.ItemContainerGenerator != null); 111Debug.Assert(_filterMenuButton.ItemContainerGenerator != null); 1039Debug.Assert(selectedItem != null, "Must have a selectedItem to synchronize with."); 1080Debug.Assert(IsSynchronizedWithCurrentItemInternal, "We should add currency change listeners only when IsSynchronizedWithCurrentItemInternal is true"); 1158Debug.Assert(IsSynchronizedWithCurrentItemInternal, "We shouldn't be listening for currency changes if IsSynchronizedWithCurrentItemInternal is false"); 1181Debug.Assert(IsSynchronizedWithCurrentItemInternal, "We shouldn't be listening for currency changes if IsSynchronizedWithCurrentItemInternal is false"); 1489Debug.Assert(String.IsNullOrEmpty(path) || path == "/InnerText"); 2350Debug.Assert(gallery.ItemContainerGenerator.Status == GeneratorStatus.ContainersGenerated); 2644Debug.Assert(e.RoutedEvent == Mouse.MouseMoveEvent || e.RoutedEvent == Mouse.MouseLeaveEvent); 2645Debug.Assert(_localMousePosition.HasValue);
Microsoft\Windows\Controls\Ribbon\RibbonGalleryCategory.cs (1)
507Debug.Assert(RibbonGallery == null || RibbonGallery.IsSynchronizedWithCurrentItemInternal, "We shouldn't be listening for currency changes if IsSynchronizedWithCurrentItemInternal is false");
Microsoft\Windows\Controls\Ribbon\RibbonGroup.cs (1)
1163Debug.Assert(groupSizeDefinition != null && groupSizeDefinition.IsCollapsed);
Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs (16)
206Debug.Assert(property != null); 212Debug.Assert(d != null); 213Debug.Assert(property != null); 214Debug.Assert(v != null); 779Debug.Assert(category.RibbonGallery == gallery, "The reference RibbongalleryItem and the RibbonGallery must be related."); 942Debug.Assert(element != null, "Element must not be null"); 943Debug.Assert(routedEvent != null, "RoutedEvent must not be null"); 967Debug.Assert(element != null, "Element must not be null"); 968Debug.Assert(routedEvent != null, "RoutedEvent must not be null"); 996Debug.Assert(element != null); 1361Debug.Assert(starLayoutProvider != null); 2113Debug.Assert(clone is ButtonBase, 2146Debug.Assert(clone is ButtonBase || clone is RibbonMenuButton, 2184Debug.Assert(clone is ButtonBase || clone is RibbonMenuButton, 2204Debug.Assert(clone is RibbonMenuButton, 2471Debug.Assert(parentItemsControl != null);
Microsoft\Windows\Controls\Ribbon\RibbonKeyTipAndContentSyncHelper.cs (5)
31Debug.Assert(element != null); 73Debug.Assert(element != null); 93Debug.Assert(element != null); 118Debug.Assert(element != null); 137Debug.Assert(element != null);
Microsoft\Windows\Controls\Ribbon\RibbonMenuButton.cs (3)
1469Debug.Assert(GetType().IsSubclassOf(type)); // RibbonMenuButton is a subclass of MenuBase 1473Debug.Assert(property != null); 1478Debug.Assert(method != null);
Microsoft\Windows\Controls\Ribbon\RibbonMenuItem.cs (2)
1164Debug.Assert(timer != null, "timer should not be null."); 1165Debug.Assert(!timer.IsEnabled, "timer should not be running.");
Microsoft\Windows\Controls\Ribbon\RibbonTab.cs (1)
450Debug.Assert(resizeStatusCount > 0);
Microsoft\Windows\Controls\Ribbon\RibbonTwoLineText.cs (2)
337Debug.Assert(_textBlock1 != null && _textBlock2 != null); 371Debug.Assert(_textBlock1 != null && _textBlock2 != null);
Microsoft\Windows\Controls\TextSearchInternal.cs (2)
801Debug.Assert(_attachedTo != null); 816Debug.Assert(_attachedTo != null);
System.Windows.Forms (2187)
System\Resources\ResXDataNode.cs (4)
157Debug.Assert(_name is not null || _nodeInfo?.Name is not null); 176Debug.Assert(FileRefType is not null); 343Debug.Assert(_value is string, "Resource entries with no Type or MimeType must be encoded as strings"); 489Debug.Assert(FileRef is not null);
System\Resources\ResXResourceReader.cs (6)
238Debug.Assert(_resData is null && _resMetadata is null); 262Debug.Assert(contentReader is not null); 341Debug.Assert(_resData is not null); 342Debug.Assert(_resMetadata is not null); 527Debug.Assert(_resData is not null); 528Debug.Assert(_resMetadata is not null);
System\Resources\ResXResourceWriter.cs (1)
165Debug.Assert(_fileName is not null, "Nothing to output to");
System\Windows\Forms\Accessibility\AccessibleObject.cs (3)
1019Debug.Assert(result.IsEmpty || result.vt == VARENUM.VT_I4); 1860Debug.Assert( 2265Debug.Assert(
System\Windows\Forms\Accessibility\AccessibleObject.EnumVariantObject.cs (2)
19Debug.Assert(owner is not null, "Cannot create EnumVariantObject with a null owner"); 25Debug.Assert(owner is not null, "Cannot create EnumVariantObject with a null owner");
System\Windows\Forms\ActiveX\AxHost.AxContainer.cs (9)
333Debug.Assert(_parent.Site is null, "Parent is sited but we could not find IContainer"); 351Debug.Assert(_components is not null); 377Debug.Assert(_components is not null); 388Debug.Assert( 466Debug.Assert(_siteUIActive is null || _siteUIActive == site, "Deactivating when not active"); 501Debug.Assert(_siteUIActive is null, "Object did not call OnUIDeactivate"); 583Debug.Assert(_parent is not null); 629Debug.Assert(_controlInEditMode is null || _controlInEditMode == ctl, "who is exiting edit mode?"); 670Debug.Assert(hr.Succeeded);
System\Windows\Forms\ActiveX\AxHost.AxPerPropertyBrowsingEnum.cs (2)
78Debug.Assert(_cookies is not null && _names is not null, "An item array is null"); 88Debug.Assert(_cookies.Length == _names.Length, "Got uneven names and cookies");
System\Windows\Forms\ActiveX\AxHost.cs (25)
1031Debug.Assert(!Visible, "If we were visible we would not be need a fake window."); 1048Debug.Assert(!IsHandleCreated, "if we need a fake window, we can't have a real one"); 1263Debug.Assert(!OwnWindow(), "Why are we here if we own our window?"); 1327Debug.Assert(GetOcState() == OC_LOADED, " failed transition"); 1332Debug.Assert(GetOcState() == OC_PASSIVE, " failed transition"); 1366Debug.Assert(GetOcState() == OC_LOADED, " failed transition"); 1371Debug.Assert(GetOcState() == OC_RUNNING, " failed transition"); 1383Debug.Assert(!_axState[s_fOwnWindow], "If we are invis at runtime, we should never be going beyond OC_RUNNING"); 1432Debug.Assert(GetOcState() == OC_UIACTIVE, " failed transition"); 1485Debug.Assert(CanUIActivate, "we have to be able to uiactivate"); 1494Debug.Assert(_axState[s_fFakingWindow], "have to be faking it in order to destroy it..."); 1577Debug.Assert(!_axState[s_fFakingWindow], "if we were visible, we could not have had a fake window..."); 1621Debug.Assert(!_axState[s_fOwnWindow], "can't own our window when hiding"); 1622Debug.Assert(IsHandleCreated, "gotta have a window to hide"); 1623Debug.Assert(GetOcState() >= OC_INPLACE, "have to be in place in order to hide."); 1628Debug.Assert(!IsHandleCreated, "if we are inplace deactivated we should not have a window."); 1825Debug.Assert(!_axState[s_disposed], "we could not be asking for the object when we are axState[disposed]..."); 2016Debug.Assert(_storageType != StorageType.Unknown, "if we are loaded, out storage type must be set!"); 2180Debug.Assert(_freezeCount >= 0, "invalid freeze count!"); 2303Debug.Assert(_instance is null, "instance must be null"); 2307Debug.Assert(_instance is not null, "w/o an exception being thrown we must have an object..."); 2389Debug.Assert(selectionStyle is >= 0 and <= 2, "Invalid selection style"); 2405Debug.Assert((_flags & AxFlags.PreventEditMode) == 0, "edit mode should have been disabled"); 2710Debug.Assert(dispid != PInvokeCore.DISPID_UNKNOWN, "Wrong dispid sent to GetPropertyDescriptorFromDispid"); 3234Debug.Assert(IsHandleCreated, "we got to have a handle to be here...");
System\Windows\Forms\ActiveX\AxHost.OleInterfaces.cs (1)
226Debug.Assert(!_host.GetAxState(s_siteProcessedInputKey), "Re-entering IOleControlSite.TranslateAccelerator!!!");
System\Windows\Forms\ActiveX\AxHost.State.cs (5)
136Debug.Assert(_storage is null, "but we already have a storage!"); 205Debug.Assert(_buffer is not null); 257Debug.Assert(_storage is not null, "how can we not have a storage object?"); 258Debug.Assert(_lockBytes is not null, "how can we have a storage w/o ILockBytes?"); 337Debug.Assert(_length == 0, "if we have no data, then our length has to be 0");
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (5)
867Debug.Assert(_activeXState[s_inPlaceVisible], "Failed to set inplacevisible"); 894Debug.Assert(_inPlaceFrame is not null, "Setting us to visible should have created the in place frame"); 1468Debug.Assert(hr.Succeeded, "Stream should be non-null."); 1706Debug.Assert(_clientSite is not null, "How can we setextent before we are sited??"); 1947Debug.Assert(_inPlaceFrame is not null, "No inplace frame -- how did we go UI active?");
System\Windows\Forms\ActiveX\Control.ActiveXImpl.PropertyBagStream.cs (2)
63Debug.Assert(_bag[name] is string); 75Debug.Assert(pVar->vt == VARENUM.VT_BSTR);
System\Windows\Forms\ActiveX\Control_ActiveXControlInterfaces.cs (2)
79Debug.Assert(ActiveXInstance.EventsFrozen == bFreeze, "Failed to set EventsFrozen correctly"); 538Debug.Assert(hr.Succeeded);
System\Windows\Forms\Application.ComponentThreadContext.cs (1)
142Debug.Assert(_componentID != s_invalidId, "Our ID sentinel was returned as a valid ID");
System\Windows\Forms\Application.cs (7)
332Debug.Assert(success); 944Debug.Assert(UseVisualStyles, "Enable Visual Styles failed"); 1134Debug.Assert( 1196Debug.Assert(PInvoke.IsWindow(handle), "Handle being parked is not a valid window handle"); 1197Debug.Assert( 1268Debug.Assert(process is not null); 1274Debug.Assert(arguments is not null && arguments.Length > 0);
System\Windows\Forms\Application.LightThreadContext.cs (1)
32Debug.Assert(uReason != msoloop.FocusWait);
System\Windows\Forms\Application.ParkingWindow.cs (1)
127Debug.Assert(
System\Windows\Forms\Application.ThreadContext.cs (4)
143Debug.Assert(_parkingWindows.Count == 1, "parkingWindows count can not be > 1 for legacy OS/target framework versions"); 277Debug.Assert(!disposing, "Shouldn't be getting dispose from another thread."); 415Debug.Assert(_debugModalCounter >= 0, "Mis-matched calls to Application.BeginModalMessageLoop() and Application.EndModalMessageLoop()"); 503Debug.Assert(context._id == id);
System\Windows\Forms\ApplicationContext.cs (1)
140Debug.Assert(sender is Form);
System\Windows\Forms\BinaryFormat\WinFormsBinaryFormatWriter.cs (1)
23Debug.Assert(success);
System\Windows\Forms\ComponentModel\COM2Interop\COM2IManagedPerPropertyBrowsingHandler.cs (1)
64Debug.Assert(typeNames.Length == values.Length, "Mismatched parameter and attribute name length");
System\Windows\Forms\ComponentModel\COM2Interop\Com2IPerPropertyBrowsingHandler.Com2IPerPropertyBrowsingEnum.cs (2)
74Debug.Assert(_cookies is not null && _names is not null, "An item array is null"); 84Debug.Assert(_cookies.Length == _names.Length, "Got uneven names and cookies");
System\Windows\Forms\ComponentModel\COM2Interop\COM2IVsPerPropertyBrowsingHandler.cs (8)
59Debug.Assert(sender.TargetObject is null); 76Debug.Assert(sender.TargetObject is null); 113Debug.Assert(sender.TargetObject is null); 130Debug.Assert(sender.TargetObject is null); 148Debug.Assert(sender.TargetObject is null); 166Debug.Assert(sender.TargetObject is null); 187Debug.Assert(sender.TargetObject is null); 205Debug.Assert(sender.TargetObject is null);
System\Windows\Forms\ComponentModel\COM2Interop\COM2Properties.cs (1)
94Debug.Assert(_defaultPropertyIndex < _properties.Length, "Whoops! default index is > props.Length");
System\Windows\Forms\ComponentModel\COM2Interop\COM2PropertyDescriptor.cs (1)
152Debug.Assert(_baseAttributes is not null);
System\Windows\Forms\ComponentModel\COM2Interop\Com2PropertyDescriptor.ValidityScope.cs (1)
23Debug.Assert(properties is not null);
System\Windows\Forms\ComponentModel\COM2Interop\COM2PropertyPageUITypeConverter.cs (1)
48Debug.Assert(instance is not null);
System\Windows\Forms\ComponentModel\COM2Interop\COM2TypeInfoProcessor.cs (4)
333Debug.Assert(typeDesc.Anonymous.hreftype != 0u, "typeDesc doesn't contain an hreftype!"); 339Debug.Assert(typeDesc.Anonymous.lptdesc is not null, "typeDesc doesn't contain an refTypeDesc!"); 648Debug.Assert(functionDescription->lprgelemdescParam is not null, "ELEMDESC param is null!"); 766Debug.Assert(!name.IsEmpty, "No name for VARDESC member, but GetDocumentation returned S_OK!");
System\Windows\Forms\Control.ControlCollection.cs (1)
349Debug.Assert(control is not null, "Why are we returning null controls from a valid index?");
System\Windows\Forms\Control.cs (28)
506Debug.Assert(accessibleObject is not null, "Failed to create accessibility object"); 525Debug.Assert(ncAccessibleObject is not null, "Failed to create NON-CLIENT accessibility object"); 777Debug.Assert(!backBrush.IsNull, "Failed to create brushHandle"); 1635Debug.Assert(s_defaultFont is not null, "defaultFont wasn't set!"); 2520Debug.Assert(Margin == value, "Error detected while setting Margin."); 2544Debug.Assert(MaximumSize == DefaultMaximumSize, "Error detected while resetting MaximumSize."); 2550Debug.Assert(MaximumSize == value, "Error detected while setting MaximumSize."); 2569Debug.Assert(MinimumSize == value, "Error detected while setting MinimumSize."); 4581Debug.Assert((cp.ExStyle & (int)WINDOW_EX_STYLE.WS_EX_MDICHILD) == 0, "Can't put MDI child forms on the parking form"); 5030Debug.Assert(this == entry._caller, "Called BeginInvoke on one control, and the corresponding EndInvoke on a different control"); 5046Debug.Assert(asyncResult.IsCompleted, "Why isn't this asyncResult done yet?"); 5056Debug.Assert(IsHandleCreated, "Handle should be created by now"); 5117Debug.Assert(c.IsHandleCreated, "FindMarshalingControl chose a bad control."); 5768Debug.Assert(window is not null, "window is null in Control.GetSafeHandle"); 6150Debug.Assert(tme._args!.Length == 1, "Arguments are wrong for WaitCallback"); 6155Debug.Assert(tme._args!.Length == 1, "Arguments are wrong for SendOrPostCallback"); 8420Debug.Assert(args is not null, "This method should never be called with null args."); 8768Debug.Assert((OBJ_TYPE)PInvokeCore.GetObjectType(hDC) == OBJ_TYPE.OBJ_ENHMETADC, 8770Debug.Assert((lParam & (long)PInvoke.PRF_CHILDREN) != 0, 8780Debug.Assert(success, "GetViewportOrgEx() failed."); 8788Debug.Assert(!hClippingRegion.IsNull, "CreateRectRgn() failed."); 8792Debug.Assert( 8810Debug.Assert(success, "GetWindowRect() failed."); 10242Debug.Assert(value != -1, "Outdated call to SetParentHandle"); 10250Debug.Assert(Handle != value, "Cycle created in SetParentHandle"); 10752Debug.Assert(LayoutSuspendCount > 0, "SuspendLayout: layoutSuspendCount overflowed."); 10768Debug.Assert(scaledFont is not null); 12703Debug.Assert(sizeProperty is not null && locationProperty is not null, "Error retrieving Size/Location properties on Control.");
System\Windows\Forms\Control.FontHandleWrapper.cs (1)
23Debug.Assert(!_handle.IsNull, "FontHandleWrapper disposed, but still being accessed");
System\Windows\Forms\Control.Ime.cs (8)
111Debug.Assert(val >= 0, "Counter underflow."); 451Debug.Assert(ImeSupported, "WARNING: Attempting to update ImeMode properties on IME-Unaware control!"); 452Debug.Assert(!DesignMode, "Shouldn't be updating cached ime mode at design-time"); 483Debug.Assert(ImeSupported, "ImeModeChanged should not be raised on an Ime-Unaware control."); 781Debug.Assert(countryTable is not null, "countryTable is null"); 839Debug.Assert(imeMode != ImeMode.Inherit, "ImeMode.Inherit is an invalid argument to ImeContext.SetImeStatus"); 937Debug.Assert(succeeded, "Could not set the IME open status."); 942Debug.Assert(succeeded, "Could not release IME context.");
System\Windows\Forms\Control.MetafileDCWrapper.cs (4)
30Debug.Assert((OBJ_TYPE)PInvokeCore.GetObjectType(hOriginalDC) == OBJ_TYPE.OBJ_ENHMETADC, 65Debug.Assert(success, "DICopy() failed."); 68Debug.Assert(success, "DeleteObject() failed."); 70Debug.Assert(success, "DeleteObject() failed.");
System\Windows\Forms\Control.SuspendLayoutScope.cs (1)
32Debug.Assert(_control is null || _layoutSuspendCount == _control.LayoutSuspendCount, "Suspend/Resume layout mismatch!");
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (2)
436Debug.Assert(_image is null, "We expect to be returning null."); 991Debug.Assert(GetStyle(ControlStyles.UserPaint), "Shouldn't be in PaintControl when control is not UserPaint style");
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutData.cs (1)
27Debug.Assert(options is not null, "must have options");
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonPopupAdapter.cs (3)
142Debug.Assert( 167Debug.Assert( 183Debug.Assert(
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonStandardAdapter.cs (1)
210Debug.Assert(
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxBaseAdapter.cs (1)
190Debug.Assert(
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxPopupAdapter.cs (1)
123Debug.Assert(
System\Windows\Forms\Controls\Buttons\ButtonInternal\DarkMode\ButtonDarkModeAdapter.cs (2)
62Debug.Assert(false, "Exception in PaintUp: Unable to render button in dark mode."); 99Debug.Assert(false, "Exception in PaintDown: Unable to render button in dark mode.");
System\Windows\Forms\Controls\Buttons\ButtonInternal\RadioButtonBaseAdapter.cs (1)
99Debug.Assert(!hdc.IsNull, "Calling DrawAndFillEllipse with null wg");
System\Windows\Forms\Controls\ComboBox\ComboBox.ACNativeWindow.cs (2)
20Debug.Assert(!s_acWindows.ContainsKey(acHandle)); 73Debug.Assert(s_acWindows.ContainsKey(HWND));
System\Windows\Forms\Controls\ComboBox\ComboBox.ChildAccessibleObject.cs (1)
16Debug.Assert(owner.IsHandleCreated, "ComboBox's handle hasn't been created");
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxAccessibleObject.cs (1)
134Debug.Assert(index < entries.Count);
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxUiaTextProvider.cs (1)
35Debug.Assert(_owningComboBox.IsHandleCreated);
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (12)
588Debug.Assert(IsHandleCreated, "Handle should be created at this point"); 2020Debug.Assert((ModifierKeys & Keys.Alt) == 0); 2038Debug.Assert((ModifierKeys & Keys.Alt) == 0); 2159Debug.Assert(IsHandleCreated, "Shouldn't be calling Native methods before the handle is created."); 2169Debug.Assert(IsHandleCreated, "Shouldn't be calling Native methods before the handle is created."); 2199Debug.Assert(actualLength != PInvoke.LB_ERR, "Should have validated the index above"); 2210Debug.Assert(IsHandleCreated, "Shouldn't be calling Native methods before the handle is created."); 2226Debug.Assert(IsHandleCreated, "Shouldn't be calling Native methods before the handle is created."); 2278Debug.Assert(_childEdit is null, "Child edit window already attached"); 2279Debug.Assert(_childListBox is null, "Child listbox window already attached"); 2837Debug.Assert(DisplayMember.Equals(string.Empty), "if this list is sorted it means that dataSource was null when Sorted first became true. at that point DisplayMember had to be String.Empty"); 3174Debug.Assert(DropDownStyle == ComboBoxStyle.DropDownList);
System\Windows\Forms\Controls\ComboBox\ComboBox.ObjectCollection.cs (1)
134Debug.Assert(index >= 0 && index <= Count, "Wrong index for insert");
System\Windows\Forms\Controls\DataGridView\DataGridView.AccessibleObject.cs (1)
66Debug.Assert(GetChildCount() == 0);
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (47)
1134Debug.Assert(dataGridViewCell is not null); 1713Debug.Assert(_ptCurrentCell.X >= 0 && _ptCurrentCell.Y >= 0); 1714Debug.Assert(_ptCurrentCell.X < Columns.Count); 1715Debug.Assert(_ptCurrentCell.Y < Rows.Count); 1782Debug.Assert(_ptCurrentCell.X >= 0 && _ptCurrentCell.X < Columns.Count); 1783Debug.Assert(_ptCurrentCell.Y >= 0 && _ptCurrentCell.Y < Rows.Count); 1785Debug.Assert(dataGridViewRow is not null); 1787Debug.Assert(IsSharedCellVisible(dataGridViewCell, _ptCurrentCell.Y)); 1801Debug.Assert(_ptCurrentCell.Y != -1); 1819Debug.Assert(_ptCurrentCell.Y != -1); 1837Debug.Assert(_ptCurrentCell.Y != -1); 1855Debug.Assert(_ptCurrentCell.Y >= 0); 1856Debug.Assert(_ptCurrentCell.Y < Rows.Count); 2309Debug.Assert(firstDisplayedCell.RowIndex >= 0 2345Debug.Assert(DisplayedBandsInfo.NumTotallyDisplayedFrozenRows == 0); 2353Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow == -1); 2354Debug.Assert(DisplayedBandsInfo.NumDisplayedScrollingRows == 0); 2355Debug.Assert(DisplayedBandsInfo.NumTotallyDisplayedScrollingRows == 0); 2407Debug.Assert(DisplayedBandsInfo.LastTotallyDisplayedScrollingCol == -1); 2410Debug.Assert(firstDisplayedColumnIndex == firstDisplayedColumnIndexDbg1 || !Visible || DisplayedBandsInfo.Dirty); 2411Debug.Assert(firstDisplayedColumnIndex == firstDisplayedColumnIndexDbg2 || DisplayedBandsInfo.Dirty); 2479Debug.Assert(totalVisibleFrozenWidth > 0); 2509Debug.Assert(success); 2511Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol >= 0); 2512Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol == value 2559Debug.Assert(totalVisibleFrozenHeight > 0); 2584Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 2589Debug.Assert(rowsToScroll != 0); 2599Debug.Assert(success); 2764Debug.Assert(Columns.DisplayInOrder(DisplayedBandsInfo.FirstDisplayedScrollingCol, oldFirstVisibleScrollingCol)); 2809Debug.Assert(_horizontalOffset == 0); 2925Debug.Assert(dataGridViewCell is not null); 2926Debug.Assert(rowIndex >= 0); 2936Debug.Assert(dataGridViewCell is not null); 2937Debug.Assert(rowIndex >= 0); 2946Debug.Assert(dataGridViewCell is not null); 2947Debug.Assert(rowIndex >= 0); 3028Debug.Assert(value >= 0); 3116Debug.Assert(_individualReadOnlyCells.Count == 0); 3119Debug.Assert(!Columns[columnIndex].ReadOnly); 3125Debug.Assert((Rows.GetRowState(rowIndex) & DataGridViewElementStates.ReadOnly) == 0); 3407Debug.Assert(_rowHeaderWidth != value); 3408Debug.Assert(value >= MinimumRowHeadersWidth); 3607Debug.Assert(HorizontalOffset == 0); 3608Debug.Assert(VerticalOffset == 0); 3895Debug.Assert(_ptCurrentCell.Y >= 0); 3903Debug.Assert(_ptCurrentCell.Y >= 0);
System\Windows\Forms\Controls\DataGridView\DataGridView.DataConnection.cs (39)
148Debug.Assert(_dataConnectionState[DATACONNECTIONSTATE_cancellingRowEdit]); 163Debug.Assert(CurrencyManager.AllowAdd, "why did we call AddNew on the currency manager when the currency manager does not allow new rows?"); 274Debug.Assert(_props is not null); 311Debug.Assert(sortProperty is null); 327Debug.Assert(_props is not null); 341Debug.Assert(DataBoundRowsCount() == CurrencyManager!.List!.Count || (_owner.Columns.Count == 0 && dataGridViewRowsCount == 0), 348Debug.Assert(sender == CurrencyManager, "did we forget to unregister our ListChanged event handler?"); 388Debug.Assert(!_dataConnectionState[DATACONNECTIONSTATE_inAddNew] || !_dataConnectionState[DATACONNECTIONSTATE_finishedAddNew], 414Debug.Assert(_owner.AllowUserToAddRowsInternal, "how did we start the add new transaction when the AllowUserToAddRowsInternal is false?"); 474Debug.Assert(CurrencyManager?.List is not null); 488Debug.Assert(DataBoundRowsCount() != -1, "the data bound data grid view rows count should be at least 0"); 492Debug.Assert(CurrencyManager?.List is not null); 508Debug.Assert(CurrencyManager.List.Count == 1); 513Debug.Assert(_dataConnectionState[DATACONNECTIONSTATE_finishedAddNew]); 529Debug.Assert(CurrencyManager!.List!.Count == 0, "we deleted the row that the Child table forcefully added"); 551Debug.Assert(CurrencyManager?.List is not null); 616Debug.Assert(e.OldIndex > -1, "the currency manager should have taken care of this case"); 617Debug.Assert(e.NewIndex > -1, "how can we move an item outside of the list?"); 623Debug.Assert(e.NewIndex != -1, "the item changed event does not cover changes to the entire list"); 678Debug.Assert(sender == CurrencyManager, "did we forget to unregister our events?"); 681Debug.Assert(_owner.CurrentCellAddress.X == -1); 736Debug.Assert(CurrencyManager?.List is not null); 766Debug.Assert(_owner.NewRowIndex != -1, "the NewRowIndex is -1 only when AllowUserToAddRows is false"); 783Debug.Assert(sender == DataSource); 784Debug.Assert(DataSource is ISupportInitializeNotification); 785Debug.Assert(_dataConnectionState[DATACONNECTIONSTATE_dataSourceInitializedHookedUp]); 798Debug.Assert(CurrencyManager is not null); 805Debug.Assert(CurrencyManager is not null); 826Debug.Assert(_owner.AllowUserToAddRowsInternal, "how did we start an add new row transaction if the dataGridView control has AllowUserToAddRows == false?"); 828Debug.Assert(CurrencyManager?.List is not null); 837Debug.Assert(_owner.NewRowIndex == CurrencyManager.List.Count - 1); 1141Debug.Assert(rowIndex >= 0); 1174Debug.Assert(rowIndex >= 0); 1207Debug.Assert(!_props[i].IsBrowsable || typeof(IList).IsAssignableFrom(_props[i].PropertyType), "if the DGV does not have any columns then the properties in the currency manager should be Browsable(false) or point to sub lists"); 1222Debug.Assert(dataGridViewColumn is not null); 1229Debug.Assert(rowIndex >= -1); 1394Debug.Assert(DataBoundRowsCount() == CurrencyManager.List!.Count, "if the back end was changed while in AddNew the DGV should have updated its rows collection"); 1541Debug.Assert(dataGridViewColumn.IsDataBound && dataGridViewColumn.BoundColumnIndex != -1, "we need a bound column index to perform the sort"); 1542Debug.Assert(List is IBindingList, "you should have checked by now that we are bound to an IBindingList");
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (769)
71Debug.Assert(NewRowIndex == -1); 299Debug.Assert(rowIndex > -1); 300Debug.Assert(rowIndex < Rows.Count); 333Debug.Assert(_noAutoSizeCount > 0); 342Debug.Assert(autoSizeColumnCriteriaFilter != DataGridViewAutoSizeColumnCriteriaInternal.None); 343Debug.Assert((autoSizeColumnCriteriaFilter & DataGridViewAutoSizeColumnCriteriaInternal.Fill) == 0); 369Debug.Assert(columnIndex >= -1 && columnIndex < Columns.Count); 370Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 371Debug.Assert(_autoSizeRowsMode is DataGridViewAutoSizeRowsMode.DisplayedHeaders 388Debug.Assert(columnIndex == -1); 389Debug.Assert((((DataGridViewAutoSizeRowsModeInternal)_autoSizeRowsMode) & DataGridViewAutoSizeRowsModeInternal.Header) != 0); 393Debug.Assert(RowHeadersWidth > 0); 394Debug.Assert(RowHeadersVisible); 409Debug.Assert(preferredThickness >= minimumHeight); 417Debug.Assert(_autoSizeRowsMode != DataGridViewAutoSizeRowsMode.None); 466Debug.Assert((((DataGridViewAutoSizeRowsModeInternal)_autoSizeRowsMode) & DataGridViewAutoSizeRowsModeInternal.Header) != 0); 470Debug.Assert(RowHeadersWidth > 0); 471Debug.Assert(RowHeadersVisible); 493Debug.Assert((((DataGridViewAutoSizeRowsModeInternal)_autoSizeRowsMode) & DataGridViewAutoSizeRowsModeInternal.DisplayedRows) != 0); 534Debug.Assert(dataGridViewColumn.Visible); 535Debug.Assert(!dataGridViewColumn.Frozen); 536Debug.Assert(dataGridViewColumn.MinimumWidth <= width); 537Debug.Assert(dataGridViewColumn.InheritedAutoSizeMode == DataGridViewAutoSizeColumnMode.Fill); 538Debug.Assert(!_layout._dirty); 544Debug.Assert(dataGridViewColumn.MinimumWidth == dataGridViewColumn.Width); 569Debug.Assert(!dataGridViewColumnTmp.Frozen); 695Debug.Assert(Math.Abs(weightSum - weightSumDbg) < 1.0F); 714Debug.Assert(!dataGridViewColumnTmp.Frozen); 758Debug.Assert(newWeightSum > 0); 862Debug.Assert(Math.Abs(weightSum - weightSumDbg) < 1.0F); 907Debug.Assert(!dataGridViewColumn.Frozen); 925Debug.Assert(_layout.Data.Width == _layout.Inside.Width - _layout.RowHeaders.Width - (SingleVerticalBorderAdded ? 1 : 0)); 991Debug.Assert(weightSum > 0); 1166Debug.Assert(oldDesiredWidth >= mostDeservingDataGridViewColumn.DesiredFillWidth); 1178Debug.Assert(widthLoss >= 0); 1197Debug.Assert(Math.Abs(weightSum - weightSumDbg) < 1.0F); 1256Debug.Assert(Math.Abs(dataGridViewColumnTmp.UsedFillWeight * _availableWidthForFillColumns - weightSum * dataGridViewColumnTmp.Width) / weightSum / dataGridViewColumnTmp.Width <= 1.25F / dataGridViewColumnTmp.Width); 1278Debug.Assert(widthSum == _availableWidthForFillColumns); 1319Debug.Assert((((DataGridViewAutoSizeRowsModeInternal)autoSizeRowsMode) & DataGridViewAutoSizeRowsModeInternal.DisplayedRows) != 0); 1479Debug.Assert(_selectedBandIndexes.Contains(rowIndex) == 1617Debug.Assert(clonedColumn.IsDataBound); 1634Debug.Assert(finalClonedColumns.Length == 0); 1635Debug.Assert(clonedColumnsCount == 0); 1648Debug.Assert(dataGridViewColumn.IsDataBound); 1656Debug.Assert(autoSizeColumnCriteriaFilter != DataGridViewAutoSizeColumnCriteriaInternal.None); 1657Debug.Assert((autoSizeColumnCriteriaFilter & DataGridViewAutoSizeColumnCriteriaInternal.Fill) == 0); 1792Debug.Assert(_noAutoSizeCount > 0); 1857Debug.Assert(_noAutoSizeCount > 0); 1864Debug.Assert(autoSizeColumnCriteriaInternal is DataGridViewAutoSizeColumnCriteriaInternal.Header 1869Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count); 1915Debug.Assert(_noAutoSizeCount > 0); 2107Debug.Assert(_noAutoSizeCount > 0); 2269Debug.Assert(_noAutoSizeCount > 0); 2276Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 2277Debug.Assert(((DataGridViewAutoSizeRowCriteriaInternal)autoSizeRowMode & InvalidDataGridViewAutoSizeRowCriteriaInternalMask) == 0); 2331Debug.Assert(_noAutoSizeCount > 0); 2443Debug.Assert(_lastRowSplitBar == -1); 2578Debug.Assert(_ptCurrentCell.X >= 0 && _ptCurrentCell.X < Columns.Count); 2579Debug.Assert(_ptCurrentCell.Y >= 0 && _ptCurrentCell.Y < Rows.Count); 2580Debug.Assert(!IsCurrentCellInEditMode); 2608Debug.Assert(!IsCurrentCellInEditMode); 2661Debug.Assert(((IDataGridViewEditingControl)EditingControl).EditingControlDataGridView == this); 2665Debug.Assert(EditingControl is null); 2667Debug.Assert(EditingControl is not null); 2677Debug.Assert(EditingControl is not null); 2691Debug.Assert(EditingControl is not null); 2692Debug.Assert(_editingPanel is not null); 2695Debug.Assert(dgvese.CellStyle is not null); 2762Debug.Assert(_lastColSplitBar == -1); 2785Debug.Assert(_lastRowSplitBar == -1); 2792Debug.Assert(inheritedCellStyle is not null); 2798Debug.Assert(cellStyle is not null); 2802Debug.Assert(columnHeadersStyle is not null); 2805Debug.Assert(dataGridViewStyle is not null); 2923Debug.Assert(dataGridViewStyle.Alignment != DataGridViewContentAlignment.NotSet); 2937Debug.Assert(dataGridViewStyle.WrapMode != DataGridViewTriState.NotSet); 3043Debug.Assert(_ptCurrentCell.Y != -1); 3076Debug.Assert(success); 3092Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]); 3094Debug.Assert(dataGridViewEditingCell is not null); 3127Debug.Assert(dataGridViewEditingCell is not null); 3135Debug.Assert((AllowUserToAddRowsInternal && Rows.Count == 1) || (!AllowUserToAddRowsInternal && Rows.Count == 0)); 3152Debug.Assert(success); 3180Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]); 3212Debug.Assert(Rows.GetFirstRow(DataGridViewElementStates.Visible) == 0); 3253Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]); 3318Debug.Assert(dataGridViewCurrentCell.OwningColumn is not null); 3445Debug.Assert(_noDimensionChangeCount >= 0); 3583Debug.Assert(_noDimensionChangeCount >= 0); 3610Debug.Assert(firstVisibleFrozenColumn is not null); 3616Debug.Assert(Columns.DisplayInOrder(firstVisibleFrozenColumn.Index, dataGridViewColumn.Index)); 3649Debug.Assert(hti._col != -1); 3700Debug.Assert(hti._col != -1); 3760Debug.Assert(_ptCurrentCell.X > -1); 3864Debug.Assert(((EditingControl is not null && ((IDataGridViewEditingControl)EditingControl).EditingControlValueChanged) 3875Debug.Assert(_ptCurrentCell.X > -1); 3908Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]); 3946Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]); 4022Debug.Assert(_ptCurrentCell.X > -1); 4145Debug.Assert(columnIndex < Columns.Count); 4168Debug.Assert(success); 4186Debug.Assert(dataGridViewRow is not null); 4246Debug.Assert(cx <= _horizontalOffset); 4335Debug.Assert(rowIndex < DisplayedBandsInfo.FirstDisplayedScrollingRow); 4391Debug.Assert(insideLeft.Height >= 0); 4413Debug.Assert(insideLeft.Width >= 0); 4432Debug.Assert(colHeaders.Width >= 0); 4474Debug.Assert(newLayout.Data.X >= 0); 4475Debug.Assert(newLayout.Data.Y >= 0); 4476Debug.Assert(newLayout.Data.Width >= 0); 4477Debug.Assert(newLayout.Data.Height >= 0); 4485Debug.Assert(!_layout._dirty); 4519Debug.Assert(oldNumTotallyVisibleFrozenRows == DisplayedBandsInfo.NumTotallyDisplayedFrozenRows); 4520Debug.Assert(oldNumVisibleScrollingRows == DisplayedBandsInfo.NumDisplayedScrollingRows); 4521Debug.Assert(oldNumTotallyVisibleScrollingRows == DisplayedBandsInfo.NumTotallyDisplayedScrollingRows); 4522Debug.Assert(oldFirstVisibleScrollingRow == DisplayedBandsInfo.FirstDisplayedScrollingRow); 4528Debug.Assert(newFirstVisibleScrollingCol == DisplayedBandsInfo.FirstDisplayedScrollingCol); 4533Debug.Assert(oldLastTotallyVisibleScrollingCol == DisplayedBandsInfo.LastTotallyDisplayedScrollingCol); 4534Debug.Assert(oldFirstVisibleScrollingCol == DisplayedBandsInfo.FirstDisplayedScrollingCol); 4545Debug.Assert(_vertScrollBar.Maximum > 0); 4560Debug.Assert(VerticalScrollingOffset == _vertScrollBar.Value); 4612Debug.Assert(cx <= Columns.GetColumnsWidth(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen)); 4655Debug.Assert(firstDisplayedScrollingCol >= 0); 4677Debug.Assert(FirstDisplayedScrollingColumnHiddenWidth == 0); 4697Debug.Assert(FirstDisplayedScrollingColumnHiddenWidth == 0); 4703Debug.Assert(dataGridViewColumn.Thickness > displayWidth - cx); 4710Debug.Assert(FirstDisplayedScrollingColumnHiddenWidth == GetNegOffsetFromHorizontalOffset(_horizontalOffset)); 4714Debug.Assert(numVisibleScrollingCols <= visibleScrollingColumnsTmp, "the number of displayed columns can only grow"); 4730Debug.Assert(jumpFromFirstVisibleScrollingCol >= -1); 4738Debug.Assert(firstDisplayedScrollingCol >= 0); 4761Debug.Assert((DisplayedBandsInfo.NumDisplayedScrollingCols > 0 && DisplayedBandsInfo.FirstDisplayedScrollingCol != -1) 4791Debug.Assert(cy < displayHeight); 4885Debug.Assert(lastDisplayedScrollingRow == -1); 4894Debug.Assert(firstDisplayedFrozenRow < nRows, "firstDisplayedFrozenRow larger than number of rows"); 4895Debug.Assert(lastDisplayedFrozenRow < nRows, "lastDisplayedFrozenRow larger than number of rows"); 4896Debug.Assert(lastDisplayedScrollingRow < nRows, "lastDisplayedScrollingRow larger than number of rows"); 4904Debug.Assert(DisplayedBandsInfo.NumTotallyDisplayedFrozenRows >= 0, "the number of visible frozen rows can't be negative"); 4905Debug.Assert(DisplayedBandsInfo.NumDisplayedScrollingRows >= 0, "the number of visible scrolling rows can't be negative"); 4906Debug.Assert(DisplayedBandsInfo.NumTotallyDisplayedScrollingRows >= 0, "the number of totally visible scrolling rows can't be negative"); 4907Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow < nRows, "firstDisplayedScrollingRow larger than number of rows"); 4937Debug.Assert(dataGridViewColumn.DataGridView is null); 4938Debug.Assert(dataGridViewColumn.Index >= 0); 4939Debug.Assert(dataGridViewColumn.DisplayIndex >= 0); 4956Debug.Assert(Columns.VerifyColumnDisplayIndexes()); 4971Debug.Assert(dataGridViewColumn.DataGridView == this); 4973Debug.Assert(dataGridViewColumn.DisplayIndex >= 0); 4990Debug.Assert(Columns.VerifyColumnDisplayIndexes()); 5005Debug.Assert(anticipatedColumnIndex >= 0 && anticipatedColumnIndex <= Columns.Count); 5014Debug.Assert(dataGridViewColumn.DisplayIndex >= 0 && dataGridViewColumn.DisplayIndex <= Columns.Count); 5134Debug.Assert(newDisplayIndex != dataGridViewColumn.DisplayIndex); 5135Debug.Assert(!_dataGridViewOper[OperationInDisplayIndexAdjustments]); 5197Debug.Assert(Columns[columnIndex].Index == columnIndex); 5204Debug.Assert(insertionCount > 0); 5215Debug.Assert(CurrentCellInternal is not null); 5222Debug.Assert(dataGridViewRow is not null); 5223Debug.Assert(anticipatedRowIndex >= 0 && anticipatedRowIndex <= Rows.Count); 5289Debug.Assert(dataGridViewRow is not null); 5350Debug.Assert(rowIndexDeleted >= 0); 5358Debug.Assert(dataGridViewRow.Index == rowIndex); 5375Debug.Assert(rowIndexInserted >= 0); 5376Debug.Assert(insertionCount > 0); 5384Debug.Assert(dataGridViewRow.Index == rowIndex); 5452Debug.Assert(Rows.Count > 1); 5453Debug.Assert(NewRowIndex != -1); 5463Debug.Assert(NewRowIndex == Rows.Count - 1); 5466Debug.Assert(dataGridViewRow.Index == -1); 5471Debug.Assert(NewRowIndex == -1); 5476Debug.Assert((Rows.GetRowState(NewRowIndex) & DataGridViewElementStates.Visible) != 0); 5477Debug.Assert(_ptCurrentCell.Y == NewRowIndex); 5547Debug.Assert(dataGridViewColumn.Visible && !dataGridViewColumn.Frozen); 5613Debug.Assert(NoSelectionChangeCount == 0); 5736Debug.Assert(_editingPanel is not null); 5737Debug.Assert(_ptCurrentCell.X != -1); 5949Debug.Assert(sender == EditingControl || sender == _editingPanel); 5950Debug.Assert(_ptCurrentCell.X != -1); 5959Debug.Assert(sender == EditingControl || sender == _editingPanel); 5960Debug.Assert(_ptCurrentCell.X != -1); 5969Debug.Assert(sender == EditingControl || sender == _editingPanel); 5975Debug.Assert(sender == EditingControl || sender == _editingPanel); 5981Debug.Assert(sender == EditingControl || sender == _editingPanel); 5987Debug.Assert(sender == EditingControl || sender == _editingPanel); 5990Debug.Assert(EditingControl is not null); 5991Debug.Assert(!_dataGridViewState1[State1_CustomCursorSet]); 6007Debug.Assert(sender == EditingControl || sender == _editingPanel); 6010Debug.Assert(EditingControl is not null); 6029Debug.Assert(sender == EditingControl || sender == _editingPanel); 6035Debug.Assert(sender == EditingControl || sender == _editingPanel); 6125Debug.Assert(proposed >= Columns[_trackColumn].MinimumThickness); 6126Debug.Assert(proposed <= DataGridViewBand.MaxBandThickness); 6237Debug.Assert(_editingPanel is null || _editingPanel.Controls.Count == 0); 6251Debug.Assert(success); 6264Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]); 6341Debug.Assert(_autoSizeRowsMode == DataGridViewAutoSizeRowsMode.None); 6393Debug.Assert(rowIndex >= 0); 6394Debug.Assert(rowIndex < Rows.Count); 6395Debug.Assert((Rows.GetRowState(rowIndex) & DataGridViewElementStates.Visible) != 0); 6396Debug.Assert((Rows.GetRowState(rowIndex) & DataGridViewElementStates.Frozen) == 0); 6432Debug.Assert(numDisplayedScrollingRows > 0); 6435Debug.Assert(rowIndexTmp != -1); 6448Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow != -1); 6476Debug.Assert(rowIndexTmp != -1); 6500Debug.Assert(firstDisplayedFrozenRowIndex != -1); 6636Debug.Assert(numDisplayedScrollingCols > 0); 6640Debug.Assert(dataGridViewColumnTmp is not null); 6653Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol != -1); 6681Debug.Assert(dataGridViewColumnTmp is not null); 6982Debug.Assert(rowIndex >= 0); 6983Debug.Assert(dataGridViewCell.OwningColumn is not null); 7105Debug.Assert(columnIndex >= -1 && columnIndex < Columns.Count); 7106Debug.Assert(rowIndex >= -1 && rowIndex < Rows.Count); 7110Debug.Assert(dataGridViewRow is not null); 7291Debug.Assert(rowIndex != -1); 7818Debug.Assert(firstVisibleColumn is not null); 7819Debug.Assert(lastVisibleColumn is not null); 7843Debug.Assert(firstVisibleRowIndex != -1); 7844Debug.Assert(lastVisibleRowIndex != -1); 7892Debug.Assert(lRowIndex != -1); 7893Debug.Assert(uRowIndex != -1); 7894Debug.Assert(lColumn is not null); 7895Debug.Assert(uColumn is not null); 7896Debug.Assert(lColumn.Index == uColumn.Index || Columns.DisplayInOrder(lColumn.Index, uColumn.Index)); 7897Debug.Assert(lRowIndex <= uRowIndex); 7922Debug.Assert(prevDataGridViewColumn is not null); 7985Debug.Assert(nextDataGridViewColumn is not null); 8014Debug.Assert(rowIndex != -1); 8020Debug.Assert(nextRowIndex != -1); 8037Debug.Assert(prevDataGridViewColumn is not null); 8107Debug.Assert(nextDataGridViewColumn is not null); 8186Debug.Assert(destinationBytes[97] == '<'); 8187Debug.Assert(destinationBytes[bytecountEndOfHtml - 1] == '>'); 8188Debug.Assert(destinationBytes[133] == '<'); 8189Debug.Assert(destinationBytes[bytecountEndOfFragment] == '<'); 8203Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count); 8325Debug.Assert(RightToLeftInternal || (x >= data.X - 1 && x < data.Right), "x must be inside the horizontal bounds of this.layout.Data"); 8326Debug.Assert(!RightToLeftInternal || (x >= data.X && x <= data.Right), "x must be inside the horizontal bounds of this.layout.Data"); 8385Debug.Assert(dataGridViewColumn.Visible && !dataGridViewColumn.Frozen); 8418Debug.Assert(xOffset > 0); 8453Debug.Assert(index < Columns.Count); 8454Debug.Assert(Columns[index].Visible); 8495Debug.Assert(dataGridViewColumn!.Visible && !dataGridViewColumn.Frozen); 8572Debug.Assert(!_vertScrollBar.Enabled 8605Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 8641Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 8652Debug.Assert(mouseY > rectScrollingArea.Bottom); 8697Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol >= 0); 8748Debug.Assert((!RightToLeftInternal && mouseX > rectScrollingArea.Right) || (RightToLeftInternal && mouseX < rectScrollingArea.Left)); 8822Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 8864Debug.Assert(mouseY >= rectScrollingArea.Top && mouseY <= rectScrollingArea.Bottom); 8965Debug.Assert(mouseX >= rectScrollingArea.Left && mouseX <= rectScrollingArea.Right); 9033Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 9111Debug.Assert(y >= data.Y - 1 && y < data.Bottom, "y must be inside the vertical bounds of the data area."); 9141Debug.Assert((Rows.GetRowState(indexTmp) & DataGridViewElementStates.Visible) != 0 9165Debug.Assert(yOffset > 0); 9198Debug.Assert(index >= 0 && index < Rows.Count); 9199Debug.Assert((Rows.GetRowState(index) & DataGridViewElementStates.Visible) != 0); 9235Debug.Assert(indexTmp != -1); 9240Debug.Assert((Rows.GetRowState(indexTmp) & DataGridViewElementStates.Visible) != 0 9257Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow != -1); 9347Debug.Assert(xColumnLeftEdge == GetColumnXFromIndex(hti._col)); 9421Debug.Assert(yRowTopEdge == GetRowYFromIndex(hti._row)); 9488Debug.Assert(xColumnLeftEdge == GetColumnXFromIndex(hti._col)); 9489Debug.Assert(yRowTopEdge == GetRowYFromIndex(hti._row)); 9609Debug.Assert(rowIndex >= 0); 9630Debug.Assert(_dataGridViewOper[OperationTrackColSelect] || _dataGridViewOper[OperationTrackCellSelect]); 9641Debug.Assert(_horizScrollTimer is not null); 9696Debug.Assert(_ptCurrentCell.X == dataGridViewCell.ColumnIndex); 9724Debug.Assert(EditingControl is not null); 9775Debug.Assert(dataGridViewCell.DataGridView == this); 9815Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count); 9859Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 9887Debug.Assert(lo <= hi); 9888Debug.Assert(lo < Rows.Count); 9889Debug.Assert(hi < Rows.Count); 9919Debug.Assert(lo <= hi); 9920Debug.Assert(lo > -1); 10178Debug.Assert(_layout.Data.Height >= 0); 10201Debug.Assert(_layout.RowHeaders.Height >= 0); 10222Debug.Assert(_layout.Data.Width >= 0); 10231Debug.Assert(_layout.ColumnHeaders.Width >= 0); 10268Debug.Assert(_layout.Data.Height >= 0); 10279Debug.Assert(_layout.Data.Width >= 0); 10288Debug.Assert(_layout.ColumnHeaders.Width >= 0); 10317Debug.Assert(_horizScrollBar.Maximum > 0); 10359Debug.Assert(_vertScrollBar.Maximum > 0); 10401Debug.Assert(success); 10450Debug.Assert(DataSource is not null, "this method should only be called when we have a data connection"); 10451Debug.Assert(dataGridViewColumn.DataPropertyName.Length != 0, "this method should be called only for columns which have DataPropertyName set"); 10533Debug.Assert(dataGridViewColumn.Index >= 0); 10534Debug.Assert(dataGridViewColumn.DataGridView == this); 10553Debug.Assert(autoSizeColumnMode != DataGridViewAutoSizeColumnMode.NotSet); 10586Debug.Assert(rowIndex >= 0); 10592Debug.Assert(rowIndex == Rows.Count - 1); 10602Debug.Assert(!dataGridViewCell.Selected); 10603Debug.Assert(dataGridViewRowDebug.Index != -1 || !dataGridViewCell.HasValue); 10613Debug.Assert(dataGridViewCell.OwningColumn is not null); 10624Debug.Assert(rowIndex >= 0); 10838Debug.Assert(dataGridViewRow.Cells.Count < newColumnCount); 10852Debug.Assert(weightSum <= ushort.MaxValue); 10855Debug.Assert(dataGridViewColumns is not null); 10917Debug.Assert(weightSum <= ushort.MaxValue); 10940Debug.Assert(dataGridViewColumn.CellType is not null); 10958Debug.Assert(dataGridViewColumn.CellType is not null); 11035Debug.Assert(dataGridViewRows is not null); 11075Debug.Assert(!AllowUserToAddRowsInternal); 11165Debug.Assert(autoSizeColumnMode != DataGridViewAutoSizeColumnMode.NotSet); 11248Debug.Assert(autoSizeColumnMode != DataGridViewAutoSizeColumnMode.NotSet); 11304Debug.Assert(autoSizeColumnMode != DataGridViewAutoSizeColumnMode.NotSet); 11735Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 11753Debug.Assert(_noDimensionChangeCount >= 0); 11759Debug.Assert(dataGridViewCell.RowIndex >= -1); 11760Debug.Assert(dataGridViewCell.ColumnIndex >= -1); 11775Debug.Assert(columnIndex >= 0); 11776Debug.Assert(rowIndex >= 0); 11823Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 11841Debug.Assert(_noDimensionChangeCount >= 0); 11906Debug.Assert(hti.Type is not DataGridViewHitTestType.None 11909Debug.Assert(_ptMouseDownCell.X == hti._col); 11910Debug.Assert(_ptMouseDownCell.Y == hti._row); 11958Debug.Assert(Columns[columnIndex].Resizable == DataGridViewTriState.True); 12065Debug.Assert(hti.Type == DataGridViewHitTestType.Cell); 12142Debug.Assert(MultiSelect || _individualSelectedCells.Count <= 1); 12191Debug.Assert(success); 12214Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1); 12270Debug.Assert(_selectedBandIndexes.Contains(hti._col)); 12280Debug.Assert(success); 12297Debug.Assert(_selectedBandIndexes.Count <= 1); 12370Debug.Assert(_selectedBandIndexes.Count <= 1); 12392Debug.Assert(success); 12417Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1); 12468Debug.Assert(_selectedBandIndexes.Contains(hti._row) == 12475Debug.Assert(_selectedBandIndexes.Contains(hti._row)); 12485Debug.Assert(success); 12503Debug.Assert(_selectedBandIndexes.Count <= 1); 12576Debug.Assert(_selectedBandIndexes.Count <= 1); 12687Debug.Assert(hti.Type is not DataGridViewHitTestType.None 12699Debug.Assert(!_dataGridViewState2[State2_MessageFromEditingCtrls]); 12764Debug.Assert(MultiSelect); 12798Debug.Assert(success); 12814Debug.Assert(dataGridViewCell.RowIndex >= 0); 12858Debug.Assert(dataGridViewCellStyle is not null); 13059Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 13081Debug.Assert(_noDimensionChangeCount >= 0); 13105Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 13131Debug.Assert(_noDimensionChangeCount >= 0); 13366Debug.Assert(newDisplayIndex != dataGridViewColumn.DisplayIndex); 13424Debug.Assert(_dataGridViewOper[OperationInDisplayIndexAdjustments]); 13426Debug.Assert(Columns.VerifyColumnDisplayIndexes()); 13434Debug.Assert(_dataGridViewOper[OperationInDisplayIndexAdjustments]); 13537Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count); 13616Debug.Assert(autoSizeColumnCriteriaInternal != DataGridViewAutoSizeColumnCriteriaInternal.None); 13617Debug.Assert(autoSizeColumnCriteriaInternal != DataGridViewAutoSizeColumnCriteriaInternal.Fill); 13650Debug.Assert(SortOrder != SortOrder.None); 13676Debug.Assert(hti.Type == DataGridViewHitTestType.ColumnHeader); 13776Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1); 13806Debug.Assert(_individualSelectedCells.Count == 0); 13850Debug.Assert(success); 13862Debug.Assert(success); 13873Debug.Assert(success); 13878Debug.Assert(CurrentCellAddress == new Point(-1, -1)); 13883Debug.Assert(_selectedBandIndexes.Contains(hti._col)); 14037Debug.Assert(dataGridViewColumn.Width == minimumWidth); 14117Debug.Assert(dataGridViewColumn.DataGridView is null); 14126Debug.Assert(hti._col >= 0); 14127Debug.Assert(MultiSelect); 14224Debug.Assert(success); 14337Debug.Assert(Columns.DisplayInOrder(dataGridViewColumn.Index, DisplayedBandsInfo.FirstDisplayedScrollingCol)); 14390Debug.Assert(autoSizeColumnMode != DataGridViewAutoSizeColumnMode.NotSet); 14586Debug.Assert(AllowUserToAddRowsInternal); 14751Debug.Assert(!ReadOnly); 14788Debug.Assert((Rows.GetRowState(rowIndex) & DataGridViewElementStates.Visible) != 0); 14792Debug.Assert(DataConnection is not null); 14793Debug.Assert(DataConnection.CurrencyManager is not null); 14794Debug.Assert(DataConnection.CurrencyManager.Position == _ptCurrentCell.Y); 14852Debug.Assert(!Columns[dataGridViewCell.ColumnIndex].ReadOnly); 14853Debug.Assert(!Rows[dataGridViewCell.RowIndex].ReadOnly); 14854Debug.Assert(!ReadOnly); 15274Debug.Assert(_ptCurrentCell.X == -1); 15283Debug.Assert(success); 15289Debug.Assert(rowIndex >= 0); 15290Debug.Assert(insertionCount > 0); 15304Debug.Assert(rowIndex >= 0); 15312Debug.Assert(_ptCurrentCell.X == -1); 15321Debug.Assert(success); 15327Debug.Assert(rowIndex >= 0); 15328Debug.Assert(dataGridViewRows is not null); 15329Debug.Assert(dataGridViewRows.Length > 0); 15343Debug.Assert(dataGridViewRows is not null); 15344Debug.Assert(dataGridViewRows.Length > 0); 15352Debug.Assert(_ptCurrentCell.X == -1); 15361Debug.Assert(success); 15472Debug.Assert(dataGridViewRow.Cells.Count < newColumnCount); 15545Debug.Assert(success); 15611Debug.Assert(dataGridViewRows is not null); 15920Debug.Assert(dgvcme is not null); 15931Debug.Assert(dgvcme is not null); 15988Debug.Assert(dgvcme is not null); 16011Debug.Assert(Columns[columnIndex].Resizable == DataGridViewTriState.True); 16031Debug.Assert(_columnHeadersHeightSizeMode == DataGridViewColumnHeadersHeightSizeMode.EnableResizing); 16038Debug.Assert(dgvcme is not null); 16061Debug.Assert(Rows[rowIndex].Resizable == DataGridViewTriState.True); 16081Debug.Assert(_rowHeadersWidthSizeMode == DataGridViewRowHeadersWidthSizeMode.EnableResizing); 16108Debug.Assert(_ptMouseDownCell.Y != -2); 16328Debug.Assert(_vertScrollTimer is null || !_vertScrollTimer.Enabled); 16329Debug.Assert(_horizScrollTimer is null || !_horizScrollTimer.Enabled); 16482Debug.Assert(_cumulativeVerticalWheelDelta > -PInvoke.WHEEL_DELTA); 16483Debug.Assert(_cumulativeVerticalWheelDelta < PInvoke.WHEEL_DELTA); 16484Debug.Assert(_cumulativeHorizontalWheelDelta > -PInvoke.WHEEL_DELTA); 16485Debug.Assert(_cumulativeHorizontalWheelDelta < PInvoke.WHEEL_DELTA); 16583Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 16592Debug.Assert(totalVisibleFrozenHeight == Rows.GetRowsHeight(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen)); 16593Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 16873Debug.Assert(dataGridViewColumn.Index >= 0); 16874Debug.Assert(dataGridViewColumn.DataGridView is null); 16899Debug.Assert(_ptCurrentCell.X == -1); 16908Debug.Assert(success); 16924Debug.Assert(autoSizeColumnMode != DataGridViewAutoSizeColumnMode.NotSet); 16950Debug.Assert(_ptCurrentCell.X == -1); 16959Debug.Assert(success); 17026Debug.Assert(dataGridViewColumn.Index >= 0 && dataGridViewColumn.Index < Columns.Count); 17077Debug.Assert(success); 17090Debug.Assert(success); 17106Debug.Assert(columnIndex == 0); 17149Debug.Assert(Columns[i].IsDataBound, "two columns w/ the same DataPropertyName should be DataBound at the same time"); 17150Debug.Assert(Columns[i].HeaderCell.SortGlyphDirection == dataGridViewColumn.HeaderCell.SortGlyphDirection, "DataBound columns should have the same SortGlyphDirection as the one on the DataGridView"); 17189Debug.Assert(_horizontalOffset >= dataGridViewColumn.Thickness); 17240Debug.Assert(rowIndexDeleted >= 0 && rowIndexDeleted < Rows.Count); 17263Debug.Assert(NewRowIndex != -1); 17264Debug.Assert(NewRowIndex == Rows.Count - 1); 17278Debug.Assert(rowIndexDeleted < _ptCurrentCell.Y); 17292Debug.Assert(success); 17305Debug.Assert(success); 17562Debug.Assert(rowIndex >= 0); 17655Debug.Assert(columnIndex >= 0 && rowIndex >= 0); 17697Debug.Assert(NewRowIndex == -1, "newRowIndex and AllowUserToAddRowsInternal became out of sync"); 17728Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 17749Debug.Assert(_noDimensionChangeCount >= 0); 17772Debug.Assert(rowIndex >= 0); 17928Debug.Assert(hti.Type == DataGridViewHitTestType.RowHeader); 18033Debug.Assert(success); 18058Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1); 18088Debug.Assert(_individualSelectedCells.Count == 0); 18118Debug.Assert(_selectedBandIndexes.Contains(hti._row) == 18134Debug.Assert(success); 18141Debug.Assert(success); 18152Debug.Assert(success); 18157Debug.Assert(CurrentCellAddress == new Point(-1, -1)); 18162Debug.Assert(_selectedBandIndexes.Contains(hti._row)); 18301Debug.Assert(rowIndex != -1); 18302Debug.Assert(_autoSizeRowsMode == DataGridViewAutoSizeRowsMode.None); 18322Debug.Assert(columnIndex >= 0 && rowIndex >= 0); 18335Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 18356Debug.Assert(_noDimensionChangeCount >= 0); 18402Debug.Assert(hti._row >= 0); 18403Debug.Assert(MultiSelect); 18496Debug.Assert(success); 18556Debug.Assert(rowIndex >= -1); 18758Debug.Assert(_noDimensionChangeCount >= 0); 18782Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 18803Debug.Assert(_noDimensionChangeCount >= 0); 18939Debug.Assert(dataGridViewColumnHeaderCell is not null); 18963Debug.Assert(Columns[i].IsDataBound, "two columns w/ the same DataPropertyName should be DataBound at the same time"); 18991Debug.Assert(success); 19098Debug.Assert(success); 19108Debug.Assert(success); 19138Debug.Assert(rowIndexTmp != -1); 19145Debug.Assert(rowIndexTmp != -1); 19146Debug.Assert((Rows.GetRowState(rowIndexTmp) & DataGridViewElementStates.Displayed) != 0); 19166Debug.Assert((Rows.GetRowState(rowIndexTmp) & DataGridViewElementStates.Visible) != 0); 19168Debug.Assert(numDisplayedScrollingRows > 0); 19171Debug.Assert(rowIndexTmp != -1); 19178Debug.Assert(rowIndexTmp != -1); 19179Debug.Assert((Rows.GetRowState(rowIndexTmp) & DataGridViewElementStates.Displayed) != 0); 19277Debug.Assert(bounds.Left == 0); 19278Debug.Assert(bounds.Top == 0); 19363Debug.Assert(cellBounds.Width > 0); 19432Debug.Assert(dataGridViewColumn.Visible && !dataGridViewColumn.Frozen); 19441Debug.Assert(cellBounds.Width > 0); 19480Debug.Assert(clipRegion is not null); 19541Debug.Assert(_dataGridViewOper[OperationTrackColHeadersResize] || _dataGridViewOper[OperationTrackRowResize]); 19546Debug.Assert(_dataGridViewOper[OperationTrackRowHeadersResize] 19621Debug.Assert((Rows.GetRowState(indexTmp) & DataGridViewElementStates.Frozen) == 0); 19622Debug.Assert((Rows.GetRowState(indexTmp) & DataGridViewElementStates.Visible) != 0); 19764Debug.Assert(_inPerformLayoutCount >= 0); 19793Debug.Assert(EditingControl is not null); 19803Debug.Assert(dataGridViewCell.ColumnIndex == _ptCurrentCell.X); 19804Debug.Assert(dataGridViewCell.RowIndex == _ptCurrentCell.Y || dataGridViewCell.RowIndex == -1); 19948Debug.Assert(rowIndex >= 0); 19973Debug.Assert(rowCount == dataGridViewRowsCount, "out of sync in AddNewTransaction when the user did not type in the 'add new row'"); 19981Debug.Assert(rowCount == dataGridViewRowsCount, "out of sync"); 20014Debug.Assert(dataGridViewRow.Index == -1); 20026Debug.Assert(dataGridViewRow.Index == -1); 20183Debug.Assert(success); 20209Debug.Assert(_ptAnchorCell.Y >= 0); 20261Debug.Assert(success); 20306Debug.Assert(success); 20376Debug.Assert(success); 20436Debug.Assert(success); 20465Debug.Assert(_ptAnchorCell.Y >= 0); 20503Debug.Assert(success); 20548Debug.Assert(success); 20617Debug.Assert(success); 20672Debug.Assert(success); 20694Debug.Assert(_ptAnchorCell.Y >= 0); 20764Debug.Assert(success); 20818Debug.Assert(success); 20916Debug.Assert(success); 20978Debug.Assert(success); 21018Debug.Assert(success); 21503Debug.Assert(_ptCurrentCell.Y != -1); 21504Debug.Assert(CurrentCellInternal is not null); 21505Debug.Assert(EditMode != DataGridViewEditMode.EditOnEnter 21514Debug.Assert(success); 21903Debug.Assert(success); 22114Debug.Assert(success); 22121Debug.Assert(success); 22142Debug.Assert(_ptAnchorCell.X >= 0); 22165Debug.Assert(success); 22175Debug.Assert(success); 22182Debug.Assert(success); 22204Debug.Assert(success); 22225Debug.Assert(success); 22232Debug.Assert(success); 22274Debug.Assert(success); 22284Debug.Assert(success); 22291Debug.Assert(success); 22313Debug.Assert(success); 22334Debug.Assert(success); 22341Debug.Assert(success); 22409Debug.Assert(success); 22419Debug.Assert(success); 22426Debug.Assert(success); 22457Debug.Assert(success); 22476Debug.Assert(success); 22483Debug.Assert(success); 22503Debug.Assert(success); 22538Debug.Assert(success); 22545Debug.Assert(success); 22556Debug.Assert(_ptAnchorCell.X >= 0); 22577Debug.Assert(success); 22599Debug.Assert(success); 22610Debug.Assert(success); 22622Debug.Assert(success); 22644Debug.Assert(success); 22658Debug.Assert(success); 22670Debug.Assert(success); 22687Debug.Assert(_ptAnchorCell.X >= 0); 22690Debug.Assert(success); 22707Debug.Assert(success); 22718Debug.Assert(success); 22725Debug.Assert(success); 22742Debug.Assert(success); 22756Debug.Assert(success); 22763Debug.Assert(success); 22779Debug.Assert(_ptAnchorCell.X >= 0); 22799Debug.Assert(success); 22825Debug.Assert(success); 22836Debug.Assert(success); 22843Debug.Assert(success); 22869Debug.Assert(success); 22881Debug.Assert(success); 22888Debug.Assert(success); 22903Debug.Assert(success); 22949Debug.Assert(firstDisplayedScrollingRowIndex != -1); 22969Debug.Assert(nextScreenVisibleRowIndexTmp != -1); 23007Debug.Assert(success); 23033Debug.Assert(_ptAnchorCell.Y >= 0); 23056Debug.Assert(success); 23073Debug.Assert(_ptAnchorCell.Y >= 0); 23109Debug.Assert(_ptAnchorCell.Y >= 0); 23215Debug.Assert(previousScreenVisibleRowIndexTmp != -1); 23243Debug.Assert(previousScreenVisibleRowIndex != -1); 23292Debug.Assert(_ptAnchorCell.Y >= 0); 23331Debug.Assert(_ptAnchorCell.Y >= 0); 23367Debug.Assert(_ptAnchorCell.Y >= 0); 23493Debug.Assert(success); 23500Debug.Assert(success); 23543Debug.Assert(success); 23553Debug.Assert(success); 23560Debug.Assert(success); 23582Debug.Assert(success); 23603Debug.Assert(success); 23610Debug.Assert(success); 23652Debug.Assert(success); 23662Debug.Assert(success); 23669Debug.Assert(success); 23691Debug.Assert(success); 23712Debug.Assert(success); 23719Debug.Assert(success); 23789Debug.Assert(success); 23799Debug.Assert(success); 23806Debug.Assert(success); 23837Debug.Assert(success); 23856Debug.Assert(success); 23863Debug.Assert(success); 23883Debug.Assert(success); 23918Debug.Assert(success); 23925Debug.Assert(success); 23941Debug.Assert(_ptAnchorCell.X >= 0); 23957Debug.Assert(success); 23964Debug.Assert(success); 23975Debug.Assert(success); 23982Debug.Assert(success); 23999Debug.Assert(success); 24013Debug.Assert(success); 24020Debug.Assert(success); 24042Debug.Assert(_ptAnchorCell.X >= 0); 24045Debug.Assert(success); 24052Debug.Assert(success); 24063Debug.Assert(success); 24070Debug.Assert(success); 24087Debug.Assert(success); 24101Debug.Assert(success); 24108Debug.Assert(success); 24124Debug.Assert(_ptAnchorCell.X >= 0); 24149Debug.Assert(success); 24165Debug.Assert(success); 24176Debug.Assert(success); 24183Debug.Assert(success); 24209Debug.Assert(success); 24221Debug.Assert(success); 24228Debug.Assert(success); 24243Debug.Assert(success); 24274Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1); 24292Debug.Assert(!_selectedBandIndexes.Contains(_ptCurrentCell.X)); 24301Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1); 24319Debug.Assert(!_selectedBandIndexes.Contains(_ptCurrentCell.Y)); 24584Debug.Assert(_ptAnchorCell.Y >= 0); 24681Debug.Assert(_ptAnchorCell.Y >= 0); 24783Debug.Assert(_ptAnchorCell.Y >= 0); 24966Debug.Assert(_ptAnchorCell.Y >= 0); 25281Debug.Assert(success); 25292Debug.Assert(dataGridViewCurrentCell is not null); 25305Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]); 25307Debug.Assert(dataGridViewEditingCell is not null); 25336Debug.Assert(NewRowIndex == Rows.Count - 1); 25345Debug.Assert(IsCurrentCellInEditMode); 25399Debug.Assert(dgvcme.Clicks == 1); 25475Debug.Assert(_ptCurrentCell.Y != -1); 25497Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]); 25501Debug.Assert(dataGridViewEditingCell is not null); 25556Debug.Assert(list.Count == rowsCount); 25673Debug.Assert(_noSelectionChangeCount > 0); 25700Debug.Assert(_noSelectionChangeCount > 0); 25722Debug.Assert(dataGridViewCell.ColumnIndex != columnIndexException || dataGridViewCell.RowIndex != rowIndexException); 25741Debug.Assert(_noSelectionChangeCount > 0); 25793Debug.Assert(_noSelectionChangeCount > 0); 25957Debug.Assert(rowIndex >= 0); 25958Debug.Assert(rowIndex < Rows.Count); 26003Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count); 26135Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol >= 0); 26152Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol >= 0); 26202Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count); 26203Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol >= -1 && DisplayedBandsInfo.FirstDisplayedScrollingCol < Columns.Count); 26204Debug.Assert(DisplayedBandsInfo.LastTotallyDisplayedScrollingCol >= -1 && DisplayedBandsInfo.LastTotallyDisplayedScrollingCol < Columns.Count); 26205Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 26206Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= -1 && DisplayedBandsInfo.FirstDisplayedScrollingRow < Rows.Count); 26207Debug.Assert(Columns[columnIndex].Visible); 26208Debug.Assert((Rows.GetRowState(rowIndex) & DataGridViewElementStates.Visible) != 0); 26265Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 26295Debug.Assert(firstDisplayedScrollingRow != -1); 26320Debug.Assert(rowCount != 0); 26321Debug.Assert(deltaY != 0); 26322Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= Rows.GetRowCount(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen)); 26344Debug.Assert(rowsRect.X > 0); 26351Debug.Assert(rowsRect.Height >= 0); 26355Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow > -1); 26380Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 26382Debug.Assert(firstVisibleScrollingRow != -1); 26384Debug.Assert(newScrolledOffRowCount >= rowCount); 26391Debug.Assert(rows != 0); 26392Debug.Assert((rows > 0 && (scrollEventType == ScrollEventType.SmallIncrement || scrollEventType == ScrollEventType.LargeIncrement)) 26396Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 26407Debug.Assert(newFirstVisibleScrollingRow != -1); 26425Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow == oldFirstVisibleScrollingRow); 26448Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow == newFirstVisibleScrollingRow); 26462Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 26488Debug.Assert(newFirstVisibleScrollingRow != -1); 26614Debug.Assert(_noDimensionChangeCount >= 0); 26615Debug.Assert(_noSelectionChangeCount >= 0); 26642Debug.Assert(index >= 0); 26716Debug.Assert(_columnHeadersHeight != columnHeadersHeight); 26717Debug.Assert(columnHeadersHeight >= MinimumColumnHeadersHeight); 26718Debug.Assert(columnHeadersHeight <= MaxHeadersThickness); 26784Debug.Assert(rowIndex >= 0 && columnIndex < Columns.Count && rowIndex < Rows.Count); 26852Debug.Assert(oldCurrentCellX == _ptCurrentCell.X); 26853Debug.Assert(oldCurrentCellY == _ptCurrentCell.Y); 26950Debug.Assert(oldCurrentCellY >= 0); 27058Debug.Assert(oldCurrentCellX == _ptCurrentCell.X); 27059Debug.Assert(oldCurrentCellY == _ptCurrentCell.Y); 27114Debug.Assert(oldCurrentCellY >= 0); 27146Debug.Assert(columnIndexFrom >= 0 && columnIndexTo >= 0); 27147Debug.Assert((Columns[columnIndexFrom]).DisplayIndex <= (Columns[columnIndexTo]).DisplayIndex); 27148Debug.Assert(rowIndexFrom >= 0 && rowIndexTo >= 0); 27149Debug.Assert(rowIndexFrom <= rowIndexTo); 27150Debug.Assert(_noSelectionChangeCount > 0); 27233Debug.Assert(_noSelectionChangeCount > 0); 27268Debug.Assert(columnIndexFrom >= 0 && columnIndexTo >= 0); 27269Debug.Assert((Columns[columnIndexFrom]).DisplayIndex <= (Columns[columnIndexTo]).DisplayIndex); 27270Debug.Assert(_noSelectionChangeCount > 0); 27284Debug.Assert(_selectedBandIndexes.Contains(columnIndex)); 27311Debug.Assert(_selectedBandIndexes.Contains(columnIndexTo)); 27319Debug.Assert(rowIndexFrom >= 0 && rowIndexTo >= 0); 27320Debug.Assert(rowIndexFrom <= rowIndexTo); 27321Debug.Assert(_noSelectionChangeCount > 0); 27340Debug.Assert(!_selectedBandIndexes.Contains(rowIndex)); 27349Debug.Assert(_selectedBandIndexes.Contains(rowIndex)); 27471Debug.Assert(columnIndex >= 0 && rowIndex >= 0 && columnIndex < Columns.Count && rowIndex < Rows.Count); 27544Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count); 27580Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 27641Debug.Assert(_individualSelectedCells.Contains(dataGridViewCell)); 27659Debug.Assert(_selectedBandIndexes.Contains(columnIndex)); 27695Debug.Assert(_selectedBandIndexes.Contains(rowIndex)); 27760Debug.Assert(_individualSelectedCells.Count <= 1); 27774Debug.Assert(_selectedBandIndexes.Count <= 1); 27812Debug.Assert(_selectedBandIndexes.Count <= 1); 27829Debug.Assert(_selectedBandIndexes.Count <= 1); 27854Debug.Assert(_selectedBandIndexes.Count <= 1); 27872Debug.Assert(_selectedBandIndexes.Contains(rowIndex) == 27881Debug.Assert(_selectedBandIndexes.Contains(rowIndex) == 27896Debug.Assert(_selectedBandIndexes.Count <= 1); 27913Debug.Assert(_selectedBandIndexes.Count <= 1); 27941Debug.Assert(success); 27962Debug.Assert(!_selectedBandIndexes.Contains(columnIndex)); 27968Debug.Assert(_selectedBandIndexes.Contains(columnIndex)); 27981Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1); 27993Debug.Assert(_selectedBandIndexes.Count <= 1); 28081Debug.Assert(!_selectedBandIndexes.Contains(rowIndex)); 28088Debug.Assert(_selectedBandIndexes.Contains(rowIndex)); 28101Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1); 28113Debug.Assert(_selectedBandIndexes.Count <= 1); 28219Debug.Assert(!(comparer is not null && DataSource is not null)); 28220Debug.Assert(direction is ListSortDirection.Ascending or ListSortDirection.Descending); 28245Debug.Assert(rowVFIndex != -1); 28247Debug.Assert(Rows.GetRowCount(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen) == 0); 28309Debug.Assert(rowVIndex != -1); 28313Debug.Assert(rowVIndex != -1); 28324Debug.Assert(_dataGridViewOper[OperationInSort]); 28345Debug.Assert(rowIndex1 != NewRowIndex); 28346Debug.Assert(rowIndex2 != NewRowIndex); 28431Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 28455Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 28683Debug.Assert(lastVisibleRowIndex != -1); 28820Debug.Assert(_editingPanel is not null); 28831Debug.Assert(EditingControl is not null); 28895Debug.Assert(dataGridViewColumnTmp is not null); 28899Debug.Assert(ColumnNeedsDisplayedState(dataGridViewColumnTmp)); 28912Debug.Assert(numDisplayedScrollingCols > 0); 28916Debug.Assert(dataGridViewColumnTmp is not null); 28920Debug.Assert(ColumnNeedsDisplayedState(dataGridViewColumnTmp)); 29056Debug.Assert(rowVisible); 29118Debug.Assert(rowIndexTmp != -1); 29134Debug.Assert(numDisplayedScrollingRows > 0); 29137Debug.Assert(rowIndexTmp != -1); 29217Debug.Assert(anchorColumnIndex >= 0); 29218Debug.Assert(anchorRowIndex >= 0); 29219Debug.Assert(newEdgeColumnIndex >= 0); 29220Debug.Assert(newEdgeRowIndex >= 0); 29221Debug.Assert(_noSelectionChangeCount > 0); 29403Debug.Assert(oldEdgeRowIndex < anchorRowIndex); 29448Debug.Assert(oldEdgeRowIndex <= anchorRowIndex); 29631Debug.Assert(oldEdgeRowIndex >= anchorRowIndex); 29779Debug.Assert(oldEdgeRowIndex >= anchorRowIndex); 29865Debug.Assert(_dataGridViewOper[OperationTrackRowSelect] || _dataGridViewOper[OperationTrackCellSelect]); 29918Debug.Assert(_editingPanel is not null); 29929Debug.Assert(EditingControl is not null); 29983Debug.Assert(hti._row == -1); 29987Debug.Assert(hti._col == -1); 29991Debug.Assert(hti._row == -1); 29992Debug.Assert(hti._col == -1);
System\Windows\Forms\Controls\DataGridView\DataGridView.TopRowAccessibleObject.cs (1)
123Debug.Assert(index >= 0);
System\Windows\Forms\Controls\DataGridView\DataGridViewBand.cs (22)
149Debug.Assert(!IsRow); 154Debug.Assert(value != Displayed); 192Debug.Assert(!IsRow); 253Debug.Assert(dataGridViewColumnHeaderCell is not null); 295Debug.Assert(value.OwningRow is null); 313Debug.Assert(dataGridViewColumnHeaderCell.SortGlyphDirection == SortOrder.None); 314Debug.Assert(value.OwningColumn is null); 318Debug.Assert(value.DataGridView is null); 394Debug.Assert(!IsRow); 423Debug.Assert(Index >= 0); 460Debug.Assert(value != ReadOnly); 470Debug.Assert(DataGridView is not null); 480Debug.Assert(!IsRow); 534Debug.Assert(!IsRow); 556Debug.Assert(Index >= 0); 575Debug.Assert(value != Selected); 666Debug.Assert(_thickness != value); 667Debug.Assert(value >= _minimumThickness); 668Debug.Assert(value <= MaxBandThickness); 680Debug.Assert(!IsRow); 779Debug.Assert(IsRow); 784Debug.Assert(rowIndex > -1);
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (14)
45Debug.Assert((value & ~(ButtonState.Normal | ButtonState.Pushed | ButtonState.Checked)) == 0); 76Debug.Assert(value is >= FlatStyle.Flat and <= FlatStyle.System); 201Debug.Assert(contentBoundsDebug.Equals(contentBounds)); 270Debug.Assert(errorIconBoundsDebug.Equals(errorIconBounds)); 502Debug.Assert(RowIndex >= 0); // Cell is not in a shared row. 516Debug.Assert(DataGridView.CellMouseDownInContentBounds); 652Debug.Assert(paint || computeContentBounds || computeErrorIconBounds); 653Debug.Assert(!paint || !computeContentBounds || !computeErrorIconBounds); 654Debug.Assert(!computeContentBounds || !computeErrorIconBounds || !paint); 655Debug.Assert(!computeErrorIconBounds || !paint || !computeContentBounds); 656Debug.Assert(cellStyle is not null); 795Debug.Assert(FlatStyle == FlatStyle.Popup, "FlatStyle.Popup is the last flat style"); 872Debug.Assert(valBounds.Height <= 0 || valBounds.Width <= 0); 925Debug.Assert(FlatStyle == FlatStyle.Popup, "FlatStyle.Popup is the last flat style");
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (72)
163Debug.Assert(DataGridView.Rows.GetRowState(RowIndex) == DataGridView.Rows.SharedRow(RowIndex).State); 182Debug.Assert(RowIndex >= -1); 228Debug.Assert(RowIndex >= -1); 265Debug.Assert(DataGridView.Rows.GetRowState(RowIndex) == DataGridView.Rows.SharedRow(RowIndex).State); 444Debug.Assert(DataGridView.Rows.GetRowState(RowIndex) == DataGridView.Rows.SharedRow(RowIndex).State); 459Debug.Assert(ColumnIndex >= 0); 514Debug.Assert(DataGridView.Rows.GetRowState(RowIndex) == DataGridView.Rows.SharedRow(RowIndex).State); 546Debug.Assert(DataGridView.Rows.GetRowState(RowIndex) == DataGridView.Rows.SharedRow(RowIndex).State); 561Debug.Assert(ColumnIndex >= 0); 576Debug.Assert(value != Selected); 693Debug.Assert(RowIndex >= -1); 698Debug.Assert(RowIndex >= -1); 751Debug.Assert(DataGridView.Rows.GetRowState(RowIndex) == DataGridView.Rows.SharedRow(RowIndex).State); 888Debug.Assert(DataGridView is not null); 889Debug.Assert(ColumnIndex >= 0); 958Debug.Assert(DataGridView is not null); 979Debug.Assert(rowIndex == -1); 980Debug.Assert(this is DataGridViewColumnHeaderCell, "if the row index == -1 and we have an owning column this should be a column header cell"); 992Debug.Assert(this is DataGridViewRowHeaderCell); 1003Debug.Assert(OwningColumn is null); 1004Debug.Assert(OwningRow is null); 1005Debug.Assert(rowIndex == -1); 1071Debug.Assert(dataGridView.EditingControl.ParentInternal == dataGridView.EditingPanel); 1072Debug.Assert(dataGridView.EditingPanel.Controls.Contains(dataGridView.EditingControl)); 1074Debug.Assert(dataGridView.EditingControl.ParentInternal is null); 1087Debug.Assert(dataGridView.EditingPanel.ParentInternal == dataGridView); 1088Debug.Assert(dataGridView.Controls.Contains(dataGridView.EditingPanel)); 1090Debug.Assert(dataGridView.EditingPanel.ParentInternal is null); 1093Debug.Assert(dataGridView.EditingControl.ParentInternal is null); 1094Debug.Assert(dataGridView.EditingPanel.ParentInternal is null); 1095Debug.Assert(dataGridView.EditingPanel.Controls.Count == 0); 1117Debug.Assert(DataGridView?.EditingControl is not null); 1372Debug.Assert(csv); 1431Debug.Assert(DataGridView is not null); 1486Debug.Assert(DataGridView is not null); 1719Debug.Assert(OwningRow is not null); 1735Debug.Assert(ColumnIndex < DataGridView.Columns.Count); 1778Debug.Assert(RowIndex == -1); 1800Debug.Assert(OwningColumn is not null); 1801Debug.Assert(OwningRow is not null); 1802Debug.Assert(ColumnIndex >= 0); 1865Debug.Assert(state == stateDebug || DataGridView.Rows.SharedRow(rowIndex).Index == -1); 1885Debug.Assert(ColumnIndex < DataGridView.Columns.Count); 1908Debug.Assert(cellStyle is not null); 1915Debug.Assert(rowStyle is not null); 1922Debug.Assert(columnStyle is not null); 1926Debug.Assert(dataGridViewStyle is not null); 2190Debug.Assert(dataGridViewStyle.Alignment != DataGridViewContentAlignment.NotSet); 2217Debug.Assert(dataGridViewStyle.WrapMode != DataGridViewTriState.NotSet); 2281Debug.Assert(width > 0); 2319Debug.Assert(maxWidth > 0); 2336Debug.Assert(height > 0); 2360Debug.Assert(OwningColumn is not null); 2361Debug.Assert(OwningRow is not null); 2423Debug.Assert(ColumnIndex < dataGridView.Columns.Count); 2452Debug.Assert(rowIndex >= 0); 2453Debug.Assert(ColumnIndex >= 0); 2477Debug.Assert(!dgv.EditingPanel.ContainsFocus); 2479Debug.Assert(dgv.EditingPanel.ParentInternal is null); 2482Debug.Assert(dgv.IsSharedCellVisible(this, rowIndex)); 2485Debug.Assert(dgv.EditingControl.ParentInternal == dgv.EditingPanel); 2486Debug.Assert(dgv.EditingPanel.ParentInternal == dgv); 2659Debug.Assert(textSize.Height <= maxHeight); 2701Debug.Assert(DataGridView is not null); 2714Debug.Assert(DataGridView.IsCurrentCellInEditMode); 2748Debug.Assert(this is DataGridViewHeaderCell); 2808Debug.Assert(!string.IsNullOrEmpty(errorText), "if we entered the cell error area then an error was painted, so we should have an error"); 2964Debug.Assert(false, "there are only three possible choices for the CurrentMouseLocation"); 2980Debug.Assert(CurrentMouseLocation != FlagAreaNotSet); 3640Debug.Assert(DataGridView is not null); 3936Debug.Assert(rowIndex >= 0); 3937Debug.Assert(ColumnIndex >= 0);
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.DataGridViewCellAccessibleObject.cs (9)
280Debug.Assert(dataGridView.CurrentCell == dataGridViewCell, "the result of selecting the cell should have made this cell the current cell"); 496Debug.Assert(_owner is not null); 497Debug.Assert(_owner.DataGridView is not null); 498Debug.Assert(_owner.OwningColumn is not null); 499Debug.Assert(_owner.OwningRow is not null); 533Debug.Assert(_owner is not null); 534Debug.Assert(_owner.DataGridView is not null); 535Debug.Assert(_owner.OwningColumn is not null); 536Debug.Assert(_owner.OwningRow is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewCellCollection.cs (6)
56Debug.Assert(dataGridViewRow is not null); 173Debug.Assert(!dataGridViewCell.Selected); 227Debug.Assert(!dataGridViewCell.Selected); 277Debug.Assert(!dataGridViewCell.ReadOnly); 278Debug.Assert(!dataGridViewCell.Selected); 286Debug.Assert(!dataGridViewCell.Selected);
System\Windows\Forms\Controls\DataGridView\DataGridViewCellLinkedList.cs (5)
65Debug.Assert(_headElement is not null); 72Debug.Assert(dataGridViewCell is not null); 73Debug.Assert(dataGridViewCell.DataGridView!.SelectionMode == DataGridViewSelectionMode.CellSelect || 98Debug.Assert(dataGridViewCell is not null); 119Debug.Assert(dataGridViewCell is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewCellLinkedListElement.cs (1)
15Debug.Assert(dataGridViewCell is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewCellLinkedListEnumerator.cs (3)
27Debug.Assert(_current is not null); // Since this is for internal use only. 36Debug.Assert(_current is null); 42Debug.Assert(_current is not null); // Since this is for internal use only.
System\Windows\Forms\Controls\DataGridView\DataGridViewCellPaintingEventArgs.cs (2)
50Debug.Assert(dataGridView is not null); 185Debug.Assert(graphics is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewCellStyle.cs (8)
97Debug.Assert(Enum.IsDefined(value)); 270Debug.Assert(value.All < -1); 290Debug.Assert(value.Left >= 0); 291Debug.Assert(value.Right >= 0); 292Debug.Assert(value.Top >= 0); 293Debug.Assert(value.Bottom >= 0); 359Debug.Assert(value is >= DataGridViewTriState.NotSet and <= DataGridViewTriState.False); 451Debug.Assert(dgvcs is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewCellValueEventArgs.cs (2)
31Debug.Assert(columnIndex >= -1); 32Debug.Assert(rowIndex >= -1);
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (19)
187Debug.Assert((value & ~(ButtonState.Normal | ButtonState.Pushed | ButtonState.Checked)) == 0); 251Debug.Assert(value is >= FlatStyle.Flat and <= FlatStyle.System); 431Debug.Assert(DataGridView is not null); 490Debug.Assert(checkBoxBoundsDebug.Equals(checkBoxBounds)); 626Debug.Assert(retCheckState == CheckState.Indeterminate); 766Debug.Assert(DataGridView is not null); 777Debug.Assert(DataGridView is not null); 855Debug.Assert(RowIndex >= 0); // Cell is not in a shared row. 869Debug.Assert(DataGridView.CellMouseDownInContentBounds); 1057Debug.Assert(paint || computeContentBounds || computeErrorIconBounds); 1058Debug.Assert(!paint || !computeContentBounds || !computeErrorIconBounds); 1059Debug.Assert(!computeContentBounds || !computeErrorIconBounds || !paint); 1060Debug.Assert(!computeErrorIconBounds || !paint || !computeContentBounds); 1061Debug.Assert(cellStyle is not null); 1079Debug.Assert(DataGridView is not null); 1390Debug.Assert(FlatStyle == FlatStyle.Popup); 1556Debug.Assert(valBounds.Width < checkBoxSize.Width || valBounds.Height < checkBoxSize.Height, "the bounds are empty"); 1574Debug.Assert(formattedValue is null || FormattedValueType is null || FormattedValueType.IsAssignableFrom(formattedValue.GetType())); 1707Debug.Assert(DataGridView is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewColumn.cs (11)
308Debug.Assert(value >= -1); 309Debug.Assert(value < int.MaxValue); 360Debug.Assert(value > 0); 435Debug.Assert(columnStyle is not null); 445Debug.Assert(dataGridViewStyle is not null); 534Debug.Assert(dataGridViewStyle.Alignment != DataGridViewContentAlignment.NotSet); 544Debug.Assert(dataGridViewStyle.WrapMode != DataGridViewTriState.NotSet); 781Debug.Assert(value > 0); 912Debug.Assert(dataGridView is null || Index > -1); 920Debug.Assert(autoSizeColumnCriteriaInternal is DataGridViewAutoSizeColumnCriteriaInternal.Header 928Debug.Assert(dataGridView.ColumnHeadersVisible || autoSizeColumnCriteriaInternal != DataGridViewAutoSizeColumnCriteriaInternal.Header);
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnCollection.ColumnOrderComparer.cs (2)
16Debug.Assert(x is not null); 17Debug.Assert(y is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnCollection.cs (36)
145Debug.Assert(DataGridView is not null); 169Debug.Assert(_itemsSorted is null || VerifyColumnOrderCache()); 178Debug.Assert(DataGridView is not null); 223Debug.Assert(smallestIndex >= 0); 261Debug.Assert(_itemsSorted is null || VerifyColumnOrderCache()); 309Debug.Assert(_itemsSorted is null || VerifyColumnOrderCache()); 475Debug.Assert((includeFilter & ~(DataGridViewElementStates.Displayed | DataGridViewElementStates.Frozen | DataGridViewElementStates.Resizable | 477Debug.Assert((includeFilter & DataGridViewElementStates.Resizable) == 0); 478Debug.Assert(DisplayInOrder(fromColumnIndex, toColumnIndex)); 479Debug.Assert(_items[toColumnIndex].StateIncludes(includeFilter)); 489Debug.Assert(dataGridViewColumn is not null); 501Debug.Assert(dataGridViewColumn is not null); 502Debug.Assert(_itemsSorted is not null); 503Debug.Assert(_lastAccessedSortedIndex == -1 || 507Debug.Assert(VerifyColumnOrderCache()); 532Debug.Assert((includeFilter & ~(DataGridViewElementStates.Displayed | DataGridViewElementStates.Frozen | DataGridViewElementStates.Resizable | 610Debug.Assert(VerifyColumnOrderCache()); 654Debug.Assert(VerifyColumnOrderCache()); 694Debug.Assert(VerifyColumnOrderCache()); 737Debug.Assert(VerifyColumnOrderCache()); 810Debug.Assert(VerifyColumnOrderCache()); 866Debug.Assert(DataGridView is not null); 905Debug.Assert(_itemsSorted is null || VerifyColumnOrderCache()); 911Debug.Assert(includeFilter is DataGridViewElementStates.Displayed 934Debug.Assert(includeFilter is DataGridViewElementStates.Displayed 958Debug.Assert(VerifyColumnDisplayIndexes()); 967Debug.Assert(DataGridView is not null); 973Debug.Assert(DataGridView is not null); 1003Debug.Assert(_itemsSorted is null || VerifyColumnOrderCache()); 1050Debug.Assert(_itemsSorted is null || VerifyColumnOrderCache()); 1058Debug.Assert(index >= 0 && index < Count); 1059Debug.Assert(DataGridView is not null); 1060Debug.Assert(!DataGridView.NoDimensionChangeAllowed); 1061Debug.Assert(!DataGridView.InDisplayIndexAdjustments); 1108Debug.Assert(columnWidthIncrement != 0); 1116Debug.Assert(columnWidthIncrement != 0);
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnEventArgs.cs (1)
12Debug.Assert(dataGridViewColumn.Index >= -1);
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (14)
90Debug.Assert(value is >= SortOrder.None and <= SortOrder.Descending); 136Debug.Assert(inFirstRow); 184Debug.Assert(csv); 260Debug.Assert(contentBoundsDebug.Equals(contentBounds)); 290Debug.Assert(cellStyle is not null); 294Debug.Assert(columnHeadersStyle is not null); 297Debug.Assert(dataGridViewStyle is not null); 429Debug.Assert(dataGridViewStyle.Alignment != DataGridViewContentAlignment.NotSet); 443Debug.Assert(dataGridViewStyle.WrapMode != DataGridViewTriState.NotSet); 755Debug.Assert(cellStyle is not null); 772Debug.Assert(DataGridView is not null); 805Debug.Assert(ButtonState == ButtonState.Pushed); 1093Debug.Assert(SortGlyphDirection == SortOrder.Descending); 1182Debug.Assert(DataGridView is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.DataGridViewColumnHeaderCellAccessibleObject.cs (2)
162Debug.Assert(Owner is not null); 184Debug.Assert(Owner is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (37)
163Debug.Assert(DisplayMember is not null && DisplayMember.Length > 0); 173Debug.Assert(ValueMember is not null && ValueMember.Length > 0); 261Debug.Assert(value is >= DataGridViewComboBoxDisplayStyle.ComboBox and <= DataGridViewComboBoxDisplayStyle.Nothing); 363Debug.Assert(value is >= FlatStyle.Flat and <= FlatStyle.System); 514Debug.Assert(DataGridView is not null); 520Debug.Assert(DataGridView is not null); 521Debug.Assert(EditingComboBox is not null); 581Debug.Assert(DataGridView is not null); 582Debug.Assert(EditingComboBox is not null); 617Debug.Assert(s_cachedDropDownWidth >= 1); 685Debug.Assert(sender == DataSource, "How can we get dispose notification from anything other than our DataSource?"); 691Debug.Assert(sender == DataSource); 692Debug.Assert(DataSource is ISupportInitializeNotification); 693Debug.Assert(_flags.HasFlag(DataGridViewComboBoxCellFlags.DataSourceInitializedHookedUp)); 784Debug.Assert(contentBoundsDebug.Equals(contentBounds)); 887Debug.Assert(errorIconBoundsDebug.Equals(errorIconBounds)); 1044Debug.Assert(item is not null); 1228Debug.Assert(EditingComboBox is not null); 1231Debug.Assert(rowIndex > -1); 1250Debug.Assert(DataGridView is not null && 1252Debug.Assert(!ReadOnly); 1412Debug.Assert(property is not null); 1413Debug.Assert(DataManager is not null); 1444Debug.Assert(!string.IsNullOrEmpty(field)); 1533Debug.Assert(value is not null); 1534Debug.Assert(ValueMemberProperty is not null || DisplayMemberProperty is not null || 1577Debug.Assert(DisplayMemberProperty is not null || ValueMemberProperty is not null || 1633Debug.Assert(TemplateComboBoxColumn.CellTemplate == this); 1665Debug.Assert(e.ColumnIndex == ColumnIndex); 1871Debug.Assert(paint || computeContentBounds || computeErrorIconBounds || computeDropDownButtonRect); 1872Debug.Assert(!paint || !computeContentBounds || !computeErrorIconBounds || !computeDropDownButtonRect); 1873Debug.Assert(!paint || !computeContentBounds || !computeDropDownButtonRect || !computeErrorIconBounds); 1874Debug.Assert(!computeContentBounds || !computeErrorIconBounds || !paint || !computeDropDownButtonRect); 1875Debug.Assert(!computeContentBounds || !computeErrorIconBounds || !computeDropDownButtonRect || !paint); 1876Debug.Assert(!computeErrorIconBounds || !paint || !computeContentBounds || !computeDropDownButtonRect); 1877Debug.Assert(!computeErrorIconBounds || !paint || !computeDropDownButtonRect || !computeContentBounds); 1878Debug.Assert(cellStyle is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.ObjectCollection.cs (1)
23Debug.Assert(owner is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewHeaderCell.cs (6)
335Debug.Assert(state == stateDebug); 491Debug.Assert(ButtonState == ButtonState.Pushed); 492Debug.Assert(ColumnIndex == DataGridView.MouseDownCellAddress.X); 493Debug.Assert(rowIndex == DataGridView.MouseDownCellAddress.Y); 563Debug.Assert(DataGridView is not null); 564Debug.Assert(Enum.IsDefined(newButtonState));
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (13)
115Debug.Assert(value is >= DataGridViewImageCellLayout.NotSet and <= DataGridViewImageCellLayout.Zoom); 164Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 279Debug.Assert(imgBoundsDebug.Equals(imgBounds)); 344Debug.Assert(errBoundsDebug.Equals(errBounds)); 576Debug.Assert(imageLayout != DataGridViewImageCellLayout.Stretch); 668Debug.Assert( 732Debug.Assert(paint || computeContentBounds || computeErrorIconBounds); 733Debug.Assert(!paint || !computeContentBounds || !computeErrorIconBounds); 734Debug.Assert(!computeContentBounds || !computeErrorIconBounds || !paint); 735Debug.Assert(!computeErrorIconBounds || !paint || !computeContentBounds); 736Debug.Assert(cellStyle is not null); 760Debug.Assert(valBounds.Height <= 0 || valBounds.Width <= 0); 805Debug.Assert(imageLayout != DataGridViewImageCellLayout.NotSet);
System\Windows\Forms\Controls\DataGridView\DataGridViewIntLinkedList.cs (4)
29Debug.Assert(source is not null); 71Debug.Assert(index >= 0); 75Debug.Assert(index == _lastAccessedIndex); 88Debug.Assert(_headElement is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewIntLinkedListEnumerator.cs (3)
27Debug.Assert(_current is not null); // Since this is for internal use only. 36Debug.Assert(_current is null); 42Debug.Assert(_current is not null); // Since this is for internal use only.
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (8)
143Debug.Assert(value is >= LinkBehavior.SystemDefault and <= LinkBehavior.NeverUnderline); 474Debug.Assert(linkBoundsDebug.Equals(linkBounds)); 888Debug.Assert(paint || computeContentBounds || computeErrorIconBounds); 889Debug.Assert(!paint || !computeContentBounds || !computeErrorIconBounds); 890Debug.Assert(!computeContentBounds || !computeErrorIconBounds || !paint); 891Debug.Assert(!computeErrorIconBounds || !paint || !computeContentBounds); 892Debug.Assert(cellStyle is not null); 964Debug.Assert(computeContentBounds);
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (27)
145Debug.Assert(Index >= -1); 600Debug.Assert(inheritedCellStyle is not null); 606Debug.Assert(cellStyle is not null); 610Debug.Assert(rowHeadersStyle is not null); 613Debug.Assert(dataGridViewStyle is not null); 742Debug.Assert(dataGridViewStyle.Alignment != DataGridViewContentAlignment.NotSet); 756Debug.Assert(dataGridViewStyle.WrapMode != DataGridViewTriState.NotSet); 794Debug.Assert(inheritedRowStyle is not null); 795Debug.Assert(rowIndex >= 0); 801Debug.Assert(rowStyle is not null); 805Debug.Assert(dataGridViewStyle is not null); 808Debug.Assert(rowsDefaultCellStyle is not null); 811Debug.Assert(alternatingRowsDefaultCellStyle is not null); 983Debug.Assert(dataGridViewStyle.Alignment != DataGridViewContentAlignment.NotSet); 1001Debug.Assert(dataGridViewStyle.WrapMode != DataGridViewTriState.NotSet); 1129Debug.Assert(Cells.Count == dataGridView.Columns.Count); 1169Debug.Assert(Index == -1); 1170Debug.Assert(!Selected); 1273Debug.Assert(rowIndex >= -1); 1397Debug.Assert(DataGridView is not null); 1405Debug.Assert(DataGridView is not null); 1527Debug.Assert(cellBounds.Width > 0); 1606Debug.Assert(dataGridViewColumn.Visible && !dataGridViewColumn.Frozen); 1617Debug.Assert(cellBounds.Width > 0); 1704Debug.Assert(cellBounds.Width > 0); 1752Debug.Assert(Index == -1); 1794Debug.Assert(values is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.DataGridViewRowAccessibleObject.cs (1)
275Debug.Assert(index >= 0);
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.DataGridViewSelectedRowCellsAccessibleObject.cs (1)
61Debug.Assert(false, "we should have found already the selected cell");
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.cs (107)
192Debug.Assert(DataGridView is not null); 205Debug.Assert(dataGridViewRow.Cells.Count == DataGridView.Columns.Count); 208Debug.Assert(values is null); 210Debug.Assert((dataGridViewRow.State & (DataGridViewElementStates.Selected | DataGridViewElementStates.Displayed)) == 0); 226Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 227Debug.Assert(DataGridView.NewRowIndex == Count - 1); 241Debug.Assert(dataGridViewCell.OwningRow == dataGridViewRow); 254Debug.Assert((rowState & (DataGridViewElementStates.Selected | DataGridViewElementStates.Displayed)) == 0); 264Debug.Assert(dataGridViewRow.State == SharedRowState(index)); 274Debug.Assert(DataGridView is not null); 321Debug.Assert(DataGridView is not null); 349Debug.Assert(rowTemplate.Cells.Count == DataGridView.Columns.Count); 351Debug.Assert((rowTemplateState & (DataGridViewElementStates.Selected | DataGridViewElementStates.Displayed)) == 0); 357Debug.Assert(dataGridViewCell.OwningRow == rowTemplate); 370Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 371Debug.Assert(DataGridView.NewRowIndex == Count - 1); 382Debug.Assert(DataGridView is not null); 408Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 409Debug.Assert(DataGridView.NewRowIndex == Count - 1); 416Debug.Assert(dataGridViewRow.Cells.Count == DataGridView.Columns.Count); 423Debug.Assert(dataGridViewCell.OwningRow == dataGridViewRow); 440Debug.Assert((dataGridViewRow.State & (DataGridViewElementStates.Selected | DataGridViewElementStates.Displayed)) == 0); 442Debug.Assert(_rowStates.Count == SharedList.Count); 453Debug.Assert(dataGridViewRow.State == SharedRowState(index)); 481Debug.Assert(DataGridView is not null); 485Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 486Debug.Assert(DataGridView.NewRowIndex == Count - 1); 487Debug.Assert(!newRow); 502Debug.Assert(DataGridView is not null); 550Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 551Debug.Assert(DataGridView.NewRowIndex == Count - 1); 671Debug.Assert(DataGridView is not null); 704Debug.Assert(dataGridViewRow.Index == -1); 716Debug.Assert(DataGridView is not null); 730Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 731Debug.Assert(DataGridView.NewRowIndex == Count - 1); 748Debug.Assert(dataGridViewRow.Cells.Count == DataGridView.Columns.Count); 753Debug.Assert(dataGridViewCell.OwningRow == dataGridViewRow); 766Debug.Assert((dataGridViewRow.State & (DataGridViewElementStates.Selected | DataGridViewElementStates.Displayed)) == 0); 774Debug.Assert(dataGridViewRow.State == SharedRowState(index)); 778Debug.Assert(_rowStates.Count == SharedList.Count); 855Debug.Assert(visibleRowIndex < GetRowCount(DataGridViewElementStates.Visible)); 874Debug.Assert(false, "we should have found the row already"); 886Debug.Assert(_cachedRowCountsAccessAllowed); 942Debug.Assert(_cachedRowCountsAccessAllowed); 986Debug.Assert(_cachedRowCountsAccessAllowed); 1024Debug.Assert(skipRows >= 0); 1147Debug.Assert(_cachedRowCountsAccessAllowed); 1220Debug.Assert(toRowIndex >= fromRowIndex); 1221Debug.Assert((GetRowState(toRowIndex) & includeFilter) == includeFilter); 1243Debug.Assert(_cachedRowHeightsAccessAllowed); 1290Debug.Assert(toRowIndex >= fromRowIndex); 1291Debug.Assert((GetRowState(toRowIndex) & includeFilter) == includeFilter); 1308Debug.Assert(toRowIndex >= fromRowIndex); 1309Debug.Assert(toRowIndex == _items.Count || (GetRowState(toRowIndex) & includeFilter) == includeFilter); 1341Debug.Assert(dataGridViewRow.Index == rowIndex); 1353Debug.Assert(DataGridView is not null); 1425Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 1430Debug.Assert(rowTemplate.Cells.Count == DataGridView.Columns.Count); 1432Debug.Assert((rowTemplateState & (DataGridViewElementStates.Selected | DataGridViewElementStates.Displayed)) == 0); 1438Debug.Assert(dataGridViewCell.OwningRow == rowTemplate); 1454Debug.Assert(DataGridView is not null); 1470Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 1494Debug.Assert(DataGridView is not null); 1495Debug.Assert(rowIndex >= 0 && rowIndex <= Count); 1496Debug.Assert(dataGridViewRow is not null); 1497Debug.Assert(dataGridViewRow.DataGridView is null); 1498Debug.Assert(!DataGridView.NoDimensionChangeAllowed); 1499Debug.Assert(DataGridView.NewRowIndex == -1 || rowIndex != Count); 1500Debug.Assert(!dataGridViewRow.Selected); 1518Debug.Assert(dataGridViewRow.Cells.Count == DataGridView.Columns.Count); 1525Debug.Assert(dataGridViewCell.OwningRow == dataGridViewRow); 1541Debug.Assert((dataGridViewRow.State & (DataGridViewElementStates.Selected | DataGridViewElementStates.Displayed)) == 0); 1543Debug.Assert(_rowStates.Count == SharedList.Count); 1554Debug.Assert(dataGridViewRow.State == SharedRowState(rowIndex)); 1582Debug.Assert(DataGridView is not null); 1602Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 1654Debug.Assert(_rowStates.Count == SharedList.Count); 1683Debug.Assert(_rowStates.Count == SharedList.Count); 1710Debug.Assert(DataGridView is not null); 1733Debug.Assert(dataGridViewRow.Index == -1); 1736Debug.Assert(_rowStates.Count == SharedList.Count); 1749Debug.Assert(DataGridView is not null); 1772Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 1794Debug.Assert(dataGridViewRow.Cells.Count == DataGridView.Columns.Count); 1799Debug.Assert(dataGridViewCell.OwningRow == dataGridViewRow); 1815Debug.Assert((dataGridViewRow.State & (DataGridViewElementStates.Selected | DataGridViewElementStates.Displayed)) == 0); 1817Debug.Assert(_rowStates.Count == SharedList.Count); 1825Debug.Assert(dataGridViewRow.State == SharedRowState(rowIndexInserted)); 1837Debug.Assert(includeFilter is DataGridViewElementStates.Displayed 1872Debug.Assert(includeFilter is DataGridViewElementStates.Displayed 1910Debug.Assert(e.Action != CollectionChangeAction.Remove); 1963Debug.Assert(DataGridView is not null); 2023Debug.Assert(rowCount == 1); 2093Debug.Assert(DataGridView is not null); 2170Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 2211Debug.Assert(index >= 0 && index < Count); 2212Debug.Assert(DataGridView is not null); 2213Debug.Assert(!DataGridView.NoDimensionChangeAllowed); 2223Debug.Assert(DataGridView is not null); 2242Debug.Assert(dataGridViewRow is not null); 2243Debug.Assert(dataGridViewRow.Index == -1); 2259Debug.Assert(index >= 0); 2260Debug.Assert(index < Count); 2284Debug.Assert(state is DataGridViewElementStates.Displayed 2451Debug.Assert(rowHeightIncrement != 0); 2464Debug.Assert(rowHeightIncrement != 0);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.RowComparer.cs (8)
27Debug.Assert(customComparer is not null); 43Debug.Assert(_dataGridView.AllowUserToAddRowsInternal); 53Debug.Assert(dataGridViewRow is not null); 54Debug.Assert(_sortedColumnIndex >= 0); 132Debug.Assert(value1 is DataGridViewRow); 133Debug.Assert(value2 is DataGridViewRow); 134Debug.Assert(value1 is not null); 135Debug.Assert(value2 is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.RowList.cs (3)
20Debug.Assert(rowComparer is not null); 21Debug.Assert(Count > 0); 62Debug.Assert(i >= left && j <= right, "(i>=left && j<=right) Sort failed - Is your IComparer bogus?");
System\Windows\Forms\Controls\DataGridView\DataGridViewRowErrorTextNeededEventArgs.cs (1)
10Debug.Assert(rowIndex >= -1);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (19)
106Debug.Assert((!DataGridView.RightToLeftInternal && firstCell) || (DataGridView.RightToLeftInternal && lastCell)); 156Debug.Assert(csv); 236Debug.Assert(contentBoundsDebug.Equals(contentBounds)); 307Debug.Assert(DataGridView is not null); 315Debug.Assert(cellStyle is not null); 319Debug.Assert(rowHeadersStyle is not null); 322Debug.Assert(dataGridViewStyle is not null); 454Debug.Assert(dataGridViewStyle.Alignment != DataGridViewContentAlignment.NotSet); 468Debug.Assert(dataGridViewStyle.WrapMode != DataGridViewTriState.NotSet); 521Debug.Assert(OwningRow is not null); 629Debug.Assert(paint || computeContentBounds || computeErrorIconBounds); 630Debug.Assert(!paint || !computeContentBounds || !computeErrorIconBounds); 631Debug.Assert(!computeContentBounds || !computeErrorIconBounds || !paint); 632Debug.Assert(!computeErrorIconBounds || !paint || !computeContentBounds); 633Debug.Assert(cellStyle is not null); 687Debug.Assert(ButtonState == ButtonState.Pushed); 840Debug.Assert(valBounds.Width >= 0); 841Debug.Assert(valBounds.Height >= 0); 1028Debug.Assert(DataGridView is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.DataGridViewRowHeaderCellAccessibleObject.cs (1)
182Debug.Assert(Owner.DataGridView.TopLeftHeaderCell.AccessibilityObject == Owner.DataGridView.AccessibilityObject.GetChild(0)!.GetChild(0));
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeightInfoNeededEventArgs.cs (4)
57Debug.Assert(rowIndex >= -1); 58Debug.Assert(height > 0); 59Debug.Assert(minimumHeight > 0); 60Debug.Assert(height >= minimumHeight);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeightInfoPushedEventArgs.cs (1)
12Debug.Assert(rowIndex >= -1);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowPostPaintEventArgs.cs (2)
38Debug.Assert(dataGridView is not null); 179Debug.Assert(graphics is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowPrePaintEventArgs.cs (2)
41Debug.Assert(dataGridView is not null); 196Debug.Assert(graphics is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewSelectedCellCollection.cs (3)
92Debug.Assert(!Contains(dataGridViewCell)); 101Debug.Assert(dataGridViewCells is not null); 104Debug.Assert(!Contains(dataGridViewCell));
System\Windows\Forms\Controls\DataGridView\DataGridViewSortCompareEventArgs.cs (2)
17Debug.Assert(dataGridViewColumn is not null); 18Debug.Assert(dataGridViewColumn.Index >= 0);
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (14)
139Debug.Assert(cellStyle.WrapMode != DataGridViewTriState.NotSet); 140Debug.Assert(DataGridView is not null); 310Debug.Assert(textBoundsDebug.Equals(textBounds)); 379Debug.Assert(errorBoundsDebug.Equals(errorBounds)); 507Debug.Assert(DataGridView is not null && 509Debug.Assert(!ReadOnly); 574Debug.Assert(e.ColumnIndex == ColumnIndex); 655Debug.Assert(paint || computeContentBounds || computeErrorIconBounds); 656Debug.Assert(!paint || !computeContentBounds || !computeErrorIconBounds); 657Debug.Assert(!computeContentBounds || !computeErrorIconBounds || !paint); 658Debug.Assert(!computeErrorIconBounds || !paint || !computeContentBounds); 659Debug.Assert(cellStyle is not null); 768Debug.Assert(cellEdited || formattedString is null); 769Debug.Assert(paint || computeContentBounds);
System\Windows\Forms\Controls\DataGridView\DataGridViewTopLeftHeaderCell.cs (9)
77Debug.Assert(contentBoundsDebug.Equals(contentBounds)); 128Debug.Assert(errorBoundsDebug.Equals(errorBounds)); 221Debug.Assert(paint || computeContentBounds || computeErrorIconBounds); 222Debug.Assert(!paint || !computeContentBounds || !computeErrorIconBounds); 223Debug.Assert(!computeContentBounds || !computeErrorIconBounds || !paint); 224Debug.Assert(!computeErrorIconBounds || !paint || !computeContentBounds); 225Debug.Assert(cellStyle is not null); 250Debug.Assert(ButtonState == ButtonState.Pushed); 339Debug.Assert(computeContentBounds);
System\Windows\Forms\Controls\DataGridView\DataGridViewTopLeftHeaderCell.DataGridViewTopLeftHeaderCellAccessibleObject.cs (1)
159Debug.Assert(Owner.DataGridView.RowHeadersVisible, "if the row headers are not visible how did you get the top left header cell acc object?");
System\Windows\Forms\Controls\DataGridView\DataGridViewUtilities.cs (1)
437Debug.Assert(cellStyle.Alignment == DataGridViewContentAlignment.NotSet, "this is the only alignment left");
System\Windows\Forms\Controls\DateTimePicker\DateTimePicker.cs (1)
225Debug.Assert(_calendarFontHandleWrapper is null, "font handle out of sync with Font");
System\Windows\Forms\Controls\GroupBox\GroupBoxRenderer.cs (1)
235Debug.Assert(textBounds.Y <= boxBounds.Y, "if text below box, need to render area of box above text");
System\Windows\Forms\Controls\ImageList\ImageList.cs (9)
352Debug.Assert(HandleCreated, "Calling AddIconToHandle when there is no handle"); 371Debug.Assert(HandleCreated, "Calling AddToHandle when there is no handle"); 401Debug.Assert(_nativeImageList is null, "Handle already created, this may be a source of temporary GDI leaks"); 436Debug.Assert(_originals is not null, "Handle not yet created, yet original images are gone"); 551Debug.Assert(Image.GetPixelFormatSize(sourceData.PixelFormat) == 32); 552Debug.Assert(Image.GetPixelFormatSize(sourceData.PixelFormat) == Image.GetPixelFormatSize(targetData.PixelFormat)); 553Debug.Assert(targetData.Width == sourceData.Width); 554Debug.Assert(targetData.Height == sourceData.Height); 555Debug.Assert(targetData.Stride == targetData.Width * 4);
System\Windows\Forms\Controls\ImageList\ImageList.ImageCollection.cs (5)
74Debug.Assert(_owner is not null, "ImageCollection has no owner (ImageList)"); 75Debug.Assert((_owner._originals is null) == (_owner.HandleCreated), " Either we should have the original images, or the handle should be created"); 83Debug.Assert(_owner is not null, "ImageCollection has no owner (ImageList)"); 229Debug.Assert((Count == _imageInfoCollection.Count), "The count of these two collections should be equal."); 247Debug.Assert((Count == _imageInfoCollection.Count), "The count of these two collections should be equal.");
System\Windows\Forms\Controls\ImageList\ImageList.NativeImageList.cs (1)
27Debug.Assert(hr.Succeeded);
System\Windows\Forms\Controls\ImageList\ImageList.Original.cs (1)
42Debug.Assert(customTransparentColor.Equals(Color.Transparent), "Specified a custom transparent color then told us to ignore it");
System\Windows\Forms\Controls\ImageList\ImageListStreamer.cs (2)
44Debug.Assert(written == length - HeaderMagic.Length, "RLE compression failure"); 64Debug.Assert(written == length, "RLE decompression failure");
System\Windows\Forms\Controls\Labels\Label.cs (1)
1400Debug.Assert(!AutoSize || (AutoSize && !SelfSizing) || Size == PreferredSize,
System\Windows\Forms\Controls\Labels\Label.LabelImageIndexer.cs (2)
18Debug.Assert(owner is not null, $"{nameof(owner)} should not be null."); 25set { Debug.Assert(false, "Setting the image list in this class is not supported"); }
System\Windows\Forms\Controls\Labels\LinkLabel.cs (10)
484Debug.Assert(text is not null, "string should not be null"); 511Debug.Assert(g is not null); 550Debug.Assert(regionIndex == (textRegions.Length - 1), "Failed to consume all link label visual regions"); 978Debug.Assert(Text.Length == 0); 1018Debug.Assert((_linkFont is null && _hoverLinkFont is null) 1235Debug.Assert(g is not null, "Must pass valid graphics"); 1236Debug.Assert(foreBrush is not null, "Must pass valid foreBrush"); 1237Debug.Assert(linkBrush is not null, "Must pass valid linkBrush"); 1325Debug.Assert(focusRectangle != RectangleF.Empty, "focusRectangle should be initialized"); 1728Debug.Assert(CanUseTextRenderer || base.UseCompatibleTextRendering, "Using GDI text rendering when CanUseTextRenderer reported false.");
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.CheckedItemCollection.cs (1)
153Debug.Assert(!isChecked || !isIndeterminate, "Can't be both checked and indeterminate. Somebody broke our state.");
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (8)
1533Debug.Assert(IsHandleCreated, "Shouldn't be calling Native methods before the handle is created."); 1557Debug.Assert(IsHandleCreated, "Shouldn't be calling Native methods before the handle is created."); 1577Debug.Assert(actualLength != PInvoke.LB_ERR, "Should have validated the index above"); 1588Debug.Assert(IsHandleCreated, "Shouldn't be calling Native methods before the handle is created."); 1614Debug.Assert(IsHandleCreated, "Shouldn't be calling Native methods before the handle is created."); 1634Debug.Assert(IsHandleCreated, "Should only call Native methods after the handle has been created"); 1635Debug.Assert(_selectionMode != SelectionMode.None, "Guard against setting selection for None selection mode outside this code."); 1654Debug.Assert(IsHandleCreated, "Should only call native methods if handle is created");
System\Windows\Forms\Controls\ListBoxes\ListBox.ItemAccessibleObject.cs (1)
47Debug.Assert(id.Length >= 3);
System\Windows\Forms\Controls\ListBoxes\ListBox.ObjectCollection.cs (2)
120Debug.Assert(index >= 0 && index <= Count, "Wrong index for insert"); 181Debug.Assert(items is not null);
System\Windows\Forms\Controls\ListControl\ListControl.cs (1)
260Debug.Assert(dataManager is not null);
System\Windows\Forms\Controls\ListView\ColumnHeader.ColumnHeaderImageListIndexer.cs (1)
25Debug.Assert(false, "We should never set the image list");
System\Windows\Forms\Controls\ListView\ListView.ColumnHeaderCollection.cs (1)
537Debug.Assert(columnCount >= 1, "Column mismatch");
System\Windows\Forms\Controls\ListView\ListView.cs (48)
853Debug.Assert(!_listViewState[LISTVIEWSTATE_flipViewToLargeIconAndSmallIcon] || View == View.SmallIcon, "we need this bit only in SmallIcon view"); 854Debug.Assert(!_listViewState[LISTVIEWSTATE_flipViewToLargeIconAndSmallIcon] || Application.ComCtlSupportsVisualStyles, "we need this bit only when loading ComCtl 6.0"); 861Debug.Assert(!value || View == View.SmallIcon, "we need this bit only in SmallIcon view"); 862Debug.Assert(!value || Application.ComCtlSupportsVisualStyles, "we need this bit only when loading ComCtl 6.0"); 1694Debug.Assert(result != 0, "LVM_SETTILEVIEWINFO failed"); 2416Debug.Assert(Columns[i].DisplayIndex > -1 && Columns[i].DisplayIndex < Columns.Count, "display indices out of whack"); 2420Debug.Assert(sumOfDisplayIndices == (colsCount - 1) * colsCount / 2, "display indices out of whack"); 2473Debug.Assert(_listItemSorter is not null, "null sorter!"); 2772Debug.Assert(item is not null, "Item was null in ITEMPREPAINT"); 3108Debug.Assert(fi.Exists, "who deleted our temp file?"); 3133Debug.Assert(fi.Exists, "who deleted our temp file?"); 3271Debug.Assert(false, "these are all the search directions"); 3410Debug.Assert(item._listView == this, "Can't GetDisplayIndex if the list item doesn't belong to us"); 3411Debug.Assert(item._id != -1, "ListViewItem has no ID yet"); 3434Debug.Assert(displayIndex != -1, "This item is in the list view -- why can't we find a display index for it?"); 3441Debug.Assert(_listViewItems is not null, "listItemsArray is null, but the handle isn't created"); 3572Debug.Assert(IsHandleCreated, "How did we add items without a handle?"); 3943Debug.Assert(_groups is not null && _groups.Count > 0, "this method should be used only when the user adds a group, not when we add our own DefaultGroup"); 3944Debug.Assert(group != DefaultGroup, "this method should be used only when the user adds a group, not when we add our own DefaultGroup"); 3981Debug.Assert(lvItem.iGroupId != -1, "there is a list view item which is not parented"); 3990Debug.Assert(IsHandleCreated, "InsertGroupNative precondition: list-view handle must be created"); 3991Debug.Assert(group == DefaultGroup || Groups.Contains(group), "Make sure ListView.Groups contains this group before adding the native LVGROUP. Otherwise, custom-drawing may break."); 3994Debug.Assert(result != -1, "Failed to insert group"); 4030Debug.Assert(itemList is not null, "In Begin/EndUpdate with no delayed array!"); 4057Debug.Assert(!_listItemsTable.ContainsKey(itemID), "internal hash table inconsistent -- inserting item, but it's already in the hash table"); 4066Debug.Assert(_listViewItems is not null, "listItemsArray is null, but the handle isn't created"); 4090Debug.Assert(!FlipViewToLargeIconAndSmallIcon, "if we added even 1 item then we should have been done w/ FlipViewToLargeIconAndSmallIcon"); 4105Debug.Assert(IsHandleCreated, "InsertItemsNative precondition: list-view handle must be created"); 4130Debug.Assert(Items.Contains(li), "Make sure ListView.Items contains this item before adding the native LVITEM. Otherwise, custom-drawing may break."); 4151Debug.Assert(result != IntPtr.Zero, "Groups not enabled"); 4741Debug.Assert(_listViewItems is null, "listItemsArray not null, even though handle created"); 5049Debug.Assert(retval != 0); 5155Debug.Assert(IsHandleCreated, "RemoveGroupNative precondition: list-view handle must be created"); 5252Debug.Assert((mask & ~(LVCOLUMNW_MASK.LVCF_FMT | LVCOLUMNW_MASK.LVCF_TEXT | LVCOLUMNW_MASK.LVCF_IMAGE)) == 0, "Unsupported mask in setColumnInfo"); 5413Debug.Assert(_savedCheckedItems.Contains(item), "somehow we lost track of one item"); 5485Debug.Assert(IsHandleCreated, "How did we add items without a handle?"); 5522Debug.Assert(IsHandleCreated, "SetItemText with no handle"); 5753Debug.Assert(IsHandleCreated, "UpdateGroupNative precondition: list-view handle must be created"); 5756Debug.Assert(result != -1); 5862Debug.Assert(retval != -1, "Error enabling group view"); 5869Debug.Assert(Application.ComCtlSupportsVisualStyles, "this function works only when ComCtl 6.0 and higher is loaded"); 5870Debug.Assert(_viewStyle == View.Tile, "this function should be called only in Tile view"); 5883Debug.Assert(retval != 0, "LVM_SETTILEVIEWINFO failed"); 6221Debug.Assert(_listViewState[LISTVIEWSTATE_headerControlTracking], "HDN_ENDTRACK and HDN_BEGINTRACK are out of sync."); 6368Debug.Assert(header->iItem == 0, "we only need to compensate for the first column resize"); 6369Debug.Assert(_columnHeaders!.Length > 0, "there should be a column that we need to compensate for"); 6483Debug.Assert(_labelEdit is null, 6542Debug.Assert(_labelEdit is not null, "There is no active label edit to end");
System\Windows\Forms\Controls\ListView\ListView.ListViewItemCollection.cs (1)
35Debug.Assert(innerList is not null, "Can't pass in null innerList");
System\Windows\Forms\Controls\ListView\ListView.ListViewNativeItemCollection.cs (14)
91Debug.Assert(_owner._listViewItems is not null, "listItemsArray is null, but the handle isn't created"); 105Debug.Assert(!_owner.FlipViewToLargeIconAndSmallIcon || Count == 0, "the FlipView... bit is turned off after adding 1 item."); 140Debug.Assert(!_owner.FlipViewToLargeIconAndSmallIcon || Count == 0, "the FlipView... bit is turned off after adding 1 item."); 192Debug.Assert(!_owner.VirtualMode, "in virtual mode, this method does not make any sense"); 259Debug.Assert(_owner._listViewItems is null, "listItemsArray not null, even though handle created"); 273Debug.Assert(!_owner.FlipViewToLargeIconAndSmallIcon, "we only set this when comctl 6.0 is loaded"); 289Debug.Assert(_owner._listViewItems is not null, "listItemsArray is null, but the handle isn't created"); 317Debug.Assert(_owner._listViewItems is not null, "listItemsArray is null, but the handle isn't created"); 342Debug.Assert(!_owner.FlipViewToLargeIconAndSmallIcon || Count == 0, "the FlipView... bit is turned off after adding 1 item."); 366Debug.Assert(!_owner.VirtualMode, "in virtual mode, this function does not make any sense"); 382Debug.Assert(!_owner.FlipViewToLargeIconAndSmallIcon || Count == 0, "the FlipView... bit is turned off after adding 1 item."); 405Debug.Assert(!_owner.FlipViewToLargeIconAndSmallIcon || Count == 0, "the FlipView... bit is turned off after adding 1 item."); 420Debug.Assert(_owner._listViewItems is null, "listItemsArray not null, even though handle created"); 428Debug.Assert(_owner._listViewItems is not null, "listItemsArray is null, but the handle isn't created");
System\Windows\Forms\Controls\ListView\ListView.SelectedIndexCollection.cs (3)
76Debug.Assert(_owner._savedSelectedItems is not null || count == 0, "if the count of selectedItems is greater than 0 then the selectedItems should have been saved by now"); 111Debug.Assert(fidx != -1, "Invalid index returned from LVM_GETNEXTITEM"); 118Debug.Assert(_owner._savedSelectedItems is not null, "Null selected items collection");
System\Windows\Forms\Controls\ListView\ListView.SelectedListViewItemCollection.cs (2)
135Debug.Assert(fidx != -1, "Invalid index returned from LVM_GETNEXTITEM"); 142Debug.Assert(_owner._savedSelectedItems is not null, "Null selected items collection");
System\Windows\Forms\Controls\ListView\ListViewGroup.ListViewGroupAccessibleObject.cs (1)
111Debug.Assert(id.Length >= 2);
System\Windows\Forms\Controls\ListView\ListViewGroupCollection.cs (1)
267Debug.Assert(_listView.IsHandleCreated, "MoveGroupItems pre-condition: listView handle must be created");
System\Windows\Forms\Controls\ListView\ListViewGroupConverter.cs (1)
96Debug.Assert(ctor is not null, "Expected the constructor to exist.");
System\Windows\Forms\Controls\ListView\ListViewInsertionMark.cs (1)
128Debug.Assert(_listView.IsHandleCreated, "ApplySavedState Precondition: List-view handle must be created");
System\Windows\Forms\Controls\ListView\ListViewItem.cs (9)
455Debug.Assert(_group == value, "BUG: group member variable wasn't updated!"); 997Debug.Assert(_listView is null || !_listView.VirtualMode, "ListViewItem::Host can't be used w/ a virtual item"); 998Debug.Assert(parent is null || !parent.VirtualMode, "ListViewItem::Host can't be used w/ a virtual list"); 1037Debug.Assert(_listView is not null, "This method is used only when items are parented in a list view"); 1038Debug.Assert(!_listView.VirtualMode, "we need to update the group only when the user specifies the list view items in localizable forms"); 1063Debug.Assert(_listView!.IsHandleCreated, "Should only invoke UpdateStateToListView when handle is created."); 1100Debug.Assert(!updateOwner || result != 0, "Groups not enabled"); 1297Debug.Assert(listView is not null && listView.VirtualMode, "ListViewItem::SetItemIndex should be used only when the list is virtual"); 1298Debug.Assert(index > -1, "can't set the index on a virtual list view item to -1");
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemBaseAccessibleObject.cs (1)
208Debug.Assert(id.Length >= 2);
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemImageAccessibleObject.cs (1)
46Debug.Assert(id.Length >= 4);
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItem.cs (3)
114Debug.Assert(style is not null, "Should have checked CustomStyle"); 123Debug.Assert(style is not null, "Should have checked CustomStyle"); 132Debug.Assert(style is not null, "Should have checked CustomStyle");
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObject.cs (1)
109Debug.Assert(id.Length >= 4);
System\Windows\Forms\Controls\ListView\ListViewItemConverter.cs (8)
56Debug.Assert(ctor is not null, "Expected the constructor to exist."); 64Debug.Assert(ctor is not null, "Expected the constructor to exist."); 92Debug.Assert(ctor is not null, "Expected the constructor to exist."); 112Debug.Assert(ctor is not null, "Expected the constructor to exist."); 128Debug.Assert(ctor is not null, "Expected the constructor to exist."); 142Debug.Assert(ctor is not null, "Expected the constructor to exist."); 152Debug.Assert(ctor is not null, "Expected the constructor to exist."); 165Debug.Assert(ctor is not null, "Expected the constructor to exist.");
System\Windows\Forms\Controls\ListView\ListViewSubItemConverter.cs (2)
43Debug.Assert(ctor is not null, "Expected the constructor to exist."); 56Debug.Assert(ctor is not null, "Expected the constructor to exist.");
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.CalendarAccessibleObject.cs (1)
42Debug.Assert(OsVersion.IsWindows8OrGreater());
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.CalendarBodyAccessibleObject.cs (1)
50Debug.Assert(OsVersion.IsWindows8OrGreater());
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.CalendarRowAccessibleObject.cs (1)
94Debug.Assert(OsVersion.IsWindows8OrGreater());
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (4)
869Debug.Assert(result != 0, "MCM_GETTODAY failed"); 1811Debug.Assert(_mcCurView == MONTH_CALDENDAR_MESSAGES_VIEW.MCMV_MONTH, "This logic should work only in the Month view."); 1875Debug.Assert(lower.Ticks <= upper.Ticks, "lower must be less than upper"); 2114Debug.Assert(_mcCurView == nmmcvm->dwOldView, "Calendar view mode is out of sync with native control");
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.MonthCalendarAccessibleObject.cs (1)
80Debug.Assert(OsVersion.IsWindows8OrGreater());
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (9)
1129Debug.Assert(_selectedTab is not null, "Invalid tab selection!"); 1464Debug.Assert(_tabs[i] is not null, "Null item in tab array!"); 1801Debug.Assert( 3547Debug.Assert(_tabs.Count > 0, "We don't have any tabs left!"); 3562Debug.Assert(_tabs.Count > 0, "Tab array destroyed!"); 3642Debug.Assert(oldObject is not null && newObject is not null && oldObject.GetType() == newObject.GetType()); 3700Debug.Assert(_tabs.Count > 0, "No view tab buttons to select!"); 3760Debug.Assert(_tabs[PropertiesTabIndex].Tab.GetType() == DefaultTabType, "First item is not property tab!"); 3796Debug.Assert(view < _viewSortButtons.Length, "Can't select view type > 1");
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\ArrayElementGridEntry.cs (2)
30Debug.Assert(owner is Array, "Owner is not array type!"); 36Debug.Assert(owner is Array, "Owner is not array type!");
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\DetailsButton.DetailsButtonAccessibleObject.cs (1)
22Debug.Assert(_ownerItem is not null, "AccessibleObject owner cannot be null");
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (7)
76Debug.Assert(OwnerGrid is not null, "GridEntry w/o PropertyGrid owner, text rendering will fail."); 181Debug.Assert(value is null || !Disposed, "Why are we putting new children in after we are disposed?"); 684Debug.Assert(value != this, "how can we be our own parent?"); 920Debug.Assert(!Disposed, "Why are we creating children after we are disposed?"); 1274Debug.Assert(ownerTab is not null, "No current tab!"); 1980Debug.Assert(gridHost is not null, "No prop entry host!"); 2215Debug.Assert(o is not null, "Collection contains a null element.");
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.GridEntryAccessibleObject.cs (2)
22Debug.Assert(owner is not null, "GridEntryAccessibleObject must have a valid owner GridEntry"); 97Debug.Assert(Parent is not null, "GridEntry AO does not have a parent AO");
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MergePropertyDescriptor.cs (5)
86Debug.Assert(component is Array, "MergePropertyDescriptor::CanResetValue called with non-array value"); 196Debug.Assert(component is Array, "MergePropertyDescriptor::GetValue called with non-array value"); 266Debug.Assert(component is Array, "MergePropertyDescriptor::ResetValue called with non-array value"); 307Debug.Assert(component is Array, "MergePropertyDescriptor::SetValue called with non-array value"); 325Debug.Assert(component is Array, "MergePropertyDescriptor::ShouldSerializeValue called with non-array value");
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MultiPropertyDescriptorGridEntry.cs (2)
308Debug.Assert(PropertyDescriptor is MergePropertyDescriptor, "Did not get a MergePropertyDescriptor!!!"); 309Debug.Assert(owner is object[], "Did not get an array of objects!!");
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyDescriptorGridEntry.PropertyDescriptorGridEntryAccessibleObject.cs (5)
27Debug.Assert(index >= 0); 163Debug.Assert(child is not null); 238Debug.Assert(child is not null); 243Debug.Assert(index <= lastChildIndex); 251Debug.Assert(child is not null);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (7)
878Debug.Assert(control is not null, "Null control passed to CommonEditorUse"); 3144Debug.Assert(_cumulativeVerticalWheelDelta > -PInvoke.WHEEL_DELTA, "cumulativeVerticalWheelDelta is too small"); 3145Debug.Assert(_cumulativeVerticalWheelDelta < PInvoke.WHEEL_DELTA, "cumulativeVerticalWheelDelta is too big"); 3187Debug.Assert(_scrollBar is not null); 3420Debug.Assert(gridEntry.Expandable, "non-expandable IPE firing outline click"); 3537Debug.Assert(parentIndex != -1, "parent GridEntry not found in allGridEntries"); 5343Debug.Assert(_editTextBox is not null);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (1)
335Debug.Assert(editor is not null, "How do we have a link without the InstanceCreationEditor?");
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.MouseHook.cs (2)
101Debug.Assert(!_mouseHookHandle.IsNull, "Failed to install mouse hook"); 168Debug.Assert(_thisProcessId != 0, "Didn't get our process id!");
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\SingleSelectRootGridEntry.cs (1)
35Debug.Assert(target is not null, "Can't browse a null object!");
System\Windows\Forms\Controls\PropertyGrid\PropertyGridToolStrip.PropertyGridToolStripAccessibleObject.cs (1)
75Debug.Assert(target is not null);
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (6)
274Debug.Assert(versionInfo is not null && !string.IsNullOrEmpty(versionInfo.ProductVersion), "Couldn't get the version info for the richedit dll"); 1650Debug.Assert(cb % 2 == 0, "EditStreamProc call out of cycle. Expected to always get character boundary calls"); 2852Debug.Assert(data is not null, "StreamIn passed a null stream"); 3035Debug.Assert(IsHandleCreated); 3191Debug.Assert((c.cpMax - c.cpMin) > 0, "CHARRANGE was null or negative - can't do it!"); 3207Debug.Assert(len != 0, "CHARRANGE from RichTextBox was bad! - impossible?");
System\Windows\Forms\Controls\RichTextBox\RichTextBox.OleCallback.cs (1)
51Debug.Assert(hr.Succeeded);
System\Windows\Forms\Controls\TabControl\TabPage.cs (1)
666Debug.Assert(_externalToolTip == toolTip, "RemoveToolTip should remove a toolTip that was set.");
System\Windows\Forms\Controls\TextBox\MaskedTextBox.cs (21)
146Debug.Assert(maskedTextProvider is not null, "Initializing from a null MaskProvider ref."); 1223Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 1499Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 1501Debug.Assert(startPosition >= 0 && ((startPosition + selectionLen) <= _maskedTextProvider.Length), "Invalid position range."); 1694Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 1772Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2058Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2158Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2159Debug.Assert(text is not null, "text is null."); 2277Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2381Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2492Debug.Assert(newProvider is not null, "Initializing from a null MaskProvider ref."); 2541Debug.Assert(srcPos != MaskedTextProvider.InvalidIndex, "InvalidIndex unexpected at this time."); 2696Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2715Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2753Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2759Debug.Assert(ImeMode == ImeMode.Disable, "IME enabled when in RO or Pwd mode."); 2802Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2859Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2995Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 3014Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided.");
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (1)
1863Debug.Assert(IsHandleCreated, "Don't call this method until the handle is created.");
System\Windows\Forms\Controls\TextBox\TextBoxBase.TextBoxBaseUiaTextProvider.cs (2)
437Debug.Assert(Owner.IsHandleCreated); 453Debug.Assert(Owner.IsHandleCreated);
System\Windows\Forms\Controls\ToolStrips\ToolStripComboBox.ToolStripComboBoxControl.ToolStripComboBoxFlatComboAdapter.cs (1)
24Debug.Assert(comboBox is ToolStripComboBoxControl, "Why are we here and not a toolstrip combo?");
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (3)
1740Debug.Assert(reason != ToolStripDropDownCloseReason.ItemClicked, 1884Debug.Assert(_countDropDownItemsAssignedTo > 0, "dropdown assignment underflow"); 2029Debug.Assert(start is not null, "Who is passing null to GetFirstDropDown?");
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.ToolStripDropDownAccessibleObject.cs (1)
55Debug.Assert(owner is not null);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownButton.cs (2)
141Debug.Assert(ParentInternal is not null, "Parent is null here, not going to get accurate ID"); 155Debug.Assert(ParentInternal is not null, "Parent is null here, not going to get accurate ID");
System\Windows\Forms\Controls\ToolStrips\ToolStripDropTargetManager.cs (1)
152Debug.Assert(false, "Why is lastDropTarget null?");
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (6)
2094Debug.Assert(Owner.Items.Contains(this), "How can there be a owner and not be in the collection?"); 2315Debug.Assert(false, "Invalid event type."); 2584Debug.Assert(deltaTicks >= 0, "why are delta ticks less than zero? that's some mighty fast clicking"); 3489Debug.Assert((toPointType == ToolStripPointType.ToolStripCoords), "why are we here! - investigate"); 3580Debug.Assert(i < count, "Item has a parent set but the parent doesn't own the item"); 3601Debug.Assert(ParentInternal is not null, "Tool Strip Item Parent is null");
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.ToolStripItemImageIndexer.cs (2)
14Debug.Assert(item is not null, $"{nameof(item)} should not be null."); 21set => Debug.Assert(false, "We should never set the image list");
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (3)
215Debug.Assert(toolStrip is not null, "passed in bogus toolstrip, why?"); 216Debug.Assert(start is not null, "passed in bogus start, why?"); 325Debug.Assert(start is not null, "why is null passed here?");
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.cs (1)
134Debug.Assert(!InMenuMode, "How did we get here if we're already in menu mode?");
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.HostedWindowsFormsMessageHook.cs (1)
77Debug.Assert(_messageHookHandle != IntPtr.Zero, "Failed to install mouse hook");
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (3)
874Debug.Assert(ParentInternal is not null, "Parent is null here, not going to get accurate ID"); 882Debug.Assert(ParentInternal is not null, "Parent is null here, not going to get accurate ID"); 897Debug.Assert(ParentInternal is not null, "Why is parent null");
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.ToolStripMenuItemInternalLayout.cs (1)
126Debug.Assert(image is not null);
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelCell.cs (1)
68Debug.Assert(_cachedBounds.X >= 0 && _cachedBounds.Y >= 0, "cached bounds are outside of the client area, investigate");
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.HorizontalRowManager.cs (2)
301Debug.Assert(cell is not null, "Don't expect cell to be null here, what's going on?"); 529Debug.Assert(ctg.ToolStripPanelRow == Row, "we should now be in the new panel row.");
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.VerticalRowManager.cs (1)
539Debug.Assert(ctg.ToolStripPanelRow == Row, "we should now be in the new panel row.");
System\Windows\Forms\Controls\ToolStrips\ToolStripSettingsManager.cs (1)
223Debug.Assert(!itemLocationHash.ContainsKey(item.Name), "WARNING: ToolStripItem name not unique.");
System\Windows\Forms\Controls\ToolStrips\ToolStripSettingsManager.SettingsStub.cs (1)
38Debug.Assert(!string.IsNullOrEmpty(ToolStripPanelName), "ToolStrip was parented to a panel, but we couldn't figure out its name.");
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitButton.cs (3)
427Debug.Assert(ParentInternal is not null, "Parent is null here, not going to get accurate ID"); 454Debug.Assert(ParentInternal is not null, "Parent is null here, not going to get accurate ID"); 477Debug.Assert(deltaTicks >= 0, "why are deltaticks less than zero? thats some mighty fast clicking");
System\Windows\Forms\Controls\ToolStrips\ToolStripSystemDarkModeRenderer.cs (1)
564Debug.Assert(e.Item is not null, "The ToolStripItem should not be null on rendering the Arrow.");
System\Windows\Forms\Controls\TrackBar\TrackBar.cs (5)
738Debug.Assert(_minimum <= _maximum, "Minimum should be <= Maximum"); 801Debug.Assert((bool)(BOOL)lresult); 863Debug.Assert(_autoDrawTicks == ShouldAutoDrawTicks()); 938Debug.Assert(_cumulativeWheelData > -PInvoke.WHEEL_DELTA, "cumulativeWheelData is too small"); 939Debug.Assert(_cumulativeWheelData < PInvoke.WHEEL_DELTA, "cumulativeWheelData is too big");
System\Windows\Forms\Controls\TreeView\ArraySubsetEnumerator.cs (2)
16Debug.Assert(count == 0 || array is not null, "if array is null, count should be 0"); 17Debug.Assert(array is null || count <= array.Length, "Trying to enumerate more than the array contains");
System\Windows\Forms\Controls\TreeView\TreeNode.cs (6)
1226Debug.Assert(min != -1, "Bad sorting"); 1260Debug.Assert(min != -1, "Bad sorting"); 1600Debug.Assert(num > 0, "required capacity can not be less than 1"); 2022Debug.Assert(tv.IsHandleCreated, "nonexistent handle"); 2098Debug.Assert(_parent is not null, "toggle on virtual root"); 2131Debug.Assert(tv is not null, "TreeNode has handle but no TreeView");
System\Windows\Forms\Controls\TreeView\TreeNode.TreeNodeImageIndexer.cs (2)
18Debug.Assert(node is not null, $"{nameof(node)} should not be null."); 43set { Debug.Assert(false, "We should never set the image list"); }
System\Windows\Forms\Controls\TreeView\TreeNodeCollection.cs (1)
333Debug.Assert(delta == 0, "delta should be 0");
System\Windows\Forms\Controls\TreeView\TreeView.cs (6)
1117Debug.Assert(_selectedNode is null || _selectedNode.TreeView != this, "handle is created, but we're still caching selectedNode"); 1319Debug.Assert(_topNode is null || _topNode.TreeView != this, "handle is created, but we're still caching selectedNode"); 1790Debug.Assert(_internalStateImageList is not null, "Why are changing images when the Imagelist is null?"); 2563Debug.Assert(_labelEdit is null, 2718Debug.Assert(nmtvcd->nmcd.dwItemSpec != 0, "Invalid node handle in ITEMPREPAINT"); 2813Debug.Assert(nmtvcd->nmcd.dwItemSpec != 0, "Invalid node handle in ITEMPOSTPAINT");
System\Windows\Forms\Controls\UpDown\DomainUpDown.cs (3)
377Debug.Assert(_domainItems is not null, "Domain values array is null"); 378Debug.Assert(index < _domainItems.Count && index >= -1, "SelectValue: index out of range"); 414Debug.Assert(_sorted, "Sorted == false");
System\Windows\Forms\Controls\UpDown\NumericUpDown.cs (8)
186Debug.Assert(_maximum == value, "Maximum != what we just set it to!"); 213Debug.Assert(_minimum.Equals(value), "Minimum != what we just set it to!"); 354Debug.Assert(_minimum <= _maximum, 525Debug.Assert(UserEdit, "ParseEditText() - UserEdit == false"); 702Debug.Assert(text == text.ToUpper(CultureInfo.InvariantCulture), "GetPreferredSize assumes hex digits to be uppercase."); 740Debug.Assert(_minimum <= _currentValue && _currentValue <= _maximum, 744Debug.Assert(!ChangingText, "ChangingText should have been set to false"); 855Debug.Assert(largestDigit != -1 && digitWidth != -1, "Failed to find largest digit.");
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (3)
649Debug.Assert(!UserEdit, "OnTextBoxTextChanged() - UserEdit == true"); 742Debug.Assert(_wheelDelta > -PInvoke.WHEEL_DELTA, "wheelDelta is too small"); 743Debug.Assert(_wheelDelta < PInvoke.WHEEL_DELTA, "wheelDelta is too big");
System\Windows\Forms\Controls\UpDown\UpDownBase.UpDownButtons.cs (3)
124Debug.Assert( 197Debug.Assert( 215Debug.Assert(
System\Windows\Forms\Controls\WebBrowser\HtmlDocument.cs (1)
38Debug.Assert(NativeHtmlDocument2 is not null, "The document should implement IHtmlDocument2");
System\Windows\Forms\Controls\WebBrowser\HtmlElement.cs (1)
52Debug.Assert(NativeHtmlElement is not null, "The element object should implement IHTMLElement");
System\Windows\Forms\Controls\WebBrowser\HtmlElementCollection.cs (1)
34Debug.Assert(NativeHtmlElementCollection is not null, "The element collection object should implement IHTMLElementCollection");
System\Windows\Forms\Controls\WebBrowser\HtmlElementEventArgs.cs (1)
16Debug.Assert(NativeHTMLEventObj is not null, "The event object should implement IHTMLEventObj");
System\Windows\Forms\Controls\WebBrowser\HtmlHistory.cs (1)
17Debug.Assert(NativeOmHistory is not null, "The history object should implement IOmHistory");
System\Windows\Forms\Controls\WebBrowser\HtmlShimManager.cs (2)
148Debug.Assert(addedShim is not null, "Why are we calling this with a null shim?"); 165Debug.Assert(unloadedWindow is not null, "Why are we calling this with a null window?");
System\Windows\Forms\Controls\WebBrowser\HtmlWindow.cs (1)
32Debug.Assert(NativeHtmlWindow is not null, "The window object should implement IHTMLWindow2");
System\Windows\Forms\Controls\WebBrowser\HtmlWindow.HtmlWindowShim.cs (1)
52Debug.Assert(result, "failed to add event");
System\Windows\Forms\Controls\WebBrowser\HtmlWindowCollection.cs (1)
26Debug.Assert(NativeHTMLFramesCollection2 is not null, "The window collection object should implement IHTMLFramesCollection2");
System\Windows\Forms\Controls\WebBrowser\WebBrowser.cs (3)
268Debug.Assert(psi is not null, "Object isn't an IPersistStreamInit!"); 356Debug.Assert(!htmlDocument2.IsNull, "The HtmlDocument object must implement IHTMLDocument2."); 381Debug.Assert(!htmlDocument2.IsNull, "The HtmlDocument object must implement IHTMLDocument2.");
System\Windows\Forms\Controls\WebBrowser\WebBrowser.WebBrowserEvent.cs (7)
47Debug.Assert(_parent is not null, "Parent should have been set"); 51Debug.Assert(urlObject is null or string, "invalid url type"); 52Debug.Assert(targetFrameName is null or string, "invalid targetFrameName type"); 53Debug.Assert(headers is null or string, "invalid headers type"); 76Debug.Assert(urlObject is null or string, "invalid url"); 84Debug.Assert(psi is not null, "The Document does not implement IPersistStreamInit"); 114Debug.Assert(urlObject is null or string, "invalid url type");
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (20)
600Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Loaded, "Failed transition"); 604Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Running, "Failed transition"); 608Debug.Assert(ActiveXState == WebBrowserHelper.AXState.InPlaceActive, "Failed transition"); 612Debug.Assert(ActiveXState == WebBrowserHelper.AXState.UIActive, "Failed transition"); 641Debug.Assert(ActiveXState == WebBrowserHelper.AXState.InPlaceActive, "Failed transition"); 645Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Running, "Failed transition"); 649Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Loaded, "Failed transition"); 653Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Passive, "Failed transition"); 835Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Passive, "Wrong start state to transition from"); 839Debug.Assert(_activeXInstance is null, "activeXInstance must be null"); 852Debug.Assert(_activeXInstance is not null, "w/o an exception being thrown we must have an object..."); 864Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Loaded, "Wrong start state to transition from"); 893Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Loaded, "Wrong start state to transition from"); 918Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Running, "Wrong start state to transition from"); 937Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Running, "Wrong start state to transition from"); 959Debug.Assert(ActiveXState == WebBrowserHelper.AXState.InPlaceActive, "Wrong start state to transition from"); 980Debug.Assert(ActiveXState == WebBrowserHelper.AXState.InPlaceActive, "Wrong start state to transition from"); 1000Debug.Assert(ActiveXState == WebBrowserHelper.AXState.UIActive, "Wrong start state to transition from"); 1004Debug.Assert(hr.Succeeded, "Failed to UIDeactivate"); 1016Debug.Assert(_activeXInstance is not null, "The native control is null");
System\Windows\Forms\Controls\WebBrowser\WebBrowserContainer.cs (6)
50Debug.Assert(_parent is not null); 196Debug.Assert(rval is null || _associatedContainer is null || rval == _associatedContainer, 227Debug.Assert(_parent.Site is null, "Parent is sited but we could not find IContainer!!!"); 374Debug.Assert(_siteUIActive is null, "Object did not call OnUIDeactivate"); 388Debug.Assert(_siteUIActive == site, "deactivating when not active..."); 410Debug.Assert(_controlInEditMode is null || _controlInEditMode == ctl, "who is exiting edit mode?");
System\Windows\Forms\Controls\WebBrowser\WebBrowserHelper.cs (1)
98Debug.Assert(selectionService is not null, "service must implement ISelectionService");
System\Windows\Forms\Controls\WebBrowser\WebBrowserSiteBase.cs (1)
139Debug.Assert(!Host.GetAXHostState(WebBrowserHelper.s_siteProcessedInputKey), "Re-entering IOleControlSite.TranslateAccelerator!!!");
System\Windows\Forms\DataBinding\Binding.BindToObject.cs (5)
26Debug.Assert(_owner.DataSource is not null, "how can we determine if DataSource is initialized or not if we have no data source?"); 54Debug.Assert(owner is not null); 61Debug.Assert(sender == _owner.DataSource, "data source should not change"); 62Debug.Assert(_owner.DataSource is ISupportInitializeNotification, "data source should not change on the BindToObject"); 63Debug.Assert(_waitingOnDataSource);
System\Windows\Forms\DataBinding\Binding.cs (3)
195Debug.Assert(sender == BindableComponent, "which other control can send us the Load event?"); 469Debug.Assert(sender == _bindingManagerBase, "we should only receive notification from our binding manager base"); 673Debug.Assert(type is not null);
System\Windows\Forms\DataBinding\BindingContext.cs (2)
292Debug.Assert(newBindingContext is not null, "Always called with a non-null BindingContext"); 293Debug.Assert(propBinding is not null, "Always called with a non-null Binding.");
System\Windows\Forms\DataBinding\BindingSource.cs (6)
560Debug.Assert(sender == _currencyManager, "only receive notifications from the currency manager"); 758Debug.Assert(index >= 0, "BindingSource.ListItem_PropertyChanged - no current item."); 759Debug.Assert(index == ((IList)this).IndexOf(sender), "BindingSource.ListItem_PropertyChanged - unexpected current item."); 1233Debug.Assert(_currentItemHookedForItemChange is null, "BindingSource trying to hook new current item before unhooking old current item!"); 1263Debug.Assert(cm is not null); 1274Debug.Assert(cm is not null);
System\Windows\Forms\DataBinding\Command.cs (3)
37Debug.Assert(s_cmds.Length > 0, "why is cmds.Length zero?"); 38Debug.Assert(s_icmdTry >= 0, "why is icmdTry negative?"); 103Debug.Assert(cmd._id is >= IdMin and < IdLim, "generated command id out of range");
System\Windows\Forms\DataBinding\ControlBindingsCollection.cs (1)
191Debug.Assert(!string.IsNullOrEmpty(binding.PropertyName), "The caller should check for this.");
System\Windows\Forms\DataBinding\CurrencyManager.cs (2)
622Debug.Assert(_lastGoodKnownRow == -1 || _lastGoodKnownRow == listposition, "if we have a valid lastGoodKnownRow, then it should equal the position in the list"); 819Debug.Assert(_lastGoodKnownRow == -1 || listposition == _lastGoodKnownRow, "how did they get out of sync?");
System\Windows\Forms\DataBinding\ListBindingConverter.cs (1)
154Debug.Assert(ctor is not null, "Failed to find Binding ctor for types!");
System\Windows\Forms\DataBinding\ListBindingHelper.cs (1)
448Debug.Assert(listAccessors is not null);
System\Windows\Forms\DataBinding\ListManagerBindingsCollection.cs (1)
22Debug.Assert(bindingManagerBase is not null, "How could a ListManagerBindingsCollection not have a BindingManagerBase associated with it!");
System\Windows\Forms\DataBinding\RelatedCurrencyManager.cs (1)
29Debug.Assert(parentManager is not null, "How could this be a null parentManager.");
System\Windows\Forms\DataBinding\RelatedPropertyManager.cs (1)
24Debug.Assert(parentManager is not null, "How could this be a null parentManager.");
System\Windows\Forms\Design\ComponentEditorForm.cs (2)
383Debug.Assert((newPage >= 0) && (newPage < _pageSites.Length), 470Debug.Assert(_activePage != -1);
System\Windows\Forms\Design\ComponentEditorForm.PageSelector.cs (3)
55Debug.Assert(_hbrushDither.IsNull, "Brush should not be recreated."); 70Debug.Assert( 78Debug.Assert(
System\Windows\Forms\Dialogs\CommonDialogs\FileDialog.cs (2)
632Debug.Assert(!extensions[j].StartsWith('.'), 634Debug.Assert(currentExtension.Length == 0 || currentExtension[0] == '.',
System\Windows\Forms\Dialogs\CommonDialogs\FileDialog.Vista.cs (1)
106Debug.Assert((UnexpectedOptions & _fileNameFlags) == 0, "Unexpected FileDialog options");
System\Windows\Forms\Dialogs\CommonDialogs\FontDialog.cs (1)
408Debug.Assert(cf.nSizeMin <= cf.nSizeMax, "min and max font sizes are the wrong way around");
System\Windows\Forms\Dialogs\CommonDialogs\OpenFileDialog.cs (1)
174Debug.Assert(hr.Succeeded);
System\Windows\Forms\Dialogs\CommonDialogs\SaveFileDialog.cs (1)
172Debug.Assert(hr.Succeeded);
System\Windows\Forms\Dialogs\CommonDialogs\SpecialFolderEnumConverter.cs (1)
40Debug.Assert(currentItem is not null);
System\Windows\Forms\Dialogs\TaskDialog\TaskDialog.cs (5)
654Debug.Assert(_handle == IntPtr.Zero); 918Debug.Assert(_boundPage is not null); 974Debug.Assert(!_raisedPageCreated); 1171Debug.Assert(linkHref is not null); 1521Debug.Assert(currentPtr == (long)ptrTaskDialogConfig + sizeToAllocate);
System\Windows\Forms\Dialogs\TaskDialog\TaskDialogProgressBar.cs (1)
343Debug.Assert(BoundPage is not null);
System\Windows\Forms\ErrorProvider\ErrorProvider.ControlItem.ControlItemAccessibleObject.cs (1)
132Debug.Assert(id.Length >= 3);
System\Windows\Forms\ErrorProvider\ErrorProvider.cs (4)
448Debug.Assert(sender == _errorManager, "who else can send us messages?"); 646Debug.Assert(dsInit is not null, "ErrorProvider: ISupportInitializeNotification.Initialized event received, but current DataSource does not support ISupportInitializeNotification!"); 647Debug.Assert(dsInit.IsInitialized, "ErrorProvider: DataSource sent ISupportInitializeNotification.Initialized event but before it had finished initializing."); 798Debug.Assert(_errorCount >= 0, "Error count should not be less than zero");
System\Windows\Forms\ErrorProvider\ErrorProvider.ErrorWindow.cs (2)
223Debug.Assert(_timer is not null); 249Debug.Assert(shownTooltips <= 1);
System\Windows\Forms\Form.cs (35)
181Debug.Assert(_formState[s_formStateAllowTransparency] == 0, "Failed to set formState[FormStateAllowTransparency]"); 182Debug.Assert(_formState[s_formStateBorderStyle] == (int)FormBorderStyle.Sizable, "Failed to set formState[FormStateBorderStyle]"); 183Debug.Assert(_formState[s_formStateTaskBar] == 1, "Failed to set formState[FormStateTaskBar]"); 184Debug.Assert(_formState[s_formStateControlBox] == 1, "Failed to set formState[FormStateControlBox]"); 185Debug.Assert(_formState[s_formStateKeyPreview] == 0, "Failed to set formState[FormStateKeyPreview]"); 186Debug.Assert(_formState[s_formStateLayered] == 0, "Failed to set formState[FormStateLayered]"); 187Debug.Assert(_formState[s_formStateMaximizeBox] == 1, "Failed to set formState[FormStateMaximizeBox]"); 188Debug.Assert(_formState[s_formStateMinimizeBox] == 1, "Failed to set formState[FormStateMinimizeBox]"); 189Debug.Assert(_formState[s_formStateHelpButton] == 0, "Failed to set formState[FormStateHelpButton]"); 190Debug.Assert(_formState[s_formStateStartPos] == (int)FormStartPosition.WindowsDefaultLocation, "Failed to set formState[FormStateStartPos]"); 191Debug.Assert(_formState[s_formStateWindowState] == (int)FormWindowState.Normal, "Failed to set formState[FormStateWindowState]"); 192Debug.Assert(_formState[s_formStateShowWindowOnCreate] == 0, "Failed to set formState[FormStateShowWindowOnCreate]"); 193Debug.Assert(_formState[s_formStateAutoScaling] == 1, "Failed to set formState[FormStateAutoScaling]"); 194Debug.Assert(_formState[s_formStateSetClientSize] == 0, "Failed to set formState[FormStateSetClientSize]"); 195Debug.Assert(_formState[s_formStateTopMost] == 0, "Failed to set formState[FormStateTopMost]"); 196Debug.Assert(_formState[s_formStateSWCalled] == 0, "Failed to set formState[FormStateSWCalled]"); 197Debug.Assert(_formState[s_formStateMdiChildMax] == 0, "Failed to set formState[FormStateMdiChildMax]"); 198Debug.Assert(_formState[s_formStateRenderSizeGrip] == 0, "Failed to set formState[FormStateRenderSizeGrip]"); 199Debug.Assert(_formState[s_formStateSizeGripStyle] == 0, "Failed to set formState[FormStateSizeGripStyle]"); 200Debug.Assert(_formState[s_formStateIsWindowActivated] == 0, "Failed to set formState[FormStateIsWindowActivated]"); 201Debug.Assert(_formState[s_formStateIsTextEmpty] == 0, "Failed to set formState[FormStateIsTextEmpty]"); 202Debug.Assert(_formState[s_formStateIsActive] == 0, "Failed to set formState[FormStateIsActive]"); 203Debug.Assert(_formState[s_formStateIconSet] == 0, "Failed to set formState[FormStateIconSet]"); 459Debug.Assert(!DesignMode, "Form designer should not allow base size set in design mode."); 508Debug.Assert(AutoSize == value, "Error detected setting Form.AutoSize."); 1105Debug.Assert(_ctlClient is null, "why isn't ctlClient null"); 1111Debug.Assert(_ctlClient is not null, "why is ctlClient null"); 3782Debug.Assert(IsHandleCreated, "Attempt to set focus to a form that has not yet created its handle."); 4925Debug.Assert(result); 4969Debug.Assert(result); 6078Debug.Assert(containerControl is not null); 6171Debug.Assert(IsMdiContainer, "Not an MDI container!"); 6331Debug.Assert(numWindowListItems == MdiWindowListStrip.MergedMenu.MdiWindowListItem.DropDownItems.Count, "Calling RevertMerge modified the mdiwindowlistitem"); 6924Debug.Assert(Properties.ContainsKey(s_propFormMdiParent), "how is formMdiParent null?"); 6925Debug.Assert(IsHandleCreated, "how is handle 0?");
System\Windows\Forms\Form.EnumThreadWindowsCallback.cs (1)
45Debug.Assert(oldValue == (nint)_formHandle.Value);
System\Windows\Forms\Input\Cursor.cs (1)
401Debug.Assert(stream is not null, "Stream should be validated before this method is called.");
System\Windows\Forms\Input\InputLanguageCollection.cs (2)
19Debug.Assert(value is not null); 20Debug.Assert(Array.IndexOf(value, null!) == -1, "Should not contain null");
System\Windows\Forms\Internal\ItemArray.cs (1)
71Debug.Assert(s_lastMask > mask, "We have overflowed our state mask.");
System\Windows\Forms\Internal\WinFormsUtils.cs (1)
320Debug.Assert(component is not null, "component passed here cannot be null");
System\Windows\Forms\Layout\ArrangedElement.cs (2)
74Debug.Assert((value.Right >= 0 && value.Left >= 0 && value.Top >= 0 && value.Bottom >= 0), "who's setting margin negative?"); 86Debug.Assert((value.Right >= 0 && value.Left >= 0 && value.Top >= 0 && value.Bottom >= 0), "who's setting padding negative?");
System\Windows\Forms\Layout\CommonProperties.cs (28)
167Debug.Assert(value != GetAutoSize(element), "PERF: Caller should guard against setting AutoSize to original value."); 178Debug.Assert(GetAutoSize(element) == value, "Error detected setting AutoSize."); 186Debug.Assert(value != GetMargin(element), "PERF: Caller should guard against setting Margin to original value."); 190Debug.Assert(GetMargin(element) == value, "Error detected setting Margin."); 200Debug.Assert(value != GetMaximumSize(element, new Size(-7109, -7107)), 214Debug.Assert(GetMaximumSize(element, new Size(-7109, -7107)) == value, "Error detected setting MaximumSize."); 222Debug.Assert(value != GetMinimumSize(element, new Size(-7109, -7107)), 236Debug.Assert(GetMinimumSize(element, new Size(-7109, -7107)) == value, "Error detected setting MinimumSize."); 250Debug.Assert(value != GetPadding(element, new Padding(-7105)), 256Debug.Assert(GetPadding(element, new Padding(-7105)) == value, "Error detected setting Padding."); 348Debug.Assert(xGetPreferredSizeCache(element) == Size.Empty, "Error detected in xClearPreferredSizeCache."); 390Debug.Assert( 394Debug.Assert(xGetPreferredSizeCache(element) == value, "Error detected in xGetPreferredSizeCache."); 423Debug.Assert( 441Debug.Assert( 458Debug.Assert(((xGetDock(element) != DockStyle.None) && element.ParticipatesInLayout) == result, 519Debug.Assert(value != GetSelfAutoSizeInDefaultLayout(element), "PERF: Caller should guard against setting AutoSize to original value."); 525Debug.Assert(GetSelfAutoSizeInDefaultLayout(element) == value, "Error detected setting AutoSize."); 541Debug.Assert(mode == DockAnchorMode.Anchor || value == DefaultAnchor, "xGetAnchor needs to return DefaultAnchor when docked."); 559Debug.Assert(result == (GetAutoSize(element) && xGetDock(element) == DockStyle.None), 578Debug.Assert(mode == DockAnchorMode.Dock || value == DefaultDock, 589Debug.Assert(value != xGetAnchor(element), "PERF: Caller should guard against setting Anchor to original value."); 599Debug.Assert(GetLayoutState(element)[s_dockModeSection] == (int)DockAnchorMode.Anchor, 608Debug.Assert(value != xGetDock(element), "PERF: Caller should guard against setting Dock to original value."); 618Debug.Assert(xGetDock(element) == value, "Error detected setting Dock."); 619Debug.Assert((GetLayoutState(element)[s_dockModeSection] == (int)DockAnchorMode.Dock) 652Debug.Assert(value != GetFlowBreak(element), "PERF: Caller should guard against setting FlowBreak to original value."); 660Debug.Assert(GetFlowBreak(element) == value, "Error detected setting SetFlowBreak.");
System\Windows\Forms\Layout\Containers\ContainerControl.cs (4)
467Debug.Assert(control is not null); 535Debug.Assert(value is null || (value.ParentInternal is not null && this == value.ParentInternal.GetContainerControl())); 1277Debug.Assert(count <= 999, "Infinite loop trying to find controls which can ProcessMnemonic()!!!"); 1661Debug.Assert(_activeControl is null || _activeControl.ParentInternal.GetContainerControl() == this);
System\Windows\Forms\Layout\Containers\SplitContainer.cs (1)
930Debug.Assert(Enabled, "SplitContainer.OnKeyDown should not be called if the button is disabled");
System\Windows\Forms\Layout\DefaultLayout.cs (19)
83Debug.Assert(CommonProperties.GetAutoSizeMode(element) == AutoSizeMode.GrowAndShrink || (newSize.Height >= oldBounds.Height && newSize.Width >= oldBounds.Width), 100Debug.Assert(CommonProperties.GetAutoSizeMode(element) == AutoSizeMode.GrowAndShrink || newBounds.Contains(oldBounds), "How did we resize in such a way we no longer contain our old bounds?"); 137Debug.Assert((growthDirection & GrowthDirection.Left) == GrowthDirection.None 140Debug.Assert((growthDirection & GrowthDirection.Upward) == GrowthDirection.None 368Debug.Assert(GetAnchorInfo(element) is not null, "AnchorInfo should be initialized before LayoutAnchorControls()."); 375Debug.Assert(!HasCachedBounds(container), "Do not call this method with an active cached bounds list."); 390Debug.Assert(element.Bounds == GetCachedBounds(element), "Why do we have cachedBounds for a docked element?"); 451Debug.Assert(mdiClient is null, "How did we end up with multiple MdiClients?"); 527Debug.Assert( 548Debug.Assert((measureOnly && (newSize.Width >= remainingSize.Width)) || (newSize.Width == remainingSize.Width), 565Debug.Assert((measureOnly && (newSize.Height >= remainingSize.Height)) || (newSize.Height == remainingSize.Height), 585Debug.Assert(desiredSize.Width >= 0 && desiredSize.Height >= 0, "Error detected in xGetDockSize: Element size was negative."); 711Debug.Assert(!HasCachedBounds(element.Container), "Do not call this method with an active cached bounds list."); 833Debug.Assert(AppContextSwitches.AnchorLayoutV2, $"AnchorLayoutV2 should be called only when {AppContextSwitches.AnchorLayoutV2SwitchName} is enabled."); 934Debug.Assert(!HasCachedBounds(element.Container), "Do not call this method with an active cached bounds list."); 969Debug.Assert(GetDock(element) == value, "Error setting Dock value."); 1051Debug.Assert(element.Container == container, "We have non-children in our containers cached bounds store."); 1092Debug.Assert(specified == BoundsSpecified.None || GetCachedBounds(element) == element.Bounds, 1104Debug.Assert(!HasCachedBounds(container), "Do not call this method with an active cached bounds list.");
System\Windows\Forms\Layout\FlowLayout.cs (17)
81Debug.Assert(wrapContents || breakIndex == container.Children.Count, 128Debug.Assert(dummy == endIndex, "EndIndex / BreakIndex mismatch."); 165Debug.Assert(startIndex < endIndex, "Loop should be in forward Z-order."); 289Debug.Assert(GetWrapContents(container) == value, "GetWrapContents should return the same value as we set"); 301Debug.Assert(GetFlowDirection(container) == value, "GetFlowDirection should return the same value as we set"); 322Debug.Assert(container.Children[0].Bounds.Y == margin.Top + container.DisplayRectangle.Y); 323Debug.Assert(container.Children[0].Bounds.X == margin.Left + container.DisplayRectangle.X); 326Debug.Assert(container.Children[0].Bounds.X == container.DisplayRectangle.X + container.DisplayRectangle.Width - container.Children[0].Bounds.Width - margin.Right); 327Debug.Assert(container.Children[0].Bounds.Y == margin.Top + container.DisplayRectangle.Y); 330Debug.Assert(container.Children[0].Bounds.Y == container.DisplayRectangle.Y + container.DisplayRectangle.Height - container.Children[0].Bounds.Height - margin.Bottom); 331Debug.Assert(container.Children[0].Bounds.X == margin.Left + container.DisplayRectangle.X); 343Debug.Assert(collection[i].Bounds.Y >= container.DisplayRectangle.Y); 344Debug.Assert(collection[i].Bounds.X >= container.DisplayRectangle.X); 347Debug.Assert(collection[i].Bounds.Y >= container.DisplayRectangle.Y); 348Debug.Assert(collection[i].Bounds.X + collection[i].Bounds.Width <= container.DisplayRectangle.X + container.DisplayRectangle.Width); 351Debug.Assert(collection[i].Bounds.Y + collection[i].Bounds.Height <= container.DisplayRectangle.Y + container.DisplayRectangle.Height); 352Debug.Assert(collection[i].Bounds.X >= container.DisplayRectangle.X);
System\Windows\Forms\Layout\FlowLayout.ElementProxy.cs (1)
63Debug.Assert(Element == value, "Element should be the same as we set it to");
System\Windows\Forms\Layout\LayoutTransaction.cs (2)
64Debug.Assert(_controlToLayout is null || _controlToLayout.LayoutSuspendCount == _layoutSuspendCount, "Suspend/Resume layout mismatch!"); 96Debug.Assert(elementCausingLayout is not null, "LayoutTransaction.DoLayout - elementCausingLayout is null, no layout performed - did you mix up your parameters?");
System\Windows\Forms\Layout\LayoutUtils.cs (22)
89Debug.Assert((topBits != 0 && (middleBits == 0 && bottomBits == 0)) 99Debug.Assert(result is >= 0x00 and <= 0x0A, "ContentAlignmentToIndex result out of range."); 100Debug.Assert(result != 0x00 || alignment == ContentAlignment.TopLeft, "Error detected in ContentAlignmentToIndex."); 101Debug.Assert(result != 0x01 || alignment == ContentAlignment.TopCenter, "Error detected in ContentAlignmentToIndex."); 102Debug.Assert(result != 0x02 || alignment == ContentAlignment.TopRight, "Error detected in ContentAlignmentToIndex."); 103Debug.Assert(result != 0x03, "Error detected in ContentAlignmentToIndex."); 104Debug.Assert(result != 0x04 || alignment == ContentAlignment.MiddleLeft, "Error detected in ContentAlignmentToIndex."); 105Debug.Assert(result != 0x05 || alignment == ContentAlignment.MiddleCenter, "Error detected in ContentAlignmentToIndex."); 106Debug.Assert(result != 0x06 || alignment == ContentAlignment.MiddleRight, "Error detected in ContentAlignmentToIndex."); 107Debug.Assert(result != 0x07, "Error detected in ContentAlignmentToIndex."); 108Debug.Assert(result != 0x08 || alignment == ContentAlignment.BottomLeft, "Error detected in ContentAlignmentToIndex."); 109Debug.Assert(result != 0x09 || alignment == ContentAlignment.BottomCenter, "Error detected in ContentAlignmentToIndex."); 110Debug.Assert(result != 0x0A || alignment == ContentAlignment.BottomRight, "Error detected in ContentAlignmentToIndex."); 118Debug.Assert(threeBitFlag is >= 0x00 and <= 0x04 and not 0x03, "threeBitFlag out of range."); 120Debug.Assert((result & 0x03) == result, "Result out of range."); 478Debug.Assert(align != ContentAlignment.MiddleCenter, "Result is ambiguous with an alignment of MiddleCenter."); 533Debug.Assert(Rectangle.Union(region1, region2) == bounds, 543Debug.Assert(region1.Right == region2.Left, "Adjacency error."); 548Debug.Assert(region2.Right == region1.Left, "Adjacency error."); 553Debug.Assert(region1.Bottom == region2.Top, "Adjacency error."); 558Debug.Assert(region2.Bottom == region1.Top, "Adjacency error."); 567Debug.Assert(Rectangle.Union(region1, region2) == bounds, "region1 and region2 do not add up to bounds.");
System\Windows\Forms\Layout\TableLayout.ContainerInfo.cs (6)
83Debug.Assert(_cols.Length != value.Length, "PERF: should not allocate strips, we've already got an array"); 97Debug.Assert(_rows.Length != value.Length, "PERF: should not allocate strips, we've already got an array"); 144Debug.Assert(ChildInfoValid, "Fetching invalid information"); 154Debug.Assert(ChildInfoValid, "Fetching invalid information"); 164Debug.Assert(ChildInfoValid, "Fetching invalid information"); 294Debug.Assert(ChildInfoValid, "Fetched invalid information");
System\Windows\Forms\Layout\TableLayout.cs (16)
320Debug.Assert(maxColumns > 0, "maxColumn must be positive"); 450Debug.Assert(numRows <= maxRows, "number of rows allocated shouldn't exceed max number of rows"); 451Debug.Assert(numColumns <= maxColumns, "number of columns allocated shouldn't exceed max number of columns"); 512Debug.Assert(fixedLayoutInfo.IsAbsolutelyPositioned, "should only check for those elements which are absolutely positioned"); 1036Debug.Assert((strip.MinSize == style.Size), "absolutely sized strip's size should be set before we call ApplyStyles"); 1169Debug.Assert((dontHonorConstraint || (usedSpace == SumStrips(strips, 0, strips.Length))), "Error computing usedSpace."); 1201Debug.Assert(currentRow <= layoutInfo.RowStart, "RowStart should increase in forward Z-order."); 1214Debug.Assert(currentCol <= layoutInfo.ColumnStart, "ColumnStart should increase in forward Z-order."); 1364Debug.Assert(GetLayoutInfo(element) == value, "GetLayoutInfo should return the same value as we set it to"); 1428Debug.Assert((containerInfo.Columns is null && cols is null) || containerInfo.Columns!.Length == cols.Length, 1430Debug.Assert((containerInfo.Rows is null && rows is null) || containerInfo.Rows!.Length == rows.Length, 1481Debug.Assert(!cellsOccupied1.IntersectsWith(cellsOccupied2), "controls overlap in the same cell"); 1486Debug.Assert(containerInfo.ColumnStyles.Count >= layoutInfo1.ColumnStart + layoutInfo1.ColumnSpan, "length of column style too short"); 1487Debug.Assert(containerInfo.ColumnStyles.Count >= layoutInfo1.ColumnStart + layoutInfo2.ColumnSpan, "length of column style too short"); 1503Debug.Assert(containerInfo.RowStyles.Count >= layoutInfo1.RowStart + layoutInfo1.RowSpan, "length of row style too short"); 1504Debug.Assert(containerInfo.RowStyles.Count >= layoutInfo2.RowStart + layoutInfo2.RowSpan, "length of row style too short");
System\Windows\Forms\Layout\TableLayout.ReservationGrid.cs (2)
33Debug.Assert(!IsReserved(column, rowOffset), "we should not be reserving already reserved space."); 50Debug.Assert(IsReserved(column, rowOffset), "IsReserved/Reserved mismatch.");
System\Windows\Forms\MDI\MDIClient.cs (1)
253Debug.Assert(result);
System\Windows\Forms\MDI\MDIControlStrip.cs (1)
97Debug.Assert(Items.Count <= 4, "Too many items in the MDIControlStrip. How did we get into this situation?");
System\Windows\Forms\MDI\MDIWindowDialog.cs (1)
35Debug.Assert(item is not null, "No item selected!");
System\Windows\Forms\NativeWindow.cs (7)
238Debug.Assert(!handle.IsNull, "Should never insert a zero handle into the hash"); 258Debug.Assert( 299Debug.Assert(!hwnd.IsNull); 304Debug.Assert(_priorWindowProcHandle is not null); 315Debug.Assert(_priorWindowProcHandle != _windowProcHandle, "Uh oh! Subclassed ourselves!!!"); 609Debug.Assert(DefaultWindowProc != IntPtr.Zero, "We have active windows but no user window proc?"); 704Debug.Assert(!hwnd.IsNull);
System\Windows\Forms\NativeWindow.WindowClass.cs (3)
44Debug.Assert(!hwnd.IsNull, "Windows called us with an HWND of 0"); 49Debug.Assert(_targetWindow is not null); 109Debug.Assert(string.Equals(
System\Windows\Forms\NotifyIcon.NotifyIconNativeWindow.cs (1)
65Debug.Assert(_reference is not null, "NotifyIcon was garbage collected while it was still visible. How did we let that happen?");
System\Windows\Forms\OLE\Clipboard.cs (1)
63Debug.Assert(dataObject is null);
System\Windows\Forms\OLE\DropTarget.cs (1)
108Debug.Assert(pDataObj is not null, "OleDragEnter didn't give us a valid data object.");
System\Windows\Forms\OLE\WrappingDataObject.cs (1)
16Debug.Assert(data is not DataObject);
System\Windows\Forms\OwnerDrawPropertyBag.cs (1)
53Debug.Assert(Font is not null);
System\Windows\Forms\Panels\FlowLayoutPanel.cs (2)
35Debug.Assert(FlowDirection == value, "FlowDirection should be the same as we set it"); 49Debug.Assert(WrapContents == value, "WrapContents should be the same as we set it");
System\Windows\Forms\Panels\FlowLayoutSettings.cs (2)
28Debug.Assert(FlowDirection == value, "FlowDirection should be the same as we set it"); 41Debug.Assert(WrapContents == value, "WrapContents should be the same as we set it");
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutPanel.cs (7)
69Debug.Assert(BorderStyle == value, "BorderStyle should be the same as we set it"); 91Debug.Assert(CellBorderStyle == value, "CellBorderStyle should be the same as we set it"); 117Debug.Assert(ColumnCount == value, "ColumnCount should be the same as we set it"); 190Debug.Assert(GetColumnSpan(control) == value, "GetColumnSpan should be the same as we set it"); 203Debug.Assert(GetRowSpan(control) == value, "GetRowSpan should be the same as we set it"); 218Debug.Assert(GetRow(control) == row, "GetRow should be the same as we set it"); 246Debug.Assert(GetColumn(control) == column, "GetColumn should be the same as we set it");
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutSettings.cs (7)
78Debug.Assert(CellBorderStyle == value, "CellBorderStyle should be the same as we set"); 107Debug.Assert(ColumnCount == value, "the max columns should equal to the value we set it to"); 133Debug.Assert(RowCount == value, "the max rows should equal to the value we set it to"); 268Debug.Assert(GetColumnSpan(element) == value, "column span should equal to the value we set"); 306Debug.Assert(GetRowSpan(element) == value, "row span should equal to the value we set"); 447Debug.Assert(!colSpecified || GetColumn(element) == column, "column position should equal to what we set"); 448Debug.Assert(!rowSpecified || GetRow(element) == row, "row position should equal to what we set");
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutStyle.cs (1)
74Debug.Assert(size >= 0);
System\Windows\Forms\Printing\PrintDialog.cs (2)
260Debug.Assert(dialogSettings->hDevMode.IsNull && dialogSettings->hDevNames.IsNull); 374Debug.Assert(dialogSettings.hDevMode.IsNull && dialogSettings.hDevNames.IsNull);
System\Windows\Forms\Printing\PrintPreviewControl.cs (2)
469Debug.Assert(_pageInfo is not null, "Must call ComputePreview first"); 520Debug.Assert(_pageInfo is not null, $"{nameof(PreviewPrintController)} did not give us preview info.");
System\Windows\Forms\PropertyStore.cs (1)
220Debug.Assert(sizeof(T) > 8);
System\Windows\Forms\Rendering\ControlPaint.cs (4)
269Debug.Assert(data.Scan0 != 0, "BitmapData.Scan0 is null; check marshalling"); 1095Debug.Assert(style == ButtonBorderStyle.Outset, "Caller should have known how to use us."); 2447Debug.Assert(replaceBlack.A == 255); 2448Debug.Assert(replaceWhite.A == 255);
System\Windows\Forms\Rendering\DCMapping.cs (6)
42Debug.Assert(success, "GetViewportOrgEx() failed."); 51Debug.Assert(!clippingRegion.IsNull, "CreateRectRgn() failed."); 63Debug.Assert(success, "SetViewportOrgEx() failed."); 71Debug.Assert( 85Debug.Assert( 98Debug.Assert(
System\Windows\Forms\Rendering\DpiChangedEventArgs.cs (1)
21Debug.Assert((short)m.WParamInternal.HIWORD == DeviceDpiNew, "Non-square pixels!");
System\Windows\Forms\Rendering\DrawingEventArgs.cs (4)
55Debug.Assert(type is OBJ_TYPE.OBJ_DC 99Debug.Assert(!_hdc.IsNull); 161Debug.Assert(offset.IsEmpty, "transform has been modified"); 162Debug.Assert(isInfinite, "clipping as been applied");
System\Windows\Forms\Rendering\FontCache.Data.cs (3)
41Debug.Assert(PInvoke.GetMapMode(hdc) == HDC_MAP_MODE.MM_TEXT); 78Debug.Assert(font.SizeInPoints > 0.0f, "size has a negative value."); 120Debug.Assert(!hfont.IsNull);
System\Windows\Forms\Rendering\GdiCache.cs (1)
93Debug.Assert(font is not null);
System\Windows\Forms\Rendering\ScreenDcCache.cs (8)
34Debug.Assert(cacheSpace >= 0); 103Debug.Assert(PInvoke.GetClipRgn(hdc, hrgn) == 0, "Should not have a clipping region"); 108Debug.Assert(point.IsEmpty, "Viewport origin shouldn't be shifted"); 109Debug.Assert(PInvoke.GetMapMode(hdc) == HDC_MAP_MODE.MM_TEXT); 110Debug.Assert(PInvoke.GetROP2(hdc) == R2_MODE.R2_COPYPEN); 111Debug.Assert(PInvoke.GetBkMode(hdc) == BACKGROUND_MODE.OPAQUE); 114Debug.Assert(PInvoke.GetWorldTransform(hdc, (XFORM*)(void*)&matrix)); 115Debug.Assert(matrix.IsIdentity);
System\Windows\Forms\Rendering\TextExtensions.cs (1)
21Debug.Assert(((uint)flags & GdiUnsupportedFlagMask) == 0,
System\Windows\Forms\Rendering\TextRenderer.cs (2)
635Debug.Assert(apply.HasFlag(ApplyGraphicsProperties.Clipping) 640Debug.Assert(apply.HasFlag(ApplyGraphicsProperties.TranslateTransform)
System\Windows\Forms\Scrolling\ScrollableControl.cs (1)
787Debug.Assert(IsHandleCreated, "Handle is not created");
System\Windows\Forms\SendKeys\SendKeys.SendKeysHookProc.cs (1)
53Debug.Assert(
System\Windows\Forms\Timer.cs (4)
230Debug.Assert(!HWND.IsNull, "Could not create timer HWND."); 325Debug.Assert(_timerID == 0, "Destroying handle with timerID still set."); 338Debug.Assert(_timerID == 0, "Destroying handle with timerID still set."); 344Debug.Assert(m.HWND == HWND && !HWND.IsNull, "Timer getting messages for other windows?");
System\Windows\Forms\WindowsFormsSynchronizationContext.cs (2)
31Debug.Assert(_controlToSendTo.IsHandleCreated, "Marshaling control should have created its handle in its ctor."); 38Debug.Assert(
System\Windows\Forms\WindowSubclassHandler.cs (2)
107Debug.Assert(_originalWindowProc != _windowProcDelegatePtr); 268Debug.Assert(hWnd == _handle);
System.Windows.Forms.Design (385)
System\ComponentModel\Design\ByteViewer.cs (3)
128Debug.Assert(success && charCount == 8); 185Debug.Assert(charsBuffer.Length >= lineBuffer.Length); 207Debug.Assert(charsBuffer.Length >= lineBuffer.Length * 3 + 1);
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (2)
933Debug.Assert(_suspendEnabledCount >= 0, "Mismatch suspend/resume enabled"); 1134Debug.Assert(collection.Count > 0, "We should only be wrapped if there is a selection");
System\ComponentModel\Design\CollectionEditor.cs (2)
353Debug.Assert(Context is not null); 366Debug.Assert(Context is not null);
System\ComponentModel\Design\ComponentDesigner.cs (2)
364Debug.Assert( 503Debug.Assert(Component.Site is not null);
System\ComponentModel\Design\DesignerActionPanel.cs (4)
342Debug.Assert(false); // should never get here 433Debug.Assert(TopLevelControl is Form, "DesignerActionPanel must be hosted on a Form."); 608Debug.Assert(relatedComponent is not null); 880Debug.Assert(newLine.GetType() == newLineInfo.LineType);
System\ComponentModel\Design\DesignerActionPanel.MethodLine.cs (1)
57Debug.Assert(!ActionPanel.InMethodInvoke, "Nested method invocation");
System\ComponentModel\Design\DesignerActionUI.cs (4)
336Debug.Assert(behaviorWithPanelToRegen.RelatedComponent is not null, "could not find related component for this refresh"); 600Debug.Assert(_lastPanelComponent is not null, "last panel component should not be null here... " + 627Debug.Assert(_designerActionKeyboardBehavior is not null, $"why is {nameof(_designerActionKeyboardBehavior)} null?"); 629Debug.Assert(popBehavior is DesignerActionKeyboardBehavior, "behavior returned is of the wrong kind?");
System\ComponentModel\Design\DesignerActionUI.DesignerActionToolStripDropDown.cs (1)
138Debug.Assert(relatedGlyph is not null, "related glyph cannot be null");
System\ComponentModel\Design\DesignerActionUIService.cs (1)
23Debug.Assert(_designerActionService is not null, "we should have created and registered the DAService first");
System\ComponentModel\Design\DesignerEventService.cs (4)
44Debug.Assert(host is not null, "Design surface did not provide us with a designer host"); 119Debug.Assert(surface is not null, "DesignerApplication should not pass null here"); 121Debug.Assert(host is not null, "Design surface did not provide us with a designer host"); 147Debug.Assert(host is not null, "Design surface removed host too early in dispose");
System\ComponentModel\Design\DesignerHost.cs (1)
376Debug.Assert(component is not null, "Caller should have guarded against a null component");
System\ComponentModel\Design\DesignerHost.Site.cs (2)
39Debug.Assert(nc is not null, "We failed to resolve a nested container."); 41Debug.Assert(sc is not null, "We failed to resolve a service container from the nested container.");
System\ComponentModel\Design\DesignSurfaceManager.cs (4)
334Debug.Assert(_activeDesignSurfaceChanged is not null, "Should have detached this event handler."); 350Debug.Assert(_designSurfaceCreated is not null, "Should have detached this event handler."); 368Debug.Assert(_designSurfaceDisposed is not null, "Should have detached this event handler."); 386Debug.Assert(_selectionChanged is not null, "Should have detached this event handler.");
System\ComponentModel\Design\EventBindingService.cs (1)
241Debug.Assert(_showCodeComponent is null && _showCodeEventDescriptor is null && _showCodeMethodName is null, "show code already pending");
System\ComponentModel\Design\InheritanceService.cs (7)
101Debug.Assert(!field.IsStatic, "Instance binding shouldn't have found this field"); 119Debug.Assert(fieldAttrs.Length == 1, "Non-inheritable attribute has more than one copy"); 120Debug.Assert(fieldAttrs[0] is AccessedThroughPropertyAttribute, "Reflection bug: GetCustomAttributes(type) didn't discriminate by type"); 125Debug.Assert(fieldProp is not null, "Field declared with AccessedThroughPropertyAttribute has no associated property"); 126Debug.Assert(fieldProp.PropertyType == field.FieldType, "Field declared with AccessedThroughPropertyAttribute is associated with a property with a different return type."); 137Debug.Assert(member is not null, "GetGetMethod for property didn't return a method, but CanRead is true"); 153Debug.Assert(value is IComponent, "Value of inherited field is not IComponent. How did this value get into the datatype?");
System\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (2)
117Debug.Assert( 345Debug.Assert(index != -1, "We should have found a Ctrl+Enter in the string");
System\ComponentModel\Design\MultilineStringEditor.OleCallback.cs (2)
43Debug.Assert(hr.Succeeded); 119Debug.Assert(success);
System\ComponentModel\Design\ReferenceService.cs (4)
70Debug.Assert(cs is not null, "Reference service relies on IComponentChangeService"); 317Debug.Assert(trailingName is not null, "Expected a trailing name"); 318Debug.Assert(reference is not null, "Expected a reference"); 319Debug.Assert(sitedComponent is not null, "Expected a sited component");
System\ComponentModel\Design\SelectionService.cs (1)
215Debug.Assert(_selection is not null, "Should be impossible to update the help context before configuring the selection hash");
System\ComponentModel\Design\Serialization\BasicDesignerLoader.cs (3)
295Debug.Assert(host is not null, "designer loader was asked to flush after it has been disposed."); 734Debug.Assert(mgr is not null && thisSurface is not null); 853Debug.Assert(lastError is not null, "Someone embedded a null in the error collection");
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.ComponentListCodeDomSerializer.cs (3)
213Debug.Assert(curIndex > 0, "ResolvedNestedName accepts only nested names!"); 439Debug.Assert(state is MemberAttributes, "Attempting to deserialize a null modifier"); 621Debug.Assert(prop.GetValue(data._value) is null, "ShouldSerializeValue and GetValue are differing");
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.cs (1)
161Debug.Assert(_resourceStream is null, "Attempting to close a serialization store with already serialized resources");
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.cs (6)
190Debug.Assert(manager is not null, "Should pass a serialization manager into EnsureDocument"); 195Debug.Assert(_documentType is null && _documentNamespace is null, "We have no compile unit but we still have a type or namespace. Our state is inconsistent."); 803Debug.Assert(typeDeclaration is not null, "Root CodeDom serializer must return a CodeTypeDeclaration"); 831Debug.Assert(_documentType is not null, "EnsureDocument didn't create a document type"); 832Debug.Assert(_documentNamespace is not null, "EnsureDocument didn't create a document namespace"); 833Debug.Assert(_rootSerializer is not null || _typeSerializer is not null, "EnsureDocument didn't create a root serializer");
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.ModifiersInheritedExtenderProvider.cs (1)
78Debug.Assert(baseComponent is not null, "Root component was null");
System\ComponentModel\Design\Serialization\CodeDomSerializer.cs (3)
217Debug.Assert(manager.Context.Current == abs, "Serializer added a context it didn't remove."); 279Debug.Assert(manager.Context.Current == abs, "Serializer added a context it didn't remove."); 361Debug.Assert(false, e.Message);
System\ComponentModel\Design\Serialization\CodeDomSerializerBase.cs (18)
360Debug.Assert(resourceName is not null, "non-string keys in dictionary entry"); 465Debug.Assert(manager.Context.Current == statement, "Someone corrupted the context stack"); 1181Debug.Assert(targetObject is not null, "Failed to get target object for event attach"); 1182Debug.Assert(eventName is not null, "Failed to get eventName for event attach"); 1693Debug.Assert(nameParts.Length > 0, "How can we fail to split when IndexOf succeeded?"); 1952Debug.Assert(argumentValues is not null && parameters is not null, "These should have been allocated when the argument array was created."); 1973Debug.Assert(manager.Context.Current == newCtx, "Context stack corrupted."); 2012Debug.Assert(arguments.Length == 0, "Property serialization does not support arguments"); 2018Debug.Assert(arguments.Length == 0, "Field serialization does not support arguments"); 2118Debug.Assert(manager.Context.Current == descriptor, "Context stack corrupted."); 2159Debug.Assert(manager.Context.Current == inheritance, "Somebody messed up our context stack."); 2227Debug.Assert(manager.Context.Current == tree, "Context stack corrupted."); 2235Debug.Assert(manager.Context.Current == statements, "Context stack corrupted."); 2263Debug.Assert(manager.Context.Current == propertyToSerialize, "Context stack corrupted."); 2370Debug.Assert(manager.Context.Current == saveStatements, "Context stack corrupted."); 2402Debug.Assert(saveStatements != statements, "The serializer returned the same collection that exists on the context stack."); 2563Debug.Assert(manager.Context.Current == saveStatements, "Context stack corrupted."); 2769Debug.Assert(className is not null, "FillStatementTable expected a valid className but received null");
System\ComponentModel\Design\Serialization\CollectionCodeDomSerializer.cs (6)
272Debug.Assert(candidateType!.IsAssignableFrom(type) || type.IsAssignableFrom(candidateType), "These two types are not related, how were they chosen based on the base type"); 435Debug.Assert(manager.Context.Current == newContext, "Context stack corrupted."); 501Debug.Assert(genCode, "Why didn't GetCollectionDelta calculate the same thing?"); 529Debug.Assert(manager.Context.Current == newCtx, "Context stack corrupted."); 583Debug.Assert(genCode, "Why didn't GetCollectionDelta calculate the same thing?"); 605Debug.Assert(manager.Context.Current == newContext, "Context stack corrupted.");
System\ComponentModel\Design\Serialization\ComponentCodeDomSerializer.cs (3)
278Debug.Assert(isCompleteOld == isComplete, "CCDS Differing"); 454Debug.Assert(manager.Context.Current == entry, "Context stack corrupted"); 496Debug.Assert(manager.Context.Current == statements, "Context stack corrupted");
System\ComponentModel\Design\Serialization\DesignerSerializationManager.cs (1)
760Debug.Assert(instance is not null, "instance should not be null here");
System\ComponentModel\Design\Serialization\LocalizationCodeDomSerializer.cs (2)
130Debug.Assert(resourceManager is not null, "No resource manager available in context."); 132Debug.Assert(rmExpression is not null, "No expression available for resource manager.");
System\ComponentModel\Design\Serialization\PropertyMemberCodeDomSerializer.cs (3)
200Debug.Assert(manager.Context.Current == tree, "Serializer added a context it didn't remove."); 260Debug.Assert(manager.Context.Current == tree, "Context stack corrupted."); 341Debug.Assert(manager.Context.Current == tree, "Context stack corrupted.");
System\ComponentModel\Design\Serialization\ResourceCodeDomSerializer.cs (2)
428Debug.Assert(manager.Context.Current == re.ExpressionContext, "Someone corrupted the context stack"); 430Debug.Assert(manager.Context.Current == re.PropertyDescriptor, "Someone corrupted the context stack");
System\ComponentModel\Design\Serialization\ResourceCodeDomSerializer.SerializationResourceManager.cs (14)
209Debug.Assert(name is not null, "name is null"); 219Debug.Assert(culture.Parent != culture, "should have returned when culture = InvariantCulture"); 364Debug.Assert(_manager is not null, "This resource manager object has been destroyed."); 390Debug.Assert(culture is not null, "null parameter"); 466Debug.Assert(invariantWriter is not null, "GetResourceWriter returned null for the InvariantCulture"); 471Debug.Assert(!ReadCulture.Equals(CultureInfo.InvariantCulture), "invariantCultureResourcesDirty should only come into play when readCulture != CultureInfo.InvariantCulture; check that CompareWithParentValue is correct"); 473Debug.Assert(resourceSet is not null, "ResourceSet for the InvariantCulture not loaded, but it's considered dirty?"); 484Debug.Assert(_metadata is not null, "No metadata, but it's dirty?"); 571Debug.Assert(metadata is not null, "Don't know where to push metadata."); 623Debug.Assert(resourceSet is not null, "No ResourceSet for the InvariantCulture?"); 651Debug.Assert(!ReadCulture.Equals(CultureInfo.InvariantCulture), "invariantCultureResourcesDirty should only come into play when readCulture != CultureInfo.InvariantCulture; check that CompareWithParentValue is correct"); 653Debug.Assert(resourceSet is not null, "No ResourceSet for the InvariantCulture?"); 689Debug.Assert(!ReadCulture.Equals(CultureInfo.InvariantCulture), "invariantCultureResourcesDirty should only come into play when readCulture != CultureInfo.InvariantCulture; check that CompareWithParentValue is correct"); 691Debug.Assert(resourceSet is not null, "No ResourceSet for the InvariantCulture?");
System\ComponentModel\Design\Serialization\ResourcePropertyMemberCodeDomSerializer.cs (1)
69Debug.Assert(manager is not null, "manager should not be null!");
System\ComponentModel\Design\Serialization\TypeCodeDomSerializer.cs (3)
202Debug.Assert(manager.Context.Current == rootCtx, "Context stack corrupted"); 374Debug.Assert(_nameTable is not null, "OnResolveName called and we are not deserializing!"); 465Debug.Assert(manager.Context.Current == statementCtx, "Somebody messed up our context stack");
System\ComponentModel\Design\UndoEngine.UndoUnit.ChangeUndoEvent.cs (2)
110Debug.Assert(_after is null, "Change undo saving state twice."); 154Debug.Assert(_savedAfterState, "After state not saved. BeforeUndo was not called?");
System\ComponentModel\Design\UndoEngine.UndoUnit.cs (2)
463Debug.Assert(idx >= groupEndIdx, "We're going backwards"); 515Debug.Assert(idx <= groupEndIdx, "We're going backwards");
System\Drawing\Design\ColorEditor.CustomColorDialog.cs (4)
36Debug.Assert(_hInstance != IntPtr.Zero, "Dialog has been disposed"); 122Debug.Assert(!success, "Couldn't find dialog member COLOR_RED"); 125Debug.Assert(!success, "Couldn't find dialog member COLOR_GREEN"); 128Debug.Assert(!success, "Couldn't find dialog member COLOR_BLUE");
System\Drawing\Design\IconEditor.cs (1)
68Debug.Assert(s_imageExtenders.Length <= 0, "Why does IconEditor have subclasses if Icon doesn't?");
System\Drawing\Design\ToolboxItem.cs (1)
641Debug.Assert(type is not null);
System\Windows\Forms\Design\BaseContextMenuStrip.cs (1)
86Debug.Assert(root is not null, "Null root component. Will be unable to build selection menu");
System\Windows\Forms\Design\Behavior\BehaviorService.AdornerWindow.MouseHook.cs (4)
63Debug.Assert(s_adornerWindowList.Count > 0, "No AdornerWindow available to create the mouse hook"); 87Debug.Assert(_isHooked, "Failed to install mouse hook."); 124Debug.Assert(_isHooked, "How did we get here when we are disposed?"); 165Debug.Assert(_thisProcessID != 0, "Didn't get our process id!");
System\Windows\Forms\Design\Behavior\BehaviorService.cs (1)
410Debug.Assert(_captureBehavior is null, "OnLostCapture should have cleared captureBehavior");
System\Windows\Forms\Design\Behavior\DesignerActionKeyboardBehavior.cs (1)
22Debug.Assert(_menuService is not null, "we should have found a menu service here...");
System\Windows\Forms\Design\Behavior\DragAssistanceManager.cs (2)
842Debug.Assert(lines[i].PaddingLineType == PaddingLineType.PaddingRight); 866Debug.Assert(lines[i].PaddingLineType == PaddingLineType.PaddingBottom);
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (1)
995Debug.Assert(_primaryComponentIndex != -1, "primaryComponentIndex was not set!");
System\Windows\Forms\Design\Behavior\GrabHandleGlyph.cs (1)
101Debug.Assert(false, "GrabHandleGlyph was called with a bad GrabHandleGlyphType.");
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (3)
371Debug.Assert(BehaviorService is not null, "We should have a behavior service."); 411Debug.Assert(!_dragging, "How can we be dragging without pushing a behavior?"); 798Debug.Assert(i == 0, "The first control in the Selection should be the target control");
System\Windows\Forms\Design\Behavior\SelectionManager.cs (1)
137Debug.Assert(_currentSelectionBounds is not null);
System\Windows\Forms\Design\Behavior\TableLayoutPanelBehavior.cs (2)
103Debug.Assert(_resizeProp is not null, "Unable to get the resize property for tableGlyph's Style"); 133Debug.Assert(_leftStyle.styleProp is not null && _rightStyle.styleProp is not null, "Couldn't find property descriptor for width or height");
System\Windows\Forms\Design\BorderSidesEditor.BorderSidesEditorUI.cs (1)
365Debug.Assert(edSvc is not null);
System\Windows\Forms\Design\ChangeToolStripParentVerb.cs (1)
23Debug.Assert(designer is not null, "Can't have a StandardMenuStripVerb without an associated designer");
System\Windows\Forms\Design\CollectionEditVerbManager.cs (2)
29Debug.Assert(designer is not null, "Can't have a CollectionEditVerbManager without an associated designer"); 41Debug.Assert(_targetProperty is not null, "Need PropertyDescriptor for ICollection property to associate collection editor with.");
System\Windows\Forms\Design\CommandSet.CommandSetItem.StatusState.cs (1)
41Debug.Assert(!_statusFlags.HasFlag(StatusFlag.NeedsUpdate), "Updating item when StatusState is not valid.");
System\Windows\Forms\Design\CommandSet.cs (13)
201Debug.Assert(SelectionService is not null, "CommandSet relies on the selection service, which is unavailable."); 221Debug.Assert(ds is not null, "No dictionary service"); 1405Debug.Assert(ds is not null, "No designer serialization service -- we cannot copy to clipboard"); 1450Debug.Assert(ds is not null, "No designer serialization service -- we cannot copy to clipboard"); 2197Debug.Assert(SelectionService is not null, "We need the SelectionService, but we can't find it!"); 2313Debug.Assert(selectedObjects is not null, "queryStatus should have disabled this"); 2394Debug.Assert(selectedObjects is not null, "queryStatus should have disabled this"); 2419Debug.Assert(sizeProp is not null, "No size property on component"); 2420Debug.Assert(locProp is not null, "No location property on component"); 2469Debug.Assert(false, "Invoking pbrs command failed"); 2553Debug.Assert(selectedObjects is not null, "queryStatus should have disabled this"); 2900Debug.Assert(designerHost is not null, "Failed to get designer host"); 3086Debug.Assert(attr is not null, "Type descriptor gave us a null attribute -- problem in type descriptor");
System\Windows\Forms\Design\ComponentTray.cs (21)
87Debug.Assert(es is not null, "Component tray wants an extender provider service, but there isn't one."); 102Debug.Assert(_menucmdArrangeIcons is null, "Non-Null Menu Command for ArrangeIcons"); 103Debug.Assert(_menucmdLineupIcons is null, "Non-Null Menu Command for LineupIcons"); 104Debug.Assert(_menucmdLargeIcons is null, "Non-Null Menu Command for LargeIcons"); 752Debug.Assert(host is not null, "Service object could not provide us with a designer host."); 882Debug.Assert(_menucmdArrangeIcons is not null, "Null Menu Command for ArrangeIcons"); 883Debug.Assert(_menucmdLineupIcons is not null, "Null Menu Command for LineupIcons"); 884Debug.Assert(_menucmdLargeIcons is not null, "Null Menu Command for LargeIcons"); 1003Debug.Assert(_serviceProvider is not null, "Trying to access services too late or too early."); 1129Debug.Assert((de.AllowedEffect & (DragDropEffects.Move | DragDropEffects.Copy)) != 0, "DragDropEffect.Move | .Copy isn't allowed?"); 1163Debug.Assert((de.AllowedEffect & DragDropEffects.Copy) != 0, "DragDropEffect.Move isn't allowed?"); 1774Debug.Assert(index >= 1, "Got the wrong index, how could that be?"); 1796Debug.Assert(index >= 1, "Got the wrong index, how could that be?"); 1810Debug.Assert(_controls.IndexOf(c) != -1, "Add control to the list of controls before autoarranging.!!!"); 1823Debug.Assert(_selectionUISvc is not null, "No SelectionUIService available for tray."); 1839Debug.Assert(comp is not null, "Component for the TrayControl is null"); 1874Debug.Assert(comp is not null, "Component for the TrayControl is null"); 1940Debug.Assert(ds is not null, "ComponentTray relies on IDictionaryService, which is not available."); 2093Debug.Assert(host is not null, "Component tray does not have access to designer host."); 2137Debug.Assert(_tray._selectionUISvc is not null, "We shouldn't be able to begin a drag without this"); 2773Debug.Assert(o1 is not null && o2 is not null, "Null objects sent for comparison!!!");
System\Windows\Forms\Design\ContextMenuStripActionList.cs (2)
24Debug.Assert(getProperty is not null, "Could not find given property in control."); 37Debug.Assert(changingProperty is not null, "Could not find given property in control.");
System\Windows\Forms\Design\ControlCodeDomSerializer.cs (1)
267Debug.Assert(value is not IComponent { Site: not null }, "Unnamed, sited control in hierarchy");
System\Windows\Forms\Design\ControlCommandSet.cs (6)
473Debug.Assert(directionOffsetY == 0, "Can only resize in one direction at a time using the keyboard"); 496Debug.Assert(directionOffsetX == 0, "Can only resize in one direction at a time using the keyboard"); 927Debug.Assert(_tabOrder is not null, "Tab order and menu enabling are out of sync"); 969Debug.Assert(SelectionService is not null, "Need SelectionService for sizing command"); 1110Debug.Assert(ccs is not null && controlsProp is not null, "Wrong parent in parent list"); 1305Debug.Assert(SelectionService is not null, "Need SelectionService for sizing command");
System\Windows\Forms\Design\ControlDesigner.ChildSubClass.cs (1)
53Debug.Assert(m.HWnd == Handle, "Message handle differs from target handle");
System\Windows\Forms\Design\ControlDesigner.ChildWindowTarget.cs (1)
79Debug.Assert(_handle != IntPtr.Zero, "Handle for control not created");
System\Windows\Forms\Design\ControlDesigner.cs (6)
216Debug.Assert(_host is not null); 374Debug.Assert(Component is not null, "this.component needs to be set before this method is valid."); 535Debug.Assert(ctl.DataBindings.Count > 0, "we should not be notified if the control has no dataBindings"); 913Debug.Assert(child is not null); 917Debug.Assert(child.IsHandleCreated); 1747Debug.Assert(!s_inContextMenu, "Recursively hitting live region for context menu!!!");
System\Windows\Forms\Design\DataGridViewAddColumnDialog.cs (5)
519Debug.Assert(_initialDataGridViewColumnsCount != -1, "did you forget to set the initialDataGridViewColumnsCount when you started the dialog?"); 562Debug.Assert(_initialDataGridViewColumnsCount == -1, "did you forget to reset the _initialDataGridViewColumnsCount when you started the dialog?"); 598Debug.Assert(_unboundColumnRadioButton.Checked, "we only have 2 radio buttons"); 619Debug.Assert(_dataColumns.Enabled, "dataColumns list box and dataBoundColumnRadioButton should be enabled / disabled in sync"); 624Debug.Assert(_unboundColumnRadioButton.Checked, "We only have 2 radio buttons");
System\Windows\Forms\Design\DataGridViewCellStyleBuilder.cs (2)
320Debug.Assert(e.Cell == _sampleDataGridView.Rows[0].Cells[0], "the sample data grid view has only one cell"); 321Debug.Assert(sender == _sampleDataGridView, "did we forget to unhook notification");
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (8)
111Debug.Assert(typeof(DataGridViewColumn).IsAssignableFrom(newType), "we should only have types that can be assigned to a DataGridViewColumn"); 112Debug.Assert(_selectedColumns.SelectedItem == item, "we must have lost track of what item is in the property grid"); 663Debug.Assert(selectedIndex > -1 && selectedIndex < _selectedColumns.Items.Count - 1); 683Debug.Assert(_columnsPrivateCopy[i].Frozen, "MOVE_DOWN : all the columns up to the one we moved should be frozen"); 709Debug.Assert(selectedIndex > 0); 825Debug.Assert(_selectedColumns.SelectedIndex != -1); 904Debug.Assert(selectedIndex != -1, "we forgot to take away the selected object from the property grid"); 1350Debug.Assert(component is ListBoxItem, "this property descriptor only relates to the data grid view column class");
System\Windows\Forms\Design\DataGridViewColumnDesigner.cs (3)
145Debug.Assert(_selectionService is not null); 181Debug.Assert(_behavior is not null); 197Debug.Assert(_behavior is not null);
System\Windows\Forms\Design\DataGridViewColumnTypeEditor.Picker.cs (1)
135Debug.Assert(false, "we should have found a type by now");
System\Windows\Forms\Design\DataGridViewDesigner.cs (3)
255Debug.Assert(string.IsNullOrEmpty(dataGridView.DataMember), "in the designer we can't set DataSource and DataMember at the same time. Did you forget to set AutoGenerateColumns to false at a previous stage?"); 384Debug.Assert(dataGridView.DataSource is null || _currencyManager is not null, "if we have a data source we should also have a currency manager by now"); 561Debug.Assert(dataGridView.DataSource is null || _currencyManager is not null, "if we have a data source we should also have a currency manager by now");
System\Windows\Forms\Design\DataGridViewRowCollectionCodeDomSerializer.cs (2)
34Debug.Assert(rowCollection.Count == 1, " we should have only the add new row"); 36Debug.Assert(dataGridView.AllowUserToAddRows, "we only have the add new row when the data grid view allows users to add rows");
System\Windows\Forms\Design\DesignBindingPicker.cs (3)
843Debug.Assert(nodes.Count == 0, "We only add data member content sub-nodes once."); 2266Debug.Assert(false, "DesignBindingPicker failed to add custom image to image list."); 2282Debug.Assert(!_subNodesFilled && value, "we can only set this bit to true once");
System\Windows\Forms\Design\DesignerActionVerbItem.cs (1)
13Debug.Assert(verb is not null, "All callers check whether the verb is null.");
System\Windows\Forms\Design\DesignerUtils.cs (3)
745Debug.Assert(css is not null, "No component serialization service -- we cannot copy the objects"); 746Debug.Assert(host is not null, "No host -- we cannot copy the objects"); 778Debug.Assert(newObjects.Count == objects.Count, "Why is the count of the copied objects not the same?");
System\Windows\Forms\Design\DocumentDesigner.AxToolboxItem.cs (3)
63Debug.Assert(host is not null, "Designer host is null"); 141Debug.Assert(comps[0] is not null, "Could not create instance of ActiveX control wrappers!!!"); 175Debug.Assert(trs is not null, "No type resolution service found.");
System\Windows\Forms\Design\DocumentDesigner.cs (5)
330Debug.Assert(host is not null, "Must have a designer host on dispose"); 378Debug.Assert(toolbox is not null, "No toolbox service available"); 610Debug.Assert(sel is Control, "Our logic is flawed - sel should be a Control"); 762Debug.Assert(component.Site is not null, "Designer host should have given us a site by now."); 1104Debug.Assert(ss.PrimarySelection == Component, "Bug in selection service: form should have primary selection.");
System\Windows\Forms\Design\EditorServiceContext.cs (2)
34Debug.Assert(_targetProperty is not null, "Need PropertyDescriptor for ICollection property to associate collection editor with."); 39Debug.Assert(!string.IsNullOrEmpty(newVerbText), "newVerbText cannot be null or empty");
System\Windows\Forms\Design\EventHandlerService.cs (1)
55Debug.Assert(_handlers.Count > 0, "Should have handlers to look through.");
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (2)
242Debug.Assert(currentMinTopLeft > 0 && currentMaxBottomRight > 0, "How can we not have a min/max value?"); 273Debug.Assert(currentMinTopLeft > 0 && currentMaxBottomRight > 0, "How can we not have a min/max value?");
System\Windows\Forms\Design\FormatControl.cs (8)
93Debug.Assert(customFormatType is not null); 102Debug.Assert(item is not null); 111Debug.Assert(item is not null); 123Debug.Assert(item is not null); 185Debug.Assert(decimalPlacesUpDown.Visible); 197Debug.Assert(dateTimeFormatsListBox.Visible); 209Debug.Assert(_customStringTextBox.Visible); 405Debug.Assert(item is not null);
System\Windows\Forms\Design\FormatControl.CurrencyFormatType.cs (1)
74Debug.Assert(Parse(formatString), "we only push valid strings");
System\Windows\Forms\Design\FormatControl.DateTimeFormatType.cs (1)
67Debug.Assert(Parse(formatString), "we only push valid strings");
System\Windows\Forms\Design\FormatControl.NumericFormatType.cs (1)
73Debug.Assert(Parse(formatString), "we only push valid strings");
System\Windows\Forms\Design\FormatControl.ScientificFormatType.cs (1)
74Debug.Assert(Parse(formatString), "we only push valid strings");
System\Windows\Forms\Design\FormatStringDialog.cs (1)
130Debug.Assert(_listControl is not null, "we check this everywhere, but it does not hurt to check it again");
System\Windows\Forms\Design\FormatStringEditor.cs (1)
26Debug.Assert(
System\Windows\Forms\Design\FormDocumentDesigner.cs (2)
290Debug.Assert(host is not null, "Must have a designer host on dispose"); 333Debug.Assert(component is Form, "FormDocumentDesigner expects its component to be a form.");
System\Windows\Forms\Design\ImageListDesigner.OriginalImageCollection.cs (2)
30Debug.Assert(_owner is not null, "OriginalImageCollection has no owner (ImageListDesigner)"); 31Debug.Assert(_items is not null, "OriginalImageCollection has no list (ImageListDesigner)");
System\Windows\Forms\Design\InheritanceUI.cs (1)
54Debug.Assert(level != InheritanceLevel.NotInherited, "This should only be called for inherited components.");
System\Windows\Forms\Design\MaskDesignerDialog.cs (4)
343Debug.Assert(maskDescriptor is not null, "Null mask descriptor."); 344Debug.Assert(maskDescriptor.Name is not null, "Mask descriptor should either be valid or equal to _customMaskDescriptor"); 350Debug.Assert(descriptor is not null, "Null mask descriptor in the collection."); 516Debug.Assert(success, "BadBad: Could not add MaskDescriptor.Sample even it was validated, something is wrong!");
System\Windows\Forms\Design\MaskedTextBoxDesigner.cs (4)
210Debug.Assert(maskedTextBox is not null, "Designed control is not a MaskedTextBox."); 228Debug.Assert(maskedTextBox is not null, "Designed control is not a MaskedTextBox."); 247Debug.Assert(maskedTextBox is not null, "Designed control is not a MaskedTextBox."); 260Debug.Assert(maskedTextBox is not null, "Designed control is not a MaskedTextBox.");
System\Windows\Forms\Design\MaskPropertyEditor.cs (1)
29Debug.Assert(instance is not null, "Null masked text box.");
System\Windows\Forms\Design\OleDragDropHandler.cs (3)
554Debug.Assert(selectionUISvc is not null, "Unable to get selection ui service when adding child control"); 725Debug.Assert(container is not null, "Didn't get a container from the site!"); 836Debug.Assert(selectionUISvc is not null, "Unable to get selection ui service when adding child control");
System\Windows\Forms\Design\ParentControlDesigner.cs (6)
1350Debug.Assert(_suspendChanging > 0, "Unbalanced SuspendChangingEvents\\ResumeChangingEvents"); 1356Debug.Assert(_suspendChanging >= 0, "Unbalanced SuspendChangingEvents\\ResumeChangingEvents"); 1615Debug.Assert((de.AllowedEffect & (DragDropEffects.Move | DragDropEffects.Copy)) != 0, "DragDropEffect.Move | .Copy isn't allowed?"); 1668Debug.Assert(tabCommand is not null, "Missing tab order command"); 1688Debug.Assert((de.AllowedEffect & DragDropEffects.Copy) != 0, "DragDropEffect.Move isn't allowed?"); 1762Debug.Assert(_graphics is null);
System\Windows\Forms\Design\SelectionUIHandler.cs (6)
46Debug.Assert(components[i] is IComponent, "Selection UI handler only deals with IComponents"); 48Debug.Assert(_dragControls[i] is not null, "Everyone must have a control"); 60Debug.Assert(bounds is not null && controls is not null && bounds.Length == controls.Length, "bounds->controls mismatch"); 101Debug.Assert(_originalCoordinates is not null, "We are keying off of originalCoords, but MoveControls didn't set it"); 242Debug.Assert(controls[i] == GetControl((IComponent)components[i]), "Control->Component mapping is out of sync"); 307Debug.Assert(host is not null, "No designer host");
System\Windows\Forms\Design\SelectionUIService.cs (3)
349Debug.Assert(!RecreatingHandle, "Perf hit: we are recreating the docwin handle"); 499Debug.Assert(selComp is not null, "Illegal selection on double-click"); 1072Debug.Assert(_dragComponents is not null, "We should have a set of drag controls here");
System\Windows\Forms\Design\SelectionUIService.SelectionUIItem.cs (4)
272Debug.Assert(!(pt.X >= _outerRect.X && pt.X <= _innerRect.X), "Should be handled by left top check"); 290Debug.Assert(!(pt.Y >= _outerRect.Y && pt.Y <= _innerRect.Y), "Should be handled by top right check"); 308Debug.Assert(!(pt.X >= _outerRect.X && pt.X <= _innerRect.X), "Should be handled by left bottom check"); 310Debug.Assert(!(pt.X >= _innerRect.X + _innerRect.Width && pt.X <= _outerRect.X + _outerRect.Width), "Should be handled by right bottom check");
System\Windows\Forms\Design\ShortcutKeysEditor.ShortcutKeysUI.cs (3)
56Debug.Assert(s_validKeys.Distinct().Count() == s_validKeys.Length); 240Debug.Assert((keyCode & Keys.KeyCode) == keyCode); 323Debug.Assert(!_updateCurrentValue);
System\Windows\Forms\Design\StandardMenuStripVerb.cs (7)
30Debug.Assert(designer is not null, "Can't have a StandardMenuStripVerb without an associated designer"); 96Debug.Assert(host is not null, "can't create standard menu without designer _host."); 179Debug.Assert(imageProperty is not null, "Could not find 'Image' property in ToolStripItem."); 270Debug.Assert(host is not null, "can't create standard menu without designer _host."); 326Debug.Assert(displayStyleProperty is not null, "Could not find 'Text' property in ToolStripItem."); 330Debug.Assert(textProperty is not null, "Could not find 'Text' property in ToolStripItem."); 346Debug.Assert(imageProperty is not null, "Could not find 'Image' property in ToolStripItem.");
System\Windows\Forms\Design\TabControlDesigner.cs (2)
210Debug.Assert(control is not null, "Component must be a tab control, it is a: " + component.GetType().FullName); 279Debug.Assert(textProperty is not null, "Could not find 'Text' property in TabPage.");
System\Windows\Forms\Design\TableLayoutPanelCodeDomSerializer.cs (1)
42Debug.Assert(panel is not null, "Huh? We were expecting to be serializing a TableLayoutPanel here.");
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (4)
501Debug.Assert(existingControl is null, "We shouldn't be able to do a local copy of a cell with an existing control"); 1116Debug.Assert(Table.ColumnStyles[i] is not null, "Table's ColumnStyle[" + i + "] is null!"); 1244Debug.Assert(fullTable || (_droppedCellPosition != InvalidPoint), "Why is neither fullTable or droppedCellPosition set?"); 1816Debug.Assert(currentIndex != index);
System\Windows\Forms\Design\TabOrder.cs (4)
72Debug.Assert(os is not null, "No overlay service -- tab order UI cannot be shown"); 260Debug.Assert(_tabGlyphs is not null, "tabGlyps should not be null here."); 508Debug.Assert(mcs is not null, "No menu command service, can't get out of tab order UI"); 512Debug.Assert(mc is not null, "No tab order menu command, can't get out of tab order UI");
System\Windows\Forms\Design\TemplateNodeCustomMenuItemCollection.cs (5)
66Debug.Assert(designerHost is not null, "Why didn't we get a designer host?"); 95Debug.Assert(imageProperty is not null, "Could not find 'Image' property in ToolStripItem."); 102Debug.Assert(dispProperty is not null, "Could not find 'DisplayStyle' property in ToolStripItem."); 106Debug.Assert(imageTransProperty is not null, "Could not find 'DisplayStyle' property in ToolStripItem."); 110Debug.Assert(dummyIndex != -1, "Why is the index of the Item negative?");
System\Windows\Forms\Design\TextBoxDesigner.cs (2)
76Debug.Assert(tb is not null, "Designed control is not a TextBox."); 90Debug.Assert(tb is not null, "Designed control is not a TextBox.");
System\Windows\Forms\Design\ToolStripActionList.cs (2)
55Debug.Assert(getProperty is not null, "Could not find given property in control."); 63Debug.Assert(changingProperty is not null, "Could not find given property in control.");
System\Windows\Forms\Design\ToolStripDesigner.cs (12)
476Debug.Assert(_host is not null, "Why didn't we get a designer host?"); 528Debug.Assert(_host is not null, "Why didn't we get a designer host?"); 529Debug.Assert(_pendingTransaction is null, "Adding item with pending transaction?"); 562Debug.Assert(textProperty is not null, "Could not find 'Text' property in ToolStripItem."); 581Debug.Assert(imageProperty is not null, "Could not find 'Image' property in ToolStripItem."); 588Debug.Assert(displayProperty is not null, "Could not find 'DisplayStyle' property in ToolStripItem."); 592Debug.Assert(imageTransProperty is not null, "Could not find 'DisplayStyle' property in ToolStripItem."); 978Debug.Assert(_host is not null, "Why didn't we get a designer host?"); 1089Debug.Assert(_host is not null, "Why didn't we get a designer host?"); 1090Debug.Assert(_pendingTransaction is null, "Removing item with pending transaction?"); 1721Debug.Assert(defaultName is not null && defaultName.Length > 0, "Couldn't create default name for item"); 2476Debug.Assert(NewItemTransaction is null, "NewItemTransaction should have been nulled out and cancelled by now.");
System\Windows\Forms\Design\ToolStripDesignerUtils.cs (2)
208Debug.Assert(toolStrip is not null, "why werent we handed a toolstrip here? returning default list"); 255Debug.Assert(currentToolStripVisibility != ToolStripItemDesignerAvailability.None, "Why is GetDesignerVisibility returning None?");
System\Windows\Forms\Design\ToolStripInSituService.cs (2)
32Debug.Assert(_designerHost is not null, "ToolStripKeyboardHandlingService relies on the selection service, which is unavailable."); 36Debug.Assert(_componentChangeService is not null, "ToolStripKeyboardHandlingService relies on the componentChange service, which is unavailable.");
System\Windows\Forms\Design\ToolStripItemBehavior.cs (10)
113Debug.Assert(item is not null, "Item passed is null, SelectionService cannot be obtained"); 117Debug.Assert(selSvc is not null, "Failed to get Selection Service!"); 127Debug.Assert(item is not null, "Item passed is null, BehaviorService cannot be obtained"); 131Debug.Assert(behaviorSvc is not null, "Failed to get Behavior Service!"); 141Debug.Assert(item is not null, "Item passed is null, ToolStripKeyBoardHandlingService cannot be obtained"); 145Debug.Assert(keyBoardSvc is not null, "Failed to get ToolStripKeyboardHandlingService!"); 294Debug.Assert(designerHost is not null, "Invalid DesignerHost"); 545Debug.Assert(designerHost is not null, "Invalid DesignerHost"); 649Debug.Assert(designerHost is not null, "Invalid DesignerHost"); 966Debug.Assert(designerHost is not null, "Invalid DesignerHost");
System\Windows\Forms\Design\ToolStripItemCustomMenuItemCollection.cs (14)
255Debug.Assert(item is not null, "Why is item null?"); 259Debug.Assert(propertyName is not null, "Why is propertyName null?"); 271Debug.Assert(item is not null, "Why is item null?"); 275Debug.Assert(desc is not null, "Why is desc null?"); 373Debug.Assert(designerHost is not null, "Why didn't we get a designer host?"); 435Debug.Assert(designerHost is not null, "Why didn't we get a designer host?"); 448Debug.Assert(dummyIndex != -1, "Why is item index negative?"); 474Debug.Assert(designerHost is not null, "Why didn't we get a designer host?"); 487Debug.Assert(dummyIndex != -1, "Why is item index negative?"); 513Debug.Assert(designerHost is not null, "Why didn't we get a designer host?"); 544Debug.Assert(dummyIndex != -1, "Why is item index negative?"); 572Debug.Assert(getProperty is not null, "Could not find given property in control."); 588Debug.Assert(getProperty is not null, "Could not find given property in control."); 606Debug.Assert(changingProperty is not null, "Could not find given property in control.");
System\Windows\Forms\Design\ToolStripItemDesigner.cs (4)
825Debug.Assert(imageProperty is not null, "Could not find 'Image' property in ToolStripItem."); 832Debug.Assert(dispProperty is not null, "Could not find 'DisplayStyle' property in ToolStripItem."); 836Debug.Assert(imageTransProperty is not null, "Could not find 'DisplayStyle' property in ToolStripItem."); 1218Debug.Assert(parent is not null, "ImmediateParent is null for the current ToolStripItem !!");
System\Windows\Forms\Design\ToolStripKeyboardHandlingService.cs (3)
55Debug.Assert(_selectionService is not null, "ToolStripKeyboardHandlingService relies on the selection service, which is unavailable."); 63Debug.Assert(_designerHost is not null, "ToolStripKeyboardHandlingService relies on the selection service, which is unavailable."); 67Debug.Assert(_componentChangeService is not null, "ToolStripKeyboardHandlingService relies on the componentChange service, which is unavailable.");
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (8)
894Debug.Assert(textProperty is not null, "Could not find 'Text' property in ToolStripItem."); 1856Debug.Assert(_designerHost is not null, "Why didn't we get a designer host?"); 1865Debug.Assert(_designerHost is not null, "Why didn't we get a designer host?"); 1977Debug.Assert(_designerHost is not null, "Why didn't we get a designer host?"); 1978Debug.Assert(_pendingTransaction is null, "Adding item with pending transaction?"); 2136Debug.Assert(selectionSvc is not null, "No Selection Service !!"); 2346Debug.Assert(index != -1, "Invalid Index"); 2687Debug.Assert(ownerItem is not null, "How can ownerItem be null for a menu item on a dropdown?");
System\Windows\Forms\Design\ToolStripTemplateNode.cs (2)
1089Debug.Assert(_centerTextBox.Control is not null, "The TextBox is null"); 1412Debug.Assert(_addItemButton.DropDownItems.Count > 0);
System\Windows\Forms\Design\TreeNodeCollectionEditor.cs (2)
110Debug.Assert(false, "TreeNodeCollectionEditor couldn't find the TreeView being designed"); 123Debug.Assert(dictionaryService is not null, "TreeNodeCollectionEditor relies on IDictionaryService, which is not available.");
System\Windows\Forms\Design\TreeViewDesigner.cs (1)
62Debug.Assert(_treeView is not null, "TreeView is null in TreeViewDesigner");
System.Windows.Forms.Primitives (27)
System\Windows\Forms\Automation\UiaTextRange.cs (1)
120Debug.Assert(!typeof(UiaTextRange).IsAssignableTo(typeof(IDisposable)));
System\Windows\Forms\DeviceContextExtensions.cs (4)
45Debug.Assert(!hbrush.IsNull); 82Debug.Assert((lines.Length % 4) == 0); 154Debug.Assert(!hbrush.IsNull, "HBRUSH is null"); 190Debug.Assert(!create, "Couldn't get Graphics");
System\Windows\Forms\Internals\ScaleHelper.cs (2)
86Debug.Assert(Enum.IsDefined(processDpiAwareness)); 269Debug.Assert(dpi >= 96);
System\Windows\Forms\Internals\ThemingScope.cs (2)
34Debug.Assert(success); 43Debug.Assert(success);
System\Windows\Forms\Padding.cs (4)
196Debug.Assert(ShouldSerializeAll(), "_all is true, but ShouldSerializeAll() is false."); 197Debug.Assert(All == Left && Left == Top && Top == Right && Right == Bottom, "_all is true, but All/Left/Top/Right/Bottom inconsistent."); 201Debug.Assert(All == -1, "_all is false, but All != -1."); 202Debug.Assert(!ShouldSerializeAll(), "ShouldSerializeAll() should not be true when all flag is not set.");
System\Windows\Forms\RefCountedCache.CacheEntry.cs (1)
49Debug.Assert(refCount >= 0);
System\Windows\Forms\RefCountedCache.cs (3)
40Debug.Assert(softLimit > 0 && hardLimit > 0); 41Debug.Assert(softLimit <= hardLimit); 169Debug.Assert(removed != 0 || _softLimit < 20);
System\Windows\Forms\RefCountedCache.Scope.cs (1)
40Debug.Assert(entry is not null);
System\Windows\Forms\SinglyLinkedList.cs (5)
52Debug.Assert(First is not null && Last is not null); 157Debug.Assert(_previous is not null); 165Debug.Assert(_previous is not null); 197Debug.Assert(_previous is not null); 202Debug.Assert(_list.Last == _current);
System\Windows\Forms\SystemDrawingExtensions.cs (1)
56Debug.Assert((lines.Length % 4) == 0);
Windows\Win32\PInvoke.LoadLibrary.cs (1)
18Debug.Assert(Path.IsPathFullyQualified(customPath));
Windows\Win32\PInvoke.PrintDlg.cs (1)
16Debug.Assert(RuntimeInformation.ProcessArchitecture == Architecture.X86);
Windows\Win32\System\Ole\ClassPropertyDispatchAdapter.cs (1)
190Debug.Assert(!bindingFlags.HasFlag(BindingFlags.NonPublic));
System.Windows.Forms.Tests (1)
System\Windows\Forms\DynamicAxHost.cs (1)
22Debug.Assert(clsid == _factory.ClassId);
System.Windows.Input.Manipulations (113)
System\Windows\Input\Manipulations\Exceptions.cs (12)
101Debug.Assert(paramName1 != null); 102Debug.Assert(paramName2 != null); 119Debug.Assert(paramName1 != null); 120Debug.Assert(paramName2 != null); 139Debug.Assert(paramName1 != null); 140Debug.Assert(paramName2a != null); 141Debug.Assert(paramName2b != null); 199Debug.Assert(paramName != null); 200Debug.Assert(messageFormat != null); 218Debug.Assert(paramName != null); 219Debug.Assert(paramName.Length > 0); 238Debug.Assert(format != null);
System\Windows\Input\Manipulations\InertiaParameters2D.cs (3)
29Debug.Assert(isEqual != null); 30Debug.Assert(setNewValue != null); 31Debug.Assert(paramName != null);
System\Windows\Input\Manipulations\InertiaProcessor2D.cs (40)
318Debug.Assert(!result, "Complete method is supposed to raise Completed event."); 360Debug.Assert(!IsRunning); 413Debug.Assert(handler != null); 611Debug.Assert(double.IsNaN(this.desiredDeceleration), "desiredDisplacement and desiredDeceleration are mutually exclusive."); 622Debug.Assert(double.IsNaN(this.desiredDisplacement), "desiredDisplacement and desiredDeceleration are mutually exclusive."); 668Debug.Assert( 683Debug.Assert(!DoubleUtil.IsZero(state.InitialVelocity)); 723Debug.Assert(state.Duration >= 0); 724Debug.Assert(!double.IsNaN(state.Deceleration)); 725Debug.Assert(!double.IsNaN(state.Offset)); 743Debug.Assert(this.processorState == ProcessorState.Running); 791Debug.Assert(this.expansion.InitialValue > 0 && 836Debug.Assert(this.expansion.InitialValue > 0 && 844Debug.Assert(!DoubleUtil.IsZero(previousExpansionValue)); 903Debug.Assert(!double.IsNaN(initialVelocity) && !double.IsInfinity(initialValue)); 904Debug.Assert(!double.IsNaN(initialVelocity) && !double.IsInfinity(initialVelocity)); 905Debug.Assert(!double.IsNaN(deceleration) && !double.IsInfinity(deceleration)); 906Debug.Assert(!double.IsNaN(timeDelta) && !double.IsInfinity(timeDelta) && timeDelta >= 0); 920Debug.Assert(!double.IsNaN(timeDelta) && !double.IsInfinity(timeDelta) && timeDelta >= 0); 954Debug.Assert(!double.IsNaN(resultValue) && !double.IsInfinity(resultValue), "Calculation error, value should be a finite number."); 1007Debug.Assert(false); 1041Debug.Assert(!double.IsInfinity(value)); 1059Debug.Assert(!double.IsNaN(length) && length >= 0 && !double.IsInfinity(length)); 1060Debug.Assert(!double.IsInfinity(baseVector.X)); 1061Debug.Assert(!double.IsInfinity(baseVector.Y)); 1228Debug.Assert(initialState != null); 1229Debug.Assert(initialState.AbsoluteDeceleration >= 0 || double.IsNaN(initialState.AbsoluteDeceleration)); 1230Debug.Assert(initialState.AbsoluteOffset >= 0 || double.IsNaN(initialState.AbsoluteOffset)); 1250Debug.Assert(elapsedTimeSinceInitialTimestamp >= 0); 1262Debug.Assert(Validations.IsFinite((float)result)); 1288Debug.Assert(this.ExtrapolationResult == ExtrapolationResult.Skip); 1292Debug.Assert(!double.IsNaN(this.InitialValue) && !double.IsInfinity(this.InitialValue)); 1293Debug.Assert(!double.IsNaN(this.InitialVelocity) && !double.IsInfinity(this.InitialVelocity)); 1294Debug.Assert(!double.IsNaN(this.Offset)); // can be infinity 1295Debug.Assert(!double.IsNaN(this.AbsoluteDeceleration) && this.AbsoluteDeceleration >= 0 && !double.IsInfinity(this.InitialVelocity)); 1296Debug.Assert(!double.IsNaN(this.Duration) && this.Duration >= 0); // can be infinity 1297Debug.Assert(!double.IsNaN(this.FinalValue)); // can be infinity 1336Debug.Assert(!double.IsNaN(value) && !double.IsInfinity(value)); 1337Debug.Assert(!double.IsNaN(delta) && !double.IsInfinity(delta)); 1338Debug.Assert(!double.IsNaN(total) && !double.IsInfinity(total));
System\Windows\Input\Manipulations\Lazy.cs (1)
31Debug.Assert(getValue != null);
System\Windows\Input\Manipulations\Manipulation2DCompletedEventArgs.cs (4)
37Debug.Assert(Validations.IsFinite(originX), "originX should be finite"); 38Debug.Assert(Validations.IsFinite(originY), "originY should be finite"); 39Debug.Assert(velocities != null, "velocities should not be null"); 40Debug.Assert(total != null, "total should not be null");
System\Windows\Input\Manipulations\Manipulation2DDeltaEventArgs.cs (5)
40Debug.Assert(Validations.IsFinite(originX), "originX should be finite"); 41Debug.Assert(Validations.IsFinite(originY), "originY should be finite"); 42Debug.Assert(velocities != null, "velocities should not be null"); 43Debug.Assert(delta != null, "delta should not be null"); 44Debug.Assert(cumulative != null, "cumulative should not be null");
System\Windows\Input\Manipulations\Manipulation2DStartedEventArgs.cs (2)
41Debug.Assert(Validations.IsFinite(originX)); 42Debug.Assert(Validations.IsFinite(originY));
System\Windows\Input\Manipulations\ManipulationDelta2D.cs (7)
104Debug.Assert(Validations.IsFinite(translationX), "translationX should be finite"); 105Debug.Assert(Validations.IsFinite(translationY), "translationY should be finite"); 106Debug.Assert(Validations.IsFinite(rotation), "rotation should be finite"); 107Debug.Assert(Validations.IsFiniteNonNegative(scaleX), "scaleX should be finite and not negative"); 108Debug.Assert(Validations.IsFiniteNonNegative(scaleY), "scaleY should be finite and not negative"); 109Debug.Assert(Validations.IsFinite(expansionX), "expansionX should be finite"); 110Debug.Assert(Validations.IsFinite(expansionY), "expansionY should be finite");
System\Windows\Input\Manipulations\ManipulationPivot2D.cs (1)
141Debug.Assert(processor != null);
System\Windows\Input\Manipulations\ManipulationProcessor2D.cs (4)
329Debug.Assert(sender != null); 330Debug.Assert(this.currentManipulation == null, "Manipulation was already in progress"); 352Debug.Assert(object.ReferenceEquals(sender, this.currentManipulation)); 366Debug.Assert(object.ReferenceEquals(sender, this.currentManipulation));
System\Windows\Input\Manipulations\ManipulationSequence.cs (24)
275Debug.Assert(!float.IsNaN(result) && !float.IsInfinity(result)); 425Debug.Assert(this.processorState == ProcessorState.Manipulating, "Wrong state."); 507Debug.Assert(Started != null, "Processor hasn't registered for Started event"); 514Debug.Assert(Delta != null, "Processor hasn't registered for Delta event"); 574Debug.Assert(Completed != null, "Processor hasn't registered for Completed event"); 592Debug.Assert(this.log.Length > 0); // makes a good breakpoint to read the log 660Debug.Assert(this.processorState == ProcessorState.Manipulating, "Invalid state."); 751Debug.Assert(!double.IsNaN(value)); 795Debug.Assert(this.manipulatorStates != null); 829Debug.Assert(!float.IsNaN(smoothedRotation) && !float.IsInfinity(smoothedRotation)); 835Debug.Assert(!float.IsNaN(smoothedExpansion) && !float.IsInfinity(smoothedExpansion)); 841Debug.Assert(!float.IsNaN(smoothedScale) && !float.IsInfinity(smoothedScale)); 942Debug.Assert(settings.Pivot != null, "don't call unless we have a settings.Pivot"); 943Debug.Assert(settings.Pivot.HasPosition, "don't call unless there's a settings.Pivot location"); 1010Debug.Assert(this.manipulatorStates != null && this.manipulatorStates.Count > 0); 1031Debug.Assert(this.manipulatorStates != null && this.manipulatorStates.Count > 0); 1070Debug.Assert(queue != null); 1094Debug.Assert(timeDelta >= ManipulationProcessor2D.TimestampTicksPerMillisecond, 1132Debug.Assert(queue != null); 1549Debug.Assert(!float.IsNaN(position.X) && !float.IsNaN(position.Y)); 1550Debug.Assert(!float.IsInfinity(position.Y) && !float.IsInfinity(position.Y)); 1551Debug.Assert(!float.IsNaN(scale) && !float.IsInfinity(scale) && scale > 0); 1552Debug.Assert(!float.IsNaN(expansion) && !float.IsInfinity(expansion)); 1553Debug.Assert(!float.IsNaN(orientation) && !float.IsInfinity(orientation));
System\Windows\Input\Manipulations\ManipulationVelocities2D.cs (8)
85Debug.Assert(Validations.IsFinite(linearVelocityX)); 86Debug.Assert(Validations.IsFinite(linearVelocityY)); 87Debug.Assert(Validations.IsFinite(angularVelocity)); 88Debug.Assert(Validations.IsFinite(expansionVelocity)); 109Debug.Assert(getLinearVelocityX != null, "getLinearVelocityX should not be null"); 110Debug.Assert(getLinearVelocityY != null, "getLinearVelocityX should not be null"); 111Debug.Assert(getAngularVelocity != null, "getLinearVelocityX should not be null"); 112Debug.Assert(getExpansionVelocity != null, "getLinearVelocityX should not be null");
System\Windows\Input\Manipulations\Validations.cs (2)
30Debug.Assert(paramName != null); 54Debug.Assert(paramName != null);
System.Xaml (173)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SafeSecurityHelper.cs (1)
266Debug.Assert(target is not null);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Context\XamlContextStack.cs (5)
26Debug.Assert(CurrentFrame is not null); 27Debug.Assert(CurrentFrame.Depth == Depth); 84Debug.Assert(iteratorFrame is not null); 110Debug.Assert(CurrentFrame.Depth == Depth); 123Debug.Assert(CurrentFrame.Depth == Depth);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Context\XamlFrame.cs (1)
40Debug.Assert(_depth != -1, "Context Frame is uninitialized");
src\Microsoft.DotNet.Wpf\src\Shared\MS\Utility\FrugalList.cs (4)
183Debug.Assert(start >= _previousEnd, "Arguments out of order during Compact"); 184Debug.Assert(_validItemCount + end - start <= _newCount, "Too many items copied during Compact"); 1295Debug.Assert(collection is not null); 1303Debug.Assert(collection is not null);
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (3)
128Debug.Assert(type is not null, "Type passed to IsInternalType is null"); 149Debug.Assert(type is not null, "Type passed to IsPublicType is null"); 443Debug.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)
110Debug.Assert(type is not null, "Null passed for type to GetConverterType");
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlCompatibilityReader.cs (1)
340Debug.Assert(Scope.ShouldProcessContent(namespaceName, Reader.LocalName));
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlWrappingReader.cs (1)
34Debug.Assert( baseReader is not null);
System\Xaml\Context\ContextServices.cs (1)
17Debug.Assert(xamlContext.ParentProperty is not null);
System\Xaml\Context\NameFixupGraph.cs (8)
56Debug.Assert(fixupToken.Target.Instance is null && 59Debug.Assert(_deferredRootProvideValue is null); 69Debug.Assert(parentObject is not null); 75Debug.Assert(fixupToken.FixupType == FixupType.UnresolvedChildren || 79Debug.Assert(!_dependenciesByChildObject.ContainsKey(fixupToken.ReferencedObject)); 85Debug.Assert(fixupToken.FixupType != FixupType.UnresolvedChildren && 451Debug.Assert(outEdge.FixupType == FixupType.UnresolvedChildren); 465Debug.Assert(parentDependencies.Contains(token));
System\Xaml\Context\NameFixupToken.cs (1)
130Debug.Assert(_runtime is null);
System\Xaml\Context\ObjectWriterContext.cs (7)
70Debug.Assert(rootNameScope is null, "Cannot pass a new namescope in to a reparse context"); 132Debug.Assert(!_nameResolutionComplete || value); 420Debug.Assert(frame is not null); 461Debug.Assert(frame is not null); 828Debug.Assert(frame.NameScopeDictionary is not null || frame.Depth == 0); 842Debug.Assert(nameScopeDictionary is not null); 878Debug.Assert(rootFrame.Depth == 1);
System\Xaml\Context\XamlContext.cs (3)
266Debug.Assert(typeName is not null, "typeName cannot be null and should have been checked before now"); 267Debug.Assert(typeName.Name is not null, "typeName.Name cannot be null and should have been checked before now"); 268Debug.Assert(typeName.Namespace is not null);
System\Xaml\InfosetObjects\DeferredWriter.cs (2)
148Debug.Assert(!property.IsDirective && !property.IsUnknown); 200Debug.Assert(_deferredTreeDepth == 0);
System\Xaml\InfosetObjects\XamlNodes.cs (5)
65Debug.Assert(data is XamlType, "XamlNode ctor, StartObject data is not a XamlType"); 69Debug.Assert(data is XamlMember, "XamlNode ctor, StartMember data is not a XamlMember"); 73Debug.Assert(data is NamespaceDeclaration, "XamlNode ctor, NamespaceDeclaration data is not a NamespaceDeclaration"); 83Debug.Assert(data is null, "XamlNode ctor, Internal XamlNode data must be null for this Node type"); 98Debug.Assert(internalNodeType == InternalNodeType.EndOfAttributes ||
System\Xaml\InfosetObjects\XamlObjectWriter.cs (21)
148Debug.Assert(_context.SourceBamlUri is null || _context.BaseUri is null || _context.SourceBamlUri == _context.BaseUri, 400Debug.Assert(_context.CurrentProperty.DeferringLoader is not null); 432Debug.Assert(_context.LiveDepth > 0); 510Debug.Assert(_context.LiveDepth > 1); 616Debug.Assert(_context.LiveDepth > 0); 831Debug.Assert(_context.CurrentProperty.DeferringLoader is not null); 1196Debug.Assert(inst is not null); // runtime throws before it returns null. 1429Debug.Assert(ctx.ParentProperty == XamlLanguage.Key); 1643Debug.Assert(inst == ctx.ParentInstance); 1731Debug.Assert(parentInstance is not null || (parentProperty is not null && parentProperty.IsDirective) || ctx.LiveDepth == 1); 1777Debug.Assert(ctx.LiveDepth > 1); 1852Debug.Assert(ctx.ParentType.IsCollection, "Logic_WillParentCollectionAdd called on a non-collection"); 1915Debug.Assert(ctx.CurrentProperty is null); 2134Debug.Assert(token.Target.Property == XamlLanguage.Key); 2396Debug.Assert(!_inNameResolution); 2399Debug.Assert(_nameFixupGraph is not null); 2489Debug.Assert(token.NeededNames.Count == 0 || nameResolutionIsComplete); 2586Debug.Assert(token.FixupType == FixupType.MarkupExtensionFirstRun && _lastInstance == token.ReferencedObject); 2613Debug.Assert(token.Target.KeyHolder.Key == token); 2623Debug.Assert(pendingAdd.Key == token); 2633Debug.Assert(pendingAdd.Item == token);
System\Xaml\InfosetObjects\XamlXmlReader.cs (1)
263Debug.Assert(_current.IsEof, "Xaml Parser returned an illegal internal XamlNode");
System\Xaml\MS\Impl\XmlNsInfo.cs (1)
130Debug.Assert(Assembly is not null, "RefOnly assemblies shouldn't be GCed");
System\Xaml\Parser\GenericTypeNameParser.cs (4)
166Debug.Assert(_scanner.Token == GenericTypeNameScannerToken.NAME); 197Debug.Assert(_scanner.Token == GenericTypeNameScannerToken.OPEN); 229Debug.Assert(_scanner.Token == GenericTypeNameScannerToken.COMMA); 240Debug.Assert(_scanner.Token == GenericTypeNameScannerToken.SUBSCRIPT);
System\Xaml\Parser\GenericTypeNameScanner.cs (3)
310Debug.Assert(_multiCharTokenStartIdx == -1 && _multiCharTokenLength == 0); 318Debug.Assert(_multiCharTokenStartIdx != -1 && _multiCharTokenLength > 0); 372Debug.Assert(KnownStrings.WhitespaceChars.Length == 5);
System\Xaml\Parser\MeScanner.cs (1)
563Debug.Assert(KnownStrings.WhitespaceChars.Length == 5);
System\Xaml\Parser\NodeStreamSorter.cs (5)
576Debug.Assert(deepestIdx != -1); 584Debug.Assert(_sortingInfoArray[start].XamlNodeType == XamlNodeType.StartMember); 610Debug.Assert(_sortingInfoArray[current].XamlNodeType == XamlNodeType.StartMember); 632Debug.Assert(_sortingInfoArray[current].XamlNodeType == XamlNodeType.StartMember); 684Debug.Assert(length1 > 0 && length2 > 0);
System\Xaml\Parser\XamlScanner.cs (5)
246Debug.Assert(_xmlReader.NodeType == XmlNodeType.Element); 283Debug.Assert(_xmlReader.NodeType == XmlNodeType.Element); 428Debug.Assert(_xmlReader.NodeType == XmlNodeType.Element); 787Debug.Assert(prop.IsUnknown); 844Debug.Assert(_accumulatedText is not null, "Creating unnecessary XamlText objects");
System\Xaml\Parser\XamlScannerStack.cs (2)
74Debug.Assert(_stack.Count != 0); 84Debug.Assert(_stack.Count != 0);
System\Xaml\Parser\XamlText.cs (2)
270Debug.Assert(start > 0); 271Debug.Assert(end < text.Length);
System\Xaml\Runtime\DynamicMethodRuntime.cs (2)
132Debug.Assert(schemaContext is not null); 133Debug.Assert(accessLevel is not null);
System\Xaml\Schema\Reflector.cs (4)
273Debug.Assert(attributeType == typeof(XamlDeferLoadAttribute)); 274Debug.Assert(count == 2); 378Debug.Assert((flagMask & 0xFFFF) == flagMask, "flagMask should only use lower 16 bits of int"); 387Debug.Assert(value || (bitMask & bitToSet) == 0);
System\Xaml\Schema\TypeReflector.cs (13)
314Debug.Assert(_positionalParameterTypes is not null, "TryGetPositionalParameters should have been called first"); 357Debug.Assert(!IsUnknown); 441Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null"); 453Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null"); 467Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null"); 468Debug.Assert(_nonAttachableMemberCache is not null, "Members property should have been invoked before this"); 480Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null"); 481Debug.Assert(_nonAttachableMemberCache is not null, "Members property should have been invoked before this"); 708Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null"); 725Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null"); 986Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null"); 987Debug.Assert(_attachableMemberCache is not null, "AttachableMembers property should have been invoked before this"); 1147Debug.Assert(value);
System\Xaml\Schema\XamlDirective.cs (2)
22Debug.Assert(immutableXamlNamespaces is not null); 25Debug.Assert(ns is not null);
System\Xaml\Schema\XamlNamespace.cs (4)
99Debug.Assert(typeArgs.Length > 0, "This method should only be called for generic types."); 159Debug.Assert(typeArgs[n] is not null); 160Debug.Assert(typeArgs[n].UnderlyingType is not null); 180Debug.Assert(_assemblyNamespaces.Length == 1);
System\Xaml\XamlBackgroundReader.cs (1)
157Debug.Assert(XamlNode.IsEof_Helper(nodeType, data));
System\Xaml\XamlMember.cs (3)
350Debug.Assert(_declaringType is not null, "XamlDirective should not call base.ToString"); 1045Debug.Assert(DeclaringType is not null, "XamlDirective should not call into base.GetHashCode"); 1073Debug.Assert(xamlMember2.IsDirective);
System\Xaml\XamlNodeList.cs (1)
78Debug.Assert(XamlNode.IsEof_Helper(nodeType, data));
System\Xaml\XamlNodeQueue.cs (1)
69Debug.Assert(XamlNode.IsEof_Helper(nodeType, data));
System\Xaml\XamlObjectReader.cs (2)
295Debug.Assert(false); // should never reach here 1770Debug.Assert(Object is not null);
System\Xaml\XamlType.cs (25)
201Debug.Assert(_reflector is not null, "_reflector should have been initialized by IsDictionary"); 220Debug.Assert(_reflector is not null, "_reflector should have been initialized by GetCollectionKind"); 241Debug.Assert(_reflector is not null, "_reflector should have been initialized by GetCollectionKind"); 261Debug.Assert(_reflector is not null, "_reflector should have been initialized by IsCollection"); 337Debug.Assert(_reflector is not null, "_reflector should have been initialized by IsMarkupExtension"); 523Debug.Assert(_reflector is not null, "_reflector should have been initialized by ItemType"); 597Debug.Assert(_reflector is not null, "_reflector should have been initialized by GetCollectionKind"); 824Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 861Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 955Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 969Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1030Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1208Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1222Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1233Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1267Debug.Assert(typeArgs.Length == 1); 1280Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1309Debug.Assert(typeArgs.Length == 1); 1324Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1343Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1423Debug.Assert(UnderlyingTypeInternal.IsSet, "EnsureReflector should have caused UnderlyingType to be initialized"); 1673Debug.Assert(GetType() != typeof(XamlType), "Default GetAllMembers logic should have already captured all writeable properties"); 1811Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1930Debug.Assert(xamlType1.IsUnknown); 1931Debug.Assert(xamlType2.IsUnknown);
System\Xaml\XamlXmlWriter.cs (26)
345Debug.Assert(writer.namespaceScopes.Peek().AllocatingNodeType == XamlNodeType.StartMember); 386Debug.Assert(ns is not null); 387Debug.Assert(prefix is not null); 506Debug.Assert(objectFrame.AllocatingNodeType == XamlNodeType.StartObject || 529Debug.Assert(frame.AllocatingNodeType == nodeType); 813Debug.Assert(writer.namespaceScopes.Count > 1); 816Debug.Assert(frame.AllocatingNodeType == XamlNodeType.StartMember); 831Debug.Assert(writer.namespaceScopes.Count > 1); 834Debug.Assert(frame.AllocatingNodeType == XamlNodeType.StartMember); 954Debug.Assert(writer.namespaceScopes.Count == 1); 1000Debug.Assert(writer.namespaceScopes.Count > 0); 1087Debug.Assert(writer.namespaceScopes.Count > 0); 1159Debug.Assert(writer.namespaceScopes.Count > 0); 1160Debug.Assert(writer.namespaceScopes.Peek().AllocatingNodeType == XamlNodeType.StartObject || 1236Debug.Assert(writer.namespaceScopes.Count > 0); 1371Debug.Assert(writer.namespaceScopes.Count > 0); 1435Debug.Assert(writer.namespaceScopes.Count > 0); 1437Debug.Assert(memberFrame.AllocatingNodeType == XamlNodeType.StartMember || 1568Debug.Assert(writer.namespaceScopes.Count > 0); 1570Debug.Assert(memberFrame.AllocatingNodeType == XamlNodeType.StartMember || 1759Debug.Assert(value is not null); 1903Debug.Assert(frame.AllocatingNodeType == XamlNodeType.StartObject); 1906Debug.Assert(objectXamlType is not null); 1947Debug.Assert(member is not null); 2076Debug.Assert(writer.ppStateInfo.CurrentDepth != 0); 2077Debug.Assert(writer.ppStateInfo.NodesList.Count != 0);
Templates.Blazor.Tests (3)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
655Debug.Assert(pemEnvelope != null);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
90Debug.Assert(oldTrustLevel == TrustLevel.Full); // Mac trust is all or nothing
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
334Debug.Assert(IsCommandAvailable(OpenSslCommand), "How did we trust without the openssl command?");
Templates.Blazor.WebAssembly.Auth.Tests (3)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
655Debug.Assert(pemEnvelope != null);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
90Debug.Assert(oldTrustLevel == TrustLevel.Full); // Mac trust is all or nothing
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
334Debug.Assert(IsCommandAvailable(OpenSslCommand), "How did we trust without the openssl command?");
Templates.Blazor.WebAssembly.Tests (3)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
655Debug.Assert(pemEnvelope != null);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
90Debug.Assert(oldTrustLevel == TrustLevel.Full); // Mac trust is all or nothing
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
334Debug.Assert(IsCommandAvailable(OpenSslCommand), "How did we trust without the openssl command?");
Templates.Mvc.Tests (3)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
655Debug.Assert(pemEnvelope != null);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
90Debug.Assert(oldTrustLevel == TrustLevel.Full); // Mac trust is all or nothing
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
334Debug.Assert(IsCommandAvailable(OpenSslCommand), "How did we trust without the openssl command?");
Templates.Tests (3)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
655Debug.Assert(pemEnvelope != null);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
90Debug.Assert(oldTrustLevel == TrustLevel.Full); // Mac trust is all or nothing
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
334Debug.Assert(IsCommandAvailable(OpenSslCommand), "How did we trust without the openssl command?");
Test.Utilities (520)
src\Compilers\Core\Portable\Collections\BitVector.cs (3)
34Debug.Assert(requiredWords == 0 || requiredWords <= bits.Length); 92Debug.Assert(_capacity == 0 || WordsForCapacity(_capacity) <= _bits.Length); 190Debug.Assert(numTrailingBits <= BitsPerWord);
src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (13)
69Debug.Assert(instance.IsEmpty); 100Debug.Assert(valueSet.Count >= 1); 116Debug.Assert(valueSet.Count >= 1); 149Debug.Assert(valueSet.Count >= 1); 161Debug.Assert(valueSet.Count >= 1); 211Debug.Assert(this.Count >= 1); 234Debug.Assert(this.Count >= 1); 263Debug.Assert(this.Count >= 1); 274Debug.Assert(this.Count >= 1); 280Debug.Assert(_value is V, "Item must be a a V"); 309Debug.Assert(this.Count >= 1); 315Debug.Assert(_value is V, "_value must be a V"); 343Debug.Assert(_count >= 1);
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (15)
49Debug.Assert(baseDirectory == null || searchPaths != null || PathUtilities.IsAbsolute(baseDirectory)); 62Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 73Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 86Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 103Debug.Assert(baseDirectory == null || PathUtilities.IsAbsolute(baseDirectory)); 109Debug.Assert(PathUtilities.GetPathKind(path) == kind); 174Debug.Assert(PathUtilities.IsDirectorySeparator(path![0])); 175Debug.Assert(path.Length == 1 || !PathUtilities.IsDirectorySeparator(path[1])); 200Debug.Assert(PathUtilities.IsAbsolute(resolvedBasePath)); 250Debug.Assert(PathUtilities.IsAbsolute(path)); 294Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 312Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 396Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 414Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 437Debug.Assert(PathUtilities.IsAbsolute(fullPath));
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (3)
385Debug.Assert(!IsUnixLikePlatform); 403Debug.Assert(IsAbsolute(root)); 855Debug.Assert(parts[toSkip - 1] == string.Empty);
src\Compilers\Core\Portable\FileSystem\RelativePathResolver.cs (4)
29Debug.Assert(searchPaths.All(PathUtilities.IsAbsolute)); 30Debug.Assert(baseDirectory == null || PathUtilities.GetPathKind(baseDirectory) == PathKind.Absolute); 49Debug.Assert(fullPath != null); 50Debug.Assert(PathUtilities.IsAbsolute(fullPath));
src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (1)
329Debug.Assert(destination.Length == HashLengthInBytes);
src\Compilers\Core\Portable\Hashing\XxHash128.cs (6)
259Debug.Assert(length >= 1 && length <= 3); 284Debug.Assert(length >= 4 && length <= 8); 310Debug.Assert(length >= 9 && length <= 16); 336Debug.Assert(length >= 17 && length <= 128); 362Debug.Assert(length >= 129 && length <= 240); 395Debug.Assert(length > 240);
src\Compilers\Core\Portable\Hashing\XxHashShared.cs (45)
122Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 125Debug.Assert(InternalBufferLengthBytes % StripeLengthBytes == 0); 128Debug.Assert(ReadLE64(defaultSecretUInt64[0]) == DefaultSecretUInt64_0); 129Debug.Assert(ReadLE64(defaultSecretUInt64[1]) == DefaultSecretUInt64_1); 130Debug.Assert(ReadLE64(defaultSecretUInt64[2]) == DefaultSecretUInt64_2); 131Debug.Assert(ReadLE64(defaultSecretUInt64[3]) == DefaultSecretUInt64_3); 132Debug.Assert(ReadLE64(defaultSecretUInt64[4]) == DefaultSecretUInt64_4); 133Debug.Assert(ReadLE64(defaultSecretUInt64[5]) == DefaultSecretUInt64_5); 134Debug.Assert(ReadLE64(defaultSecretUInt64[6]) == DefaultSecretUInt64_6); 135Debug.Assert(ReadLE64(defaultSecretUInt64[7]) == DefaultSecretUInt64_7); 136Debug.Assert(ReadLE64(defaultSecretUInt64[8]) == DefaultSecretUInt64_8); 137Debug.Assert(ReadLE64(defaultSecretUInt64[9]) == DefaultSecretUInt64_9); 138Debug.Assert(ReadLE64(defaultSecretUInt64[10]) == DefaultSecretUInt64_10); 139Debug.Assert(ReadLE64(defaultSecretUInt64[11]) == DefaultSecretUInt64_11); 140Debug.Assert(ReadLE64(defaultSecretUInt64[12]) == DefaultSecretUInt64_12); 141Debug.Assert(ReadLE64(defaultSecretUInt64[13]) == DefaultSecretUInt64_13); 142Debug.Assert(ReadLE64(defaultSecretUInt64[14]) == DefaultSecretUInt64_14); 143Debug.Assert(ReadLE64(defaultSecretUInt64[15]) == DefaultSecretUInt64_15); 146Debug.Assert(ReadLE64(defaultSecret3UInt64[0]) == DefaultSecret3UInt64_0); 147Debug.Assert(ReadLE64(defaultSecret3UInt64[1]) == DefaultSecret3UInt64_1); 148Debug.Assert(ReadLE64(defaultSecret3UInt64[2]) == DefaultSecret3UInt64_2); 149Debug.Assert(ReadLE64(defaultSecret3UInt64[3]) == DefaultSecret3UInt64_3); 150Debug.Assert(ReadLE64(defaultSecret3UInt64[4]) == DefaultSecret3UInt64_4); 151Debug.Assert(ReadLE64(defaultSecret3UInt64[5]) == DefaultSecret3UInt64_5); 152Debug.Assert(ReadLE64(defaultSecret3UInt64[6]) == DefaultSecret3UInt64_6); 153Debug.Assert(ReadLE64(defaultSecret3UInt64[7]) == DefaultSecret3UInt64_7); 154Debug.Assert(ReadLE64(defaultSecret3UInt64[8]) == DefaultSecret3UInt64_8); 155Debug.Assert(ReadLE64(defaultSecret3UInt64[9]) == DefaultSecret3UInt64_9); 156Debug.Assert(ReadLE64(defaultSecret3UInt64[10]) == DefaultSecret3UInt64_10); 157Debug.Assert(ReadLE64(defaultSecret3UInt64[11]) == DefaultSecret3UInt64_11); 158Debug.Assert(ReadLE64(defaultSecret3UInt64[12]) == DefaultSecret3UInt64_12); 159Debug.Assert(ReadLE64(defaultSecret3UInt64[13]) == DefaultSecret3UInt64_13); 213Debug.Assert(length > 240); 229Debug.Assert(stripes <= stripesPerBlock); // can handle max 1 scramble per invocation 230Debug.Assert(stripesSoFar < stripesPerBlock); 251Debug.Assert(state.BufferedCount <= InternalBufferLengthBytes); 281Debug.Assert(sourceIndex < source.Length); 287Debug.Assert(NumStripesPerBlock >= state.StripesProcessedInCurrentBlock); 291Debug.Assert(stripesToEnd <= stripes); 310Debug.Assert(sourceIndex < source.Length); // at least some bytes left 332Debug.Assert(sourceIndex < source.Length); 333Debug.Assert(remaining.Length <= InternalBufferLengthBytes); 334Debug.Assert(state.BufferedCount == 0); 371Debug.Assert(state.BufferedCount > 0); 787Debug.Assert(shift >= 0 && shift < 64);
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (2)
16Debug.Assert(start >= 0); 17Debug.Assert(start <= array.Length);
src\Compilers\Core\Portable\InternalUtilities\BitArithmeticUtilities.cs (3)
53Debug.Assert(CountBits(alignment) == 1); 66Debug.Assert(position >= 0 && alignment > 0); 67Debug.Assert(CountBits(alignment) == 1);
src\Compilers\Core\Portable\InternalUtilities\ConsList`1.cs (4)
38Debug.Assert(_tail != null); 89Debug.Assert(tail != null); 100Debug.Assert(this != Empty); 110Debug.Assert(this != Empty);
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (5)
17public static void Assert([DoesNotReturnIf(false)] bool condition) => Debug.Assert(condition); 19/// <inheritdoc cref="Debug.Assert(bool, string)"/> 22=> Debug.Assert(condition, message); 24/// <inheritdoc cref="Debug.Assert(bool, string)"/> 72Debug.Assert(false, message);
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (2)
140Debug.Assert((object?)initializedValue != uninitializedValue); 156Debug.Assert(!initializedValue.IsDefault);
src\Compilers\Core\Portable\InternalUtilities\MultiDictionary.cs (3)
49Debug.Assert(_count > 1); 52Debug.Assert(_count == v.Count); 154Debug.Assert(_value != null);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (2)
131Debug.Assert(e.InnerException is object); 133Debug.Assert(false, "Unreachable");
src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (1)
35Debug.Assert(count > 0);
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
32Debug.Assert(number >= 0);
src\Compilers\Core\Portable\SpecialTypeExtensions.cs (1)
373Debug.Assert(value.GetType().IsPrimitive);
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
85Debug.Assert(false, message);
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (1)
232Debug.Assert(newChange.SpanStart == oldChange.Span.Start + oldDelta);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
648Debug.Assert(data.All(d => d.Count() == count));
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (16)
83Debug.Assert(items != null); 484Debug.Assert(self.Length == other.Length); 515Debug.Assert(self.Length == other.Length); 548Debug.Assert(!array.IsDefault); 549Debug.Assert(predicateWithArg != null ^ predicateWithoutArg != null); 568Debug.Assert(i > 0); 584Debug.Assert(i > 0); 587Debug.Assert(builder == null); 600Debug.Assert(!all); 601Debug.Assert(!none); 610Debug.Assert(none); 900Debug.Assert(builder.Count > 1); 944Debug.Assert(members.Length > 0); 959Debug.Assert(count < members.Length); 971Debug.Assert(builder.Count == count); 1279Debug.Assert(!array.IsDefault);
src\Dependencies\Collections\Internal\ArraySortHelper.cs (44)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 112Debug.Assert(i != j); 125Debug.Assert(i != j); 134Debug.Assert(comparer != null); 147Debug.Assert(keys.Length > 0); 148Debug.Assert(depthLimit >= 0); 149Debug.Assert(comparer != null); 192Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 193Debug.Assert(comparer != null); 237Debug.Assert(comparer != null); 238Debug.Assert(keys.Length > 0); 255Debug.Assert(comparer != null); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 415Debug.Assert(!Unsafe.AreSame(ref i, ref j)); 427Debug.Assert(keys.Length > 0); 428Debug.Assert(depthLimit >= 0); 474Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 537Debug.Assert(keys.Length > 0); 693Debug.Assert(comparer != null); 694Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 695Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 696Debug.Assert(i != j); 713Debug.Assert(i != j); 726Debug.Assert(comparer != null); 727Debug.Assert(keys.Length == values.Length); 737Debug.Assert(keys.Length > 0); 738Debug.Assert(values.Length == keys.Length); 739Debug.Assert(depthLimit >= 0); 740Debug.Assert(comparer != null); 783Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 784Debug.Assert(comparer != null); 828Debug.Assert(comparer != null); 829Debug.Assert(keys.Length > 0); 846Debug.Assert(comparer != null); 873Debug.Assert(comparer != null); 946Debug.Assert(i != j); 964Debug.Assert(i != j); 977Debug.Assert(keys.Length > 0); 978Debug.Assert(values.Length == keys.Length); 979Debug.Assert(depthLimit >= 0); 1022Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 1081Debug.Assert(keys.Length > 0); 1235Debug.Assert(typeof(TKey) == typeof(double) || typeof(TKey) == typeof(float));
src\Dependencies\Collections\Internal\BitHelper.cs (2)
34Debug.Assert(bitPosition >= 0); 48Debug.Assert(bitPosition >= 0);
src\Dependencies\Collections\Internal\HashHelpers.cs (3)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 113Debug.Assert(divisor <= int.MaxValue); 119Debug.Assert(highbits == value % divisor);
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\Dependencies\Collections\OneOrMany.cs (1)
200Debug.Assert(HasOneItem == other.HasOneItem);
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
24Debug.Assert(dictionary is not null);
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
24Debug.Assert(dictionary is not null);
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
120Debug.Assert(other is not ValueBuilder);
src\Dependencies\Collections\Segmented\SegmentedArray.cs (6)
114Debug.Assert(length > 0); 115Debug.Assert(sourceIndex >= 0); 116Debug.Assert(destinationIndex >= 0); 117Debug.Assert((uint)(sourceIndex + length) <= array.Length); 118Debug.Assert((uint)(destinationIndex + length) <= array.Length); 491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (21)
168Debug.Assert(_entries.Length >= source.Count); 169Debug.Assert(_count == 0); 260Debug.Assert(modified); 267Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 447Debug.Assert(comparer is not null); 518Debug.Assert(_buckets.Length > 0); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 524Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType)); 574Debug.Assert(comparer is not null); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 649Debug.Assert(newSize >= _entries.Length); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 711Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 788Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (16)
189Debug.Assert(Count == source.Count); 204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 258Debug.Assert(comparer is not null); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 302Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 902Debug.Assert(newSize >= _entries.Length); 1023Debug.Assert(_buckets.Length > 0); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1063Debug.Assert(comparer is not null); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (2)
270Debug.Assert(_size == _items.Length); 520Debug.Assert(_items.Length < capacity);
src\Dependencies\Collections\TemporaryArray`1.cs (2)
173Debug.Assert(_count == InlineCapacity); 336Debug.Assert(_builder is null);
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\Dependencies\PooledObjects\ArrayBuilder.cs (8)
493Debug.Assert(builder.Count == 0); 609Debug.Assert(start >= 0 && length >= 0); 610Debug.Assert(start + length <= items.Count); 629Debug.Assert(start >= 0 && length >= 0); 630Debug.Assert(start + length <= items.Length); 644Debug.Assert(start >= 0 && length >= 0); 645Debug.Assert(start + length <= items.Length); 669Debug.Assert(limit <= Count);
src\Dependencies\PooledObjects\ObjectPool`1.cs (5)
118Debug.Assert(size >= 1); 126Debug.Assert(size >= 1); 277Debug.Assert(obj != null, "freeing null?"); 279Debug.Assert(_firstItem != obj, "freeing twice?"); 290Debug.Assert(value != obj, "freeing twice?");
src\Dependencies\PooledObjects\PooledDictionary.cs (1)
58Debug.Assert(instance.Count == 0);
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
47Debug.Assert(instance.Count == 0);
src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
30Debug.Assert(pool != null); 95Debug.Assert(builder.Builder.Length == 0);
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (1)
240Debug.Assert(_entireQueueCancellationToken.IsCancellationRequested);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (2)
505Debug.Assert(SymbolEqualityComparer.Default.Equals(method.ContainingType.OriginalDefinition, systemThreadingInterlocked)); 517Debug.Assert(SymbolEqualityComparer.Default.Equals(method.ContainingType.OriginalDefinition, systemThreadingInterlocked));
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (6)
211Debug.Assert(isInsideAnonymousObjectInitializer == 289Debug.Assert(success); 290Debug.Assert(cfg != null); 334Debug.Assert(operation is IAnonymousFunctionOperation anonymousFunction && anonymousFunction.Symbol.OriginalDefinition.ReturnTypeAndParametersAreSame(lambdaOrLocalFunction.OriginalDefinition) || 507Debug.Assert(parameterIndex >= 0); 508Debug.Assert(parameterIndex < arguments.Length);
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (1)
48Debug.Assert(ReferenceEquals(this, Empty) || !_perTreeOptions.IsEmpty);
src\RoslynAnalyzers\Utilities\Compiler\Options\MSBuildItemOptionNames.cs (1)
42Debug.Assert(typeof(MSBuildItemOptionNames).GetFields().Single(f => f.Name == itemOptionName) != null);
src\RoslynAnalyzers\Utilities\Compiler\Options\MSBuildPropertyOptionNames.cs (1)
36Debug.Assert(typeof(MSBuildPropertyOptionNames).GetFields().Single(f => f.Name == propertyOptionName) != null);
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (3)
66Debug.Assert(!names.IsEmpty || !symbols.IsEmpty || !wildcardNamesBySymbolKind.IsEmpty); 144Debug.Assert(parts.SymbolName[^1] == WildcardChar); 145Debug.Assert(parts.SymbolName.Length >= 2);
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (2)
72Debug.Assert(instance.IsEmpty); 82Debug.Assert(added);
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (1)
47Debug.Assert(instance.Count == 0);
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (1)
69Debug.Assert(instance.Count == 0);
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
102Debug.Assert(rulesetNode.Name == RuleSetNodeName); 131Debug.Assert(rulesetNode.Name == RuleSetNodeName);
src\RoslynAnalyzers\Utilities\Compiler\SmallDictionary.cs (2)
428Debug.Assert(unbalanced != currentNode); 434Debug.Assert(n.HashCode != hashCode);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleHelpers.cs (1)
185Debug.Assert(s_unusedExpressionAssignmentPreferenceMap.ContainsValue(option.Value));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOptions2.cs (7)
193Debug.Assert(s_unusedParametersPreferenceMap.ContainsValue(option.Value)); 215Debug.Assert(s_accessibilityModifiersRequiredMap.ContainsKey(value)); 223Debug.Assert(s_accessibilityModifiersRequiredMap.ContainsValue(option.Value)); 261Debug.Assert(s_parenthesesPreferenceMap.ContainsKey(value)); 269Debug.Assert(s_parenthesesPreferenceMap.ContainsValue(option.Value)); 313Debug.Assert(s_forEachExplicitCastInSourcePreferencePreferenceMap.ContainsKey(value)); 322Debug.Assert(s_forEachExplicitCastInSourcePreferencePreferenceMap.ContainsValue(option.Value));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\ImmutableIntervalTree`1.cs (1)
79Debug.Assert(values.IsSorted(Comparer<T>.Create((t1, t2) => localIntrospector.GetSpan(t1).Start - localIntrospector.GetSpan(t2).Start)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\MutableIntervalTree`1.cs (2)
102Debug.Assert(rightBalance == 1); 115Debug.Assert(leftBalance == -1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (2)
295Debug.Assert(lastEnd < span1.End); 306Debug.Assert(lastEnd < span2.Start);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (4)
74Debug.Assert(!string.IsNullOrEmpty(sectionName)); 91Debug.Assert(!string.IsNullOrEmpty(key)); 92Debug.Assert(key == key.Trim()); 93Debug.Assert(value == value.Trim());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (1)
313Debug.Assert(match.Groups.Count - 1 == _numberRangePairs.Length);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSeparatedSyntaxNodeList.cs (4)
45Debug.Assert(NodesAndTokens[i].IsNode); 46Debug.Assert(NodesAndTokens[i].Node is EmbeddedSyntaxNode<TSyntaxKind, TSyntaxNode>); 51Debug.Assert(!NodesAndTokens[i].IsNode); 68Debug.Assert(nodeOrToken.IsNode);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNode.cs (1)
46Debug.Assert((int)(object)kind != 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNodeOrToken.cs (2)
26Debug.Assert((int)(object)token.Kind != 0); 34Debug.Assert(Node == null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxToken.cs (4)
36Debug.Assert(!leadingTrivia.IsDefault); 37Debug.Assert(!virtualChars.IsDefault); 38Debug.Assert(!trailingTrivia.IsDefault); 39Debug.Assert(!diagnostics.IsDefault);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxTrivia.cs (1)
28Debug.Assert(virtualChars.Length > 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (13)
79Debug.Assert(expectedValueText == actualValueText); 85Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 89Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 98Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 107Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 117Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 121Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 135Debug.Assert(!token.ContainsDiagnostics); 139Debug.Assert(startDelimiter == ""); 140Debug.Assert(endDelimiter == ""); 147Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 153Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 219Debug.Assert(char.IsSurrogate(ch));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.Chunks.cs (1)
104Debug.Assert(index + 1 >= data.Length ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (3)
196Debug.Assert(_leafCharacters == virtualChars._leafCharacters); 197Debug.Assert(_span.End == virtualChars._span.Start); 208Debug.Assert(chars1._leafCharacters == chars2._leafCharacters);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ControlFlowGraphExtensions.cs (2)
16Debug.Assert(firstBlock.Kind == BasicBlockKind.Entry); 23Debug.Assert(lastBlock.Kind == BasicBlockKind.Exit);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (2)
25Debug.Assert(descriptor.CustomTags is ImmutableArray<string>); 51Debug.Assert(reportDiagnostic != ReportDiagnostic.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (1)
43Debug.Assert(loc1.IsInSource && loc2.IsInSource);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
153Debug.Assert(parenthesizedOperation.Language == LanguageNames.VisualBasic);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (3)
79Debug.Assert(tabSize > 0); 80Debug.Assert(endPosition >= 0 && endPosition <= textSnippet.Length); 254Debug.Assert(builder.KeyComparer == StringComparer.Ordinal || builder.KeyComparer == StringComparer.OrdinalIgnoreCase);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolUsageInfo.cs (1)
31Debug.Assert(valueUsageInfoOpt.HasValue ^ typeOrNamespaceUsageInfoOpt.HasValue);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (18)
59Debug.Assert(unreachableBlocksToVisit.Count == 0); 215Debug.Assert(branch.Destination == null); 220Debug.Assert(branch.Destination == null); 226Debug.Assert(branch.Destination != null); 257Debug.Assert(region.Kind != ControlFlowRegionKind.Root); 261Debug.Assert(enclosing.NestedRegions[0] == region); 262Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 279Debug.Assert(@finally.Kind == ControlFlowRegionKind.Finally); 324Debug.Assert(enclosing.NestedRegions[0] == fromRegion); 325Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 336Debug.Assert(enclosing.NestedRegions[0] == fromRegion); 347Debug.Assert(enclosing.Kind == ControlFlowRegionKind.FilterAndHandler); 349Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 373Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 374Debug.Assert(startAt > 0); 375Debug.Assert(startAt <= tryAndCatch.NestedRegions.Length); 389Debug.Assert(@catch.NestedRegions[0].Kind == ControlFlowRegionKind.Filter); 390Debug.Assert(entryBlock.Ordinal == @catch.NestedRegions[0].FirstBlockOrdinal);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (1)
76Debug.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");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (2)
93Debug.Assert(localFunction.IsLocalFunction()); 245Debug.Assert(newBlockAnalysisData != null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.cs (1)
57Debug.Assert(localFunctionOrLambda.IsLocalFunction() || localFunctionOrLambda.IsAnonymousFunction());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (13)
101Debug.Assert(LValueFlowCapturesInGraph.Values.All(kind => kind is FlowCaptureKind.LValueCapture or FlowCaptureKind.LValueAndRValueCapture)); 121Debug.Assert(cfg.Parent == null); 144Debug.Assert(cfg.Parent != null); 145Debug.Assert(lambdaOrLocalFunction.IsAnonymousFunction() || lambdaOrLocalFunction.IsLocalFunction()); 146Debug.Assert(parentAnalysisData != null); 303Debug.Assert(lambdaOrLocalFunctionCfg != null); 313Debug.Assert(anonymousFunctionCfg != null); 322Debug.Assert(localFunction.IsLocalFunction()); 330Debug.Assert(localFunctionCfg != null); 346Debug.Assert(_analysisDataByBasicBlockMap[basicBlock] != null); 487Debug.Assert(localFunction.IsLocalFunction()); 488Debug.Assert(localFunction.Equals(localFunction.OriginalDefinition)); 578Debug.Assert(localFunctionTarget.Method.IsLocalFunction());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (11)
53Debug.Assert(_currentContainingSymbol == null); 54Debug.Assert(_currentAnalysisData == null); 55Debug.Assert(_currentRootOperation == null); 56Debug.Assert(_pendingWritesMap == null); 109Debug.Assert(symbol != null); 161Debug.Assert(symbolOpt != null || operation.Kind == OperationKind.FlowCaptureReference); 197Debug.Assert(symbolOpt != null); 207Debug.Assert(symbolOpt == null); 210Debug.Assert(_currentAnalysisData.IsLValueFlowCapture(captureReference.Id)); 346Debug.Assert(localFunction.IsLocalFunction()); 499Debug.Assert(operation.Type.IsDelegateType());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
56Debug.Assert(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (2)
191Debug.Assert(scratch.Count == 0); 205Debug.Assert(scratch.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (10)
65Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 92Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 107Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 130Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 148Debug.Assert(operation.Option == AdjustNewLinesOption.ForceLinesIfOnSingleLine); 178Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 195Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 209Debug.Assert(!context.IsFormattingDisabled(new TextSpan(context.TokenStream.GetToken(pairIndex + 1).SpanStart, 0))); 461Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 464Debug.Assert(!previousChangesMap.ContainsKey(currentToken));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (12)
63Debug.Assert(this.TokenCount > 0); 85Debug.Assert(previousToken.FullSpan.End <= currentToken.FullSpan.Start); 388Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 389Debug.Assert(token1.IndexInStream < 0 || token2.IndexInStream < 0 || (token1.IndexInStream + 1 == token2.IndexInStream)); 390Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span)); 413Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 414Debug.Assert(token1.IndexInStream < 0 || token2.IndexInStream < 0 || (token1.IndexInStream + 1 == token2.IndexInStream)); 415Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span)); 433Debug.Assert(_treeData.IsFirstToken(this.FirstTokenInStream.Token)); 445Debug.Assert(_treeData.IsLastToken(this.LastTokenInStream.Token)); 493Debug.Assert(tokenData2 == tokenData1.GetNextTokenData()); 517Debug.Assert(token.FullSpan.IsEmpty);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AlignTokensOperation.cs (1)
19Debug.Assert(!tokens.IsEmpty());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (2)
750Debug.Assert(!_firstLineBlank); 856Debug.Assert(IsWhitespaceOrEndOfLine(trivia2));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
84Debug.Assert(indentStyle == FormattingOptions2.IndentStyle.Smart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
161Debug.Assert(spanToCheck.Length > 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (1)
21Debug.Assert(nameSpan.Length > 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
416Debug.Assert(s_serializationVersion == 5, "After increasing the serialization version, add an upgrade path here.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\Option2.cs (3)
69Debug.Assert(LanguageName is null == (Definition.ConfigName.StartsWith(OptionDefinition.LanguageAgnosticConfigNamePrefix, StringComparison.Ordinal) || 71Debug.Assert(LanguageName is LanguageNames.CSharp == Definition.ConfigName.StartsWith(OptionDefinition.CSharpConfigNamePrefix, StringComparison.Ordinal)); 72Debug.Assert(LanguageName is LanguageNames.VisualBasic == Definition.ConfigName.StartsWith(OptionDefinition.VisualBasicConfigNamePrefix, StringComparison.Ordinal));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
59Debug.Assert(IsSupportedOptionType(Type));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionKey2.cs (3)
22Debug.Assert(option.IsPerLanguage == language is not null); 30Debug.Assert(option.IsPerLanguage); 42Debug.Assert(!option.IsPerLanguage);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\PerLanguageOption2.cs (2)
60Debug.Assert(!Definition.ConfigName.StartsWith(OptionDefinition.CSharpConfigNamePrefix, StringComparison.Ordinal)); 61Debug.Assert(!Definition.ConfigName.StartsWith(OptionDefinition.VisualBasicConfigNamePrefix, StringComparison.Ordinal));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectReader.cs (2)
45Debug.Assert(BitConverter.IsLittleEndian); 242Debug.Assert(code is >= TypeCode.FirstWellKnownTextEncoding and <= TypeCode.LastWellKnownTextEncoding);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (5)
92Debug.Assert(BitConverter.IsLittleEndian); 185Debug.Assert(value == null || !value.GetType().GetTypeInfo().IsEnum, "Enum should not be written with WriteValue. Write them as ints instead."); 195Debug.Assert(!typeInfo.IsEnum, "Enums should not be written with WriteObject. Write them out as integers instead."); 470Debug.Assert(id >= 0); 542Debug.Assert(kind is >= EncodingExtensions.FirstTextEncodingKind and <= EncodingExtensions.LastTextEncodingKind);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (5)
62Debug.Assert(HasPreamble(Encoding.Unicode)); 67Debug.Assert(HasPreamble(Encoding.BigEndianUnicode)); 72Debug.Assert(HasPreamble(Encoding.UTF32)); 77Debug.Assert(HasPreamble(Encoding.UTF32)); 82Debug.Assert(HasPreamble(Encoding.UTF8));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\FileBannerFacts\AbstractFileBannerFacts.cs (2)
168Debug.Assert(root.FullSpan.Start == 0); 174Debug.Assert(firstToken.FullSpan.Start == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (1)
40Debug.Assert(ownerOfHeader.FullSpan.Contains(lastTokenOrNodeOfHeader.Span));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
23Debug.Assert(symbol.IsAnonymousDelegateType() || symbol.IsAnonymousFunction());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousTypeSymbolKey.cs (1)
19Debug.Assert(symbol.IsAnonymousType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
198Debug.Assert(reader.Position == symbolKey.Length);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (3)
17Debug.Assert(symbol.Equals(symbol.ConstructedFrom)); 129Debug.Assert(symbol.Equals(symbol.ConstructedFrom)); 262Debug.Assert(method != null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (3)
36Debug.Assert(symbol.IsGlobalNamespace); 94Debug.Assert(metadataName == string.Empty); 98Debug.Assert(metadataName == string.Empty);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.PropertySymbolKey.cs (1)
104Debug.Assert(property != null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (8)
65Debug.Assert(Data[Position] == c); 87Debug.Assert(char.IsNumber(Data[Position])); 102Debug.Assert(start != Position); 116Debug.Assert(val is 0 or 1); 202Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 288Debug.Assert(_skipString == false); 293Debug.Assert(_skipString == true); 547Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
109Debug.Assert(_nestingCount == 0); 255Debug.Assert(location.Kind is LocationKind.None or 307Debug.Assert(!array.IsDefault);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
20Debug.Assert(symbol.IsTupleType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (18)
261Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 263Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 285Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 287Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 297Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 299Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 307Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 309Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 319Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 321Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 572Debug.Assert(previousOriginalNode == null || previousOriginalNode.Parent == currentOriginalNode); 573Debug.Assert(previousReplacedNode == null || previousReplacedNode.Parent == currentReplacedNode); 627Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 629Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 1081Debug.Assert(signature1Parameters.Length == signature2Parameters.Length); 1082Debug.Assert(specifiedArguments.Length <= signature1Parameters.Length || 1166Debug.Assert(parameter1.HasExplicitDefaultValue, "Expected all unspecified parameter to have default values"); 1167Debug.Assert(parameter1.HasExplicitDefaultValue == parameter2.HasExplicitDefaultValue);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (4)
98Debug.Assert(chars.Length != 0); // If TryDecodeFromUtf16() consumed the entire buffer, it could not have returned false. 127Debug.Assert(chars.Length != 0 && !chars[0].IsSpace()); 175Debug.Assert(tempBuffer.Length != 0); // We only bound-check after writing a character to the tempBuffer. 316Debug.Assert((consumed % 4) == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (1)
100Debug.Assert(_forwardMap.Count == _backwardMap.Count);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (4)
163Debug.Assert(spilledEdges.Count == (edgeCount - CompactEdgeAllocationSize)); 173Debug.Assert(currentEdgeIndex == edges.Capacity); 174Debug.Assert(currentEdgeIndex == edges.Count); 278Debug.Assert(currentNode.SpilloverEdges.Count == (currentNode.EdgeCount - CompactEdgeAllocationSize));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (8)
182Debug.Assert(source.Length <= target.Length); 219Debug.Assert(minimumEditCount >= 0); 485Debug.Assert(offset >= 0); 577Debug.Assert(v1 >= 0); 578Debug.Assert(v2 >= 0); 579Debug.Assert(v3 >= 0); 580Debug.Assert(v4 >= 0); 598Debug.Assert(min >= 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (2)
203Debug.Assert(!this.IsLocked); 212Debug.Assert(this.IsOwnedByMe);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (1)
239Debug.Assert(count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (4)
33Debug.Assert(span.Start >= start, "Bad generator."); 85Debug.Assert(current < length); 107Debug.Assert(current < length); 126Debug.Assert(char.IsUpper(identifier[current - 1]));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\WordSimilarityChecker.cs (1)
134Debug.Assert(similarityWeight <= _threshold);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
330Debug.Assert(type is null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IMethodSymbolExtensions.cs (2)
25Debug.Assert(method.PartialImplementationPart == null && !Equals(method.PartialDefinitionPart, method)); 30Debug.Assert(!Equals(method.PartialImplementationPart, method));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (7)
92Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 179Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 217Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 254Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 379Debug.Assert(current.IsDefinition); 413Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 439Debug.Assert(current.IsDefinition);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
533Debug.Assert(isTypeParameter2);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (1)
166Debug.Assert(_assemblyComparer == null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (7)
78Debug.Assert(!x.IsDefault && !y.IsDefault); 114Debug.Assert(x.Kind == y.Kind && x.Kind == k); 332Debug.Assert(GetTypeKind(x) == GetTypeKind(y)); 371Debug.Assert(y.Kind == SymbolKind.ErrorType); 420Debug.Assert(y.IsTupleType); 619Debug.Assert( 623Debug.Assert(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
266Debug.Assert(
Text.Analyzers (59)
src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (2)
280Debug.Assert(_value is V, "Item must be a a V"); 315Debug.Assert(_value is V, "_value must be a V");
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (4)
19/// <inheritdoc cref="Debug.Assert(bool, string)"/> 22=> Debug.Assert(condition, message); 24/// <inheritdoc cref="Debug.Assert(bool, string)"/> 72Debug.Assert(false, message);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
133Debug.Assert(false, "Unreachable");
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
85Debug.Assert(false, message);
src\Dependencies\Collections\Internal\ArraySortHelper.cs (3)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\Dependencies\Collections\Internal\HashHelpers.cs (1)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\Dependencies\Collections\Segmented\SegmentedArray.cs (1)
491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (10)
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
277Debug.Assert(obj != null, "freeing null?"); 279Debug.Assert(_firstItem != obj, "freeing twice?"); 290Debug.Assert(value != obj, "freeing twice?");
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
321Debug.Assert(operation.Kind is OperationKind.None or OperationKind.Attribute, $"Unexpected root operation kind: {operation.Kind}");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (8)
85Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 89Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 98Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 107Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 117Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 121Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 147Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 153Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (1)
76Debug.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");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
416Debug.Assert(s_serializationVersion == 5, "After increasing the serialization version, add an upgrade path here.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (2)
185Debug.Assert(value == null || !value.GetType().GetTypeInfo().IsEnum, "Enum should not be written with WriteValue. Write them as ints instead."); 195Debug.Assert(!typeInfo.IsEnum, "Enums should not be written with WriteObject. Write them out as integers instead.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
1166Debug.Assert(parameter1.HasExplicitDefaultValue, "Expected all unspecified parameter to have default values");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (4)
492Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 499Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 532Debug.Assert(_completionRefCount == 0, $"Expected {nameof(_completionRefCount)} == 0, got {_completionRefCount}"); 560Debug.Assert(taskSet, "Complete should only be called once.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (1)
33Debug.Assert(span.Start >= start, "Bad generator.");
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
192Debug.Assert(false, message + ". " + diagnostics);
TlsFeaturesObserve (3)
Program.cs (3)
36Debug.Assert(!success); 37Debug.Assert(bytesReturned > 0); 42Debug.Assert(success);
UIAutomationClient (24)
MS\Internal\Automation\Accessible.cs (1)
17Debug.Assert(acc != null, "null IAccessible");
MS\Internal\Automation\CacheHelper.cs (1)
69Debug.Assert(response.RequestedData == null, "both RequestedData and TreeStructure should be null or non-null");
MS\Internal\Automation\FocusTracker.cs (1)
82Debug.Assert(acc != null, "HandleFocusChange got hwnd and null IAccessible");
MS\Internal\Automation\HwndProxyElementProvider.cs (2)
39Debug.Assert( hwnd != NativeMethods.HWND.NULL ); 2115Debug.Assert(provider is IRawElementProviderFragment, "Expecting a fragment provider");
MS\Internal\Automation\MenuTracker.cs (1)
74Debug.Assert(handlers.Length <= 1, "handlers.Length");
MS\Internal\Automation\QueueProcessor.cs (3)
76Debug.Assert(!_quitting, "Can't add items to queue when quitting"); 86Debug.Assert(!_quitting, "Can't add items to queue when quitting"); 140Debug.Assert(_quitting, "MsgWaitForMultipleObjects failed while WaitForWork");
MS\Internal\Automation\Schema.cs (2)
56Debug.Assert( false, "GetPropertyInfo failed " + id ); 104Debug.Assert( false, "GetAttributeInfo failed " + id );
MS\Internal\Automation\SelectionPatternProviderSideWrapper.cs (1)
26Debug.Assert(target != null);
MS\Internal\Automation\UiaCoreApi.cs (2)
451Debug.Assert(offsets == null && treeStructures == null, "if nothin found, all out params shoud be null"); 455Debug.Assert(offsets.Length == treeStructures.Length);
MS\Internal\Automation\WindowHideOrCloseTracker.cs (1)
88Debug.Assert(handlers.Length <= 1, "handlers.Length");
MS\Internal\Automation\WindowShowOrOpenTracker.cs (1)
85Debug.Assert(handlers.Length <= 1, "handlers.Length");
MS\Internal\Automation\WinEventWrap.cs (1)
32Debug.Assert(eventIds != null && eventIds.Length > 0, "eventIds is invalid");
System\Windows\Automation\AutomationElement.cs (1)
755Debug.Assert(responses.Length == 1);
System\Windows\Automation\BasePattern.cs (1)
25Debug.Assert(el != null);
System\Windows\Automation\CacheRequest.cs (1)
549Debug.Assert( _request != null );
System\Windows\Automation\Text\TextRange.cs (2)
57Debug.Assert(!hTextRange.IsInvalid); 58Debug.Assert(pattern != null);
System\Windows\Automation\TextPattern.cs (2)
32Debug.Assert(el != null); 33Debug.Assert(!hPattern.IsInvalid);
UIAutomationClientSideProviders (75)
MS\Internal\AutomationProxies\Accessible.cs (9)
143Debug.Assert(acc != null, "null IAccessible"); 316Debug.Assert(parent != null); 327Debug.Assert(false); 343Debug.Assert(parent != null); 354Debug.Assert(false); 685Debug.Assert( false, "Need to handle Accessible.accFocus case!" ); 728Debug.Assert(_idChild == NativeMethods.CHILD_SELF); 773Debug.Assert(false); 979Debug.Assert(_accessibleChildrenIndex < 0);
MS\Internal\AutomationProxies\CommonGetThemePartSize.cs (1)
95System.Diagnostics.Debug.Assert (false, "Unsupport Type");
MS\Internal\AutomationProxies\CommonXSendMessage.cs (1)
94System.Diagnostics.Debug.Assert(remoteTextArea.ToInt32() == remoteTextArea.ToInt64());
MS\Internal\AutomationProxies\Misc.cs (2)
1970Debug.Assert(System.Environment.OSVersion.Version.Major < 6); 2041Debug.Assert(System.Environment.OSVersion.Version.Major >= 6);
MS\Internal\AutomationProxies\MSAAEventDispatcher.cs (2)
124Debug.Assert(refcount >= 0); 361Debug.Assert(eventId == NativeMethods.EVENT_OBJECT_REORDER);
MS\Internal\AutomationProxies\MSAANativeProvider.cs (6)
51Debug.Assert(acc != null, "acc"); 52Debug.Assert(hwnd != IntPtr.Zero); 224Debug.Assert(_hwnd == UnsafeNativeMethods.WindowFromPhysicalPoint((int)x, (int)y)); 340Debug.Assert(false); 1024Debug.Assert(!IsRoot); 1077Debug.Assert(_hwnd != IntPtr.Zero);
MS\Internal\AutomationProxies\NonClientArea.cs (1)
108System.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)
122System.Diagnostics.Debug.Assert(this is ProxyHwnd, "Invalid method called ElementProviderFromPoint"); 209System.Diagnostics.Debug.Assert(fragment != null, "DrillDownFragment: starting point is null"); 214System.Diagnostics.Debug.Assert(fromPoint != null, @"DrillDownFragment: calling ElementProviderFromPoint on Fragment should not return null");
MS\Internal\AutomationProxies\ProxySimple.cs (2)
244System.Diagnostics.Debug.Assert(_sAutomationId != null, "_sAutomationId is null!"); 443System.Diagnostics.Debug.Assert(_parent != null, "Navigate: Leaf element does not have parent");
MS\Internal\AutomationProxies\WindowsEditBox.cs (16)
436Debug.Assert(point.x >= 0 && point.x < 65536, "WindowsEditBox.CharFromPos() x coordinate out of range."); 437Debug.Assert(point.y >= 0 && point.y < 65536, "WindowsEditBox.CharFromPos() y coordinate out of range."); 514Debug.Assert(!IsMultiline); 521Debug.Assert(IsMultiline); 551Debug.Assert(hfont != IntPtr.Zero, "WindowsEditBox.GetLogfont got null HFONT"); 677Debug.Assert(index >= 0, "WindowsEditBox.LineFromChar negative index."); 678Debug.Assert(index <= GetTextLength(), "WindowsEditBox.LineFromChar index out of range."); 739Debug.Assert(index >= 0, "WindowsEditBox.PosFromChar negative index."); 740Debug.Assert(index < GetTextLength(), "WindowsEditBox.PosFromChar index out of range."); 743Debug.Assert(result!=-1, "WindowsEditBox.PosFromChar index out of bounds."); 798Debug.Assert(start >= 0, "WindowsEditBox.SetSel negative start."); 799Debug.Assert(start <= GetTextLength(), "WindowsEditBox.SetSel start out of range."); 800Debug.Assert(end >= 0, "WindowsEditBox.SetSel negative end."); 801Debug.Assert(end <= GetTextLength(), "WindowsEditBox.SetSel end out of range."); 961Debug.Assert(floor >= 0); 972Debug.Assert(i >= floor);
MS\Internal\AutomationProxies\WindowsEditBoxRange.cs (1)
39Debug.Assert(provider != null);
MS\Internal\AutomationProxies\WindowsIPAddress.cs (1)
104System.Diagnostics.Debug.Assert (index != -1, "GetOverrideProviderForHwnd: cannot find child hwnd index");
MS\Internal\AutomationProxies\WindowsListBox.cs (3)
594System.Diagnostics.Debug.Assert (IsMultipleSelection (), "Calling ClearAll on single-selected listbox"); 910System.Diagnostics.Debug.Assert (_parent is WindowsListBox, "Invalid Parent for a Listbox Item"); 1178System.Diagnostics.Debug.Assert (_listBox.IsMultipleSelection (), "Calling UnSelect on single-selected listbox");
MS\Internal\AutomationProxies\WindowsListView.cs (1)
1960System.Diagnostics.Debug.Assert(el is ListViewItemCheckbox);
MS\Internal\AutomationProxies\WindowsListViewGroup.cs (2)
552System.Diagnostics.Debug.Assert (!WindowsListView.IsDetailMode (hwnd), "GetColumnCountExternal: called when lv is in Detail mode"); 802System.Diagnostics.Debug.Assert (false, "GetCountOfItemsInDimension: failed to get item rect");
MS\Internal\AutomationProxies\WindowsListViewGroupHelper.cs (1)
800System.Diagnostics.Debug.Assert(min <= _items.Length, "EnsureCapacity: min is > _items.Length");
MS\Internal\AutomationProxies\WindowsListViewItem.cs (2)
500System.Diagnostics.Debug.Assert (parent != null, "Hit null while looking for the SelectionContainer"); 729System.Diagnostics.Debug.Assert (WindowsListView.IsGroupViewEnabled (hwnd), "GetGroupID: called when lv does not have groups");
MS\Internal\AutomationProxies\WindowsListViewItemStartMenu.cs (1)
85System.Diagnostics.Debug.Assert(AccessibleObject != null, "Failed to get a valid IAccessible!");
MS\Internal\AutomationProxies\WindowsMenu.cs (2)
115System.Diagnostics.Debug.Assert(idObject == NativeMethods.OBJID_MENU || idObject == NativeMethods.OBJID_SYSMENU, "Unexpected idObject"); 2695System.Diagnostics.Debug.Assert (name.Length > hotKeyStart + 1, "Unexpected end of string");
MS\Internal\AutomationProxies\WindowsRichEdit.cs (4)
226Debug.Assert(_document != null); 266Debug.Assert(_document != null); 273Debug.Assert(range.Start == range.End); 309Debug.Assert(_document != null);
MS\Internal\AutomationProxies\WindowsRichEditRange.cs (11)
23Debug.Assert(range != null); 24Debug.Assert(pattern != null); 240Debug.Assert(text == null || text.Length == maxLength); 1116Debug.Assert(charMoved == 0 || charMoved == 1); 1119Debug.Assert(paraMoved == 0 || paraMoved == 1); 1145Debug.Assert(charMoved == 0 || charMoved == -1); 1148Debug.Assert(paraMoved == 0 || paraMoved == -1); 1174Debug.Assert(charMoved == 0 || charMoved == 1); 1177Debug.Assert(paraMoved == 0 || paraMoved == 1); 1203Debug.Assert(charMoved == 0 || charMoved == -1); 1206Debug.Assert(paraMoved == 0 || paraMoved == -1);
MS\Internal\AutomationProxies\WindowsTab.cs (1)
1191System.Diagnostics.Debug.Assert(_parent is WindowsTab, "Invalid Parent for a Tab Item");
MS\Internal\AutomationProxies\WindowsTreeView.cs (1)
1058System.Diagnostics.Debug.Assert (topLevelParent is WindowsTreeView, "Invalid Parent for a TreeView Item");
MS\Internal\AutomationProxies\WinEventTracker.cs (1)
448Debug.Assert (hwnd == IntPtr.Zero, @"BuildEventsList: event is global but hwnd is not null");
UIAutomationTypes (4)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\NativeMethodsOther.cs (1)
16Debug.Assert((0xFFFF0000 & errorCode) == 0);
System\Windows\Automation\AutomationIdentifier.cs (3)
46Debug.Assert(id != 0); 124Debug.Assert(obj != null, "Null obj!"); 128Debug.Assert(obj is AutomationIdentifier, "CompareTo called with unexpected type");
vbc (3)
src\Compilers\Core\CommandLine\BuildProtocol.cs (2)
71Debug.Assert(!string.IsNullOrWhiteSpace(CompilerHash), "A hash value is required to communicate with the server"); 83Debug.Assert(!string.IsNullOrWhiteSpace(compilerHash), "CompilerHash is required to send request to the build server");
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (1)
138Debug.Assert(false, e.Message);
VBCSCompiler (3)
src\Compilers\Core\CommandLine\BuildProtocol.cs (2)
71Debug.Assert(!string.IsNullOrWhiteSpace(CompilerHash), "A hash value is required to communicate with the server"); 83Debug.Assert(!string.IsNullOrWhiteSpace(compilerHash), "CompilerHash is required to send request to the build server");
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (1)
138Debug.Assert(false, e.Message);
WindowsFormsIntegration (5)
System\Windows\Integration\ApplicationInterop.cs (2)
144Debug.Assert(processedState == SWF.PreProcessControlState.MessageNotNeeded, "invalid state"); 216Debug.Assert(windowFilter != null);
System\Windows\Integration\ElementHost.cs (1)
1584Debug.Assert(request != null, "request was null!");
System\Windows\Integration\WindowsFormsHost.cs (2)
967Debug.Assert(uiAction == NativeMethods.UIS_INITIALIZE || uiAction == NativeMethods.UIS_SET, "Unexpected uiAction"); 1094Debug.Assert(methodInfo != null, "Couldn't find OnParentRightToLeftChanged method!");
xunit.console (1)
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\DependencyContextLoader.cs (1)
97Debug.Assert(_fileSystem.File.Exists(location));