9900 references to Assert
Aspire.Azure.AI.OpenAI (1)
src\Components\Common\AzureComponent.cs (1)
68Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.Data.Tables (1)
src\Components\Common\AzureComponent.cs (1)
68Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.Messaging.EventHubs (1)
src\Components\Common\AzureComponent.cs (1)
68Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.Messaging.ServiceBus (1)
src\Components\Common\AzureComponent.cs (1)
68Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.Messaging.WebPubSub (1)
src\Components\Common\AzureComponent.cs (1)
68Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.Search.Documents (1)
src\Components\Common\AzureComponent.cs (1)
68Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.Security.KeyVault (1)
src\Components\Common\AzureComponent.cs (1)
68Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.Storage.Blobs (1)
src\Components\Common\AzureComponent.cs (1)
68Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.Storage.Queues (1)
src\Components\Common\AzureComponent.cs (1)
68Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Dashboard (19)
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\Pages\ConsoleLogs.razor.cs (1)
148Debug.Assert(added, "Should not receive duplicate resources in initial snapshot data.");
Components\Pages\Resources.razor.cs (1)
179Debug.Assert(added, "Should not receive duplicate resources in initial snapshot data.");
Configuration\DashboardOptions.cs (4)
98Debug.Assert(_primaryApiKeyBytes is not null, "Should have been parsed during validation."); 174Debug.Assert(_parsedEndpointAddresses is not null, "Should have been parsed during validation."); 263Debug.Assert(_nameClaimTypes is not null, "Should have been parsed during validation."); 269Debug.Assert(_usernameClaimTypes is not null, "Should have been parsed during validation.");
Model\ResourceOutgoingPeerResolver.cs (2)
36Debug.Assert(added, "Should not receive duplicate resources in initial snapshot data."); 53Debug.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)
269Debug.Assert(result, "Guid.TryFormat not successful.");
Otlp\Storage\TelemetryRepository.cs (2)
754Debug.Assert(_tracesLock.IsReadLockHeld || _tracesLock.IsWriteLockHeld, $"Must get lock before calling {nameof(GetTraceUnsynchronized)}."); 770Debug.Assert(_tracesLock.IsReadLockHeld || _tracesLock.IsWriteLockHeld, $"Must get lock before calling {nameof(GetSpanUnsynchronized)}.");
ResourceService\DashboardClient.cs (2)
176Debug.Assert( 188Debug.Assert(
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 (2)
38Debug.Assert(logLine.Timestamp == null || logLine.Timestamp.Value.Kind == DateTimeKind.Utc, "Timestamp should always be UTC."); 134Debug.Assert(BaseLineNumber != null, "Should be set before this method is run.");
Aspire.Hosting (9)
ApplicationModel\ResourceLoggerService.cs (1)
378Debug.Assert(_backlog.EntriesCount == 0, "The backlog should be empty if there are no subscribers.");
Dashboard\DashboardLifecycleHook.cs (2)
179Debug.Assert(options.DashboardUrl is not null, "DashboardUrl should not be null"); 180Debug.Assert(options.OtlpGrpcEndpointUrl is not null || options.OtlpHttpEndpointUrl is not null, "OtlpGrpcEndpointUrl and OtlpHttpEndpointUrl should not both be null");
Dcp\DcpExecutor.cs (2)
113Debug.Assert(_dcpInfo is not null, "DCP info should not be null at this point"); 246Debug.Assert(!entry.LogsAvailable.HasValue || entry.LogsAvailable.Value, "entry.LogsAvailable should never be 'false'");
Orchestrator\ApplicationOrchestrator.cs (1)
123Debug.Assert(context.DcpResourceName is not null, "Container that is starting should always include the DCP name.");
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 (2)
38Debug.Assert(logLine.Timestamp == null || logLine.Timestamp.Value.Kind == DateTimeKind.Utc, "Timestamp should always be UTC."); 134Debug.Assert(BaseLineNumber != null, "Should be set before this method is run.");
Aspire.Hosting.Analyzers (1)
Infrastructure\WellKnownTypes.cs (1)
43Debug.Assert(name == typeIdName, $"Enum name ({typeIdName}) and type name ({name}) must match at {i}");
CodeGenerator (1)
HttpUtilities\HttpUtilities.cs (1)
308Debug.Assert(str.Length == sizeof(ulong), string.Format(CultureInfo.InvariantCulture, "String must be exactly {0} (ASCII) characters long.", sizeof(ulong)));
CodeStyleConfigFileGenerator (1)
src\Compilers\Core\Portable\InternalUtilities\ExceptionUtilities.cs (1)
22Debug.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);
DesignSurface (1)
CustomControls\DesignerActionVerbItem.cs (1)
15Debug.Assert(verb is not null, "All callers check whether the verb is null.");
dotnet-dev-certs (1)
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)
321Debug.Assert(this.ToolContext.HasValue, $"{nameof(ToolContext)} is not initialized!"); 322Debug.Assert(this.Verbosity.HasValue, $"{nameof(Verbosity)} is not initialized!"); 693Debug.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)
217Debug.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!");
Extensibility.MessageInterceptor.IntegrationTests (1)
AsyncResult.cs (1)
101Debug.Assert(this._manualResetEvent == null, "No ManualResetEvent should be created for a synchronous AsyncResult.");
http2cat (7)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
229Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
IIS.FunctionalTests (7)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
229Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
IIS.LongTests (7)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
229Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
IIS.NewHandler.FunctionalTests (7)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
229Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
IIS.NewShim.FunctionalTests (7)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
229Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
IIS.ShadowCopy.Tests (3)
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
229Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
IISExpress.FunctionalTests (7)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
229Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
illink (6)
ILLink.RoslynAnalyzer (10)
DataFlow\LocalDataFlowVisitor.cs (7)
103 Debug.Assert (OwningSymbol is IMethodSymbol or IFieldSymbol or IPropertySymbol, 111 Debug.Assert (OwningSymbol is IMethodSymbol, 204 Debug.Assert (local.ContainingSymbol is IMethodSymbol or IFieldSymbol, // backing field for property initializers 451 Debug.Assert (!IsLValueFlowCapture (operation.Id), 453 Debug.Assert (operation.GetValueUsageInfo (OwningSymbol).HasFlag (ValueUsageInfo.Read), 472 Debug.Assert (operation.GetValueUsageInfo (OwningSymbol).HasFlag (ValueUsageInfo.Write), 474 Debug.Assert (operation.GetValueUsageInfo (OwningSymbol).HasFlag (ValueUsageInfo.Reference),
DataFlow\LValueFlowCaptureProvider.cs (1)
80 Debug.Assert (kind == FlowCaptureKind.LValueAndRValueCapture || !rvalueFlowCaptureIds.Contains (captureId), "Flow capture used as both an r-value and an l-value, but with incorrect flow capture kind");
TrimAnalysis\MethodReturnValue.cs (1)
22 Debug.Assert (!isNewObj || methodSymbol.MethodKind == MethodKind.Constructor, "isNewObj can only be true for constructors");
TrimAnalysis\TrimAnalysisPatternStore.cs (1)
103 Debug.Assert (existingPattern == pattern, "Return values should be identical");
InMemory.FunctionalTests (2)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (1)
124Debug.Assert(streamId == 0 || streamId == -1, "StreamId sent that was non-zero, which isn't handled by tests");
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
Microsoft.Analyzers.Local.Tests (1)
InternalReferencedInPublicDocAnalyzerTests.cs (1)
459Debug.Assert(lineNumbers.Length == detectedTexts.Length, "Line numbers and texts should be the same length");
Microsoft.AspNetCore (3)
WebApplicationBuilder.cs (3)
82Debug.Assert(slim, "should only be called with slim: true"); 148Debug.Assert(!slim, "should only be called with slim: false"); 149Debug.Assert(empty, "should only be called with empty: true");
Microsoft.AspNetCore.App.Analyzers (11)
Infrastructure\VirtualChars\AbstractVirtualCharService.cs (8)
82Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 86Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 95Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 104Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 114Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 118Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 144Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 150Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics.");
src\Shared\Diagnostics\AnalyzerDebug.cs (2)
16/// <inheritdoc cref="Debug.Assert(bool, string)"/> 19=> Debug.Assert(b, message);
src\Shared\RoslynUtils\WellKnownTypes.cs (1)
46Debug.Assert(name == typeIdName, $"Enum name ({typeIdName}) and type name ({name}) must match at {i}");
Microsoft.AspNetCore.App.CodeFixes (2)
Authorization\AddAuthorizationBuilderFixer.cs (2)
76Debug.Assert(false, "AddAuthorizationBuilderAnalyzer should not have emitted a diagnostic."); 110Debug.Assert(false, "AddAuthorizationBuilderAnalyzer should not have emitted a diagnostic.");
Microsoft.AspNetCore.Authentication.Negotiate (2)
NegotiateHandler.cs (2)
209Debug.Assert(object.ReferenceEquals(persistence?.State, _negotiateState), 401Debug.Assert(!items.ContainsKey(AuthPersistenceKey), "This should only be registered once per connection");
Microsoft.AspNetCore.Components (2)
RenderTree\RenderTreeDiffBuilder.cs (1)
174Debug.Assert(action switch
src\Http\Routing\src\Patterns\RoutePatternMatcher.cs (1)
434Debug.Assert(false, "indexOfLastSegementUsed should always be 0 from the check above");
Microsoft.AspNetCore.Components.Server (14)
BlazorPack\SequenceOfT.cs (3)
168Debug.Assert(last != null, "Cannot advance before acquiring memory."); 407Debug.Assert(segment != null, "Null not allowed."); 433Debug.Assert(offset >= this.Start, "Trying to rewind.");
Circuits\CircuitRegistry.cs (1)
133Debug.Assert(result, "This operation operates inside of a lock. We expect the previously inspected value to be still here.");
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequenceReader.cs (9)
263Debug.Assert(this.usingSequence, "usingSequence"); 270Debug.Assert(this.usingSequence, "usingSequence"); 305Debug.Assert(this.usingSequence, "usingSequence"); 365Debug.Assert(count >= 0, "count >= 0"); 382Debug.Assert(count >= 0, "count >= 0"); 387Debug.Assert(this.CurrentSpanIndex < this.CurrentSpan.Length, "this.CurrentSpanIndex < this.CurrentSpan.Length"); 408Debug.Assert(this.usingSequence, "usingSequence"); 430Debug.Assert(count >= 0, "count >= 0"); 474Debug.Assert(firstSpan.Length < destination.Length, "firstSpan.Length < destination.Length");
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequenceReaderExtensions.cs (1)
72Debug.Assert(reader.UnreadSpan.Length < sizeof(T), "reader.UnreadSpan.Length < sizeof(T)");
Microsoft.AspNetCore.Components.Server.Tests (2)
src\SignalR\common\SignalR.Common\test\Internal\Protocol\MessagePackHubProtocolTestBase.cs (2)
465Debug.Assert(size < 16, "Test code doesn't support array sizes greater than 15"); 472Debug.Assert(size < 16, "Test code doesn't support string sizes greater than 15");
Microsoft.AspNetCore.Components.WebAssembly (1)
Services\WebAssemblyConsoleLogger.cs (1)
95Debug.Assert(logLevel != LogLevel.None, "This method is never called with LogLevel.None.");
Microsoft.AspNetCore.Cryptography.Internal (1)
UnsafeNativeMethods.cs (1)
479Debug.Assert(lastError != 0, "This method should only be called if there was an error.");
Microsoft.AspNetCore.DataProtection (7)
KeyManagement\Key.cs (1)
151Debug.Assert(_descriptorFactory is not null, "Key constructed without either descriptor or descriptor factory");
KeyManagement\KeyRingProvider.cs (4)
387Debug.Assert(taskKeyRing is not null, "How did _cacheableKeyRingTask change while we were holding the lock?"); 395Debug.Assert(!forceRefresh, "Consumed cached key ring even though forceRefresh is true"); 396Debug.Assert(!CacheableKeyRing.IsValid(existingCacheableKeyRing, utcNow), "Should have returned a valid cached key ring above"); 447Debug.Assert(!task.IsCanceled, "How did a task with no cancellation token get canceled?");
KeyManagement\XmlKeyManager.cs (1)
283Debug.Assert(_cacheExpirationTokenSource != null, $"{nameof(TriggerAndResetCacheExpirationToken)} must have been called first.");
Repositories\FileSystemXmlRepository.cs (1)
209Debug.Assert(fileSystemInfo.Exists, "Having previously been deleted should not have caused an exception");
Microsoft.AspNetCore.DataProtection.Abstractions (1)
src\Shared\WebEncoders\WebEncoders.cs (1)
155Debug.Assert(arraySizeRequired % 4 == 0, "Invariant: Array length must be a multiple of 4.");
Microsoft.AspNetCore.DeveloperCertificates.XPlat (1)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
334Debug.Assert(IsCommandAvailable(OpenSslCommand), "How did we trust without the openssl command?");
Microsoft.AspNetCore.Diagnostics (2)
src\Shared\Diagnostics\AnalyzerDebug.cs (2)
16/// <inheritdoc cref="Debug.Assert(bool, string)"/> 19=> Debug.Assert(b, message);
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (2)
src\Shared\Diagnostics\AnalyzerDebug.cs (2)
16/// <inheritdoc cref="Debug.Assert(bool, string)"/> 19=> Debug.Assert(b, message);
Microsoft.AspNetCore.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 (1)
Internal\Json\MessageTypeInfoResolver.cs (1)
126Debug.Assert(!field.IsRepeated && !field.IsMap, "Collections shouldn't have a setter.");
Microsoft.AspNetCore.Hosting (6)
Internal\ConfigureContainerBuilder.cs (1)
24Debug.Assert(MethodInfo != null, "Shouldn't be called when there is no Configure method.");
Internal\HostingApplicationDiagnostics.cs (1)
158Debug.Assert(context.MetricsTagsFeature != null, "MetricsTagsFeature should be set if MetricsEnabled is true.");
Internal\WebHost.cs (4)
81Debug.Assert(_applicationServices != null, "Initialize must be called before accessing services."); 126Debug.Assert(_applicationServices != null, "Initialize must be called first."); 202Debug.Assert(_applicationServices != null, "Initialize must be called first."); 255Debug.Assert(_applicationServices != null, "Initialize must be called first.");
Microsoft.AspNetCore.Http.Abstractions (2)
Extensions\UseMiddlewareExtensions.cs (2)
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.");
Microsoft.AspNetCore.Http.Connections (3)
Internal\HttpConnectionContext.cs (1)
629Debug.Assert(TransportType != HttpTransportType.None, "Transport has not been initialized yet");
Internal\Transports\WebSocketsServerTransport.cs (1)
39Debug.Assert(context.WebSockets.IsWebSocketRequest, "Not a websocket request");
src\Shared\WebEncoders\WebEncoders.cs (1)
155Debug.Assert(arraySizeRequired % 4 == 0, "Invariant: Array length must be a multiple of 4.");
Microsoft.AspNetCore.Http.Extensions (12)
RequestDelegateFactory.cs (7)
1294Debug.Assert(factoryContext.JsonRequestBodyParameter is not null, "factoryContext.JsonRequestBodyParameter is null for a JSON body."); 1301Debug.Assert(parameterName is not null, "CreateArgument() should throw if parameter.Name is null."); 1429Debug.Assert(factoryContext.FirstFormRequestBodyParameter is not null, "factoryContext.FirstFormRequestBodyParameter is null for a form body."); 1436Debug.Assert(parameterName is not null, "CreateArgument() should throw if parameter.Name is null."); 1585Debug.Assert(parameterInfo.Name != null, "Parameter name must be set for parameters resolved from properties."); 1610Debug.Assert(parameterInfo.Name != null, "Parameter name must be set for parameters resolved from properties."); 2275Debug.Assert(parameterName is not null, "CreateArgument() should throw if parameter.Name is 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\PropertyAsParameterInfo.cs (1)
25Debug.Assert(propertyInfo != null, "PropertyInfo must be provided.");
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (1)
290Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.AspNetCore.Http.RequestDelegateGenerator (3)
src\Shared\Diagnostics\AnalyzerDebug.cs (2)
16/// <inheritdoc cref="Debug.Assert(bool, string)"/> 19=> Debug.Assert(b, message);
src\Shared\RoslynUtils\WellKnownTypes.cs (1)
46Debug.Assert(name == typeIdName, $"Enum name ({typeIdName}) and type name ({name}) must match at {i}");
Microsoft.AspNetCore.HttpLogging (1)
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (1)
290Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.AspNetCore.Mvc.Abstractions (2)
ModelBinding\ModelMetadata.cs (2)
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.");
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
src\Shared\PropertyAsParameterInfo.cs (1)
25Debug.Assert(propertyInfo != null, "PropertyInfo must be provided.");
Microsoft.AspNetCore.Mvc.Core (10)
Filters\DefaultFilterProvider.cs (2)
68Debug.Assert(actualFilter != null, "actualFilter should not be null"); 69Debug.Assert(filterMetadata != null, "filterMetadata should not be null");
Infrastructure\ControllerActionInvoker.cs (1)
538Debug.Assert(actionParameters != null, "Expect arguments to be initialized.");
ModelBinding\Binders\ArrayModelBinder.cs (2)
94Debug.Assert(targetType == typeof(TElement[]), "GenericModelBinder only creates this binder for arrays."); 102Debug.Assert(targetType == typeof(TElement?[]), "GenericModelBinder only creates this binder for arrays.");
ModelBinding\Binders\CollectionModelBinder.cs (1)
472Debug.Assert(targetCollection != null, "This binder is instantiated only for ICollection<T> model types.");
ModelBinding\PlaceholderBinder.cs (1)
20Debug.Assert(Inner is not null, "Inner must be resolved before BindModelAsync can be called.");
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (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.");
Microsoft.AspNetCore.Mvc.Localization (1)
ViewLocalizer.cs (1)
90Debug.Assert(!string.IsNullOrEmpty(path), "Couldn't determine a path for the view");
Microsoft.AspNetCore.Mvc.NewtonsoftJson (2)
BsonTempDataSerializer.cs (2)
182Debug.Assert(genericTypeArguments.Length == 1, "IList<T> has one generic argument"); 188Debug.Assert(
Microsoft.AspNetCore.Mvc.RazorPages (2)
Infrastructure\PageActionInvoker.cs (1)
267Debug.Assert(executor != null, "We should always find a executor for a handler");
Infrastructure\PageActionInvokerCache.cs (1)
47Debug.Assert(compiledPageActionDescriptor != null, "PageLoader didn't run!");
Microsoft.AspNetCore.Mvc.TagHelpers (1)
JavaScriptResources.cs (1)
39Debug.Assert(
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
Filters\SaveTempDataPropertyFilterBase.cs (1)
70Debug.Assert(Subject != null, "Subject must be set before this method is invoked.");
Microsoft.AspNetCore.OpenApi (7)
Extensions\ApiDescriptionExtensions.cs (1)
44Debug.Assert(apiDescription.RelativePath != null, "Relative path cannot be null.");
Services\OpenApiDocumentService.cs (1)
233Debug.Assert(descriptions.Key != null, "Relative path mapped to OpenApiPath key cannot be null.");
Services\Schemas\OpenApiSchemaService.cs (1)
140Debug.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\PropertyAsParameterInfo.cs (1)
25Debug.Assert(propertyInfo != null, "PropertyInfo must be provided.");
Microsoft.AspNetCore.OutputCaching (1)
OutputCacheEntryFormatter.cs (1)
373Debug.Assert(reader.IsEOF, "should have read entire payload");
Microsoft.AspNetCore.ResponseCompression (1)
ResponseCompressionProvider.cs (1)
83Debug.Assert(false, "Duplicate check failed.");
Microsoft.AspNetCore.Rewrite (1)
ApacheModRewrite\ConditionEvaluator.cs (1)
52Debug.Assert(condResult != null, "ConditionEvaluator must be passed at least one condition to evaluate.");
Microsoft.AspNetCore.Routing (5)
Matching\ILEmitTrieFactory.cs (1)
524Debug.Assert(entries.Length == 1, "We should have a single entry");
Patterns\RoutePatternMatcher.cs (1)
434Debug.Assert(false, "indexOfLastSegementUsed should always be 0 from the check above");
RouteEndpointDataSource.cs (1)
213Debug.Assert(entry.InferMetadataFunc != null, "A func to infer metadata must be provided for route handlers.");
RouteOptions.cs (1)
34Debug.Assert(_endpointDataSources != null, "Endpoint data sources should have been set in DI.");
UriBuildingContext.cs (1)
137Debug.Assert(_lastValueOffset != -1, "Cannot invoke Remove more than once.");
Microsoft.AspNetCore.Server.HttpSys (25)
AsyncAcceptContext.cs (3)
138Debug.Assert(false, nameof(SetExpectCompletion)); // fail hard in debug 150Debug.Assert(false, nameof(CancelExpectCompletion)); // fail hard in debug 162Debug.Assert(false, nameof(ObserveCompletion)); // fail hard in debug
AuthenticationManager.cs (1)
87Debug.Assert(_urlGroup == null, "SetUrlGroupSecurity called more than once.");
HttpSysListener.cs (3)
263Debug.Assert(_serverSession != null, "ServerSessionHandle is null in CloseV2Config"); 264Debug.Assert(!_serverSession.Id.IsInvalid, "ServerSessionHandle is invalid in CloseV2Config"); 275Debug.Assert(_state != State.Stopped, "Listener has been stopped.");
MessagePump.cs (1)
104Debug.Assert(RequestContextFactory == null, "Start called twice!");
NativeInterop\SafeNativeOverlapped.cs (1)
36Debug.Assert(_boundHandle != null, "ReleaseHandle can't be called on SafeNativeOverlapped.Zero.");
NativeInterop\ServerSession.cs (1)
22Debug.Assert(serverSessionId != 0, "Invalid id returned by HttpCreateServerSession");
NativeInterop\UrlGroup.cs (3)
43Debug.Assert(urlGroupId != 0, "Invalid id returned by HttpCreateUrlGroup"); 89Debug.Assert(info != IntPtr.Zero, "SetUrlGroupProperty called with invalid pointer"); 193Debug.Assert(Id != 0, "HttpCloseUrlGroup called with invalid url group id");
RequestProcessing\Response.cs (2)
286Debug.Assert(!HasStarted, "HttpListenerResponse::SendHeaders()|SentHeaders is true."); 387Debug.Assert(!HasComputedHeaders, nameof(HasComputedHeaders) + " is true.");
RequestProcessing\ResponseBody.cs (3)
114Debug.Assert(!(endOfRequest && data.Count > 0), "Data is not supported at the end of the request."); 195Debug.Assert(!(addTrailers && chunked), "Trailers aren't currently supported for HTTP/1.1 chunking."); 272Debug.Assert(currentChunk == dataChunks.Length, "All chunks should be accounted for");
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (4)
119Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 128Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 177Debug.Assert(_nativeRequest != null, "RequestContextBase::ReleasePins()|ReleasePins() called twice."); 215Debug.Assert(_nativeRequest == null, "RequestContextBase::Dispose()|Dispose() called before ReleasePins().");
src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (1)
23Debug.Assert(rawUrlBytes.Length != 0, "Length of the URL cannot be zero.");
src\Shared\PathNormalizer\PathNormalizer.cs (1)
17Debug.Assert(src[0] == '/', "Path segment must always start with a '/'");
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (7)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
229Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
Microsoft.AspNetCore.Server.IIS (20)
Core\HttpRequestStream.cs (2)
62Debug.Assert(_body != null, "Stream must be accepting reads."); 75Debug.Assert(_body != null, "Stream must be accepting reads.");
Core\IISHttpServer.cs (1)
163Debug.Assert(server._iisContextFactory != null, "StartAsync must be called first.");
Core\IISServerAuthenticationHandlerInternal.cs (4)
24Debug.Assert(_iisHttpContext != null, "Handler must be initialized."); 25Debug.Assert(Scheme != null, "Handler must be initialized."); 41Debug.Assert(_context != null, "Handler must be initialized."); 51Debug.Assert(_context != null, "Handler must be initialized.");
Core\IO\AsyncIOEngine.Flush.cs (1)
30Debug.Assert(_requestHandler != null, "Must initialize first.");
Core\IO\AsyncIOEngine.Read.cs (1)
34Debug.Assert(_requestHandler != null, "Must initialize first.");
Core\IO\AsyncIOOperation.cs (1)
13private static readonly Action<object?> CallbackCompleted = _ => { Debug.Assert(false, "Should not be invoked"); };
Core\IO\AsyncWriteOperationBase.cs (1)
26Debug.Assert(_requestHandler != null, "Must initialize first.");
Core\IO\WebSocketsAsyncIOEngine.Initialize.cs (1)
28Debug.Assert(_requestHandler != null, "Must initialize first.");
Core\IO\WebSocketsAsyncIOEngine.Read.cs (1)
42Debug.Assert(_requestHandler != null, "Must initialize first.");
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (4)
119Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 128Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 177Debug.Assert(_nativeRequest != null, "RequestContextBase::ReleasePins()|ReleasePins() called twice."); 215Debug.Assert(_nativeRequest == null, "RequestContextBase::Dispose()|Dispose() called before ReleasePins().");
src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (1)
23Debug.Assert(rawUrlBytes.Length != 0, "Length of the URL cannot be zero.");
src\Shared\PathNormalizer\PathNormalizer.cs (1)
17Debug.Assert(src[0] == '/', "Path segment must always start with a '/'");
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 (75)
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 (7)
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\HttpProtocol.cs (1)
1347Debug.Assert(!HasResponseStarted, $"{nameof(SetErrorResponseHeaders)} called after response had already started.");
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 (6)
237Debug.Assert(_isClosed == 1, "Should only be set when connection is closed."); 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."); 1756Debug.Assert(staticTableIndex > 0, "Static table starts at 1.");
Internal\Http2\Http2FrameWriter.cs (4)
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");
Internal\Http3\Http3Connection.cs (1)
599Debug.Assert(persistentStateFeature != null, $"Required {nameof(IPersistentStateFeature)} not on stream context.");
Internal\Http3\Http3Stream.cs (1)
459Debug.Assert(staticTableIndex >= 0, "Static table starts at 0.");
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 (4)
54Debug.Assert(str.Length == 8, "String must be exactly 8 (ASCII) characters long."); 66Debug.Assert(str.Length == 4, "String must be exactly 4 (ASCII) characters long."); 78Debug.Assert(bytes.Length == 8, "Mask must be exactly 8 bytes long."); 330Debug.Assert(char.IsAscii(c), "Must already be validated");
Internal\Infrastructure\KestrelMetrics.cs (1)
446Debug.Assert(TryGetErrorType(reason, out _), "Overwrite should only be set for an error reason.");
Internal\Infrastructure\PipeWriterHelpers\ConcurrentPipeWriter.cs (1)
62Debug.Assert(_currentFlushTcs == null, "There should not be a pending flush.");
Internal\Infrastructure\ResourceCounter.cs (1)
64Debug.Assert(_count >= 0, "Resource count is negative. More resources were released than were locked.");
Internal\Infrastructure\TimeoutControl.cs (3)
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)
341Debug.Assert(Options.ConfigurationLoader != null, "Rebind can only happen when there is a ConfigurationLoader.");
Internal\SniOptionsSelector.cs (1)
154Debug.Assert(_fallbackServerCertificateSelector != null,
Internal\ThrowHelper.cs (1)
24Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
KestrelConfigurationLoader.cs (4)
50Debug.Assert(reloadOnChange || (certificatePathWatcher is null), "If reloadOnChange is false, then certificatePathWatcher should be null"); 288Debug.Assert(!!_loaded || _reloadToken is null, "Shouldn't have a reload token before first load"); 289Debug.Assert(!!ReloadOnChange || _reloadToken is null, "Shouldn't have a reload token unless reload-on-change is set"); 395Debug.Assert(o.EndpointConfig?.Certificate?.FileHasChanged != true, "Preserving an endpoint with file changes");
KestrelServerOptions.cs (2)
295Debug.Assert(ApplicationServices.GetRequiredService<IHttpsConfigurationService>().IsInitialized, "HTTPS configuration should have been enabled"); 397Debug.Assert(status.FailureMessage != null, "Status with a failure result must have a message.");
Middleware\HttpsConnectionMiddleware.cs (3)
253Debug.Assert(!certificate.HasPrivateKey, "This should only be called with certificates that don't have a private key"); 318Debug.Assert(_options != null, "Middleware must be created with options."); 414Debug.Assert(_options != null, "Middleware must be created with options.");
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
334Debug.Assert(IsCommandAvailable(OpenSslCommand), "How did we trust without the openssl command?");
src\Shared\Hpack\DynamicHPackEncoder.cs (4)
71Debug.Assert(!_pendingTableSizeUpdate, "Dynamic table size update should be encoded before headers."); 153Debug.Assert(headerSize <= _maxHeaderTableSize, "Header is bigger than dynamic table size."); 212Debug.Assert(headerSize <= _maxHeaderTableSize, "Header is bigger than dynamic table size."); 213Debug.Assert(headerSize <= _maxHeaderTableSize - _headerTableSize, "Not enough room in dynamic table.");
src\Shared\PathNormalizer\PathNormalizer.cs (1)
17Debug.Assert(src[0] == '/', "Path segment must always start with a '/'");
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\runtime\Http3\Frames\Http3Frame.cs (1)
43Debug.Assert(VariableLengthIntegerHelper.GetByteCount((long)frameType) == 1, $"{nameof(TryWriteFrameEnvelope)} assumes {nameof(frameType)} will fit within a single byte varint.");
src\Shared\runtime\Http3\Helpers\VariableLengthIntegerHelper.cs (1)
73Debug.Assert(value >= 0 && value <= EightByteLimit, "Serialized values are within [0, 2^62).");
src\Shared\runtime\Http3\QPack\QPackDecoder.cs (2)
428Debug.Assert(_state == State.CompressedHeaders, "Should be ready to parse a new header."); 646Debug.Assert(_stringOctets != null, "String buffer should have a value.");
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
229Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (2)
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
src\Shared\test\Shared.Tests\runtime\Http2\DynamicTableTest.cs (1)
149Debug.Assert((insertSize % 64) == 0, $"{nameof(insertSize)} must be a multiple of 64 ({nameof(HeaderField)}.{nameof(HeaderField.RfcOverhead)} * 2)");
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (1)
124Debug.Assert(streamId == 0 || streamId == -1, "StreamId sent that was non-zero, which isn't handled by tests");
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (4)
Internal\NamedPipeConnectionListener.cs (2)
63Debug.Assert(!stream.IsConnected, "Stream should have been successfully disconnected to reach this point."); 71Debug.Assert(_completeListeningTask == null, "Already started");
Internal\NamedPipeTransportFactory.cs (1)
28Debug.Assert(OperatingSystem.IsWindows(), "Named pipes transport requires a Windows operating system.");
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (2)
Internal\QuicConnectionContext.cs (1)
178Debug.Assert(cancellationToken.IsCancellationRequested, "Error requires cancellation is requested.");
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (2)
SocketConnectionListener.cs (1)
65Debug.Assert(_listenSocket != null, "Bind must be called first.");
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
Microsoft.AspNetCore.Shared.Tests (26)
runtime\Http2\DynamicTableTest.cs (1)
149Debug.Assert((insertSize % 64) == 0, $"{nameof(insertSize)} must be a multiple of 64 ({nameof(HeaderField)}.{nameof(HeaderField.RfcOverhead)} * 2)");
src\Shared\Hpack\DynamicHPackEncoder.cs (4)
71Debug.Assert(!_pendingTableSizeUpdate, "Dynamic table size update should be encoded before headers."); 153Debug.Assert(headerSize <= _maxHeaderTableSize, "Header is bigger than dynamic table size."); 212Debug.Assert(headerSize <= _maxHeaderTableSize, "Header is bigger than dynamic table size."); 213Debug.Assert(headerSize <= _maxHeaderTableSize - _headerTableSize, "Not enough room in dynamic table.");
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (4)
119Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 128Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 177Debug.Assert(_nativeRequest != null, "RequestContextBase::ReleasePins()|ReleasePins() called twice."); 215Debug.Assert(_nativeRequest == null, "RequestContextBase::Dispose()|Dispose() called before ReleasePins().");
src\Shared\HttpSys\RequestProcessing\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 (1)
17Debug.Assert(src[0] == '/', "Path segment must always start with a '/'");
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (3)
244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\runtime\Http3\Frames\Http3Frame.cs (1)
43Debug.Assert(VariableLengthIntegerHelper.GetByteCount((long)frameType) == 1, $"{nameof(TryWriteFrameEnvelope)} assumes {nameof(frameType)} will fit within a single byte varint.");
src\Shared\runtime\Http3\Helpers\VariableLengthIntegerHelper.cs (1)
73Debug.Assert(value >= 0 && value <= EightByteLimit, "Serialized values are within [0, 2^62).");
src\Shared\runtime\Http3\QPack\QPackDecoder.cs (2)
428Debug.Assert(_state == State.CompressedHeaders, "Should be ready to parse a new header."); 646Debug.Assert(_stringOctets != null, "String buffer should have a value.");
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
229Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
src\Shared\WebEncoders\WebEncoders.cs (1)
155Debug.Assert(arraySizeRequired % 4 == 0, "Invariant: Array length must be a multiple of 4.");
Microsoft.AspNetCore.SignalR.Common.Tests (2)
Internal\Protocol\MessagePackHubProtocolTestBase.cs (2)
465Debug.Assert(size < 16, "Test code doesn't support array sizes greater than 15"); 472Debug.Assert(size < 16, "Test code doesn't support string sizes greater than 15");
Microsoft.AspNetCore.SignalR.Core (6)
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");
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.");
StreamTracker.cs (1)
35Debug.Assert(RuntimeFeature.IsDynamicCodeSupported || !itemType.IsValueType, "HubMethodDescriptor ensures itemType is not a ValueType when PublishAot=true.");
Microsoft.AspNetCore.WebSockets (1)
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (1)
290Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.AspNetCore.WebUtilities (3)
MultipartReaderStream.cs (2)
237Debug.Assert(stream.FinalBoundaryFound || remainder.IsEmpty, "Un-expected data found on the boundary line: " + remainder.ToString()); 323Debug.Assert(stream.FinalBoundaryFound || string.Equals(string.Empty, remainder, StringComparison.Ordinal), "Un-expected data found on the boundary line: " + remainder);
src\Shared\WebEncoders\WebEncoders.cs (1)
155Debug.Assert(arraySizeRequired % 4 == 0, "Invariant: Array length must be a multiple of 4.");
Microsoft.Build (29)
BackEnd\BuildManager\BuildManager.cs (1)
1018Debug.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)
161Debug.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)
1724Debug.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)
862Debug.Assert(FileUtilities.PathsEqual(searchToExclude.BaseDirectory, recursionState.BaseDirectory), "Expected exclude search base directory to match include search base directory"); 2526Debug.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)
275Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?"); 470Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?");
Microsoft.Build.Framework (20)
ArraySortHelper.cs (3)
63Debug.Assert(comparer != null, "Check the arguments in the caller!"); 82Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 338Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
BuildException\BuildExceptionBase.cs (1)
112Debug.Assert((exception.Data?.Count ?? 0) == 0,
ChangeWaves.cs (1)
173Debug.Assert(_runningTests || AllWaves.Contains(wave), $"Change wave version {wave} is invalid");
HashHelpers.cs (1)
89Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
ReuseableStringBuilder.cs (1)
326Debug.Assert(returningBuilder.Capacity > returning._borrowedWithCapacity, "Capacity can only increase");
SegmentedArray.cs (1)
483Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
SegmentedArrayHelper.cs (1)
120Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
SegmentedDictionary`2.cs (10)
236Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 237Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 337Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 482Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 618Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 650Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 687Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 709Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 759Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 783Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
StringBuilderCache.cs (1)
92Debug.Assert(StringBuilderCache.t_cachedInstance == null, "Unexpected replacing of other StringBuilder.");
Microsoft.Build.Tasks.CodeAnalysis (13)
CommandLineBuilderExtension.cs (1)
240Debug.Assert(treatAsFlags == null
Csc.cs (1)
799Debug.Assert(HostObject != null, "We should not be here if the host object has not been set.");
RCWForCurrentContext.cs (1)
52Debug.Assert(objInCurrentCtx != null, "Unable to marshal COM Object to the current context (apartment). This will hurt performance.");
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\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
133Debug.Assert(false, "Unreachable");
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!");
Microsoft.Build.Tasks.Core (39)
AssemblyDependency\CandidateAssemblyFilesResolver.cs (1)
88Debug.Assert(considered.Reason != NoMatchReason.Unknown, "Expected a no match reason here.");
AssemblyDependency\Reference.cs (4)
210Debug.Assert(dependee.FullPath.Length > 0, "Cannot add dependee that doesn't have a full name. This should have already been resolved."); 424Debug.Assert(filenameExtension[0] == '.', "Expected extension to start with '.'"); 445Debug.Assert(!Path.IsPathRooted(filename), "Satellite path should be relative to the current reference."); 457Debug.Assert(!Path.IsPathRooted(filename), "Serialization assembly path should be relative to the current reference.");
AssemblyDependency\ResolveAssemblyReference.cs (6)
1669Debug.Assert(false, "Should have handled this case."); 1714Debug.Assert(false, "Unexpected exception type."); 1852Debug.Assert(false, "Should have handled this case."); 1970Debug.Assert(false, "Should have handled this case."); 2009Debug.Assert(!reference.IsPrimary, "A primary reference should never lose a conflict because of version. This is an insoluble conflict instead."); 2040Debug.Assert(false, "Should have handled this case.");
AssignCulture.cs (1)
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, string.Format(CultureInfo.CurrentCulture, "Unable to find a package node in {0}", strLangManifestFilename)); 1258Debug.Assert(false, "Specified key does not exist for node " + nextNode.InnerXml); 1564Debug.Assert(sourceAttribute != null, "we should not be here if there is no ProductCode attribute"); 1986Debug.Assert(s != null, String.Format(CultureInfo.CurrentCulture, "EmbeddedResource '{0}' not found", name));
CSharptokenEnumerator.cs (2)
96Debug.Assert(false, "Code defect in tokenizer: Should have yielded a closing tick."); 160Debug.Assert(false, "Defect in tokenizer: Should have yielded a terminating quote.");
FileMatcher.cs (2)
862Debug.Assert(FileUtilities.PathsEqual(searchToExclude.BaseDirectory, recursionState.BaseDirectory), "Expected exclude search base directory to match include search base directory"); 2526Debug.Assert(excludeState.SearchData.RegexFileMatch != null || excludeState.SearchData.DirectoryPattern != null,
InterningBinaryReader.cs (1)
173Debug.Assert(false, e.ToString());
ManifestUtil\Manifest.cs (1)
528Debug.Assert(false, "AssemblyName cannot be empty");
ManifestUtil\TrustInfo.cs (1)
318Debug.Assert(document != null, "GetPermissionSetElement was passed a null document");
ManifestUtil\Util.cs (1)
220Debug.Assert(s != null, String.Format(CultureInfo.CurrentCulture, "EmbeddedResource '{0}' not found", name));
RedistList.cs (1)
862Debug.Assert(isValidEntry, string.Format(CultureInfo.InvariantCulture, "Missing attribute in redist file: {0}, line #{1}", path,
ResGenDependencies.cs (3)
370Debug.Assert(outputFiles != null, "OutputFiles hasn't been set"); 395Debug.Assert(OutputFiles != null, "This has not been initialized"); 396Debug.Assert(otherLibrary.OutputFiles != null, "The other library has not been initialized");
ResolveManifestFiles.cs (4)
349Debug.Assert(!String.IsNullOrEmpty(itemCulture), String.Format(CultureInfo.CurrentCulture, "Satellite item '{0}' is missing expected attribute '{1}'", item.ItemSpec, "Culture")); 865Debug.Assert(!_dictionary.ContainsKey(key), String.Format(CultureInfo.CurrentCulture, "Two or more items with same key '{0}' detected", key)); 924Debug.Assert(!_dictionary.ContainsKey(key), String.Format(CultureInfo.CurrentCulture, "Two or more items with same key '{0}' detected", key)); 965Debug.Assert(!_dictionary.ContainsKey(key), String.Format(CultureInfo.CurrentCulture, "Two or more items with same '{0}' attribute detected", ItemMetadataNames.targetPath));
SystemState.cs (1)
654Debug.Assert(false, "Using slow-path in SystemState.GetDirectories, was this intentional?");
Microsoft.Build.Tasks.UnitTests (1)
QuotingUtilities.cs (1)
91Debug.Assert(false, "Null character in parameter");
Microsoft.Build.Utilities.Core (6)
CommandLineBuilder.cs (1)
201Debug.Assert(!hasAllUnquotedCharacters || !hasSomeQuotedCharacters,
FileMatcher.cs (2)
862Debug.Assert(FileUtilities.PathsEqual(searchToExclude.BaseDirectory, recursionState.BaseDirectory), "Expected exclude search base directory to match include search base directory"); 2526Debug.Assert(excludeState.SearchData.RegexFileMatch != null || excludeState.SearchData.DirectoryPattern != null,
TaskLoggingHelper.cs (2)
275Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?"); 470Debug.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)
1234Debug.Assert(this.RealizedIL.IsDefault, "Too late to allocate a new IL marker"); 1259Debug.Assert(!RealizedIL.IsDefault, "Builder must be realized to perform this operation"); 1260Debug.Assert(_allocatedILMarkers != null, "There are not markers in this builder"); 1261Debug.Assert(ilMarker >= 0 && ilMarker < _allocatedILMarkers.Count, "Wrong builder?");
CodeGen\ILBuilderEmit.cs (9)
34Debug.Assert(!code.IsControlTransfer(), 135Debug.Assert(labelInfo.bb == null, "duplicate use of a label"); 147Debug.Assert(curStack == labelStack, "forward branches and fall-through must agree on stack depth"); 192Debug.Assert(labelInfo.stack == _emitState.CurStack, "branches to same label with different stacks"); 292Debug.Assert(ld.stack == curStack, "branches to same label with different stacks"); 365Debug.Assert(!arrayType.IsSZArray, "should be used only with multidimensional arrays"); 379Debug.Assert(!arrayType.IsSZArray, "should be used only with multidimensional arrays"); 393Debug.Assert(!arrayType.IsSZArray, "should be used only with multidimensional arrays"); 407Debug.Assert(!arrayType.IsSZArray, "should be used only with multidimensional arrays");
CodeGen\PrivateImplementationDetails.cs (1)
387Debug.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)
1603Debug.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\ExceptionUtilities.cs (1)
22Debug.Assert(false, output);
InternalUtilities\FatalError.cs (1)
48Debug.Assert(s_handler == null, "Handler already set");
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)
493Debug.Assert(emittedTypeName != null, "NULL actual name unexpected!!!"); 555Debug.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)
3877Debug.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)
2352Debug.Assert(offset % ManagedPEBuilder.MappedFieldDataAlignment == 0, "Expected last write to end at alignment boundary"); 2353Debug.Assert(ManagedPEBuilder.MappedFieldDataAlignment == 8, "Expected alignment to be 8");
PEWriter\NativeResourceWriter.cs (2)
195Debug.Assert(typeDirectory.NumberOfIdEntries == 0, "Not all Win32 resources with types encoded as strings precede those encoded as ints"); 213Debug.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)
761Debug.Assert(_currentState.HasValue, "Created a builder with no values?"); 762Debug.Assert(_items.Count >= 1, "Created a builder with no values?");
src\Dependencies\Collections\Internal\ArraySortHelper.cs (3)
65Debug.Assert(comparer != null, "Check the arguments in the caller!"); 84Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 341Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\Dependencies\Collections\Internal\HashHelpers.cs (1)
89Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
154Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\Dependencies\Collections\SegmentedArray.cs (1)
489Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\Dependencies\Collections\SegmentedDictionary`2.cs (10)
299Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 300Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 406Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 519Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 614Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 646Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 705Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 732Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 782Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 811Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\Dependencies\Collections\SegmentedHashSet`1.cs (10)
202Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 203Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 225Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 294Debug.Assert(entries.Length > 0, "entries should be non-empty"); 324Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 899Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 1024Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1089Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1170Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1327Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
275Debug.Assert(obj != null, "freeing null?"); 277Debug.Assert(_firstItem != obj, "freeing twice?"); 288Debug.Assert(value != obj, "freeing twice?");
Syntax\GreenNode.cs (4)
579Debug.Assert(found, "We must be able to find annotations since we had the bit set on ourselves"); 580Debug.Assert(annotations != null, "annotations should not be null"); 581Debug.Assert(annotations != s_noAnnotations, "annotations should not be s_noAnnotations"); 582Debug.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)
73Debug.Assert(item.IsNode, "Node missing in separated list."); 77Debug.Assert(item.IsToken, "Separator token missing in separated list."); 148Debug.Assert(node.IsList, "separated list cannot be a singleton separator");
Syntax\SyntaxNode.cs (3)
479Debug.Assert(!triviaContainsMatch(current.GetLeadingTriviaCore(), rawKind), "Should not have a match if the token doesn't even have leading trivia"); 482Debug.Assert(!triviaContainsMatch(current.GetTrailingTriviaCore(), rawKind), "Should never have a match in trailing trivia"); 764Debug.Assert(childNodeOrToken.FullSpan.Contains(position), "ChildThatContainsPosition's return value does not contain the requested position.");
Syntax\SyntaxNodeOrToken.cs (6)
46Debug.Assert(!node.Green.IsList, "node cannot be a list"); 54Debug.Assert(parent == null || !parent.Green.IsList, "parent cannot be a list"); 55Debug.Assert(token != null || (parent == null && position == 0 && index == 0), "parts must form a token"); 56Debug.Assert(token == null || token.IsToken, "token must be a token"); 57Debug.Assert(index >= 0, "index must not be negative"); 58Debug.Assert(parent == null || token != null, "null token cannot have parent");
Syntax\SyntaxToken.cs (3)
30Debug.Assert(parent == null || !parent.Green.IsList, "list cannot be a parent"); 31Debug.Assert(token == null || token.IsToken, "token must be a token"); 41Debug.Assert(token == null || token.IsToken, "token must be a token");
Syntax\SyntaxTreeExtensions.cs (1)
80Debug.Assert(false, message);
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\ExceptionUtilities.cs (1)
22Debug.Assert(false, output);
src\Compilers\Core\Portable\InternalUtilities\FatalError.cs (1)
48Debug.Assert(s_handler == null, "Handler already set");
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
133Debug.Assert(false, "Unreachable");
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
80Debug.Assert(false, message);
src\Dependencies\Collections\Internal\ArraySortHelper.cs (3)
65Debug.Assert(comparer != null, "Check the arguments in the caller!"); 84Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 341Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\Dependencies\Collections\Internal\HashHelpers.cs (1)
89Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
154Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\Dependencies\Collections\SegmentedArray.cs (1)
489Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\Dependencies\Collections\SegmentedDictionary`2.cs (10)
299Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 300Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 406Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 519Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 614Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 646Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 705Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 732Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 782Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 811Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\Dependencies\Collections\SegmentedHashSet`1.cs (10)
202Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 203Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 225Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 294Debug.Assert(entries.Length > 0, "entries should be non-empty"); 324Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 899Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 1024Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1089Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1170Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1327Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
275Debug.Assert(obj != null, "freeing null?"); 277Debug.Assert(_firstItem != obj, "freeing twice?"); 288Debug.Assert(value != obj, "freeing twice?");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (8)
86Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 90Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 99Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 108Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 118Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 122Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 148Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 154Debug.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)
183Debug.Assert(value == null || !value.GetType().GetTypeInfo().IsEnum, "Enum should not be written with WriteValue. Write them as ints instead."); 193Debug.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)
491Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 498Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 531Debug.Assert(_completionRefCount == 0, $"Expected {nameof(_completionRefCount)} == 0, got {_completionRefCount}"); 559Debug.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)
96Debug.Assert(false, "All conflict markers should start at the beginning of a line.");
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
197Debug.Assert(false, message + ". " + diagnostics);
Microsoft.CodeAnalysis.Collections.Package (26)
Internal\ArraySortHelper.cs (3)
65Debug.Assert(comparer != null, "Check the arguments in the caller!"); 84Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 341Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
Internal\HashHelpers.cs (1)
89Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
Internal\SegmentedArrayHelper.cs (1)
154Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
SegmentedArray.cs (1)
489Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
SegmentedDictionary`2.cs (10)
299Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 300Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 406Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 519Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 614Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 646Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 705Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 732Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 782Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 811Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
SegmentedHashSet`1.cs (10)
202Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 203Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 225Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 294Debug.Assert(entries.Length > 0, "entries should be non-empty"); 324Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 899Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 1024Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1089Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1170Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1327Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
Microsoft.CodeAnalysis.CSharp (294)
Binder\Binder.ValueChecks.cs (2)
4322Debug.Assert(conversion.ConversionKind != ConversionKind.StackAllocToSpanType, "StackAllocToSpanType unexpected"); 5099Debug.Assert(conversion.ConversionKind != ConversionKind.StackAllocToSpanType, "StackAllocToSpanType unexpected");
Binder\Binder_Attributes.cs (1)
308Debug.Assert(!constructorArgsArray.IsDefault, "Property of VisitArguments");
Binder\Binder_Conversions.cs (3)
2479Debug.Assert(targetElementTypes.Length == arguments.Length, "converting a tuple literal to incompatible type?"); 2811Debug.Assert(delegateType is NamedTypeSymbol { TypeKind: TypeKind.Delegate, DelegateInvokeMethod: { HasUseSiteError: false } } 3041Debug.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."); 829Debug.Assert(candidate.GetMemberArity() != 0 || candidate.Name == WellKnownMemberNames.InstanceConstructorName || arity == 0,
Binder\Binder_Expressions.cs (3)
2441Debug.Assert(result.IsSingleViable, "If this happens, we need to deal with multiple label definitions."); 2795Debug.Assert(originalUserDefinedConversions.Length == 0, 7842Debug.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)
1288Debug.Assert(!method.HasUseSiteError, "Shouldn't have reached this point if there were use site errors."); 1850Debug.Assert(d is not DiagnosticWithInfo { HasLazyInfo: true }, "Adjust the Arguments access to handle lazy diagnostics to avoid cycles.");
Binder\Binder_Lookup.cs (2)
1178Debug.Assert(!originalBinder.InCref, "Can't dot into type parameters, so how can this happen?"); 1581Debug.Assert(symbol.Kind != SymbolKind.Alias, "It is the caller's responsibility to unwrap aliased symbols.");
Binder\Binder_Operators.cs (3)
2537Debug.Assert((object)operandType != null, "BindValue should have caught a null operand type"); 3063Debug.Assert(false, "Should be handled separately."); 3806Debug.Assert(!targetType.IsPointerOrFunctionPointer(), "Should have been caught above");
Binder\Binder_Statements.cs (11)
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"); 2726Debug.Assert(resultKind == LookupResultKind.Empty, "How could overload resolution fail if a user-defined true operator was found?"); 2727Debug.Assert(originalUserDefinedOperators.IsEmpty, "How could overload resolution fail if a user-defined true operator was found?"); 3726Debug.Assert(initializerInvocation.HasAnyErrors || constructorInitializer.IsConstructorInitializer(), "Please keep this bound node in sync with BoundNodeExtensions.IsConstructorInitializer."); 3794Debug.Assert(initializerInvocation.HasAnyErrors || constructorInitializer.IsConstructorInitializer(), "Please keep this bound node in sync with BoundNodeExtensions.IsConstructorInitializer."); 3811Debug.Assert(initializerInvocation.HasAnyErrors || constructorInitializer.IsConstructorInitializer(), "Please keep this bound node in sync with BoundNodeExtensions.IsConstructorInitializer.");
Binder\Binder_Symbols.cs (8)
1657Debug.Assert((object)typeSymbol != null, "Expect an error type if special type isn't found"); 1665Debug.Assert((object)typeSymbol != null, "Expect an error type if special type isn't found"); 1794Debug.Assert((object)typeSymbol != null, "Expect an error type if well-known type isn't found"); 1806Debug.Assert((object)typeSymbol != null, "Expect an error type if well-known type isn't found"); 2032Debug.Assert(!Symbol.Equals(originalSymbols[best.Index], originalSymbols[secondBest.Index], TypeCompareKind.ConsiderEverything) || options.IsAttributeTypeLookup(), 2035Debug.Assert(!Symbol.Equals(first, second, TypeCompareKind.ConsiderEverything) || !Symbol.Equals(originalSymbols[best.Index], originalSymbols[secondBest.Index], TypeCompareKind.ConsiderEverything), 2190Debug.Assert(originalSymbols[best.Index].Name != originalSymbols[secondBest.Index].Name || 2648Debug.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?"); 855Debug.Assert(!inUsing || inBody, "inUsing => inBody"); 1052Debug.Assert(BitArithmeticUtilities.CountBits((uint)usage) <= 1, "Not a flags enum."); 1143Debug.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)
549Debug.Assert((object)collectionConversionClassification.Method == null, 551Debug.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)
248Debug.Assert(oldLocation != newLocation || oldLocation == Location.None || newLocation.SourceTree?.GetRoot().ContainsDiagnostics == true, 317Debug.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)
382Debug.Assert((object)delegateInvokeMethod != null && !delegateInvokeMethod.HasUseSiteError,
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (1)
1374Debug.Assert((kind & ~BinaryOperatorKind.Checked) == kind, "Did not expect operator to be checked. Consider using .Operator() to mask.");
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (4)
903Debug.Assert((object)argument.Type == null, "should not need to dig into elements if tuple has natural type"); 1390Debug.Assert((object)delegateType.DelegateInvokeMethod != null && !delegateType.DelegateInvokeMethod.HasUseSiteError, 1444Debug.Assert(method is { HasUseSiteError: false }, 3037Debug.Assert((object)target.DelegateInvokeMethod != null && !target.DelegateInvokeMethod.HasUseSiteError,
Binder\Semantics\OverloadResolution\OverloadResolution.cs (1)
4637Debug.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, 1318Debug.Assert((object)parameter == unwrapIfParamsCollection(badArg, parameter, isLastParameter), "If they ever differ, just call the method when constructing the diagnostic."); 1401Debug.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?"); 1460Debug.Assert(nValid == 0, "Why are we doing error reporting on an overload resolution problem that had one valid result?");
Binder\WithCrefTypeParametersBinder.cs (1)
127Debug.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 (1)
66Debug.Assert(value >= 0, "Id must be non-negative but was set to " + value);
BoundTree\BoundExpression.cs (3)
676Debug.Assert(valueSymbol != null, "Field 'valueSymbol' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)"); 677Debug.Assert(valueExpression != null, "Field 'valueExpression' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)"); 678Debug.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 (1)
546Debug.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)
370Debug.Assert(inits.All((init) => init.Kind != BoundKind.ArrayInitialization) || 433Debug.Assert(inPlaceTarget is null || TargetIsNotOnHeap(inPlaceTarget), "in-place construction target should not be on heap"); 586Debug.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"); 3866Debug.Assert(expr.LeftConversion is null, "coalesce with nontrivial left conversions are lowered into conditional."); 4080Debug.Assert(useKind == UseKind.Unused, "Using the return value of a void method."); 4081Debug.Assert(_method.GenerateDebugInfo, "Implied by this.emitSequencePoints");
CodeGen\EmitStackAllocInitializer.cs (1)
172Debug.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)
615Debug.Assert(EvalStackIsEmpty(), "entering blocks when evaluation stack is not empty?"); 794Debug.Assert(localUsedWalker.IsLocalUsedIn(assignment.Right), "who assigns the temp?"); 929Debug.Assert(_context != ExprContext.AssignmentTarget, "assignment expression cannot be a target of another assignment"); 939Debug.Assert(_context == ExprContext.Value || 973Debug.Assert( 979Debug.Assert(!isIndirectAssignment, "indirect assignment is a read, not a write"); 1030Debug.Assert(!node.IsRef || 1037Debug.Assert(lhs.Type.IsValueType, "'this' is assignable only in structs"); 1057Debug.Assert(((BoundCall)lhs).Method.RefKind == RefKind.Ref, "only ref returning methods are assignable"); 1061Debug.Assert(((BoundFunctionPointerInvocation)lhs).FunctionPointer.Signature.RefKind == RefKind.Ref, "only ref returning function pointers are assignable"); 1065Debug.Assert(((BoundConditionalOperator)lhs).IsRef, "only ref ternaries are assignable"); 1069Debug.Assert(((BoundAssignmentOperator)lhs).IsRef, "only ref assignments are assignable"); 1073Debug.Assert(!IsIndirectAssignment(node.Update(((BoundSequence)node.Left).Value, node.Right, node.IsRef, node.Type)), 1389Debug.Assert(false, "we should not have label expressions at this stage"); 1395Debug.Assert(false, "we should not have is-pattern expressions at this stage"); 1401Debug.Assert(node.CaseExpressionOpt == null, "we should not have label expressions at this stage"); 1874Debug.Assert(local.RefKind == RefKind.None, "cannot take a ref of a ref"); 2010Debug.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)
1357Debug.Assert(position == CheckAndAdjustPosition(position), "Expected adjusted position"); 1565Debug.Assert((options & LookupOptions.UseBaseReferenceAccessibility) == 0, "Use the useBaseReferenceAccessibility parameter."); 1940Debug.Assert(ReferenceEquals(lowestBoundNode, highestBoundNode), "How is it that this operator has the same syntax node as its operand?"); 4114Debug.Assert(symbol.IsIndexer(), "Only indexers can have name " + WellKnownMemberNames.Indexer); 4897Debug.Assert(((options & SymbolInfoOptions.PreferConstructorsToType) != 0) != 4899Debug.Assert(((options & SymbolInfoOptions.ResolveAliases) != 0) !=
Compilation\MemberSemanticModel.cs (6)
885Debug.Assert(this.GetMemberModel(lambda) == null, "Did not find a unique LambdaSymbol for lambda in member."); 1217Debug.Assert(IsInTree(node), "Since the node is in the tree, we can always recompute the binder later"); 1240Debug.Assert(IsInTree(node), "Since the node is in the tree, we can always recompute the binder later"); 1252Debug.Assert(IsInTree(node), "Since the node is in the tree, we can always recompute the binder later"); 1378Debug.Assert(current != null, "Why are we being asked to find an enclosing lambda outside of our root?"); 1534Debug.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)
1766Debug.Assert(name is not null, "Should only be looking for a known namespace by name."); 1767Debug.Assert(namespaces is [NamespaceSymbol], "Namespace declarations of the same name are expected to appear as a single merged symbol."); 1771Debug.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)
1328Debug.Assert(false, "Didn't expect nesting to reach depth " + depth); 1363Debug.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)
2352Debug.Assert(initializerInvocation.HasAnyErrors || constructorInitializer.IsConstructorInitializer(), "Please keep this bound node in sync with BoundNodeExtensions.IsConstructorInitializer.");
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)
791Debug.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)
205Debug.Assert(length >= 0, "last comes before first");
FlowAnalysis\DefiniteAssignment.cs (3)
288Debug.Assert(variableId.Symbol.Kind == SymbolKind.Field || variableId.Symbol.Kind == SymbolKind.Property || variableId.Symbol.Kind == SymbolKind.Event, 314Debug.Assert( 615Debug.Assert(newCode != oldCode || oldCode == ErrorCode.ERR_InsufficientStack, oldCode.ToString());
FlowAnalysis\NullableWalker.cs (1)
5950Debug.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)
1077Debug.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)
286Debug.Assert(body != null, "we should have either sub-dispatch or a handler"); 356Debug.Assert(node.Label == proxyLabel || !(F.CurrentFunction is IteratorFinallyMethodSymbol), "should not be proxying branches in finally"); 362Debug.Assert(node.Label == _currentFinallyFrame.ProxyLabelIfNeeded(node.Label), "conditional leave?"); 383Debug.Assert(node.CatchBlocks.IsEmpty, "try with yields must have no catches"); 384Debug.Assert(node.FinallyBlockOpt != null, "try with yields must have finally"); 392Debug.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)
117Debug.Assert(node.Type.SpecialType == SpecialType.System_String, "Non-string binary addition should have been handled by VisitConversion or VisitArguments"); 1004Debug.Assert(yNonNull is null, "Handled by trivial optimization above; otherwise we should use yNonNull here."); 1017Debug.Assert(xNonNull is null, "Handled by trivial optimization above; otherwise we should use xNonNull here.");
Lowering\LocalRewriter\LocalRewriter_Call.cs (2)
610Debug.Assert(false, "Unexpected conversion kind" + conv.ConversionKind); 1014Debug.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\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (1)
193Debug.Assert(!_inExpressionLambda, "Expression trees do not support extension Add");
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (1)
817Debug.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)
4832Debug.Assert(typeParameterList == null, "Exit condition of ParseMemberName in this scenario"); 6597Debug.Assert(!ReferenceEquals(tmp, explicitInterfaceName), "We should have consumed something and updated explicitInterfaceName");
Parser\Lexer.cs (8)
1719Debug.Assert(consumedSurrogate == SlidingTextWindow.InvalidCharacter, "Since consumedChar == '\\'"); 3283Debug.Assert(false, "Should have picked up leading indentationTrivia, but didn't."); 3299Debug.Assert(false, "Should have picked up leading indentationTrivia, but didn't."); 3691Debug.Assert(TextWindow.Position > beforeConsumed, "First character or entity has been consumed."); 3802Debug.Assert(info.Text == null, "Haven't tried to set it yet."); 3803Debug.Assert(info.StringValue == null, "Haven't tried to set it yet."); 4606Debug.Assert(info == null, "Never produce a diagnostic while peeking."); 4614Debug.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)
72Debug.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)
97Debug.Assert(result != s_noUncommonProperties || result.IsDefaultValue(), "default value was modified");
Symbols\MethodSymbol.cs (1)
1274Debug.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)
89Debug.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)
651Debug.Assert((object)compilationRelaxationsAttribute != null, "GetWellKnownType unexpectedly returned null"); 660Debug.Assert((object)runtimeCompatibilityAttribute != null, "GetWellKnownType unexpectedly returned null"); 693Debug.Assert((object)unverifiableCodeAttribute != null, "GetWellKnownType unexpectedly returned null"); 705Debug.Assert((object)securityPermissionAttribute != null, "GetWellKnownType unexpectedly returned null"); 712Debug.Assert((object)securityAction != null, "GetWellKnownType unexpectedly returned null"); 2642Debug.Assert( 2650Debug.Assert(_unusedFieldWarnings.IsDefault, "We shouldn't have computed the diagnostics if we're still noting definitions."); 2671Debug.Assert(this.HasComplete(CompletionPart.Module), 2693Debug.Assert(success, "Once CompletionPart.Module is set, no-one should be modifying the map."); 2838Debug.Assert((object)originalDefinition.ContainingType == null, "How did a nested type get forwarded?");
Symbols\Source\SourceMemberContainerSymbol.cs (2)
2401Debug.Assert(field.AssociatedSymbol is not EventSymbol, "Didn't expect to find a field-like event backing field in the member list."); 2715Debug.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)
169Debug.Assert(!this.IsFixedSizeBuffer, "Subclasses representing fixed fields must override"); 325Debug.Assert(!this.IsFixedSizeBuffer, "Subclasses representing fixed fields must override");
Symbols\Source\SourceNamedTypeSymbol.cs (2)
88Debug.Assert(false, "bad declaration kind"); 1696Debug.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 (1)
635Debug.Assert(this.MethodKind != MethodKind.UserDefinedOperator, "SourceUserDefinedOperatorSymbolBase overrides this");
Symbols\Source\SourcePropertyAccessorSymbol.cs (1)
196Debug.Assert(!_property.IsExpressionBodied, "Cannot have accessors in expression bodied lightweight properties");
Symbols\Symbol.cs (2)
204Debug.Assert(!(this is SourceAssemblySymbol), "SourceAssemblySymbol must override DeclaringCompilation"); 207Debug.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)
69Debug.Assert(compilation != null, "SynthesizedClass is not contained in a source module?");
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)
652Debug.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)
104Debug.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)
2255Debug.Assert(currentNode != null, "binding should be enclosed in a conditional access");
Microsoft.CodeAnalysis.CSharp.CodeStyle (6)
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\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
872Debug.Assert(name != null, "Unexpected node type " + node.Kind());
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)
510Debug.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)
47Debug.Assert(whenClause == null || section.Labels.Length == 1, "We shouldn't have guards when we're combining multiple cases into a single arm"); 52Debug.Assert(label.Guards.Length == 0, "We shouldn't have guards when we're combining multiple cases into a single arm");
NavigationBar\CSharpNavigationBarItemService.cs (1)
88Debug.Assert(member is IMethodSymbol { PartialDefinitionPart: null } or IPropertySymbol { 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.Test.Utilities (1)
CSharpTestBase.cs (1)
2108Debug.Assert(syntaxNode is not null, "Did you forget to place /*<bind>*/ comments in your source?");
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
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\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
872Debug.Assert(name != null, "Unexpected node type " + node.Kind());
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.EditorFeatures (3)
AutomaticCompletion\BraceCompletionSessionProvider.BraceCompletionSession.cs (2)
385Debug.Assert(caretPoint.Snapshot == endPoint.Snapshot, "snapshots do not match"); 417Debug.Assert(afterBrace.HasValue, "Unable to move caret to closing point");
Tagging\AbstractAsynchronousTaggerProvider.TagSource_ProduceTags.cs (1)
462Debug.Assert(snapshot.Version.Next == null, "should be on latest snapshot");
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (6)
AbstractTypeParameterChecker.cs (1)
34Debug.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)
41Debug.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\Compilers\Core\Portable\InternalUtilities\ExceptionUtilities.cs (1)
22Debug.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\ExceptionUtilities.cs (1)
22Debug.Assert(false, output);
src\Compilers\Core\Portable\InternalUtilities\FatalError.cs (1)
48Debug.Assert(s_handler == null, "Handler already set");
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
133Debug.Assert(false, "Unreachable");
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
275Debug.Assert(obj != null, "freeing null?"); 277Debug.Assert(_firstItem != obj, "freeing twice?"); 288Debug.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)
522Debug.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)
231Debug.Assert(rawValue != null || this.Type.GetLmrType().IsVoid(), "In our mock system, this should only happen for void."); 240Debug.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\ExceptionUtilities.cs (1)
22Debug.Assert(false, output);
src\Compilers\Core\Portable\InternalUtilities\FatalError.cs (1)
48Debug.Assert(s_handler == null, "Handler already set");
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
133Debug.Assert(false, "Unreachable");
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
275Debug.Assert(obj != null, "freeing null?"); 277Debug.Assert(_firstItem != obj, "freeing twice?"); 288Debug.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)
522Debug.Assert((underlyingType.BaseType != null) || underlyingType.IsPointer || underlyingType.IsArray, "BaseType should only return null if the underlyingType is a pointer or array.");
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 (12)
ChangeSignature\AbstractChangeSignatureService.cs (1)
450Debug.Assert(false, "Change Signature: Attempted to modify node twice with different semantic parameters.");
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (1)
115Debug.Assert(document.Name != FileName, $"New document name is same as old document name:{FileName}");
Completion\CompletionService_GetCompletions.cs (1)
218Debug.Assert(lspProvider.TriggerCharacters.Contains(character),
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
521Debug.Assert(containingType != null,
DocumentationComments\AbstractDocumentationCommentSnippetService.cs (1)
446Debug.Assert(trimmedPreviousLine.StartsWith(ExteriorTriviaText), "Unexpected: previous line does not begin with doc comment exterior trivia.");
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
6505Debug.Assert(!self.FullSpan.Contains(position), "Position is valid. How could we not find a child?");
ExtractInterface\AbstractExtractInterfaceService.cs (1)
419Debug.Assert(false, string.Format(FeaturesResources.Unexpected_interface_member_kind_colon_0, member.Kind.ToString()));
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
143Debug.Assert(false, "How?");
Shared\Utilities\ExtractTypeHelpers.cs (1)
218Debug.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)
96Debug.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 (2)
EditAndContinue\SyntaxMapDescription.cs (2)
22Debug.Assert(match != null, "Must be created from edit script"); 30Debug.Assert(match != null, "Must be created from edit script");
Microsoft.CodeAnalysis.InteractiveHost (9)
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\ExceptionUtilities.cs (1)
22Debug.Assert(false, output);
src\Compilers\Core\Portable\InternalUtilities\FatalError.cs (1)
48Debug.Assert(s_handler == null, "Handler already set");
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
275Debug.Assert(obj != null, "freeing null?"); 277Debug.Assert(_firstItem != obj, "freeing twice?"); 288Debug.Assert(value != obj, "freeing twice?");
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)
364Debug.Assert(!concurrentlyExecutingTasks.Any(t => !t.Key.IsCompleted), "The tasks should have all been drained before continuing");
Microsoft.CodeAnalysis.PooledObjects.Package (3)
ObjectPool`1.cs (3)
275Debug.Assert(obj != null, "freeing null?"); 277Debug.Assert(_firstItem != obj, "freeing twice?"); 288Debug.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)
241Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 249Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 310Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 317Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 329Debug.Assert(underlyingLValue IsNot Nothing, "Field 'underlyingLValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 330Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 369Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 376Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 388Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 395Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 407Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 414Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 440Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 447Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 473Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 485Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 513Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 525Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 589Debug.Assert(Not (symbols.IsDefault), "Field 'symbols' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 590Debug.Assert(Not (childBoundNodes.IsDefault), "Field 'childBoundNodes' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 645Debug.Assert(Not (childBoundNodes.IsDefault), "Field 'childBoundNodes' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 679Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 718Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 760Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 761Debug.Assert(Not (indices.IsDefault), "Field 'indices' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 762Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 817Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 818Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 852Debug.Assert(sourceType IsNot Nothing, "Field 'sourceType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 853Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 895Debug.Assert(field IsNot Nothing, "Field 'field' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 896Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 904Debug.Assert(field IsNot Nothing, "Field 'field' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 905Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 939Debug.Assert(method IsNot Nothing, "Field 'method' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 940Debug.Assert(getMethodFromHandle IsNot Nothing, "Field 'getMethodFromHandle' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 941Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 950Debug.Assert(method IsNot Nothing, "Field 'method' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 951Debug.Assert(getMethodFromHandle IsNot Nothing, "Field 'getMethodFromHandle' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 952Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 994Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1036Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1044Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1078Debug.Assert(namespaceSymbol IsNot Nothing, "Field 'namespaceSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1133Debug.Assert(method IsNot Nothing, "Field 'method' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1134Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1142Debug.Assert(method IsNot Nothing, "Field 'method' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1143Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1177Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1184Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1210Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1219Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1261Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1269Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1303Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1310Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1336Debug.Assert(document IsNot Nothing, "Field 'document' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1337Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1345Debug.Assert(document IsNot Nothing, "Field 'document' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1346Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1380Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1381Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1444Debug.Assert(underlyingExpression IsNot Nothing, "Field 'underlyingExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1445Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1492Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1493Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1532Debug.Assert(left IsNot Nothing, "Field 'left' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1533Debug.Assert(right IsNot Nothing, "Field 'right' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1534Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1605Debug.Assert(underlyingExpression IsNot Nothing, "Field 'underlyingExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1606Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1661Debug.Assert(bitwiseOperator IsNot Nothing, "Field 'bitwiseOperator' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1662Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1725Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1732Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1758Debug.Assert(left IsNot Nothing, "Field 'left' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1759Debug.Assert(right IsNot Nothing, "Field 'right' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1760Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1823Debug.Assert(byRefLocal IsNot Nothing, "Field 'byRefLocal' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1824Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1879Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1880Debug.Assert(methodGroup IsNot Nothing, "Field 'methodGroup' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1930Debug.Assert(condition IsNot Nothing, "Field 'condition' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1931Debug.Assert(whenTrue IsNot Nothing, "Field 'whenTrue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1932Debug.Assert(whenFalse IsNot Nothing, "Field 'whenFalse' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1933Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1996Debug.Assert(testExpression IsNot Nothing, "Field 'testExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1997Debug.Assert(elseExpression IsNot Nothing, "Field 'elseExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1998Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2069Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2076Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2088Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2089Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2181Debug.Assert(lambda IsNot Nothing, "Field 'lambda' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2223Debug.Assert(Not (elementPlaceholders.IsDefault), "Field 'elementPlaceholders' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2224Debug.Assert(Not (convertedElements.IsDefault), "Field 'convertedElements' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2271Debug.Assert(underlyingExpression IsNot Nothing, "Field 'underlyingExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2272Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2319Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2320Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2391Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2392Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2455Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2456Debug.Assert(targetType IsNot Nothing, "Field 'targetType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2457Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2551Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2685Debug.Assert(Not (methods.IsDefault), "Field 'methods' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2743Debug.Assert(Not (properties.IsDefault), "Field 'properties' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2837Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2907Debug.Assert(Not (clauses.IsDefault), "Field 'clauses' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2941Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2942Debug.Assert(Not (indices.IsDefault), "Field 'indices' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3005Debug.Assert(Not (clauses.IsDefault), "Field 'clauses' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3039Debug.Assert(method IsNot Nothing, "Field 'method' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3040Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3041Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3136Debug.Assert(Not (constructorArguments.IsDefault), "Field 'constructorArguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3137Debug.Assert(Not (namedArguments.IsDefault), "Field 'namedArguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3138Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3204Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3275Debug.Assert(member IsNot Nothing, "Field 'member' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3276Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3347Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3348Debug.Assert(memberAccess IsNot Nothing, "Field 'memberAccess' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3390Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3410Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3460Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3461Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3495Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3520Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3521Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3584Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3618Debug.Assert(Not (declarations.IsDefault), "Field 'declarations' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3619Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3669Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3678Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3720Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3721Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3763Debug.Assert(Not (initializers.IsDefault), "Field 'initializers' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3791Debug.Assert(Not (initializers.IsDefault), "Field 'initializers' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3830Debug.Assert(Not (initializers.IsDefault), "Field 'initializers' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3861Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3892Debug.Assert(method IsNot Nothing, "Field 'method' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3893Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3959Debug.Assert(Not (bounds.IsDefault), "Field 'bounds' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3960Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4031Debug.Assert(inferredType IsNot Nothing, "Field 'inferredType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4032Debug.Assert(Not (bounds.IsDefault), "Field 'bounds' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4033Debug.Assert(initializer IsNot Nothing, "Field 'initializer' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4034Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4108Debug.Assert(Not (initializers.IsDefault), "Field 'initializers' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4142Debug.Assert(fieldSymbol IsNot Nothing, "Field 'fieldSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4143Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4214Debug.Assert(propertySymbol IsNot Nothing, "Field 'propertySymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4215Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4216Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4311Debug.Assert(eventSymbol IsNot Nothing, "Field 'eventSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4312Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4354Debug.Assert(Not (locals.IsDefault), "Field 'locals' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4355Debug.Assert(Not (statements.IsDefault), "Field 'statements' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4405Debug.Assert(Not (fields.IsDefault), "Field 'fields' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4406Debug.Assert(statement IsNot Nothing, "Field 'statement' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4461Debug.Assert(localSymbol IsNot Nothing, "Field 'localSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4524Debug.Assert(Not (localDeclarations.IsDefault), "Field 'localDeclarations' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4525Debug.Assert(initializer IsNot Nothing, "Field 'initializer' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4526Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4576Debug.Assert(Not (localDeclarations.IsDefault), "Field 'localDeclarations' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4644Debug.Assert(initialValue IsNot Nothing, "Field 'initialValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4680Debug.Assert(Not (initializedFields.IsDefault), "Field 'initializedFields' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4681Debug.Assert(initialValue IsNot Nothing, "Field 'initialValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4715Debug.Assert(Not (initializedProperties.IsDefault), "Field 'initializedProperties' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4716Debug.Assert(initialValue IsNot Nothing, "Field 'initialValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4750Debug.Assert(parameter IsNot Nothing, "Field 'parameter' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4751Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4793Debug.Assert(statement IsNot Nothing, "Field 'statement' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4827Debug.Assert(Not (locals.IsDefault), "Field 'locals' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4828Debug.Assert(Not (sideEffects.IsDefault), "Field 'sideEffects' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4829Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4884Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4918Debug.Assert(condition IsNot Nothing, "Field 'condition' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4919Debug.Assert(consequence IsNot Nothing, "Field 'consequence' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4969Debug.Assert(expressionStatement IsNot Nothing, "Field 'expressionStatement' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4970Debug.Assert(Not (caseBlocks.IsDefault), "Field 'caseBlocks' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4971Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5037Debug.Assert(caseStatement IsNot Nothing, "Field 'caseStatement' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5038Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5080Debug.Assert(Not (caseClauses.IsDefault), "Field 'caseClauses' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5284Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5285Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5294Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5295Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5323Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5324Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5325Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5391Debug.Assert(condition IsNot Nothing, "Field 'condition' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5392Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5393Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5394Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5436Debug.Assert(controlVariable IsNot Nothing, "Field 'controlVariable' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5437Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5438Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5439Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5483Debug.Assert(leftOperandPlaceholder IsNot Nothing, "Field 'leftOperandPlaceholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5484Debug.Assert(rightOperandPlaceholder IsNot Nothing, "Field 'rightOperandPlaceholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5485Debug.Assert(addition IsNot Nothing, "Field 'addition' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5486Debug.Assert(subtraction IsNot Nothing, "Field 'subtraction' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5487Debug.Assert(lessThanOrEqual IsNot Nothing, "Field 'lessThanOrEqual' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5488Debug.Assert(greaterThanOrEqual IsNot Nothing, "Field 'greaterThanOrEqual' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5567Debug.Assert(initialValue IsNot Nothing, "Field 'initialValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5568Debug.Assert(limitValue IsNot Nothing, "Field 'limitValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5569Debug.Assert(stepValue IsNot Nothing, "Field 'stepValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5570Debug.Assert(controlVariable IsNot Nothing, "Field 'controlVariable' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5571Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5572Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5573Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5639Debug.Assert(collection IsNot Nothing, "Field 'collection' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5640Debug.Assert(enumeratorInfo IsNot Nothing, "Field 'enumeratorInfo' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5641Debug.Assert(controlVariable IsNot Nothing, "Field 'controlVariable' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5642Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5643Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5644Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5686Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5694Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5728Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5736Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5770Debug.Assert(tryBlock IsNot Nothing, "Field 'tryBlock' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5771Debug.Assert(Not (catchBlocks.IsDefault), "Field 'catchBlocks' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5829Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5903Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5916Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5952Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5959Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5985Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5997Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6025Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6032Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6058Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6065Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6091Debug.Assert(sourceType IsNot Nothing, "Field 'sourceType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6092Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6100Debug.Assert(sourceType IsNot Nothing, "Field 'sourceType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6101Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6135Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6142Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6168Debug.Assert(localSymbol IsNot Nothing, "Field 'localSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6169Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6183Debug.Assert(localSymbol IsNot Nothing, "Field 'localSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6184Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6228Debug.Assert(localSymbol IsNot Nothing, "Field 'localSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6229Debug.Assert(emitExpressions IsNot Nothing, "Field 'emitExpressions' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6230Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6245Debug.Assert(localSymbol IsNot Nothing, "Field 'localSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6246Debug.Assert(emitExpressions IsNot Nothing, "Field 'emitExpressions' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6247Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6299Debug.Assert(parameterSymbol IsNot Nothing, "Field 'parameterSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6300Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6310Debug.Assert(parameterSymbol IsNot Nothing, "Field 'parameterSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6311Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6361Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6369Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6403Debug.Assert(originalArgument IsNot Nothing, "Field 'originalArgument' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6404Debug.Assert(inConversion IsNot Nothing, "Field 'inConversion' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6405Debug.Assert(inPlaceholder IsNot Nothing, "Field 'inPlaceholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6406Debug.Assert(outConversion IsNot Nothing, "Field 'outConversion' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6407Debug.Assert(outPlaceholder IsNot Nothing, "Field 'outPlaceholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6478Debug.Assert(originalArgument IsNot Nothing, "Field 'originalArgument' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6479Debug.Assert(localSymbol IsNot Nothing, "Field 'localSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6526Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6534Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6568Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6576Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6610Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6652Debug.Assert(Not (statements.IsDefault), "Field 'statements' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6686Debug.Assert(condition IsNot Nothing, "Field 'condition' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6687Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6737Debug.Assert(originalExpression IsNot Nothing, "Field 'originalExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6738Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6739Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6789Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6790Debug.Assert(Not (parameters.IsDefault), "Field 'parameters' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6791Debug.Assert(bindingCache IsNot Nothing, "Field 'bindingCache' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6808Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6809Debug.Assert(Not (parameters.IsDefault), "Field 'parameters' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6810Debug.Assert(bindingCache IsNot Nothing, "Field 'bindingCache' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6878Debug.Assert(lambdaSymbol IsNot Nothing, "Field 'lambdaSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6879Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6958Debug.Assert(lastOperator IsNot Nothing, "Field 'lastOperator' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6959Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6993Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7000Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7012Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7013Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7047Debug.Assert(conversionCall IsNot Nothing, "Field 'conversionCall' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7048Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7082Debug.Assert(Not (rangeVariables.IsDefault), "Field 'rangeVariables' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7083Debug.Assert(compoundVariableType IsNot Nothing, "Field 'compoundVariableType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7084Debug.Assert(Not (binders.IsDefault), "Field 'binders' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7085Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7095Debug.Assert(Not (rangeVariables.IsDefault), "Field 'rangeVariables' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7096Debug.Assert(compoundVariableType IsNot Nothing, "Field 'compoundVariableType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7097Debug.Assert(Not (binders.IsDefault), "Field 'binders' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7098Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7134Debug.Assert(source IsNot Nothing, "Field 'source' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7135Debug.Assert(Not (rangeVariables.IsDefault), "Field 'rangeVariables' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7136Debug.Assert(compoundVariableType IsNot Nothing, "Field 'compoundVariableType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7137Debug.Assert(Not (binders.IsDefault), "Field 'binders' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7138Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7185Debug.Assert(underlyingExpression IsNot Nothing, "Field 'underlyingExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7186Debug.Assert(Not (rangeVariables.IsDefault), "Field 'rangeVariables' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7187Debug.Assert(compoundVariableType IsNot Nothing, "Field 'compoundVariableType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7188Debug.Assert(Not (binders.IsDefault), "Field 'binders' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7189Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7223Debug.Assert(underlyingExpression IsNot Nothing, "Field 'underlyingExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7224Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7258Debug.Assert(lambdaSymbol IsNot Nothing, "Field 'lambdaSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7259Debug.Assert(Not (rangeVariables.IsDefault), "Field 'rangeVariables' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7260Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7318Debug.Assert(rangeVariable IsNot Nothing, "Field 'rangeVariable' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7319Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7320Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7362Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7363Debug.Assert(Not (parameters.IsDefault), "Field 'parameters' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7364Debug.Assert(compilation IsNot Nothing, "Field 'compilation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7374Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7375Debug.Assert(Not (parameters.IsDefault), "Field 'parameters' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7376Debug.Assert(compilation IsNot Nothing, "Field 'compilation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7426Debug.Assert(underlyingExpression IsNot Nothing, "Field 'underlyingExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7427Debug.Assert(Not (rangeVariables.IsDefault), "Field 'rangeVariables' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7428Debug.Assert(compoundVariableType IsNot Nothing, "Field 'compoundVariableType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7429Debug.Assert(Not (binders.IsDefault), "Field 'binders' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7430Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7480Debug.Assert(group IsNot Nothing, "Field 'group' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7481Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7515Debug.Assert(rangeVariable IsNot Nothing, "Field 'rangeVariable' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7516Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7524Debug.Assert(rangeVariable IsNot Nothing, "Field 'rangeVariable' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7525Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7559Debug.Assert(eventAccess IsNot Nothing, "Field 'eventAccess' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7560Debug.Assert(handler IsNot Nothing, "Field 'handler' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7588Debug.Assert(eventAccess IsNot Nothing, "Field 'eventAccess' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7589Debug.Assert(handler IsNot Nothing, "Field 'handler' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7615Debug.Assert(eventAccess IsNot Nothing, "Field 'eventAccess' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7616Debug.Assert(handler IsNot Nothing, "Field 'handler' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7642Debug.Assert(eventSymbol IsNot Nothing, "Field 'eventSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7643Debug.Assert(eventInvocation IsNot Nothing, "Field 'eventInvocation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7685Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7686Debug.Assert(usingInfo IsNot Nothing, "Field 'usingInfo' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7687Debug.Assert(Not (locals.IsDefault), "Field 'locals' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7753Debug.Assert(lockExpression IsNot Nothing, "Field 'lockExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7754Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7796Debug.Assert(xmlNamespace IsNot Nothing, "Field 'xmlNamespace' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7797Debug.Assert(localName IsNot Nothing, "Field 'localName' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7798Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7799Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7849Debug.Assert(xmlNamespace IsNot Nothing, "Field 'xmlNamespace' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7850Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7851Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7893Debug.Assert(declaration IsNot Nothing, "Field 'declaration' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7894Debug.Assert(Not (childNodes.IsDefault), "Field 'childNodes' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7895Debug.Assert(rewriterInfo IsNot Nothing, "Field 'rewriterInfo' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7896Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7946Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7947Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8005Debug.Assert(target IsNot Nothing, "Field 'target' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8006Debug.Assert(data IsNot Nothing, "Field 'data' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8007Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8008Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8058Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8059Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8060Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8102Debug.Assert(name IsNot Nothing, "Field 'name' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8103Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8104Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8105Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8168Debug.Assert(argument IsNot Nothing, "Field 'argument' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8169Debug.Assert(Not (childNodes.IsDefault), "Field 'childNodes' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8170Debug.Assert(rewriterInfo IsNot Nothing, "Field 'rewriterInfo' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8171Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8221Debug.Assert(memberAccess IsNot Nothing, "Field 'memberAccess' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8222Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8256Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8257Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8291Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8292Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8293Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8439Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8510Debug.Assert(activeHandlerLocal IsNot Nothing, "Field 'activeHandlerLocal' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8511Debug.Assert(resumeTargetLocal IsNot Nothing, "Field 'resumeTargetLocal' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8512Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8559Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8560Debug.Assert(Not (jumps.IsDefault), "Field 'jumps' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8607Debug.Assert(resumeTargetTemporary IsNot Nothing, "Field 'resumeTargetTemporary' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8608Debug.Assert(resumeLabel IsNot Nothing, "Field 'resumeLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8609Debug.Assert(resumeNextLabel IsNot Nothing, "Field 'resumeNextLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8610Debug.Assert(Not (jumps.IsDefault), "Field 'jumps' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8673Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8674Debug.Assert(awaitableInstancePlaceholder IsNot Nothing, "Field 'awaitableInstancePlaceholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8675Debug.Assert(getAwaiter IsNot Nothing, "Field 'getAwaiter' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8676Debug.Assert(awaiterInstancePlaceholder IsNot Nothing, "Field 'awaiterInstancePlaceholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8677Debug.Assert(isCompleted IsNot Nothing, "Field 'isCompleted' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8678Debug.Assert(getResult IsNot Nothing, "Field 'getResult' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8679Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8758Debug.Assert(Not (locals.IsDefault), "Field 'locals' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8759Debug.Assert(Not (spillFields.IsDefault), "Field 'spillFields' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8760Debug.Assert(Not (statements.IsDefault), "Field 'statements' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8859Debug.Assert(original IsNot Nothing, "Field 'original' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8860Debug.Assert(start IsNot Nothing, "Field 'start' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8861Debug.Assert(source IsNot Nothing, "Field 'source' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8862Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8925Debug.Assert(receiver IsNot Nothing, "Field 'receiver' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8926Debug.Assert(placeholder IsNot Nothing, "Field 'placeholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8927Debug.Assert(accessExpression IsNot Nothing, "Field 'accessExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8977Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8991Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9035Debug.Assert(receiver IsNot Nothing, "Field 'receiver' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9036Debug.Assert(whenNotNull IsNot Nothing, "Field 'whenNotNull' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9037Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9108Debug.Assert(valueTypeReceiver IsNot Nothing, "Field 'valueTypeReceiver' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9109Debug.Assert(referenceTypeReceiver IsNot Nothing, "Field 'referenceTypeReceiver' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9110Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9157Debug.Assert(argument IsNot Nothing, "Field 'argument' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9158Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9205Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9206Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9245Debug.Assert(Not (contents.IsDefault), "Field 'contents' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9246Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9293Debug.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)
541Debug.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)
2885Debug.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 (70)
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)
378Debug.Assert(type.Locations.All(assert), message);
Rename\ConflictEngine\ConflictResolver.cs (1)
460Debug.Assert(index <= str1.Length && index <= str2.Length, "Index cannot be greater than the string");
Rename\SymbolicRenameLocations.cs (1)
42Debug.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\ExceptionUtilities.cs (1)
22Debug.Assert(false, output);
src\Compilers\Core\Portable\InternalUtilities\FatalError.cs (1)
48Debug.Assert(s_handler == null, "Handler already set");
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
133Debug.Assert(false, "Unreachable");
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
80Debug.Assert(false, message);
src\Dependencies\Collections\Internal\ArraySortHelper.cs (3)
65Debug.Assert(comparer != null, "Check the arguments in the caller!"); 84Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 341Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\Dependencies\Collections\Internal\HashHelpers.cs (1)
89Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
154Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\Dependencies\Collections\SegmentedArray.cs (1)
489Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\Dependencies\Collections\SegmentedDictionary`2.cs (10)
299Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 300Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 406Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 519Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 614Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 646Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 705Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 732Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 782Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 811Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\Dependencies\Collections\SegmentedHashSet`1.cs (10)
202Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 203Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 225Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 294Debug.Assert(entries.Length > 0, "entries should be non-empty"); 324Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 899Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 1024Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1089Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1170Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1327Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
275Debug.Assert(obj != null, "freeing null?"); 277Debug.Assert(_firstItem != obj, "freeing twice?"); 288Debug.Assert(value != obj, "freeing twice?");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (8)
86Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 90Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 99Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 108Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 118Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 122Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 148Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 154Debug.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)
183Debug.Assert(value == null || !value.GetType().GetTypeInfo().IsEnum, "Enum should not be written with WriteValue. Write them as ints instead."); 193Debug.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)
491Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 498Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 531Debug.Assert(_completionRefCount == 0, $"Expected {nameof(_completionRefCount)} == 0, got {_completionRefCount}"); 559Debug.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)
197Debug.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");
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\ExceptionUtilities.cs (1)
22Debug.Assert(false, output);
src\Compilers\Core\Portable\InternalUtilities\FatalError.cs (1)
48Debug.Assert(s_handler == null, "Handler already set");
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)
65Debug.Assert(comparer != null, "Check the arguments in the caller!"); 84Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 341Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\Dependencies\Collections\Internal\HashHelpers.cs (1)
89Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
154Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\Dependencies\Collections\SegmentedArray.cs (1)
489Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\Dependencies\Collections\SegmentedDictionary`2.cs (10)
299Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 300Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 406Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 519Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 614Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 646Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 705Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 732Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 782Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 811Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\Dependencies\Collections\SegmentedHashSet`1.cs (10)
202Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 203Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 225Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 294Debug.Assert(entries.Length > 0, "entries should be non-empty"); 324Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 899Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 1024Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1089Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1170Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1327Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
275Debug.Assert(obj != null, "freeing null?"); 277Debug.Assert(_firstItem != obj, "freeing twice?"); 288Debug.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.Package (1)
RequestExecutionQueue.cs (1)
364Debug.Assert(!concurrentlyExecutingTasks.Any(t => !t.Key.IsCompleted), "The tasks should have all been drained before continuing");
Microsoft.CSharp (7)
Microsoft\CSharp\RuntimeBinder\DynamicDebuggerProxy.cs (1)
175Debug.Assert((numberOfArguments == argTypes.Length) && (numberOfArguments == argFlags.Length), "Argument arrays size mismatch.");
Microsoft\CSharp\RuntimeBinder\Errors\UserStringBuilder.cs (1)
469Debug.Assert(elementType != null, "No element type");
Microsoft\CSharp\RuntimeBinder\Semantics\Conversion.cs (1)
497Debug.Assert(exprType <= FUNDTYPE.FT_LASTNUMERIC, "Error in constant conversion logic!");
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\MethodOrPropertySymbol.cs (1)
61Debug.Assert(_Params == null, "Should only be set once");
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Constant.cs (1)
40Debug.Assert(
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeManager.cs (2)
91Debug.Assert(atsOuter == null || atsOuter.OwningAggregate == agg.Parent, ""); 152Debug.Assert(!(pUnderlyingType is NullableType), "Attempt to make nullable of nullable");
Microsoft.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.Extensions.AI (13)
CachingHelpers.cs (3)
29Debug.Assert(serializerOptions is not null, "Expected serializer options to be non-null"); 30Debug.Assert(serializerOptions!.IsReadOnly, "Expected serializer options to already be read-only."); 95Debug.Assert(destPos == chars.Length, "Expected to have filled the entire array.");
ChatCompletion\AnonymousDelegatingChatClient.cs (2)
116Debug.Assert(_completeStreamingFunc is not null, "Expected non-null streaming delegate."); 166Debug.Assert(_completeFunc is not null, "Expected non-null non-streaming delegate.");
ChatCompletion\FunctionInvokingChatClient.cs (2)
451Debug.Assert( 496Debug.Assert(functionCount > 0, $"Expecteded {nameof(functionCount)} to be > 0, got {functionCount}.");
ChatCompletion\OpenTelemetryChatClient.cs (1)
54Debug.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)
51Debug.Assert(innerGenerator is not null, "Should have been validated by the base ctor.");
Functions\AIFunctionFactory.cs (3)
317Debug.Assert(Metadata.ReturnParameter.ParameterType == typeof(void), "The return parameter is not void."); 361Debug.Assert(ctx is not null, "Expected a non-null context object."); 526Debug.Assert(specializedType.IsGenericType && specializedType.GetGenericTypeDefinition() == genericMethodDefinition.DeclaringType, "generic member definition doesn't match type.");
Microsoft.Extensions.AI.Abstractions (21)
Contents\DataContent.cs (1)
140Debug.Assert(Data is not null, "Expected Data to be initialized.");
Contents\DataUriParser.cs (1)
70Debug.Assert(
src\Shared\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.");
src\Shared\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");
src\Shared\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.");
src\Shared\JsonSchemaExporter\NullabilityInfoContext\NullabilityInfoContext.cs (2)
484Debug.Assert(genericParameter.IsGenericParameter, "must be generic parameter"); 518Debug.Assert(genericParameter.IsGenericParameter && !genericParameter.IsGenericMethodParameter(), "must be generic parameter");
Utilities\AIJsonUtilities.Schema.cs (2)
262Debug.Assert(refUri is "#" || refUri.StartsWith("#/", StringComparison.Ordinal), $"Expected {nameof(refUri)} to be either # or start with #/, got {refUri}"); 373Debug.Assert(kind is JsonValueKind.True, $"Invalid schema type: {kind}");
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceChatClient.cs (1)
476Debug.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 (8)
src\Shared\ServerSentEvents\ArrayBuffer.cs (1)
106Debug.Assert(byteCount <= ActiveLength, $"Expected {byteCount} <= {ActiveLength}");
src\Shared\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}");
Microsoft.Extensions.Caching.Hybrid (27)
Internal\BufferChunk.cs (10)
29Debug.Assert(array is not null, "expected valid array input"); 38Debug.Assert(!ReturnToPool, "do not return right-sized arrays"); 39Debug.Assert(Length == array.Length, "array length not respected"); 44Debug.Assert(array is not null, "expected valid array input"); 45Debug.Assert(length >= 0, "expected valid length"); 48Debug.Assert(ReturnToPool == returnToPool, "return-to-pool not respected"); 49Debug.Assert(Length == length, "length not respected"); 80Debug.Assert(Array is null && !ReturnToPool, "expected clean slate after recycle"); 90Debug.Assert(copy.Length == Length, "same length expected"); 91Debug.Assert(!copy.ReturnToPool, "do not return to pool");
Internal\DefaultHybridCache.CacheItem.cs (1)
49Debug.Assert(newCount >= 0, "over-release detected");
Internal\DefaultHybridCache.L2.cs (1)
77Debug.Assert(buffer.Array is not null, "array should be non-null");
Internal\DefaultHybridCache.Stampede.cs (1)
97Debug.Assert(existingType != newType, "should be different types");
Internal\DefaultHybridCache.StampedeStateT.cs (8)
47Debug.Assert(_underlying is null, "should not already have factory field"); 48Debug.Assert(underlying is not null, "factory argument should be meaningful"); 65Debug.Assert(_underlying is null, "should not already have factory field"); 66Debug.Assert(underlying is not null, "factory argument should be meaningful"); 105Debug.Assert(ReferenceEquals(first, stampede.Task), "should not be cancelled"); 126Debug.Assert(_result is not null, "result should be assigned"); 378Debug.Assert(value.Array is not null, "expected buffer"); 406Debug.Assert((Key.Flags & FlagsDisableL1AndL2Write) == FlagsDisableL1AndL2Write, "Only expected if L1+L2 disabled");
Internal\HybridCacheEventSource.cs (1)
218Debug.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"); 179Debug.Assert(needed > currentLength, "should need to grow"); 199Debug.Assert(FreeCapacity > 0 && FreeCapacity >= sizeHint, "should be space");
Microsoft.Extensions.Caching.Memory (1)
CacheEntry.cs (1)
204Debug.Assert(_current.Value == this, "Entries disposed in invalid order");
Microsoft.Extensions.DependencyInjection (6)
DependencyInjectionEventSource.cs (1)
265Debug.Assert(instance != null, "descriptor.ImplementationInstance != null");
ServiceLookup\CallSiteFactory.cs (1)
429Debug.Assert(implementationType != null, "descriptor.ImplementationType != null");
ServiceLookup\CallSiteRuntimeResolver.cs (1)
180Debug.Assert(!ServiceProvider.VerifyAotCompatibility || !elementType.IsValueType, "VerifyAotCompatibility=true will throw during building the IEnumerableCallSite if elementType is a ValueType.");
ServiceLookup\Expressions\ExpressionResolverBuilder.cs (2)
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.");
Microsoft.Extensions.FileProviders.Physical (2)
PollingFileChangeToken.cs (1)
67Debug.Assert(_tokenSource == null, "We expect CancellationTokenSource to be initialized exactly once.");
PollingWildCardChangeToken.cs (1)
75Debug.Assert(_tokenSource == null, "We expect CancellationTokenSource to be initialized exactly once.");
Microsoft.Extensions.Hosting (2)
HostApplicationBuilder.cs (1)
120Debug.Assert(empty, "should only be called with empty: true");
Internal\Host.cs (1)
241Debug.Assert(_hostedServices != null, "Hosted services are resolved when host is started.");
Microsoft.Extensions.Http (3)
DefaultHttpClientFactory.cs (3)
200Debug.Assert(removed, "Entry not found. We should always be able to remove the entry"); 201Debug.Assert(object.ReferenceEquals(active, found!.Value), "Different entry found. The entry should not have been replaced"); 279Debug.Assert(entry != null, "Entry was null, we should always get an entry back from TryDequeue");
Microsoft.Extensions.Logging (1)
LoggerInformation.cs (1)
50Debug.Assert(logger != null || externalScopeProvider != null, "Logger can't be null when there isn't an ExternalScopeProvider");
Microsoft.Extensions.Logging.Abstractions (1)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Parser.cs (1)
104Debug.Assert(logMethodSymbol != null, "log method is present.");
Microsoft.Extensions.Primitives (2)
ThrowHelper.cs (2)
61Debug.Assert(Enum.IsDefined(typeof(ExceptionResource), resource), 79Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument),
Microsoft.Extensions.TimeProvider.Testing (1)
FakeTimeProvider.cs (1)
176Debug.Assert(TimestampFrequency == TimeSpan.TicksPerSecond, "Assuming frequency equals ticks per second");
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 (1)
DotNetObjectReferenceOfT.cs (1)
51Debug.Assert(_objectId != 0, "Accessing ObjectId without tracking is always incorrect.");
Microsoft.Maui (3)
Fonts\FileSystemEmbeddedFontLoader.cs (1)
46 Debug.Assert(_rootPath != null || _getRootPath != null, $"The ctor should have set either {nameof(_rootPath)} or {nameof(_getRootPath)}.");
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.ML.Tokenizers (2)
Model\EnglishRobertaTokenizer.cs (1)
977Debug.Assert(pairs.Count != 0, "Pairs should not be empty.");
Utils\ValueStringBuilder.cs (1)
395Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.Net.Http.Headers (2)
HeaderUtilities.cs (2)
266Debug.Assert(false, $"Index '{nameof(current)}' not advanced, this is a bug."); 320Debug.Assert(false, $"Index '{nameof(current)}' not advanced, this is a bug.");
Microsoft.VisualBasic.Core (223)
Microsoft\VisualBasic\Collection.vb (11)
58Debug.Assert(m_KeyedNodesHash.ContainsKey(Key), "We got an argumentexception from a hashtable add, but it wasn't a duplicate key.") 162Debug.Assert(node.m_Key IsNot Nothing, "How can that be? We just found it by its key.") 178Debug.Assert(node IsNot Nothing, "Should have thrown exception rather than return Nothing") 197Debug.Assert(node IsNot Nothing, "Should have thrown rather than returning Nothing") 385Debug.Assert(NodeToBeDeleted IsNot Nothing, "How can we remove a non-existent node ?") 448Debug.Assert(NodeToInsertBefore IsNot Nothing, "FastList.InsertBefore: NodeToInsertBefore may not be nothing") 456Debug.Assert(NodeToInsertAfter IsNot Nothing, "FastList.InsertAfter: NodeToInsertAfter may not be nothing") 514Debug.Assert(NodeToBeDeleted IsNot Nothing, "How can we delete a non-existent node ?") 518Debug.Assert(NodeToBeDeleted Is m_StartOfList, "How can any node besides the first node not have a previous node ?") 571Debug.Assert(NewOrRemovedNode IsNot Nothing, "AdjustIndexes: Node shouldn't be Nothing") 681Debug.Assert(node IsNot Nothing, "Should have thrown exception rather than return Nothing")
Microsoft\VisualBasic\CompilerServices\ConversionResolution.vb (23)
160Debug.Assert(TypeCode.Empty = 0, "wrong value!") 161Debug.Assert(TypeCode.Object = 1, "wrong value!") 162Debug.Assert(TypeCode.Boolean = 3, "yte is wrong value!") 163Debug.Assert(TypeCode.Char = 4, "wrong value!") 164Debug.Assert(TypeCode.SByte = 5, "wrong value!") 165Debug.Assert(TypeCode.Byte = 6, "wrong value!") 166Debug.Assert(TypeCode.Int16 = 7, "wrong value!") 167Debug.Assert(TypeCode.UInt16 = 8, "wrong value!") 168Debug.Assert(TypeCode.Int32 = 9, "wrong value!") 169Debug.Assert(TypeCode.UInt32 = 10, "wrong value!") 170Debug.Assert(TypeCode.Int64 = 11, "wrong value!") 171Debug.Assert(TypeCode.UInt64 = 12, "wrong value!") 172Debug.Assert(TypeCode.Single = 13, "wrong value!") 173Debug.Assert(TypeCode.Double = 14, "wrong value!") 174Debug.Assert(TypeCode.Decimal = 15, "wrong value!") 175Debug.Assert(TypeCode.DateTime = 16, "wrong value!") 176Debug.Assert(TypeCode.String = 18, "wrong value!") 250Debug.Assert(False, "all conversions from interface should have been handled by now") 590Debug.Assert(types.Count > 0, "unexpected empty set") 616Debug.Assert(types.Count > 0, "unexpected empty set") 839Debug.Assert(Not wideningOnly AndAlso sourceDeriveds.Count > 0, "unexpected state") 848Debug.Assert(Not wideningOnly AndAlso targetBases.Count > 0, "unexpected state") 979Debug.Assert(operatorSet.Count > 0, "expected operators")
Microsoft\VisualBasic\CompilerServices\Conversions.vb (1)
2517Debug.Assert(Not SourceType.IsByRef, "never expected to see byref source type")
Microsoft\VisualBasic\CompilerServices\LateBinding.vb (4)
599Debug.Assert(False, ex.Message) 1212Debug.Assert(Not Member Is Nothing, "How can this be Nothing ?") 1229Debug.Assert(False, "How can a property get here ?") 1234Debug.Assert(False, "How did we get here ?")
Microsoft\VisualBasic\CompilerServices\LikeOperator.vb (29)
78Debug.Assert(Options <> CompareOptions.Ordinal, "Char expansion check unexpected during binary compare") 455Debug.Assert(Comparer IsNot Nothing, "Like Operator - Comparer expected for option compare text") 456Debug.Assert(Not MatchBothCharsOfExpandedCharInRight OrElse Not UseUnexpandedCharForRight, "Conflicting compare options") 493Debug.Assert(LeftEnd < LeftLength AndAlso RightEnd < RightLength, "Comparing chars beyond end of string") 517Debug.Assert(Comparer IsNot Nothing, "Like Operator - Comparer expected for option compare text") 537Debug.Assert(Comparer IsNot Nothing, "Like Operator - Comparer expected for option compare text") 567Debug.Assert(RangeList Is Nothing OrElse ValidatePatternWithoutMatching, "Unexpected options to MatchRange") 784Debug.Assert(Not ValidatePatternWithoutMatching, "Unexpected string matching when validating pattern string") 912Debug.Assert(PatType = PatternType.STRING, "Unexpected pattern group type") 916Debug.Assert(PatType = PatternType.STRING, "Unexpected pattern group type") 924Debug.Assert(PatType = PatternType.STRING, "Unexpected pattern group type") 928Debug.Assert(PatType = PatternType.STRING, "Unexpected pattern group type") 942Debug.Assert(PatType = PatternType.STAR OrElse PatType = PatternType.NONE, "Unexpected pattern group type") 946Debug.Assert(PatType = PatternType.STAR OrElse PatType = PatternType.NONE, "Unexpected pattern group type") 958Debug.Assert(PatType = PatternType.EXCLIST OrElse PatType = PatternType.INCLIST, "Unexpected pattern group type") 962Debug.Assert(PatType = PatternType.EXCLIST OrElse PatType = PatternType.INCLIST, "Unexpected pattern group type") 971Debug.Assert(PatType = PatternType.EXCLIST OrElse PatType = PatternType.INCLIST, "Unexpected pattern group type") 975Debug.Assert(PatType = PatternType.EXCLIST OrElse PatType = PatternType.INCLIST, "Unexpected pattern group type") 1165Debug.Assert(False, "Unexpected pattern kind") 1229Debug.Assert(PatternGroups IsNot Nothing AndAlso 1281Debug.Assert(PatternGroups(PGIndex).PatType = PatternType.NONE, "Unexpected pattern end") 1310Debug.Assert(False, "Unexpected pattern kind") 1356Debug.Assert(PatternGroups(PGIndex).PatType = PatternType.STAR, "Unexpected start of pattern groups list") 1498Debug.Assert(SourceIndex <= PGCurrent.MaxSourceIndex, "Pattern matching lost") 1524Debug.Assert(PatternGroups(PGPrevMismatchIndex).PatType <> PatternType.NONE, "Bad previous mismatch index") 1605Debug.Assert(PG.PatType = PatternType.EXCLIST OrElse PG.PatType = PatternType.INCLIST, "Unexpected pattern group") 1611Debug.Assert(RangeList IsNot Nothing AndAlso RangeList.Count > 0, "Empty RangeList unexpected") 1617Debug.Assert(Range.Start >= 0, "NULL Range start unexpected") 1729Debug.Assert(Options <> CompareOptions.Ordinal, "This method should not be invoked in Option compare binary mode")
Microsoft\VisualBasic\CompilerServices\NewLateBinding.vb (22)
522Debug.Assert(False, "the resolution should have thrown an exception") 720Debug.Assert(False, "the resolution should have thrown an exception - should never reach here") 1096Debug.Assert(False, "the resolution should have thrown an exception") 1182Debug.Assert(baseReference IsNot Nothing, "Nothing unexpected") 1183Debug.Assert(arguments IsNot Nothing, "Nothing unexpected") 1184Debug.Assert(argumentNames IsNot Nothing, "Nothing unexpected") 1185Debug.Assert(typeArguments IsNot Nothing, "Nothing unexpected") 1217Debug.Assert(False, "If ReportErrors is True, GetMembers should have thrown above") 1259Debug.Assert(propInfo.GetSetMethod Is Nothing OrElse HasIsExternalInitModifier(propInfo.GetSetMethod), "expected error condition") 1263Debug.Assert(propInfo.GetGetMethod Is Nothing, "expected error condition") 1293Debug.Assert(baseReference IsNot Nothing, "expected a base reference") 1294Debug.Assert(methodName IsNot Nothing, "expected method name") 1295Debug.Assert(members IsNot Nothing AndAlso members.Length > 0, "expected members") 1296Debug.Assert(arguments IsNot Nothing AndAlso 1353Debug.Assert(failure = OverloadResolution.ResolutionFailure.None OrElse Not reportErrors, 1357Debug.Assert(resolutionResult Is Nothing, "resolution failed so should have no result") 1361Debug.Assert(resolutionResult IsNot Nothing, "resolution didn't fail, so should have result") 1384Debug.Assert(result = False AndAlso errors.Count > 0, "expected this candidate to fail") 1460Debug.Assert(result = False AndAlso errors.Count > 0, "expected this candidate to fail") 1483Debug.Assert(False, "not a method or property??") 1493Debug.Assert(targetProcedure IsNot Nothing AndAlso arguments IsNot Nothing, "expected arguments") 1504Debug.Assert(arguments.Length > 0, "must have an argument for property set Value")
Microsoft\VisualBasic\CompilerServices\ObjectType.vb (2)
330Diagnostics.Debug.Assert(Not FromType Is ToType, "IsWideningConversion invalid for like types") 1080Diagnostics.Debug.Assert(Int16Result <= 0, "Invalid result")
Microsoft\VisualBasic\CompilerServices\Operators.Resolution.vb (4)
137Debug.Assert(arguments.Length > 1, "unary op on Nothing unexpected here") 138Debug.Assert(arguments(1) IsNot Nothing, "binary op on Nothing operands unexpected here") 193Debug.Assert(operatorMethod IsNot Nothing, "Operator can't be nothing at this point") 209Debug.Assert(result = False AndAlso errors.Count > 0, "expected this candidate to fail")
Microsoft\VisualBasic\CompilerServices\OverloadResolution.vb (31)
105Debug.Assert(GetTypeCode(leftType) <> GetTypeCode(rightType), 414Debug.Assert(False, "Unexpected comparison type!!!") 424Debug.Assert(Not (leftWinsAtLeastOnce AndAlso rightWinsAtLeastOnce), 493Debug.Assert(arguments Is Nothing OrElse arguments.Length = argumentCount, "Inconsistency in arguments!!!") 686Debug.Assert(False, "unexpected code path") 728Debug.Assert(arguments Is Nothing OrElse arguments.Length = argumentCount, "Inconsistency in arguments!!!") 790Debug.Assert(setMethod IsNot Nothing, "must have set here") 813Debug.Assert(False, "what is this? just ignore it.") 822Debug.Assert(candidateSignature IsNot Nothing, "must have signature if we have a method") 876Debug.Assert(Not collectOnlyOperators, "didn't expect operator with paramarray") 1116Debug.Assert(Not parameterType.IsByRef, "didn't expect byref parameter type here") 1171Debug.Assert(parameterTypeParameters.Length = argumentTypeArguments.Length, 1527Debug.Assert(arguments.Length - argIndex <= 1, 1578Debug.Assert(parameters.Length > 0, "expected some parameters here") 'Candidate collection guarantees this. 1717Debug.Assert(matchedArguments.Length = parameters.Length OrElse 1775Debug.Assert(arguments.Length - argIndex = 1, 1803Debug.Assert(parameters.Length > 0, "expected some parameters here") 'Candidate collection guarantees this. 1822Debug.Assert(Not matchedParameters(paramIndex), "named argument match collision") 1834Debug.Assert(parameters(index).IsOptional, 1915Debug.Assert(arguments.Length - argIndex <= 1, 1942Debug.Assert(parameters.Length > 0, "expected some parameters here") 'Candidate collection guarantees this. 2006Debug.Assert(copyBack.Length = arguments.Length, "array sizes must match") 2217Debug.Assert(False, "Unexpected comparison type!!!") 2296Debug.Assert(Not (leftWinsAtLeastOnce AndAlso rightWinsAtLeastOnce), 2357Debug.Assert(candidateCount = 1, "Surprising overload candidate remains.") 2462Debug.Assert(errors IsNot Nothing, "expected error table") 2477Debug.Assert(errors IsNot Nothing, "expected error table") 2490Debug.Assert(errors IsNot Nothing, "expected error table") 2499Debug.Assert(errors IsNot Nothing, "expected error table") 2552Debug.Assert(result = False AndAlso errors.Count > 0, "expected this candidate to fail") 2565Debug.Assert(candidateReportCount > 0, "expected at least one candidate")
Microsoft\VisualBasic\CompilerServices\StructUtils.vb (1)
96Debug.Assert(PackSize = 1, "PackSize is not actually set to anything other than 1 in the current library. " _
Microsoft\VisualBasic\CompilerServices\Symbols.vb (20)
181Debug.Assert(IsUserDefinedOperator(method), "expected operator here") 517Debug.Assert(type.GetGenericTypeDefinition IsNot Nothing, "expected bound generic type") 542Debug.Assert(genericMethodDef IsNot Nothing AndAlso IsRawGeneric(genericMethodDef), "Uninstantiated generic expected!!!") 563Debug.Assert(referringType.DeclaringMethod.IsGenericMethodDefinition, "Unexpected generic method instantiation!!!") 626Debug.Assert(method1 IsNot Nothing AndAlso IsRawGeneric(method1), "Generic method def expected!!!") 627Debug.Assert(method2 IsNot Nothing AndAlso IsRawGeneric(method2), "Generic method def expected!!!") 666Debug.Assert(False, "unexpected membertype") 708Debug.Assert(parameters IsNot Nothing, "expected parameter array") 938Debug.Assert(Me.IsWindowsRuntimeObject(), "Expected a Windows Runtime Object") 1002Debug.Assert(Me.IsWindowsRuntimeObject(), "Expected a Windows Runtime Object") 1149Debug.Assert(Me.IsArray, "expected array when getting array value") 1150Debug.Assert(indices IsNot Nothing, "expected valid indices") 1198Debug.Assert(Me.IsArray, "expected array when setting array value") 1199Debug.Assert(arguments IsNot Nothing, "expected valid indices") 1261Debug.Assert(callTarget IsNot Nothing, "must have valid MethodBase") 1263Debug.Assert(Not targetProcedure.IsGeneric OrElse 1481Debug.Assert(Me.ArgumentsValidated, "can't bind without validating arguments") 1482Debug.Assert(Me.IsMethod, "binding to a non-method") 1494Debug.Assert(Me.IsMethod, "casting a non-method to a method") 1499Debug.Assert(Me.IsProperty, "casting a non-property to a property")
Microsoft\VisualBasic\CompilerServices\VBBinder.vb (6)
1240Debug.Assert(Not SelectedMatch Is Nothing, "Should have already thrown an exception") 1967Diagnostics.Debug.Assert(False, "Should never be reached") 1976Debug.Assert((invokeAttr And BindingFlags.CreateInstance) = 0, "CreateInstance not supported") 1978Debug.Assert(Not name Is Nothing, "Invalid argument") 2286Debug.Assert(Not Member Is Nothing, "How can this be Nothing ?") 2299Debug.Assert(False, "How can a property get here ?")
Microsoft\VisualBasic\ErrObject.vb (2)
175Diagnostics.Debug.Assert((Not m_HelpContextIsSet) OrElse (Not m_HelpFileIsSet), "Why is this getting called?") 369Diagnostics.Debug.Assert(e IsNot Nothing, "Exception shouldn't be Nothing")
Microsoft\VisualBasic\FileIO\FileSystem.vb (41)
685Debug.Assert(GetParentPath(FullNewPath).Equals(GetParentPath(directory), 722Debug.Assert(GetParentPath(FullNewPath).Equals(GetParentPath(file), 863Debug.Assert(StrCollection IsNot Nothing, "StrCollection is NULL") 895Debug.Assert([Enum].IsDefined(operation), "Invalid Operation") 936Debug.Assert(TargetDirectoryFullPath.Length > SourceDirectoryFullPath.Length, "Target path should be longer") 964Debug.Assert([Enum].IsDefined(operation), "Invalid Operation") 965Debug.Assert(sourceDirectoryPath <> "" And IO.Path.IsPathRooted(sourceDirectoryPath), "Invalid Source") 966Debug.Assert(targetDirectoryPath <> "" And IO.Path.IsPathRooted(targetDirectoryPath), "Invalid Target") 987Debug.Assert(IO.Directory.Exists(targetDirectoryPath), "Should be able to create Target Directory") 1013Debug.Assert([Enum].IsDefined(Operation), "Invalid Operation") 1014Debug.Assert(Exceptions IsNot Nothing, "Null exception list") 1015Debug.Assert(SourceDirectoryNode IsNot Nothing, "Null source node") 1032Debug.Assert(IO.Directory.Exists(SourceDirectoryNode.TargetPath), "TargetPath should have existed or exception should be thrown") 1095Debug.Assert([Enum].IsDefined(operation), "Invalid Operation") 1267Debug.Assert(FilePath <> "" AndAlso IO.Path.IsPathRooted(FilePath), FilePath) 1268Debug.Assert(Text <> "", "Empty text") 1330Debug.Assert(Not (TypeOf ex Is ArgumentException Or TypeOf ex Is ArgumentOutOfRangeException Or 1382Debug.Assert(Results IsNot Nothing, "Results is NULL") 1449Debug.Assert(Path <> "" AndAlso IO.Path.IsPathRooted(Path), Path) 1450Debug.Assert(Path.Equals(IO.Path.GetFullPath(Path)), Path) 1451Debug.Assert(NewName <> "", "Null NewName") 1452Debug.Assert(ArgumentName <> "", "Null argument name") 1485Debug.Assert(Not FullPath = "" AndAlso IO.Path.IsPathRooted(FullPath), "Must be full path") 1497Debug.Assert(DInfo.GetFiles(IO.Path.GetFileName(FullPath)).Length = 1, "Must found exactly 1") 1500Debug.Assert(DInfo.GetDirectories(IO.Path.GetFileName(FullPath)).Length = 1, 1517Debug.Assert(Not (TypeOf ex Is ArgumentException OrElse 1602Debug.Assert(FullSourcePath <> "" And IO.Path.IsPathRooted(FullSourcePath), "Invalid FullSourcePath") 1603Debug.Assert(FullTargetPath <> "" And IO.Path.IsPathRooted(FullTargetPath), "Invalid FullTargetPath") 1604Debug.Assert(ShowUI <> UIOptionInternal.NoUI, "Why call ShellDelete if ShowUI is NoUI???") 1667Debug.Assert(FullPath <> "" And IO.Path.IsPathRooted(FullPath), "FullPath must be a full path") 1668Debug.Assert(ShowUI <> UIOptionInternal.NoUI, "Why call ShellDelete if ShowUI is NoUI???") 2096Debug.Assert(IO.Directory.Exists(DirectoryPath), "Directory does not exist") 2097Debug.Assert(TargetDirectoryPath <> "" And IO.Path.IsPathRooted(TargetDirectoryPath), "Invalid TargetPath") 2157Debug.Assert(Encoding IsNot Nothing, "Null Decoder") 2158Debug.Assert(Text <> "", "Empty Text") 2179Debug.Assert(ByteBuffer IsNot Nothing, "Null ByteBuffer") 2180Debug.Assert(Count > 0, Count.ToString(CultureInfo.InvariantCulture)) 2181Debug.Assert(m_Decoder IsNot Nothing, "Null Decoder") 2182Debug.Assert(m_Preamble IsNot Nothing, "Null Preamble") 2211Debug.Assert(CharCount = ExpectedCharCount, "Should read all characters") 2245Debug.Assert(BigBuffer.Length > SmallBuffer.Length, "BigBuffer should be longer")
Microsoft\VisualBasic\FileIO\TextFieldParser.vb (21)
656Debug.Assert(m_Buffer IsNot Nothing, "There's no buffer") 657Debug.Assert(m_Reader IsNot Nothing, "There's no StreamReader") 662Debug.Assert(BufferLength >= DEFAULT_BUFFER_LENGTH, "Buffer shrunk to below default") 688Debug.Assert(m_Buffer IsNot Nothing, "There's no buffer") 689Debug.Assert(m_Reader IsNot Nothing, "There's no StreamReader") 690Debug.Assert(m_Position >= 0 And m_Position <= m_Buffer.Length, "The cursor is out of range") 717Debug.Assert(m_Buffer IsNot Nothing, "There's no buffer") 718Debug.Assert(m_Reader IsNot Nothing, "There's no StreamReader") 719Debug.Assert(m_Position = 0, "Non-zero position") 739Debug.Assert(CharsRead <= m_Buffer.Length - m_CharsRead, "We've read more chars than we have space for") 811Debug.Assert(m_Buffer IsNot Nothing, "There's no buffer") 812Debug.Assert(Cursor >= 0 And Cursor <= m_CharsRead, "The cursor is out of range") 1007Debug.Assert(m_FieldWidths IsNot Nothing, "No field widths") 1070Debug.Assert(Line IsNot Nothing, "We are parsing a Nothing") 1073Debug.Assert(Length > 0, "A blank line shouldn't be parsed") 1098Debug.Assert(Line IsNot Nothing, "No Line sent") 1128Debug.Assert(m_FieldWidths(i) > 0, "Bad field width, this should have been caught on input") 1150Debug.Assert(Widths IsNot Nothing, "There are no field widths") 1281Debug.Assert((m_DelimitersCopy Is Nothing And m_Delimiters Is Nothing) Or (m_DelimitersCopy IsNot Nothing And m_Delimiters IsNot Nothing), "Delimiters and copy are not both Nothing or both not Nothing") 1299Debug.Assert((m_FieldWidthsCopy Is Nothing And m_FieldWidths Is Nothing) Or (m_FieldWidthsCopy IsNot Nothing And m_FieldWidths IsNot Nothing), "FieldWidths and copy are not both Nothing or both not Nothing") 1414Debug.Assert(m_Delimiters IsNot Nothing, "No delimiters set!")
Microsoft\VisualBasic\Helpers\ForEachEnum.vb (1)
130Debug.Assert(Node IsNot mCurrent, "If we just inserted Node, then it couldn't be the current node because it's not in the list yet")
Microsoft\VisualBasic\Strings.vb (4)
703System.Diagnostics.Debug.Assert(Expression <> "", "Expression is empty") 704System.Diagnostics.Debug.Assert(Find <> "", "Find is empty") 705System.Diagnostics.Debug.Assert(Count > 0, "Number of replacements is 0 or less") 706System.Diagnostics.Debug.Assert([Compare] = CompareMethod.Text Or [Compare] = CompareMethod.Binary, "Unknown compare.")
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)
328Debug.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)
20Debug.Assert(!this.AreHierarchyEventsConnected, "IVsHierarchyEvents are already connected!");
ProjectSystem\MetadataReferences\VisualStudioMetadataReferenceManager.cs (1)
287Debug.Assert(pImage != IntPtr.Zero, "Base address should not be zero if GetFileFlatMapping call succeeded.");
MSBuild (11)
CommandLineSwitches.cs (6)
450Debug.Assert(s_parameterlessSwitchesMap.Length == (int)ParameterlessSwitch.NumberOfParameterlessSwitches, 452Debug.Assert(s_parameterizedSwitchesMap.Length == (int)ParameterizedSwitch.NumberOfParameterizedSwitches, 457Debug.Assert(i == (int)(s_parameterlessSwitchesMap[i].parameterlessSwitch), 461Debug.Assert(!string.IsNullOrEmpty(s_parameterlessSwitchesMap[i].resourceId), "All parameterless switches should be cross-checked against the help message strings"); 467Debug.Assert(i == (int)(s_parameterizedSwitchesMap[i].parameterizedSwitch), 472Debug.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)
91Debug.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)
3766Debug.Assert((parameterSections.Length >= 1) && (parameterSections.Length <= 2),
MSBuildTaskHost (8)
BuildExceptionBase.cs (1)
112Debug.Assert((exception.Data?.Count ?? 0) == 0,
ChangeWaves.cs (1)
173Debug.Assert(_runningTests || AllWaves.Contains(wave), $"Change wave version {wave} is invalid");
Concurrent\ConcurrentQueue.cs (2)
294Debug.Assert(boundedLength >= 2, $"Must be >= 2, got {boundedLength}"); 295Debug.Assert((boundedLength & (boundedLength - 1)) == 0, $"Must be a power of 2, got {boundedLength}");
InterningBinaryReader.cs (1)
173Debug.Assert(false, e.ToString());
StringBuilderCache.cs (1)
92Debug.Assert(StringBuilderCache.t_cachedInstance == null, "Unexpected replacing of other StringBuilder.");
TaskEngineAssemblyResolver.cs (2)
54Debug.Assert(_eventHandler == null, "The TaskEngineAssemblyResolver.InstallHandler method should only be called once!"); 84Debug.Assert(false, "There is no handler to remove.");
PresentationBuildTasks (121)
MS\Internal\MarkupCompiler\MarkupCompiler.cs (3)
2537Debug.Assert(_codeContexts == null || _codeContexts.Count == 0, "mismatched CodeContexts"); 2560Debug.Assert(HasLocalReference, "if we have a local event, there should be a local mapping PI for it"); 3039Debug.Assert(_codeContexts.Count == 0, "mismatched codecontext");
MS\Internal\MarkupCompiler\ParserExtension.cs (4)
41Debug.Assert(bamlWriter != null, "Need a BamlRecordWriter for compiling to Baml"); 150Debug.Assert(_name == null && _nameField == null, "Name has already been set"); 345Debug.Assert(_name == null && _nameField == null, "Name has already been set"); 792Debug.Assert(_name == null && _nameField == null, "Name definition has already been set");
MS\Internal\Tasks\CompilerLocalReference.cs (3)
177Debug.Assert(String.IsNullOrEmpty(_localCacheFile) != true, "_localCacheFile must not be empty."); 178Debug.Assert(mcPass1 != null, "A valid instance of MarkupCompilePass1 must be passed to method SaveCacheInformation."); 239Debug.Assert(String.IsNullOrEmpty(_localCacheFile) != true, "_localCacheFile must not be empty.");
MS\Internal\Tasks\CompilerState.cs (7)
91Debug.Assert(String.IsNullOrEmpty(_stateFilePath) != true, "StateFilePath must not be empty."); 92Debug.Assert(mcPass1 != null, "A valid instance of MarkupCompilePass1 must be passed to method SaveCacheInformation."); 93Debug.Assert(_cacheInfoList.Length == (int)CompilerStateType.MaxCount, "The Cache string array should be already allocated."); 152Debug.Assert(String.IsNullOrEmpty(_stateFilePath) != true, "_stateFilePath must be not be empty."); 153Debug.Assert(_cacheInfoList.Length == (int)CompilerStateType.MaxCount, "The Cache string array should be already allocated."); 261Debug.Assert(src[str.Length] == '\0', "src[str.Length] == '\\0'"); 262Debug.Assert(((int)src) % 4 == 0, "Managed string should start at 4 bytes boundary");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlMapTable.cs (2)
1016Debug.Assert(assemblyFullName.Length != 0, "empty assembly"); 1470Debug.Assert(GetHashTableData(stringValue) == null,
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecordHelper.cs (1)
131Debug.Assert(false, "Unhandled case in DoesRecordTypeHaveDebugExtension");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecords.cs (20)
688Debug.Assert(false,"Assembly, Type and Attribute records are not cached, so don't ask for one."); 713Debug.Assert(false,"Unknown RecordType"); 856set { Debug.Assert (value == -1, "Setting fixed record to an invalid size"); } 865Debug.Assert(false, "Must override RecordType"); 1501Debug.Assert(_valuePositionPosition != -1, 1684Debug.Assert(_valuePositionPosition != -1, 2049set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2119set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2180set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2407set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 2984set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 3198set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3285set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3434Debug.Assert(_contentSizePosition != -1, 3479set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3639set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 3737set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 3815set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 4000Debug.Assert(FilePos != -1,"UpdateWrite called but Write Never was"); 4696Debug.Assert((propertyMember is MethodInfo) || (propertyMember is PropertyInfo)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecordWriter.cs (11)
464Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 563Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 599Debug.Assert(!InStaticResourceSection, "We do not support x:Shared within a StaticResource Section"); 783Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 839Debug.Assert(keyRecord.RecordList.Count == 0, "Should have empty record list"); 865Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 1627Debug.Assert(keyRecord != null, "Unknown key record type in defer load dictionary"); 1635Debug.Assert(keyIndex == _deferKeys.Count, 1658Debug.Assert(_deferElementDepth > 0 && CollectingValues, 1666Debug.Assert(valueDeferRecord.Record != null && 1678Debug.Assert(valueDeferRecord.Record != null && valueDeferRecord.Record.RecordType == BamlRecordType.ElementEnd,
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlVersionHeader.cs (2)
103Debug.Assert(length == BamlVersionHeader.BinarySerializationSize, 108Debug.Assert((posEnd-posStart) == BamlVersionHeader.BinarySerializationSize,
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\KnownTypes.cs (3)
4756Debug.Assert(asmFramework != null, "asmFramework must not be null"); 4757Debug.Assert(asmCore != null, "asmCore must not be null"); 4758Debug.Assert(asmBase != null, "asmBase must not be null");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\MarkupExtensionParser.cs (1)
1540Debug.Assert(null != info, "No property or method info for field Name");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\StyleXamlParser.cs (1)
1290Debug.Assert (mode != StyleMode.Base || xamlPropertyNode.PropName != XamlStyleSerializer.TargetTypePropertyName,
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\TreeBuilder.cs (1)
83Debug.Assert (false, "Parse Fragment was not overidden");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlParser.cs (4)
524Debug.Assert(false,"Unknown Xaml Token."); 997Debug.Assert(null != assemblyName, "assembly name returned from GetBaseElement is null"); 998Debug.Assert(null != typeFullName, "Type name returned from GetBaseElement is null"); 1246Debug.Assert(null == _bamlWriter || null == value, "XamlParser already had a bamlWriter");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (37)
116Debug.Assert(xamlParser != null, "Cannot have null xaml parser"); 117Debug.Assert(parserContext != null, "Cannot have null parser context"); 118Debug.Assert(xmlReader != null, "Cannot have null xmlReader"); 331Debug.Assert(null != xamlNode, "null returned from the collection"); 399Debug.Assert(!IsMoreData(), "Setting state to done but not done parsing."); 432Debug.Assert(null != xamlNode, "null returned from the collection"); 1178Debug.Assert(null != typeFullName, "type name not set"); 1179Debug.Assert(null != dynamicObjectName, "dynamicObject name not set"); 1180Debug.Assert(null != assemblyName, "assembly name not set"); 1831Debug.Assert(null == dynamicObject,"DynamicObject should be null for code"); 1999Debug.Assert(false == endTagHasBeenRead, "Read past end tag on end tag"); 3181Debug.Assert(null != assemblyName, "property without an AssemblyName"); 3182Debug.Assert(null != declaringTypeFullName, "property without a type name"); 3183Debug.Assert(null != dynamicObjectName, "property without a field Name"); 3757Debug.Assert(CurrentContext.ContextType == ElementContextType.PropertyComplex || 4136Debug.Assert(null != assemblyName, "property without an AssemblyName"); 4137Debug.Assert(null != typeFullName, "property without a type name"); 4138Debug.Assert(null != dynamicObjectName, "property without a field Name"); 5089Debug.Assert( isWhitespace, 5267Debug.Assert(null != XmlReader, "XmlReader is not yet set"); 5313Debug.Assert(false, "XmlReader doesn't support LineNumber"); 5344Debug.Assert(false, "XmlReader doesn't support LinePosition"); 5571Debug.Assert(null != text, "String passed to CollapseText cannot be null"); 5572Debug.Assert(textLength > 0, "String passed to Collapsed Text cannot be empty"); 5832Debug.Assert((_nodeIndex == 0 && _xamlNodes.Count == 0 ) || (_nodeIndex < _xamlNodes.Count), 5852Debug.Assert((_nodeIndex == 0 && _xamlNodes.Count == 0 ) || (_nodeIndex < _xamlNodes.Count), 5879Debug.Assert(!value || _insertionIndex == -1, "Attribute node collection is already marked for insertion."); 5938Debug.Assert(_nodeIndex == _xamlNodes.Count, "NodeIndex is larger than node count."); 6006Debug.Assert( _typeConverterDecisionState == TypeConverterDecisionState.ElementEnd, 6069Debug.Assert(((XamlNode)_xamlNodes[_typeConverterCandidateIndex]).TokenType==XamlNodeType.ElementStart, 6088Debug.Assert(((XamlNode)_xamlNodes[_typeConverterCandidateIndex])==xamlNode, 6112Debug.Assert(((XamlNode)_xamlNodes[_typeConverterCandidateIndex])==xamlNode, 6128Debug.Assert( _typeConverterTextWrittenAndNotProcessed != null, 6157Debug.Assert(((XamlNode)_xamlNodes[_typeConverterCandidateIndex]).TokenType==XamlNodeType.ElementStart, 6433Debug.Assert(null != textFlowData, "No data for TextFlow"); 6455Debug.Assert(null != typeRightTag, "ElementType not yet assigned to Node"); 6576Debug.Assert(0 == textFlowData.InlineCount, "Text stack still has an inline count");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlTypeMapper.cs (15)
936Debug.Assert(null != localName, "null localName"); 937Debug.Assert(null != xmlNamespace, "null xmlNamespace"); 1907Debug.Assert(typeInfo != null, "Must have cached type info at this point"); 2399Debug.Assert(null != xmlNamespace,"null value passed for xmlNamespace"); 2400Debug.Assert(null != localName,"null value passed for localName"); 2438Debug.Assert(null != xmlNamespace,"null value passed for xmlNamespace"); 2439Debug.Assert(null != localName,"null value passed for localName"); 2591Debug.Assert(namespaceMap.ClrNamespace != null,"Null CLR Namespace"); 2592Debug.Assert(localName != null,"Null localName"); 3151Debug.Assert(false, "Should initialize cache prior to compiling"); 3422Debug.Assert(false, "Should initialize cache prior to compiling"); 3441Debug.Assert(null != type, "Null passed for type to GetTypeConverterType"); 3516Debug.Assert(null != propType, "Null passed for propType to GetPropertyConverterType"); 3745Debug.Assert(null != type, "null value for type passed to GetWhitespace"); 4007Debug.Assert(_dpLookupHashtable != null,
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\TokenizerHelper.cs (1)
172Debug.Assert(!Char.IsWhiteSpace(currentChar),"Token started on Whitespace");
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (2)
129Debug.Assert(type is not null, "Type passed to IsInternalType is null"); 150Debug.Assert(type is not null, "Type passed to IsPublicType is null");
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\TypeConverterHelper.cs (2)
102Debug.Assert(null != memberInfo, "Null passed for memberInfo to GetConverterType"); 111Debug.Assert(type is not null, "Null passed for type to GetConverterType");
src\Microsoft.DotNet.Wpf\src\WindowsBase\MS\Internal\IO\Packaging\CompoundFile\ContainerUtilities.cs (1)
84Debug.Assert(length >= 0, "The length cannot be negative. Caller must verify this");
PresentationCore (522)
MS\Internal\DpiUtil\DpiUtil+ProcessDpiAwarenessHelper.cs (1)
102Debug.Assert(windowThreadProcessId != 0, "GetWindowThreadProcessId failed");
MS\Internal\Generic\Span.cs (1)
469Debug.Assert(
MS\Internal\Ink\EllipticalNodeOperations.cs (3)
38Debug.Assert(_nodeShapeToCircle.HasInverse, "About to invert a non-invertible transform"); 50Debug.Assert(_nodeShapeToCircle.HasInverse, "Just rotated an invertible transform and produced a non-invertible one"); 66Debug.Assert(_nodeShapeToCircle.HasInverse, "Just scaled an invertible transform and produced a non-invertible one");
MS\Internal\Ink\ExtendedPropertyCollection.cs (1)
310System.Diagnostics.Debug.Assert(!this.Contains(extendedProperty.Id), "ExtendedProperty already belongs to the collection");
MS\Internal\Ink\GestureRecognizer\NativeRecognizer.cs (3)
667Debug.Assert(!(bestResultColumnCount != 0 && pRecoLattice->pLatticeColumns == IntPtr.Zero), "Invalid results!"); 681Debug.Assert(0 < recoColumn.cLatticeElements, "Invalid results!"); 688Debug.Assert((RECO_TYPE)(recoElement.type) == RECO_TYPE.RECO_TYPE_WCHAR, "The Application gesture has to be WCHAR type" );
MS\Internal\Ink\InkSerializedFormat\CustomAttributeSerializer.cs (1)
942Debug.Assert(false, "Missing case statement!");
MS\Internal\Ink\InkSerializedFormat\DrawingAttributeSerializer.cs (3)
283System.Diagnostics.Debug.Assert(false, "Corrupt Matrix in the ExtendedPropertyCollection!"); 499System.Diagnostics.Debug.Assert(da.Color != (Color)DrawingAttributes.GetDefaultDrawingAttributeValue(KnownIds.Color), "Color was put in the EPC for the default value!"); 600System.Diagnostics.Debug.Assert(da.StylusTip != StylusTip.Ellipse, "StylusTip was put in the EPC for the default value!");
MS\Internal\Ink\InkSerializedFormat\StrokeSerializer.cs (1)
292System.Diagnostics.Debug.Assert(false, "ExtendedProperties for points are not supported");
MS\Internal\Ink\StrokeNode.cs (3)
260Debug.Assert(false, "StrokeNodeOperations.GetPointsAtStartOfSegment failed to find the D position"); 373Debug.Assert(false, "StrokeNodeOperations.GetPointsAtEndOfSegment failed to find the B position"); 640Debug.Assert(false, "Couldn't find all 4 indexes in StrokeNodeOperations.GetPointsAtMiddleSegment");
MS\Internal\Ink\StrokeRenderer.cs (2)
348Debug.Assert(!prevStrokeNode.GetConnectingQuad().IsEmpty, "prevStrokeNode.GetConnectingQuad() is Empty!"); 454Debug.Assert(!strokeNode.GetConnectingQuad().IsEmpty, "strokeNode.GetConnectingQuad was empty, this is unexpected");
MS\Internal\IO\Packaging\ByteRangeDownloader.cs (3)
74Debug.Assert(fileMutex != null, "FileMutex must be a valid mutex"); 75Debug.Assert(tempStream != null, "ByteRangeDownloader requires a stream to write to"); 191Debug.Assert(byteRanges.GetLength(0) == 1, "We don't support a request with multiple byte ranges");
MS\Internal\IO\Packaging\NetStream.cs (2)
721Debug.Assert(_fullStreamLength >= 0, "We assume _fullStreamLength is correct for Http cases - only Ftp can return bogus values"); 1155Debug.Assert(_fullDownloadComplete, "Do not call this unless full download is complete.");
MS\Internal\IO\Packaging\PseudoWebRequest.cs (3)
45Debug.Assert(uri != null, "PackWebRequest uri cannot be null"); 46Debug.Assert(packageUri != null, "packageUri cannot be null"); 47Debug.Assert(partUri != null, "partUri cannot be null");
MS\Internal\IO\Packaging\ResponseStream.cs (4)
47Debug.Assert(container != null, "Logic error: use other constructor for full package request streams"); 48Debug.Assert(owningStream != null, "Logic error: use other constructor for full package request streams"); 71Debug.Assert(s != null, "Logic error: base stream cannot be null"); 72Debug.Assert(response != null, "Logic error: response cannot be null");
MS\Internal\Media\VisualTreeUtils.cs (3)
236Debug.Assert((visual == null) != (visual3D == null), 257Debug.Assert(castSucceeded && ((visual == null) != (visual3D == null)), 264Debug.Assert(!castSucceeded && visual == null && visual3D == null,
MS\Internal\Media3D\GeneralTransform2DTo3DTo2D.cs (1)
471Debug.Assert(uv.Length == p.Length, "vertices and texture coordinate sizes should match");
MS\Internal\Media3D\M3DUtil.cs (2)
41Debug.Assert(!bounds.IsEmpty, 385Debug.Assert(camera != null, "Caller is responsible for ensuring camera is not null.");
MS\Internal\Shaping\GlyphInfoList.cs (1)
52Debug.Assert(_glyphs.Offset + _glyphs.Length == cch, "Invalid glyph length!");
MS\Internal\Shaping\OpenTypeCommon.cs (4)
595Debug.Assert(false,"Unknown OpenType layout table!"); 1076Debug.Assert(false,"Ext.Lookup processed earlier!"); 1161Debug.Assert(false,"Ext.Lookup processed earlier!"); 1174Debug.Assert(false,"Unknown OpenType layout table!");
MS\Internal\Shaping\TypefaceMap.cs (2)
218Debug.Assert(false, "Invalid font face spans"); 391Debug.Assert(index >= 0, "Invalid scaled shapeable typeface index spans");
MS\Internal\Shaping\UshortList2.cs (4)
135Debug.Assert(false, "Not supported"); 141Debug.Assert(false, "Not supported"); 147Debug.Assert(false, "Not supported"); 152Debug.Assert(false, "Not supported");
MS\Internal\TextFormatting\Bidi.cs (30)
685Debug.Assert(CharProperty[1, (int) startClass]==1 || (startClass == DirectionClass.ArabicLetter), 688Debug.Assert(CharProperty[1, (int) endClass]==1, ("Cannot use non strong type to resolve neutrals")); 711Debug.Assert(CharProperty[2, (int) characterClass[counter + classIndex]]==0, 736Debug.Assert(CharProperty[2, (int) characterClass[counter + classIndex]]==0, "Changing class of a fixed class"); 847Debug.Assert(startOfNeutrals == PositionInvalid, 892Debug.Assert(startOfDelayed != PositionInvalid, 937Debug.Assert(startOfNeutrals == PositionInvalid, 942Debug.Assert(startOfDelayed != PositionInvalid, 1042Debug.Assert(startOfNeutrals != PositionInvalid, 1081Debug.Assert(startOfNeutrals != PositionInvalid, 1114Debug.Assert(startOfNeutrals == PositionInvalid, 1132Debug.Assert(startOfNeutrals == PositionInvalid, 1145Debug.Assert(startOfDelayed != PositionInvalid, 1159Debug.Assert(startOfNeutrals == PositionInvalid, 1164Debug.Assert(startOfDelayed != PositionInvalid, 1175Debug.Assert(startOfNeutrals != PositionInvalid, 1184Debug.Assert(startOfNeutrals == PositionInvalid, 1202Debug.Assert(startOfDelayed != PositionInvalid, 1206Debug.Assert(lastClass == DirectionClass.EuropeanTerminator, 1213Debug.Assert(startOfNeutrals == PositionInvalid, 1218Debug.Assert(startOfDelayed != PositionInvalid, 1267Debug.Assert(startOfNeutrals != PositionInvalid, 1281Debug.Assert(startOfNeutrals == PositionInvalid, 1286Debug.Assert(startOfDelayed != PositionInvalid, 1318Debug.Assert(startOfNeutrals == PositionInvalid, 1345Debug.Assert(startOfNeutrals == PositionInvalid, 1390Debug.Assert(startOfNeutrals == PositionInvalid, 1426Debug.Assert(startOfDelayed != PositionInvalid, 1568Debug.Assert(startOfNeutrals == PositionInvalid, 2459Debug.Assert(runLengthResolved == runLength,
MS\Internal\TextFormatting\FullTextState.cs (1)
288Debug.Assert(lsccp > 0, "Zero-length text line!");
MS\Internal\TextFormatting\LineServicesCallbacks.cs (9)
162Debug.Assert(TextStore.IsContent(plsrun), "Unrecognizable run!"); 163Debug.Assert(lsrun.RunProp != null, "invalid lsrun!"); 594Debug.Assert(markerStore != null, "No marker store, yet autonumbering is specified!"); 664Debug.Assert( 728Debug.Assert( 1238Debug.Assert(false, "Not supported TextDecorationUnit"); 1265Debug.Assert(false, "Not supported TextDecorationUnit"); 2316Debug.Assert(false, "Unsupported installed object!"); 2606Debug.Assert(fGeometryProvided == 0, "Line enumeration doesn't need geometry information");
MS\Internal\TextFormatting\TextMarkerSource.cs (1)
128Debug.Assert(false, "Invalid marker style");
MS\Internal\TextFormatting\TextRunCacheImp.cs (2)
176Debug.Assert(textRun != null && runLength > 0, "Invalid run!"); 249Debug.Assert(
MS\Internal\UIElementHelper.cs (3)
17Debug.Assert(o != null, "UIElementHelper.IsHitTestVisible called with null argument"); 32Debug.Assert(o != null, "UIElementHelper.IsVisible called with null argument"); 47Debug.Assert(o != null, "UIElementHelper.PredictFocus called with null argument");
src\Microsoft.DotNet.Wpf\src\Common\Graphics\exports.cs (1)
1072Debug.Assert(_others == null, "There shouldn't be anything stored in the others array.");
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\CharacterBuffer.cs (2)
245Debug.Assert(characterOffset >= 0 && characterOffset < _characterArray.Length, "Invalid character index"); 345Debug.Assert(characterOffset >= 0 && characterOffset < _string.Length, "Invalid character index");
System\IO\Packaging\PackWebRequest.cs (2)
67Debug.Assert(uri != null, "PackWebRequest uri cannot be null"); 68Debug.Assert(packageUri != null, "packageUri cannot be null");
System\IO\Packaging\PackWebResponse.cs (1)
612Debug.Assert(false, "Cannot return full-container stream from cached container object");
System\Windows\Automation\Peers\AutomationPeer.cs (1)
1629Debug.Assert(caller._children != null, "iteration over a null family");
System\Windows\BinaryFormat\BinaryFormatWriter.cs (1)
611Debug.Assert(ex is ArgumentException, "We should only be getting ArgumentExceptions on write.");
System\Windows\ClassHandlersStore.cs (4)
36Debug.Assert(index != -1, "There should exist a set of handlers for the given routedEvent"); 75Debug.Assert(index != -1, "There should exist a set of handlers for the given index"); 86Debug.Assert(GetHandlersIndex(routedEvent) == -1, "There should not exist a set of handlers for the given routedEvent"); 106Debug.Assert(baseClassListeners != null, "Update only when there are base class listeners to be updated");
System\Windows\DragDrop.cs (2)
566Debug.Assert(dragSource != null, "Invalid dragSource"); 567Debug.Assert(dataObject != null, "Invalid dataObject");
System\Windows\DragEventArgs.cs (3)
45Debug.Assert(false, "Invalid dragDropKeyStates"); 50Debug.Assert(false, "Invalid allowedEffects"); 55Debug.Assert(false, "Invalid target");
System\Windows\EventHandlersStore.cs (2)
250Debug.Assert(key != null, "Search key cannot be null"); 268Debug.Assert(key != null, "Search key cannot be null");
System\Windows\FreezableCollection.cs (2)
981Debug.Assert(list != null, "list may not be null."); 1079Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Generated\TextDecorationCollection.cs (2)
734Debug.Assert(list != null, "list may not be null."); 832Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\GiveFeedbackEventArgs.cs (1)
41Debug.Assert(false, "Invalid effects");
System\Windows\GlobalEventManager.cs (3)
24Debug.Assert(GetRoutedEventFromName(name, ownerType, false) == null, 57Debug.Assert( 62Debug.Assert(routedEvent.IsLegalHandler(handler),
System\Windows\Ink\IncrementalHitTester.cs (2)
205Debug.Assert(false, "Benign assert. IncrementalHitTester's _strokeInfos cache is out of sync, rebuilding."); 213Debug.Assert(false, "Benign assert. IncrementalHitTester's _strokeInfos cache is out of sync, rebuilding.");
System\Windows\Input\AccessKeyManager.cs (2)
241Debug.Assert(target != null, "Targets should only be UIElements"); 603Debug.Assert(element is IInputElement, "Element in AccessKeyManager store was not of type IInputElement");
System\Windows\Input\Command\CommandBinding.cs (2)
181Debug.Assert(Executed != null, nameof(Executed) + " != null"); 189Debug.Assert(PreviewExecuted != null, nameof(PreviewExecuted) + " != null");
System\Windows\Input\InputLanguageSource.cs (1)
194Debug.Assert(_ipp == null, "_EnsureInputProcesoorProfile has been called.");
System\Windows\Input\InputMethod.cs (1)
715Debug.Assert(false, "Unknown Speech Mode");
System\Windows\Input\InputMethodStateTypeInfo.cs (1)
92Debug.Assert(false, "The guid does not match.");
System\Windows\Input\InputProcessorProfiles.cs (5)
63Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "Initialize called on MTA thread!"); 65Debug.Assert(_ipp == null, "Initialize called twice"); 83Debug.Assert(_ipp != null, "Uninitialize called without initializing"); 181Debug.Assert(_cookie == UnsafeNativeMethods.TF_INVALID_COOKIE, "Cookie is already set."); 196Debug.Assert(_cookie != UnsafeNativeMethods.TF_INVALID_COOKIE, "Cookie is not set.");
System\Windows\Input\InputProcessorProfilesLoader.cs (1)
57Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "Load called on MTA thread!");
System\Windows\Input\Manipulation.cs (1)
41Debug.Assert(element != null, "element should be non-null.");
System\Windows\Input\ManipulationDevice.cs (2)
75Debug.Assert(element != null, "element should be non-null."); 104Debug.Assert(element != null, "element should be non-null.");
System\Windows\Input\ManipulationLogic.cs (1)
302Debug.Assert(_generatedEvent == null, "There is already a generated event waiting to be pushed.");
System\Windows\Input\MouseDevice.cs (1)
1455Debug.Assert(_mouseOver == null, "_mouseOver should be null because we have called ChangeMouseOver(null) already.");
System\Windows\Input\Stylus\Common\DynamicRenderer.cs (1)
584Debug.Assert(_waitingForRenderComplete, "We were expecting to be waiting for a RenderComplete to call our OnRenderComplete, we might never reset and get flashing strokes from here on out");
System\Windows\Input\Stylus\Common\StylusLogic.cs (1)
768Debug.Assert(false, "Unknown Flick Action encountered");
System\Windows\Input\Stylus\Common\StylusPointCollection.cs (3)
145Debug.Assert(0 == rawPacketData.Length % lengthPerPoint, "Invalid assumption about packet length, there shouldn't be any remainder"); 559Debug.Assert(this.Count != 0, "Why are we serializing an empty StylusPointCollection???"); 644Debug.Assert(e.Cancel, "This event should always be cancelled");
System\Windows\Input\Stylus\Common\StylusPointPropertyInfo.cs (1)
115Debug.Assert(( stylusPointPropertyInfo1.Id != StylusPointPropertyIds.X &&
System\Windows\Input\Stylus\Pointer\PointerTabletDeviceInfo.cs (3)
258Debug.Assert(properties[StylusPointDescription.RequiredXIndex /*0*/].Id == StylusPointPropertyIds.X || !seenX, 260Debug.Assert(properties[StylusPointDescription.RequiredYIndex /*1*/].Id == StylusPointPropertyIds.Y || !seenY, 262Debug.Assert(properties[StylusPointDescription.RequiredPressureIndex /*1*/].Id == StylusPointPropertyIds.NormalPressure /*2*/,
System\Windows\Input\Stylus\Wisp\PenContext.cs (3)
150Debug.Assert(propertyInfos[StylusPointDescription.RequiredXIndex /*0*/].Id == StylusPointPropertyIds.X, "X isn't where we expect it! Fix PenImc to ask for X at index 0"); 151Debug.Assert(propertyInfos[StylusPointDescription.RequiredYIndex /*0*/].Id == StylusPointPropertyIds.Y, "Y isn't where we expect it! Fix PenImc to ask for Y at index 1"); 152Debug.Assert(pressureIndex == -1 || pressureIndex == StylusPointDescription.RequiredPressureIndex /*2*/,
System\Windows\Input\Stylus\Wisp\PenThreadPool.cs (1)
144Debug.Assert(false, "Retry limit reached when acquiring PenThread");
System\Windows\Input\Stylus\Wisp\PenThreadWorker.cs (2)
933Debug.Assert(properties[StylusPointDescription.RequiredXIndex /*0*/].Id == StylusPointPropertyIds.X, "X isn't where we expect it! Fix PenImc to ask for X at index 0"); 934Debug.Assert(properties[StylusPointDescription.RequiredYIndex /*1*/].Id == StylusPointPropertyIds.Y, "Y isn't where we expect it! Fix PenImc to ask for Y at index 1");
System\Windows\Input\Stylus\Wisp\WispLogic.cs (1)
3305Debug.Assert(!_inputEnabled, "StylusLogic has been enabled unexpectly.");
System\Windows\Input\Stylus\Wisp\WispTabletDeviceCollection.cs (2)
268Debug.Assert(false, "Error acquiring PenThread in UpdateTabletsImpl()"); 416Debug.Assert(false, "Error acquiring PenThread in HandleTabletAdded()");
System\Windows\Input\TextServicesCompartment.cs (2)
87Debug.Assert(_cookie == UnsafeNativeMethods.TF_INVALID_COOKIE, "cookie is already set."); 108Debug.Assert(_cookie != UnsafeNativeMethods.TF_INVALID_COOKIE, "cookie is not set.");
System\Windows\Input\TextServicesContext.cs (1)
47Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "SetDispatcherThreaad on MTA thread");
System\Windows\Input\TouchDevice.cs (3)
602Debug.Assert(oldCapture != null, "oldCapture should be non-null."); 611Debug.Assert(captured != null, "captured should be non-null."); 849Debug.Assert(newDirectlyOver != _directlyOver, "ChangeDirectlyOver called when newDirectlyOver is the same as _directlyOver.");
System\Windows\InterOp\HwndSource.cs (3)
1019Debug.Assert(_hwndTarget!= null, "HwndTarget is null"); 1020Debug.Assert(_hwndTarget.IsDisposed == false, "HwndTarget is disposed"); 2264Debug.Assert(null!=ikis, "ChildSinkWithFocus called when none had focus");
System\Windows\Media\Animation\AnimationLayer.cs (6)
35Debug.Assert(defaultDestinationValue != DependencyProperty.UnsetValue, 82Debug.Assert(handoffBehavior == HandoffBehavior.Compose, 84Debug.Assert(defaultDestinationValue == DependencyProperty.UnsetValue, 136Debug.Assert(_hasStickySnapshotValue, 146Debug.Assert(_animationClocks != null 154Debug.Assert(index >= 0,
System\Windows\Media\Animation\AnimationStorage.cs (10)
510Debug.Assert(index > -1, 539Debug.Assert(_hasStickySnapshotValue, 589Debug.Assert(animationClocks != null, 591Debug.Assert(animationClocks.Count > 0, 593Debug.Assert(!animationClocks.Contains(null), 595Debug.Assert(HandoffBehaviorEnum.IsDefined(handoffBehavior), 707Debug.Assert(HandoffBehaviorEnum.IsDefined(handoffBehavior), 780Debug.Assert(HandoffBehaviorEnum.IsDefined(handoffBehavior), 896Debug.Assert(storage != null, 1145Debug.Assert(type == typeof(Vector3D), "Application is trying to create independent animation storage for an unsupported type.");
System\Windows\Media\Animation\Clock.cs (24)
1396Debug.Assert(_resolvedDuration != Duration.Automatic, "_resolvedDuration should never be set to Automatic."); 1944Debug.Assert(_currentDuration != Duration.Automatic, "_currentDuration should never be Automatic."); 2170Debug.Assert(_currentDuration == Duration.Forever, "_currentDuration has an invalid enum value."); 2189Debug.Assert(this is ClockGroup, "ComputeCurrentIterationWithGrow should only run on ClockGroups."); 2190Debug.Assert(CanGrow, "ComputeCurrentIterationWithGrow should only run on clocks with CanGrow."); 2191Debug.Assert(_currentIterationBeginTime.HasValue, "ComputeCurrentIterationWithGrow should only be called when _currentIterationBeginTime has a value."); 2192Debug.Assert(_resolvedDuration.HasTimeSpan, "ComputeCurrentIterationWithGrow should only be called when _resolvedDuration has a value."); // We must have a computed duration 2193Debug.Assert(_currentDuration.HasTimeSpan, "ComputeCurrentIterationWithGrow should only be called when _currentDuration has a value."); 2340Debug.Assert(_currentDuration != Duration.Automatic, "_currentDuration should never be Automatic."); 2344Debug.Assert(_currentDuration.TimeSpan > TimeSpan.Zero, "ComputeCurrentTime was entered with _currentDuration <= 0"); 2351Debug.Assert(transitionTime <= 1, "The values of the accel and decel attributes incorrectly add to more than 1.0"); 2352Debug.Assert(transitionTime >= 0, "The values of the accel and decel attributes incorrectly add to less than 0.0"); 2415Debug.Assert(_currentDuration == Duration.Forever, "_currentDuration has an invalid enum value."); 2443Debug.Assert(_resolvedDuration == Duration.Forever, "_resolvedDuration should be Forever when NaturalDuration is Automatic."); 2476Debug.Assert(_resolvedDuration != Duration.Automatic, "_resolvedDuration should never be Automatic."); 2477Debug.Assert(_currentDuration != Duration.Automatic, "_currentDuration should never be Automatic."); 2499Debug.Assert(_currentDuration.HasTimeSpan, "_currentDuration is invalid, neither Forever nor a TimeSpan."); 2500Debug.Assert(_currentDuration == _resolvedDuration, "For clocks which cannot grow, _currentDuration must equal _resolvedDuration."); 2512Debug.Assert(_resolvedDuration.HasTimeSpan, "_resolvedDuration is invalid, neither Forever nor a TimeSpan."); 2513Debug.Assert(_currentDuration.HasTimeSpan, "_currentDuration is invalid, neither Forever nor a TimeSpan."); 2653Debug.Assert(!_currentIterationBeginTime.HasValue, "_currentIterationBeginTime should not have a value when _beginTime has no value."); 3079Debug.Assert(_rootData != null, "A root Clock must have the _rootData structure initialized."); 3393Debug.Assert(!current.IsRoot, "Root nodes never should reset their Slip amounts with ResetSlipOnSubtree(), even when seeking."); 4170Debug.Assert(Math.Abs(optimizedInputTime - inputTime) <= error,
System\Windows\Media\Animation\ClockController.cs (1)
32Debug.Assert(owner != null, "ClockController must have a non-null owner.");
System\Windows\Media\Animation\ClockGroup.cs (8)
408Debug.Assert(!IsTimeManager, "Cannot associate a root with multiple timing trees"); 409Debug.Assert(this._timeManager == null, "Cannot use a timeline already in the timing tree as a root"); 410Debug.Assert(timeManager.TimeManagerClock == this, "Cannot associate more than one root per timing tree"); 411Debug.Assert(this._parent == null && _children == null, "Cannot use a timeline connected to other timelines as a root"); 458Debug.Assert(IsTimeManager, "Invalid call to RootActivate for a non-root Clock"); 474Debug.Assert(IsTimeManager, "Invalid call to RootCleanChildren for a non-root Clock"); 497Debug.Assert(IsTimeManager, "Invalid call to RootHasChildren for a non-root Clock"); 508Debug.Assert(IsTimeManager, "Invalid call to RootDeactivate for a non-root Clock");
System\Windows\Media\Animation\Generated\BooleanAnimationUsingKeyFrames.cs (6)
338Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 527Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 534Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 584Debug.Assert(!_areKeyTimesValid, "KeyFrameBooleanAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 728Debug.Assert(index < keyFrameCount, 804Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\ByteAnimationUsingKeyFrames.cs (6)
338Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 619Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 626Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 676Debug.Assert(!_areKeyTimesValid, "KeyFrameByteAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 820Debug.Assert(index < keyFrameCount, 896Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\CharAnimationUsingKeyFrames.cs (6)
337Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 526Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 533Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 583Debug.Assert(!_areKeyTimesValid, "KeyFrameCharAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 727Debug.Assert(index < keyFrameCount, 803Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\ColorAnimationUsingKeyFrames.cs (6)
338Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 619Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 626Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 676Debug.Assert(!_areKeyTimesValid, "KeyFrameColorAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 820Debug.Assert(index < keyFrameCount, 896Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\DecimalAnimationUsingKeyFrames.cs (6)
338Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 619Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 626Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 676Debug.Assert(!_areKeyTimesValid, "KeyFrameDecimalAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 820Debug.Assert(index < keyFrameCount, 896Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\DoubleAnimationUsingKeyFrames.cs (6)
338Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 619Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 626Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 676Debug.Assert(!_areKeyTimesValid, "KeyFrameDoubleAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 820Debug.Assert(index < keyFrameCount, 896Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Int16AnimationUsingKeyFrames.cs (6)
338Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 619Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 626Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 676Debug.Assert(!_areKeyTimesValid, "KeyFrameInt16Animaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 820Debug.Assert(index < keyFrameCount, 896Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Int32AnimationUsingKeyFrames.cs (6)
338Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 619Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 626Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 676Debug.Assert(!_areKeyTimesValid, "KeyFrameInt32Animaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 820Debug.Assert(index < keyFrameCount, 896Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Int64AnimationUsingKeyFrames.cs (6)
338Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 619Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 626Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 676Debug.Assert(!_areKeyTimesValid, "KeyFrameInt64Animaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 820Debug.Assert(index < keyFrameCount, 896Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\MatrixAnimationUsingKeyFrames.cs (6)
337Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 526Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 533Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 583Debug.Assert(!_areKeyTimesValid, "KeyFrameMatrixAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 727Debug.Assert(index < keyFrameCount, 803Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\ObjectAnimationUsingKeyFrames.cs (6)
337Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 526Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 533Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 583Debug.Assert(!_areKeyTimesValid, "KeyFrameObjectAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 727Debug.Assert(index < keyFrameCount, 803Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Point3DAnimationUsingKeyFrames.cs (6)
339Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 620Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 627Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 677Debug.Assert(!_areKeyTimesValid, "KeyFramePoint3DAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 821Debug.Assert(index < keyFrameCount, 897Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\PointAnimationUsingKeyFrames.cs (6)
338Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 619Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 626Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 676Debug.Assert(!_areKeyTimesValid, "KeyFramePointAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 820Debug.Assert(index < keyFrameCount, 896Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\QuaternionAnimationUsingKeyFrames.cs (6)
339Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 620Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 627Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 677Debug.Assert(!_areKeyTimesValid, "KeyFrameQuaternionAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 821Debug.Assert(index < keyFrameCount, 897Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\RectAnimationUsingKeyFrames.cs (6)
338Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 619Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 626Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 676Debug.Assert(!_areKeyTimesValid, "KeyFrameRectAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 820Debug.Assert(index < keyFrameCount, 896Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Rotation3DAnimationUsingKeyFrames.cs (6)
339Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 620Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 627Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 677Debug.Assert(!_areKeyTimesValid, "KeyFrameRotation3DAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 821Debug.Assert(index < keyFrameCount, 897Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\SingleAnimationUsingKeyFrames.cs (6)
338Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 619Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 626Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 676Debug.Assert(!_areKeyTimesValid, "KeyFrameSingleAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 820Debug.Assert(index < keyFrameCount, 896Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\SizeAnimationUsingKeyFrames.cs (6)
338Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 619Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 626Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 676Debug.Assert(!_areKeyTimesValid, "KeyFrameSizeAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 820Debug.Assert(index < keyFrameCount, 896Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\StringAnimationUsingKeyFrames.cs (6)
337Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 526Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 533Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 583Debug.Assert(!_areKeyTimesValid, "KeyFrameStringAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 727Debug.Assert(index < keyFrameCount, 803Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\TimelineCollection.cs (2)
741Debug.Assert(list != null, "list may not be null."); 840Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Animation\Generated\TimelineGroup.cs (1)
172Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Animation\Generated\Vector3DAnimationUsingKeyFrames.cs (6)
339Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 620Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 627Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 677Debug.Assert(!_areKeyTimesValid, "KeyFrameVector3DAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 821Debug.Assert(index < keyFrameCount, 897Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\VectorAnimationUsingKeyFrames.cs (6)
338Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 619Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 626Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 676Debug.Assert(!_areKeyTimesValid, "KeyFrameVectorAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 820Debug.Assert(index < keyFrameCount, 896Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\TimelineClockCollection.cs (2)
418Debug.Assert(owner != null, "ClockCollection must have a non-null owner."); 427Debug.Assert(false, "Parameterless constructor is illegal for ClockCollection.");
System\Windows\Media\Animation\TimeManager.cs (1)
576Debug.Assert(false, "Unrecognized TimeState enumeration value");
System\Windows\Media\BitmapCacheBrush.cs (1)
178Debug.Assert(InternalTarget == AutoWrapVisual,
System\Windows\Media\Effects\Generated\BitmapEffectCollection.cs (2)
733Debug.Assert(list != null, "list may not be null."); 831Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Effects\Generated\BitmapEffectGroup.cs (1)
191Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Effects\Generated\BitmapEffectInput.cs (1)
225Debug.Assert(s_Input == null || s_Input.IsFrozen,
System\Windows\Media\Effects\ShaderEffect.cs (1)
715Debug.Assert(!hBrush.IsNull || ss._brush == null, "If brush isn't null, hBrush better not be");
System\Windows\Media\EventProxy.cs (2)
30Debug.Assert(((IntPtr)pEPD.m_handle) != IntPtr.Zero, "If this asserts fires: Why is it firing? It might be legal in future."); 105Debug.Assert(((IntPtr)epd.m_handle) != IntPtr.Zero, "Stream is disposed.");
System\Windows\Media\FormattedText.cs (2)
1717Debug.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."); 1718Debug.Assert(_defaultParaProps.TextMarkerProperties == null, "FormattedText was assumed to always have no TextMarkerProperties. This assumption has changed and thus the calculation of Width and Overhangs should be revised.");
System\Windows\Media\Generated\Brush.cs (2)
424Debug.Assert(s_Transform == null || s_Transform.IsFrozen, 428Debug.Assert(s_RelativeTransform == null || s_RelativeTransform.IsFrozen,
System\Windows\Media\Generated\CombinedGeometry.cs (2)
419Debug.Assert(s_Geometry1 == null || s_Geometry1.IsFrozen, 423Debug.Assert(s_Geometry2 == null || s_Geometry2.IsFrozen,
System\Windows\Media\Generated\DashStyle.cs (1)
320Debug.Assert(s_Dashes == null || s_Dashes.IsFrozen,
System\Windows\Media\Generated\DoubleCollection.cs (2)
758Debug.Assert(list != null, "list may not be null."); 856Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\DrawingCollection.cs (2)
773Debug.Assert(list != null, "list may not be null."); 871Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\DrawingGroup.cs (1)
818Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Generated\GeneralTransformCollection.cs (2)
731Debug.Assert(list != null, "list may not be null."); 829Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\GeneralTransformGroup.cs (1)
179Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Generated\Geometry.cs (1)
348Debug.Assert(s_Transform == null || s_Transform.IsFrozen,
System\Windows\Media\Generated\GeometryCollection.cs (2)
773Debug.Assert(list != null, "list may not be null."); 871Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\GeometryGroup.cs (1)
472Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Generated\GradientBrush.cs (1)
271Debug.Assert(s_GradientStops == null || s_GradientStops.IsFrozen,
System\Windows\Media\Generated\GradientStopCollection.cs (2)
835Debug.Assert(list != null, "list may not be null."); 933Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\GuidelineSet.cs (2)
342Debug.Assert(s_GuidelinesX == null || s_GuidelinesX.IsFrozen, 346Debug.Assert(s_GuidelinesY == null || s_GuidelinesY.IsFrozen,
System\Windows\Media\Generated\Int32Collection.cs (2)
757Debug.Assert(list != null, "list may not be null."); 855Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\PathFigure.cs (1)
256Debug.Assert(s_Segments == null || s_Segments.IsFrozen,
System\Windows\Media\Generated\PathFigureCollection.cs (2)
826Debug.Assert(list != null, "list may not be null."); 924Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\PathGeometry.cs (1)
273Debug.Assert(s_Figures == null || s_Figures.IsFrozen,
System\Windows\Media\Generated\PathSegmentCollection.cs (2)
731Debug.Assert(list != null, "list may not be null."); 829Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\Pen.cs (1)
545Debug.Assert(s_DashStyle == null || s_DashStyle.IsFrozen,
System\Windows\Media\Generated\PointCollection.cs (2)
759Debug.Assert(list != null, "list may not be null."); 857Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\PolyBezierSegment.cs (1)
192Debug.Assert(s_Points == null || s_Points.IsFrozen,
System\Windows\Media\Generated\PolyLineSegment.cs (1)
192Debug.Assert(s_Points == null || s_Points.IsFrozen,
System\Windows\Media\Generated\PolyQuadraticBezierSegment.cs (1)
192Debug.Assert(s_Points == null || s_Points.IsFrozen,
System\Windows\Media\Generated\TextEffectCollection.cs (2)
731Debug.Assert(list != null, "list may not be null."); 829Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\TransformCollection.cs (2)
773Debug.Assert(list != null, "list may not be null."); 871Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\TransformGroup.cs (1)
422Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Generated\VectorCollection.cs (2)
759Debug.Assert(list != null, "list may not be null."); 857Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\GeometryHitTestParameters.cs (1)
91Debug.Assert(_hitGeometryInternal.Transform.Value == _hitGeometryCache.Transform.Value,
System\Windows\Media\HostVisual.cs (1)
323Debug.Assert(channelDispatcher == this.Dispatcher, "HostVisual connecting on a second thread");
System\Windows\Media\ImageSourceConverter.cs (1)
215Debug.Assert(rawData != null, "rawData is null.");
System\Windows\Media\Imaging\BitmapFrame.cs (2)
50Debug.Assert((stream == null), "Both stream and uri are non-null"); 71Debug.Assert((stream != null), "Both stream and uri are null");
System\Windows\Media\Imaging\BitmapVisualManager.cs (1)
94Debug.Assert (renderTargetBitmap != null, "Render Target is null");
System\Windows\Media\Imaging\Generated\ColorConvertedBitmap.cs (1)
357Debug.Assert(s_Source == null || s_Source.IsFrozen,
System\Windows\Media\Imaging\Generated\CroppedBitmap.cs (1)
300Debug.Assert(s_Source == null || s_Source.IsFrozen,
System\Windows\Media\Imaging\Generated\FormatConvertedBitmap.cs (1)
358Debug.Assert(s_Source == null || s_Source.IsFrozen,
System\Windows\Media\Imaging\Generated\TransformedBitmap.cs (2)
318Debug.Assert(s_Source == null || s_Source.IsFrozen, 322Debug.Assert(s_Transform == null || s_Transform.IsFrozen,
System\Windows\Media\MediaContext.cs (11)
604Debug.Assert(InterlockIsEnabled, 701Debug.Assert(_interlockState == InterlockState.WaitingForResponse, 778Debug.Assert(!InterlockIsWaiting, 843Debug.Assert(InterlockIsWaiting, 1078Debug.Assert(IsClockSupported, "MediaContext.CurrentTime called when QueryPerformaceCounter is not supported"); 1337Debug.Assert(_interlockState == InterlockState.Disabled, 1367Debug.Assert(dispatcher != null, "Dispatcher required"); 2121Debug.Assert(_needToCommitChannel, "CommitChannel called with nothing on the channel"); 2125Debug.Assert(!InterlockIsWaiting, 2191Debug.Assert(InterlockIsEnabled, 2523Debug.Assert(_interlockState == InterlockState.WaitingForNextFrame
System\Windows\Media\mediaeventshelper.cs (3)
85Debug.Assert((sender != null), "Sender is null"); 86Debug.Assert((sender.Dispatcher != null), "Dispatcher is null"); 252Debug.Assert((cb == size), "Invalid event packet");
System\Windows\Media\MediaSystem.cs (1)
268Debug.Assert(reference != null, "The reference object can not be null.");
System\Windows\Media\PathStreamGeometryContext.cs (4)
66Debug.Assert(_figures == null, "It is illegal to call SetFigureCount multiple times or after BeginFigure."); 75Debug.Assert(_figures != null, "It is illegal to call SetSegmentCount before BeginFigure."); 76Debug.Assert(_currentFigure != null, "It is illegal to call SetSegmentCount before BeginFigure."); 77Debug.Assert(_segments == null, "It is illegal to call SetSegmentCount multiple times per BeginFigure or after a *To method.");
System\Windows\Media\StreamAsIStream.cs (2)
54Debug.Assert(((IntPtr)pSD.m_handle) != IntPtr.Zero, "If this asserts fires: why is it firing. It might be legal in future."); 510Debug.Assert(((IntPtr)sd.m_handle) != IntPtr.Zero, "Stream is disposed.");
System\Windows\Media\UniqueEventHelper.cs (4)
39Debug.Assert(sender != null, "Sender is null"); 42Debug.Assert(handler != null, "Event handler is null"); 70Debug.Assert(sender != null, "Sender is null"); 73Debug.Assert(handler != null, "Event handler is null");
System\Windows\Media\Visual.cs (7)
157Debug.Assert(false, "TYPE_VISUAL or TYPE_VIEWPORT3DVISUAL expected."); 1946Debug.Assert(Point.Equals(pointParams.HitPoint, backupHitPoint), 1977Debug.Assert(Matrix.Equals(geometryParams.InternalHitGeometry.Transform.Value, originalMatrix), 3036Debug.Assert(bed != null, "Must be non-null because otherwise the code would have earlied out where new value is compared against old value."); 3281Debug.Assert(EffectField.GetValue(this) == null, "Not expecting both BitmapEffect and Effect to be set on the same node"); 3956Debug.Assert(_parent != null, "If oldParent is null, current parent should != null."); 5219Debug.Assert(cyclicBrushToChannelsMap != null, "Visual brush roots need to have the visual brush to channels map!");
System\Windows\Media\VisualCollection.cs (3)
261Debug.Assert(value == 0, "There shouldn't be a case where value != 0."); 262Debug.Assert(_size == 0, "Size must be 0 here."); 817Debug.Assert(newIndex >= 0 && newIndex <= _size, "New index is invalid");
System\Windows\Media3D\GeneralTransform2DTo3D.cs (1)
24Debug.Assert(child != null, "Going from 2D to 3D containingVisual3D.Visual should not be null");
System\Windows\Media3D\Generated\Camera.cs (1)
328Debug.Assert(s_Transform == null || s_Transform.IsFrozen,
System\Windows\Media3D\Generated\DiffuseMaterial.cs (1)
357Debug.Assert(s_Brush == null || s_Brush.IsFrozen,
System\Windows\Media3D\Generated\EmissiveMaterial.cs (1)
329Debug.Assert(s_Brush == null || s_Brush.IsFrozen,
System\Windows\Media3D\Generated\GeneralTransform3DCollection.cs (2)
731Debug.Assert(list != null, "list may not be null."); 829Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Generated\GeneralTransform3DGroup.cs (1)
179Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media3D\Generated\MaterialCollection.cs (2)
773Debug.Assert(list != null, "list may not be null."); 871Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Generated\MaterialGroup.cs (1)
422Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media3D\Generated\MeshGeometry3D.cs (4)
399Debug.Assert(s_Positions == null || s_Positions.IsFrozen, 403Debug.Assert(s_Normals == null || s_Normals.IsFrozen, 407Debug.Assert(s_TextureCoordinates == null || s_TextureCoordinates.IsFrozen, 411Debug.Assert(s_TriangleIndices == null || s_TriangleIndices.IsFrozen,
System\Windows\Media3D\Generated\Model3D.cs (1)
328Debug.Assert(s_Transform == null || s_Transform.IsFrozen,
System\Windows\Media3D\Generated\Model3DCollection.cs (2)
773Debug.Assert(list != null, "list may not be null."); 871Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Generated\Model3DGroup.cs (1)
443Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media3D\Generated\Point3DCollection.cs (2)
761Debug.Assert(list != null, "list may not be null."); 859Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Generated\RotateTransform3D.cs (1)
404Debug.Assert(s_Rotation == null || s_Rotation.IsFrozen,
System\Windows\Media3D\Generated\SpecularMaterial.cs (1)
357Debug.Assert(s_Brush == null || s_Brush.IsFrozen,
System\Windows\Media3D\Generated\Transform3DCollection.cs (2)
773Debug.Assert(list != null, "list may not be null."); 871Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Generated\Transform3DGroup.cs (1)
422Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media3D\Generated\Vector3DCollection.cs (2)
761Debug.Assert(list != null, "list may not be null."); 859Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Geometry3D.cs (1)
78Debug.Assert(facesToHit != FaceType.None,
System\Windows\Media3D\HitTestParameters3D.cs (4)
61Debug.Assert(!HasModelTransformMatrix, 110Debug.Assert(HasWorldTransformMatrix, 143Debug.Assert(HasModelTransformMatrix, 183Debug.Assert(HasHitTestProjectionMatrix,
System\Windows\Media3D\Matrix3D.cs (4)
1214Debug.Assert(!(det < Determinant || det > Determinant), 1301Debug.Assert(!(det < Determinant || det > Determinant), 1396Debug.Assert( 1414Debug.Assert(IsDistinguishedIdentity == value,
System\Windows\Media3D\MeshGeometry3D.cs (5)
166Debug.Assert(hitTestableFaces != FaceType.None, 408Debug.Assert(!double.IsInfinity(pz / pw) && !double.IsNaN(pz / pw), 413Debug.Assert(dist > 0, "Distance is negative: " + dist); 494Debug.Assert(!double.IsInfinity(pz / pw) && !double.IsNaN(pz / pw), 530Debug.Assert(_cachedBounds.IsEmpty,
System\Windows\Media3D\Quaternion.cs (1)
519Debug.Assert(!(cosOmega < -1.0) && !(cosOmega > 1.0),
System\Windows\Media3D\Viewport2DVisual3D.cs (6)
328Debug.Assert((newValue == null || newValue.InheritanceContext == null), 337Debug.Assert((newValue == null || newValue.InheritanceContext == null), 344Debug.Assert((newValue == null || newValue.InheritanceContext == null), 760Debug.Assert( (viewport2DVisual3D.InternalBitmapCacheBrush.InternalTarget == null 769Debug.Assert( (viewport2DVisual3D.InternalBitmapCacheBrush.InternalTarget == null 789Debug.Assert((viewport2DVisual3D.Visual == null || viewport2DVisual3D.Visual.InheritanceContext == null),
System\Windows\Media3D\Viewport3DVisual.cs (4)
251Debug.Assert(!e.IsASubPropertyChange, 637Debug.Assert( 657Debug.Assert( 759Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentNodeConnected),
System\Windows\Media3D\Visual3D.cs (10)
458Debug.Assert(VisualTreeHelper.GetParent(this) != null, "If oldParent is null, current parent should != null."); 1058Debug.Assert(boundsAreEqual, errorString); 1212Debug.Assert((flags & VisualProxyFlags.IsContentNodeConnected) == 0, 1583Debug.Assert(child.InheritanceContext == this, 1829Debug.Assert(_2DParent.GetValue(this) == null, 1837Debug.Assert(parent2D == null || parent2D is Viewport3DVisual, 2041Debug.Assert(!e.CheckFlagsOr(VisualFlags.ShouldPostRender), 2043Debug.Assert(!e.CheckFlagsOr(VisualFlags.NodeIsCyclicBrushRoot), 2055Debug.Assert((viewport == null) == (e.InternalVisualParent == null), 2093Debug.Assert(_inheritanceContext.GetValue(this) == UseParentAsContext,
System\Windows\Media3D\Visual3DCollection.cs (7)
481Debug.Assert(InternalGetItem(i).ParentIndex == i - 1, 505Debug.Assert(InternalGetItem(i).ParentIndex == i + 1, 539Debug.Assert(_owner != null, "How did an Visual3DCollection get constructed without an owner?"); 547Debug.Assert(!duplicates.ContainsKey(visual), "How did the visual get re-inserted?"); 550Debug.Assert(visual.InternalVisualParent == _owner, "Why isn't our child's parent pointer the same as the collection owner?"); 551Debug.Assert(visual.ParentIndex == i, 601Debug.Assert(list != null, "list may not be null.");
System\Windows\QueryContinueDragEventArgs.cs (1)
34Debug.Assert(false, "Invalid dragDropKeyStates");
System\Windows\UIElement.cs (4)
255Debug.Assert(MeasureRequest == null, "can't be clean and still have MeasureRequest"); 288Debug.Assert(ArrangeRequest == null, "can't be clean and still have MeasureRequest"); 1879Debug.Assert(routedEvent != null, "RoutedEvent must not be null"); 1915Debug.Assert(routedEvent != null, "RoutedEvent must not be null");
PresentationFramework (1097)
MS\Internal\Annotations\Anchoring\AttachedAnnotation.cs (8)
64Debug.Assert(manager != null, "LocatorManager can not be null"); 65Debug.Assert(annotation != null, "Annotation can not be null"); 66Debug.Assert(anchor != null, "Anchor can not be null"); 67Debug.Assert(attachedAnchor != null, "AttachedAnchor can not be null"); 234Debug.Assert(attachedAnchor != null, "AttachedAnchor can not be null"); 235Debug.Assert(attachmentLevel > AttachmentLevel.Unresolved && attachmentLevel <= AttachmentLevel.Incomplete, 250Debug.Assert(_selectionProcessor != null, SR.Format(SR.NoProcessorForSelectionType, attachedAnchor.GetType())); 260Debug.Assert(_attachmentLevel != AttachmentLevel.Full, "Should only set fully resolved anchor if attachment level is not full.");
MS\Internal\Annotations\Anchoring\DataIdProcessor.cs (2)
386Debug.Assert(node != null, "DependencyObject can not be null"); 407Debug.Assert(d != null, "DependencyObject can not be null");
MS\Internal\Annotations\Anchoring\FixedPageProcessor.cs (1)
319Debug.Assert(page >= 0, "page can not be negative");
MS\Internal\Annotations\Anchoring\FixedTextSelectionProcessor.cs (2)
112Debug.Assert(numOfPages >= 0, "start page number is bigger than the end page number"); 604Debug.Assert((start != null) && (end != null), "null start/end TextPointer on a non empty page");
MS\Internal\Annotations\Anchoring\LocatorManager.cs (13)
308Debug.Assert(attachedAnchor != null, "AttachedAnchor cannot be null if attachmentLevel is not Unresolved."); 358Debug.Assert(processor != null, "SubtreeProcessor can not be null"); 635Debug.Assert(startNode != null, "startNode can not be null"); 747Debug.Assert(node != null, "node can not be null"); 814Debug.Assert(data != null, "dataBlob is either null or not of ProcessingTreeState type"); 819Debug.Assert(processor != null, "SubtreeProcessor can not be null"); // There is always a default processor 841Debug.Assert(data != null, "dataBlob is either null or not of ProcessingTreeState type"); 845Debug.Assert(processor != null, "SubtreeProcessor can not be null"); 880Debug.Assert(locator != null, "locator can not be null"); 881Debug.Assert(startNode != null, "startNode can not be null"); 917Debug.Assert(offset >= 0 && offset < realLocator.Parts.Count, "offset out of range"); 1090Debug.Assert(locator != null, "locator can not be null"); 1091Debug.Assert(data.LocatorPartIndex >= 0 && data.LocatorPartIndex < locator.Parts.Count,
MS\Internal\Annotations\Anchoring\PathNode.cs (5)
210Debug.Assert(node != null, "node can not be null"); 264Debug.Assert(node != null, "node can not be null"); 303Debug.Assert(path != null, "path can not be null"); 304Debug.Assert(branch != null, "branch can not be null"); 308Debug.Assert(path.Node.Equals(branch.Node), "path.Node is not equal to branch.Node");
MS\Internal\Annotations\Component\AdornerPresentationContext.cs (1)
426Debug.Assert((adorners != null) && (adorner != null), "null adorners list or adorner");
MS\Internal\Annotations\Component\AnnotationComponentManager.cs (9)
56Debug.Assert(attachedAnnotation != null, "AttachedAnnotation should not be null"); 73Debug.Assert(attachedAnnotation != null, "AttachedAnnotation should not be null"); 140Debug.Assert(attachedAnnotation != null, "AttachedAnnotation should not be null"); 143Debug.Assert(annotatedElement != null, "the annotatedElement should inherit from UIElement"); 163Debug.Assert(annotatedElement != null, "the annotatedElement should inherit from UIElement"); 206Debug.Assert(attachedAnnotation != null, "attachedAnnotation should not be null"); 207Debug.Assert(previousAttachedAnchor != null, "previousAttachedAnchor should not be null"); 267Debug.Assert(attachedAnnotation != null, "attachedAnnotation should not be null"); 268Debug.Assert(component != null, "component should not be null");
MS\Internal\Annotations\Component\AnnotationHighlightLayer.cs (21)
73Debug.Assert(start != null, "start pointer is null"); 74Debug.Assert(end != null, "end pointer is null"); 75Debug.Assert(start.CompareTo(end) <= 0, "end pointer before start"); 111Debug.Assert(highlightRange != null, "null range data"); 341Debug.Assert(highlightRange != null, " null highlight range"); 343Debug.Assert((rangeSegments != null) && (rangeSegments.Count > 0), "invalid rangeSegments"); 354Debug.Assert(highlightSegment != null, "null highlight segment"); 378Debug.Assert(rangeEnumerator.Current.IsNull || !next || 513Debug.Assert(false, "Mismatched segment data"); 636Debug.Assert(start != null, "start pointer is null"); 637Debug.Assert(end != null, "end pointer is null"); 638Debug.Assert(owners != null, "null owners list"); 639Debug.Assert(owners.Count > 0, "empty owners list"); 641Debug.Assert(owners[i] != null, "null owner"); 792Debug.Assert((ps1 != null) && (ps2 != null) && (ps1.CompareTo(ps2) <= 0), "invalid splitting points"); 866Debug.Assert(res.Count == 2, "unexpected resulting segment count after split"); 919Debug.Assert(textViews != null, "geometry text view not found"); 938Debug.Assert((view != null) && (parentView != null), "null text view"); 980Debug.Assert(!_segment.IsNull, "null TextSegment"); 1099Debug.Assert(TopOwner != null, "invalid TopOwner"); 1101Debug.Assert(parentView != null, "geometry parent text view not found");
MS\Internal\Annotations\Component\MarkedHighlightComponent.cs (26)
364Debug.Assert(anchor != null, "undefined anchor"); 365Debug.Assert(marker.Data != null || marker.Data == Geometry.Empty, "undefined geometry"); 369Debug.Assert(geometry != null, "unexpected geometry type"); 370Debug.Assert(geometry.Children.Count == 3, "unexpected geometry children count"); 437Debug.Assert(_uiParent != null, "No selection container"); 479Debug.Assert(textContainer != null, "TextAnchor does not belong to a TextContainer"); 631Debug.Assert(componentsRegister != null, "The selection is not registered"); 657Debug.Assert(anchor != null, "wrong attachedAnchor"); 890Debug.Assert(selection != null, "Unexpected sender of Changed event"); 900Debug.Assert(components != null, "No SN registered for this selection"); 908Debug.Assert(components[i].HighlightAnchor != null, "Missing highlight anchor component"); 929Debug.Assert(sender != null, "undefined sender"); 956Debug.Assert(pos != null, "null text pointer"); 970Debug.Assert((components != null) && (components.Count > 0), "invalid component registry"); 997Debug.Assert(selectionHandler != null, "SelectionHandler handler can not be null"); 998Debug.Assert(mouseMoveHandler != null, "MouseMoveHandler handler can not be null"); 1011Debug.Assert(component != null, "component is null"); 1012Debug.Assert(_components != null, "_components are null"); 1046Debug.Assert(component != null, "component is null"); 1047Debug.Assert(_components != null, "_components are null"); 1102Debug.Assert(first != null, "first component is null"); 1103Debug.Assert((first.AttachedAnnotations != null) && (first.AttachedAnnotations.Count > 0), "first AttachedAnchor is null"); 1104Debug.Assert(second != null, "second component is null"); 1105Debug.Assert((second.AttachedAnnotations != null) && (second.AttachedAnnotations.Count > 0), "second AttachedAnchor is null"); 1110Debug.Assert(firstAnchor != null, " first TextAnchor is null"); 1111Debug.Assert(secondAnchor != null, " second TextAnchor is null");
MS\Internal\Annotations\Storage\StoreAnnotationsMap.cs (2)
43Debug.Assert(authorChanged != null && anchorChanged != null && cargoChanged != null, 69Debug.Assert(FindAnnotation(annotation.Id) == null, "annotation not found");
MS\Internal\AppModel\IconHelper.cs (1)
339Debug.Assert(nBytesCount > 0, "The N-Byte has to be greater than 0!");
MS\Internal\AppModel\Journaling.cs (5)
93Debug.Assert(_contentId == 0 || _contentId == value, 373Debug.Assert(endingPF.ParentPageFunctionId == Guid.Empty, 563Debug.Assert(ns != null, "Fragment navigation won't work when the INavigator doesn't have a NavigationService."); 650Debug.Assert(contentObject.GetType().AssemblyQualifiedName == this._typeName, 781Debug.Assert(_markupUri != null, "_markupUri in JournalEntryPageFunctionUri should be set.");
MS\Internal\AppModel\JournalNavigationScope.cs (2)
313Debug.Assert(navigationService != null, "NavigationService cannot be null for journal navigations"); 415Debug.Assert(_journal == null && value != null,
MS\Internal\AppModel\ReturnEventSaver.cs (1)
109Debug.Assert(caller != null, "Caller should not be null");
MS\Internal\Controls\ActiveXContainer.cs (3)
60Debug.Assert(_host != null, "gotta have the avalon activex host"); 206Debug.Assert(_siteUIActive == null, "Object did not call OnUIDeactivate"); 217Debug.Assert(this.ActiveXHost == site, "deactivating when not active...");
MS\Internal\Controls\InkCanvasInnerCanvas.cs (1)
278Debug.Assert(Children.Contains(hitElement), "The hit element should be a child of InnerCanvas.");
MS\Internal\Controls\InkCanvasSelectionAdorner.cs (1)
29Debug.Assert(adornedElement is InkCanvasInnerCanvas,
MS\Internal\Controls\ModelTreeEnumerator.cs (6)
138Debug.Assert(contentControl != null, "contentControl should be non-null."); 158Debug.Assert(headeredContentControl != null, "headeredContentControl should be non-null."); 159Debug.Assert(header != null, "Header should be non-null. If Header was null, the base ContentControl enumerator should have been used."); 218Debug.Assert(headeredItemsControl != null, "headeredItemsControl should be non-null."); 219Debug.Assert(items != null, "items should be non-null."); 220Debug.Assert(header != null, "header should be non-null. If Header was null, the base ItemsControl enumerator should have been used.");
MS\Internal\Controls\StickyNote\StickyNoteAnnotations.cs (4)
722Debug.Assert(false, "The annotation data does match with the current content control in StickyNote"); 1368Debug.Assert(((IAnnotationComponent)this).AnnotatedElement != null, "undefined annotated element"); 1395Debug.Assert(adornerTransform != null, "transform to AnnotatedElement is null"); 1561Debug.Assert(_attachedAnnotation != null, "This property should never be acccessed from outside of CAF");
MS\Internal\Controls\StickyNote\StickyNoteContentControl.cs (1)
395Debug.Assert(node != null, "Try to load data from an invalid node");
MS\Internal\Controls\TemplatedAdorner.cs (3)
41Debug.Assert(adornedElement != null, "adornedElement should not be null"); 42Debug.Assert(adornerTemplate != null, "adornerTemplate should not be null"); 136Debug.Assert(_child != null, "_child should not be null");
MS\Internal\Controls\WebBrowserEvent.cs (7)
32Debug.Assert(parent != null, "WebBrowser control required for hooking webbrowser events"); 42Debug.Assert(url == null || url is string, "invalid url type"); 43Debug.Assert(targetFrameName == null || targetFrameName is string, "invalid targetFrameName type"); 44Debug.Assert(headers == null || headers is string, "invalid headers type"); 158Debug.Assert(url == null || url is string, "invalid url type"); 175Debug.Assert(psi != null, "The Document does not implement IPersistStreamInit"); 212Debug.Assert(url == null || url is string, "invalid url type");
MS\Internal\Data\BindingWorker.cs (1)
30Debug.Assert((int)Feature.LastFeatureId <= 32, "UncommonValueTable supports only 32 Ids");
MS\Internal\Data\CollectionViewGroupRoot.cs (2)
152Debug.Assert(System.Windows.Controls.ItemsControl.EqualsEx(item, ProtectedItems[index]), "RemoveSpecialItem finds inconsistent data"); 637Debug.Assert(false, "Failed to find item in expected subgroup after Move");
MS\Internal\Data\CompositeCollectionView.cs (3)
408Debug.Assert(startingIndex >= 0, "Source composite collection failed to supply an index"); 1654Debug.Assert(false, "CurrentItem is not consistent with CurrentPosition"); 1659Debug.Assert(false, "CurrentItem is not consistent with CurrentPosition");
MS\Internal\Data\DataExtensionMethods.cs (1)
34Debug.Assert(false, "Unsupported list passed to Search");
MS\Internal\Data\IndexedEnumerable.cs (2)
394Debug.Assert(false, "EnsureCacheCurrent: _enumerator.Current failed with InvalidOperationException"); 396Debug.Assert(System.Windows.Controls.ItemsControl.EqualsEx(_cachedItem, current), "EnsureCacheCurrent: _cachedItem out of sync with _enumerator.Current");
MS\Internal\Data\LiveShapingBlock.cs (1)
86Debug.Assert(index < size, "FindPosition called with item not in its block");
MS\Internal\Data\LiveShapingList.cs (1)
259Debug.Assert(sdc.Count >= _compInfos.Length, "SortDescriptions don't match LivePropertyInfos");
MS\Internal\Data\PropertyPathWorker.cs (2)
605Debug.Assert(0 <= k && k < _arySVS.Length && _arySVS[k].collectionView == collectionView, "bad parameters to UpdateSourceValueState"); 1138Debug.Assert(_dependencySourcesChanged, "Cached accessor didn't change sources");
MS\Internal\Data\RBNode.cs (4)
419Debug.Assert(successor != null && successor.Size < MaxSize, "InsertAt: successor should have room"); 440Debug.Assert(succsucc.Size == MaxSize, "InsertAt: outer nodes should be full"); 518Debug.Assert(index >= node.LeftSize + node.Size, "InsertNode: index should fall between nodes"); 571Debug.Assert(!deleteHere || node.Size == 0, "DeleteNode: Deleted node should be empty");
MS\Internal\Data\StaticPropertyChangedEventManager.cs (6)
84Debug.Assert(false, "Should never get here"); 92Debug.Assert(false, "Should never get here"); 154Debug.Assert(handler != null && type != null && propertyName != null, 179Debug.Assert(handler != null && type != null && propertyName != null, 400Debug.Assert((String)de.Key != AllListenersKey, "special key should not appear"); 488Debug.Assert(_toRemove.Count == 0, "to-remove list should be empty");
MS\Internal\Data\ValueChangedEventManager.cs (3)
188Debug.Assert(_toRemove.Count == 0, "to-remove list should be empty"); 296Debug.Assert(listener != null && source != null && pd != null, 304Debug.Assert(listener != null && source != null && pd != null,
MS\Internal\Data\ViewManager.cs (1)
237Debug.Assert(cvs != null, "Required CVS key is missing");
MS\Internal\Data\XDeferredAxisSource.cs (1)
78Debug.Assert(aryMembers.Length == 1, "XLinq changed XDeferredAxis to have more than one indexer");
MS\Internal\Documents\Application\DocumentApplicationJournalEntry.cs (1)
70Debug.Assert(docViewer != null, "PUIDocumentApplicationDocumentViewer not found.");
MS\Internal\Documents\HostedElements.cs (1)
186Debug.Assert(false, "Invalid state in HostedElements.cs");
MS\Internal\Documents\PageCache.cs (1)
736Debug.Assert(changes != null, "Attempt to fire PageCacheChangedEvent with null change set.");
MS\Internal\Documents\RowCache.cs (1)
1063Debug.Assert(false, "Requested to update a non-existent row.");
MS\Internal\Documents\TableTextElementCollectionInternal.cs (1)
342Debug.Assert(false, "Garbage in logical tree.");
MS\Internal\Documents\TextBoxView.cs (1)
1181System.Diagnostics.Debug.Assert(_host != null && _host.TextContainer != null && _host.TextContainer.Highlights != null,
MS\Internal\Documents\TextParagraphView.cs (1)
323Debug.Assert(lines != null && lines.Count > 0, "Line array is empty.");
MS\Internal\Globalization\BamlResourceSerializer.cs (2)
52Debug.Assert(output != null, "The output stream given is null"); 53Debug.Assert(tree != null && tree.Root != null, "The tree to be serialized is null.");
MS\Internal\Globalization\BamlTreeMap.cs (2)
39Debug.Assert(tree != null, "Baml Tree is empty"); 40Debug.Assert(localizer != null, "BamlLocalizer is null");
MS\Internal\Globalization\BamlTreeNode.cs (2)
39Debug.Assert(root != null, "Baml tree root is null!"); 40Debug.Assert(size > 0, "Baml tree size is less than 1");
MS\Internal\Globalization\BamlTreeUpdater.cs (3)
23Debug.Assert(tree != null && tree.Root != null, "Empty Tree!"); 24Debug.Assert(treeMap != null, "Empty map!"); 25Debug.Assert(dictionary != null, "Empty dictionary");
MS\Internal\Globalization\LocalizableResourceBuilder.cs (1)
516Debug.Assert(false, "Can't process localizability attribute on nodes other than Element, Property and LiteralContent.");
MS\Internal\Helper.cs (5)
592Debug.Assert(targetDependencyObject != null, "DependencyProperties can only be set on DependencyObjects"); 638Debug.Assert(targetMember is PropertyInfo || targetMember is MethodInfo, 651Debug.Assert(parameterInfos.Length == 2, "The signature of a static settor must contain two parameters"); 1249Debug.Assert(virtualizingElement != null, "Must have a virtualizingElement to clear"); 1327Debug.Assert(VisualTreeHelper.IsAncestorOf(pathEndElement, pathStartElement), "pathEndElement should be an ancestor of pathStartElement");
MS\Internal\Ink\ClipboardProcessor.cs (1)
169Debug.Assert(false , "CopySelectData: InkCanvas should have a selection!");
MS\Internal\Ink\EditingCoordinator.cs (19)
73Debug.Assert(ActiveEditingBehavior == SelectionEditor, 166Debug.Assert(currentBehavior is StylusEditingBehavior, 188Debug.Assert(currentBehavior is StylusEditingBehavior, 302Debug.Assert(_activationStack.Count == 1, "The behavior stack has to contain one behavior."); 358Debug.Assert(behavior == LassoSelectionBehavior || behavior == SelectionEditingBehavior, 369Debug.Assert(behavior != LassoSelectionBehavior && behavior != SelectionEditingBehavior, 438Debug.Assert((_capturedStylus != null && _capturedMouse == null) 769Debug.Assert(stylusEditingBehavior != null || ActiveEditingBehavior == null, 852Debug.Assert(ActiveEditingBehavior == null || ActiveEditingBehavior is IStylusEditing, 921Debug.Assert(inputDevice != null, "A null device is passed in."); 922Debug.Assert(stylusEditingBehavior != null, "stylusEditingBehavior cannot be null."); 923Debug.Assert(!IsInMidStroke, "The previous device hasn't been released yet."); 968Debug.Assert(!resetDynamicRenderer, "The dynamic renderer shouldn't be reset for Mouse"); 1004Debug.Assert(IsInMidStroke || !releaseDevice, "The captured device has been release unexpectly."); 1046Debug.Assert(_capturedStylus == null || _capturedMouse == null, "InkCanvas cannot capture both stylus and mouse at the same time."); 1179Debug.Assert(false, "Unknown behavior"); 1216Debug.Assert(false, "Unknown behavior"); 1224Debug.Assert(!IsInMidStroke, "ChangeEditingBehavior cannot be called in a mid-stroke"); 1225Debug.Assert(_activationStack.Count <= 1, "The behavior stack has to contain at most one behavior when user is not editing.");
MS\Internal\Ink\EraserBehavior.cs (5)
79Debug.Assert(EditingCoordinator.IsInMidStroke, "SwitchToMode should only be called in a mid-stroke"); 141Debug.Assert(false, "Unknown InkCanvasEditingMode!"); 174Debug.Assert(_cachedPointEraserCursor != null, "_cachedPointEraserCursor shouldn't be null."); 380Debug.Assert(null != e.HitStroke, "e.HitStroke cannot be null"); 396Debug.Assert(eraseResult != null, "eraseResult cannot be null");
MS\Internal\Ink\InkCanvasSelection.cs (9)
131Debug.Assert(activeSelectionHitResult != InkCanvasSelectionHitResult.None, "activeSelectionHitResult cannot be InkCanvasSelectionHitResult.None."); 141Debug.Assert(VisualTreeHelper.GetParent(feedbackAdorner) == null, 156Debug.Assert(VisualTreeHelper.GetParent(_inkCanvas.FeedbackAdorner) 174Debug.Assert(VisualTreeHelper.GetParent(feedbackAdorner) == adornerLayer, 481Debug.Assert(false, "The updatedElement has to be the same type as the originalElement."); 601Debug.Assert(false, "An unexpected single selected Element"); 762Debug.Assert( SelectedElements.Count != 0, 880Debug.Assert(_inkCanvas.SelectionAdorner.Visibility == Visibility.Visible, 887Debug.Assert(_inkCanvas.SelectionAdorner.Visibility == Visibility.Collapsed,
MS\Internal\Ink\InkCollectionBehavior.cs (3)
105Debug.Assert(EditingCoordinator.IsInMidStroke, "SwitchToMode should only be called in a mid-stroke"); 163Debug.Assert(false, "Unknown InkCanvasEditingMode!"); 291Debug.Assert(_strokeDrawingAttributes != null, "_strokeDrawingAttributes can not be null, did we not see a down?");
MS\Internal\Ink\LassoSelectionBehavior.cs (5)
69Debug.Assert(EditingCoordinator.IsInMidStroke, "SwitchToMode should only be called in a mid-stroke"); 97Debug.Assert(false, "Cannot switch from Select to Select in mid-stroke"); 110Debug.Assert(false, "Unknown InkCanvasEditingMode!"); 122Debug.Assert(stylusPoints.Count != 0, "An empty stylusPoints has been passed in."); 586Debug.Assert(!_disableLasso && _lassoHelper == null, "StartLasso is called unexpectedly.");
MS\Internal\Ink\PenCursorManager.cs (2)
59Debug.Assert(DoubleUtil.IsZero(tranform.OffsetX) && DoubleUtil.IsZero(tranform.OffsetY), "The EraserShape cannot be translated."); 60Debug.Assert(tranform.HasInverse, "The transform has to be invertable.");
MS\Internal\Ink\SelectionEditingBehavior.cs (1)
376Debug.Assert(EditingCoordinator.UserIsEditing == false, "Unexpect UserIsEditng state." );
MS\Internal\IO\Packaging\ManagedFilter.cs (2)
63System.Diagnostics.Debug.Assert(_propType == PropSpecType.Name, "ManagedPropSpec.PropName - PropName only meaningful if PropType is type string"); 84System.Diagnostics.Debug.Assert(_propType == PropSpecType.Id, "ManagedPropSpec.PropId - PropId only meaningful if PropType is numeric");
MS\Internal\LayoutDump.cs (5)
465Debug.Assert(dpv != null, "Dump function has to match element type."); 481Debug.Assert(text != null, "Dump function has to match element type."); 514Debug.Assert(fdsv != null, "Dump function has to match element type."); 540Debug.Assert(fdView != null, "Dump function has to match element type."); 580Debug.Assert(flowDocumentPage != null, "Dump function has to match page type.");
MS\Internal\Navigation\JournalEntryStack.cs (1)
118Debug.Assert(_current != null, "If we are returning true, our current cannot be null");
MS\Internal\PtsHost\CellParagraph.cs (3)
65Debug.Assert(Cell.Index != -1 && Cell.ColumnIndex != -1, 137Debug.Assert(Cell.Index != -1 && Cell.ColumnIndex != -1, 166Debug.Assert(Cell.Index != -1 && Cell.ColumnIndex != -1,
MS\Internal\PtsHost\ErrorHandler.cs (2)
27System.Diagnostics.Debug.Assert(false, message); 41System.Diagnostics.Debug.Assert(false, message);
MS\Internal\PtsHost\FigureParagraph.cs (1)
306Debug.Assert(false, "Tight wrap is not currently supported.");
MS\Internal\PtsHost\FloaterBaseParagraph.cs (1)
113Debug.Assert(false, "Tight wrap is not currently supported.");
MS\Internal\PtsHost\FloaterParagraph.cs (1)
813Debug.Assert(false, "Unknown type of anchor.");
MS\Internal\PtsHost\Line.cs (4)
59Debug.Assert(_line != null, "Line has been already disposed."); 345Debug.Assert(!double.IsNaN(_trackWidth), "Track width must be set for measure pass."); 404Debug.Assert(DoubleUtil.GreaterThanOrClose(rect.Width, 0), "Negative inline object's width."); 1006Debug.Assert(runBounds.Count == 1, "Expecting exactly one TextRunBounds for a single text position.");
MS\Internal\PtsHost\LineBase.cs (2)
136Debug.Assert(element != null, "Cannot use ITextContainer that does not provide TextElement instances."); 258Debug.Assert(element != null, "Element should be here.");
MS\Internal\PtsHost\Pts.cs (3)
57Debug.Assert(ptsContext != null, "Null argument 'ptsContext' - required for return value validation."); 92Debug.Assert(ptsContext != null, "Null argument 'ptsContext' - required for return value validation."); 209Debug.Assert(false, "Unknown WrapDirection value.");
MS\Internal\PtsHost\PtsHelper.cs (1)
898Debug.Assert(cColumns > 0, "At least one column is required.");
MS\Internal\PtsHost\PtsHost.cs (19)
570Debug.Assert(false, "PTS.GetSegmentDefinedColumnSpanAreaInfo is not implemented."); 582Debug.Assert(false, "PTS.GetHeightDefinedColumnSpanAreaInfo is not implemented."); 870Debug.Assert(false, "PTS.GetNumberEndnoteColumns is not implemented."); 882Debug.Assert(false, "PTS.GetEndnoteColumnInfo is not implemented."); 893Debug.Assert(false, "PTS.GetFootnoteSeparators is not implemented."); 902Debug.Assert(false, "PTS.FFootnoteBeneathText is not implemented."); 911Debug.Assert(false, "PTS.GetNumberFootnoteColumns is not implemented."); 923Debug.Assert(false, "PTS.GetFootnoteColumnInfo is not implemented."); 932Debug.Assert(false, "PTS.GetFootnoteSegment is not implemented."); 946Debug.Assert(false, "PTS.GetFootnotePresentationAndRejectionOrder is not implemented."); 955Debug.Assert(false, "PTS.FAllowFootnoteSeparation is not implemented."); 1253Debug.Assert(false, "PTS.GetFootnotes is not implemented."); 1272Debug.Assert(false, "PTS.FormatDropCap is not implemented."); 1290Debug.Assert(false, "PTS.GetDropCapPolygons is not implemented."); 1298Debug.Assert(false, "PTS.DestroyDropCap is not implemented."); 1706Debug.Assert(false, "PTS.SnapGridVertical is not implemented."); 1807Debug.Assert(false, "PTS.UpdGetDropCapChange is not implemented."); 1908Debug.Assert(false, "PTS.GetOptimalLineDcpCache is not implemented."); 2934Debug.Assert(false, "PTS.ObjGetFootnoteInfo is not implemented.");
MS\Internal\PtsHost\PtsPage.cs (1)
166Debug.Assert(breakRecord == null || !_section.StructuralCache.DestroyStructure, "Cannot format from dirty break record unless StructuralCache.DestroyStructure is not set.");
MS\Internal\PtsHost\SubpageParagraph.cs (1)
186Debug.Assert(fSuppressTopSpace == 1, "Top space should be always suppressed at the top of broken paragraph.");
MS\Internal\PtsHost\TableParaClient.cs (2)
1973Debug.Assert(false, "Unsupported unit type"); 2041Debug.Assert(_calculatedColumns[i].UserWidth.GridUnitType == GridUnitType.Auto || _calculatedColumns[i].UserWidth.GridUnitType == GridUnitType.Star || _calculatedColumns[i].UserWidth.GridUnitType == GridUnitType.Pixel, "Unexpected GridUnitType");
MS\Internal\PtsHost\TableParagraph.cs (2)
319Debug.Assert(currentRowGroup.Rows[nextRowIndex].Index != -1, 336Debug.Assert(Rows[0].Index != -1,
MS\Internal\PtsHost\TextFormatterHost.cs (6)
40Debug.Assert(Context != null, "TextFormatter host is not initialized."); 41Debug.Assert(textSourceCharacterIndex >= 0, "Character index must be non-negative."); 56Debug.Assert(Context != null, "TextFormatter host is not initialized."); 57Debug.Assert(textSourceCharacterIndexLimit >= 0, "Character index must be non-negative."); 70Debug.Assert(Context != null, "TextFormatter host is not initialized."); 71Debug.Assert(textSourceCharacterIndex>= 0, "Character index must be non-negative.");
MS\Internal\PtsHost\TextParaClient.cs (10)
132Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 230Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 319Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 372Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 714Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 795Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 858Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 908Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 1065Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 1367Debug.Assert(false, "Should not get here. ParaCache is not currently used.");
MS\Internal\SystemDataHelper.cs (1)
84Debug.Assert(false, "Could not find Null field or property for SqlNullable type");
MS\Internal\Text\ComplexLine.cs (11)
64Debug.Assert(run != null, "TextRun has not been created."); 65Debug.Assert(run.Length > 0, "TextRun has to have positive length."); 155Debug.Assert(runs != null, "Cannot retrieve runs collection."); 178Debug.Assert(DoubleUtil.GreaterThanOrClose(rect.Width, 0), "Negative inline object's width."); 230Debug.Assert(runs != null, "Cannot retrieve runs collection."); 334Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text, "TextPointer does not point to characters."); 381Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart, "TextPointer does not point to element start edge."); 386Debug.Assert(element != null, "Cannot use ITextContainer that does not provide TextElement instances."); 472Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd, "TextPointer does not point to element end edge."); 477Debug.Assert(element != null, "Element should be here."); 522Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.EmbeddedElement, "TextPointer does not point to embedded object.");
MS\Internal\Text\Line.cs (7)
109Debug.Assert(_line != null, "Rendering line that has not been measured yet."); 116Debug.Assert(line.HasCollapsed, "Line has not been collapsed"); 309Debug.Assert(collapsedLine.HasCollapsed, "Line has not been collapsed"); 313Debug.Assert(collapsedRanges.Count == 1, "Multiple collapsed ranges are not supported."); 345Debug.Assert(collapsedLine.HasCollapsed, "Line has not been collapsed"); 476Debug.Assert(runBounds.Count == 1, "Expecting exactly one TextRunBounds for a single text position."); 499Debug.Assert(paraProperties.TextTrimming != TextTrimming.None, "Text trimming must be enabled.");
MS\Internal\Text\SimpleLine.cs (2)
34Debug.Assert(dcp >= 0, "Character index must be non-negative."); 74Debug.Assert(dcp >= 0, "Character index must be non-negative.");
MS\Internal\Text\TypographyProperties.cs (2)
776Debug.Assert((uint)propertyId < (uint)PropertyId.PropertyCount, "Invalid typography property id"); 792Debug.Assert((uint)propertyId < (uint)PropertyId.PropertyCount, "Invalid typography property id");
MS\Internal\WeakHashtable.cs (1)
54Debug.Assert(!key.GetType().IsValueType, "WeakHashtable doesn't support value-type keys. Use WeakObjectHashtable instead.");
MS\Win32\UxThemeWrapper.cs (1)
398Debug.Assert(themeState.IsActive, "Queried ThemeColor while UxTheme is not active.");
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Context\XamlFrame.cs (1)
41Debug.Assert(_depth != -1, "Context Frame is uninitialized");
System\Windows\Annotations\AnnotationHelper.cs (1)
625Debug.Assert((textSegments != null) && (textSegments.Count > 0), "Invalid selection TextSegments");
System\Windows\Annotations\Storage\XmlStreamStore.cs (2)
834Debug.Assert(knownNamespace != null, "null knownNamespace"); 853Debug.Assert(name != null, "null compatible namespace");
System\Windows\Application.cs (6)
108Debug.Assert(_appInstance == null, "_appInstance must be null here."); 518Debug.Assert(stream != null, "stream should not be null."); 519Debug.Assert(pc != null, "pc should not be null."); 702Debug.Assert( ((stream != null) && (sooPart == null)) != true, "When stream is not null, sooPart cannot be null either"); 1528Debug.Assert(CheckAccess(), "This should only be called on the Application thread"); 1589Debug.Assert(CheckAccess() == true, "DoShutdown can only be called on the Dispatcer thread");
System\Windows\Automation\Peers\ItemAutomationPeer.cs (1)
694System.Diagnostics.Debug.Assert(Object.Equals(item, Item), "ItemPeer reuse for an unequal item is not supported");
System\Windows\Automation\Peers\ItemsControlAutomationPeer.cs (1)
620Debug.Assert(false,"it must not add already present Item");
System\Windows\BroadcastEventHelper.cs (2)
166Debug.Assert(loadedPending != null && loadedPending.Length == 3, 203Debug.Assert(unloadedPending != null && unloadedPending.Length == 3,
System\Windows\Controls\AVElementHelper.cs (1)
53Debug.Assert((element != null), "Element is null");
System\Windows\Controls\ComboBox.cs (4)
1199Debug.Assert(_autoScrollTimer == null, "IsMouseCaptured went from true to true"); 1561Debug.Assert((increment > 0 && startIndex <= stopIndex) || (increment < 0 && startIndex >= stopIndex), "Infinite loop detected"); 1723Debug.Assert(!comboBox.CheckAccess() || Mouse.Captured != comboBox, "On the dispatcher thread, ComboBox should not have capture after closing the dropdown"); 1771Debug.Assert(!CheckAccess() || Mouse.Captured != this, "On the dispatcher thread, ComboBox should not have capture after closing the dropdown");
System\Windows\Controls\ContainerTracking.cs (2)
99Debug.Assert(IsInList(root), "This container should be in the tracking list."); 110Debug.Assert(!IsInList(root), "This container shouldn't be in our tracking list");
System\Windows\Controls\ContextMenu.cs (1)
481Debug.Assert(_parentPopup == null, "_parentPopup should be null");
System\Windows\Controls\DataGrid.cs (14)
1637Debug.Assert(info != null, "info is null."); 1638Debug.Assert(column != null, "column is null."); 1749Debug.Assert(_isDraggingSelection, "DoAutoScroll should only be called when dragging selection."); 3543Debug.Assert(CanUserAddRows, "AddNewItem called when the end-user cannot add new rows."); 3544Debug.Assert(!IsAddingNewItem, "AddNewItem called when a pending add is taking place."); 6373Debug.Assert(RelativeMousePosition != RelativeMousePositions.Over, "The mouse is not supposed to be over the DataGrid."); 7093Debug.Assert(sortColumn != null, "column should not be null"); 7251Debug.Assert(e.NewItems.Count == 1, "SortDescriptionCollection should handle one element at a time"); 7262Debug.Assert(e.OldItems.Count == 1, "SortDescriptionCollection should handle one element at a time"); 7282Debug.Assert(e.OldItems.Count == 1 && e.NewItems.Count == 1, "SortDescriptionCollection should handle one element at a time"); 7396Debug.Assert(e.NewItems.Count == 1, "GroupDescriptionCollection should handle one element at a time"); 7404Debug.Assert(e.OldItems.Count == 1, "GroupDescriptionCollection should handle one element at a time"); 7415Debug.Assert(e.OldItems.Count == 1 && e.NewItems.Count == 1, "GroupDescriptionCollection should handle one element at a time"); 7835Debug.Assert(dataGrid != null || columnCollection != null, "Both dataGrid and columnCollection cannot not be null at the same time");
System\Windows\Controls\DataGridAutoGeneratingColumnEventArgs.cs (1)
106Debug.Assert(
System\Windows\Controls\DataGridCell.cs (5)
90Debug.Assert(_owner == null || _owner == ownerRow, "_owner should be null before PrepareCell is called or the same value as the ownerRow."); 138Debug.Assert(_owner == ownerRow, "_owner should be the same as the DataGridRow that is clearing the cell."); 574Debug.Assert(!IsEditing, "Should not call BeginEdit when IsEditing is true."); 587Debug.Assert(IsEditing, "Should not call CancelEdit when IsEditing is false."); 598Debug.Assert(IsEditing, "Should not call CommitEdit when IsEditing is false.");
System\Windows\Controls\DataGridCellInfo.cs (9)
54Debug.Assert(item != null, "item should not be null."); 55Debug.Assert(column != null, "column should not be null."); 56Debug.Assert(owner != null, "owner should not be null."); 65Debug.Assert(info != null, "item should not be null."); 66Debug.Assert(column != null, "column should not be null."); 67Debug.Assert(owner != null, "owner should not be null."); 79Debug.Assert(item == DependencyProperty.UnsetValue, "This should only be used to make an Unset CellInfo."); 105Debug.Assert(owner != null, "owner should not be null."); 117Debug.Assert(owner != null, "owner should not be null.");
System\Windows\Controls\DataGridCellsPanel.cs (17)
167Debug.Assert(blockList != null, "RealizedColumnsBlockList shouldn't be null at this point."); 634Debug.Assert(!children.Contains(child), "we incorrectly identified a recycled container"); 649Debug.Assert(child == InternalChildren[childIndex], "Wrong child was generated"); 679Debug.Assert(container != null, "Null container was generated"); 715Debug.Assert(children[visualTreeIndex] != null, "MoveVisualChild interprets a null destination as 'move to end'"); 776Debug.Assert(false, "We should have found a child"); 1071Debug.Assert(columnIndex < columnCount, "columnIndex should be less than column count"); 1147Debug.Assert(children == _realizedChildren, "the given child list must be the _realizedChildren list when recycling"); 1332Debug.Assert( 1338Debug.Assert( 1417Debug.Assert(i >= arrangeState.FrozenColumnCount, "Frozen cells should have been realized or not visible"); 1451Debug.Assert(child != null, "child cannot be null."); 1466Debug.Assert(cell.Column != null, "column cannot be null."); 1571Debug.Assert(children.Count > blockElementCount, "Element count from blocks can't be less than total children count"); 1612Debug.Assert(columnIndex <= block.EndIndex, "Missing children for index in block list"); 1974Debug.Assert(ParentDataGrid != null, "ParentDataGrid should not be null"); 2092Debug.Assert((itemCount == itemUICount) || (itemUICount == 0), "Both ItemUICount and ItemCount should be equal or ItemUICount should be 0.");
System\Windows\Controls\DataGridColumn.cs (2)
893Debug.Assert(d is DataGridColumn, "d should be a DataGridColumn"); 1145Debug.Assert(itemProperty != null && itemProperty.PropertyType != null, "itemProperty and/or its PropertyType member cannot be null");
System\Windows\Controls\DataGridColumnCollection.cs (16)
21Debug.Assert(dataGridOwner != null, "We should have a valid DataGrid"); 227Debug.Assert(displayIndex >= 0 && displayIndex < DisplayIndexMap.Count, "displayIndex should have already been validated"); 325Debug.Assert(newDisplayIndex >= 0 && newDisplayIndex < Count, "The new DisplayIndex should have already been validated"); 358Debug.Assert(oldDisplayIndex != newDisplayIndex, "A column's display index must have changed for us to call OnColumnDisplayIndexChanged"); 359Debug.Assert(oldDisplayIndex >= 0 && oldDisplayIndex < Count, "The old DisplayIndex should be valid"); 410Debug.Assert( 413Debug.Assert(IsUpdatingDisplayIndex == false, "We don't add new columns as part of a display index update operation"); 470Debug.Assert(DisplayIndexMap.Count == 0, "DisplayIndexMap should be empty until first measure call."); 554Debug.Assert( 557Debug.Assert(IsUpdatingDisplayIndex == false, "We don't remove columns as part of a display index update operation"); 562Debug.Assert(DisplayIndexMap.Count > Count, "Columns were just removed: the display index map shouldn't have yet been updated"); 598Debug.Assert(oldColumns.Count == 1 && newColumns.Count == 1, "Multi replace isn't possible with ObservableCollection"); 726Debug.Assert(Count == DisplayIndexMap.Count, "Display Index map is of the wrong size"); 729Debug.Assert(DisplayIndexMap[i] >= 0 && DisplayIndexMap[i] < Count, "DisplayIndex map entry doesn't point to a valid column"); 730Debug.Assert(ColumnFromDisplayIndex(i).DisplayIndex == i, "DisplayIndex map doesn't match column indices"); 897Debug.Assert(
System\Windows\Controls\DataGridColumnHeaderCollection.cs (1)
46Debug.Assert(e.Property == DataGridColumn.HeaderProperty, "We only want to know about the header property changing");
System\Windows\Controls\DataGridHelper.cs (2)
237Debug.Assert((cell is DataGridCell) || (cell is DataGridColumnHeader), "provideColumn should be one of the cell or header containers."); 301Debug.Assert((cell is DataGridCell) || (cell is DataGridColumnHeader), "provideColumn should be one of the cell or header containers.");
System\Windows\Controls\DataGridHyperlinkColumn.cs (1)
287Debug.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)
255Debug.Assert(
System\Windows\Controls\DataGridRow.cs (2)
439Debug.Assert(_owner == null || _owner == owningDataGrid, "_owner should be null before PrepareRow is called or the same as the owningDataGrid."); 480Debug.Assert(_owner == owningDataGrid, "_owner should be the same as the DataGrid that is clearing the row.");
System\Windows\Controls\DataGridTextColumn.cs (1)
269Debug.Assert(e.RoutedEvent == Keyboard.PreviewKeyDownEvent, "We should only reach here on the PreviewKeyDown event because the TextBox within is expected to handle the preview event and hence trump the successive KeyDown event.");
System\Windows\Controls\Grid.cs (1)
2370Debug.Assert(!def.IsShared, "*-defs cannot be shared");
System\Windows\Controls\GridSplitter.cs (2)
635Debug.Assert(_resizeData == null, "_resizeData is not null, DragCompleted was not called"); 869Debug.Assert(_resizeData != null, "_resizeData should not be null when calling MoveSplitter");
System\Windows\Controls\GridViewColumn.cs (1)
425Debug.Assert(false, "Invalid value for ActualWidth.");
System\Windows\Controls\GridViewColumnCollection.cs (3)
141Debug.Assert(IsImmutable != true, "IsImmutable is true before BlockWrite"); 150Debug.Assert(IsImmutable != false, "IsImmutable is flase before UnblockWrite"); 241Debug.Assert(oldIndex != newIndex, "oldIndex==newIndex when perform move action.");
System\Windows\Controls\GridViewColumnCollectionChangedEventArgs.cs (12)
45Debug.Assert(action == NotifyCollectionChangedAction.Add || action == NotifyCollectionChangedAction.Remove, 47Debug.Assert(changedItem != null, "changedItem can't be null"); 48Debug.Assert(index >= 0, "index must >= 0"); 49Debug.Assert(actualIndex >= 0, "actualIndex must >= 0"); 60Debug.Assert(newItem != null, "newItem can't be null"); 61Debug.Assert(oldItem != null, "oldItem can't be null"); 62Debug.Assert(index >= 0, "index must >= 0"); 63Debug.Assert(actualIndex >= 0, "actualIndex must >= 0"); 74Debug.Assert(changedItem != null, "changedItem can't be null"); 75Debug.Assert(index >= 0, "index must >= 0"); 76Debug.Assert(oldIndex >= 0, "oldIndex must >= 0"); 77Debug.Assert(actualIndex >= 0, "actualIndex must >= 0");
System\Windows\Controls\GridViewColumnHeader.cs (4)
290Debug.Assert(false, "Method ShouldSerializeProperty is called on an internally generated GridViewColumnHeader."); 424Debug.Assert(flag != Flags.None && ignoreFlag != Flags.None, "Invalid parameter dp."); 759Debug.Assert(stream != null, "stream is null"); 783Debug.Assert(gripperCursor != null, "gripper cursor is null");
System\Windows\Controls\GridViewHeaderRowPresenter.cs (12)
301Debug.Assert(_paddingHeader != null, "padding header is null"); 311Debug.Assert(_indicator != null, "_indicator is null"); 312Debug.Assert(_floatingHeader != null, "_floatingHeader is null"); 385Debug.Assert(_paddingHeader != null, "padding header is null"); 454Debug.Assert(_draggingSrcHeader != null, "_draggingSrcHeader is null"); 855Debug.Assert(index >= 0 && index < InternalChildren.Count, "Error index when GetVisualIndex"); 938Debug.Assert(false, "Head is container for itself, but parent is neither GridViewHeaderRowPresenter nor null."); 1194Debug.Assert(header != null, "Cannot instantiate GridViewColumnHeader in AddFloatingHeader"); 1207Debug.Assert(srcHeader != null, "srcHeader is null"); 1208Debug.Assert(_floatingHeader != null, "floating header is null"); 1374Debug.Assert(index >= 0 && index < HeadersPositionList.Count, "wrong index"); 1561Debug.Assert(Columns != null, "Columns is null in OnHeaderDragCompleted");
System\Windows\Controls\GridViewRowPresenter.cs (2)
575Debug.Assert(column != null, "column shouldn't be null"); 655Debug.Assert(cell is TextBlock, "cells are either TextBlocks or ContentPresenters");
System\Windows\Controls\InkCanvas.cs (14)
576Debug.Assert(e.Property == InkCanvas.RightProperty || e.Property == InkCanvas.BottomProperty, 1042Debug.Assert(e != null, "EventArg can not be null"); 1261Debug.Assert(e != null, "EventArg can not be null"); 1318Debug.Assert(e != null, "EventArg can not be null"); 1372Debug.Assert(e != null, "EventArg can not be null"); 1406Debug.Assert(e != null, "EventArg can not be null"); 1437Debug.Assert(e != null, "EventArg can not be null"); 1473Debug.Assert(e != null, "EventArg can not be null"); 1549Debug.Assert(e != null, "EventArg can not be null"); 1579Debug.Assert(e != null, "EventArg can not be null"); 1613Debug.Assert(e != null, "EventArg can not be null"); 1643Debug.Assert(e != null, "EventArg can not be null"); 2340Debug.Assert(strokes != null 2667Debug.Assert(removeSelectedStrokes || removeSelectedElements, "At least either Strokes or Elements should be removed!");
System\Windows\Controls\InkPresenter.cs (2)
450Debug.Assert(newStrokes != null, "Cannot set a null to InkPresenter"); 481Debug.Assert(addedStrokes != null, "The added StrokeCollection cannot be null.");
System\Windows\Controls\ItemCollection.cs (5)
2282Debug.Assert(IsShapingActive, "Shaping storage not available"); 2319Debug.Assert(!value, "Shaping storage not available"); 2351Debug.Assert(IsShapingActive, "Shaping storage not available"); 2384Debug.Assert(IsShapingActive, "Shaping storage not available"); 2417Debug.Assert(IsShapingActive, "Shaping storage not available");
System\Windows\Controls\ItemContainerGenerator.cs (9)
280Debug.Assert(false, "Unexpected reentrant call to ICG.Remove"); 326Debug.Assert(!_recyclableContainers.Contains(container), "trying to add a container to the collection twice"); 931Debug.Assert(item == null || ItemsControl.EqualsEx(item, target), 2208Debug.Assert(ItemsControl.EqualsEx(rib.ItemAt(rib.ContainerCount - 1), 2274Debug.Assert(!container.HasExpression(entryIndex, dp), "DataContext set by expression (unexpectedly)"); 2339Debug.Assert(!container.HasExpression(entryIndex, dp), "DataContext set by expression (unexpectedly)"); 2372Debug.Assert(ItemsControl.EqualsEx(item, ItemsInternal[index]), "Event contains the wrong index"); 2447Debug.Assert(false, "unexpected reentrant call to OnItemAdded"); 2637Debug.Assert(false, "unexpected reentrant call to OnItemMoved");
System\Windows\Controls\ItemsControl.cs (3)
2591Debug.Assert(ScrollHost != null, "This operation to adjust the offset along an edge is only possible when there is a ScrollHost available"); 2752Debug.Assert(direction == FocusNavigationDirection.Up || direction == FocusNavigationDirection.Down, "Can only get the first item on a page using North or South"); 3066Debug.Assert(element != viewPort && element.IsArrangeValid && parent != null, "GetElementViewportPosition called in unsupported situation");
System\Windows\Controls\ListBox.cs (1)
616Debug.Assert(_autoScrollTimer == null, "IsMouseCaptured went from true to true");
System\Windows\Controls\MenuItem.cs (6)
1741Debug.Assert(IsSelected, "When IsSubmenuOpen = true, IsSelected should be true as well"); 1920Debug.Assert(IsHighlighted, "MenuItem got Key.Enter but was not highlighted -- focus did not follow highlight?"); 2185Debug.Assert(Role == MenuItemRole.TopLevelHeader || Role == MenuItemRole.TopLevelItem, "MenuItem was not top-level"); 2225Debug.Assert(!parentMenu.OpenOnMouseEnter || parentMenu.IsMenuMode, "OpenOnMouseEnter can only be true when IsMenuMode is true"); 2574Debug.Assert(timer != null, "timer should not be null."); 2575Debug.Assert(!timer.IsEnabled, "timer should not be running.");
System\Windows\Controls\MultipleCopiesCollection.cs (9)
29Debug.Assert(item != null, "item should not be null."); 30Debug.Assert(count >= 0, "count should not be negative."); 50Debug.Assert( 57Debug.Assert( 64Debug.Assert( 71Debug.Assert( 116Debug.Assert(RepeatCount == newCount, "We should have properly updated the RepeatCount"); 199Debug.Assert((index >= 0) && (index < RepeatCount), "Index out of range"); 285Debug.Assert(_item != null, "_item should be non-null.");
System\Windows\Controls\Page.cs (2)
726Debug.Assert( p != null, "DependencyObject must be of type Page." ); 771Debug.Assert(_currentIws != null, "_currentIws cannot be null here. Caller should always verify it");
System\Windows\Controls\Panel.cs (9)
569Debug.Assert(_itemContainerGenerator == null, "Attempted to connect to a generator when Panel._itemContainerGenerator is non-null."); 592Debug.Assert(_itemContainerGenerator != null, "Attempted to disconnect from a generator when Panel._itemContainerGenerator is null."); 613Debug.Assert(IsItemsHost, "Should be invoked only on an ItemsHost panel"); 673Debug.Assert(_itemContainerGenerator != null, "Encountered a null _itemContainerGenerator while receiving an ItemsChanged from a generator."); 712Debug.Assert(_itemContainerGenerator != null, "Encountered a null _itemContainerGenerator while receiving an Add action from a generator."); 741Debug.Assert(itemCount == containerCount, "Panel expects Replace to affect only realized containers"); 742Debug.Assert(_itemContainerGenerator != null, "Encountered a null _itemContainerGenerator while receiving an Replace action from a generator."); 752Debug.Assert(e != null && !isNewlyRealized, "Panel expects Replace to affect only realized containers"); 771Debug.Assert(_itemContainerGenerator != null, "Encountered a null _itemContainerGenerator while receiving an Move action from a generator.");
System\Windows\Controls\PasswordTextNavigator.cs (8)
28Debug.Assert(offset >= 0 && offset <= container.SymbolCount, "Bad PasswordTextPointer offset!"); 52Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 423Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 464Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 470Debug.Assert(false, "Bad distance!"); 490Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 508Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 509Debug.Assert(false, "No scoping element!");
System\Windows\Controls\PopupControlService.cs (2)
1610Debug.Assert(hwndSource != null && rootElement != null, "expect non-null hwndSource and rootElement"); 1612Debug.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)
149Debug.Assert(child1 != null, "First child should be non-null."); 150Debug.Assert(child2 != null, "Second child should be non-null.");
System\Windows\Controls\Primitives\DataGridCellsPresenter.cs (1)
346Debug.Assert(
System\Windows\Controls\Primitives\DataGridColumnHeader.cs (6)
103Debug.Assert(column != null, "This header must have been generated with for a particular column"); 104Debug.Assert(column.Header == item, "The data item for a ColumnHeader is the Header property of a column"); 317Debug.Assert(header != null, "Header should not be null"); 457Debug.Assert(Column != null, "column can't be null if we got a notification for this property change"); 467Debug.Assert(Column != null, "column can't be null if we got a notification for this property change"); 550Debug.Assert(Column != null, "column can't be null if we got a notification for this property change");
System\Windows\Controls\Primitives\DataGridColumnHeadersPresenter.cs (11)
227Debug.Assert(column != null, "We shouldn't have generated this column header if we don't have a column."); 263Debug.Assert(HeaderCollection != null, "This is a helper method for preparing and clearing a container; if it's called we must have a valid ItemSource"); 699Debug.Assert(ParentDataGrid != null, "ParentDataGrid is null"); 746Debug.Assert(_draggingSrcColumnHeader != null, "Dragging header is null"); 760Debug.Assert(_columnHeaderDragIndicator != null, "Drag indicator is null"); 761Debug.Assert(_draggingSrcColumnHeader != null, "Dragging header is null"); 779Debug.Assert(_draggingSrcColumnHeader != null, "Dragging header is null"); 793Debug.Assert(_columnHeaderDropLocationIndicator != null, "Drag indicator is null"); 794Debug.Assert(_draggingSrcColumnHeader != null, "Dragging header is null"); 811Debug.Assert(ParentDataGrid != null, "ParentDataGrid is null"); 924Debug.Assert(ParentDataGrid != null, "ParentDataGrid is null");
System\Windows\Controls\Primitives\DatePickerTextBox.cs (2)
152Debug.Assert( 192Debug.Assert(datePickerTextBox != null, "The source is not an instance of a DatePickerTextBox!");
System\Windows\Controls\Primitives\MenuBase.cs (1)
799Debug.Assert(CheckAccess(), "IsMenuMode requires context access");
System\Windows\Controls\Primitives\Popup.cs (11)
177Debug.Assert(popup != null, "Popup must be non-null"); 178Debug.Assert(placementTarget != null, "Placement target must be non-null."); 208Debug.Assert(popup != null, "Popup must be non-null"); 209Debug.Assert(placementTarget != null, "Placement target must be non-null."); 885Debug.Assert(!bindTreatMousePlacementAsBottomProperty || child is ToolTip, "child must be a Tooltip to bind TreatMousePlacementAsBottomProperty"); 1109Debug.Assert( Mouse.Captured == _popupRoot, "_cacheValid[(int)CacheBits.CaptureEngaged] == true but Mouse.Captured != _popupRoot"); 1401Debug.Assert(popup != null, "popup should be non-null."); 1402Debug.Assert(child != null, "child should be non-null."); 1425Debug.Assert(child != null, "child should be non-null"); 1939Debug.Assert(CheckAccess(), "AsyncReposition not called on the dispatcher thread."); 3297Debug.Assert(!IsChildPopup || (IsChildPopup && !transparent), "Child popups cannot be transparent");
System\Windows\Controls\Primitives\ResizeGrip.cs (1)
65Debug.Assert(rg != null, "DependencyObject must be of type ResizeGrip.");
System\Windows\Controls\Primitives\Selector.cs (13)
1035Debug.Assert(CanSelectMultiple, "CanSelectMultiple should be true when calling SelectAllImpl"); 1423Debug.Assert(!SelectionChange.IsActive, "SelectionChange is already active -- use SelectionChange.Select or Unselect"); 1497Debug.Assert(!((SelectedIndex >= 0) && (_selectedItems.Count == 0)), "SelectedIndex >= 0 implies _selectedItems nonempty"); 1595Debug.Assert(SelectionChange.IsActive, "SelectionChange.IsActive should be true"); 1677Debug.Assert(SelectionChange.IsActive, "SelectionChange.IsActive should be true"); 2040Debug.Assert(SelectionChange.IsActive, "SelectionChange.IsActive should be true"); 2272Debug.Assert(!_active, SR.SelectionChangeActive); 2285Debug.Assert(_active, "There must be a selection change active when you call SelectionChange.End()"); 2319Debug.Assert(_toSelect.Count <= 1, "_toSelect.Count was > 1"); 2494Debug.Assert(_active, SR.SelectionChangeNotActive); 2495Debug.Assert(info != null, "parameter info should not be null"); 2551Debug.Assert(_active, SR.SelectionChangeNotActive); 2552Debug.Assert(info != null, "info should not be null");
System\Windows\Controls\Primitives\Thumb.cs (1)
244Debug.Assert(false,"Got MouseLeftButtonDown event while dragging!");
System\Windows\Controls\Primitives\ToolBarOverflowPanel.cs (1)
94Debug.Assert(childrenIndex == childrenCount, "ToolBarOverflowPanel.Children count mismatch after transferring children from GeneratedItemsCollection.");
System\Windows\Controls\Primitives\ToolBarPanel.cs (4)
142Debug.Assert(children[childrenIndex] == child, "InternalChildren is out of sync with _generatedItemsCollection."); 189Debug.Assert(children[childrenIndex] == child, "InternalChildren is out of sync with _generatedItemsCollection."); 454Debug.Assert(itemCount == containerCount, "ToolBarPanel expects Replace to affect only realized containers"); 464Debug.Assert(e != null && !isNewlyRealized, "ToolBarPanel expects Replace to affect only realized containers");
System\Windows\Controls\Primitives\Track.cs (6)
389Debug.Assert(_visualChildren == null || _visualChildren[1] == null, "Child[1] should be null if Child[0] == null)"); 390Debug.Assert(_visualChildren == null || _visualChildren[2] == null, "Child[2] should be null if Child[0] == null)"); 395Debug.Assert(_visualChildren[2] == null, "Child[2] should be null if Child[1] == null)"); 591Debug.Assert(decreaseButtonLength >= 0.0 && decreaseButtonLength <= remainingTrackLength, "decreaseButtonLength is outside bounds"); 592Debug.Assert(increaseButtonLength >= 0.0 && increaseButtonLength <= remainingTrackLength, "increaseButtonLength is outside bounds"); 606Debug.Assert(DoubleUtil.GreaterThanOrClose(offset, 0.0), "Invalid offest (negative value).");
System\Windows\Controls\ScrollViewer.cs (1)
2389Debug.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)
48Debug.Assert(_addedCells.IsReadOnly, "_addedCells should have ended up as read-only."); 49Debug.Assert(_removedCells.IsReadOnly, "_removedCells should have ended up as read-only.");
System\Windows\Controls\TextBlock.cs (4)
1946Debug.Assert(_complexContent != null, "Inline objects are supported only in complex content."); 1976Debug.Assert(((InlineObject)inlineObjects[index]).Element == inlineObject.Element, "InlineObject cache is out of sync."); 2945Debug.Assert(sender == _complexContent.TextContainer, "Received text change for foreign TextContainer."); 3427Debug.Assert(DoubleUtil.AreClose(lineHeight, lineMetrics.Height), "Line height is out of sync.");
System\Windows\Controls\TextSearch.cs (3)
294Debug.Assert(String.IsNullOrEmpty(matchedText) == false, "matchedText cannot be null or empty"); 295Debug.Assert(String.IsNullOrEmpty(newText) == false, "newText cannot be null or empty"); 296Debug.Assert(matchedText.StartsWith(newText, ignoreCase, cultureInfo), "matchedText should start with newText");
System\Windows\Controls\ToolTip.cs (1)
500Debug.Assert(_parentPopup == null, "_parentPopup should be null");
System\Windows\Controls\VirtualizedCellInfoCollection.cs (20)
24Debug.Assert(owner != null, "owner must not be null."); 37Debug.Assert(owner != null, "owner must not be null."); 87Debug.Assert(IsValidCell(cell), "The cell should be valid."); 88Debug.Assert(!Contains(cell), "VirtualizedCellInfoCollection does not support duplicate items."); 471Debug.Assert(left >= 0, "left must be positive."); 472Debug.Assert(top >= 0, "top must be positive."); 473Debug.Assert(width >= 0, "width must be positive."); 474Debug.Assert(height >= 0, "height must be positive."); 491Debug.Assert(value >= 0, "Value must be positive."); 505Debug.Assert(value >= 0, "Value must be positive."); 519Debug.Assert(value >= _left, "Right must be greater than or equal to Left."); 533Debug.Assert(value >= _top, "Bottom must be greater than or equal to Top."); 547Debug.Assert(value >= 0, "Value must be positive."); 561Debug.Assert(value >= 0, "Value must be positive."); 787Debug.Assert(!IsEmpty, "Don't call GetBoundingRegion when IsEmpty is true."); 819Debug.Assert(left <= right, "left should be less than or equal to right."); 820Debug.Assert(top <= bottom, "top should be less than or equal to bottom."); 830Debug.Assert(rowCount > 0, "rowCount should be greater than 0."); 831Debug.Assert(columnCount > 0, "columnCount should be greater than 0."); 1634Debug.Assert(list != null, "list should not be null.");
System\Windows\Controls\VirtualizingStackPanel.cs (73)
402Debug.Assert(!IsPixelBased && IsScrolling && 479Debug.Assert(IsScrolling, "setting offset on non-scrolling panel"); 607Debug.Assert(IsScrolling, "setting offset on non-scrolling panel"); 798Debug.Assert(AnchorOperationField.GetValue(this) == null, "There is already a pending AnchorOperation."); 830Debug.Assert(_scrollData._firstContainerInViewport != null, "Must have an anchor element"); 856Debug.Assert(AnchorOperationField.GetValue(this) != null, "anchor state is inconsistent"); 887Debug.Assert(currFirstContainerInViewport != null, "Cannot find container in viewport"); 1142Debug.Assert(!IsPixelBased || !findTopContainer, "find 'top' container only makes sense when item-scrolling"); 1699Debug.Assert(IsVirtualizing && InRecyclingMode, "We should only modify the visual order when in recycling mode"); 2389Debug.Assert(!adjustToChangeInFirstItem || foundFirstItemInViewport, "This loop should only happen twice at most"); 3850Debug.Assert(info != null, "Expected state from previous measure not found"); 3958Debug.Assert(IsScrolling && IsVirtualizing, "Only check viewport on scrolling panel when virtualizing"); 4353Debug.Assert(retryCount >=0, "retry MeasureCaches too often"); 4510Debug.Assert(effectiveOffsetInfo.ScrollGeneration <= scrollGeneration, 4709Debug.Assert(cacheUnit != VirtualizationCacheLengthUnit.Page, "Page cacheUnit is not expected here."); 4965Debug.Assert(IsScrolling, "The scrolling panel is the only one that should extend the viewport"); 5023Debug.Assert(virtualizationInfoProvider != null, "This method should only be invoked for a virtualizing owner"); 5024Debug.Assert(cacheUnit != VirtualizationCacheLengthUnit.Page, "Page after cache size is not expected here."); 5652Debug.Assert(itemIndex < items.Count, "index out of range"); 5752Debug.Assert(IsVirtualizing, "We should only need to extend the viewport beyond the generated items when virtualizing"); 6086Debug.Assert(!containerSize.IsEmpty, "We can't estimate an empty size"); 6102Debug.Assert(!IsVSP45Compat, "this method should not be called in VSP45Compat mode"); 6170Debug.Assert(!containerSize.IsEmpty, "We can't estimate an empty size"); 6382Debug.Assert(parentItemStorageProvider != null || container != null, 6425Debug.Assert(!IsVSP45Compat, "SetItemsHostInset should not be called in VSP45-compat mode"); 6461Debug.Assert(false, "SetInset should only be called for a container"); 6606Debug.Assert(cacheUnit != VirtualizationCacheLengthUnit.Page, "Page cacheUnit is not expected here."); 6816Debug.Assert(virtualizingChild != null, "This method should only be invoked for a virtualizing child"); 7254Debug.Assert(DoubleUtil.AreClose(pixelSizeInViewport + pixelSizeBeforeViewport + pixelSizeAfterViewport, childPixelSize.Width), "The computed sizes within and outside the viewport should add up to the childPixelSize."); 7346Debug.Assert(DoubleUtil.AreClose(pixelSizeInViewport + pixelSizeBeforeViewport + pixelSizeAfterViewport, childPixelSize.Height), "The computed sizes within and outside the viewport should add up to the childPixelSize."); 7441Debug.Assert(IsVSP45Compat, "this method should only be called in VSP45Compat mode"); 7447Debug.Assert(evaluateAreContainersUniformlySized || !computedAreContainersUniformlySized, "AreContainersUniformlySized starts off true and can only be flipped to false."); 7593Debug.Assert(!IsVSP45Compat, "this method should not be called in VSP45Compat mode"); 7599Debug.Assert(evaluateAreContainersUniformlySized || !computedAreContainersUniformlySized, "AreContainersUniformlySized starts off true and can only be flipped to false."); 7882Debug.Assert(itemStorageProvider != null || item == this, "An item storage provider must be available."); 7883Debug.Assert(item != null, "An item must be available."); 7907Debug.Assert(itemStorageProvider != null || item == this, "An item storage provider must be available."); 7908Debug.Assert(item != null, "An item must be available."); 7951Debug.Assert(itemStorageProvider != null || item == this, "An item storage provider must be available."); 7952Debug.Assert(item != null, "An item must be available."); 8009Debug.Assert(itemStorageProvider != null || item == this, "An item storage provider must be available."); 8010Debug.Assert(item != null, "An item must be available."); 8732Debug.Assert(container != null, "Null container was generated"); 8777Debug.Assert(children[visualTreeIndex] != null, "MoveVisualChild interprets a null destination as 'move to end'"); 8902Debug.Assert(!children.Contains(child), "we incorrectly identified a recycled container"); 8923Debug.Assert(child == InternalChildren[childIndex], "Wrong child was generated"); 8945Debug.Assert(args.ItemUICount == args.ItemCount, "Both ItemUICount and ItemCount should be equal or ItemUICount should be 0."); 8955Debug.Assert(child != null, "Null child was generated"); 8956Debug.Assert(!newlyRealized, "newlyRealized should be false after Replace"); 8985Debug.Assert((itemCount == itemUICount) || (itemUICount == 0), "Both ItemUICount and ItemCount should be equal or ItemUICount should be 0."); 9026Debug.Assert(IsVirtualizing, "Can't clean up containers if not virtualizing"); 9027Debug.Assert(itemsControl != null, "We can't cleanup if we aren't the itemshost"); 9172Debug.Assert(InRecyclingMode, "This method only applies to recycling mode"); 9191Debug.Assert(IsVirtualizing && InRecyclingMode, "Realized children only exist when recycling"); 9192Debug.Assert(_realizedChildren != null, "Realized children must exist to verify it"); 9205Debug.Assert(!_realizedChildren.Contains(child), "_realizedChildren should not contain recycled containers"); 9211Debug.Assert(_realizedChildren[position.Index] == child, "_realizedChildren is corrupt!"); 9223Debug.Assert(_realizedChildren.Count == children.Count, "Realized and visual children must match"); 9227Debug.Assert(_realizedChildren[i] == children[i], "Realized and visual children must match"); 9257Debug.Assert(false, "We should have found a child"); 9373Debug.Assert(!InRecyclingMode, "This method only applies to standard virtualization"); 9441Debug.Assert(children == _realizedChildren, "the given child list must be the _realizedChildren list when recycling"); 9587Debug.Assert(IsScrolling, "ScrollData must only be set on a scrolling panel."); 9714Debug.Assert(DoubleUtil.AreClose(viewportSize.Width - Math.Floor(viewportSize.Width), 0.0), "The viewport size must not contain fractional values when in item scrolling mode."); 9715Debug.Assert(DoubleUtil.AreClose(extentSize.Width - Math.Floor(extentSize.Width), 0.0), "The extent size must not contain fractional values when in item scrolling mode."); 9719Debug.Assert(DoubleUtil.AreClose(viewportSize.Height - Math.Floor(viewportSize.Height), 0.0), "The viewport size must not contain fractional values when in item scrolling mode."); 9720Debug.Assert(DoubleUtil.AreClose(extentSize.Height - Math.Floor(extentSize.Height), 0.0), "The extent size must not contain fractional values when in item scrolling mode."); 10438Debug.Assert(IsScrolling, "ScrollData must only be set on a scrolling panel."); 10563Debug.Assert(DoubleUtil.AreClose(viewportSize.Width - Math.Floor(viewportSize.Width), 0.0), "The viewport size must not contain fractional values when in item scrolling mode."); 10564Debug.Assert(DoubleUtil.AreClose(extentSize.Width - Math.Floor(extentSize.Width), 0.0), "The extent size must not contain fractional values when in item scrolling mode."); 10568Debug.Assert(DoubleUtil.AreClose(viewportSize.Height - Math.Floor(viewportSize.Height), 0.0), "The viewport size must not contain fractional values when in item scrolling mode."); 10569Debug.Assert(DoubleUtil.AreClose(extentSize.Height - Math.Floor(extentSize.Height), 0.0), "The extent size must not contain fractional values when in item scrolling mode."); 12213Debug.Assert(tracer != null, "Trace called when not tracing");
System\Windows\Data\BindingBase.cs (1)
70Debug.Assert((int)Feature.LastFeatureId <= 32, "UncommonValueTable supports only 32 Ids");
System\Windows\Data\BindingExpression.cs (1)
2119Debug.Assert(NeedsValidation, "check NeedsValidation before calling this");
System\Windows\Data\BindingExpressionBase.cs (3)
118Debug.Assert((int)Feature.LastFeatureId <= 32, "UncommonValueTable supports only 32 Ids"); 1690Debug.Assert(RootBindingExpression == this, "Only call this with a root binding"); 2501Debug.Assert((_flags & PrivateFlags.iPropagationMask) != PrivateFlags.iPropDefault,
System\Windows\Data\BindingGroup.cs (3)
1321Debug.Assert(_bindingExpressions.Count == 0, "Unexpected Reset event"); 1325Debug.Assert(false, "Unexpected change event"); 1768Debug.Assert(bindingExpression != null, "do not ask for source value from a [Multi,Priority]Binding");
System\Windows\Data\BindingListCollectionView.cs (4)
583Debug.Assert(_newItemIndex != -2 && newItem == _newItem, "AddNew did not raise expected events"); 610Debug.Assert(_newItemIndex == -2 && _newItem == NoNewItem, "unexpected call to BeginAddNew"); 1908Debug.Assert(_newItem == InternalList[index], "unexpected item while committing AddNew"); 1967Debug.Assert(item == InternalList[index], "unexpected item while committing AddNew");
System\Windows\Data\CollectionView.cs (1)
1807Debug.Assert(changeLog != null && changeLog.Count > 0, "don't defer when there's no work");
System\Windows\Data\ListCollectionView.cs (6)
769Debug.Assert(_newItemIndex != -2 && System.Windows.Controls.ItemsControl.EqualsEx(newItem, _newItem), "AddNew did not raise expected events"); 788Debug.Assert(_newItemIndex == -2 && _newItem == NoNewItem, "unexpected call to BeginAddNew"); 1686Debug.Assert(false, "Cannot update collection view from outside UIContext without index in event args"); 2435Debug.Assert(view != null, "lazyGetCollectionView should not return null"); 3117Debug.Assert(list.VerifyLiveSorting(lsi), "live sorting failed"); 3127Debug.Assert(list.VerifyLiveSorting(null), "live sorting not resotred");
System\Windows\Data\MultiBinding.cs (2)
110Debug.Assert(false, "Unexpected BindingMode value"); 133Debug.Assert(false, "Unexpected UpdateSourceTrigger value");
System\Windows\Data\MultiBindingExpression.cs (2)
177Debug.Assert(ParentMultiBinding.Converter != null || !String.IsNullOrEmpty(EffectiveStringFormat), 869Debug.Assert(NeedsValidation, "check NeedsValidation before calling this");
System\Windows\Data\PriorityBindingExpression.cs (2)
187Debug.Assert(MutableBindingExpressions.Count == 0, "expect to encounter empty BindingExpression collection when attaching MultiBinding"); 441Debug.Assert(NeedsValidation, "check NeedsValidation before calling this");
System\Windows\Data\XmlDataProvider.cs (1)
280Debug.Assert(_domSetDocument == null, "Should not be possible to be using Source and user-set Doc at the same time.");
System\Windows\DataTrigger.cs (1)
188Debug.Assert( TriggerConditions != null && TriggerConditions.Length == 1,
System\Windows\DescendentsWalker.cs (1)
94Debug.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)
376Debug.Assert(result.Dictionary == null || result.Dictionary == rd, 417Debug.Assert(Object.Equals(result.Requester, requester), "Reverting a request for the wrong requester"); 426Debug.Assert(result.Dictionary != null, "simple lookup resolved incorrectly"); 453Debug.Assert(cachedDict == result.Dictionary, "conflicting dictionaries for a StaticResource reference"); 461Debug.Assert(cachedDict != null, "no dictionary found for StaticResource reference");
System\Windows\Documents\AdornerLayer.cs (3)
420Debug.Assert(adornerInfos != null, "No adorners found for element in AdornerLayer._zOrderMap"); 455Debug.Assert(adornerInfos != null, "No adorners found for element in AdornerLayer._zOrderMap"); 533Debug.Assert(adornerInfo != null, "Adorner should not be null");
System\Windows\Documents\ColumnResizeAdorner.cs (1)
133Debug.Assert(_adornerLayer == null, "Attempt to overwrite existing AdornerLayer!");
System\Windows\Documents\CompositionAdorner.cs (3)
363Debug.Assert(_adornerLayer == null, "Attempt to overwrite existing AdornerLayer!"); 585Debug.Assert(start.CompareTo(startLinePointer) <= 0, "The start pointer is positioned after the composition start line pointer!"); 608Debug.Assert(endLinePointer.CompareTo(textSegment.End) == 0, "The end line pointer is positioned after the composition text range end pointer!");
System\Windows\Documents\DocumentSequenceHighlightLayer.cs (1)
52Debug.Assert(false, "This method is not implemented and not expected to be called.");
System\Windows\Documents\DocumentSequenceTextContainer.cs (1)
435Debug.Assert(false, "should never be here");
System\Windows\Documents\DocumentSequenceTextPointer.cs (5)
49Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 444Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 473Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 493Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 1083Debug.Assert(false, "invalid TextPointerContext");
System\Windows\Documents\FixedDocument.cs (2)
1103Debug.Assert(!highlightTransitionPosition.IsNull, "Highlight start not followed by highlight end!"); 1119Debug.Assert(!highlightTransitionPosition.IsNull, "Highlight start not followed by highlight end!");
System\Windows\Documents\FixedPage.cs (1)
606Debug.Assert(dpo != null, "GetLinkUri shouldn't be called for non-DependencyObjects.");
System\Windows\Documents\FixedSOMPageConstructor.cs (2)
54Debug.Assert(stroke || fill, "should not be a nop"); 193Debug.Assert(false, "It should not be called");
System\Windows\Documents\FixedTextPointer.cs (5)
378Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 381Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 411Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 422Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 672Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!");
System\Windows\Documents\FixedTextView.cs (1)
1190Debug.Assert(!textPointer.IsFrozen, "Can't reposition a frozen pointer!");
System\Windows\Documents\ImmComposition.cs (1)
288Debug.Assert(oldSource == null || newSource == null,
System\Windows\Documents\NullTextContainer.cs (1)
252Debug.Assert(false, "Unexpected call to NullTextContainer.set_TextView!");
System\Windows\Documents\NullTextNavigator.cs (9)
223Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 233Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 245Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 247Debug.Assert(distance == 0, "Single possible position in this empty container"); 257Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 267Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 269Debug.Assert(false, "No scoping element!"); 277Debug.Assert(false, "NullTextPointer does not expect layout dependent method calls!"); 286Debug.Assert(false, "NullTextPointer does not expect layout dependent method calls!");
System\Windows\Documents\TextServicesHost.cs (7)
62Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "OnRegisterTextStore must be called on STA thread"); 248Debug.Assert(_registeredtextstorecount > 0, "Overrelease TextStore!"); 266Debug.Assert(CheckAccess(), "OnDispatcherShutdownFinished called on bad thread!"); 267Debug.Assert(_isDispatcherShutdownFinished == false, "Was this dispather finished???"); 295Debug.Assert(CheckAccess(), "RegisterTextStore called on bad thread!"); 300Debug.Assert(_isDispatcherShutdownFinished == false, "Was this dispather finished?"); 301Debug.Assert(_registeredtextstorecount == 0, "TextStore was registered without ThreadMgr?");
System\Windows\Documents\TextStore.cs (1)
4807Debug.Assert(tracer != null, "Trace called when not tracing");
System\Windows\FrameworkContextData.cs (1)
63Debug.Assert((walkerEntry.Data == data) && (walkerEntry.Walker == walker),
System\Windows\FrameworkElement.cs (7)
1167Debug.Assert(startNode.IsValid || unlinkedParent != null, 1378Debug.Assert(fo.IsValid, 1467Debug.Assert(target != null, "Don't call FindTemplateResource with a null target object"); 1473Debug.Assert(fo.IsValid, "Don't call FindTemplateResource with a target object that is neither a FrameworkElement nor a FrameworkContentElement"); 1911Debug.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."); 2342Debug.Assert(templatedParentTemplate != null , 2530Debug.Assert(fceParent == null, "Nearest framework parent via the visual tree has to be an FE. It cannot be an FCE");
System\Windows\FrameworkElementFactory.cs (3)
682Debug.Assert( treeNodeFO.IsValid || (treeNodeVisual3D != null), 1173Debug.Assert(_frameworkTemplate != null, "ContentPresenter is an FE and can only have a FrameworkTemplate"); 1216Debug.Assert(_frameworkTemplate != null, "GridViewRowPresenter is an FE and can only have a FrameworkTemplate");
System\Windows\FrameworkTemplate.cs (5)
58Debug.Assert(templatedParent != null, 437Debug.Assert(!_sealed, "call this method before template is sealed"); 830Debug.Assert(false, "We do not have support for DynamicResource within unshared template content"); 959Debug.Assert(templateReader != null, "PlayXaml returned null"); 1052Debug.Assert(false, "Unknown enum value");
System\Windows\Generated\FrameworkContentElement.cs (1)
1157Debug.Assert(value == true,
System\Windows\Generated\FrameworkElement.cs (1)
1196Debug.Assert(value == true,
System\Windows\Input\Command\CommandConverter.cs (2)
807System.Diagnostics.Debug.Assert( propertyInfo == null, "KnownCommand isn't known to CommandConverter.GetKnownCommand" ); 810System.Diagnostics.Debug.Assert( fieldInfo == null, "KnownCommand isn't known to CommandConverter.GetKnownCommand" );
System\Windows\Input\KeyboardNavigation.cs (18)
495Debug.Assert(adornedElement != null, "adornedElement should not be null"); 496Debug.Assert(focusVisualStyle != null, "focusVisual should not be null"); 512Debug.Assert(adornedElement != null, "adornedElement should not be null"); 513Debug.Assert(adornedElementParent != null, "adornedElementParent should not be null"); 514Debug.Assert(contentHostParent != null, "contentHostParent should not be null"); 515Debug.Assert(contentHostParent is Visual, "contentHostParent should be Visual"); 516Debug.Assert(focusVisualStyle != null, "focusVisual should not be null"); 979Debug.Assert(currentElement != null, "currentElement should not be null"); 1339Debug.Assert(container != null, "container cannot be null"); 1790Debug.Assert(e != null, "e should not be null"); 1791Debug.Assert(container != null, "container should not be null"); 1869Debug.Assert(e != null, "e cannot be null"); 2083Debug.Assert(container != null, "container should not be null"); 2119Debug.Assert(IsTabStopOrGroup(nextTabElement), "nextTabElement should be IsTabStop or group"); 2258Debug.Assert(e != null || container != null, "e or container should not be null"); 2637Debug.Assert(sourceElement != null, "sourceElement must not be null"); 2887Debug.Assert(!(sourceElement == null && container == null), "Both sourceElement and container cannot be null"); 2892Debug.Assert(container != null, "container cannot be null");
System\Windows\Interop\ActiveXHost.cs (20)
218Debug.Assert(args.Key.Length > 0, "got an empty access key"); 410Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Loaded, "Failed transition"); 415Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Running, "Failed transition"); 420Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.InPlaceActive, "Failed transition"); 425Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.UIActive, "Failed transition"); 466Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.InPlaceActive, "Failed transition"); 471Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Running, "Failed transition"); 476Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Loaded, "Failed transition"); 481Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Passive, "Failed transition"); 552Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Passive, "Wrong start state to transition from"); 557Debug.Assert(_axInstance == null, "_axInstance must be null"); 560Debug.Assert(_axInstance != null, "w/o an exception being thrown we must have an object..."); 575Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Loaded, "Wrong start state to transition from"); 609Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Loaded, "Wrong start state to transition from"); 634Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Running, "Wrong start state to transition from"); 651Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Running, "Wrong start state to transition from"); 678Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.InPlaceActive, "Wrong start state to transition from"); 693Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.InPlaceActive, "Wrong start state to transition from"); 706Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.UIActive, "Wrong start state to transition from"); 942Debug.Assert(_axInstance != null, "The native control is null");
System\Windows\Interop\WindowInteropHelper.cs (2)
71Debug.Assert(_window != null, "Cannot be null since we verify in the constructor"); 76Debug.Assert(_window != null, "Cannot be null since we verify in the constructor");
System\Windows\LogicalTreeHelper.cs (1)
406Debug.Assert(parentFE != null || parentFCE != null, "Either parentFE or parentFCE should be non-null");
System\Windows\Markup\Baml2006\Baml2006Reader.cs (1)
2117Debug.Assert(_context.CurrentFrame.XamlType != null, "BAML Xmlns record is only legal between ElementStart and ElementEnd");
System\Windows\Markup\Baml2006\SharedStream.cs (1)
289System.Diagnostics.Debug.Assert(_baseStream != null, "Stream has already been disposed");
System\Windows\Markup\BamlMapTable.cs (3)
815Debug.Assert(attributeId >= 0, "Known Property Id must be a DependencyProperty."); 1016Debug.Assert(assemblyFullName.Length != 0, "empty assembly"); 1470Debug.Assert(GetHashTableData(stringValue) == null,
System\Windows\Markup\BamlReader.cs (2)
1394Debug.Assert(dictKey != null, "Bad Key record"); 1427Debug.Assert(keyStartRecord != null, "Bad Key Element Start record");
System\Windows\Markup\BamlRecordHelper.cs (1)
131Debug.Assert(false, "Unhandled case in DoesRecordTypeHaveDebugExtension");
System\Windows\Markup\BamlRecordReader.cs (10)
227Debug.Assert(false == XamlReaderStream.IsWriteComplete, 1201Debug.Assert(!CurrentContext.CheckFlag(ReaderFlags.NeedToAddToTree), "Failed to add Element to tree before popping stack"); 1498Debug.Assert(param != null && paramList == null, "Must have a single param"); 1512Debug.Assert(param == null && paramList != null, "Must have a paramList"); 1886Debug.Assert(staticResourceValues != null, "Must have a list of StaticResourceValues for lookup"); 1959Debug.Assert(staticResourceValues != null, "Must have a list of StaticResourceValues for lookup"); 2227Debug.Assert(element is DependencyObject, "Guaranteed by PropertyDefinition constructor"); 2697Debug.Assert( attributeUsage == BamlAttributeUsage.XmlSpace, 3441Debug.Assert( CurrentContext.ObjectData == null && CurrentContext.ExpectedType != null, 4987Debug.Assert(false, "The only remaining option is attached property, which is not allowed in xaml for content properties");
System\Windows\Markup\BamlRecords.cs (21)
688Debug.Assert(false,"Assembly, Type and Attribute records are not cached, so don't ask for one."); 713Debug.Assert(false,"Unknown RecordType"); 856set { Debug.Assert (value == -1, "Setting fixed record to an invalid size"); } 865Debug.Assert(false, "Must override RecordType"); 1501Debug.Assert(_valuePositionPosition != -1, 1684Debug.Assert(_valuePositionPosition != -1, 2049set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2119set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2180set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2407set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 2796Debug.Assert (false, "Unknown custom serializer"); 2984set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 3198set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3285set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3434Debug.Assert(_contentSizePosition != -1, 3479set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3639set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 3737set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 3815set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 4000Debug.Assert(FilePos != -1,"UpdateWrite called but Write Never was"); 4696Debug.Assert((propertyMember is MethodInfo) || (propertyMember is PropertyInfo)
System\Windows\Markup\BamlRecordWriter.cs (11)
464Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 563Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 599Debug.Assert(!InStaticResourceSection, "We do not support x:Shared within a StaticResource Section"); 783Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 839Debug.Assert(keyRecord.RecordList.Count == 0, "Should have empty record list"); 865Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 1627Debug.Assert(keyRecord != null, "Unknown key record type in defer load dictionary"); 1635Debug.Assert(keyIndex == _deferKeys.Count, 1658Debug.Assert(_deferElementDepth > 0 && CollectingValues, 1666Debug.Assert(valueDeferRecord.Record != null && 1678Debug.Assert(valueDeferRecord.Record != null && valueDeferRecord.Record.RecordType == BamlRecordType.ElementEnd,
System\Windows\Markup\BamlVersionHeader.cs (3)
72Debug.Assert((posEnd-posStart) == BamlVersionHeader.BinarySerializationSize, 103Debug.Assert(length == BamlVersionHeader.BinarySerializationSize, 108Debug.Assert((posEnd-posStart) == BamlVersionHeader.BinarySerializationSize,
System\Windows\Markup\BamlWriter.cs (2)
117Debug.Assert(null != assemblyName,"assembly name returned from GetBaseElement is null"); 118Debug.Assert(null != typeFullName,"Type name returned from GetBaseElement is null");
System\Windows\Markup\MarkupExtensionParser.cs (1)
1540Debug.Assert(null != info, "No property or method info for field Name");
System\Windows\Markup\Primitives\ElementMarkupObject.cs (3)
932Debug.Assert(typeSerializer != null, "typeSerializer for Enum was null"); 992Debug.Assert(serializer != null && serializer.CanConvertToString(_object.Instance, _object.Context), 1017Debug.Assert(serializer != null && serializer.CanConvertToString(_object.Instance, _object.Context),
System\Windows\Markup\Primitives\ExtensionSimplifierMarkupObject.cs (2)
314Debug.Assert(typeSerializer != null, "Could not retrieve typeSerializer for Type"); 349Debug.Assert(!propertyWritten, "An argument was returned after a property was set. All arguments must be returned first and in order");
System\Windows\Markup\Primitives\MarkupWriter.cs (5)
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"); 1361Debug.Assert( ((bool)_xmlnsSpacePreserve) == _containingScope.XmlnsSpacePreserve ,
System\Windows\Markup\WpfXamlLoader.cs (2)
317System.Diagnostics.Debug.Assert(count == 0, "Mismatch StartMember/EndMember"); 387System.Diagnostics.Debug.Assert(xamlReader.Value is string, "XmlAttributeProperties.XmlSpaceProperty has the type string.");
System\Windows\Markup\XamlStream.cs (14)
75Debug.Assert(!WriteComplete,"Write called after close"); 77Debug.Assert(null != buffer,"Null buffer past to the Writer"); 89Debug.Assert(null != writeBuffer,"Null writeBuffer returned"); 109Debug.Assert(0 < bufferWriteCount,"Not writing any bytes to the buffer"); 114Debug.Assert(bufferOffset < BufferSize,"Trying to Read past bufer"); 180Debug.Assert(!WriteComplete,"UpdateReaderLength called after close"); 225Debug.Assert(bufferOffset < BufferSize,"Calculated bufferOffset is greater than buffer"); 245Debug.Assert(0 < bufferReadCount,"Not reading any bytes to the buffer"); 250Debug.Assert(bufferOffset < BufferSize,"Trying ot read past buffer"); 373Debug.Assert(bufferOffset < BufferSize,"Calculated bufferOffset is greater than buffer"); 378Debug.Assert(bufferArray.Count == bufferIndex,"Need to allocate more than one buffer"); 379Debug.Assert(false == reader,"Allocating a buffer on Read"); 784Debug.Assert(false,"Close called on ReaderStream"); 792Debug.Assert(false,"Flush called on ReaderStream");
System\Windows\Markup\XamlTypeMapper.cs (26)
817Debug.Assert(null != attribInfo, "null attribInfo"); 818Debug.Assert(null != currentParentType, "null currentParentType"); 936Debug.Assert(null != localName, "null localName"); 937Debug.Assert(null != xmlNamespace, "null xmlNamespace"); 1588Debug.Assert(null != eventName, "null eventName"); 1589Debug.Assert(null != owner, "null owner"); 1633Debug.Assert(null != localName, "null localName"); 1634Debug.Assert(null != xmlNamespace, "null xmlNamespace"); 1671Debug.Assert(null != baseType, "baseType not set"); 1764Debug.Assert(null != localName, "null localName"); 1765Debug.Assert(null != xmlNamespace, "null xmlNamespace"); 1907Debug.Assert(typeInfo != null, "Must have cached type info at this point"); 2399Debug.Assert(null != xmlNamespace,"null value passed for xmlNamespace"); 2400Debug.Assert(null != localName,"null value passed for localName"); 2438Debug.Assert(null != xmlNamespace,"null value passed for xmlNamespace"); 2439Debug.Assert(null != localName,"null value passed for localName"); 2591Debug.Assert(namespaceMap.ClrNamespace != null,"Null CLR Namespace"); 2592Debug.Assert(localName != null,"Null localName"); 3441Debug.Assert(null != type, "Null passed for type to GetTypeConverterType"); 3472Debug.Assert(null != type, "Null passed for type to GetTypeConverter"); 3516Debug.Assert(null != propType, "Null passed for propType to GetPropertyConverterType"); 3560Debug.Assert(null != propType, "Null passed for propType to GetPropertyConverter"); 3679Debug.Assert(_constructors != null, "This operation is legal only after the constructors have been fetched"); 3745Debug.Assert(null != type, "null value for type passed to GetWhitespace"); 3757Debug.Assert(1 == trimAttribute.Length,"More than one TrimWhitespace Attribute"); 4007Debug.Assert(_dpLookupHashtable != null,
System\Windows\Media\Animation\BeginStoryboard.cs (2)
177Debug.Assert( fe != null || fce != null, "Caller of internal function failed to verify that we have a FE or FCE - we have neither." ); 196Debug.Assert( fe != null, "Invoke needs an object as starting point");
System\Windows\Media\Animation\ControllableStoryboardAction.cs (3)
60Debug.Assert( fe != null || fce != null, "Caller of internal function failed to verify that we have a FE or FCE - we have neither." ); 61Debug.Assert( targetStyle != null || frameworkTemplate != null, 80Debug.Assert( fe != null, "Invoke needs an object as starting point");
System\Windows\Media\Animation\Generated\ThicknessAnimationUsingKeyFrames.cs (6)
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\PauseStoryboard.cs (1)
26Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\RemoveStoryboard.cs (1)
26Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\ResumeStoryboard.cs (1)
26Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\SeekStoryboard.cs (1)
92Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\SetStoryboardSpeedRatio.cs (1)
50Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\SkipStoryboardToFill.cs (1)
26Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\StopStoryboard.cs (1)
26Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\Storyboard.cs (6)
690Debug.Assert( i > 0, "The caller should not have set the PropertyPath context to a null object." ); 745Debug.Assert( i > 0, "The caller should not have set the PropertyPath context to a non DependencyObject." ); 810Debug.Assert(path.Length > 1, "This method shouldn't even be called for a simple property path."); 860Debug.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'."); 980Debug.Assert(cacheEntry.Source != DependencyProperty.UnsetValue, 2096Debug.Assert( target != null && clone != null && property != null && original != null,
System\Windows\MultiTrigger.cs (1)
128Debug.Assert( TriggerConditions[i].SourceChildIndex == 0,
System\Windows\Navigation\Journal.cs (6)
273Debug.Assert(!(journalEntry.IsAlive() && journalEntry.JEGroupState.JournalDataStreams != null), 303Debug.Assert(_uncommittedCurrentIndex == _currentEntryIndex, 416Debug.Assert(IsNavigable(target), "target must be navigable"); 479Debug.Assert(index < TotalCount && index >= 0, "Invalid index passed to RemoveEntryInternal"); 480Debug.Assert(_uncommittedCurrentIndex == _currentEntryIndex, 484Debug.Assert(theEntry != null, "Journal list state is messed up");
System\Windows\Navigation\JournalEntry.cs (1)
265Debug.Assert(!_jeGroupState.JournalDataStreams.HasAnyData,
System\Windows\Navigation\NavigationService.cs (15)
90Debug.Assert(e != null, "Hyperlink fired Navigate event with null NavigateEventArgs"); 103Debug.Assert(dobj != null, "RequestNavigateEventArgs.OriginalSource should be DependencyObject"); 238Debug.Assert(_bp != null, "NavigationService should not handle a nav from a hyperlink thats not in its hosted tree"); 612Debug.Assert(ChildNavigationServices.Contains(ncChild), "Child NavigationService must already exist"); 672Debug.Assert(fe != null, "INavigatorHost needs to be FrameworkElement"); 1105Debug.Assert(bpu == null || 1135Debug.Assert(navMode == NavigationMode.Refresh, 1897Debug.Assert(PendingNavigationList.Count == 0, 2007Debug.Assert(this.Application != null && 2059Debug.Assert(source == null || 2109Debug.Assert(PendingNavigationList.Count == 0, 2119Debug.Assert(_navigateQueueItem == null, "Previous nav queue item should be cleared by now."); 3049Debug.Assert(navigationMode == NavigationMode.New || 3662Debug.Assert(_navigateQueueItem == null, 4458Debug.Assert(node != null, "Trying to dispose a null Logical Tree Node");
System\Windows\Navigation\NavigationWindow.cs (8)
997Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1004Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1012Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1019Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1027Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1034Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1041Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1053Debug.Assert(nw != null, "sender must be of type NavigationWindow.");
System\Windows\ResourceDictionary.cs (7)
540Debug.Assert(_numDefer > 0, "The stream was closed before all deferred content was loaded."); 953Debug.Assert(IsInitialized == false, "Dictionary should not be initialized when EndInit is called"); 1014Debug.Assert(_numDefer > 0, "The stream was closed before all deferred content was loaded."); 1287Debug.Assert(keyValue != null, "Didn't find the ResourceKey property or x:PositionalParameters directive"); 1291Debug.Assert(false, "StaticResources[] entry is not a StaticResource not OptimizedStaticResource"); 1718Debug.Assert(resourceKey != null, "ResourceKey cannot be null"); 2295Debug.Assert(IsThemeDictionary || _ownerApps != null || IsReadOnly, "This must be an App/Theme/Style/Template ResourceDictionary");
System\Windows\ResourceDictionaryCollection.cs (1)
15Debug.Assert(owner != null, "ResourceDictionaryCollection's owner cannot be null");
System\Windows\ResourceReferenceExpression.cs (1)
104Debug.Assert(_targetObject == d, "TargetObject that this expression is attached to must be the same as the one on which its value is being queried");
System\Windows\ResourcesChangeInfo.cs (1)
234Debug.Assert(_oldDictionaries != null || _newDictionaries != null || _key != null, "Must have a dictionary or a key that has changed");
System\Windows\StaticResourceExtension.cs (1)
242Debug.Assert(ambientList != null, "IAmbientProvider.GetAllAmbientValues no longer returns List<>, please copy the list");
System\Windows\Style.cs (2)
345Debug.Assert(resourceKey != null, "Argument cannot be null"); 627Debug.Assert(setterBase != null, "Setter collection must contain non-null instances of SetterBase");
System\Windows\StyleHelper.cs (40)
707Debug.Assert(freezable.IsFrozen, "Freezable within a Style or Template should have been frozen by now"); 1125Debug.Assert(action.IsSealed, "TriggerAction should have already been sealed by this point."); 1494Debug.Assert((container is FrameworkElement) || (container is FrameworkContentElement), "Caller has queried with non-framework element. Bad caller, bad!"); 1495Debug.Assert(dataType < InstanceStyleData.ArraySize, "Caller has queried using a value outside the range of the Enum. Bad caller, bad!"); 1598Debug.Assert(!freezable.CanFreeze, "If a freezable could have been frozen it would have been done by now."); 1625Debug.Assert(instanceValues != null, "InstanceValues hashtable should have been created at initialization time."); 1810Debug.Assert(treeRoot is FrameworkElement || treeRoot is FrameworkContentElement, 1858Debug.Assert(treeRoot == null || treeRoot is FrameworkElement || treeRoot is FrameworkContentElement, 1886Debug.Assert( feContainer._buildVisualTreeVerification == VerificationState.WaitingForBuildVisualTree, 1894Debug.Assert(frameworkTemplate != null, "Only FrameworkTemplate has the ability to build a VisualTree by this means"); 1906Debug.Assert( feContainer._buildVisualTreeVerification == VerificationState.WaitingForBuildVisualTreeCompletion, 1911Debug.Assert( feContainer._buildVisualTreeVerification == VerificationState.WaitingForAddCustomTemplateRoot, 1946Debug.Assert( container._buildVisualTreeVerification != VerificationState.WaitingForBuildVisualTreeCompletion, 1948Debug.Assert( container._buildVisualTreeVerification == VerificationState.WaitingForAddCustomTemplateRoot, 1969Debug.Assert( null == VisualTreeHelper.GetParent(child), 2057Debug.Assert( feWalkNode != null || fceWalkNode != null, 2130Debug.Assert(feContainer != null || fceContainer != null, 2149Debug.Assert(templatedChildren.Count > 0, 2390Debug.Assert(sender is FrameworkElement || sender is FrameworkContentElement, 2445Debug.Assert(sender is FrameworkElement || sender is FrameworkContentElement, 2479Debug.Assert(templatedParentTemplate != null, "Must have a VisualTree owner"); 2524Debug.Assert(action.ContainingTrigger is EventTrigger, 2615Debug.Assert(child.IsValid, "child should either be an FE or an FCE"); 2967Debug.Assert(value != NotYetApplied, "attempt to retrieve instance value that was never set"); 3486Debug.Assert( oldTemplate == null || oldTemplate is FrameworkTemplate, 3488Debug.Assert( newTemplate == null || newTemplate is FrameworkTemplate, 3490Debug.Assert( (oldTemplate == null || newTemplate == null ) || 4082Debug.Assert(styledChildren != null, "Should reach here only if the template tree has already been created"); 4211Debug.Assert(dp != null, "dp must not be null"); 4443Debug.Assert( triggerBase is MultiDataTrigger, 4479Debug.Assert( triggerBase is MultiTrigger, 4822Debug.Assert(!(action.ContainingTrigger is EventTrigger), 4838Debug.Assert( trigger.Property == changedProperty, 4845Debug.Assert( frameworkTemplate != null, 4853Debug.Assert( conditions != null && conditions.Length == 1, 4883Debug.Assert( conditions != null && conditions.Length == 1, 4916Debug.Assert( frameworkTemplate != null, 4927Debug.Assert(evaluationNode != null, 4989Debug.Assert( evaluationBinding != null, 5803Debug.Assert(false, "GetHashCode for value types will use reflection to generate the hashcode. Write a better hash code generation algorithm if this struct is to be used in a hashtable, or remove this assert if it's decided that reflection is OK.");
System\Windows\SystemResources.cs (1)
351Debug.Assert(typeKey != null || resourceKey != null, "typeKey or resourceKey should be non-null");
System\Windows\TemplateContent.cs (1)
580Debug.Assert(iReader != null, "Template's Reader is not a Indexing Reader");
System\Windows\TemplateNameScope.cs (2)
51Debug.Assert(templatedParent == null || (templatedParent is FrameworkElement || templatedParent is FrameworkContentElement), 199Debug.Assert(false, "Should never be trying to unregister via this interface for templates");
System\Windows\ThemeDictionaryExtension.cs (2)
188Debug.Assert(dictionary != null, "dictionary should not be null"); 189Debug.Assert(assemblyName != null, "assemblyName should not be null");
System\Windows\TreeChangeInfo.cs (2)
53Debug.Assert(d != null, "Must have non-null current node"); 112Debug.Assert(!inheritableProperties.Contains(dp), "EffectiveValues cache must not contains duplicate entries for the same DP");
System\Windows\TreeWalkHelper.cs (14)
40Debug.Assert(fe != null || fce != null, "Node with the tree change notification must be an FE or an FCE."); 41Debug.Assert(parent != null, "Must have a parent that the current node is connected to or disconnected from."); 242Debug.Assert(fe != null || fce != null, "Must have non-null current node"); 265Debug.Assert(inheritableProperty.IsPotentiallyInherited, "if we got here, it means that this property is inheritable by someone"); 282Debug.Assert(!currentInheritableProperties.Contains(inheritableProperty), "InheritableProperties list should not have duplicates"); 317Debug.Assert(d != null, "Must have non-null current node"); 320Debug.Assert(fMetadata.IsInherited == true, "This must be an inherited dependency property"); 323Debug.Assert(!wasSelfInheritanceParent || isSelfInheritanceParent, "IsSelfInheritanceParent changed from true to false"); 454Debug.Assert(fe != null || fce != null, "Node with the resources change notification must be an FE or an FCE."); 523Debug.Assert(d != null, "Must have non-null current node"); 685Debug.Assert(d != null, "Must have non-null current node"); 748Debug.Assert(d != null, "Must have non-null current node"); 910Debug.Assert(fo.IsValid, "Node with the resources change notification must be an FE or an FCE."); 942Debug.Assert(d != null, "Must have non-null current node");
System\Windows\Trigger.cs (2)
233Debug.Assert( TriggerConditions != null && TriggerConditions.Length == 1, 236Debug.Assert( TriggerConditions[0].SourceChildIndex == 0,
System\Windows\TriggerBase.cs (1)
367Debug.Assert( false,
System\Windows\Window.cs (40)
337Debug.Assert(_threadWindowHandles == null, "_threadWindowHandles must be null before enumerating the thread windows"); 1366Debug.Assert( IsSourceWindowNull == false , "IsSourceWindowNull cannot be true when _showingAsDialog is true"); 3020Debug.Assert( IsSourceWindowNull == false , "IsSourceWindowNull cannot be true when calling this function"); 3247Debug.Assert(Manager != null, "HwndStyleManager must have a valid value here"); 3580Debug.Assert(w != null, "Target must be of type Window."); 3603Debug.Assert(_threadWindowHandles != null, "_threadWindowHandles must not be null at this point"); 3626Debug.Assert(_threadWindowHandles != null, "_threadWindowHandles must not be null at this point"); 3763Debug.Assert(IsSourceWindowNull == false, "_swh should not be null here"); 3913Debug.Assert(workAreaWidthDeviceUnits >= 0, string.Create(CultureInfo.InvariantCulture, $"workAreaWidth ({hMonitor})for monitor ({workAreaWidthDeviceUnits}) is negative")); 3914Debug.Assert(workAreaHeightDeviceUnits >= 0, string.Create(CultureInfo.InvariantCulture, $"workAreaHeight ({hMonitor}) for monitor ({workAreaHeightDeviceUnits}) is negative")); 3924Debug.Assert(IsSourceWindowNull == false, "_swh should not be null here"); 4053Debug.Assert(false, "Invalid value for ResizeMode"); 4428Debug.Assert(_showingAsDialog == true, "_showingAsDialog must be true when DoDialogHide is called"); 4469Debug.Assert(_threadWindowHandles != null, "_threadWindowHandles must not be null at this point"); 4510Debug.Assert(ownedWindows.Count == 0, "All owned windows should now be gone"); 5068Debug.Assert(w != null, "DependencyObject must be of type Window."); 5094Debug.Assert(w != null, "DependencyObject must be of type Window."); 5113Debug.Assert(w != null, "DependencyObject must be of type Window."); 5173Debug.Assert(w != null, "DependencyObject must be of type Window."); 5300Debug.Assert(w != null, "DependencyObject must be of type Window."); 5320Debug.Assert(w != null, "DependencyObject must be of type Window."); 5581Debug.Assert(_dispatcherFrame == null, "_dispatcherFrame must be null here"); 5640Debug.Assert(w != null, "DependencyObject must be of type Window."); 5651Debug.Assert(w != null, "DependencyObject must be of type Window."); 5711Debug.Assert(w != null, "d must be typeof Window"); 5734Debug.Assert(w != null, "d must be typeof Window"); 5773Debug.Assert(w != null, "d must be typeof Window"); 5811Debug.Assert(w != null, "d must be typeof Window"); 5832Debug.Assert(w != null, "d must be typeof Window"); 5873Debug.Assert(w != null, "d must be typeof Window"); 6103Debug.Assert( w != null, "DependencyObject must be of type Window." ); 6178Debug.Assert( w != null, "DependencyObject must be of type Window." ); 6235Debug.Assert( IsSourceWindowNull == false , "IsSourceWindowNull cannot be true when calling this function"); 6257Debug.Assert( w != null, "DependencyObject must be of type Window." ); 6289Debug.Assert(w != null, "DependencyObject must be of type Window."); 7446Debug.Assert(IsSourceWindowNull != true, "IsSourceWindowNull cannot be true here"); 7537Debug.Assert( IsSourceWindowNull == false , "Should only be invoked when we know Handle is non-null" ); 7547Debug.Assert( IsSourceWindowNull == false , "Should only be invoked when we know Handle is non-null" ); 7572Debug.Assert( IsSourceWindowNull == false , "IsSourceWindowNull can't be true here"); 7591Debug.Assert( IsSourceWindowNull == false , "IsSourceWindowNull can't be true here");
System\Windows\WindowCollection.cs (1)
40Debug.Assert(count >= 0, "count must not be less than zero");
PresentationFramework.Aero (3)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
330Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 357Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 367Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
PresentationFramework.Aero2 (3)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
330Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 357Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 367Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
PresentationFramework.AeroLite (3)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
330Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 357Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 367Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
PresentationFramework.Classic (21)
Microsoft\Windows\Themes\ClassicBorderDecorator.cs (18)
232Debug.Assert(rgbColor.Red >= 0 && rgbColor.Red <= 1, "Red must be between 0 and 1."); 233Debug.Assert(rgbColor.Green >= 0 && rgbColor.Green <= 1, "Green must be between 0 and 1."); 234Debug.Assert(rgbColor.Blue >= 0 && rgbColor.Blue <= 1, "Blue must be between 0 and 1."); 296Debug.Assert(hue >= 0 && hue <= 1, "Output hue should be between 0 and 1."); 297Debug.Assert(lightness >= 0 && lightness <= 1, "Output lightness should be between 0 and 1."); 298Debug.Assert(saturation >= 0 && saturation <= 1, "Output saturation should be between 0 and 1."); 300Debug.Assert(!isHueDefined || isSaturationDefined, "If hue is defined, saturation must also be defined."); 312Debug.Assert(hlsColor.Lightness >= 0 && hlsColor.Lightness <= 1, "Lightness must be between 0 and 1."); 313Debug.Assert(hlsColor.Saturation >= 0 && hlsColor.Saturation <= 1, "Saturation must be between 0 and 1."); 338Debug.Assert(red >= 0 && red <= 1, "Output red should be between 0 and 1."); 339Debug.Assert(green >= 0 && green <= 1, "Output green should be between 0 and 1."); 340Debug.Assert(blue >= 0 && blue <= 1, "Output blue should be between 0 and 1."); 347Debug.Assert(n1 >= 0 && n1 <= 1, "n1 must be between 0 and 1."); 348Debug.Assert(n2 >= 0 && n2 <= 1, "n2 must be between 0 and 1."); 349Debug.Assert(hue >= -6 && hue < 12, "Hue must be between -6 (inclusive) and 12 (exclusive)."); 1155Debug.Assert(_tabCache != null, "_tabCache is null. GetShadow1 should only be called after GetHighlight1"); 1168Debug.Assert(_tabCache != null, "_tabCache is null. GetHighlight2 should only be called after GetHighlight1"); 1181Debug.Assert(_tabCache != null, "_tabCache is null. GetHighlight2 should only be called after GetHighlight1");
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
330Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 357Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 367Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
PresentationFramework.Luna (3)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
330Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 357Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 367Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
PresentationFramework.Royale (3)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
330Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 357Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 367Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
PresentationUI (5)
MS\Internal\Documents\Application\DocumentProperties.cs (1)
221System.Diagnostics.Debug.Assert(
MS\Internal\Documents\DocumentApplicationDocumentViewer.cs (1)
49System.Diagnostics.Debug.Assert(
MS\Internal\Documents\DocumentSignatureManager.cs (1)
825System.Diagnostics.Debug.Assert(
MS\Internal\Documents\RightsManagementManager.cs (1)
70System.Diagnostics.Debug.Assert(
MS\Internal\Documents\SignatureSummaryDialog.cs (1)
759Debug.Assert(item._displayImage != null, "Signature icon is null");
ReachFramework (80)
AlphaFlattener\BrushProxy.cs (37)
164Debug.Assert(pen != null, "pen expected"); 165Debug.Assert(brush != null, "brush expected"); 188Debug.Assert(_brush.BrushList == null, "Simple brush expected"); 270Debug.Assert(pen != null, "pen expected"); 271Debug.Assert(pen.Brush != null, "pen expected to have a brush"); 303Debug.Assert(pen != null, "pen expected"); 304Debug.Assert(pen.Brush != null, "pen expected to have a brush"); 541Debug.Assert(bp._opacityOnly == _opacityOnly, "Brush and OpacityMask can't mix in a single list"); 669Debug.Assert(Utility.IsRenderVisible(vb), "TileBrush.Viewbox area must be positive"); 676Debug.Assert(false, "IsOpaque(" + _brush.GetType() + ") not handled"); 736Debug.Assert(Utility.IsRenderVisible(vb), "TileBrush.Viewbox must be visible"); 772Debug.Assert(false, "IsTransparent not handled " + _brush.GetType()); 1076Debug.Assert(false, "Unexpected brush type"); 1249Debug.Assert(drawingBrush.Drawing != null, "DrawingBrush where Drawing == null should've been culled"); 1315Debug.Assert(_drawing != null, "_drawing primitive changed, but it's null"); 1934Debug.Assert(false, "Unhandled GradientBrush type"); 2131Debug.Assert(b._brush is SolidColorBrush, "SolidColorBrush expected"); 2132Debug.Assert(!b._opacityOnly, "OpacityMask not expected"); 2144Debug.Assert(first, "prefix only"); 2372Debug.Assert(bp != null, "Blending visible ImageBrush with another brush should yield non-empty brush"); 2649Debug.Assert(brush != null, "null brush"); 2692Debug.Assert(gb.MappingMode == BrushMappingMode.Absolute, "absolute brush"); 2700Debug.Assert(tb.ViewportUnits == BrushMappingMode.Absolute, "absolute brush required for BrushProxy"); 2890Debug.Assert(false, "Unhandled GradientBrush type"); 2915Debug.Assert(false, "Unandled Brush type"); 2945Debug.Assert(gsc != null && gsc.Count > 0, "BrushProxy.IsEmpty should return true upon GradientBrush with zero stops"); 2986Debug.Assert(!bounds.IsEmpty, "Bounds must not be empty for BitmapCacheBrush"); 3064Debug.Assert(!bounds.IsEmpty, "Bounds must not be empty for VisualBrush"); 3204Debug.Assert(false, "Unhandled ImageBrush.ImageSource type"); 3259Debug.Assert(brushB.Brush != null, "null brush not expected"); 3346Debug.Assert(false, "Brush type not expected"); 3371Debug.Assert(Utility.NormalizeOpacity(value) == value, "BrushProxy.Opacity must always be normalized"); 3499Debug.Assert(false, "Unexpected brush type"); 3619Debug.Assert(false, "Single brush expected"); 3644Debug.Assert( 3711Debug.Assert(Utility.IsValid(opacity), "Opacity comes from BrushProxy, should be valid"); 4180Debug.Assert(Utility.IsValid(opacity), "Opacity comes from BrushProxy, should be valid");
AlphaFlattener\DrawingContext.cs (11)
252Debug.Assert(b != null, "LinearGradientBrush expected"); 375Debug.Assert(b != null, "RadialGradientBrush expected"); 496Debug.Assert(one.BrushList.Count == 2, "Only two brushes allowed here"); 598Debug.Assert(brush != null, "brush expected"); 599Debug.Assert(shape != null, "shape expected"); 600Debug.Assert(!_costing, "in costing mode DrawImage"); 683Debug.Assert(false, "Opacity invalid at BrushProxyDecomposer"); 688Debug.Assert(false, "Opacity invalid at BrushProxyDecomposer"); 693Debug.Assert(brushTrans.IsIdentity, "brushTrans not supported"); 722Debug.Assert(pen == null, "no pen"); 930Debug.Assert(!_costing, "in costing mode DrawyGlyphs");
AlphaFlattener\Flattener.cs (2)
87Debug.Assert(Utility.IsValid(opacity) && Utility.IsValid(tree.Opacity), "Invalid opacity encountered, should've been normalized in conversion to Primitive"); 1175Debug.Assert(false, "Wrong Primitive type");
AlphaFlattener\ImageProxy.cs (2)
170Debug.Assert(opacityBrush.ViewportUnits == BrushMappingMode.Absolute, "TileBrush must have absolute viewport by this point"); 298Debug.Assert(!opacityOnly, "Opaque image OpacityMask should not be blended with brush");
AlphaFlattener\Optimizer.cs (1)
84Debug.Assert(geometry != null, "No geometry available for primitive");
AlphaFlattener\Primitive.cs (9)
261Debug.Assert(Utility.NormalizeOpacity(value) == value, "Opacity should be normalized during tree walking"); 676Debug.Assert(Brush == null, "no brush expected"); 1312Debug.Assert((Brush != null) || (Pen != null), "empty primitive"); 1382Debug.Assert(tb.ViewboxUnits == BrushMappingMode.Absolute, "Absolute Viewbox expected"); 1857Debug.Assert(false, "Image over Brush?"); 2028Debug.Assert(false, "GetShapeGeometry on Canvas"); 2034Debug.Assert(false, "Exclude on Canvas"); 2039Debug.Assert(false, "BlendBrush on Canvas"); 2046Debug.Assert(false, "BlendOverImage on Canvas");
AlphaFlattener\PrimitiveRenderer.cs (1)
62Debug.Assert(_brush == null, "no brush");
AlphaFlattener\Utility.cs (3)
961Debug.Assert(false, "Unsupported PathSegment"); 1598Debug.Assert(false, "Unhandled TileBrush type"); 1669Debug.Assert(IsValidViewbox(viewbox, brush.Stretch != Stretch.None) &&
Packaging\XpsManager.cs (2)
1408Debug.Assert(package != null, "package cannot be null"); 1453Debug.Assert(package != null, "package cannot be null");
PrintConfig\PrintSchemaShim.cs (1)
659Debug.Assert(false, "PrintTicketScope enum is out of range");
Serialization\DrawingContextFlattener.cs (2)
81Debug.Assert(Utility.IsValid(opacity), "Invalid opacity should clip subtree"); 91Debug.Assert(!BrushProxy.IsEmpty(opacityMask), "empty opacity mask should not result in Push");
Serialization\Manager\MetroSerializationManager.cs (1)
847Debug.Assert(propertyInfo.PropertyType == dependencyProperty.PropertyType,
Serialization\VisualSerializer.cs (7)
257Debug.Assert(!BrushProxy.IsEmpty(brush), "Should not be serializing empty brush"); 387Debug.Assert(pos >= 0, "Missing offset"); 821Debug.Assert(false, "Brush not supported"); 1435Debug.Assert(forFill || forStroke, "Either forFill or forStoke should be true"); 1678Debug.Assert(_nameAttr.Length > 0, "Empty _nameAttr"); 2347Debug.Assert(nameAttr == null || nameAttr.Length > 0, "Bad name attribute"); 2382Debug.Assert(_nameAttr == null, "Empty");
Serialization\VisualTreeFlattener.cs (1)
632Debug.Assert(_visualDepth >= 0, "StartVisual/EndVisual mismatch");
Replay (7)
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);
Roslyn.Test.PdbUtilities (1)
EditAndContinue\EditAndContinueTest.GenerationVerifier.cs (1)
169Debug.Assert(updatedMethods.Length == 1, "Only supported for a single method update");
SemanticSearch.BuildTask (1)
src\Compilers\Core\Portable\InternalUtilities\ExceptionUtilities.cs (1)
22Debug.Assert(false, output);
Shared (1)
ServerSentEvents\SseParser_1.cs (1)
292Debug.Assert(_newlineIndex - _lineOffset < _lineLength, "Expected to be positioned at a non-empty newline");
System.CodeDom (4)
Microsoft\VisualBasic\VBCodeGenerator.cs (1)
2593Debug.Assert(_statementDepth >= 0, "statementDepth >= 0");
src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (1)
254Debug.Assert(q.Count == 1, "We should have one and only one in the rank queue.");
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 (12)
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (1)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
System\Collections\Generic\LinkedList.cs (4)
389Debug.Assert(head == null && count == 0, "LinkedList must be empty when this method is called!"); 399Debug.Assert(node.list == this, "Deleting the node from another list!"); 400Debug.Assert(head != null, "This method shouldn't be called on empty list!"); 403Debug.Assert(count == 1 && head == node, "this should only be true for a list with only one node");
System\Collections\Generic\OrderedDictionary.cs (7)
414Debug.Assert(index < 0, "Expected index to be unspecied when overwriting an existing key."); 424Debug.Assert(index < 0, "Expected index to be unspecied when ignoring a duplicate key."); 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"); 1078Debug.Assert(!forceNewHashCodes || !typeof(TKey).IsValueType, "Value types never rehash."); 1079Debug.Assert(newSize >= _count, "The requested size must accomodate all of the current elements.");
System.Collections.Concurrent (15)
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (1)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
System\Collections\Concurrent\BlockingCollection.cs (6)
257Debug.Assert(tryAddReturnValue, "TryAdd() was expected to return true."); 287Debug.Assert(tryAddReturnValue, "TryAdd() was expected to return true."); 458Debug.Assert((observedAdders + 1) <= (~COMPLETE_ADDING_ON_MASK), "The number of concurrent adders thread exceeded the maximum limit."); 767Debug.Assert(tryAddAnyReturnValue >= 0 && tryAddAnyReturnValue < collections.Length, 809Debug.Assert(tryAddAnyReturnValue >= 0 && tryAddAnyReturnValue < collections.Length, 1168Debug.Assert(returnValue >= 0 && returnValue < collections.Length,
System\Collections\Concurrent\ConcurrentBag.cs (2)
739Debug.Assert(_tailIndex == tail, "No other thread should be changing _tailIndex"); 1034Debug.Assert(
System\Collections\Concurrent\ConcurrentDictionary.cs (3)
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");
System\Collections\Concurrent\PartitionerStatic.cs (3)
694Debug.Assert(_useSingleChunking, "Expected _useSingleChecking to be true"); 744Debug.Assert(!_useSingleChunking, "Did not expect to be in single-chunking mode"); 1659Debug.Assert((DEFAULT_BYTES_PER_CHUNK % IntPtr.Size) == 0, "bytes per chunk should be a multiple of pointer size");
System.Collections.Immutable (12)
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (1)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
System\Collections\Frozen\FrozenDictionary.AlternateLookup.cs (1)
68Debug.Assert(Comparer is IAlternateEqualityComparer<TAlternateKey, TKey>, "Must have already been verified");
System\Collections\Frozen\FrozenDictionary.cs (1)
116Debug.Assert(source.Count > 0, "Empty sources should have been filtered out by caller");
System\Collections\Frozen\FrozenSet.AlternateLookup.cs (1)
68Debug.Assert(Comparer is IAlternateEqualityComparer<TAlternate, T>, "Must have already been verified");
System\Collections\Frozen\FrozenSet.cs (1)
97Debug.Assert(source.Count > 0, "Empty sources should have been filtered out by caller");
System\Collections\Frozen\FrozenSetInternalBase.cs (7)
33Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used."); 60Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used."); 87Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used."); 103Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used."); 131Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used."); 147Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used."); 192Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used.");
System.Collections.NonGeneric (1)
System\Collections\SortedList.cs (1)
219Debug.Assert(_size == 0, "Size is not zero");
System.ComponentModel.Annotations (4)
System\ComponentModel\DataAnnotations\EnumDataTypeAttribute.cs (1)
69Debug.Assert(valueType == value.GetType(), "The valueType should equal the Type of the value");
System\ComponentModel\DataAnnotations\UIHintAttribute.cs (2)
146Debug.Assert(leftParams != null, "leftParams shouldn't be null"); 147Debug.Assert(rightParams != null, "rightParams shouldn't be null");
System\ComponentModel\DataAnnotations\ValidationAttribute.cs (1)
76Debug.Assert(populateErrorMessageResourceAccessor is false, "Use the default constructor instead");
System.ComponentModel.EventBasedAsync (1)
System\ComponentModel\BackgroundWorker.cs (1)
167Debug.Assert(_asyncOperation != null, "_asyncOperation not initialized");
System.ComponentModel.TypeConverter (70)
System\ComponentModel\AmbientValueAttribute.cs (1)
33Debug.Assert(IDesignerHost.IsSupported, "Runtime instantiation of this attribute is not allowed with trimming.");
System\ComponentModel\DecimalConverter.cs (1)
49Debug.Assert(ctor != null, "Expected constructor to exist.");
System\ComponentModel\Design\DesigntimeLicenseContext.cs (1)
52Debug.Assert(fileName != null && fileName.Length > 0, "Cannot get local path, fileName is not valid");
System\ComponentModel\Design\DesigntimeLicenseContextSerializer.cs (1)
94Debug.Assert(_stream.Position != 0, "Expected the first byte to be read first");
System\ComponentModel\Design\Serialization\MemberRelationshipService.cs (1)
151Debug.Assert(o is RelationshipEntry, "This is only called indirectly from a dictionary only containing RelationshipEntry structs.");
System\ComponentModel\EventDescriptorCollection.cs (3)
349Debug.Assert(foundCount == eventCount, "We did not completely fill our event array"); 421Debug.Assert(count == 0 || array != null, "if array is null, count should be 0"); 422Debug.Assert(array == null || count <= array.Length, "Trying to enumerate more than the array contains");
System\ComponentModel\ExtendedPropertyDescriptor.cs (5)
25Debug.Assert(extenderInfo != null, "ExtendedPropertyDescriptor must have extenderInfo"); 26Debug.Assert(provider != null, "ExtendedPropertyDescriptor must have provider"); 47Debug.Assert(extender != null, "The original PropertyDescriptor must be non-null"); 51Debug.Assert(attr != null, "The original PropertyDescriptor does not have an ExtenderProvidedPropertyAttribute"); 56Debug.Assert(reflectDesc != null, "The original PropertyDescriptor has an invalid ExtenderProperty");
System\ComponentModel\GuidConverter.cs (1)
61Debug.Assert(ctor != null, "Expected constructor to exist.");
System\ComponentModel\LicenseManager.cs (3)
196Debug.Assert(providerType != null, "Type cannot ever be null"); 205Debug.Assert(type != null, "IsValid Type cannot ever be null"); 216Debug.Assert(type != null, "IsValid Type cannot ever be null");
System\ComponentModel\LicFileLicenseProvider.cs (1)
52Debug.Assert(context != null, "No context provided!");
System\ComponentModel\MaskedTextProvider.cs (14)
635Debug.Assert(AssignedEditPositionCount >= 0, "Invalid count of assigned chars."); 647Debug.Assert(AssignedEditPositionCount >= 0, "Invalid count of assigned chars."); 1266Debug.Assert(input != null && position >= 0 && position < _testString.Length, "input param out of range."); 1554Debug.Assert(startPosition >= 0 && startPosition <= endPosition && endPosition < _testString.Length, "Out of range input value."); 1946Debug.Assert(AssignedEditPositionCount >= 0, "Invalid count of assigned chars."); 1956Debug.Assert(startPosition >= 0 && endPosition >= 0 && endPosition >= startPosition && endPosition < _testString.Length, "position out of range."); 2025Debug.Assert(position >= 0 && position < _testString.Length, "Position out of range."); 2037Debug.Assert(position >= 0 && position < _testString.Length, "Position out of range."); 2038Debug.Assert(charDescriptor != null, "Null character descriptor."); 2051Debug.Assert(!IsLiteralPosition(charDex), "Setting char in literal position."); 2084Debug.Assert(AssignedEditPositionCount <= EditPositionCount, "Invalid count of assigned chars."); 2162Debug.Assert(position >= 0 && position < _testString.Length, "Position out of range."); 2420Debug.Assert(input != null, "null input."); 2421Debug.Assert(position >= 0, "Position out of range.");
System\ComponentModel\NullableConverter.cs (1)
111Debug.Assert(ci != null, "Couldn't find constructor");
System\ComponentModel\PropertyDescriptorCollection.cs (1)
367Debug.Assert(foundCount == propCount, "We did not completely fill our property array");
System\ComponentModel\ReflectEventDescriptor.cs (6)
99Debug.Assert(eventInfo.ReflectedType!.IsAssignableFrom(componentClass), "eventInfo.ReflectedType is used below, but only componentClass is annotated with DynamicallyAccessedMembers. Ensure ReflectedType is in componentClass's hierarchy."); 236Debug.Assert(_componentClass != null, "Must have a component class for FilterAttributes"); 262Debug.Assert(currentReflectType != null, "currentReflectType cannot be null"); 263Debug.Assert(currentReflectType.IsAssignableFrom(_componentClass), "currentReflectType must be in _componentClass's hierarchy"); 383Debug.Assert(currentReflectType != null, "currentReflectType cannot be null"); 384Debug.Assert(currentReflectType.IsAssignableFrom(_componentClass), "currentReflectType must be in _componentClass's hierarchy");
System\ComponentModel\ReflectPropertyDescriptor.cs (2)
751Debug.Assert(_componentClass != null, "Must have a component class for FillAttributes"); 911Debug.Assert(component != null, "GetValue must be given a component");
System\ComponentModel\ReflectTypeDescriptionProvider.cs (7)
225Debug.Assert(table != null, "COMPAT: Editor table should not be null"); // don't throw; RTM didn't so we can't do it either. 246Debug.Assert(objectType != null, "Should have arg-checked before coming in here"); 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");
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)
846Debug.Assert(converter != null, "Unexpected null TypeConverter."); 856Debug.Assert(converter != null, "Unexpected null TypeConverter."); 1649Debug.Assert(type != null, "Caller should validate"); 1737Debug.Assert(instance != null, "Caller should validate"); 1836Debug.Assert(target.Next == null, "Delegating provider should always be the last provider in the chain."); 1876Debug.Assert(pipelineType != PIPELINE_ATTRIBUTES, "PipelineAttributeFilter is not supported for attributes"); 1966Debug.Assert(cache == null || list == null || !cache.Contains(s_pipelineFilterKeys[pipelineType]), "Earlier pipeline stage should have removed our cache"); 2024Debug.Assert(suffix != null, "Name collision with non-extender property."); 2927Debug.Assert(newAttrs[idx] != null, "_attributes contains a null member"); 3094Debug.Assert(attrs != null, "Someone should have handled this"); 3105Debug.Assert(className != null, "Someone should have handled this"); 3125Debug.Assert(converter != null, "Someone should have handled this"); 3167Debug.Assert(events != null, "Someone should have handled this"); 3179Debug.Assert(events != null, "Someone should have handled this"); 3191Debug.Assert(properties != null, "Someone should have handled this"); 3205Debug.Assert(properties != null, "Someone should have handled this");
System\ComponentModel\UriTypeConverter.cs (1)
74Debug.Assert(ctor != null, "Couldn't find constructor");
System\ComponentModel\VersionConverter.cs (1)
75Debug.Assert(ctor != null, "Couldn't find constructor");
System\Drawing\ColorConverter.cs (1)
125Debug.Assert(member != null, "Could not convert color to member. Did someone change method name / signature and not update ColorConverter?");
System\Timers\Timer.cs (1)
155Debug.Assert(_timer != null, $"{nameof(_timer)} was expected not to be null");
System.Composition.Hosting (2)
System\Composition\Hosting\Core\CompositionDependency.cs (1)
166Debug.Assert(IsError, "Should be in error state.");
System\Composition\Hosting\Core\CompositionOperation.cs (1)
86Debug.Assert(sharingLock != null, "Expected a sharing lock to be passed.");
System.Configuration.ConfigurationManager (91)
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)
697Debug.Assert(provider != null, "Could not determine provider from which settings were loaded");
System\Configuration\BaseConfigurationRecord.cs (26)
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"); 2622Debug.Assert(!positionedAtNextElement, "!positionedAtNextElement"); 3668Debug.Assert(factoryRecord.HasErrors,
System\Configuration\ClientSettingsStore.cs (1)
70Debug.Assert(settingsGroup != null, "Failed to declare settings group");
System\Configuration\ConfigPathUtility.cs (4)
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),
System\Configuration\ConfigurationElement.cs (5)
182Debug.Assert(Properties.Contains(propertyName), "Properties.Contains(propertyName)"); 732Debug.Assert(type != null, "type != null"); 762Debug.Assert(propertyInformation != null, "propertyInformation != 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 (25)
342Debug.Assert(input.HasResult, "input.HasResult"); 349Debug.Assert(IsLocationConfig, "Indirect location inputs exist only in location config record"); 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)); 2731Debug.Assert(allowOverrideAttribute == null, 2983Debug.Assert(update.SectionRecord.HasFileInput, "update.SectionRecord.HasFileInput"); 3024Debug.Assert(hasFile, "hasFile");
System\Configuration\SchemeSettingInternal.cs (1)
15Debug.Assert(name != null, "'name' must not be null.");
System\Configuration\SectionUpdates.cs (1)
37Debug.Assert(string.IsNullOrEmpty(_name), "FindSectionUpdates assumes search is from root record");
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 (5)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\ConsolePal.Unix.ConsoleStream.cs (2)
27Debug.Assert(handle != null, "Expected non-null console handle"); 28Debug.Assert(!handle.IsInvalid, "Expected valid console handle");
System\ConsolePal.Unix.cs (1)
605Debug.Assert(foundByteDstPos < foundByteDst.Length, "Should only be called when there's room for at least one byte.");
System.Data.Common (553)
src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (3)
40Debug.Assert(ADP.IsCatchableExceptionType(e), "Invalid exception type, should have been re-thrown!"); 243Debug.Assert(e != null, "Unexpected null exception!"); 263Debug.Assert(e != null, "Unexpected null exception!");
src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (7)
422Debug.Assert(((0 < keyname.Length) && (';' != keyname[0]) && !char.IsWhiteSpace(keyname[0]) && (-1 == keyname.IndexOf('\u0000'))) == compValue, "IsValueValid mismatch with regex"); 438Debug.Assert(KeyIndex == parser.GroupNumberFromName("key"), "wrong key index"); 439Debug.Assert(ValueIndex == parser.GroupNumberFromName("value"), "wrong value index"); 547Debug.Assert(null != connectionString, "null connectionstring"); 569Debug.Assert(IsKeyNameValid(keyname), "ParseFailure, invalid keyname"); 570Debug.Assert(IsValueValidInternal(keyvalue), "parse failure, invalid keyvalue"); 651Debug.Assert(expanded, "password/pwd was not removed");
src\libraries\Common\src\System\Data\Common\NameValuePair.cs (2)
17Debug.Assert(!string.IsNullOrEmpty(name), "empty keyname"); 27Debug.Assert(0 < _length, "NameValuePair zero Length usage");
System\Data\Common\AdapterUtil.Common.cs (4)
27Debug.Assert(e != null, "TraceException: null Exception"); 36Debug.Assert(IsCatchableExceptionType(e), "Invalid exception type, should have been re-thrown!"); 728Debug.Assert(0 == (rowStates & dataRow.RowState), "flagged RowState"); 753Debug.Assert(0 == (rowStates & dataRow.RowState), "flagged RowState");
System\Data\Common\BigIntegerStorage.cs (3)
44Debug.Assert(0 <= recordNo, "Invalid record"); 45Debug.Assert(null != value, "null value"); 129Debug.Assert(null != value, "null value");
System\Data\Common\BooleanStorage.cs (3)
95Debug.Assert(0 <= recordNo, "Invalid record"); 96Debug.Assert(null != value, "null value"); 149System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\ByteStorage.cs (3)
167Debug.Assert(0 <= recordNo, "Invalid record"); 168System.Diagnostics.Debug.Assert(null != value, "null value"); 221System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\CharStorage.cs (3)
94Debug.Assert(0 <= recordNo, "Invalid record"); 95System.Diagnostics.Debug.Assert(null != value, "null value"); 148System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\DataAdapter.cs (2)
37Debug.Assert(readerHandler.FieldCount > 0, "Scenario expects non-empty results but no fields reported by reader"); 449Debug.Assert(null != dataTables[i], "null DataTable Fill");
System\Data\Common\DataColumnMapping.cs (3)
91Debug.Assert(null != columns, "GetDataColumnBySchemaAction: unexpected null DataColumnCollection"); 97Debug.Assert(null != dataColumn, "GetDataColumnBySchemaAction: unexpected null dataColumn"); 117Debug.Assert(dataTable != null, "Should not call with a null DataTable");
System\Data\Common\DataColumnMappingCollection.cs (2)
350Debug.Assert((null != _items) && (0 <= index) && (index < Count), "RemoveIndex, invalid"); 381Debug.Assert((null != _items) && (0 <= index) && (index < Count), "RemoveIndex, invalid");
System\Data\Common\DataRecordInternal.cs (2)
21Debug.Assert(null != schemaInfo, "invalid attempt to instantiate DataRecordInternal with null schema information"); 22Debug.Assert(null != values, "invalid attempt to instantiate DataRecordInternal with null value[]");
System\Data\Common\DataStorage.cs (11)
142Debug.Assert(storageType == GetStorageType(type), "Incorrect storage type specified"); 297Debug.Assert(typeCode == GetStorageType(dataType), "Incorrect storage type specified"); 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\DbDataAdapter.cs (22)
775Debug.Assert(DbType.Int32 == parameter.DbType, "unexpected DbType"); 937Debug.Assert(null != tableMapping, "null TableMapping when MissingMappingAction.Error"); 966Debug.Assert((null != dataRows) && (0 < dataRows.Length), "Update: bad dataRows"); 967Debug.Assert(null != tableMapping, "Update: bad DataTableMapping"); 1451Debug.Assert(null == rowUpdatedEvent.Errors, "Continue - but contains an exception"); 1462Debug.Assert(null != connection, "unexpected null connection"); 1497Debug.Assert(null != rowUpdatedEvent, "null rowUpdatedEvent"); 1498Debug.Assert(null != dataCommand, "null dataCommand"); 1499Debug.Assert(rowUpdatedEvent.Command == dataCommand, "dataCommand differs from rowUpdatedEvent"); 1585Debug.Assert(null == rowUpdatedEvent.Errors, "Continue - but contains an exception"); 1597Debug.Assert(null != rowUpdatedEvent, "null rowUpdatedEvent"); 1619Debug.Assert(null != batchCommands, "null batchCommands?"); 1638Debug.Assert(null != row, "null dataRow?"); 1654Debug.Assert(null != batchCommands, "null batchCommands?"); 1670Debug.Assert(null != row, "null dataRow?"); 1706Debug.Assert(null != batchCommands, "null batchCommands?"); 1713Debug.Assert(null != row, "null dataRow?"); 1724Debug.Assert(null != dataRow, "null dataRow"); 1771Debug.Assert(null != command, "GetConnection3: null command"); 1772Debug.Assert(!string.IsNullOrEmpty(method), "missing method name"); 1783Debug.Assert(null != command, "GetConnection4: null command"); 1824Debug.Assert(null != connection, "QuietOpen: null connection");
System\Data\Common\DbEnumerator.cs (1)
60Debug.Assert(null != _schemaInfo && null != _descriptors, "unable to build schema information!");
System\Data\Common\DBSchemaRow.cs (3)
33Debug.Assert(null != dataRows, "GetSchemaRows: unexpected null dataRows"); 70Debug.Assert(null != _schemaTable.ColumnName, "no column ColumnName"); 84Debug.Assert(null != _schemaTable.Size, "no column Size");
System\Data\Common\DecimalStorage.cs (3)
172System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 173System.Diagnostics.Debug.Assert(null != value, "null value"); 217System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\DoubleStorage.cs (3)
167System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 168System.Diagnostics.Debug.Assert(null != value, "null value"); 221System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\Int16Storage.cs (3)
184System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 185System.Diagnostics.Debug.Assert(null != value, "null value"); 235System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\Int32Storage.cs (3)
183System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 184System.Diagnostics.Debug.Assert(null != value, "null value"); 234System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\Int64Storage.cs (3)
175System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 176System.Diagnostics.Debug.Assert(null != value, "null value"); 226System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\ObjectStorage.cs (3)
235Debug.Assert(null != value, "null value"); 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 (2)
284Debug.Assert(constraint != null, "Attempt to add null constraint to constraint array"); 564Debug.Assert(a1 != null && a2 != null, "Invalid Arguments");
System\Data\ConstraintEnumerator.cs (3)
46Debug.Assert(_constraints.Current is Constraint, "ConstraintEnumerator, contains object which is not constraint"); 60Debug.Assert(_currentObject != null, "GetObject should never be called w/ null currentObject."); 78Debug.Assert(CurrentObject != null, "GetObject should never be called w/ null currentObject.");
System\Data\DataColumn.cs (38)
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"); 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"); 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 (2)
548Debug.Assert(col.Computed, "invalid (non an expression) column in the expression dependent columns"); 861Debug.Assert(name != null, "Must specify a name");
System\Data\DataError.cs (4)
40Debug.Assert(column != null, "Invalid (null) argument"); 41Debug.Assert(column.Table != null, "Invalid (loose) column"); 88Debug.Assert(column._errors >= 0, "missing error counts"); 98Debug.Assert(_errorList[i]._column._errors >= 0, "missing error counts");
System\Data\DataException.cs (1)
313Debug.Assert(null != e, "TraceException: null Exception");
System\Data\DataRelation.cs (4)
415Debug.Assert(DataSet == null || !_nested, "this relation supposed to be not in dataset or not nested"); 485Debug.Assert(ChildTable != null, "On a DataSet, but not on Table. Bad state"); 595Debug.Assert(_parentKeyConstraint == null || value == null, "ParentKeyConstraint should not have been set already."); 626Debug.Assert(_childKeyConstraint == null || value == null, "ChildKeyConstraint should not have been set already.");
System\Data\DataRow.cs (15)
340Debug.Assert(!_inChangingEvent, "how are we in a changing event to cancel?"); 341Debug.Assert(-1 != _tempRecord, "how no propsed record to cancel?"); 357Debug.Assert(!_inChangingEvent, "how are we in a changing event to end?"); 512Debug.Assert(!_inChangingEvent, "how are we in a changing event to cancel?"); 513Debug.Assert(-1 != _tempRecord, "how no propsed record to cancel?"); 530Debug.Assert(!_inChangingEvent, "how are we in a changing event to end?"); 608Debug.Assert(-1 != _tempRecord, "missing temp record"); 609Debug.Assert(0 == _countColumnChange, "unexpected column change count"); 610Debug.Assert(null == _lastChangedColumn, "unexpected last column change"); 626Debug.Assert(-1 == _tempRecord, "unexpected temp record"); 1033Debug.Assert(0 != (DataViewRowState.Added & viewState), "not DataViewRowState.Added"); 1038Debug.Assert(_action == DataRowAction.Rollback || 0 != (DataViewRowState.Deleted & viewState), "not DataViewRowState.Deleted"); 1047Debug.Assert(0 != (DataViewRowState.ModifiedOriginal & viewState), "not DataViewRowState.ModifiedOriginal"); 1352Debug.Assert(relation != null, "The relation should not be null here."); 1447Debug.Assert(valueFromStorage.Equals(column.DataExpression.Evaluate(this, version)),
System\Data\DataSet.cs (7)
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");
System\Data\DataTable.cs (55)
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"); 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"); 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"); 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"); 5201Debug.Assert(dataRow._tempRecord == recordNo, "tempRecord has been changed in event handler"); 5537Debug.Assert(tableList != null, "tableList shouldnot be null"); 6830Debug.Assert(_targetTable == null, "do not reuse this section"); 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"); 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"); 7075Debug.Assert(column.Computed, "Only computed columns should be re-evaluated.");
System\Data\DataTableCollection.cs (1)
618Debug.Assert(_list.Count == tableList.Count, "Both lists should have equal numbers of tables");
System\Data\DataTableExtensions.cs (1)
218Debug.Assert(null != table, "null DataTable");
System\Data\DataView.cs (20)
275Debug.Assert(_rowViewCache.Count == CountFromIndex, "DataView.Count mismatch"); 360Debug.Assert(null != predicate, "null predicate"); 367Debug.Assert(DataRowVersion.Default != version, "not expecting Default"); 368Debug.Assert(DataRowVersion.Proposed != version, "not expecting Proposed"); 549Debug.Assert(null == _addNewRow, "AddNew addNewRow is not null"); 784Debug.Assert(null != _addNewRow, "null addNewRow"); 808Debug.Assert(flag, "didn't remove addNewRow"); 1099Debug.Assert(property != null, "property is null"); 1291Debug.Assert(null != row, "MaintainDataView.ItemAdded with null DataRow"); 1298Debug.Assert(flag, "row actually removed"); 1305Debug.Assert(0 <= index, "ItemAdded was actually deleted"); 1320Debug.Assert(null != row, "MaintainDataView.ItemDeleted with null DataRow"); 1321Debug.Assert(row != _addNewRow, "addNewRow being deleted"); 1342Debug.Assert(null == row, "MaintainDataView.Reset with non-null DataRow"); 1376Debug.Assert(((ListChangedType.ItemChanged == e.ListChangedType) && ((e.NewIndex == e.OldIndex) || (-1 == e.OldIndex))) || 1380Debug.Assert(0 <= e.NewIndex, "negative NewIndex"); 1471Debug.Assert(null != drv, "didn't contain addNewRow"); 1474Debug.Assert(rvc.Count == CountFromIndex, "didn't add expected count"); 1535Debug.Assert((0 == (DataViewRowState.ModifiedCurrent & newRowStates)) || 1552Debug.Assert(null == _comparison, "RelatedView should not have a comparison function");
System\Data\DataViewListener.cs (2)
96Debug.Assert(null == _table, "DataViewListener already registered table"); 152Debug.Assert(null == _index, "DataviewListener already registered index");
System\Data\EnumerableRowCollection.cs (2)
76Debug.Assert(!isDataViewable || table != null, "isDataViewable bug table is null"); 104Debug.Assert(null != enumerableRows, "null enumerableRows");
System\Data\Filter\AggregateNode.cs (2)
44Debug.Assert(columnName != null, "Invalid parameter column name (null)."); 207Debug.Assert(DataRowVersion.Original == version, "wrong version");
System\Data\Filter\BinaryNode.cs (2)
1110Debug.Assert((!DataStorage.IsObjectNull(vLeft)) && (!DataStorage.IsObjectNull(vRight)), "Impossible."); 1675Debug.Assert(patchars[length - 1] == '*' || patchars[length - 1] == '%', "Invalid LIKE pattern formed.. ");
System\Data\Filter\DataExpression.cs (2)
94Debug.Assert(_parsed, "Invalid calling order: Bind() before Parse()"); 220Debug.Assert(_dependency != null, "GetDependencies: null, we should have created an empty list");
System\Data\Filter\ExpressionParser.cs (32)
294Debug.Assert(_text[_start] == '\'' && _text[_pos - 1] == '\'', "The expression contains an invalid string constant"); 295Debug.Assert(_pos - _start > 1, "The expression contains an invalid string constant"); 301Debug.Assert(_text[_start] == '#' && _text[_pos - 1] == '#', "The expression contains invalid date constant."); 302Debug.Assert(_pos - _start > 2, "The expression contains invalid date constant '{0}'."); 322Debug.Assert(_topOperator > 0, "Empty operator stack!!"); 393Debug.Assert(_topOperator > 1, "melformed operator stack."); 403Debug.Assert(opInfo._priority == Operators.PriParen, "melformed operator stack."); 415Debug.Assert(_topNode > 0 && NodePeek()!.GetType() == typeof(FunctionNode), "The function node should be created on '('"); 549Debug.Assert(_topNode == 1 || _topNode == 0, "Invalid Node Stack"); 562Debug.Assert(_token == Tokens.LeftParen, "ParseAggregateArgument(): Invalid argument, token <> '('"); 618Debug.Assert(_topNode > 0, "NodePop(): Corrupted node stack"); 620Debug.Assert(null != node, "null NodePop"); 640Debug.Assert(null != node, "null NodePush"); 658Debug.Assert(pri > Operators.PriStart && pri <= Operators.PriMax, "Invalid priority value"); 664Debug.Assert(_topOperator > 0, "Empty operator stack!!"); 670Debug.Assert(opInfo._priority >= pri, "Invalid prioriry value"); 710Debug.Assert(opInfo._op == Operators.Plus || 719Debug.Assert(nodeLeft != null, "Invalid left operand"); 720Debug.Assert(nodeRight != null, "Invalid right operand"); 751Debug.Assert(nodeLeft == null, "Invalid left operand"); 752Debug.Assert(nodeRight != null, "Invalid right operand"); 766Debug.Assert(expr != null, "Failed to create expression"); 992Debug.Assert(_pos != 0, "We have at least one digit in the buffer, ScanNumeric()"); 993Debug.Assert(IsDigit(text[_pos - 1]), "We have at least one digit in the buffer, ScanNumeric(), not a digit"); 1053Debug.Assert(chEnd != '\0', "Invalid bracket value"); 1054Debug.Assert(esc != '\0', "Invalid escape value"); 1072Debug.Assert(text[_pos] == chEnd, "Invalid bracket value"); 1111Debug.Assert(_token == Tokens.Name, "Exprecing an identifier."); 1112Debug.Assert(_pos > _start, "Exprecing an identifier."); 1115Debug.Assert(name != null, "Make sure the arguments for Compare method are OK"); 1125Debug.Assert(s_reservedwords[i]._word != null, "Make sure the arguments for Compare method are OK"); 1145Debug.Assert(_token == Tokens.Name, "Exprecing an identifier.");
System\Data\Filter\FunctionNode.cs (5)
123Debug.Assert(_info < s_funcs.Length && _info >= 0, "Invalid function info."); 127Debug.Assert(_argumentCount == s_funcs[_info]._argumentCount || s_funcs[_info]._isVariantArgumentList, "Invalid argument argumentCount."); 198Debug.Assert(_info > -1, "All function nodes should be bound at this point."); // default info is -1, it means if not bounded, it should be -1, not 0!! 258Debug.Assert(_info > -1, "Optimizing unbound function "); // default info is -1, it means if not bounded, it should be -1, not 0!! 396Debug.Assert(_argumentCount == 2, "Invalid argument argumentCount: ");
System\Data\Filter\LookupNode.cs (2)
58Debug.Assert(_relation != null, "Invalid relation: no parent table."); 59Debug.Assert(_columnName != null, "All Lookup expressions have columnName set.");
System\Data\Filter\ZeroOpNode.cs (2)
21Debug.Assert(op == Operators.True || op == Operators.False || op == Operators.Null, "Invalid zero-op"); 40Debug.Assert(_op == Operators.True || _op == Operators.False || _op == Operators.Null, "Invalid zero-op");
System\Data\ForeignKeyConstraint.cs (1)
759Debug.Assert(Table == RelatedTable, "We call this clone just if we have the same datatable as parent and child ");
System\Data\LinqDataView.cs (2)
39Debug.Assert(table != null, "null DataTable"); 112Debug.Assert(!(!string.IsNullOrEmpty(base.Sort) && base.SortComparison != null),
System\Data\Merger.cs (2)
269Debug.Assert(MissingSchemaAction.Ignore == _missingSchemaAction, "MergeSchema failed"); 522Debug.Assert(MissingSchemaAction.Error == _missingSchemaAction ||
System\Data\ProviderBase\DataReaderContainer.cs (6)
30Debug.Assert(null != dataReader, "null dataReader"); 53Debug.Assert(null != fieldName, "null GetName"); 81Debug.Assert(null != dataReader, "null dbDataReader"); 98Debug.Assert(0 <= fieldCount, "negative FieldCount"); 107Debug.Assert(null != fieldType, "null FieldType"); 139Debug.Assert(0 <= fieldCount, "negative FieldCount");
System\Data\ProviderBase\SchemaMapping.cs (18)
64Debug.Assert(null != adapter, nameof(adapter)); 65Debug.Assert(null != dataReader, nameof(dataReader)); 66Debug.Assert(0 < dataReader.FieldCount, "FieldCount"); 67Debug.Assert(null != dataset || null != datatable, "SchemaMapping - null dataSet"); 68Debug.Assert(SchemaType.Mapped == schemaType || SchemaType.Source == schemaType, "SetupSchema - invalid schemaType"); 284Debug.Assert(_mappedLength == _indexMap!.Length, "incorrect precomputed length"); 299Debug.Assert(_mappedLength == Math.Min(_readerDataValues!.Length, _mappedDataValues!.Length), "incorrect precomputed length"); 363Debug.Assert(0 == _mappedMode, "incorrect mappedMode"); 364Debug.Assert((null == _chapterMap) && (null == _indexMap) && (null == _mappedDataValues), "incorrect MappedValues"); 367Debug.Assert((null == _chapterMap) && (null == _indexMap) && (null != _mappedDataValues), "incorrect MappedValues"); 371Debug.Assert((null == _chapterMap) && (null != _indexMap) && (null != _mappedDataValues), "incorrect MappedValues"); 375Debug.Assert((null != _chapterMap) && (null == _indexMap) && (null != _mappedDataValues), "incorrect MappedValues"); 379Debug.Assert((null != _chapterMap) && (null != _indexMap) && (null != _mappedDataValues), "incorrect MappedValues"); 472Debug.Assert(null != _dataSet, "if chapters, then Fill(DataSet,...) not Fill(DataTable,...)"); 523Debug.Assert(rgcol != null, "invalid call to ResizeArray"); 524Debug.Assert(len <= rgcol.Length, "invalid len passed to ResizeArray"); 769Debug.Assert(null != schemaRows, "SchemaSetup - null DbSchemaRow[]"); 770Debug.Assert(_dataReader.FieldCount <= schemaRows.Length, "unexpected fewer rows in Schema than FieldCount");
System\Data\RbTree.cs (30)
321Debug.Assert(_inUseNodeCount - 1 == SubTreeSize(root), "count mismatch"); 371Debug.Assert(page._slots[slotId]._leftId == NIL, "node not cleared"); 372Debug.Assert(page._slots[slotId]._rightId == NIL, "node not cleared"); 373Debug.Assert(page._slots[slotId]._parentId == NIL, "node not cleared"); 374Debug.Assert(page._slots[slotId]._nextId == NIL, "node not cleared"); 377Debug.Assert(page._slots[slotId]._nodeColor == NodeColor.red, "node not cleared"); 550Debug.Assert(NIL != x_id, "nil left"); 551Debug.Assert(NIL != z_id, "nil right"); 580Debug.Assert(-1 == position, "KEY_SEARCH_AND_INDEX with bad position"); 591Debug.Assert((NIL == Left(z_id)) || (0 > Compare(root_id, Left(z_id), z_id)), "Left is not left"); 598Debug.Assert((NIL == Right(z_id)) || (0 < Compare(root_id, Right(z_id), z_id)), "Right is not right"); 841Debug.Assert(_accessMethod == TreeAccessMethod.INDEX_ONLY, "not expecting anything else"); 1229Debug.Assert((NIL == Left(x_id)) || (0 > Compare(root_id, Left(x_id), x_id)), "Search duplicate Left is not left"); 1236Debug.Assert((NIL == Right(x_id)) || (0 < Compare(root_id, Right(x_id), x_id)), "Search duplicate Right is not right"); 1259Debug.Assert((NIL == Left(x_id)) || (0 > Compare(NIL, Left(x_id), x_id)), "Search Left is not left"); 1266Debug.Assert((NIL == Right(x_id)) || (0 < Compare(NIL, Right(x_id), x_id)), "Search Right is not right"); 1347Debug.Assert(NIL != node, "GetIndexByNode(NIL)"); 1513Debug.Assert(NIL == Next(x_id), "has unexpected satellite tree"); 1698Debug.Assert(nodeId != NIL, " in SetParent nodeId == NIL"); 1709Debug.Assert(nodeId != NIL, " in SetColor nodeId == NIL"); 1740Debug.Assert(nodeId != NIL && 1786Debug.Assert(myCorrectSize == size, "VerifySize"); 1907Debug.Assert(null != tree, "null tree"); 1908Debug.Assert((NIL == _nodeID && NIL == _mainTreeNodeID) || (NIL != _nodeID), "MainTreeNodeID is not NIL"); 1912Debug.Assert(NIL != tree.Next(_mainTreeNodeID), "MainTreeNodeID should have a Next"); 1918Debug.Assert(tree.root == node, "MainTreeNodeID parent change doesn't align"); 1922Debug.Assert(NIL == tree.Next(_nodeID), "NodeID should not have a Next"); 1935Debug.Assert(NIL == tree.Next(node), "duplicate node should not have a next"); 1939Debug.Assert((NIL == _mainTreeNodeID && tree.root == node) || 1989Debug.Assert((_slotMap[segmentPos] & freeSlot) == 0, "Slot position segment[segmentPos ]: [freeSlot] is in use. Expected to be empty");
System\Data\RecordManager.cs (9)
115Debug.Assert(record >= 0 && record < _recordCapacity, "NewRecord: Invalid record"); 121Debug.Assert(-1 <= record && record < _recordCapacity, "invalid record"); 185Debug.Assert(record >= 0 && record < _rows.Length, "Invalid record number"); 190Debug.Assert(record >= 0 && record < _rows.Length, "Invalid record number"); 212Debug.Assert(src != null, "Can not Merge record without a table"); 270Debug.Assert((record < _lastFreeRecord) && (-1 == _freeRecordList.IndexOf(record)), "accessing free record"); 272Debug.Assert((null == r) || 281Debug.Assert((record < _lastFreeRecord) && (-1 == _freeRecordList.IndexOf(record)), "accessing free record"); 282Debug.Assert((null == _rows[record]) || (row == _rows[record]), "record of a different row");
System\Data\RelatedView.cs (2)
27Debug.Assert(Table == _childKey.Table, "Key.Table Must be equal to Current Table"); 37Debug.Assert(Table == _childKey.Table, "Key.Table Must be equal to Current Table");
System\Data\Select.cs (8)
480Debug.Assert(_matchedCandidates > 0 && _matchedCandidates <= lenId, "BuildLinearExpression : Invalid Index"); 484Debug.Assert(canColumn != null && canColumn.expr != null, "BuildLinearExpression : Must be a matched candidate"); 563Debug.Assert(!needSorting, "What are we doing here if no real reuse of this index ?"); 707default: Debug.Assert(true, "Unsupported Binary Search Operator!"); break; 739Debug.Assert(candidateColumn != null, "How come this is not a candidate column"); 740Debug.Assert(candidateColumn.expr != null, "How come there is no associated expression"); 793Debug.Assert(_matchedCandidates <= _index._indexFields.Length, "GetBinaryFilteredRecords : Invalid Index"); 800Debug.Assert(lo <= hi, "GetBinaryFilteredRecords : Invalid Search Results");
System\Data\Selection.cs (26)
19Debug.Assert(column != null, "null column"); 114Debug.Assert(null != table, "null table"); 175Debug.Assert(recordIndex >= 0 && recordIndex < _recordCount, "recordIndex out of range"); 233Debug.Assert(0 <= _refCount, "AddRef on disposed index"); 234Debug.Assert(null != _records, "null records"); 298Debug.Assert(_records.CheckUnique(_records.root) != HasDuplicates, "CheckUnique difference"); 326Debug.Assert(null != row1, "record1 no datarow"); 327Debug.Assert(null != row2, "record2 no datarow"); 350Debug.Assert(0 == CompareDataRows(record1, record2), "duplicate record not a duplicate by user function"); 357Debug.Assert(0 == c, "duplicate record not a duplicate"); 362Debug.Assert(null != row1, "record1 no datarow"); 363Debug.Assert(null != row2, "record2 no datarow"); 448Debug.Assert(null != _comparison, "missing comparison"); 475Debug.Assert(record == row._newRecord, "newRecord has change during GetIndex"); 479Debug.Assert(record == row._oldRecord, "oldRecord has change during GetIndex"); 859Debug.Assert(DoListChanged, "supposed to check DoListChanged before calling to delay create ListChangedEventArgs"); 870Debug.Assert(-1 <= record, "bad record#"); 942Debug.Assert((-1 == oldRecord) || (-1 == newRecord) || 1073Debug.Assert(null != listener, "null listener"); 1074Debug.Assert(!Index.ContainsReference(_listeners, listener), "already contains reference"); 1086Debug.Assert(null != listener, "null listener"); 1089Debug.Assert(0 <= index, "listeners don't contain listener"); 1104Debug.Assert(null != action, "no action"); 1105Debug.Assert(0 <= _listenerReaderCount, "negative _listEventCount"); 1147Debug.Assert((-1 == nullIndex) || (null == _listeners[nullIndex]), "non-null listener"); 1148Debug.Assert(0 == _listenerReaderCount, "0 < _listenerReaderCount");
System\Data\SQLTypes\SQLDecimal.cs (4)
409Debug.Assert((precision == MaxPrecision + 1) || VerifyPrecision(precision), "Calcualted precision too low?"); 410Debug.Assert((precision == 1) || !VerifyPrecision((byte)(precision - 1)), "Calculated precision too high?"); 433Debug.Assert(precision > 0, "Precision cannot be less than 1"); 434Debug.Assert(precision <= MaxPrecision, "Precision > MaxPrecision");
System\Data\SQLTypes\SqlXml.cs (3)
89Debug.Assert(_createSqlReaderMethodInfo != null, "MethodInfo reference for XmlReader.CreateSqlReader should not be null."); 120Debug.Assert(CreateSqlReaderMethodInfo != null, "MethodInfo reference for XmlReader.CreateSqlReader should not be null."); 283Debug.Assert(_stream != null, "stream can not be null");
System\Data\UniqueConstraint.cs (3)
139Debug.Assert(null != _constraintIndex, "null UniqueConstraint index"); 148Debug.Assert(DataKey.ColumnsEqual(_key.ColumnsReference, sortIndexColumns), "UniqueConstraint index columns do not match the key sort index"); 189Debug.Assert(constraints.Table._primaryKey == this, "If the primary key and this are 'Equal', they should also be '=='");
System\Data\XDRSchema.cs (5)
40Debug.Assert(FEqualIdentity(schemaRoot, Keywords.XDR_SCHEMA, Keywords.XDRNS), "Illegal node"); 74Debug.Assert(FEqualIdentity(node, Keywords.XDR_ELEMENT, Keywords.XDRNS) || 184Debug.Assert(FEqualIdentity(node, Keywords.XDR_ELEMENTTYPE, Keywords.XDRNS) || 275Debug.Assert((s_mapNameTypeXdr[i - 1].CompareTo(s_mapNameTypeXdr[i].name)) < 0, "incorrect sorting"); 345Debug.Assert(FEqualIdentity(node, Keywords.XDR_ELEMENT, Keywords.XDRNS) ||
System\Data\XmlDataLoader.cs (5)
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 (4)
799Debug.Assert(nodeApp != null, "Need to create <application..> node first."); 1431Debug.Assert(col.ColumnMapping != MappingType.SimpleContent, "Illegal state"); 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 (1)
849Debug.Assert(state == ElementState.Defoliated, "Region is accessed using column, but it's state is FOLIATED");
System\Xml\XmlDataDocument.cs (1)
3080Debug.Assert(tableList[readPos] != null, "Temp Array is not supposed to reach to null");
System.Data.Odbc (194)
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 (13)
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");
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 (16)
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"); 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 (4)
110Debug.Assert(_pooledCount <= 1 && _pooledCount >= -1, "Pooled count for object is invalid"); 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\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");
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 (20)
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"); 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"); 2324Debug.Assert(buffer.Length >= 264, "Native buffer to small (_buffer.Length < 264)"); 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");
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\OdbcParameter.cs (4)
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"); 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 (5)
src\libraries\Common\src\System\HexConverter.cs (2)
337Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 338Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Diagnostics\DiagnosticListener.cs (1)
301Debug.Assert(!(cur.Observer == Observer && cur.IsEnabled1Arg == IsEnabled1Arg && cur.IsEnabled3Arg == IsEnabled3Arg), "Did not remove subscription!");
System\Diagnostics\DsesFilterAndTransform.cs (1)
724Debug.Assert(type != null, "Type should only be null for the well-known static fetchers already checked");
System.Diagnostics.Process (18)
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.TryReadStatusFile.cs (1)
61Debug.Assert(!b || (ProcPid)result.Pid == pid || pid == ProcPid.Self, "Expected process ID from status file to match supplied pid");
src\libraries\Common\src\System\IO\StringParser.cs (5)
177Debug.Assert(result == int.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 222Debug.Assert(result == long.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 253Debug.Assert(result == uint.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 280Debug.Assert(result == ulong.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 295Debug.Assert(result == char.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Diagnostics\AsyncStreamReader.cs (2)
50Debug.Assert(stream != null && encoding != null && callback != null, "Invalid arguments!"); 51Debug.Assert(stream.CanRead, "Stream must be readable!");
System\Diagnostics\Process.cs (1)
781Debug.Assert(waitHandleContext != null, "Process.CompletionCallback called with no waitHandleContext");
System\Diagnostics\Process.Unix.cs (4)
161Debug.Assert(_haveProcessId, $"{nameof(ConfigureAfterProcessIdSet)} should only be called once a process ID is set"); 180Debug.Assert(Associated, "Process.EnsureWatchingForExit called with no associated process"); 294Debug.Assert(value == ProcessPriorityClass.Normal, "Input should have been validated by caller"); 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 (1)
23Debug.Assert(processNameFilter is null, "Not used on Linux");
System\Diagnostics\ProcessStartInfo.cs (1)
105Debug.Assert(!(e is IDisposable), "Environment.GetEnvironmentVariables should not be IDisposable.");
System.Diagnostics.TextWriterTraceListener (1)
System\Diagnostics\XmlWriterTraceListener.cs (1)
392Debug.Assert(typeof(T) == typeof(int) || typeof(T) == typeof(uint) || typeof(T) == typeof(long), "We only currently stackalloc enough space for these types.");
System.Diagnostics.TraceSource (1)
System\Diagnostics\Switch.cs (1)
172Debug.Assert(switchValueString is not null, "Unexpected 'switchValueString' null value");
System.Formats.Asn1 (3)
System\Formats\Asn1\AsnWriter.BitString.cs (1)
193Debug.Assert(_buffer == ensureNoExtraCopy, $"_buffer was replaced during {nameof(WriteConstructedCerBitString)}");
System\Formats\Asn1\AsnWriter.GeneralizedTime.cs (1)
65Debug.Assert(normalized.Year <= 9999, "DateTimeOffset guards against this internally");
System\Formats\Asn1\AsnWriter.OctetString.cs (1)
166Debug.Assert(_buffer == ensureNoExtraCopy, $"_buffer was replaced during {nameof(WriteConstructedCerOctetString)}");
System.Formats.Cbor (6)
System\Formats\Cbor\CborInitialByte.cs (2)
47Debug.Assert((byte)majorType < 8, "CBOR Major Type is out of range"); 48Debug.Assert((byte)additionalInfo < 32, "CBOR initial byte additional info is out of range");
System\Formats\Cbor\Reader\CborReader.cs (3)
381Debug.Assert(restoreHeight >= 0, "Attempting to restore checkpoint outside of its original context."); 388Debug.Assert(_nestedDataItems.ToArray()[restoreHeight - 1].FrameOffset == checkpoint.FrameOffset, 403Debug.Assert(checkpoint.FrameOffset == _frameOffset, "Attempting to restore checkpoint outside of its original context.");
System\Formats\Cbor\Writer\CborWriter.Tag.cs (1)
166Debug.Assert((flags & ScaleMask) == 0, "mantissa argument should be integral.");
System.Formats.Nrbf (12)
System\Formats\Nrbf\ArrayRecord.cs (3)
131Debug.Assert(incrementCount == 1, "IncrementCount other than 1 is allowed only for null records."); 161Debug.Assert(numElementsWritten == (uint)source.Count, "We should have traversed the entirety of the source records collection."); 162Debug.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\JaggedArrayRecord.cs (1)
36Debug.Assert(TypeName.GetElementType().IsArray, "Jagged arrays are required.");
System\Formats\Nrbf\RectangularArrayRecord.cs (1)
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.Tar (6)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Formats\Tar\TarEntry.cs (1)
398Debug.Assert(PathInternal.EndsInDirectorySeparator(destinationDirectoryFullPath), "caller must ensure the path ends with a separator.");
System\Formats\Tar\TarHeader.Write.cs (2)
1066Debug.Assert(destination.Length == 8, "8 byte field expected."); 1091Debug.Assert(destination.Length == 12, "12 byte field expected.");
System\Formats\Tar\TarWriter.cs (1)
310Debug.Assert(entry.Format == TarEntryFormat.Unknown, "Missing format handler");
System.IO.Compression (23)
System\IO\Compression\DeflateManaged\DeflateManagedStream.cs (1)
121Debug.Assert(_inflater.AvailableOutput == 0, "We should have copied all stuff out!");
System\IO\Compression\DeflateManaged\HuffmanTree.cs (3)
48Debug.Assert( 102Debug.Assert(length > 0 && length <= 16, "Invalid len"); 236Debug.Assert(value < 0, "CreateTable: Only negative numbers are used for tree pointers!");
System\IO\Compression\DeflateManaged\InflaterManaged.cs (1)
396Debug.Assert(_extraBits != 0, "We handle other cases separately!");
System\IO\Compression\DeflateManaged\InputBuffer.cs (3)
35Debug.Assert(0 < count && count <= 16, "count is invalid."); 110Debug.Assert(0 < count && count <= 16, "count is invalid."); 213Debug.Assert(_bitsInBuffer >= n, "No enough bits in the buffer, Did you call EnsureBitsAvailable?");
System\IO\Compression\DeflateManaged\OutputWindow.cs (3)
35Debug.Assert(_bytesUsed < WindowSize, "Can't add byte when window is full!"); 43Debug.Assert((_bytesUsed + length) <= WindowSize, "No Enough space"); 148Debug.Assert(_bytesUsed >= 0, "check this function and find why we copied more bytes than we have");
System\IO\Compression\DeflateZLib\Deflater.cs (9)
91Debug.Assert(NeedsInput(), "We have something left in previous input!"); 105Debug.Assert(NeedsInput(), "We have something left in previous input!"); 118Debug.Assert(null != outputBuffer, "Can't pass in a null output buffer!"); 119Debug.Assert(!NeedsInput(), "GetDeflateOutput should only be called after providing input"); 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\Inflater.cs (3)
68Debug.Assert(null != bytes, "Can't pass in a null output buffer!"); 185Debug.Assert(NeedsInput(), "We have something left in previous input!"); 195Debug.Assert(NeedsInput(), "We have something left in previous input!");
System.IO.Compression.ZipFile (1)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
System.IO.FileSystem.DriveInfo (1)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
System.IO.FileSystem.Watcher (4)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\IO\FileSystemWatcher.cs (2)
69Debug.Assert(c_notifyFiltersValidMask == s_notifyFiltersValidMask, "The NotifyFilters enum has changed. The c_notifyFiltersValidMask must be updated to reflect the values of the NotifyFilters enum."); 593Debug.Assert(EnableRaisingEvents, "Expected EnableRaisingEvents to be true");
System.IO.Hashing (4)
System\IO\Hashing\Crc32.Arm.cs (2)
15Debug.Assert(ArmCrc.Arm64.IsSupported, "ARM CRC support is required."); 43Debug.Assert(ArmCrc.IsSupported, "ARM CRC support is required.");
System\IO\Hashing\Crc32.Vectorized.cs (1)
34Debug.Assert(CanBeVectorized(source), "source cannot be vectorized.");
System\IO\Hashing\Crc64.Vectorized.cs (1)
48Debug.Assert(CanBeVectorized(source), "source cannot be vectorized.");
System.IO.IsolatedStorage (3)
src\libraries\Common\src\System\Security\IdentityHelper.cs (2)
79Debug.Assert(((buff.Length % 5) == 0), "Unexpected hash length"); 119Debug.Assert(((b2 & 0xF8) == 0), "Unexpected set bits");
System\IO\IsolatedStorage\IsolatedStorageFile.cs (1)
541Debug.Assert(partialPath != null, "partialPath should be non null");
System.IO.MemoryMappedFiles (4)
Microsoft\Win32\SafeMemoryMappedFileHandle.Unix.cs (1)
44Debug.Assert(!ownsFileHandle || fileHandle != null, "We can only own a FileStream we're actually given.");
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
System\IO\MemoryMappedFiles\MemoryMappedViewAccessor.cs (1)
15Debug.Assert(view != null, "view is null");
System\IO\MemoryMappedFiles\MemoryMappedViewStream.cs (1)
15Debug.Assert(view != null, "view is null");
System.IO.Packaging (34)
System\IO\Packaging\InterleavedZipPackagePartStream.PieceDirectory.cs (1)
192Debug.Assert(pieceNumber <= _lastPieceIndex, "We should have found the valid pieceNumber earlier");
System\IO\Packaging\InternalRelationshipCollection.cs (5)
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"); 559Debug.Assert(!target.IsAbsoluteUri, "Uri should be relative at this stage");
System\IO\Packaging\Package.cs (2)
401Debug.Assert((parts != null), 987Debug.Assert(index >= 0, "Given uri must be present in the dictionary");
System\IO\Packaging\PackagePart.cs (2)
588Debug.Assert(_deleted != true, "PackagePart.Flush should never be called on a deleted part"); 656Debug.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)
149Debug.Assert((targetMode == TargetMode.External || !targetUri.IsAbsoluteUri), 153Debug.Assert((targetMode >= TargetMode.Internal || targetMode <= TargetMode.External), 157Debug.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 (2)
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 (7)
232Debug.Assert((partName.Length - file.Length) > 0, 291Debug.Assert((path.Length - partNameWithoutExtension.Length - RelationshipPartExtensionName.Length - 1) > 0, 297Debug.Assert((path.Length - RelationshipPartSegmentName.Length) > 0, 387Debug.Assert(partUri != null, "Null reference check for this uri parameter should have been made earlier"); 552Debug.Assert(partUri != null, "Null reference check for this uri parameter should have been made earlier"); 553Debug.Assert(!(partUri is ValidatedPartUri), "This method should only be called when we have not already validated the part uri"); 587Debug.Assert(partName != null, "Null reference check for this partName parameter should have been made earlier");
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\ZipPackage.cs (5)
502Debug.Assert(zipItemName != null, "The parameter zipItemName should not be 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 (9)
System\IO\Pipelines\Pipe.cs (6)
280Debug.Assert(segment != _readHead, "Returning _readHead segment that's in use!"); 281Debug.Assert(segment != _readTail, "Returning _readTail segment that's in use!"); 282Debug.Assert(segment != _writingHead, "Returning _writingHead segment that's in use!"); 497Debug.Assert(_unconsumedBytes >= 0, "Length has gone negative"); 498Debug.Assert(ResumeWriterThreshold >= 1, "ResumeWriterThreshold is less than 1"); 570Debug.Assert(_writerAwaitable.IsCompleted, "PipeWriter.FlushAsync isn't completed and will deadlock");
System\IO\Pipelines\PipeAwaitable.cs (1)
63Debug.Assert(previousAwaitableState == _awaitableState, "The awaitable state changed!");
System\IO\Pipelines\StreamPipeReader.cs (2)
555Debug.Assert(segment != _readHead, "Returning _readHead segment that's in use!"); 556Debug.Assert(segment != _readTail, "Returning _readTail segment that's in use!");
System.IO.Pipes (15)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
System\IO\Pipes\AnonymousPipeClientStream.cs (2)
65Debug.Assert(direction != PipeDirection.InOut, "anonymous pipes are unidirectional, caller should have verified before calling Init"); 66Debug.Assert(safePipeHandle != null && !safePipeHandle.IsInvalid, "safePipeHandle must be valid");
System\IO\Pipes\AnonymousPipeServerStream.Unix.cs (1)
17Debug.Assert(direction != PipeDirection.InOut, "Anonymous pipe direction shouldn't be InOut");
System\IO\Pipes\NamedPipeServerStream.Unix.cs (6)
28Debug.Assert(!string.IsNullOrEmpty(pipeName), "fullPipeName is null or empty"); 29Debug.Assert(direction >= PipeDirection.In && direction <= PipeDirection.InOut, "invalid pipe direction"); 30Debug.Assert(inBufferSize >= 0, "inBufferSize is negative"); 31Debug.Assert(outBufferSize >= 0, "outBufferSize is negative"); 32Debug.Assert((maxNumberOfServerInstances >= 1) || (maxNumberOfServerInstances == MaxAllowedServerInstances), "maxNumberOfServerInstances is invalid"); 33Debug.Assert(transmissionMode >= PipeTransmissionMode.Byte && transmissionMode <= PipeTransmissionMode.Message, "transmissionMode is out of range");
System\IO\Pipes\PipeStream.cs (5)
59Debug.Assert(direction >= PipeDirection.In && direction <= PipeDirection.InOut, "invalid pipe direction"); 60Debug.Assert(transmissionMode >= PipeTransmissionMode.Byte && transmissionMode <= PipeTransmissionMode.Message, "transmissionMode is out of range"); 61Debug.Assert(outBufferSize >= 0, "outBufferSize is negative"); 107Debug.Assert(handle != null, "handle is null"); 108Debug.Assert(!handle.IsClosed, "handle is closed");
System.IO.Ports (18)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
System\IO\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 (4)
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");
System.Linq (10)
System\Linq\Grouping.cs (1)
391Debug.Assert(_count > 0, "A grouping should only have been created if an element was being added to it.");
System\Linq\Lookup.cs (1)
173Debug.Assert(index == _count, "All list elements were not initialized.");
System\Linq\OrderedEnumerable.SpeedOpt.cs (1)
389Debug.Assert(TypeIsImplicitlyStable<TElement>(), "Using Min/Max has different semantics for floating-point values.");
System\Linq\Select.SpeedOpt.cs (1)
754Debug.Assert(index == results.Length, "All list elements were not initialized.");
System\Linq\SkipTake.SpeedOpt.cs (6)
213Debug.Assert(!(source is IList<TSource>), $"The caller needs to check for {nameof(IList<TSource>)}."); 219Debug.Assert(maxIndexInclusive == -1 || (maxIndexInclusive - minIndexInclusive < int.MaxValue), $"{nameof(Limit)} will overflow!"); 272Debug.Assert(count != (uint)int.MaxValue + 1 || _minIndexInclusive > 0, "Our return value will be incorrect."); 347Debug.Assert(minIndex >= 0, $"We should have taken care of all cases when {nameof(minIndex)} overflows."); 375Debug.Assert(maxIndex >= 0, $"We should have taken care of all cases when {nameof(maxIndex)} overflows."); 384Debug.Assert(_minIndexInclusive + index >= 0, $"Adding {nameof(index)} caused {nameof(_minIndexInclusive)} to overflow.");
System.Linq.AsyncEnumerable (1)
System\Linq\GroupBy.cs (1)
402Debug.Assert(_count > 0, "A grouping should only have been created if an element was being added to it.");
System.Linq.Expressions (36)
System\Dynamic\DynamicMetaObject.cs (1)
264Debug.Assert(expr != null, "Unexpected null expression; ctor should have caught this.");
System\Dynamic\DynamicObject.cs (1)
835Debug.Assert(Restrictions == BindingRestrictions.Empty, "We don't merge, restrictions are always empty");
System\Dynamic\ExpandoObject.cs (1)
1010Debug.Assert(Restrictions == BindingRestrictions.Empty, "We don't merge, restrictions are always empty");
System\Dynamic\Utils\ContractUtils.cs (1)
125Debug.Assert(Monitor.IsEntered(lockObject), "Expected lock is not held.");
System\Dynamic\Utils\TypeUtils.cs (1)
27Debug.Assert(type != null, "type cannot be null");
System\Linq\Expressions\Compiler\LambdaCompiler.cs (2)
256Debug.Assert(_hasClosureArgument, "must have a Closure argument"); 257Debug.Assert(_method.IsStatic, "must be a static method");
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (2)
635Debug.Assert(node.ArgumentCount == 0, "Node with arguments must have a constructor."); 636Debug.Assert(node.Type.IsValueType, "Only value type may have constructor not set.");
System\Linq\Expressions\Compiler\LambdaCompiler.Logical.cs (2)
284Debug.Assert(opFalse != null, "factory should check that the method exists"); 390Debug.Assert(opTrue != null, "factory should check that the method exists");
System\Linq\Expressions\Compiler\StackSpiller.cs (6)
136Debug.Assert((result.Action == RewriteAction.None) ^ (node != result.Node), "rewrite action does not match node object identity"); 139Debug.Assert(result.Node.NodeType != ExpressionType.Extension, "extension nodes must be rewritten"); 142Debug.Assert( 150Debug.Assert( 605Debug.Assert(node.NodeType != ExpressionType.Quote, "unexpected Quote"); 606Debug.Assert(node.NodeType != ExpressionType.Throw, "unexpected Throw");
System\Linq\Expressions\Interpreter\ControlFlowInstructions.cs (8)
267Debug.Assert(_tryHandler == null && tryHandler != null, "the tryHandler can be set only once"); 293Debug.Assert(_tryHandler != null, "the tryHandler must be set already"); 319Debug.Assert(instructions[index] is GotoInstruction, "should be the 'Goto' instruction that jumps out the try/catch/finally"); 353Debug.Assert(instructions[index] is GotoInstruction, "should be the 'Goto' instruction that jumps out the try/catch/finally"); 378Debug.Assert(!isFromJump || (isFromJump && _tryHandler.FinallyStartIndex == frame.InstructionIndex), "we should already jump to the first instruction of the finally"); 416Debug.Assert(_tryHandler == null, "the tryHandler can be set only once"); 422Debug.Assert(_tryHandler != null, "the tryHandler must be set already"); 451Debug.Assert(instructions[index] is GotoInstruction, "should be the 'Goto' instruction that jumps out the try/fault");
System\Linq\Expressions\Interpreter\InstructionList.cs (1)
194Debug.Assert(instruction.ConsumedStack >= 0 && instruction.ProducedStack >= 0 &&
System\Linq\Expressions\Interpreter\InterpretedFrame.cs (1)
255Debug.Assert(!gotoExceptionHandler || (gotoExceptionHandler && _continuationIndex == target.ContinuationStackDepth),
System\Linq\Expressions\Interpreter\LightCompiler.cs (2)
86Debug.Assert(handlers != null, "catch blocks should exist"); 1360Debug.Assert(opTrue != null, "factory should check that the method exists");
System\Linq\Expressions\Interpreter\LocalAccess.cs (2)
377Debug.Assert(type.IsValueType, "MutableValue only supports value types."); 416Debug.Assert(type.IsValueType, "MutableBox only supports value types.");
System\Linq\Expressions\Interpreter\TypeOperations.cs (1)
153Debug.Assert(mi.ReturnType.IsValueType, "Nullable is only allowed on value types.");
System\Linq\Expressions\TypeBinaryExpression.cs (1)
77Debug.Assert(TypeUtils.AreReferenceAssignable(typeof(object), Expression.Type), "Expecting reference types only after this point.");
System\Runtime\CompilerServices\CallSite.cs (3)
135Debug.Assert(s_cachedNoMatch != null, "all normal sites should have Update cached once there is an instance."); 140Debug.Assert(s_cachedUpdate != null, "all normal sites should have Update cached once there is an instance."); 191Debug.Assert(matchmaker?._match != false, "cached site should be set up for matchmaking");
System.Linq.Parallel (147)
System\Linq\Parallel\Channels\AsynchronousChannel.cs (10)
118Debug.Assert(chunkSize > 0, "chunk size must be greater than 0"); 119Debug.Assert(capacity > 1, "this impl doesn't support capacity of 1 or 0"); 290Debug.Assert(!_done, "can't continue producing after the production is over"); 294Debug.Assert(!IsFull, "expected a non-full buffer"); 418Debug.Assert(_consumerChunk != null, "consumer chunk is null"); 419Debug.Assert(0 <= _consumerChunkIndex && _consumerChunkIndex < _consumerChunk.Length, "chunk index out of bounds"); 496Debug.Assert(_consumerChunk != null, "consumer chunk is null"); 497Debug.Assert(0 <= _consumerChunkIndex && _consumerChunkIndex < _consumerChunk.Length, "chunk index out of bounds"); 587Debug.Assert(!IsChunkBufferEmpty, "single-consumer should never witness an empty queue here"); 663Debug.Assert(_done, "Expected channel to be done before disposing");
System\Linq\Parallel\Channels\SynchronousChannel.cs (3)
69Debug.Assert(!_done, "trying to enqueue into the queue after production is done"); 91Debug.Assert(_done, "trying to dequeue before production is done -- this is not safe"); 119Debug.Assert(_done, "Can only copy from the channel after it's done being added to");
System\Linq\Parallel\Enumerables\AggregationMinMaxHelpers.cs (2)
101Debug.Assert(default(T) != null || element.Second != null, "nulls unexpected in final reduce"); 118Debug.Assert(accumulator.First || default(T) == null,
System\Linq\Parallel\Enumerables\ParallelEnumerableWrapper.cs (1)
69Debug.Assert(wrappedEnumerable != null, "wrappedEnumerable must not be null.");
System\Linq\Parallel\Enumerables\RepeatEnumerable.cs (1)
33Debug.Assert(count >= 0, "count not within range (must be >= 0)");
System\Linq\Parallel\Merging\AsynchronousChannelMergeEnumerator.cs (3)
153Debug.Assert(dequeueResult, "channel isn't empty, yet the dequeue failed, hmm"); 165Debug.Assert(_channels[currChannelIndex].IsDone, "thought this channel was done"); 166Debug.Assert(_channels[currChannelIndex].IsChunkBufferEmpty, "thought this channel was empty");
System\Linq\Parallel\Merging\DefaultMergeHelper.cs (1)
88Debug.Assert(_channelEnumerator != null, "enumerator can't be null if we're not ignoring output");
System\Linq\Parallel\Merging\MergeExecutor.cs (1)
55Debug.Assert(!ignoreOutput || options == ParallelMergeOptions.FullyBuffered, "Pipelining with no output is not supported.");
System\Linq\Parallel\Merging\OrderPreservingPipeliningMergeHelper.cs (1)
421Debug.Assert(buffer.Count > 0, "Producer's buffer should not be empty here.");
System\Linq\Parallel\Partitioning\HashRepartitionEnumerator.cs (3)
74Debug.Assert(valueExchangeMatrix.GetLength(0) == partitionCount, "expected square matrix of buffers (NxN)"); 75Debug.Assert(partitionCount > 0 && valueExchangeMatrix[0].Length == partitionCount, "expected square matrix of buffers (NxN)"); 229Debug.Assert(0 <= destinationIndex && destinationIndex < _partitionCount,
System\Linq\Parallel\Partitioning\OrderedHashRepartitionEnumerator.cs (4)
76Debug.Assert(valueExchangeMatrix.GetLength(0) == partitionCount, "expected square matrix of buffers (NxN)"); 77Debug.Assert(partitionCount > 0 && valueExchangeMatrix[0].Length == partitionCount, "expected square matrix of buffers (NxN)"); 151Debug.Assert(mutables._currentKeyBuffer != null, "expected same # of buffers/key-buffers"); 236Debug.Assert(0 <= destinationIndex && destinationIndex < _partitionCount,
System\Linq\Parallel\Partitioning\PartitionedDataSource.cs (20)
238Debug.Assert(data != null, "data mustn't be null"); 239Debug.Assert(partitionCount > 0, "partitionCount must be positive"); 240Debug.Assert(partitionIndex >= 0, "partitionIndex can't be negative"); 241Debug.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount"); 242Debug.Assert(maxChunkSize > 0, "maxChunkSize must be positive or -1"); 340Debug.Assert(data != null, "data must not be null"); 341Debug.Assert(partitionCount > 0, "partitionCount must be positive"); 342Debug.Assert(partitionIndex >= 0, "partitionIndex can't be negative"); 343Debug.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount"); 360Debug.Assert(_currentIndex == null, "Expected deferred allocation to ensure it happens on correct thread"); 409Debug.Assert(data != null, "data must not be null"); 410Debug.Assert(partitionCount > 0, "partitionCount must be positive"); 411Debug.Assert(partitionIndex >= 0, "partitionIndex can't be negative"); 412Debug.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount"); 413Debug.Assert(maxChunkSize > 0, "maxChunkSize must be positive or -1"); 511Debug.Assert(data != null, "data must not be null"); 512Debug.Assert(partitionCount > 0, "partitionCount must be positive"); 513Debug.Assert(partitionIndex >= 0, "partitionIndex can't be negative"); 514Debug.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount"); 531Debug.Assert(_currentIndex == null, "Expected deferred allocation to ensure it happens on correct thread");
System\Linq\Parallel\Partitioning\PartitionedStream.cs (2)
58Debug.Assert(0 <= index && index < _partitions.Length, "index out of bounds"); 65Debug.Assert(0 <= index && index < _partitions.Length, "index out of bounds");
System\Linq\Parallel\QueryOperators\AssociativeAggregationOperator.cs (8)
78Debug.Assert(child != null, "child data source cannot be null"); 79Debug.Assert(intermediateReduce != null, "need an intermediate reduce function"); 80Debug.Assert(finalReduce != null, "need a final reduce function"); 81Debug.Assert(resultSelector != null, "need a result selector function"); 82Debug.Assert(options.IsValidQueryAggregationOption(), "enum out of valid range"); 83Debug.Assert((options & QueryAggregationOptions.Associative) == QueryAggregationOptions.Associative, "expected an associative operator"); 84Debug.Assert(typeof(TIntermediate) == typeof(TInput) || seedIsSpecified, "seed must be specified if TIntermediate differs from TInput"); 262Debug.Assert(_reduceOperator._intermediateReduce != null, "expected a compiled operator");
System\Linq\Parallel\QueryOperators\Binary\ConcatQueryOperator.cs (2)
42Debug.Assert(firstChild != null, "first child data source cannot be null"); 43Debug.Assert(secondChild != null, "second child data source cannot be null");
System\Linq\Parallel\QueryOperators\Binary\ExceptQueryOperator.cs (1)
34Debug.Assert(left != null && right != null, "child data sources cannot be null");
System\Linq\Parallel\QueryOperators\Binary\GroupJoinQueryOperator.cs (4)
44Debug.Assert(left != null && right != null, "child data sources cannot be null"); 45Debug.Assert(leftKeySelector != null, "left key selector must not be null"); 46Debug.Assert(rightKeySelector != null, "right key selector must not be null"); 47Debug.Assert(resultSelector != null, "need a result selector function");
System\Linq\Parallel\QueryOperators\Binary\HashJoinQueryOperatorEnumerator.cs (2)
95Debug.Assert(_resultSelector != null, "expected a compiled result selector"); 139Debug.Assert(mutables._currentRightMatches == null || mutables._currentRightMatches.Count > 0,
System\Linq\Parallel\QueryOperators\Binary\IntersectQueryOperator.cs (1)
33Debug.Assert(left != null && right != null, "child data sources cannot be null");
System\Linq\Parallel\QueryOperators\Binary\JoinQueryOperator.cs (4)
60Debug.Assert(left != null && right != null, "child data sources cannot be null"); 61Debug.Assert(leftKeySelector != null, "left key selector must not be null"); 62Debug.Assert(rightKeySelector != null, "right key selector must not be null"); 63Debug.Assert(resultSelector != null, "need a result selector function");
System\Linq\Parallel\QueryOperators\Binary\UnionQueryOperator.cs (1)
33Debug.Assert(left != null && right != null, "child data sources cannot be null");
System\Linq\Parallel\QueryOperators\Binary\ZipQueryOperator.cs (1)
60Debug.Assert(resultSelector != null, "operator cannot be null");
System\Linq\Parallel\QueryOperators\Inlined\DecimalMinMaxAggregationOperator.cs (1)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\DoubleMinMaxAggregationOperator.cs (1)
35Debug.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\FloatMinMaxAggregationOperator.cs (1)
34Debug.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\InlinedAggregationOperator.cs (1)
37Debug.Assert(child != null, "child data source cannot be null");
System\Linq\Parallel\QueryOperators\Inlined\IntMinMaxAggregationOperator.cs (1)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\LongMinMaxAggregationOperator.cs (1)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalMinMaxAggregationOperator.cs (1)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleMinMaxAggregationOperator.cs (1)
35Debug.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\NullableFloatMinMaxAggregationOperator.cs (1)
35Debug.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\NullableIntMinMaxAggregationOperator.cs (1)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\NullableLongMinMaxAggregationOperator.cs (1)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\PartitionedStreamMerger.cs (1)
38Debug.Assert(_received, "Cannot return the merge executor because Receive() has not been called yet.");
System\Linq\Parallel\QueryOperators\QuerySettings.cs (1)
149Debug.Assert(topLevelCancellationTokenSource != null, "There should always be a top-level cancellation signal specified.");
System\Linq\Parallel\QueryOperators\Unary\AnyAllSearchOperator.cs (2)
54Debug.Assert(child != null, "child data source cannot be null"); 55Debug.Assert(predicate != null, "need a predicate function");
System\Linq\Parallel\QueryOperators\Unary\ContainsSearchOperator.cs (1)
40Debug.Assert(child != null, "child data source cannot be null");
System\Linq\Parallel\QueryOperators\Unary\DefaultIfEmptyQueryOperator.cs (1)
40Debug.Assert(child != null, "child data source cannot be null");
System\Linq\Parallel\QueryOperators\Unary\DistinctQueryOperator.cs (1)
34Debug.Assert(source != null, "child data source cannot be null");
System\Linq\Parallel\QueryOperators\Unary\ElementAtQueryOperator.cs (3)
40Debug.Assert(child != null, "child data source cannot be null"); 41Debug.Assert(index >= 0, "index can't be less than 0"); 152Debug.Assert(!e.MoveNext(), "expected enumerator to be empty");
System\Linq\Parallel\QueryOperators\Unary\FirstQueryOperator.cs (1)
39Debug.Assert(child != null, "child data source cannot be null");
System\Linq\Parallel\QueryOperators\Unary\ForAllOperator.cs (3)
35Debug.Assert(child != null, "child data source cannot be null"); 36Debug.Assert(elementAction != null, "need a function"); 151Debug.Assert(_elementAction != null, "expected a compiled operator");
System\Linq\Parallel\QueryOperators\Unary\GroupByQueryOperator.cs (3)
56Debug.Assert(child != null, "child data source cannot be null"); 57Debug.Assert(keySelector != null, "need a selector function"); 58Debug.Assert(elementSelector != null ||
System\Linq\Parallel\QueryOperators\Unary\IndexedSelectQueryOperator.cs (3)
47Debug.Assert(child != null, "child data source cannot be null"); 48Debug.Assert(selector != null, "need a selector function"); 161Debug.Assert(_selector != null, "expected a compiled selection function");
System\Linq\Parallel\QueryOperators\Unary\IndexedWhereQueryOperator.cs (3)
46Debug.Assert(child != null, "child data source cannot be null"); 47Debug.Assert(predicate != null, "need a filter function"); 165Debug.Assert(_predicate != null, "expected a compiled operator");
System\Linq\Parallel\QueryOperators\Unary\LastQueryOperator.cs (1)
40Debug.Assert(child != null, "child data source cannot be null");
System\Linq\Parallel\QueryOperators\Unary\ReverseQueryOperator.cs (2)
41Debug.Assert(child != null, "child data source cannot be null"); 56Debug.Assert(Child.OrdinalIndexState != OrdinalIndexState.Indexable, "Don't take this code path if the child is indexable.");
System\Linq\Parallel\QueryOperators\Unary\SelectManyQueryOperator.cs (6)
58Debug.Assert(leftChild != null, "left child data source cannot be null"); 59Debug.Assert(rightChildSelector != null || indexedRightChildSelector != null, 61Debug.Assert(rightChildSelector == null || indexedRightChildSelector == null, 63Debug.Assert(typeof(TRightInput) == typeof(TOutput) || resultSelector != null, 313Debug.Assert(_currentRightSourceAsOutput == _currentRightSource, 442Debug.Assert(_currentRightSourceAsOutput == _currentRightSource,
System\Linq\Parallel\QueryOperators\Unary\SelectQueryOperator.cs (3)
42Debug.Assert(child != null, "child data source cannot be null"); 43Debug.Assert(selector != null, "need a selector function"); 120Debug.Assert(_selector != null, "expected a compiled operator");
System\Linq\Parallel\QueryOperators\Unary\SingleQueryOperator.cs (1)
39Debug.Assert(child != null, "child data source cannot be null");
System\Linq\Parallel\QueryOperators\Unary\SortQueryOperator.cs (2)
36Debug.Assert(keySelector != null, "key selector must not be null"); 181Debug.Assert(keySelector != null, "need a key comparer");
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipQueryOperator.cs (3)
51Debug.Assert(child != null, "child data source cannot be null"); 89Debug.Assert(Child.OrdinalIndexState != OrdinalIndexState.Indexable, "Don't take this code path if the child is indexable."); 298Debug.Assert(_count <= 0 || _keyComparer.Compare(currentKey, minKey) > 0,
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipWhileQueryOperator.cs (3)
71Debug.Assert(child != null, "child data source cannot be null"); 72Debug.Assert(predicate != null || indexedPredicate != null, "need a predicate function"); 390Debug.Assert(_keyComparer.Compare(currentKey, _operatorState._currentLowKey) > 0,
System\Linq\Parallel\QueryOperators\Unary\WhereQueryOperator.cs (3)
41Debug.Assert(child != null, "child data source cannot be null"); 42Debug.Assert(predicate != null, "need a filter function"); 130Debug.Assert(_predicate != null, "expected a compiled operator");
System\Linq\Parallel\Scheduling\QueryTask.cs (2)
62Debug.Assert(taskScheduler == TaskScheduler.Default, "PLINQ queries can currently execute only on the default scheduler."); 81Debug.Assert(taskScheduler == TaskScheduler.Default, "PLINQ queries can currently execute only on the default scheduler.");
System\Linq\Parallel\Scheduling\QueryTaskGroupState.cs (2)
73Debug.Assert(rootTask != null, "Expected a non-null task"); 74Debug.Assert(_rootTask == null, "Cannot begin a query more than once");
System\Linq\Parallel\Scheduling\Scheduling.cs (1)
88Debug.Assert((DEFAULT_BYTES_PER_CHUNK % IntPtr.Size) == 0, "bytes per chunk should be a multiple of pointer size");
System\Linq\Parallel\Utils\Lookup.cs (1)
115Debug.Assert(_defaultKeyGrouping == null, "Cannot insert two groupings with the default key into a lookup.");
System\Linq\Parallel\Utils\Sorting.cs (4)
194Debug.Assert(sourceValues != null, "values weren't populated"); 195Debug.Assert(sourceKeys != null, "keys weren't populated"); 584Debug.Assert(keys != null, "need a non-null keyset"); 608Debug.Assert(i >= left && j <= right, "(i>=left && j<=right) sort failed - bogus IComparer?");
System\Linq\ParallelEnumerable.cs (3)
1526Debug.Assert(options.IsValidQueryAggregationOption(), "enum is out of range"); 5334Debug.Assert(queryOp != null, "expected query operator"); 5353Debug.Assert(!e.MoveNext(), "expected only a single element");
System.Linq.Queryable (1)
System\Linq\EnumerableRewriter.cs (1)
227Debug.Assert(matchingMethods.Length > 0, "All static methods with arguments on Queryable have equivalents on Enumerable.");
System.Memory (2)
System\Text\EncodingExtensions.cs (2)
209Debug.Assert(remainingBytes.IsEmpty, "Over-allocated the byte[] instance?"); 395Debug.Assert(span.IsEmpty, "Over-allocated the string instance?");
System.Net.Http (77)
src\libraries\Common\src\System\CharArrayHelpers.cs (1)
13Debug.Assert(array != null, "Null array");
src\libraries\Common\src\System\Collections\Generic\BidirectionalDictionary.cs (2)
26Debug.Assert(_forward.Count == _backward.Count, "both the dictionaries must have the same number of elements"); 33Debug.Assert(!_backward.ContainsKey(item2), "No added item1 should ever have existing item2");
src\libraries\Common\src\System\HexConverter.cs (2)
337Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 338Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackDecoder.cs (3)
244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\IntegerDecoder.cs (1)
40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\Frames\Http3Frame.cs (1)
43Debug.Assert(VariableLengthIntegerHelper.GetByteCount((long)frameType) == 1, $"{nameof(TryWriteFrameEnvelope)} assumes {nameof(frameType)} will fit within a single byte varint.");
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\Helpers\VariableLengthIntegerHelper.cs (1)
73Debug.Assert(value >= 0 && value <= EightByteLimit, "Serialized values are within [0, 2^62).");
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackDecoder.cs (2)
428Debug.Assert(_state == State.CompressedHeaders, "Should be ready to parse a new header."); 646Debug.Assert(_stringOctets != null, "String buffer should have a value.");
src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (1)
349Debug.Assert(_length > 0, "Length should never be 0 here because BlockCount would be 0");
src\libraries\Common\src\System\StrongToWeakReference.cs (2)
17Debug.Assert(obj != null, "Expected non-null obj"); 28Debug.Assert(_strongRef != null, $"Expected non-null {nameof(_strongRef)} after setting");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Net\Http\DiagnosticsHelper.cs (1)
84Debug.Assert(Enum.GetValues<HttpRequestError>().Length == 12, "We need to extend the mapping in case new values are added to HttpRequestError.");
System\Net\Http\Headers\AltSvcHeaderParser.cs (1)
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 (1)
236Debug.Assert(parseEndIndex < input.Length, "Expected string to have at least 1 char");
System\Net\Http\Headers\CacheControlHeaderParser.cs (1)
48Debug.Assert(isInvalidValue || storeValue == null || temp != null, "'storeValue' is not of type CacheControlHeaderValue");
System\Net\Http\Headers\HeaderUtilities.cs (1)
235Debug.Assert(Array.TrueForAll(alreadyFound, value => value),
System\Net\Http\Headers\HttpHeaders.cs (18)
340Debug.Assert(_count != 0 && entries is not null, "Caller should have validated the collection is not empty"); 380Debug.Assert(descriptor.Parser != null, "Can't add parsed value if there is no parser available."); 394Debug.Assert(descriptor.Parser != null, "Can't add parsed value if there is no parser available."); 428Debug.Assert(descriptor.Parser != null, "Can't add parsed value if there is no parser available."); 429Debug.Assert(descriptor.Parser.SupportsMultipleValues, 447Debug.Assert(parsedValue.GetType() == value.GetType(), 463Debug.Assert(item.GetType() == value.GetType(), 506Debug.Assert(descriptor.Parser != null, "Can't add parsed value if there is no parser available."); 507Debug.Assert(descriptor.Parser.SupportsMultipleValues, 525Debug.Assert(parsedValue.GetType() == value.GetType(), 537Debug.Assert(item.GetType() == value.GetType(), 557Debug.Assert(GetType() == sourceHeaders.GetType(), "Can only copy headers from an instance of the same type."); 880Debug.Assert(index < value.Length, "Parser must return an index value within the string length."); 933Debug.Assert(!(value is List<object>), 1048Debug.Assert(index < value.Length, "Parser must return an index value within the string length."); 1166Debug.Assert(length > 1, "The header should have been removed when it became empty"); 1286Debug.Assert(parser != null, "There should be no reason to call CanAddValue if there is no parser for the current header."); 1358Debug.Assert(count == 1, "Only a single parsed value should be stored for this parser");
System\Net\Http\Headers\RangeHeaderValue.cs (1)
171Debug.Assert(current == input.Length, "GetRangeItemListLength() should consume the whole string or fail.");
System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs (1)
25Debug.Assert(response != null, "The HttpResponseMessage cannot be null.");
System\Net\Http\SocketsHttpHandler\ConnectionPool\ConnectionSetupDistributedTracing.cs (1)
67Debug.Assert(errorType is not null, "DiagnosticsHelper.TryGetErrorType() should succeed whenever an exception is provided.");
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (1)
952Debug.Assert((_availableHttp2Connections?.Count ?? 0) == 0, $"Expected {nameof(_availableHttp2Connections)}.{nameof(_availableHttp2Connections.Count)} == 0");
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http2.cs (3)
368Debug.Assert(isNewConnection || initialRequestWaiter is null, "Shouldn't have a request unless the connection is new"); 393Debug.Assert(_availableHttp2Connections is null || !_availableHttp2Connections.Contains(connection), $"HTTP2 connection already in available list"); 466Debug.Assert(initialRequestWaiter is not null, "Expect request for a new connection");
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (2)
370Debug.Assert(isNewConnection || initialRequestWaiter is null, "Shouldn't have a request unless the connection is new"); 396Debug.Assert(_availableHttp3Connections is null || !_availableHttp3Connections.Contains(connection), $"HTTP3 connection already in available list");
System\Net\Http\SocketsHttpHandler\ContentLengthReadStream.cs (1)
19Debug.Assert(contentLength > 0, "Caller should have checked for 0.");
System\Net\Http\SocketsHttpHandler\CookieHelper.cs (1)
18Debug.Assert(valuesArray.Length > 0, "No values for header??");
System\Net\Http\SocketsHttpHandler\CreditManager.cs (3)
97Debug.Assert(_current <= 0 || _waitersTail is null, "Shouldn't have waiters when credit is available"); 161Debug.Assert(Monitor.IsEntered(SyncObject), "Shouldn't be called outside lock."); 167Debug.Assert(_waitersTail is null, "Shouldn't have waiters when credit is available");
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (4)
347Debug.Assert(_availableStreamsWaiter is null, "As used currently, shouldn't already have a waiter"); 1148Debug.Assert(canceled, "Callback should have been unregistered if the operation was completing successfully."); 1434Debug.Assert(headerValuesCount > 0, "No values for header??"); 1858Debug.Assert(completed, "FinalTeardown was called twice");
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (1)
367Debug.Assert(_requestCompletionState == StreamCompletionState.Failed || _responseCompletionState == StreamCompletionState.Failed,
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (1)
723Debug.Assert(headerValuesCount > 0, "No values for header??");
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (16)
437Debug.Assert(headerValuesCount > 0, "No values for header??"); 534Debug.Assert(_currentRequest == null, $"Expected null {nameof(_currentRequest)}."); 535Debug.Assert(_readBuffer.ActiveLength == 0, "Unexpected data in read buffer"); 536Debug.Assert(_readAheadTaskStatus != ReadAheadTask_Started, 1767Debug.Assert(_readAheadTask == default, "Read ahead task should have been consumed as part of the headers."); 1785Debug.Assert(_readAheadTask == default, "Read ahead task should have been consumed as part of the headers."); 1806Debug.Assert(_readAheadTask == default, "Read ahead task should have been consumed as part of the headers."); 1844Debug.Assert(_readAheadTask == default, "Read ahead task should have been consumed as part of the headers."); 1934Debug.Assert(_readBuffer.ActiveLength == 0, "HttpConnection's buffer should have been empty."); 2038Debug.Assert(_currentRequest != null, "Expected the connection to be associated with a request."); 2039Debug.Assert(_writeBuffer.ActiveLength == 0, "Everything in write buffer should have been flushed."); 2100Debug.Assert(_currentRequest == null, "Connection should no longer be associated with a request."); 2101Debug.Assert(_readAheadTask == default, "Expected a previous initial read to already be consumed."); 2102Debug.Assert(_readAheadTaskStatus == ReadAheadTask_NotStarted, "Expected SendAsync to reset the read-ahead task status."); 2103Debug.Assert(_readBuffer.ActiveLength == 0, "Unexpected data in connection read buffer."); 2120Debug.Assert(!_detachedFromPool, "Should not be detached from pool unless _connectionClose is true");
System\Net\Http\SocketsHttpHandler\MultiProxy.cs (1)
155Debug.Assert(_uris != null || _proxyConfig != null, $"{nameof(ReadNext)} must not be called on a default-initialized {nameof(MultiProxy)}.");
System.Net.HttpListener (28)
src\libraries\Common\src\System\HexConverter.cs (2)
337Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 338Debug.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 (2)
261Debug.Assert(value != DBNull.Value, "Result can't be set to DBNull - it's a special internal value."); 263Debug.Assert(!InternalPeekCompleted, "Called on completed result.");
src\libraries\Common\src\System\Net\WebSockets\WebSocketValidate.cs (1)
97Debug.Assert(!string.IsNullOrEmpty(parameterName), "'parameterName' MUST NOT be NULL or string.Empty");
System\Net\HttpListenerRequestUriBuilder.cs (11)
49Debug.Assert(!string.IsNullOrEmpty(rawUri), "Empty raw URL."); 50Debug.Assert(!string.IsNullOrEmpty(cookedUriScheme), "Empty cooked URL scheme."); 51Debug.Assert(!string.IsNullOrEmpty(cookedUriHost), "Empty cooked URL host."); 52Debug.Assert(!string.IsNullOrEmpty(cookedUriPath), "Empty cooked URL path."); 136Debug.Assert(encoding != null, "'encoding' must be assigned."); 137Debug.Assert(!string.IsNullOrEmpty(_rawPath), "'rawPath' must have at least one character."); 150Debug.Assert(_rawOctets.Count == 0, 172Debug.Assert(encoding != null, "'encoding' must be assigned."); 365Debug.Assert(uriString != null, "uriString must not be null"); 366Debug.Assert(uriString.Length > 0, "uriString must not be empty"); 434Debug.Assert(path != null, "'path' must not be null");
System\Net\WebSockets\HttpListenerWebSocketContext.cs (5)
42Debug.Assert(requestUri != null, "requestUri shouldn't be null"); 43Debug.Assert(headers != null, "headers shouldn't be null"); 44Debug.Assert(cookieCollection != null, "cookieCollection shouldn't be null"); 45Debug.Assert(secWebSocketProtocols != null, "secWebSocketProtocols shouldn't be null"); 46Debug.Assert(webSocket != null, "webSocket shouldn't be null");
System\Net\Windows\CookieExtensions.cs (4)
18Debug.Assert(s_toServerStringFunc != null, "Reflection failed for Cookie.ToServerString()."); 27Debug.Assert(s_cloneFunc != null, "Reflection failed for Cookie.Clone()."); 45Debug.Assert(s_getVariantFunc != null, "Reflection failed for Cookie.Variant."); 57Debug.Assert(s_internalAddFunc != null, "Reflection failed for CookieCollection.InternalAdd().");
System.Net.Mail (40)
src\libraries\Common\src\System\Collections\Generic\BidirectionalDictionary.cs (2)
26Debug.Assert(_forward.Count == _backward.Count, "both the dictionaries must have the same number of elements"); 33Debug.Assert(!_backward.ContainsKey(item2), "No added item1 should ever have existing item2");
src\libraries\Common\src\System\HexConverter.cs (2)
337Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 338Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Net\ContextAwareResult.cs (7)
133Debug.Assert((_flags & StateFlags.ThreadSafeContextCopy) != 0, "Called on completed result."); 144Debug.Assert(AsyncCallback != null || (_flags & StateFlags.CaptureContext) != 0, "No context captured - specify a callback or forceCaptureContext."); 150Debug.Assert(_lock != null, "Must lock (StartPostingAsyncOp()) { ... FinishPostingAsyncOp(); } when calling ContextCopy (unless it's only called after FinishPostingAsyncOp)."); 156Debug.Assert((_flags & StateFlags.ThreadSafeContextCopy) != 0, "Result became completed during call."); 186Debug.Assert(!InternalPeekCompleted, "Called on completed result."); 270Debug.Assert((_flags & StateFlags.PostBlockStarted) != 0, "Called without calling StartPostingAsyncOp."); 313Debug.Assert(AsyncCallback == null || CompletedSynchronously, "Didn't capture context, but didn't complete synchronously!");
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (2)
261Debug.Assert(value != DBNull.Value, "Result can't be set to DBNull - it's a special internal value."); 263Debug.Assert(!InternalPeekCompleted, "Called on completed result.");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Net\Base64Stream.cs (1)
61Debug.Assert(_writeState != null, "_writeState was null");
System\Net\Mail\DomainLiteralReader.cs (1)
35Debug.Assert(data[index] == MailBnfHelper.EndSquareBracket, "data did not end with a square bracket");
System\Net\Mail\MailAddress.cs (4)
34Debug.Assert(_host != null, 37Debug.Assert(userName != null, 40Debug.Assert(displayName != null, 291Debug.Assert(Address != null, "address was null");
System\Net\Mail\MailAddressParser.cs (1)
45Debug.Assert(index == -1 || data[index] == MailBnfHelper.Comma,
System\Net\Mail\MailHeaderInfo.cs (1)
77Debug.Assert((int)s_headerInfo[i].ID == i, "Header info data structures are not in sync");
System\Net\Mail\SmtpCommands.cs (1)
211System.Diagnostics.Debug.Assert(lines.Length == 1, "Did not expect more than one line response for auth command");
System\Net\Mail\SmtpConnection.cs (1)
310Debug.Assert(context == null || context.IdentityRequested, "Authentication required when it wasn't expected. (Maybe Credentials was changed on another thread?)");
System\Net\Mail\WhitespaceReader.cs (4)
34Debug.Assert(!string.IsNullOrEmpty(data), "data was null or empty"); 35Debug.Assert(index < data.Length, "index was outside the bounds of the string"); 117Debug.Assert(!string.IsNullOrEmpty(data), "data was null or empty"); 118Debug.Assert(index < data.Length, "index was outside the bounds of the string");
System\Net\Mime\Base64Encoder.cs (1)
22Debug.Assert(_writeState != null, "_writeState was null");
System\Net\Mime\ByteEncoder.cs (4)
56Debug.Assert(value != null, "value was null"); 57Debug.Assert(WriteState != null, "writestate was null"); 58Debug.Assert(WriteState.Buffer != null, "writestate.buffer was null"); 76Debug.Assert(codepointSize == 1 || codepointSize == 2, "codepointSize was not 1 or 2");
System\Net\Mime\SmtpDateTime.cs (6)
163Debug.Assert(timeZone.Seconds == 0, "Span had seconds value"); 164Debug.Assert(timeZone.Milliseconds == 0, "Span had milliseconds value"); 175Debug.Assert(!string.IsNullOrEmpty(offset), "violation of precondition: offset must not be null or empty"); 176Debug.Assert(offset != UnknownTimeZoneDefaultOffset, "Violation of precondition: do not pass an unknown offset"); 177Debug.Assert(offset.StartsWith('-') || offset.StartsWith('+'), "offset initial character was not a + or -"); 211Debug.Assert(!string.IsNullOrEmpty(value), "violation of precondition: offset must not be null or empty");
System\Net\TrackingValidationObjectDictionary.cs (1)
45Debug.Assert(key != null, "key was null");
System.Net.NetworkInformation (11)
src\libraries\Common\src\System\HexConverter.cs (2)
337Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 338Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\IO\StringParser.cs (5)
177Debug.Assert(result == int.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 222Debug.Assert(result == long.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 253Debug.Assert(result == uint.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 280Debug.Assert(result == ulong.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 295Debug.Assert(result == char.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result");
System\Net\NetworkInformation\NetworkAddressChange.Unix.cs (4)
74Debug.Assert(Socket == null, 125Debug.Assert(Socket == null, 153Debug.Assert(Socket == null, "Socket is not null, must close existing socket before opening another."); 178Debug.Assert(Socket != null, "Socket was null when CloseSocket was called.");
System.Net.Ping (1)
System\Net\NetworkInformation\Ping.RawSocket.cs (1)
397Debug.Assert(Marshal.SizeOf<IcmpHeader>() == 8, "The size of an ICMP Header must be 8 bytes.");
System.Net.Primitives (4)
src\libraries\Common\src\System\HexConverter.cs (2)
337Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 338Debug.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.");
System.Net.Quic (10)
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)
129Debug.Assert(verifyTime.Kind != DateTimeKind.Utc, "UTC verifyTime should have been normalized to Local");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (1)
83Debug.Assert(error <= uint.MaxValue, "ErrGetError should only return error codes in the UInt32 range.");
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs (2)
50Debug.Assert(_parent == null, "Expected no existing parent"); 51Debug.Assert(parent != null && !parent.IsInvalid, "Expected new parent to be non-null and valid");
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (1)
53Debug.Assert(!isCachedInvalidHandle || handle.IsInvalid, "The cached invalid handle must still be invalid.");
src\libraries\Common\src\System\HexConverter.cs (2)
337Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 338Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (1)
349Debug.Assert(_length > 0, "Length should never be 0 here because BlockCount would be 0");
System.Net.Requests (14)
src\libraries\Common\src\System\Net\ContextAwareResult.cs (7)
133Debug.Assert((_flags & StateFlags.ThreadSafeContextCopy) != 0, "Called on completed result."); 144Debug.Assert(AsyncCallback != null || (_flags & StateFlags.CaptureContext) != 0, "No context captured - specify a callback or forceCaptureContext."); 150Debug.Assert(_lock != null, "Must lock (StartPostingAsyncOp()) { ... FinishPostingAsyncOp(); } when calling ContextCopy (unless it's only called after FinishPostingAsyncOp)."); 156Debug.Assert((_flags & StateFlags.ThreadSafeContextCopy) != 0, "Result became completed during call."); 186Debug.Assert(!InternalPeekCompleted, "Called on completed result."); 270Debug.Assert((_flags & StateFlags.PostBlockStarted) != 0, "Called without calling StartPostingAsyncOp."); 313Debug.Assert(AsyncCallback == null || CompletedSynchronously, "Didn't capture context, but didn't complete synchronously!");
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (2)
261Debug.Assert(value != DBNull.Value, "Result can't be set to DBNull - it's a special internal value."); 263Debug.Assert(!InternalPeekCompleted, "Called on completed result.");
System\Net\FtpControlStream.cs (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\NetworkStreamWrapper.cs (1)
56Debug.Assert(value is SslStream, "Expected SslStream");
System\Net\TimerThread.cs (1)
200Debug.Assert(_timers.Prev!.Next == _timers, $"Tail corruption.");
System.Net.Security (40)
src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssBuffer.cs (1)
21Debug.Assert(destination != null, "target destination cannot be null");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs (2)
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)
129Debug.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 (2)
71Debug.Assert( 391Debug.Assert(sslHandle != null, "Expected non-null return value from SafeSslHandle.Create");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (2)
224Debug.Assert(GetAlpnProtocolListSerializedLength(applicationProtocols) == buffer.Length, 467Debug.Assert(!IsInvalid, "Expected a valid context in Disconnect");
src\libraries\Common\src\Microsoft\Win32\SafeHandles\GssSafeHandles.cs (2)
18Debug.Assert(!string.IsNullOrEmpty(name), "Invalid user name passed to SafeGssNameHandle create"); 35Debug.Assert(!string.IsNullOrEmpty(name), "Invalid target name passed to SafeGssNameHandle create");
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs (2)
50Debug.Assert(_parent == null, "Expected no existing parent"); 51Debug.Assert(parent != null && !parent.IsInvalid, "Expected new parent to be non-null and valid");
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (1)
53Debug.Assert(!isCachedInvalidHandle || handle.IsInvalid, "The cached invalid handle must still be invalid.");
src\libraries\Common\src\System\HexConverter.cs (2)
337Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 338Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
System\Net\NegotiateAuthenticationPal.Unix.cs (4)
121Debug.Assert(_securityContext is not null && _isAuthenticated, "Trying to get the client SPN before handshaking is done!"); 489Debug.Assert(username != null && password != null, "Username and Password can not be null"); 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 (1)
173Debug.Assert(!OperatingSystem.IsTvOS(), "Server authentication is not supported on tvOS");
System\Net\Security\NegotiateStream.cs (1)
310Debug.Assert(vt.IsCompleted, "Should have completed synchroously with sync adapter");
System\Net\Security\NetSecurityTelemetry.cs (1)
183Debug.Assert(Enum.GetValues<SslProtocols>()[^1] == SslProtocols.Tls13, "Make sure to add a counter for new SslProtocols");
System\Net\Security\Pal.Managed\SafeChannelBindingHandle.cs (1)
23Debug.Assert(certHashBytes != null, "check certHashBytes is not null");
System\Net\Security\SslSessionsCache.cs (1)
149Debug.Assert(creds != null, "creds == null");
System\Net\Security\SslStream.cs (9)
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"); 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 (2)
46Debug.Assert(e != null, $"Expected non-null Exception to be passed to {nameof(SetException)}"); 752Debug.Assert(_buffer.AvailableLength > 0, "_buffer.AvailableBytes > 0");
System\Net\Security\SslStream.Protocol.cs (2)
526Debug.Assert((object?)clientCertificate == (object?)selectedCert || clientCertificate!.Equals(selectedCert), "'selectedCert' does not match 'clientCertificate'."); 738Debug.Assert(localCertificate.Equals(selectedCert), "'selectedCert' does not match 'localCertificate'.");
System.Net.ServerSentEvents (1)
System\Net\ServerSentEvents\SseParser_1.cs (1)
276Debug.Assert(_newlineIndex - _lineOffset < _lineLength, "Expected to be positioned at a non-empty newline");
System.Net.Sockets (26)
System\Net\Sockets\Socket.cs (1)
3571Debug.Assert(boundAddress != null, "Not Bound");
System\Net\Sockets\Socket.Unix.cs (1)
92Debug.Assert(e == Interop.Error.SUCCESS, e.ToString());
System\Net\Sockets\SocketAsyncContext.Unix.cs (15)
169Debug.Assert(_state is State.Running or State.RunningWithPendingCancellation, "Unexpected operation state"); 724Debug.Assert(success, "Timed out waiting for queue lock"); 857Debug.Assert(observedSequenceNumber - _sequenceNumber < 10000, "Very large sequence number increase???"); 869Debug.Assert(operation.Next == operation, "Expected operation.Next == operation"); 957Debug.Assert(_tail == null, "State == Ready but queue is not empty!"); 963Debug.Assert(_tail != null, "State == Waiting but queue is empty!"); 978Debug.Assert(_tail != null, "State == Processing but queue is empty!"); 1013Debug.Assert(op.Event == null, "Sync operation encountered in ProcessAsyncOperation"); 1047Debug.Assert(_tail != null, "Unexpected empty queue while processing I/O"); 1048Debug.Assert(op == _tail.Next, "Operation is not at head of queue???"); 1080Debug.Assert(observedSequenceNumber - _sequenceNumber < 10000, "Very large sequence number increase???"); 1106Debug.Assert(_tail.Next == op, "Queue modified while processing queue"); 1148Debug.Assert(_tail != null, "Unexpected empty queue in CancelAndContinueProcessing"); 1477Debug.Assert(callback != null, "Expected non-null callback"); 1542Debug.Assert(callback != null, "Expected non-null callback");
System\Net\Sockets\SocketPal.Unix.cs (6)
68Debug.Assert(fd != (IntPtr)(-1), "fd should not be -1"); 650Debug.Assert(fd != (IntPtr)(-1), "Expected fd != -1"); 1798Debug.Assert(count > 0, $"Expected at least one entry."); 1940Debug.Assert(eventsLength == checkReadInitialCount + checkWriteInitialCount + checkErrorInitialCount, "Invalid eventsLength"); 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.");
System\Net\Sockets\UnixDomainSocketEndPoint.Unix.cs (3)
28Debug.Assert(s_nativePathOffset >= 0, "Expected path offset to be positive"); 29Debug.Assert(s_nativePathOffset + s_nativePathLength <= s_nativeAddressSize, "Expected address size to include all of the path length"); 30Debug.Assert(s_nativePathLength >= 92, "Expected max path length to be at least 92"); // per http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_un.h.html
System.Net.WebClient (4)
src\libraries\Common\src\System\HexConverter.cs (2)
337Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 338Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
System\Net\WebClient.cs (2)
871Debug.Assert(_progress != null, "ProgressData should have been initialized"); 1010Debug.Assert(_progress != null, "ProgressData should have been initialized");
System.Net.WebSockets (18)
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\Compression\WebSocketDeflater.cs (2)
43Debug.Assert(_buffer is null, "Invalid state, ReleaseBuffer not called."); 106Debug.Assert(output.Slice(written - WebSocketInflater.FlushMarkerLength, WebSocketInflater.FlushMarkerLength)
System\Net\WebSockets\Compression\WebSocketInflater.cs (1)
89Debug.Assert(totalBytesReceived == 0 || _buffer is not null, "Prepare must be called.");
System\Net\WebSockets\ManagedWebSocket.cs (14)
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"); 465Debug.Assert(Monitor.IsEntered(StateUpdateLock), $"Expected {nameof(StateUpdateLock)} to be held"); 505Debug.Assert(_sendMutex.IsHeld, $"Caller should hold the {nameof(_sendMutex)}"); 1173Debug.Assert(_receiveMutex.IsHeld, $"Caller should hold the {nameof(_receiveMutex)}"); 1299Debug.Assert(_receiveBufferCount >= 2, "Expected to at least have the first two bytes of the header."); 1317Debug.Assert(_receiveBufferCount >= 2, "Expected to have two bytes for the payload length."); 1323Debug.Assert(_receiveBufferCount >= 8, "Expected to have eight bytes for the payload length."); 1535Debug.Assert(count - 2 == encodedLength, $"{nameof(s_textEncoding.GetByteCount)} and {nameof(s_textEncoding.GetBytes)} encoded count didn't match"); 1633Debug.Assert(_sendMutex.IsHeld, $"Caller should hold the {nameof(_sendMutex)}"); 1783Debug.Assert((b & 0x80) != 0, "Should have already skipped past ASCII");
System.Net.WebSockets.Client (2)
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\ClientWebSocketOptions.cs (1)
282Debug.Assert(!_isReadOnly, "Already set");
System.Numerics.Tensors (4)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan.cs (2)
572Debug.Assert(copiedValues == destination.FlattenedLength, "Didn't copy the right amount to the array."); 628Debug.Assert(copiedValues == destination.FlattenedLength, "Didn't copy the right amount to the array.");
System\Numerics\Tensors\netcore\TensorSpan.cs (2)
601Debug.Assert(copiedValues == destination.FlattenedLength, "Didn't copy the right amount to the array."); 655Debug.Assert(copiedValues == destination.FlattenedLength, "Didn't copy the right amount to the array.");
System.ObjectModel (1)
System\Collections\ObjectModel\KeyedCollection.cs (1)
273Debug.Assert(key != null, "key shouldn't be null!");
System.Private.CoreLib (1150)
src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\ExceptionHandling.cs (10)
679Debug.Assert(isValid, "Unwind and intercept failed unexpectedly"); 751Debug.Assert(exInfo._passNumber == 1, "expected asm throw routine to set the pass"); 775Debug.Assert(isValid, "RhThrowEx called with an unexpected context"); 862Debug.Assert(pCatchHandler != null || pReversePInvokePropagationCallback != IntPtr.Zero || unwoundReversePInvoke || isExceptionIntercepted, "We should have a handler if we're starting the second pass"); 863Debug.Assert(!isExceptionIntercepted || (pCatchHandler == null), "No catch handler should be returned for intercepted exceptions in the first pass"); 887Debug.Assert(isValid, "second-pass EH unwind failed unexpectedly"); 902Debug.Assert(frameIter.SP == handlingFrameSP, "Encountered a different reverse P/Invoke frame in the second pass."); 960Debug.Assert(ip != null, "IP address must not be null"); 966Debug.Assert(handlingFrameSP != MaxSP, "Handling frame must have an SP value"); 967Debug.Assert(((UIntPtr*)handlingFrameSP) > &handlingFrameSP,
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (1)
61Debug.Assert(!b || (ProcPid)result.Pid == pid || pid == ProcPid.Self, "Expected process ID from status file to match supplied pid");
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadDir.cs (3)
40Debug.Assert(Name != null, "should not have a null name"); 47Debug.Assert(nameBytes.Length > 0, "we shouldn't have gotten a garbage value from the OS"); 51Debug.Assert(NameLength != -1 || !value.Contains('\0'), "should not have embedded nulls if we parsed the end of string");
src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (13)
67Debug.Assert(InitialSegmentSize > 0, "Initial segment size must be > 0."); 68Debug.Assert((InitialSegmentSize & (InitialSegmentSize - 1)) == 0, "Initial segment size must be a power of 2"); 69Debug.Assert(InitialSegmentSize <= MaxSegmentSize, "Initial segment size should be <= maximum."); 70Debug.Assert(MaxSegmentSize < int.MaxValue / 2, "Max segment size * 2 must be < int.MaxValue, or else overflow could occur."); 102Debug.Assert(segment != null, "Expected a non-null segment."); 112Debug.Assert(newSegmentSize > 0, "The max size should always be small enough that we don't overflow."); 179Debug.Assert(segment != null, "Expected a non-null segment."); 180Debug.Assert(array != null, "Expected a non-null item array."); 253Debug.Assert(segment != null, "Expected a non-null segment."); 254Debug.Assert(array != null, "Expected a non-null item array."); 368Debug.Assert(syncObj != null, "The syncObj parameter is null."); 390Debug.Assert((size & (size - 1)) == 0, "Size must be a power of 2"); 429Debug.Assert(queue != null, "Expected a non-null queue.");
src\libraries\Common\src\System\HexConverter.cs (2)
337Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 338Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\IO\StringParser.cs (5)
177Debug.Assert(result == int.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 222Debug.Assert(result == long.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 253Debug.Assert(result == uint.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 280Debug.Assert(result == ulong.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 295Debug.Assert(result == char.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result");
src\libraries\Common\src\System\Number.Formatting.Common.cs (1)
820Debug.Assert(p >= spanPtr - 1, "Underflow");
src\libraries\Common\src\System\Number.NumberBuffer.cs (3)
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\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\libraries\System.Private.CoreLib\src\System\AppContext.cs (1)
157Debug.Assert(s_dataStore == null, "s_dataStore is not expected to be inited before Setup is called");
src\libraries\System.Private.CoreLib\src\System\Array.cs (1)
613Debug.Assert(hi - low >= 0, "Length overflow!");
src\libraries\System.Private.CoreLib\src\System\Buffers\SharedArrayPool.cs (2)
280Debug.Assert(t_tlsBuckets is null, $"Non-null {nameof(t_tlsBuckets)}"); 477Debug.Assert(array is not null, "No nulls should have been present in slots < _count.");
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\FormattingHelpers.CountDigits.cs (1)
103Debug.Assert(table.Length == 32, "Every result of uint.Log2(value) needs a long entry in the table.");
src\libraries\System.Private.CoreLib\src\System\Char.cs (1)
96Debug.Assert(IsLatin1(c), "char.GetLatin1UnicodeCategory(): c should be <= 00ff");
src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentQueue.cs (3)
335Debug.Assert(s._frozenForEnqueues, "Internal segment must be frozen as there's a following segment."); 577Debug.Assert(s._preservedForObservation, "Would have had to been preserved as a segment part of enumeration"); 578Debug.Assert(s._frozenForEnqueues, "Would have had to be frozen for enqueues as it's intermediate");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ArraySortHelper.cs (5)
56Debug.Assert(comparer != null, "Check the arguments in the caller!"); 75Debug.Assert(array != null, "Check the arguments in the caller!"); 76Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 326Debug.Assert(array != null, "Check the arguments in the caller!"); 327Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (18)
199Debug.Assert(_comparer is not null, "The comparer should never be null for a reference type."); 285Debug.Assert(_buckets != null, "_buckets should be non-null"); 286Debug.Assert(_entries != null, "_entries should be non-null"); 407Debug.Assert(_entries != null, "expected entries to be != null"); 522Debug.Assert(entries != null, "expected entries to be non-null"); 602Debug.Assert((StartOfFreeList - entries[_freeList].next) >= -1, "shouldn't overflow because `next` cannot underflow"); 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"); 973Debug.Assert(entries != null, "expected entries to be non-null"); 1012Debug.Assert((StartOfFreeList - entries[dictionary._freeList].next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1087Debug.Assert(entries != null, "expected entries to be non-null"); 1149Debug.Assert((StartOfFreeList - entries[dictionary._freeList].next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1251Debug.Assert(_entries != null, "_entries should be non-null"); 1304Debug.Assert(_entries != null, "entries should be non-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"); 1406Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (16)
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"); 297Debug.Assert(entries != null, "entries should be non-null"); 327Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 465Debug.Assert(entries != null, "expected entries to be non-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."); 1290Debug.Assert(_entries != null, "_entries should be non-null"); 1420Debug.Assert(entries != null, "expected entries to be non-null"); 1484Debug.Assert((StartOfFreeList - entries![_freeList].Next) >= -1, "shouldn't overflow because `next` cannot underflow"); 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\NonRandomizedStringEqualityComparer.cs (2)
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\ValueListBuilder.cs (1)
94Debug.Assert(index == 0, "Implementation currently only supports index == 0");
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (1)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
src\libraries\System.Private.CoreLib\src\System\Collections\Hashtable.cs (5)
281Debug.Assert(_loadsize < hashsize, "Invalid hashtable loadsize!"); 424Debug.Assert(!_isWriterInProgress, "Race condition detected in usages of Hashtable - multiple threads appear to be writing to a Hashtable instance simultaneously! Don't do that - use Hashtable.Synchronized."); 743Debug.Assert(_loadsize < newsize, "Our current implementation means this is not possible."); 790Debug.Assert(key != null, "key can't be null here!"); 972Debug.Assert(!_isWriterInProgress, "Race condition detected in usages of Hashtable - multiple threads appear to be writing to a Hashtable instance simultaneously! Don't do that - use Hashtable.Synchronized.");
src\libraries\System.Private.CoreLib\src\System\ComponentModel\DefaultValueAttribute.cs (1)
45Debug.Assert(IsSupported, "Runtime instantiation of this attribute is not allowed with trimming.");
src\libraries\System.Private.CoreLib\src\System\Convert.cs (1)
172Debug.Assert(value != null, "[Convert.DefaultToType]value!=null");
src\libraries\System.Private.CoreLib\src\System\DateTime.cs (4)
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 (1)
937Debug.Assert(offset.Ticks >= MinOffset && offset.Ticks <= MaxOffset, "Offset not validated.");
src\libraries\System.Private.CoreLib\src\System\DefaultBinder.cs (1)
1062Debug.Assert(cur1.IsStatic != cur2.IsStatic, "hierarchyDepth1 == hierarchyDepth2");
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Debug.cs (1)
91Assert(condition, message.ToStringAndClear());
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventProvider.cs (1)
481Debug.Assert(EtwAPIMaxRefObjCount == 8, $"{nameof(EtwAPIMaxRefObjCount)} must equal the number of fields in {nameof(EightObjects)}");
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (7)
1947Debug.Assert(data->Size >= 0 && data->Size % 2 == 0, "String size should be even"); 1952Debug.Assert(*(charPointer + i) != 0, "String may not contain null chars"); 1954Debug.Assert(*(charPointer + charLength) == 0, "String must be null terminated"); 2879Debug.Assert(EventListener.s_EventSources != null, "should be called within lock on EventListener.EventListenersLock which ensures s_EventSources to be initialized"); 4548Debug.Assert(eventSource.m_id == id, "Unexpected event source ID."); 4554Debug.Assert(allListeners.ContainsKey(dispatcher.m_Listener), "EventSource has a listener not on the global list."); 4564Debug.Assert(dispatcher != null, "Listener is not on all eventSources.");
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\ArrayTypeInfo.cs (1)
46Debug.Assert(value != null, "null accepted only for some overrides");
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\EnumerableTypeInfo.cs (1)
51Debug.Assert(value != null, "null accepted only for some overrides");
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\PropertyValue.cs (3)
132Debug.Assert(_scalarLength == 0, "This ReflectedValue refers to an unboxed value type, not a reference type or boxed value type."); 141Debug.Assert(_scalarLength > 0, "This ReflectedValue refers to a reference type or boxed value type, not an unboxed value type"); 150Debug.Assert(_scalarLength > 0, "This ReflectedValue refers to a reference type or boxed value type, not an unboxed value type");
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingEventSource.cs (2)
632Debug.Assert(eventName != null, "GetOpcodeWithDefault should not returned Start when eventName is null"); 637Debug.Assert(eventName != null, "GetOpcodeWithDefault should not returned Stop when eventName is null");
src\libraries\System.Private.CoreLib\src\System\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\CharUnicodeInfo.cs (5)
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"); 377Debug.Assert(str != null, "str can not be 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 (2)
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");
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Nls.cs (3)
503Debug.Assert(actualSortKeyLength == 0, "LCMapStringEx should never return a negative value."); 555Debug.Assert(sortKeyLength == 0, "LCMapStringEx should never return a negative value."); 607Debug.Assert(((options & ~(CompareOptions.IgnoreCase |
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.cs (15)
912Debug.Assert(_sRealName != null, "[CultureData.CultureName] Expected _sRealName to be populated by already"); 1092Debug.Assert(_sSpecificCulture != null, "[CultureData.SpecificCultureName] Expected this.sSpecificCulture to be populated by culture data initialization already"); 1654Debug.Assert(_sWindowsName != null, "[CultureData.CalendarIds] Expected _sWindowsName to be populated by already"); 1722Debug.Assert(calendarId > 0 && calendarId <= CalendarId.LAST_CALENDAR, 1738Debug.Assert(_sWindowsName != null, "[CultureData.GetCalendar] Expected _sWindowsName to be populated by already"); 1767Debug.Assert(_sRealName != null, "[CultureData.IsRightToLeft] Expected _sRealName to be populated by already"); 1791Debug.Assert(_sRealName != null, "[CultureData.TextInfoName] Expected _sRealName to be populated by already"); 1803Debug.Assert(_sRealName != null, "[CultureData.SortName] Expected _sRealName to be populated by already"); 1876Debug.Assert(_sRealName != null, "[CultureData.LCID] Expected this.sRealName to be populated already"); 1919Debug.Assert(calendarId > 0, "[CultureData.saEraNames] Expected Calendar.ID > 0"); 1925Debug.Assert(calendarId > 0, "[CultureData.saAbbrevEraNames] Expected Calendar.ID > 0"); 1931Debug.Assert(calendarId > 0, "[CultureData.saAbbrevEraNames] Expected Calendar.ID > 0"); 2096Debug.Assert(startIndex >= 0, "startIndex cannot be negative"); 2097Debug.Assert(!timeParts.AsSpan().ContainsAny('\'', '\\'), "timeParts cannot include quote characters"); 2217Debug.Assert(_sWindowsName != null, "[CultureData.GetNFIValues] Expected _sWindowsName to be populated by already");
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Icu.cs (5)
205Debug.Assert(_sWindowsName != null, "[CultureData.IcuGetLocaleInfo] Expected _sWindowsName to be populated already"); 220Debug.Assert(localeName != null, "[CultureData.IcuGetLocaleInfo] Expected localeName to be not be null"); 245Debug.Assert(_sWindowsName != null, "[CultureData.IcuGetLocaleInfo(LocaleNumberData)] Expected _sWindowsName to be populated already"); 269Debug.Assert(_sWindowsName != null, "[CultureData.IcuGetLocaleInfo(LocaleGroupingData)] Expected _sWindowsName to be populated already"); 292Debug.Assert(_sWindowsName != null, "[CultureData.GetTimeFormatString(bool shortFormat)] Expected _sWindowsName to be populated already");
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Nls.cs (6)
50Debug.Assert(_sRealName != null, "[CultureData.DoGetLocaleInfo] Expected _sRealName to be populated by already"); 77Debug.Assert(_sRealName != null, "[CultureData.DoGetLocaleInfoInt] Expected _sRealName to be populated by already"); 84Debug.Assert(_sRealName != null, "[CultureData.DoGetLocaleInfoInt] Expected _sRealName to be populated by already"); 97Debug.Assert(_sRealName != null, "[CultureData.DoGetLocaleInfoInt] Expected _sRealName to be populated by already"); 104Debug.Assert(_sRealName != null, "[CultureData.DoGetLocaleInfoInt] Expected _sRealName to be populated by already"); 176Debug.Assert(localeName != null, "[CultureData.GetLocaleInfoFromLCType] Expected localeName to be not be null");
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureInfo.cs (3)
453Debug.Assert(s_InvariantCultureInfo != null, "[CultureInfo.InvariantCulture] s_InvariantCultureInfo is null"); 575Debug.Assert(_name != null, "[CultureInfo.DisplayName] Always expect _name to be set"); 802Debug.Assert(calType != CalendarId.GREGORIAN, "calType!=CalendarId.GREGORIAN");
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (3)
166Debug.Assert(value >= 0, "DateTimeFormat.FormatDigits(): value >= 0"); 221Debug.Assert(month >= 1 && month <= 12, "month >=1 && month <= 12"); 262Debug.Assert(repeatCount != 3 || repeatCount != 4, "repeateCount should be 3 or 4");
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfo.cs (38)
172Debug.Assert(abbreviatedDayNames.Length == 7, "[DateTimeFormatInfo.GetAbbreviatedDayOfWeekNames] Expected 7 day names in a week"); 186Debug.Assert(m_superShortDayNames.Length == 7, "[DateTimeFormatInfo.InternalGetSuperShortDayNames] Expected 7 day names in a week"); 200Debug.Assert(dayNames.Length == 7, "[DateTimeFormatInfo.GetDayOfWeekNames] Expected 7 day names in a week"); 214Debug.Assert(abbreviatedMonthNames.Length == 12 || abbreviatedMonthNames.Length == 13, 229Debug.Assert(monthNames.Length == 12 || monthNames.Length == 13, 255Debug.Assert(calendarId != CalendarId.UNINITIALIZED_VALUE, "[DateTimeFormatInfo.Populate] Expected initialized calendarId"); 272Debug.Assert(allLongTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long time patterns"); 275Debug.Assert(allShortTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short time patterns"); 278Debug.Assert(allLongDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long date patterns"); 281Debug.Assert(allShortDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short date patterns"); 284Debug.Assert(allYearMonthPatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some year month patterns"); 351Debug.Assert(amDesignator != null, "DateTimeFormatInfo.AMDesignator, amDesignator != null"); 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"); 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"); 985Debug.Assert(timeSeparator != null, "DateTimeFormatInfo.TimeSeparator, timeSeparator != null"); 1048Debug.Assert(values != null, "value != null"); 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, 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, 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 (9)
97Debug.Assert(dtfi != null, "dtfi == null"); 190Debug.Assert(dtfi != null, "dtfi == null"); 2497Debug.Assert(dtfi != null, "dtfi == null"); 5365Debug.Assert(dtfi != null, "Expected non-null DateTimeFormatInfo"); 5404Debug.Assert(Index + count <= Length, "__DTString::Advance: Index + count <= len"); 5731Debug.Assert(Index >= 0 && Index < Length, "Index >= 0 && Index < len"); 5740Debug.Assert(Index >= 0 && Index < Length, "Index >= 0 && Index < len"); 5741Debug.Assert(char.IsAsciiDigit(Value[Index]), "IsDigit(Value[Index])"); 5916Debug.Assert(sub.index + sub.length <= Length, "sub.index + sub.length <= len");
src\libraries\System.Private.CoreLib\src\System\Globalization\HebrewCalendar.cs (1)
494Debug.Assert(numDays >= 1, "NumDays >= 1");
src\libraries\System.Private.CoreLib\src\System\Globalization\HebrewNumber.cs (1)
102Debug.Assert(Number > 0 && Number <= 999, "Number is out of range.");
src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.cs (12)
201Debug.Assert(count >= 1, "[IdnMapping.GetAscii] Expected 0 length strings to fail before now."); 372Debug.Assert(!char.IsLowSurrogate(unicode, basicCount), "[IdnMapping.punycode_encode]Unexpected low surrogate"); 449Debug.Assert(delta > 0, "[IdnMapping.cs]1 punycode_encode - delta overflowed int"); 463Debug.Assert(delta > 0, "[IdnMapping.cs]2 punycode_encode - delta overflowed int"); 474Debug.Assert(c_punycodeBase != t, "[IdnMapping.punycode_encode]Expected c_punycodeBase (36) to be != t"); 493Debug.Assert(delta > 0, "[IdnMapping.cs]3 punycode_encode - delta overflowed int"); 693Debug.Assert(w > 0, "[IdnMapping.punycode_decode]Expected w > 0"); 701Debug.Assert(c_punycodeBase != t, "[IdnMapping.punycode_decode]Expected t != c_punycodeBase (36)"); 711Debug.Assert((output.Length - iOutputAfterLastDot - numSurrogatePairs) + 1 > 0, 835Debug.Assert(numpoints != 0, "[IdnMapping.adapt]Expected non-zero numpoints."); 843Debug.Assert(delta + c_skew != 0, "[IdnMapping.adapt]Expected non-zero delta+skew."); 868Debug.Assert(d >= 0 && d < c_punycodeBase, "[IdnMapping.encode_digit]Expected 0 <= d < punycodeBase");
src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Nls.cs (1)
80Debug.Assert(realLength > buffer.Length, "Buffer overflow should have iLength > cBuffer.Length");
src\libraries\System.Private.CoreLib\src\System\Globalization\RegionInfo.cs (1)
112Debug.Assert(_name != null, "Expected RegionInfo._name to be populated already");
src\libraries\System.Private.CoreLib\src\System\Globalization\TextElementEnumerator.cs (2)
21Debug.Assert(str != null, "TextElementEnumerator(): str != null"); 22Debug.Assert(startIndex >= 0 && startIndex <= str.Length, "TextElementEnumerator(): startIndex >= 0 && startIndex <= str.Length");
src\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.cs (2)
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.Nls.cs (1)
39Debug.Assert(ret == pSourceLen, "Expected getting the same length of the original string");
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanFormat.cs (10)
551Debug.Assert((field == 0 && sb.Length == 0) || field == 1, "field == 0 || field == 1, Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 559Debug.Assert((field == 1 && sb.Length == 0) || field == 2, "field == 1 || field == 2, Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 567Debug.Assert((field == 2 && sb.Length == 0) || field == 3, "field == 2 || field == 3, Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 575Debug.Assert((field == 3 && sb.Length == 0) || field == 4, "field == 3 || field == 4, Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 584Debug.Assert((field == 4 && sb.Length == 0) || field == 5, "field == 4 || field == 5, Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 600Debug.Assert(0 < dd && dd < 3, "0 < dd && dd < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 601Debug.Assert(0 < hh && hh < 3, "0 < hh && hh < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 602Debug.Assert(0 < mm && mm < 3, "0 < mm && mm < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 603Debug.Assert(0 < ss && ss < 3, "0 < ss && ss < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 604Debug.Assert(0 < ff && ff < 8, "0 < ff && ff < 8, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern");
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanParse.cs (4)
447Debug.Assert(_tokenCount == (_sepCount + _numCount), "tokenCount == (SepCount + NumCount)"); 631Debug.Assert(success, "Should have thrown on failure"); 653Debug.Assert(success, "Should have thrown on failure"); 675Debug.Assert(success, "Should have thrown on failure");
src\libraries\System.Private.CoreLib\src\System\Globalization\UmAlQuraCalendar.cs (6)
267Debug.Assert((HijriYear >= MinCalendarYear) && (HijriYear <= MaxCalendarYear), "Hijri year is out of range."); 268Debug.Assert(HijriMonth >= 1, "Hijri month is out of range."); 269Debug.Assert(HijriDay >= 1, "Hijri day is out of range."); 339Debug.Assert((time.Ticks >= s_minDate.Ticks) && (time.Ticks <= s_maxDate.Ticks), "Gregorian date is out of range."); 487Debug.Assert((year >= MinCalendarYear) && (year <= MaxCalendarYear), "Hijri year is out of range."); 497Debug.Assert((days == 354) || (days == 355), "Hijri year has to be 354 or 355 days.");
src\libraries\System.Private.CoreLib\src\System\Guid.cs (4)
270Debug.Assert(success, "GuidParseThrowStyle.All means throw on all failures"); 341Debug.Assert(success, "GuidParseThrowStyle.AllButOverflow means throw on all failures"); 400Debug.Assert(success, "GuidParseThrowStyle.AllButOverflow means throw on all failures"); 1150Debug.Assert(result && bytesWritten == guidString.Length, "Formatting guid should have succeeded.");
src\libraries\System.Private.CoreLib\src\System\IO\BinaryReader.cs (3)
159Debug.Assert(numBytes is 1 or 2, "BinaryReader::ReadOneChar assumes it's reading one or two bytes only."); 178Debug.Assert(charsRead < 2, "BinaryReader::ReadOneChar - assuming we only got 0 or 1 char, not 2!"); 474Debug.Assert(buffer.Length != 1, "length of 1 should use ReadByte.");
src\libraries\System.Private.CoreLib\src\System\IO\BufferedStream.cs (10)
199Debug.Assert(!(_writePos > 0 && _readPos != _readLen), "Read and Write buffers cannot both have data in them at the same time."); 368Debug.Assert(_writePos == 0, "BufferedStream: Write buffer must be empty in FlushRead!"); 407Debug.Assert(_readPos == 0 && _readLen == 0, 409Debug.Assert(_buffer != null && _bufferSize >= _writePos, 420Debug.Assert(_readPos == 0 && _readLen == 0, 422Debug.Assert(_buffer != null && _bufferSize >= _writePos, 499Debug.Assert(_readLen == _readPos, "The read buffer must now be empty"); 549Debug.Assert(_readLen == _readPos, "The read buffer must now be empty"); 1256Debug.Assert(_writePos == 0, "Write buffer must be empty if there's data in the read buffer"); 1295Debug.Assert(_writePos == 0, "Write buffer must be empty if there's data in the read buffer");
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEntry.Unix.cs (1)
85Debug.Assert(charsWritten > 0, "didn't write any chars to buffer");
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (1)
106Debug.Assert(path != null, "File.Exists: GetFullPath returned null");
src\libraries\System.Private.CoreLib\src\System\IO\FileInfo.cs (1)
26Debug.Assert(!isNormalized || !PathInternal.IsPartiallyQualified(fullPath.AsSpan()), "should be fully qualified if normalized");
src\libraries\System.Private.CoreLib\src\System\IO\FileNotFoundException.cs (1)
53Debug.Assert(_message != null, "_message was null after calling SetMessageField");
src\libraries\System.Private.CoreLib\src\System\IO\Path.cs (7)
640Debug.Assert(result, "should never fail joining first two paths"); 705Debug.Assert(first.Length > 0 && second.Length > 0, "should have dealt with empty paths"); 716Debug.Assert(first.Length > 0 && second.Length > 0 && third.Length > 0, "should have dealt with empty paths"); 732Debug.Assert(first.Length > 0 && second.Length > 0 && third.Length > 0 && fourth.Length > 0, "should have dealt with empty paths"); 798Debug.Assert(byteCount == 8, $"Unexpected {nameof(byteCount)}"); 799Debug.Assert(chars.Length == 12, $"Unexpected {nameof(chars)}.Length"); 829Debug.Assert((b2 & 0xF8) == 0, "Unexpected set bits");
src\libraries\System.Private.CoreLib\src\System\IO\Path.Unix.cs (1)
68Debug.Assert(collapsedString.Length < path.Length || collapsedString.ToString() == path,
src\libraries\System.Private.CoreLib\src\System\IO\PinnedBufferMemoryStream.cs (1)
19Debug.Assert(array != null, "Array can't be null");
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs (22)
28Debug.Assert(bufferSize > 1, "Buffering must not be enabled for smaller buffer sizes"); 62Debug.Assert(!(_writePos > 0 && _readPos != _readLen), "Read and Write buffers cannot both have data in them at the same time."); 162Debug.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), 233Debug.Assert(_readPos == _readLen, "Read buffer should be empty!"); 301Debug.Assert(!_strategy.IsClosed, "FileStream ensures that strategy is not closed"); 302Debug.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), 380Debug.Assert(_writePos == 0, "Win32FileStream must not have buffered write data here! Pipes should be unidirectional."); 427Debug.Assert(_readLen == _readPos, "The read buffer must now be empty"); 518Debug.Assert(_writePos == 0, "FlushWrite must set _writePos to 0"); 524Debug.Assert(_writePos == 0, "FileStream cannot have buffered data to write here! Your stream will be corrupted."); 598Debug.Assert(!_strategy.IsClosed, "FileStream ensures that strategy is not closed"); 599Debug.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), 601Debug.Assert(_strategy.CanSeek || (_readPos == 0 && _readLen == 0), 721Debug.Assert(_writePos == 0, "FileStream cannot have buffered data to write here! Your stream will be corrupted."); 758Debug.Assert(!_strategy.IsClosed, "FileStream responsibility"); 759Debug.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), 854Debug.Assert(_writePos == 0, "Write buffer must be empty if there's data in the read buffer"); 885Debug.Assert(_writePos == 0, "Write buffer must be empty if there's data in the read buffer"); 952Debug.Assert(_writePos == 0, "Write buffer must be empty in FlushRead!"); 965Debug.Assert(_readPos == 0 && _readLen == 0, "Read buffer must be empty in FlushWrite!"); 966Debug.Assert(_buffer != null && _bufferSize >= _writePos, "Write buffer must be allocated and write position must be in the bounds of the buffer in FlushWrite!"); 1044Debug.Assert(!_strategy.IsClosed, "FileStream ensures that strategy is not closed");
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\OSFileStreamStrategy.cs (1)
192Debug.Assert(!_fileHandle.TryGetCachedLength(out _), "If length can be cached (file opened for reading, not shared for writing), it should be impossible to modify file length");
src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (6)
238Debug.Assert(thisTask != null && thisTask._stream != null, 512Debug.Assert(thisTask != null && thisTask._stream != 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."); 585Debug.Assert(_asyncActiveSemaphore != null, "Must have been initialized in order to get here.");
src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (27)
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."); 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."); 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."); 922Debug.Assert(charPos < charLen, "ReadBuffer returned > 0 but didn't bump _charLen?"); 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."); 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."); 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 (1)
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\UnmanagedMemoryStream.cs (1)
382Debug.Assert(pos + nInt >= 0, "_position + n >= 0"); // len is less than 2^63 -1.
src\libraries\System.Private.CoreLib\src\System\Lazy.cs (1)
93Debug.Assert(_exceptionDispatch != null, "execution path is invalid");
src\libraries\System.Private.CoreLib\src\System\Marvin.cs (3)
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\MemoryExtensions.cs (2)
5722Debug.Assert(treatAsSingleSeparator, "Should only ever be called as true; exists to differentiate from separators overload"); 6173Debug.Assert(formatter != null, "An incorrectly written provider said it implemented ICustomFormatter, and then didn't");
src\libraries\System.Private.CoreLib\src\System\Number.Parsing.cs (1)
238Debug.Assert((styles & ~NumberStyles.Integer) == 0, "Only handles subsets of Integer format");
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\DynamicMethod.cs (4)
255Debug.Assert(owner == null && m == null, "owner and m cannot be set for transparent methods"); 261Debug.Assert(m != null || owner != null, "Constructor should ensure that either m or owner is set"); 262Debug.Assert(m == null || !m.Equals(s_anonymouslyHostedDynamicMethodsModule), "The user cannot explicitly use this assembly"); 263Debug.Assert(m == null || owner == null, "m and owner cannot both be set");
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeBuilderInstantiation.cs (1)
34Debug.Assert(type != null, "this is only called from RuntimeType.MakeGenericType and TypeBuilder.MakeGenericType so 'type' cannot be null");
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs (1)
399Debug.Assert(!sigElementType.IsNullableOfT, "A true boxed Nullable<T> should never be here.");
src\libraries\System.Private.CoreLib\src\System\Resources\FastResourceComparer.cs (5)
75Debug.Assert(a != null && bytes != null, "FastResourceComparer::CompareOrdinal must have non-null params"); 76Debug.Assert(bCharLength * 2 <= bytes.Length, "FastResourceComparer::CompareOrdinal - numChars is too big!"); 111Debug.Assert((byteLen & 1) == 0, "CompareOrdinal is expecting a UTF-16 string length, which must be even!"); 112Debug.Assert(a != null && b != null, "Null args not allowed."); 113Debug.Assert(byteLen >= 0, "byteLen must be non-negative.");
src\libraries\System.Private.CoreLib\src\System\Resources\FileBasedResourceGroveler.cs (5)
20Debug.Assert(mediator != null, "mediator shouldn't be null; check caller"); 29Debug.Assert(culture != null, "culture shouldn't be null; check caller"); 64Debug.Assert(culture != null, "culture shouldn't be null; check caller"); 65Debug.Assert(fileName != null, "fileName shouldn't be null; check caller"); 88Debug.Assert(file != null, "file shouldn't be null; check caller");
src\libraries\System.Private.CoreLib\src\System\Resources\ManifestBasedResourceGroveler.cs (15)
31Debug.Assert(mediator != null, "mediator shouldn't be null; check caller"); 37Debug.Assert(culture != null, "culture shouldn't be null; check caller"); 38Debug.Assert(localResourceSets != null, "localResourceSets shouldn't be null; check caller"); 90Debug.Assert(satellite != null, "satellite should not be null when stream is set"); 128Debug.Assert(a != null, "assembly != null"); 168Debug.Assert(store != null, "I need a Stream!"); 225Debug.Assert(readerTypeName != null, "Reader Type name should be set"); 226Debug.Assert(resSetTypeName != null, "ResourceSet Type name should be set"); 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"); 392Debug.Assert(readerTypeName != null, "readerTypeName shouldn't be null; check caller"); 393Debug.Assert(resSetTypeName != null, "resSetTypeName shouldn't be null; check caller");
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceManager.cs (1)
556Debug.Assert(asmTypeName != null, "asmTypeName was unexpectedly null");
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.Core.cs (5)
34Debug.Assert(stream != null, "Need a stream!"); 35Debug.Assert(stream.CanRead, "Stream should be readable!"); 36Debug.Assert(resCache != null, "Need a Dictionary!"); 178Debug.Assert(index >= 0 && index < _numResources, "Couldn't find data position within sorted data positions array!"); 181Debug.Assert(len >= 0 && len <= (int)_store.BaseStream.Length - dataPos + _dataSectionOffset, "Length was negative or outside the bounds of the file!");
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (20)
46Debug.Assert(value >= 0, "negative ResourceTypeCode. What?"); 202Debug.Assert(_nameHashes != null && _nameHashesPtr == null, "Internal state mangled."); 207Debug.Assert(_nameHashes == null && _nameHashesPtr != null, "Internal state mangled."); 218Debug.Assert(_namePositions != null && _namePositionsPtr == null, "Internal state mangled."); 223Debug.Assert(_namePositions == null && _namePositionsPtr != null, "Internal state mangled."); 259Debug.Assert(_store != null, "ResourceReader is closed!"); 340Debug.Assert(_store != null, "ResourceReader is closed!"); 383Debug.Assert(_store != null, "ResourceReader is closed!"); 454Debug.Assert(_store != null, "ResourceReader is closed!"); 478Debug.Assert(_store != null, "ResourceReader is closed!"); 540Debug.Assert(_store != null, "ResourceReader is closed!"); 541Debug.Assert(_version == 1, ".resources file was not a V1 .resources file!"); 622Debug.Assert(_store != null, "ResourceReader is closed!"); 623Debug.Assert(_version >= 2, ".resources file was not a V2 (or higher) .resources file!"); 730Debug.Assert(r == len, "ResourceReader needs to use a blocking read here. (Call _store.ReadBytes(len)?)"); 783Debug.Assert(_store != null, "ResourceReader is closed!"); 1002Debug.Assert(_typeTable[typeIndex] != null, "Should have found a type!"); 1033Debug.Assert(typeCode >= 0, "can't be negative"); 1038Debug.Assert(!string.Equals(typeCode.ToString(), "LastPrimitive"), "Change ResourceTypeCode metadata order so LastPrimitive isn't what Enum.ToString prefers."); 1044Debug.Assert(typeIndex >= 0 && typeIndex < _typeTable.Length, "TypeCode is broken or corrupted!");
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncMethodBuilderCore.cs (3)
146Debug.Assert(continuation != null, "Expected non-null continuation"); 147Debug.Assert(invokeAction != null, "Expected non-null invokeAction"); 148Debug.Assert(innerTask != null, "Expected non-null innerTask");
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilderT.cs (3)
302Debug.Assert((m_stateFlags & (int)InternalTaskOptions.PromiseTask) != 0, "Expected state flags to already be configured."); 303Debug.Assert(m_stateObject is null, "Expected to be able to use the state object field for ExecutionContext."); 487Debug.Assert(task != null, "Expected non-null task");
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncVoidMethodBuilder.cs (1)
152Debug.Assert(context != null, "Must only be used with a non-null context.");
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConditionalWeakTable.cs (6)
389Debug.Assert(table != null, "Must provide a valid table"); 390Debug.Assert(Monitor.IsEntered(table._lock), "Must hold the _lock lock to construct the enumerator"); 391Debug.Assert(table._container != null, "Should not be used on a finalized table"); 392Debug.Assert(table._container.FirstFreeEntry > 0, "Should have returned an empty enumerator instead"); 396Debug.Assert(table._activeEnumeratorRefCount >= 0, "Should never have a negative ref count before incrementing"); 423Debug.Assert(table._activeEnumeratorRefCount >= 0, "Should never have a negative ref count after decrementing");
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\DefaultInterpolatedStringHandler.cs (2)
505Debug.Assert(provider is not CultureInfo || provider.GetFormat(typeof(ICustomFormatter)) is null, "Expected CultureInfo to not provide a custom formatter"); 526Debug.Assert(formatter != null, "An incorrectly written provider said it implemented ICustomFormatter, and then didn't");
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilderT.cs (1)
408Debug.Assert(StateMachine is not null, $"Null {nameof(StateMachine)}");
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs (10)
32Debug.Assert(task != null, "Constructing an awaiter requires a task to await."); 107Debug.Assert(taskCompleted, "With an infinite timeout, the task should have always completed."); 129Debug.Assert(task.IsCompleted, "Task must have been completed by now."); 130Debug.Assert(task.Status != TaskStatus.RanToCompletion, "Task should not be completed successfully."); 217Debug.Assert(task != null, "Need a task to wait on"); 218Debug.Assert(continuation != null, "Need a continuation to invoke when the wait completes"); 298Debug.Assert(task != null, "Constructing an awaiter requires a task to await."); 366Debug.Assert(task != null, "Constructing an awaitable requires a task to await."); 394Debug.Assert(task != null, "Constructing an awaiter requires a task to await."); 476Debug.Assert(task != null, "Constructing an awaiter requires a task to await.");
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\CollectionsMarshal.cs (2)
29Debug.Assert(items is not null, "Implementation depends on List<T> always having an array."); 37Debug.Assert(typeof(T[]) == list._items.GetType(), "Implementation depends on List<T> always using a T[] and not U[] where U : T.");
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.Unix.cs (1)
37Debug.Assert(bufferLength >= (s.Length + 1) * SystemMaxDBCSCharSize, "Insufficient buffer length passed to StringToAnsiString");
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (1)
279Debug.Assert(allContexts != null, "Creating the default context should have initialized the contexts collection.");
src\libraries\System.Private.CoreLib\src\System\Runtime\MemoryFailPoint.cs (1)
337Debug.Assert(Volatile.Read(ref s_failPointReservedMemory) >= 0, "Process-wide MemoryFailPoint reserved memory was negative!");
src\libraries\System.Private.CoreLib\src\System\Runtime\Serialization\SerializationInfo.cs (14)
105Debug.Assert(_names.Length == _count, "[SerializationInfo.ExpandArrays]_names.Length == _count"); 267Debug.Assert(null != name, "[SerializationInfo.UpdateValue]name!=null"); 268Debug.Assert(null != value, "[SerializationInfo.UpdateValue]value!=null"); 269Debug.Assert(type is not null, "[SerializationInfo.UpdateValue]type!=null"); 310Debug.Assert(index < _values.Length, "[SerializationInfo.GetElement]index<_values.Length"); 311Debug.Assert(index < _types.Length, "[SerializationInfo.GetElement]index<_types.Length"); 314Debug.Assert(foundType is not null, "[SerializationInfo.GetElement]foundType!=null"); 327Debug.Assert(index < _values.Length, "[SerializationInfo.GetElement]index<_values.Length"); 328Debug.Assert(index < _types.Length, "[SerializationInfo.GetElement]index<_types.Length"); 331Debug.Assert(foundType is not null, "[SerializationInfo.GetElement]foundType!=null"); 349Debug.Assert(_converter != null, "[SerializationInfo.GetValue]_converter!=null"); 355Debug.Assert(type is not null, "[SerializationInfo.GetValue]type ==null"); 356Debug.Assert(type is RuntimeType, "[SerializationInfo.GetValue]type is not a runtime type"); 367Debug.Assert(_converter != null, "[SerializationInfo.GetValue]_converter!=null");
src\libraries\System.Private.CoreLib\src\System\Runtime\Serialization\SerializationInfoEnumerator.cs (7)
38Debug.Assert(members != null, "[SerializationInfoEnumerator.ctor]members!=null"); 39Debug.Assert(info != null, "[SerializationInfoEnumerator.ctor]info!=null"); 40Debug.Assert(types != null, "[SerializationInfoEnumerator.ctor]types!=null"); 41Debug.Assert(numItems >= 0, "[SerializationInfoEnumerator.ctor]numItems>=0"); 42Debug.Assert(members.Length >= numItems, "[SerializationInfoEnumerator.ctor]members.Length>=numItems"); 43Debug.Assert(info.Length >= numItems, "[SerializationInfoEnumerator.ctor]info.Length>=numItems"); 44Debug.Assert(types.Length >= numItems, "[SerializationInfoEnumerator.ctor]types.Length>=numItems");
src\libraries\System.Private.CoreLib\src\System\Runtime\Versioning\VersioningHelper.cs (1)
166Debug.Assert(requires == SxSRequirements.None, "Computed a strange set of required resource scoping. It's probably wrong.");
src\libraries\System.Private.CoreLib\src\System\SearchValues\IndexOfAnyAsciiSearcher.cs (12)
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\ProbabilisticWithAsciiCharSearchValues.cs (4)
57Debug.Assert(_inverseAsciiState.Lookup.Contains(0), "The inverse bitmap did not contain a 0."); 66Debug.Assert(!(Ssse3.IsSupported || PackedSimd.IsSupported) || !_inverseAsciiState.Lookup.Contains(0), 156Debug.Assert(_inverseAsciiState.Lookup.Contains(0), "The inverse bitmap did not contain a 0."); 165Debug.Assert(!(Ssse3.IsSupported || PackedSimd.IsSupported) || !_inverseAsciiState.Lookup.Contains(0),
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasickBuilder.cs (1)
44Debug.Assert(_nodes[0].MatchLength == 0, "The root node shouldn't have a match.");
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\RabinKarp.cs (2)
112Debug.Assert(span.Length <= MaxInputLength, "Teddy should have handled short inputs."); 164Debug.Assert(span.Length <= MaxInputLength, "Teddy should have handled long inputs.");
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\StringSearchValuesHelper.cs (1)
147Debug.Assert(matchStart == candidate[0], "This should only be called after the first character has been checked");
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\TeddyBucketizer.cs (2)
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.");
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValues.cs (1)
340Debug.Assert(newValuesCount > values.Length, "Shouldn't have been called if there were no letters present");
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValuesBase.cs (2)
30Debug.Assert(_uniqueValues is not null, "ContainsCore should be overridden if uniqueValues weren't provided."); 36Debug.Assert(_uniqueValues is not null, "GetValues should be overridden if uniqueValues weren't provided.");
src\libraries\System.Private.CoreLib\src\System\Security\SecureString.cs (2)
55Debug.Assert(str._buffer != null, "Expected other SecureString's buffer to be non-null"); 56Debug.Assert(str._encrypted, "Expected to be used only on encrypted SecureStrings");
src\libraries\System.Private.CoreLib\src\System\Security\SecurityElement.cs (7)
87Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 176Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 237Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 306Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 346Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 421Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 485Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly");
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.T.cs (32)
1059Debug.Assert(length >= 0, "Expected non-negative length"); 1074Debug.Assert(length >= 0, "Expected non-negative length"); 1089Debug.Assert(length >= 0, "Expected non-negative length"); 1105Debug.Assert(length >= 0, "Expected non-negative length"); 1121Debug.Assert(length >= 0, "Expected non-negative length"); 1139Debug.Assert(length >= 0, "Expected non-negative length"); 1157Debug.Assert(length >= 0, "Expected non-negative length"); 1176Debug.Assert(length >= 0, "Expected non-negative length"); 1316Debug.Assert(length >= 0, "Expected non-negative length"); 1317Debug.Assert(value is byte or short or int or long, "Expected caller to normalize to one of these types"); 1496Debug.Assert(length >= 0, "Expected non-negative length"); 1497Debug.Assert(value is byte or short or int or long, "Expected caller to normalize to one of these types"); 1702Debug.Assert(length >= 0, "Expected non-negative length"); 1703Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 1909Debug.Assert(length >= 0, "Expected non-negative length"); 1910Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 2101Debug.Assert(length >= 0, "Expected non-negative length"); 2102Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 2263Debug.Assert(length >= 0, "Expected non-negative length"); 2264Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 2429Debug.Assert(length >= 0, "Expected non-negative length"); 2430Debug.Assert(value is byte or short or int or long, "Expected caller to normalize to one of these types"); 2549Debug.Assert(length >= 0, "Expected non-negative length"); 2550Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 2734Debug.Assert(length >= 0, "Expected non-negative length"); 2735Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 2920Debug.Assert(length >= 0, "Expected non-negative length"); 2921Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 3092Debug.Assert(Vector128.IsHardwareAccelerated && Vector128<T>.IsSupported, "Vector128 is not HW-accelerated or not supported"); 3149Debug.Assert(Vector512.IsHardwareAccelerated && Vector512<T>.IsSupported, "Vector512 is not HW-accelerated or not supported"); 3187Debug.Assert(length >= 0, "Expected non-negative length"); 3188Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types");
src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (6)
83Debug.Assert(strA._firstChar == strB._firstChar, 190Debug.Assert(*(a + 1) != *(b + 1), "This char must be different if we reach here!"); 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");
src\libraries\System.Private.CoreLib\src\System\String.cs (1)
551Debug.Assert(stringLength == doubleCheck,
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (3)
139Debug.Assert(position <= totalLength - s.Length, "We didn't allocate enough space for the result string!"); 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!");
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.CaseConversion.cs (2)
268Debug.Assert((nuint)(&pDest[i]) % expectedWriteAlignment == 0, "Destination buffer wasn't properly aligned!"); 275Debug.Assert(i <= elementCount, "We overran a buffer somewhere.");
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Utility.cs (64)
144Debug.Assert(0 < numBytesRead && numBytesRead <= Vector512.Size, "We should've made forward progress of at least one byte."); 145Debug.Assert((nuint)numBytesRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 148Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 152Debug.Assert((nuint)pBuffer % Vector512.Size == 0, "Vector read should be aligned."); 180Debug.Assert(0 < numBytesRead && numBytesRead <= Vector256.Size, "We should've made forward progress of at least one byte."); 181Debug.Assert((nuint)numBytesRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 184Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 188Debug.Assert((nuint)pBuffer % Vector256.Size == 0, "Vector read should be aligned."); 216Debug.Assert(0 < numBytesRead && numBytesRead <= Vector128.Size, "We should've made forward progress of at least one byte."); 217Debug.Assert((nuint)numBytesRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 220Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 224Debug.Assert((nuint)pBuffer % Vector128.Size == 0, "Vector read should be aligned."); 324Debug.Assert(!AllBytesInUInt32AreAscii(currentUInt32), "Shouldn't have reached this point if we have an all-ASCII input."); 358Debug.Assert(Sse2.IsSupported || AdvSimd.Arm64.IsSupported, "Sse2 or AdvSimd64 required."); 359Debug.Assert(BitConverter.IsLittleEndian, "This SSE2/Arm64 implementation assumes little-endian."); 416Debug.Assert(0 < numBytesRead && numBytesRead <= SizeOfVector128, "We should've made forward progress of at least one byte."); 417Debug.Assert((nuint)numBytesRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 583Debug.Assert(ContainsNonAsciiByte_Sse2(currentSseMask), "Shouldn't be here unless we see non-ASCII data."); 588Debug.Assert(ContainsNonAsciiByte_AdvSimd(currentAdvSimdIndex), "Shouldn't be here unless we see non-ASCII data."); 601Debug.Assert(!AllBytesInUInt32AreAscii(currentDWord), "Shouldn't be here unless we see non-ASCII data."); 760Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector512InChars, "We should've made forward progress of at least one char."); 761Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 764Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 768Debug.Assert((nuint)pBuffer % Vector512.Size == 0, "Vector read should be aligned."); 796Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector256InChars, "We should've made forward progress of at least one char."); 797Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 800Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 804Debug.Assert((nuint)pBuffer % Vector256.Size == 0, "Vector read should be aligned."); 831Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector128InChars, "We should've made forward progress of at least one char."); 832Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 835Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 839Debug.Assert((nuint)pBuffer % Vector128.Size == 0, "Vector read should be aligned."); 918Debug.Assert(totalNumBytesRead % sizeof(char) == 0, "Total number of bytes read should be even since we're working with chars."); 923Debug.Assert(!AllCharsInUInt32AreAscii(currentUInt32), "Shouldn't have reached this point if we have an all-ASCII input."); 951Debug.Assert(Sse2.IsSupported || AdvSimd.Arm64.IsSupported, "Should've been checked by caller."); 952Debug.Assert(BitConverter.IsLittleEndian, "This SSE2/Arm64 assumes little-endian."); 998Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector128InChars, "We should've made forward progress of at least one char."); 999Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 1077Debug.Assert(((nuint)pBuffer - (nuint)pOriginalBuffer) % 2 == 0, "Shouldn't have incremented any pointer by an odd byte count."); 1120Debug.Assert(currentMask != 0, "Shouldn't be here unless we see non-ASCII data."); 1145Debug.Assert(!AllCharsInUInt32AreAscii(currentDWord), "Shouldn't be here unless we see non-ASCII data."); 1481Debug.Assert(!AllCharsInUInt32AreAscii(utf16Data32BitsHigh), "Shouldn't have reached this point if we have an all-ASCII input."); 1697Debug.Assert(Vector128.IsHardwareAccelerated, "Vector128 is required."); 1698Debug.Assert(BitConverter.IsLittleEndian, "This implementation assumes little-endian."); 1750Debug.Assert(0 < currentOffsetInElements && currentOffsetInElements <= SizeOfVector128, "We wrote at least 1 byte but no more than a whole vector."); 1751Debug.Assert(currentOffsetInElements <= elementCount, "Shouldn't have overrun the destination buffer."); 1752Debug.Assert(elementCount - currentOffsetInElements >= SizeOfVector128, "We should be able to run at least one whole vector."); 1770Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % SizeOfVector128 == 0, "Write should be aligned."); 1793Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % sizeof(ulong) == 0, "Destination should be ulong-aligned."); 1815Debug.Assert(Vector256.IsHardwareAccelerated, "Vector256 is required."); 1816Debug.Assert(BitConverter.IsLittleEndian, "This implementation assumes little-endian."); 1867Debug.Assert(0 < currentOffsetInElements && currentOffsetInElements <= Vector256.Size, "We wrote at least 1 byte but no more than a whole vector."); 1868Debug.Assert(currentOffsetInElements <= elementCount, "Shouldn't have overrun the destination buffer."); 1869Debug.Assert(elementCount - currentOffsetInElements >= Vector256.Size, "We should be able to run at least one whole vector."); 1887Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % Vector256.Size == 0, "Write should be aligned."); 1910Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % Vector128.Size == 0, "Destination should be 128-bit-aligned."); 1932Debug.Assert(Vector512.IsHardwareAccelerated, "Vector512 is required."); 1933Debug.Assert(BitConverter.IsLittleEndian, "This implementation assumes little-endian."); 1985Debug.Assert(0 < currentOffsetInElements && currentOffsetInElements <= Vector512.Size, "We wrote at least 1 byte but no more than a whole vector."); 1986Debug.Assert(currentOffsetInElements <= elementCount, "Shouldn't have overrun the destination buffer."); 1987Debug.Assert(elementCount - currentOffsetInElements >= Vector512.Size, "We should be able to run at least one whole vector."); 2005Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % Vector512.Size == 0, "Write should be aligned."); 2028Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % Vector256.Size == 0, "Destination should be 256-bit-aligned."); 2135Debug.Assert(!AllBytesInUInt32AreAscii(asciiData), "Shouldn't have reached this point if we have an all-ASCII input.");
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Utility.Helpers.cs (1)
43Debug.Assert(!AllBytesInUInt32AreAscii(value), "Caller shouldn't provide an all-ASCII value.");
src\libraries\System.Private.CoreLib\src\System\Text\ASCIIEncoding.cs (14)
156Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 157Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 349Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 350Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 351Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 352Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 408Debug.Assert(idx <= numElementsToConvert, "Somehow went beyond bounds of source or destination buffer?"); 498Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 499Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 640Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 641Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 642Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 643Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 696Debug.Assert(idx <= numElementsToConvert, "Somehow went beyond bounds of source or destination buffer?");
src\libraries\System.Private.CoreLib\src\System\Text\CompositeFormat.cs (1)
46Debug.Assert((segment.Literal is not null) ^ (segment.ArgIndex >= 0), "The segment should represent a literal or a format hole, but not both.");
src\libraries\System.Private.CoreLib\src\System\Text\Decoder.cs (1)
178Debug.Assert(result <= charCount, "Returned more chars than we have space for");
src\libraries\System.Private.CoreLib\src\System\Text\DecoderFallback.cs (2)
109Debug.Assert(byteStart != null, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize"); 164Debug.Assert(byteStart != null, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize");
src\libraries\System.Private.CoreLib\src\System\Text\DecoderNLS.cs (6)
227Debug.Assert(_fallbackBuffer is null || _fallbackBuffer.Remaining == 0, "Should have no data remaining in the fallback buffer."); 228Debug.Assert(HasLeftoverData, "Caller shouldn't invoke this routine unless there's leftover data in the decoder."); 268Debug.Assert(charCount >= 0, "Fallback buffer shouldn't have returned a negative char count."); 283Debug.Assert(_fallbackBuffer is null || _fallbackBuffer.Remaining == 0, "Should have no data remaining in the fallback buffer."); 284Debug.Assert(HasLeftoverData, "Caller shouldn't invoke this routine unless there's leftover data in the decoder."); 351Debug.Assert(combinedBufferBytesConsumed == combinedBuffer.Length, "We should be asked to persist the entire combined buffer.");
src\libraries\System.Private.CoreLib\src\System\Text\DecoderReplacementFallback.cs (1)
132Debug.Assert(_fallbackIndex < _strDefault.Length && _fallbackIndex >= 0,
src\libraries\System.Private.CoreLib\src\System\Text\Encoder.cs (1)
176Debug.Assert(result <= byteCount, "Returned more bytes than we have space for");
src\libraries\System.Private.CoreLib\src\System\Text\EncoderFallback.cs (2)
262Debug.Assert(byteCountThisIteration >= 0, "Encoding shouldn't have returned a negative byte count."); 299Debug.Assert(charStart != null,
src\libraries\System.Private.CoreLib\src\System\Text\EncoderLatin1BestFitFallback.cs (2)
142Debug.Assert(index + 1 < ArrayCharBestFit.Length, 163Debug.Assert(index + 1 < ArrayCharBestFit.Length,
src\libraries\System.Private.CoreLib\src\System\Text\EncoderNLS.cs (1)
287Debug.Assert(byteCount >= 0, "Encoding shouldn't have returned a negative byte count.");
src\libraries\System.Private.CoreLib\src\System\Text\EncoderReplacementFallback.cs (1)
160Debug.Assert(_fallbackIndex < _strDefault.Length && _fallbackIndex >= 0,
src\libraries\System.Private.CoreLib\src\System\Text\Encoding.cs (6)
711Debug.Assert(result <= byteCount, "[Encoding.GetBytes]Returned more bytes than we have space for"); 860Debug.Assert(result <= charCount, "[Encoding.GetChars]Returned more chars than we have space for"); 1287Debug.Assert(_fallbackBuffer.Remaining == 0, 1339Debug.Assert(_bytes < _byteEnd, "[EncodingCharBuffer.GetNextByte]Expected more date"); 1446Debug.Assert(moreBytesExpected >= 0, "[EncodingByteBuffer.AddByte]expected non-negative moreBytesExpected"); 1488Debug.Assert(_chars > _charStart ||
src\libraries\System.Private.CoreLib\src\System\Text\Encoding.Internal.cs (59)
123Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS."); 124Debug.Assert(charCount >= 0, "Caller should've checked this condition."); 125Debug.Assert(pChars != null || charCount == 0, "Cannot provide a null pointer and a non-zero count."); 231Debug.Assert(0 <= charsConsumedSoFar && charsConsumedSoFar < originalCharCount, "Invalid arguments provided to method."); 257Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS."); 258Debug.Assert(0 <= charsConsumedSoFar && charsConsumedSoFar <= originalCharCount, "Caller should've checked this condition."); 313Debug.Assert(originalCharsLength >= 0, "Caller provided invalid parameter."); 347Debug.Assert(byteCountThisIteration >= 0, "Fallback shouldn't have returned a negative value."); 348Debug.Assert(charsConsumedThisIteration >= 0, "Fallback shouldn't have returned a negative value."); 370Debug.Assert(byteCountThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 371Debug.Assert(charsConsumedThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 385Debug.Assert(fallbackBuffer.Remaining == 0, "There should be no data in the fallback buffer after GetByteCount."); 400Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS."); 401Debug.Assert(charCount >= 0, "Caller should've checked this condition."); 402Debug.Assert(pChars != null || charCount == 0, "Cannot provide a null pointer and a non-zero count."); 403Debug.Assert(byteCount >= 0, "Caller should've checked this condition."); 404Debug.Assert(pBytes != null || byteCount == 0, "Cannot provide a null pointer and a non-zero count."); 494Debug.Assert(0 <= charsConsumedSoFar && charsConsumedSoFar < originalCharCount, "Invalid arguments provided to method."); 495Debug.Assert(0 <= bytesWrittenSoFar && bytesWrittenSoFar <= originalByteCount, "Invalid arguments provided to method."); 524Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS."); 525Debug.Assert(0 <= charsConsumedSoFar && charsConsumedSoFar <= originalCharCount, "Caller should've checked this condition."); 526Debug.Assert(0 <= bytesWrittenSoFar && bytesWrittenSoFar <= originalByteCount, "Caller should've checked this condition."); 589Debug.Assert(originalCharsLength >= 0, "Caller provided invalid parameter."); 590Debug.Assert(originalBytesLength >= 0, "Caller provided invalid parameter."); 608Debug.Assert(charsConsumedThisIteration == chars.Length, "If returning NeedMoreData, should out the entire buffer length as chars consumed."); 658Debug.Assert(bytesWrittenThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 659Debug.Assert(charsConsumedThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 697Debug.Assert(originalCharsLength >= chars.Length, "About to report a negative number of chars used?"); 701Debug.Assert(fallbackBuffer.Remaining == 0 || encoder != null, "Shouldn't have any leftover data in fallback buffer unless an EncoderNLS is in use."); 716Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS."); 717Debug.Assert(byteCount >= 0, "Caller should've checked this condition."); 718Debug.Assert(pBytes != null || byteCount == 0, "Cannot provide a null pointer and a non-zero count."); 725Debug.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, "Fallback buffer can't hold data between GetChars invocations."); 825Debug.Assert(0 <= bytesConsumedSoFar && bytesConsumedSoFar < originalByteCount, "Invalid arguments provided to method."); 851Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS."); 852Debug.Assert(0 <= bytesConsumedSoFar && bytesConsumedSoFar <= originalByteCount, "Caller should've checked this condition."); 913Debug.Assert(originalBytesLength >= 0, "Caller provided invalid parameter."); 944Debug.Assert(charCountThisIteration >= 0, "Fallback shouldn't have returned a negative value."); 966Debug.Assert(charCountThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 967Debug.Assert(bytesConsumedThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 981Debug.Assert(fallbackBuffer.Remaining == 0, "There should be no data in the fallback buffer after GetCharCount."); 996Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS."); 997Debug.Assert(byteCount >= 0, "Caller should've checked this condition."); 998Debug.Assert(pBytes != null || byteCount == 0, "Cannot provide a null pointer and a non-zero count."); 999Debug.Assert(charCount >= 0, "Caller should've checked this condition."); 1000Debug.Assert(pChars != null || charCount == 0, "Cannot provide a null pointer and a non-zero count."); 1090Debug.Assert(0 <= bytesConsumedSoFar && bytesConsumedSoFar < originalByteCount, "Invalid arguments provided to method."); 1091Debug.Assert(0 <= charsWrittenSoFar && charsWrittenSoFar <= originalCharCount, "Invalid arguments provided to method."); 1120Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS."); 1121Debug.Assert(0 <= bytesConsumedSoFar && bytesConsumedSoFar <= originalByteCount, "Caller should've checked this condition."); 1122Debug.Assert(0 <= charsWrittenSoFar && charsWrittenSoFar <= originalCharCount, "Caller should've checked this condition."); 1146Debug.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, "Should be no remaining fallback data at this point."); 1190Debug.Assert(originalBytesLength >= 0, "Caller provided invalid parameter."); 1191Debug.Assert(originalCharsLength >= 0, "Caller provided invalid parameter."); 1210Debug.Assert(bytesConsumedThisIteration == bytes.Length, "If returning NeedMoreData, should out the entire buffer length as bytes consumed."); 1227Debug.Assert(charsWrittenThisIteration >= 0, "Fallback shouldn't have returned a negative value."); 1258Debug.Assert(charsWrittenThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 1259Debug.Assert(bytesConsumedThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 1294Debug.Assert(originalBytesLength >= bytes.Length, "About to report a negative number of bytes used?");
src\libraries\System.Private.CoreLib\src\System\Text\Latin1Encoding.cs (10)
108Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 109Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 295Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 296Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 297Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 298Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 601Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 602Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 603Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 604Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified.");
src\libraries\System.Private.CoreLib\src\System\Text\Latin1Utility.cs (22)
63Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVectorInChars, "We should've made forward progress of at least one char."); 64Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 67Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 71Debug.Assert((nuint)pBuffer % SizeOfVectorInChars == 0, "Vector read should be aligned."); 149Debug.Assert(totalNumBytesRead % sizeof(char) == 0, "Total number of bytes read should be even since we're working with chars."); 154Debug.Assert(!AllCharsInUInt32AreLatin1(currentUInt32), "Shouldn't have reached this point if we have an all-Latin-1 input."); 184Debug.Assert(Sse2.IsSupported, "Should've been checked by caller."); 185Debug.Assert(BitConverter.IsLittleEndian, "SSE2 assumes little-endian."); 240Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector128InChars, "We should've made forward progress of at least one char."); 241Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 370Debug.Assert(((nuint)pBuffer - (nuint)pOriginalBuffer) % 2 == 0, "Shouldn't have incremented any pointer by an odd byte count."); 425Debug.Assert(currentMask != 0, "Shouldn't be here unless we see non-Latin-1 data."); 433Debug.Assert(!AllCharsInUInt32AreLatin1(currentDWord), "Shouldn't be here unless we see non-Latin-1 data."); 550Debug.Assert(BitConverter.IsLittleEndian, "Assume little endian if SSE2 is supported."); 746Debug.Assert(!AllCharsInUInt32AreLatin1(utf16Data32BitsHigh), "Shouldn't have reached this point if we have an all-Latin-1 input."); 862Debug.Assert(0 < currentOffsetInElements && currentOffsetInElements <= SizeOfVector128, "We wrote at least 1 byte but no more than a whole vector."); 864Debug.Assert(currentOffsetInElements <= elementCount, "Shouldn't have overrun the destination buffer."); 865Debug.Assert(elementCount - currentOffsetInElements >= SizeOfVector128, "We should be able to run at least one whole vector."); 898Debug.Assert(((nuint)pLatin1Buffer + currentOffsetInElements) % SizeOfVector128 == 0, "Write should be aligned."); 933Debug.Assert(((nuint)pLatin1Buffer + currentOffsetInElements) % sizeof(ulong) == 0, "Destination should be ulong-aligned."); 1027Debug.Assert(elementCount - currentOffset < SizeOfVector128, "Case where 2 vectors remained should've been in the hot loop."); 1098Debug.Assert(elementCount - currentOffset < SizeOfVector, "Vectorized logic should result in less than a vector's length of data remaining.");
src\libraries\System.Private.CoreLib\src\System\Text\Rune.cs (3)
226Debug.Assert(!GlobalizationMode.Invariant, "This should've been checked by the caller."); 227Debug.Assert(textInfo != null, "This should've been checked by the caller."); 1214Debug.Assert(!value.IsAscii, "Shouldn't use this non-optimized code path for ASCII characters.");
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (25)
238Debug.Assert(m_ChunkOffset + m_ChunkChars.Length >= m_ChunkOffset, "The length of the string is greater than int.MaxValue."); 431Debug.Assert(newLen == chunk.m_ChunkChars.Length, "The new chunk should be larger or equal to the one it is replacing."); 441Debug.Assert(Length == value, "Something went wrong setting Length."); 684Debug.Assert(repeatCount > 0, "Invalid length; should have been validated by caller."); 706Debug.Assert(m_ChunkLength == 0, "A new block was not created."); 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"); 1414Debug.Assert(typeof(T).Assembly.Equals(typeof(object).Assembly), "Implementation trusts the results of TryFormat because T is expected to be something known"); 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!"); 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."); 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."); 2548Debug.Assert(Capacity == Length, nameof(ExpandByABlock) + " should only be called when there is no space left."); 2765Debug.Assert(chunk != null, "We fell off the beginning of the string!"); 2797Debug.Assert(chunk != null, "We fell off the beginning of the string!"); 3139Debug.Assert(formatter != null, "An incorrectly written provider said it implemented ICustomFormatter, and then didn't");
src\libraries\System.Private.CoreLib\src\System\Text\TranscodingStream.cs (1)
93Debug.Assert(disposing, "This type isn't finalizable.");
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf16Utility.Validation.cs (5)
26Debug.Assert(inputLength >= 0, "Input length must not be negative."); 27Debug.Assert(pInputBuffer != null || inputLength == 0, "Input length must be zero if input buffer pointer is null."); 91Debug.Assert((debugMask & 0b_1010_1010_1010_1010) == 0, "Shouldn't have set the 0x8000 bit of any element in 'charIsNonAscii'."); 193Debug.Assert((highSurrogatesMask & lowSurrogatesMask) == 0, 196Debug.Assert(((highSurrogatesMask | lowSurrogatesMask) & 0b_1010_1010_1010_1010u) == 0,
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8.cs (1)
658Debug.Assert(formatter is not null, "An incorrectly written provider said it implemented ICustomFormatter, and then didn't");
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.Helpers.cs (3)
726Debug.Assert(IsFirstCharAtLeastThreeUtf8Bytes(value) && !IsFirstCharSurrogate(value), "First half of value should've been 0800..D7FF or E000..FFFF"); 727Debug.Assert(IsSecondCharAtLeastThreeUtf8Bytes(value) && !IsSecondCharSurrogate(value), "Second half of value should've been 0800..D7FF or E000..FFFF"); 761Debug.Assert(IsFirstCharAtLeastThreeUtf8Bytes(value) && !IsFirstCharSurrogate(value), "First half of value should've been 0800..D7FF or E000..FFFF");
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.Transcoding.cs (10)
22Debug.Assert(inputLength >= 0, "Input length must not be negative."); 23Debug.Assert(pInputBuffer != null || inputLength == 0, "Input length must be zero if input buffer pointer is null."); 25Debug.Assert(outputCharsRemaining >= 0, "Destination length must not be negative."); 26Debug.Assert(pOutputBuffer != null || outputCharsRemaining == 0, "Destination length must be zero if destination buffer pointer is null."); 72Debug.Assert(pLastBufferPosProcessed < pInputBuffer, "Algorithm should've made forward progress since last read."); 842Debug.Assert(inputLength >= 0, "Input length must not be negative."); 843Debug.Assert(pInputBuffer != null || inputLength == 0, "Input length must be zero if input buffer pointer is null."); 845Debug.Assert(outputBytesRemaining >= 0, "Destination length must not be negative."); 846Debug.Assert(pOutputBuffer != null || outputBytesRemaining == 0, "Destination length must be zero if destination buffer pointer is null."); 906Debug.Assert(pLastBufferPosProcessed < pInputBuffer, "Algorithm should've made forward progress since last read.");
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.Validation.cs (4)
26Debug.Assert(inputLength >= 0, "Input length must not be negative."); 27Debug.Assert(pInputBuffer != null || inputLength == 0, "Input length must be zero if input buffer pointer is null."); 77Debug.Assert(pLastBufferPosProcessed < pInputBuffer, "Algorithm should've made forward progress since last read."); 729Debug.Assert(pOriginalInputBuffer + originalInputLength == pInputBuffer, "About to return an unexpected value.");
src\libraries\System.Private.CoreLib\src\System\Text\UnicodeEncoding.cs (32)
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 (25)
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"); 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 (14)
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\Threading\CancellationTokenSource.cs (9)
346Debug.Assert(IsCancellationCompleted, "Expected cancellation to have finished"); 589Debug.Assert(this != s_neverCanceledSource, "This source should never be exposed via a 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"); 1059Debug.Assert(node != null, "Expected non-null node"); 1060Debug.Assert(node.Registrations == this, "Expected node to come from this registrations instance"); 1207Debug.Assert(registrations != null, "Expected non-null parent registrations");
src\libraries\System.Private.CoreLib\src\System\Threading\EventWaitHandle.cs (1)
43Debug.Assert(result != null, "result should be non-null on success");
src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs (6)
298Debug.Assert(executionContext != null && !executionContext.m_isDefault, "ExecutionContext argument is Default."); 351Debug.Assert(Thread.CurrentThread._executionContext == null, "ThreadPool thread not on Default ExecutionContext."); 352Debug.Assert(Thread.CurrentThread._synchronizationContext == null, "ThreadPool thread not on Default SynchronizationContext."); 457Debug.Assert(current.m_localValues != null, "Only the default context should have null, and we shouldn't be here on the default context"); 471Debug.Assert(current.m_localValues != null, "Only the default context should have null, and we shouldn't be here on the default context"); 494Debug.Assert(current.m_localValues != null, "Only the default context should have null, and we shouldn't be here on the default context");
src\libraries\System.Private.CoreLib\src\System\Threading\IOCompletionCallbackHelper.cs (1)
28Debug.Assert(helper != null, "IOCompletionCallbackHelper cannot be null");
src\libraries\System.Private.CoreLib\src\System\Threading\ManualResetEventSlim.cs (8)
111Debug.Assert(value >= 0, "SpinCount is a restricted-width integer. The value supplied is outside the legal range."); 112Debug.Assert(value <= SpinCountState_MaxValue, "SpinCount is a restricted-width integer. The value supplied is outside the legal range."); 127Debug.Assert(value >= 0, "NumWaiters should never be less than zero. This indicates an internal error."); 194Debug.Assert(DEFAULT_SPIN_SP >= 0, "Internal error - DEFAULT_SPIN_SP is outside the legal range."); 195Debug.Assert(DEFAULT_SPIN_SP <= SpinCountState_MaxValue, "Internal error - DEFAULT_SPIN_SP is outside the legal range."); 240Debug.Assert(currentIsSet, 656Debug.Assert(obj is ManualResetEventSlim, "Expected a ManualResetEventSlim"); 678Debug.Assert((newBits | updateBitsMask) == updateBitsMask, "newBits do not fall within the updateBitsMask.");
src\libraries\System.Private.CoreLib\src\System\Threading\Mutex.cs (1)
53Debug.Assert(result != null, "result should be non-null on success");
src\libraries\System.Private.CoreLib\src\System\Threading\PeriodicTimer.cs (1)
218Debug.Assert(!_stopped, "Unexpectedly stopped without _signaled being true.");
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WaitThread.cs (1)
127Debug.Assert(current != null, "The wait thread to remove was not found in the list of thread pool wait threads.");
src\libraries\System.Private.CoreLib\src\System\Threading\ReaderWriterLockSlim.cs (6)
587Debug.Assert(_numWriteUpgradeWaiters == 0, "There can be at most one thread with the upgrade lock held."); 615Debug.Assert(lrwc != null, "Initialized based on _fIsReentrant earlier in the method"); 756Debug.Assert(lrwc != null, "Initialized based on _fIsReentrant earlier in the method"); 795Debug.Assert(_owners > 0, "ReleasingReaderLock: releasing lock and no read lock taken"); 843Debug.Assert((_owners & WRITER_HELD) > 0, "Calling ReleaseWriterLock when no write lock is held"); 1609Debug.Assert(_isLocked, "Exiting spin lock that is not held");
src\libraries\System.Private.CoreLib\src\System\Threading\Semaphore.cs (1)
45Debug.Assert(result != null, "result should be non-null on success");
src\libraries\System.Private.CoreLib\src\System\Threading\SemaphoreSlim.cs (13)
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"); 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 (1)
117Debug.Assert(!IsThreadOwnerTrackingEnabled, "property should be false by now");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\CachedCompletedInt32Task.cs (1)
26Debug.Assert(task.IsCompletedSuccessfully, "Expected that a stored last task completed successfully");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (25)
200Debug.Assert(ReadyToComplete, "The block must be ready to complete to be here."); 213Debug.Assert(!localThis.m_completionState!.IsCompleted, "Completion should only happen once."); 219Debug.Assert(success, "Expected to complete completion task."); 230Debug.Assert(faultedTask != null && faultedTask.IsFaulted && faultedTask.Exception!.InnerExceptionCount > 0, 340else Debug.Assert(m_processingCount == EXCLUSIVE_PROCESSING_SENTINEL, "The processing count must be the sentinel if it's not >= 0."); 364Debug.Assert(m_processingCount == EXCLUSIVE_PROCESSING_SENTINEL, "Processing exclusive tasks requires being in exclusive mode."); 365Debug.Assert(!m_exclusiveTaskScheduler.m_tasks.IsEmpty, "Processing exclusive tasks requires tasks to be processed."); 370Debug.Assert(m_threadProcessingMode.Value == ProcessingMode.NotCurrentlyProcessing, 388Debug.Assert(m_threadProcessingMode.Value == ProcessingMode.ProcessingExclusiveTask, 399Debug.Assert(m_processingCount == EXCLUSIVE_PROCESSING_SENTINEL, "The processing mode should not have deviated from exclusive."); 412Debug.Assert(m_processingCount > 0, "Processing concurrent tasks requires us to be in concurrent mode."); 417Debug.Assert(m_threadProcessingMode.Value == ProcessingMode.NotCurrentlyProcessing, 446Debug.Assert(m_threadProcessingMode.Value == ProcessingMode.ProcessingConcurrentTasks, 457Debug.Assert(m_processingCount > 0, "The procesing mode should not have deviated from concurrent."); 524Debug.Assert(pair != null, "Scheduler must be associated with a valid pair."); 525Debug.Assert(processingMode == ProcessingMode.ProcessingConcurrentTasks || processingMode == ProcessingMode.ProcessingExclusiveTask, 527Debug.Assert( 547Debug.Assert(task != null, "Infrastructure should have provided a non-null task."); 563Debug.Assert(task != null, "Infrastructure should have provided a non-null task."); 573Debug.Assert(task != null, "Infrastructure should have provided a non-null task."); 647Debug.Assert(t.IsFaulted, "Task should be faulted due to the scheduler faulting it and throwing the exception."); 671Debug.Assert(scheduler != null, "Need a scheduler with which to construct the debug view."); 694Debug.Assert(pair != null, "Need a pair with which to construct the debug view."); 734Debug.Assert(syncObj != null, "The monitor object to check must be provided."); 735Debug.Assert(Monitor.IsEntered(syncObj) == held, "The locking scheme was not correctly followed.");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Future.cs (3)
402Debug.Assert(!IsCompleted, "The promise must not yet be completed."); 444Debug.Assert(!IsWaitNotificationEnabledOrNotRanToCompletion, 463Debug.Assert(IsCompletedSuccessfully, "Task<T>.Result getter: Expected result to have been set.");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\FutureFactory.cs (22)
497Debug.Assert((endFunction != null) != (endAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 641Debug.Assert((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 761Debug.Assert((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 783Debug.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 878Debug.Assert((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 900Debug.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 1003Debug.Assert((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 1025Debug.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 1136Debug.Assert((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 1158Debug.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 1197Debug.Assert(thisRef != null, "Expected a non-null thisRef"); 1198Debug.Assert(beginMethod != null, "Expected a non-null beginMethod"); 1199Debug.Assert(endMethod != null, "Expected a non-null endMethod"); 1212Debug.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 1240Debug.Assert(thisRef != null, "Expected a non-null thisRef"); 1241Debug.Assert(endMethod != null, "Expected a non-null endMethod"); 1287Debug.Assert(!IsCompleted, "The task should not have been completed yet."); 1316Debug.Assert(successfullySet, "Expected the task to not yet be completed"); 1608Debug.Assert((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 1655Debug.Assert((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 1979Debug.Assert((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 2029Debug.Assert((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Sources\ManualResetValueTaskSourceCore.cs (4)
176Debug.Assert(storedContinuation is not null, $"{nameof(storedContinuation)} is null"); 224Debug.Assert(continuation is not null, $"{nameof(continuation)} is null"); 260Debug.Assert(executionContext is not null, $"{nameof(executionContext)} is null"); 319Debug.Assert(continuation is not null, $"{nameof(continuation)} is null");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (86)
187Debug.Assert(task != null, "Null Task objects can't be added to the ActiveTasks collection"); 328Debug.Assert(promiseStyle, "Promise CTOR: promiseStyle was false"); 521Debug.Assert(m_contingentProperties == null || m_contingentProperties.m_capturedContext == null, 565Debug.Assert(illegalInternalOptions == 0, "TaskConstructorCore: Illegal internal options"); 569Debug.Assert(m_stateFlags == 0, "TaskConstructorCore: non-zero m_stateFlags"); 570Debug.Assert((((int)creationOptions) | (int)TaskStateFlags.OptionsMask) == (int)TaskStateFlags.OptionsMask, "TaskConstructorCore: options take too many bits"); 597Debug.Assert((internalOptions & InternalTaskOptions.ContinuationTask) == 0, "TaskConstructorCore: Did not expect to see cancelable token for continuation task."); 685Debug.Assert(((int)TaskStateFlags.OptionsMask & 1) == 1, "OptionsMask needs a shift in Options.get"); 740Debug.Assert((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) != 0, 748Debug.Assert(success, "Tried to set enabled on completed Task"); 778Debug.Assert(tasks != null, "Expected non-null array of tasks"); 815Debug.Assert(isWaitNotificationEnabled, "Should only be called if the wait completion bit is set."); 834Debug.Assert(IsWaitNotificationEnabled, "Should only be called if the wait completion bit is set."); 875Debug.Assert(InternalCurrent == this, "Task.AddNewChild(): Called from an external context"); 896Debug.Assert(InternalCurrent == this, "Task.DisregardChild(): Called from an external context"); 899Debug.Assert(props.m_completionCountdown >= 2, "Task.DisregardChild(): Expected parent count to be >= 2"); 1044Debug.Assert(scheduler != null, "Task.InternalRunSynchronously(): null TaskScheduler"); 1114Debug.Assert( 1131Debug.Assert((m_stateFlags & (int)TaskStateFlags.Canceled) != 0, "Task.RunSynchronously: expected TaskStateFlags.Canceled to be set"); 1261Debug.Assert((e == null) || IsFaulted, "Task.Exception_get(): returning non-null value when not Faulted"); 1661Debug.Assert(m_taskScheduler != null, "expected a task scheduler to have been selected"); 1662Debug.Assert((m_stateFlags & (int)TaskStateFlags.Started) == 0, "task has already started"); 1684Debug.Assert(m_action != null, "Must have a delegate to be in ScheduleAndStart"); 1709Debug.Assert( 1729Debug.Assert(exceptionObject != null, "Task.AddException: Expected a non-null exception object"); 1740Debug.Assert(exceptionObject != null, "Task.AddException: Expected a non-null exception object"); 1748Debug.Assert( 1754Debug.Assert( 1846Debug.Assert(m_contingentProperties != null && m_contingentProperties.m_exceptionsHolder != null, "ExceptionRecorded should imply this"); 1864Debug.Assert(IsFaulted && ExceptionRecorded, "Must only be used when the task has faulted with exceptions."); 1872Debug.Assert(IsCanceled, "Must only be used when the task has canceled."); 1887Debug.Assert(IsCompleted, "ThrowIfExceptional(): Expected IsCompleted == true"); 2155Debug.Assert(childTask.IsCompleted, "ProcessChildCompletion was called for an uncompleted task"); 2157Debug.Assert(childTask.m_contingentProperties?.m_parent == this, "ProcessChildCompletion should only be called for a child of this task"); 2217Debug.Assert(task.IsCompleted, "Expected all tasks in list to be completed"); 2394Debug.Assert(m_action != null, "Null action in InnerInvoke()"); 2531Debug.Assert(!flowExecutionContext, "We already determined we're not required to flow context."); 2630Debug.Assert(waitResult, "expected wait to succeed"); 2786Debug.Assert((m_stateFlags & (int)TaskStateFlags.Faulted) == 0, "Task.Wait() completing when in Faulted state."); 3172Debug.Assert((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) == 0, "Task.InternalCancel() did not expect promise-style task"); 3244Debug.Assert((m_stateFlags & IllegalFlags) == 0, "The continuation was in an invalid state."); 3245Debug.Assert((m_stateFlags & (int)TaskStateFlags.WaitingForActivation) != 0, "Expected continuation to be waiting for activation"); 3264Debug.Assert((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) != 0, "Task.RecordInternalCancellationRequest(CancellationToken) only valid for promise-style task"); 3284Debug.Assert(edi != null, "Expected either an OCE or an EDI"); 3286Debug.Assert(oce != null, "Expected EDI to contain an OCE"); 3288Debug.Assert(oce.CancellationToken == tokenToRecord, 3299Debug.Assert((m_stateFlags & ((int)TaskStateFlags.Canceled | (int)TaskStateFlags.CompletionReserved)) != 0, "Task.CancellationCleanupLogic(): Task not canceled or reserved."); 3331Debug.Assert(this == InternalCurrent, "SetCancellationAcknowledged() should only be called while this is still the current task"); 3332Debug.Assert(IsCancellationRequested, "SetCancellationAcknowledged() should not be called if the task's CT wasn't signaled"); 3369Debug.Assert(exceptionObject != null, "Expected non-null exceptionObject argument"); 3372Debug.Assert( 3414Debug.Assert( 4458Debug.Assert(continuationTask != null, "Task.ContinueWithCore(): null continuationTask"); 4459Debug.Assert(scheduler != null, "Task.ContinueWithCore(): null scheduler"); 4460Debug.Assert(!continuationTask.IsCompleted, "Did not expect continuationTask to be completed"); 4542Debug.Assert(tc != null, "Expected non-null tc object in AddTaskContinuationComplex"); 4545Debug.Assert(oldValue is not null, "Expected non-null m_continuationObject object"); 4581Debug.Assert(oldValue == s_taskCompletionSentinel, "Expected m_continuationObject to be list or sentinel"); 4718Debug.Assert(waitResult, "expected wait to succeed"); 4741Debug.Assert(waitResult, "expected wait to succeed"); 5063Debug.Assert(exceptions != null, "Should have seen at least one exception"); 5092Debug.Assert(tasks != null, "Expected a non-null list of tasks"); 5093Debug.Assert(tasks.Count > 0, "Expected at least one task"); 5139Debug.Assert(count > 0, "Expected count > 0"); 5146Debug.Assert(_count >= 0, "Count should never go below 0"); 5189Debug.Assert(tasks.Length == 0 || waitResult != -1, "expected wait to succeed"); 5451Debug.Assert(succeeded, "This should always succeed on a new task."); 5465Debug.Assert(succeeded, "This should always succeed on a new task."); 5499Debug.Assert(succeeded, "This should always succeed on a new task."); 5513Debug.Assert(succeeded, "This should always succeed on a new task."); 6042Debug.Assert(tasks.Length != 0, "Expected a non-zero length task array"); 6043Debug.Assert(m_stateObject is null, "Expected to be able to use the state object field for faulted/canceled tasks."); 6188Debug.Assert(observedExceptions.Count > 0, "Expected at least one exception"); 6203Debug.Assert(_remainingToComplete >= 0, "Count should never go below 0"); 6396Debug.Assert(tasks != null, "Expected a non-null task array"); 6397Debug.Assert(tasks.Length > 0, "Expected a non-zero length task array"); 6435Debug.Assert(task != null, "Constituent task in WhenAll should never be null"); 6460Debug.Assert(observedExceptions.Count > 0, "Expected at least one exception"); 6481Debug.Assert(m_count >= 0, "Count should never go below 0"); 6682Debug.Assert(success, "Only one task should have gotten to this point, and thus this must be successful."); 7394Debug.Assert(outerTask != null, "Expected non-null outerTask"); 7448Debug.Assert(result, "Expected TrySetFromTask from inner task to succeed"); 7475Debug.Assert(task != null && task.IsCompleted, "Expected non-null, completed outer task"); 7476Debug.Assert(_state == STATE_WAITING_ON_OUTER_TASK, "We're in the wrong state!"); 7488Debug.Assert(result, "Expected TrySetFromTask from outer task to succeed"); 7505Debug.Assert(task != null && task.IsCompleted, "TrySetFromTask: Expected task to have completed.");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskCache.cs (1)
33Debug.Assert(ExclusiveInt32Max >= InclusiveInt32Min, "Expected max to be at least min");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskContinuation.cs (11)
18Debug.Assert(action is Action<Task> || action is Action<Task, object?>, 31Debug.Assert(antecedent != null, 64Debug.Assert(function is Func<Task, TResult> || function is Func<Task, object?, TResult>, 77Debug.Assert(antecedent != null, 110Debug.Assert(action is Action<Task<TAntecedentResult>> || action is Action<Task<TAntecedentResult>, object?>, 123Debug.Assert(antecedent != null, 156Debug.Assert(function is Func<Task<TAntecedentResult>, TResult> || function is Func<Task<TAntecedentResult>, object?, TResult>, 169Debug.Assert(antecedent != null, 274Debug.Assert(task != null, "TaskContinuation ctor: task is null"); 275Debug.Assert(scheduler != null, "TaskContinuation ctor: scheduler is null"); 292Debug.Assert(completedTask.IsCompleted, "ContinuationTask.Run(): completedTask not completed");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskExceptionHolder.cs (17)
47Debug.Assert(task != null, "Expected a non-null task."); 92Debug.Assert(exceptionObject != null, "TaskExceptionHolder.Add(): Expected a non-null exceptionObject"); 93Debug.Assert( 109Debug.Assert(exceptionObject != null, "Expected exceptionObject to be non-null."); 111Debug.Assert(m_cancellationException == null, 116Debug.Assert(m_faultExceptions == null, 129Debug.Assert(edi != null && edi.SourceException is OperationCanceledException, 145Debug.Assert(exceptionObject != null, "AddFaultException(): Expected a non-null exceptionObject"); 173Debug.Assert(exc != null, "No exceptions should be null"); 179Debug.Assert(numExceptions > 0, "Collection should contain at least one exception."); 189Debug.Assert(exceptions.Count > 0, "There should be at least one dispatch info."); 192Debug.Assert(tmp != null, "No dispatch infos should be null"); 255Debug.Assert(exceptions != null, "Expected an initialized list."); 256Debug.Assert(exceptions.Count > 0, "Expected at least one exception."); 284Debug.Assert(exceptions != null, "Expected an initialized list."); 285Debug.Assert(exceptions.Count > 0, "Expected at least one exception."); 300Debug.Assert(edi == null || edi.SourceException is OperationCanceledException,
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskFactory.cs (7)
1554Debug.Assert((tasksCopy != null) && (tasksCopy.Length > 0), "Expected non-null task array with at least one element in it"); 1581Debug.Assert(_count >= 0, "Count should never go below 0"); 1624Debug.Assert((tasksCopy != null) && (tasksCopy.Length > 0), "Expected non-null task array with at least one element in it"); 1651Debug.Assert(_count >= 0, "Count should never go below 0"); 2274Debug.Assert(tasks != null, "Expected non-null collection of tasks"); 2309Debug.Assert(success, "Only one task should have gotten to this point, and thus this must be successful."); 2317Debug.Assert(tasks != null, "Should not have been nulled out yet.");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskScheduler.cs (1)
512Debug.Assert(scheduler != null, "Table returned an incorrect Count or CopyTo failed");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ValueTask.cs (1)
416Debug.Assert(valueTask._obj is null or Task or IValueTaskSource, "If the ValueTask<>'s backing object is an IValueTaskSource<TResult>, it must also be IValueTaskSource.");
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadLocal.cs (4)
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");
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (4)
819Debug.Assert(c > 0, "There must at least be a queue for this thread."); 1448Debug.Assert(_executed, "A QueueUserWorkItemCallback was never called!"); 1456Debug.Assert(!Interlocked.Exchange(ref _executed, true), "A QueueUserWorkItemCallback was called twice!"); 1611Debug.Assert(helper != null, "Null state passed to PerformWaitOrTimerCallback!");
src\libraries\System.Private.CoreLib\src\System\Threading\Timer.cs (3)
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.");
src\libraries\System.Private.CoreLib\src\System\Threading\Win32ThreadPoolNativeOverlapped.cs (2)
193Debug.Assert(data._callback != null, "Does CompleteWithCallback called after Reset?"); 230Debug.Assert(data._callback != null, "Does OnExecutionContextCallback called after Reset?");
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.AdjustmentRule.cs (1)
243Diagnostics.Debug.Assert(daylightDelta <= MaxDaylightDelta && daylightDelta >= -MaxDaylightDelta,
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.cs (4)
315Debug.Assert(rule.NoDaylightTransitions, "GetPreviousAdjustmentRule should only be used with NoDaylightTransitions rules."); 615Debug.Assert(e is InvalidTimeZoneException, 1173Debug.Assert(result == null || ruleIndex.HasValue, "If an AdjustmentRule was found, ruleIndex should also be set."); 1895Debug.Assert(rule == null || ruleIndex.HasValue,
src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeNameParser.cs (1)
265Debug.Assert(nestedNameLength > 0, "TryGetTypeNameInfo should return error on zero lengths");
src\System\Buffer.CoreCLR.cs (3)
24Debug.Assert(len >= 0, "Negative length in memcpy!"); 31Debug.Assert((srcIndex >= 0) && (destIndex >= 0) && (len >= 0), "Index and length must be non-negative!"); 32Debug.Assert(src.Length - srcIndex >= len, "not enough bytes in src");
src\System\Delegate.CoreCLR.cs (1)
203Debug.Assert(
src\System\MulticastDelegate.CoreCLR.cs (3)
56Debug.Assert(obj is MulticastDelegate, "Shouldn't have failed here since we already checked the types are the same!"); 94Debug.Assert(_invocationList is object[], "empty invocation list on multicast delegate"); 200Debug.Assert(!IsUnmanagedFunctionPtr(), "dynamic method and unmanaged fntptr delegate combined");
src\System\Reflection\Associates.cs (1)
67Debug.Assert(!associateMethodHandle.IsNullHandle(), "Failed to resolve associateRecord methodDef token");
src\System\Reflection\Emit\DynamicILGenerator.cs (1)
294Debug.Assert(opcode.Equals(OpCodes.Calli),
src\System\Reflection\Emit\RuntimeILGenerator.cs (5)
653Debug.Assert(opcode.Equals(OpCodes.Calli), 683Debug.Assert(opcode.Equals(OpCodes.Call) || 691Debug.Assert(opcode.Equals(OpCodes.Call) || 1309Debug.Assert(m_catchEndAddr[currentCatch - 1] == -1, "m_catchEndAddr[m_currentCatch-1] == -1"); 1326Debug.Assert(m_catchEndAddr[currentCatch - 1] == -1, "m_catchEndAddr[m_currentCatch-1] == -1");
src\System\Reflection\Emit\RuntimeMethodBuilder.cs (3)
586Debug.Assert(currentMethod == this, "We should have found this method in m_containingType.m_listMethods"); 587Debug.Assert(currentToken != 0, "The token should not be 0"); 594Debug.Assert(m_token == 0, "m_token should not have been initialized");
src\System\Reflection\Emit\RuntimeModuleBuilder.cs (2)
216Debug.Assert(!type.IsByRef, "Must not be ByRef. Get token from TypeSpec."); 217Debug.Assert(!type.IsGenericType || type.IsGenericTypeDefinition, "Must not have generic arguments.");
src\System\Reflection\Emit\RuntimeTypeBuilder.cs (1)
234Debug.Assert(destType is RuntimeType, "destType is not a runtime type, an EnumBuilder, or a TypeBuilder.");
src\System\Reflection\RuntimeCustomAttributeData.cs (1)
1975Debug.Assert(pca.BaseType == typeof(Attribute), "Pseudo CA Error - Incorrect base type");
src\System\Reflection\RuntimeLocalVariableInfo.cs (1)
16public override Type LocalType { get { Debug.Assert(_type != null, "type must be set!"); return _type; } }
src\System\Runtime\CompilerServices\CastHelpers.cs (1)
350Debug.Assert(mt != toTypeHnd, "The check for the trivial cases should be inlined by the JIT");
src\System\RuntimeHandles.cs (2)
230Debug.Assert(type.GetConstructor(Type.EmptyTypes) is ConstructorInfo c && c.IsPublic, 254Debug.Assert(type.GetConstructor(Type.EmptyTypes) is ConstructorInfo c && c.IsPublic,
src\System\RuntimeType.ActivatorCache.cs (1)
80Debug.Assert(Nullable.GetUnderlyingType(rt) != null,
src\System\RuntimeType.CoreCLR.cs (1)
4406Debug.Assert(!hit.Equals(key), "Key was already in CerHashtable! Potential race condition (or bug) in the Reflection cache?");
src\System\StubHelpers.cs (5)
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");
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 (19)
src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (1)
254Debug.Assert(q.Count == 1, "We should have one and only one in the rank queue.");
src\libraries\Common\src\System\HexConverter.cs (2)
337Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 338Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
System\Runtime\Serialization\CodeGenerator.cs (1)
362Debug.Assert(cmp == Cmp.GreaterThanOrEqualTo, "Unexpected cmp");
System\Runtime\Serialization\CollectionDataContract.cs (2)
843Debug.Assert(Kind != CollectionKind.Array, "GetCollectionElementType should not be called on Arrays"); 844Debug.Assert(GetEnumeratorMethod != null, "GetEnumeratorMethod should be non-null for non-Arrays");
System\Runtime\Serialization\Json\XmlJsonReader.cs (1)
1570Debug.Assert(i < val.Length, "Found that an '\' was the last character in a string. ReadServerTypeAttriute validates that the escape sequence is valid when it calls ReadQuotedText and ReadEscapedCharacter");
System\Runtime\Serialization\Json\XmlJsonWriter.cs (2)
434Debug.Assert(!(_isWritingDataTypeAttribute && _isWritingServerTypeAttribute), 603Debug.Assert((_nodeType == JsonNodeType.StandaloneText) || (_nodeType == JsonNodeType.EndElement),
System\Runtime\Serialization\KnownTypeDataContractResolver.cs (1)
17Debug.Assert(context != null, "KnownTypeDataContractResolver should not be instantiated with a null context");
System\Runtime\Serialization\ReflectionXmlFormatReader.cs (1)
74Debug.Assert(reflectedMemberCount == memberCount, "The value returned by ReflectionGetMembers() should equal to memberCount.");
System\Xml\StringHandle.cs (2)
117Debug.Assert(type == StringHandleType.EscapedUTF8, "Should be EscapedUTF8"); 131Debug.Assert(type == StringHandleType.EscapedUTF8, "Should be EscapedUTF8");
System\Xml\ValueHandle.cs (1)
690Debug.Assert(offset + count <= chars.Length, string.Format("offset '{0}' + count '{1}' MUST BE <= chars.Length '{2}'", offset, count, chars.Length));
System\Xml\XmlBinaryWriter.cs (4)
38Debug.Assert(XmlBinaryNodeType.MaxAttribute < XmlBinaryNodeType.MinElement && 71Debug.Assert(nodeType >= XmlBinaryNodeType.MinText && nodeType <= XmlBinaryNodeType.MaxText && ((byte)nodeType & 1) == 0, "Invalid nodeType"); 109Debug.Assert(offset >= 0 && offset + 1 + sizeof(T) <= buffer.Length, "WriteTextNodeRaw"); 124Debug.Assert(offset >= 0 && offset + sizeof(T) <= buffer.Length, "WriteRaw");
System\Xml\XmlUTF8TextReader.cs (1)
879Debug.Assert(buffer[offset] == 0xEF, "buffer[offset] MUST be 0xEF.");
System.Private.Uri (9)
src\libraries\Common\src\System\HexConverter.cs (2)
337Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 338Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\DomainNameHelper.cs (1)
61Debug.Assert(!str.AsSpan(start, index).Contains(':'),
System\IriHelper.cs (1)
118Debug.Assert(ch < 0xFF, "Expecting ASCII character.");
System\UriExt.cs (2)
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.");
System\UriHelper.cs (2)
191Debug.Assert(!noEscape.Contains('%'), "Need to treat % specially; it should be part of any escaped set"); 218Debug.Assert(!noEscape.Contains('%'), "Need to treat % specially; it should be part of any escaped set");
System.Private.Windows.Core (4)
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (1)
803Debug.Assert(ex is ArgumentException or SerializationException, "Unexpected write exception.");
System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Windows\Win32\Graphics\Gdi\RegionScope.cs (1)
45Debug.Assert(result != -1, "GetClipRgn failed");
Windows\Win32\System\Com\GlobalInterfaceTable.UnknownStrategy.cs (1)
20Debug.Assert(_cookie == 0, "A cookie has already been generated for this instance.");
System.Private.Windows.GdiPlus (2)
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)
22Debug.Assert(status != Status.Ok, "Throwing an exception for an 'Ok' return code");
System.Private.Xml (437)
src\libraries\Common\src\System\HexConverter.cs (2)
337Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 338Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Xml\BinaryXml\XmlBinaryReader.cs (8)
2004Debug.Assert(_mark <= _end, "Mark should never be past End"); 2005Debug.Assert(_mark <= _pos, "Mark should never be after Pos"); 2756Debug.Assert(_stringValue == null, "this.stringValue == null"); 2757Debug.Assert(_token == BinXmlToken.CData, "this.token == BinXmlToken.CData"); 3488Debug.Assert(_checkCharacters, "this.checkCharacters"); 3494Debug.Assert(data.Length % 2 == 0, "Data size should not be odd"); 3543Debug.Assert(!_checkCharacters, "!this.checkCharacters"); 3546Debug.Assert(0 == ((_pos - _tokDataPos) & 1), "Data size should not be odd");
System\Xml\BitStack.cs (2)
50Debug.Assert(_curr != 0x1, "Stack empty"); 71Debug.Assert(_curr != 0x1, "Stack empty");
System\Xml\Cache\XPathDocumentBuilder.cs (5)
320Debug.Assert(_idxParent != 0 && _pageParent != null, "ID attribute must have an element parent"); 554Debug.Assert(prefix.Equals("xml"), "xmlns:xml namespace declaration should always be present in the list."); 705Debug.Assert(_lineInfo.HasLineInfo(), "HasLineInfo should have been checked before this."); 773Debug.Assert(_textBldr.HasText || (_idxSibling == 0 && _idxParent == 0), "Cannot create empty text node unless it's a top-level text node."); 774Debug.Assert(_idxSibling == 0 || (_pageSibling != null && !_pageSibling[_idxSibling].IsText), "Cannot create adjacent text nodes.");
System\Xml\Cache\XPathDocumentNavigator.cs (1)
88Debug.Assert(_idxParent != 0 && _pageParent![_idxParent].HasCollapsedText,
System\Xml\Cache\XPathNode.cs (7)
154Debug.Assert(HasCollapsedText, "Do not call CollapsedLinePosition unless HasCollapsedText is true."); 211Debug.Assert(localName == null || (object?)Document.NameTable.Get(localName) == (object)localName, "localName must be atomized."); 223Debug.Assert(localName == null || (object?)Document.NameTable.Get(localName) == (object)localName, "localName must be atomized."); 439Debug.Assert(pageSibling != null && idxSibling != 0 && idxSibling <= ushort.MaxValue, "Bad argument"); 440Debug.Assert(_idxSibling == 0, "SetSibling should not be called more than once."); 458Debug.Assert(pageSimilar != null && idxSimilar != 0 && idxSimilar <= ushort.MaxValue, "Bad argument"); 459Debug.Assert(_idxSimilar == 0, "SetSimilarElement should not be called more than once.");
System\Xml\Cache\XPathNodeHelper.cs (21)
70Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 89Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 109Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 138Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 161Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 179Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 194Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 228Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 261Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 299Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 331Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 394Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 428Debug.Assert(pageCurrent != null && idxCurrent != 0, "Cannot pass null argument(s)"); 527Debug.Assert(pageCurrent != null && idxCurrent != 0, "Cannot pass null argument(s)"); 528Debug.Assert(typ != XPathNodeType.Text, "Text should be handled by GetTextFollowing in order to take into account collapsed text."); 529Debug.Assert(page[idx].NodeType != XPathNodeType.Attribute, "Current node should never be an attribute or namespace--caller should handle this case."); 566Debug.Assert(!page[idx].IsAttrNmsp, "GetContentFollowing should never return attributes or namespaces."); 585Debug.Assert(pageCurrent != null && idxCurrent != 0, "Cannot pass null argument(s)"); 586Debug.Assert(!page[idx].IsAttrNmsp, "Current node should never be an attribute or namespace--caller should handle this case."); 662Debug.Assert(pageNode[idxNode].HasAttribute || pageNode[idxNode].HasContentChild, "Caller must check HasAttribute/HasContentChild on parent before calling GetChild."); 663Debug.Assert(pageNode[idxNode].HasAttribute || !pageNode[idxNode].HasCollapsedText, "Text child is virtualized and therefore is not present in the physical node page.");
System\Xml\Core\XmlTextReaderImpl.cs (23)
763Debug.Assert(baseUriStr == string.Empty, "BaseURI can come either from XmlParserContext or from the constructor argument, not from both"); 2008Debug.Assert(_v1Compat, "XmlTextReaderImpl.Normalization property cannot be accessed on reader created via XmlReader.Create."); 2013Debug.Assert(_v1Compat, "XmlTextReaderImpl.Normalization property cannot be changed on reader created via XmlReader.Create."); 2041Debug.Assert(_v1Compat, "XmlTextReaderImpl.WhitespaceHandling property cannot be accessed on reader created via XmlReader.Create."); 2046Debug.Assert(_v1Compat, "XmlTextReaderImpl.WhitespaceHandling property cannot be changed on reader created via XmlReader.Create."); 2066Debug.Assert(_v1Compat, "XmlTextReaderImpl.DtdProcessing property cannot be accessed on reader created via XmlReader.Create."); 2071Debug.Assert(_v1Compat, "XmlTextReaderImpl.DtdProcessing property cannot be changed on reader created via XmlReader.Create."); 2123Debug.Assert(_v1Compat, "XmlTextReaderImpl.ResetState cannot be called on reader created via XmlReader.Create."); 2165Debug.Assert(_v1Compat, "XmlTextReaderImpl.GetRemainder cannot be called on reader created via XmlReader.Create."); 2206Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadChars cannot be called on reader created via XmlReader.Create."); 2242Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadBase64 cannot be called on reader created via XmlReader.Create."); 2276Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadBinHex cannot be called on reader created via XmlReader.Create."); 3286Debug.Assert(_ps.appendMode, "UnDecodeChars cannot be called after ps.appendMode has been changed to false"); 3288Debug.Assert(_ps.charsUsed >= _ps.charPos, "The current position must be in the valid character range."); 3296Debug.Assert(_charactersInDocument >= _ps.charsUsed - _ps.charPos, 3305Debug.Assert(_charactersFromEntities >= _ps.charsUsed - _ps.charPos, 4887Debug.Assert(val == XmlComplianceUtil.CDataNormalize(val), "The attribute value is not CDATA normalized!"); 7967Debug.Assert(_xmlResolver.SupportsType(uri, typeof(Stream)), "Stream must always be a supported type in XmlResolver"); 8511Debug.Assert(count == charsParsed || _incReadDecoder.IsFull, "Check if decoded consumed all characters unless it's full."); 8528Debug.Assert(IncrementalRead() == 0, "Previous call of IncrementalRead should eat up all characters!"); 8590Debug.Assert(_ps.eolNormalized, "Entity replacement text for attribute values should be EOL-normalized!"); 9023Debug.Assert(context.NameTable == null || context.NameTable == nt, "This check should have been done in XmlParserContext constructor."); 9122Debug.Assert(_curNode.type == XmlNodeType.Whitespace && newNodeType == XmlNodeType.SignificantWhitespace, "Incorrect node type change!");
System\Xml\Core\XmlTextReaderImplAsync.cs (2)
2530Debug.Assert(val == XmlComplianceUtil.CDataNormalize(val), "The attribute value is not CDATA normalized!"); 5178Debug.Assert(_xmlResolver.SupportsType(uri, typeof(Stream)), "Stream must always be a supported type in XmlResolver");
System\Xml\Core\XmlTextReaderImplHelpers.cs (1)
447Debug.Assert(_valueStartPos >= 0 || _value != null, "Value not ready.");
System\Xml\Core\XmlTextWriter.cs (1)
1471Debug.Assert(declared, "Unexpected situation!!");
System\Xml\Core\XmlWriterSettings.cs (1)
603Debug.Assert(Encoding.Equals(Encoding.GetEncoding(Encoding.CodePage)), "Cannot serialize encoding correctly");
System\Xml\Dom\DocumentXPathNavigator.cs (4)
1309Debug.Assert(node1 != node2, "Should be handled by ComparePosition()"); 1791Debug.Assert(node != null, "This method needs to be called with the beforehand check of NextSibling being not null from node to end"); 1833Debug.Assert(node != null, "Undefined navigator position"); 1834Debug.Assert(node == _document || node.OwnerDocument == _document, "Navigator switched documents");
System\Xml\Dom\XmlNode.cs (1)
809Debug.Assert(true, "shouldn't have fall through here.");
System\Xml\Schema\Inference\Infer.cs (2)
253Debug.Assert(_rootSchema != null, "rootSchema is null"); 483Debug.Assert(targetNS == null || targetNS.Length > 0, "targetns for schema is empty");
System\Xml\Schema\XmlSchemaException.cs (1)
83Debug.Assert(message == null || !message.StartsWith("Sch_", StringComparison.Ordinal), "Do not pass a resource here!");
System\Xml\Schema\XmlSchemaObjectTable.cs (3)
21Debug.Assert(!_table.ContainsKey(name), "XmlSchemaObjectTable.Add: entry already exists"); 195Debug.Assert(array.Length >= _size, "array is not big enough to hold all the items in the ICollection"); 248Debug.Assert(array.Length >= _size, "array is not big enough to hold all the items in the ICollection");
System\Xml\Schema\XmlValueConverter.cs (6)
235Debug.Assert(schemaType != null && datatype != null, "schemaType or schemaType.Datatype may not be null"); 242Debug.Assert(schemaType.Datatype!.Variety != XmlSchemaDatatypeVariety.List, "schemaType must be list's item type, not list itself"); 435Debug.Assert(_typeCode == XmlTypeCode.Item, "If SchemaType is null, then TypeCode may only be Item, Node, or AnyAtomicType"); 2919Debug.Assert(!(atomicConverter is XmlListConverter) || ((XmlListConverter)atomicConverter).atomicConverter == null, 3051Debug.Assert(enumSrc != null, "Value passed to ToArray must implement IEnumerable"); 3079Debug.Assert(enumSrc != null, "Value passed to ToArray must implement IEnumerable");
System\Xml\Schema\XsdDateTime.cs (2)
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.");
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (5)
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."); 1882Debug.Assert(xmlnsMember.XmlnsSource != null, "Xmlns member's source was not set.");
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\XmlException.cs (2)
92Debug.Assert(message == null || !message.StartsWith("Xml_", StringComparison.Ordinal), "Do not pass a resource here!"); 294Debug.Assert(e != null, "Unexpected null exception");
System\Xml\XPath\Internal\BooleanFunctions.cs (1)
65Debug.Assert(result is XPathNavigator, "Unknown value type");
System\Xml\XPath\Internal\CompiledXPathExpr.cs (1)
46Debug.Assert(_query != null, "In case of error in XPath we create ErrorXPathExpression");
System\Xml\XPath\Internal\DescendantoverDescendantQuery.cs (1)
95Debug.Assert(result, "Algorithm error, We always should be able to move up if level > 0");
System\Xml\XPath\Internal\FilterQuery.cs (1)
71Debug.Assert(value is XPathNavigator, "Unknown value type");
System\Xml\XPath\Internal\LogicalExpr.cs (2)
254Debug.Assert(op == Operator.Op.EQ || op == Operator.Op.NE, 366Debug.Assert(op == Operator.Op.EQ || op == Operator.Op.NE,
System\Xml\XPath\Internal\NamespaceQuery.cs (1)
61Debug.Assert(e.LocalName.Length == 0, "Only xmlns='' can have empty string as a value");
System\Xml\XPath\Internal\PrecedingQuery.cs (1)
85Debug.Assert(qyInput.Advance() == null, "we read all qyInput.Advance() already");
System\Xml\XPath\Internal\PreSiblingQuery.cs (1)
67Debug.Assert(test, "We just moved to parent, how we can not have first child?");
System\Xml\XPath\Internal\Query.cs (1)
191Debug.Assert(value is XPathNavigator, "Unknown value type");
System\Xml\XPath\Internal\SortQuery.cs (3)
22Debug.Assert(qyInput != null, "Sort Query needs an input query tree to work on"); 54Debug.Assert(numSorts > 0, "Why was the sort query created?"); 197Debug.Assert(x != null && y != null, "Oops!! what happened?");
System\Xml\XPath\Internal\StringFunctions.cs (1)
22Debug.Assert(argList != null, "Use 'new Query[]{}' instead.");
System\Xml\XPath\Internal\XPathMultyIterator.cs (2)
127Debug.Assert(position != 0, "MoveNext() wasn't called"); 128Debug.Assert(firstNotEmpty < arr.Length, "MoveNext() returned false");
System\Xml\XPath\Internal\XPathParser.cs (1)
498Debug.Assert(opnd != null, "IsPrimaryExpr() was true. We should recognize this lex.");
System\Xml\XPath\XPathDocument.cs (1)
178Debug.Assert((object?)_nameTable.Get(string.Empty) == (object)string.Empty, "NameTable must contain atomized string.Empty");
System\Xml\XPath\XPathNavigator.cs (2)
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");
System\Xml\Xsl\IlGen\GenerateHelper.cs (6)
116Debug.Assert(seqEmpty != null, "Field `Empty` could not be found"); 896Debug.Assert(clrTypeDst == typeof(object), "Invalid cast, since value types do not allow inheritance."); 902Debug.Assert(clrTypeSrc == typeof(object), "Invalid cast, since value types do not allow inheritance."); 910Debug.Assert(clrTypeSrc.IsAssignableFrom(clrTypeDst) || clrTypeDst.IsAssignableFrom(clrTypeSrc), 1411Debug.Assert(keyType.IsAtomicValue, "Sort key must have atomic value type."); 1633Debug.Assert(!opcode.Equals(OpCodes.Br) && !opcode.Equals(OpCodes.Br_S), "Use EmitUnconditionalBranch and be careful not to emit unverifiable code.");
System\Xml\Xsl\IlGen\IteratorDescriptor.cs (2)
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 (2)
209Debug.Assert(!_isReadOnly, "This OptimizerPatterns instance is read-only."); 247Debug.Assert(!_isReadOnly, "This OptimizerPatterns instance is read-only.");
System\Xml\Xsl\IlGen\TailCallAnalyzer.cs (1)
36Debug.Assert(XmlILConstructInfo.Read(nd).PushToWriterLast,
System\Xml\Xsl\IlGen\XmlILConstructAnalyzer.cs (15)
130Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 143Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 156Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 169Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 182Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 195Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 219Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 243Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 268Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 297Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 311Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 325Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 339Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 353Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 1095Debug.Assert(nd.NodeType != QilNodeType.NamespaceDecl || !_nsmgr.HasNamespace(prefix) || _nsmgr.LookupNamespace(prefix) == ns,
System\Xml\Xsl\IlGen\XmlILModule.cs (3)
211Debug.Assert(!_useLRE, "Cannot create initialized data for an LRE module"); 220Debug.Assert(!_useLRE, "Cannot create field for an LRE module"); 229Debug.Assert(!_useLRE, "Cannot create type initializer for an LRE module");
System\Xml\Xsl\IlGen\XmlILOptimizerVisitor.cs (2)
5297Debug.Assert(nd is QilLiteral, "All literals except True, False, and QName must use QilLiteral"); 5639Debug.Assert(nd.NodeType == QilNodeType.Let || nd.NodeType == QilNodeType.Parameter, "Unexpected type of a global");
System\Xml\Xsl\IlGen\XmlIlVisitor.cs (32)
76Debug.Assert(_iterCurr.Storage.Location == ItemLocation.None, "Root expression should have been pushed to the writer."); 97Debug.Assert(methGlobal != null, "Metadata for global value should have already been computed"); 149Debug.Assert(iter.XmlType == TypeFactory.ItemS, "IlGen currently only supports parameters of type item*."); 193Debug.Assert(iter.NodeType == QilNodeType.Parameter, "Only parameters may not have a default value"); 253Debug.Assert(iter.XmlType == TypeFactory.ItemS, "IlGen currently only supports default values in parameters of type item*."); 318Debug.Assert(nd.XmlType!.IsSingleton || CachesResult(nd) || _iterCurr.HasLabelNext, 981Debug.Assert(ndBranch.XmlType!.IsSingleton, "Conditional must produce a singleton"); 1144Debug.Assert(XmlILConstructInfo.Read(nd).PullFromIteratorFirst, "VisitEmpty should only be called if items are iterated"); 1165Debug.Assert(XmlILConstructInfo.Read(ndSeq).ConstructMethod == XmlILConstructMethod.Iterator, "This method should only be called if items in list are pulled from a code iterator."); 1509Debug.Assert(!ndStrConcat.Values.XmlType!.IsSingleton, "Optimizer should have folded StrConcat of a singleton value"); 1713Debug.Assert(ndComp.Left.XmlType!.IsAtomicValue && ndComp.Right.XmlType!.IsAtomicValue, "Operands to compare must be atomic values."); 1714Debug.Assert(ndComp.Left.XmlType.IsSingleton && ndComp.Right.XmlType.IsSingleton, "Operands to compare must be cardinality one."); 1715Debug.Assert(ndComp.Left.XmlType == ndComp.Right.XmlType, "Operands to compare may not be heterogenous."); 2330Debug.Assert(ndKey.Key.XmlType!.IsAtomicValue, "Sort key must be an atomic value."); 2437Debug.Assert(pattStep.MatchesPattern(OptimizerPatternName.Axis), "Dod patterns should only match if step is FilterElements or FilterKindTest or Axis"); 2523Debug.Assert(_iterCurr.Storage.IsCached, "DodMerge pattern should only be matched when cached sequences are returned from loop"); 2600Debug.Assert(ndName != null, "Attribute node must have a literal QName as its second argument"); 2780Debug.Assert(XmlILConstructInfo.Read(ndElem).PushToWriterFirst, "Element construction should always be pushed to writer."); 2830Debug.Assert(XmlILConstructInfo.Read(ndAttr).PushToWriterFirst, "Attribute construction should always be pushed to writer."); 2864Debug.Assert(XmlILConstructInfo.Read(ndComment).PushToWriterFirst, "Comment construction should always be pushed to writer."); 2884Debug.Assert(XmlILConstructInfo.Read(ndPI).PushToWriterFirst, "PI construction should always be pushed to writer."); 2924Debug.Assert(info.PushToWriterFirst, "Text construction should always be pushed to writer."); 2984Debug.Assert(XmlILConstructInfo.Read(ndDoc).PushToWriterFirst, "Document root construction should always be pushed to writer."); 3007Debug.Assert(info.PushToWriterFirst, "Namespace construction should always be pushed to writer."); 3181Debug.Assert(!typDerived!.NeverSubtypeOf(typBase), "Normalizer should have eliminated IsType where source can never be a subtype of destination type."); 3187Debug.Assert(_iterCurr.Storage.ItemStorageType == typeof(XPathItem), "If !IsNode, then storage type should be Item"); 3263Debug.Assert((typDerived.NodeKinds & kinds) != XmlNodeKindFlags.None, "Normalizer should have taken care of case where node kinds are disjoint."); 3439Debug.Assert(ndVal.Child.XmlType!.IsNode, "XPathNodeValue node may only be applied to a sequence of Nodes."); 3649Debug.Assert(ndActualArg.XmlType!.IsSubtypeOf(xmlTypeFormalArg), "Xml type of actual arg must be a subtype of the Xml type of the formal arg"); 3779Debug.Assert(XmlILConstructInfo.Read(ndCopyOf).PushToWriterFirst, "XsltCopyOf should always be pushed to writer."); 4105Debug.Assert(ndName.XmlType!.TypeCode == XmlTypeCode.QName, "Element or attribute name must have QName type."); 4853Debug.Assert(_iterCurr.Storage.IsCached, "Expression result should be cached. CachesResult() might have a bug in it.");
System\Xml\Xsl\QIL\QilList.cs (1)
58Debug.Assert(!xt.IsDod, "Sequences do not preserve DocOrderDistinct");
System\Xml\Xsl\QIL\QilPatternFactory.cs (3)
228Debug.Assert(arg != null, "Argument shouldn't be null"); 229Debug.Assert(arg.XmlType!.TypeCode == XmlTypeCode.Boolean && arg.XmlType.IsSingleton, 770Debug.Assert(t != null, "Type can't be null");
System\Xml\Xsl\QIL\QilReplaceVisitor.cs (1)
81Debug.Assert(newType.IsSubtypeOf(XmlQueryTypeFactory.AtMost(oldType, oldType.Cardinality)), "Replace shouldn't relax original type");
System\Xml\Xsl\QIL\WhitespaceRule.cs (1)
77Debug.Assert(this.GetType() == typeof(WhitespaceRule), "Serialization of WhitespaceRule subclasses is not implemented");
System\Xml\Xsl\Runtime\DodSequenceMerge.cs (1)
94Debug.Assert(_sequencesToMerge.Count == 1, "While loop should terminate when count == 1");
System\Xml\Xsl\Runtime\SetIterators.cs (2)
213Debug.Assert(nestedNavigator == null, "null is passed to MoveNext after IteratorState.HaveCurrent has been returned."); 313Debug.Assert(nestedNavigator == null, "null is passed to MoveNext after IteratorState.HaveCurrent has been returned.");
System\Xml\Xsl\Runtime\XmlAttributeCache.cs (1)
156Debug.Assert(value is XmlAtomicValue, "value should always be an XmlAtomicValue, as XmlAttributeCache is only used by XmlQueryOutput");
System\Xml\Xsl\Runtime\XmlCollation.cs (2)
156Debug.Assert(collationLiteral != null, "collation literal should not be null"); 379Debug.Assert(_cultInfo == null || _cultInfo.Equals(new CultureInfo(_cultInfo.Name)),
System\Xml\Xsl\Runtime\XmlExtensionFunction.cs (2)
281Debug.Assert(_meth != null, "Must call Bind() before calling Invoke."); 282Debug.Assert(args.Length == _argClrTypes!.Length, "Mismatched number of actual and formal arguments.");
System\Xml\Xsl\Runtime\XmlILIndex.cs (1)
45Debug.Assert(navigator.ComparePosition(seq[seq.Count - 1]) >= 0, "Index nodes must be added in document order");
System\Xml\Xsl\Runtime\XmlQueryContext.cs (2)
167Debug.Assert(dataSource != null, "GetType() below assumes dataSource is not null"); 199Debug.Assert(uriRelative != null, "Relative URI should not be null");
System\Xml\Xsl\Runtime\XmlQueryOutput.cs (14)
162Debug.Assert(prefix != null && !string.IsNullOrEmpty(localName) && ns != null, "Invalid argument"); 163Debug.Assert(ValidateNames.ValidateName(prefix, localName, ns, XPathNodeType.Element, ValidateNames.Flags.All), "Name validation failed"); 221Debug.Assert(prefix != null && localName != null && ns != null, "Invalid argument"); 595Debug.Assert(_depth == 0, "Root node can only be constructed at top-level."); 608Debug.Assert(_depth == 1, "Root node can only be constructed at top-level."); 746Debug.Assert(prefix != null, "Invalid argument"); 884Debug.Assert(_xstate == XmlState.WithinSequence, "Values can only be written at the top-level."); 938Debug.Assert(navigator.NodeType == XPathNodeType.Element, "StartCopy should return true only for Element nodes."); 957Debug.Assert(navigator.NodeType == XPathNodeType.Root, "EndCopy should only be called for Element and Document nodes."); 980Debug.Assert(text != null, "Invalid argument"); 1044Debug.Assert(nodeType == XPathNodeType.Element, "StartCopy should return true only for Element nodes."); 1175Debug.Assert(_xstate != XmlState.WithinSequence, "StartCopy should not called if state is WithinSequence"); 1219Debug.Assert(navigator.NodeType == XPathNodeType.Element, "Only elements have namespaces to copy"); 1224Debug.Assert(navigator.LocalName.Length != 0, "xmlns:foo='' isn't allowed");
System\Xml\Xsl\Runtime\XmlQueryRuntime.cs (9)
174Debug.Assert(IsGlobalComputed(idx), "Cannot get the value of a global value until it has been computed."); 175Debug.Assert(_globalValues![idx] is IList<XPathItem>, "Only debugger should call this method, and all global values should have type item* in debugging scenarios."); 191Debug.Assert(IsGlobalComputed(idx), "Cannot get the value of a global value until it has been computed."); 192Debug.Assert(_globalValues![idx] is IList<XPathItem>, "Only debugger should call this method, and all global values should have type item* in debugging scenarios."); 250Debug.Assert(_earlyObjects != null && index < _earlyObjects.Length, "Early bound object does not exist"); 300Debug.Assert(IsGlobalComputed(index), "Cannot get the value of a global value until it has been computed."); 310Debug.Assert(!IsGlobalComputed(index), "Global value should only be set once."); 480Debug.Assert(XmlILTypeHelper.GetStorageType(xmlType).IsAssignableFrom(value.GetType()), 499Debug.Assert(xmlType != XmlQueryTypeFactory.Node && xmlType != XmlQueryTypeFactory.NodeS,
System\Xml\Xsl\Runtime\XmlQuerySequence.cs (1)
387Debug.Assert(keys.Length >= _size, "Number of keys must be >= number of items.");
System\Xml\Xsl\Runtime\XmlQueryStaticData.cs (1)
184Debug.Assert(formatVersion != CurrentFormatVersion || dataReader.Read() == -1, "Extra data at the end of the stream");
System\Xml\Xsl\Runtime\XmlSortKey.cs (2)
252Debug.Assert(that._sortKey != null, "Both keys must have non-null sortKey field"); 257Debug.Assert(_sortKeyBytes != null && that._sortKeyBytes != null, "Both keys must have non-null sortKeyBytes field");
System\Xml\Xsl\Runtime\XslNumber.cs (4)
27Debug.Assert(isSeparator == (formatString != null), "AssertSeparator"); 270Debug.Assert(item.ValueType == typeof(double), "Item must be either of type int, or double"); 308Debug.Assert(val >= 0 && val == Math.Round(val), "ConvertToArabic operates on non-negative integer numbers only"); 360Debug.Assert(pNewEnd >= result, "Separator cannot be the first character");
System\Xml\Xsl\Runtime\XsltConvert.cs (1)
252Debug.Assert(destinationType.IsStrict && destinationType.IsAtomicValue, "Can only convert to strict atomic type.");
System\Xml\Xsl\Runtime\XsltLibrary.cs (4)
196Debug.Assert(_decimalFormatters != null && 0 <= idx && idx < _decimalFormatters.Count, "Value of decimalFormatterIndex is out of range"); 341Debug.Assert(!item.IsNode, "Atomic value expected"); 361Debug.Assert(TypeCode.Boolean < TypeCode.Double && TypeCode.Double < TypeCode.String, "Cannot use the smallest TypeCode as a weakest one"); 539Debug.Assert((object)nav1.NameTable == (object)nav2.NameTable, "Ref.Equal cannot be used if navigators have different name tables");
System\Xml\Xsl\SourceLineInfo.cs (3)
75Debug.Assert(0 < lineInfo.Start.Line && 0 < lineInfo.Start.Pos, "0 < start"); 76Debug.Assert(0 < lineInfo.End.Line && 0 < lineInfo.End.Pos, "0 < end"); 77Debug.Assert(lineInfo.Start.LessOrEqual(lineInfo.End), "start <= end");
System\Xml\Xsl\XmlIlGenerator.cs (1)
341Debug.Assert(methInfo != null, "MethodInfo for global value should have been created previously.");
System\Xml\Xsl\XmlQueryType.cs (10)
487Debug.Assert(Count == 1 && IsSingleton, "This method should only be called for item types."); 488Debug.Assert(baseType.Count == 1 && baseType.IsSingleton, "This method should only be called for item types."); 489Debug.Assert(!IsDod && !baseType.IsDod, "Singleton types may not have DocOrderDistinct property"); 528Debug.Assert(this.Count == 1 && this.IsSingleton, "this should be an item"); 529Debug.Assert(other.Count == 1 && other.IsSingleton, "other should be an item"); 562Debug.Assert(Count == 1, "Do not pass a Union type to this method."); 563Debug.Assert(IsSingleton, "Do not pass a Sequence type to this method."); 885Debug.Assert(count < 64, "BitMatrix currently only handles up to 64x64 matrix."); 903Debug.Assert(index1 < _bits.Length && index2 < _bits.Length, "Index out of range."); 908Debug.Assert(index1 < _bits.Length && index2 < _bits.Length, "Index out of range.");
System\Xml\Xsl\XmlQueryTypeFactory.cs (10)
265Debug.Assert(itemType.IsSingleton, "All types should be prime."); 351Debug.Assert(arrEnum[arrEnum.Length - 1] == XmlTypeCode.DayTimeDuration, 437Debug.Assert(schemaType.Datatype!.Variety == XmlSchemaDatatypeVariety.Atomic, "List or Union Xsd types should have been handled by caller."); 504Debug.Assert(nameTest != null, "nameTest cannot be null"); 505Debug.Assert(schemaType != null, "schemaType cannot be null"); 554Debug.Assert((object)this == (object)Create(_code, _isStrict), "Unknown type"); 741Debug.Assert(members != null && members.Count != 1, "ChoiceType must contain a list with 0 or >1 types."); 749Debug.Assert(t.Cardinality == XmlQueryCardinality.One, "ChoiceType member types must be prime types."); 972Debug.Assert(prime != null, "SequenceType can only modify the cardinality of a non-null XmlQueryType."); 973Debug.Assert(prime.IsSingleton, "Prime type must have cardinality one.");
System\Xml\Xsl\XPath\XPathBuilder.cs (9)
67Debug.Assert(!_inTheBuild, "XPathBuilder is busy!"); 80Debug.Assert(_inTheBuild, "StartBuild() wasn't called"); 92Debug.Assert(numFixupCurrent >= 0, "Context fixup error"); 93Debug.Assert(numFixupPosition >= 0, "Context fixup error"); 94Debug.Assert(numFixupLast >= 0, "Context fixup error"); 148Debug.Assert(compType == XmlTypeCode.Boolean || left.XmlType!.IsSingleton && right.XmlType!.IsSingleton, "Both comparison operands must be singletons"); 170Debug.Assert(compType == XmlTypeCode.Boolean || compType == XmlTypeCode.Double || compType == XmlTypeCode.String, "I don't know what to do with RTF here"); 457Debug.Assert(nodeset.NodeType == QilNodeType.DocOrderDistinct, 561Debug.Assert(!args.IsReadOnly, "Writable collection expected");
System\Xml\Xsl\XPath\XPathParser.cs (2)
57Debug.Assert(_posInfo.Count == 0, "PushPosInfo() and PopPosInfo() calls have been unbalanced"); 536Debug.Assert(
System\Xml\Xsl\XPath\XPathQilFactory.cs (8)
41Debug.Assert(result == (xt.TypeCode == XmlTypeCode.Item || xt.TypeCode == XmlTypeCode.AnyAtomicType), "What else can it be?"); 48Debug.Assert(n != null && n.XmlType!.IsSingleton && n.XmlType.IsNode, "Must be a singleton node"); 54Debug.Assert(n != null && n.XmlType!.IsNode, "Must be a node-set"); 60Debug.Assert(n != null && n.XmlType!.IsSingleton && n.XmlType.IsNode && n.XmlType.IsNotRtf, "Must be a singleton node and not an Rtf"); 66Debug.Assert(n != null && n.XmlType!.IsSubtypeOf(T.StringX), "Must be a singleton string"); 72Debug.Assert(n != null && n.XmlType!.IsSubtypeOf(T.StringXS), "Must be a sequence of strings"); 78Debug.Assert(n != null && n.XmlType!.IsSubtypeOf(T.DoubleX), "Must be a singleton Double"); 84Debug.Assert(n != null && n.XmlType!.IsSubtypeOf(T.BooleanX), "Must be a singleton Bool");
System\Xml\Xsl\XPathConvert.cs (2)
1045Debug.Assert(equal, "DblToRgbFast and DblToRgbPrecise should give the same result"); 2857Debug.Assert(('0' & 0xF) == 0, "We use (char)(d |'0') to convert digit to char");
System\Xml\Xsl\Xslt\Compiler.cs (5)
63Debug.Assert(CompilerErrorColl == null, "Compiler cannot be reused"); 76Debug.Assert(Root == null, "Compiler cannot be reused"); 119Debug.Assert(importPrecedence <= oldNsAlias.ImportPrecedence, "Stylesheets must be processed in the order of decreasing import precedence"); 291Debug.Assert(_savedErrorCount == -1, "Nested EnterForwardsCompatible calls"); 298Debug.Assert(_savedErrorCount != -1, "ExitForwardsCompatible without EnterForwardsCompatible");
System\Xml\Xsl\Xslt\CompilerScopeManager.cs (7)
97Debug.Assert(_lastRecord == 0 && _lastScopes == 0, "PushScope() and PopScope() calls are unbalanced"); 111Debug.Assert(nsDecl.Prefix == null, "NS may be null only when prefix is null where it is used for extension-element-prefixes='#all'"); 149Debug.Assert(flag == (flag & ScopeFlags.ExclusiveFlags) && BitOperations.IsPow2((uint)flag), "One exclusive flag"); 150Debug.Assert(uri != null || ncName == null, "null, null means exclude '#all'"); 168Debug.Assert(flag == (flag & ScopeFlags.InheritedFlags) && BitOperations.IsPow2((uint)flag), "one inherited flag"); 193Debug.Assert((_records[_lastRecord].flags & ScopeFlags.CompatibilityFlags) != ScopeFlags.CompatibilityFlags, 414Debug.Assert(LastPredefRecord <= _currentRecord && _currentRecord <= _scope._lastRecord, "MoveNext() either was not called or returned false");
System\Xml\Xsl\Xslt\Focus.cs (7)
68Debug.Assert(_focusType != SingletonFocusType.None, "Focus is not set, call SetFocus first"); 79Debug.Assert(_focusType == SingletonFocusType.Iterator && _current != null, "Unexpected singleton focus type"); 104Debug.Assert(!IsFocusSet, "Focus was already set"); 125Debug.Assert(IsFocusSet, "Focus was not set"); 136Debug.Assert(_current != null, "Naked current() is not expected in this function"); 142Debug.Assert(_position != null, "Naked position() is not expected in this function"); 148Debug.Assert(_last != null, "Naked last() is not expected in this function");
System\Xml\Xsl\Xslt\InvokeGenerator.cs (6)
60Debug.Assert(formalArg.Name.LocalName == "namespaces", "Cur,Pos,Last don't have default values and should be always added to by caller in AddImplicitArgs()"); 61Debug.Assert(formalArg.DefaultValue != null, "PrecompileProtoTemplatesHeaders() set it"); 71Debug.Assert(formalArg.Name!.NamespaceUri != XmlReservedNs.NsXslDebug, "Cur,Pos,Last don't have default values and should be always added to by caller in AddImplicitArgs(). We don't have $namespaces in !debug."); 86Debug.Assert(invokeType == T.ItemS, "Actual argument type is not a subtype of formal argument type"); 132Debug.Assert(_formalArgs![prevArg] != null, "formalArg must be in the list"); 133Debug.Assert(_invokeArgs![prevArg] != null, "This arg should be compiled already");
System\Xml\Xsl\Xslt\KeyMatchBuilder.cs (3)
29Debug.Assert(0 <= _depth && _depth <= 1, "this shouldn't happen"); 41Debug.Assert(0 <= _depth && _depth <= 1, "this shouldn't happen"); 110Debug.Assert(content.Child == _fixup, "Unexpected content node");
System\Xml\Xsl\Xslt\MatcherBuilder.cs (1)
135Debug.Assert(
System\Xml\Xsl\Xslt\OutputScopeManager.cs (1)
149Debug.Assert(0 < record, "first record is lookup barrier, so we don't need to check this condition runtime");
System\Xml\Xsl\Xslt\QilGenerator.cs (18)
234Debug.Assert(!_curLoop.IsFocusSet && !_funcFocus.IsFocusSet, "Must be compiled using singleton focus"); 432Debug.Assert(IsDebug, "This is debug only logic"); 602Debug.Assert((template != null) == (tmpl.SourceLine != null), "Templates must have line information, and attribute sets must not"); 610Debug.Assert(!IsDebug, "In debug mode we don't generate parumWithCalls functions. Otherwise focus flags should be adjusted"); 653Debug.Assert(tmpl is Template, "Only templates can have explicit arguments"); 656Debug.Assert(arg.DefaultValue == null, "Argument must not be compiled yet"); 747Debug.Assert(result != null, "Result of compilation should not be null"); 1216Debug.Assert(!_curLoop.IsFocusSet, "xsl:apply-imports cannot be inside of xsl:for-each"); 1246Debug.Assert(tmpl.Function != null, "All templates should be already compiled"); 1281Debug.Assert(attSet.Function != null, "All templates should be already compiled"); 1421Debug.Assert(result == null, "xsl:otherwise must be the last child of xsl:choose"); 1818Debug.Assert(0 < list.Count, "Pattern should have at least one filter"); 2581Debug.Assert(actualArgs[actArg].NodeType == XslNodeType.WithParam, "All Sorts was removed in CompileSorts()"); 2662Debug.Assert(actualArgs[i].NodeType == XslNodeType.WithParam, "All Sorts was removed in CompileSorts()"); 2689Debug.Assert(actualArgs[0].Name == _nameCurrent, "Caller should always pass $current as a first argument to apply-* calls."); 2753Debug.Assert( 2794Debug.Assert(!IsDebug, "Attempt to override SourceLineInfo in debug mode"); 2886Debug.Assert(_vars.Count == 0, "Accumulated variables left unclaimed");
System\Xml\Xsl\Xslt\QilGeneratorEnv.cs (2)
26Debug.Assert(args == null || args.Length == 0, "Error message must already be composed in res"); 103Debug.Assert(!args.IsReadOnly, "Writable collection expected");
System\Xml\Xsl\Xslt\QilStrConcatenator.cs (3)
46Debug.Assert(_inUse, "Reset() wasn't called"); 52Debug.Assert(_inUse, "Reset() wasn't called"); 58Debug.Assert(_inUse, "Reset() wasn't called");
System\Xml\Xsl\Xslt\Stylesheet.cs (2)
87Debug.Assert(var.Name!.NamespaceUri != null, "Name must be resolved in XsltLoader"); 120Debug.Assert(template.ImportPrecedence <= old.ImportPrecedence, "Global objects are processed in order of decreasing import precedence");
System\Xml\Xsl\Xslt\XPathPatternBuilder.cs (15)
44Debug.Assert(!_inTheBuild, "XPathBuilder is busy!"); 52Debug.Assert(filter.NodeType == QilNodeType.Filter, "XPathPatternBuilder expected to generate list of Filters on top level"); 67Debug.Assert(_inTheBuild, "StartBuild() wasn't called"); 71Debug.Assert(_predicateEnvironment.numFixupCurrent >= 0, "Context fixup error"); 72Debug.Assert(_predicateEnvironment.numFixupPosition >= 0, "Context fixup error"); 73Debug.Assert(_predicateEnvironment.numFixupLast >= 0, "Context fixup error"); 84Debug.Assert(right.NodeType == QilNodeType.Filter, "LocationPathPattern must be compiled into a filter"); 92Debug.Assert(left.NodeType == QilNodeType.Filter, "LocationPathPattern must be compiled into a filter"); 133Debug.Assert(nodeType == XPathNodeType.All && prefix == null && name == null, " // is the only d-o-s axes that we can have in pattern"); 199Debug.Assert(GetLastParent(left) == left, "Left is always single axis and never the step"); 297Debug.Assert( 305Debug.Assert(name == "key", "Unexpected function"); 306Debug.Assert( 376Debug.Assert(context != null, "Predicate always has step so it can't have context == null"); 377Debug.Assert(context.Variable.NodeType == QilNodeType.For, "It shouldn't be Let, becaus predicates in PatternBuilder don't produce cached tuples.");
System\Xml\Xsl\Xslt\XslAstAnalyzer.cs (9)
113Debug.Assert((v.Flags & XslFlags.Stop) == 0, "Already visited this vertex"); 121Debug.Assert((u.Flags & flag) == flag, "Flag was not set on an adjacent vertex"); 347Debug.Assert(_forEachDepth == 0, "xsl:apply-imports cannot be inside of xsl:for-each"); 348Debug.Assert(_currentTemplate is Template, "xsl:apply-imports can only occur within xsl:template"); 356Debug.Assert(node.Select != null, "Absent @select should be replaced with 'node()' in XsltLoader"); 807Debug.Assert((t.Flags & XslFlags.Stop) == 0, "Already visited this vertex"); 816Debug.Assert((u.Flags & XslFlags.SideEffects) == XslFlags.SideEffects, "Flag was not set on an adjacent vertex"); 824Debug.Assert((u.Flags & XslFlags.SideEffects) == XslFlags.SideEffects, "Flag was not set on an adjacent vertex"); 839Debug.Assert((u.Flags & XslFlags.SideEffects) == XslFlags.SideEffects, "Flag was not set on an adjacent vertex");
System\Xml\Xsl\Xslt\XsltInput.cs (16)
77Debug.Assert(tr.Settings == null, "XmlReader created with XmlReader.Create should always expand entities."); 273Debug.Assert(_reader.NodeType == XmlNodeType.Attribute, "reader.NodeType == XmlNodeType.Attribute"); 323Debug.Assert(_reader.NodeType == XmlNodeType.Text, "Unexpected node type inside attribute value"); 348Debug.Assert(_nodeType == XmlNodeType.Element, "To call MoveToFirstChild() XsltInut should be positioned on an Element."); 358Debug.Assert(_nodeType != XmlNodeType.Element || IsEmptyElement, "On non-empty elements we should call MoveToFirstChild()"); 518Debug.Assert(_nodeType == XmlNodeType.Element, "For MoveToElement() we should be positioned on Element or Attribute"); 524Debug.Assert(_nodeType == XmlNodeType.Element, "For MoveToLiteralAttribute() we should be positioned on Element or Attribute"); 539Debug.Assert(_nodeType == XmlNodeType.Element, "For MoveToLiteralAttribute() we should be positioned on Element or Attribute"); 554Debug.Assert(_attributes != null && _attributes[attNum].name == attName, "Attribute numbering error."); 566Debug.Assert(_attributes != null && _attributes[attNum].name == attName, "Attribute numbering error."); 589Debug.Assert(_nodeType == XmlNodeType.Element || _nodeType == XmlNodeType.EndElement, "Input is positioned on element or attribute"); 620Debug.Assert(_nodeType != XmlNodeType.Element || _attributesRead, "Should first read attributes"); 628Debug.Assert(_nodeType != XmlNodeType.Element || _attributesRead, "Should first read attributes"); 637Debug.Assert(_nodeType != XmlNodeType.Element || _attributesRead, "Should first read attributes"); 750Debug.Assert(SS, "First we parse xsl:stylesheet element"); 1099Debug.Assert(Ref.Equal(_atoms.NameTable.Get(nsUri), nsUri), "Namespaces must be atomized");
System\Xml\Xsl\Xslt\XsltLoader.cs (11)
177Debug.Assert(_compiler.Version != 0, "Version should be already decided at this point"); 236Debug.Assert(!_documentUriInUse.Contains(baseUri), "Circular references must be checked while processing xsl:include and xsl:import"); 973Debug.Assert(dummy, "One of the attrs should have lineInfo. If both are default they can't conflict."); 1067Debug.Assert(setName != null, "Required attribute always != null"); 2800Debug.Assert(_input.IsRequiredAttribute(attNum), "It happened that @name as NCName is always required attribute"); 2890Debug.Assert(_input.LocalName == "use-attribute-sets", "we are positioned on this attribute"); 2891Debug.Assert(list != null && list.Count == 0, "It happened that we always add use-attribute-sets first. Otherwise we can't call list.Clear()"); 2954Debug.Assert(!_input.IsRequiredAttribute(attNum), "All Yes/No attributes are optional."); 2974Debug.Assert(!_input.IsRequiredAttribute(attNum), "All 'type' attributes are optional."); 2983Debug.Assert(!_input.IsRequiredAttribute(attNum), "All 'validation' attributes are optional."); 3009Debug.Assert(!_input.IsRequiredAttribute(attNum), "All 'input-type-validation' attributes are optional.");
System\Xml\Xsl\Xslt\XsltQilFactory.cs (4)
28Debug.Assert(xt.IsSingleton && xt.IsStrict, "Xslt assumes that these types will always be singleton and strict"); 34Debug.Assert(IsDebug, "QName is reserved as the marker for missing values"); 45Debug.Assert(n != null && n.XmlType!.IsSubtypeOf(T.QNameX), "Must be a singleton QName"); 121Debug.Assert(value != null && (
System\Xml\Xsl\XsltOld\ActionFrame.cs (3)
113Debug.Assert(!_withParams.Contains(name), "We should check duplicate params at compile time"); 155Debug.Assert(proc.ActionStack.Peek() == this, "the trick we are doing with proc.Current will work only if this is topmost frame"); 327Debug.Assert(index > 0, "MoveNext() wasn't called");
System\Xml\Xsl\XsltOld\BeginEvent.cs (1)
46Debug.Assert(!_replaceNSAliasesDone, "Second attempt to replace NS aliases!. This bad.");
System\Xml\Xsl\XsltOld\Compiler.cs (9)
551Debug.Assert(!_documentURIs.Contains(href), "Circular references must be checked while processing xsl:include and xsl:import"); 557Debug.Assert(_documentURIs.Contains(href), "Attempt to remove href that was not added"); 805Debug.Assert(avt.Length != start, "Empty string not supposed here"); 806Debug.Assert(lex.Length == 0, "Builder should to be reset here"); 845Debug.Assert(avt.Length != start, "Empty string not supposed here"); 846Debug.Assert(lex.Length == 0, "Builder should to be reset here"); 847Debug.Assert(avt[start] == '{', "We calling getXPathLex() only after we really meet {"); 915Debug.Assert(saveStart < start, "We have to read something. Otherwise it's dead loop."); 944Debug.Assert(!constant || list.Count <= 1, "We can't have more then 1 text event if now {avt} found");
System\Xml\Xsl\XsltOld\InputScopeManager.cs (7)
59Debug.Assert(_scopeStack != null, "Push/Pop disbalance"); 75Debug.Assert(_scopeStack != null, "PushScope wasn't called"); 95Debug.Assert(_scopeStack != null, "PushScope wasn't called"); 139Debug.Assert(_scopeStack != null, "PushScope wasn't called"); 149Debug.Assert(_scopeStack != null, "PushScope wasn't called"); 162Debug.Assert(_scopeStack != null, "PushScope wasn't called"); 172Debug.Assert(_scopeStack != null, "PushScope wasn't called");
System\Xml\Xsl\XsltOld\Processor.cs (11)
142Debug.Assert(_resolver != null, "Constructor should create it if null passed"); 151Debug.Assert(_sortArray != null, "InitSortArray() wasn't called"); 202Debug.Assert(_sortArray != null, "InitSortArray() wasn't called"); 828Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State, 1019Debug.Assert(result != null, "Variable was just calculated and result can't be null"); 1058Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger"); 1070Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger"); 1076Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger"); 1078Debug.Assert(dbgFrame != null, "PushDebuggerStack() wasn't ever called"); 1085Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger"); 1092Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger");
System\Xml\Xsl\XsltOld\ReaderOutput.cs (1)
344Debug.Assert(Value.Length != 0, "It whould be Whitespace in this case");
System\Xml\Xsl\XsltOld\SequentialOutput.cs (7)
162Debug.Assert(!_isHtmlOutput || mainNode.Prefix != null, "Html can't have abbreviated elements"); 213Debug.Assert(i < node.TextInfoCount, "disableEscaping marker can't be last TextInfo record"); 232Debug.Assert(_outputDoctype, "It supposed to check this condition before actual call"); 233Debug.Assert(_output.DoctypeSystem != null || (_isHtmlOutput && _output.DoctypePublic != null), "We set outputDoctype == true only if"); 267Debug.Assert(_outputXmlDecl, "It supposed to check this condition before actual call"); 268Debug.Assert(_isXmlOutput && !_output.OmitXmlDeclaration, "We set outputXmlDecl == true only if"); 660Debug.Assert(0 <= i, "find char wasn't really find");
System\Xml\Xsl\XsltOld\TemplateAction.cs (1)
139Debug.Assert(!(union.qy2 is UnionExpr), "only qy1 can be union");
System\Xml\Xsl\XsltOld\XsltCompileContext.cs (3)
329Debug.Assert( 344Debug.Assert( 995Debug.Assert(args.Length <= this.Minargs, "We are checking this on resolve time");
System.Private.Xml.Linq (13)
System\Xml\Linq\XContainer.cs (2)
1059Debug.Assert(e != null, "EndElement received but the current container is not an element."); 1175Debug.Assert(e != null, "EndElement received but the current container is not an element.");
System\Xml\Linq\XHashtable.cs (5)
147Debug.Assert(BitOperations.IsPow2(capacity), "capacity must be a power of 2"); 148Debug.Assert(extractKey != null, "extractKey may not be null"); 200Debug.Assert(entryIdx == EndOfList, "Resize() should only be called by one thread"); 232Debug.Assert(entryIdx == FullList, "Linked list should have been closed when it was counted"); 398Debug.Assert(key != null, "key should have been checked previously for null");
System\Xml\Linq\XNamespace.cs (5)
217Debug.Assert(index >= 0 && index <= localName.Length, "Caller should have checked that index was in bounds"); 218Debug.Assert(count >= 0 && index + count <= localName.Length, "Caller should have checked that count was in bounds"); 235Debug.Assert(index >= 0 && index <= namespaceName.Length, "Caller should have checked that index was in bounds"); 236Debug.Assert(count >= 0 && index + count <= namespaceName.Length, "Caller should have checked that count was in bounds"); 274Debug.Assert(n != null, "Null name should never exist here");
System\Xml\Linq\XNodeReader.cs (1)
1386Debug.Assert(_omitDuplicateNamespaces, "This method should only be called if we're omitting duplicate namespace attribute. For perf reason it's better to test this flag in the caller method.");
System.Reflection.Emit (3)
System\Reflection\Emit\ILGeneratorImpl.cs (3)
434Debug.Assert(opcode.Equals(OpCodes.Call) || 443Debug.Assert(opcode.Equals(OpCodes.Call) || 579Debug.Assert(opcode.Equals(OpCodes.Calli), "Unexpected opcode encountered for StackBehaviour VarPop.");
System.Reflection.Metadata (8)
src\libraries\Common\src\System\HexConverter.cs (2)
337Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 338Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Reflection\Metadata\BlobReader.cs (1)
137Debug.Assert((alignment & (alignment - 1)) == 0, "Alignment must be a power of two.");
System\Reflection\Metadata\Internal\StringHeap.cs (3)
291Debug.Assert(rawHandle.StringKind != StringKind.DotTerminated, "Not supported"); 310Debug.Assert(rawHandle.StringKind != StringKind.DotTerminated, "Not supported"); 320Debug.Assert(rawHandle.StringKind != StringKind.DotTerminated, "Not supported");
System\Reflection\Metadata\TypeNameParser.cs (1)
265Debug.Assert(nestedNameLength > 0, "TryGetTypeNameInfo should return error on zero lengths");
System.Reflection.MetadataLoadContext (2)
System\Reflection\Runtime\General\ListBuilder.cs (1)
38Debug.Assert(!_toArrayAlreadyCalled, "Cannot call ListBuilder.ToArray() a second time. Copy the one you already got.");
System\Reflection\TypeLoading\General\Helpers.cs (1)
232Debug.Assert(ns != null, "For top level types, the namespace must be string.Empty, not null");
System.Resources.Extensions (30)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (4)
294Debug.Assert(resMgrHeaderBlob.Length > 0, "ResourceWriter: Expected non empty header"); 388Debug.Assert((bw.BaseStream.Position & 7) == 0, "ResourceWriter: Name hashes array won't be 8 byte aligned! Ack!"); 399Debug.Assert((bw.BaseStream.Position & 3) == 0, "ResourceWriter: Name positions array won't be 4 byte aligned! Ack!"); 425Debug.Assert(startOfDataSection == bw.Seek(0, SeekOrigin.Current), "ResourceWriter::Generate - start of data section is wrong!");
src\libraries\System.Private.CoreLib\src\System\IO\PinnedBufferMemoryStream.cs (1)
19Debug.Assert(array != null, "Array can't be null");
src\libraries\System.Private.CoreLib\src\System\Resources\FastResourceComparer.cs (5)
75Debug.Assert(a != null && bytes != null, "FastResourceComparer::CompareOrdinal must have non-null params"); 76Debug.Assert(bCharLength * 2 <= bytes.Length, "FastResourceComparer::CompareOrdinal - numChars is too big!"); 111Debug.Assert((byteLen & 1) == 0, "CompareOrdinal is expecting a UTF-16 string length, which must be even!"); 112Debug.Assert(a != null && b != null, "Null args not allowed."); 113Debug.Assert(byteLen >= 0, "byteLen must be non-negative.");
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (20)
46Debug.Assert(value >= 0, "negative ResourceTypeCode. What?"); 202Debug.Assert(_nameHashes != null && _nameHashesPtr == null, "Internal state mangled."); 207Debug.Assert(_nameHashes == null && _nameHashesPtr != null, "Internal state mangled."); 218Debug.Assert(_namePositions != null && _namePositionsPtr == null, "Internal state mangled."); 223Debug.Assert(_namePositions == null && _namePositionsPtr != null, "Internal state mangled."); 259Debug.Assert(_store != null, "ResourceReader is closed!"); 340Debug.Assert(_store != null, "ResourceReader is closed!"); 383Debug.Assert(_store != null, "ResourceReader is closed!"); 454Debug.Assert(_store != null, "ResourceReader is closed!"); 478Debug.Assert(_store != null, "ResourceReader is closed!"); 540Debug.Assert(_store != null, "ResourceReader is closed!"); 541Debug.Assert(_version == 1, ".resources file was not a V1 .resources file!"); 622Debug.Assert(_store != null, "ResourceReader is closed!"); 623Debug.Assert(_version >= 2, ".resources file was not a V2 (or higher) .resources file!"); 730Debug.Assert(r == len, "ResourceReader needs to use a blocking read here. (Call _store.ReadBytes(len)?)"); 783Debug.Assert(_store != null, "ResourceReader is closed!"); 1002Debug.Assert(_typeTable[typeIndex] != null, "Should have found a type!"); 1033Debug.Assert(typeCode >= 0, "can't be negative"); 1038Debug.Assert(!string.Equals(typeCode.ToString(), "LastPrimitive"), "Change ResourceTypeCode metadata order so LastPrimitive isn't what Enum.ToString prefers."); 1044Debug.Assert(typeIndex >= 0 && typeIndex < _typeTable.Length, "TypeCode is broken or corrupted!");
System.Resources.Writer (4)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (4)
294Debug.Assert(resMgrHeaderBlob.Length > 0, "ResourceWriter: Expected non empty header"); 388Debug.Assert((bw.BaseStream.Position & 7) == 0, "ResourceWriter: Name hashes array won't be 8 byte aligned! Ack!"); 399Debug.Assert((bw.BaseStream.Position & 3) == 0, "ResourceWriter: Name positions array won't be 4 byte aligned! Ack!"); 425Debug.Assert(startOfDataSection == bw.Seek(0, SeekOrigin.Current), "ResourceWriter::Generate - start of data section is wrong!");
System.Runtime.Caching (117)
System\Runtime\Caching\CacheExpires.cs (47)
27Debug.Assert((pageIndex & 0x00ffffff) == pageIndex, "(pageIndex & 0x00ffffff) == pageIndex"); 28Debug.Assert((entryIndex & ENTRY_MASK) == entryIndex, "(entryIndex & ENTRY_MASK) == entryIndex"); 29Debug.Assert(entryIndex != 0 || pageIndex == 0, "entryIndex != 0 || pageIndex == 0"); 118Debug.Assert(_cPagesInUse == 0, "_cPagesInUse == 0"); 119Debug.Assert(_cEntriesInUse == 0, "_cEntriesInUse == 0"); 120Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0"); 182Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)"); 188Debug.Assert((_pages[(list._head)]._pagePrev) == -1, "PagePrev(list._head) == -1"); 201Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)"); 207Debug.Assert((_pages[(list._tail)]._pageNext) == -1, "PageNext(list._tail) == -1"); 220Debug.Assert(list._head != -1, "list._head != -1"); 229Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)"); 233Debug.Assert((_pages[((_pages[(pageIndex)]._pagePrev))]._pageNext) == pageIndex, "PageNext(PagePrev(pageIndex)) == pageIndex"); 238Debug.Assert(list._head == pageIndex, "list._head == pageIndex"); 244Debug.Assert((_pages[((_pages[(pageIndex)]._pageNext))]._pagePrev) == pageIndex, "PagePrev(PageNext(pageIndex)) == pageIndex"); 249Debug.Assert(list._tail == pageIndex, "list._tail == pageIndex"); 259Debug.Assert(list._head != -1, "list._head != -1"); 260Debug.Assert(list._tail != -1, "list._tail != -1"); 272Debug.Assert(list._head != -1, "list._head != -1"); 273Debug.Assert(list._tail != -1, "list._tail != -1"); 293Debug.Assert(capacity > 0, "capacity > 0"); 294Debug.Assert(MIN_LOAD_FACTOR < 1.0, "MIN_LOAD_FACTOR < 1.0"); 307Debug.Assert((((_pages[(pageIndex)]._entries))[0]._cFree) == NUM_ENTRIES, "FreeEntryCount(EntriesI(pageIndex)) == NUM_ENTRIES"); 312Debug.Assert((_pages[(pageIndex)]._entries) != null, "EntriesI(pageIndex) != null"); 328Debug.Assert(_freeEntryList._head >= 0, "_freeEntryList._head >= 0"); 338Debug.Assert(((entries)[0]._next).IsInvalid, "FreeEntryHead(entries).IsInvalid"); 349Debug.Assert(entries[entryIndex]._cacheEntry == null, "entries[entryIndex]._cacheEntry == null"); 370Debug.Assert(_cPagesInUse * NUM_ENTRIES == _cEntriesInUse, "_cPagesInUse * NUM_ENTRIES == _cEntriesInUse"); 371Debug.Assert(_freeEntryList._head == -1, "_freeEntryList._head == -1"); 372Debug.Assert(_freeEntryList._tail == -1, "_freeEntryList._tail == -1"); 386Debug.Assert(_cPagesInUse == oldLength, "_cPagesInUse == oldLength"); 387Debug.Assert(_cEntriesInUse == oldLength * NUM_ENTRIES, "_cEntriesInUse == oldLength * ExpiresEntryRef.NUM_ENTRIES"); 392Debug.Assert(newLength > oldLength, "newLength > oldLength"); 439Debug.Assert(_freeEntryList._head != -1, "_freeEntryList._head != -1"); 440Debug.Assert(_freeEntryList._tail != -1, "_freeEntryList._tail != -1"); 441Debug.Assert(_freeEntryList._head != _freeEntryList._tail, "_freeEntryList._head != _freeEntryList._tail"); 476Debug.Assert(((entries)[0]._cFree) > 0, "FreeEntryCount(entries) > 0"); 486Debug.Assert(_freeEntryList._head != _freeEntryList._tail, "_freeEntryList._head != _freeEntryList._tail"); 488Debug.Assert(newRef.PageIndex != _freeEntryList._tail, "newRef.PageIndex != _freeEntryList._tail"); 512Debug.Assert((cacheEntry.ExpiresBucket == 0xff) == entryRef.IsInvalid, "(cacheEntry.ExpiresBucket == 0xff) == entryRef.IsInvalid"); 522Debug.Assert(cacheEntry.ExpiresBucket == 0xff, "cacheEntry.ExpiresBucket == 0xff"); 523Debug.Assert(cacheEntry.ExpiresEntryRef.IsInvalid, "cacheEntry.ExpiresEntryRef.IsInvalid"); 610Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0"); 628Debug.Assert(_blockReduce == false, "_blockReduce == false"); 695Debug.Assert(!inFlushHead.IsInvalid, "!inFlushHead.IsInvalid"); 709Debug.Assert(cacheEntry.ExpiresEntryRef.IsInvalid, "cacheEntry.ExpiresEntryRef.IsInvalid"); 738Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0");
System\Runtime\Caching\CacheUsage.cs (59)
27Debug.Assert((pageIndex & 0x00ffffff) == pageIndex, "(pageIndex & 0x00ffffff) == pageIndex"); 28Debug.Assert((Math.Abs(entryIndex) & ENTRY_MASK) == (Math.Abs(entryIndex)), "(Math.Abs(entryIndex) & ENTRY_MASK) == Math.Abs(entryIndex)"); 29Debug.Assert(entryIndex != 0 || pageIndex == 0, "entryIndex != 0 || pageIndex == 0"); 52Debug.Assert(result > 0, "result > 0"); 62Debug.Assert(result < 0, "result < 0"); 148Debug.Assert(_cPagesInUse == 0, "_cPagesInUse == 0"); 149Debug.Assert(_cEntriesInUse == 0, "_cEntriesInUse == 0"); 150Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0"); 151Debug.Assert(_lastRefHead.IsInvalid, "_lastRefHead.IsInvalid"); 152Debug.Assert(_lastRefTail.IsInvalid, "_lastRefTail.IsInvalid"); 153Debug.Assert(_addRef2Head.IsInvalid, "_addRef2Head.IsInvalid"); 165Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)"); 171Debug.Assert((_pages[(list._head)]._pagePrev) == -1, "PagePrev(list._head) == -1"); 184Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)"); 190Debug.Assert((_pages[(list._tail)]._pageNext) == -1, "PageNext(list._tail) == -1"); 203Debug.Assert(list._head != -1, "list._head != -1"); 212Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)"); 216Debug.Assert((_pages[((_pages[(pageIndex)]._pagePrev))]._pageNext) == pageIndex, "PageNext(PagePrev(pageIndex)) == pageIndex"); 221Debug.Assert(list._head == pageIndex, "list._head == pageIndex"); 227Debug.Assert((_pages[((_pages[(pageIndex)]._pageNext))]._pagePrev) == pageIndex, "PagePrev(PageNext(pageIndex)) == pageIndex"); 232Debug.Assert(list._tail == pageIndex, "list._tail == pageIndex"); 242Debug.Assert(list._head != -1, "list._head != -1"); 243Debug.Assert(list._tail != -1, "list._tail != -1"); 254Debug.Assert(list._head != -1, "list._head != -1"); 255Debug.Assert(list._tail != -1, "list._tail != -1"); 273Debug.Assert(capacity > 0, "capacity > 0"); 274Debug.Assert(MIN_LOAD_FACTOR < 1.0, "MIN_LOAD_FACTOR < 1.0"); 287Debug.Assert((((_pages[(pageIndex)]._entries))[0]._cFree) == NUM_ENTRIES, "FreeEntryCount(EntriesI(pageIndex)) == NUM_ENTRIES"); 292Debug.Assert((_pages[(pageIndex)]._entries) != null, "EntriesI(pageIndex) != null"); 308Debug.Assert(_freeEntryList._head >= 0, "_freeEntryList._head >= 0"); 318Debug.Assert(((entries)[0]._ref1._next).IsInvalid, "FreeEntryHead(entries).IsInvalid"); 326Debug.Assert(entryRef.IsRef1, "entryRef.IsRef1"); 331Debug.Assert(entries[entryIndex]._cacheEntry == null, "entries[entryIndex]._cacheEntry == null"); 355Debug.Assert(_cPagesInUse * NUM_ENTRIES == _cEntriesInUse, "_cPagesInUse * NUM_ENTRIES == _cEntriesInUse"); 356Debug.Assert(_freeEntryList._head == -1, "_freeEntryList._head == -1"); 357Debug.Assert(_freeEntryList._tail == -1, "_freeEntryList._tail == -1"); 371Debug.Assert(_cPagesInUse == oldLength, "_cPagesInUse == oldLength"); 372Debug.Assert(_cEntriesInUse == oldLength * NUM_ENTRIES, "_cEntriesInUse == oldLength * ExpiresEntryRef.NUM_ENTRIES"); 377Debug.Assert(newLength > oldLength, "newLength > oldLength"); 424Debug.Assert(_freeEntryList._head != -1, "_freeEntryList._head != -1"); 425Debug.Assert(_freeEntryList._tail != -1, "_freeEntryList._tail != -1"); 426Debug.Assert(_freeEntryList._head != _freeEntryList._tail, "_freeEntryList._head != _freeEntryList._tail"); 459Debug.Assert(((entries)[0]._cFree) > 0, "FreeEntryCount(entries) > 0"); 469Debug.Assert(_freeEntryList._head != _freeEntryList._tail, "_freeEntryList._head != _freeEntryList._tail"); 472Debug.Assert(newRef1.PageIndex != _freeEntryList._tail, "newRef1.PageIndex != _freeEntryList._tail"); 478Debug.Assert(cacheEntry.UsageEntryRef == oldRef1, "cacheEntry.UsageEntryRef == oldRef1"); 487Debug.Assert(prev != oldRef2, "prev != oldRef2"); 505Debug.Assert(next != oldRef1, "next != oldRef1"); 531Debug.Assert(cacheEntry.UsageEntryRef.IsInvalid, "cacheEntry.UsageEntryRef.IsInvalid"); 583Debug.Assert(entryRef.IsRef1, "entryRef.IsRef1"); 683Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0"); 700Debug.Assert(_blockReduce == false, "_blockReduce == false"); 709Debug.Assert(_cEntriesInUse > 0, "_cEntriesInUse > 0"); 723Debug.Assert(utcDate != DateTime.MinValue, "utcDate != DateTime.MinValue"); 731Debug.Assert(cacheEntry.UsageEntryRef == prev1, "cacheEntry.UsageEntryRef == prev1"); 761Debug.Assert(!inFlushHead.IsInvalid, "!inFlushHead.IsInvalid"); 775Debug.Assert(cacheEntry.UsageEntryRef.IsInvalid, "cacheEntry.UsageEntryRef.IsInvalid"); 801Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0"); 851Debug.Assert(bucket != 0xff, "bucket != 0xff");
System\Runtime\Caching\ChangeMonitor.cs (3)
145Debug.Assert(_flags[INITIALIZED], "It is critical that INITIALIZED is set before CHANGED is checked below"); 162Debug.Assert(_flags[CHANGED], "It is critical that CHANGED is set before INITIALIZED is checked below."); 208Debug.Assert(_flags[CHANGED], "It is critical that CHANGED is set before INITIALIZED is checked below.");
System\Runtime\Caching\MemoryCacheEntry.cs (1)
257Debug.Assert(_fields._dependents == null, "_fields._dependents == null");
System\Runtime\Caching\MemoryCacheEntryChangeMonitor.cs (1)
136Debug.Assert(keys != null && keys.Count > 0, "keys != null && keys.Count > 0");
System\Runtime\Caching\MemoryCacheStore.cs (3)
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.Numerics (14)
src\libraries\Common\src\System\HexConverter.cs (2)
337Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 338Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Number.Formatting.Common.cs (1)
820Debug.Assert(p >= spanPtr - 1, "Underflow");
src\libraries\Common\src\System\Number.NumberBuffer.cs (3)
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\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\FormattingHelpers.CountDigits.cs (1)
103Debug.Assert(table.Length == 32, "Every result of uint.Log2(value) needs a long entry in the table.");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (1)
94Debug.Assert(index == 0, "Implementation currently only supports index == 0");
System\Number.BigInteger.cs (1)
926Debug.Assert(base1E9Value[^1] != 0, "Leading zeros should be trimmed by caller.");
System\Numerics\BigInteger.cs (4)
1329Debug.Assert(mode == GetBytesMode.Span || destination.IsEmpty, $"If we're not in span mode, we shouldn't have been passed a destination."); 1649Debug.Assert(!(trivialLeft && trivialRight), "Trivial cases should be handled on the caller operator"); 1727Debug.Assert(!(trivialLeft && trivialRight), "Trivial cases should be handled on the caller operator"); 2702Debug.Assert(!(trivialLeft && trivialRight), "Trivial cases should be handled on the caller operator");
System.Runtime.Serialization.Formatters (36)
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (1)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
System\Runtime\Serialization\ObjectManager.cs (33)
89Debug.Assert(holder != null, "holder!=null"); 90Debug.Assert(holder._id >= 0, "holder.m_id>=0"); 176Debug.Assert(holder.RequiresSerInfoFixup, "[ObjectManager.FixupSpecialObject]holder.HasSurrogate||holder.HasISerializable"); 180Debug.Assert(surrogate != null, "surrogate!=null"); 197Debug.Assert(holder.ObjectValue is ISerializable, "holder.m_object is ISerializable"); 284Debug.Assert(holder != null, "[TypedReferenceBuilder.ctor]holder!=null"); 285Debug.Assert(holder.RequiresValueTypeFixup, "[TypedReferenceBuilder.ctor]holder.RequiresValueTypeFixup"); 333Debug.Assert(currFixup.ParentIndex != null, "[ObjectManager.DoValueTypeFixup]currFixup.ParentIndex!=null"); 346Debug.Assert(fixupObj != null, "[ObjectManager.DoValueTypeFixup]FixupObj!=null"); 362Debug.Assert(fixupObj != null, "[ObjectManager.DoValueTypeFixup]fixupObj!=null"); 408Debug.Assert(holder != null, "[ObjectManager.CompleteObject]holder.m_object!=null"); 437Debug.Assert(fixups._values[i]!._fixupType == FixupHolder.DelayedFixup, "fixups.m_values[i].m_fixupType==FixupHolder.DelayedFixup"); 597Debug.Assert(temp.DirectlyDependentObjects > 0, "temp.m_missingElementsRemaining>0"); 654Debug.Assert(member == null || member is FieldInfo, "RegisterString - member is FieldInfo"); 859Debug.Assert(_fixupCount >= 0, "[ObjectManager.DoFixups]m_fixupCount>=0"); 1044Debug.Assert(objID >= 0, "objID>=0"); 1081Debug.Assert(objID >= 0, "objID>=0"); 1127Debug.Assert(_dependentObjects != null, "[ObjectHolder.RemoveDependency]m_dependentObjects!=null"); 1128Debug.Assert(id >= 0, "[ObjectHolder.RemoveDependency]id>=0"); 1168Debug.Assert(holder != null, "[ObjectHolder.UpdateTotalDependencyChain]holder!=null"); 1203Debug.Assert(obj != null, "obj!=null"); 1204Debug.Assert(_id > 0, "m_id>0"); 1390Debug.Assert(id > 0, "id>0"); 1391Debug.Assert(fixupInfo != null, "fixupInfo!=null"); 1392Debug.Assert(fixupType == ArrayFixup || fixupType == MemberFixup || fixupType == DelayedFixup, "fixupType==ArrayFixup || fixupType == MemberFixup || fixupType==DelayedFixup"); 1486Debug.Assert(_currentItem != -1, "[LongList.Current]m_currentItem!=-1"); 1487Debug.Assert(_values[_currentItem] != -1, "[LongList.Current]m_values[m_currentItem]!=-1"); 1537Debug.Assert(startingSize > 0 && startingSize < 0x1000, "startingSize>0 && startingSize<0x1000"); 1580Debug.Assert(list != null, "[ObjectHolderListEnumerator.ctor]list!=null"); 1589Debug.Assert(_startingVersion == _list.Version, "[ObjectHolderListEnumerator.MoveNext]m_startingVersion==m_list.Version"); 1606Debug.Assert(_currPos != -1, "[ObjectHolderListEnumerator.Current]m_currPos!=-1"); 1607Debug.Assert(_currPos < _list.Count, "[ObjectHolderListEnumerator.Current]m_currPos<m_list.Count"); 1608Debug.Assert(_startingVersion == _list.Version, "[ObjectHolderListEnumerator.Current]m_startingVersion==m_list.Version");
System\Runtime\Serialization\SerializationEventsCache.cs (1)
77Debug.Assert(obj != null, "object should have been initialized");
System\Runtime\Serialization\SurrogateSelector.cs (1)
26Debug.Assert(selector != null, "[HasCycle]selector!=null");
System.Runtime.Serialization.Schema (2)
System\Runtime\Serialization\Schema\CodeExporter.cs (1)
821Debug.Assert(baseContractCodeDomInfo.IsProcessed, "Cannot generate code for type if code for base type has not been generated");
System\Runtime\Serialization\Schema\DiagnosticUtility.cs (1)
70Debug.Assert(condition, message);
System.Security.Cryptography (36)
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)
129Debug.Assert(verifyTime.Kind != DateTimeKind.Utc, "UTC verifyTime should have been normalized to Local");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Dsa.cs (1)
92Debug.Assert(
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (1)
83Debug.Assert(error <= uint.MaxValue, "ErrGetError should only return error codes in the UInt32 range.");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EvpPkey.cs (2)
300Debug.Assert(evpPKeyHandle == IntPtr.Zero && extraHandle == IntPtr.Zero, "both handles should be null if provider is not supported"); 306Debug.Assert(evpPKeyHandle == IntPtr.Zero, "extraHandle should not be null if evpPKeyHandle is not null");
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs (2)
50Debug.Assert(_parent == null, "Expected no existing parent"); 51Debug.Assert(parent != null && !parent.IsInvalid, "Expected new parent to be non-null and valid");
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (1)
53Debug.Assert(!isCachedInvalidHandle || handle.IsInvalid, "The cached invalid handle must still be invalid.");
src\libraries\Common\src\System\HexConverter.cs (2)
337Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 338Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Security\Cryptography\ECOpenSsl.cs (1)
46Debug.Assert(currentKey != null, "key is null");
src\libraries\Common\src\System\Security\Cryptography\KeyFormatHelper.cs (2)
170Debug.Assert(algorithmIdentifierLength > 0, "algorithmIdentifier was empty"); 171Debug.Assert(privateKeyLength > 0, "privateKey was empty");
src\libraries\Common\src\System\Security\Cryptography\SP800108HmacCounterKdfImplementationManaged.cs (1)
94Debug.Assert(newReferenceCount >= 0, newReferenceCount.ToString());
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Security\Cryptography\CryptoStream.cs (2)
144Debug.Assert(_outputBufferIndex == 0, "The output index can only ever be non-zero when in read mode."); 563Debug.Assert(_outputBufferIndex == 0, "The output index can only ever be non-zero when in read mode.");
System\Security\Cryptography\CspParameters.cs (1)
31Debug.Assert((CspProviderFlags.UseMachineKeyStore |
System\Security\Cryptography\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\HKDFManagedImplementation.cs (1)
69Debug.Assert(hashLength <= 512 / 8, "hashLength is larger than expected, consider increasing this value or using regular allocation");
System\Security\Cryptography\Rfc2898DeriveBytes.cs (1)
207Debug.Assert(_startIndex == 0 && _endIndex == 0, "Invalid start or end index in the internal buffer.");
System\Security\Cryptography\UniversalCryptoDecryptor.cs (1)
57Debug.Assert(inputBuffer.Length % InputBlockSize == 0, "Did not remove whole blocks for depadding");
System\Security\Cryptography\X509Certificates\OpenSslCachedSystemStoreProvider.cs (3)
114Debug.Assert( 144Debug.Assert( 309Debug.Assert(
System\Security\Cryptography\X509Certificates\OpenSslCrlCache.cs (1)
164Debug.Assert(
System\Security\Cryptography\X509Certificates\OpenSslDirectoryBasedStoreProvider.cs (1)
34Debug.Assert(
System\Security\Cryptography\X509Certificates\OpenSslX509CertificateReader.cs (2)
794Debug.Assert( 797Debug.Assert(
System\Security\Cryptography\X509Certificates\OpenSslX509ChainProcessor.cs (2)
676Debug.Assert(!verify, "verify should have returned false for signature error"); 690Debug.Assert(verify, "verify should have returned true");
System\Security\Cryptography\X509Certificates\X500RelativeDistinguishedName.cs (1)
64Debug.Assert(overlaps, "AsnValueReader.ReadEncodedValue returns a slice of the source");
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (1)
1336Debug.Assert(firstDot != 0, "Leading periods should have been rejected.");
System.Security.Cryptography.Cose (3)
src\libraries\System.Formats.Cbor\src\System\Formats\Cbor\CborInitialByte.cs (2)
47Debug.Assert((byte)majorType < 8, "CBOR Major Type is out of range"); 48Debug.Assert((byte)additionalInfo < 32, "CBOR initial byte additional info is out of range");
System\Security\Cryptography\Cose\CoseSigner.cs (1)
157Debug.Assert(alg.HasValue, "Algorithm (alg) is a known header and should have been validated in Set[Encoded]Value()");
System.Security.Cryptography.Pkcs (7)
src\libraries\Common\src\System\HexConverter.cs (2)
337Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 338Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Security\Cryptography\KeyFormatHelper.cs (2)
170Debug.Assert(algorithmIdentifierLength > 0, "algorithmIdentifier was empty"); 171Debug.Assert(privateKeyLength > 0, "privateKey was empty");
System\Security\Cryptography\Pkcs\Rfc3161TimestampToken.cs (1)
44Debug.Assert(_signerInfo != null, "_signerInfo != null");
System\Security\Cryptography\Pkcs\SignerInfo.cs (2)
478Debug.Assert(compatMode, $"{nameof(PrepareDigest)} returned null for the primary check"); 765Debug.Assert(compatMode, $"{nameof(PrepareDigest)} returned null for the primary check");
System.Security.Cryptography.Xml (54)
src\libraries\Common\src\System\HexConverter.cs (2)
337Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 338Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
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.ServiceModel.Federation (1)
System\Runtime\OperationWithTimeoutAsyncResult.cs (1)
159Debug.Assert(_manualResetEvent == null, "No ManualResetEvent should be created for a synchronous AsyncResult.");
System.ServiceModel.Syndication (20)
System\ServiceModel\Syndication\Atom10FeedFormatter.cs (1)
594Debug.Assert(!FeedUtils.IsXmlns(attr.Name, attr.Namespace), "XML namespace attributes should not be added to the list.");
System\ServiceModel\Syndication\SyndicationElementExtension.cs (8)
216Debug.Assert(_extensionDataWriter != null, "outer name is null only for datacontract and xmlserializer cases"); 231Debug.Assert(extensionData != null && dataContractSerializer != null, "null check"); 240Debug.Assert(extensionData != null && serializer != null, "null check"); 249Debug.Assert((_dataContractSerializer == null && _outerName == null && _outerNamespace == null), "Xml serializer cannot have outer name, ns"); 254Debug.Assert(_xmlSerializer == null, "Xml serializer cannot be configured"); 270Debug.Assert(_outerName == null, "All callers of this function should already check for a null outer name."); 273Debug.Assert(_xmlSerializer == null, "only one of xmlserializer or datacontract serializer can be present"); 289Debug.Assert(_dataContractSerializer == null, "only one of xmlserializer or datacontract serializer can be present");
System\ServiceModel\Syndication\SyndicationElementExtensionCollection.cs (4)
161Debug.Assert(_initialized, "The constructor should never clear the collection."); 184Debug.Assert(_initialized, "The constructor should never remove items from the collection."); 196Debug.Assert(_initialized, "The constructor should never set items in the collection."); 245Debug.Assert((dcSerializer == null) != (xmlSerializer == null), "exactly one serializer should be supplied");
System\ServiceModel\Syndication\SyndicationFeedFormatter.cs (1)
557Debug.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)
27Debug.Assert(source != null, "The base constructor already checks if source is valid.");
System\ServiceModel\Syndication\XmlSyndicationContent.cs (4)
81Debug.Assert(source != null, "The base constructor already checks if source is valid."); 110Debug.Assert(_contentBuffer != null, "contentBuffer cannot be null"); 129Debug.Assert(_contentBuffer != null, "contentBuffer cannot be null"); 153Debug.Assert(_contentBuffer != null, "contentBuffer cannot be null");
System.Text.Encoding.CodePages (149)
System\Text\BaseCodePageEncoding.cs (7)
105Debug.Assert(stream is UnmanagedMemoryStream, "UnmanagedMemoryStream will read a full buffer on one call to Read."); 143Debug.Assert(stream is UnmanagedMemoryStream, "UnmanagedMemoryStream will read a full buffer on one call to Read."); 189Debug.Assert(stream is UnmanagedMemoryStream, "UnmanagedMemoryStream will read a full buffer on one call to Read."); 230Debug.Assert(tableName != null, "table name can not be null"); 266Debug.Assert(m_codePageHeader != null && m_codePageHeader.Length == CODEPAGE_HEADER_SIZE, "m_codePageHeader expected to match in size the struct CodePageHeader"); 385Debug.Assert(arrayUnicodeBestFit != null, "[BaseCodePageEncoding.GetBestFitUnicodeToBytesData]Expected non-null arrayUnicodeBestFit"); 396Debug.Assert(arrayBytesBestFit != null, "[BaseCodePageEncoding.GetBestFitBytesToUnicodeData]Expected non-null arrayBytesBestFit");
System\Text\BaseCodePageEncoding.netcoreapp.cs (1)
16Debug.Assert(stream is UnmanagedMemoryStream, "UnmanagedMemoryStream will read a full buffer on one call to Read.");
System\Text\DBCSCodePageEncoding.cs (37)
94Debug.Assert(pCodePage->CodePage == dataTableCodePage, 116Debug.Assert(_bytesUnknown == 0x3f, 139Debug.Assert(bytesRead == m_dataSize, "s_codePagesEncodingDataStream.Read should have read a full buffer."); 179Debug.Assert(bytePosition < 0x100, "[DBCSCodePageEncoding.LoadManagedCodePage]expected lead byte to be < 0x100"); 262Debug.Assert(bytesRead == m_dataSize, "s_codePagesEncodingDataStream.Read should have read a full buffer."); 525Debug.Assert(count >= 0, "[DBCSCodePageEncoding.GetByteCount]count is negative"); 526Debug.Assert(chars != null, "[DBCSCodePageEncoding.GetByteCount]chars is null"); 529Debug.Assert(EncoderFallback != null, "[DBCSCodePageEncoding.GetByteCount]Attempting to use null fallback"); 556Debug.Assert(char.IsHighSurrogate(charLeftOver), "[DBCSCodePageEncoding.GetByteCount]leftover character should be high surrogate"); 557Debug.Assert(encoder != null, 621Debug.Assert(bytes != null, "[DBCSCodePageEncoding.GetBytes]bytes is null"); 622Debug.Assert(byteCount >= 0, "[DBCSCodePageEncoding.GetBytes]byteCount is negative"); 623Debug.Assert(chars != null, "[DBCSCodePageEncoding.GetBytes]chars is null"); 624Debug.Assert(charCount >= 0, "[DBCSCodePageEncoding.GetBytes]charCount is negative"); 627Debug.Assert(EncoderFallback != null, "[DBCSCodePageEncoding.GetBytes]Attempting to use null encoder fallback"); 647Debug.Assert(charLeftOver == 0 || char.IsHighSurrogate(charLeftOver), 662Debug.Assert(encoder != null, 695Debug.Assert(encoder == null, 718Debug.Assert(chars > charStart, 737Debug.Assert(chars > charStart, 770Debug.Assert(bytes != null, "[DBCSCodePageEncoding.GetCharCount]bytes is null"); 771Debug.Assert(count >= 0, "[DBCSCodePageEncoding.GetCharCount]byteCount is negative"); 787Debug.Assert(decoder == null || 807Debug.Assert(fallbackBuffer == null, 832Debug.Assert(fallbackBuffer == null, 907Debug.Assert(decoder == null || !decoder.m_throwOnOverflow || 919Debug.Assert(bytes != null, "[DBCSCodePageEncoding.GetChars]bytes is null"); 920Debug.Assert(byteCount >= 0, "[DBCSCodePageEncoding.GetChars]byteCount is negative"); 921Debug.Assert(chars != null, "[DBCSCodePageEncoding.GetChars]chars is null"); 922Debug.Assert(charCount >= 0, "[DBCSCodePageEncoding.GetChars]charCount is negative"); 940Debug.Assert(decoder == null || !decoder.m_throwOnOverflow || 961Debug.Assert(fallbackBuffer == null, 987Debug.Assert(fallbackBuffer == null, 1065Debug.Assert(bytes >= byteStart + byteBuffer.Length, 1079Debug.Assert(bytes > byteStart, 1084Debug.Assert(bytes > byteStart, 1110Debug.Assert(decoder == null || !decoder.m_throwOnOverflow ||
System\Text\DecoderBestFitFallback.cs (3)
84Debug.Assert(iCount < 1, "[DecoderReplacementFallbackBuffer.Fallback] Calling fallback without a previously empty buffer"); 182Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length, 203Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length,
System\Text\DecoderFallbackBufferHelper.cs (2)
46Debug.Assert(byteStart != null, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize"); 102Debug.Assert(byteStart != null, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize");
System\Text\EncoderBestFitFallback.cs (2)
187Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length, 208Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length,
System\Text\EncoderFallbackBufferHelper.cs (1)
74Debug.Assert(charStart != null, "[EncoderFallback.InternalFallbackBuffer]Fallback buffer is not initialized");
System\Text\EncodingByteBuffer.cs (2)
50Debug.Assert(moreBytesExpected >= 0, "[EncodingByteBuffer.AddByte]expected non-negative moreBytesExpected"); 107Debug.Assert(_chars > _charStart || (bThrow && (_bytes == _byteStart)),
System\Text\EncodingCharBuffer.cs (2)
42Debug.Assert(_fallbackBuffer.Remaining == 0, 113Debug.Assert(_bytes < _byteEnd, "[EncodingCharBuffer.GetNextByte]Expected more date");
System\Text\GB18030Encoding.cs (9)
166Debug.Assert(count4Byte <= GBLast4ByteCode, 186Debug.Assert(unicodeCount == 0, 217Debug.Assert(byteCount >= 0, "[GB18030Encoding.GetBytes]byteCount is negative"); 218Debug.Assert(chars != null, "[GB18030Encoding.GetBytes]chars is null"); 219Debug.Assert(charCount >= 0, "[GB18030Encoding.GetBytes]charCount is negative"); 222Debug.Assert(EncoderFallback != null, "[GB18030Encoding.GetBytes]Attempting to use null encoder fallback"); 402Debug.Assert(bytes != null, "[GB18030Encoding.GetChars]bytes is null"); 403Debug.Assert(byteCount >= 0, "[GB18030Encoding.GetChars]byteCount is negative"); 405Debug.Assert(charCount >= 0, "[GB18030Encoding.GetChars]charCount is negative");
System\Text\ISCIIEncoding.cs (26)
129Debug.Assert(chars != null, "[ISCIIEncoding.GetBytes]chars!=null"); 131Debug.Assert(charCount >= 0, "[ISCIIEncoding.GetBytes]charCount >=0"); 132Debug.Assert(byteCount >= 0, "[ISCIIEncoding.GetBytes]byteCount >=0"); 228Debug.Assert(indicScript != 0, "[ISCIIEncoding.GetBytes]expected an indic script value"); 318Debug.Assert(bytes != null, "[ISCIIEncoding.GetChars]bytes is null"); 319Debug.Assert(byteCount >= 0, "[ISCIIEncoding.GetChars]byteCount is negative"); 321Debug.Assert(charCount >= 0, "[ISCIIEncoding.GetChars]charCount is negative"); 431Debug.Assert(bLastVirama == false, "[ISCIIEncoding.GetChars] Expected no bLastVirama in bLastATR mode"); 432Debug.Assert(bLastDevenagariStressAbbr == false, "[ISCIIEncoding.GetChars] Expected no bLastDevenagariStressAbbr in bLastATR mode"); 433Debug.Assert(cLastCharForNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNextNukta in bLastATR mode"); 434Debug.Assert(cLastCharForNoNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNoNextNukta in bLastATR mode"); 462Debug.Assert(bLastATR == false, "[ISCIIEncoding.GetChars] Expected no bLastATR in bLastVirama mode"); 463Debug.Assert(bLastDevenagariStressAbbr == false, "[ISCIIEncoding.GetChars] Expected no bLastDevenagariStressAbbr in bLastVirama mode"); 464Debug.Assert(cLastCharForNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNextNukta in bLastVirama mode"); 465Debug.Assert(cLastCharForNoNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNoNextNukta in bLastVirama mode"); 498Debug.Assert(bLastATR == false, "[ISCIIEncoding.GetChars] Expected no bLastATR in bLastDevenagariStressAbbr mode"); 499Debug.Assert(bLastVirama == false, "[ISCIIEncoding.GetChars] Expected no bLastVirama in bLastDevenagariStressAbbr mode"); 500Debug.Assert(cLastCharForNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNextNukta in bLastDevenagariStressAbbr mode"); 501Debug.Assert(cLastCharForNoNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNoNextNukta in bLastDevenagariStressAbbr mode"); 506Debug.Assert(cLastCharForNextNukta > 0 && cLastCharForNoNextNukta > 0, 528Debug.Assert(bLastATR == false, "[ISCIIEncoding.GetChars] Expected no bLastATR in cLastCharForNextNukta mode"); 529Debug.Assert(bLastVirama == false, "[ISCIIEncoding.GetChars] Expected no bLastVirama in cLastCharForNextNukta mode"); 530Debug.Assert(bLastDevenagariStressAbbr == false, "[ISCIIEncoding.GetChars] Expected no bLastDevenagariStressAbbr in cLastCharForNextNukta mode"); 535Debug.Assert(!bLastSpecial && !bLastDevenagariStressAbbr && !bLastVirama && !bLastATR && 554Debug.Assert(currentCodePageIndex != -1, "[ISCIIEncoding.GetChars]Expected valid currentCodePageIndex != -1"); 652Debug.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow,
System\Text\ISO2022Encoding.cs (23)
226Debug.Assert(count >= 0, "[ISO2022Encoding.GetByteCount]count is negative"); 227Debug.Assert(chars != null, "[ISO2022Encoding.GetByteCount]chars is null"); 237Debug.Assert(chars != null, "[ISO2022Encoding.GetBytes]chars is null"); 238Debug.Assert(byteCount >= 0, "[ISO2022Encoding.GetBytes]byteCount is negative"); 239Debug.Assert(charCount >= 0, "[ISO2022Encoding.GetBytes]charCount is negative"); 242Debug.Assert(EncoderFallback != null, "[ISO2022Encoding.GetBytes]Attempting to use null encoder fallback"); 277Debug.Assert(bytes != null, "[ISO2022Encoding.GetCharCount]bytes is null"); 278Debug.Assert(count >= 0, "[ISO2022Encoding.GetCharCount]byteCount is negative"); 288Debug.Assert(bytes != null, "[ISO2022Encoding.GetChars]bytes is null"); 289Debug.Assert(byteCount >= 0, "[ISO2022Encoding.GetChars]byteCount is negative"); 290Debug.Assert(charCount >= 0, "[ISO2022Encoding.GetChars]charCount is negative"); 376Debug.Assert(char.IsHighSurrogate(charLeftOver), "[ISO2022Encoding.GetBytesCP5022xJP]leftover character should be high surrogate"); 437Debug.Assert(CodePage == 50221, "[ISO2022Encoding.GetBytesCP5022xJP]Expected Code Page 50221"); 617Debug.Assert(char.IsHighSurrogate(charLeftOver), "[ISO2022Encoding.GetBytesCP50225KR]leftover character should be high surrogate"); 717Debug.Assert(!encoder.MustFlush || !encoder.m_throwOnOverflow, 763Debug.Assert(char.IsHighSurrogate(charLeftOver), "[ISO2022Encoding.GetBytesCP52936]leftover character should be high surrogate"); 1086Debug.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow, 1180Debug.Assert(count > 0, "[ISO2022Encoding.DecrementEscapeBytes]count > 0"); 1385Debug.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow, 1443Debug.Assert(byteCount >= 0, "[ISO2022Encoding.GetCharsCP52936]count >=0"); 1444Debug.Assert(bytes != null, "[ISO2022Encoding.GetCharsCP52936]bytes!=null"); 1553Debug.Assert(currentMode == ISO2022Modes.ModeHZ, "[ISO2022Encoding.GetCharsCP52936]Expected ModeHZ"); 1677Debug.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow,
System\Text\SBCSCodePageEncoding.cs (34)
68Debug.Assert(pCodePage->CodePage == dataTableCodePage, 103Debug.Assert(bytesRead == buffer.Length, "s_codePagesEncodingDataStream.Read should have read a full buffer."); 167Debug.Assert(bytesRead == buffer.Length, "s_codePagesEncodingDataStream.Read should have read a full buffer."); 301Debug.Assert(count >= 0, "[SBCSCodePageEncoding.GetByteCount]count is negative"); 302Debug.Assert(chars != null, "[SBCSCodePageEncoding.GetByteCount]chars is null"); 305Debug.Assert(EncoderFallback != null, "[SBCSCodePageEncoding.GetByteCount]Attempting to use null fallback"); 317Debug.Assert(charLeftOver == 0 || char.IsHighSurrogate(charLeftOver), 322Debug.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer || 363Debug.Assert(encoder != null, "[SBCSCodePageEncoding.GetByteCount]Expect to have encoder if we have a charLeftOver"); 416Debug.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 426Debug.Assert(bytes != null, "[SBCSCodePageEncoding.GetBytes]bytes is null"); 427Debug.Assert(byteCount >= 0, "[SBCSCodePageEncoding.GetBytes]byteCount is negative"); 428Debug.Assert(chars != null, "[SBCSCodePageEncoding.GetBytes]chars is null"); 429Debug.Assert(charCount >= 0, "[SBCSCodePageEncoding.GetBytes]charCount is negative"); 432Debug.Assert(EncoderFallback != null, "[SBCSCodePageEncoding.GetBytes]Attempting to use null encoder fallback"); 444Debug.Assert(charLeftOver == 0 || char.IsHighSurrogate(charLeftOver), 449Debug.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer || 548Debug.Assert(encoder != null, "[SBCSCodePageEncoding.GetBytes]Expect to have encoder if we have a charLeftOver"); 607Debug.Assert(chars > charStart, "[SBCSCodePageEncoding.GetBytes]Expected chars to have advanced (fallback)"); 623Debug.Assert(fallbackBuffer == null || fallbackHelper.bFallingBack == false, "[SBCSCodePageEncoding.GetBytes]Expected to NOT be falling back"); 626Debug.Assert(chars > charStart, "[SBCSCodePageEncoding.GetBytes]Expected chars to have advanced (normal)"); 651Debug.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, "[SBCSEncoding.GetBytes]Expected Empty fallback buffer at end"); 660Debug.Assert(bytes != null, "[SBCSCodePageEncoding.GetCharCount]bytes is null"); 661Debug.Assert(count >= 0, "[SBCSCodePageEncoding.GetCharCount]byteCount is negative"); 680Debug.Assert(!decoder.m_throwOnOverflow || !decoder.InternalHasFallbackBuffer || 738Debug.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 749Debug.Assert(bytes != null, "[SBCSCodePageEncoding.GetChars]bytes is null"); 750Debug.Assert(byteCount >= 0, "[SBCSCodePageEncoding.GetChars]byteCount is negative"); 751Debug.Assert(chars != null, "[SBCSCodePageEncoding.GetChars]chars is null"); 752Debug.Assert(charCount >= 0, "[SBCSCodePageEncoding.GetChars]charCount is negative"); 776Debug.Assert(!decoder.m_throwOnOverflow || !decoder.InternalHasFallbackBuffer || 861Debug.Assert(bytes > byteStart, 880Debug.Assert(bytes > byteStart, 897Debug.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0,
System.Text.Encodings.Web (13)
src\libraries\Common\src\System\HexConverter.cs (2)
337Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 338Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Text\Encodings\Web\AllowedBmpCodePointsBitmap.cs (1)
81Debug.Assert(thisAllowedCharactersBitmap.IsEmpty, "Both vectors should've been fully consumed.");
System\Text\Encodings\Web\DefaultHtmlEncoder.cs (2)
107Debug.Assert(4 <= idxOfSemicolon && idxOfSemicolon <= 9, "Expected '&#x0;'..'&#x10FFFF;'."); 182Debug.Assert(4 <= idxOfSemicolon && idxOfSemicolon <= 9, "Expected '&#x0;'..'&#x10FFFF;'.");
System\Text\Encodings\Web\OptimizedInboxTextEncoder.Ascii.cs (2)
105Debug.Assert(encodedCharCount > 0 && encodedCharCount <= 6, "Inner encoder returned bad length."); 112Debug.Assert(thisChar <= 0x7F, "Inner encoder returned non-ASCII data.");
System\Text\Encodings\Web\OptimizedInboxTextEncoder.cs (3)
104Debug.Assert(innerCharsWritten <= bufferLength, "Mustn't overflow the buffer."); 105Debug.Assert(innerCharsWritten != 0, "Inner escaper succeeded with 0-char output?"); 366Debug.Assert(Ssse3.IsSupported, "#ifdef was ill-formed.");
System\Text\Encodings\Web\TextEncoder.cs (1)
515Debug.Assert(!value.IsEmpty, "Caller should've special-cased 'no encoding needed'.");
System\Text\Encodings\Web\ThrowHelper.cs (1)
25Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument),
System.Text.Json (87)
src\libraries\Common\src\System\HexConverter.cs (2)
337Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 338Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\libraries\System.Text.Json\Common\JsonHelpers.cs (2)
144Debug.Assert(childlessQueue.Count > 0, "The graph contains cycles."); 172Debug.Assert(idx == 0, "should have populated the entire sortedNodes array.");
System\Text\Json\BitStack.cs (2)
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.MetadataDb.cs (2)
159Debug.Assert(!_isLocked, "Dispose called on a locked database"); 235Debug.Assert(!_isLocked, "Appending to a locked database");
System\Text\Json\Document\JsonDocument.Parse.cs (2)
422Debug.Assert(ret, "TryParseValue returned false with shouldThrow: true."); 423Debug.Assert(document != null, "null document returned with shouldThrow: true.");
System\Text\Json\Document\JsonElement.cs (2)
1312Debug.Assert(success, "enumerators must have matching length"); 1342Debug.Assert(success, "enumerators should have matching lengths");
System\Text\Json\Document\JsonElement.Parse.cs (2)
51Debug.Assert(ret, "TryParseValue returned false with shouldThrow: true."); 52Debug.Assert(document != null, "null document returned with shouldThrow: true.");
System\Text\Json\JsonHelpers.cs (5)
49Debug.Assert(reader.AllowMultipleValues, "only supported by readers that support multiple values."); 50Debug.Assert(reader.CurrentDepth == 0, "should only invoked for top-level values."); 183Debug.Assert(success, "The skipped value should have already been buffered."); 439Debug.Assert(char.IsDigit((char)span[0]), "leading plus not allowed in valid JSON numbers."); 490Debug.Assert(intg.Length == 1, "Leading zeros not permitted in JSON numbers.");
System\Text\Json\Nodes\JsonObject.cs (1)
279Debug.Assert(_dictionary != null, "Cannot have detachable nodes without a materialized dictionary.");
System\Text\Json\Nodes\JsonValueOfT.cs (1)
65Debug.Assert(s_valueKind is not null, "Should only be invoked for types that are supported primitives.");
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (3)
167Debug.Assert(index1 >= 0, "the first parameter is not escaped"); 168Debug.Assert(index2 >= 0, "the second parameter is not escaped"); 528Debug.Assert(source[idx] == 'u', "invalid escape sequences must have already been caught by Utf8JsonReader.Read()");
System\Text\Json\Reader\Utf8JsonReader.TryGet.cs (3)
82Debug.Assert(_tokenType != JsonTokenType.Number || !ValueIsEscaped, "Numbers can't contain escape characters."); 146Debug.Assert(_tokenType != JsonTokenType.Number || !ValueIsEscaped, "Numbers can't contain escape characters."); 228Debug.Assert(bytesWritten < source.Length, "source buffer must contain at least one escape sequence");
System\Text\Json\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 (1)
197Debug.Assert(elementTypeInfo.Type.IsEnum, "The enum keyword should only be populated by schemas for enum types.");
System\Text\Json\Serialization\Converters\CastingConverter.cs (1)
28Debug.Assert(sourceConverter.SourceConverterForCastingConverter is null, "casting converters should not be layered.");
System\Text\Json\Serialization\Converters\Collection\JsonCollectionConverter.cs (2)
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.");
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\Object\ObjectDefaultConverter.cs (2)
293Debug.Assert(!isAlreadyReadMetadataProperty, "Only possible for types that can read metadata, which do not call into the fast-path method."); 475Debug.Assert(success, "Serializer should guarantee sufficient read-ahead has been done.");
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.cs (1)
330Debug.Assert(success, "Serializer should guarantee sufficient read-ahead has been done.");
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (7)
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."); 406Debug.Assert(IsDefinedValueOrCombinationOfValues(key), "must only be invoked against valid enum values."); 407Debug.Assert( 440Debug.Assert(remainingBits == 0 && sb.Length > 0, "unexpected remaining bits or empty string."); 601Debug.Assert(JsonName.Equals(other.JsonName, StringComparison.OrdinalIgnoreCase), "The conflicting entry must be equal up to case insensitivity."); 646Debug.Assert(input.Equals(JsonName.AsSpan(), StringComparison.OrdinalIgnoreCase), "Must equal the field name up to case insensitivity.");
System\Text\Json\Serialization\JsonConverter.cs (1)
191Debug.Assert(state.FlushThreshold == 0 || (state.PipeWriter is { CanGetUnflushedBytes: true }),
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.Read.HandleMetadata.cs (4)
58Debug.Assert(!allowOutOfOrderMetadata, "Object must have already been buffered in this mode."); 202Debug.Assert(!allowOutOfOrderMetadata, "Object must have already been buffered in this mode."); 270Debug.Assert(!isReadingAheadOfNonMetadataProperties, "must have already verified if non-metadata properties precede $values"); 286Debug.Assert(allowOutOfOrderMetadata, "should only be reached if reading ahead is required.");
System\Text\Json\Serialization\JsonSerializer.Read.HandlePropertyName.cs (2)
46Debug.Assert(jsonTypeInfo.ExtensionDataProperty is null, "jsonTypeInfo.Configure() should have caught conflicting configuration."); 58Debug.Assert(obj != null, "obj is null");
System\Text\Json\Serialization\JsonSerializerOptions.Caching.cs (3)
112Debug.Assert(!fallBackToNearestAncestorType || IsReadOnly, "ancestor resolution should only be invoked in read-only options."); 113Debug.Assert(ensureNotNull is null or true, "Explicitly passing false will result in invalid result annotation."); 407Debug.Assert(options.IsReadOnly, "Cannot create caching contexts for mutable JsonSerializerOptions instances");
System\Text\Json\Serialization\JsonSerializerOptions.cs (1)
1008Debug.Assert(_effectiveJsonTypeInfoResolver is null, "an effective resolver always returns metadata");
System\Text\Json\Serialization\Metadata\FSharpCoreReflectionProxy.cs (1)
90Debug.Assert(s_singletonInstance is not null, "should be initialized via a successful IsFSharpType call.");
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Helpers.cs (1)
154Debug.Assert(jsonPropertyInfo.MemberName != null, "MemberName is not set by source gen");
System\Text\Json\Serialization\Metadata\JsonParameterInfo.cs (1)
98Debug.Assert(MatchingProperty.DeclaringTypeInfo != null, "Declaring type metadata must have already been configured.");
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (11)
528Debug.Assert(EffectiveConverter != null, "Must have calculated the effective converter."); 565Debug.Assert(DeclaringTypeInfo != null, "We should have ensured parent is assigned in JsonTypeInfo"); 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."); 947Debug.Assert(EffectiveConverter.CanPopulate, "Property is marked with Populate but converter cannot populate. This should have been validated in Configure"); 948Debug.Assert(state.Parent.ReturnValue != null, "Parent object is null"); 949Debug.Assert(!state.Current.IsPopulating, "We've called TryGetPrePopulatedValue more than once");
System\Text\Json\Serialization\Metadata\JsonPropertyInfoOfT.cs (1)
312Debug.Assert(EffectiveObjectCreationHandling != JsonObjectCreationHandling.Populate, "Populating should not be possible for simple types");
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (5)
279Debug.Assert(_properties is null, "must not be set if a property list has been initialized."); 741Debug.Assert(Monitor.IsEntered(Options.CacheContext), "Configure called directly, use EnsureConfigured which synchronizes access to this method"); 1177Debug.Assert( 1229Debug.Assert(ExtensionDataProperty.MemberName != null, "Custom property info cannot be data extension property"); 1408Debug.Assert(jsonPropertyInfo.MemberName != null, "MemberName can be null in custom JsonPropertyInfo instances and should never be passed in this method");
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.cs (1)
132Debug.Assert(!IsReadOnly, "We should not mutate read-only JsonTypeInfo");
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.ReadHelper.cs (2)
21Debug.Assert(success, "Should only return false for async deserialization"); 121Debug.Assert(!bufferState.IsFinalBlock || reader.AllowMultipleValues || reader.BytesConsumed == bufferState.Bytes.Length,
System\Text\Json\Serialization\Metadata\PolymorphicTypeResolver.cs (1)
73Debug.Assert(_discriminatorIdtoType != null, "Discriminator index must have been populated.");
System\Text\Json\Serialization\Metadata\PropertyRef.cs (1)
83Debug.Assert(
System\Text\Json\Serialization\Metadata\PropertyRefCacheBuilder.cs (1)
28Debug.Assert(TotalCount < MaxCapacity, "Should have been checked by the caller.");
System\Text\Json\Serialization\WriteStack.cs (1)
150Debug.Assert(!supportAsync || supportContinuation, "supportAsync must imply supportContinuation");
System\Text\Json\ThrowHelper.Serialization.cs (1)
790Debug.Assert(propertyInfo.DeclaringTypeInfo != null, "We should not throw this exception when ParentTypeInfo is null");
System\Text\Json\Writer\Utf8JsonWriter.cs (2)
260Debug.Assert(options.NewLine is "\n" or "\r\n", "Invalid NewLine string."); 1142Debug.Assert(_newLineLength is 1 or 2, "Invalid new line length.");
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)
501Debug.Assert(IsSymbolAccessibleWithin(typeToGenerate.Type, within: contextType), "should not generate metadata for inaccessible types."); 787Debug.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)
144Debug.Assert(childlessQueue.Count > 0, "The graph contains cycles."); 172Debug.Assert(idx == 0, "should have populated the entire sortedNodes array.");
System.Text.RegularExpressions (53)
src\libraries\Common\src\System\HexConverter.cs (2)
337Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 338Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (1)
94Debug.Assert(index == 0, "Implementation currently only supports index == 0");
System\Text\RegularExpressions\CaptureCollection.cs (1)
187Debug.Assert(collection != null, "collection cannot be null.");
System\Text\RegularExpressions\GroupCollection.cs (1)
241Debug.Assert(collection != null, "collection cannot be null.");
System\Text\RegularExpressions\MatchCollection.cs (2)
77Debug.Assert(i >= 0, "i cannot be negative."); 200Debug.Assert(collection != null, "collection cannot be null.");
System\Text\RegularExpressions\Regex.Cache.cs (2)
286Debug.Assert(pattern != null, "Pattern must be provided"); 287Debug.Assert(culture != null, "Culture must be provided");
System\Text\RegularExpressions\RegexCharClass.cs (6)
371Debug.Assert(cc.CanMerge && CanMerge, "Both character classes added together must be able to merge"); 427Debug.Assert(_subtractor == null, "Can't add two subtractions to a char class. "); 601Debug.Assert(IsSingleton(set) || IsSingletonInverse(set), "Tried to get the singleton char out of a non singleton character class"); 1270Debug.Assert(asciiLazyCache is null || asciiLazyCache.Length == CacheArrayLength, "set lookup should be able to store two bits for each of the first 128 characters"); 1377Debug.Assert((SetStartIndex & 0x1) == 1, "If SetStartIndex is not odd, the calculation below this will be reversed"); 1840Debug.Assert(!string.IsNullOrEmpty(set), "Found a null/empty element in RegexCharClass prop table");
System\Text\RegularExpressions\RegexCompiler.cs (5)
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"); 2694Debug.Assert(sliceStaticPos == 0, "This should be the first node and thus static position shouldn't have advanced."); 3860Debug.Assert(!isAtomic, "An atomic lazy should have had its upper bound lowered to its lower bound."); 5164Debug.Assert(!negate, "Negation isn't appropriate for a multi");
System\Text\RegularExpressions\RegexFindOptimizations.cs (1)
379Debug.Assert(LeadingAnchor != RegexNodeKind.Bol, "BOL isn't enabled for RTL");
System\Text\RegularExpressions\RegexInterpreter.cs (3)
39Debug.Assert(code != null, "code must not be null."); 300Debug.Assert(_culture != null, "If the pattern has backreferences and is IgnoreCase, then _culture must not be null."); 1131Debug.Assert(!_rightToLeft, "UpdateBumpalongs aren't added for RTL");
System\Text\RegularExpressions\RegexNode.cs (5)
203Debug.Assert(Kind == RegexNodeKind.Capture, "Every generated tree should begin with a capture node"); 222Debug.Assert(Kind != RegexNodeKind.Group, "All Group nodes should have been removed."); 292Debug.Assert(node.Str is not null, "Expect non-null multi string"); 1798Debug.Assert((Options & RegexOptions.NonBacktracking) == 0, "Atomic groups aren't supported and don't help performance with NonBacktracking"); 2220Debug.Assert(currentIndex >= 0, "Node should have been in its parent's child list");
System\Text\RegularExpressions\RegexParser.cs (5)
57Debug.Assert(pattern != null, "Pattern must be set"); 58Debug.Assert(culture != null, "Culture must be set"); 1078Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern"); 1153Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern"); 1976Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern");
System\Text\RegularExpressions\Symbolic\BDD.cs (3)
68Debug.Assert((one is null) == (zero is null), "Neither or both children should be null."); 344Debug.Assert(bytes.Length > 1, "All inputs are expected to be larger than a single byte, which would map to False or True."); 502Debug.Assert(leaf is not null, "this should never happen because there must exist another leaf besides False");
System\Text\RegularExpressions\Symbolic\CharSetSolver.cs (2)
207Debug.Assert(!set.IsLeaf, "Did not expect multi-terminal"); 257Debug.Assert(!set1.IsLeaf || !set2.IsLeaf, "Did not expect multi-terminal case");
System\Text\RegularExpressions\Symbolic\DoublyLinkedList.cs (4)
54Debug.Assert(other != this, "self append not allowed to avoid circularity"); 141Debug.Assert(_first is null && _last is null, "empty list"); 145Debug.Assert(_size > 0, "_size < 0 means that the list has been invalidated after Append"); 146Debug.Assert(_first is not null && _last is not null && _first.Prev is null && _last.Next is null, "non-empty list");
System\Text\RegularExpressions\Symbolic\MintermClassifier.cs (1)
37Debug.Assert(minterms.Length > 0, "Requires at least");
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.cs (8)
892Debug.Assert(lastStart != -1, "We expected to find a starting position but didn't."); 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)}."); 1578Debug.Assert(lookup is not null, $"{nameof(NoZAnchorFindOptimizationsInitialStateHandler)} must only be used with call sites that pass non-null {nameof(lookup)}."); 1610Debug.Assert(currentStateId == matcher._initialStateId, "There are no anchors, so the current state should be the sole initial state.");
System.Text.RegularExpressions.Generator (77)
RegexGenerator.Emitter.cs (42)
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."); 2106Debug.Assert(node.Kind is RegexNodeKind.Backreference, $"Unexpected type: {node.Kind}"); 2175Debug.Assert(node.Kind is RegexNodeKind.BackreferenceConditional, $"Unexpected type: {node.Kind}"); 2176Debug.Assert(node.ChildCount() == 2, $"Expected 2 children, found {node.ChildCount()}"); 2348Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.Kind}"); 2349Debug.Assert(node.ChildCount() == 3, $"Expected 3 children, found {node.ChildCount()}"); 2535Debug.Assert(node.Kind is RegexNodeKind.Capture, $"Unexpected type: {node.Kind}"); 2536Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 2628Debug.Assert(node.Kind is RegexNodeKind.PositiveLookaround, $"Unexpected type: {node.Kind}"); 2629Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 2676Debug.Assert(node.Kind is RegexNodeKind.NegativeLookaround, $"Unexpected type: {node.Kind}"); 2677Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 2787Debug.Assert(sliceStaticPos == 0, "This should be the first node and thus static position shouldn't have advanced."); 2951Debug.Assert(node.Kind is RegexNodeKind.Atomic or RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround or RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.Kind}"); 2980Debug.Assert(node.Kind is RegexNodeKind.UpdateBumpalong, $"Unexpected type: {node.Kind}"); 2992Debug.Assert(node.Kind is RegexNodeKind.Concatenate, $"Unexpected type: {node.Kind}"); 2993Debug.Assert(node.ChildCount() >= 2, $"Expected at least 2 children, found {node.ChildCount()}"); 3166Debug.Assert(node.Kind is RegexNodeKind.Boundary or RegexNodeKind.NonBoundary or RegexNodeKind.ECMABoundary or RegexNodeKind.NonECMABoundary, $"Unexpected kind: {node.Kind}"); 3193Debug.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}"); 3259Debug.Assert(node.Kind is RegexNodeKind.Multi, $"Unexpected type: {node.Kind}"); 3308Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Notoneloop or RegexNodeKind.Setloop, $"Unexpected type: {node.Kind}"); 3446Debug.Assert(node.Kind is RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy or RegexNodeKind.Setlazy, $"Unexpected type: {node.Kind}"); 3693Debug.Assert(node.Kind is RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 3694Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}"); 3695Debug.Assert(node.N >= node.M, $"Unexpected M={node.M}, N={node.N}"); 3696Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 3719Debug.Assert(!isAtomic, "An atomic lazy should have had its upper bound lowered to its lower bound."); 4117Debug.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}"); 4249Debug.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}"); 4287Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 4288Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}"); 4289Debug.Assert(node.M == node.N, $"Unexpected M={node.M} == N={node.N}"); 4290Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 4307Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 4308Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}"); 4309Debug.Assert(node.N >= node.M, $"Unexpected M={node.M}, N={node.N}"); 4310Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 4931Debug.Assert(!negate, "Negation isn't appropriate for a multi");
src\libraries\Common\src\System\HexConverter.cs (2)
337Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 338Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (1)
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"); 1840Debug.Assert(!string.IsNullOrEmpty(set), "Found a null/empty element in RegexCharClass prop table");
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexFindOptimizations.cs (1)
56Debug.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"); 1798Debug.Assert((Options & RegexOptions.NonBacktracking) == 0, "Atomic groups aren't supported and don't help performance with NonBacktracking"); 2220Debug.Assert(currentIndex >= 0, "Node should have been in its parent's child list"); 2516Debug.Assert(Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {Kind}"); 2632Debug.Assert(Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {Kind}");
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexParser.cs (5)
57Debug.Assert(pattern != null, "Pattern must be set"); 58Debug.Assert(culture != null, "Culture must be set"); 1078Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern"); 1153Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern"); 1976Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern");
System.Threading (1)
System\Threading\CountdownEvent.cs (1)
249Debug.Assert(_currentCount >= 0, "latch was decremented below zero");
System.Threading.Channels (50)
src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (13)
67Debug.Assert(InitialSegmentSize > 0, "Initial segment size must be > 0."); 68Debug.Assert((InitialSegmentSize & (InitialSegmentSize - 1)) == 0, "Initial segment size must be a power of 2"); 69Debug.Assert(InitialSegmentSize <= MaxSegmentSize, "Initial segment size should be <= maximum."); 70Debug.Assert(MaxSegmentSize < int.MaxValue / 2, "Max segment size * 2 must be < int.MaxValue, or else overflow could occur."); 102Debug.Assert(segment != null, "Expected a non-null segment."); 112Debug.Assert(newSegmentSize > 0, "The max size should always be small enough that we don't overflow."); 179Debug.Assert(segment != null, "Expected a non-null segment."); 180Debug.Assert(array != null, "Expected a non-null item array."); 253Debug.Assert(segment != null, "Expected a non-null segment."); 254Debug.Assert(array != null, "Expected a non-null item array."); 368Debug.Assert(syncObj != null, "The syncObj parameter is null."); 390Debug.Assert((size & (size - 1)) == 0, "Size must be a power of 2"); 429Debug.Assert(queue != null, "Expected a non-null queue.");
System\Threading\Channels\AsyncOperation.cs (7)
90Debug.Assert(!_pooled, "Cancelable operations can't be pooled"); 184Debug.Assert(_pooled, "Should only be used for pooled objects"); 260Debug.Assert(IsCompleted, $"Expected IsCompleted"); 263Debug.Assert(prevContinuation != s_availableSentinel, "Continuation was the available sentinel."); 385Debug.Assert(_continuation != s_completedSentinel, $"The continuation was the completion sentinel."); 386Debug.Assert(_continuation != s_availableSentinel, $"The continuation was the available sentinel."); 415Debug.Assert(ts != null, "Expected a TaskScheduler");
System\Threading\Channels\BoundedChannel.cs (14)
458Debug.Assert(waitingReadersTail == null, "Shouldn't have any waiters to wake up"); 462Debug.Assert(success, "We should always be able to complete the reader."); 651Debug.Assert(success, "We should always be able to complete the reader."); 678Debug.Assert(SyncObj != null, "The sync obj must not be null."); 679Debug.Assert(Monitor.IsEntered(SyncObj), "Invariants can only be validated while holding the lock."); 683Debug.Assert(_blockedReaders.IsEmpty, "There are items available, so there shouldn't be any blocked readers."); 684Debug.Assert(_waitingReadersTail == null, "There are items available, so there shouldn't be any waiting readers."); 688Debug.Assert(_blockedWriters.IsEmpty, "There's space available, so there shouldn't be any blocked writers."); 689Debug.Assert(_waitingWritersTail == null, "There's space available, so there shouldn't be any waiting writers."); 693Debug.Assert(_items.IsEmpty, "There shouldn't be queued items if there's a blocked reader."); 694Debug.Assert(_blockedWriters.IsEmpty, "There shouldn't be any blocked writer if there's a blocked reader."); 698Debug.Assert(_items.Count == _bufferedCapacity, "We should have a full buffer if there's a blocked writer."); 699Debug.Assert(_blockedReaders.IsEmpty, "There shouldn't be any blocked readers if there's a blocked writer."); 703Debug.Assert(_doneWriting != null, "We can only complete if we're done writing.");
System\Threading\Channels\SingleConsumerUnboundedChannel.cs (2)
254Debug.Assert(blockedReader == null || waitingReader == null, "There should only ever be at most one reader."); 318Debug.Assert((blockedReader != null) ^ (waitingReader != null), "Expected either a blocked or waiting reader, but not both");
System\Threading\Channels\UnboundedChannel.cs (7)
329Debug.Assert(SyncObj != null, "The sync obj must not be null."); 330Debug.Assert(Monitor.IsEntered(SyncObj), "Invariants can only be validated while holding the lock."); 336Debug.Assert(_blockedReaders.IsEmpty, "There's data available, so there shouldn't be any blocked readers."); 337Debug.Assert(_waitingReadersTail == null, "There's data available, so there shouldn't be any waiting readers."); 339Debug.Assert(!_completion.Task.IsCompleted, "We still have data available, so shouldn't be completed."); 343Debug.Assert(_items.IsEmpty, "There are blocked/waiting readers, so there shouldn't be any data available."); 347Debug.Assert(_doneWriting != null, "We're completed, so we must be done writing.");
System\Threading\Channels\UnboundedPriorityChannel.cs (7)
334Debug.Assert(SyncObj != null, "The sync obj must not be null."); 335Debug.Assert(Monitor.IsEntered(SyncObj), "Invariants can only be validated while holding the lock."); 341Debug.Assert(_blockedReaders.IsEmpty, "There's data available, so there shouldn't be any blocked readers."); 342Debug.Assert(_waitingReadersTail == 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."); 348Debug.Assert(_items.Count == 0, "There are blocked/waiting readers, so there shouldn't be any data available."); 352Debug.Assert(_doneWriting != null, "We're completed, so we must be done writing.");
System.Threading.Tasks.Dataflow (400)
Base\DataflowBlock.cs (49)
126Debug.Assert(source != null, "Filtered link requires a source to filter on."); 127Debug.Assert(target != null, "Filtered link requires a target to filter to."); 128Debug.Assert(predicate != null, "Filtered link requires a predicate to filter with."); 141Debug.Assert(_userProvidedPredicate != null, "User-provided predicate is required."); 173Debug.Assert(messageHeader.IsValid, "Only valid messages may be consumed."); 182Debug.Assert(messageHeader.IsValid, "Only valid messages may be consumed."); 191Debug.Assert(messageHeader.IsValid, "Only valid messages may be consumed."); 228Debug.Assert(filter != null, "Need a filter with which to construct the debug view."); 358Debug.Assert(source != null, "The SendAsyncSource instance must have been constructed."); 414Debug.Assert(target != null, "A valid target to send to is required."); 518Debug.Assert(completionAction != null, "Completion action to run is required."); 527Debug.Assert(_cancellationRegistration != default(CancellationTokenRegistration), 567Debug.Assert(source._cancellationState != CANCELLATION_STATE_NONE, 608Debug.Assert(_cancellationState == CANCELLATION_STATE_COMPLETING, 663Debug.Assert( 764Debug.Assert(source != null, "Need a source with which to construct the debug view."); 1007Debug.Assert(source != null, "Need a source from which to receive."); 1261Debug.Assert(Volatile.Read(ref _cleanupReserved), "Should only be called once by whomever reserved the right."); 1569Debug.Assert(target != null, "The target should never be null; this should be checked by all internal usage."); 1570Debug.Assert(source != null, "The source should never be null; this should be checked by all internal usage."); 1667Debug.Assert(propagator != null, "Need a block with which to construct the debug view."); 1906Debug.Assert(source1 != null && action1 != null, "The first source and action should not be null."); 1907Debug.Assert(source2 != null && action2 != null, "The second source and action should not be null."); 1908Debug.Assert((source3 == null) == (action3 == null), "The third action should be null iff the third source is null."); 1909Debug.Assert(dataflowBlockOptions != null, "Options are required."); 1953Debug.Assert(source != null, "Expected a non-null source"); 1954Debug.Assert(action != null, "Expected a non-null action"); 1955Debug.Assert(branchId >= 0, "Expected a valid branch ID (> 0)"); 1956Debug.Assert(scheduler != null, "Expected a non-null scheduler"); 1991Debug.Assert(source1 != null && action1 != null, "The first source and action should not be null."); 1992Debug.Assert(source2 != null && action2 != null, "The second source and action should not be null."); 1993Debug.Assert((source3 == null) == (action3 == null), "The third action should be null iff the third source is null."); 1994Debug.Assert(dataflowBlockOptions != null, "Options are required."); 2040Debug.Assert(resultBranchId < tasks.Length, "Expected a valid branch ID"); 2041Debug.Assert(successfulBranchId == -1, "There should be at most one successful branch."); 2044else Debug.Assert(resultBranchId == -1, "Expected -1 as a signal of a non-successful branch"); 2166Debug.Assert(completed != null, "Requires a shared target to complete."); 2266Debug.Assert(source != null, "Requires a source for which to retrieve the observable."); 2284Debug.Assert(source != null, "The observable requires a source to wrap."); 2333Debug.Assert(_observersState.Unlinker == null, "The source should not be linked to the target."); 2358Debug.Assert(observer != null, "Expected an observer."); 2364Debug.Assert(currentState != null, "Observer state should never be null."); 2392Debug.Assert(currentState != null, "Observer state should never be null."); 2393Debug.Assert(currentState.Unlinker != null, "The target should be linked."); 2394Debug.Assert(currentState.Canceler != null, "The target should have set up continuations."); 2426Debug.Assert(observable != null, "Need a block with which to construct the debug view."); 2461Debug.Assert(observable != null, "Observe state must be mapped to a source observable."); 2555Debug.Assert(Target.Completion.IsCompleted, "The target must have already completed in order to notify of completion."); 2627Debug.Assert(target != null, "A target to observe is required.");
Base\DataflowBlockOptions.cs (9)
113Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 125Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 136Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 156Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 175Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 291Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 314Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 423Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 434Debug.Assert(this != Default, "Default instance is supposed to be immutable.");
Base\DataflowLinkOptions.cs (3)
85Debug.Assert(this != Default && this != UnlinkAfterOneAndPropagateCompletion, "Default and UnlinkAfterOneAndPropagateCompletion instances are supposed to be immutable."); 96Debug.Assert(this != Default && this != UnlinkAfterOneAndPropagateCompletion, "Default and UnlinkAfterOneAndPropagateCompletion instances are supposed to be immutable."); 108Debug.Assert(this != Default && this != UnlinkAfterOneAndPropagateCompletion, "Default and UnlinkAfterOneAndPropagateCompletion instances are supposed to be immutable.");
Blocks\ActionBlock.cs (6)
112Debug.Assert(asyncAction != null, "action is of incorrect delegate type"); 128Debug.Assert((_spscTarget != null) ^ (_defaultTarget != null), "One and only one of the two targets must be non-null after construction"); 159Debug.Assert(action != null, "action needed for processing"); 204Debug.Assert(completed != null, "Need completed task for processing"); 205Debug.Assert(completed.IsCompleted, "The task to be processed must be completed by now."); 336Debug.Assert(actionBlock != null, "Need a block with which to construct the debug view.");
Blocks\BatchBlock.cs (34)
84Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 202Debug.Assert(batchBlock != null, "Need a block with which to construct the debug view"); 293Debug.Assert(batchSize > 0, "A positive batch size is required"); 309Debug.Assert(owningBatch != null, "This batch target core must be associated with a batch block."); 310Debug.Assert(batchSize >= 1, "Batch sizes must be positive."); 311Debug.Assert(batchCompletedAction != null, "Completion action must be specified."); 312Debug.Assert(dataflowBlockOptions != null, "Options required to configure the block."); 381Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 409Debug.Assert(_nonGreedyState != null, "_nonGreedyState must have been initialized during construction in non-greedy mode."); 461Debug.Assert(_nonGreedyState != null && _nonGreedyState.TaskForInputProcessing != null, 622Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 637Debug.Assert(BatchesNeedProcessing, "There must be a batch that needs processing."); 666Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 755Debug.Assert(!_dataflowBlockOptions.Greedy, "This method may only be used in non-greedy mode."); 756Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 773Debug.Assert(_messages.Count == 0, "The queue must be empty between batches in non-greedy mode"); 785Debug.Assert(allowFewerThanBatchSize ? poppedInitially > 0 : poppedInitially == _batchSize, 819Debug.Assert(reserved.Count <= _batchSize, "Expected the number of reserved sources to be <= the number needed for a batch."); 872Debug.Assert(_dataflowBlockOptions.Greedy, "This method may only be used in greedy mode."); 873Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 874Debug.Assert(_boundingState != null, "Bounding state is required when in bounded mode."); 902Debug.Assert(poppedInitially > 0, "We received fewer than we expected based on the previous check."); 931Debug.Assert(reserved.Count <= itemCountNeededToCompleteBatch, "Expected the number of reserved sources to be <= the number needed for a batch."); 981Debug.Assert(!_dataflowBlockOptions.Greedy, "This method may only be used in non-greedy mode."); 982Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 983Debug.Assert(_nonGreedyState.ReservedSourcesTemp != null, "ReservedSourcesTemp should have been initialized."); 1031Debug.Assert(_dataflowBlockOptions.Greedy, "This method may only be used in greedy mode."); 1032Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 1033Debug.Assert(_nonGreedyState.ReservedSourcesTemp != null, "ReservedSourcesTemp should have been initialized."); 1034Debug.Assert(_boundingState != null, "Bounded state is required for bounded mode."); 1086Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 1087Debug.Assert(_nonGreedyState.ReservedSourcesTemp != null, "Should have been initialized"); 1117Debug.Assert(numItemsRemoved > 0, "Should only be called for a positive number of items removed."); 1128Debug.Assert(_boundingState.CurrentCount - numItemsRemoved >= 0,
Blocks\BatchedJoinBlock.cs (21)
102Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 149Debug.Assert(_target1 != null, "_target1 not initialized"); 150Debug.Assert(_target2 != null, "_target2 not initialized"); 164Debug.Assert(_sharedResources != null, "_sharedResources not initialized"); 165Debug.Assert(_sharedResources._incomingLock != null, "_sharedResources._incomingLock not initialized"); 166Debug.Assert(_source != null, "_source not initialized"); 230Debug.Assert(batchedJoinBlock != null, "Need a block with which to construct the debug view."); 354Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 404Debug.Assert(_target1 != null, "_target1 not initialized"); 405Debug.Assert(_target2 != null, "_target2 not initialized"); 406Debug.Assert(_target3 != null, "_target3 not initialized"); 421Debug.Assert(_sharedResources != null, "_sharedResources not initialized"); 422Debug.Assert(_sharedResources._incomingLock != null, "_sharedResources._incomingLock not initialized"); 423Debug.Assert(_source != null, "_source not initialized"); 488Debug.Assert(batchedJoinBlock != null, "Need a block with which to construct the debug view."); 546Debug.Assert(sharedResources != null, "Targets require a shared resources through which to communicate."); 586Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 652Debug.Assert(batchedJoinBlockTarget != null, "Need a block with which to construct the debug view."); 685Debug.Assert(batchSize >= 1, "A positive batch size is required."); 686Debug.Assert(batchSizeReachedAction != null, "Need an action to invoke for each batch."); 687Debug.Assert(allTargetsDecliningAction != null, "Need an action to invoke when all targets have declined.");
Blocks\BroadcastBlock.cs (25)
79Debug.Assert(dataflowBlockOptions.BoundedCapacity > 0, "Positive bounding count expected; should have been verified by options ctor"); 94Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 127Debug.Assert(storeExceptionEvenIfAlreadyCompleting || !revertProcessingState, 142Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 194Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 209Debug.Assert(_boundingState != null && _boundingState.PostponedMessages != null, 224Debug.Assert(numItemsRemoved > 0, "Should only be called for a positive number of items removed."); 235Debug.Assert(_boundingState.CurrentCount - numItemsRemoved >= 0, 250Debug.Assert(_boundingState != null, "Must be in bounded mode."); 285Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 287Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 331Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 333Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 464Debug.Assert(broadcastBlock != null, "Need a block with which to construct the debug view."); 553Debug.Assert(owningSource != null, "Must be associated with a broadcast block."); 554Debug.Assert(dataflowBlockOptions != null, "Options are required to configure this block."); 674Debug.Assert(target != null, "Target required to offer messages to."); 711else Debug.Assert(result != DataflowMessageStatus.NotAvailable, "Messages from a Broadcast should never be missed."); 744Debug.Assert(_messages.Count > 0, "There must be at least one message to dequeue."); 944Debug.Assert(_taskForOutputProcessing == null, "There must be no processing tasks."); 945Debug.Assert( 1162Debug.Assert(exception != null, "An exception to add is required."); 1163Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions."); 1174Debug.Assert(exceptions != null, "A list of exceptions to add is required."); 1175Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions.");
Blocks\BufferBlock.cs (13)
76Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 119Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 135Debug.Assert(_boundingState != null && _boundingState.PostponedMessages != null, 162Debug.Assert(storeExceptionEvenIfAlreadyCompleting || !revertProcessingState, 177Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 225Debug.Assert(numItemsRemoved > 0, "A positive number of items to remove is required."); 236Debug.Assert(_boundingState.CurrentCount - numItemsRemoved >= 0, 251Debug.Assert(_boundingState != null, "Must be in bounded mode."); 287Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 289Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 333Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 335Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 448Debug.Assert(bufferBlock != null, "Need a block with which to construct the debug view.");
Blocks\JoinBlock.cs (42)
98Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 136Debug.Assert(_target1 != null, "_target1 not initialized"); 137Debug.Assert(_target2 != null, "_target2 not initialized"); 151Debug.Assert(_sharedResources != null, "_sharedResources not initialized"); 152Debug.Assert(_sharedResources._exceptionAction != null, "_sharedResources._exceptionAction not initialized"); 211Debug.Assert(joinBlock != null, "Need a block with which to construct the debug view."); 323Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 361Debug.Assert(_target1 != null, "_target1 not initialized"); 362Debug.Assert(_target2 != null, "_target2 not initialized"); 363Debug.Assert(_target3 != null, "_target3 not initialized"); 378Debug.Assert(_sharedResources != null, "_sharedResources not initialized"); 379Debug.Assert(_sharedResources._exceptionAction != null, "_sharedResources._exceptionAction not initialized"); 441Debug.Assert(joinBlock != null, "Need a block with which to construct the debug view."); 514Debug.Assert(sharedResources != null, "Targets need shared resources through which to communicate."); 530Debug.Assert(_messages != null, "_messages must have been initialized in greedy mode"); 531Debug.Assert(_messages.Count >= 0, "A message must have been consumed by this point."); 536Debug.Assert(_nonGreedy!.ConsumedMessage.Key, "A message must have been consumed by this point."); 561Debug.Assert(_messages != null, "_messages must have been initialized in greedy mode"); 596Debug.Assert(_sharedResources._dataflowBlockOptions.Greedy, "This is only valid in greedy mode"); 613Debug.Assert(!_sharedResources._dataflowBlockOptions.Greedy, "This is only used in non-greedy mode"); 620Debug.Assert(!HasAtLeastOneMessageAvailable, "The queue must be empty between joins in non-greedy mode"); 653Debug.Assert(!_sharedResources._dataflowBlockOptions.Greedy, "This is only used in non-greedy mode"); 654Debug.Assert(_nonGreedy!.ReservedMessage.Key != null, "This target must have a reserved message"); 680Debug.Assert(!_nonGreedy.ConsumedMessage.Key, "There must be no other consumed message"); 695Debug.Assert(_sharedResources._dataflowBlockOptions.Greedy, "This is only used in greedy mode"); 696Debug.Assert(_sharedResources._boundingState != null, "This is only used in bounding mode"); 780Debug.Assert(_nonGreedy != null, "Only valid in non-greedy mode."); 791Debug.Assert(_nonGreedy == null || _nonGreedy.ReservedMessage.Key == null, 855Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 879Debug.Assert(_nonGreedy != null, "_nonGreedy must have been initialized during construction in non-greedy mode."); 910Debug.Assert(_messages != null, "_messages must be initialized in greedy mode."); 977Debug.Assert(joinBlockTarget != null, "Need a target with which to construct the debug view."); 1043Debug.Assert(ownerJoin != null, "Resources must be associated with a join."); 1044Debug.Assert(targets != null, "Resources must be shared between multiple targets."); 1045Debug.Assert(joinFilledAction != null, "An action to invoke when a join is created must be provided."); 1046Debug.Assert(exceptionAction != null, "An action to invoke for faults must be provided."); 1047Debug.Assert(dataflowBlockOptions != null, "Options must be provided to configure the resources."); 1277Debug.Assert(JoinNeedsProcessing, "There must be a join that needs processing."); 1358Debug.Assert(!_dataflowBlockOptions.Greedy || _boundingState != null, "This only makes sense in non-greedy or bounding mode"); 1397Debug.Assert(_targets.Length > 0, "A join must have targets."); 1424Debug.Assert(numItemsRemoved > 0, "Number of items removed needs to be positive."); 1435Debug.Assert(_boundingState.CurrentCount - numItemsRemoved >= 0,
Blocks\TransformBlock.cs (7)
101Debug.Assert(transformSync == null ^ transformAsync == null, "Exactly one of transformSync and transformAsync must be null."); 132Debug.Assert(transformAsync != null, "Incorrect delegate type."); 157Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 228Debug.Assert(transform != null, "Function to invoke is required."); 273Debug.Assert(completed != null, "Completed task is required."); 274Debug.Assert(completed.IsCompleted, "Task must be completed to be here."); 423Debug.Assert(transformBlock != null, "Need a block with which to construct the debug view.");
Blocks\TransformManyBlock.cs (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."); 629Debug.Assert(transformManyBlock != null, "Need a block with which to construct the debug view.");
Blocks\TransformManyBlock.IAsyncEnumerable.cs (2)
122Debug.Assert(_reorderingBuffer is not null, "Expected a reordering buffer"); 123Debug.Assert(id != Common.INVALID_REORDERING_ID, "This ID should never have been handed out.");
Blocks\WriteOnceBlock.cs (6)
114Debug.Assert(_decliningPermanently, "We may get here only after we have started to decline permanently."); 115Debug.Assert(_completionReserved, "We may get here only after we have reserved completion."); 173Debug.Assert(_lazyCompletionTaskSource == null || !_lazyCompletionTaskSource.Task.IsCompleted, "The task completion source must not be completed. This must be the only thread that ever completes the block."); 227Debug.Assert(exception != null || !storeExceptionEvenIfAlreadyCompleting, 437Debug.Assert(_header.IsValid, "A valid header is required."); 534Debug.Assert(writeOnceBlock != null, "Need a block with which to construct the debug view.");
Internal\ActionOnDispose.cs (4)
33Debug.Assert(action != null, "Non-null disposer action required."); 48Debug.Assert(action != null, "Non-null disposer action required."); 76Debug.Assert(action != null, "Non-null action needed for disposable"); 117Debug.Assert(action != null, "Non-null action needed for disposable");
Internal\Common.cs (40)
48Debug.Assert(syncObj != null, "The monitor object to check must be provided."); 49Debug.Assert(Monitor.IsEntered(syncObj) == held, "The locking scheme was not correctly followed."); 71Debug.Assert(predicate != null, "Non-null predicate to execute is required."); 95Debug.Assert(wr != null, "Expected a WeakReference<T> as the state argument"); 104Debug.Assert(block != null, "Block required to extract an Id."); 120Debug.Assert(block != null, "Should only be used with valid objects being displayed in the debugger."); 121Debug.Assert(options == null || options.NameFormat != null, "If options are provided, NameFormat must be valid."); 152Debug.Assert(exception != null, "An exception to check for cancellation must be provided."); 178Debug.Assert(completionTask != null, "A task to wire up for completion is needed."); 179Debug.Assert(completeAction != null, "An action to invoke upon cancellation is required."); 214Debug.Assert(exception != null && exception.StackTrace == null, 230Debug.Assert(exc != null, "The exception into which data should be stored must be provided."); 274Debug.Assert(exception != null, "An exception is needed to store the data into."); 275Debug.Assert(key != null, "A key into the exception's data collection is needed."); 276Debug.Assert(value != null, "The value to store must be provided."); 313Debug.Assert(exception != null, "An exception to add is required."); 314Debug.Assert(!unwrapInnerExceptions || exception.InnerException != null, 374Debug.Assert(cancellationToken.IsCancellationRequested, 377Debug.Assert(t.IsCanceled, "Task's constructor should cancel the task synchronously in the ctor."); 386Debug.Assert(block != null, "We need a block from which to retrieve a cancellation task."); 407Debug.Assert(outgoingLock != null, "Monitor object needed to protect the operation."); 408Debug.Assert(targetRegistry != null, "Registry from which to remove is required."); 409Debug.Assert(targetBlock != null, "Target block to unlink is required."); 454Debug.Assert(task != null, "Task to start is required."); 455Debug.Assert(scheduler != null, "Scheduler on which to start the task is required."); 472Debug.Assert(task != null, "Task to start is needed."); 473Debug.Assert(scheduler != null, "Scheduler on which to start the task is required."); 484Debug.Assert(task.IsFaulted, "The task should have been faulted if it failed to start."); 501Debug.Assert(target != null, "There must be a subject target."); 502Debug.Assert(postponedMessages != null, "The stacked map of postponed messages must exist."); 519Debug.Assert(sourceAndMessage.Key != null, "Postponed messages must have an associated source."); 533Debug.Assert(processedCount == initialCount, 548Debug.Assert(sourceCompletionTask != null, "sourceCompletionTask may not be null."); 549Debug.Assert(target != null, "The target where completion is to be propagated may not be null."); 550Debug.Assert(sourceCompletionTask.IsCompleted, "sourceCompletionTask must be completed in order to propagate its completion."); 571Debug.Assert(sourceCompletionTask != null, "sourceCompletionTask may not be null."); 572Debug.Assert(target != null, "The target where completion is to be propagated may not be null."); 582Debug.Assert(sourceCompletionTask != null, "sourceCompletionTask may not be null."); 583Debug.Assert(target != null, "The target where completion is to be propagated may not be null."); 628Debug.Assert(boundedCapacity > 0, "Bounded is only supported with positive values.");
Internal\DataflowEtwProvider.cs (11)
66Debug.Assert(block != null, "Block needed for the ETW event."); 67Debug.Assert(dataflowBlockOptions != null, "Options needed for the ETW event."); 94Debug.Assert(block != null, "Block needed for the ETW event."); 95Debug.Assert(task != null, "Task needed for the ETW event."); 96Debug.Assert(reason == TaskLaunchedReason.ProcessingInputMessages || reason == TaskLaunchedReason.OfferingOutputMessages, 130Debug.Assert(block != null, "Block needed for the ETW event."); 135Debug.Assert(blockIsCompleted, "Block must be completed for this event to be valid."); 181Debug.Assert(source != null, "Source needed for the ETW event."); 182Debug.Assert(target != null, "Target needed for the ETW event."); 203Debug.Assert(source != null, "Source needed for the ETW event."); 204Debug.Assert(target != null, "Target needed for the ETW event.");
Internal\EnumerableDebugView.cs (1)
29Debug.Assert(enumerable != null, "Expected a non-null enumerable.");
Internal\ImmutableArray.cs (1)
41Debug.Assert(elements != null, "Requires an array to wrap.");
Internal\QueuedMap.cs (11)
78Debug.Assert(0 <= _freeIndex && _freeIndex < _storage.Count, "Index is out of range."); 93Debug.Assert(_tailIndex == TERMINATOR_INDEX, "If head indicates empty, so too should tail."); 99Debug.Assert(_tailIndex != TERMINATOR_INDEX, "If head does not indicate empty, neither should tail."); 116Debug.Assert(_tailIndex == TERMINATOR_INDEX, "If head indicates empty, so too should tail."); 122Debug.Assert(0 <= _headIndex && _headIndex < _storage.Count, "Head is out of range."); 140Debug.Assert(0 <= index && index < _storage.Count, "Index is out of range."); 144Debug.Assert(idx != index, "Index should not belong to the list of free slots."); 211Debug.Assert(items != null, "Requires non-null array to store into."); 212Debug.Assert(count >= 0 && arrayOffset >= 0, "Count and offset must be non-negative"); 213Debug.Assert(arrayOffset + count >= 0, "Offset plus count overflowed"); 214Debug.Assert(arrayOffset + count <= items.Length, "Range must be within array size");
Internal\ReorderingBuffer.cs (7)
59Debug.Assert(owningSource != null, "Buffer must be associated with a source."); 60Debug.Assert(outputAction != null, "Action required for when items are to be released."); 71Debug.Assert(id != Common.INVALID_REORDERING_ID, "This ID should never have been handed out."); 86Debug.Assert((ulong)id > (ulong)_nextReorderedIdToOutput, "Duplicate id."); 97Debug.Assert(id != Common.INVALID_REORDERING_ID, "This ID should never have been handed out."); 123Debug.Assert(id != Common.INVALID_REORDERING_ID, "This ID should never have been handed out."); 188Debug.Assert(buffer != null, "Need a buffer with which to construct the debug view.");
Internal\SourceCore.cs (19)
108Debug.Assert(owningSource != null, "Core must be associated with a source."); 109Debug.Assert(dataflowBlockOptions != null, "Options must be provided to configure the core."); 110Debug.Assert(completeAction != null, "Action to invoke on completion is required."); 264Debug.Assert(!_enableOffering, "Offering should have been disabled if there was a valid reservation"); 412Debug.Assert(items != null, "Items list must be valid."); 462Debug.Assert(exception != null, "Valid exception must be provided to be added."); 463Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions."); 474Debug.Assert(exceptions != null, "Valid exceptions must be provided to be added."); 475Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions."); 489Debug.Assert(aggregateException != null && aggregateException.InnerExceptions.Count > 0, "Aggregate must be valid and contain inner exceptions to unwrap."); 490Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions."); 579Debug.Assert(linkToTarget != null, "Must have a valid target to offer to."); 673Debug.Assert(target != null, "Valid target to offer to is required."); 678Debug.Assert(result != DataflowMessageStatus.NotAvailable, "Messages are not being offered concurrently, so nothing should be missed."); 696Debug.Assert(result == DataflowMessageStatus.Postponed, 741Debug.Assert(_taskForOutputProcessing == null && _enableOffering && !_messages.IsEmpty, 800Debug.Assert(_taskForOutputProcessing != null && _taskForOutputProcessing.Id == Task.CurrentId, 858Debug.Assert(_taskForOutputProcessing != null && _taskForOutputProcessing.Id == Task.CurrentId, 912Debug.Assert(
Internal\SpscTargetCore.cs (7)
77Debug.Assert(owningTarget != null, "Expected non-null owningTarget"); 78Debug.Assert(action != null, "Expected non-null action"); 79Debug.Assert(dataflowBlockOptions != null, "Expected non-null dataflowBlockOptions"); 193Debug.Assert( 256Debug.Assert(previousConsumer != null && previousConsumer.Id == Task.CurrentId, 324Debug.Assert(_completionReserved, "Should only invoke once completion has been reserved."); 341Debug.Assert(result, "Expected completion task to not yet be completed");
Internal\TargetCore.cs (30)
114Debug.Assert(owningTarget != null, "Core must be associated with a target block."); 115Debug.Assert(dataflowBlockOptions != null, "Options must be provided to configure the core."); 116Debug.Assert(callAction != null, "Action to invoke for each item is required."); 129Debug.Assert(_dataflowBlockOptions.BoundedCapacity > 0, "Positive bounding count expected; should have been verified by options ctor"); 143Debug.Assert(storeExceptionEvenIfAlreadyCompleting || !revertProcessingState, 153Debug.Assert(_numberOfOutstandingOperations > 0 || !storeExceptionEvenIfAlreadyCompleting, 168Debug.Assert(_numberOfOutstandingOperations > 0 && (!UsesAsyncCompletion || _numberOfOutstandingServiceTasks > 0), 208Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 218Debug.Assert(messageId != Common.INVALID_REORDERING_ID, "The assigned message ID is invalid."); 227Debug.Assert(_boundingState != null && _boundingState.PostponedMessages != null, 259Debug.Assert(_numberOfOutstandingOperations > 0, "Operations may only be completed if any are outstanding."); 265Debug.Assert(boundingCountChange <= 0 && _boundingState.CurrentCount + boundingCountChange >= 0, 295Debug.Assert(_numberOfOutstandingOperations >= 0, "Number of outstanding operations should never be negative."); 296Debug.Assert(_numberOfOutstandingServiceTasks >= 0, "Number of outstanding service tasks should never be negative."); 297Debug.Assert(_numberOfOutstandingOperations >= _numberOfOutstandingServiceTasks, "Number of outstanding service tasks should never exceed the number of outstanding operations."); 311Debug.Assert(_numberOfOutstandingOperations >= 0, "Number of outstanding operations should never be negative."); 312Debug.Assert(_numberOfOutstandingServiceTasks >= 0, "Number of outstanding service tasks should never be negative."); 313Debug.Assert(_numberOfOutstandingOperations >= _numberOfOutstandingServiceTasks, "Number of outstanding service tasks should never exceed the number of outstanding operations."); 354Debug.Assert(HasRoomForMoreServiceTasks, "There must be room to process asynchronously."); 424Debug.Assert( 495Debug.Assert(_numberOfOutstandingOperations > 0, "Expected a positive number of outstanding operations, since we're completing one here."); 502Debug.Assert(_numberOfOutstandingServiceTasks > 0, "Expected a positive number of outstanding service tasks, since we're completing one here."); 523Debug.Assert(UsesAsyncCompletion, "Only valid to use when in async mode."); 615Debug.Assert( 660Debug.Assert(messageId != Common.INVALID_REORDERING_ID, "The assigned message ID is invalid."); 664Debug.Assert(_boundingState.OutstandingTransfers >= 0, "Expected TryConsumePostponedMessage to not be negative."); 730Debug.Assert((_decliningPermanently && _messages.IsEmpty) || CanceledOrFaulted, "There must be no more messages."); 758lock (IncomingLock) Debug.Assert(_numberOfOutstandingOperations == 0, "Everything must be done by now."); 811Debug.Assert(count != 0, "Should only be called when the count is actually changing."); 817Debug.Assert(count > 0 || (count < 0 && _boundingState.CurrentCount + count >= 0),
Internal\TargetRegistry.cs (29)
37Debug.Assert(target != null, "The target that is supposed to be linked must not be null."); 38Debug.Assert(linkOptions != null, "The linkOptions must not be null."); 74Debug.Assert(owningSource != null, "The TargetRegistry instance must be owned by a source block."); 85Debug.Assert(target != null, "The target that is supposed to be linked must not be null."); 86Debug.Assert(linkOptions != null, "The link options must not be null."); 97Debug.Assert(_linksWithRemainingMessages >= 0, "_linksWithRemainingMessages must be non-negative at any time."); 121Debug.Assert(target != null, "Target to remove is required."); 124Debug.Assert(_linksWithRemainingMessages >= 0, "_linksWithRemainingMessages must be non-negative at any time."); 138Debug.Assert(target != null, "Target to remove is required."); 141Debug.Assert(_linksWithRemainingMessages >= 0, "_linksWithRemainingMessages must be non-negative at any time."); 142Debug.Assert(!onlyIfReachedMaxMessages || _linksWithRemainingMessages > 0, "We shouldn't have ended on the slow path."); 148Debug.Assert(node != null, "The LinkedTargetInfo node referenced in the Dictionary must be non-null."); 159Debug.Assert(_linksWithRemainingMessages >= 0, "_linksWithRemainingMessages must be non-negative at any time."); 169Debug.Assert(node.RemainingMessages > 1, "The target should have been removed, because there are no remaining messages."); 184Debug.Assert(_linksWithRemainingMessages >= 0, "_linksWithRemainingMessages must be non-negative at any time."); 194Debug.Assert(_owningSource.Completion.IsCompleted, "The owning source must have completed before propagating completion."); 214Debug.Assert(node != null, "Requires a node to be added."); 223Debug.Assert(_firstTarget != null && _lastTarget != null, "Both first and last node must either be null or non-null."); 224Debug.Assert(_lastTarget.Next == null, "The last node must not have a successor."); 225Debug.Assert(_firstTarget.Previous == null, "The first node must not have a predecessor."); 243Debug.Assert(_firstTarget != null && _lastTarget != null, "Both first and last node must be non-null after AddToList."); 250Debug.Assert(node != null, "Node to remove is required."); 251Debug.Assert(_firstTarget != null && _lastTarget != null, "Both first and last node must be non-null before RemoveFromList."); 273Debug.Assert((_firstTarget != null) == (_lastTarget != null), "Both first and last node must either be null or non-null after RemoveFromList."); 312Debug.Assert(owningSource != null, "Propagator must be associated with a source."); 313Debug.Assert(target != null, "Target to propagate to is required."); 323Debug.Assert(source == _owningSource, "Only valid to be used with the source for which it was created."); 378Debug.Assert(passthrough != null, "Need a propagator with which to construct the debug view."); 398Debug.Assert(registry != null, "Need a registry with which to construct the debug view.");
src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (13)
67Debug.Assert(InitialSegmentSize > 0, "Initial segment size must be > 0."); 68Debug.Assert((InitialSegmentSize & (InitialSegmentSize - 1)) == 0, "Initial segment size must be a power of 2"); 69Debug.Assert(InitialSegmentSize <= MaxSegmentSize, "Initial segment size should be <= maximum."); 70Debug.Assert(MaxSegmentSize < int.MaxValue / 2, "Max segment size * 2 must be < int.MaxValue, or else overflow could occur."); 102Debug.Assert(segment != null, "Expected a non-null segment."); 112Debug.Assert(newSegmentSize > 0, "The max size should always be small enough that we don't overflow."); 179Debug.Assert(segment != null, "Expected a non-null segment."); 180Debug.Assert(array != null, "Expected a non-null item array."); 253Debug.Assert(segment != null, "Expected a non-null segment."); 254Debug.Assert(array != null, "Expected a non-null item array."); 368Debug.Assert(syncObj != null, "The syncObj parameter is null."); 390Debug.Assert((size & (size - 1)) == 0, "Size must be a power of 2"); 429Debug.Assert(queue != null, "Expected a non-null queue.");
System.Threading.Tasks.Parallel (12)
System\Threading\Tasks\Parallel.cs (9)
924Debug.Assert(((body == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) + (bodyWithLocal == null ? 0 : 1)) == 1, 926Debug.Assert(bodyWithLocal != null || (localInit == null && localFinally == null), 1645Debug.Assert(((body == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) + 1648Debug.Assert((bodyWithStateAndLocal != null) || (bodyWithEverything != null) || (localInit == null && localFinally == null), 1704Debug.Assert(parallelOptions != null, "ForEachWorker(array): parallelOptions is null"); 1763Debug.Assert(parallelOptions != null, "ForEachWorker(list): parallelOptions is null"); 2517Debug.Assert(((simpleBody == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) + 2520Debug.Assert((bodyWithStateAndLocal != null) || (bodyWithEverything != null) || (localInit == null && localFinally == null), 2524Debug.Assert((orderedSource != null) || (bodyWithStateAndIndex == null && bodyWithEverything == null),
System\Threading\Tasks\Parallel.ForEachAsync.cs (3)
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"); 665Debug.Assert(taskSet, "Complete should only be called once.");
System.Transactions.Local (36)
System\Transactions\Enlistment.cs (1)
164Debug.Assert(_transaction != null, "this.transaction != null");
System\Transactions\InternalTransaction.cs (1)
129Debug.Assert(_promotedTransaction == null, "A transaction can only be promoted once!");
System\Transactions\TransactionScope.cs (1)
804Debug.Assert(null != _dependentTransaction, "null != this.dependentTransaction");
System\Transactions\TransactionsEtwProvider.cs (7)
271Debug.Assert(transaction != null, "Transaction needed for the ETW event."); 595Debug.Assert(enlistment != null, "Enlistment needed for the ETW event."); 620Debug.Assert(enlistment != null, "Enlistment needed for the ETW event."); 645Debug.Assert(enlistment != null, "Enlistment needed for the ETW event."); 670Debug.Assert(enlistment != null, "Enlistment needed for the ETW event."); 696Debug.Assert(enlistment != null, "Enlistment needed for the ETW event."); 721Debug.Assert(enlistment != null, "Enlistment needed for the ETW event.");
System\Transactions\TransactionState.cs (24)
163Debug.Assert(tx.State != this, "Changing to the same state."); 788Debug.Assert(tx._promoterType != Guid.Empty, "InternalTransaction.PromoterType was not set in PSPEInitialize"); 835Debug.Assert(tx._promoter != null, "Transaction Promoter is Null entering SubordinateActive"); 1077Debug.Assert(tx._promoterType != Guid.Empty, "InternalTransaction.PromoterType was not set in Phase0PSPEInitialize"); 1266Debug.Assert(tx._phase1Volatiles._volatileEnlistmentCount == 1, 1668Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 1697Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 1727Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 1768Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 1803Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 2007Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 2101Debug.Assert(tx.promotedToken != null, "InternalTransaction.promotedToken is null in TransactionStateDelegatedNonMSDTCBase or one of its derived classes."); 2145Debug.Assert((tx._promoterType == Guid.Empty) || (tx._promoterType == TransactionInterop.PromoterTypeDtc), "Promoted to MSTC but PromoterType is not TransactionInterop.PromoterTypeDtc"); 2536Debug.Assert(tx._phase0Volatiles.VolatileDemux != null, "Volatile Demux must exist for VolatilePrepareDone when promoted."); 2644Debug.Assert(tx._phase1Volatiles.VolatileDemux != null, "Volatile Demux must exist for VolatilePrepareDone when promoted."); 2801Debug.Assert(tx._phase1Volatiles.VolatileDemux != null, "Volatile Demux must exist."); 2864Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 3494Debug.Assert(tx._durableEnlistment != null, "PromotedNonMSDTC state is not valid for transaction"); 3633Debug.Assert(tx.promotedToken != null, "InternalTransaction.promotedToken is null in TransactionStateDelegatedNonMSDTCBase or one of its derived classes."); 4265Debug.Assert((distributedTx == null), "PSPEPromote for non-MSDTC promotion returned a distributed transaction."); 4266Debug.Assert((tx.promotedToken != null), "PSPEPromote for non-MSDTC promotion did not set InternalTransaction.PromotedToken."); 4351Debug.Assert(tx.State == TransactionStateActive, "PSPEPromote called from state other than TransactionStateActive"); 4378Debug.Assert(tx.State == TransactionStatePhase0, "Phase0PSPEInitialize called from state other than TransactionStatePhase0"); 4401Debug.Assert(returnState == TransactionStateDelegated ||
System\Transactions\TransactionTable.cs (1)
671Debug.Assert(transactionCount == _index, "Index changed timing out transactions");
System\Transactions\VolatileEnlistmentMultiplexing.cs (1)
454Debug.Assert(_volatileDemux == null, "volatileDemux can only be set once.");
System.Web.HttpUtility (3)
src\libraries\Common\src\System\HexConverter.cs (2)
337Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 338Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (1)
298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System.Windows.Controls.Ribbon (22)
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonQuickAccessToolBarOverflowPanel.cs (2)
25Debug.Assert(child != null, "child not expected to be null"); 26Debug.Assert(RibbonQuickAccessToolBar.GetIsOverflowItem(child) == true, "child expected to have IsOverflowItem == true");
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonQuickAccessToolBarPanel.cs (1)
223Debug.Assert(overflowPanel.Children.Count >= overflowIndex, "overflowIndex should never get above overflowPanel.Children.Count");
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonWindowSmallIconConverter.cs (2)
89Debug.Assert(size.Width != 0, "input param width should not be zero"); 90Debug.Assert(size.Height != 0, "input param height should not be zero");
Microsoft\Windows\Controls\Ribbon\Ribbon.cs (1)
1652Debug.Assert(ItemContainerGenerator.Status == GeneratorStatus.ContainersGenerated, "Expected: containers should be generated before calling this method.");
Microsoft\Windows\Controls\Ribbon\RibbonGallery.cs (4)
1040Debug.Assert(selectedItem != null, "Must have a selectedItem to synchronize with."); 1081Debug.Assert(IsSynchronizedWithCurrentItemInternal, "We should add currency change listeners only when IsSynchronizedWithCurrentItemInternal is true"); 1159Debug.Assert(IsSynchronizedWithCurrentItemInternal, "We shouldn't be listening for currency changes if IsSynchronizedWithCurrentItemInternal is false"); 1182Debug.Assert(IsSynchronizedWithCurrentItemInternal, "We shouldn't be listening for currency changes if IsSynchronizedWithCurrentItemInternal is false");
Microsoft\Windows\Controls\Ribbon\RibbonGalleryCategory.cs (1)
508Debug.Assert(RibbonGallery == null || RibbonGallery.IsSynchronizedWithCurrentItemInternal, "We shouldn't be listening for currency changes if IsSynchronizedWithCurrentItemInternal is false");
Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs (9)
780Debug.Assert(category.RibbonGallery == gallery, "The reference RibbongalleryItem and the RibbonGallery must be related."); 943Debug.Assert(element != null, "Element must not be null"); 944Debug.Assert(routedEvent != null, "RoutedEvent must not be null"); 968Debug.Assert(element != null, "Element must not be null"); 969Debug.Assert(routedEvent != null, "RoutedEvent must not be null"); 2114Debug.Assert(clone is ButtonBase, 2147Debug.Assert(clone is ButtonBase || clone is RibbonMenuButton, 2185Debug.Assert(clone is ButtonBase || clone is RibbonMenuButton, 2205Debug.Assert(clone is RibbonMenuButton,
Microsoft\Windows\Controls\Ribbon\RibbonMenuItem.cs (2)
1171Debug.Assert(timer != null, "timer should not be null."); 1172Debug.Assert(!timer.IsEnabled, "timer should not be running.");
System.Windows.Forms (715)
System\Resources\ResXDataNode.cs (1)
344Debug.Assert(_value is string, "Resource entries with no Type or MimeType must be encoded as strings");
System\Resources\ResXResourceWriter.cs (1)
165Debug.Assert(_fileName is not null, "Nothing to output to");
System\Windows\Forms\Accessibility\AccessibleObject.cs (2)
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 (5)
333Debug.Assert(_parent.Site is null, "Parent is sited but we could not find IContainer"); 388Debug.Assert( 466Debug.Assert(_siteUIActive is null || _siteUIActive == site, "Deactivating when not active"); 501Debug.Assert(_siteUIActive is null, "Object did not call OnUIDeactivate"); 629Debug.Assert(_controlInEditMode is null || _controlInEditMode == ctl, "who is exiting edit mode?");
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)
223Debug.Assert(!_host.GetAxState(s_siteProcessedInputKey), "Re-entering IOleControlSite.TranslateAccelerator!!!");
System\Windows\Forms\ActiveX\AxHost.State.cs (4)
136Debug.Assert(_storage is null, "but we already have a storage!"); 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)
868Debug.Assert(_activeXState[s_inPlaceVisible], "Failed to set inplacevisible"); 895Debug.Assert(_inPlaceFrame is not null, "Setting us to visible should have created the in place frame"); 1469Debug.Assert(hr.Succeeded, "Stream should be non-null."); 1707Debug.Assert(_clientSite is not null, "How can we setextent before we are sited??"); 1948Debug.Assert(_inPlaceFrame is not null, "No inplace frame -- how did we go UI active?");
System\Windows\Forms\ActiveX\Control_ActiveXControlInterfaces.cs (1)
79Debug.Assert(ActiveXInstance.EventsFrozen == bFreeze, "Failed to set EventsFrozen correctly");
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 (3)
940Debug.Assert(UseVisualStyles, "Enable Visual Styles failed"); 1139Debug.Assert( 1202Debug.Assert(
System\Windows\Forms\Application.ParkingWindow.cs (1)
127Debug.Assert(
System\Windows\Forms\Application.ThreadContext.cs (3)
148Debug.Assert(_parkingWindows.Count == 1, "parkingWindows count can not be > 1 for legacy OS/target framework versions"); 282Debug.Assert(!disposing, "Shouldn't be getting dispose from another thread."); 423Debug.Assert(_debugModalCounter >= 0, "Mis-matched calls to Application.BeginModalMessageLoop() and Application.EndModalMessageLoop()");
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\COM2Properties.cs (1)
94Debug.Assert(_defaultPropertyIndex < _properties.Length, "Whoops! default index is > props.Length");
System\Windows\Forms\ComponentModel\COM2Interop\COM2TypeInfoProcessor.cs (3)
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!");
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 (27)
436Debug.Assert(accessibleObject is not null, "Failed to create accessibility object"); 455Debug.Assert(ncAccessibleObject is not null, "Failed to create NON-CLIENT accessibility object"); 707Debug.Assert(!backBrush.IsNull, "Failed to create brushHandle"); 1565Debug.Assert(s_defaultFont is not null, "defaultFont wasn't set!"); 2450Debug.Assert(Margin == value, "Error detected while setting Margin."); 2474Debug.Assert(MaximumSize == DefaultMaximumSize, "Error detected while resetting MaximumSize."); 2480Debug.Assert(MaximumSize == value, "Error detected while setting MaximumSize."); 2499Debug.Assert(MinimumSize == value, "Error detected while setting MinimumSize."); 4511Debug.Assert((cp.ExStyle & (int)WINDOW_EX_STYLE.WS_EX_MDICHILD) == 0, "Can't put MDI child forms on the parking form"); 4960Debug.Assert(this == entry._caller, "Called BeginInvoke on one control, and the corresponding EndInvoke on a different control"); 4976Debug.Assert(asyncResult.IsCompleted, "Why isn't this asyncResult done yet?"); 4986Debug.Assert(IsHandleCreated, "Handle should be created by now"); 5047Debug.Assert(c.IsHandleCreated, "FindMarshalingControl chose a bad control."); 5698Debug.Assert(window is not null, "window is null in Control.GetSafeHandle"); 6080Debug.Assert(tme._args!.Length == 1, "Arguments are wrong for WaitCallback"); 6085Debug.Assert(tme._args!.Length == 1, "Arguments are wrong for SendOrPostCallback"); 8362Debug.Assert(args is not null, "This method should never be called with null args."); 8710Debug.Assert((OBJ_TYPE)PInvokeCore.GetObjectType(hDC) == OBJ_TYPE.OBJ_ENHMETADC, 8712Debug.Assert((lParam & (long)PInvoke.PRF_CHILDREN) != 0, 8722Debug.Assert(success, "GetViewportOrgEx() failed."); 8730Debug.Assert(!hClippingRegion.IsNull, "CreateRectRgn() failed."); 8734Debug.Assert( 8752Debug.Assert(success, "GetWindowRect() failed."); 10166Debug.Assert(value != -1, "Outdated call to SetParentHandle"); 10174Debug.Assert(Handle != value, "Cycle created in SetParentHandle"); 10676Debug.Assert(LayoutSuspendCount > 0, "SuspendLayout: layoutSuspendCount overflowed."); 12630Debug.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)
394Debug.Assert(_image is null, "We expect to be returning null."); 936Debug.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\RadioButtonBaseAdapter.cs (1)
99Debug.Assert(!hdc.IsNull, "Calling DrawAndFillEllipse with null wg");
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.cs (9)
588Debug.Assert(IsHandleCreated, "Handle should be created at this point"); 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");
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.DataConnection.cs (17)
163Debug.Assert(CurrencyManager.AllowAdd, "why did we call AddNew on the currency manager when the currency manager does not allow new rows?"); 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?"); 488Debug.Assert(DataBoundRowsCount() != -1, "the data bound data grid view rows count should be at least 0"); 529Debug.Assert(CurrencyManager!.List!.Count == 0, "we deleted the row that the Child table forcefully added"); 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?"); 766Debug.Assert(_owner.NewRowIndex != -1, "the NewRowIndex is -1 only when AllowUserToAddRows is false"); 826Debug.Assert(_owner.AllowUserToAddRowsInternal, "how did we start an add new row transaction if the dataGridView control has AllowUserToAddRows == false?"); 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"); 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 (19)
4716Debug.Assert(numVisibleScrollingCols <= visibleScrollingColumnsTmp, "the number of displayed columns can only grow"); 4896Debug.Assert(firstDisplayedFrozenRow < nRows, "firstDisplayedFrozenRow larger than number of rows"); 4897Debug.Assert(lastDisplayedFrozenRow < nRows, "lastDisplayedFrozenRow larger than number of rows"); 4898Debug.Assert(lastDisplayedScrollingRow < nRows, "lastDisplayedScrollingRow larger than number of rows"); 4906Debug.Assert(DisplayedBandsInfo.NumTotallyDisplayedFrozenRows >= 0, "the number of visible frozen rows can't be negative"); 4907Debug.Assert(DisplayedBandsInfo.NumDisplayedScrollingRows >= 0, "the number of visible scrolling rows can't be negative"); 4908Debug.Assert(DisplayedBandsInfo.NumTotallyDisplayedScrollingRows >= 0, "the number of totally visible scrolling rows can't be negative"); 4909Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow < nRows, "firstDisplayedScrollingRow larger than number of rows"); 8327Debug.Assert(RightToLeftInternal || (x >= data.X - 1 && x < data.Right), "x must be inside the horizontal bounds of this.layout.Data"); 8328Debug.Assert(!RightToLeftInternal || (x >= data.X && x <= data.Right), "x must be inside the horizontal bounds of this.layout.Data"); 9113Debug.Assert(y >= data.Y - 1 && y < data.Bottom, "y must be inside the vertical bounds of the data area."); 10452Debug.Assert(DataSource is not null, "this method should only be called when we have a data connection"); 10453Debug.Assert(dataGridViewColumn.DataPropertyName.Length != 0, "this method should be called only for columns which have DataPropertyName set"); 17154Debug.Assert(Columns[i].IsDataBound, "two columns w/ the same DataPropertyName should be DataBound at the same time"); 17155Debug.Assert(Columns[i].HeaderCell.SortGlyphDirection == dataGridViewColumn.HeaderCell.SortGlyphDirection, "DataBound columns should have the same SortGlyphDirection as the one on the DataGridView"); 17702Debug.Assert(NewRowIndex == -1, "newRowIndex and AllowUserToAddRowsInternal became out of sync"); 18968Debug.Assert(Columns[i].IsDataBound, "two columns w/ the same DataPropertyName should be DataBound at the same time"); 19981Debug.Assert(rowCount == dataGridViewRowsCount, "out of sync in AddNewTransaction when the user did not type in the 'add new row'"); 19989Debug.Assert(rowCount == dataGridViewRowsCount, "out of sync");
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (2)
798Debug.Assert(FlatStyle == FlatStyle.Popup, "FlatStyle.Popup is the last flat style"); 928Debug.Assert(FlatStyle == FlatStyle.Popup, "FlatStyle.Popup is the last flat style");
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (3)
980Debug.Assert(this is DataGridViewColumnHeaderCell, "if the row index == -1 and we have an owning column this should be a column header cell"); 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");
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.DataGridViewCellAccessibleObject.cs (1)
280Debug.Assert(dataGridView.CurrentCell == dataGridViewCell, "the result of selecting the cell should have made this cell the current cell");
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (1)
1548Debug.Assert(valBounds.Width < checkBoxSize.Width || valBounds.Height < checkBoxSize.Height, "the bounds are empty");
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (1)
685Debug.Assert(sender == DataSource, "How can we get dispose notification from anything other than our DataSource?");
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (1)
668Debug.Assert(
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 (1)
874Debug.Assert(false, "we should have found the row already");
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.RowList.cs (1)
62Debug.Assert(i >= left && j <= right, "(i>=left && j<=right) Sort failed - Is your IComparer bogus?");
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 (4)
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");
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.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 (7)
484Debug.Assert(text is not null, "string should not be null"); 550Debug.Assert(regionIndex == (textRegions.Length - 1), "Failed to consume all link label visual regions"); 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.ObjectCollection.cs (1)
120Debug.Assert(index >= 0 && index <= Count, "Wrong index for insert");
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 (46)
849Debug.Assert(!_listViewState[LISTVIEWSTATE_flipViewToLargeIconAndSmallIcon] || View == View.SmallIcon, "we need this bit only in SmallIcon view"); 850Debug.Assert(!_listViewState[LISTVIEWSTATE_flipViewToLargeIconAndSmallIcon] || Application.ComCtlSupportsVisualStyles, "we need this bit only when loading ComCtl 6.0"); 857Debug.Assert(!value || View == View.SmallIcon, "we need this bit only in SmallIcon view"); 858Debug.Assert(!value || Application.ComCtlSupportsVisualStyles, "we need this bit only when loading ComCtl 6.0"); 1690Debug.Assert(result != 0, "LVM_SETTILEVIEWINFO failed"); 2404Debug.Assert(Columns[i].DisplayIndex > -1 && Columns[i].DisplayIndex < Columns.Count, "display indices out of whack"); 2408Debug.Assert(sumOfDisplayIndices == (colsCount - 1) * colsCount / 2, "display indices out of whack"); 2461Debug.Assert(_listItemSorter is not null, "null sorter!"); 2760Debug.Assert(item is not null, "Item was null in ITEMPREPAINT"); 3096Debug.Assert(fi.Exists, "who deleted our temp file?"); 3121Debug.Assert(fi.Exists, "who deleted our temp file?"); 3259Debug.Assert(false, "these are all the search directions"); 3398Debug.Assert(item._listView == this, "Can't GetDisplayIndex if the list item doesn't belong to us"); 3399Debug.Assert(item._id != -1, "ListViewItem has no ID yet"); 3422Debug.Assert(displayIndex != -1, "This item is in the list view -- why can't we find a display index for it?"); 3429Debug.Assert(_listViewItems is not null, "listItemsArray is null, but the handle isn't created"); 3560Debug.Assert(IsHandleCreated, "How did we add items without a handle?"); 3931Debug.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"); 3932Debug.Assert(group != DefaultGroup, "this method should be used only when the user adds a group, not when we add our own DefaultGroup"); 3969Debug.Assert(lvItem.iGroupId != -1, "there is a list view item which is not parented"); 3978Debug.Assert(IsHandleCreated, "InsertGroupNative precondition: list-view handle must be created"); 3979Debug.Assert(group == DefaultGroup || Groups.Contains(group), "Make sure ListView.Groups contains this group before adding the native LVGROUP. Otherwise, custom-drawing may break."); 3982Debug.Assert(result != -1, "Failed to insert group"); 4018Debug.Assert(itemList is not null, "In Begin/EndUpdate with no delayed array!"); 4045Debug.Assert(!_listItemsTable.ContainsKey(itemID), "internal hash table inconsistent -- inserting item, but it's already in the hash table"); 4054Debug.Assert(_listViewItems is not null, "listItemsArray is null, but the handle isn't created"); 4078Debug.Assert(!FlipViewToLargeIconAndSmallIcon, "if we added even 1 item then we should have been done w/ FlipViewToLargeIconAndSmallIcon"); 4093Debug.Assert(IsHandleCreated, "InsertItemsNative precondition: list-view handle must be created"); 4118Debug.Assert(Items.Contains(li), "Make sure ListView.Items contains this item before adding the native LVITEM. Otherwise, custom-drawing may break."); 4139Debug.Assert(result != IntPtr.Zero, "Groups not enabled"); 4685Debug.Assert(_listViewItems is null, "listItemsArray not null, even though handle created"); 5100Debug.Assert(IsHandleCreated, "RemoveGroupNative precondition: list-view handle must be created"); 5197Debug.Assert((mask & ~(LVCOLUMNW_MASK.LVCF_FMT | LVCOLUMNW_MASK.LVCF_TEXT | LVCOLUMNW_MASK.LVCF_IMAGE)) == 0, "Unsupported mask in setColumnInfo"); 5358Debug.Assert(_savedCheckedItems.Contains(item), "somehow we lost track of one item"); 5430Debug.Assert(IsHandleCreated, "How did we add items without a handle?"); 5467Debug.Assert(IsHandleCreated, "SetItemText with no handle"); 5680Debug.Assert(IsHandleCreated, "UpdateGroupNative precondition: list-view handle must be created"); 5789Debug.Assert(retval != -1, "Error enabling group view"); 5796Debug.Assert(Application.ComCtlSupportsVisualStyles, "this function works only when ComCtl 6.0 and higher is loaded"); 5797Debug.Assert(_viewStyle == View.Tile, "this function should be called only in Tile view"); 5810Debug.Assert(retval != 0, "LVM_SETTILEVIEWINFO failed"); 6148Debug.Assert(_listViewState[LISTVIEWSTATE_headerControlTracking], "HDN_ENDTRACK and HDN_BEGINTRACK are out of sync."); 6295Debug.Assert(header->iItem == 0, "we only need to compensate for the first column resize"); 6296Debug.Assert(_columnHeaders!.Length > 0, "there should be a column that we need to compensate for"); 6409Debug.Assert(_labelEdit is null, 6468Debug.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)
136Debug.Assert(fidx != -1, "Invalid index returned from LVM_GETNEXTITEM"); 143Debug.Assert(_owner._savedSelectedItems is not null, "Null selected items collection");
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.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\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.cs (4)
868Debug.Assert(result != 0, "MCM_GETTODAY failed"); 1810Debug.Assert(_mcCurView == MONTH_CALDENDAR_MESSAGES_VIEW.MCMV_MONTH, "This logic should work only in the Month view."); 1874Debug.Assert(lower.Ticks <= upper.Ticks, "lower must be less than upper"); 2113Debug.Assert(_mcCurView == nmmcvm->dwOldView, "Calendar view mode is out of sync with native control");
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (8)
1132Debug.Assert(_selectedTab is not null, "Invalid tab selection!"); 1470Debug.Assert(_tabs[i] is not null, "Null item in tab array!"); 1807Debug.Assert( 3553Debug.Assert(_tabs.Count > 0, "We don't have any tabs left!"); 3568Debug.Assert(_tabs.Count > 0, "Tab array destroyed!"); 3706Debug.Assert(_tabs.Count > 0, "No view tab buttons to select!"); 3766Debug.Assert(_tabs[PropertiesTabIndex].Tab.GetType() == DefaultTabType, "First item is not property tab!"); 3802Debug.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."); 184Debug.Assert(value is null || !Disposed, "Why are we putting new children in after we are disposed?"); 690Debug.Assert(value != this, "how can we be our own parent?"); 926Debug.Assert(!Disposed, "Why are we creating children after we are disposed?"); 1280Debug.Assert(ownerTab is not null, "No current tab!"); 1986Debug.Assert(gridHost is not null, "No prop entry host!"); 2221Debug.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"); 313Debug.Assert(component is Array, "MergePropertyDescriptor::SetValue called with non-array value"); 331Debug.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\PropertyGridView.cs (5)
878Debug.Assert(control is not null, "Null control passed to CommonEditorUse"); 3129Debug.Assert(_cumulativeVerticalWheelDelta > -PInvoke.WHEEL_DELTA, "cumulativeVerticalWheelDelta is too small"); 3130Debug.Assert(_cumulativeVerticalWheelDelta < PInvoke.WHEEL_DELTA, "cumulativeVerticalWheelDelta is too big"); 3405Debug.Assert(gridEntry.Expandable, "non-expandable IPE firing outline click"); 3522Debug.Assert(parentIndex != -1, "parent GridEntry not found in allGridEntries");
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\RichTextBox\RichTextBox.cs (5)
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"); 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\TabControl\TabPage.cs (1)
657Debug.Assert(_externalToolTip == toolTip, "RemoveToolTip should remove a toolTip that was set.");
System\Windows\Forms\Controls\TextBox\MaskedTextBox.cs (21)
148Debug.Assert(maskedTextProvider is not null, "Initializing from a null MaskProvider ref."); 1227Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 1505Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 1507Debug.Assert(startPosition >= 0 && ((startPosition + selectionLen) <= _maskedTextProvider.Length), "Invalid position range."); 1700Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 1778Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2064Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2164Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2165Debug.Assert(text is not null, "text is null."); 2283Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2390Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2501Debug.Assert(newProvider is not null, "Initializing from a null MaskProvider ref."); 2550Debug.Assert(srcPos != MaskedTextProvider.InvalidIndex, "InvalidIndex unexpected at this time."); 2705Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2724Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2762Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2768Debug.Assert(ImeMode == ImeMode.Disable, "IME enabled when in RO or Pwd mode."); 2811Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2868Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 3004Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 3023Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided.");
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (1)
1840Debug.Assert(IsHandleCreated, "Don't call this method until the handle is created.");
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)
1743Debug.Assert(reason != ToolStripDropDownCloseReason.ItemClicked, 1887Debug.Assert(_countDropDownItemsAssignedTo > 0, "dropdown assignment underflow"); 2032Debug.Assert(start is not null, "Who is passing null to GetFirstDropDown?");
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?"); 2312Debug.Assert(false, "Invalid event type."); 2582Debug.Assert(deltaTicks >= 0, "why are deltaticks less than zero? thats some mighty fast clicking"); 3487Debug.Assert((toPointType == ToolStripPointType.ToolStripCoords), "why are we here! - investigate"); 3578Debug.Assert(i < count, "Item has a parent set but the parent doesn't own the item"); 3599Debug.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?"); 328Debug.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)
877Debug.Assert(ParentInternal is not null, "Parent is null here, not going to get accurate ID"); 885Debug.Assert(ParentInternal is not null, "Parent is null here, not going to get accurate ID"); 900Debug.Assert(ParentInternal is not null, "Why is parent 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\TrackBar\TrackBar.cs (3)
737Debug.Assert(_minimum <= _maximum, "Minimum should be <= Maximum"); 937Debug.Assert(_cumulativeWheelData > -PInvoke.WHEEL_DELTA, "cumulativeWheelData is too small"); 938Debug.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"); 1603Debug.Assert(num > 0, "required capacity can not be less than 1"); 2025Debug.Assert(tv.IsHandleCreated, "nonexistent handle"); 2103Debug.Assert(_parent is not null, "toggle on virtual root"); 2136Debug.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)
1116Debug.Assert(_selectedNode is null || _selectedNode.TreeView != this, "handle is created, but we're still caching selectedNode"); 1318Debug.Assert(_topNode is null || _topNode.TreeView != this, "handle is created, but we're still caching selectedNode"); 1789Debug.Assert(_internalStateImageList is not null, "Why are changing images when the Imagelist is null?"); 2562Debug.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)
381Debug.Assert(_domainItems is not null, "Domain values array is null"); 382Debug.Assert(index < _domainItems.Count && index >= -1, "SelectValue: index out of range"); 418Debug.Assert(_sorted, "Sorted == false");
System\Windows\Forms\Controls\UpDown\NumericUpDown.cs (8)
190Debug.Assert(_maximum == value, "Maximum != what we just set it to!"); 217Debug.Assert(_minimum.Equals(value), "Minimum != what we just set it to!"); 358Debug.Assert(_minimum <= _maximum, 529Debug.Assert(UserEdit, "ParseEditText() - UserEdit == false"); 706Debug.Assert(text == text.ToUpper(CultureInfo.InvariantCulture), "GetPreferredSize assumes hex digits to be uppercase."); 744Debug.Assert(_minimum <= _currentValue && _currentValue <= _maximum, 748Debug.Assert(!ChangingText, "ChangingText should have been set to false"); 859Debug.Assert(largestDigit != -1 && digitWidth != -1, "Failed to find largest digit.");
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (3)
653Debug.Assert(!UserEdit, "OnTextBoxTextChanged() - UserEdit == true"); 746Debug.Assert(_wheelDelta > -PInvoke.WHEEL_DELTA, "wheelDelta is too small"); 747Debug.Assert(_wheelDelta < PInvoke.WHEEL_DELTA, "wheelDelta is too big");
System\Windows\Forms\Controls\UpDown\UpDownBase.UpDownButtons.cs (3)
128Debug.Assert( 201Debug.Assert( 219Debug.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)
45Debug.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\HtmlWindowCollection.cs (1)
26Debug.Assert(NativeHTMLFramesCollection2 is not null, "The window collection object should implement IHTMLFramesCollection2");
System\Windows\Forms\Controls\WebBrowser\WebBrowser.cs (3)
271Debug.Assert(psi is not null, "Object isn't an IPersistStreamInit!"); 359Debug.Assert(!htmlDocument2.IsNull, "The HtmlDocument object must implement IHTMLDocument2."); 384Debug.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 (5)
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 (3)
26Debug.Assert(_owner.DataSource is not null, "how can we determine if DataSource is initialized or not if we have no data source?"); 61Debug.Assert(sender == _owner.DataSource, "data source should not change"); 62Debug.Assert(_owner.DataSource is ISupportInitializeNotification, "data source should not change on the BindToObject");
System\Windows\Forms\DataBinding\Binding.cs (2)
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");
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 (4)
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!");
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\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 (1)
383Debug.Assert((newPage >= 0) && (newPage < _pageSites.Length),
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\CommonDialog.cs (1)
207Debug.Assert(_priorWindowProcedure == 0, "The previous subclass wasn't properly cleaned up");
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\ErrorProvider\ErrorProvider.cs (4)
448Debug.Assert(sender == _errorManager, "who else can send us messages?"); 640Debug.Assert(dsInit is not null, "ErrorProvider: ISupportInitializeNotification.Initialized event received, but current DataSource does not support ISupportInitializeNotification!"); 641Debug.Assert(dsInit.IsInitialized, "ErrorProvider: DataSource sent ISupportInitializeNotification.Initialized event but before it had finished initializing."); 792Debug.Assert(_errorCount >= 0, "Error count should not be less than zero");
System\Windows\Forms\Form.cs (32)
180Debug.Assert(_formState[s_formStateAllowTransparency] == 0, "Failed to set formState[FormStateAllowTransparency]"); 181Debug.Assert(_formState[s_formStateBorderStyle] == (int)FormBorderStyle.Sizable, "Failed to set formState[FormStateBorderStyle]"); 182Debug.Assert(_formState[s_formStateTaskBar] == 1, "Failed to set formState[FormStateTaskBar]"); 183Debug.Assert(_formState[s_formStateControlBox] == 1, "Failed to set formState[FormStateControlBox]"); 184Debug.Assert(_formState[s_formStateKeyPreview] == 0, "Failed to set formState[FormStateKeyPreview]"); 185Debug.Assert(_formState[s_formStateLayered] == 0, "Failed to set formState[FormStateLayered]"); 186Debug.Assert(_formState[s_formStateMaximizeBox] == 1, "Failed to set formState[FormStateMaximizeBox]"); 187Debug.Assert(_formState[s_formStateMinimizeBox] == 1, "Failed to set formState[FormStateMinimizeBox]"); 188Debug.Assert(_formState[s_formStateHelpButton] == 0, "Failed to set formState[FormStateHelpButton]"); 189Debug.Assert(_formState[s_formStateStartPos] == (int)FormStartPosition.WindowsDefaultLocation, "Failed to set formState[FormStateStartPos]"); 190Debug.Assert(_formState[s_formStateWindowState] == (int)FormWindowState.Normal, "Failed to set formState[FormStateWindowState]"); 191Debug.Assert(_formState[s_formStateShowWindowOnCreate] == 0, "Failed to set formState[FormStateShowWindowOnCreate]"); 192Debug.Assert(_formState[s_formStateAutoScaling] == 1, "Failed to set formState[FormStateAutoScaling]"); 193Debug.Assert(_formState[s_formStateSetClientSize] == 0, "Failed to set formState[FormStateSetClientSize]"); 194Debug.Assert(_formState[s_formStateTopMost] == 0, "Failed to set formState[FormStateTopMost]"); 195Debug.Assert(_formState[s_formStateSWCalled] == 0, "Failed to set formState[FormStateSWCalled]"); 196Debug.Assert(_formState[s_formStateMdiChildMax] == 0, "Failed to set formState[FormStateMdiChildMax]"); 197Debug.Assert(_formState[s_formStateRenderSizeGrip] == 0, "Failed to set formState[FormStateRenderSizeGrip]"); 198Debug.Assert(_formState[s_formStateSizeGripStyle] == 0, "Failed to set formState[FormStateSizeGripStyle]"); 199Debug.Assert(_formState[s_formStateIsWindowActivated] == 0, "Failed to set formState[FormStateIsWindowActivated]"); 200Debug.Assert(_formState[s_formStateIsTextEmpty] == 0, "Failed to set formState[FormStateIsTextEmpty]"); 201Debug.Assert(_formState[s_formStateIsActive] == 0, "Failed to set formState[FormStateIsActive]"); 202Debug.Assert(_formState[s_formStateIconSet] == 0, "Failed to set formState[FormStateIconSet]"); 462Debug.Assert(!DesignMode, "Form designer should not allow base size set in design mode."); 511Debug.Assert(AutoSize == value, "Error detected setting Form.AutoSize."); 1108Debug.Assert(_ctlClient is null, "why isn't ctlClient null"); 1114Debug.Assert(_ctlClient is not null, "why is ctlClient null"); 3707Debug.Assert(IsHandleCreated, "Attempt to set focus to a form that has not yet created its handle."); 6080Debug.Assert(IsMdiContainer, "Not an MDI container!"); 6240Debug.Assert(numWindowListItems == MdiWindowListStrip.MergedMenu.MdiWindowListItem.DropDownItems.Count, "Calling RevertMerge modified the mdiwindowlistitem"); 6833Debug.Assert(Properties.ContainsKey(s_propFormMdiParent), "how is formMdiParent null?"); 6834Debug.Assert(IsHandleCreated, "how is handle 0?");
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 (1)
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 (1)
1283Debug.Assert(count <= 999, "Infinite loop trying to find controls which can ProcessMnemonic()!!!");
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 (18)
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."); 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 (5)
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");
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\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 (4)
238Debug.Assert(!handle.IsNull, "Should never insert a zero handle into the hash"); 258Debug.Assert( 315Debug.Assert(_priorWindowProcHandle != _windowProcHandle, "Uh oh! Subclassed ourselves!!!"); 609Debug.Assert(DefaultWindowProc != IntPtr.Zero, "We have active windows but no user window proc?");
System\Windows\Forms\NativeWindow.WindowClass.cs (1)
44Debug.Assert(!hwnd.IsNull, "Windows called us with an HWND of 0");
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\DropTarget.cs (1)
108Debug.Assert(pDataObj is not null, "OleDragEnter didn't give us a valid data object.");
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\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\Rendering\ControlPaint.cs (2)
272Debug.Assert(data.Scan0 != 0, "BitmapData.Scan0 is null; check marshalling"); 1098Debug.Assert(style == ButtonBorderStyle.Outset, "Caller should have known how to use us.");
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 (2)
161Debug.Assert(offset.IsEmpty, "transform has been modified"); 162Debug.Assert(isInfinite, "clipping as been applied");
System\Windows\Forms\Rendering\FontCache.Data.cs (1)
78Debug.Assert(font.SizeInPoints > 0.0f, "size has a negative value.");
System\Windows\Forms\Rendering\ScreenDcCache.cs (2)
103Debug.Assert(PInvoke.GetClipRgn(hdc, hrgn) == 0, "Should not have a clipping region"); 108Debug.Assert(point.IsEmpty, "Viewport origin shouldn't be shifted");
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)
793Debug.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.Design (342)
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\ComponentDesigner.cs (1)
364Debug.Assert(
System\ComponentModel\Design\DesignerActionPanel.cs (1)
433Debug.Assert(TopLevelControl is Form, "DesignerActionPanel must be hosted on a Form.");
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\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 (2)
295Debug.Assert(host is not null, "designer loader was asked to flush after it has been disposed."); 856Debug.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"); 1696Debug.Assert(nameParts.Length > 0, "How can we fail to split when IndexOf succeeded?"); 1955Debug.Assert(argumentValues is not null && parameters is not null, "These should have been allocated when the argument array was created."); 1976Debug.Assert(manager.Context.Current == newCtx, "Context stack corrupted."); 2015Debug.Assert(arguments.Length == 0, "Property serialization does not support arguments"); 2021Debug.Assert(arguments.Length == 0, "Field serialization does not support arguments"); 2121Debug.Assert(manager.Context.Current == descriptor, "Context stack corrupted."); 2162Debug.Assert(manager.Context.Current == inheritance, "Somebody messed up our context stack."); 2230Debug.Assert(manager.Context.Current == tree, "Context stack corrupted."); 2238Debug.Assert(manager.Context.Current == statements, "Context stack corrupted."); 2266Debug.Assert(manager.Context.Current == propertyToSerialize, "Context stack corrupted."); 2373Debug.Assert(manager.Context.Current == saveStatements, "Context stack corrupted."); 2405Debug.Assert(saveStatements != statements, "The serializer returned the same collection that exists on the context stack."); 2566Debug.Assert(manager.Context.Current == saveStatements, "Context stack corrupted."); 2772Debug.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 (1)
36Debug.Assert(_hInstance != IntPtr.Zero, "Dialog has been disposed");
System\Drawing\Design\IconEditor.cs (1)
68Debug.Assert(s_imageExtenders.Length <= 0, "Why does IconEditor have subclasses if Icon doesn't?");
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\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\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\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)
44Debug.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 (3)
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"); 1732Debug.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 (5)
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"); 683Debug.Assert(_columnsPrivateCopy[i].Frozen, "MOVE_DOWN : all the columns up to the one we moved should be frozen"); 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\DataGridViewColumnTypeEditor.Picker.cs (1)
135Debug.Assert(false, "we should have found a type by now");
System\Windows\Forms\Design\DataGridViewDesigner.cs (3)
256Debug.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?"); 385Debug.Assert(dataGridView.DataSource is null || _currencyManager is not null, "if we have a data source we should also have a currency manager by now"); 562Debug.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)
846Debug.Assert(nodes.Count == 0, "We only add data member content sub-nodes once."); 2269Debug.Assert(false, "DesignBindingPicker failed to add custom image to image list."); 2285Debug.Assert(!_subNodesFilled && value, "we can only set this bit to true once");
System\Windows\Forms\Design\DesignerActionVerbItem.cs (1)
12Debug.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!!!"); 176Debug.Assert(trs is not null, "No type resolution service found.");
System\Windows\Forms\Design\DocumentDesigner.cs (5)
342Debug.Assert(host is not null, "Must have a designer host on dispose"); 390Debug.Assert(toolbox is not null, "No toolbox service available"); 622Debug.Assert(sel is Control, "Our logic is flawed - sel should be a Control"); 774Debug.Assert(component.Site is not null, "Designer host should have given us a site by now."); 1116Debug.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.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 (5)
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?");
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"); 90Debug.Assert(bounds is not null && controls is not null && bounds.Length == controls.Length, "bounds->controls mismatch"); 131Debug.Assert(_originalCoordinates is not null, "We are keying off of originalCoords, but MoveControls didn't set it"); 272Debug.Assert(controls[i] == GetControl((IComponent)components[i]), "Control->Component mapping is out of sync"); 337Debug.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\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)
215Debug.Assert(control is not null, "Component must be a tab control, it is a: " + component.GetType().FullName); 284Debug.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 (3)
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?");
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)
509Debug.Assert(_host is not null, "Why didn't we get a designer host?"); 564Debug.Assert(_host is not null, "Why didn't we get a designer host?"); 565Debug.Assert(_pendingTransaction is null, "Adding item with pending transaction?"); 598Debug.Assert(textProperty is not null, "Could not find 'Text' property in ToolStripItem."); 617Debug.Assert(imageProperty is not null, "Could not find 'Image' property in ToolStripItem."); 624Debug.Assert(dispProperty is not null, "Could not find 'DisplayStyle' property in ToolStripItem."); 628Debug.Assert(imageTransProperty is not null, "Could not find 'DisplayStyle' property in ToolStripItem."); 998Debug.Assert(_host is not null, "Why didn't we get a designer host?"); 1112Debug.Assert(_host is not null, "Why didn't we get a designer host?"); 1113Debug.Assert(_pendingTransaction is null, "Removing item with pending transaction?"); 1675Debug.Assert(defaultName is not null && defaultName.Length > 0, "Couldn't create default name for item"); 2450Debug.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"); 548Debug.Assert(designerHost is not null, "Invalid DesignerHost"); 652Debug.Assert(designerHost is not null, "Invalid DesignerHost"); 975Debug.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"); 2690Debug.Assert(ownerItem is not null, "How can ownerItem be null for a menu item on a dropdown?");
System\Windows\Forms\Design\ToolStripTemplateNode.cs (1)
1125Debug.Assert(_centerTextBox.Control is not null, "The TextBox is null");
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 (6)
System\Windows\Forms\DeviceContextExtensions.cs (2)
154Debug.Assert(!hbrush.IsNull, "HBRUSH is null"); 190Debug.Assert(!create, "Couldn't get Graphics");
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.Input.Manipulations (36)
System\Windows\Input\Manipulations\InertiaProcessor2D.cs (7)
319Debug.Assert(!result, "Complete method is supposed to raise Completed event."); 612Debug.Assert(double.IsNaN(this.desiredDeceleration), "desiredDisplacement and desiredDeceleration are mutually exclusive."); 623Debug.Assert(double.IsNaN(this.desiredDisplacement), "desiredDisplacement and desiredDeceleration are mutually exclusive."); 669Debug.Assert( 792Debug.Assert(this.expansion.InitialValue > 0 && 837Debug.Assert(this.expansion.InitialValue > 0 && 955Debug.Assert(!double.IsNaN(resultValue) && !double.IsInfinity(resultValue), "Calculation error, value should be a finite number.");
System\Windows\Input\Manipulations\Manipulation2DCompletedEventArgs.cs (4)
38Debug.Assert(Validations.IsFinite(originX), "originX should be finite"); 39Debug.Assert(Validations.IsFinite(originY), "originY should be finite"); 40Debug.Assert(velocities != null, "velocities should not be null"); 41Debug.Assert(total != null, "total should not be null");
System\Windows\Input\Manipulations\Manipulation2DDeltaEventArgs.cs (5)
41Debug.Assert(Validations.IsFinite(originX), "originX should be finite"); 42Debug.Assert(Validations.IsFinite(originY), "originY should be finite"); 43Debug.Assert(velocities != null, "velocities should not be null"); 44Debug.Assert(delta != null, "delta should not be null"); 45Debug.Assert(cumulative != null, "cumulative should not be null");
System\Windows\Input\Manipulations\ManipulationDelta2D.cs (7)
105Debug.Assert(Validations.IsFinite(translationX), "translationX should be finite"); 106Debug.Assert(Validations.IsFinite(translationY), "translationY should be finite"); 107Debug.Assert(Validations.IsFinite(rotation), "rotation should be finite"); 108Debug.Assert(Validations.IsFiniteNonNegative(scaleX), "scaleX should be finite and not negative"); 109Debug.Assert(Validations.IsFiniteNonNegative(scaleY), "scaleY should be finite and not negative"); 110Debug.Assert(Validations.IsFinite(expansionX), "expansionX should be finite"); 111Debug.Assert(Validations.IsFinite(expansionY), "expansionY should be finite");
System\Windows\Input\Manipulations\ManipulationProcessor2D.cs (1)
331Debug.Assert(this.currentManipulation == null, "Manipulation was already in progress");
System\Windows\Input\Manipulations\ManipulationSequence.cs (8)
426Debug.Assert(this.processorState == ProcessorState.Manipulating, "Wrong state."); 508Debug.Assert(Started != null, "Processor hasn't registered for Started event"); 515Debug.Assert(Delta != null, "Processor hasn't registered for Delta event"); 575Debug.Assert(Completed != null, "Processor hasn't registered for Completed event"); 661Debug.Assert(this.processorState == ProcessorState.Manipulating, "Invalid state."); 943Debug.Assert(settings.Pivot != null, "don't call unless we have a settings.Pivot"); 944Debug.Assert(settings.Pivot.HasPosition, "don't call unless there's a settings.Pivot location"); 1095Debug.Assert(timeDelta >= ManipulationProcessor2D.TimestampTicksPerMillisecond,
System\Windows\Input\Manipulations\ManipulationVelocities2D.cs (4)
110Debug.Assert(getLinearVelocityX != null, "getLinearVelocityX should not be null"); 111Debug.Assert(getLinearVelocityY != null, "getLinearVelocityX should not be null"); 112Debug.Assert(getAngularVelocity != null, "getLinearVelocityX should not be null"); 113Debug.Assert(getExpansionVelocity != null, "getLinearVelocityX should not be null");
System.Xaml (59)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Context\XamlFrame.cs (1)
41Debug.Assert(_depth != -1, "Context Frame is uninitialized");
src\Microsoft.DotNet.Wpf\src\Shared\MS\Utility\FrugalList.cs (2)
184Debug.Assert(start >= _previousEnd, "Arguments out of order during Compact"); 185Debug.Assert(_validItemCount + end - start <= _newCount, "Too many items copied during Compact");
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (3)
129Debug.Assert(type is not null, "Type passed to IsInternalType is null"); 150Debug.Assert(type is not null, "Type passed to IsPublicType is null"); 444Debug.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)
111Debug.Assert(type is not null, "Null passed for type to GetConverterType");
System\Xaml\Context\ObjectWriterContext.cs (1)
72Debug.Assert(rootNameScope is null, "Cannot pass a new namescope in to a reparse context");
System\Xaml\Context\XamlContext.cs (2)
267Debug.Assert(typeName is not null, "typeName cannot be null and should have been checked before now"); 268Debug.Assert(typeName.Name is not null, "typeName.Name cannot be null and should have been checked before now");
System\Xaml\InfosetObjects\XamlNodes.cs (7)
51Debug.Assert(false, "XamlNode Ctor missing data argument"); 66Debug.Assert(data is XamlType, "XamlNode ctor, StartObject data is not a XamlType"); 70Debug.Assert(data is XamlMember, "XamlNode ctor, StartMember data is not a XamlMember"); 74Debug.Assert(data is NamespaceDeclaration, "XamlNode ctor, NamespaceDeclaration data is not a NamespaceDeclaration"); 84Debug.Assert(data is null, "XamlNode ctor, Internal XamlNode data must be null for this Node type"); 88Debug.Assert(false, "XamlNode ctor, incorrect ctor called."); 99Debug.Assert(internalNodeType == InternalNodeType.EndOfAttributes ||
System\Xaml\InfosetObjects\XamlObjectWriter.cs (2)
149Debug.Assert(_context.SourceBamlUri is null || _context.BaseUri is null || _context.SourceBamlUri == _context.BaseUri, 1853Debug.Assert(ctx.ParentType.IsCollection, "Logic_WillParentCollectionAdd called on a non-collection");
System\Xaml\InfosetObjects\XamlXmlReader.cs (1)
264Debug.Assert(_current.IsEof, "Xaml Parser returned an illegal internal XamlNode");
System\Xaml\MS\Impl\XmlNsInfo.cs (1)
131Debug.Assert(Assembly is not null, "RefOnly assemblies shouldn't be GCed");
System\Xaml\Parser\NodeStreamSorter.cs (1)
672Debug.Assert(false, "Missing End Object in node sorter");
System\Xaml\Parser\XamlScanner.cs (1)
845Debug.Assert(_accumulatedText is not null, "Creating unnecessary XamlText objects");
System\Xaml\Schema\Reflector.cs (1)
379Debug.Assert((flagMask & 0xFFFF) == flagMask, "flagMask should only use lower 16 bits of int");
System\Xaml\Schema\TypeReflector.cs (11)
315Debug.Assert(_positionalParameterTypes is not null, "TryGetPositionalParameters should have been called first"); 442Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null"); 454Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null"); 468Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null"); 469Debug.Assert(_nonAttachableMemberCache is not null, "Members property should have been invoked before this"); 481Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null"); 482Debug.Assert(_nonAttachableMemberCache is not null, "Members property should have been invoked before this"); 709Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null"); 726Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null"); 987Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null"); 988Debug.Assert(_attachableMemberCache is not null, "AttachableMembers property should have been invoked before this");
System\Xaml\Schema\XamlNamespace.cs (1)
98Debug.Assert(typeArgs.Length > 0, "This method should only be called for generic types.");
System\Xaml\XamlMember.cs (2)
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");
System\Xaml\XamlType.cs (21)
202Debug.Assert(_reflector is not null, "_reflector should have been initialized by IsDictionary"); 221Debug.Assert(_reflector is not null, "_reflector should have been initialized by GetCollectionKind"); 242Debug.Assert(_reflector is not null, "_reflector should have been initialized by GetCollectionKind"); 262Debug.Assert(_reflector is not null, "_reflector should have been initialized by IsCollection"); 338Debug.Assert(_reflector is not null, "_reflector should have been initialized by IsMarkupExtension"); 524Debug.Assert(_reflector is not null, "_reflector should have been initialized by ItemType"); 598Debug.Assert(_reflector is not null, "_reflector should have been initialized by GetCollectionKind"); 825Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 862Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 956Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 970Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1031Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1209Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1223Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1234Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1281Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1325Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1344Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1424Debug.Assert(UnderlyingTypeInternal.IsSet, "EnsureReflector should have caused UnderlyingType to be initialized"); 1675Debug.Assert(GetType() != typeof(XamlType), "Default GetAllMembers logic should have already captured all writeable properties"); 1813Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable");
Templates.Blazor.Tests (1)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
334Debug.Assert(IsCommandAvailable(OpenSslCommand), "How did we trust without the openssl command?");
Templates.Blazor.WebAssembly.Auth.Tests (1)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
334Debug.Assert(IsCommandAvailable(OpenSslCommand), "How did we trust without the openssl command?");
Templates.Blazor.WebAssembly.Tests (1)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
334Debug.Assert(IsCommandAvailable(OpenSslCommand), "How did we trust without the openssl command?");
Templates.Mvc.Tests (1)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
334Debug.Assert(IsCommandAvailable(OpenSslCommand), "How did we trust without the openssl command?");
Templates.Tests (1)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
334Debug.Assert(IsCommandAvailable(OpenSslCommand), "How did we trust without the openssl command?");
UIAutomationClient (28)
MS\Internal\Automation\Accessible.cs (1)
18Debug.Assert(acc != null, "null IAccessible");
MS\Internal\Automation\CacheHelper.cs (4)
70Debug.Assert(response.RequestedData == null, "both RequestedData and TreeStructure should be null or non-null"); 100Debug.Assert(false, "Internal error: got malformed tree description string (extra chars at end)"); 106Debug.Assert(false, "Internal error: mismatch between count of property buckets and nodes claiming them"); 226Debug.Assert(false, "Internal error: Got malformed tree description string, missing closing paren");
MS\Internal\Automation\ClientEventManager.cs (1)
462Debug.Assert(false, "GetNewRootTracker internal error: Unexpected Tracker value!");
MS\Internal\Automation\FocusTracker.cs (1)
83Debug.Assert(acc != null, "HandleFocusChange got hwnd and null IAccessible");
MS\Internal\Automation\HwndProxyElementProvider.cs (4)
376Debug.Assert(false,"unexpected switch() case:"); 1419Debug.Assert(false, "too many children or inf loop?"); 1877Debug.Assert(false, "too many children or inf loop?"); 2116Debug.Assert(provider is IRawElementProviderFragment, "Expecting a fragment provider");
MS\Internal\Automation\MenuTracker.cs (1)
75Debug.Assert(handlers.Length <= 1, "handlers.Length");
MS\Internal\Automation\Misc.cs (1)
150Debug.Assert(false, "missing client-side pattern wrapper");
MS\Internal\Automation\ProxyManager.cs (1)
682Debug.Assert(false, "unexpected switch() case:");
MS\Internal\Automation\QueueProcessor.cs (3)
77Debug.Assert(!_quitting, "Can't add items to queue when quitting"); 87Debug.Assert(!_quitting, "Can't add items to queue when quitting"); 141Debug.Assert(_quitting, "MsgWaitForMultipleObjects failed while WaitForWork");
MS\Internal\Automation\Schema.cs (3)
56Debug.Assert( false, "GetPropertyInfo failed " + id ); 68Debug.Assert(false, "GetDefaultValue was passed an unknown property"); 104Debug.Assert( false, "GetAttributeInfo failed " + id );
MS\Internal\Automation\UiaCoreApi.cs (5)
241Debug.Assert(false, "unsupported property should not have made it this far"); 452Debug.Assert(offsets == null && treeStructures == null, "if nothin found, all out params shoud be null"); 644Debug.Assert(false, "Got unknown eventId from core: " + args._eventId); 662Debug.Assert(false, "Got unknown propertyId from core: " + pcargs._propertyId); 703Debug.Assert(false, "Unknown event type from core:" + args._type);
MS\Internal\Automation\WindowHideOrCloseTracker.cs (1)
89Debug.Assert(handlers.Length <= 1, "handlers.Length");
MS\Internal\Automation\WindowShowOrOpenTracker.cs (1)
86Debug.Assert(handlers.Length <= 1, "handlers.Length");
MS\Internal\Automation\WinEventWrap.cs (1)
33Debug.Assert(eventIds != null && eventIds.Length > 0, "eventIds is invalid");
UIAutomationClientSideProviders (51)
MS\Internal\AutomationProxies\Accessible.cs (5)
144Debug.Assert(acc != null, "null IAccessible"); 686Debug.Assert( false, "Need to handle Accessible.accFocus case!" ); 917System.Diagnostics.Debug.Assert(false, "Call to AccessibleChildren() returned E_INVALIDARG."); 1374Debug.Assert(false, string.Format(CultureInfo.CurrentCulture, "MsaaNativeProvider: IAccessible threw a COMException: {0}", e.Message)); 1391Debug.Assert(false, string.Format(CultureInfo.CurrentCulture, "Unexpected IAccessible exception: {0}", e));
MS\Internal\AutomationProxies\CommonGetThemePartSize.cs (1)
96System.Diagnostics.Debug.Assert (false, "Unsupport Type");
MS\Internal\AutomationProxies\MSAANativeProvider.cs (1)
52Debug.Assert(acc != null, "acc");
MS\Internal\AutomationProxies\NonClientArea.cs (1)
109System.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)
123System.Diagnostics.Debug.Assert(this is ProxyHwnd, "Invalid method called ElementProviderFromPoint"); 210System.Diagnostics.Debug.Assert(fragment != null, "DrillDownFragment: starting point is null"); 215System.Diagnostics.Debug.Assert(fromPoint != null, @"DrillDownFragment: calling ElementProviderFromPoint on Fragment should not return null");
MS\Internal\AutomationProxies\ProxySimple.cs (2)
245System.Diagnostics.Debug.Assert(_sAutomationId != null, "_sAutomationId is null!"); 444System.Diagnostics.Debug.Assert(_parent != null, "Navigate: Leaf element does not have parent");
MS\Internal\AutomationProxies\QueueProcessor.cs (1)
128Debug.Assert(false, "MsgWaitForMultipleObjects failed while WaitForWork");
MS\Internal\AutomationProxies\WindowsEditBox.cs (13)
437Debug.Assert(point.x >= 0 && point.x < 65536, "WindowsEditBox.CharFromPos() x coordinate out of range."); 438Debug.Assert(point.y >= 0 && point.y < 65536, "WindowsEditBox.CharFromPos() y coordinate out of range."); 552Debug.Assert(hfont != IntPtr.Zero, "WindowsEditBox.GetLogfont got null HFONT"); 557Debug.Assert(false, "WindowsEditBox.GetObject unexpected return value"); 678Debug.Assert(index >= 0, "WindowsEditBox.LineFromChar negative index."); 679Debug.Assert(index <= GetTextLength(), "WindowsEditBox.LineFromChar index out of range."); 740Debug.Assert(index >= 0, "WindowsEditBox.PosFromChar negative index."); 741Debug.Assert(index < GetTextLength(), "WindowsEditBox.PosFromChar index out of range."); 744Debug.Assert(result!=-1, "WindowsEditBox.PosFromChar index out of bounds."); 799Debug.Assert(start >= 0, "WindowsEditBox.SetSel negative start."); 800Debug.Assert(start <= GetTextLength(), "WindowsEditBox.SetSel start out of range."); 801Debug.Assert(end >= 0, "WindowsEditBox.SetSel negative end."); 802Debug.Assert(end <= GetTextLength(), "WindowsEditBox.SetSel end out of range.");
MS\Internal\AutomationProxies\WindowsIPAddress.cs (1)
105System.Diagnostics.Debug.Assert (index != -1, "GetOverrideProviderForHwnd: cannot find child hwnd index");
MS\Internal\AutomationProxies\WindowsListBox.cs (3)
595System.Diagnostics.Debug.Assert (IsMultipleSelection (), "Calling ClearAll on single-selected listbox"); 911System.Diagnostics.Debug.Assert (_parent is WindowsListBox, "Invalid Parent for a Listbox Item"); 1179System.Diagnostics.Debug.Assert (_listBox.IsMultipleSelection (), "Calling UnSelect on single-selected listbox");
MS\Internal\AutomationProxies\WindowsListViewGroup.cs (2)
553System.Diagnostics.Debug.Assert (!WindowsListView.IsDetailMode (hwnd), "GetColumnCountExternal: called when lv is in Detail mode"); 803System.Diagnostics.Debug.Assert (false, "GetCountOfItemsInDimension: failed to get item rect");
MS\Internal\AutomationProxies\WindowsListViewGroupHelper.cs (3)
412System.Diagnostics.Debug.Assert(false, "Cannot add item to the needed group"); 437System.Diagnostics.Debug.Assert(false, "Cannot add item to the needed group"); 801System.Diagnostics.Debug.Assert(min <= _items.Length, "EnsureCapacity: min is > _items.Length");
MS\Internal\AutomationProxies\WindowsListViewItem.cs (2)
501System.Diagnostics.Debug.Assert (parent != null, "Hit null while looking for the SelectionContainer"); 730System.Diagnostics.Debug.Assert (WindowsListView.IsGroupViewEnabled (hwnd), "GetGroupID: called when lv does not have groups");
MS\Internal\AutomationProxies\WindowsListViewItemStartMenu.cs (2)
48System.Diagnostics.Debug.Assert(false, "The listview item on the Start Menu has an unexpected IAccessible role!"); 86System.Diagnostics.Debug.Assert(AccessibleObject != null, "Failed to get a valid IAccessible!");
MS\Internal\AutomationProxies\WindowsMenu.cs (3)
116System.Diagnostics.Debug.Assert(idObject == NativeMethods.OBJID_MENU || idObject == NativeMethods.OBJID_SYSMENU, "Unexpected idObject"); 1351System.Diagnostics.Debug.Assert(false, "Cannot find back the accelerator in the menu!"); 2696System.Diagnostics.Debug.Assert (name.Length > hotKeyStart + 1, "Unexpected end of string");
MS\Internal\AutomationProxies\WindowsTab.cs (2)
1178System.Diagnostics.Debug.Assert(false, "XSendMessage.GetItem() failed!"); 1192System.Diagnostics.Debug.Assert(_parent is WindowsTab, "Invalid Parent for a Tab Item");
MS\Internal\AutomationProxies\WindowsToolbarAsMenu.cs (1)
48System.Diagnostics.Debug.Assert(false, "Unexpected role " + role);
MS\Internal\AutomationProxies\WindowsToolbarItemAsMenuItem.cs (1)
42System.Diagnostics.Debug.Assert(false, "Unexpected role " + role);
MS\Internal\AutomationProxies\WindowsTreeView.cs (1)
1059System.Diagnostics.Debug.Assert (topLevelParent is WindowsTreeView, "Invalid Parent for a TreeView Item");
MS\Internal\AutomationProxies\WinEventTracker.cs (3)
265Debug.Assert(false, "Exception raising event " + eventId + " for prop " + ecp._idProp + " on hwnd " + hwnd + "\n" + e.Message); 310Debug.Assert(false, "Exception raising event " + eventId + " for prop " + ecp._idProp + " on hwnd " + hwnd + "\n" + e.Message); 449Debug.Assert (hwnd == IntPtr.Zero, @"BuildEventsList: event is global but hwnd is not null");
UIAutomationTypes (3)
System\Windows\Automation\AutomationIdentifier.cs (3)
125Debug.Assert(obj != null, "Null obj!"); 129Debug.Assert(obj is AutomationIdentifier, "CompareTo called with unexpected type"); 169default: Debug.Assert(false, "Invalid type specified for AutomationIdentifier");
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 (6)
System\Windows\Integration\ApplicationInterop.cs (1)
145Debug.Assert(processedState == SWF.PreProcessControlState.MessageNotNeeded, "invalid state");
System\Windows\Integration\ElementHost.cs (2)
1587Debug.Assert(request != null, "request was null!"); 1606Debug.Assert(false, "Unknown FocusNavigationDirection");
System\Windows\Integration\WindowsFormsHost.cs (3)
870Debug.Assert(false, "Unknown FocusNavigationDirection"); 968Debug.Assert(uiAction == NativeMethods.UIS_INITIALIZE || uiAction == NativeMethods.UIS_SET, "Unexpected uiAction"); 1095Debug.Assert(methodInfo != null, "Couldn't find OnParentRightToLeftChanged method!");