19894 references to Assert
ClientSample (3)
Tcp\SocketAwaitable.cs (1)
36Debug.Assert(ReferenceEquals(_callback, _callbackCompleted));
Tcp\SocketSender.cs (2)
82Debug.Assert(!buffer.IsEmpty); 83Debug.Assert(!buffer.IsSingleSegment);
CodeGenerator (6)
src\Servers\Kestrel\shared\KnownHeaders.cs (4)
773Debug.Assert(requestHeaders.Length <= 64); 774Debug.Assert(requestHeaders.Max(x => x.Index) <= 62); 778Debug.Assert(responseHeaders.Length <= 63); 779Debug.Assert(responseHeaders.Count(x => x.Index == 63) == 1);
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http3\QPack\HeaderField.cs (1)
17Debug.Assert(name.Length > 0);
dotnet-dev-certs (1)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
574Debug.Assert(pemEnvelope != null);
GetDocument.Insider (1)
.packages\microsoft.extensions.hostfactoryresolver.sources\9.0.0-preview.5.24265.2\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
293Debug.Assert(_hostTcs.Task.IsCompleted);
http2cat (35)
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
95Debug.Assert(indexLength >= 1); 127Debug.Assert(indexLength >= 1); 159Debug.Assert(indexLength >= 1); 197Debug.Assert(indexLength >= 1); 369Debug.Assert(Ascii.IsValid(value)); 376Debug.Assert(integerLength >= 1); 382Debug.Assert(status == OperationStatus.Done); 383Debug.Assert(valueBytesWritten == value.Length); 397Debug.Assert(destination.Length >= value.Length); 406Debug.Assert(status == OperationStatus.Done); 407Debug.Assert(bytesWritten == value.Length); 426Debug.Assert(integerLength >= 1); 470Debug.Assert(integerLength >= 1); 481Debug.Assert(written == encodedStringLength); 528Debug.Assert(separator != null); 529Debug.Assert(Ascii.IsValid(separator)); 551Debug.Assert(integerLength >= 1);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8);
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
246Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\StringUtilities.cs (8)
121Debug.Assert(input != null); 122Debug.Assert(output != null); 126Debug.Assert((long)end >= Vector256<sbyte>.Count); 311Debug.Assert(input != null); 312Debug.Assert(output != null); 417Debug.Assert(IsValidHeaderString(previousValue)); 564Debug.Assert(Avx2.IsSupported); 573Debug.Assert(Sse2.IsSupported);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
IIS.FunctionalTests (35)
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
95Debug.Assert(indexLength >= 1); 127Debug.Assert(indexLength >= 1); 159Debug.Assert(indexLength >= 1); 197Debug.Assert(indexLength >= 1); 369Debug.Assert(Ascii.IsValid(value)); 376Debug.Assert(integerLength >= 1); 382Debug.Assert(status == OperationStatus.Done); 383Debug.Assert(valueBytesWritten == value.Length); 397Debug.Assert(destination.Length >= value.Length); 406Debug.Assert(status == OperationStatus.Done); 407Debug.Assert(bytesWritten == value.Length); 426Debug.Assert(integerLength >= 1); 470Debug.Assert(integerLength >= 1); 481Debug.Assert(written == encodedStringLength); 528Debug.Assert(separator != null); 529Debug.Assert(Ascii.IsValid(separator)); 551Debug.Assert(integerLength >= 1);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8);
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
246Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\StringUtilities.cs (8)
121Debug.Assert(input != null); 122Debug.Assert(output != null); 126Debug.Assert((long)end >= Vector256<sbyte>.Count); 311Debug.Assert(input != null); 312Debug.Assert(output != null); 417Debug.Assert(IsValidHeaderString(previousValue)); 564Debug.Assert(Avx2.IsSupported); 573Debug.Assert(Sse2.IsSupported);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
IIS.LongTests (35)
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
95Debug.Assert(indexLength >= 1); 127Debug.Assert(indexLength >= 1); 159Debug.Assert(indexLength >= 1); 197Debug.Assert(indexLength >= 1); 369Debug.Assert(Ascii.IsValid(value)); 376Debug.Assert(integerLength >= 1); 382Debug.Assert(status == OperationStatus.Done); 383Debug.Assert(valueBytesWritten == value.Length); 397Debug.Assert(destination.Length >= value.Length); 406Debug.Assert(status == OperationStatus.Done); 407Debug.Assert(bytesWritten == value.Length); 426Debug.Assert(integerLength >= 1); 470Debug.Assert(integerLength >= 1); 481Debug.Assert(written == encodedStringLength); 528Debug.Assert(separator != null); 529Debug.Assert(Ascii.IsValid(separator)); 551Debug.Assert(integerLength >= 1);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8);
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
246Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\StringUtilities.cs (8)
121Debug.Assert(input != null); 122Debug.Assert(output != null); 126Debug.Assert((long)end >= Vector256<sbyte>.Count); 311Debug.Assert(input != null); 312Debug.Assert(output != null); 417Debug.Assert(IsValidHeaderString(previousValue)); 564Debug.Assert(Avx2.IsSupported); 573Debug.Assert(Sse2.IsSupported);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
IIS.NewHandler.FunctionalTests (35)
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
95Debug.Assert(indexLength >= 1); 127Debug.Assert(indexLength >= 1); 159Debug.Assert(indexLength >= 1); 197Debug.Assert(indexLength >= 1); 369Debug.Assert(Ascii.IsValid(value)); 376Debug.Assert(integerLength >= 1); 382Debug.Assert(status == OperationStatus.Done); 383Debug.Assert(valueBytesWritten == value.Length); 397Debug.Assert(destination.Length >= value.Length); 406Debug.Assert(status == OperationStatus.Done); 407Debug.Assert(bytesWritten == value.Length); 426Debug.Assert(integerLength >= 1); 470Debug.Assert(integerLength >= 1); 481Debug.Assert(written == encodedStringLength); 528Debug.Assert(separator != null); 529Debug.Assert(Ascii.IsValid(separator)); 551Debug.Assert(integerLength >= 1);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8);
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
246Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\StringUtilities.cs (8)
121Debug.Assert(input != null); 122Debug.Assert(output != null); 126Debug.Assert((long)end >= Vector256<sbyte>.Count); 311Debug.Assert(input != null); 312Debug.Assert(output != null); 417Debug.Assert(IsValidHeaderString(previousValue)); 564Debug.Assert(Avx2.IsSupported); 573Debug.Assert(Sse2.IsSupported);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
IIS.NewShim.FunctionalTests (35)
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
95Debug.Assert(indexLength >= 1); 127Debug.Assert(indexLength >= 1); 159Debug.Assert(indexLength >= 1); 197Debug.Assert(indexLength >= 1); 369Debug.Assert(Ascii.IsValid(value)); 376Debug.Assert(integerLength >= 1); 382Debug.Assert(status == OperationStatus.Done); 383Debug.Assert(valueBytesWritten == value.Length); 397Debug.Assert(destination.Length >= value.Length); 406Debug.Assert(status == OperationStatus.Done); 407Debug.Assert(bytesWritten == value.Length); 426Debug.Assert(integerLength >= 1); 470Debug.Assert(integerLength >= 1); 481Debug.Assert(written == encodedStringLength); 528Debug.Assert(separator != null); 529Debug.Assert(Ascii.IsValid(separator)); 551Debug.Assert(integerLength >= 1);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8);
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
246Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\StringUtilities.cs (8)
121Debug.Assert(input != null); 122Debug.Assert(output != null); 126Debug.Assert((long)end >= Vector256<sbyte>.Count); 311Debug.Assert(input != null); 312Debug.Assert(output != null); 417Debug.Assert(IsValidHeaderString(previousValue)); 564Debug.Assert(Avx2.IsSupported); 573Debug.Assert(Sse2.IsSupported);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
IIS.ShadowCopy.Tests (12)
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
246Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\StringUtilities.cs (8)
121Debug.Assert(input != null); 122Debug.Assert(output != null); 126Debug.Assert((long)end >= Vector256<sbyte>.Count); 311Debug.Assert(input != null); 312Debug.Assert(output != null); 417Debug.Assert(IsValidHeaderString(previousValue)); 564Debug.Assert(Avx2.IsSupported); 573Debug.Assert(Sse2.IsSupported);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
IISExpress.FunctionalTests (35)
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
95Debug.Assert(indexLength >= 1); 127Debug.Assert(indexLength >= 1); 159Debug.Assert(indexLength >= 1); 197Debug.Assert(indexLength >= 1); 369Debug.Assert(Ascii.IsValid(value)); 376Debug.Assert(integerLength >= 1); 382Debug.Assert(status == OperationStatus.Done); 383Debug.Assert(valueBytesWritten == value.Length); 397Debug.Assert(destination.Length >= value.Length); 406Debug.Assert(status == OperationStatus.Done); 407Debug.Assert(bytesWritten == value.Length); 426Debug.Assert(integerLength >= 1); 470Debug.Assert(integerLength >= 1); 481Debug.Assert(written == encodedStringLength); 528Debug.Assert(separator != null); 529Debug.Assert(Ascii.IsValid(separator)); 551Debug.Assert(integerLength >= 1);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8);
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
246Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\StringUtilities.cs (8)
121Debug.Assert(input != null); 122Debug.Assert(output != null); 126Debug.Assert((long)end >= Vector256<sbyte>.Count); 311Debug.Assert(input != null); 312Debug.Assert(output != null); 417Debug.Assert(IsValidHeaderString(previousValue)); 564Debug.Assert(Avx2.IsSupported); 573Debug.Assert(Sse2.IsSupported);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
ILCompiler.DependencyAnalysisFramework (15)
ComputedStaticDependencyNode.cs (3)
18Debug.Assert(_dependencies == null); 19Debug.Assert(_conditionalDependencies == null); 20Debug.Assert(dependencies != null);
DependencyAnalyzer.cs (2)
245Debug.Assert(currentNode.Marked); 319Debug.Assert(node.StaticDependenciesAreComputed);
DependencyNode.cs (2)
18Debug.Assert(mark != null); 19Debug.Assert(_mark == null);
DgmlWriter.cs (1)
114Debug.Assert(!_nodeMappings.ContainsKey(node));
FirstMarkLogStrategy.cs (3)
50Debug.Assert(reason != null); 101Debug.Assert(markData.Reason1 != null); 110Debug.Assert(markData.Reason != null);
FullGraphLogStrategy.cs (3)
121Debug.Assert(reason != null); 175Debug.Assert(markData.Reason1 != null); 184Debug.Assert(markData.Reason != null);
src\coreclr\tools\Common\Sorting\ICompareAsEqualAction.cs (1)
17Debug.Assert(false);
illink (191)
ILLink.RoslynAnalyzer (72)
DataFlow\ControlFlowGraphExtensions.cs (2)
18 Debug.Assert (firstBlock.Kind == BasicBlockKind.Entry); 25 Debug.Assert (lastBlock.Kind == BasicBlockKind.Exit);
DataFlow\ControlFlowGraphProxy.cs (2)
65 Debug.Assert (region != null); 146 Debug.Assert (enclosingRegion.Kind == ControlFlowRegionKind.TryAndCatch);
DataFlow\InterproceduralState.cs (1)
54 Debug.Assert (!Methods.IsUnknown ());
DataFlow\LocalDataFlowAnalysis.cs (2)
74 Debug.Assert (Context.OwningSymbol is not IMethodSymbol methodSymbol || 82 Debug.Assert (!oldInterproceduralState.Methods.IsUnknown ());
DataFlow\LocalDataFlowVisitor.cs (17)
176 Debug.Assert (assemblyType != null); 180 Debug.Assert (method != null); 343 Debug.Assert (operation.Target is not IFlowCaptureReferenceOperation); 397 Debug.Assert (IsLValueFlowCapture (flowCaptureReference.Id)); 398 Debug.Assert (flowCaptureReference.GetValueUsageInfo (OwningSymbol).HasFlag (ValueUsageInfo.Write)); 400 Debug.Assert (!capturedReferences.IsUnknown ()); 436 Debug.Assert (addMethod != null); 442 Debug.Assert (removeMethod != null); 509 Debug.Assert (operation.Value is not IFlowCaptureReferenceOperation); 529 Debug.Assert (!capturedReferences.IsUnknown ()); 574 Debug.Assert (localFunction.MethodKind == MethodKind.LocalFunction); 624 Debug.Assert (operation.GetValueUsageInfo (OwningSymbol).HasFlag (ValueUsageInfo.Read)); 638 Debug.Assert (operation.GetValueUsageInfo (OwningSymbol).HasFlag (ValueUsageInfo.Reference)); 672 Debug.Assert (operation.GetValueUsageInfo (OwningSymbol).HasFlag (ValueUsageInfo.Read)); 715 Debug.Assert (operation.Symbol.ContainingSymbol is IMethodSymbol or IFieldSymbol); 717 Debug.Assert (lambda.MethodKind == MethodKind.LambdaMethod); 824 Debug.Assert (localFunction.MethodKind == MethodKind.LocalFunction);
DataFlow\MethodBodyValue.cs (2)
23 Debug.Assert (owningSymbol is (IMethodSymbol or IFieldSymbol or IPropertySymbol)); 33 Debug.Assert (ControlFlowGraph == other.ControlFlowGraph);
DynamicallyAccessedMembersAnalyzer.cs (1)
67 Debug.Assert ((int) first < (int) last);
IOperationExtensions.cs (1)
116 Debug.Assert (parenthesizedOperation.Language == LanguageNames.VisualBasic);
src\tools\illink\src\ILLink.Shared\Annotations.cs (1)
54 Debug.Assert (memberTypes != DynamicallyAccessedMemberTypes.None);
src\tools\illink\src\ILLink.Shared\DataFlow\ForwardDataFlowAnalysis.cs (9)
69 Debug.Assert (entryOut != null); 70 Debug.Assert (cfg.GetConditionalSuccessor (cfg.Entry) == null); 315 Debug.Assert (isPredecessorInFinally); 377 Debug.Assert (result); 388 Debug.Assert (exceptionState != null); 389 Debug.Assert (oldExceptionState != null); 395 Debug.Assert (enclosingTryOrCatch.Kind != RegionKind.Filter); 423 Debug.Assert (cfg.GetConditionalSuccessor (lastFinallyBlock) == null); 425 Debug.Assert (finallyExit != null);
src\tools\illink\src\ILLink.Shared\DataFlow\ValueSet.cs (4)
180 Debug.Assert (other._values == UnknownSentinel); 189 Debug.Assert (other._values == UnknownSentinel); 193 Debug.Assert (_values == UnknownSentinel); 223 Debug.Assert (_values == UnknownSentinel);
src\tools\illink\src\ILLink.Shared\TrimAnalysis\HandleCallAction.cs (3)
86 Debug.Assert (requiresDataFlowAnalysis || annotatedMethodReturnValue.DynamicallyAccessedMemberTypes == DynamicallyAccessedMemberTypes.None); 90 Debug.Assert (instanceValue.IsEmpty ()); 91 Debug.Assert (argumentValues.Count == 1);
src\tools\illink\src\ILLink.Shared\TrimAnalysis\NullableSystemTypeValue.cs (1)
21 Debug.Assert (nullableType.IsTypeOf (WellKnownType.System_Nullable_T));
src\tools\illink\src\ILLink.Shared\TrimAnalysis\NullableValueWithDynamicallyAccessedMembers.cs (1)
23 Debug.Assert (nullableType.IsTypeOf (WellKnownType.System_Nullable_T));
src\tools\illink\src\ILLink.Shared\TrimAnalysis\RuntimeTypeHandleForNullableSystemTypeValue.cs (1)
21 Debug.Assert (nullableType.IsTypeOf (WellKnownType.System_Nullable_T));
src\tools\illink\src\ILLink.Shared\TrimAnalysis\RuntimeTypeHandleForNullableValueWithDynamicallyAccessedMembers.cs (1)
21 Debug.Assert (nullableType.IsTypeOf (WellKnownType.System_Nullable_T));
TrimAnalysis\ArrayValue.cs (1)
77 System.Diagnostics.Debug.Assert (v is not ArrayValue);
TrimAnalysis\DiagnosticContext.cs (1)
57 Debug.Assert (Location != null);
TrimAnalysis\FlowAnnotations.cs (3)
48 Debug.Assert (parameterMethod != null); 58 Debug.Assert (property != null); 74 Debug.Assert (property != null);
TrimAnalysis\HandleCallAction.cs (1)
221 Debug.Assert (property != null);
TrimAnalysis\TrimAnalysisAssignmentPattern.cs (2)
45 Debug.Assert (Operation == other.Operation); 46 Debug.Assert (SymbolEqualityComparer.Default.Equals (OwningSymbol, other.OwningSymbol));
TrimAnalysis\TrimAnalysisFieldAccessPattern.cs (3)
38 Debug.Assert (SymbolEqualityComparer.Default.Equals (Field, other.Field)); 39 Debug.Assert (Operation == other.Operation); 40 Debug.Assert (SymbolEqualityComparer.Default.Equals (OwningSymbol, other.OwningSymbol));
TrimAnalysis\TrimAnalysisGenericInstantiationPattern.cs (3)
35 Debug.Assert (Operation == other.Operation); 36 Debug.Assert (SymbolEqualityComparer.Default.Equals (GenericInstantiation, other.GenericInstantiation)); 37 Debug.Assert (SymbolEqualityComparer.Default.Equals (OwningSymbol, other.OwningSymbol));
TrimAnalysis\TrimAnalysisMethodCallPattern.cs (4)
56 Debug.Assert (Operation == other.Operation); 57 Debug.Assert (SymbolEqualityComparer.Default.Equals (CalledMethod, other.CalledMethod)); 58 Debug.Assert (SymbolEqualityComparer.Default.Equals (OwningSymbol, other.OwningSymbol)); 59 Debug.Assert (Arguments.Length == other.Arguments.Length);
TrimAnalysis\TrimAnalysisReflectionAccessPattern.cs (3)
37 Debug.Assert (SymbolEqualityComparer.Default.Equals (ReferencedMethod, other.ReferencedMethod)); 38 Debug.Assert (Operation == other.Operation); 39 Debug.Assert (SymbolEqualityComparer.Default.Equals (OwningSymbol, other.OwningSymbol));
TrimAnalysis\TrimAnalysisVisitor.cs (2)
345 Debug.Assert (OwningSymbol is IMethodSymbol); 362 Debug.Assert (OwningSymbol is IMethodSymbol);
InMemory.FunctionalTests (10)
Http2\Http2TestBase.cs (2)
430Debug.Assert(index <= H2StaticTable.Count); 438Debug.Assert(index <= H2StaticTable.Count);
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (1)
294Debug.Assert(success);
src\Servers\Kestrel\shared\test\RevocationResponder.cs (1)
314System.Diagnostics.Debug.Assert(read == requestBytes.Length);
src\Servers\Kestrel\shared\TransportConnection.cs (1)
72Debug.Assert(Application != null);
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
204Debug.Assert(_memoryHandle.HasValue);
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
IntegrationTestsWebsite (1)
Infrastructure\DynamicServiceModelProvider.cs (1)
15Debug.Assert(CreateMethod != null);
KeyManagementSimulator (3)
Program.cs (3)
402Debug.Assert(now >= _now); 485Debug.Assert(pFail >= 0); 486Debug.Assert(pFail <= 1); // Allow 100% failure rate
Microsoft.Arcade.Test.Common (2)
DiffUtil.cs (2)
198Debug.Assert(lengthA >= 0 && lengthB >= 0); 212Debug.Assert(lcsLength <= max);
Microsoft.AspNetCore (3)
BootstrapHostBuilder.cs (1)
111Debug.Assert(descriptor.ImplementationType?.Name == "GenericWebHostService");
WebApplicationBuilder.cs (2)
391Debug.Assert(_builtApplication is not null); 495Debug.Assert(_builtApplication is not null);
Microsoft.AspNetCore.Analyzer.Testing (1)
DiagnosticVerifier.cs (1)
144Debug.Assert(sources.Length == documents.Length);
Microsoft.AspNetCore.Analyzers (3)
BuildServiceProviderAnalyzer.cs (1)
21Debug.Assert(context.Symbol.Kind == SymbolKind.NamedType);
UseAuthorizationAnalyzer.cs (1)
22Debug.Assert(context.Symbol.Kind == SymbolKind.NamedType);
UseMvcAnalyzer.cs (1)
21Debug.Assert(context.Symbol.Kind == SymbolKind.NamedType);
Microsoft.AspNetCore.Antiforgery (14)
Internal\BinaryBlob.cs (2)
73Debug.Assert(_data.Length == other._data.Length); 86Debug.Assert(_data != null && _data.Length >= (32 / 8));
Internal\DefaultAntiforgery.cs (7)
54Debug.Assert(antiforgeryFeature.NewCookieTokenString != null); 184Debug.Assert(!string.IsNullOrEmpty(antiforgeryTokenSet.CookieToken)); 185Debug.Assert(!string.IsNullOrEmpty(antiforgeryTokenSet.RequestToken)); 284Debug.Assert(antiforgeryFeature.HaveDeserializedCookieToken); 313Debug.Assert(_tokenGenerator.IsCookieTokenValid(newCookieToken)); 407Debug.Assert(antiforgeryFeature.HaveGeneratedNewCookieToken); 408Debug.Assert(antiforgeryFeature.NewRequestToken != null);
Internal\DefaultAntiforgeryTokenStore.cs (4)
24Debug.Assert(httpContext != null); 38Debug.Assert(httpContext != null); 81Debug.Assert(httpContext != null); 82Debug.Assert(token != null);
Internal\DefaultClaimUidExtractor.cs (1)
26Debug.Assert(claimsPrincipal != null);
Microsoft.AspNetCore.App.Analyzers (60)
Infrastructure\EmbeddedSyntax\EmbeddedSeparatedSyntaxNodeList.cs (4)
26Debug.Assert(!nodesAndTokens.IsDefault); 44Debug.Assert(NodesAndTokens[i].IsNode); 45Debug.Assert(NodesAndTokens[i].Node is EmbeddedSyntaxNode<TSyntaxKind, TSyntaxNode>); 50Debug.Assert(!NodesAndTokens[i].IsNode);
Infrastructure\EmbeddedSyntax\EmbeddedSyntaxNode.cs (1)
25Debug.Assert((int)(object)kind != 0);
Infrastructure\EmbeddedSyntax\EmbeddedSyntaxNodeOrToken.cs (2)
25Debug.Assert((int)(object)token.Kind != 0); 33Debug.Assert(Node == null);
Infrastructure\EmbeddedSyntax\EmbeddedSyntaxToken.cs (1)
30Debug.Assert(!diagnostics.IsDefault);
Infrastructure\EmbeddedSyntax\EmbeddedSyntaxTrivia.cs (1)
27Debug.Assert(virtualChars.Length > 0);
Infrastructure\RoutePattern\RoutePatternNodes.cs (20)
19Debug.Assert(parts != null); 20Debug.Assert(endOfFileToken.Kind == RoutePatternKind.EndOfFile); 72Debug.Assert(openBracketToken.Kind == RoutePatternKind.OpenBracketToken); 73Debug.Assert(textToken.Kind == RoutePatternKind.ReplacementToken); 74Debug.Assert(closeBracketToken.Kind == RoutePatternKind.CloseBracketToken); 108Debug.Assert(openBraceToken.Kind == RoutePatternKind.OpenBraceToken); 109Debug.Assert(closeBraceToken.Kind == RoutePatternKind.CloseBraceToken); 146Debug.Assert(literalToken.Kind == RoutePatternKind.Literal); 170Debug.Assert(separatorToken.Kind == RoutePatternKind.DotToken); 194Debug.Assert(separatorToken.Kind == RoutePatternKind.SlashToken); 218Debug.Assert(asteriskToken.Kind == RoutePatternKind.AsteriskToken); 242Debug.Assert(questionMarkToken.Kind == RoutePatternKind.QuestionMarkToken); 266Debug.Assert(equalsToken.Kind == RoutePatternKind.EqualsToken); 267Debug.Assert(defaultValueToken.Kind == RoutePatternKind.DefaultValueToken); 294Debug.Assert(parameterNameToken.Kind == RoutePatternKind.ParameterNameToken); 318Debug.Assert(colonToken.Kind == RoutePatternKind.ColonToken); 345Debug.Assert(openParenToken.Kind == RoutePatternKind.OpenParenToken); 346Debug.Assert(argumentToken.Kind == RoutePatternKind.PolicyFragmentToken); 347Debug.Assert(closeParenToken.Kind == RoutePatternKind.CloseParenToken); 377Debug.Assert(argumentToken.Kind == RoutePatternKind.PolicyFragmentToken);
Infrastructure\RoutePattern\RoutePatternParser.cs (3)
65Debug.Assert(_lexer.Position == _lexer.Text.Length); 66Debug.Assert(_currentToken.Kind == RoutePatternKind.EndOfFile); 439Debug.Assert(_routePatternOptions.SupportTokenReplacement);
Infrastructure\VirtualChars\AbstractVirtualCharService.cs (5)
76Debug.Assert(expectedValueText == actualValueText); 132Debug.Assert(!token.ContainsDiagnostics); 136Debug.Assert(startDelimiter == ""); 137Debug.Assert(endDelimiter == ""); 218Debug.Assert(char.IsSurrogate(ch));
Infrastructure\VirtualChars\CSharpVirtualCharService.cs (9)
58Debug.Assert(!token.ContainsDiagnostics); 341Debug.Assert(char.IsSurrogate(ch)); 351Debug.Assert(tokenText[index] == '\\'); 364Debug.Assert(tokenText[index] == '\\'); 397Debug.Assert(tokenText[index] == '\\'); 416Debug.Assert(tokenText[index] == '\\'); 461Debug.Assert(uintChar is > 0x0000FFFF and <= 0x0010FFFF); 501Debug.Assert(character == 'x'); 533Debug.Assert(IsHexDigit(c));
Infrastructure\VirtualChars\VirtualCharSequence.Chunks.cs (2)
72Debug.Assert(index >= 0); 150Debug.Assert(index + 1 >= _underlyingData.Length ||
Infrastructure\VirtualChars\VirtualCharSequence.cs (3)
214Debug.Assert(_leafCharacters == virtualChars._leafCharacters); 215Debug.Assert(_span.End == virtualChars._span.Start); 226Debug.Assert(chars1._leafCharacters == chars2._leafCharacters);
Mvc\DetectAmbiguousActionRoutes.cs (1)
110Debug.Assert(!httpMethods.IsDefault);
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (1)
549Debug.Assert(token.IsKind(SyntaxKind.StringLiteralToken));
RouteEmbeddedLanguage\RoutePatternCompletionProvider.cs (1)
401Debug.Assert(token.IsKind(SyntaxKind.StringLiteralToken));
RouteHandlers\DetectAmbiguousRoutes.cs (1)
153Debug.Assert(!httpMethods.IsDefault);
src\Shared\Diagnostics\AnalyzerDebug.cs (2)
12/// <inheritdoc cref="Debug.Assert(bool)"/> 14public static void Assert([DoesNotReturnIf(false)] bool b) => Debug.Assert(b);
src\Shared\Roslyn\CodeAnalysisExtensions.cs (3)
34Debug.Assert(methodSymbol != null); 159Debug.Assert(method.PartialImplementationPart == null && !SymbolEqualityComparer.Default.Equals(method.PartialDefinitionPart, method)); 165Debug.Assert(!SymbolEqualityComparer.Default.Equals(method.PartialImplementationPart, method));
Microsoft.AspNetCore.Authentication (1)
RemoteAuthenticationHandler.cs (1)
145Debug.Assert(ticket != null);
Microsoft.AspNetCore.Authentication.Cookies (1)
CookieAuthenticationHandler.cs (1)
212Debug.Assert(result.Ticket != null);
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (1)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
47Debug.Assert(tfms.Length > 0);
Microsoft.AspNetCore.Authentication.Negotiate (3)
Internal\LdapAdapter.cs (1)
47Debug.Assert(settings.LdapConnection != null);
NegotiateHandler.cs (1)
140Debug.Assert(exception != null);
PostConfigureNegotiateOptions.cs (1)
49Debug.Assert(_serverAuth.AuthenticationScheme != null);
Microsoft.AspNetCore.Components (41)
Rendering\RenderTreeBuilder.cs (1)
790Debug.Assert(_hasSeenAddMultipleAttributes);
RenderTree\Renderer.cs (2)
282Debug.Assert(_pendingTasks == null); 339Debug.Assert(_pendingTasks is null || _pendingTasks.Count == 0);
Routing\SupplyParameterFromQueryValueProvider.cs (3)
54Debug.Assert(_subscribers is not null); 96Debug.Assert(url is not null); 126Debug.Assert(_subscribers is not null);
src\Components\Shared\src\ArrayBuilder.cs (1)
180Debug.Assert(newCapacity > _items.Length);
src\Http\Http.Abstractions\src\Routing\RouteValueDictionary.cs (1)
491Debug.Assert(_arrayStorage != null);
src\Http\Routing\src\Constraints\RegexRouteConstraint.cs (1)
68Debug.Assert(_regexFactory is not null);
src\Http\Routing\src\ParameterPolicyActivator.cs (1)
161Debug.Assert(constructors.Count > 0);
src\Http\Routing\src\PathTokenizer.cs (3)
47Debug.Assert(_path[0] == '/'); 97Debug.Assert(_path[_path.Length - 1] != '/'); 98Debug.Assert(currentSegmentIndex == index);
src\Http\Routing\src\Patterns\RoutePattern.cs (5)
48Debug.Assert(defaults != null); 49Debug.Assert(parameterPolicies != null); 50Debug.Assert(parameters != null); 51Debug.Assert(requiredValues != null); 52Debug.Assert(pathSegments != null);
src\Http\Routing\src\Patterns\RoutePatternLiteralPart.cs (1)
22Debug.Assert(!string.IsNullOrEmpty(content));
src\Http\Routing\src\Patterns\RoutePatternMatcher.cs (8)
111Debug.Assert(pathSegment != null); 168Debug.Assert(pathSegment != null); 169Debug.Assert(pathSegment.IsSimple); 172Debug.Assert(part.IsParameter); 240Debug.Assert(!pathSegment.IsSimple); 338Debug.Assert(routeSegment != null); 339Debug.Assert(routeSegment.Parts.Count > 1); 361Debug.Assert(part.IsLiteral || part.IsSeparator);
src\Http\Routing\src\Patterns\RoutePatternParser.cs (8)
51Debug.Assert(context.AtEnd() || context.Current == Separator); 73Debug.Assert(context != null); 74Debug.Assert(segments != null); 145Debug.Assert(context.Current == OpenBrace); 445Debug.Assert(context != null); 446Debug.Assert(literal != null); 485Debug.Assert(template != null); 526Debug.Assert(_index >= 0);
src\Http\Routing\src\Patterns\RoutePatternSeparatorPart.cs (1)
39Debug.Assert(!string.IsNullOrEmpty(content));
src\Http\Routing\src\Template\RoutePrecedence.cs (3)
69Debug.Assert(digit >= 0 && digit < 10); 125Debug.Assert(digit >= 0 && digit < 10); 191Debug.Assert(parameterPart != null);
src\Http\Routing\src\Tree\TreeEnumerator.cs (1)
94Debug.Assert(next.Depth < _tokenizer.Count);
src\Http\Routing\src\Tree\UrlMatchingTree.cs (1)
98Debug.Assert(segment.Parts.Count == 1);
Microsoft.AspNetCore.Components.Endpoints (29)
Builder\RazorComponentEndpointDataSource.cs (4)
78Debug.Assert(_changeToken != null); 79Debug.Assert(_endpoints != null); 168Debug.Assert(_changeToken != null); 169Debug.Assert(_endpoints != null);
FormMapping\Factories\NullableConverterFactory.cs (3)
26Debug.Assert(underlyingType != null); 29Debug.Assert(underlyingConverter != null); 32Debug.Assert(expectedConverterType != null);
FormMapping\FormDataReader.cs (3)
202Debug.Assert(_currentDepth >= 0); 206Debug.Assert(_currentPrefixBuffer.Length >= keyLength); 235Debug.Assert(_prefixBuffer.Length >= (_currentPrefixBuffer.Length + separator.Length));
FormMapping\HttpContextFormValueMapper.cs (1)
88Debug.Assert(deserializer != null);
src\Shared\PropertyHelper\PropertyHelper.cs (18)
161Debug.Assert(propertyInfo != null); 181Debug.Assert(propertyInfo != null); 195Debug.Assert(propertyInfo != null); 198Debug.Assert(propertyGetterWrapperMethod != null); 199Debug.Assert(propertyGetterWrapperMethod.IsGenericMethodDefinition); 200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 203Debug.Assert(propertyGetterByRefWrapperMethod != null); 204Debug.Assert(propertyGetterByRefWrapperMethod.IsGenericMethodDefinition); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 208Debug.Assert(getMethod != null); 209Debug.Assert(!getMethod.IsStatic); 210Debug.Assert(getMethod.GetParameters().Length == 0); 277Debug.Assert(propertyInfo != null); 278Debug.Assert(!propertyInfo.DeclaringType!.IsValueType); 281Debug.Assert(setMethod != null); 282Debug.Assert(!setMethod.IsStatic); 283Debug.Assert(setMethod.ReturnType == typeof(void)); 285Debug.Assert(parameters.Length == 1);
Microsoft.AspNetCore.Components.Server (10)
src\Components\Shared\src\ArrayBuilder.cs (1)
180Debug.Assert(newCapacity > _items.Length);
src\Shared\PooledArrayBufferWriter.cs (6)
80Debug.Assert(_rentedBuffer != null); 144Debug.Assert(_rentedBuffer != null); 165Debug.Assert(oldBuffer.Length >= _index); 166Debug.Assert(_rentedBuffer.Length >= _index); 174Debug.Assert(_rentedBuffer.Length - _index > 0); 175Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (1)
376Debug.Assert(written == prefixLength);
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
Microsoft.AspNetCore.Components.Web (10)
Forms\EditForm.cs (2)
133Debug.Assert(_editContext != null); 194Debug.Assert(_editContext != null);
Forms\InputDate.cs (1)
114Debug.Assert(result != null);
Forms\InputRadio.cs (1)
63Debug.Assert(Context != null);
Forms\InputRadioGroup.cs (1)
71Debug.Assert(_context != null);
Forms\Mapping\SupplyParameterFromFormValueProvider.cs (1)
74Debug.Assert(mappingContext != null);
HtmlRendering\StaticHtmlRenderer.HtmlWriting.cs (2)
162Debug.Assert(afterElement == position + frame.ElementSubtreeLength); 177Debug.Assert(afterAttributes == position + frame.ElementSubtreeLength);
Routing\NavLink.cs (1)
132Debug.Assert(_hrefAbsolute != null);
Virtualization\Virtualize.cs (1)
170Debug.Assert(refreshTask.IsCompletedSuccessfully);
Microsoft.AspNetCore.Components.WebView (1)
src\Components\Shared\src\ArrayBuilder.cs (1)
180Debug.Assert(newCapacity > _items.Length);
Microsoft.AspNetCore.CookiePolicy (1)
ResponseCookiesWrapper.cs (1)
98Debug.Assert(key != null);
Microsoft.AspNetCore.Cryptography.Internal (4)
SafeHandles\BCryptAlgorithmHandle.cs (1)
45Debug.Assert(pbKey != null);
WeakReferenceHelpers.cs (3)
38Debug.Assert(newTarget != null); 41Debug.Assert(newWeakRef != null); 53Debug.Assert(currentWeakRef != null);
Microsoft.AspNetCore.Cryptography.KeyDerivation (17)
PBKDF2\ManagedPbkdf2Provider.cs (5)
19Debug.Assert(password != null); 20Debug.Assert(salt != null); 21Debug.Assert(iterationCount > 0); 22Debug.Assert(numBytesRequested > 0); 96Debug.Assert(src.Length == dest.Length);
PBKDF2\NetCorePbkdf2Provider.cs (4)
19Debug.Assert(password != null); 20Debug.Assert(salt != null); 21Debug.Assert(iterationCount > 0); 22Debug.Assert(numBytesRequested > 0);
PBKDF2\Win7Pbkdf2Provider.cs (4)
18Debug.Assert(password != null); 19Debug.Assert(salt != null); 20Debug.Assert(iterationCount > 0); 21Debug.Assert(numBytesRequested > 0);
PBKDF2\Win8Pbkdf2Provider.cs (4)
20Debug.Assert(password != null); 21Debug.Assert(salt != null); 22Debug.Assert(iterationCount > 0); 23Debug.Assert(numBytesRequested > 0);
Microsoft.AspNetCore.DataProtection (40)
AuthenticatedEncryption\AuthenticatedEncryptorFactory.cs (1)
82Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
AuthenticatedEncryption\CngCbcAuthenticatedEncryptorFactory.cs (1)
43Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
AuthenticatedEncryption\CngGcmAuthenticatedEncryptorFactory.cs (1)
44Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
Cng\DpapiSecretSerializerHelper.cs (9)
45Debug.Assert(secret != null); 120Debug.Assert(secret != null); 121Debug.Assert(protectionDescriptorHandle != null); 146Debug.Assert(protectionDescriptorHandle != null); 147Debug.Assert(pbData != null); 198Debug.Assert(protectedSecret != null); 261Debug.Assert(protectedData != null); 274Debug.Assert(pbData != null); 322Debug.Assert(protectedData != null);
DataProtectionServiceCollectionExtensions.cs (1)
64Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
EphemeralDataProtectionProvider.cs (2)
50Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); 103Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
KeyManagement\Key.cs (2)
135Debug.Assert(_descriptorException is null); // Mutually exclusive with _descriptor 172Debug.Assert(_descriptorException is null); // Mutually exclusive with _descriptor
KeyManagement\KeyRingBasedDataProtector.cs (5)
35Debug.Assert(keyRingProvider != null); 188Debug.Assert(protectedData != null); 331Debug.Assert(ms.Position == sizeof(uint)); 338Debug.Assert(purpose != null); 356Debug.Assert(existingTemplate.Length >= sizeof(uint) /* MAGIC_HEADER */ + sizeof(Guid) /* keyId */);
KeyManagement\KeyRingProvider.cs (6)
173Debug.Assert(defaultKey != null); 176Debug.Assert(defaultKey.CreateEncryptor() != null); 228Debug.Assert(utcNow.Kind == DateTimeKind.Utc); 312Debug.Assert(existingCacheableKeyRing != null); 328Debug.Assert(utcNow.Kind == DateTimeKind.Utc); 446Debug.Assert(task.IsCompleted);
KeyManagement\XmlKeyManager.cs (9)
268Debug.Assert(keyElement.Name == KeyElementName); 314Debug.Assert(_knownKeyMap.TryGetValue(key.KeyId, out var existingKey)); 315Debug.Assert(existingKey.CreationDate == key.CreationDate); 316Debug.Assert(existingKey.ActivationDate == key.ActivationDate); 317Debug.Assert(existingKey.ExpirationDate == key.ExpirationDate); 324Debug.Assert(revocationElement.Name == RevocationElementName); 576Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); // Hint for the platform compatibility analyzer. 601Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); // Hint for the platform compatibility analyzer. 606Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); // Hint for the platform compatibility analyzer.
Repositories\DefaultKeyStorageDirectories.cs (1)
74Debug.Assert(retVal != null);
XmlEncryption\XmlEncryptionExtensions.cs (2)
62Debug.Assert(placeholderReplacements.Count > 0); 143Debug.Assert(placeholderReplacements.Count > 0);
Microsoft.AspNetCore.DataProtection.Abstractions (2)
DataProtectionCommonExtensions.cs (1)
53Debug.Assert(retVal is IDataProtector); // CreateProtector is supposed to return an instance of this interface
src\Shared\WebEncoders\WebEncoders.cs (1)
344Debug.Assert(output.Length >= GetArraySizeRequiredToEncode(input.Length));
Microsoft.AspNetCore.DeveloperCertificates.XPlat (1)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
574Debug.Assert(pemEnvelope != null);
Microsoft.AspNetCore.Diagnostics (10)
src\Shared\Diagnostics\AnalyzerDebug.cs (2)
12/// <inheritdoc cref="Debug.Assert(bool)"/> 14public static void Assert([DoesNotReturnIf(false)] bool b) => Debug.Assert(b);
src\Shared\Diagnostics\BaseView.cs (3)
110Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 118Debug.Assert(AttributeValues != null); 119Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
src\Shared\RazorViews\BaseView.cs (3)
150Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 158Debug.Assert(AttributeValues != null); 159Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
198Debug.Assert(method != null); 199Debug.Assert(method.DeclaringType != null);
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (8)
src\Shared\Diagnostics\AnalyzerDebug.cs (2)
12/// <inheritdoc cref="Debug.Assert(bool)"/> 14public static void Assert([DoesNotReturnIf(false)] bool b) => Debug.Assert(b);
src\Shared\Diagnostics\BaseView.cs (3)
110Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 118Debug.Assert(AttributeValues != null); 119Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
src\Shared\RazorViews\BaseView.cs (3)
150Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 158Debug.Assert(AttributeValues != null); 159Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
Microsoft.AspNetCore.Grpc.JsonTranscoding (4)
Internal\JsonRequestHelpers.cs (1)
357Debug.Assert(read == data.Length);
src\Grpc\JsonTranscoding\src\Shared\HttpRoutePatternParser.cs (3)
343Debug.Assert(CurrentVariable.FieldPath.Any()); 344Debug.Assert(CurrentVariable.StartSegment < CurrentVariable.EndSegment); 345Debug.Assert(CurrentVariable.EndSegment <= _segments.Count);
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (3)
ConverterTests\JsonConverterReadTests.cs (1)
661Debug.Assert(objectOld != null);
UnaryServerCallHandlerTests.cs (2)
594Debug.Assert(requestMessage != null); 630Debug.Assert(requestMessage != null);
Microsoft.AspNetCore.Grpc.Swagger (3)
src\Grpc\JsonTranscoding\src\Shared\HttpRoutePatternParser.cs (3)
343Debug.Assert(CurrentVariable.FieldPath.Any()); 344Debug.Assert(CurrentVariable.StartSegment < CurrentVariable.EndSegment); 345Debug.Assert(CurrentVariable.EndSegment <= _segments.Count);
Microsoft.AspNetCore.Hosting (11)
Http\DefaultHttpContextFactory.cs (2)
56Debug.Assert(featureCollection != null); 57Debug.Assert(httpContext != null);
Internal\HostingRequestFinishedLog.cs (2)
28Debug.Assert(_context.HttpContext != null); 62Debug.Assert(_context.HttpContext != null);
Internal\StartupMethods.cs (2)
14Debug.Assert(configure != null); 15Debug.Assert(configureServices != null);
src\Shared\RazorViews\BaseView.cs (3)
150Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 158Debug.Assert(AttributeValues != null); 159Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
198Debug.Assert(method != null); 199Debug.Assert(method.DeclaringType != null);
Microsoft.AspNetCore.Html.Abstractions (2)
HtmlFormattableString.cs (2)
89Debug.Assert(formatProvider != null); 90Debug.Assert(encoder != null);
Microsoft.AspNetCore.Http (12)
src\Http\Shared\StreamCopyOperationInternal.cs (4)
39Debug.Assert(source != null); 40Debug.Assert(destination != null); 41Debug.Assert(!bytesRemaining.HasValue || bytesRemaining.GetValueOrDefault() >= 0); 42Debug.Assert(buffer != null);
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (8)
229Debug.Assert(_arrayStorage == null); 515Debug.Assert(_arrayStorage != null); 545Debug.Assert(_arrayStorage is not null); 546Debug.Assert(_count <= _arrayStorage.Length); 556Debug.Assert(_dictionaryStorage == null); 557Debug.Assert(_arrayStorage != null); 576Debug.Assert(_dictionaryStorage == null); 577Debug.Assert(_arrayStorage != null);
Microsoft.AspNetCore.Http.Abstractions (24)
PathString.cs (2)
158Debug.Assert(count > 0); 159Debug.Assert(buffer is not null);
Routing\RouteValueDictionary.cs (3)
491Debug.Assert(_arrayStorage != null); 774Debug.Assert(_propertyStorage != null); 887Debug.Assert(value != null);
src\Shared\PropertyHelper\PropertyHelper.cs (18)
161Debug.Assert(propertyInfo != null); 181Debug.Assert(propertyInfo != null); 195Debug.Assert(propertyInfo != null); 198Debug.Assert(propertyGetterWrapperMethod != null); 199Debug.Assert(propertyGetterWrapperMethod.IsGenericMethodDefinition); 200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 203Debug.Assert(propertyGetterByRefWrapperMethod != null); 204Debug.Assert(propertyGetterByRefWrapperMethod.IsGenericMethodDefinition); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 208Debug.Assert(getMethod != null); 209Debug.Assert(!getMethod.IsStatic); 210Debug.Assert(getMethod.GetParameters().Length == 0); 277Debug.Assert(propertyInfo != null); 278Debug.Assert(!propertyInfo.DeclaringType!.IsValueType); 281Debug.Assert(setMethod != null); 282Debug.Assert(!setMethod.IsStatic); 283Debug.Assert(setMethod.ReturnType == typeof(void)); 285Debug.Assert(parameters.Length == 1);
src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
47Debug.Assert(_pos == _span.Length);
Microsoft.AspNetCore.Http.Connections (5)
Internal\HttpConnectionContext.cs (1)
522Debug.Assert(Status == HttpConnectionStatus.Disposed);
Internal\HttpConnectionsMetrics.cs (1)
57Debug.Assert(transportType != HttpTransportType.None);
src\Shared\WebEncoders\WebEncoders.cs (1)
344Debug.Assert(output.Length >= GetArraySizeRequiredToEncode(input.Length));
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
Microsoft.AspNetCore.Http.Connections.Client (9)
Internal\Constants.cs (1)
24Debug.Assert(assemblyVersion != null);
Internal\LongPollingTransport.cs (2)
73Debug.Assert(_application != null); 143Debug.Assert(_application != null);
Internal\ServerSentEventsTransport.cs (2)
91Debug.Assert(_application != null); 129Debug.Assert(_application != null);
Internal\WebSocketsTransport.cs (4)
339Debug.Assert(_application != null); 349Debug.Assert(_notifyOnReconnect is not null); 435Debug.Assert(_application != null); 532Debug.Assert(_application != null);
Microsoft.AspNetCore.Http.Connections.Common (3)
NegotiateProtocol.cs (2)
64Debug.Assert(writer.CurrentDepth == 0); 133Debug.Assert(writer.CurrentDepth == 0);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
126Debug.Assert(charsUsed == 1);
Microsoft.AspNetCore.Http.Extensions (21)
RequestDelegateFactory.cs (4)
246Debug.Assert(untargetableRequestDelegate is not null); 258Debug.Assert(targetableRequestDelegate is not null); 416Debug.Assert(factoryContext.EndpointBuilder.FilterFactories.Count > 0); 1952Debug.Assert(bindAsyncMethod.Expression is not null);
src\Components\Endpoints\src\FormMapping\Factories\NullableConverterFactory.cs (3)
26Debug.Assert(underlyingType != null); 29Debug.Assert(underlyingConverter != null); 32Debug.Assert(expectedConverterType != null);
src\Components\Endpoints\src\FormMapping\FormDataReader.cs (3)
202Debug.Assert(_currentDepth >= 0); 206Debug.Assert(_currentPrefixBuffer.Length >= keyLength); 235Debug.Assert(_prefixBuffer.Length >= (_currentPrefixBuffer.Length + separator.Length));
src\Http\Shared\StreamCopyOperationInternal.cs (4)
39Debug.Assert(source != null); 40Debug.Assert(destination != null); 41Debug.Assert(!bytesRemaining.HasValue || bytesRemaining.GetValueOrDefault() >= 0); 42Debug.Assert(buffer != null);
src\Shared\ParameterBindingMethodCache.cs (1)
719Debug.Assert(obj is ParameterLookupKey);
src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
47Debug.Assert(_pos == _span.Length);
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (5)
37Debug.Assert(value >= 0); 38Debug.Assert(value <= _chars.Length); 48Debug.Assert(capacity >= 0); 86Debug.Assert(index < _pos); 289Debug.Assert(additionalCapacityBeyondPos > 0);
Microsoft.AspNetCore.Http.RequestDelegateGenerator (2)
src\Shared\Diagnostics\AnalyzerDebug.cs (2)
12/// <inheritdoc cref="Debug.Assert(bool)"/> 14public static void Assert([DoesNotReturnIf(false)] bool b) => Debug.Assert(b);
Microsoft.AspNetCore.Http.Results (6)
src\Http\Shared\StreamCopyOperationInternal.cs (4)
39Debug.Assert(source != null); 40Debug.Assert(destination != null); 41Debug.Assert(!bytesRemaining.HasValue || bytesRemaining.GetValueOrDefault() >= 0); 42Debug.Assert(buffer != null);
src\Shared\RangeHelper\RangeHelper.cs (1)
67Debug.Assert(rangeHeader.Ranges.Count == 1);
src\Shared\ResultsHelpers\SharedUrlHelper.cs (1)
26Debug.Assert(path.HasValue);
Microsoft.AspNetCore.HttpLogging (14)
BufferingStream.cs (1)
147Debug.Assert(_tail != null);
src\Shared\Buffers\BufferSegment.cs (4)
27Debug.Assert(value <= AvailableMemory.Length); 64Debug.Assert(_memoryOwner != null); 102Debug.Assert(segment != null); 103Debug.Assert(Next == null);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
47Debug.Assert(_pos == _span.Length);
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (5)
37Debug.Assert(value >= 0); 38Debug.Assert(value <= _chars.Length); 48Debug.Assert(capacity >= 0); 86Debug.Assert(index < _pos); 289Debug.Assert(additionalCapacityBeyondPos > 0);
Microsoft.AspNetCore.Identity (1)
IdentityApiEndpointRouteBuilderExtensions.cs (1)
431Debug.Assert(!result.Succeeded);
Microsoft.AspNetCore.Identity.FunctionalTests (4)
src\Identity\Extensions.Core\src\Rfc6238AuthenticationService.cs (4)
40Debug.Assert(res); 53Debug.Assert(res); 54Debug.Assert(written == hash.Length); 61Debug.Assert(offset + 4 < hash.Length);
Microsoft.AspNetCore.Mvc.Abstractions (6)
ModelBinding\ModelMetadata.cs (3)
564Debug.Assert(_parameterMapping != null); 565Debug.Assert(_boundConstructorPropertyMapping != null); 652Debug.Assert(ModelType != null);
ModelBinding\ModelStateDictionary.cs (2)
552Debug.Assert(key != null); 930Debug.Assert(ChildNodes != null);
src\Shared\ParameterBindingMethodCache.cs (1)
719Debug.Assert(obj is ParameterLookupKey);
Microsoft.AspNetCore.Mvc.Analyzers (3)
src\Shared\Roslyn\CodeAnalysisExtensions.cs (3)
34Debug.Assert(methodSymbol != null); 159Debug.Assert(method.PartialImplementationPart == null && !SymbolEqualityComparer.Default.Equals(method.PartialDefinitionPart, method)); 165Debug.Assert(!SymbolEqualityComparer.Default.Equals(method.PartialImplementationPart, method));
Microsoft.AspNetCore.Mvc.Api.Analyzers (3)
src\Shared\Roslyn\CodeAnalysisExtensions.cs (3)
34Debug.Assert(methodSymbol != null); 159Debug.Assert(method.PartialImplementationPart == null && !SymbolEqualityComparer.Default.Equals(method.PartialDefinitionPart, method)); 165Debug.Assert(!SymbolEqualityComparer.Default.Equals(method.PartialImplementationPart, method));
Microsoft.AspNetCore.Mvc.Core (231)
ActionConstraints\ActionConstraintCache.cs (1)
95Debug.Assert(entry.ActionConstraints != null || entry.Items != null);
ApplicationModels\ApplicationModelFactory.cs (1)
79Debug.Assert(result != null);
ApplicationModels\ControllerActionDescriptorBuilder.cs (1)
134Debug.Assert(IsAttributeRouted(actionDescriptor));
Authorization\AuthorizeFilter.cs (1)
205Debug.Assert(AuthorizeData != null);
Controllers\ControllerBinderDelegateProvider.cs (1)
60Debug.Assert(valueProvider is not null);
Formatters\AcceptHeaderParser.cs (2)
124Debug.Assert(input != null); 125Debug.Assert(startIndex <= input.Length); // it's OK if index == value.Length.
Infrastructure\ActionSelectionTable.cs (2)
178Debug.Assert(matches != null); 179Debug.Assert(matches.Count >= 0);
Infrastructure\ControllerActionInvoker.cs (15)
116Debug.Assert(state != null); 117Debug.Assert(_actionExecutingContext != null); 140Debug.Assert(state != null); 141Debug.Assert(_actionExecutingContext != null); 171Debug.Assert(state != null); 172Debug.Assert(_actionExecutingContext != null); 220Debug.Assert(state != null); 221Debug.Assert(_actionExecutingContext != null); 222Debug.Assert(_actionExecutedContext != null); 314Debug.Assert(_actionExecutedContext != null); 336Debug.Assert(invoker._actionExecutedContext != null); 342Debug.Assert(_actionExecutingContext != null); 355Debug.Assert(_actionExecutedContext != null); 362Debug.Assert(invoker._actionExecutedContext != null); 523Debug.Assert(_cacheEntry.ControllerBinderDelegate != null);
Infrastructure\DefaultActionDescriptorCollectionProvider.cs (4)
57Debug.Assert(_collection != null); 58Debug.Assert(_changeToken != null); 72Debug.Assert(_collection != null); 73Debug.Assert(_changeToken != null);
Infrastructure\ObjectResultExecutor.cs (1)
124Debug.Assert(result.ContentTypes != null);
Infrastructure\ResourceInvoker.cs (49)
335Debug.Assert(state != null); 336Debug.Assert(_authorizationContext != null); 359Debug.Assert(state != null); 360Debug.Assert(_authorizationContext != null); 381Debug.Assert(state != null); 382Debug.Assert(_authorizationContext != null); 411Debug.Assert(state != null); 412Debug.Assert(_authorizationContext != null); 413Debug.Assert(_authorizationContext.Result != null); 471Debug.Assert(state != null); 472Debug.Assert(_resourceExecutingContext != null); 495Debug.Assert(state != null); 496Debug.Assert(_resourceExecutingContext != null); 530Debug.Assert(state != null); 531Debug.Assert(_resourceExecutingContext != null); 573Debug.Assert(state != null); 574Debug.Assert(_resourceExecutingContext != null); 575Debug.Assert(_resourceExecutedContext != null); 599Debug.Assert(state != null); 600Debug.Assert(_resourceExecutingContext != null); 601Debug.Assert(_resourceExecutedContext != null); 647Debug.Assert(scope == Scope.Invoker || scope == Scope.Resource); 666Debug.Assert(state != null); 696Debug.Assert(state != null); 697Debug.Assert(_exceptionContext != null); 733Debug.Assert(state != null); 782Debug.Assert(state != null); 783Debug.Assert(_exceptionContext != null); 856Debug.Assert(scope == Scope.Invoker || scope == Scope.Resource); 889Debug.Assert(scope == Scope.Invoker); 908Debug.Assert(_resourceExecutingContext != null); 922Debug.Assert(_resourceExecutedContext != null); 929Debug.Assert(invoker._resourceExecutedContext != null); 971Debug.Assert(_resourceExecutedContext != null); 993Debug.Assert(invoker._resourceExecutedContext != null); 1168Debug.Assert(state != null); 1169Debug.Assert(_resultExecutingContext != null); 1192Debug.Assert(state != null); 1193Debug.Assert(_resultExecutingContext != null); 1225Debug.Assert(state != null); 1226Debug.Assert(_resultExecutingContext != null); 1274Debug.Assert(state != null); 1275Debug.Assert(_resultExecutingContext != null); 1276Debug.Assert(_resultExecutedContext != null); 1373Debug.Assert(_resultExecutedContext != null); 1396Debug.Assert(invoker._resultExecutedContext != null); 1404Debug.Assert(_resultExecutingContext != null); 1418Debug.Assert(_resultExecutedContext != null); 1425Debug.Assert(invoker._resultExecutedContext != null);
ModelBinding\Binders\CollectionModelBinder.cs (1)
168Debug.Assert(model != null);
ModelBinding\Binders\ComplexObjectModelBinder.cs (3)
68Debug.Assert(propertyData == GreedyPropertiesMayHaveData || propertyData == ValueProviderDataAvailable); 440Debug.Assert(property.MetadataKind == ModelMetadataKind.Property); 485Debug.Assert(parameter.MetadataKind == ModelMetadataKind.Parameter);
ModelBinding\Binders\ComplexTypeModelBinder.cs (1)
97Debug.Assert(propertyData == GreedyPropertiesMayHaveData || propertyData == ValueProviderDataAvailable);
ModelBinding\Binders\DictionaryModelBinder.cs (1)
119Debug.Assert(result.Model != null);
ModelBinding\Binders\FormFileModelBinder.cs (2)
105Debug.Assert(postedFiles is List<IFormFile>); 110Debug.Assert(postedFiles is List<IFormFile>);
ModelBinding\Binders\HeaderModelBinder.cs (1)
194Debug.Assert(values != null);
ModelBinding\Metadata\DefaultModelMetadataProvider.cs (1)
358Debug.Assert(propertyKey.MetadataKind == ModelMetadataKind.Property);
ModelBinding\ModelBinderFactory.cs (4)
79Debug.Assert(!(binder is PlaceholderBinder)); 176Debug.Assert(metadata != null); 177Debug.Assert(binder != null); 189Debug.Assert(metadata != null);
ModelBinding\PrefixContainer.cs (2)
202Debug.Assert(candidate.StartsWith(prefix, StringComparison.OrdinalIgnoreCase)); 259Debug.Assert(candidate.StartsWith(prefix, StringComparison.OrdinalIgnoreCase));
ModelBinding\SuppressChildValidationMetadataProvider.cs (1)
85Debug.Assert(FullTypeName != null);
ModelBinding\Validation\ClientValidatorCache.cs (1)
83Debug.Assert(entry.Items != null);
ModelBinding\Validation\ValidationStack.cs (1)
56Debug.Assert(ReferenceEquals(List[List.Count - 1], model));
ModelBinding\Validation\ValidationVisitor.cs (3)
203Debug.Assert(Key != null); 204Debug.Assert(Metadata != null); 427Debug.Assert(Metadata is not null && Key is not null && Model is not null);
ModelBinding\Validation\ValidatorCache.cs (1)
73Debug.Assert(entry.Items != null);
MvcCoreDiagnosticListenerExtensions.cs (100)
26Debug.Assert(diagnosticListener != null); 27Debug.Assert(actionDescriptor != null); 28Debug.Assert(httpContext != null); 29Debug.Assert(routeData != null); 54Debug.Assert(diagnosticListener != null); 55Debug.Assert(actionDescriptor != null); 56Debug.Assert(httpContext != null); 57Debug.Assert(routeData != null); 81Debug.Assert(diagnosticListener != null); 82Debug.Assert(authorizationContext != null); 83Debug.Assert(filter != null); 111Debug.Assert(diagnosticListener != null); 112Debug.Assert(authorizationContext != null); 113Debug.Assert(filter != null); 141Debug.Assert(diagnosticListener != null); 142Debug.Assert(authorizationContext != null); 143Debug.Assert(filter != null); 171Debug.Assert(diagnosticListener != null); 172Debug.Assert(authorizationContext != null); 173Debug.Assert(filter != null); 201Debug.Assert(diagnosticListener != null); 202Debug.Assert(resourceExecutingContext != null); 203Debug.Assert(filter != null); 231Debug.Assert(diagnosticListener != null); 232Debug.Assert(resourceExecutedContext != null); 233Debug.Assert(filter != null); 261Debug.Assert(diagnosticListener != null); 262Debug.Assert(resourceExecutingContext != null); 263Debug.Assert(filter != null); 291Debug.Assert(diagnosticListener != null); 292Debug.Assert(resourceExecutingContext != null); 293Debug.Assert(filter != null); 321Debug.Assert(diagnosticListener != null); 322Debug.Assert(resourceExecutedContext != null); 323Debug.Assert(filter != null); 351Debug.Assert(diagnosticListener != null); 352Debug.Assert(resourceExecutedContext != null); 353Debug.Assert(filter != null); 381Debug.Assert(diagnosticListener != null); 382Debug.Assert(exceptionContext != null); 383Debug.Assert(filter != null); 411Debug.Assert(diagnosticListener != null); 412Debug.Assert(exceptionContext != null); 413Debug.Assert(filter != null); 441Debug.Assert(diagnosticListener != null); 442Debug.Assert(exceptionContext != null); 443Debug.Assert(filter != null); 471Debug.Assert(diagnosticListener != null); 472Debug.Assert(exceptionContext != null); 473Debug.Assert(filter != null); 501Debug.Assert(diagnosticListener != null); 502Debug.Assert(actionExecutingContext != null); 503Debug.Assert(filter != null); 531Debug.Assert(diagnosticListener != null); 532Debug.Assert(actionExecutedContext != null); 533Debug.Assert(filter != null); 561Debug.Assert(diagnosticListener != null); 562Debug.Assert(actionExecutingContext != null); 563Debug.Assert(filter != null); 591Debug.Assert(diagnosticListener != null); 592Debug.Assert(actionExecutingContext != null); 593Debug.Assert(filter != null); 621Debug.Assert(diagnosticListener != null); 622Debug.Assert(actionExecutedContext != null); 623Debug.Assert(filter != null); 651Debug.Assert(diagnosticListener != null); 652Debug.Assert(actionExecutedContext != null); 653Debug.Assert(filter != null); 682Debug.Assert(diagnosticListener != null); 683Debug.Assert(actionContext != null); 684Debug.Assert(actionArguments != null); 685Debug.Assert(controller != null); 728Debug.Assert(diagnosticListener != null); 729Debug.Assert(actionContext != null); 730Debug.Assert(actionArguments != null); 731Debug.Assert(controller != null); 774Debug.Assert(diagnosticListener != null); 775Debug.Assert(resultExecutingContext != null); 776Debug.Assert(filter != null); 804Debug.Assert(diagnosticListener != null); 805Debug.Assert(resultExecutedContext != null); 806Debug.Assert(filter != null); 834Debug.Assert(diagnosticListener != null); 835Debug.Assert(resultExecutingContext != null); 836Debug.Assert(filter != null); 864Debug.Assert(diagnosticListener != null); 865Debug.Assert(resultExecutingContext != null); 866Debug.Assert(filter != null); 894Debug.Assert(diagnosticListener != null); 895Debug.Assert(resultExecutedContext != null); 896Debug.Assert(filter != null); 924Debug.Assert(diagnosticListener != null); 925Debug.Assert(resultExecutedContext != null); 926Debug.Assert(filter != null); 954Debug.Assert(diagnosticListener != null); 955Debug.Assert(actionContext != null); 956Debug.Assert(result != null); 980Debug.Assert(diagnosticListener != null); 981Debug.Assert(actionContext != null); 982Debug.Assert(result != null);
Routing\ActionEndpointDataSourceBase.cs (4)
46Debug.Assert(_changeToken != null); 47Debug.Assert(_endpoints != null); 90Debug.Assert(_changeToken != null); 91Debug.Assert(_endpoints != null);
Routing\DynamicControllerEndpointMatcherPolicy.cs (1)
166Debug.Assert(currentSelector == null || ReferenceEquals(currentSelector, selector));
Routing\UrlHelperBase.cs (2)
308Debug.Assert(path.HasValue); 377Debug.Assert(pageName.Length > 0);
Routing\ViewEnginePath.cs (3)
18Debug.Assert(!string.IsNullOrEmpty(first)); 31Debug.Assert(index >= 0); 48Debug.Assert(!string.IsNullOrEmpty(path));
src\Shared\PropertyHelper\PropertyHelper.cs (18)
161Debug.Assert(propertyInfo != null); 181Debug.Assert(propertyInfo != null); 195Debug.Assert(propertyInfo != null); 198Debug.Assert(propertyGetterWrapperMethod != null); 199Debug.Assert(propertyGetterWrapperMethod.IsGenericMethodDefinition); 200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 203Debug.Assert(propertyGetterByRefWrapperMethod != null); 204Debug.Assert(propertyGetterByRefWrapperMethod.IsGenericMethodDefinition); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 208Debug.Assert(getMethod != null); 209Debug.Assert(!getMethod.IsStatic); 210Debug.Assert(getMethod.GetParameters().Length == 0); 277Debug.Assert(propertyInfo != null); 278Debug.Assert(!propertyInfo.DeclaringType!.IsValueType); 281Debug.Assert(setMethod != null); 282Debug.Assert(!setMethod.IsStatic); 283Debug.Assert(setMethod.ReturnType == typeof(void)); 285Debug.Assert(parameters.Length == 1);
src\Shared\RangeHelper\RangeHelper.cs (1)
67Debug.Assert(rangeHeader.Ranges.Count == 1);
src\Shared\ResultsHelpers\SharedUrlHelper.cs (1)
26Debug.Assert(path.HasValue);
Microsoft.AspNetCore.Mvc.Core.Test (1)
ModelBinding\StubModelBinder.cs (1)
64Debug.Assert(bindingContext.Result == ModelBindingResult.Failed());
Microsoft.AspNetCore.Mvc.Core.TestCommon (1)
ActivityReplacer.cs (1)
20Debug.Assert(Activity.Current == _activity);
Microsoft.AspNetCore.Mvc.Formatters.Xml (3)
XmlDataContractSerializerOutputFormatter.cs (2)
242Debug.Assert(valueType is not null); 251Debug.Assert(wrapperProvider is not null);
XmlSerializerOutputFormatter.cs (1)
228Debug.Assert(wrapperProvider is not null);
Microsoft.AspNetCore.Mvc.IntegrationTests (6)
BinderTypeBasedModelBinderIntegrationTest.cs (5)
322Debug.Assert(bindingContext.Result == ModelBindingResult.Failed()); 347Debug.Assert(bindingContext.Result == ModelBindingResult.Failed()); 371Debug.Assert(bindingContext.Result == ModelBindingResult.Failed()); 389Debug.Assert(bindingContext.Result == ModelBindingResult.Failed()); 401Debug.Assert(bindingContext.Result == ModelBindingResult.Failed());
GenericModelBinderIntegrationTest.cs (1)
170Debug.Assert(bindingContext.Result == ModelBindingResult.Failed());
Microsoft.AspNetCore.Mvc.Localization (1)
Properties\Resources.Designer.cs (1)
49System.Diagnostics.Debug.Assert(value != null);
Microsoft.AspNetCore.Mvc.Razor (7)
Compilation\DefaultViewCompiler.cs (1)
120Debug.Assert(relativePath != null);
RazorPageBase.cs (2)
304Debug.Assert(_valueBuffer is not null); 607Debug.Assert(_tagHelperAttributeInfo.ExecutionContext != null);
RazorView.cs (2)
97Debug.Assert(_bufferScope != null); 280Debug.Assert(originalLocations is not null && layoutPageResult.SearchedLocations is not null);
RazorViewEngine.cs (2)
482Debug.Assert(!string.IsNullOrEmpty(name)); 488Debug.Assert(!string.IsNullOrEmpty(name));
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (16)
CSharpCompiler.cs (3)
117Debug.Assert(_parseOptions is not null); 118Debug.Assert(_compilationOptions is not null); 119Debug.Assert(_emitOptions is not null);
PageActionDescriptorChangeProvider.cs (1)
32Debug.Assert(!string.IsNullOrEmpty(rootDirectory));
RuntimeViewCompiler.cs (5)
138Debug.Assert(item.ExpirationTokens != null); 152Debug.Assert(item.Descriptor != null); 162Debug.Assert(taskSource != null); 168Debug.Assert(item.Descriptor != null); 383Debug.Assert(relativePath != null);
src\Mvc\Mvc.RazorPages\src\ApplicationModels\PageRouteModelFactory.cs (7)
89Debug.Assert(relativePath.StartsWith('/')); 129Debug.Assert(path.StartsWith(rootDirectory, StringComparison.OrdinalIgnoreCase)); 130Debug.Assert(path.EndsWith(RazorViewEngine.ViewExtension, StringComparison.OrdinalIgnoreCase)); 140Debug.Assert(!string.IsNullOrEmpty(areaName)); 141Debug.Assert(!string.IsNullOrEmpty(viewEnginePath)); 142Debug.Assert(viewEnginePath.StartsWith('/')); 175Debug.Assert(directory.StartsWith('/'));
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (2)
TestInfrastructure\DirectoryNode.cs (2)
34Debug.Assert(directory != null); 113Debug.Assert(!string.IsNullOrEmpty(path));
Microsoft.AspNetCore.Mvc.RazorPages (78)
ApplicationModels\PageRouteModelFactory.cs (7)
89Debug.Assert(relativePath.StartsWith('/')); 129Debug.Assert(path.StartsWith(rootDirectory, StringComparison.OrdinalIgnoreCase)); 130Debug.Assert(path.EndsWith(RazorViewEngine.ViewExtension, StringComparison.OrdinalIgnoreCase)); 140Debug.Assert(!string.IsNullOrEmpty(areaName)); 141Debug.Assert(!string.IsNullOrEmpty(viewEnginePath)); 142Debug.Assert(viewEnginePath.StartsWith('/')); 175Debug.Assert(directory.StartsWith('/'));
DependencyInjection\RazorPagesRazorViewEngineOptionsSetup.cs (1)
26Debug.Assert(!string.IsNullOrEmpty(rootDirectory));
Infrastructure\DynamicPageEndpointMatcherPolicy.cs (1)
183Debug.Assert(currentSelector == null || ReferenceEquals(currentSelector, selector));
Infrastructure\DynamicPageEndpointSelectorCache.cs (1)
35Debug.Assert(dataSourceId is not null);
Infrastructure\PageActionInvoker.cs (28)
192Debug.Assert(_instance is not null); 213Debug.Assert(handlerBinder is not null); 214Debug.Assert(_arguments is not null); 253Debug.Assert(_instance is not null); 254Debug.Assert(_arguments is not null); 321Debug.Assert(_instance is not null); 357Debug.Assert(state != null); 358Debug.Assert(_handlerSelectedContext != null); 381Debug.Assert(state != null); 382Debug.Assert(_handlerSelectedContext != null); 397Debug.Assert(state != null); 398Debug.Assert(_handlerSelectedContext != null); 439Debug.Assert(_instance is not null); 440Debug.Assert(_arguments is not null); 471Debug.Assert(state != null); 472Debug.Assert(_handlerExecutingContext != null); 495Debug.Assert(state != null); 496Debug.Assert(_handlerExecutingContext != null); 498Debug.Assert(_instance is not null); 529Debug.Assert(state != null); 530Debug.Assert(_handlerExecutingContext != null); 531Debug.Assert(_instance is not null); 580Debug.Assert(state != null); 581Debug.Assert(_handlerExecutingContext != null); 582Debug.Assert(_handlerExecutedContext != null); 670Debug.Assert(_handlerExecutedContext != null); 675Debug.Assert(_handlerExecutingContext != null); 690Debug.Assert(_handlerExecutedContext != null);
MvcRazorPagesDiagnosticListenerExtensions.cs (40)
20Debug.Assert(diagnosticListener != null); 21Debug.Assert(actionContext != null); 22Debug.Assert(handlerMethodDescriptor != null); 23Debug.Assert(arguments != null); 24Debug.Assert(instance != null); 56Debug.Assert(diagnosticListener != null); 57Debug.Assert(actionContext != null); 58Debug.Assert(handlerMethodDescriptor != null); 59Debug.Assert(arguments != null); 60Debug.Assert(instance != null); 90Debug.Assert(diagnosticListener != null); 91Debug.Assert(handlerExecutionContext != null); 92Debug.Assert(filter != null); 120Debug.Assert(diagnosticListener != null); 121Debug.Assert(handlerExecutedContext != null); 122Debug.Assert(filter != null); 150Debug.Assert(diagnosticListener != null); 151Debug.Assert(handlerExecutingContext != null); 152Debug.Assert(filter != null); 180Debug.Assert(diagnosticListener != null); 181Debug.Assert(handlerExecutingContext != null); 182Debug.Assert(filter != null); 210Debug.Assert(diagnosticListener != null); 211Debug.Assert(handlerExecutedContext != null); 212Debug.Assert(filter != null); 240Debug.Assert(diagnosticListener != null); 241Debug.Assert(handlerExecutedContext != null); 242Debug.Assert(filter != null); 270Debug.Assert(diagnosticListener != null); 271Debug.Assert(handlerSelectedContext != null); 272Debug.Assert(filter != null); 300Debug.Assert(diagnosticListener != null); 301Debug.Assert(handlerSelectedContext != null); 302Debug.Assert(filter != null); 330Debug.Assert(diagnosticListener != null); 331Debug.Assert(handlerSelectedContext != null); 332Debug.Assert(filter != null); 360Debug.Assert(diagnosticListener != null); 361Debug.Assert(handlerSelectedContext != null); 362Debug.Assert(filter != null);
Microsoft.AspNetCore.Mvc.TagHelpers (7)
CacheTagHelper.cs (1)
269Debug.Assert(length == 0);
CurrentValues.cs (1)
12Debug.Assert(values != null);
LinkTagHelper.cs (2)
324Debug.Assert(url != null); 450Debug.Assert(fallbackHrefs[i] != null);
ScriptTagHelper.cs (2)
291Debug.Assert(url != null); 319Debug.Assert(src != null);
TagHelperOutputExtensions.cs (1)
99Debug.Assert(found);
Microsoft.AspNetCore.Mvc.Testing (2)
.packages\microsoft.extensions.hostfactoryresolver.sources\9.0.0-preview.5.24265.2\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
293Debug.Assert(_hostTcs.Task.IsCompleted);
Handlers\RedirectHandler.cs (1)
137Debug.Assert(response.RequestMessage is not null);
Microsoft.AspNetCore.Mvc.ViewFeatures (46)
AttributeDictionary.cs (8)
76Debug.Assert(index >= 0 && index < Count && _items != null); 82Debug.Assert(index >= 0 && index <= Count); 83Debug.Assert(value.Key != null); 95Debug.Assert(index >= 0 && index <= Count); 96Debug.Assert(value.Key != null); 108Debug.Assert(index >= 0 && index < Count); 110Debug.Assert(_items != null); 119Debug.Assert(key != null);
Buffers\PagedBufferedTextWriter.cs (2)
50Debug.Assert(length > 0); 66Debug.Assert(length == 0);
Buffers\PagedCharBuffer.cs (2)
61Debug.Assert(copyLength > 0); 82Debug.Assert(copyLength > 0);
CachedExpressionCompiler.cs (2)
45Debug.Assert(expression != null); 223Debug.Assert(combinedNullTest.Type == typeof(bool));
DefaultDisplayTemplates.cs (1)
89Debug.Assert(elementMetadata != null);
DefaultEditorTemplates.cs (1)
71Debug.Assert(elementMetadata != null);
DefaultHtmlGenerator.cs (4)
199Debug.Assert(!isChecked.HasValue); 454Debug.Assert(!isChecked.HasValue); 457Debug.Assert(value != null); 966Debug.Assert(isTargetEnum ^ enumNames == null);
ExpressionHelper.cs (7)
131Debug.Assert(segmentCount >= 0); 134Debug.Assert(!doNotCache); 148Debug.Assert(doNotCache); 157Debug.Assert(doNotCache); 168Debug.Assert(!name.Contains("__")); 182Debug.Assert(false); 187Debug.Assert(segmentCount == 0);
ExpressionMetadataProvider.cs (1)
118Debug.Assert(metadata != null);
ModelExplorer.cs (2)
127Debug.Assert(Container != null); 202Debug.Assert(propertyHelper != null);
ModelExplorerExtensions.cs (1)
53Debug.Assert(enumGroupedDisplayNamesAndValues != null);
src\Shared\PooledArrayBufferWriter.cs (6)
80Debug.Assert(_rentedBuffer != null); 144Debug.Assert(_rentedBuffer != null); 165Debug.Assert(oldBuffer.Length >= _index); 166Debug.Assert(_rentedBuffer.Length >= _index); 174Debug.Assert(_rentedBuffer.Length - _index > 0); 175Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
TempDataDictionary.cs (1)
152Debug.Assert(_initialKeys is not null && _retainedKeys is not null && _data is not null);
TemplateBuilder.cs (1)
107Debug.Assert(enumGrouped != null);
ValidationHelpers.cs (4)
13Debug.Assert(modelError != null); 29Debug.Assert(modelError != null); 30Debug.Assert(containingEntry != null); 31Debug.Assert(modelExplorer != null);
ViewDataDictionaryFactory.cs (2)
18Debug.Assert(constructor != null); 39Debug.Assert(constructor != null);
ViewDataEvaluator.cs (1)
100Debug.Assert(expression != null);
Microsoft.AspNetCore.OpenApi (17)
Schemas\JsonSchemaMapper\JsonSchemaMapper.cs (8)
226Debug.Assert(typeInfo.IsReadOnly); 310Debug.Assert(derivedType.TypeDiscriminator is null or int or string); 597Debug.Assert(parameterTypeInfo.Type == parameter.ParameterType); 657Debug.Assert(_currentPath != null); 664Debug.Assert(_currentDepth > 0); 669Debug.Assert(_currentPath != null); 682Debug.Assert(_currentPath != null); 683Debug.Assert(_generatedTypePaths != null);
Schemas\JsonSchemaMapper\JsonSchemaMapper.ReflectionHelpers.cs (5)
27Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary); 73Debug.Assert(converter is null || IsBuiltInConverter(converter)); 95Debug.Assert(typeInfo.Type.IsEnum && IsBuiltInConverter(converter)); 157Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Object); 277Debug.Assert(memberInfo is PropertyInfo or FieldInfo);
src\Shared\ParameterBindingMethodCache.cs (1)
719Debug.Assert(obj is ParameterLookupKey);
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
126Debug.Assert(charsUsed == 1);
Microsoft.AspNetCore.OutputCaching (20)
FormatterBinaryWriter.cs (6)
46Debug.Assert(target is not null); 50Debug.Assert(length == 0 && offset == 0); 55Debug.Assert(offset >= 0 && offset <= length); 56Debug.Assert(length > 0); 94Debug.Assert(actual == bytes); 102Debug.Assert(actual == bytes);
Memory\MemoryOutputCacheStore.cs (5)
97Debug.Assert(keys != null); 115Debug.Assert(key != null); 136Debug.Assert(tags != null); 137Debug.Assert(tags.Length > 0); 138Debug.Assert(key is string);
RecyclableArrayBufferWriter.cs (4)
66Debug.Assert(_buffer.Length > _index); 73Debug.Assert(_buffer.Length > _index); 107Debug.Assert(needed > currentLength); 127Debug.Assert(FreeCapacity > 0 && FreeCapacity >= sizeHint);
RecyclableSequenceBuilder.cs (2)
73Debug.Assert(_currentSegment is not null); 75Debug.Assert(_currentSegmentIndex >= 0 && _currentSegmentIndex <= current.Length);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (6)
RedisOutputCacheStore.cs (6)
99Debug.Assert(secondsWithJitter >= 270 && secondsWithJitter <= 330); 168Debug.Assert(cache is not null); 193Debug.Assert(cache is not null); 212Debug.Assert(cache is not null); 246Debug.Assert(cache is not null); 345Debug.Assert(_cache is not null);
Microsoft.AspNetCore.Razor (1)
TagHelpers\DefaultTagHelperContent.cs (1)
34Debug.Assert(_buffer.Count == 0);
Microsoft.AspNetCore.Razor.Runtime (1)
Runtime\TagHelpers\TagHelperExecutionContext.cs (1)
221Debug.Assert(!Output.IsContentModified);
Microsoft.AspNetCore.Razor.Runtime.Test (1)
Runtime\TagHelpers\TagHelperRunnerTest.cs (1)
259Debug.Assert(ProcessOrderTracker != null);
Microsoft.AspNetCore.ResponseCaching (3)
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
Microsoft.AspNetCore.ResponseCompression (4)
ResponseCompressionMiddleware.cs (1)
51Debug.Assert(originalBodyFeature != null);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
Microsoft.AspNetCore.Rewrite (6)
ApacheModRewrite\CookieActionFactory.cs (1)
59Debug.Assert(action != null || tokenType == Fields.Name);
ApacheModRewrite\RuleBuilder.cs (4)
65Debug.Assert(input.Operand != null); 76Debug.Assert(input.Operand != null); 102Debug.Assert(input.Operand != null); 162Debug.Assert(input.Operand != null);
PatternSegments\RuleMatchSegment.cs (1)
19Debug.Assert(ruleBackReferences != null);
Microsoft.AspNetCore.Routing (84)
ArrayBuilder.cs (7)
32Debug.Assert(capacity >= 0); 61Debug.Assert(index >= 0 && index < _count); 85Debug.Assert(_count > 0); 94Debug.Assert(_count > 0); 111Debug.Assert(_array != null); // Nonzero _count should imply this 141Debug.Assert(_count < Capacity); 148Debug.Assert(minimum > Capacity);
Constraints\RegexRouteConstraint.cs (1)
68Debug.Assert(_regexFactory is not null);
Matching\CandidateSet.cs (2)
289Debug.Assert(cmp <= 0); 335Debug.Assert(count > 0);
Matching\DfaMatcher.cs (2)
198Debug.Assert(candidateStateArray is not null); 205Debug.Assert(candidateStateArray is not null);
Matching\DfaMatcherBuilder.cs (1)
396Debug.Assert(i == segment.Parts.Count - 1 && partParameter.IsOptional);
Matching\EndpointComparer.cs (4)
43Debug.Assert(x != null); 44Debug.Assert(y != null); 79Debug.Assert(x != null); 80Debug.Assert(y != null);
Matching\ILEmitTrieFactory.cs (3)
534Debug.Assert(index + 4 <= text.Length); 544Debug.Assert(index + 4 <= text.Length); 552Debug.Assert(index + 1 <= text.Length);
Matching\SingleEntryAsciiJumpTable.cs (1)
47Debug.Assert(a.Length == b.Length && b.Length == length);
ParameterPolicyActivator.cs (1)
161Debug.Assert(constructors.Count > 0);
ParameterPolicyFactory.cs (1)
40Debug.Assert(reference.ParameterPolicy != null || reference.Content != null);
PathTokenizer.cs (3)
47Debug.Assert(_path[0] == '/'); 97Debug.Assert(_path[_path.Length - 1] != '/'); 98Debug.Assert(currentSegmentIndex == index);
Patterns\RoutePattern.cs (5)
48Debug.Assert(defaults != null); 49Debug.Assert(parameterPolicies != null); 50Debug.Assert(parameters != null); 51Debug.Assert(requiredValues != null); 52Debug.Assert(pathSegments != null);
Patterns\RoutePatternLiteralPart.cs (1)
22Debug.Assert(!string.IsNullOrEmpty(content));
Patterns\RoutePatternMatcher.cs (8)
111Debug.Assert(pathSegment != null); 168Debug.Assert(pathSegment != null); 169Debug.Assert(pathSegment.IsSimple); 172Debug.Assert(part.IsParameter); 240Debug.Assert(!pathSegment.IsSimple); 338Debug.Assert(routeSegment != null); 339Debug.Assert(routeSegment.Parts.Count > 1); 361Debug.Assert(part.IsLiteral || part.IsSeparator);
Patterns\RoutePatternParser.cs (8)
51Debug.Assert(context.AtEnd() || context.Current == Separator); 73Debug.Assert(context != null); 74Debug.Assert(segments != null); 145Debug.Assert(context.Current == OpenBrace); 445Debug.Assert(context != null); 446Debug.Assert(literal != null); 485Debug.Assert(template != null); 526Debug.Assert(_index >= 0);
Patterns\RoutePatternSeparatorPart.cs (1)
39Debug.Assert(!string.IsNullOrEmpty(content));
RequestDelegateFilterPipelineBuilder.cs (1)
19Debug.Assert(options.EndpointBuilder != null);
RouteBase.cs (2)
313Debug.Assert(_constraintLogger != null); 324Debug.Assert(_constraintLogger != null);
RouteCollection.cs (1)
150Debug.Assert(_options != null);
RouteEndpointDataSource.cs (1)
247Debug.Assert(factoryCreatedRequestDelegate is not null);
src\Shared\PropertyHelper\PropertyHelper.cs (18)
161Debug.Assert(propertyInfo != null); 181Debug.Assert(propertyInfo != null); 195Debug.Assert(propertyInfo != null); 198Debug.Assert(propertyGetterWrapperMethod != null); 199Debug.Assert(propertyGetterWrapperMethod.IsGenericMethodDefinition); 200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 203Debug.Assert(propertyGetterByRefWrapperMethod != null); 204Debug.Assert(propertyGetterByRefWrapperMethod.IsGenericMethodDefinition); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 208Debug.Assert(getMethod != null); 209Debug.Assert(!getMethod.IsStatic); 210Debug.Assert(getMethod.GetParameters().Length == 0); 277Debug.Assert(propertyInfo != null); 278Debug.Assert(!propertyInfo.DeclaringType!.IsValueType); 281Debug.Assert(setMethod != null); 282Debug.Assert(!setMethod.IsStatic); 283Debug.Assert(setMethod.ReturnType == typeof(void)); 285Debug.Assert(parameters.Length == 1);
Template\RoutePrecedence.cs (7)
48Debug.Assert(digit >= 0 && digit < 10); 69Debug.Assert(digit >= 0 && digit < 10); 102Debug.Assert(digit >= 0 && digit < 10); 125Debug.Assert(digit >= 0 && digit < 10); 163Debug.Assert(part.IsParameter); 191Debug.Assert(parameterPart != null); 231Debug.Assert(part.IsParameter);
Template\TemplateBinder.cs (2)
518Debug.Assert(context.BufferState == SegmentState.Beginning); 519Debug.Assert(context.UriState == SegmentState.Beginning);
Tree\TreeEnumerator.cs (1)
94Debug.Assert(next.Depth < _tokenizer.Count);
Tree\UrlMatchingTree.cs (1)
98Debug.Assert(segment.Parts.Count == 1);
UriBuildingContext.cs (1)
171Debug.Assert(result);
Microsoft.AspNetCore.Routing.Abstractions (19)
RouteData.cs (1)
146Debug.Assert(_routers != null);
src\Shared\PropertyHelper\PropertyHelper.cs (18)
161Debug.Assert(propertyInfo != null); 181Debug.Assert(propertyInfo != null); 195Debug.Assert(propertyInfo != null); 198Debug.Assert(propertyGetterWrapperMethod != null); 199Debug.Assert(propertyGetterWrapperMethod.IsGenericMethodDefinition); 200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 203Debug.Assert(propertyGetterByRefWrapperMethod != null); 204Debug.Assert(propertyGetterByRefWrapperMethod.IsGenericMethodDefinition); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 208Debug.Assert(getMethod != null); 209Debug.Assert(!getMethod.IsStatic); 210Debug.Assert(getMethod.GetParameters().Length == 0); 277Debug.Assert(propertyInfo != null); 278Debug.Assert(!propertyInfo.DeclaringType!.IsValueType); 281Debug.Assert(setMethod != null); 282Debug.Assert(!setMethod.IsStatic); 283Debug.Assert(setMethod.ReturnType == typeof(void)); 285Debug.Assert(parameters.Length == 1);
Microsoft.AspNetCore.Server.HttpSys (33)
AsyncAcceptContext.cs (2)
72Debug.Assert(_requestContext != null); 172Debug.Assert(_requestContext != null);
MessagePump.cs (3)
106Debug.Assert(application != null); 162Debug.Assert(RequestContextFactory != null); 270Debug.Assert(_messagePump.Stopping);
NativeInterop\RequestQueue.cs (2)
109Debug.Assert(Created); 125Debug.Assert(Created);
RequestProcessing\RequestContext.FeatureCollection.cs (1)
79Debug.Assert(_features != null);
RequestProcessing\Response.cs (2)
602Debug.Assert(HasTrailers); 648Debug.Assert(unknownHeadersOffset == trailerCount);
RequestProcessing\ResponseBody.cs (1)
223Debug.Assert(hasData);
RequestProcessing\ResponseStreamAsyncResult.cs (2)
94Debug.Assert(currentChunk == _dataChunks.Length); 135Debug.Assert(currentChunk == _dataChunks.Length);
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
204Debug.Assert(_memoryHandle.HasValue);
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (2)
168Debug.Assert(_backingBuffer != null); 226Debug.Assert((int)HTTP_VERB.HttpVerbMaximum == HttpVerbs.Length);
src\Shared\ServerInfrastructure\StringUtilities.cs (8)
121Debug.Assert(input != null); 122Debug.Assert(output != null); 126Debug.Assert((long)end >= Vector256<sbyte>.Count); 311Debug.Assert(input != null); 312Debug.Assert(output != null); 417Debug.Assert(IsValidHeaderString(previousValue)); 564Debug.Assert(Avx2.IsSupported); 573Debug.Assert(Sse2.IsSupported);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
UrlPrefixCollection.cs (2)
214Debug.Assert(_urlGroup != null); 224Debug.Assert(port >= 5000 || port < 8000);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (24)
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
95Debug.Assert(indexLength >= 1); 127Debug.Assert(indexLength >= 1); 159Debug.Assert(indexLength >= 1); 197Debug.Assert(indexLength >= 1); 369Debug.Assert(Ascii.IsValid(value)); 376Debug.Assert(integerLength >= 1); 382Debug.Assert(status == OperationStatus.Done); 383Debug.Assert(valueBytesWritten == value.Length); 397Debug.Assert(destination.Length >= value.Length); 406Debug.Assert(status == OperationStatus.Done); 407Debug.Assert(bytesWritten == value.Length); 426Debug.Assert(integerLength >= 1); 470Debug.Assert(integerLength >= 1); 481Debug.Assert(written == encodedStringLength); 528Debug.Assert(separator != null); 529Debug.Assert(Ascii.IsValid(separator)); 551Debug.Assert(integerLength >= 1);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8);
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
246Debug.Assert(totalBytesUsed == encodedLength);
Microsoft.AspNetCore.Server.IIS (31)
Core\IISHttpContext.cs (2)
442Debug.Assert(_hasResponseStarted == false); 482Debug.Assert(!HasStartedConsumingRequestBody);
Core\IISHttpContext.FeatureCollection.cs (1)
364Debug.Assert(_readBodyTask == null || _readBodyTask.IsCompleted);
Core\IO\AsyncIOEngine.cs (1)
175Debug.Assert(_runningOperation != null);
Core\IO\WebSocketsAsyncIOEngine.cs (2)
37Debug.Assert(!read.InUse()); 53Debug.Assert(!write.InUse());
Core\OutputProducer.cs (1)
119Debug.Assert(false);
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
204Debug.Assert(_memoryHandle.HasValue);
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (2)
168Debug.Assert(_backingBuffer != null); 226Debug.Assert((int)HTTP_VERB.HttpVerbMaximum == HttpVerbs.Length);
src\Shared\RazorViews\BaseView.cs (3)
150Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 158Debug.Assert(AttributeValues != null); 159Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
246Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\StringUtilities.cs (8)
121Debug.Assert(input != null); 122Debug.Assert(output != null); 126Debug.Assert((long)end >= Vector256<sbyte>.Count); 311Debug.Assert(input != null); 312Debug.Assert(output != null); 417Debug.Assert(IsValidHeaderString(previousValue)); 564Debug.Assert(Avx2.IsSupported); 573Debug.Assert(Sse2.IsSupported);
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
198Debug.Assert(method != null); 199Debug.Assert(method.DeclaringType != null);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
Microsoft.AspNetCore.Server.Kestrel.Core (264)
AnyIPListenOptions.cs (1)
20Debug.Assert(IPEndPoint != null);
HttpsConfigurationService.cs (4)
135Debug.Assert(_useHttpsWithDefaults is not null); 136Debug.Assert(_tlsConfigurationLoader is not null); 137Debug.Assert(_populateMultiplexedTransportFeatures is not null); 138Debug.Assert(_httpsLogger is not null);
Internal\Http\Http1Connection.cs (1)
149Debug.Assert(MinRequestBodyDataRate != null);
Internal\Http\Http1OutputProducer.cs (7)
171Debug.Assert(!producer._pipeWriterCompleted); 172Debug.Assert(producer._autoChunk && producer._advancedBytesForChunk > 0); 524Debug.Assert(_currentSegmentOwner == null); 525Debug.Assert(_completedSegments == null || _completedSegments.Count == 0); 631Debug.Assert(_advancedBytesForChunk <= _currentChunkMemory.Length); 632Debug.Assert(_advancedBytesForChunk > 0); 636Debug.Assert(bytesWritten <= _currentMemoryPrefixBytes);
Internal\Http\HttpHeaders.Generated.cs (131)
8403Debug.Assert((_currentBits & 0x1L) != 0); 8408Debug.Assert((_currentBits & 0x2L) != 0); 8413Debug.Assert((_currentBits & 0x4L) != 0); 8418Debug.Assert((_currentBits & 0x8L) != 0); 8423Debug.Assert((_currentBits & 0x10L) != 0); 8428Debug.Assert((_currentBits & 0x20L) != 0); 8433Debug.Assert((_currentBits & 0x40L) != 0); 8438Debug.Assert((_currentBits & 0x80L) != 0); 8443Debug.Assert((_currentBits & 0x100L) != 0); 8448Debug.Assert((_currentBits & 0x200L) != 0); 8453Debug.Assert((_currentBits & 0x400L) != 0); 8458Debug.Assert((_currentBits & 0x800L) != 0); 8463Debug.Assert((_currentBits & 0x1000L) != 0); 8468Debug.Assert((_currentBits & 0x2000L) != 0); 8473Debug.Assert((_currentBits & 0x4000L) != 0); 8478Debug.Assert((_currentBits & 0x8000L) != 0); 8483Debug.Assert((_currentBits & 0x10000L) != 0); 8488Debug.Assert((_currentBits & 0x20000L) != 0); 8493Debug.Assert((_currentBits & 0x40000L) != 0); 8498Debug.Assert((_currentBits & 0x80000L) != 0); 8503Debug.Assert((_currentBits & 0x100000L) != 0); 8508Debug.Assert((_currentBits & 0x200000L) != 0); 8513Debug.Assert((_currentBits & 0x400000L) != 0); 8518Debug.Assert((_currentBits & 0x800000L) != 0); 8523Debug.Assert((_currentBits & 0x1000000L) != 0); 8528Debug.Assert((_currentBits & 0x2000000L) != 0); 8533Debug.Assert((_currentBits & 0x4000000L) != 0); 8538Debug.Assert((_currentBits & 0x8000000L) != 0); 8543Debug.Assert((_currentBits & 0x10000000L) != 0); 8548Debug.Assert((_currentBits & 0x20000000L) != 0); 8553Debug.Assert((_currentBits & 0x40000000L) != 0); 8558Debug.Assert((_currentBits & 0x80000000L) != 0); 8563Debug.Assert((_currentBits & 0x100000000L) != 0); 8568Debug.Assert((_currentBits & 0x200000000L) != 0); 8573Debug.Assert((_currentBits & 0x400000000L) != 0); 8578Debug.Assert((_currentBits & 0x800000000L) != 0); 8583Debug.Assert((_currentBits & 0x1000000000L) != 0); 8588Debug.Assert((_currentBits & 0x2000000000L) != 0); 8593Debug.Assert((_currentBits & 0x4000000000L) != 0); 8598Debug.Assert((_currentBits & 0x8000000000L) != 0); 8603Debug.Assert((_currentBits & 0x10000000000L) != 0); 8608Debug.Assert((_currentBits & 0x20000000000L) != 0); 8613Debug.Assert((_currentBits & 0x40000000000L) != 0); 8618Debug.Assert((_currentBits & 0x80000000000L) != 0); 8623Debug.Assert((_currentBits & 0x100000000000L) != 0); 8628Debug.Assert((_currentBits & 0x200000000000L) != 0); 8633Debug.Assert((_currentBits & 0x400000000000L) != 0); 8638Debug.Assert((_currentBits & 0x800000000000L) != 0); 8643Debug.Assert((_currentBits & 0x1000000000000L) != 0); 8648Debug.Assert(_currentBits == 0); 14835Debug.Assert((tempBits & 0x1L) != 0); 14854Debug.Assert((tempBits & 0x2L) != 0); 14861Debug.Assert((tempBits & 0x4L) != 0); 14880Debug.Assert((tempBits & 0x8L) != 0); 14899Debug.Assert((tempBits & 0x10L) != 0); 14906Debug.Assert((tempBits & 0x20L) != 0); 14913Debug.Assert((tempBits & 0x40L) != 0); 14920Debug.Assert((tempBits & 0x80L) != 0); 14927Debug.Assert((tempBits & 0x100L) != 0); 14934Debug.Assert((tempBits & 0x200L) != 0); 14941Debug.Assert((tempBits & 0x400L) != 0); 14948Debug.Assert((tempBits & 0x800L) != 0); 14955Debug.Assert((tempBits & 0x1000L) != 0); 14962Debug.Assert((tempBits & 0x2000L) != 0); 14981Debug.Assert((tempBits & 0x4000L) != 0); 14988Debug.Assert((tempBits & 0x8000L) != 0); 14995Debug.Assert((tempBits & 0x10000L) != 0); 15002Debug.Assert((tempBits & 0x20000L) != 0); 15009Debug.Assert((tempBits & 0x40000L) != 0); 15016Debug.Assert((tempBits & 0x80000L) != 0); 15023Debug.Assert((tempBits & 0x100000L) != 0); 15030Debug.Assert((tempBits & 0x200000L) != 0); 15037Debug.Assert((tempBits & 0x400000L) != 0); 15044Debug.Assert((tempBits & 0x800000L) != 0); 15051Debug.Assert((tempBits & 0x1000000L) != 0); 15058Debug.Assert((tempBits & 0x2000000L) != 0); 15065Debug.Assert((tempBits & 0x4000000L) != 0); 15072Debug.Assert((tempBits & 0x8000000L) != 0); 15079Debug.Assert((tempBits & 0x10000000L) != 0); 15086Debug.Assert((tempBits & 0x20000000L) != 0); 15093Debug.Assert((tempBits & 0x40000000L) != 0); 15100Debug.Assert((tempBits & 0x80000000L) != 0); 15107Debug.Assert((tempBits & 0x100000000L) != 0); 15126Debug.Assert((tempBits & 0x200000000L) != 0); 15133Debug.Assert((tempBits & 0x400000000L) != 0); 15140Debug.Assert((tempBits & 0x800000000L) != 0); 15147Debug.Assert((tempBits & 0x1000000000L) != 0); 15154Debug.Assert((tempBits & 0x2000000000L) != 0); 15172Debug.Assert(valueCount > 0); 15253Debug.Assert((_currentBits & 0x1L) != 0); 15259Debug.Assert((_currentBits & 0x2L) != 0); 15265Debug.Assert((_currentBits & 0x4L) != 0); 15271Debug.Assert((_currentBits & 0x8L) != 0); 15277Debug.Assert((_currentBits & 0x10L) != 0); 15283Debug.Assert((_currentBits & 0x20L) != 0); 15289Debug.Assert((_currentBits & 0x40L) != 0); 15295Debug.Assert((_currentBits & 0x80L) != 0); 15301Debug.Assert((_currentBits & 0x100L) != 0); 15307Debug.Assert((_currentBits & 0x200L) != 0); 15313Debug.Assert((_currentBits & 0x400L) != 0); 15319Debug.Assert((_currentBits & 0x800L) != 0); 15325Debug.Assert((_currentBits & 0x1000L) != 0); 15331Debug.Assert((_currentBits & 0x2000L) != 0); 15337Debug.Assert((_currentBits & 0x4000L) != 0); 15343Debug.Assert((_currentBits & 0x8000L) != 0); 15349Debug.Assert((_currentBits & 0x10000L) != 0); 15355Debug.Assert((_currentBits & 0x20000L) != 0); 15361Debug.Assert((_currentBits & 0x40000L) != 0); 15367Debug.Assert((_currentBits & 0x80000L) != 0); 15373Debug.Assert((_currentBits & 0x100000L) != 0); 15379Debug.Assert((_currentBits & 0x200000L) != 0); 15385Debug.Assert((_currentBits & 0x400000L) != 0); 15391Debug.Assert((_currentBits & 0x800000L) != 0); 15397Debug.Assert((_currentBits & 0x1000000L) != 0); 15403Debug.Assert((_currentBits & 0x2000000L) != 0); 15409Debug.Assert((_currentBits & 0x4000000L) != 0); 15415Debug.Assert((_currentBits & 0x8000000L) != 0); 15421Debug.Assert((_currentBits & 0x10000000L) != 0); 15427Debug.Assert((_currentBits & 0x20000000L) != 0); 15433Debug.Assert((_currentBits & 0x40000000L) != 0); 15439Debug.Assert((_currentBits & 0x80000000L) != 0); 15445Debug.Assert((_currentBits & 0x100000000L) != 0); 15451Debug.Assert((_currentBits & 0x200000000L) != 0); 15457Debug.Assert((_currentBits & 0x400000000L) != 0); 15463Debug.Assert((_currentBits & 0x800000000L) != 0); 15469Debug.Assert((_currentBits & 0x1000000000L) != 0); 15475Debug.Assert((_currentBits & 0x2000000000L) != 0); 15481Debug.Assert(_currentBits == 0); 17589Debug.Assert((_currentBits & 0x1L) != 0); 17595Debug.Assert((_currentBits & 0x2L) != 0); 17601Debug.Assert((_currentBits & 0x4L) != 0);
Internal\Http\HttpParser.cs (1)
333Debug.Assert(result);
Internal\Http\HttpProtocol.cs (3)
718Debug.Assert(_bodyControl != null); 1010Debug.Assert(_requestRejectedException != null); 1616Debug.Assert(!HasResponseStarted);
Internal\Http\ReasonPhrases.cs (1)
84Debug.Assert(!string.IsNullOrEmpty(reasonPhrase));
Internal\Http2\Http2Connection.cs (9)
233Debug.Assert(Limits.MinRequestBodyDataRate != null); 378Debug.Assert(_currentHeadersStream != null); 1136Debug.Assert(_currentHeadersStream != null); 1163Debug.Assert(_currentHeadersStream != null); 1178Debug.Assert(_currentHeadersStream != null); 1444Debug.Assert(TimeoutControl.TimerReason == TimeoutReason.RequestHeaders || 1462Debug.Assert(index <= H2StaticTable.Count); 1470Debug.Assert(index <= H2StaticTable.Count); 1488Debug.Assert(_currentHeadersStream != null);
Internal\Http2\Http2FrameWriter.cs (5)
223Debug.Assert(actual <= int.MaxValue); 609Debug.Assert(dataLength == data.Length); 636Debug.Assert(dataLength == data.Length); 640Debug.Assert(dataLength > dataPayloadLength); 859Debug.Assert(payload.Length == _outgoingFrame.PayloadLength); // 8
Internal\Http2\Http2OutputProducer.cs (2)
179Debug.Assert(_completedResponse); 309Debug.Assert(_unconsumedBytes > 0);
Internal\Http2\Http2Stream.cs (3)
152Debug.Assert(_decrementCalled); 434Debug.Assert(32 < ch && ch < 127); 501Debug.Assert(flushTask.IsCompletedSuccessfully);
Internal\Http3\Http3Connection.cs (7)
377Debug.Assert(streamDirectionFeature != null); 378Debug.Assert(streamIdFeature != null); 605Debug.Assert(_context.ServiceContext.ServerOptions.EnableWebTransportAndH3Datagrams); 871Debug.Assert(!stream.IsReceivingHeader); 882Debug.Assert(Limits.MinRequestBodyDataRate != null); 898Debug.Assert(_context.ServiceContext.ServerOptions.EnableWebTransportAndH3Datagrams); 903Debug.Assert(!_webtransportSessions.ContainsKey(http3Stream.StreamId));
Internal\Http3\Http3FrameWriter.cs (3)
179Debug.Assert(dataLength == data.Length); 202Debug.Assert(dataLength == data.Length); 206Debug.Assert(dataLength > dataPayloadLength);
Internal\Http3\Http3OutputProducer.cs (1)
60Debug.Assert(_dataWriteProcessingTask.IsCompleted);
Internal\Http3\Http3Stream.cs (3)
205Debug.Assert(index <= H3StaticTable.Count); 213Debug.Assert(index <= H3StaticTable.Count); 1156Debug.Assert(32 < ch && ch < 127);
Internal\Http3\QPackHeaderWriter.cs (1)
15Debug.Assert(hasValue == true);
Internal\Infrastructure\HttpUtilities.cs (3)
60Debug.Assert(operationStatus == OperationStatus.Done); 72Debug.Assert(operationStatus == OperationStatus.Done); 265Debug.Assert(WordListForPerfectHashOfMethods.Length == (MaxHashValue + 1) && methodsLookup.Length == (MaxHashValue + 1));
Internal\Infrastructure\PipeWriterHelpers\ConcurrentPipeWriter.cs (4)
163Debug.Assert(_currentFlushTcs != null); 240Debug.Assert(_tail != null); 296Debug.Assert(_currentFlushTcs != null); 329Debug.Assert(_tail != null);
Internal\Infrastructure\StatusCheckPipeWriter.cs (1)
33Debug.Assert(_context != null);
Internal\Infrastructure\StatusCheckWriteStream.cs (1)
27Debug.Assert(_context != null);
Internal\Infrastructure\StreamCloseAwaitable.cs (1)
22Debug.Assert(ReferenceEquals(_callback, _callbackCompleted));
Internal\Infrastructure\TimeoutControl.cs (1)
116Debug.Assert(_minReadRate != null);
Internal\WebTransport\WebTransportSession.cs (1)
136Debug.Assert(success);
KestrelConfigurationLoader.cs (1)
297Debug.Assert(ReloadOnChange);
KestrelServerOptions.cs (1)
312Debug.Assert(DevelopmentCertificate is null);
Middleware\HttpsConnectionMiddleware.cs (1)
93Debug.Assert(_serverCertificate != null);
src\Shared\Buffers\BufferSegment.cs (4)
27Debug.Assert(value <= AvailableMemory.Length); 64Debug.Assert(_memoryOwner != null); 102Debug.Assert(segment != null); 103Debug.Assert(Next == null);
src\Shared\CertificateGeneration\CertificateManager.cs (1)
574Debug.Assert(pemEnvelope != null);
src\Shared\Hpack\DynamicHPackEncoder.cs (1)
158Debug.Assert(removed != null);
src\Shared\Hpack\EncoderHeaderEntry.cs (2)
32Debug.Assert(name != null); 33Debug.Assert(value != null);
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
95Debug.Assert(indexLength >= 1); 127Debug.Assert(indexLength >= 1); 159Debug.Assert(indexLength >= 1); 197Debug.Assert(indexLength >= 1); 369Debug.Assert(Ascii.IsValid(value)); 376Debug.Assert(integerLength >= 1); 382Debug.Assert(status == OperationStatus.Done); 383Debug.Assert(valueBytesWritten == value.Length); 397Debug.Assert(destination.Length >= value.Length); 406Debug.Assert(status == OperationStatus.Done); 407Debug.Assert(bytesWritten == value.Length); 426Debug.Assert(integerLength >= 1); 470Debug.Assert(integerLength >= 1); 481Debug.Assert(written == encodedStringLength); 528Debug.Assert(separator != null); 529Debug.Assert(Ascii.IsValid(separator)); 551Debug.Assert(integerLength >= 1);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8);
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\runtime\Http3\Helpers\VariableLengthIntegerHelper.cs (8)
69Debug.Assert((firstByte & LengthMask) == InitialEightByteLengthMask); 118Debug.Assert(result); 119Debug.Assert(bytesRead == length); 149Debug.Assert(longToEncode >= 0); 150Debug.Assert(longToEncode <= EightByteLimit); 193Debug.Assert(res); 199Debug.Assert(value >= 0); 200Debug.Assert(value <= EightByteLimit);
src\Shared\runtime\Http3\QPack\HeaderField.cs (1)
17Debug.Assert(name.Length > 0);
src\Shared\runtime\Http3\QPack\QPackEncoder.cs (14)
42Debug.Assert(res); 97Debug.Assert(res); 106Debug.Assert(res); 167Debug.Assert(res); 177Debug.Assert(res); 204Debug.Assert(written == encodedStringLength); 235Debug.Assert(separator != null); 236Debug.Assert(Ascii.IsValid(separator)); 303Debug.Assert(buffer.Length >= s.Length); 312Debug.Assert(status == OperationStatus.Done); 313Debug.Assert(bytesWritten == s.Length); 318Debug.Assert(Ascii.IsValid(s)); 331Debug.Assert(status == OperationStatus.Done); 332Debug.Assert(valueBytesWritten == s.Length);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
246Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\StringUtilities.cs (8)
121Debug.Assert(input != null); 122Debug.Assert(output != null); 126Debug.Assert((long)end >= Vector256<sbyte>.Count); 311Debug.Assert(input != null); 312Debug.Assert(output != null); 417Debug.Assert(IsValidHeaderString(previousValue)); 564Debug.Assert(Avx2.IsSupported); 573Debug.Assert(Sse2.IsSupported);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (11)
src\Servers\Kestrel\shared\KnownHeaders.cs (4)
773Debug.Assert(requestHeaders.Length <= 64); 774Debug.Assert(requestHeaders.Max(x => x.Index) <= 62); 778Debug.Assert(responseHeaders.Length <= 63); 779Debug.Assert(responseHeaders.Count(x => x.Index == 63) == 1);
src\Servers\Kestrel\shared\test\RevocationResponder.cs (1)
314System.Diagnostics.Debug.Assert(read == requestBytes.Length);
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
204Debug.Assert(_memoryHandle.HasValue);
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
src\Shared\test\Shared.Tests\runtime\Http2\DynamicTableTest.cs (1)
157Debug.Assert(data.Length == 16);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (10)
Http2\Http2ConnectionBenchmarkBase.cs (3)
103Debug.Assert(_receiveHttpFrame.Type == Http2FrameType.SETTINGS); 105Debug.Assert(_receiveHttpFrame.Type == Http2FrameType.WINDOW_UPDATE); 107Debug.Assert(_receiveHttpFrame.Type == Http2FrameType.SETTINGS);
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (1)
294Debug.Assert(success);
src\Servers\Kestrel\shared\TransportConnection.cs (1)
72Debug.Assert(Application != null);
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
204Debug.Assert(_memoryHandle.HasValue);
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (6)
src\Servers\Kestrel\shared\TransportConnection.cs (1)
72Debug.Assert(Application != null);
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
204Debug.Assert(_memoryHandle.HasValue);
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (27)
Internal\QuicConnectionListener.cs (2)
169Debug.Assert(connectionContext != null); 170Debug.Assert(connectionContext.GetInnerConnection() == quicConnection);
Internal\QuicStreamContext.cs (8)
81Debug.Assert(_stream == null); 143Debug.Assert(_processingTask.IsCompletedSuccessfully); 150Debug.Assert(_stream != null); 184Debug.Assert(_stream != null); 204Debug.Assert(_stream != null); 352Debug.Assert(_streamClosedTokenSource != null); 367Debug.Assert(_stream != null); 522Debug.Assert(_stream != null);
src\Servers\Kestrel\shared\TransportConnection.cs (1)
72Debug.Assert(Application != null);
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
204Debug.Assert(_memoryHandle.HasValue);
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
src\Shared\ServerInfrastructure\StringUtilities.cs (8)
121Debug.Assert(input != null); 122Debug.Assert(output != null); 126Debug.Assert((long)end >= Vector256<sbyte>.Count); 311Debug.Assert(input != null); 312Debug.Assert(output != null); 417Debug.Assert(IsValidHeaderString(previousValue)); 564Debug.Assert(Avx2.IsSupported); 573Debug.Assert(Sse2.IsSupported);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (12)
Internal\SocketConnection.cs (3)
44Debug.Assert(socket != null); 45Debug.Assert(memoryPool != null); 46Debug.Assert(logger != null);
Internal\SocketSender.cs (2)
78Debug.Assert(!buffer.IsEmpty); 79Debug.Assert(!buffer.IsSingleSegment);
SocketConnectionListener.cs (1)
51Debug.Assert(listenSocket.LocalEndPoint != null);
src\Servers\Kestrel\shared\TransportConnection.cs (1)
72Debug.Assert(Application != null);
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
204Debug.Assert(_memoryHandle.HasValue);
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
Microsoft.AspNetCore.Shared.Tests (93)
runtime\Http2\DynamicTableTest.cs (1)
157Debug.Assert(data.Length == 16);
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (8)
229Debug.Assert(_arrayStorage == null); 515Debug.Assert(_arrayStorage != null); 545Debug.Assert(_arrayStorage is not null); 546Debug.Assert(_count <= _arrayStorage.Length); 556Debug.Assert(_dictionaryStorage == null); 557Debug.Assert(_arrayStorage != null); 576Debug.Assert(_dictionaryStorage == null); 577Debug.Assert(_arrayStorage != null);
src\Shared\Hpack\DynamicHPackEncoder.cs (1)
158Debug.Assert(removed != null);
src\Shared\Hpack\EncoderHeaderEntry.cs (2)
32Debug.Assert(name != null); 33Debug.Assert(value != null);
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (2)
168Debug.Assert(_backingBuffer != null); 226Debug.Assert((int)HTTP_VERB.HttpVerbMaximum == HttpVerbs.Length);
src\Shared\PropertyHelper\PropertyHelper.cs (18)
161Debug.Assert(propertyInfo != null); 181Debug.Assert(propertyInfo != null); 195Debug.Assert(propertyInfo != null); 198Debug.Assert(propertyGetterWrapperMethod != null); 199Debug.Assert(propertyGetterWrapperMethod.IsGenericMethodDefinition); 200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 203Debug.Assert(propertyGetterByRefWrapperMethod != null); 204Debug.Assert(propertyGetterByRefWrapperMethod.IsGenericMethodDefinition); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 208Debug.Assert(getMethod != null); 209Debug.Assert(!getMethod.IsStatic); 210Debug.Assert(getMethod.GetParameters().Length == 0); 277Debug.Assert(propertyInfo != null); 278Debug.Assert(!propertyInfo.DeclaringType!.IsValueType); 281Debug.Assert(setMethod != null); 282Debug.Assert(!setMethod.IsStatic); 283Debug.Assert(setMethod.ReturnType == typeof(void)); 285Debug.Assert(parameters.Length == 1);
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
95Debug.Assert(indexLength >= 1); 127Debug.Assert(indexLength >= 1); 159Debug.Assert(indexLength >= 1); 197Debug.Assert(indexLength >= 1); 369Debug.Assert(Ascii.IsValid(value)); 376Debug.Assert(integerLength >= 1); 382Debug.Assert(status == OperationStatus.Done); 383Debug.Assert(valueBytesWritten == value.Length); 397Debug.Assert(destination.Length >= value.Length); 406Debug.Assert(status == OperationStatus.Done); 407Debug.Assert(bytesWritten == value.Length); 426Debug.Assert(integerLength >= 1); 470Debug.Assert(integerLength >= 1); 481Debug.Assert(written == encodedStringLength); 528Debug.Assert(separator != null); 529Debug.Assert(Ascii.IsValid(separator)); 551Debug.Assert(integerLength >= 1);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8);
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\runtime\Http3\Helpers\VariableLengthIntegerHelper.cs (8)
69Debug.Assert((firstByte & LengthMask) == InitialEightByteLengthMask); 118Debug.Assert(result); 119Debug.Assert(bytesRead == length); 149Debug.Assert(longToEncode >= 0); 150Debug.Assert(longToEncode <= EightByteLimit); 193Debug.Assert(res); 199Debug.Assert(value >= 0); 200Debug.Assert(value <= EightByteLimit);
src\Shared\runtime\Http3\QPack\HeaderField.cs (1)
17Debug.Assert(name.Length > 0);
src\Shared\runtime\Http3\QPack\QPackEncoder.cs (14)
42Debug.Assert(res); 97Debug.Assert(res); 106Debug.Assert(res); 167Debug.Assert(res); 177Debug.Assert(res); 204Debug.Assert(written == encodedStringLength); 235Debug.Assert(separator != null); 236Debug.Assert(Ascii.IsValid(separator)); 303Debug.Assert(buffer.Length >= s.Length); 312Debug.Assert(status == OperationStatus.Done); 313Debug.Assert(bytesWritten == s.Length); 318Debug.Assert(Ascii.IsValid(s)); 331Debug.Assert(status == OperationStatus.Done); 332Debug.Assert(valueBytesWritten == s.Length);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
246Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\StringUtilities.cs (8)
121Debug.Assert(input != null); 122Debug.Assert(output != null); 126Debug.Assert((long)end >= Vector256<sbyte>.Count); 311Debug.Assert(input != null); 312Debug.Assert(output != null); 417Debug.Assert(IsValidHeaderString(previousValue)); 564Debug.Assert(Avx2.IsSupported); 573Debug.Assert(Sse2.IsSupported);
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
198Debug.Assert(method != null); 199Debug.Assert(method.DeclaringType != null);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
src\Shared\WebEncoders\WebEncoders.cs (1)
344Debug.Assert(output.Length >= GetArraySizeRequiredToEncode(input.Length));
Microsoft.AspNetCore.SignalR.Client.Core (5)
HubConnection.cs (1)
2086Debug.Assert(_messageBuffer is not null);
src\SignalR\common\Shared\MessageBuffer.cs (3)
326Debug.Assert(_currentIndex == -1); 332Debug.Assert(_startingSequenceId + _currentIndex + 1 == sequenceId); 374Debug.Assert(numElements > 0 && numElements < BufferLength + 1);
src\SignalR\common\Shared\ReflectionHelper.cs (1)
37Debug.Assert(nullableType.GetGenericArguments().Length == 1);
Microsoft.AspNetCore.SignalR.Client.Tests (2)
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
Microsoft.AspNetCore.SignalR.Common (5)
Protocol\HandshakeProtocol.cs (2)
69Debug.Assert(writer.CurrentDepth == 0); 100Debug.Assert(writer.CurrentDepth == 0);
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
126Debug.Assert(charsUsed == 1);
Microsoft.AspNetCore.SignalR.Core (17)
HubConnectionContext.cs (1)
300Debug.Assert(_messageBuffer is not null);
Internal\ChannelBasedSemaphore.cs (1)
74Debug.Assert(false);
Internal\DefaultHubDispatcher.cs (2)
343Debug.Assert(hub.Clients is HubCallerClients); 612Debug.Assert(authorizePolicy != null);
src\SignalR\common\Shared\ClientResultsManager.cs (9)
34Debug.Assert(result); 44Debug.Assert(result); 169public static new void SetCanceled(CancellationToken cancellationToken) => Debug.Assert(false); 170public static new void SetException(IEnumerable<Exception> exceptions) => Debug.Assert(false); 173Debug.Assert(false); 178Debug.Assert(false); 183Debug.Assert(false); 188Debug.Assert(false); 193Debug.Assert(false);
src\SignalR\common\Shared\MessageBuffer.cs (3)
326Debug.Assert(_currentIndex == -1); 332Debug.Assert(_startingSequenceId + _currentIndex + 1 == sequenceId); 374Debug.Assert(numElements > 0 && numElements < BufferLength + 1);
src\SignalR\common\Shared\ReflectionHelper.cs (1)
37Debug.Assert(nullableType.GetGenericArguments().Length == 1);
Microsoft.AspNetCore.SignalR.Protocols.Json (4)
Protocol\JsonHubProtocol.cs (3)
571Debug.Assert(writer.CurrentDepth == 0); 791Debug.Assert(arguments != null); 809Debug.Assert(arguments != null);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
126Debug.Assert(charsUsed == 1);
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (3)
Protocol\MessagePackHubProtocolWorker.cs (1)
376Debug.Assert(written == prefixLength);
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (5)
Protocol\NewtonsoftJsonHubProtocol.cs (2)
783Debug.Assert(arguments != null); 800Debug.Assert(arguments != null);
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
126Debug.Assert(charsUsed == 1);
Microsoft.AspNetCore.SignalR.Specification.Tests (2)
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
Microsoft.AspNetCore.SignalR.StackExchangeRedis (16)
Internal\RedisProtocol.cs (1)
244Debug.Assert(isArray);
RedisHubLifetimeManager.cs (4)
821Debug.Assert(success); 825Debug.Assert(success); 826Debug.Assert(written == 24); 828Debug.Assert(base64.EndsWith("=="));
src\SignalR\common\Shared\ClientResultsManager.cs (9)
34Debug.Assert(result); 44Debug.Assert(result); 169public static new void SetCanceled(CancellationToken cancellationToken) => Debug.Assert(false); 170public static new void SetException(IEnumerable<Exception> exceptions) => Debug.Assert(false); 173Debug.Assert(false); 178Debug.Assert(false); 183Debug.Assert(false); 188Debug.Assert(false); 193Debug.Assert(false);
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
Microsoft.AspNetCore.SignalR.Tests (1)
TestFilters.cs (1)
48Debug.Assert(syncPoints.Length == 3);
Microsoft.AspNetCore.SpaServices.Extensions (1)
Npm\NodeScriptRunner.cs (1)
109Debug.Assert(chunk.Array != null);
Microsoft.AspNetCore.StaticAssets (5)
src\Shared\RangeHelper\RangeHelper.cs (1)
67Debug.Assert(rangeHeader.Ranges.Count == 1);
StaticAssetEndpointDataSource.cs (4)
64Debug.Assert(_changeToken != null); 65Debug.Assert(_endpoints != null); 110Debug.Assert(_changeToken != null); 111Debug.Assert(_endpoints != null);
Microsoft.AspNetCore.StaticFiles (1)
src\Shared\RangeHelper\RangeHelper.cs (1)
67Debug.Assert(rangeHeader.Ranges.Count == 1);
Microsoft.AspNetCore.StaticFiles.FunctionalTests (1)
src\Shared\RangeHelper\RangeHelper.cs (1)
67Debug.Assert(rangeHeader.Ranges.Count == 1);
Microsoft.AspNetCore.TestHost (3)
.packages\microsoft.extensions.hostfactoryresolver.sources\9.0.0-preview.5.24265.2\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
293Debug.Assert(_hostTcs.Task.IsCompleted);
ResponseBodyReaderStream.cs (1)
113Debug.Assert(innerException != null);
WebSocketClient.cs (1)
104Debug.Assert(webSocketFeature != null);
Microsoft.AspNetCore.WebSockets (10)
HandshakeHelpers.cs (4)
175Debug.Assert(ret); 176Debug.Assert(written == len); 270Debug.Assert(ret); 271Debug.Assert(written == len);
src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
47Debug.Assert(_pos == _span.Length);
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (5)
37Debug.Assert(value >= 0); 38Debug.Assert(value <= _chars.Length); 48Debug.Assert(capacity >= 0); 86Debug.Assert(index < _pos); 289Debug.Assert(additionalCapacityBeyondPos > 0);
Microsoft.AspNetCore.WebUtilities (21)
FileBufferingReadStream.cs (2)
238Debug.Assert(_tempFileDirectoryAccessor != null); 240Debug.Assert(_tempFileDirectory != null);
FileBufferingWriteStream.cs (2)
124Debug.Assert(PagedByteBuffer.Length <= _memoryThreshold); 163Debug.Assert(PagedByteBuffer.Length <= _memoryThreshold);
FormPipeReader.cs (1)
269Debug.Assert(segmentConsumed == keyValuePair.FirstSpan.Length);
HttpRequestStreamReader.cs (3)
258Debug.Assert(charsRemaining == 0); 269Debug.Assert(charsRemaining == 0); 279Debug.Assert(charsRemaining > 0);
HttpResponseStreamWriter.cs (8)
215Debug.Assert(_charBufferCount == _charBufferSize); 251Debug.Assert(count > 0); 252Debug.Assert(_charBufferSize - _charBufferCount < count); 295Debug.Assert(count > 0); 296Debug.Assert(_charBufferSize - _charBufferCount < count); 344Debug.Assert(value.Length > 0); 345Debug.Assert(_charBufferSize - _charBufferCount < value.Length); 616Debug.Assert(_charBufferSize - _charBufferCount >= value.Length);
MultipartReaderStream.cs (4)
202Debug.Assert(matchCount == length); 219Debug.Assert(read == length); // It should have all been buffered 288Debug.Assert(matchCount == length); 305Debug.Assert(read == length); // It should have all been buffered
src\Shared\WebEncoders\WebEncoders.cs (1)
344Debug.Assert(output.Length >= GetArraySizeRequiredToEncode(input.Length));
Microsoft.AspNetCore.WebUtilities.Microbenchmarks (2)
HttpRequestStreamReaderReadLineBenchmark.cs (2)
33Debug.Assert(result.Length == Length - 2); 42Debug.Assert(result.Length == Length - 2);
Microsoft.Build (50)
BackEnd\BuildManager\BuildManager.cs (20)
682Debug.Assert(Monitor.IsEntered(_syncLock)); 1368Debug.Assert(!Monitor.IsEntered(_syncLock)); 1382Debug.Assert(Monitor.IsEntered(_syncLock)); 1449Debug.Assert(Monitor.IsEntered(_syncLock)); 1640Debug.Assert(!Monitor.IsEntered(_syncLock)); 1661Debug.Assert(!Monitor.IsEntered(_syncLock)); 1717Debug.Assert(!Monitor.IsEntered(_syncLock)); 2224Debug.Assert(Monitor.IsEntered(_syncLock)); 2257Debug.Assert(Monitor.IsEntered(_syncLock)); 2265Debug.Assert(Monitor.IsEntered(_syncLock)); 2382Debug.Assert(Monitor.IsEntered(_syncLock)); 2408Debug.Assert(Monitor.IsEntered(_syncLock)); 2485Debug.Assert(Monitor.IsEntered(_syncLock)); 2580Debug.Assert(Monitor.IsEntered(_syncLock)); 2630Debug.Assert(Monitor.IsEntered(_syncLock)); 2795Debug.Assert(Monitor.IsEntered(_syncLock)); 2821Debug.Assert(Monitor.IsEntered(_syncLock)); 2964Debug.Assert(Monitor.IsEntered(_syncLock)); 3164Debug.Assert(Monitor.IsEntered(_syncLock)); 3245Debug.Assert(Monitor.IsEntered(_syncLock));
BackEnd\Components\RequestBuilder\TaskHost.cs (1)
843Debug.Assert(coresAcquired >= 1);
Collections\RetrievableEntryHashSet\HashSet.cs (4)
238Debug.Assert(String.Equals(name, value.Key, StringComparison.Ordinal)); 287Debug.Assert(String.Equals(entry.Key, entry.Value.Key, StringComparison.Ordinal)); 401Debug.Assert(String.Equals(entry.Key, entry.Value.Key, StringComparison.Ordinal)); 607Debug.Assert(String.Equals(entry.Key, entry.Value.Key, StringComparison.Ordinal));
Definition\BuiltInMetadata.cs (1)
76Debug.Assert(FileUtilities.ItemSpecModifiers.IsItemSpecModifier(name));
Definition\ProjectCollection.cs (2)
1653Debug.Assert(_locker.IsWriteLockHeld); 1671Debug.Assert(_locker.IsWriteLockHeld);
Evaluation\Conditionals\Scanner.cs (1)
111Debug.Assert(-1 != _errorPosition); // We should have set it
Evaluation\LazyItemEvaluator.cs (1)
213Debug.Assert(_cache == null);
FileMatcher.cs (3)
1963Debug.Assert(projectDirectoryUnescaped != null); 1964Debug.Assert(filespecUnescaped != null); 1965Debug.Assert(Path.IsPathRooted(projectDirectoryUnescaped));
FileUtilities.cs (2)
721Debug.Assert(allowedExtensions?.Length > 0); 729Debug.Assert(!String.IsNullOrEmpty(extension) && extension[0] == '.');
Graph\ProjectGraph.cs (1)
840Debug.Assert(_evaluationContext is not null);
Utilities\FileSpecMatchTester.cs (4)
23Debug.Assert(!string.IsNullOrEmpty(unescapedFileSpec)); 24Debug.Assert(currentDirectory != null); 58Debug.Assert(!string.IsNullOrEmpty(fileToMatch)); 78Debug.Assert(!string.IsNullOrEmpty(normalizedFileToMatch));
Utilities\SimpleVersion.cs (1)
183Debug.Assert(value >= 0);
WindowsFileSystem.cs (2)
128Debug.Assert(hr != WindowsNative.ErrorFileNotFound); 190Debug.Assert(hr != WindowsNative.ErrorSuccess);
WindowsNative.cs (3)
158Debug.Assert(Status == EnumerateDirectoryStatus.UnknownError); 168Debug.Assert(Status != EnumerateDirectoryStatus.UnknownError && 178Debug.Assert(Status != EnumerateDirectoryStatus.Success);
Xml\ProjectXmlUtilities.XmlElementChildIterator.cs (4)
33Debug.Assert(element != null); 43Debug.Assert(_state > -1); 60Debug.Assert(_state == -1); 70Debug.Assert(_state == 1 && _current != null);
Microsoft.Build.Engine (6)
Conditionals\Scanner.cs (1)
128Debug.Assert(-1 != errorPosition); // We should have set it
Engine\TaskEngine.cs (5)
430Debug.Assert(howToExecuteTask == TaskExecutionMode.InferOutputsOnly); 864Debug.Assert(howToExecuteTask == TaskExecutionMode.InferOutputsOnly); 1016Debug.Assert(taskOutputSpecification.IsProperty); 1067Debug.Assert(taskOutputSpecification.IsProperty); 1163Debug.Assert(taskOutputSpecification.IsProperty);
Microsoft.Build.Engine.OM.UnitTests (7)
FileUtilities.cs (2)
721Debug.Assert(allowedExtensions?.Length > 0); 729Debug.Assert(!String.IsNullOrEmpty(extension) && extension[0] == '.');
WindowsFileSystem.cs (2)
128Debug.Assert(hr != WindowsNative.ErrorFileNotFound); 190Debug.Assert(hr != WindowsNative.ErrorSuccess);
WindowsNative.cs (3)
158Debug.Assert(Status == EnumerateDirectoryStatus.UnknownError); 168Debug.Assert(Status != EnumerateDirectoryStatus.UnknownError && 178Debug.Assert(Status != EnumerateDirectoryStatus.Success);
Microsoft.Build.Framework (62)
ArraySortHelper.cs (49)
108Debug.Assert(i != j); 121Debug.Assert(i != j); 130Debug.Assert(comparer != null); 140Debug.Assert(keys.Length > 0); 141Debug.Assert(depthLimit >= 0); 142Debug.Assert(comparer != null); 185Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 186Debug.Assert(comparer != null); 230Debug.Assert(comparer != null); 231Debug.Assert(keys.Length > 0); 248Debug.Assert(comparer != null); 249Debug.Assert(lo >= 0); 250Debug.Assert(lo < keys.Length); 410Debug.Assert(!Unsafe.AreSame(ref i, ref j)); 419Debug.Assert(keys.Length > 0); 420Debug.Assert(depthLimit >= 0); 466Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 529Debug.Assert(keys.Length > 0); 546Debug.Assert(lo >= 0); 547Debug.Assert(lo < keys.Length); 689Debug.Assert(comparer != null); 690Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 691Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 692Debug.Assert(i != j); 709Debug.Assert(i != j); 722Debug.Assert(comparer != null); 723Debug.Assert(keys.Length == values.Length); 733Debug.Assert(keys.Length > 0); 734Debug.Assert(values.Length == keys.Length); 735Debug.Assert(depthLimit >= 0); 736Debug.Assert(comparer != null); 779Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 780Debug.Assert(comparer != null); 824Debug.Assert(comparer != null); 825Debug.Assert(keys.Length > 0); 842Debug.Assert(comparer != null); 843Debug.Assert(lo >= 0); 844Debug.Assert(lo < keys.Length); 871Debug.Assert(comparer != null); 944Debug.Assert(i != j); 962Debug.Assert(i != j); 975Debug.Assert(keys.Length > 0); 976Debug.Assert(values.Length == keys.Length); 977Debug.Assert(depthLimit >= 0); 1020Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 1079Debug.Assert(keys.Length > 0); 1096Debug.Assert(lo >= 0); 1097Debug.Assert(lo < keys.Length); 1237Debug.Assert(typeof(TKey) == typeof(double) || typeof(TKey) == typeof(float));
HashHelpers.cs (2)
111Debug.Assert(divisor <= int.MaxValue); 117Debug.Assert(highbits == value % divisor);
ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
22Debug.Assert(dictionary is not null);
ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
22Debug.Assert(dictionary is not null);
SegmentedArray.cs (5)
106Debug.Assert(length > 0); 107Debug.Assert(sourceIndex >= 0); 108Debug.Assert(destinationIndex >= 0); 109Debug.Assert((uint)(sourceIndex + length) <= array.Length); 110Debug.Assert((uint)(destinationIndex + length) <= array.Length);
SegmentedDictionary`2.cs (4)
195Debug.Assert(modified); 202Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 479Debug.Assert(_buckets.Length > 0); 651Debug.Assert(newSize >= _entries.Length);
Microsoft.Build.Tasks.Core (18)
FileMatcher.cs (3)
1963Debug.Assert(projectDirectoryUnescaped != null); 1964Debug.Assert(filespecUnescaped != null); 1965Debug.Assert(Path.IsPathRooted(projectDirectoryUnescaped));
FileUtilities.cs (2)
721Debug.Assert(allowedExtensions?.Length > 0); 729Debug.Assert(!String.IsNullOrEmpty(extension) && extension[0] == '.');
GenerateApplicationManifest.cs (2)
396Debug.Assert(!String.IsNullOrEmpty(manifest.Product)); 414Debug.Assert(!String.IsNullOrEmpty(manifest.Publisher));
GenerateDeploymentManifest.cs (2)
138Debug.Assert(!String.IsNullOrEmpty(manifest.Product)); 150Debug.Assert(!String.IsNullOrEmpty(manifest.Publisher));
GenerateResource.cs (1)
3370Debug.Assert(_logger.HasLoggedErrors);
RedistList.cs (2)
895Debug.Assert(firstEntry != null && secondEntry != null); 1084Debug.Assert(name != null && frameworkDirectory != null);
ResolveManifestFiles.cs (1)
958Debug.Assert(!String.IsNullOrEmpty(targetPath));
WindowsFileSystem.cs (2)
128Debug.Assert(hr != WindowsNative.ErrorFileNotFound); 190Debug.Assert(hr != WindowsNative.ErrorSuccess);
WindowsNative.cs (3)
158Debug.Assert(Status == EnumerateDirectoryStatus.UnknownError); 168Debug.Assert(Status != EnumerateDirectoryStatus.UnknownError && 178Debug.Assert(Status != EnumerateDirectoryStatus.Success);
Microsoft.Build.Utilities.Core (10)
FileMatcher.cs (3)
1963Debug.Assert(projectDirectoryUnescaped != null); 1964Debug.Assert(filespecUnescaped != null); 1965Debug.Assert(Path.IsPathRooted(projectDirectoryUnescaped));
FileUtilities.cs (2)
721Debug.Assert(allowedExtensions?.Length > 0); 729Debug.Assert(!String.IsNullOrEmpty(extension) && extension[0] == '.');
WindowsFileSystem.cs (2)
128Debug.Assert(hr != WindowsNative.ErrorFileNotFound); 190Debug.Assert(hr != WindowsNative.ErrorSuccess);
WindowsNative.cs (3)
158Debug.Assert(Status == EnumerateDirectoryStatus.UnknownError); 168Debug.Assert(Status != EnumerateDirectoryStatus.UnknownError && 178Debug.Assert(Status != EnumerateDirectoryStatus.Success);
Microsoft.CSharp (800)
Microsoft\CSharp\RuntimeBinder\ArgumentObject.cs (1)
22Debug.Assert(type != null);
Microsoft\CSharp\RuntimeBinder\BinderHelper.cs (8)
43Debug.Assert(o.HasValue); 264Debug.Assert(action.ReturnType == typeof(object)); 273Debug.Assert(action.ReturnType == typeof(object)); 288Debug.Assert(args != null); 289Debug.Assert(args.Length != 0); 290Debug.Assert(args[0].Value is Type); 367Debug.Assert(discard <= argCount); 368Debug.Assert(argNames.Count <= argCount - discard);
Microsoft\CSharp\RuntimeBinder\CSharpBinaryOperationBinder.cs (2)
41Debug.Assert(name != null); 84Debug.Assert(_argumentInfo.Length == 2);
Microsoft\CSharp\RuntimeBinder\CSharpConvertBinder.cs (1)
35Debug.Assert(arguments.Length == 1);
Microsoft\CSharp\RuntimeBinder\CSharpGetMemberBinder.cs (1)
26Debug.Assert(arguments.Length == 1);
Microsoft\CSharp\RuntimeBinder\CSharpUnaryOperationBinder.cs (1)
70Debug.Assert(_argumentInfo.Length == 1);
Microsoft\CSharp\RuntimeBinder\Errors\ErrorHandling.cs (3)
71Debug.Assert(0 != (arg.eaf & ErrArgFlags.Unique) && 0 == (arg.eaf & ErrArgFlags.NoStr)); 101Debug.Assert(0 != (args[prgiarg[j]].eaf & ErrArgFlags.Unique)); 115Debug.Assert(0 != (arg2.eaf & ErrArgFlags.Unique) && 0 == (arg2.eaf & ErrArgFlags.NoStr));
Microsoft\CSharp\RuntimeBinder\Errors\UserStringBuilder.cs (4)
18Debug.Assert(_strBuilder == null || _strBuilder.Length == 0); 24Debug.Assert(_strBuilder != null); 189Debug.Assert(meth == prop.SetterMethod); 209Debug.Assert(meth == @event.methRemove);
Microsoft\CSharp\RuntimeBinder\ExpressionTreeCallRewriter.cs (18)
55Debug.Assert(binOp != null); 56Debug.Assert(binOp.Kind == ExpressionKind.Sequence); 57Debug.Assert(binOp.OptionalRightChild is ExprCall); 58Debug.Assert(((ExprCall)binOp.OptionalRightChild).PredefinedMethod == PREDEFMETH.PM_EXPRESSION_LAMBDA); 59Debug.Assert(binOp.OptionalLeftChild != null); 77Debug.Assert(call?.PredefinedMethod == PREDEFMETH.PM_EXPRESSION_PARAMETER); 78Debug.Assert(pExpr.OptionalRightChild is ExprWrap); 296Debug.Assert(list != null); 306Debug.Assert(pExpr.PredefinedMethod == PREDEFMETH.PM_EXPRESSION_ARRAYINDEX2); 339Debug.Assert((pExpr.Flags & EXPRFLAG.EXF_UNBOXRUNTIME) == 0); 351Debug.Assert(pm == PREDEFMETH.PM_EXPRESSION_CONVERT || 427Debug.Assert(fieldInfo != null); 501Debug.Assert(list != null); 573Debug.Assert(isLifted != null); 703Debug.Assert(pExpr.Type is NullType); 710Debug.Assert(call != null); 712Debug.Assert(pm == PREDEFMETH.PM_EXPRESSION_CONVERT || 912Debug.Assert(expressions.Count == arrinit.DimensionSizes[0]);
Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs (18)
76Debug.Assert(args.Length >= 1); 118Debug.Assert(pResult != null); 129Debug.Assert(System.Threading.Monitor.IsEntered(s_bindLock)); 206Debug.Assert(t != null); 257Debug.Assert(array[i].Type != null); 393Debug.Assert(type.IsByRef); 484Debug.Assert(argument.Info.Name != null); 693Debug.Assert(t != null); // Would have thrown in PopulateSymbolTableWithPayloadInformation already 821Debug.Assert(result != null); 857Debug.Assert(prop != null); 945Debug.Assert(arguments.Length == 1); 985Debug.Assert(arguments.Length == 2); 1137Debug.Assert(type != typeof(string)); 1145Debug.Assert(callingObject.Type is ArrayType); 1193Debug.Assert(arguments.Length == 1); 1228Debug.Assert(arguments.Length == 1); 1251Debug.Assert(arguments.Length >= 2); 1252Debug.Assert(Array.TrueForAll(arguments, a => a.Type != null));
Microsoft\CSharp\RuntimeBinder\RuntimeBinderExtensions.cs (4)
141Debug.Assert(!(member1 is MethodBase) || 223Debug.Assert(typeParam.IsGenericParameter); 322Debug.Assert(type != null); 342Debug.Assert(type != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Binding\Better.cs (9)
185Debug.Assert(index != -1); 208Debug.Assert(!(args.prgexpr[i] is ExprNamedArgumentSpecification)); 352Debug.Assert(betterMethod == BetterType.Neither); 400Debug.Assert(argType != null); 401Debug.Assert(p1 != null); 402Debug.Assert(p2 != null); 489Debug.Assert(list.Count != 0); 490Debug.Assert(list[0].mpwi != null); 515Debug.Assert(candidate != contender);
Microsoft\CSharp\RuntimeBinder\Semantics\BinOpArgInfo.cs (2)
15Debug.Assert(op1 != null); 16Debug.Assert(op2 != null);
Microsoft\CSharp\RuntimeBinder\Semantics\BinOpSig.cs (2)
107Debug.Assert(((_grflt & LiftFlags.Lift1) == 0) || ((_grflt & LiftFlags.Convert1) == 0)); 108Debug.Assert(((_grflt & LiftFlags.Lift2) == 0) || ((_grflt & LiftFlags.Convert2) == 0));
Microsoft\CSharp\RuntimeBinder\Semantics\Conversion.cs (39)
222Debug.Assert(s_simpleTypeBetter[i][i] == same); 225Debug.Assert(s_simpleTypeBetter[i][j] != same && s_simpleTypeBetter[j][i] != same); 226Debug.Assert( 230Debug.Assert( 248Debug.Assert((int)pt1 < NUM_EXT_TYPES); 249Debug.Assert((int)pt2 < NUM_EXT_TYPES); 298Debug.Assert(type1 != null && type2 != null); 360Debug.Assert(!(expr is ExprMemberGroup)); 441Debug.Assert(!(expr is ExprMemberGroup)); 442Debug.Assert(dest != null); 517Debug.Assert(expr.Type != null); 629Debug.Assert(exprSrc == null || exprSrc.Type == typeSrc); 721Debug.Assert(convCur.getClass() == aggCur); 809Debug.Assert((typeBestSrc == null) == (typeBestDst == null)); // If typeBestSrc is null then typeBestDst should be null. 810Debug.Assert(fFromImplicit); 817Debug.Assert(iuciBestSrc == -1); 823Debug.Assert(0 <= iuciBestSrc && iuciBestSrc < prguci.Count - 1); 837Debug.Assert(fToImplicit); 844Debug.Assert(iuciBestDst == -1); 850Debug.Assert(0 <= iuciBestDst && iuciBestDst < prguci.Count - 1); 863Debug.Assert((typeBestSrc == null) == (typeBestDst == null)); 866Debug.Assert(iuciBestSrc == -1 && iuciBestDst == -1); 870Debug.Assert(0 <= iuciBestSrc && iuciBestSrc < prguci.Count); 871Debug.Assert(0 <= iuciBestDst && iuciBestDst < prguci.Count); 933Debug.Assert(typeFrom != typeBestSrc || typeTo != typeBestDst); 941Debug.Assert(n <= 0); 955Debug.Assert(n <= 0); 982Debug.Assert(ctypeLiftBest <= 2); 996Debug.Assert(fLiftSrc || fLiftDst); 1034Debug.Assert(pConversionArgument != null); 1057Debug.Assert(0 <= iuciBestSrc && iuciBestSrc < prguci.Count); 1058Debug.Assert(0 <= iuciBestDst && iuciBestDst < prguci.Count); 1066Debug.Assert(pExpr != null); 1102Debug.Assert(pTransformedArgument != null); 1106Debug.Assert(pCast != null); 1126Debug.Assert(constSrc != null); 1327Debug.Assert(type1 != type2); 1361Debug.Assert(type1 != type2); 1487Debug.Assert(typeDest != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Conversions.cs (5)
78Debug.Assert(typeSrc != null); 79Debug.Assert(typeDst != null); 186Debug.Assert(!(typeArr is MethodGroupType)); 241Debug.Assert(pTypeParams.Count == pSourceArgs.Count); 242Debug.Assert(pTypeParams.Count == pTargetArgs.Count);
Microsoft\CSharp\RuntimeBinder\Semantics\ExplicitConversion.cs (31)
74Debug.Assert((_flags & CONVERTTYPE.STANDARD) == 0); 189Debug.Assert(_typeSrc != null); 190Debug.Assert(_typeDest != null); 204Debug.Assert(valueSrc.Type == _typeSrc.StripNubs()); 235Debug.Assert(_typeSrc != null); 236Debug.Assert(_typeDest != null); 299Debug.Assert(!(typeArr is MethodGroupType)); 345Debug.Assert(_typeSrc != null); 346Debug.Assert(arrayDest != null); 412Debug.Assert(_typeSrc != null); 413Debug.Assert(aggTypeDest != null); 455Debug.Assert(_typeSrc != null); 456Debug.Assert(_typeSrc.IsPredefType(PredefinedType.PT_DECIMAL)); 457Debug.Assert(aggTypeDest.IsEnumType); 497Debug.Assert(_typeSrc != null); 498Debug.Assert(aggTypeDest != null); 499Debug.Assert(aggTypeDest.IsPredefType(PredefinedType.PT_DECIMAL)); 500Debug.Assert(_typeSrc.IsEnumType); 542Debug.Assert(ok); 551Debug.Assert(_typeSrc != null); 552Debug.Assert(aggTypeDest != null); 603Debug.Assert(_typeSrc != null); 604Debug.Assert(aggTypeDest != null); 613Debug.Assert(_typeSrc.IsPredefined && aggDest.IsPredefined()); 618Debug.Assert((int)ptSrc < NUM_SIMPLE_TYPES && (int)ptDest < NUM_SIMPLE_TYPES); 622Debug.Assert(convertKind != ConvKind.Implicit); 623Debug.Assert(convertKind != ConvKind.Identity); 678Debug.Assert(_typeSrc != null); 679Debug.Assert(aggTypeDest != null); 736Debug.Assert(_typeSrc != null); 737Debug.Assert(aggTypeDest != null);
Microsoft\CSharp\RuntimeBinder\Semantics\ExpressionBinder.cs (45)
275Debug.Assert(pt != PredefinedType.PT_VOID); // use getVoidType() 290Debug.Assert(op1 is ExprCast 308Debug.Assert(pArrayType != null); 349Debug.Assert(typeDest != null); 377Debug.Assert(exprCast.Argument != null); 392Debug.Assert(mwi.Sym is MethodSymbol && (!mwi.Meth().isOverride || mwi.Meth().isHideByName)); 393Debug.Assert(pMemGroup != null); 422Debug.Assert(pResult.Type == VoidType.Instance); 437Debug.Assert(fwt.GetType() != null && fwt.Field().getClass() == fwt.GetType().OwningAggregate); 452Debug.Assert(BindingFlag.BIND_MEMBERSET == (BindingFlag)EXPRFLAG.EXF_MEMBERSET); 463Debug.Assert(pwt.Sym is PropertySymbol && 466Debug.Assert(pwt.Prop().Params.Count == 0 || pwt.Prop() is IndexerSymbol); 540Debug.Assert(pName != null); 598Debug.Assert(methCur.typeVars.Count == 0); 660Debug.Assert(arg.Type is NullableType); 716Debug.Assert(grp.SymKind == SYMKIND.SK_MethodSymbol || grp.SymKind == SYMKIND.SK_PropertySymbol && ((grp.Flags & EXPRFLAG.EXF_INDEXER) != 0)); 721Debug.Assert(grp.Name != null); 730Debug.Assert((grp.Flags & EXPRFLAG.EXF_INDEXER) != 0); 763Debug.Assert(arg != null); 796Debug.Assert(pOperand1 != null); 797Debug.Assert(pOperand1.Type != null); 805Debug.Assert(pOperand2.Type != null); 814Debug.Assert(kind >= CheckLvalueKind.Assignment && kind <= CheckLvalueKind.Increment); 823Debug.Assert(prop != null); 824Debug.Assert(prop.isLvalue()); 865Debug.Assert(!(expr is ExprLocal)); 866Debug.Assert(!(expr is ExprMemberGroup)); 872Debug.Assert(!prop.MethWithTypeSet || ExprProperty.HasIsExternalInitModifier(prop.MethWithTypeSet)); 900Debug.Assert(field.FieldWithType.Field().isReadOnly); 929Debug.Assert(prop != null); 948Debug.Assert(swt.GetType() != null && swt.GetType().OwningAggregate == swt.Sym.parent as AggregateSymbol); 1000Debug.Assert(swt.GetType().OwningAggregate == aggCalled); 1003Debug.Assert(pObject != null); 1050Debug.Assert( 1064Debug.Assert(call != null); 1077Debug.Assert(mp != null); 1078Debug.Assert(mp.Params != null); 1089Debug.Assert(!Array.Exists(@params.Items, p => p is ArgumentListType)); // We should never have picked a varargs method to bind to. 1136Debug.Assert(index != mp.Params.Count); 1190Debug.Assert(rval != null); 1331Debug.Assert(arg != null); 1332Debug.Assert(arg.Type != null); 1338Debug.Assert(iarg <= argInfo.carg); 1607Debug.Assert(ek >= ExpressionKind.FirstOp && (ek - ExpressionKind.FirstOp) < (int)EK2NAME.Length); 1645Debug.Assert(arg != null);
Microsoft\CSharp\RuntimeBinder\Semantics\EXPRExtensions.cs (2)
14Debug.Assert(f != null); 52Debug.Assert(expr?.Kind >= ExpressionKind.TypeLimit && 0 != (expr.Flags & EXPRFLAG.EXF_BINOP));
Microsoft\CSharp\RuntimeBinder\Semantics\ExprFactory.cs (11)
104Debug.Assert(type != null); 113Debug.Assert(type.FundamentalType > FUNDTYPE.FT_NONE); 114Debug.Assert(type.FundamentalType < FUNDTYPE.FT_COUNT); 160Debug.Assert(arg1 != null); 161Debug.Assert(exprKind.IsUnaryOperator() == (arg2 == null)); 176Debug.Assert(operand != null); 202Debug.Assert(wrap != null); 219Debug.Assert(last == first); 226Debug.Assert(last == first); 231Debug.Assert((last as ExprList)?.OptionalNextListNode != null); 232Debug.Assert((last as ExprList).OptionalNextListNode.Kind != ExpressionKind.List);
Microsoft\CSharp\RuntimeBinder\Semantics\GroupToArgsBinder.cs (26)
61Debug.Assert(grp != null); 62Debug.Assert(args != null); 93Debug.Assert(_pGroup.SymKind == SYMKIND.SK_MethodSymbol || _pGroup.SymKind == SYMKIND.SK_PropertySymbol && 0 != (_pGroup.Flags & EXPRFLAG.EXF_INDEXER)); 106Debug.Assert(pGroup != null); 242Debug.Assert(!_results.InaccessibleResult); 247Debug.Assert(!_misnamed); 254Debug.Assert(!_mpwiBogus); 274Debug.Assert(type.IsInterfaceType); 345Debug.Assert(pmethBest != null); 572Debug.Assert(optionalArgument != null); 631Debug.Assert(meth is MethodSymbol); 647Debug.Assert(method.parent is AggregateSymbol); 852Debug.Assert(_methList.IsEmpty() || _methList.Head().mpwi.MethProp() != _pCurrentSym); 874Debug.Assert(methSym.typeVars.Count > 0); 1034Debug.Assert(pMethod != null); 1036Debug.Assert(pMethod.IsParameterOptional(iParam)); 1076Debug.Assert(_pGroup.SymKind == SYMKIND.SK_MethodSymbol || _pGroup.SymKind == SYMKIND.SK_PropertySymbol && 0 != (_pGroup.Flags & EXPRFLAG.EXF_INDEXER)); 1077Debug.Assert(_pGroup.TypeArgs.Count == 0 || _pGroup.SymKind == SYMKIND.SK_MethodSymbol); 1078Debug.Assert(0 == (_pGroup.Flags & EXPRFLAG.EXF_USERCALLABLE) || _results.BestResult.MethProp().isUserCallable()); 1082Debug.Assert(_results.BestResult.MethProp() is MethodSymbol); 1101Debug.Assert(_methList.IsEmpty()); 1155Debug.Assert(!_results.BestResult || _results.BestResult.MethProp().getClass().IsDelegate()); 1156Debug.Assert(!_results.BestResult || _results.BestResult.GetType().OwningAggregate.IsDelegate()); 1174Debug.Assert(_results.UninferableResult.Sym is MethodSymbol); 1218Debug.Assert(0 == (_pGroup.Flags & EXPRFLAG.EXF_CTOR)); 1224Debug.Assert(!(_pGroup.ParentType is TypeParameterType));
Microsoft\CSharp\RuntimeBinder\Semantics\ImplicitConversion.cs (18)
87Debug.Assert(_typeSrc != null && _typeDest != null); // types must be supplied. 88Debug.Assert(_exprSrc == null || _typeSrc == _exprSrc.Type); // type of source should be correct if source supplied 89Debug.Assert(!_needsExprDest || _exprSrc != null); // need source expr to create dest expr 144Debug.Assert(ftDest != FUNDTYPE.FT_NONE || _typeDest is ParameterModifierType); 268Debug.Assert(0 != (~_flags & (CONVERTTYPE.STANDARD | CONVERTTYPE.ISEXPLICIT))); 269Debug.Assert(_exprSrc == null || _exprSrc.Type == _typeSrc); 270Debug.Assert(!_needsExprDest || _exprSrc != null); 271Debug.Assert(_typeSrc != nubDst); // BindImplicitConversion should have taken care of this already. 278Debug.Assert(atsDst != _typeSrc); 304Debug.Assert(_typeSrc == typeSrcBase); 347Debug.Assert(exprTmp.Type == nubDst); 671Debug.Assert(aggSrc.getThisType().IsSimpleType); 672Debug.Assert(_typeDest.IsSimpleType); 674Debug.Assert(aggSrc.IsPredefined() && _typeDest.IsPredefined); 679Debug.Assert((int)ptSrc < NUM_SIMPLE_TYPES && (int)ptDest < NUM_SIMPLE_TYPES); 701Debug.Assert(ptSrc == PredefinedType.PT_FLOAT || ptSrc == PredefinedType.PT_DOUBLE); 702Debug.Assert(0 != (_flags & CONVERTTYPE.ISEXPLICIT)); 708Debug.Assert(convertKind != ConvKind.Identity);
Microsoft\CSharp\RuntimeBinder\Semantics\MemberLookup.cs (30)
70Debug.Assert(type != null && sym != null); 85Debug.Assert(_csym == 1); 86Debug.Assert(_prgtype[0] == type); 117Debug.Assert(!(symCur is AggregateSymbol)); 228Debug.Assert(_fMulti || typeCur == _prgtype[0]); 299Debug.Assert(!fInaccess || !fFoundSome); 328Debug.Assert(sym is PropertySymbol); 360Debug.Assert(!_swtFirst || _fMulti); 361Debug.Assert(typeStart != null && !typeStart.IsInterfaceType && (ptypeEnd == null || typeStart != ptypeEnd)); 369Debug.Assert(!typeCur.IsInterfaceType); 395Debug.Assert(typeCur == typeEnd); 405Debug.Assert(!_swtFirst || _fMulti); 406Debug.Assert(typeStart == null || typeStart.IsInterfaceType); 407Debug.Assert(typeStart != null || types.Count != 0); 420Debug.Assert(type.IsInterfaceType); 430Debug.Assert(typeCur != null); 435Debug.Assert(typeCur != null && typeCur.IsInterfaceType); 444Debug.Assert(type.IsInterfaceType); 472Debug.Assert(CSemanticChecker.CheckBogus(swt.Sym)); 475Debug.Assert((meth1 ?? meth2) != null); 523Debug.Assert((flags & ~MemLookFlags.All) == 0); 524Debug.Assert(obj == null || obj.Type != null); 525Debug.Assert(typeSrc is AggregateType); 545Debug.Assert((_flags & (MemLookFlags.Ctor | MemLookFlags.NewObj | MemLookFlags.Operator | MemLookFlags.BaseCall)) == 0); 568Debug.Assert(typeCls2 != null && typeCls2.IsPredefType(PredefinedType.PT_OBJECT)); 596Debug.Assert(FError()); 600Debug.Assert(!_swtFirst || _swtAmbig); 617Debug.Assert(_typeSrc is AggregateType); 645Debug.Assert(_arity != 0); 646Debug.Assert(!(_swtBadArity.Sym is AggregateSymbol));
Microsoft\CSharp\RuntimeBinder\Semantics\MemberLookupResults.cs (2)
24Debug.Assert(containingTypes != null); 25Debug.Assert(containingTypes.Count != 0);
Microsoft\CSharp\RuntimeBinder\Semantics\MethodIterator.cs (3)
29Debug.Assert(name != null); 30Debug.Assert(containingTypes != null); 31Debug.Assert(containingTypes.Count != 0);
Microsoft\CSharp\RuntimeBinder\Semantics\MethodTypeInferrer.cs (55)
90Debug.Assert(pMethod != null); 91Debug.Assert(pMethod.typeVars.Count > 0); 92Debug.Assert(pMethod.isParamArray || pMethod.Params == pMethodFormalParameterTypes); 98Debug.Assert(pMethodArguments != null); 99Debug.Assert(pMethodFormalParameterTypes != null); 100Debug.Assert(pMethodArguments.carg <= pMethodFormalParameterTypes.Count); 147Debug.Assert(0 <= iParam); 148Debug.Assert(iParam < _pMethodTypeParameters.Count); 156Debug.Assert(pParam != null); 157Debug.Assert(pParam.IsMethodTypeParameter); 159Debug.Assert(_pMethodTypeParameters[iParam] == pParam); 181Debug.Assert(IsUnfixed(pParam)); 193Debug.Assert(IsUnfixed(pParam)); 205Debug.Assert(IsUnfixed(pParam)); 217Debug.Assert(0 <= iParam); 218Debug.Assert(iParam < _pMethodTypeParameters.Count); 254Debug.Assert(_pMethodFormalParameterTypes != null); 255Debug.Assert(_pMethodArguments != null); 256Debug.Assert(_pMethodArguments.carg <= _pMethodFormalParameterTypes.Count); 399Debug.Assert(res != NewInferenceResult.NoProgress); 579Debug.Assert(_ppDependencies == null); 593Debug.Assert(_ppDependencies != null); 599Debug.Assert(0 <= iParam && iParam < _pMethodTypeParameters.Count); 600Debug.Assert(0 <= jParam && jParam < _pMethodTypeParameters.Count); 614Debug.Assert(_ppDependencies != null); 615Debug.Assert(0 <= iParam && iParam < _pMethodTypeParameters.Count); 616Debug.Assert(0 <= jParam && jParam < _pMethodTypeParameters.Count); 654Debug.Assert(_ppDependencies != null); 677Debug.Assert(_ppDependencies != null); 694Debug.Assert(_ppDependencies != null); 728Debug.Assert(0 <= iParam && iParam < _pMethodTypeParameters.Count); 743Debug.Assert(0 <= iParam && iParam < _pMethodTypeParameters.Count); 871Debug.Assert(pSource != null); 872Debug.Assert(pDest != null); 873Debug.Assert(pSource.OwningAggregate == pDest.OwningAggregate); 878Debug.Assert(pSourceArgs != null); 879Debug.Assert(pDestArgs != null); 880Debug.Assert(pSourceArgs.Count == pDestArgs.Count); 1233Debug.Assert(pSource != null); 1234Debug.Assert(pDest != null); 1235Debug.Assert(pSource.OwningAggregate == pDest.OwningAggregate); 1241Debug.Assert(pTypeParams != null); 1242Debug.Assert(pSourceArgs != null); 1243Debug.Assert(pDestArgs != null); 1245Debug.Assert(pTypeParams.Count == pSourceArgs.Count); 1246Debug.Assert(pTypeParams.Count == pDestArgs.Count); 1540Debug.Assert(pSource != null); 1541Debug.Assert(pDest != null); 1542Debug.Assert(pSource.OwningAggregate == pDest.OwningAggregate); 1548Debug.Assert(pTypeParams != null); 1549Debug.Assert(pSourceArgs != null); 1550Debug.Assert(pDestArgs != null); 1552Debug.Assert(pTypeParams.Count == pSourceArgs.Count); 1553Debug.Assert(pTypeParams.Count == pDestArgs.Count); 1588Debug.Assert(IsUnfixed(iParam));
Microsoft\CSharp\RuntimeBinder\Semantics\Nullable.cs (5)
13Debug.Assert(expr != null); 31Debug.Assert(pExpr != null && !(pExpr is ExprList)); 41Debug.Assert(exprSrc != null && exprSrc.Type is NullableType); 47Debug.Assert(args != null && !(args is ExprList)); 65Debug.Assert(exprSrc != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Operators.cs (128)
177Debug.Assert(prgbofs != null); 193Debug.Assert(rgbofs != null); 238Debug.Assert(typeSig1.IsValueType); 265Debug.Assert(typeSig1.IsValueType); 322Debug.Assert(typeSig2.IsValueType); 350Debug.Assert(typeSig2.IsValueType); 399Debug.Assert(binopSignatures != null); 488Debug.Assert(arg1 != null); 489Debug.Assert(arg2 != null); 527Debug.Assert(binopSignatures.Count > 0); 553Debug.Assert(bestBinopSignature < binopSignatures.Count); 585Debug.Assert(bofs.fnkind != BinOpFuncKind.BoolBitwiseOp); 605Debug.Assert(bofs.Type1() is NullableType || bofs.Type2() is NullableType); 649Debug.Assert((exprRes.Flags & EXPRFLAG.EXF_LVALUE) == 0); 737Debug.Assert(!(typeDst is NullableType)); 770Debug.Assert(!(typeDst is NullableType)); 811Debug.Assert(info.type1 is NullableType); 822Debug.Assert(info.type2 is NullableType); 948Debug.Assert(type1.FundamentalType != FUNDTYPE.FT_VAR); 964Debug.Assert(type2.FundamentalType != FUNDTYPE.FT_VAR); 999Debug.Assert( 1002Debug.Assert( 1049Debug.Assert(Enum.IsDefined(bt1)); 1050Debug.Assert(Enum.IsDefined(bt2)); 1156Debug.Assert(pArgument != null); 1159Debug.Assert(type != null); 1192Debug.Assert(pResult != null); 1259Debug.Assert(nBestSignature < pSignatures.Count); 1299Debug.Assert(pArgument != null); 1300Debug.Assert(pArgument.Type != null); 1316Debug.Assert(pRawType == pArgumentType); 1317Debug.Assert(pArgumentType is AggregateType); 1345Debug.Assert(!(pArgumentType is PointerType)); 1358Debug.Assert(pArgument != null); 1393Debug.Assert(pArgument != null); 1394Debug.Assert(pArgument.Type != null); 1516Debug.Assert(arg?.Type != null); 1530Debug.Assert((exprRes.Flags & EXPRFLAG.EXF_LVALUE) == 0); 1553Debug.Assert(Enum.IsDefined(bt)); 1567Debug.Assert(arg1.Type.IsPredefined && arg2.Type.IsPredefined && arg1.Type.PredefinedType == arg2.Type.PredefinedType); 1577Debug.Assert(arg.Type.IsPredefined); 1587Debug.Assert(arg1.Type.IsPredefined && arg2.Type.IsPredefined && arg1.Type.PredefinedType == arg2.Type.PredefinedType); 1597Debug.Assert(arg.Type.IsPredefined); 1608Debug.Assert(ek == ExpressionKind.Add || ek == ExpressionKind.Subtract); 1632Debug.Assert(ek == ExpressionKind.Add || ek == ExpressionKind.Subtract); 1641Debug.Assert(type.FundamentalType != FUNDTYPE.FT_PTR); // Can't have a pointer. 1645Debug.Assert(type.IsPredefType(PredefinedType.PT_DECIMAL)); 1704Debug.Assert(ek == ExpressionKind.Add || ek == ExpressionKind.Subtract); 1705Debug.Assert(!uofs.isLifted()); 1707Debug.Assert(arg != null); 1711Debug.Assert(!(type is NullableType)); 1731Debug.Assert(ek == ExpressionKind.Add || ek == ExpressionKind.Subtract); 1732Debug.Assert(uofs.isLifted()); 1735Debug.Assert(arg != null); 1765Debug.Assert(arg1.Type.IsPredefType(PredefinedType.PT_DECIMAL) && arg2.Type.IsPredefType(PredefinedType.PT_DECIMAL)); 1768Debug.Assert(typeDec != null); 1807Debug.Assert(arg.Type.IsPredefType(PredefinedType.PT_DECIMAL)); 1808Debug.Assert(ek == ExpressionKind.Negate || ek == ExpressionKind.UnaryPlus); 1811Debug.Assert(typeDec != null); 1827Debug.Assert(ek == ExpressionKind.Add); 1828Debug.Assert(arg1.Type.IsPredefType(PredefinedType.PT_STRING) || arg2.Type.IsPredefType(PredefinedType.PT_STRING)); 1839Debug.Assert(ek == ExpressionKind.LeftShirt || ek == ExpressionKind.RightShift); 1840Debug.Assert(arg1.Type.IsPredefined); 1841Debug.Assert(arg2.Type.IsPredefType(PredefinedType.PT_INT)); 1844Debug.Assert(ptOp == PredefinedType.PT_INT || ptOp == PredefinedType.PT_UINT || ptOp == PredefinedType.PT_LONG || ptOp == PredefinedType.PT_ULONG); 1857Debug.Assert(arg1 != null); 1858Debug.Assert(arg2 != null); 1859Debug.Assert(arg1.Type.IsPredefType(PredefinedType.PT_BOOL) || arg1.Type is NullableType argNubType1 && argNubType1.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL)); 1860Debug.Assert(arg2.Type.IsPredefType(PredefinedType.PT_BOOL) || arg2.Type is NullableType argNubType2 && argNubType2.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL)); 1868Debug.Assert(ek == ExpressionKind.BitwiseAnd || ek == ExpressionKind.BitwiseOr); 1869Debug.Assert(expr1.Type.IsPredefType(PredefinedType.PT_BOOL) || expr1.Type is NullableType expNubType1 && expNubType1.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL)); 1870Debug.Assert(expr2.Type.IsPredefType(PredefinedType.PT_BOOL) || expr2.Type is NullableType expNubType2 && expNubType2.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL)); 1896Debug.Assert((exprRes.Flags & EXPRFLAG.EXF_LVALUE) == 0); 1912Debug.Assert(arg.Type.IsPredefType(PredefinedType.PT_BOOL)); 1913Debug.Assert(ek == ExpressionKind.LogicalNot); 1937Debug.Assert(ek == ExpressionKind.Eq || ek == ExpressionKind.NotEq); 1938Debug.Assert(arg1.Type.IsPredefType(PredefinedType.PT_STRING) && arg2.Type.IsPredefType(PredefinedType.PT_STRING)); 1955Debug.Assert(ek == ExpressionKind.Eq || ek == ExpressionKind.NotEq); 1971Debug.Assert(ek == ExpressionKind.Add || ek == ExpressionKind.Subtract || ek == ExpressionKind.Eq || ek == ExpressionKind.NotEq); 1972Debug.Assert(arg1.Type == arg2.Type && (arg1.Type.IsDelegateType || arg1.Type.IsPredefType(PredefinedType.PT_DELEGATE))); 2014Debug.Assert(typeEnum != null); 2031Debug.Assert(!typeDst.IsPredefType(PredefinedType.PT_BOOL)); 2041Debug.Assert(ek == ExpressionKind.Add || ek == ExpressionKind.Subtract); 2055Debug.Assert(typeEnum != null); 2071Debug.Assert((exprRes.Flags & EXPRFLAG.EXF_LVALUE) == 0); 2088Debug.Assert(ek == ExpressionKind.BitwiseNot); 2089Debug.Assert((ExprCast)arg != null); 2090Debug.Assert(((ExprCast)arg).Argument.Type.IsEnumType); 2190Debug.Assert(ptOp == PredefinedType.PT_INT || ptOp == PredefinedType.PT_UINT || ptOp == PredefinedType.PT_LONG || ptOp == PredefinedType.PT_ULONG); 2192Debug.Assert(typeOp != null); 2193Debug.Assert(op1 != null && op1.Type == typeOp); 2194Debug.Assert(op2 == null || op2.Type == typeOp); 2195Debug.Assert((op2 == null) == (kind == ExpressionKind.Negate || kind == ExpressionKind.UnaryPlus || kind == ExpressionKind.BitwiseNot)); 2206Debug.Assert((exprRes.Flags & EXPRFLAG.EXF_LVALUE) == 0); 2244Debug.Assert(ptOp == PredefinedType.PT_INT || ptOp == PredefinedType.PT_UINT || ptOp == PredefinedType.PT_LONG || ptOp == PredefinedType.PT_ULONG); 2246Debug.Assert(typeOp != null); 2247Debug.Assert(op != null && op.Type == typeOp); 2260Debug.Assert(0 == (exprRes.Flags & EXPRFLAG.EXF_LVALUE)); 2275Debug.Assert(op2 == null || op1.Type == op2.Type); 2276Debug.Assert(op1.Type.IsPredefType(PredefinedType.PT_FLOAT) || op1.Type.IsPredefType(PredefinedType.PT_DOUBLE)); 2307Debug.Assert(op1 != null); 2308Debug.Assert(op2 != null); 2317Debug.Assert(op1 != null); 2332Debug.Assert(pCall != null); 2333Debug.Assert(pCall.MethWithInst.Meth() != null); 2334Debug.Assert(pCall.OptionalArguments != null); 2335Debug.Assert(kind == ExpressionKind.LogicalAnd || kind == ExpressionKind.LogicalOr); 2339Debug.Assert(pCall.MethWithInst.Meth().Params.Count == 2); 2347Debug.Assert(list != null); 2457Debug.Assert(method.typeVars.Count == 0); 2493Debug.Assert(name != null); 2543Debug.Assert(cats == 2); 2572Debug.Assert(pmethBest.ctypeLift == 2); 2620Debug.Assert(Params != paramsRaw); 2621Debug.Assert(paramsRaw[0] == Params[0].BaseOrParameterOrElementType); 2622Debug.Assert(paramsRaw[1] == Params[1].BaseOrParameterOrElementType); 2641Debug.Assert(paramsRaw[0] == paramsRaw[1]); 2642Debug.Assert(typeRetRaw.IsPredefType(PredefinedType.PT_BOOL)); 2650Debug.Assert(typeRetRaw.IsPredefType(PredefinedType.PT_BOOL)); 2658Debug.Assert(!(ek == ExpressionKind.Eq || ek == ExpressionKind.NotEq) || nonLiftedArg1.Type == nonLiftedArg2.Type); 2682Debug.Assert(argType1.IsEnumType || argType2.IsEnumType); 2689Debug.Assert(type1 == typeEnum || type1 == typeEnum.UnderlyingEnumType); 2690Debug.Assert(type2 == typeEnum || type2 == typeEnum.UnderlyingEnumType); 2699Debug.Assert(type1 == type2); 2703Debug.Assert(type1 != type2); 2712Debug.Assert(ek.IsRelational()); 2725Debug.Assert(methSym != null); 2740Debug.Assert(methSym != null);
Microsoft\CSharp\RuntimeBinder\Semantics\PredefinedMembers.cs (22)
214Debug.Assert(propertyName != null); 215Debug.Assert(propertyGetter >= 0 && propertyGetter < PREDEFMETH.PM_COUNT); 223Debug.Assert(property != null); 233Debug.Assert(signature != null); 253Debug.Assert(current >= 0 && (int)current < (int)PredefinedType.PT_COUNT); 274Debug.Assert(signature != null); 279Debug.Assert(count >= 0); 296Debug.Assert((int)GetMethInfo((PREDEFMETH)i).method == i); 300Debug.Assert((int)GetPropInfo((PREDEFPROP)i).property == i); 308Debug.Assert(property >= 0 && property < PREDEFPROP.PP_COUNT); 315Debug.Assert(method >= 0 && method < PREDEFMETH.PM_COUNT); 330Debug.Assert(signature != null); 331Debug.Assert(cMethodTyVars >= 0); 332Debug.Assert(methodName != null); 333Debug.Assert(type != null); 338Debug.Assert(returnType != null); 341Debug.Assert(argumentTypes != null); 394Debug.Assert(result >= 0 && result < PREDEFMETH.PM_COUNT); 412Debug.Assert(property >= 0 && property < PREDEFPROP.PP_COUNT); 413Debug.Assert(s_predefinedProperties[(int)property].property == property); 420Debug.Assert(method >= 0 && method < PREDEFMETH.PM_COUNT); 421Debug.Assert(s_predefinedMethods[(int)method].method == method);
Microsoft\CSharp\RuntimeBinder\Semantics\SemanticChecker.cs (13)
35Debug.Assert(symCheck != null); 36Debug.Assert(atsCheck == null || symCheck.parent == atsCheck.OwningAggregate); 37Debug.Assert(typeThru == null || 51Debug.Assert(atsCheck != null); 71Debug.Assert(atsCheck != null); 85Debug.Assert(type != null); 92Debug.Assert(type is VoidType || type is TypeParameterType); 119Debug.Assert(symCheck != null); 120Debug.Assert(atsCheck == null || symCheck.parent == atsCheck.OwningAggregate); 121Debug.Assert(typeThru == null || 210Debug.Assert(symCheck.GetAccess() == ACCESS.ACC_PROTECTED 228Debug.Assert(agg != aggCheck); // We checked for this above. 256Debug.Assert(!CheckAccess(swtBad.Sym, swtBad.GetType(), symWhere, typeQual) ||
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\AggregateSymbol.cs (3)
86Debug.Assert(GetTypeVars() == GetTypeVarsAll() || isNested()); 286Debug.Assert(GetOuterAgg().GetTypeVars() != null); 287Debug.Assert(GetOuterAgg().GetTypeVarsAll() != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\FieldSymbol.cs (1)
41Debug.Assert(isEvent);
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\MethodOrPropertySymbol.cs (9)
92Debug.Assert(index < Params.Count); 103Debug.Assert(_optionalParameterIndex != null); 125Debug.Assert(index < Params.Count); 126Debug.Assert(_defaultParameterIndex != null); 132Debug.Assert(_defaultParameterIndex != null); 140Debug.Assert(HasDefaultParameterValue(index)); 141Debug.Assert(_defaultParameterIndex != null); 147Debug.Assert(HasDefaultParameterValue(index)); 164Debug.Assert(IsMarshalAsParameter(index));
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\MethodSymbol.cs (6)
40Debug.Assert(!_inferenceMustFail); 114Debug.Assert(isPropertyAccessor()); 120Debug.Assert(isPropertyAccessor()); 126Debug.Assert(isEventAccessor()); 132Debug.Assert(isEventAccessor()); 139Debug.Assert(MethKind == MethodKindEnum.ExplicitConv || MethKind == MethodKindEnum.ImplicitConv);
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\ParentSymbol.cs (5)
24Debug.Assert(sym != null /*&& this != null */); 27Debug.Assert(sym.parent == null || sym.parent == this); 29Debug.Assert(sym.nextChild == null); 33Debug.Assert(firstChild == null); 48Debug.Assert(_lastChild == psym || count == 0);
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\Symbol.cs (1)
86Debug.Assert(_access != ACCESS.ACC_UNKNOWN);
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\SymbolLoader.cs (28)
23Debug.Assert(atsDer != null); 24Debug.Assert(pBase != null); 47Debug.Assert(pDerived != null); 48Debug.Assert(pBase != null); 58Debug.Assert(pDerived != null); 59Debug.Assert(pBase != null); 96Debug.Assert(pSource != null); 97Debug.Assert(pDest != null); 108Debug.Assert(pSource != null); 109Debug.Assert(pDest != null); 123Debug.Assert(pSource != null); 124Debug.Assert(pDest != null); 157Debug.Assert(atsDest.TypeArgsAll.Count == 1); 165Debug.Assert(pSource != null); 166Debug.Assert(pDest != null); 167Debug.Assert(!(pSource is TypeParameterType)); 330Debug.Assert(pSource != null && pSource.IsInterfaceType); 331Debug.Assert(pDest != null && pDest.IsInterfaceType); 340Debug.Assert(pSource != null && pSource.IsDelegateType); 341Debug.Assert(pDest != null && pDest.IsDelegateType); 350Debug.Assert(pSource != null); 351Debug.Assert(pDest != null); 367Debug.Assert(pTypeParams.Count == pSourceArgs.Count); 368Debug.Assert(pTypeParams.Count == pDestArgs.Count); 405Debug.Assert(pSource != null); 406Debug.Assert(pDest != null); 407Debug.Assert(!(pSource is TypeParameterType)); 486Debug.Assert(!derived.IsEnum() && !@base.IsEnum());
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\SymbolStore.cs (3)
28Debug.Assert(child.nextSameName == null); 29Debug.Assert(child.parent == null || child.parent == parent); 54Debug.Assert(sym != null && sym.nextSameName == null);
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\SymFactory.cs (7)
87Debug.Assert(name != null); 88Debug.Assert(parent != null); 104Debug.Assert(name != null); 108Debug.Assert(sym != null); 128Debug.Assert(sym != null); 136Debug.Assert(sym != null); 172Debug.Assert(sym != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\TypeParameterSymbol.cs (1)
61Debug.Assert(index >= _nIndexInOwnParameters);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\BinaryOperator.cs (7)
13Debug.Assert(kind > ExpressionKind.TypeLimit); 14Debug.Assert(left != null); 15Debug.Assert(right != null); 24Debug.Assert(kind > ExpressionKind.TypeLimit); 25Debug.Assert(left != null); 26Debug.Assert(right != null); 27Debug.Assert(call != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\BoundAnonymousFunction.cs (3)
13Debug.Assert(type != null); 14Debug.Assert(type.IsDelegateType); 15Debug.Assert(argumentScope != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Call.cs (1)
13Debug.Assert(
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Cast.cs (2)
14Debug.Assert(argument != null); 15Debug.Assert((flags & ~(EXPRFLAG.EXF_CAST_ALL | EXPRFLAG.EXF_MASK_ANY)) == 0);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Class.cs (1)
13Debug.Assert(type != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\CompoundOperator.cs (3)
13Debug.Assert((flags & ~EXPRFLAG.EXF_MASK_ANY) == 0); 26Debug.Assert(left != null); 27Debug.Assert(op != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Concatenate.cs (4)
14Debug.Assert(first?.Type != null); 15Debug.Assert(second?.Type != null); 16Debug.Assert(first.Type.IsPredefType(PredefinedType.PT_STRING) || second.Type.IsPredefType(PredefinedType.PT_STRING)); 29Debug.Assert(second.Type.IsPredefType(PredefinedType.PT_STRING));
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\EXPR.cs (2)
34Debug.Assert(!(this is ExprList)); 35Debug.Assert(_type != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\ExprOperator.cs (1)
13Debug.Assert(kind.IsUnaryOperator() || kind > ExpressionKind.TypeLimit);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\FieldInfo.cs (2)
13Debug.Assert(field != null); 14Debug.Assert(fieldType != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\MemberGroup.cs (1)
14Debug.Assert(
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\MethodInfo.cs (4)
16Debug.Assert(method != null); 17Debug.Assert(methodType != null); 56Debug.Assert(m.Name == methodInfo.Name && 125Debug.Assert(c.GetParameters() == null || c.GetParameters().Length == genericInstanceParams.Count);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\PropertyInfo.cs (3)
16Debug.Assert(propertySymbol != null); 17Debug.Assert(propertyType != null); 52Debug.Assert((p.Name == propertyInfo.Name) &&
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\UnaryOperator.cs (7)
13Debug.Assert(kind.IsUnaryOperator()); 14Debug.Assert(operand != null); 21Debug.Assert(kind.IsUnaryOperator()); 22Debug.Assert(operand != null); 23Debug.Assert(type != null); 24Debug.Assert(call != null); 25Debug.Assert(userMethod != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\UserDefinedConversion.cs (2)
15Debug.Assert(argument != null); 16Debug.Assert(call != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\UserDefinedLogicalOperator.cs (3)
13Debug.Assert(trueFalseCall != null); 14Debug.Assert((operatorCall?.OptionalArguments as ExprList)?.OptionalElement != null); 21Debug.Assert(FirstOperandToExamine != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Visitors\ExpressionTreeRewriter.cs (55)
18Debug.Assert(expr != null); 33Debug.Assert(assignment != null); 89Debug.Assert(anonmeth != null); 97Debug.Assert(createParameters != null); 98Debug.Assert(anonmeth.Expression != null); 100Debug.Assert(anonmeth.ArgumentScope.nextChild == null); 113Debug.Assert(expr != null); 120Debug.Assert(local != null); 121Debug.Assert(local.Local.wrap != null); 128Debug.Assert(expr != null); 145Debug.Assert(expr != null); 152Debug.Assert(pExpr != null); 186Debug.Assert(expr != null); 206Debug.Assert(expr != null); 220Debug.Assert(pExpr != null); 234Debug.Assert(pExpr != null); 248Debug.Assert(expr != null); 305Debug.Assert(!expr.MethWithInst.Meth().isVirtual || expr.MemberGroup.OptionalObject != null); 313Debug.Assert(expr != null); 337Debug.Assert(expr != null); 348Debug.Assert(expr != null); 355Debug.Assert(expr != null); 362Debug.Assert(expr != null); 364Debug.Assert(memberGroup.IsDelegate); 366Debug.Assert(oldObject != null); 376Debug.Assert(expr != null); 405Debug.Assert(origL != null); 406Debug.Assert(origR != null); 420Debug.Assert(expr.IsLifted); 427Debug.Assert(expr.IsLifted); 434Debug.Assert(expr.IsLifted); 441Debug.Assert(expr.IsLifted); 477Debug.Assert(expr != null); 494Debug.Assert(!(origOp.Type is NullableType nub) || !nub.UnderlyingType.IsEnumType); 501Debug.Assert(expr != null); 545Debug.Assert(udcall.Kind == ExpressionKind.Call || udcall.Kind == ExpressionKind.UserLogicalOp); 549Debug.Assert(args.OptionalNextListNode.Kind != ExpressionKind.List); 556Debug.Assert(userLogOp != null); 558Debug.Assert(args.OptionalNextListNode.Kind != ExpressionKind.List); 581Debug.Assert(expr != null); 592Debug.Assert(arg != null && arg.Kind != ExpressionKind.List); 632Debug.Assert(expr != null); 654Debug.Assert(args.OptionalNextListNode.Kind != ExpressionKind.List); 682Debug.Assert(pArgument != null); 775Debug.Assert(pUDConversion is ExprUserDefinedConversion); 813Debug.Assert(anonmeth.Expression != null); 833Debug.Assert(expr != null); 834Debug.Assert(expr.MethWithInst.Meth().IsConstructor()); 976Debug.Assert(expr != null); 977Debug.Assert(pp1 != null); 978Debug.Assert(pp1 != null); 979Debug.Assert(pp2 != null); 980Debug.Assert(pp2 != null); 984Debug.Assert(orig1 != null && orig2 != null); 1022Debug.Assert(pExpr != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Visitors\ExprVisitorBase.cs (17)
94Debug.Assert(pExpr != null); 125Debug.Assert(exprRet != null); 128Debug.Assert(exprRet != null); 134Debug.Assert(exprRet != null); 137Debug.Assert(exprRet != null); 155Debug.Assert(exprRet != null); 161Debug.Assert(exprRet != null); 164Debug.Assert(exprRet != null); 167Debug.Assert(exprRet != null); 176Debug.Assert(exprRet != null); 182Debug.Assert(exprRet != null); 200Debug.Assert(exprRet != null); 208Debug.Assert(exprRet != null); 254Debug.Assert(exprRet != null); 257Debug.Assert(exprRet != null); 263Debug.Assert(exprRet != null); 266Debug.Assert(exprRet != null);
Microsoft\CSharp\RuntimeBinder\Semantics\TypeBind.cs (11)
79Debug.Assert(typeVars.Count == typeArgsThis.Count); 125Debug.Assert(mwi.Meth() != null && mwi.GetType() != null && mwi.TypeArgs != null); 126Debug.Assert(mwi.Meth().typeVars.Count == mwi.TypeArgs.Count); 127Debug.Assert(mwi.GetType().OwningAggregate == mwi.Meth().getClass()); 142Debug.Assert(typeVars.Count == typeArgs.Count); 143Debug.Assert(typeVars.Count > 0); 144Debug.Assert(flags == CheckConstraintsFlags.None || flags == CheckConstraintsFlags.NoErrors); 164Debug.Assert(!(arg is PointerType)); 165Debug.Assert(!arg.IsStaticClass); 253Debug.Assert(typeBnd.IsInterfaceType); 334Debug.Assert(typeBnd is AggregateType || typeBnd is TypeParameterType || typeBnd is ArrayType);
Microsoft\CSharp\RuntimeBinder\Semantics\Types\AggregateType.cs (7)
30Debug.Assert(typeArgsThis != null); 62Debug.Assert(outerType == null || outerType.TypeArgsAll != null); 105Debug.Assert(baseClass != null); 194Debug.Assert(type.IsInterfaceType); 222Debug.Assert(IsPredefined); 298Debug.Assert(IsEnumType); 383Debug.Assert(
Microsoft\CSharp\RuntimeBinder\Semantics\Types\PredefinedTypes.cs (1)
187Debug.Assert(s_types[i].Type == (PredefinedType)i);
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeArray.cs (3)
88Debug.Assert(types != null); 101Debug.Assert(Count >= 0); 102Debug.Assert(Array.TrueForAll(Items, item => item != null));
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeManager.cs (40)
45Debug.Assert(iv >= 0); 62Debug.Assert(tpt != null); 69Debug.Assert(args > 0 && args < 32767); 70Debug.Assert(args == 1 || !isSZArray); 83Debug.Assert(pArray.Rank == args); 84Debug.Assert(pArray.ElementType == elementType); 95Debug.Assert(agg.GetTypeVars().Count == typeArgs.Count); 101Debug.Assert(!pAggregate.ConstraintError.HasValue); 106Debug.Assert(pAggregate.OwningAggregate == agg); 107Debug.Assert(pAggregate.TypeArgsThis != null && pAggregate.TypeArgsAll != null); 108Debug.Assert(pAggregate.TypeArgsThis == typeArgs); 115Debug.Assert(typeArgsAll != null && typeArgsAll.Count == agg.GetTypeVarsAll().Count); 126Debug.Assert(cvarOuter <= typeArgsAll.Count); 145Debug.Assert(pPointer.ReferentType == baseType); 174Debug.Assert(pParamModifier.ParameterType == paramType); 184Debug.Assert(typeSrc != null); 191Debug.Assert(typeSrc != null); 298Debug.Assert(tvs.GetIndexInOwnParameters() == tvs.GetIndexInTotalParameters()); 301Debug.Assert(pctx.MethodTypes != null); 317Debug.Assert(typeDst.Equals(SubstType(typeSrc, typeArgsCls, typeArgsMeth, denormMeth))); 378Debug.Assert(typeDst.TypeKind != typeSrc.TypeKind); 413Debug.Assert(atsSrc.TypeArgsAll.Count == atsDst.TypeArgsAll.Count); 434Debug.Assert(typeDst != typeSrc); 438Debug.Assert(tvs.GetIndexInOwnParameters() == index); 439Debug.Assert(tvs.GetIndexInTotalParameters() < pctx.MethodTypes.Length); 447Debug.Assert(index < pctx.ClassTypes.Length); 474Debug.Assert(typeFind.TypeKind != type.TypeKind); 578Debug.Assert(pSymbol.GetTypeParameterType() == null); // Should have been checked first before creating 595Debug.Assert(typeSrc != null); 596Debug.Assert(!(typeSrc is ParameterModifierType)); 597Debug.Assert(!(typeSrc is PointerType)); 606Debug.Assert(!(typeSrc is VoidType) && !(typeSrc is TypeParameterType)); 617Debug.Assert(CSemanticChecker.CheckTypeAccess(typeDst, context)); 648Debug.Assert(CSemanticChecker.CheckTypeAccess(typeDst, context)); 657Debug.Assert(typeSrc is NullableType); 666Debug.Assert(typeSrc != null); 667Debug.Assert(typeSrc.IsInterfaceType || typeSrc.IsDelegateType); 720Debug.Assert(CSemanticChecker.CheckTypeAccess(typeDst, context)); 727Debug.Assert(typeSrc != null); 740Debug.Assert(CSemanticChecker.CheckTypeAccess(typeDst, context));
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeParameterType.cs (1)
19Debug.Assert(symbol.GetTypeParameterType() == null);
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeTable.cs (5)
77Debug.Assert(LookupAggregate(aggregate, outer, args) == null); 92Debug.Assert(LookupArray(elementType, rankNum) == null); 106Debug.Assert(LookupParameterModifier(elementType, isOut) == null); 118Debug.Assert(LookupPointer(elementType) == null); 130Debug.Assert(LookupNullable(underlyingType) == null);
Microsoft\CSharp\RuntimeBinder\Semantics\UnaOpSig.cs (5)
44Debug.Assert(type != null); 61Debug.Assert(pt != PredefinedType.PT_UNDEFINEDINDEX); 72Debug.Assert((_grflt & LiftFlags.Lift2) == 0); 73Debug.Assert((_grflt & LiftFlags.Convert2) == 0); 79Debug.Assert(((_grflt & LiftFlags.Lift1) == 0) || ((_grflt & LiftFlags.Convert1) == 0));
Microsoft\CSharp\RuntimeBinder\Semantics\WithType.cs (2)
131Debug.Assert(ats == null || sym.parent == ats.OwningAggregate); 225Debug.Assert(ats == null || mps != null && mps.getClass() == ats.OwningAggregate);
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (25)
140Debug.Assert(!s_namesLoadedForEachType.Contains(key)); 210Debug.Assert(addedField == null); 407Debug.Assert(t1.IsGenericParameter && t2.IsGenericParameter); 457Debug.Assert(t.IsGenericParameter); 524Debug.Assert((agg != null && bIsAggregate) || (meth != null && !bIsAggregate)); 611Debug.Assert(!(ctype is AggregateType)); 629Debug.Assert(i + 1 < declarationChain.Count); 634Debug.Assert(o is string); 657Debug.Assert(meth != null); 694Debug.Assert(agg != null); 755Debug.Assert(!bAdded); 759Debug.Assert(bAdded); 811Debug.Assert(types != null); 823Debug.Assert(t != null); 916Debug.Assert(type.IsPublic || type.IsNestedPublic); 1058Debug.Assert(fieldInfo.IsFamilyAndAssembly); 1083Debug.Assert(ev.AssociatedEventInfo == eventInfo); 1108Debug.Assert(ev.methAdd != null || ev.methRemove != null); 1339Debug.Assert(method != null || member is ConstructorInfo); 1397Debug.Assert(member.IsFamilyAndAssembly); 1511Debug.Assert(Type.GetTypeCode(defValue.GetType()) != TypeCode.Decimal); // Handled above 1697Debug.Assert(baseMethod != null); 1710Debug.Assert(t is AggregateType); 1712Debug.Assert(aggregate != null); 1787Debug.Assert(t is AggregateType);
Microsoft\CSharp\RuntimeBinder\Syntax\NameManager.cs (3)
161Debug.Assert(key != null); 162Debug.Assert(key.Length >= length); 168Debug.Assert(id < PredefinedName.PN_COUNT);
Microsoft\CSharp\RuntimeBinder\Syntax\NameTable.cs (6)
67Debug.Assert(Array.TrueForAll(_entries, e => e?.Name.Text != name.Text)); 94Debug.Assert(key != null); 95Debug.Assert(length <= key.Length); 115Debug.Assert(candidate != null); 116Debug.Assert(key != null); 117Debug.Assert(length <= key.Length);
Microsoft.DotNet.ApiCompat (12)
DifferenceWriter.cs (1)
69Debug.Assert(_differences.Count == 0);
NamespaceRemappingComparer.cs (3)
39Debug.Assert(name != null); 88Debug.Assert(name != null); 102Debug.Assert(!String.IsNullOrEmpty(mappingFile));
Rules\Compat\CannotAddAttributes.cs (1)
73Debug.Assert(implMethod.ParameterCount == contractMethod.ParameterCount);
Rules\Compat\DelegatesMustMatch.cs (2)
30Debug.Assert(implMethod != null && contractMethod != null); 61Debug.Assert(paramCount == contractMethod.ParameterCount);
Rules\Compat\EnumValuesMustMatch.cs (1)
25Debug.Assert(implField != null || contractField != null);
Rules\Compat\ParameterModifiersCannotChange.cs (1)
40Debug.Assert(paramCount == contractMethod.ParameterCount);
Rules\Compat\ParameterNamesCannotChange.cs (1)
34Debug.Assert(paramCount == contractMethod.ParameterCount);
Rules\InheritanceHierarchyChangeTracker.cs (2)
51Debug.Assert(_typeComparer != null); 103Debug.Assert(baseClasses != null);
Microsoft.DotNet.ArcadeLogging (4)
MessageBuilder.cs (4)
24Debug.Assert(_state == State.NotStarted || _state == State.Finished); 32Debug.Assert(_state == State.Properties); 43Debug.Assert(_state == State.Properties); 55Debug.Assert(_state == State.Finished);
Microsoft.DotNet.Build.Tasks.VisualStudio (1)
Vsix\GetPkgDefAssemblyDependencyGuid.cs (1)
63Debug.Assert(reducedHash.Length == targetBlockSize);
Microsoft.DotNet.NuGetRepack.Tests (2)
TestHelpers\DiffUtil.cs (2)
198Debug.Assert(lengthA >= 0 && lengthB >= 0); 212Debug.Assert(lcsLength <= max);
Microsoft.DotNet.Open.Api.Tools.Tests (1)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
47Debug.Assert(tfms.Length > 0);
Microsoft.DotNet.SignTool (21)
src\BatchSignInput.cs (3)
35Debug.Assert(!filesToSign.IsDefault); 36Debug.Assert(zipDataMap != null); 37Debug.Assert(!filesToCopy.IsDefault);
src\ByteSequenceComparer.cs (2)
68Debug.Assert(x != null); 74Debug.Assert(!x.IsDefault);
src\Configuration.cs (8)
112Debug.Assert(tempDir != null); 113Debug.Assert(itemsToSign != null && !itemsToSign.Any(i => i == null)); 114Debug.Assert(strongNameInfo != null); 115Debug.Assert(fileSignInfo != null); 208Debug.Assert(!isNested); 298Debug.Assert(parentContainer.FullPath != file.FullPath); 630Debug.Assert(Path.GetExtension(archivePath) == ".zip"); 634Debug.Assert(zipFileSignInfo.IsZipContainer());
src\ExplicitCertificateKey.cs (1)
18Debug.Assert(fileName != null);
src\FileSignInfo.cs (3)
101Debug.Assert(pathWithHash.FullPath != null); 102Debug.Assert(!pathWithHash.ContentHash.IsDefault && pathWithHash.ContentHash.Length == 256 / 8); 103Debug.Assert(targetFramework != "");
src\PathWithHash.cs (2)
33Debug.Assert(!contentHash.IsDefault); 34Debug.Assert(fullPath != null);
src\SignedFileContentKey.cs (2)
34Debug.Assert(!contentHash.IsDefault); 35Debug.Assert(fileName != null);
Microsoft.DotNet.SignTool.Tests (1)
StreamUtilities.cs (1)
29Debug.Assert(count > 0);
Microsoft.DotNet.XUnitExtensions (2)
DiscovererHelpers.cs (1)
64Debug.Assert(ctorArgs.Count() >= 2);
Discoverers\ConditionalClassDiscoverer.cs (1)
39Debug.Assert(conditionArguments.Count() == 2);
Microsoft.Extensions.ApiDescription.Client.Tests (1)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
47Debug.Assert(tfms.Length > 0);
Microsoft.Extensions.Caching.Hybrid (13)
Internal\DefaultHybridCache.L2.cs (1)
86Debug.Assert(buffer.Array is not null);
Internal\DefaultHybridCache.Stampede.cs (1)
100Debug.Assert(existingType != newType);
Internal\DefaultHybridCache.StampedeStateT.cs (6)
35Debug.Assert(_underlying is null); 36Debug.Assert(underlying is not null); 52Debug.Assert(_underlying is null); 53Debug.Assert(underlying is not null); 126Debug.Assert(_result is not null); 272Debug.Assert(ReferenceEquals(first, stampede.Task));
Internal\RecyclableArrayBufferWriter.cs (5)
50Debug.Assert(obj._index == 0); 137Debug.Assert(_buffer.Length > _index); 144Debug.Assert(_buffer.Length > _index); 176Debug.Assert(needed > currentLength); 196Debug.Assert(FreeCapacity > 0 && FreeCapacity >= sizeHint);
Microsoft.Extensions.Caching.Memory (1)
CacheEntry.CacheEntryTokens.cs (1)
116Debug.Assert(entry._tokens != null);
Microsoft.Extensions.Caching.MicroBenchmarks (5)
src\Caching\Hybrid\src\Internal\RecyclableArrayBufferWriter.cs (5)
50Debug.Assert(obj._index == 0); 137Debug.Assert(_buffer.Length > _index); 144Debug.Assert(_buffer.Length > _index); 176Debug.Assert(needed > currentLength); 196Debug.Assert(FreeCapacity > 0 && FreeCapacity >= sizeHint);
Microsoft.Extensions.Caching.StackExchangeRedis (8)
RedisCache.cs (8)
215Debug.Assert(cache is not null); 279Debug.Assert(_cache is not null); 302Debug.Assert(_cache is not null); 319Debug.Assert(_cache is not null); 346Debug.Assert(_cache is not null); 428Debug.Assert(cache is not null); 483Debug.Assert(cache is not null); 747Debug.Assert(cache is not null);
Microsoft.Extensions.Configuration (5)
ConfigurationProvider.cs (2)
76Debug.Assert(ConfigurationPath.KeyDelimiter == ":"); 98Debug.Assert(ConfigurationPath.KeyDelimiter == ":");
ReferenceCountedProviders.cs (3)
48Debug.Assert(_refCount > 0); 53Debug.Assert(_refCount > 0); 63Debug.Assert(_refCount > 0);
Microsoft.Extensions.Configuration.Binder (9)
BindingPoint.cs (2)
60Debug.Assert(!IsReadOnly); 61Debug.Assert(!_valueSet);
ConfigurationBinder.cs (7)
408Debug.Assert(bindingPoint.Value is not null); 451Debug.Assert(!type.IsArray); 611Debug.Assert(source is not null); 612Debug.Assert(addMethod is not null); 633Debug.Assert(dictionaryType.IsGenericType && 829Debug.Assert(source is not null); 830Debug.Assert(addMethod is not null);
Microsoft.Extensions.Configuration.Json (1)
JsonConfigurationFileParser.cs (1)
83Debug.Assert(_paths.Count > 0);
Microsoft.Extensions.DependencyInjection (8)
ServiceLookup\CallSiteFactory.cs (7)
72Debug.Assert(implementationType != null); 105Debug.Assert(serviceTypeGenericArguments.Length == implementationTypeGenericArguments.Length); 301Debug.Assert(callSite != null); 554Debug.Assert(parameterCallSites != null); 726Debug.Assert(_item != null); 737Debug.Assert(_items == null); 787Debug.Assert(_items == null);
ServiceProvider.cs (1)
180System.Diagnostics.Debug.Assert(result is null || CallSiteFactory.IsService(serviceIdentifier));
Microsoft.Extensions.DependencyInjection.Abstractions (10)
ActivatorUtilities.cs (8)
133Debug.Assert(!constructor.IsPreferred); 596Debug.Assert(false); 626Debug.Assert(parameterMap != null); 679Debug.Assert(parameterMap != null); 932Debug.Assert(parameters.Length >= 1 && parameters.Length <= FixedArgumentThreshold); 933Debug.Assert(FixedArgumentThreshold == 4); 991Debug.Assert(parameters.Length >= 1 && parameters.Length <= FixedArgumentThreshold); 992Debug.Assert(FixedArgumentThreshold == 4);
ServiceDescriptor.cs (2)
308Debug.Assert(typeArguments.Length == 2); 327Debug.Assert(typeArguments.Length == 3);
Microsoft.Extensions.DependencyModel (14)
DependencyContextJsonReader.cs (1)
81Debug.Assert(rented.Length >= utf8Bom.Length);
DependencyContextLoader.cs (1)
93Debug.Assert(_fileSystem.File.Exists(location));
DependencyContextWriter.cs (7)
159Debug.Assert(compilationLibrary.Serviceable == runtimeLibrary.Serviceable); 160Debug.Assert(compilationLibrary.Version == runtimeLibrary.Version); 161Debug.Assert(compilationLibrary.Hash == runtimeLibrary.Hash); 162Debug.Assert(compilationLibrary.Type == runtimeLibrary.Type); 163Debug.Assert(compilationLibrary.Path == runtimeLibrary.Path); 164Debug.Assert(compilationLibrary.HashPath == runtimeLibrary.HashPath); 165Debug.Assert(compilationLibrary.RuntimeStoreManifestName == null);
Resolution\AppBaseCompilationAssemblyResolver.cs (1)
85Debug.Assert(sharedDirectory != null);
Utf8JsonReaderExtensions.cs (4)
91Debug.Assert(reader.IsTokenTypeProperty()); 101Debug.Assert(!reader.IsTokenTypeProperty()); 107Debug.Assert(reader.IsTokenTypeProperty()); 122Debug.Assert(reader.IsTokenTypeProperty());
Microsoft.Extensions.Diagnostics (7)
Metrics\DebugConsoleMetricListener.cs (2)
44Debug.Assert(userState == this); 63Debug.Assert(state == this);
Metrics\DefaultMeterFactory.cs (1)
30Debug.Assert(options.Name is not null);
src\libraries\Common\src\System\Diagnostics\DiagnosticsHelper.cs (4)
141Debug.Assert(index >= 0); 142Debug.Assert(index < _maxIndex); 152Debug.Assert(index >= 0); 153Debug.Assert(index < _maxIndex);
Microsoft.Extensions.FileProviders.Embedded (1)
Manifest\EmbeddedFilesManifest.cs (1)
65Debug.Assert(path.Length > 0);
Microsoft.Extensions.FileProviders.Physical (5)
Internal\FileSystemInfoHelper.cs (1)
51Debug.Assert(fileInfo.Exists);
PhysicalFileProvider.cs (1)
153Debug.Assert(!_fileWatcherInitialized);
PhysicalFilesWatcher.cs (1)
469Debug.Assert(state != null);
PollingWildCardChangeToken.cs (2)
160Debug.Assert(previousHash.Length == currentHash.Length); 176Debug.Assert(_byteBuffer.Length > sizeof(long));
Microsoft.Extensions.Hosting (2)
Internal\ConsoleLifetime.netcoreapp.cs (1)
26Debug.Assert(context.Signal == PosixSignal.SIGINT || context.Signal == PosixSignal.SIGQUIT || context.Signal == PosixSignal.SIGTERM);
Internal\ServiceFactoryAdapter.cs (1)
36Debug.Assert(_factoryResolver != null && _contextResolver != null);
Microsoft.Extensions.Hosting.Systemd (1)
SystemdLifetime.netcoreapp.cs (1)
23Debug.Assert(context.Signal == PosixSignal.SIGTERM);
Microsoft.Extensions.Hosting.WindowsServices (3)
WindowsServiceLifetimeHostBuilderExtensions.cs (3)
110Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); 116Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); 137Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
Microsoft.Extensions.Http (5)
ActiveHandlerTrackingEntry.cs (3)
61Debug.Assert(Lifetime != Timeout.InfiniteTimeSpan); 78Debug.Assert(_callback != null); 79Debug.Assert(_timer != null);
DependencyInjection\DefaultHttpClientBuilder.cs (1)
15Debug.Assert(tracker != null);
DependencyInjection\HttpClientBuilderExtensions.cs (1)
657Debug.Assert(registry != null);
Microsoft.Extensions.Identity.Core (2)
DefaultPersonalDataProtector.cs (1)
36Debug.Assert(data != null);
Rfc6238AuthenticationService.cs (1)
61Debug.Assert(offset + 4 < hash.Length);
Microsoft.Extensions.Logging (4)
LoggerFactoryScopeProvider.cs (2)
139Debug.Assert(activity != null); 140Debug.Assert(activityTrackingOption != ActivityTrackingOptions.None);
LoggerInformation.cs (1)
67Debug.Assert(Logger != null);
src\libraries\Common\src\Extensions\ProviderAliasUtilities\ProviderAliasUtilities.cs (1)
27Debug.Assert(arg.ArgumentType == typeof(string));
Microsoft.Extensions.Logging.Abstractions (5)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
Microsoft.Extensions.Logging.AzureAppServices (1)
BlobLoggerProvider.cs (1)
81System.Diagnostics.Debug.Assert(tryGetBuffer);
Microsoft.Extensions.Logging.Configuration (1)
src\libraries\Common\src\Extensions\ProviderAliasUtilities\ProviderAliasUtilities.cs (1)
27Debug.Assert(arg.ArgumentType == typeof(string));
Microsoft.Extensions.Logging.Console (23)
ConsoleLoggerProcessor.cs (2)
122Debug.Assert(FullMode == ConsoleLoggerQueueFullMode.Wait); 128Debug.Assert(_messageQueue.Count < MaxQueueLength);
src\libraries\Common\src\System\Text\Json\PooledByteBufferWriter.cs (21)
32Debug.Assert(MaximumBufferSize == Array.MaxLength); 38Debug.Assert(initialCapacity > 0); 48Debug.Assert(_rentedBuffer != null); 49Debug.Assert(_index <= _rentedBuffer.Length); 58Debug.Assert(_rentedBuffer != null); 67Debug.Assert(_rentedBuffer != null); 76Debug.Assert(_rentedBuffer != null); 88Debug.Assert(_rentedBuffer != null); 98Debug.Assert(_rentedBuffer != null); 99Debug.Assert(_index <= _rentedBuffer.Length); 121Debug.Assert(initialCapacity > 0); 122Debug.Assert(_rentedBuffer is null); 132Debug.Assert(_rentedBuffer != null); 133Debug.Assert(count >= 0); 134Debug.Assert(_index <= _rentedBuffer.Length - count); 176Debug.Assert(_rentedBuffer != null); 177Debug.Assert(sizeHint > 0); 208Debug.Assert(oldBuffer.Length >= _index); 209Debug.Assert(_rentedBuffer.Length >= _index); 217Debug.Assert(_rentedBuffer.Length - _index > 0); 218Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
Microsoft.Extensions.Logging.EventSource (1)
LoggingEventSource.cs (1)
510Debug.Assert(pinnedString == rePinnedString);
Microsoft.Extensions.Logging.Generators (11)
LoggerMessageGenerator.Parser.cs (1)
740Debug.Assert(searchedBrace is '{' or '}');
src\libraries\Common\src\Roslyn\CSharpSyntaxHelper.cs (1)
42Debug.Assert(container != null);
src\libraries\Common\src\Roslyn\SyntaxValueProvider_ForAttributeWithMetadataName.cs (2)
109Debug.Assert(lastDotIndex > 0); 124Debug.Assert(syntaxNodes.All(n => n.SyntaxTree == syntaxTree));
src\libraries\Common\src\Roslyn\SyntaxValueProvider_ForAttributeWithSimpleName.cs (2)
161Debug.Assert(compilationUnit is ICompilationUnitSyntax); 198Debug.Assert(compilationUnit is ICompilationUnitSyntax);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (5)
28Debug.Assert(value >= 0); 29Debug.Assert(value <= _span.Length); 38Debug.Assert(index < _pos); 106Debug.Assert(length >= 0); 134Debug.Assert(_pos == _span.Length);
Microsoft.Extensions.Options.DataAnnotations (2)
DataAnnotationValidateOptions.cs (2)
67Debug.Assert(errors is not null && errors.Count > 0); 76Debug.Assert(options is not null);
Microsoft.Extensions.Primitives (4)
CompositeChangeToken.cs (2)
124Debug.Assert(state != null); 149Debug.Assert(disposables != null);
StringSegment.cs (1)
108Debug.Assert(Buffer is not null);
StringValues.cs (1)
192Debug.Assert(value is string[]);
Microsoft.Extensions.SecretManager.Tools.Tests (1)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
47Debug.Assert(tfms.Length > 0);
Microsoft.Interop.ComInterfaceGenerator (10)
ComInterfaceContext.cs (1)
65Debug.Assert(baseContext.HasValue);
ComMethodInfo.cs (1)
75Debug.Assert(method is { IsStatic: false, MethodKind: MethodKind.Ordinary });
GeneratedComInterfaceAttributeData.cs (2)
56Debug.Assert(found); 62Debug.Assert(attr.AttributeClass.ToDisplayString() == TypeNames.GeneratedComInterfaceAttribute);
Marshallers\ManagedHResultExceptionGeneratorResolver.cs (2)
51Debug.Assert(info.MarshallingAttributeInfo is ManagedHResultExceptionMarshallingInfo); 79Debug.Assert(info.MarshallingAttributeInfo is ManagedHResultExceptionMarshallingInfo);
Marshallers\ObjectUnwrapperResolver.cs (1)
25Debug.Assert(info.MarshallingAttributeInfo is ObjectUnwrapperInfo);
UnmanagedToManagedStubGenerator.cs (1)
54Debug.Assert(statements.CleanupCalleeAllocated.IsEmpty);
VirtualMethodPointerStubGenerator.cs (1)
39Debug.Assert(methodStub.TypeKeyOwner.Syntax is NameSyntax);
VtableIndexStubGenerator.cs (1)
231Debug.Assert(virtualMethodIndexAttr is not null);
Microsoft.Interop.JavaScript.JSImportGenerator (3)
JSExportGenerator.cs (1)
182Debug.Assert(jsExportAttr is not null);
JSGeneratorFactory.cs (1)
18Debug.Assert(context != null);
JSImportGenerator.cs (1)
167Debug.Assert(jsImportAttr is not null);
Microsoft.Interop.LibraryImportGenerator (2)
LibraryImportGenerator.cs (2)
259Debug.Assert(generatedDllImportAttr is not null); 499Debug.Assert(target.StringMarshalling == StringMarshalling.Utf16);
Microsoft.Interop.SourceGeneration (13)
BoundGenerators.cs (3)
41Debug.Assert(managedExceptionInfo == null); 53Debug.Assert(managedReturnMarshaller == defaultBoundGenerator); 58Debug.Assert(nativeReturnMarshaller == defaultBoundGenerator);
DiagnosticOr.cs (3)
99Debug.Assert(value is not null); 108Debug.Assert(value is not null); 109Debug.Assert(diagnostics is not null);
ManagedToNativeStubCodeContext.cs (1)
47Debug.Assert(info.ManagedIndex == TypePositionInfo.UnsetIndex);
Marshalling\BoolMarshaller.cs (1)
31Debug.Assert(info.ManagedType is SpecialTypeInfo(_, _, SpecialType.System_Boolean));
Marshalling\ByValueContentsMarshalKindValidator.cs (1)
38Debug.Assert(support == ByValueMarshalKindSupport.Supported || diagnostic is not null);
Marshalling\ByValueMarshalKindSupportDescriptor.cs (1)
92Debug.Assert(marshalKind is ByValueContentsMarshalKind.Default);
Marshalling\CharMarshaller.cs (1)
38Debug.Assert(info.ManagedType is SpecialTypeInfo(_, _, SpecialType.System_Char));
MarshalUsingAttributeParser.cs (1)
30Debug.Assert(attributeData.AttributeClass!.ToDisplayString() == TypeNames.MarshalUsingAttribute);
NativeMarshallingAttributeParser.cs (1)
24Debug.Assert(attributeData.AttributeClass!.ToDisplayString() == TypeNames.NativeMarshallingAttribute);
Microsoft.JSInterop (3)
Infrastructure\DotNetDispatcher.cs (1)
227Debug.Assert(count == receivedBytes);
JSRuntime.cs (1)
317Debug.Assert(dotNetObjectReference.ObjectId != 0);
src\Components\Shared\src\ArrayBuilder.cs (1)
180Debug.Assert(newCapacity > _items.Length);
Microsoft.JSInterop.Tests (2)
JSRuntimeTest.cs (2)
144Debug.Assert(poco != null); 167Debug.Assert(poco != null);
Microsoft.Net.Http.Headers (1)
SetCookieHeaderValue.cs (1)
269Debug.Assert(formatted);
Microsoft.VisualBasic.Core (48)
Microsoft\VisualBasic\Collection.vb (6)
78Debug.Assert(BeforeNode IsNot Nothing) 93Debug.Assert(AfterNode IsNot Nothing) 156Debug.Assert(node IsNot Nothing) 170Debug.Assert(node Is Nothing) 213Debug.Assert(node IsNot Nothing) 337Debug.Assert(CultureInfo IsNot Nothing)
Microsoft\VisualBasic\CompilerServices\LateBinding.vb (2)
293Debug.Assert(OperatingSystem.IsWindows()) 851Debug.Assert(False)
Microsoft\VisualBasic\CompilerServices\Operators.vb (12)
148Debug.Assert(comparison = CompareClass.Less OrElse 167Debug.Assert(comparison = CompareClass.Less OrElse 186Debug.Assert(comparison = CompareClass.Less OrElse 205Debug.Assert(comparison = CompareClass.Less OrElse 224Debug.Assert(comparison = CompareClass.Less OrElse 243Debug.Assert(comparison = CompareClass.Less OrElse 262Debug.Assert(comparison = CompareClass.Less OrElse 281Debug.Assert(comparison = CompareClass.Less OrElse 300Debug.Assert(comparison = CompareClass.Less OrElse 319Debug.Assert(comparison = CompareClass.Less OrElse 338Debug.Assert(comparison = CompareClass.Less OrElse 357Debug.Assert(comparison = CompareClass.Less OrElse
Microsoft\VisualBasic\CompilerServices\OverloadResolution.vb (1)
1348Debug.Assert(parameter IsNot Nothing AndAlso parameterType IsNot Nothing)
Microsoft\VisualBasic\CompilerServices\Symbols.vb (1)
1393Debug.Assert(rawMethod IsNot Nothing)
Microsoft\VisualBasic\CompilerServices\Utils.vb (2)
261Debug.Assert(Not (TypeOf member1 Is MethodBase) OrElse 323Debug.Assert(typeParam.IsGenericParameter)
Microsoft\VisualBasic\CompilerServices\VB6BinaryFile.vb (1)
184Diagnostics.Debug.Assert(Not m_Encoding Is Nothing)
Microsoft\VisualBasic\CompilerServices\VB6File.vb (13)
672Diagnostics.Debug.Assert(Not m_Encoding Is Nothing) 1026Diagnostics.Debug.Assert(Not m_Encoding Is Nothing) 1037Diagnostics.Debug.Assert(Not m_Encoding Is Nothing) 1049Diagnostics.Debug.Assert(ByteLength <= lengthToWrite) 1057Diagnostics.Debug.Assert(m_Encoding.GetByteCount(s) = lengthToWrite) 1070Diagnostics.Debug.Assert(Not m_Encoding Is Nothing) 1090Diagnostics.Debug.Assert(Not m_Encoding Is Nothing) 1108Diagnostics.Debug.Assert(Not m_Encoding Is Nothing) 1852Debug.Assert(m_Encoding.GetByteCount(sTemp) = ByteLength) 1859Diagnostics.Debug.Assert(Not m_Encoding Is Nothing) 1867Debug.Assert(m_Encoding.GetByteCount(sTemp) = FixedStringLength) 1877Debug.Assert(ByteLength <= FixedStringLength) 1891Debug.Assert(ByteLength = m_Encoding.GetByteCount(sTemp) AndAlso ByteLength <= FixedStringLength)
Microsoft\VisualBasic\CompilerServices\VB6InputFile.vb (1)
60Diagnostics.Debug.Assert(Not m_Encoding Is Nothing)
Microsoft\VisualBasic\CompilerServices\VB6OutputFile.vb (2)
86Diagnostics.Debug.Assert(Not m_Encoding Is Nothing) 108Diagnostics.Debug.Assert(Not m_Encoding Is Nothing)
Microsoft\VisualBasic\CompilerServices\VB6RandomFile.vb (1)
417Diagnostics.Debug.Assert(Not m_Encoding Is Nothing)
Microsoft\VisualBasic\CompilerServices\VBBinder.vb (1)
1060Diagnostics.Debug.Assert(AmbiguousCount > 0)
Microsoft\VisualBasic\FileIO\FileSystem.vb (3)
1313Debug.Assert(ByteCount <= ByteBuffer.Length) 1600Debug.Assert([Enum].IsDefined(Operation)) 1601Debug.Assert([Enum].IsDefined(TargetType))
Microsoft\VisualBasic\Helpers\ForEachEnum.vb (2)
69Debug.Assert(Not mAtBeginning) 80Debug.Assert(mNext Is Nothing)
MSBuild (8)
CoreCLRAssemblyLoader.cs (1)
51Debug.Assert(Path.IsPathRooted(fullPath));
FileUtilities.cs (2)
721Debug.Assert(allowedExtensions?.Length > 0); 729Debug.Assert(!String.IsNullOrEmpty(extension) && extension[0] == '.');
WindowsFileSystem.cs (2)
128Debug.Assert(hr != WindowsNative.ErrorFileNotFound); 190Debug.Assert(hr != WindowsNative.ErrorSuccess);
WindowsNative.cs (3)
158Debug.Assert(Status == EnumerateDirectoryStatus.UnknownError); 168Debug.Assert(Status != EnumerateDirectoryStatus.UnknownError && 178Debug.Assert(Status != EnumerateDirectoryStatus.Success);
MSBuildTaskHost (14)
Concurrent\ConcurrentDictionary.cs (10)
128Debug.Assert(_comparer.GetHashCode(key) == hashcode); 162Debug.Assert(_comparer.GetHashCode(key) == hashcode); 191Debug.Assert((prev == null && node == tables._buckets[bucketNo]) || prev._next == node); 374Debug.Assert(newLength % 2 != 0); 458Debug.Assert(bucketNo >= 0 && bucketNo < bucketCount); 470Debug.Assert(bucketNo >= 0 && bucketNo < bucketCount); 471Debug.Assert(lockNo >= 0 && lockNo < lockCount); 487Debug.Assert(locksAcquired == _tables._locks.Length); 497Debug.Assert(fromInclusive <= toExclusive); 522Debug.Assert(fromInclusive <= toExclusive);
Concurrent\ConcurrentQueue.cs (2)
167Debug.Assert(head._frozenForEnqueues); 231Debug.Assert(next == s._nextSegment);
FileUtilities.cs (2)
721Debug.Assert(allowedExtensions?.Length > 0); 729Debug.Assert(!String.IsNullOrEmpty(extension) && extension[0] == '.');
PresentationBuildTasks (88)
Microsoft\Build\Tasks\Windows\GenerateTemporaryTargetAssembly.cs (4)
195Debug.Assert(targetOutputs.ContainsKey(CompileTargetName)); 196Debug.Assert(targetOutputs[CompileTargetName].Length == 1); 310Debug.Assert(targetOutputs.ContainsKey(CompileTargetName)); 311Debug.Assert(targetOutputs[CompileTargetName].Length == 1);
MS\Internal\MarkupCompiler\MarkupCompiler.cs (26)
266Debug.Assert(!cu.Pass2); 288Debug.Assert(!cu.Pass2); 299Debug.Assert(!cu.Pass2 || _pendingLocalFiles == null); 300Debug.Assert(_pendingLocalFiles == null || _pendingLocalFiles.Count == 0); 587Debug.Assert(_codeContexts.Count == 0); 959Debug.Assert(_ccRoot.StyleConnectorFn.Statements.Count > 0); 961Debug.Assert(ccsConnector != null); 1830Debug.Assert(desc != null); 1905Debug.Assert(pis != null && pis.Length == 2 && KnownTypes.Types[(int)KnownElements.DependencyObject].IsAssignableFrom(pis[0].ParameterType)); 2032Debug.Assert(_ccRoot != null && _ccRoot.SubClass.Length > 0); 2105Debug.Assert(CompilerInfo != null && CompilerInfo.IsCodeDomProviderTypeValid); 2305Debug.Assert(genericName.Length > 0 || t.IsGenericTypeDefinition); 2309Debug.Assert(genericName.Length == 0 && typeArgsList != null); 2395Debug.Assert(typeArgsList != null && typeArgsList.Length == refTypeParams.Length); 2460Debug.Assert(_typeArgsList == null || (baseClass.IsGenericType && baseClass.IsGenericTypeDefinition)); 2461Debug.Assert(_typeArgsList != null || !baseClass.IsGenericType); 2528Debug.Assert(!string.IsNullOrEmpty(baseName)); 2534Debug.Assert(_ccRoot == null); 3000Debug.Assert(_ccRoot != null); 3049Debug.Assert(cc != null); 3053Debug.Assert(_ccRoot == (cc as CodeContextRoot)); 3054Debug.Assert(_ccRoot.CodeClass != null); 3078Debug.Assert(_ccRoot.HookupFn == null); 3132Debug.Assert(_ccRoot == (_codeContexts.Peek() as CodeContextRoot)); 3133Debug.Assert(_ccRoot.ElementType == null || 3157Debug.Assert(_ccRoot == (_codeContexts.Peek() as CodeContextRoot));
MS\Internal\MarkupCompiler\ParserExtension.cs (1)
907Debug.Assert(bamlMemStream != null);
MS\Internal\MarkupCompiler\PathInternal.cs (1)
62Debug.Assert(comparisonType == StringComparison.Ordinal || comparisonType == StringComparison.OrdinalIgnoreCase);
MS\Internal\MarkupCompiler\VersionHelper.cs (2)
62Debug.Assert(!allowWildcard || maxValue < ushort.MaxValue); 200Debug.Assert(revision < ushort.MaxValue);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\MS\Internal\Globalization\LocalizationComments.cs (1)
355Debug.Assert(enumPrefix != null && enumNames != null);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlMapTable.cs (8)
72Debug.Assert(null != xamlTypeMapper); 158Debug.Assert(cmp > 0); 1058Debug.Assert(bamlAssemblyInfoRecord.AssemblyId >= 0); 1094Debug.Assert( 1106Debug.Assert(bamlAssemblyInfoRecord.AssemblyId >= 0); 1286Debug.Assert(ownerTypeName != null); 1287Debug.Assert(attributeName != null); 1504Debug.Assert(targetType != null && memberName != null);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecords.cs (7)
778Debug.Assert(null == _writeCache[(int)record.RecordType]); 915Debug.Assert( value <= 3 && value >= 0 ); 1103Debug.Assert(RecordSize < 0); 2399Debug.Assert(value <= ExtensionIdMask); 4555Debug.Assert( SerializerTypeId != 0 ); 4728Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null); 4771Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecordWriter.cs (10)
137Debug.Assert(null != DocumentStartRecord); 408Debug.Assert(_deferElementDepth == 0); 409Debug.Assert(_deferComplexPropertyDepth == 0); 410Debug.Assert(_staticResourceElementDepth == 0); 411Debug.Assert(_dynamicResourceElementDepth == 0); 412Debug.Assert(_staticResourceRecordList == null); 430Debug.Assert(_staticResourceElementDepth == 0); 881Debug.Assert(_deferElementDepth == 2); 1070Debug.Assert(extensionTypeId != (short)KnownElements.TypeExtension); 1087Debug.Assert(typeValue != null);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\MarkupExtensionParser.cs (2)
1189Debug.Assert(sb.Length > 0); 1190Debug.Assert(!Char.IsWhiteSpace(sb[0]));
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\StyleXamlParser.cs (2)
510Debug.Assert(_inEventSetter); 1225Debug.Assert(!xamlClrEventNode.IsTemplateEvent && _inEventSetter);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\TemplateXamlParser.cs (3)
567Debug.Assert(_setterOrTriggerValueNode != null); 1340Debug.Assert(_styleModeStack.Mode == StyleMode.VisualTree); 1350Debug.Assert(!xamlClrEventNode.IsStyleSetterEvent);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlParser.cs (1)
1247Debug.Assert(SkipActionDepthCount == -1);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (13)
370Debug.Assert(null != XmlReader); 1518Debug.Assert( (null==ContentPropertyInfo && null==ContentPropertyName) 2077Debug.Assert(false == endTagHasBeenRead); 2227Debug.Assert(IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri)); 2236Debug.Assert(IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri)); 2245Debug.Assert(IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri)); 2254Debug.Assert(IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri)); 2263Debug.Assert(IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri)); 2272Debug.Assert (attributeFound || !IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri)); 2762Debug.Assert(unknownTagName != null || null != parentType); 3709Debug.Assert(typeAndSerializer == null || 4823Debug.Assert( collectionTypeID >= 0 5504Debug.Assert(currentPos > 0 && currentPos < s.Length - 1);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlTypeMapper.cs (3)
2319Debug.Assert(memberName != null); 2322Debug.Assert(memberInfo != null); 2337Debug.Assert(targetType != null);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XmlnsDictionary.cs (1)
713Debug.Assert(prefix != null);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\TokenizerHelper.cs (1)
337Debug.Assert(null != numberFormat);
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlCompatibilityReader.cs (1)
341Debug.Assert(Scope.ShouldProcessContent(namespaceName, Reader.LocalName));
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlWrappingReader.cs (1)
33Debug.Assert( baseReader != null );
PresentationCore (1617)
MS\Internal\AppModel\CookieHandler.cs (1)
116Debug.Assert(size > 0);
MS\Internal\Automation\EventPropertyMap.cs (1)
115Debug.Assert(properties != null);
MS\Internal\FontCache\FamilyCollection.cs (1)
662Debug.Assert(i == FamilyCount);
MS\Internal\FontCache\FontCacheUtil.cs (1)
60Debug.Assert(stream.Position == 0);
MS\Internal\FontCache\FontResourceCache.cs (3)
63Debug.Assert(uri.IsAbsoluteUri && uri.Scheme == PackUriHelper.UriSchemePack && BaseUriHelper.IsPackApplicationUri(uri)); 76Debug.Assert(escapedPath.EndsWith(FakeFileName, StringComparison.OrdinalIgnoreCase)); 144Debug.Assert(!folderResourceMap.ContainsKey(resourceFullName));
MS\Internal\FontCache\FontSource.cs (3)
88Debug.Assert(_isInternalCompositeFont || String.IsNullOrEmpty(_fontUri.Fragment)); 345Debug.Assert(memoryFontSize <= fileReadBufferSize); 410Debug.Assert(_memoryHandle.IsAllocated);
MS\Internal\FontFace\CompositeFontInfo.cs (3)
218Debug.Assert(IsFamilyMapRangesValid(familyMapRanges)); 226Debug.Assert(begin < end && end <= _familyMaps.Count); 254Debug.Assert(count == FirstFamilyMapRange);
MS\Internal\FontFace\PhysicalFontFamily.cs (4)
129Debug.Assert(bestMatch != null); 213Debug.Assert(bestStyleTypeface != null); 341Debug.Assert(advance <= unicodeString.Length); 347Debug.Assert(advance + sizeofChar <= unicodeString.Length);
MS\Internal\FontFace\TypefaceCollection.cs (2)
96Debug.Assert((_family != null && _familyTypefaceCollection == null)|| (_familyTypefaceCollection != null && _family == null)); 147Debug.Assert((typefaceCollection._family != null && typefaceCollection._familyTypefaceCollection == null)
MS\Internal\Generic\Span.cs (1)
142Debug.Assert(fc <= first);
MS\Internal\Ink\Bezier.cs (2)
116Debug.Assert(to - from >= 4); 357Debug.Assert(data.Node(to) - data.Node(from) > data.Node(j) - data.Node(from));
MS\Internal\Ink\CuspData.cs (1)
281Debug.Assert(bReverse);
MS\Internal\Ink\EllipticalNodeOperations.cs (9)
28System.Diagnostics.Debug.Assert((nodeShape != null) && nodeShape.IsEllipse); 175System.Diagnostics.Debug.Assert(node.IsEmpty == false); 578System.Diagnostics.Debug.Assert(result.IsEmpty); 616System.Diagnostics.Debug.Assert(DoubleUtil.AreClose(beginRadius, endRadius) == false); 648System.Diagnostics.Debug.Assert(!double.IsNaN(findex)); 657System.Diagnostics.Debug.Assert(DoubleUtil.IsBetweenZeroAndOne(x) == false); 659System.Diagnostics.Debug.Assert(!double.IsNaN(findex)); 675System.Diagnostics.Debug.Assert(!double.IsNaN(findex)); 687System.Diagnostics.Debug.Assert(!double.IsNaN(findex));
MS\Internal\Ink\ErasingStroke.cs (6)
33System.Diagnostics.Debug.Assert(erasingShape != null); 59System.Diagnostics.Debug.Assert((path != null) && (IEnumerablePointHelper.GetCount(path) != 0)); 100System.Diagnostics.Debug.Assert(iterator != null); 139System.Diagnostics.Debug.Assert(iterator != null); 140System.Diagnostics.Debug.Assert(intersections != null); 262System.Diagnostics.Debug.Assert(path.Length > 1);
MS\Internal\Ink\ExtendedPropertyCollection.cs (1)
188System.Diagnostics.Debug.Assert(propertyToRemove != null);
MS\Internal\Ink\GestureRecognizer\NativeRecognizer.cs (8)
66Debug.Assert(NativeRecognizer.RecognizerHandleSingleton != null); 368Debug.Assert(recContext != null && !recContext.IsInvalid); 415Debug.Assert(recContext != null && !recContext.IsInvalid); 504Debug.Assert(stylusPoints != null); 505Debug.Assert(propertyGuids.Length == StylusPointDescription.RequiredCountOfProperties); 637Debug.Assert(ApplicationGestureHelper.IsDefined(gesture)); 725Debug.Assert(pProps->cbPropertyValue == sizeof(uint) / sizeof(byte)); 737Debug.Assert(ApplicationGestureHelper.IsDefined(gesture));
MS\Internal\Ink\InkSerializedFormat\AlgoModule.cs (4)
225Debug.Assert(outputBufferIndex < outputBuffer.Length); 234Debug.Assert(outputBufferIndex < outputBuffer.Length); 286Debug.Assert(countPerItem == 4 || countPerItem == 2 || countPerItem == 1); 347Debug.Assert(countPerItem == 4 || countPerItem == 2 || countPerItem == 1);
MS\Internal\Ink\InkSerializedFormat\CustomAttributeSerializer.cs (2)
326Debug.Assert(strm != null); 441System.Diagnostics.Debug.Assert(guid == Guid.Empty);
MS\Internal\Ink\InkSerializedFormat\DrawingAttributeSerializer.cs (13)
342System.Diagnostics.Debug.Assert(penTip == PenTip.Rectangle); 431Debug.Assert(DrawingAttributes.MaxHeight == DrawingAttributes.MaxWidth && 460System.Diagnostics.Debug.Assert(compressionAlgorithm == 0); 461System.Diagnostics.Debug.Assert(fTag == true); 463Debug.Assert(stream != null); 489Debug.Assert(bw != null); 495Debug.Assert(bw != null); 515Debug.Assert(bw != null); 528Debug.Assert(bw != null); 546Debug.Assert(bw != null); 615Debug.Assert(bw != null); 669Debug.Assert(bw != null); 680Debug.Assert(bw != null);
MS\Internal\Ink\InkSerializedFormat\GorillaCodec.cs (5)
233Debug.Assert(intReader != null); 234Debug.Assert(shortReader != null); 246Debug.Assert(shortReader != null); 544Debug.Assert(outputBufferIndex < outputBuffer.Length); 561Debug.Assert(outputBufferIndex < outputBuffer.Length);
MS\Internal\Ink\InkSerializedFormat\HuffCodec.cs (9)
96Debug.Assert(input != null); 97Debug.Assert(input.Length >= 2); 98Debug.Assert(startIndex == 1); 99Debug.Assert(outputBuffer != null); 100Debug.Assert(outputBuffer.Length != 0); 112Debug.Assert(outputBufferIndex < outputBuffer.Length); 127Debug.Assert(outputBufferIndex < outputBuffer.Length); 189Debug.Assert(nDataLen > 0 && nDataLen - 1 <= Int32.MaxValue); 193Debug.Assert(nDataLen <= Int32.MaxValue);
MS\Internal\Ink\InkSerializedFormat\InkSerializer.cs (7)
104System.Diagnostics.Debug.Assert(inkData.Length > isfBase64PrefixLength); 249Debug.Assert(inkdata != null); 308Debug.Assert(inputStream != null); 2112Debug.Assert(data != null); 2499Debug.Assert(sizeOfHeaderInBytes == bytesWritten); 2538Debug.Assert(sizes[i] == bytesWritten); 2738System.Diagnostics.Debug.Assert(strokes != null);
MS\Internal\Ink\InkSerializedFormat\LZCodec.cs (4)
44Debug.Assert(input != null); 45Debug.Assert(input.Length > 1); 46Debug.Assert(inputIndex < input.Length); 47Debug.Assert(inputIndex >= 0);
MS\Internal\Ink\InkSerializedFormat\MultiByteCodec.cs (3)
79Debug.Assert(input != null); 80Debug.Assert(inputIndex < input.Length); 114Debug.Assert(input != null); //already validated at the AlgoModule level
MS\Internal\Ink\InkSerializedFormat\StrokeSerializer.cs (1)
967Debug.Assert(stream != null);
MS\Internal\Ink\Lasso.cs (19)
53System.Diagnostics.Debug.Assert(_points != null); 67System.Diagnostics.Debug.Assert(_points != null); 81System.Diagnostics.Debug.Assert(_points != null); 82System.Diagnostics.Debug.Assert((0 <= index) && (index < _points.Count)); 94System.Diagnostics.Debug.Assert(null != points); 108System.Diagnostics.Debug.Assert(_points != null); 124System.Diagnostics.Debug.Assert(_points != null); 175System.Diagnostics.Debug.Assert(lassoSegment.Y != 0); 190System.Diagnostics.Debug.Assert(_points != null); 191System.Diagnostics.Debug.Assert(iterator != null); 339System.Diagnostics.Debug.Assert(!crossing.IsEmpty && crossing.StartNode.IsValid && crossing.EndNode.IsValid); 342System.Diagnostics.Debug.Assert(!mcrossing.IsEmpty && mcrossing.StartNode.IsValid && mcrossing.EndNode.IsValid); 349System.Diagnostics.Debug.Assert(!mcrossing.IsEmpty && mcrossing.StartNode.IsValid && mcrossing.EndNode.IsValid); 426System.Diagnostics.Debug.Assert(DoubleUtil.AreClose(si.InBegin, StrokeFIndices.BeforeFirst)); 561System.Diagnostics.Debug.Assert(!newFIndices.IsEmpty); 562System.Diagnostics.Debug.Assert(strokeNode.IsValid); 603System.Diagnostics.Debug.Assert(obj is LassoCrossing); 708System.Diagnostics.Debug.Assert(intersection >= 0 && intersection <= points.Count - 2); 811System.Diagnostics.Debug.Assert(hitEnd != hitBegin && orgBegin != orgEnd);
MS\Internal\Ink\Renderer.cs (8)
47Debug.Assert(renderer != null); 434System.Diagnostics.Debug.Assert(sender == _strokes); 484System.Diagnostics.Debug.Assert(_strokes.IndexOf(sender as Stroke) != -1); 535System.Diagnostics.Debug.Assert(_strokes != null); 541Debug.Assert(visual is StrokeVisual); 635System.Diagnostics.Debug.Assert(stroke != null); 644System.Diagnostics.Debug.Assert(stroke != null); 656System.Diagnostics.Debug.Assert(drawingAttributes != null);
MS\Internal\Ink\StrokeFIndices.cs (1)
187System.Diagnostics.Debug.Assert(!double.IsNaN(_beginFIndex) && !double.IsNaN(_endFIndex) && DoubleUtil.LessThan(_beginFIndex, _endFIndex));
MS\Internal\Ink\StrokeIntersection.cs (6)
191System.Diagnostics.Debug.Assert(intersections != null); 192System.Diagnostics.Debug.Assert(intersections.Length > 0); 197System.Diagnostics.Debug.Assert(!intersections[j].IsEmpty); 223System.Diagnostics.Debug.Assert(intersections != null); 224System.Diagnostics.Debug.Assert(intersections.Length > 0); 229System.Diagnostics.Debug.Assert(!intersections[j].IsEmpty);
MS\Internal\Ink\StrokeNode.cs (17)
42System.Diagnostics.Debug.Assert(operations != null); 43System.Diagnostics.Debug.Assert((nodeData.IsEmpty == false) && (index >= 0)); 292Debug.Assert(!endNodeRect.Contains(point)); 904System.Diagnostics.Debug.Assert(!double.IsNaN(cutAt.BeginFIndex) && !double.IsNaN(cutAt.EndFIndex)); 922System.Diagnostics.Debug.Assert(IsValid && (_index >= 0)); 929System.Diagnostics.Debug.Assert(fragment.BeginFIndex >= 0 && fragment.BeginFIndex <= 1); 934System.Diagnostics.Debug.Assert(fragment.EndFIndex >= 0 && fragment.EndFIndex <= 1); 953System.Diagnostics.Debug.Assert(IsValid); 965System.Diagnostics.Debug.Assert(DoubleUtil.GreaterThanOrClose(fragment.BeginFIndex, 0f)); 967System.Diagnostics.Debug.Assert(DoubleUtil.LessThanOrClose(fragment.BeginFIndex, 1f)); 981System.Diagnostics.Debug.Assert(DoubleUtil.GreaterThanOrClose(fragment.EndFIndex, 0f)); 983System.Diagnostics.Debug.Assert(DoubleUtil.LessThanOrClose(fragment.EndFIndex, 1f)); 1007System.Diagnostics.Debug.Assert(IsValid); 1025System.Diagnostics.Debug.Assert(IsValid); 1043System.Diagnostics.Debug.Assert(IsValid); 1047System.Diagnostics.Debug.Assert(findex == 0); 1051System.Diagnostics.Debug.Assert((findex >= _index - 1) && (findex <= _index));
MS\Internal\Ink\StrokeNodeData.cs (2)
50System.Diagnostics.Debug.Assert(DoubleUtil.GreaterThan((double)pressure, 0d)); 61Debug.Assert(DoubleUtil.AreClose(0, s_empty._pressure));
MS\Internal\Ink\StrokeNodeOperations.cs (19)
49System.Diagnostics.Debug.Assert(nodeShape != null); 80System.Diagnostics.Debug.Assert((boundingBox.X <= 0) && (boundingBox.Y <= 0)); 126System.Diagnostics.Debug.Assert(node.IsEmpty == false); 324System.Diagnostics.Debug.Assert(DoubleUtil.IsZero(pressureFactor) == false); 375System.Diagnostics.Debug.Assert(count > 0); 401System.Diagnostics.Debug.Assert(count > 0); 423System.Diagnostics.Debug.Assert(count > 0); 484System.Diagnostics.Debug.Assert(DoubleUtil.IsZero(pressureFactor) == false); 625System.Diagnostics.Debug.Assert(findex >= 0 && findex <= 1); 639System.Diagnostics.Debug.Assert(findex >= 0 && findex <= 1); 776System.Diagnostics.Debug.Assert(true == DoubleUtil.IsBetweenZeroAndOne(findex)); 964System.Diagnostics.Debug.Assert(DoubleUtil.IsZero(pressureFactor) == false); 989System.Diagnostics.Debug.Assert(DoubleUtil.IsZero(pressureFactor) == false); 1021System.Diagnostics.Debug.Assert(!quad.IsEmpty); 1091System.Diagnostics.Debug.Assert(i < count); 1131System.Diagnostics.Debug.Assert(count > 0); 1153System.Diagnostics.Debug.Assert(count > 0); 1226System.Diagnostics.Debug.Assert(DoubleUtil.IsZero(pressureFactor) == false); 1297System.Diagnostics.Debug.Assert(findex >= 0 && findex <= 1);
MS\Internal\Ink\StrokeNodeOperations2.cs (3)
44System.Diagnostics.Debug.Assert((null != vertices) && (2 < vertices.Length)); 82System.Diagnostics.Debug.Assert(quad.IsEmpty == false); 508System.Diagnostics.Debug.Assert((false == DoubleUtil.IsZero(shortest.X)) || (false == DoubleUtil.IsZero(shortest.Y)));
MS\Internal\Ink\StrokeRenderer.cs (26)
45Debug.Assert(iterator != null); 46Debug.Assert(drawingAttributes != null); 77System.Diagnostics.Debug.Assert(true == strokeNode.IsValid); 159Debug.Assert(index == iterator.Count - 1); 218Debug.Assert(iterator != null && drawingAttributes != null); 488Debug.Assert(pathFigureDCSide.Count == 0); 630Debug.Assert(!strokeNode.IsValid); 652Debug.Assert(pathFigureDCSide.Count == 0); 678Debug.Assert(pathFigureABSide.Count == 0); 713Debug.Assert(pathFigureDCSide.Count == 0); 759Debug.Assert(pointBuffer1 != null); 760Debug.Assert(pointBuffer2 != null); 761Debug.Assert(pointBuffer3 != null); 762Debug.Assert(context != null); 835Debug.Assert(percentIntersect >= 0.0 && percentIntersect <= 100.0d); 871Debug.Assert(context != null); 872Debug.Assert(points != null); 873Debug.Assert(points.Count > 0); 899Debug.Assert(context != null); 900Debug.Assert(abPoints != null && dcPoints != null); 901Debug.Assert(abPoints.Count > 0 && dcPoints.Count > 0); 921Debug.Assert(context != null); 922Debug.Assert(abPoints != null && dcPoints != null); 923Debug.Assert(polyLinePoints != null); 952Debug.Assert(i + 2 < points.Count); 1102System.Diagnostics.Debug.Assert(da.IsHighlighter = true);
MS\Internal\Ink\StylusShape.cs (4)
164System.Diagnostics.Debug.Assert(value.HasInverse); 234System.Diagnostics.Debug.Assert(vertices.Length == 4); 259System.Diagnostics.Debug.Assert(clockWiseIndex == vertices.Length || counterClockIndex == vertices.Length); 277System.Diagnostics.Debug.Assert(m_tip == StylusTip.Ellipse);
MS\Internal\IO\Packaging\NetStream.cs (8)
818Debug.Assert(offset >= 0); 819Debug.Assert(length >= 0); 844Debug.Assert(value >= 0); 857Debug.Assert(value >= 0); 903Debug.Assert(_offset <= b._offset); 904Debug.Assert(Mergeable(b)); 952Debug.Assert(block.Length > 0); 1052Debug.Assert(block.Length > 0);
MS\Internal\LoadedOrUnloadedOperation.cs (1)
27Debug.Assert(callback != null && target != null);
MS\Internal\Media\VisualTreeUtils.cs (1)
120Debug.Assert(element == null);
MS\Internal\Media3D\GeneralTransform3DTo2DTo3D.cs (1)
42Debug.Assert(transform3DTo2D != null && transform2DTo3D != null);
MS\Internal\Media3D\M3DUtil.cs (2)
148Debug.Assert(matrix.IsAffine); 326Debug.Assert(!matrix.IsAffine);
MS\Internal\PartialArray.cs (1)
37Debug.Assert(initialIndex >= 0 && initialIndex + count <= array.Length);
MS\Internal\Shaping\OpenTypeCommon.cs (7)
232Debug.Assert(TableTag==OpenTypeTags.GSUB || TableTag==OpenTypeTags.GPOS); 233Debug.Assert(FirstGlyph<AfterLastGlyph); 234Debug.Assert(AfterLastGlyph<=GlyphInfo.Length); 735Debug.Assert(featureDescription.Parameter != 0); 785Debug.Assert( FlagToSet==GlyphFlags.NotChanged || 929Debug.Assert(tableTag == OpenTypeTags.GSUB || tableTag == OpenTypeTags.GPOS); 1700Debug.Assert(Index < SubTableCount());
MS\Internal\Shaping\OpenTypeLayoutCache.cs (16)
80Debug.Assert(tableTag == OpenTypeTags.GSUB || tableTag == OpenTypeTags.GPOS); 320Debug.Assert(totalSize <= maxCacheSize); 324Debug.Assert(totalSize <= maxCacheSize); 391Debug.Assert(tableTag == OpenTypeTags.GSUB || tableTag == OpenTypeTags.GPOS); 411Debug.Assert(false); 544Debug.Assert(lastLookup >= 0); // There are lookups, so there was an index 571Debug.Assert(cacheSize > 0); // We've calcucalted them at least ones, and 572Debug.Assert(glyphCount > 0); // if there is no records, we already should've exited 638Debug.Assert((pList - pCache) * sizeof(ushort) < cacheSize); 643Debug.Assert((pList - pCache) * sizeof(ushort) < cacheSize); 676Debug.Assert((pList - pCache) * sizeof(ushort) < cacheSize); 681Debug.Assert((pList - pCache) * sizeof(ushort) < cacheSize); 693Debug.Assert((pList - pCache) * sizeof(ushort) == cacheSize); // We exactly filled up the cache 694Debug.Assert((pGlyphs - pCache) * sizeof(ushort) == (4 + glyphCount * 2) * sizeof(ushort)); // Glyphs ended where lists start. 840Debug.Assert(tableTag == OpenTypeTags.GSUB || tableTag == OpenTypeTags.GPOS); 1058Debug.Assert(recordCount > 0); // Otherwise, we would go into (glyph > maxGlyphLookup);
MS\Internal\Shaping\ShaperBuffers.cs (2)
113Debug.Assert(_charMap.Length == charCount); 124Debug.Assert(_glyphInfoList.Length == glyphCount);
MS\Internal\Shaping\TypefaceMap.cs (7)
167Debug.Assert(ichItem == unicodeString.Length); 182Debug.Assert(index >= 0); 583Debug.Assert(cchMap <= unicodeString.Length - ich); 820Debug.Assert(cchNextValid > 0 && cchNextValid <= unicodeString.Length - ich); 838Debug.Assert(cchNextValid == 0); 848Debug.Assert(recursionDepth > 0 || advance == unicodeString.Length); 1060Debug.Assert(cch > 0);
MS\Internal\Span.cs (2)
108Debug.Assert(cp >= 0); 160Debug.Assert(spanIndex > 0);
MS\Internal\SynchronizedInputHelper.cs (3)
193Debug.Assert(mbArgs != null); 241Debug.Assert(mbArgs != null); 291Debug.Assert(false);
MS\Internal\TextFormatting\FormatSettings.cs (3)
214Debug.Assert(offsetToFirstCp == 0); 222Debug.Assert(offsetToFirstCp == 0); 235Debug.Assert(offsetToFirstCp == 0);
MS\Internal\TextFormatting\FormattedTextSymbols.cs (6)
57Debug.Assert(symbols != null); 80Debug.Assert(shapeables != null && shapeables.Count > 0); 94Debug.Assert(current != null); 206Debug.Assert(_glyphs != null); 229Debug.Assert(_glyphs != null); 372Debug.Assert(glyphAdvances.Length <= glyphIndices.Length);
MS\Internal\TextFormatting\FullTextLine.cs (18)
208Debug.Assert(_metrics._formatter != null); 466Debug.Assert(_collapsingSymbol == null && symbol != null); 488Debug.Assert(lineLength > 0); 699Debug.Assert((_statusFlags & StatusFlags.BoundingBoxComputed) != 0); 753Debug.Assert(_fullText != null); 758Debug.Assert(_metrics._height > 0); 834Debug.Assert(HasCollapsed); 1234Debug.Assert(direction == CaretDirection.Backward || direction == CaretDirection.Backspace); 1423Debug.Assert(direction == CaretDirection.Backward || direction == CaretDirection.Backspace); 1475Debug.Assert(_collapsingSymbol != null); 1570Debug.Assert(false); 1728Debug.Assert(boundsList != null); 2092Debug.Assert(textRun != null); 2096Debug.Assert(cchAcc > 0); 2109Debug.Assert(cchAcc > 0); 2113Debug.Assert(cchLeft == 0); 2455Debug.Assert(_ploline.Value != IntPtr.Zero); 2508Debug.Assert(_ploline.Value != IntPtr.Zero);
MS\Internal\TextFormatting\FullTextState.cs (1)
302Debug.Assert(!TextStore.IsMarker(plsrun));
MS\Internal\TextFormatting\LineServicesCallbacks.cs (15)
236Debug.Assert(lsrun.RunProp != null); 517Debug.Assert(Draw.CurrentLine.FullTextState != null); 525Debug.Assert(lsrun.Shapeable != null && stringLength > 0); 723Debug.Assert(ulInfo.dvpFirstUnderlineSize >= 0); 772Debug.Assert(stInfo.dvpLowerStrikethroughSize >= 0); 1632Debug.Assert(lsrunFirst.Shapeable != null); 1633Debug.Assert(cchText > 0); // LineServices should not pass in zero character count; 1792Debug.Assert(TextStore.IsContent(plsrun) && lsruns[i] != null); 1828Debug.Assert(TextStore.IsContent(plsrun) && lsrun.Shapeable != null); 2388Debug.Assert(textObject != null); 2446Debug.Assert(false); 2469Debug.Assert(lsrun.Type == Plsrun.InlineObject); 2481Debug.Assert(textObject != null); 2482Debug.Assert(textFlow != LsTFlow.lstflowWS || runDirection != 0); 3181Debug.Assert(lsrun.Shapeable != null);
MS\Internal\TextFormatting\LineServicesRun.cs (2)
248Debug.Assert(_shapeable != null); 921Debug.Assert(lsruns != null && lsruns.Length > 0 && lsruns[0] != null);
MS\Internal\TextFormatting\SimpleTextLine.cs (1)
574Debug.Assert((_statusFlags & StatusFlags.BoundingBoxComputed) != 0);
MS\Internal\TextFormatting\TextFormatterImp.cs (2)
552Debug.Assert(context.Owner == null); 577Debug.Assert(context != null);
MS\Internal\TextFormatting\TextMarkerSource.cs (5)
55Debug.Assert(markerStyle != TextMarkerStyle.None); 103Debug.Assert(autoNumberingIndex > 0); 142Debug.Assert(_characterArray != null); 274Debug.Assert(number >= 0); 406Debug.Assert(number >= 0 && number <= 9);
MS\Internal\TextFormatting\TextMetrics.cs (1)
168Debug.Assert(_cchLength > 0);
MS\Internal\TextFormatting\TextStore.cs (16)
272Debug.Assert(stringLength > 0 && runInfo.Length > 0); 330Debug.Assert( 506Debug.Assert(textEffects != null && textEffects.Count != 0); 645Debug.Assert(runInfo.StringLength > 0 && runInfo.Length > 0); 849Debug.Assert(runInfo.StringLength >= stringLength); 874Debug.Assert(cch <= runInfo.StringLength); 1423Debug.Assert(ichRun < ichEnd); 1451Debug.Assert(ichRun == cchUniform); 1549Debug.Assert(runInfo.OffsetToFirstChar + offsetToFirstChar + lsrunLength <= runInfo.CharacterBuffer.Count); 1569Debug.Assert(offsetToFirstChar == 0); 1615Debug.Assert(uniformBidiLevel == (Pap.RightToLeft ? 1 : 0)); 1644Debug.Assert(lsrunLength > 0); 1711Debug.Assert(false); 1724Debug.Assert(cch > 0 && cch <= stringLength - ich); 1963Debug.Assert(i < _plsrunVector.Count); 2384Debug.Assert(metrics != null);
MS\Internal\TextFormatting\ThousandthOfEmRealDoubles.cs (2)
47Debug.Assert(capacity >= 0); 57Debug.Assert(realValues != null);
MS\Internal\TextFormatting\ThousandthOfEmRealPoints.cs (2)
41Debug.Assert(capacity >= 0); 50Debug.Assert(pointValues != null);
MS\Win32\UnsafeNativeMethodsTablet.cs (3)
96Debug.Assert(handle != IntPtr.Zero); 136Debug.Assert(handle != IntPtr.Zero); 148System.Diagnostics.Debug.Assert(_recognizerHandle == null);
src\Microsoft.DotNet.Wpf\src\Common\Graphics\exports.cs (25)
114Debug.Assert((cbData == 0) || ((Int64)(IntPtr)pbFrom) % 4 == 0); 115Debug.Assert((cbData == 0) || ((Int64)(IntPtr)pbTo) % 4 == 0); 116Debug.Assert(cbData % 4 == 0); 117Debug.Assert(cbData >= 0); 541Debug.Assert(!handle.IsNull); 571Debug.Assert(!handle.IsNull); 929Debug.Assert(channel != null); 949Debug.Assert(channel != null); 951Debug.Assert(_debugOnly_Channel == channel); 967Debug.Assert(_debugOnly_Channel == channel); 1144Debug.Assert(_others.Count > 0); 1169Debug.Assert(index == 0); 1403Debug.Assert(index <= 1); 1481Debug.Assert(index == 0); 1519Debug.Assert(channel != null); 1544Debug.Assert(sourceChannel != null); 1549Debug.Assert(found); 1556Debug.Assert(!(_map.Get(targetChannel, out duplicate))); 1582Debug.Assert(channel != null); 1587Debug.Assert(found); 1650Debug.Assert(channel != null); 1655Debug.Assert(found); 1923Debug.Assert(!hCompositionNode.IsNull); 1949Debug.Assert(!hCompositionNode.IsNull); 2127Debug.Assert(!hCompositionNode.IsNull);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\AppDomainShutdownMonitor.cs (1)
40Debug.Assert(listener.TryGetTarget(out _));
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\GenericEnumerator.cs (1)
105Debug.Assert(_position >= 0);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Ink\BitStream.cs (2)
33Debug.Assert(buffer != null); 46Debug.Assert(buffer != null);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\LegacyPriorityQueue.cs (2)
134Debug.Assert(_count > 0); 187Debug.Assert(_count != 0);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\PartialList.cs (1)
50Debug.Assert(initialIndex >= 0 && initialIndex + count <= list.Count);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SafeSecurityHelper.cs (1)
388Debug.Assert(target != null);
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Media\TypeConverterHelper.cs (1)
72Debug.Assert(inputString is Uri);
System\Windows\DurationConverter.cs (1)
129Debug.Assert(durationValue == Duration.Automatic); // Only other legal duration type
System\Windows\FontStretch.cs (2)
30Debug.Assert(1 <= stretch && stretch <= 9); 59Debug.Assert(1 <= RealStretch && RealStretch <= 9);
System\Windows\FontStyle.cs (3)
25Debug.Assert(0 <= style && style <= 2); 120Debug.Assert(0 <= _style && _style <= 2); 139Debug.Assert(_style == 2);
System\Windows\FontWeight.cs (1)
28Debug.Assert(1 <= weight && weight <= 999);
System\Windows\FreezableCollection.cs (1)
186Debug.Assert(_collection.Count == 0);
System\Windows\Ink\DrawingAttributes.cs (13)
52System.Diagnostics.Debug.Assert(extendedProperties != null); 63System.Diagnostics.Debug.Assert(_extendedProperties != null); 82Debug.Assert(Colors.Black == (Color)GetDefaultDrawingAttributeValue(KnownIds.Color)); 106Debug.Assert(StylusTip.Ellipse == (StylusTip)GetDefaultDrawingAttributeValue(KnownIds.StylusTip)); 112Debug.Assert(StylusTip.Rectangle == (StylusTip)GetExtendedPropertyBackedProperty(KnownIds.StylusTip)); 135Debug.Assert(Matrix.Identity == (Matrix)GetDefaultDrawingAttributeValue(KnownIds.StylusTipTransform)); 164Debug.Assert(DrawingAttributes.DefaultHeight == (double)GetDefaultDrawingAttributeValue(KnownIds.StylusHeight)); 191Debug.Assert(DrawingAttributes.DefaultWidth == (double)GetDefaultDrawingAttributeValue(KnownIds.StylusWidth)); 280Debug.Assert(false == (bool)GetDefaultDrawingAttributeValue(KnownIds.IsHighlighter)); 285Debug.Assert(true == (bool)GetExtendedPropertyBackedProperty(KnownIds.IsHighlighter)); 775System.Diagnostics.Debug.Assert(null != DrawingAttributes.GetDefaultDrawingAttributeValue(guid)); 797System.Diagnostics.Debug.Assert(sender != null); 798System.Diagnostics.Debug.Assert(args != null);
System\Windows\Ink\IncrementalHitTester.cs (18)
59System.Diagnostics.Debug.Assert(_strokes != null); 82System.Diagnostics.Debug.Assert(_strokes != null); 128System.Diagnostics.Debug.Assert(strokes != null); 171System.Diagnostics.Debug.Assert((_strokes != null) && (_strokeInfos != null) && (_strokes == sender)); 274Debug.Assert(_strokeInfos.Count == _strokes.Count); 277Debug.Assert(_strokeInfos[x].Stroke == _strokes[x]); 322System.Diagnostics.Debug.Assert((percentageWithinLasso >= 0) && (percentageWithinLasso <= 100)); 333System.Diagnostics.Debug.Assert((points != null) && (IEnumerablePointHelper.GetCount(points)!= 0)); 470System.Diagnostics.Debug.Assert(eventArgs != null); 511System.Diagnostics.Debug.Assert(eraserShape != null); 524System.Diagnostics.Debug.Assert((points != null) && (IEnumerablePointHelper.GetCount(points) != 0)); 525System.Diagnostics.Debug.Assert(_erasingStroke != null); 570System.Diagnostics.Debug.Assert(strokeHitEventArgCollection.Count != 0); 575System.Diagnostics.Debug.Assert(eventArgs.HitStroke != null); 586System.Diagnostics.Debug.Assert(eventArgs != null); 684System.Diagnostics.Debug.Assert(stroke != null && hitFragments != null && hitFragments.Length > 0); 725System.Diagnostics.Debug.Assert(stroke != null); 832System.Diagnostics.Debug.Assert(stylusPoints != null && index >= 0 && index < stylusPoints.Count);
System\Windows\Ink\Stroke.cs (21)
129Debug.Assert(_cachedGeometry == null || _cachedGeometry.IsFrozen); 266Debug.Assert(bezierPoints != null && bezierPoints.Count > 0); 319Debug.Assert(stylusPointsCount > stylusPointsIndex); 337Debug.Assert(bezierLength >= prevUnbezierLength); 730System.Diagnostics.Debug.Assert(cutAt != null); 731System.Diagnostics.Debug.Assert(cutAt.Length != 0); 762System.Diagnostics.Debug.Assert(false == ((!DoubleUtil.AreClose(cutAt[cutAt.Length - 1].EndFIndex, StrokeFIndices.AfterLast)) && 772System.Diagnostics.Debug.Assert(DoubleUtil.LessThan(fragment.BeginFIndex, fragment.EndFIndex)); 792System.Diagnostics.Debug.Assert(cutAt != null); 793System.Diagnostics.Debug.Assert(cutAt.Length != 0); 818System.Diagnostics.Debug.Assert(false == ((!DoubleUtil.AreClose(cutAt[cutAt.Length - 1].EndFIndex, StrokeFIndices.AfterLast)) && 836System.Diagnostics.Debug.Assert(DoubleUtil.LessThan(beginFIndex, fragment.BeginFIndex)); 865Debug.Assert(sourceStylusPoints != null); 878System.Diagnostics.Debug.Assert(pointCount >= 1); 888System.Diagnostics.Debug.Assert(sourceStylusPoints.Count > i + beginIndex); 892System.Diagnostics.Debug.Assert(stylusPoints.Count == pointCount); 1018System.Diagnostics.Debug.Assert(IsValidStrokeFIndices(fragments[0])); 1029System.Diagnostics.Debug.Assert(x == 0); 1032System.Diagnostics.Debug.Assert(IsValidStrokeFIndices(fragments[x]) && fragments[x].EndFIndex > current); 1162Debug.Assert(ienum != null); 1181Debug.Assert(ienum != null);
System\Windows\Ink\Stroke2.cs (10)
499System.Diagnostics.Debug.Assert(_cachedGeometry != null && _cachedGeometry.IsFrozen); 532System.Diagnostics.Debug.Assert(false == _drawAsHollow); 562System.Diagnostics.Debug.Assert(geometry != null); 571System.Diagnostics.Debug.Assert(newBounds.IsEmpty == false); 581System.Diagnostics.Debug.Assert(shape != null); 582System.Diagnostics.Debug.Assert(path != null); 601System.Diagnostics.Debug.Assert(lasso != null); 624System.Diagnostics.Debug.Assert(cutAt != null); 648System.Diagnostics.Debug.Assert(cutAt != null); 686System.Diagnostics.Debug.Assert(DoubleUtil.IsZero(originalDa.StylusTipTransform.OffsetX) && DoubleUtil.IsZero(originalDa.StylusTipTransform.OffsetY));
System\Windows\Ink\StrokeCollection.cs (5)
124Debug.Assert(stream != null); 125Debug.Assert(stream.CanRead); 552Debug.Assert(stroke != null && IndexOf(stroke) == -1); 660Debug.Assert(e.Removed.Count > 0); 727Debug.Assert(startingIndex >= 0);
System\Windows\Ink\StrokeCollection2.cs (2)
475System.Diagnostics.Debug.Assert(original != null && toReplace != null); 476System.Diagnostics.Debug.Assert(index >= 0 && index < this.Count);
System\Windows\Input\InputMethod.cs (5)
565Debug.Assert(value != InputMethodState.DoNotCare); 626Debug.Assert(value != InputMethodState.DoNotCare); 660Debug.Assert(value != InputMethodState.DoNotCare); 829Debug.Assert((value & ImeConversionModeValues.DoNotCare) == 0); 1080Debug.Assert((value & ImeSentenceModeValues.DoNotCare) == 0);
System\Windows\Input\ManipulationDevice.cs (5)
158Debug.Assert(manipulator != null); 176Debug.Assert(manipulator != null); 363Debug.Assert(!deltaEventArgs.IsInertial); 429Debug.Assert(!completedEventArgs.IsInertial); 458Debug.Assert(_manipulators == null || _manipulators.Count == 0);
System\Windows\Input\ManipulationLogic.cs (2)
229Debug.Assert(_lastManipulationBeforeInertia != null); 647Debug.Assert(_containerLayoutUpdated != null);
System\Windows\Input\Stylus\Common\DynamicRenderer.cs (3)
512Debug.Assert(si!=null); // should never get here unless we are transitioning a stroke. 963Debug.Assert(si.StrokeHV.Clip == null); 965Debug.Assert(_renderCompleteStrokeInfo == null);
System\Windows\Input\Stylus\Common\DynamicRendererThreadManager.cs (1)
177Debug.Assert(__inkingDispatcher != null); // We should have a valid ref here
System\Windows\Input\Stylus\Common\MultiTouchSystemGestureLogic.cs (2)
72Debug.Assert(_firstStylusDeviceId != null && _firstStylusDeviceId != stylusInputReport.StylusDeviceId); 73Debug.Assert(_secondStylusDeviceId == null);
System\Windows\Input\Stylus\Common\RawStylusInput.cs (1)
42System.Diagnostics.Debug.Assert(tabletToElementTransform.IsFrozen);
System\Windows\Input\Stylus\Common\StylusLogic.cs (2)
427Debug.Assert(_transformToDeviceMatrices[hwndSource.CompositionTarget.CurrentDpiScale].HasInverse); 745Debug.Assert(GetFlickAction(flickData) == FlickAction.Scroll); // Make sure scroll action is set in flickdata.
System\Windows\Input\Stylus\Common\StylusPlugInCollection.cs (4)
65System.Diagnostics.Debug.Assert(this.Count > 0); // If active must have more than one plugin already 574System.Diagnostics.Debug.Assert(_element.IsEnabled == (bool)e.NewValue); 580System.Diagnostics.Debug.Assert(_element.IsVisible == (bool)e.NewValue); 586System.Diagnostics.Debug.Assert(_element.IsHitTestVisible == (bool)e.NewValue);
System\Windows\Input\Stylus\Common\StylusPoint.cs (2)
259Debug.Assert(value != null && 515Debug.Assert(StylusPointDescription.AreCompatible(stylusPoint1.Description, stylusPoint2.Description));
System\Windows\Input\Stylus\Common\StylusPointCollection.cs (3)
372Debug.Assert(count <= this.Count); 541Debug.Assert(additionalData.Length == countToCopy); 617Debug.Assert( this.Description.ButtonCount > 0 ?
System\Windows\Input\Stylus\Common\StylusPointDescription.cs (4)
308Debug.Assert( stylusPointDescription1._stylusPointPropertyInfos.Length >= RequiredCountOfProperties && 313Debug.Assert( stylusPointDescription2._stylusPointPropertyInfos.Length >= RequiredCountOfProperties && 350Debug.Assert(stylusPointDescription._stylusPointPropertyInfos.Length >= 3 && 355Debug.Assert(stylusPointDescriptionPreserveInfo._stylusPointPropertyInfos.Length >= 3 &&
System\Windows\Input\Stylus\Common\TabletDeviceBase.cs (1)
265Debug.Assert(properties != null);
System\Windows\Input\Stylus\Pointer\PointerStylusDevice.cs (2)
827Debug.Assert(transformToElement != null); 1137Debug.Assert(transformToElement != null);
System\Windows\Input\Stylus\Pointer\PointerStylusPlugInManager.cs (1)
172System.Diagnostics.Debug.Assert(data.Length % pointLength == 0);
System\Windows\Input\Stylus\Wisp\PenContext.cs (5)
125Debug.Assert(_pimcContext != null && _pimcContext.Value != null); 153Debug.Assert(_statusPropertyIndex != -1); // We should always see this. 342System.Diagnostics.Debug.Assert(stylusPointerId != 0); 445Debug.Assert(numPackets != 0); 446Debug.Assert(data != null);
System\Windows\Input\Stylus\Wisp\PenContexts.cs (2)
489System.Diagnostics.Debug.Assert(!inputReport.StylusDevice.CheckAccess()); 508System.Diagnostics.Debug.Assert(data.Length % pointLength == 0);
System\Windows\Input\Stylus\Wisp\PenThreadWorker.cs (4)
525Debug.Assert(penContext != null); 552Debug.Assert(penContext != null); 1045Debug.Assert(pc != null && pc.CommHandle != IntPtr.Zero); 1099Debug.Assert(pc != null && pc.CommHandle != IntPtr.Zero);
System\Windows\Input\Stylus\Wisp\WispLogic.cs (12)
108Debug.Assert(systemGesture != SystemGesture.None); // We should ever see this as input. 833Debug.Assert((actions & ~(RawMouseActions.Button3Press | RawMouseActions.Button3Release | 1735Debug.Assert(ShouldPromoteToMouse(stylusDevice) && stylusDevice.TouchDevice.PromotingToOther); 2511Debug.Assert(stylusDevice.InAir); 2525Debug.Assert(stylusDevice.InAir); 2794System.Diagnostics.Debug.Assert(stylusDevice != null); 2819System.Diagnostics.Debug.Assert(stylusDevice != null); 2884System.Diagnostics.Debug.Assert(stylusDevice != null); 3028Debug.Assert(__stylusDeviceMap.ContainsKey(stylusDevice.Id)); 3038Debug.Assert(Dispatcher.CheckAccess()); 3224Debug.Assert(Dispatcher.CheckAccess()); 3272Debug.Assert(Dispatcher.CheckAccess());
System\Windows\Input\Stylus\Wisp\WispStylusDevice.cs (3)
1374Debug.Assert(transformToElement != null); 1430Debug.Assert(report.TabletDeviceId == _tabletDevice.Id); 1431Debug.Assert((report.Actions & RawStylusActions.None) == 0);
System\Windows\Input\Stylus\Wisp\WispTabletDevice.cs (2)
186Debug.Assert(_stylusDeviceCollection != null); 228Debug.Assert(CheckAccess());
System\Windows\Input\Stylus\Wisp\WispTabletDeviceCollection.cs (3)
544Debug.Assert(index <= Count); 545Debug.Assert(tabletDevice.Type != (TabletDeviceType)(-1)); // make sure not the mouse tablet device! 564System.Diagnostics.Debug.Assert(index < Count && Count > 0);
System\Windows\Input\TextComposition.cs (1)
318Debug.Assert((_resultText.Length == 1) && Char.IsControl(_resultText[0]));
System\Windows\Input\TextCompositionManager.cs (1)
732Debug.Assert(_altNumpadEntryMode);
System\Windows\Input\TouchDevice.cs (1)
943Debug.Assert(element != null);
System\Windows\InterOp\D3DImage.cs (8)
594Debug.Assert(timeout != Duration.Automatic); 635Debug.Assert(e.OldValue != e.NewValue); 672Debug.Assert(_isDirty); 673Debug.Assert(_isWaitingForPresent); 674Debug.Assert(_lockCount == 0); 695Debug.Assert(_duceResource.IsOnChannel(channel)); 784Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 859Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\InterOp\HwndAppCommandInputProvider.cs (1)
39Debug.Assert(null != _source);
System\Windows\InterOp\HwndKeyboardInputProvider.cs (5)
51Debug.Assert( null != _source ); 66Debug.Assert( null != _source ); 717Debug.Assert( null != _source ); 750Debug.Assert( null != _source ); 822Debug.Assert( null != _source );
System\Windows\InterOp\HwndMouseInputProvider.cs (5)
48Debug.Assert(null != _source && null != _source.Value); 79Debug.Assert(null != _source && null != _source.Value); 129Debug.Assert(null != _source && null != _source.Value); 1194Debug.Assert(null != _source && null != _source.Value); 1239Debug.Assert(null != _source && null != _source.Value);
System\Windows\InterOp\HwndSource.cs (3)
749Debug.Assert(_weakMenuModeMessageHandler == null); 773Debug.Assert(_weakMenuModeMessageHandler != null); 1546Debug.Assert(_adjustSizingForNonClientArea == true);
System\Windows\InterOp\HwndStylusInputProvider.cs (1)
74Debug.Assert( null != _source );
System\Windows\InterOp\HwndTarget.cs (11)
480Debug.Assert(normalizedHwnd.Handle != IntPtr.Zero); 514Debug.Assert(normalizedHwnd.Handle != IntPtr.Zero); 602Debug.Assert(mode == RenderingMode.Software || mode == RenderingMode.Default); 728Debug.Assert(!_compositionTarget.IsOnChannel(channel)); 729Debug.Assert(!_compositionTarget.IsOnChannel(outOfBandChannel)); 748Debug.Assert(resourceCreated); 1348Debug.Assert(_restoreDT == sourceDT); 2386Debug.Assert(!_compositionTarget.IsOnChannel(channel)); 2612Debug.Assert(hwndTarget != null); 2633Debug.Assert(hwndTarget != null); 2636Debug.Assert(_hwndTargetCount >= 0);
System\Windows\Media\Animation\Animatable.cs (1)
323Debug.Assert(reference is WeakReference);
System\Windows\Media\Animation\AnimationClockResource.cs (6)
73Debug.Assert(sender as System.Windows.Threading.DispatcherObject != null); 74Debug.Assert(((System.Windows.Threading.DispatcherObject)sender).Dispatcher != null); 75Debug.Assert(_animationClock != null); 127Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 168Debug.Assert(_duceResource.IsOnChannel(channel)); 184Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\AnimationLayer.cs (13)
21Debug.Assert(ownerStorage != null); 32Debug.Assert( 108Debug.Assert(_animationClocks != null); 123Debug.Assert(animationClocks != null); 124Debug.Assert(animationClocks.Count > 0); 125Debug.Assert(!animationClocks.Contains(null)); 126Debug.Assert(_animationClocks == null); 190Debug.Assert(newAnimationClocks != null); 191Debug.Assert(newAnimationClocks.Count > 0); 192Debug.Assert(!newAnimationClocks.Contains(null)); 225Debug.Assert(defaultDestinationValue != DependencyProperty.UnsetValue); 245Debug.Assert(_snapshotValue != DependencyProperty.UnsetValue); 266Debug.Assert(count > 0);
System\Windows\Media\Animation\AnimationStorage.cs (26)
53Debug.Assert( _propertyTriggerLayers == null 82Debug.Assert(animationClock != null); 83Debug.Assert(_dependencyObject.Target != null); 84Debug.Assert(_currentTimeInvalidatedHandler != null); 110Debug.Assert(animationClock != null); 111Debug.Assert(_currentTimeInvalidatedHandler != null); 123Debug.Assert(_dependencyObject == null); 124Debug.Assert(_dependencyProperty == null); 148Debug.Assert(_propertyTriggerLayers != null); 149Debug.Assert(_propertyTriggerLayers.ContainsValue(layer)); 153Debug.Assert(index >= 0); 252Debug.Assert(animatedPropertyMap[_dependencyProperty.GlobalIndex] != DependencyProperty.UnsetValue); 658Debug.Assert(animationClocks[i] != null); 666Debug.Assert(handoffBehavior == HandoffBehavior.Compose); 667Debug.Assert(storage != null); 668Debug.Assert(storage._animationClocks != null); 713Debug.Assert(animationClocks != null); 714Debug.Assert(!animationClocks.Contains(null)); 786Debug.Assert(animation == null || IsAnimationValid(dp, animation)); 787Debug.Assert(IsPropertyAnimatable(d, dp)); 926Debug.Assert(storage._snapshotValue != DependencyProperty.UnsetValue); 938Debug.Assert(currentPropertyValue != DependencyProperty.UnsetValue); 948Debug.Assert(count > 0); 980Debug.Assert(clocksCount > 0); 981Debug.Assert(defaultDestinationValue != DependencyProperty.UnsetValue); 1094Debug.Assert( AnimatedPropertyMapField.GetValue(d)[dp.GlobalIndex] == DependencyProperty.UnsetValue
System\Windows\Media\Animation\Clock.cs (121)
65Debug.Assert(timeline != null); 175Debug.Assert(!IsTimeManager); 204Debug.Assert(!IsTimeManager); 222Debug.Assert(!IsTimeManager); 244Debug.Assert(!IsTimeManager); 282Debug.Assert(!IsTimeManager); 295Debug.Assert(!IsTimeManager); 313Debug.Assert(!IsTimeManager); 340Debug.Assert(!IsTimeManager); 368Debug.Assert(!IsTimeManager); 500Debug.Assert(!IsTimeManager); 586Debug.Assert(!clock.IsTimeManager); 636Debug.Assert(!current.IsTimeManager); // We should not yet be connected to the TimeManager 714Debug.Assert(!IsTimeManager); 789Debug.Assert(!IsTimeManager); 796Debug.Assert(!(IsInteractivelyPaused && PendingInteractivePause)); 797Debug.Assert(!(!IsInteractivelyPaused && PendingInteractiveResume)); 834Debug.Assert(!IsTimeManager); 841Debug.Assert( !(IsInteractivelyPaused && PendingInteractivePause)); 842Debug.Assert( !(!IsInteractivelyPaused && PendingInteractiveResume)); 869Debug.Assert(IsRoot); 891Debug.Assert(IsRoot); 962Debug.Assert(IsRoot); 973Debug.Assert(IsRoot); 1004Debug.Assert(IsRoot); 1085Debug.Assert(!IsTimeManager); 1121Debug.Assert(!IsTimeManager); 1143Debug.Assert(!IsTimeManager); 1162Debug.Assert(!IsTimeManager); 1241Debug.Assert(!IsTimeManager); 1389Debug.Assert(!IsTimeManager); 1426Debug.Assert(!IsTimeManager); 1427Debug.Assert(_parent != null && !_parent.IsTimeManager); 1799Debug.Assert(IsRoot); // root clocks only; non-roots have constant begin time 1800Debug.Assert(_rootData != null); 1805Debug.Assert(!RootBeginPending); // we can have either a begin or a seek, not both 1876Debug.Assert(_beginTime.HasValue); 1927Debug.Assert(IsRoot); 1933Debug.Assert(_rootData.DesiredFrameRate > 0); 1953Debug.Assert(!IsTimeManager); 1954Debug.Assert(!IsInteractivelyStopped); 1955Debug.Assert(_parent._currentClockState != ClockState.Stopped); 1956Debug.Assert(_currentClockState != ClockState.Stopped); 1958Debug.Assert(_beginTime.HasValue); 1960Debug.Assert(parentTime >= _beginTime.Value); // We are active or in postfill 1976Debug.Assert(_currentClockState != ClockState.Active); 2185Debug.Assert(_currentClockState == ClockState.Active 2268Debug.Assert(!IsTimeManager); 2269Debug.Assert(!IsInteractivelyStopped); 2270Debug.Assert(_parent._currentClockState != ClockState.Stopped); 2271Debug.Assert(_beginTime.HasValue); 2320Debug.Assert(!IsTimeManager); 2321Debug.Assert(!IsInteractivelyStopped); 2322Debug.Assert(_parent._currentClockState != ClockState.Stopped); 2323Debug.Assert(_currentClockState == ClockState.Active); // Must be active at this point 2350Debug.Assert(!IsTimeManager); 2351Debug.Assert(!IsInteractivelyStopped); 2352Debug.Assert(_parent._currentClockState != ClockState.Stopped); 2353Debug.Assert(_currentClockState != ClockState.Stopped); 2443Debug.Assert(!IsTimeManager); 2485Debug.Assert(!IsTimeManager); 2486Debug.Assert(!IsInteractivelyStopped || IsRoot); 2536Debug.Assert(_beginTime.HasValue); // _currentIterationBeginTime.HasValue implies _beginTime.HasValue 2565Debug.Assert(repeatBehavior == RepeatBehavior.Forever); // Only other valid enum value 2659Debug.Assert(!IsTimeManager); 2660Debug.Assert(!IsInteractivelyStopped || IsRoot); 2672Debug.Assert(_beginTime.HasValue); 2701Debug.Assert(IsRoot); 2744Debug.Assert(_beginTime == null); 2745Debug.Assert(_currentClockState == ClockState.Stopped); 2769Debug.Assert(!IsInteractivelyPaused); // Enforce invariant: cannot be pausePending when already paused 2770Debug.Assert(!PendingInteractiveResume); // Enforce invariant: cannot be both pause and resumePending 2787Debug.Assert(IsInteractivelyPaused); 2788Debug.Assert(!PendingInteractivePause); 2816Debug.Assert(endOfActivePeriod.HasValue); 2894Debug.Assert(!IsTimeManager); 2919Debug.Assert(parentTime.HasValue); // If parent isn't stopped, it must have valid time and speed 2920Debug.Assert(parentSpeed.HasValue); 2946Debug.Assert(parentTime.HasValue); // Cannot be true unless parent is stopped 2967Debug.Assert(_beginTime.HasValue); 2968Debug.Assert(parentTime.HasValue); 3013Debug.Assert(!IsTimeManager); 3014Debug.Assert(!IsInteractivelyStopped); 3015Debug.Assert(_parent._currentClockState != ClockState.Stopped); 3016Debug.Assert(_beginTime.HasValue); 3088Debug.Assert(!IsTimeManager); 3089Debug.Assert(!IsInteractivelyStopped || IsRoot); 3171Debug.Assert(!IsTimeManager); 3172Debug.Assert(_parent != null); 3173Debug.Assert(_parent.CurrentState != ClockState.Stopped); 3176Debug.Assert(HasSeekOccuredAfterLastTick || 3180Debug.Assert(_syncData.SyncClock == this || _syncData.SyncClock._parent == this); 3181Debug.Assert(CanSlip || _timeline is ParallelTimeline && ((ParallelTimeline)_timeline).SlipBehavior == SlipBehavior.Slip); 3183Debug.Assert(_syncData != null); 3184Debug.Assert(!_syncData.IsInSyncPeriod); 3187Debug.Assert(_timeline.AutoReverse == false); 3188Debug.Assert(_timeline.AccelerationRatio == 0); 3189Debug.Assert(_timeline.DecelerationRatio == 0); 3236Debug.Assert(syncClockDuration == Duration.Automatic); 3304Debug.Assert(!IsTimeManager); 3305Debug.Assert(_parent != null); 3306Debug.Assert(_syncData != null); 3307Debug.Assert(_syncData.IsInSyncPeriod); 3310Debug.Assert(_syncData.SyncClock == this || _syncData.SyncClock._parent == this); 3314Debug.Assert(!parentIntervalCollection.IsEmpty); // The parent isn't Stopped, so it must have a TIC 3318Debug.Assert(parentIntervalCollection.IsEmptyOfRealPoints || parentIntervalCollection.FirstNodeTime <= currentParentTimePT); 3319Debug.Assert(currentParentSpeed >= 0); 3449Debug.Assert(!IsTimeManager); 3530Debug.Assert(_rootData.DesiredFrameRate > 0); 3558Debug.Assert(!IsTimeManager); 3581Debug.Assert(!IsTimeManager); 3582Debug.Assert(_parent == null); 3583Debug.Assert(_timeManager == null); 3674Debug.Assert(factor != 0); // Divide by zero 3761Debug.Assert(IsRoot); // This should only be called on root-child clocks 3797Debug.Assert(!IsTimeManager); 3879Debug.Assert(!IsTimeManager); 3999Debug.Assert(syncClock != null); 4000Debug.Assert(syncClock.GetCanSlip()); 4001Debug.Assert(syncClock.IsRoot || syncClock._timeline.BeginTime.HasValue); // Only roots may later validate their _beginTime 4090Debug.Assert(_syncClockBeginTime.HasValue); // This should never be queried on a root without beginTime
System\Windows\Media\Animation\ClockGroup.cs (11)
56Debug.Assert(!IsTimeManager); 69Debug.Assert(!IsTimeManager); 82Debug.Assert(IsTimeManager); 100Debug.Assert(timelineGroup != null); 189Debug.Assert(IsTimeManager); 217Debug.Assert(IsTimeManager); 254Debug.Assert(IsTimeManager); 300Debug.Assert(group != null); // We should only have this flag set for ClockGroups 314Debug.Assert(_children != null); 438Debug.Assert(IsRoot); 464Debug.Assert(_timeManager != null); // RootActivate should be called by our own TimeManager
System\Windows\Media\Animation\DoubleAnimationUsingPath.cs (2)
173Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 266Debug.Assert(!_isValid);
System\Windows\Media\Animation\Generated\BooleanAnimationUsingKeyFrames.cs (1)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\BooleanKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\ByteAnimation.cs (1)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\ByteAnimationUsingKeyFrames.cs (1)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\ByteKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\CharAnimationUsingKeyFrames.cs (1)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\CharKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\ColorAnimation.cs (1)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\ColorAnimationUsingKeyFrames.cs (1)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\ColorIndependentAnimationStorage.cs (1)
45Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\ColorKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\DecimalAnimation.cs (1)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\DecimalAnimationUsingKeyFrames.cs (1)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\DecimalKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\DoubleAnimation.cs (1)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\DoubleAnimationUsingKeyFrames.cs (1)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\DoubleIndependentAnimationStorage.cs (1)
45Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\DoubleKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\Int16Animation.cs (1)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Int16AnimationUsingKeyFrames.cs (1)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Int16KeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\Int32Animation.cs (1)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Int32AnimationUsingKeyFrames.cs (1)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Int32KeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\Int64Animation.cs (1)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Int64AnimationUsingKeyFrames.cs (1)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Int64KeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\MatrixAnimationUsingKeyFrames.cs (1)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\MatrixIndependentAnimationStorage.cs (1)
45Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\MatrixKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\ObjectAnimationUsingKeyFrames.cs (1)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\ObjectKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\Point3DAnimation.cs (1)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Point3DAnimationUsingKeyFrames.cs (1)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Point3DIndependentAnimationStorage.cs (1)
45Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\Point3DKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\PointAnimation.cs (1)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\PointAnimationUsingKeyFrames.cs (1)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\PointIndependentAnimationStorage.cs (1)
45Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\PointKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\QuaternionAnimation.cs (1)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\QuaternionAnimationUsingKeyFrames.cs (1)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\QuaternionIndependentAnimationStorage.cs (1)
45Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\QuaternionKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\RectAnimation.cs (1)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\RectAnimationUsingKeyFrames.cs (1)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\RectIndependentAnimationStorage.cs (1)
45Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\RectKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\Rotation3DAnimation.cs (1)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Rotation3DAnimationUsingKeyFrames.cs (1)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Rotation3DKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\SingleAnimation.cs (1)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\SingleAnimationUsingKeyFrames.cs (1)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\SingleKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\SizeAnimation.cs (1)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\SizeAnimationUsingKeyFrames.cs (1)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\SizeIndependentAnimationStorage.cs (1)
45Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\SizeKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\StringAnimationUsingKeyFrames.cs (1)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\StringKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\Vector3DAnimation.cs (1)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Vector3DAnimationUsingKeyFrames.cs (1)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Vector3DIndependentAnimationStorage.cs (1)
45Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\Vector3DKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\VectorAnimation.cs (1)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\VectorAnimationUsingKeyFrames.cs (1)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\VectorKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\IndependentAnimationStorage.cs (14)
67Debug.Assert(d != null); 71Debug.Assert(d.Dispatcher != null); 74Debug.Assert(d.CheckAccess()); 96Debug.Assert(_duceResource.IsOnChannel(channel)); 112Debug.Assert(d != null); 115Debug.Assert(d.Dispatcher != null); 118Debug.Assert(d.CheckAccess()); 183Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 215Debug.Assert(d != null); 219Debug.Assert(_duceResource.IsOnAnyChannel); 235Debug.Assert(d != null); 236Debug.Assert(dp != null); 237Debug.Assert(d is Animatable ? ((Animatable)d).HasAnimatedProperties : true); 247Debug.Assert(storage._duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\KeySpline.cs (3)
265Debug.Assert(_isDirty); 317Debug.Assert(_isSpecified); 339Debug.Assert(_isSpecified);
System\Windows\Media\Animation\MatrixAnimationUsingPath.cs (2)
257Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 320Debug.Assert(!_isValid);
System\Windows\Media\Animation\PointAnimationUsingPath.cs (2)
150Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 223Debug.Assert(!_isValid);
System\Windows\Media\Animation\TimeIntervalCollection.cs (83)
111Debug.Assert(_minimumCapacity >= 2); 138Debug.Assert(IsEmpty); // We should start with a new or Clear()-ed collection first 145Debug.Assert(_nodeIsInterval[0] == false); 194Debug.Assert(_count == 0); // The boolean constructor already did the job for us 256Debug.Assert(_count > 0); 302Debug.Assert(IsSingleInterval); 304Debug.Assert(0 < _count && _count <= 2); 313Debug.Assert(beginTime <= _nodeTime[1]); 417Debug.Assert(_nodeTime[index] < time); 549Debug.Assert(fromIndex <= toIndex); 560Debug.Assert(toIndex >= 0); // Since fromIndex!=toIndex, toIndex must be >= 0 567Debug.Assert(fromIndex + 1 < toIndex); 623Debug.Assert(!_invertCollection); // Make sure we never leave inverted mode enabled 687Debug.Assert(!tic1.IsEmptyOfRealPoints); // We shouldn't reach here if either TIC is empty 688Debug.Assert(!tic2.IsEmptyOfRealPoints); 716Debug.Assert(!intersectionFound); // If an intersection was already found, we should not reach this far 726Debug.Assert(tic2.CurrentNodeIsPoint || tic2.CurrentNodeIsInterval); 744Debug.Assert(!tic1.CurrentIsAtLastNode); // Thus tic1._current can be safely advanced now 750Debug.Assert(tic1.CurrentNodeTime >= tic2.CurrentNodeTime); 753Debug.Assert(tic2.CurrentIsAtLastNode || (tic1.CurrentNodeTime < tic2.NextNodeTime)); 754Debug.Assert(tic1.CurrentIsAtLastNode || (tic2.CurrentNodeTime < tic1.NextNodeTime)); 786Debug.Assert(tic1.NextNodeTime == tic2.NextNodeTime); 794Debug.Assert(tic1.CurrentIsAtLastNode && tic2.CurrentIsAtLastNode); 802Debug.Assert(tic2.CurrentIsAtLastNode || (tic1.CurrentNodeTime < tic2.NextNodeTime)); 803Debug.Assert(tic1.CurrentIsAtLastNode || (tic2.CurrentNodeTime < tic1.NextNodeTime)); 814Debug.Assert(!_invertCollection); // Make sure we never leave inverted mode enabled 862Debug.Assert(!_invertCollection); // Make sure we never leave inverted mode enabled 881Debug.Assert(beginTime <= CurrentNodeTime); // The PTIC is clipped by the active period, and we are a subset of the active period 882Debug.Assert(CurrentIsAtLastNode || beginTime < NextNodeTime); 989Debug.Assert(!_invertCollection); // Make sure we never leave inverted mode enabled 1037Debug.Assert(projection.IsEmpty); // Make sure the projection was properly cleared first 1038Debug.Assert(!_invertCollection); // Make sure we never leave inverted mode enabled 1039Debug.Assert(beginTime <= endTime); // Ensure legitimate begin/end clipping parameters 1041Debug.Assert(!IsEmptyOfRealPoints); // We assume this function is ONLY called when this collection overlaps the postfill zone. So we cannot be empty. 1042Debug.Assert(!period.HasTimeSpan || period.TimeSpan > TimeSpan.Zero || beginTime == endTime); // Check the consistency of degenerate case where simple duration is zero; expiration time should equal beginTime 1043Debug.Assert(!_nodeIsInterval[_count - 1]); // We should not have an infinite domain set 1160Debug.Assert(projection.IsEmpty); 1161Debug.Assert(!_invertCollection); // Make sure we never leave inverted mode enabled 1162Debug.Assert(!endTime.HasValue || beginTime <= endTime); // Ensure legitimate begin/end clipping parameters 1164Debug.Assert(!IsEmptyOfRealPoints); // We assume this function is ONLY called when this collection overlaps the active zone. So we cannot be empty. 1165Debug.Assert(!endTime.HasValue || endTime >= _nodeTime[0]); // EndTime must come at or after our first node (it can be infinite) 1166Debug.Assert(_nodeTime[_count - 1] >= beginTime); // Our last node must come at least at begin time (since we must intersect the active period) 1167Debug.Assert(endTime.HasValue || fillDuration == TimeSpan.Zero); // Either endTime is finite, or it's infinite hence we cannot have any fill zone 1168Debug.Assert(!period.HasTimeSpan || period.TimeSpan > TimeSpan.Zero || (endTime.HasValue && beginTime == endTime)); // Check the consistency of degenerate case where simple duration is zero; expiration time should equal beginTime 1169Debug.Assert(!_nodeIsInterval[_count - 1]); // We should not have an infinite domain set 1243Debug.Assert(!IsEmptyOfRealPoints); 1244Debug.Assert(projection.IsEmpty); 1283Debug.Assert(_current > 0); // The only way _current could stay at zero is if the collection begins at (or past) the end of active period 1288Debug.Assert(endTime.HasValue && CurrentNodeTime >= endTime.Value); 1313Debug.Assert(!IsEmptyOfRealPoints); // The entire projection process assumes we are not empty (have an intersection with the active zone). 1314Debug.Assert(periodInTicks > 0); // We do not handle the degenerate case here. 1318Debug.Assert(CurrentNodeTime >= TimeSpan.Zero); // Verify that we are already clipped 1335Debug.Assert(CurrentNodeIsPoint); 1355Debug.Assert(CurrentNodeIsPoint); // We should only call this method when we project a legitimate point 1356Debug.Assert(!CurrentNodeIsInterval); 1427Debug.Assert(timeBeforeNextPeriod > 0); 1500Debug.Assert(intervalLength > 0); 1583Debug.Assert(index == -1 || _nodeTime[index] < point); 1614Debug.Assert(from < to); // Our code should never call MergeInterval for a point or reversed interval 1630Debug.Assert(_nodeTime.Length >= _minimumCapacity); // Assert that we indeed have memory allocated 1668Debug.Assert(_nodeTime[fromIndex] == from); 1699Debug.Assert(_nodeTime[toIndex] == to); 1700Debug.Assert(fromIndex < toIndex); 1731Debug.Assert(_count + netIncreaseInNodes >= 2); // We should never shrink past size 2 1779Debug.Assert(_nodeIsPoint == null); 1780Debug.Assert(_nodeIsInterval == null); 1788Debug.Assert(_nodeIsPoint != null); 1789Debug.Assert(_nodeIsInterval != null); 1820Debug.Assert(periodInTicks > 0); 1821Debug.Assert(accelRatio + decelRatio > 0); 2135Debug.Assert(_count > 0); // Count cannot be negative 2161Debug.Assert(right == _count - 1); 2191Debug.Assert(_current <= _count); 2206Debug.Assert(_current < _count); 2211Debug.Assert(_current < _count); 2220Debug.Assert(_current < _count); 2225Debug.Assert(_current < _count); 2234Debug.Assert(_current < _count); 2239Debug.Assert(_current < _count); 2248Debug.Assert(_current + 1 < _count); 2257Debug.Assert(_current + 1 < _count); 2266Debug.Assert(_current + 1 < _count); 2281Debug.Assert(_invertCollection != mode); // Make sure we aren't redundantly setting the mode
System\Windows\Media\Animation\Timeline.cs (1)
933Debug.Assert(sourceStore.Count > 0);
System\Windows\Media\Animation\WeakRefEnumerator.cs (2)
59Debug.Assert(_valid); 77Debug.Assert(_valid);
System\Windows\Media\BitmapCacheBrush.cs (10)
211Debug.Assert(!_pendingLayout); 269Debug.Assert(element != null); 289Debug.Assert(_pendingLayout); 293Debug.Assert(element != null); 304Debug.Assert(_DispatcherLayoutResult != null); 305Debug.Assert(_DispatcherLayoutResult.Status == DispatcherOperationStatus.Pending); 307Debug.Assert(abortStatus); 319Debug.Assert(_pendingLayout); 322Debug.Assert(element != null); 360Debug.Assert(_reentrancyFlag); // Exit must be matched with Enter. See Enter comments.
System\Windows\Media\BoundsDrawingContextWalker.cs (4)
516Debug.Assert(_pushTypeStack != null); 517Debug.Assert(_pushTypeStack.Count > 0); 526Debug.Assert(_transformStack != null); 527Debug.Assert(_transformStack.Count > 0);
System\Windows\Media\ByteStreamGeometryContext.cs (7)
328Debug.Assert(sizeof(MIL_PATHGEOMETRY) <= _currOffset); 329Debug.Assert(_currentPathGeometryData.Size == (uint)_currOffset); 558Debug.Assert(_currentPathFigureDataOffset + sizeof(MIL_PATHFIGURE) <= _currOffset); 598Debug.Assert(_currentPolySegmentDataOffset + sizeof(MIL_SEGMENT_POLY) <= _currOffset); 681Debug.Assert(points != null); 682Debug.Assert(count > 0); 731Debug.Assert((_currentPolySegmentDataOffset != -1) &&
System\Windows\Media\ColorContext.cs (2)
170Debug.Assert(_profileUri.Value == null); 598Debug.Assert(stm != null);
System\Windows\Media\ColorTransformHelper.cs (2)
86Debug.Assert(success); 88Debug.Assert(success);
System\Windows\Media\CombinedGeometry.cs (1)
208Debug.Assert(false);
System\Windows\Media\CompositionTarget.cs (6)
71Debug.Assert(channel != null); 72Debug.Assert(!_contentRoot.IsOnChannel(channel)); 74Debug.Assert(outOfBandChannel != null); 75Debug.Assert(!_contentRoot.IsOnChannel(outOfBandChannel)); 86Debug.Assert(resourceCreated); 463Debug.Assert(_cachedRenderContext == null);
System\Windows\Media\Drawing.cs (1)
82Debug.Assert(ctx != null);
System\Windows\Media\DrawingContextDrawingContextWalker.cs (1)
36Debug.Assert (drawingContext != null);
System\Windows\Media\DrawingContextWalker.cs (2)
43Debug.Assert(false); 53Debug.Assert(false);
System\Windows\Media\DrawingDrawingContext.cs (3)
1300Debug.Assert(geometry != null); 1386Debug.Assert(newDrawing != null); 1392Debug.Assert(_currentDrawingGroup == null);
System\Windows\Media\DrawingGroup.cs (3)
110Debug.Assert(_open); 111Debug.Assert(rootDrawingGroupChildren != null); 190Debug.Assert(!ctx.ShouldStopWalking);
System\Windows\Media\DrawingGroupDrawingContext.cs (2)
23Debug.Assert(null != drawingGroup); 41Debug.Assert(null != _drawingGroup);
System\Windows\Media\DrawingVisual.cs (4)
61Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated); 149Debug.Assert(_proxy.IsOnChannel(channel)); 222Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentConnected)); 223Debug.Assert(_proxy.IsOnChannel(channel));
System\Windows\Media\DrawingVisualDrawingContext.cs (2)
35Debug.Assert(null != ownerVisual); 51Debug.Assert(null != _ownerVisual);
System\Windows\Media\Effects\Generated\BlurEffect.cs (2)
186Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 230Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Effects\Generated\DropShadowEffect.cs (2)
252Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 319Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Effects\Generated\ImplicitInputBrush.cs (2)
123Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 200Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Effects\Generated\PixelShader.cs (1)
187Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Effects\Generated\ShaderEffect.cs (3)
121Debug.Assert(!channel.IsOutOfBandChannel); 122Debug.Assert(!targetResource.GetHandle(channel).IsNull); 206Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Effects\PixelShader.cs (3)
104Debug.Assert(newUri.IsAbsoluteUri); 171Debug.Assert(len == lengthRead); 194Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel));
System\Windows\Media\Effects\ShaderEffect.cs (7)
417Debug.Assert(false); 557Debug.Assert(!channel.IsOutOfBandChannel); 558Debug.Assert(!targetResource.GetHandle(channel).IsNull); 571Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 725Debug.Assert(sizeof(DUCE.ResourceHandle) == sizeof(Int32)); 807Debug.Assert(_duceResource.IsOnChannel(channel)); 960Debug.Assert(false);
System\Windows\Media\FactoryMaker.cs (2)
108Debug.Assert(s_pFactory != IntPtr.Zero); 124Debug.Assert(s_pImagingFactory != IntPtr.Zero);
System\Windows\Media\FamilyMap.cs (1)
369Debug.Assert(first <= last);
System\Windows\Media\FontFamilyConverter.cs (3)
185Debug.Assert(name != null); 190Debug.Assert(name != null); 195Debug.Assert(name != null);
System\Windows\Media\FormattedText.cs (4)
1025Debug.Assert(_nextLine == null); 1045Debug.Assert(_totalHeight + _currentLine.Height <= _that._maxTextHeight); 1134Debug.Assert(_that._text.Length > 0 && textSourcePosition + line.Length <= _that._text.Length + 1); 1150Debug.Assert(_that._trimming == TextTrimming.WordEllipsis);
System\Windows\Media\Generated\BitmapCache.cs (2)
188Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 232Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\BitmapCacheBrush.cs (10)
125Debug.Assert(!channel.IsOutOfBandChannel); 126Debug.Assert(!targetResource.GetHandle(channel).IsNull); 162Debug.Assert(element != null); 165Debug.Assert(target._DispatcherLayoutResult != null); 166Debug.Assert(target._DispatcherLayoutResult.Status == System.Windows.Threading.DispatcherOperationStatus.Pending); 168Debug.Assert(abortStatus); 186Debug.Assert(!channel.IsOutOfBandChannel); 187Debug.Assert(!targetResource.GetHandle(channel).IsNull); 321Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 409Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\Brush.cs (4)
127Debug.Assert(!channel.IsOutOfBandChannel); 128Debug.Assert(!targetResource.GetHandle(channel).IsNull); 171Debug.Assert(!channel.IsOutOfBandChannel); 172Debug.Assert(!targetResource.GetHandle(channel).IsNull);
System\Windows\Media\Generated\CombinedGeometry.cs (6)
125Debug.Assert(!channel.IsOutOfBandChannel); 126Debug.Assert(!targetResource.GetHandle(channel).IsNull); 169Debug.Assert(!channel.IsOutOfBandChannel); 170Debug.Assert(!targetResource.GetHandle(channel).IsNull); 262Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 327Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\DashStyle.cs (2)
166Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 234Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\DrawingBrush.cs (4)
118Debug.Assert(!channel.IsOutOfBandChannel); 119Debug.Assert(!targetResource.GetHandle(channel).IsNull); 181Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 284Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\DrawingContextWalker.cs (24)
51Debug.Assert(false); 71Debug.Assert(false); 93Debug.Assert(false); 117Debug.Assert(false); 149Debug.Assert(false); 187Debug.Assert(false); 221Debug.Assert(false); 261Debug.Assert(false); 283Debug.Assert(false); 301Debug.Assert(false); 321Debug.Assert(false); 336Debug.Assert(false); 366Debug.Assert(false); 384Debug.Assert(false); 396Debug.Assert(false); 408Debug.Assert(false); 422Debug.Assert(false); 438Debug.Assert(false); 450Debug.Assert(false); 462Debug.Assert(false); 473Debug.Assert(false); 490Debug.Assert(false); 505Debug.Assert(false); 514Debug.Assert(false);
System\Windows\Media\Generated\DrawingGroup.cs (18)
138Debug.Assert(!channel.IsOutOfBandChannel); 139Debug.Assert(!targetResource.GetHandle(channel).IsNull); 151Debug.Assert(resource != null); 162Debug.Assert(resource != null); 205Debug.Assert(!channel.IsOutOfBandChannel); 206Debug.Assert(!targetResource.GetHandle(channel).IsNull); 256Debug.Assert(!channel.IsOutOfBandChannel); 257Debug.Assert(!targetResource.GetHandle(channel).IsNull); 300Debug.Assert(!channel.IsOutOfBandChannel); 301Debug.Assert(!targetResource.GetHandle(channel).IsNull); 344Debug.Assert(!channel.IsOutOfBandChannel); 345Debug.Assert(!targetResource.GetHandle(channel).IsNull); 547Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 656Debug.Assert(_duceResource.IsOnChannel(channel)); 710Debug.Assert(!channel.IsOutOfBandChannel); 711Debug.Assert(!thisResource.GetHandle(channel).IsNull); 738Debug.Assert(!channel.IsOutOfBandChannel); 739Debug.Assert(!thisResource.GetHandle(channel).IsNull);
System\Windows\Media\Generated\DrawingImage.cs (4)
118Debug.Assert(!channel.IsOutOfBandChannel); 119Debug.Assert(!targetResource.GetHandle(channel).IsNull); 181Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 225Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\EllipseGeometry.cs (2)
188Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 262Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\Geometry.cs (2)
125Debug.Assert(!channel.IsOutOfBandChannel); 126Debug.Assert(!targetResource.GetHandle(channel).IsNull);
System\Windows\Media\Generated\GeometryDrawing.cs (8)
118Debug.Assert(!channel.IsOutOfBandChannel); 119Debug.Assert(!targetResource.GetHandle(channel).IsNull); 162Debug.Assert(!channel.IsOutOfBandChannel); 163Debug.Assert(!targetResource.GetHandle(channel).IsNull); 206Debug.Assert(!channel.IsOutOfBandChannel); 207Debug.Assert(!targetResource.GetHandle(channel).IsNull); 299Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 353Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\GeometryGroup.cs (10)
145Debug.Assert(!channel.IsOutOfBandChannel); 146Debug.Assert(!targetResource.GetHandle(channel).IsNull); 158Debug.Assert(resource != null); 169Debug.Assert(resource != null); 246Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 330Debug.Assert(_duceResource.IsOnChannel(channel)); 378Debug.Assert(!channel.IsOutOfBandChannel); 379Debug.Assert(!thisResource.GetHandle(channel).IsNull); 406Debug.Assert(!channel.IsOutOfBandChannel); 407Debug.Assert(!thisResource.GetHandle(channel).IsNull);
System\Windows\Media\Generated\GlyphRunDrawing.cs (6)
103Debug.Assert(!channel.IsOutOfBandChannel); 104Debug.Assert(!targetResource.GetHandle(channel).IsNull); 147Debug.Assert(!channel.IsOutOfBandChannel); 148Debug.Assert(!targetResource.GetHandle(channel).IsNull); 225Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 274Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\GuidelineSet.cs (2)
188Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 263Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\ImageBrush.cs (4)
118Debug.Assert(!channel.IsOutOfBandChannel); 119Debug.Assert(!targetResource.GetHandle(channel).IsNull); 181Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 284Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\ImageDrawing.cs (4)
118Debug.Assert(!channel.IsOutOfBandChannel); 119Debug.Assert(!targetResource.GetHandle(channel).IsNull); 203Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 255Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\LinearGradientBrush.cs (1)
187Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\LineGeometry.cs (2)
166Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 234Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\MatrixTransform.cs (2)
144Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 186Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\PathGeometry.cs (1)
190Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\Pen.cs (6)
118Debug.Assert(!channel.IsOutOfBandChannel); 119Debug.Assert(!targetResource.GetHandle(channel).IsNull); 204Debug.Assert(!channel.IsOutOfBandChannel); 205Debug.Assert(!targetResource.GetHandle(channel).IsNull); 372Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 439Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\RadialGradientBrush.cs (1)
231Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\RectangleGeometry.cs (2)
188Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 262Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\RenderData.cs (11)
525Debug.Assert(_duceResource.IsOnChannel(channel)); 537Debug.Assert(cbExtraData <= (uint)Int32.MaxValue); 553Debug.Assert((_buffer != null) || (_curOffset == 0)); 556Debug.Assert((_buffer == null) || (_curOffset <= _buffer.Length)); 1098Debug.Assert(false); 1122Debug.Assert((_buffer != null) || (_curOffset == 0)); 1125Debug.Assert((_buffer == null) || (_curOffset <= _buffer.Length)); 1438Debug.Assert(false); 1462Debug.Assert((_buffer != null) || (_curOffset == 0)); 1465Debug.Assert((_buffer == null) || (_curOffset <= _buffer.Length)); 1790Debug.Assert(false);
System\Windows\Media\Generated\RenderDataDrawingContext.cs (25)
76Debug.Assert(sizeof(MILCMD_DRAW_LINE) == 40); 134Debug.Assert(sizeof(MILCMD_DRAW_LINE_ANIMATE) == 48); 186Debug.Assert(sizeof(MILCMD_DRAW_RECTANGLE) == 40); 245Debug.Assert(sizeof(MILCMD_DRAW_RECTANGLE_ANIMATE) == 48); 309Debug.Assert(sizeof(MILCMD_DRAW_ROUNDED_RECTANGLE) == 56); 390Debug.Assert(sizeof(MILCMD_DRAW_ROUNDED_RECTANGLE_ANIMATE) == 72); 456Debug.Assert(sizeof(MILCMD_DRAW_ELLIPSE) == 40); 539Debug.Assert(sizeof(MILCMD_DRAW_ELLIPSE_ANIMATE) == 56); 591Debug.Assert(sizeof(MILCMD_DRAW_GEOMETRY) == 16); 639Debug.Assert(sizeof(MILCMD_DRAW_IMAGE) == 40); 693Debug.Assert(sizeof(MILCMD_DRAW_IMAGE_ANIMATE) == 40); 737Debug.Assert(sizeof(MILCMD_DRAW_GLYPH_RUN) == 8); 777Debug.Assert(sizeof(MILCMD_DRAW_DRAWING) == 8); 823Debug.Assert(sizeof(MILCMD_DRAW_VIDEO) == 40); 875Debug.Assert(sizeof(MILCMD_DRAW_VIDEO_ANIMATE) == 40); 911Debug.Assert(sizeof(MILCMD_PUSH_CLIP) == 8); 950Debug.Assert(sizeof(MILCMD_PUSH_OPACITY_MASK) == 24); 991Debug.Assert(sizeof(MILCMD_PUSH_OPACITY) == 8); 1038Debug.Assert(sizeof(MILCMD_PUSH_OPACITY_ANIMATE) == 16); 1076Debug.Assert(sizeof(MILCMD_PUSH_TRANSFORM) == 8); 1154Debug.Assert(sizeof(MILCMD_PUSH_GUIDELINE_SET) == 8); 1193Debug.Assert(sizeof(MILCMD_PUSH_GUIDELINE_Y1) == 8); 1238Debug.Assert(sizeof(MILCMD_PUSH_GUIDELINE_Y2) == 16); 1281Debug.Assert(sizeof(MILCMD_PUSH_EFFECT) == 8); 1325Debug.Assert(sizeof(MILCMD_POP) == 1);
System\Windows\Media\Generated\RotateTransform.cs (2)
188Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 242Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\ScaleTransform.cs (2)
210Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 270Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\SkewTransform.cs (2)
210Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 270Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\SolidColorBrush.cs (2)
144Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 227Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\TransformGroup.cs (10)
138Debug.Assert(!channel.IsOutOfBandChannel); 139Debug.Assert(!targetResource.GetHandle(channel).IsNull); 151Debug.Assert(resource != null); 162Debug.Assert(resource != null); 224Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 289Debug.Assert(_duceResource.IsOnChannel(channel)); 334Debug.Assert(!channel.IsOutOfBandChannel); 335Debug.Assert(!thisResource.GetHandle(channel).IsNull); 362Debug.Assert(!channel.IsOutOfBandChannel); 363Debug.Assert(!thisResource.GetHandle(channel).IsNull);
System\Windows\Media\Generated\TranslateTransform.cs (2)
166Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 214Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\VideoDrawing.cs (4)
103Debug.Assert(!channel.IsOutOfBandChannel); 104Debug.Assert(!targetResource.GetHandle(channel).IsNull); 188Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 240Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\VisualBrush.cs (8)
104Debug.Assert(element != null); 107Debug.Assert(target._DispatcherLayoutResult != null); 108Debug.Assert(target._DispatcherLayoutResult.Status == System.Windows.Threading.DispatcherOperationStatus.Pending); 110Debug.Assert(abortStatus); 128Debug.Assert(!channel.IsOutOfBandChannel); 129Debug.Assert(!targetResource.GetHandle(channel).IsNull); 215Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 319Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Geometry.cs (5)
193Debug.Assert(pWorldMatrix != null); 299Debug.Assert(pbPathData != (byte*)0); 420Debug.Assert(pbPathData != (byte*)0); 622Debug.Assert(pbPathData != (byte*)0); 706Debug.Assert(pbPathData != (byte*)0);
System\Windows\Media\GeometryDrawing.cs (1)
58Debug.Assert(!ctx.ShouldStopWalking);
System\Windows\Media\GeometryGroup.cs (1)
66Debug.Assert(pg.CanFreeze);
System\Windows\Media\GlyphRun.cs (6)
631Debug.Assert(clusterMap[currentClusterStart] < lastGlyphInCluster); 1335Debug.Assert(!IsSideways); 1594Debug.Assert(!IsSideways); 1873Debug.Assert(_glyphTypeface != null); 2375Debug.Assert(!IsInitializing); 2386Debug.Assert(!IsInitialized);
System\Windows\Media\GlyphRunDrawing.cs (1)
54Debug.Assert(!ctx.ShouldStopWalking);
System\Windows\Media\GlyphsSerializer.cs (5)
109Debug.Assert(_clusters[characterIndex] > glyphClusterStart); 120Debug.Assert(_indices.Count > glyphClusterStart - _glyphClusterInitialOffset); 126Debug.Assert(_characters == null || _characters.Count == 0 || _indices.Count == _characters.Count); 174Debug.Assert(_glyphStringBuider.Length == 0); 326Debug.Assert(caretStopStringLength == sb.ToString().Length);
System\Windows\Media\GlyphTypeface.cs (2)
1393Debug.Assert(charBufferRange.Length > 0); 1468Debug.Assert(glyphIndices != null || glyphMetrics != null);
System\Windows\Media\GuidelineCollection.cs (2)
57Debug.Assert(!isDynamic || guidelinesX.Length % 2 == 0); 66Debug.Assert(!isDynamic || guidelinesY.Length % 2 == 0);
System\Windows\Media\HitTestWithGeometryDrawingContextWalker.cs (8)
43Debug.Assert(geometry != null); 343Debug.Assert(_modifierStack != null); 344Debug.Assert(_modifierStack.Count > 0); 354Debug.Assert((_modifierStack.Count > 0) || (_currentTransform == null)); 362Debug.Assert((_modifierStack.Count > 0) || (_currentClip == null)); 366Debug.Assert(currentModifier == null); 392Debug.Assert(_intersectionDetail != IntersectionDetail.FullyContains); 397Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated);
System\Windows\Media\HitTestWithPointDrawingContextWalker.cs (7)
346Debug.Assert(_pointStack != null); 347Debug.Assert(_pointStack.Count > 0); 383Debug.Assert(_noOpLayerDepth >= 1); 420Debug.Assert(!_currentLayerIsNoOp); 421Debug.Assert(_noOpLayerDepth == 0); 431Debug.Assert(_currentLayerIsNoOp); 432Debug.Assert(_noOpLayerDepth == 0);
System\Windows\Media\HostVisual.cs (9)
151Debug.Assert(target != null); 152Debug.Assert(target.Dispatcher.Thread == Thread.CurrentThread); 204Debug.Assert(_target != null); 205Debug.Assert(_target.Dispatcher.Thread == Thread.CurrentThread); 227Debug.Assert(!targetsHandle.IsNull); 263Debug.Assert(IsOnChannel(channel)); 276Debug.Assert(_target._contentRoot.IsOnChannel(channel)); 277Debug.Assert(_target.OutOfBandChannel == MediaContext.CurrentMediaContext.OutOfBandChannel); 279Debug.Assert(!created);
System\Windows\Media\Imaging\BitmapCodecInfo.cs (9)
49Debug.Assert(codecInfoHandle != null); 100Debug.Assert(length >= 0); 143Debug.Assert(length >= 0); 186Debug.Assert(length >= 0); 229Debug.Assert(length >= 0); 272Debug.Assert(length >= 0); 315Debug.Assert(length >= 0); 358Debug.Assert(length >= 0); 401Debug.Assert(length >= 0);
System\Windows\Media\Imaging\BitmapDecoder.cs (4)
951Debug.Assert(_syncObject != null); 1033Debug.Assert((uri.Scheme == Uri.UriSchemeHttp) || (uri.Scheme == Uri.UriSchemeHttps)); 1034Debug.Assert(stream.CanSeek); 1188Debug.Assert(decoder != IntPtr.Zero);
System\Windows\Media\Imaging\BitmapDownload.cs (1)
413Debug.Assert(false);
System\Windows\Media\Imaging\BitmapEncoder.cs (2)
380Debug.Assert(_supportsGlobalThumbnail); 412Debug.Assert(_supportsGlobalMetadata);
System\Windows\Media\Imaging\BitmapFrameDecode.cs (7)
56Debug.Assert(decoder != null); 146Debug.Assert(decoder != null); 451Debug.Assert(_decoder != null); 705Debug.Assert(_decoder is LateBoundBitmapDecoder); 706Debug.Assert(IsDownloading == false); 711Debug.Assert(_decoder.InternalDecoder != null); 716Debug.Assert(_syncObject != null);
System\Windows\Media\Imaging\BitmapFrameEncode.cs (2)
49Debug.Assert(source != null); 178Debug.Assert(sourceBitmapFrameEncode._source != null);
System\Windows\Media\Imaging\BitmapImage.cs (5)
236Debug.Assert(_decoder != null); 374Debug.Assert(decoder.SyncObject != null); 380Debug.Assert(!_decoder.IsDownloading); 449Debug.Assert(oldWidth > 0 && oldHeight > 0); 476Debug.Assert(false);
System\Windows\Media\Imaging\BitmapMetadata.cs (4)
504Debug.Assert(blockWriter != null); 505Debug.Assert(blockWriter.MetadataBlocks != null); 932Debug.Assert(length >= 0); 974Debug.Assert(length >= 0);
System\Windows\Media\Imaging\BitmapMetadataEnumerator.cs (1)
177Debug.Assert(metadataHandle != null && !metadataHandle.IsInvalid);
System\Windows\Media\Imaging\BitmapPalette.cs (7)
165Debug.Assert(source != null); 168Debug.Assert(bitmapSource != null && !bitmapSource.IsInvalid); 202Debug.Assert(palette != null); 270Debug.Assert(palette != null && !palette.IsInvalid); 283Debug.Assert(_palette != null && !_palette.IsInvalid); 312Debug.Assert(_palette != null && !_palette.IsInvalid); 338Debug.Assert(cActualColors == numColors);
System\Windows\Media\Imaging\BitmapPalettes.cs (1)
296Debug.Assert(key < c_maxPalettes);
System\Windows\Media\Imaging\BitmapSizeOptions.cs (4)
209Debug.Assert(_preservesAspectRatio == true); 216Debug.Assert(_preservesAspectRatio == true); 223Debug.Assert(_preservesAspectRatio == false); 264Debug.Assert(false);
System\Windows\Media\Imaging\BitmapSource.cs (5)
562Debug.Assert(_syncObject != null); 800Debug.Assert(_isSourceCached); 980Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 1012Debug.Assert(_duceResource.IsOnChannel(channel)); 1198Debug.Assert(destFmt == colorConvertedBitmap.Format);
System\Windows\Media\Imaging\BitmapSourceSafeMILHandle.cs (1)
91Debug.Assert(wicBitmap != IntPtr.Zero);
System\Windows\Media\Imaging\BitmapVisualManager.cs (2)
91Debug.Assert ((sizeX > 0) && (sizeY > 0)); 92Debug.Assert ((dpiX > 0) && (dpiY > 0));
System\Windows\Media\Imaging\InteropBitmapSource.cs (4)
65Debug.Assert (_unmanagedSource != null && !_unmanagedSource.IsInvalid); 96Debug.Assert (_unmanagedSource != null && !_unmanagedSource.IsInvalid); 143Debug.Assert (_unmanagedSource != null && !_unmanagedSource.IsInvalid); 389Debug.Assert(_sizeOptions.Rotation == Rotation.Rotate0);
System\Windows\Media\Imaging\LateBoundBitmapDecoder.cs (1)
315Debug.Assert(newStream.CanSeek == true);
System\Windows\Media\Imaging\RenderTargetBitmap.cs (2)
268Debug.Assert(renderTargetBitmap != null && !renderTargetBitmap.IsInvalid); 274Debug.Assert(bitmapSource != null && !bitmapSource.IsInvalid);
System\Windows\Media\Imaging\TransformedBitmap.cs (1)
153Debug.Assert(DoubleUtil.IsZero(m.M11) && DoubleUtil.IsZero(m.M22));
System\Windows\Media\Imaging\WriteableBitmap.cs (12)
228Debug.Assert(locked); 612Debug.Assert(_pBackBufferLock == null); 659Debug.Assert(!_isWaitingForCommit); 834Debug.Assert(!(backwardsCompat && (sourceRect.X < 0 || sourceRect.Y < 0 || sourceRect.Width < 0 || sourceRect.Height < 0))); 871Debug.Assert(!(backwardsCompat && sourceBufferStride < 1)); 876Debug.Assert(!backwardsCompat); 1195Debug.Assert(_duceResource.IsOnChannel(channel)); 1238Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 1302Debug.Assert(_isWaitingForCommit); // How else are we here? 1305Debug.Assert(_lockCount == 0); // How else are we here? 1306Debug.Assert(_hasDirtyRects); // How else are we here? 1316Debug.Assert(_duceResource.IsOnChannel(channel)); // How else are we here?
System\Windows\Media\LinearGradientBrush.cs (1)
135Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel));
System\Windows\Media\MatrixStack.cs (4)
163Debug.Assert(!IsEmpty); 175Debug.Assert(!IsEmpty); 191Debug.Assert(_size == 0); // The stack must be empty before this is called. 192Debug.Assert(_highWaterMark <= _items.Length);
System\Windows\Media\MediaContext.cs (23)
211Debug.Assert(dispatcher.Reserved0 == null); 367Debug.Assert(CheckAccess()); 1371Debug.Assert(Channel != null); 1397Debug.Assert(dispatcher.Reserved0 == cm); 1420Debug.Assert(CheckAccess()); 1429Debug.Assert(CheckAccess()); 1460Debug.Assert(_timeManager != null); 1489Debug.Assert(dispatcher != null); 1490Debug.Assert(iv != null); 1502Debug.Assert(!_isDisposed); 1503Debug.Assert(iv != null); 1530Debug.Assert(dispatcher != null); 1531Debug.Assert(iv != null); 1542Debug.Assert(iv != null); 1592Debug.Assert(callback != null); 1597Debug.Assert(arg != null); 1638Debug.Assert(op != null); 1676Debug.Assert(CheckAccess()); 1800Debug.Assert(CheckAccess()); 1801Debug.Assert( 2042Debug.Assert(CheckAccess()); 2044Debug.Assert(!_isDisposed); 2045Debug.Assert(_registeredICompositionTargets != null);
System\Windows\Media\MediaContextNotificationWindow.cs (1)
150Debug.Assert(_ownerMediaContext != null);
System\Windows\Media\MediaPlayer.cs (1)
582Debug.Assert(_duceResource._duceResource.IsOnChannel(channel));
System\Windows\Media\MediaPlayerState.cs (2)
887Debug.Assert(absoluteUri.IsAbsoluteUri); 987Debug.Assert(_nativeMedia != null && !_nativeMedia.IsInvalid);
System\Windows\Media\MediaSystem.cs (1)
136Debug.Assert(s_refCount > 0);
System\Windows\Media\MILUtilities.cs (10)
90Debug.Assert(pD3DMatrix[2] == 0.0f || Single.IsNaN(pD3DMatrix[2])); 91Debug.Assert(pD3DMatrix[3] == 0.0f || Single.IsNaN(pD3DMatrix[3])); 99Debug.Assert(pD3DMatrix[6] == 0.0f || Single.IsNaN(pD3DMatrix[6])); 100Debug.Assert(pD3DMatrix[7] == 0.0f || Single.IsNaN(pD3DMatrix[7])); 106Debug.Assert(pD3DMatrix[8] == 0.0f || Single.IsNaN(pD3DMatrix[8])); 107Debug.Assert(pD3DMatrix[9] == 0.0f || Single.IsNaN(pD3DMatrix[9])); 108Debug.Assert(pD3DMatrix[10] == 1.0f || Single.IsNaN(pD3DMatrix[10])); 109Debug.Assert(pD3DMatrix[11] == 0.0f || Single.IsNaN(pD3DMatrix[11])); 117Debug.Assert(pD3DMatrix[14] == 0.0f || Single.IsNaN(pD3DMatrix[14])); 118Debug.Assert(pD3DMatrix[15] == 1.0f || Single.IsNaN(pD3DMatrix[15]));
System\Windows\Media\PathGeometry.cs (30)
138Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_PATHGEOMETRY)); 159Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_PATHFIGURE)); 179Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT)); 180Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_SEGMENT)); 189Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_LINE)); 190Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_SEGMENT_LINE)); 204Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_BEZIER)); 205Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_SEGMENT_BEZIER)); 221Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_QUADRATICBEZIER)); 222Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_SEGMENT_QUADRATICBEZIER)); 237Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_ARC)); 238Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_SEGMENT_ARC)); 258Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_POLY)); 259Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_SEGMENT_POLY)); 263Debug.Assert(pSegmentPoly->Count <= Int32.MaxValue); 270Debug.Assert(pathData.SerializedData.Length >= 274Debug.Assert(pathData.Size >= 368Debug.Assert(result != null); 387Debug.Assert(figureCollection != null); 503Debug.Assert(sameSegCount == 1); 534Debug.Assert(sameSegCount == 1); 593Debug.Assert(pbPathData != (byte*)0); 637Debug.Assert(pPathData1 != (byte*)0); 641Debug.Assert(pPathData2 != (byte*)0); 777Debug.Assert(!pathData.IsEmpty()); 796Debug.Assert(pbPathData != (byte*)0); 852Debug.Assert(pbPathData1 != (byte*)0); 856Debug.Assert(pbPathData2 != (byte*)0); 885Debug.Assert(detail != IntersectionDetail.NotCalculated); 1005Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel));
System\Windows\Media\PathStreamGeometryContext.cs (17)
84Debug.Assert(figureCount > 0); 95Debug.Assert(segmentCount > 0); 106Debug.Assert(_currentFigure != null); 121Debug.Assert(_currentFigure == null || _figures != null); 248Debug.Assert(_figures != null); 249Debug.Assert(_currentFigure != null); 305Debug.Assert(false); 317Debug.Assert(_currentSegmentPoints == null); 327Debug.Assert(points != null); 344Debug.Assert(_figures != null); 345Debug.Assert(_currentFigure != null); 347Debug.Assert(count != 0); 373Debug.Assert(_currentFigure != null); 377Debug.Assert(count > 0); 418Debug.Assert(count % 3 == 0); 435Debug.Assert(count % 2 == 0); 444Debug.Assert(false);
System\Windows\Media\Pen.cs (7)
92Debug.Assert((MIL_PEN_CAP)PenLineCap.Flat == MIL_PEN_CAP.MilPenCapFlat); 93Debug.Assert((MIL_PEN_CAP)PenLineCap.Square == MIL_PEN_CAP.MilPenCapSquare); 94Debug.Assert((MIL_PEN_CAP)PenLineCap.Round == MIL_PEN_CAP.MilPenCapRound); 95Debug.Assert((MIL_PEN_CAP)PenLineCap.Triangle == MIL_PEN_CAP.MilPenCapTriangle); 102Debug.Assert((MIL_PEN_JOIN)PenLineJoin.Miter == MIL_PEN_JOIN.MilPenJoinMiter); 103Debug.Assert((MIL_PEN_JOIN)PenLineJoin.Bevel == MIL_PEN_JOIN.MilPenJoinBevel); 104Debug.Assert((MIL_PEN_JOIN)PenLineJoin.Round == MIL_PEN_JOIN.MilPenJoinRound);
System\Windows\Media\PixelFormat.cs (7)
68Debug.Assert(mask != null); 172Debug.Assert(Marshal.SizeOf(typeof(Guid)) == 16); 514Debug.Assert(pixelFormatInfo != IntPtr.Zero); 527Debug.Assert(channelCount >= 1); 538Debug.Assert(cbBytes > 0); 547Debug.Assert(cbBytes == channelMask.Length); 615Debug.Assert(pixelFormatInfo != IntPtr.Zero);
System\Windows\Media\RadialGradientBrush.cs (1)
76Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel));
System\Windows\Media\RenderCapability.cs (3)
39Debug.Assert(mediaContext != null); 166Debug.Assert(mediaContext != null); 177Debug.Assert(mediaContext != null);
System\Windows\Media\RenderContext.cs (1)
91Debug.Assert(channel != null);
System\Windows\Media\RenderData.cs (16)
87Debug.Assert(cbRecordSize >= 0); 90Debug.Assert((_curOffset % 8) == 0); 91Debug.Assert((cbRecordSize % 8) == 0); 92Debug.Assert((sizeof(RecordHeader) % 8) == 0); 110Debug.Assert((_buffer != null) && (_buffer.Length >= newOffset)); 113Debug.Assert(_buffer.Length > 0); 138Debug.Assert(ctx != null); 240Debug.Assert(!this.IsFrozen); 280Debug.Assert(_dependentResources[i] as Freezable == null); 372Debug.Assert(_duceResource.IsOnChannel(channel)); 402Debug.Assert(_duceResource.IsOnChannel(channel)); 454Debug.Assert(_duceResource.IsOnChannel(channel)); 469Debug.Assert(cbRequiredSize >= 0); 479Debug.Assert(_buffer.Length < cbRequiredSize); 489Debug.Assert(newSize >= cbRequiredSize); 515Debug.Assert(index <= (uint)Int32.MaxValue);
System\Windows\Media\StreamGeometry.cs (5)
113Debug.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 137Debug.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 157Debug.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 393Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 463Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\textformatting\TextCharacters.cs (3)
201Debug.Assert(characterBufferReference.CharacterBuffer == _characterBufferReference.CharacterBuffer); 202Debug.Assert(offsetToFirstChar >= 0 && offsetToFirstChar < _length); 292Debug.Assert(shapeables != null);
System\Windows\Media\Typeface.cs (1)
522Debug.Assert(i > 0);
System\Windows\Media\VideoDrawing.cs (1)
43Debug.Assert(!ctx.ShouldStopWalking);
System\Windows\Media\Visual.cs (23)
580Debug.Assert(BitmapEffectStateField.GetValue(this) != null); 658Debug.Assert(IsOnChannel(channel)); 659Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentNodeConnected)); 860Debug.Assert(channelsToCyclicBrushMap[channel] > 0); 886Debug.Assert(cyclicBrushToChannelsMap[cyclicBrush] > 0); 911Debug.Assert(cyclicBrushToChannelsMap != null); 912Debug.Assert(cyclicBrushToChannelsMap.ContainsKey(cyclicBrush)); 913Debug.Assert(cyclicBrushToChannelsMap[cyclicBrush] > 0); 934Debug.Assert(channelsToCyclicBrushMap != null); 935Debug.Assert(channelsToCyclicBrushMap.ContainsKey(channel)); 936Debug.Assert(channelsToCyclicBrushMap[channel] > 0); 1312Debug.Assert(CheckFlagsAnd(VisualFlags.ReentrancyFlag)); // Exit must be matched with Enter. See Enter comments. 2091Debug.Assert(BitmapEffectStateField.GetValue(this) != null); 2222Debug.Assert(bitmapEffectState != null); 2261Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated); 2319Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated); 2383Debug.Assert(resultCallback != null); 2444Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated); 3220Debug.Assert(currentBitmapEffect.IsFrozen == emulatingEffect.IsFrozen); 3289Debug.Assert(bitmapEffectState != null); 4490Debug.Assert(ancestor != null); 4607Debug.Assert((group == null) || (group.Children.Count > 0)); 4685Debug.Assert(ancestor != null);
System\Windows\Media\VisualBrush.cs (10)
194Debug.Assert(!_pendingLayout); 237Debug.Assert(element != null); 259Debug.Assert(_pendingLayout); 263Debug.Assert(element != null); 274Debug.Assert(_DispatcherLayoutResult != null); 275Debug.Assert(_DispatcherLayoutResult.Status == DispatcherOperationStatus.Pending); 277Debug.Assert(abortStatus); 289Debug.Assert(_pendingLayout); 292Debug.Assert(element != null); 330Debug.Assert(_reentrancyFlag); // Exit must be matched with Enter. See Enter comments.
System\Windows\Media\VisualCollection.cs (16)
90Debug.Assert(_owner != null); 96Debug.Assert(_owner != null); 102Debug.Assert(_owner != null); 109Debug.Assert(_owner != null); 273Debug.Assert(_items != null); 403Debug.Assert(value != null); 404Debug.Assert(_items[index] == null); 405Debug.Assert(value._parent == null); 406Debug.Assert(!value.IsRootElement); 421Debug.Assert(_items[index] != null); 477Debug.Assert(_items[addedPosition] == null); 556Debug.Assert(visual._parent != null); 671Debug.Assert(_items[i]._parent == _owner); 839Debug.Assert(visual._parent != null); 840Debug.Assert(destination == null || destination._parent == visual._parent); 997Debug.Assert(_index == -2);
System\Windows\Media\VisualProxy.cs (7)
160Debug.Assert(count == 0); 182Debug.Assert(count == 1); 298Debug.Assert(index != PROXY_NOT_FOUND); 353Debug.Assert(index >= 0 && index < Count); 396Debug.Assert(index >= 0 && index < Count); 475Debug.Assert(index >= 0 && index < Count); 576Debug.Assert(delta % 2 == 0 && newLength >= 2);
System\Windows\Media\VisualTarget.cs (5)
51Debug.Assert(!_connected); 76Debug.Assert(channel != null); 77Debug.Assert(outOfBandChannel != null); 99Debug.Assert(!resourceCreated); 189Debug.Assert(_connected);
System\Windows\Media\VisualTreeHelper.cs (1)
172Debug.Assert(reference == null);
System\Windows\Media3D\Generated\AmbientLight.cs (2)
121Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 183Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\AxisAngleRotation3D.cs (2)
166Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 214Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\Camera.cs (2)
114Debug.Assert(!channel.IsOutOfBandChannel); 115Debug.Assert(!targetResource.GetHandle(channel).IsNull);
System\Windows\Media3D\Generated\DiffuseMaterial.cs (4)
128Debug.Assert(!channel.IsOutOfBandChannel); 129Debug.Assert(!targetResource.GetHandle(channel).IsNull); 221Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 267Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\DirectionalLight.cs (2)
140Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 208Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\EmissiveMaterial.cs (4)
121Debug.Assert(!channel.IsOutOfBandChannel); 122Debug.Assert(!targetResource.GetHandle(channel).IsNull); 199Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 244Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\GeometryModel3D.cs (8)
114Debug.Assert(!channel.IsOutOfBandChannel); 115Debug.Assert(!targetResource.GetHandle(channel).IsNull); 163Debug.Assert(!channel.IsOutOfBandChannel); 164Debug.Assert(!targetResource.GetHandle(channel).IsNull); 212Debug.Assert(!channel.IsOutOfBandChannel); 213Debug.Assert(!targetResource.GetHandle(channel).IsNull); 305Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 374Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\MaterialGroup.cs (10)
134Debug.Assert(!channel.IsOutOfBandChannel); 135Debug.Assert(!targetResource.GetHandle(channel).IsNull); 147Debug.Assert(resource != null); 158Debug.Assert(resource != null); 220Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 285Debug.Assert(_duceResource.IsOnChannel(channel)); 330Debug.Assert(!channel.IsOutOfBandChannel); 331Debug.Assert(!thisResource.GetHandle(channel).IsNull); 358Debug.Assert(!channel.IsOutOfBandChannel); 359Debug.Assert(!thisResource.GetHandle(channel).IsNull);
System\Windows\Media3D\Generated\MatrixCamera.cs (2)
162Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 218Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\MatrixTransform3D.cs (2)
140Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 175Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\MeshGeometry3D.cs (2)
206Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 303Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\Model3D.cs (2)
114Debug.Assert(!channel.IsOutOfBandChannel); 115Debug.Assert(!targetResource.GetHandle(channel).IsNull);
System\Windows\Media3D\Generated\Model3DGroup.cs (10)
134Debug.Assert(!channel.IsOutOfBandChannel); 135Debug.Assert(!targetResource.GetHandle(channel).IsNull); 147Debug.Assert(resource != null); 158Debug.Assert(resource != null); 220Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 303Debug.Assert(_duceResource.IsOnChannel(channel)); 351Debug.Assert(!channel.IsOutOfBandChannel); 352Debug.Assert(!thisResource.GetHandle(channel).IsNull); 379Debug.Assert(!channel.IsOutOfBandChannel); 380Debug.Assert(!thisResource.GetHandle(channel).IsNull);
System\Windows\Media3D\Generated\OrthographicCamera.cs (2)
140Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 232Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\PerspectiveCamera.cs (2)
140Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 232Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\PointLight.cs (2)
121Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 213Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\QuaternionRotation3D.cs (2)
143Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 185Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\RotateTransform3D.cs (4)
143Debug.Assert(!channel.IsOutOfBandChannel); 144Debug.Assert(!targetResource.GetHandle(channel).IsNull); 255Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 319Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\ScaleTransform3D.cs (2)
268Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 340Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\SpecularMaterial.cs (4)
121Debug.Assert(!channel.IsOutOfBandChannel); 122Debug.Assert(!targetResource.GetHandle(channel).IsNull); 221Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 267Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\SpotLight.cs (2)
184Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 294Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\Transform3DGroup.cs (10)
134Debug.Assert(!channel.IsOutOfBandChannel); 135Debug.Assert(!targetResource.GetHandle(channel).IsNull); 147Debug.Assert(resource != null); 158Debug.Assert(resource != null); 220Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 285Debug.Assert(_duceResource.IsOnChannel(channel)); 330Debug.Assert(!channel.IsOutOfBandChannel); 331Debug.Assert(!thisResource.GetHandle(channel).IsNull); 358Debug.Assert(!channel.IsOutOfBandChannel); 359Debug.Assert(!thisResource.GetHandle(channel).IsNull);
System\Windows\Media3D\Generated\TranslateTransform3D.cs (2)
193Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 247Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Matrix3D.cs (7)
1045Debug.Assert(IsDistinguishedIdentity); 1057Debug.Assert(IsDistinguishedIdentity); 1073Debug.Assert(IsDistinguishedIdentity); 1199Debug.Assert(!IsDistinguishedIdentity); 1200Debug.Assert(IsAffine); 1216Debug.Assert(!IsDistinguishedIdentity); 1217Debug.Assert(IsAffine);
System\Windows\Media3D\Rect3D.cs (1)
62Debug.Assert(size.IsEmpty == IsEmpty);
System\Windows\Media3D\Viewport2DVisual3D.cs (3)
595Debug.Assert(Geometry == null || Geometry is MeshGeometry3D); 623Debug.Assert(Geometry == null || Geometry is MeshGeometry3D); 651Debug.Assert(Geometry == null || Geometry is MeshGeometry3D);
System\Windows\Media3D\Viewport3DVisual.cs (6)
342Debug.Assert(child != null); 343Debug.Assert(child.InternalVisualParent == null); 393Debug.Assert(child != null); 394Debug.Assert(child.InternalVisualParent == this); 730Debug.Assert(IsOnChannel(channel)); 819Debug.Assert(IsOnChannel(channel));
System\Windows\Media3D\Visual3D.cs (13)
246Debug.Assert(child != null); 247Debug.Assert(child.InternalVisualParent == null); 294Debug.Assert(child != null); 295Debug.Assert(child.InternalVisualParent == this); 960Debug.Assert(InternalVisualParent == newParent); 968Debug.Assert(InternalVisualParent == newParent); 1090Debug.Assert(model != null); 1270Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentConnected)); 1271Debug.Assert(IsOnChannel(channel)); 1462Debug.Assert(IsOnChannel(channel)); 1463Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentNodeConnected)); 1660Debug.Assert(ancestor != null); 1808Debug.Assert(ancestor != null);
System\Windows\Navigation\BaseUriHelper.cs (2)
181Debug.Assert(uri != null && uri.IsAbsoluteUri && SecurityHelper.AreStringTypesEqual(uri.Scheme, System.IO.Packaging.PackUriHelper.UriSchemePack) && IsPackApplicationUri(uri)); 198Debug.Assert(string.Equals(partName, uri.GetComponents(UriComponents.Path, UriFormat.UriEscaped), StringComparison.OrdinalIgnoreCase));
System\Windows\PresentationSource.cs (1)
548Debug.Assert(uie is UIElement3D or UIElement);
System\Windows\ReverseInheritProperty.cs (1)
207Debug.Assert(originChangedAction != null);
System\Windows\UIElement.cs (5)
3121Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated); 3210Debug.Assert(_proxy.IsOnChannel(channel)); 3280Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentConnected)); 3281Debug.Assert(_proxy.IsOnChannel(channel)); 4158Debug.Assert(value == Visibility.Visible || value == Visibility.Hidden || value == Visibility.Collapsed);
System\Windows\UIElement3D.cs (1)
1348Debug.Assert(value == Visibility.Visible || value == Visibility.Hidden || value == Visibility.Collapsed);
PresentationFramework (1112)
MS\Internal\Annotations\Anchoring\FixedTextSelectionProcessor.cs (1)
301Debug.Assert(tv != null);
MS\Internal\Annotations\Anchoring\TextSelectionProcessor.cs (2)
395Debug.Assert(target != null); 465Debug.Assert(startNode != null);
MS\Internal\Annotations\Anchoring\TextViewSelectionProcessor.cs (1)
235Debug.Assert(textView != null);
MS\Internal\AppModel\Journaling.cs (11)
130Debug.Assert(value.JEGroupState == this); 131Debug.Assert(_groupExitEntry == null || _groupExitEntry.ContentId == value.ContentId); 226Debug.Assert(this.KeepAliveRoot == contentObject); // set by ctor; shouldn't change 233Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward); 234Debug.Assert(this.KeepAliveRoot != null); 417Debug.Assert(pageFunction != null && pageFunction.KeepAlive); 462Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward); 467Debug.Assert(pf != null); 499Debug.Assert(!pageFunction.KeepAlive); 565Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward); 578Debug.Assert(pageFunction != null);
MS\Internal\AppModel\JournalNavigationScope.cs (2)
277Debug.Assert(journal != null); 456Debug.Assert(sender == _journal);
MS\Internal\Commands\CommandHelpers.cs (3)
101Debug.Assert(controlType != null); 102Debug.Assert(command != null); 103Debug.Assert(executedRoutedEventHandler != null);
MS\Internal\Controls\CustomCategoryAttribute.cs (1)
23Debug.Assert("Content".Equals(name, StringComparison.Ordinal)
MS\Internal\Controls\InkCanvasFeedbackAdorner.cs (1)
150Debug.Assert(_frameSize != new Size(0, 0));
MS\Internal\Controls\InkCanvasInnerCanvas.cs (1)
35Debug.Assert(inkCanvas != null);
MS\Internal\Controls\StickyNote\StickyNoteAnnotations.cs (10)
89Debug.Assert(annotation != null); 131Debug.Assert((token & AllValues) != 0); 619Debug.Assert(false); 634Debug.Assert(cargo != null); 658Debug.Assert(false); 706Debug.Assert(false); 815Debug.Assert(snc.IsExpanded); 823Debug.Assert(snc.IsExpanded); 1261Debug.Assert(_attachedAnnotation != null && _attachedAnnotation.Annotation == args.Annotation); 1275Debug.Assert(_attachedAnnotation != null && _attachedAnnotation.Annotation == args.Annotation);
MS\Internal\Controls\StickyNote\StickyNoteContentControl.cs (3)
206Debug.Assert(node != null && !IsEmpty); 233Debug.Assert(node != null); 378Debug.Assert(node != null && !IsEmpty);
MS\Internal\Controls\StickyNote\StickyNoteHelper.cs (2)
91Debug.Assert(!helper.IsLocked(flag)); 101Debug.Assert(_helper.IsLocked(_flag));
MS\Internal\Data\CollectionViewGroupInternal.cs (2)
525Debug.Assert(subgroup != null); 547Debug.Assert(subgroup != null);
MS\Internal\Data\CompositeCollectionView.cs (1)
461Debug.Assert(args.Action == NotifyCollectionChangedAction.Remove);
MS\Internal\Data\DefaultValueConverter.cs (1)
477Debug.Assert(sourceType != targetType);
MS\Internal\Data\DisplayMemberTemplateSelector.cs (1)
28Debug.Assert(!(String.IsNullOrEmpty(displayMemberPath) && String.IsNullOrEmpty(stringFormat)));
MS\Internal\Data\XmlBindingWorker.cs (2)
40Debug.Assert(_xpath != null); 446Debug.Assert(ContextNode != null);
MS\Internal\DataStreams.cs (1)
276Debug.Assert(state != null);
MS\Internal\Documents\ColumnResult.cs (1)
177Debug.Assert(_paragraphs != null && _paragraphs.Count > 0);
MS\Internal\Documents\ContentElementCollection.cs (5)
41Debug.Assert(owner != null); 176Debug.Assert(Items[item.Index] == item); 312Debug.Assert(collection != null); 704Debug.Assert(BelongsToOwner(item) && Items[item.Index] == item); 714Debug.Assert(BelongsToOwner(Items[i + 1]));
MS\Internal\Documents\HostedElements.cs (5)
80Debug.Assert(_currentTextSegment == 0); 97Debug.Assert(((ITextPointer)_currentPosition).CompareTo(_textSegments[_currentTextSegment].Start) >= 0 && 108Debug.Assert(((ITextPointer)_currentPosition).CompareTo(_textSegments[_currentTextSegment].Start) >= 0); 187Debug.Assert(_currentPosition.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward) is IInputElement); 191Debug.Assert(_currentPosition.GetAdjacentElement(LogicalDirection.Forward) is IInputElement);
MS\Internal\Documents\TableColumnCollectionInternal.cs (8)
49Debug.Assert(Items[index] == null); 68Debug.Assert(BelongsToOwner(Items[i])); 115Debug.Assert(BelongsToOwner(Items[i])); 140Debug.Assert(item != null && item.Index == -1); 141Debug.Assert(Items[index] == null); 177Debug.Assert(item != null); 292Debug.Assert(BelongsToOwner(Items[i])); 300Debug.Assert(BelongsToOwner(Items[i + count]));
MS\Internal\Documents\TableTextElementCollectionInternal.cs (8)
72Debug.Assert(BelongsToOwner(Items[i])); 241Debug.Assert(BelongsToOwner(Items[i])); 261Debug.Assert(item != null && item.Index == -1); 262Debug.Assert(Items[index] == null); 290Debug.Assert(BelongsToOwner(item) && Items[item.Index] == item); 304Debug.Assert(BelongsToOwner(Items[i + 1])); 373Debug.Assert(BelongsToOwner(Items[i])); 390Debug.Assert(BelongsToOwner(item) && Items[item.Index] == item);
MS\Internal\Documents\TextParagraphView.cs (10)
155Debug.Assert(lines != null && lines.Count > 0); 161Debug.Assert(false); 273Debug.Assert(lines != null && lines.Count > 0); 277Debug.Assert(lineIndex >= 0 && lineIndex < lines.Count); 333Debug.Assert(lineIndex < lines.Count); 419Debug.Assert(dcp >= lines[lineIndex].StartPositionCP); 420Debug.Assert(dcp < lines[lineIndex].EndPositionCP || 532Debug.Assert(lines != null && lines.Count > 0); 569Debug.Assert(lines != null && lines.Count > 0); 696Debug.Assert(lines != null && lines.Count > 0);
MS\Internal\Documents\UndoManager.cs (3)
120Debug.Assert(((UndoManager)undoManager)._scope == null); 155Debug.Assert(((UndoManager)undoManager)._scope == scope); 285Debug.Assert(false);
MS\Internal\Globalization\BamlResourceContent.cs (1)
116Debug.Assert(match.Value.Length > 0 && match.Value[0] == BamlConst.EscapeChar);
MS\Internal\Globalization\BamlResourceSerializer.cs (1)
82Debug.Assert(elementNode != null);
MS\Internal\Globalization\BamlTreeMap.cs (1)
576Debug.Assert(node.NodeType == BamlNodeType.StartElement);
MS\Internal\Globalization\BamlTreeNode.cs (2)
567Debug.Assert(value.Category != LocalizationCategory.Ignore && value.Category != LocalizationCategory.Inherit); 701Debug.Assert(value.Category != LocalizationCategory.Ignore && value.Category != LocalizationCategory.Inherit);
MS\Internal\Globalization\LocalizableResourceBuilder.cs (1)
448Debug.Assert(inheritableAttribute != null);
MS\Internal\Globalization\LocalizationComments.cs (1)
355Debug.Assert(enumPrefix != null && enumNames != null);
MS\Internal\Helper.cs (2)
409Debug.Assert( fe != null ); 847Debug.Assert(item != null);
MS\Internal\Ink\ClipboardProcessor.cs (5)
85Debug.Assert(dataObject != null && _preferredClipboardData!= null); 131Debug.Assert(inkCanvasSelection.SelectedStrokes.Count == orderedStrokes.Count); 189Debug.Assert(dataObject != null && _preferredClipboardData!= null); 259Debug.Assert(_preferredClipboardData != null); 268Debug.Assert(value != null);
MS\Internal\Ink\EditingCoordinator.cs (3)
259Debug.Assert(behavior != null); 363Debug.Assert(behavior == ActiveEditingBehavior); 611Debug.Assert(newEditingBehavior != null);
MS\Internal\Ink\EraserBehavior.cs (3)
109Debug.Assert(_cachedEraseMode != mode); 163Debug.Assert(newEraseMode == InkCanvasEditingMode.EraseByPoint 355Debug.Assert(null != e.HitStroke);
MS\Internal\Ink\InkCanvasSelection.cs (2)
142Debug.Assert( _inkCanvas.EditingCoordinator.UserIsEditing == true ); 208Debug.Assert(strokes != null && elements != null);
MS\Internal\Ink\LassoHelper.cs (2)
172System.Diagnostics.Debug.Assert(null != points); 173System.Diagnostics.Debug.Assert((0 <= percentIntersect) && (100 >= percentIntersect));
MS\Internal\Ink\LassoSelectionBehavior.cs (6)
281Debug.Assert(tappedElement == null); 287Debug.Assert(tappedStroke == null); 376System.Diagnostics.Debug.Assert(null != _lassoHelper); 393Debug.Assert(canvas != null); 394Debug.Assert(childElement != null); 396Debug.Assert(canvas.CheckAccess());
MS\Internal\Ink\SelectionEditingBehavior.cs (2)
78Debug.Assert(_hitResult != InkCanvasSelectionHitResult.None); 335Debug.Assert(false);
MS\Internal\IO\Packaging\ByteStream.cs (3)
42Debug.Assert(stream != null); 48Debug.Assert(_access == FileAccess.Read); 117Debug.Assert(_length > 0);
MS\Internal\IO\Packaging\PackageFilter.cs (7)
460Debug.Assert(false); 469Debug.Assert(false); 559Debug.Assert(contentType != null && contentType.ToString().Length > 0); 585Debug.Assert(dottedExtensionName != null); 613Debug.Assert(pathWithGaps != null && stopGaps != null); 622Debug.Assert(stopGaps.Length > nextStopGapToUse); 630Debug.Assert(stopGaps.Length == nextStopGapToUse);
MS\Internal\IO\Packaging\XamlFilter.cs (8)
279Debug.Assert(bufferCharacterCount >= 0); 345Debug.Assert(_fixedPageContentExtractor != null); 380Debug.Assert(_contextStack.Count == 0); 386Debug.Assert(_topLevelReader != null); 393Debug.Assert(false); 496Debug.Assert(topOfStack.HasIndexableContent); 758Debug.Assert(_xamlReader != null); 780Debug.Assert(string.Equals(_xamlReader.LocalName, _fixedPageName, StringComparison.Ordinal));
MS\Internal\IO\Packaging\XmlFixedPageInfo.cs (1)
38Debug.Assert(_pageNode != null);
MS\Internal\IO\Packaging\XmlGlyphRunInfo.cs (1)
41Debug.Assert(_glyphsNode != null
MS\Internal\PtsHost\BaseParaClient.cs (2)
73Debug.Assert(_paraHandle.Value == IntPtr.Zero || _paraHandle.Value == pfspara); 109Debug.Assert(oldParaClient._visual != null);
MS\Internal\PtsHost\BaseParagraph.cs (1)
181Debug.Assert(ParagraphEndCharacterPosition >= startPosition);
MS\Internal\PtsHost\CellParaClient.cs (4)
84Debug.Assert(calculatedColumns != null 361Debug.Assert(tableParaClient != null); 364Debug.Assert( calculatedColumns != null 378Debug.Assert(0 <= durCellWidth);
MS\Internal\PtsHost\CellParagraph.cs (3)
75Debug.Assert(Cell.Table != null); 144Debug.Assert(Cell.Table != null); 173Debug.Assert(Cell.Table != null);
MS\Internal\PtsHost\ColumnPropertiesGroup.cs (1)
42internal double ColumnWidth { get { Debug.Assert(!double.IsNaN(_columnWidth)); return _columnWidth; } }
MS\Internal\PtsHost\ContainerParagraph.cs (12)
235Debug.Assert(_ur.ChangeType == PTS.FSKCHANGE.fskchInside); // Inconsistent UpdateRecord data 302Debug.Assert(_ur == null); // UpdateRecord has been already created. 365Debug.Assert(StructuralCache.CurrentFormatContext.FinitePage || _ur != null); // For bottomless case UpdateRecord needs to be created in UpdGetFirstChangeInSegment. 370Debug.Assert(_ur == null); 488Debug.Assert(iArea == 0); 654Debug.Assert(iArea == 0); 739Debug.Assert(pmcsclientOut == IntPtr.Zero); 784Debug.Assert(iArea == 0); 869Debug.Assert(pmcsclientOut == IntPtr.Zero); 923Debug.Assert(ParagraphEndCharacterPosition >= startPosition); 1064Debug.Assert(textPointer is TextPointer); 1190Debug.Assert(ur.Next.FirstPara == null || ur.Next.FirstPara.Next == null);
MS\Internal\PtsHost\DtrList.cs (1)
315Debug.Assert(_dtrs.Length > 0);
MS\Internal\PtsHost\FigureParaClient.cs (4)
407Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is ContainerVisual); 428Debug.Assert(fskupd != PTS.FSKUPDATE.fskupdNoChange); 442Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is SectionVisual); 612Debug.Assert(arrayColumnDesc.Length == 1);
MS\Internal\PtsHost\FigureParagraph.cs (1)
441Debug.Assert(ParagraphEndCharacterPosition >= startPosition);
MS\Internal\PtsHost\FloaterParaClient.cs (4)
413Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is ContainerVisual); 434Debug.Assert(fskupd != PTS.FSKUPDATE.fskupdNoChange); 448Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is SectionVisual); 620Debug.Assert(arrayColumnDesc.Length == 1);
MS\Internal\PtsHost\FloaterParagraph.cs (4)
256Debug.Assert(pmcsclientOut == IntPtr.Zero); 504Debug.Assert(pmcsclientOut == IntPtr.Zero); 523Debug.Assert(pmcsclientOut == IntPtr.Zero); 609Debug.Assert(ParagraphEndCharacterPosition >= startPosition);
MS\Internal\PtsHost\FlowDocumentPage.cs (8)
322Debug.Assert(child != null); 465Debug.Assert(pageDetails.u.complex.cSections == 1); // Only one section is supported right now. 481Debug.Assert(sectionDetails.u.withpagenotes.cEndnoteColumns == 0); // Footnotes are not supported yet. 483Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 484Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0); 521Debug.Assert(false); // Complex columns are not supported yet. 932Debug.Assert(e != null); 935Debug.Assert(_structuralCache.TextContainer is TextContainer);
MS\Internal\PtsHost\Line.cs (2)
678Debug.Assert(dcp >= 0 && (dcp + cch <= _line.Length)); 698Debug.Assert(cchGlyphRuns > 0 && glyphRunsCollection.Count > 0);
MS\Internal\PtsHost\ListMarkerSourceInfo.cs (1)
344Debug.Assert(number >= 0 && number <= 9);
MS\Internal\PtsHost\PageVisual.cs (2)
72Debug.Assert(vc.Count <= 1); 78Debug.Assert(vc.Count <= 1);
MS\Internal\PtsHost\Pts.cs (1)
164Debug.Assert(false);
MS\Internal\PtsHost\PtsHelper.cs (2)
593Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 594Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0);
MS\Internal\PtsHost\PtsHost.cs (5)
398Debug.Assert(cnms == 1); // Only one section is supported right now. 2571Debug.Assert(false); 2966Debug.Assert(false); 3186Debug.Assert(false); 3265Debug.Assert(false);
MS\Internal\PtsHost\PtsPage.cs (12)
163Debug.Assert(!canUpdate || _section.CanUpdate); 926Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 927Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0); 974Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 975Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0); 1054Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is ContainerVisual); 1137Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 1138Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0); 1340Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 1341Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0); 1401Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 1402Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0);
MS\Internal\PtsHost\RowParagraph.cs (3)
196Debug.Assert(cCells == Row.FormatCellCount); 260Debug.Assert (_spannedCells[j] != null); 279Debug.Assert(Row.Index - cell.RowIndex + 1 == cell.RowSpan);
MS\Internal\PtsHost\SubpageParaClient.cs (3)
340Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is ContainerVisual); 361Debug.Assert(fskupd != PTS.FSKUPDATE.fskupdNoChange); 375Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is SectionVisual);
MS\Internal\PtsHost\SubpageParagraph.cs (3)
457Debug.Assert(pmcsclientOut == IntPtr.Zero); 616Debug.Assert(pmcsclientOut == IntPtr.Zero); 664Debug.Assert(ParagraphEndCharacterPosition >= startPosition);
MS\Internal\PtsHost\TableParaClient.cs (22)
65Debug.Assert( Table != null 324Debug.Assert( TableParagraph.Table != null 367Debug.Assert( TableParagraph.Table != null 438Debug.Assert(TableParagraph.Table != null 607Debug.Assert( TableParagraph.Table != null 826Debug.Assert( TableParagraph.Table != null 897Debug.Assert( TableParagraph.Table != null 951Debug.Assert( TableParagraph.Table != null 1032Debug.Assert( TableParagraph.Table != null 1126Debug.Assert( TableParagraph.Table != null 1154Debug.Assert(false); 1176Debug.Assert(Table != null); 1202Debug.Assert(Table != null); 1384Debug.Assert(TableParagraph == (TableParagraph)(PtsContext.HandleToObject(tableObjDetails.fsnmTable))); 1414Debug.Assert(tableDetails.cRows == cRowsActual); 1463Debug.Assert(tableRowDetails.cCells == cCellsActual); 1592Debug.Assert( cellParaClient.Visual != null 1721Debug.Assert( cellParaClient.Visual != null 2050Debug.Assert(0 <= _calculatedColumns[i].DurMinWidth && 0 <= _calculatedColumns[i].DurMaxWidth); 2105Debug.Assert(0 < iP || DoubleUtil.IsZero(iP)); 2375Debug.Assert(_calculatedColumns[i].UserWidth.IsAbsolute); 2399Debug.Assert(_calculatedColumns[i].DurMinWidth <= _calculatedColumns[i].DurMaxWidth);
MS\Internal\PtsHost\TableParagraph.cs (1)
316Debug.Assert(Table.RowGroups.Count > 0);
MS\Internal\PtsHost\TextParaClient.cs (32)
137Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 164Debug.Assert(!((TextParagraph) Paragraph).HasFiguresFloatersOrInlineObjects()); 235Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 257Debug.Assert(Paragraph.Element as ContentElement != e); 324Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 377Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 719Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 800Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 832Debug.Assert(position is TextPointer); 863Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 882Debug.Assert(position is TextPointer); 913Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 1070Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 1372Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 1392Debug.Assert(!PTS.ToBoolean(textDetails.fLinesComposite)); 1472Debug.Assert(insertionIndex >= 0 && insertionIndex <= lineVisuals.Count); 2624Debug.Assert(index > 0); 2754Debug.Assert(index == 0); 2755Debug.Assert(elIndex == 0); 2769Debug.Assert(index > 0); 2793Debug.Assert(elIndex == arrayLineElement.Length - 1); 2794Debug.Assert(index == arrayLineDesc.Length - 1); 2914Debug.Assert(index > 0); 2962Debug.Assert(backspaceCaretPosition != null); 3011Debug.Assert(index == 0); 3012Debug.Assert(elIndex == 0); 3026Debug.Assert(index > 0); 3373Debug.Assert(!PTS.ToBoolean(textDetails.fLinesComposite)); 3491Debug.Assert(_lineIndexFirstVisual == lineIndexFirstVisible); 3520Debug.Assert(visualChildren.Count == (lineIndexFirstInvisible - lineIndexFirstVisible)); 3930Debug.Assert(localEnd > localStart); 4130Debug.Assert(localEnd > localStart);
MS\Internal\PtsHost\TextParagraph.cs (1)
156Debug.Assert(iArea == 0);
MS\Internal\PtsHost\TextParaLineResult.cs (4)
56Debug.Assert(false); 72Debug.Assert(false); 85Debug.Assert(false); 101Debug.Assert(false);
MS\Internal\PtsHost\UpdateRecord.cs (1)
42Debug.Assert(Next != null); // This is the last UR, cannot merge with next.
MS\Internal\PtsTable\CalculatedColumn.cs (1)
54Debug.Assert(0 <= durMinWidth && durMinWidth <= durMaxWidth);
MS\Internal\PtsTable\RowSpanVector.cs (10)
79Debug.Assert(cell != null 87Debug.Assert( start < _entries[i].Cell.ColumnIndex 93Debug.Assert(_index < _size); 94Debug.Assert(_index == 0 || _entries[_index - 1].Start < start); 95Debug.Assert(start < _entries[_index].Start); 141Debug.Assert(0 <= _index && _index < _size); 149Debug.Assert(0 <= _index && _index < _size); 182Debug.Assert(_entries[i].Cell != null); 183Debug.Assert(i >= j); 249Debug.Assert( _entries.Length > 0
MS\Internal\Text\ComplexLine.cs (1)
85Debug.Assert(dcp >= 0);
MS\Internal\Text\DynamicPropertyReader.cs (5)
44Debug.Assert(element != null); 56Debug.Assert(element != null); 74Debug.Assert(element != null); 233Debug.Assert(element != null); 258Debug.Assert(!position.IsNull);
MS\Internal\Text\LineMetrics.cs (2)
116get { Debug.Assert((_packedData & HasBeenUpdatedMask) != 0); return _width; } 131get { Debug.Assert((_packedData & HasBeenUpdatedMask) != 0); return _start; }
MS\Internal\Text\SimpleLine.cs (1)
130Debug.Assert(content != null);
MS\Internal\Text\TextLineResult.cs (4)
56Debug.Assert(false); 68Debug.Assert(false); 79Debug.Assert(false); 91Debug.Assert(false);
MS\Internal\Text\TextProperties.cs (1)
257Debug.Assert(element != null);
MS\Internal\Text\TypographyProperties.cs (1)
106Debug.Assert((uint)PropertyId.PropertyCount <= 32);
MS\Internal\WindowsRuntime\Generated\WinRT.cs (1)
174System.Diagnostics.Debug.Assert(_CanUnloadNow == null || _CanUnloadNow() == 0); // S_OK
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Context\XamlContextStack.cs (5)
30Debug.Assert(CurrentFrame != null); 31Debug.Assert(CurrentFrame.Depth == Depth); 89Debug.Assert(iteratorFrame != null); 113Debug.Assert(CurrentFrame.Depth == Depth); 126Debug.Assert(CurrentFrame.Depth == Depth);
System\Windows\Application.cs (1)
1999Debug.Assert(!uri.IsAbsoluteUri || BaseUriHelper.IsPackApplicationUri(uri));
System\Windows\Automation\Peers\DataGridAutomationPeer.cs (1)
204Debug.Assert(false);
System\Windows\Automation\Peers\DateTimeAutomationPeer.cs (1)
696Debug.Assert((int)owningButton.GetValue(Grid.RowProperty) > 0);
System\Windows\BroadcastEventHelper.cs (7)
26Debug.Assert(d is FrameworkElement || d is FrameworkContentElement); 47Debug.Assert(d is FrameworkElement || d is FrameworkContentElement); 51Debug.Assert(loadedPending.Length == 3); 74Debug.Assert(d is FrameworkElement || d is FrameworkContentElement); 95Debug.Assert(d is FrameworkElement || d is FrameworkContentElement); 99Debug.Assert(unloadedPending.Length == 3); 513Debug.Assert( fo.IsFE );
System\Windows\Controls\Calendar.cs (14)
213Debug.Assert(c != null); 269Debug.Assert(c != null); 330Debug.Assert(c != null); 387Debug.Assert(c != null); 418Debug.Assert(false); 545Debug.Assert(c != null); 631Debug.Assert(c != null); 929Debug.Assert(false); 948Debug.Assert(false); 988Debug.Assert(false); 1021Debug.Assert(false); 1093Debug.Assert(false); 1195Debug.Assert(this.DisplayMode == CalendarMode.Year); 1208Debug.Assert(this.DisplayMode == CalendarMode.Decade);
System\Windows\Controls\CalendarBlackoutDatesCollection.cs (2)
115Debug.Assert(dayInterval != 0); 330Debug.Assert(day != null);
System\Windows\Controls\ColumnDefinition.cs (14)
104Debug.Assert(_items != null); 126Debug.Assert(_items != null); 166Debug.Assert( _items[i] != null 184Debug.Assert(_items[item.Index] == item); 199Debug.Assert(_items[value.Index] == value); 335Debug.Assert( _items[i] != null 344Debug.Assert( _items[i + count] != null 600Debug.Assert(value != null && value.Index == -1); 601Debug.Assert(_items[index] == null); 618Debug.Assert(value != null); 651Debug.Assert( _items[i] != null 669Debug.Assert( _items[value.Index] == value 682Debug.Assert( _items[i + 1] != null 708Debug.Assert(value >= _size);
System\Windows\Controls\ComboBox.cs (1)
640Debug.Assert(_editableTextBoxSite == sender);
System\Windows\Controls\ContentPresenter.cs (3)
1014Debug.Assert(tc.CanConvertTo(typeof(UIElement))); 1084Debug.Assert(!(content is String) && !(content is UIElement)); // these are handled by different templates 1123Debug.Assert(!(tc != null && tc.CanConvertTo(typeof(UIElement)))); // this is handled by a different template
System\Windows\Controls\DataGrid.cs (2)
5283Debug.Assert(!IsUpdatingSelectedCells); 5289Debug.Assert(IsUpdatingSelectedCells);
System\Windows\Controls\DataGridCellsPanel.cs (1)
1151Debug.Assert(startIndex >= 0);
System\Windows\Controls\DataGridColumn.cs (1)
595Debug.Assert(Width.IsStar);
System\Windows\Controls\DataGridColumnCollection.cs (2)
548Debug.Assert(assignedDisplayIndexMap.ContainsKey(displayIndex)); 692Debug.Assert(removedDisplayIndex >= 0);
System\Windows\Controls\DataGridColumnHeaderCollection.cs (1)
51Debug.Assert(_columns.Contains(column));
System\Windows\Controls\DataGridRow.cs (1)
230Debug.Assert(stateCode != DATAGRIDROW_stateNullCode);
System\Windows\Controls\DatePicker.cs (11)
210Debug.Assert(dp != null); 256Debug.Assert(dp != null); 321Debug.Assert(dp != null); 339Debug.Assert(dp != null); 366Debug.Assert(dp != null); 438Debug.Assert(dp != null); 534Debug.Assert(dp != null); 586Debug.Assert(dp != null); 954Debug.Assert(c != null); 955Debug.Assert(args != null); 977Debug.Assert(e.AddedItems.Count < 2);
System\Windows\Controls\DateTimeHelper.cs (1)
181Debug.Assert(DateTime.Compare(start, end) < 1);
System\Windows\Controls\DefinitionBase.cs (6)
326Debug.Assert(value >= -1 && _parentIndex != value); 717Debug.Assert(sharedSizeGroup != null); 733Debug.Assert(_registry.Contains(key)); 750Debug.Assert(sharedSizeScope != null && sharedSizeGroupId != null); 763Debug.Assert(!_registry.Contains(member)); 847Debug.Assert( _userSize.GridUnitType == GridUnitType.Auto
System\Windows\Controls\Frame.cs (21)
451Debug.Assert(_ownJournalScope != null); 463Debug.Assert(_ownJournalScope == null); 505Debug.Assert(_journalOwnership == (JournalOwnership)GetValue(JournalOwnershipProperty)); 630Debug.Assert(sender == this && _ownJournalScope != null); 636Debug.Assert(sender == this && _ownJournalScope != null); 643Debug.Assert(sender == this && _ownJournalScope != null); 649Debug.Assert(sender == this && _ownJournalScope != null); 656Debug.Assert(sender == this && _ownJournalScope != null); 675Debug.Assert(sender == this && _ownJournalScope != null); 680Debug.Assert(sender == this && _ownJournalScope != null); 687Debug.Assert(sender == this && _ownJournalScope != null); 750Debug.Assert(d as Frame != null && ((Frame)d).NavigationService != null); 823Debug.Assert(canGoFwd == (bool)GetValue(CanGoForwardProperty)); 838Debug.Assert(canGoBack == (bool)GetValue(CanGoBackProperty)); 997Debug.Assert(backStack == GetValue(BackStackProperty)); 1009Debug.Assert(fwdStack == GetValue(ForwardStackProperty)); 1171Debug.Assert(GetValue(BackStackProperty) == _ownJournalScope.BackStack); 1215Debug.Assert(JournalEntry.GetType().IsSerializable); 1245Debug.Assert(_journalOwnership == JournalOwnership.OwnsJournal); 1341Debug.Assert(_ownJournalScope == null ^ _journalOwnership == JournalOwnership.OwnsJournal); 1374Debug.Assert(_ownJournalScope == null ^ _journalOwnership == JournalOwnership.OwnsJournal);
System\Windows\Controls\Grid.cs (21)
424Debug.Assert(DefinitionsU.Length > 0 && DefinitionsV.Length > 0); 683Debug.Assert(DefinitionsU.Length > 0 && DefinitionsV.Length > 0); 931Debug.Assert(0 <= cell.ColumnIndex && cell.ColumnIndex < DefinitionsU.Length); 932Debug.Assert(0 <= cell.RowIndex && cell.RowIndex < DefinitionsV.Length); 1030Debug.Assert(ExtData.DefinitionsU != null && ExtData.DefinitionsU.Length > 0); 1077Debug.Assert(ExtData.DefinitionsV != null && ExtData.DefinitionsV.Length > 0); 1125Debug.Assert(false); 1390Debug.Assert(0 < count && 0 <= start && (start + count) <= definitions.Length); 1417Debug.Assert(0 < count && 0 <= start && (start + count) <= definitions.Length); 1445Debug.Assert(1 < count && 0 <= start && (start + count) <= definitions.Length); 1478Debug.Assert( minSize <= preferredSize 1509Debug.Assert(tempDefinitions[i].UserSize.IsAuto); 1518Debug.Assert(!tempDefinitions[i].UserSize.IsAuto); 1526Debug.Assert(_IsZero(sizeToDistribute)); 1546Debug.Assert(!tempDefinitions[i].UserSize.IsAuto); 1557Debug.Assert(tempDefinitions[i].UserSize.IsAuto); 1566Debug.Assert(_IsZero(sizeToDistribute)); 1587Debug.Assert( !double.IsInfinity(totalRemainingSize) 2096Debug.Assert(!definitions[i].IsShared || !definitions[i].UserSize.IsStar); 2170Debug.Assert(nonStarIndex == starDefinitionsCount); 3885Debug.Assert(grid != null);
System\Windows\Controls\GridSplitter.cs (2)
423Debug.Assert(_decorator != null); 446Debug.Assert(_decorator != null);
System\Windows\Controls\GridViewHeaderRowPresenter.cs (4)
640Debug.Assert(column != null); 991Debug.Assert(header != null || index != -1); 1074Debug.Assert(header != null); 1083Debug.Assert(header != null);
System\Windows\Controls\GridViewRowPresenter.cs (1)
287Debug.Assert(column != null);
System\Windows\Controls\InkCanvas.cs (4)
2265System.Diagnostics.Debug.Assert(_dynamicallySelectedStrokes.Contains(s)); 2563System.Diagnostics.Debug.Assert(object.ReferenceEquals(sender, DefaultDrawingAttributes)); 2702Debug.Assert(inkCanvas != null); 2775Debug.Assert(inkCanvas != null);
System\Windows\Controls\InkPresenter.cs (3)
483System.Diagnostics.Debug.Assert(sender == this.Strokes); 533System.Diagnostics.Debug.Assert(stroke != null); 542System.Diagnostics.Debug.Assert(stroke != null);
System\Windows\Controls\ItemCollection.cs (12)
722Debug.Assert(_deferLevel == 0 || _collectionView == null || _deferInnerRefresh != null); 725Debug.Assert(_deferLevel != 0 || _deferInnerRefresh == null); 1564Debug.Assert(_isInitializing == false); 1572Debug.Assert(_isInitializing == true); 1922Debug.Assert(sender == _collectionView); 1928Debug.Assert(sender == _collectionView); 1955Debug.Assert(_collectionView != null); 1966Debug.Assert(_collectionView == null || _deferInnerRefresh != null); 2196Debug.Assert(e.NewStartingIndex >= 0); 2207Debug.Assert(e.OldStartingIndex >= 0); 2215Debug.Assert(e.OldStartingIndex >= 0); 2225Debug.Assert(e.OldStartingIndex >= 0);
System\Windows\Controls\ItemsControl.cs (1)
3171Debug.Assert(direction == FocusNavigationDirection.Up ||
System\Windows\Controls\PasswordTextNavigator.cs (1)
301Debug.Assert(false);
System\Windows\Controls\PopupControlService.cs (1)
425Debug.Assert(_currentToolTip == null);
System\Windows\Controls\Primitives\CalendarItem.cs (9)
231Debug.Assert(false); 396Debug.Assert(mode != CalendarMode.Month); 468Debug.Assert(false); 550Debug.Assert(e != null); 568Debug.Assert(b != null); 928Debug.Assert(this.Owner.DisplayMode == CalendarMode.Year); 1057Debug.Assert(childButton != null); 1248Debug.Assert(childButton != null); 1295Debug.Assert(childButton != null);
System\Windows\Controls\Primitives\DataGridRowHeader.cs (1)
494Debug.Assert(stateCode != DATAGRIDROWHEADER_stateNullCode);
System\Windows\Controls\Primitives\DatePickerTextBox.cs (1)
168Debug.Assert(e.NewValue is bool);
System\Windows\Controls\Primitives\MenuBase.cs (4)
244Debug.Assert(menu.HasPushedMenuMode); 898Debug.Assert(_pushedMenuMode == null); 900Debug.Assert(_pushedMenuMode != null); 909Debug.Assert(_pushedMenuMode != null);
System\Windows\Controls\Primitives\Popup.cs (1)
2498Debug.Assert(i >= 0 && i < GetNumberOfCombinations(placement));
System\Windows\Controls\Primitives\ScrollContentPresenter.cs (2)
806Debug.Assert(IsScrollClient); 841Debug.Assert(IsScrollClient);
System\Windows\Controls\Primitives\Selector.cs (9)
593Debug.Assert(String.IsNullOrEmpty(path) || path == "/InnerText"); 1536Debug.Assert(IsSynchronizedWithCurrentItemPrivate); 1564Debug.Assert(IsSynchronizedWithCurrentItemPrivate); 2183Debug.Assert(String.IsNullOrEmpty(path) || path == "/InnerText"); 2282Debug.Assert(_owner.CheckAccess()); 2295Debug.Assert(_owner.CheckAccess()); 2505Debug.Assert(_owner.CheckAccess()); 2562Debug.Assert(_owner.CheckAccess()); 2600Debug.Assert(_owner.CheckAccess());
System\Windows\Controls\RowDefinition.cs (14)
104Debug.Assert(_items != null); 126Debug.Assert(_items != null); 166Debug.Assert( _items[i] != null 184Debug.Assert(_items[item.Index] == item); 199Debug.Assert(_items[value.Index] == value); 335Debug.Assert( _items[i] != null 344Debug.Assert( _items[i + count] != null 600Debug.Assert(value != null && value.Index == -1); 601Debug.Assert(_items[index] == null); 618Debug.Assert(value != null); 651Debug.Assert( _items[i] != null 669Debug.Assert( _items[value.Index] == value 682Debug.Assert( _items[i + 1] != null 708Debug.Assert(value >= _size);
System\Windows\Controls\ScrollViewer.cs (3)
1326Debug.Assert(!MeasureDirty); 1735Debug.Assert(_panningInfo != null); 1869Debug.Assert(_panningInfo != null);
System\Windows\Controls\SelectedDatesCollection.cs (3)
414Debug.Assert(false); 432Debug.Assert(!_isAddingRange); 438Debug.Assert(_isAddingRange);
System\Windows\Controls\SoundPlayerAction.cs (2)
158Debug.Assert(m_player.IsLoadCompleted); 239Debug.Assert(m_player.IsLoadCompleted);
System\Windows\Controls\Stack.cs (2)
814Debug.Assert(measureElement.IsScrolling); 839Debug.Assert(logicalOffset == 0 || (logicalOffset > 0 && logicalOffset < children.Count));
System\Windows\Controls\TextBlock.cs (23)
1426Debug.Assert(lineCount == LineCount); 1539Debug.Assert(lineCount == LineCount); 1691Debug.Assert(lineCount == LineCount); 1795Debug.Assert(lineCount == LineCount); 1800Debug.Assert(lineIndex < lineCount); 1811Debug.Assert(lineCount == LineCount); 1813Debug.Assert(lineIndex < lineCount); 1839Debug.Assert(lineBounds.Count > 0); 2063Debug.Assert(lineCount == LineCount); 2207Debug.Assert(lineCount == LineCount); 2478Debug.Assert(lineIndex > 0); 2481Debug.Assert(dcp >= 0); 2496Debug.Assert(lineIndex < lineCount - 1); 2606Debug.Assert(lineIndex > 0); 2609Debug.Assert(dcp >= 0); 3416Debug.Assert(IsLayoutDataValid); 3417Debug.Assert(CheckFlags(Flags.RequiresAlignment)); 3435Debug.Assert(lineCount == LineCount); 3609Debug.Assert(lineCount == LineCount); 3646Debug.Assert(e != null); 3649Debug.Assert(_complexContent.TextContainer is TextContainer); 3920Debug.Assert(owner != null); 3921Debug.Assert(textContainer != null);
System\Windows\Controls\TextSearch.cs (2)
783Debug.Assert(_attachedTo != null); 798Debug.Assert(_attachedTo != null);
System\Windows\Controls\VirtualizedCellInfoCollection.cs (10)
979Debug.Assert(rowIndex >= 0); 1007Debug.Assert(rowIndex >= 0); 1046Debug.Assert(rowIndex >= 0); 1062Debug.Assert(oldIndex >= 0); 1063Debug.Assert(newIndex >= 0); 1152Debug.Assert(columnIndex >= 0); 1195Debug.Assert(columnIndex >= 0); 1234Debug.Assert(columnIndex >= 0); 1253Debug.Assert(oldIndex >= 0); 1254Debug.Assert(newIndex >= 0);
System\Windows\Controls\VirtualizingStackPanel.cs (4)
3715Debug.Assert(args.Action == NotifyCollectionChangedAction.Reset && args.ItemCount == 1); 9354Debug.Assert(_cleanupDelay != null); 9375Debug.Assert(_cleanupOperation != null); 9464Debug.Assert(startIndex >= 0 && count > 0);
System\Windows\Controls\WebBrowser.cs (2)
546Debug.Assert(clsid.ToString("D") == CLSID.WebBrowser); 584Debug.Assert(_axIWebBrowser2 != null);
System\Windows\Data\BindingListCollectionView.cs (1)
739Debug.Assert(true);
System\Windows\Data\ObjectDataProvider.cs (4)
164Debug.Assert((_objectInstance == null) ? (_objectType == null) : (_objectType == _objectInstance.GetType())); 351Debug.Assert(_mode != SourceMode.FromType); 452Debug.Assert(_objectType != null); 525Debug.Assert(_objectType != null);
System\Windows\Data\RelativeSource.cs (3)
172Debug.Assert(_mode == RelativeSourceMode.FindAncestor); 210Debug.Assert((!IsUninitialized) || (_mode == RelativeSourceMode.FindAncestor)); 274Debug.Assert(IsUninitialized);
System\Windows\Data\XmlDataProvider.cs (1)
772Debug.Assert(doc != null);
System\Windows\Documents\AdornerLayer.cs (2)
640Debug.Assert(adorner != null); 712Debug.Assert(element != null);
System\Windows\Documents\ChildDocumentBlock.cs (4)
50Debug.Assert(childContainer != null); 57Debug.Assert(docRef != null); 75Debug.Assert(newBlock != null); 130Debug.Assert(ChildContainer.Highlights.GetLayer(typeof(TextSelection)) == null);
System\Windows\Documents\ColumnResizeAdorner.cs (1)
41Debug.Assert(scope != null);
System\Windows\Documents\CompositionAdorner.cs (1)
59Debug.Assert(textView != null && textView.RenderScope != null);
System\Windows\Documents\DocumentSequence.cs (9)
263Debug.Assert(innerDP != null); 284Debug.Assert(innerDP != null); 569Debug.Assert(docRef != null); 576Debug.Assert(paginator != null); 584Debug.Assert(paginator != null); 1068Debug.Assert(documentSequence != null); 1069Debug.Assert(documentPaginator != null); 1070Debug.Assert(documentPage != null); 1178Debug.Assert(false);
System\Windows\Documents\DocumentSequenceHighlightLayer.cs (1)
78Debug.Assert(ranges.Count > 0);
System\Windows\Documents\DocumentSequenceTextContainer.cs (12)
45Debug.Assert(parent != null); 46Debug.Assert(parent is FixedDocumentSequence); 233Debug.Assert(_start != null); 246Debug.Assert(_end != null); 398Debug.Assert(docRef != null); 514Debug.Assert(_parent != null); 662Debug.Assert(sender != null); 663Debug.Assert(args != null); 664Debug.Assert(args.Ranges != null); 713Debug.Assert(args.Ranges.Count > 0 && ((TextSegment)args.Ranges[0]).Start.CompareTo(((TextSegment)args.Ranges[0]).End) < 0); 1007Debug.Assert(parentTextPointer != null); 1030Debug.Assert(parentChangePosition != null);
System\Windows\Documents\DocumentSequenceTextPointer.cs (7)
38Debug.Assert(childBlock != null); 39Debug.Assert(childPosition != null); 569Debug.Assert(_childTp != null); 897Debug.Assert(direction == LogicalDirection.Backward); 942Debug.Assert(tp != null); 954Debug.Assert(thisTp.ChildBlock.ChildContainer == tp.ChildBlock.ChildContainer); 998Debug.Assert(xGapAwareCompareTo(tp1, tp2) <= 0);
System\Windows\Documents\FixedDocument.cs (9)
349Debug.Assert(page != null); 665Debug.Assert(IsValidPageIndex(index)); 711Debug.Assert(fp != null); 1039Debug.Assert(sender != null); 1040Debug.Assert(args != null); 1041Debug.Assert(args.Ranges != null); 1044Debug.Assert(args.Ranges.Count > 0 && ((TextSegment)args.Ranges[0]).Start.CompareTo(((TextSegment)args.Ranges[0]).End) < 0); 1170Debug.Assert(pageNo >= 0 && pageNo<PageCount); 1362Debug.Assert(panel != null && page != null);
System\Windows\Documents\FixedElement.cs (3)
141Debug.Assert((object)_start == (object)_end); 199Debug.Assert(_object == null && e._type == ElementType.Object); 262Debug.Assert(false);
System\Windows\Documents\FixedFindEngine.cs (13)
37Debug.Assert(start != null); 38Debug.Assert(end != null); 39Debug.Assert( ((start is DocumentSequenceTextPointer) && (end is DocumentSequenceTextPointer)) || 41Debug.Assert(findPattern != null); 50Debug.Assert(paginator != null); 90Debug.Assert(firstSearchPageStart != null); 91Debug.Assert(firstSearchPageEnd != null); 125Debug.Assert(fixedDoc != null); 311Debug.Assert(endAsFTP != null); 331Debug.Assert(startAsFTP != null); 342Debug.Assert(doc != null); 343Debug.Assert(translatedPageNo >= 0 && translatedPageNo < doc.PageCount); 368Debug.Assert(pageStream != null);
System\Windows\Documents\FixedFlowMap.cs (2)
136Debug.Assert(fp >= 0 && fp < _flowOrder.Count); 168Debug.Assert(flowOld.Type == FlowNodeType.Virtual || flowNew != null);
System\Windows\Documents\FixedHighlight.cs (3)
43Debug.Assert(element != null && beginOffset >= 0 && endOffset >= 0); 143Debug.Assert(_gBeginOffset >= 0); 144Debug.Assert(_gEndOffset <= chrct);
System\Windows\Documents\FixedNode.cs (5)
81Debug.Assert(childLevels >= 1); 97Debug.Assert(childPath != null); 135Debug.Assert(path != null && path.Length >= 2); // At least a page index and an element index 342Debug.Assert(level < _path.Length); 353Debug.Assert(_path.Length >= 2);
System\Windows\Documents\FixedPage.cs (4)
863Debug.Assert(e != null); 899Debug.Assert(currentLevelIndex >= 0 && currentLevelIndex <= ((Canvas)element).Children.Count); 1030Debug.Assert(currentChildrens != null); 1172Debug.Assert(pageStructure != null);
System\Windows\Documents\FixedPageStructure.cs (13)
41Debug.Assert(pageIndex >= 0); 105Debug.Assert(lineResult != null); 117Debug.Assert(_lineResults != null); 155Debug.Assert(_lineResults != null); 209Debug.Assert(flowStart != null && flowStart.Type != FlowNodeType.Virtual); 210Debug.Assert(flowEnd != null && flowEnd.Type != FlowNodeType.Virtual); 219Debug.Assert(!rect.IsEmpty); 473Debug.Assert(false); 537Debug.Assert(glyphs!= null); 553Debug.Assert(false); 624Debug.Assert(false); 641Debug.Assert(false); 679Debug.Assert(_fixedSOMPageConstructor != null);
System\Windows\Documents\FixedSOMContainer.cs (7)
38Debug.Assert(compared != null); 39Debug.Assert(This != null); 47Debug.Assert(compareHor != SpatialComparison.None); 48Debug.Assert(compareVer != SpatialComparison.None); 103Debug.Assert(false); 110Debug.Assert(false); 224Debug.Assert(container != null);
System\Windows\Documents\FixedSOMFixedBlock.cs (1)
163Debug.Assert(SemanticBoxes[i] is FixedSOMTextRun || SemanticBoxes[i] is FixedSOMImage);
System\Windows\Documents\FixedSOMGroup.cs (5)
40Debug.Assert(compared != null); 51Debug.Assert(compareHor != SpatialComparison.None); 52Debug.Assert(compareVer != SpatialComparison.None); 102Debug.Assert(false); 109Debug.Assert(false);
System\Windows\Documents\FixedSOMImage.cs (1)
70Debug.Assert(path.Fill is ImageBrush);
System\Windows\Documents\FixedSOMLineCollection.cs (2)
60Debug.Assert(point1.X == point2.X); 66Debug.Assert(point1.Y == point2.Y);
System\Windows\Documents\FixedSOMPageConstructor.cs (10)
227Debug.Assert(fixedPage != null); 241Debug.Assert(_fixedPage != null); 246Debug.Assert(obj != null); 374Debug.Assert(obj is Image || obj is Path); 403Debug.Assert(glyphs != null); 577Debug.Assert (fixedBlock.SemanticBoxes.Count > 0); 632Debug.Assert(textRunRect.Height != 0 && fixedBlock.LineHeight != 0); 1010Debug.Assert(false); 1137Debug.Assert(currentPageElement != null); 1147Debug.Assert(nextPageElement != null);
System\Windows\Documents\FixedSOMSemanticBox.cs (3)
95Debug.Assert(o != null); 105Debug.Assert(compareHor != SpatialComparison.None && compareVer != SpatialComparison.None); 301Debug.Assert(false);
System\Windows\Documents\FixedSOMTable.cs (2)
169Debug.Assert(row != null); 185Debug.Assert(row != null);
System\Windows\Documents\FixedSOMTextRun.cs (1)
43Debug.Assert(otherRun != null);
System\Windows\Documents\FixedTextBuilder.cs (24)
197Debug.Assert(!_IsBoundaryPage(pageIndex)); 214Debug.Assert(page != null); 215Debug.Assert(page.IsInitialized); 384Debug.Assert(fn.Type == FlowNodeType.Start); 474Debug.Assert(pStart.CompareTo(pEnd) < 0); 513Debug.Assert(fixes.Length == 1); 589Debug.Assert(flowNode.Type == FlowNodeType.Run); 593Debug.Assert(flowNode.Type == FlowNodeType.Run); 594Debug.Assert(fixes != null); 807Debug.Assert(pathPrefix != null); 830Debug.Assert(prevRun != null); 831Debug.Assert(currentRun != null); 1008Debug.Assert(pathPrefix == null); 1009Debug.Assert(level1Index >= 0); 1019Debug.Assert(newPathPrefix != null); 1025Debug.Assert(pathPrefix == null && newPathPrefix == null); 1089Debug.Assert(false); 1292Debug.Assert(false); 1315Debug.Assert(e is Image); 1412Debug.Assert(elem is FixedPage || elem is Canvas); 1563Debug.Assert(false); 1677Debug.Assert(run.EndIndex - run.StartIndex == run.Text.Length); 1751Debug.Assert(uiElement != null); 1772Debug.Assert(newLineResult != null);
System\Windows\Documents\FixedTextContainer.cs (8)
50Debug.Assert(parent != null && parent is FixedDocument); 202Debug.Assert(_start != null); 215Debug.Assert(_end != null); 394Debug.Assert(res); 410Debug.Assert(highlights != null); 528Debug.Assert(_fixedTextBuilder != null); 537Debug.Assert(_containerElement != null); 619Debug.Assert(start.CompareTo(end) <= 0);
System\Windows\Documents\FixedTextView.cs (11)
123Debug.Assert(pos != null); 171Debug.Assert(ftp != null); 248Debug.Assert(startPosition != null && this.Contains(startPosition)); 249Debug.Assert(endPosition != null && this.Contains(endPosition)); 413Debug.Assert(pos != null); 472Debug.Assert(false); 867 Debug.Assert(itp != null); 965Debug.Assert(hitGlyphs != null); 1017Debug.Assert(charStart - charCount == 1); 1028Debug.Assert(charEnd - charCount == 1); 1135Debug.Assert(symbolType == TextPointerContext.Text || symbolType == TextPointerContext.EmbeddedElement);
System\Windows\Documents\FlowNode.cs (2)
54Debug.Assert( (type != FlowNodeType.Run) || ((int)cookie != 0)); 99Debug.Assert(_fp != fn._fp || (_fp == fn._fp) && (_scopeId == fn._scopeId));
System\Windows\Documents\FlowPosition.cs (12)
42Debug.Assert(!FlowNode.IsNull(node)); 131Debug.Assert(flow != null); 178Debug.Assert(dir == LogicalDirection.Forward || dir == LogicalDirection.Backward); 186Debug.Assert(GetPointerContext(dir) == TextPointerContext.Text); 203Debug.Assert(GetPointerContext(dir) == TextPointerContext.Text); 244Debug.Assert(type == FlowNodeType.Object || type == FlowNodeType.Noop || type == FlowNodeType.Start || type == FlowNodeType.End); 375Debug.Assert(this._OverlapAwareCompare(pEnd) < 0); 428Debug.Assert(dir == LogicalDirection.Backward); 586Debug.Assert(dir == LogicalDirection.Backward); 636Debug.Assert(dir == LogicalDirection.Backward); 726Debug.Assert(flow != null); 754Debug.Assert(this._flowNode.Equals(flow._flowNode));
System\Windows\Documents\Glyphs.cs (4)
76Debug.Assert(_glyphRunProperties != null); 241Debug.Assert(glyphRunProperties.glyphIndices != null); 265Debug.Assert(0 <= nibble && nibble <= 15); 339Debug.Assert(parsedGlyphs.Count == glyphCount);
System\Windows\Documents\HighlightVisual.cs (4)
176Debug.Assert(highlights != null); 245Debug.Assert(bg != null); 251Debug.Assert(highlightGeometry != null); 269Debug.Assert(highlightGeometry != null);
System\Windows\Documents\Hyperlink.cs (1)
567Debug.Assert(targetUri != null);
System\Windows\Documents\ImmComposition.cs (2)
312Debug.Assert((oldSource == null) || (oldSource == _source)); 332Debug.Assert(newSource == _source);
System\Windows\Documents\NullTextContainer.cs (2)
183Debug.Assert(_start != null); 196Debug.Assert(_end != null);
System\Windows\Documents\NullTextNavigator.cs (5)
50Debug.Assert(position is NullTextPointer || position is NullTextPointer); 66Debug.Assert(position is NullTextPointer || position is NullTextPointer); 199Debug.Assert(distance == 0); 316Debug.Assert(false); // must never call this 324Debug.Assert(false); // must never call this
System\Windows\Documents\PageContentAsyncResult.cs (2)
63Debug.Assert(source == null || source.IsAbsoluteUri); 102get { Debug.Assert(false); return null; }
System\Windows\Documents\RtfToXamlLexer.cs (1)
423Debug.Assert(false);
System\Windows\Documents\RtfToXamlReader.cs (39)
2710Debug.Assert(HasBorder); 5143Debug.Assert(dnRow != null); // Need row 5144Debug.Assert(dnRow != null && !dnRow.IsPending); // Row props attached when row is closed 5145Debug.Assert(dnRow != null && dnRow.FormatState.RowFormat != null); 5574Debug.Assert(Type == DocumentNodeType.dnTable); 5903Debug.Assert(value >= 0); 5904Debug.Assert(!IsPending); 5965Debug.Assert(value == null || !value.IsPending); 6234Debug.Assert(nUnfilledRowIndex != 0); 6326Debug.Assert(nStart + nChild < Count); 6410Debug.Assert(Count == 0 || (nStart >= 0 && nStart < Count)); 6421Debug.Assert(nStart + nChild < Count); 6439Debug.Assert(nAt + dn.ChildCount <= nEnd); 6440Debug.Assert(!dn.IsTerminated); 6449Debug.Assert(dnChild.ChildCount == 0 && dnChild.IsTerminated); 6471Debug.Assert(Count == 0 || (nStart >= 0 && nStart < Count)); 6482Debug.Assert(nStart + nChild < Count); 6500Debug.Assert(nAt + dn.ChildCount <= nEnd); 6501Debug.Assert(!dn.IsTerminated); 6513Debug.Assert(dnChild.ChildCount == 0 && dnChild.IsTerminated); 6538Debug.Assert(Count == 0 || (index >= 0 && index < Count)); 6539Debug.Assert(index + nChildCount < Count); 6568Debug.Assert(Count == 0 || (index >= 0 && index < Count)); 6610Debug.Assert(EntryAt(i).ClosedParent != null); 6613Debug.Assert(nAt + dn.ChildCount < Count); 6617Debug.Assert(dnPa.IsPending || (nAt > dnPa.Index && nAt <= dnPa.Index + dnPa.ChildCount)); 6635Debug.Assert(dnPa != null && dnPa.Type == DocumentNodeType.dnTable); 6638Debug.Assert(dnPa != null && dnPa.Type == DocumentNodeType.dnTableBody); 6641Debug.Assert(dnPa != null && dnPa.Type == DocumentNodeType.dnRow); 6644Debug.Assert(dnPa != null && dnPa.Type == DocumentNodeType.dnList); 6910Debug.Assert(false); 7087Debug.Assert(_fMain); 7134Debug.Assert(dnPa.LastChildIndex >= nAt + nExcise - 1); 8212Debug.Assert(dn.ChildCount == 0); 8240Debug.Assert(dn.ChildCount == 0); 9870Debug.Assert(nInsertAt >= 0 && nChildren > 0 && nInsertAt + nChildren - 1 < dna.Count); 11079Debug.Assert(dna.Count > 0 && dna.EntryAt(dna.Count - 1).Type == DocumentNodeType.dnParagraph); 11294Debug.Assert(!dnPara.IsTerminated); 11512Debug.Assert(!dnTop.IsTerminated);
System\Windows\Documents\RubberbandSelector.cs (2)
323Debug.Assert(range.first != null && range.second != null); 478Debug.Assert(end >= begin);
System\Windows\Documents\Table.cs (2)
433Debug.Assert(table != null); 485Debug.Assert(_currentChildType != ChildrenTypes.BeforeFirst);
System\Windows\Documents\TableCell.cs (1)
406Debug.Assert(value >= -1 && _parentIndex != value);
System\Windows\Documents\TableColumn.cs (1)
173Debug.Assert (value >= -1 && _parentIndex != value);
System\Windows\Documents\TableRow.cs (5)
203Debug.Assert(rowSpanVector != null); 230Debug.Assert(i <= firstAvailableIndex); 250Debug.Assert(_spannedCells != null); 260Debug.Assert(_cells.Count <= _formatCellCount); 316Debug.Assert(value >= -1 && _parentIndex != value);
System\Windows\Documents\TableRowGroup.cs (1)
267Debug.Assert(value >= -1 && _parentIndex != value);
System\Windows\Documents\XamlToRtfWriter.cs (3)
232Debug.Assert(openLists.Count > 0); 406Debug.Assert(openLists.Count > 0); 437Debug.Assert(openLists.Count > 0);
System\Windows\EventTrigger.cs (1)
308Debug.Assert( eventTrigger._routedEventHandler == null && eventTrigger._source == null);
System\Windows\FrameworkContentElement.cs (7)
652Debug.Assert(entry.Value == DependencyProperty.UnsetValue); 1482Debug.Assert((uint)InternalFlags.InheritanceBehavior0 == 0x08); 1483Debug.Assert((uint)InternalFlags.InheritanceBehavior1 == 0x10); 1484Debug.Assert((uint)InternalFlags.InheritanceBehavior2 == 0x20); 1497Debug.Assert((uint)InternalFlags.InheritanceBehavior0 == 0x08); 1498Debug.Assert((uint)InternalFlags.InheritanceBehavior1 == 0x10); 1499Debug.Assert((uint)InternalFlags.InheritanceBehavior2 == 0x20);
System\Windows\FrameworkElement.cs (12)
1937Debug.Assert( IsTemplatedParentAnFE ); 2347Debug.Assert( foTemplatedParent.IsFE ); 2612Debug.Assert((uint)InternalFlags.InheritanceBehavior0 == 0x08); 2613Debug.Assert((uint)InternalFlags.InheritanceBehavior1 == 0x10); 2614Debug.Assert((uint)InternalFlags.InheritanceBehavior2 == 0x20); 2627Debug.Assert((uint)InternalFlags.InheritanceBehavior0 == 0x08); 2628Debug.Assert((uint)InternalFlags.InheritanceBehavior1 == 0x10); 2629Debug.Assert((uint)InternalFlags.InheritanceBehavior2 == 0x20); 2986Debug.Assert(fe != null || fce != null); 3028Debug.Assert( feTemplatedParent != null ); 4097Debug.Assert(sourceTransform != null); 4106Debug.Assert(_transform != null);
System\Windows\FrameworkElementFactory.cs (2)
725Debug.Assert( _frameworkTemplate != null ); 801Debug.Assert( _frameworkTemplate != null );
System\Windows\FrameworkTemplate.cs (2)
773Debug.Assert(fo.TemplatedParent == templatedParent); 1144Debug.Assert(!(rootElement is FrameworkElement) ||
System\Windows\Input\KeyboardNavigation.cs (2)
3118Debug.Assert(DoubleUtil.GreaterThanOrClose(rangeEnd1, rangeStart1)); 3119Debug.Assert(DoubleUtil.GreaterThanOrClose(rangeEnd2, rangeStart2));
System\Windows\Interop\HwndHost.cs (1)
985Debug.Assert(hwnd != null);
System\Windows\Localization.cs (1)
118Debug.Assert(property == AttributesProperty);
System\Windows\Markup\Baml2006\Baml2006KeyRecord.cs (1)
72Debug.Assert(StaticResources[StaticResources.Count - 1] is StaticResource);
System\Windows\Markup\Baml2006\Baml2006Reader.cs (4)
1533Debug.Assert(dataByteSize == 1); 1673Debug.Assert(ownerType != null); 1959Debug.Assert(sr != null); 2594Debug.Assert(property.Type.UnderlyingType == typeof(DependencyProperty));
System\Windows\Markup\Baml2006\Baml2006SchemaContext.cs (1)
196Debug.Assert(wpfMember.DependencyProperty != null);
System\Windows\Markup\Baml2006\WpfSharedBamlSchemaContext.cs (2)
139Debug.Assert(bamlType != null); 169Debug.Assert(bamlMember != null);
System\Windows\Markup\Baml2006\WpfXamlMember.cs (1)
132Debug.Assert(!IsAttachable && !IsEvent);
System\Windows\Markup\BamlMapTable.cs (18)
72Debug.Assert(null != xamlTypeMapper); 158Debug.Assert(cmp > 0); 264Debug.Assert(type.IsEnum); 269Debug.Assert(ReflectionHelper.IsNullableType(type)); 551Debug.Assert(propType.IsEnum); 562Debug.Assert(ReflectionHelper.IsNullableType(propType)); 620Debug.Assert(-id <= _knownStrings.Length); 625Debug.Assert(id < StringIdMap.Count); 862Debug.Assert(memberId < 0); 1094Debug.Assert( 1106Debug.Assert(bamlAssemblyInfoRecord.AssemblyId >= 0); 1117Debug.Assert(AssemblyIdMap.Count == record.AssemblyId || 1269Debug.Assert(TypeIdMap.Count == record.TypeId || 1286Debug.Assert(ownerTypeName != null); 1287Debug.Assert(attributeName != null); 1504Debug.Assert(targetType != null && memberName != null); 1646Debug.Assert(AttributeIdMap.Count == record.AttributeId || 1662Debug.Assert(StringIdMap.Count == record.StringId ||
System\Windows\Markup\BamlRecordReader.cs (35)
107Debug.Assert(null != bamlStream); 108Debug.Assert(null != parserContext && null != parserContext.XamlTypeMapper); 133Debug.Assert(null != parserContext && null != parserContext.XamlTypeMapper); 342Debug.Assert(bamlRecord.RecordType == BamlRecordType.LinePosition); 528Debug.Assert( stackDepth == ReaderContextStack.Count ); 544Debug.Assert(bamlConnectionIdRecord.ConnectionId > 0); 556Debug.Assert(0 == ReaderContextStack.Count); // if not zero we missed an EndElement 640Debug.Assert(false); 729Debug.Assert(ReaderFlags.DependencyObject == CurrentContext.ContextType); 811Debug.Assert(ReaderFlags.DependencyObject == CurrentContext.ContextType || 1016Debug.Assert(_rootElement != null); 1066Debug.Assert(null == ParentContext); 1233Debug.Assert( CurrentContext.ContextType != ReaderFlags.PropertyComplexClr ); 1234Debug.Assert( CurrentContext.ContextType != ReaderFlags.PropertyComplexDP ); 1286Debug.Assert(CurrentContext.ContextType == ReaderFlags.ConstructorParams); 1316Debug.Assert(parent is DependencyObject); 1435Debug.Assert(param is String); 1478Debug.Assert(paramString != null); 2114Debug.Assert(serializerTypeId == (short)KnownElements.DependencyPropertyConverter); 2539Debug.Assert(o is DependencyObject); 2755Debug.Assert(element is DependencyObject); 2994Debug.Assert(!holder.ReadOnly); // this is being checked in XamlReaderHelper, just assert 3019Debug.Assert(arrayExt != null); 3138Debug.Assert (holder.Collection == null); 3643Debug.Assert(null != CurrentContext && 3703Debug.Assert(false); 3712Debug.Assert(currentTarget is DependencyObject); 3726Debug.Assert(false); // We do not expect to be here after all checks done in propertyType identification above 3788Debug.Assert(genericType != null); 3832Debug.Assert(memberInfo is MethodInfo); 3848Debug.Assert(null != CurrentContext && 3897Debug.Assert(null != CurrentContext && 4903Debug.Assert(contentProperty != null); 5754Debug.Assert(_attributeInfo != null); 5849Debug.Assert(this.AttachedPropertyGetter != null);
System\Windows\Markup\BamlRecords.cs (8)
778Debug.Assert(null == _writeCache[(int)record.RecordType]); 915Debug.Assert( value <= 3 && value >= 0 ); 1103Debug.Assert(RecordSize < 0); 2399Debug.Assert(value <= ExtensionIdMask); 2729Debug.Assert(!ValueObjectSet); 4555Debug.Assert( SerializerTypeId != 0 ); 4728Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null); 4771Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null);
System\Windows\Markup\BamlRecordWriter.cs (11)
119Debug.Assert(null != DocumentStartRecord); 137Debug.Assert(null != DocumentStartRecord); 408Debug.Assert(_deferElementDepth == 0); 409Debug.Assert(_deferComplexPropertyDepth == 0); 410Debug.Assert(_staticResourceElementDepth == 0); 411Debug.Assert(_dynamicResourceElementDepth == 0); 412Debug.Assert(_staticResourceRecordList == null); 430Debug.Assert(_staticResourceElementDepth == 0); 881Debug.Assert(_deferElementDepth == 2); 1070Debug.Assert(extensionTypeId != (short)KnownElements.TypeExtension); 1087Debug.Assert(typeValue != null);
System\Windows\Markup\BamlWriter.cs (4)
397Debug.Assert(typeValue != null); 1286Debug.Assert(stackNode != null); 1294Debug.Assert(stackNode != null); 1302Debug.Assert(stackNode != null);
System\Windows\Markup\Localizer\BamlLocalizableResource.cs (1)
62Debug.Assert(other != null);
System\Windows\Markup\MarkupExtensionParser.cs (2)
1189Debug.Assert(sb.Length > 0); 1190Debug.Assert(!Char.IsWhiteSpace(sb[0]));
System\Windows\Markup\ParserContext.cs (1)
764Debug.Assert(canDecrement);
System\Windows\Markup\Primitives\ElementMarkupObject.cs (4)
52Debug.Assert(instance != null); 728Debug.Assert(obj != null); 752Debug.Assert(descriptor != null); 801Debug.Assert(DO != null);
System\Windows\Markup\Primitives\FrameworkElementFactoryMarkupObject.cs (1)
30Debug.Assert(factory != null);
System\Windows\Markup\Primitives\MarkupWriter.cs (4)
259Debug.Assert( (object)key != null); 443Debug.Assert(item != null && _writer != null); 833Debug.Assert(property.PropertyDescriptor != null); 1037Debug.Assert(property.Value != null);
System\Windows\Markup\XamlFigureLengthSerializer.cs (1)
251Debug.Assert( unit == FigureUnitType.Pixel
System\Windows\Markup\XamlGridLengthSerializer.cs (1)
253Debug.Assert( unit == GridUnitType.Pixel
System\Windows\Markup\XamlReader.cs (1)
1114Debug.Assert(parent == null || root == parent);
System\Windows\Markup\XamlTypeMapper.cs (6)
875Debug.Assert(propertyOwnerType != null); 904Debug.Assert(attachedPropertyInfo.IsPublic || 2138Debug.Assert( propertyMember is DependencyProperty); 2319Debug.Assert(memberName != null); 2322Debug.Assert(memberInfo != null); 2337Debug.Assert(targetType != null);
System\Windows\Markup\XmlnsDictionary.cs (1)
713Debug.Assert(prefix != null);
System\Windows\Media\Animation\BeginStoryboard.cs (1)
189Debug.Assert( frameworkTemplate != null );
System\Windows\Media\Animation\ControllableStoryboardAction.cs (1)
74Debug.Assert( frameworkTemplate != null );
System\Windows\Media\Animation\Generated\ThicknessAnimation.cs (1)
217Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\ThicknessAnimationUsingKeyFrames.cs (1)
327Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\ThicknessKeyFrameCollection.cs (1)
483Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Storyboard.cs (1)
266Debug.Assert( nameScope == null );
System\Windows\Navigation\Journal.cs (7)
260Debug.Assert(ValidateIndexes()); 270Debug.Assert(ValidateIndexes()); 283Debug.Assert(journalEntry.ContentId != 0); 333Debug.Assert(ValidateIndexes()); 428Debug.Assert(ValidateIndexes()); 476Debug.Assert(je.GetType().IsSerializable); 581Debug.Assert(ValidateIndexes());
System\Windows\Navigation\JournalEntry.cs (2)
296Debug.Assert(_jeGroupState.JournalDataStreams == null); 313Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward);
System\Windows\Navigation\NavigationService.cs (29)
95Debug.Assert(_navigateQueueItem == null || _navigateQueueItem.IsPosted == false); 260Debug.Assert(IsConsistent(navInfo)); 292Debug.Assert(navMode != NavigationMode.Refresh); // because of !IsSameUri() above 313Debug.Assert(_navStatus == NavigationStatus.Navigating); 461Debug.Assert(!(_bp is Visual)); 600Debug.Assert(_parentNavigationService == newParent); 879Debug.Assert(_navigateQueueItem == null && _navStatus == NavigationStatus.Navigated); 903Debug.Assert(finishingChildPageFunction == null || 922Debug.Assert(finishingChildPageFunction._Return == null); 956Debug.Assert(pfReturnInfo == null); 962Debug.Assert(pf.ParentPageFunctionId != Guid.Empty); 1001Debug.Assert(IsConsistent(navInfo)); 1026Debug.Assert(!JournalScope.Journal.HasUncommittedNavigation); 1030Debug.Assert(_navigateQueueItem == null); 1193Debug.Assert(!JournalScope.Journal.HasUncommittedNavigation); 1210Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward); 1213Debug.Assert(_contentId != 0); 1217Debug.Assert(_journalEntryGroupState == null || 2115Debug.Assert(navigateInfo.IsConsistent); 2262Debug.Assert(_navStatus == NavigationStatus.Navigated); 2603Debug.Assert(sender == _bp); 3086Debug.Assert(IsConsistent(navigateInfo)); 3118Debug.Assert(destinationJournalEntry == null 3197Debug.Assert(_contentId != 0 && 3703Debug.Assert(ps._Resume); // should've been set by JournalEntryPFxx.ResumePageFunction() 3807Debug.Assert(parentPF._Return == null); 3909Debug.Assert(parentEntryIndex < journal.CurrentIndex); 4414Debug.Assert(_postedOp == null); 4505Debug.Assert(child != null);
System\Windows\Navigation\NavigationWindow.cs (2)
228Debug.Assert(_navigationService == null && _JNS == null); 320Debug.Assert(_JNS != null);
System\Windows\Navigation\PageFunction.cs (2)
271Debug.Assert((returnEventArgs == null) || (ra != null)); 275Debug.Assert(eh != null);
System\Windows\PropertyPath.cs (1)
435Debug.Assert(aryIPI.Length > 0);
System\Windows\ResourceDictionary.cs (9)
197Debug.Assert(classicResourceUri != null); 211Debug.Assert(genericResourceUri != null); 1095Debug.Assert(deferrableContent.Stream != null); 1096Debug.Assert(deferrableContent.SchemaContext != null); 1097Debug.Assert(deferrableContent.ObjectWriterFactory != null); 1098Debug.Assert(deferrableContent.ServiceProvider != null); 1099Debug.Assert(deferrableContent.RootObject != null); 1276Debug.Assert(staticResources != null && staticResources.Count > 0); 1314Debug.Assert(obj is DeferredResourceReference);
System\Windows\ResourceReferenceExpression.cs (1)
546Debug.Assert(!_resource.IsFrozen);
System\Windows\Shapes\Shape.cs (5)
632Debug.Assert(mode != Stretch.None); 654Debug.Assert(mode == Stretch.UniformToFill); 686Debug.Assert(geometry != null); 726Debug.Assert(geometry != null); 737Debug.Assert(_renderedGeometry != null);
System\Windows\Shell\JumpList.cs (12)
461Debug.Assert(_initializing == false); 692Debug.Assert(removedList != null); 693Debug.Assert(shellObject != null); 767Debug.Assert(false); 773Debug.Assert(shellObjects != null); 810Debug.Assert(jumpItems.Count != 0); 811Debug.Assert(cdl != null); 866Debug.Assert(jumpItems.Count != linksOnlyList.Count); 872Debug.Assert(HRESULT.DESTS_E_NO_MATCHING_ASSOC_HANDLER != hr); 888Debug.Assert(jumpTask != null); 1001Debug.Assert(jumpPath != null); 1071Debug.Assert(false);
System\Windows\Shell\ThumbButtonInfo.cs (1)
281Debug.Assert(command != null);
System\Windows\StyleHelper.cs (54)
67Debug.Assert(fe != null || fce != null); 106Debug.Assert(fe != null || fce != null); 172Debug.Assert((fe != null && fce == null)|| (fe == null && fce != null)); 360Debug.Assert(frameworkTemplate != null ); 380Debug.Assert( !frameworkTemplate.HasXamlNodeContent ); 384Debug.Assert(frameworkTemplate != null); 425Debug.Assert( frameworkTemplate != null ); 779Debug.Assert(childIndex >= 0); 1287Debug.Assert( childIndex != 0 ); // This should go to the other AddDelegateToFireTrigger overload 1345Debug.Assert((fe != null && fce == null) || (fe == null && fce != null)); 1377Debug.Assert((fe != null && fce == null) || (fe == null && fce != null)); 1378Debug.Assert((fe != null && fe == container) || (fce != null && fce == container)); 1379Debug.Assert(newStyle != null || newFrameworkTemplate != null ); 1441Debug.Assert((fe != null && fce == null) || (fe == null && fce != null)); 1442Debug.Assert((fe != null && fe == container) || (fce != null && fce == container)); 1443Debug.Assert(oldStyle != null || oldFrameworkTemplate != null ); 1677Debug.Assert(oldStyle != null || oldFrameworkTemplate != null ); 1695Debug.Assert(dataField == ThemeStyleDataField); 1777Debug.Assert(frameworkTemplate != null ); 2051Debug.Assert(frameworkTemplate != null ); 2189Debug.Assert(feContainer != null || fceContainer != null); 2224Debug.Assert(oldFrameworkTemplate != null ); 2273Debug.Assert( oldFrameworkTemplate != null ); 2487Debug.Assert( feTemplatedParent != null ); 2511Debug.Assert(ownerStyle != null || frameworkTemplate != null ); 2523Debug.Assert( frameworkTemplate != null ); 2892Debug.Assert(dataField == ThemeStyleDataField); 3034Debug.Assert(frameworkTemplate != null ); 3048Debug.Assert(frameworkTemplate != null ); 3159Debug.Assert(fe != null || fce != null); 3241Debug.Assert(fe != null || fce != null); 3313Debug.Assert(feContainer != null); 3322Debug.Assert(feContainer != null); 3362Debug.Assert(feContainer != null); 3385Debug.Assert(feContainer != null); 3413Debug.Assert(feContainer != null); 3457Debug.Assert(fe != null || fce != null); 3458Debug.Assert(container == fe || container == fce); 3498Debug.Assert(fe != null || fce != null); 3499Debug.Assert(container == fe || container == fce); 3908Debug.Assert(sourceType == ValueLookupType.Simple || 3938Debug.Assert(sourceType == ValueLookupType.Trigger || 3992Debug.Assert(sourceType == ValueLookupType.Simple || 4202Debug.Assert(child.FE != null || child.FCE != null); 4311Debug.Assert(ownerStyle != null || frameworkTemplate != null ); 4382Debug.Assert(ownerStyle != null || frameworkTemplate != null ); 4553Debug.Assert( ft != null ); 5315Debug.Assert(frameworkTemplate != null ); 5322Debug.Assert(frameworkTemplate != null); 5346Debug.Assert(frameworkTemplate != null); 5391Debug.Assert(frameworkTemplate != null ); 5396Debug.Assert(frameworkTemplate != null); 5449Debug.Assert( 5559Debug.Assert(routedEvent != null);
System\Windows\SystemResources.cs (8)
1109Debug.Assert(_hwndNotify != null); 1110Debug.Assert(_hwndNotifyHook != null); 1111Debug.Assert(callerName.Equals(nameof(EnsureResourceChangeListener), StringComparison.InvariantCulture)); 1139Debug.Assert(!_hwndNotify.ContainsKey(hwndDpiInfo)); 1140Debug.Assert(hwndDpiInfo.DpiAwarenessContextValue == dpiContextValue); 1177Debug.Assert(dpiContextValue == DpiAwarenessContextValue.Unaware || dpiContextValue == DpiAwarenessContextValue.SystemAware); 1564Debug.Assert(hwndDpiInfo != null); 1822Debug.Assert(_inflatedList != null);
System\Windows\SystemThemeKey.cs (1)
32Debug.Assert(id > SystemResourceKeyID.InternalSystemThemeStylesStart &&
System\Windows\TemplateContent.cs (11)
43Debug.Assert(_xamlType == null); 236Debug.Assert(TemplateLoadData.Reader != null); 322Debug.Assert(childIndex == lastIndex); 615Debug.Assert(sharedValue != null); 755Debug.Assert(xamlReader.NodeType == Xaml.XamlNodeType.StartObject); 756Debug.Assert(xamlReader.Type.UnderlyingType == typeof(StaticResourceExtension)); 778Debug.Assert(resource != null); 801Debug.Assert(xamlReader.NodeType == System.Xaml.XamlNodeType.StartMember); 896Debug.Assert(xamlReader.NodeType == System.Xaml.XamlNodeType.StartObject); 1155Debug.Assert(xamlReader.NodeType == System.Xaml.XamlNodeType.EndMember); 1234Debug.Assert(templateChildName != null);
System\Windows\TemplateNameScope.cs (2)
166Debug.Assert(_affectedChildren.Count == childIndex); 216Debug.Assert(fo.IsFE);
System\Windows\TriggerActionCollection.cs (1)
282Debug.Assert (Owner == null);
System\Windows\TriggerCollection.cs (1)
107Debug.Assert (Owner == null);
System\Windows\Window.cs (16)
670Debug.Assert(false); 2235Debug.Assert( _swh != null ); 2244Debug.Assert( _swh != null ); 3793Debug.Assert(hMonitor != IntPtr.Zero); 6389Debug.Assert(0 != (int)_overlaySize.Width); 6390Debug.Assert(0 != (int)_overlaySize.Height); 6433Debug.Assert(null != _taskbarList); 6459Debug.Assert(false); 6478Debug.Assert(null != _taskbarList); 6492Debug.Assert(0 <= taskbarInfo.ProgressValue && taskbarInfo.ProgressValue <= 1); 6500Debug.Assert(null != _taskbarList); 6525Debug.Assert(null != _taskbarList); 6596Debug.Assert(null != _taskbarList); 6624Debug.Assert(null != _taskbarList); 7070Debug.Assert( _swh != null ); 7281Debug.Assert( sourceWindow != null );
PresentationFramework.Aero (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
30Debug.Assert(_platformCulture != null);
PresentationFramework.Aero2 (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
30Debug.Assert(_platformCulture != null);
PresentationFramework.AeroLite (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
30Debug.Assert(_platformCulture != null);
PresentationFramework.Classic (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
30Debug.Assert(_platformCulture != null);
PresentationFramework.Luna (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
30Debug.Assert(_platformCulture != null);
PresentationFramework.Royale (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
30Debug.Assert(_platformCulture != null);
ReachFramework (42)
AlphaFlattener\BrushProxy.cs (18)
1198Debug.Assert(tileBrush.ViewportUnits == BrushMappingMode.Absolute); 1230Debug.Assert(tileBrush.ViewportUnits == BrushMappingMode.Absolute); 1390Debug.Assert(!_bounds.IsEmpty); 1398Debug.Assert(_brushList != null && _bounds.IsEmpty); 1736Debug.Assert(brush.ViewboxUnits == BrushMappingMode.Absolute); 1737Debug.Assert(brush.ViewportUnits == BrushMappingMode.Absolute); 1992Debug.Assert(g.GradientStops != null); 2047Debug.Assert(g.GradientStops.Count > 0); 3787Debug.Assert(false); // Optimization is needed before reaching here 3793Debug.Assert(false); // Optimization is needed before reaching here 3798Debug.Assert(steps > 0); 3838Debug.Assert((i >= 0) && (i < steps)); 3852Debug.Assert(false); 3949Debug.Assert(di >= 0); 4051Debug.Assert(_left <= left); 4052Debug.Assert(_right >= right); 4278Debug.Assert(_left <= left); 4279Debug.Assert(_right >= right);
AlphaFlattener\DrawingContext.cs (1)
479Debug.Assert(one != null);
AlphaFlattener\ImageProxy.cs (2)
63Debug.Assert(image != null); 135Debug.Assert(
AlphaFlattener\MetroDevice.cs (2)
452Debug.Assert(ticket != null); 496Debug.Assert(ticketXMLString == null);
AlphaFlattener\Optimizer.cs (1)
77Debug.Assert(GetPrimitiveIntersectAction() == PrimitiveIntersectAction.ClipToCluster);
AlphaFlattener\Primitive.cs (1)
751Debug.Assert(brush.ViewportUnits == BrushMappingMode.Absolute);
AlphaFlattener\SegmentTree.cs (1)
57Debug.Assert(count >= 2);
AlphaFlattener\Utility.cs (4)
1401Debug.Assert( 1748Debug.Assert(brush.ViewboxUnits == BrushMappingMode.Absolute); 1749Debug.Assert(brush.ViewportUnits == BrushMappingMode.Absolute); 2385Debug.Assert(!rect.IsEmpty);
MS\Internal\Printing\MostFrequentlyUsedCache.cs (1)
39Debug.Assert(this._dictionary.Count <= this._maxEntries);
PrintConfig\PTProvider.cs (1)
605Debug.Assert(resultLength >= 0);
Serialization\DrawingContextFlattener.cs (7)
148Debug.Assert(_fullTransform.Count == _fullClip.Count); 370Debug.Assert(visual != null); 484Debug.Assert(rHalfChord2 >= rFuzz2); // Otherewise we have no guarantee that the radius is not 0, 581Debug.Assert(cPieces > 0); 651Debug.Assert(rDot >= -rRadSquared * .1); // angle < 90 degrees 652Debug.Assert(rDot <= rRadSquared * 1.1); // as dot product of 2 radius vectors 897Debug.Assert(context != null);
Serialization\VisualSerializer.cs (1)
2014Debug.Assert(Utility.IsScaleTranslate(bitmapToDrawingTransform));
Serialization\VisualTreeFlattener.cs (2)
370Debug.Assert(treeWalkProgress != null); 385Debug.Assert(treeWalkProgress != null);
System.Collections (74)
src\libraries\Common\src\System\Collections\Generic\BitHelper.cs (2)
24Debug.Assert(bitPosition >= 0); 38Debug.Assert(bitPosition >= 0);
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (2)
103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
System\Collections\BitArray.cs (12)
97Debug.Assert(byteSpan.Length >= 0 && byteSpan.Length < 4); 227Debug.Assert(bits.m_array.Length <= arrayLength); 801Debug.Assert(span.Length > 0); 802Debug.Assert(m_array.Length > quotient); 997Debug.Assert(GetInt32ArrayLengthFromBitLength(m_length) > 0); 998Debug.Assert(intCount == GetInt32ArrayLengthFromBitLength(m_length) - 1); 1027Debug.Assert(GetInt32ArrayLengthFromBitLength(m_length) > 0); 1028Debug.Assert(intCount == GetInt32ArrayLengthFromBitLength(m_length) - 1); 1071Debug.Assert(n >= 0); 1077Debug.Assert(n >= 0); 1085Debug.Assert(n >= 0); 1178Debug.Assert(index >= _bitArray.m_length);
System\Collections\Generic\PriorityQueue.cs (10)
62Debug.Assert(Log2Arity > 0 && Math.Pow(2, Log2Arity) == Arity); 612Debug.Assert(_nodes.Length < minCapacity); 707Debug.Assert(_comparer is null); 708Debug.Assert(0 <= nodeIndex && nodeIndex < _size); 739Debug.Assert(_comparer is not null); 740Debug.Assert(0 <= nodeIndex && nodeIndex < _size); 773Debug.Assert(_comparer is null); 774Debug.Assert(0 <= nodeIndex && nodeIndex < _size); 821Debug.Assert(_comparer is not null); 822Debug.Assert(0 <= nodeIndex && nodeIndex < _size);
System\Collections\Generic\SortedList.cs (1)
158Debug.Assert(count == this.keys.Length);
System\Collections\Generic\SortedSet.cs (34)
96Debug.Assert(sortedSet.root != null); 355Debug.Assert(parent != null); 424Debug.Assert(parent.IsBlack); 448Debug.Assert(Node.IsNonNullBlack(sibling)); 609Debug.Assert(parent != null); 610Debug.Assert(grandParent != null); 659Debug.Assert(match != null); 664Debug.Assert(match.Right == null); 669Debug.Assert(parentOfSuccessor != null); 670Debug.Assert(successor.Left == null); 671Debug.Assert((successor.Right == null && successor.IsRed) || (successor.Right!.IsRed && successor.IsBlack)); 801Debug.Assert(set1 != null); 1139Debug.Assert(other != null); 1140Debug.Assert(HasEqualComparer(other)); 1145Debug.Assert(result); 1151Debug.Assert(other != null); 1152Debug.Assert(count >= 0 && count <= other.Length); 1168Debug.Assert(result); 1631Debug.Assert(count == GetCount()); 1665Debug.Assert(IsNonNullRed(sibling.Left) || IsNonNullRed(sibling.Right)); 1667Debug.Assert(HasChildren(current, sibling)); 1681Debug.Assert(node != null); 1682Debug.Assert(node == Left ^ node == Right); 1691Debug.Assert(Left != null); 1692Debug.Assert(Right != null); 1709Debug.Assert(removeRed.IsRed); 1714Debug.Assert(removeRed.IsRed); 1718Debug.Assert(Right!.Left!.IsRed); 1721Debug.Assert(Left!.Right!.IsRed); 1786Debug.Assert(IsRed); 1787Debug.Assert(Left!.Is2Node); 1788Debug.Assert(Right!.Is2Node); 1804Debug.Assert(HasChild(child)); 1824Debug.Assert(child1 != child2);
System\Collections\Generic\SortedSet.TreeSubSet.cs (8)
62Debug.Assert(this.versionUpToDate() && root == _underlying.FindRange(_min, _max)); 72Debug.Assert(versionUpToDate() && root == _underlying.FindRange(_min, _max)); 87Debug.Assert(versionUpToDate() && root == _underlying.FindRange(_min, _max)); 285Debug.Assert(this.versionUpToDate() && root == _underlying.FindRange(_min, _max)); 302Debug.Assert(this.versionUpToDate() && root == _underlying.FindRange(_min, _max)); 315Debug.Assert(_underlying != null); 335Debug.Assert(_underlying != null); 359Debug.Assert(versionUpToDate() && root == _underlying.FindRange(_min, _max));
System\Collections\Generic\Stack.cs (5)
111Debug.Assert(array != _array); 287Debug.Assert(_size == _array.Length); 315Debug.Assert(_array.Length < capacity); 348Debug.Assert(_size == 0); 409Debug.Assert(_index == -1 || _index == -2);
System.Collections.Concurrent (72)
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (2)
103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
System\Collections\Concurrent\BlockingCollection.cs (9)
212Debug.Assert(boundedCapacity > 0 || boundedCapacity == NON_BOUNDED); 226Debug.Assert(boundedCapacity > 0); 492Debug.Assert((_currentAdders & ~COMPLETE_ADDING_ON_MASK) > 0); 711Debug.Assert(_boundedCapacity != NON_BOUNDED); 998Debug.Assert((index == WaitHandle.WaitTimeout) || (index >= 0 && index < handles.Count)); 1033Debug.Assert(result); 1050Debug.Assert(collections != null); 1097Debug.Assert(originalWaitMillisecondsTimeout != Timeout.Infinite); 1396Debug.Assert((index == WaitHandle.WaitTimeout) || (index >= 0 && index < handles.Count));
System\Collections\Concurrent\ConcurrentBag.cs (20)
149Debug.Assert(Monitor.IsEntered(GlobalQueuesLock)); 304Debug.Assert(copied == count); 321Debug.Assert(Monitor.IsEntered(GlobalQueuesLock)); 392Debug.Assert(copied == count); 521Debug.Assert(count >= 0); 605Debug.Assert(_locals != null); 617Debug.Assert(!Monitor.IsEntered(GlobalQueuesLock)); 644Debug.Assert(Monitor.IsEntered(GlobalQueuesLock) == lockTaken); 724Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 750Debug.Assert(_headIndex - _tailIndex <= 0); 844Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 861Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 936Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 1027Debug.Assert(Monitor.IsEntered(this)); 1028Debug.Assert(_frozen); 1029Debug.Assert(array != null); 1030Debug.Assert(arrayIndex >= 0 && arrayIndex <= array.Length); 1039Debug.Assert(arrayIndex <= array.Length - count); 1060Debug.Assert(Monitor.IsEntered(this)); 1095Debug.Assert(array != null);
System\Collections\Concurrent\ConcurrentDictionary.cs (20)
258Debug.Assert(comparer is not null); 280Debug.Assert(comparer is not null); 424Debug.Assert((prev is null && curr == bucket) || prev!._next == curr); 497Debug.Assert(comparer is not null); 531Debug.Assert(comparer is not null); 593Debug.Assert(nullableHashcode is null || nullableHashcode == hashcode); 621Debug.Assert((prev is null && node == bucket) || prev!._next == node); 869Debug.Assert(buckets is not null); 906Debug.Assert(nullableHashcode is null || nullableHashcode == hashcode); 941Debug.Assert((prev is null && node == bucket) || prev!._next == node); 2049Debug.Assert(locksAcquired == _tables._locks.Length); 2062Debug.Assert(locksAcquired == 0); 2063Debug.Assert(!Monitor.IsEntered(locks[0])); 2079Debug.Assert(Monitor.IsEntered(locks[0])); 2080Debug.Assert(locksAcquired == 1); 2088Debug.Assert(locksAcquired == locks.Length); 2095Debug.Assert(locksAcquired >= 0); 2130Debug.Assert(i == count); 2166Debug.Assert(i == count); 2256Debug.Assert(typeof(TKey).IsValueType || comparer is not null);
System\Collections\Concurrent\PartitionerStatic.cs (21)
418Debug.Assert(_currentChunkSize == null); 423Debug.Assert(_currentChunkSize != null); 437Debug.Assert(_localOffset.Value == _currentChunkSize.Value - 1 || _currentChunkSize.Value == 0); 458Debug.Assert(requestedChunkSize > 0 && requestedChunkSize <= _maxChunkSize); 462Debug.Assert(_currentChunkSize.Value <= requestedChunkSize && _currentChunkSize.Value > 0); 743Debug.Assert(requestedChunkSize > 0); 782Debug.Assert(_sharedIndex != null); //already been allocated in MoveNext() before calling GrabNextChunk 913Debug.Assert(requestedChunkSize > 0); 950Debug.Assert(_localList != null); 951Debug.Assert(_localOffset!.Value >= 0 && _localOffset.Value < _currentChunkSize.Value); 1084Debug.Assert(requestedChunkSize > 0); 1088Debug.Assert(_sharedIndex != null); 1130Debug.Assert(_sharedIndex != null); 1221Debug.Assert(_localOffset!.Value >= 0 && _localOffset.Value < _currentChunkSize.Value); 1305Debug.Assert(_localOffset!.Value >= 0 && _localOffset.Value < _currentChunkSize.Value); 1488Debug.Assert(list != null); 1514Debug.Assert(startIndex >= 0 && endIndex <= list.Count - 1); 1528Debug.Assert(_offset >= _startIndex && _offset <= _endIndex); 1546Debug.Assert(array != null); 1571Debug.Assert(startIndex >= 0 && endIndex <= array.Length - 1); 1585Debug.Assert(_offset >= _startIndex && _offset <= _endIndex);
System.Collections.Immutable (162)
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (2)
103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
System\Collections\Frozen\FrozenDictionary.cs (5)
107Debug.Assert(newDictionary is not null); 108Debug.Assert(newDictionary.Comparer.Equals(comparer)); 171Debug.Assert(minLength >= 0 && maxLength >= minLength); 339Debug.Assert(keys.Length == values.Length); 576Debug.Assert(keys.Length == values.Length);
System\Collections\Frozen\FrozenHashTable.cs (8)
30Debug.Assert(hashCodes.Length != 0); 31Debug.Assert(buckets.Length != 0); 112Debug.Assert(count == hashtableHashcodes.Length); 148Debug.Assert(hashCodes.Length != 0); 149Debug.Assert(!hashCodesAreUnique || new HashSet<int>(hashCodes.ToArray()).Count == hashCodes.Length); 173Debug.Assert(uniqueCodesCount != 0); 209Debug.Assert(maxPrimeIndexExclusive != 0); 303Debug.Assert(count > 0);
System\Collections\Frozen\FrozenSet.cs (3)
55Debug.Assert(newSet is not null); 56Debug.Assert(newSet.Comparer.Equals(comparer)); 119Debug.Assert(minLength >= 0 && maxLength >= minLength);
System\Collections\Frozen\Int32\Int32FrozenDictionary.cs (2)
23Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<int>.Default)); 24Debug.Assert(source.Count != 0);
System\Collections\Frozen\Int32\Int32FrozenSet.cs (2)
21Debug.Assert(source.Count != 0); 22Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<int>.Default));
System\Collections\Frozen\ItemsFrozenSet.cs (1)
19Debug.Assert(source.Count != 0);
System\Collections\Frozen\KeysAndValuesFrozenDictionary.cs (1)
20Debug.Assert(source.Count != 0);
System\Collections\Frozen\SmallFrozenDictionary.cs (1)
26Debug.Assert(source.Count != 0);
System\Collections\Frozen\SmallValueTypeComparableFrozenDictionary.cs (5)
27Debug.Assert(default(TKey) is IComparable<TKey>); 28Debug.Assert(default(TKey) is not null); 29Debug.Assert(typeof(TKey).IsValueType); 31Debug.Assert(source.Count != 0); 32Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<TKey>.Default));
System\Collections\Frozen\SmallValueTypeComparableFrozenSet.cs (5)
25Debug.Assert(default(T) is IComparable<T>); 26Debug.Assert(default(T) is not null); 27Debug.Assert(typeof(T).IsValueType); 29Debug.Assert(source.Count != 0); 30Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<T>.Default));
System\Collections\Frozen\SmallValueTypeDefaultComparerFrozenDictionary.cs (4)
20Debug.Assert(default(TKey) is not null); 21Debug.Assert(typeof(TKey).IsValueType); 23Debug.Assert(source.Count != 0); 24Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<TKey>.Default));
System\Collections\Frozen\SmallValueTypeDefaultComparerFrozenSet.cs (4)
18Debug.Assert(default(T) is not null); 19Debug.Assert(typeof(T).IsValueType); 21Debug.Assert(source.Count != 0); 22Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<T>.Default));
System\Collections\Frozen\String\Hashing.cs (1)
80Debug.Assert(KeyAnalyzer.IsAllAscii(s));
System\Collections\Frozen\String\KeyAnalyzer.cs (2)
34Debug.Assert(!uniqueStrings.IsEmpty); 246Debug.Assert(IsAllAscii(s));
System\Collections\Frozen\String\LengthBuckets.cs (2)
19Debug.Assert(comparer == EqualityComparer<string>.Default || comparer == StringComparer.Ordinal || comparer == StringComparer.OrdinalIgnoreCase); 20Debug.Assert(minLength >= 0 && maxLength >= minLength);
System\Collections\Frozen\String\LengthBucketsFrozenDictionary.cs (2)
23Debug.Assert(comparer == EqualityComparer<string>.Default || comparer == StringComparer.Ordinal || comparer == StringComparer.OrdinalIgnoreCase); 35Debug.Assert(keys.Length != 0 && keys.Length == values.Length);
System\Collections\Frozen\String\LengthBucketsFrozenSet.cs (2)
21Debug.Assert(comparer == EqualityComparer<string>.Default || comparer == StringComparer.Ordinal || comparer == StringComparer.OrdinalIgnoreCase); 32Debug.Assert(items.Length != 0);
System\Collections\Frozen\String\OrdinalStringFrozenDictionary.cs (2)
30Debug.Assert(keys.Length != 0 && keys.Length == values.Length); 31Debug.Assert(comparer == EqualityComparer<string>.Default || comparer == StringComparer.Ordinal || comparer == StringComparer.OrdinalIgnoreCase);
System\Collections\Frozen\ValueTypeDefaultComparerFrozenDictionary.cs (2)
18Debug.Assert(typeof(TKey).IsValueType); 19Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<TKey>.Default));
System\Collections\Frozen\ValueTypeDefaultComparerFrozenSet.cs (2)
15Debug.Assert(typeof(T).IsValueType); 16Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<T>.Default));
System\Collections\Immutable\ImmutableArray_1.Builder.cs (1)
1085Debug.Assert(lastIndexRemoved < indexToRemove);
System\Collections\Immutable\ImmutableArray_1.cs (4)
1496Debug.Assert(indexToRemove > lastIndexRemoved); // We require that the input be a sorted set. 1510Debug.Assert(array != null); 1511Debug.Assert(!IsEmpty); 1512Debug.Assert(!items.IsEmpty);
System\Collections\Immutable\ImmutableExtensions.Minimal.cs (3)
101Debug.Assert(sequence != null); 102Debug.Assert(array != null); 103Debug.Assert(arrayIndex >= 0 && arrayIndex <= array.Length);
System\Collections\Immutable\ImmutableHashSet_1.cs (2)
440Debug.Assert(result != null); 638Debug.Assert(result == OperationResult.SizeChanged);
System\Collections\Immutable\ImmutableList_1.Enumerator.cs (2)
201Debug.Assert(_stack != null); 275Debug.Assert(_stack != null);
System\Collections\Immutable\ImmutableList_1.Node.cs (31)
71Debug.Assert(this.IsEmpty); 86Debug.Assert(!frozen || (left._frozen && right._frozen)); 95Debug.Assert(!this.IsEmpty); 108Debug.Assert(!(_left == null ^ _right == null)); 173Debug.Assert(_left != null && _right != null); 203Debug.Assert(_left != null && _right != null); 421Debug.Assert(_left != null && _right != null); 508Debug.Assert(result != null); 521Debug.Assert(!this.IsEmpty); 1299Debug.Assert(!this.IsEmpty); 1300Debug.Assert(!_right!.IsEmpty); 1311Debug.Assert(!this.IsEmpty); 1312Debug.Assert(!_left!.IsEmpty); 1323Debug.Assert(!this.IsEmpty); 1324Debug.Assert(!_right!.IsEmpty); 1325Debug.Assert(!_right!._left!.IsEmpty); 1341Debug.Assert(!this.IsEmpty); 1342Debug.Assert(!_left!.IsEmpty); 1343Debug.Assert(!_left._right!.IsEmpty); 1363Debug.Assert(!this.IsEmpty); 1404Debug.Assert(!this.IsEmpty); 1405Debug.Assert(this.IsLeftHeavy); 1416Debug.Assert(!this.IsEmpty); 1417Debug.Assert(this.IsRightHeavy); 1433Debug.Assert(tree._left != null && tree._right != null); 1439Debug.Assert(tree._left != null); 1445Debug.Assert(tree._right != null); 1466Debug.Assert(!this.IsEmpty); 1491Debug.Assert(!this.IsEmpty); 1515Debug.Assert(!this.IsEmpty); 1555Debug.Assert(!this.IsEmpty);
System\Collections\Immutable\ImmutableQueue_1.cs (7)
52Debug.Assert(forwards != null); 53Debug.Assert(backwards != null); 64Debug.Assert(s_EmptyField.IsEmpty); 78Debug.Assert(!_forwards.IsEmpty || _backwards.IsEmpty); 90Debug.Assert(s_EmptyField.IsEmpty); 100Debug.Assert(s_EmptyField.IsEmpty); 116Debug.Assert(_backwardsReversed != null);
System\Collections\Immutable\ImmutableSortedDictionary_2.cs (1)
841Debug.Assert(this.IsEmpty);
System\Collections\Immutable\ImmutableSortedDictionary_2.Enumerator.cs (1)
210Debug.Assert(_stack != null);
System\Collections\Immutable\ImmutableSortedDictionary_2.Node.cs (13)
65Debug.Assert(this.IsEmpty); 82Debug.Assert(!frozen || (left._frozen && right._frozen)); 91Debug.Assert(!this.IsEmpty); 492Debug.Assert(!tree.IsEmpty); 511Debug.Assert(!tree.IsEmpty); 530Debug.Assert(!tree.IsEmpty); 549Debug.Assert(!tree.IsEmpty); 568Debug.Assert(!tree.IsEmpty); 583Debug.Assert(!tree.IsEmpty); 593Debug.Assert(!tree.IsEmpty); 605Debug.Assert(!tree.IsEmpty); 730Debug.Assert(_right != null && _left != null); 797Debug.Assert(_left != null && _right != null);
System\Collections\Immutable\ImmutableSortedSet_1.cs (4)
247Debug.Assert(newSet != null); 371Debug.Assert(result != null); 1156Debug.Assert(list.Count > 0); 1214Debug.Assert(list.Count > 0);
System\Collections\Immutable\ImmutableSortedSet_1.Node.cs (18)
70Debug.Assert(this.IsEmpty); 85Debug.Assert(!frozen || (left._frozen && right._frozen)); 239Debug.Assert(_left != null && _right != null); 269Debug.Assert(_left != null && _right != null); 428Debug.Assert(_left != null && _right != null); 508Debug.Assert(_left != null && _right != null); 563Debug.Assert(_left != null && _right != null); 616Debug.Assert(!tree.IsEmpty); 635Debug.Assert(!tree.IsEmpty); 654Debug.Assert(!tree.IsEmpty); 673Debug.Assert(!tree.IsEmpty); 692Debug.Assert(!tree.IsEmpty); 707Debug.Assert(!tree.IsEmpty); 717Debug.Assert(!tree.IsEmpty); 729Debug.Assert(!tree.IsEmpty); 756Debug.Assert(start >= 0); 757Debug.Assert(length >= 0); 780Debug.Assert(_left != null && _right != null);
System\Collections\Immutable\ImmutableStack_1.cs (6)
54Debug.Assert(tail != null); 67Debug.Assert(s_EmptyField.IsEmpty); 77Debug.Assert(s_EmptyField.IsEmpty); 166Debug.Assert(_tail != null); 240Debug.Assert(r != null); 241Debug.Assert(r.IsEmpty == IsEmpty);
System\Collections\Immutable\SortedInt32KeyNode.cs (11)
83Debug.Assert(!frozen || (left._frozen && right._frozen)); 283Debug.Assert(!tree.IsEmpty); 302Debug.Assert(!tree.IsEmpty); 321Debug.Assert(!tree.IsEmpty); 340Debug.Assert(!tree.IsEmpty); 359Debug.Assert(!tree.IsEmpty); 374Debug.Assert(!tree.IsEmpty); 384Debug.Assert(!tree.IsEmpty); 396Debug.Assert(!tree.IsEmpty); 489Debug.Assert(_right != null && _left != null); 556Debug.Assert(_right != null && _left != null);
System.Collections.Specialized (14)
System\Collections\Specialized\HybridDictionary.cs (3)
101Debug.Assert(hashtable != null); 121Debug.Assert(list != null); 242Debug.Assert(hashtable != null);
System\Collections\Specialized\ListDictionary.cs (1)
256Debug.Assert(last != null);
System\Collections\Specialized\NameValueCollection.cs (2)
118Debug.Assert(list != null); 123Debug.Assert(list != null);
System\Collections\Specialized\OrderedDictionary.cs (8)
59Debug.Assert(dictionary != null); 465Debug.Assert(_arrayEnumerator.Current != null); 485Debug.Assert(_arrayEnumerator.Current != null); 497Debug.Assert(_arrayEnumerator.Current != null); 509Debug.Assert(_arrayEnumerator.Current != null); 563Debug.Assert(o != null); 584Debug.Assert(_objectsTable is not null); 590Debug.Assert(o != null);
System.ComponentModel.Annotations (9)
System\ComponentModel\DataAnnotations\MaxLengthAttribute.cs (1)
119Debug.Assert(value != null);
System\ComponentModel\DataAnnotations\ValidationAttribute.cs (3)
106Debug.Assert(_defaultErrorMessage is null && _errorMessageResourceName is null && _errorMessage is null && _errorMessageResourceType is null); 264Debug.Assert(_errorMessageResourceType != null); 265Debug.Assert(!string.IsNullOrEmpty(_errorMessageResourceName));
System\ComponentModel\DataAnnotations\ValidationAttributeStore.cs (2)
120Debug.Assert(type != null); 271Debug.Assert(propertyType != null);
System\ComponentModel\DataAnnotations\Validator.cs (3)
338Debug.Assert(validationContext != null); 408Debug.Assert(instance != null); 613Debug.Assert(validationContext != null);
System.ComponentModel.Composition (53)
Microsoft\Internal\Collections\CollectionServices.cs (1)
147Debug.Assert(value != null);
Microsoft\Internal\GenerationServices.cs (11)
71Debug.Assert(ilGenerator != null); 171Debug.Assert(ilGenerator != null); 190Debug.Assert(ilGenerator != null); 207Debug.Assert(ilGenerator != null); 218Debug.Assert(ilGenerator != null); 280Debug.Assert(ilGenerator != null); 294Debug.Assert(ilGenerator != null); 301Debug.Assert(ilGenerator != null); 308Debug.Assert(ilGenerator != null); 315Debug.Assert(ilGenerator != null); 322Debug.Assert(ilGenerator != null);
Microsoft\Internal\ReflectionServices.cs (5)
23Debug.Assert(member.DeclaringType != null); 34Debug.Assert(field.DeclaringType != null); 40Debug.Assert(method.DeclaringType != null); 134Debug.Assert(baseType != null); 158Debug.Assert(baseType != null);
System\ComponentModel\Composition\AttributedModelServices.cs (3)
144Debug.Assert(part != null); 186Debug.Assert(part != null); 218Debug.Assert(part != null);
System\ComponentModel\Composition\Hosting\AggregateCatalog.cs (1)
170Debug.Assert(_catalogs != null);
System\ComponentModel\Composition\Hosting\AggregateExportProvider.cs (2)
130Debug.Assert(_readOnlyProviders != null); 181Debug.Assert(exports != null);
System\ComponentModel\Composition\Hosting\AssemblyCatalog.cs (1)
470Debug.Assert(_assembly != null);
System\ComponentModel\Composition\Hosting\CatalogExportProvider.cs (2)
116Debug.Assert(_catalog != null); 727Debug.Assert(_importEngine != null);
System\ComponentModel\Composition\Hosting\CatalogExportProvider.ScopeFactoryExport.cs (1)
55Debug.Assert(childContainer.CatalogExportProvider != null);
System\ComponentModel\Composition\Hosting\ComposablePartCatalogChangeEventArgs.cs (2)
63Debug.Assert(_addedDefinitions != null); 80Debug.Assert(_removedDefinitions != null);
System\ComponentModel\Composition\Hosting\CompositionBatch.cs (2)
77Debug.Assert(_readOnlyPartsToAdd != null); 94Debug.Assert(_readOnlyPartsToRemove != null);
System\ComponentModel\Composition\Hosting\CompositionContainer.cs (1)
287Debug.Assert(_providers != null);
System\ComponentModel\Composition\Hosting\CompositionScopeDefinition.cs (2)
151Debug.Assert(_catalog != null); 183Debug.Assert(_catalog != null);
System\ComponentModel\Composition\Hosting\DirectoryCatalog.cs (3)
396Debug.Assert(_fullPath != null); 411Debug.Assert(_loadedFiles != null); 424Debug.Assert(_path != null);
System\ComponentModel\Composition\Hosting\ExportProvider.cs (1)
105Debug.Assert(exports != null);
System\ComponentModel\Composition\Hosting\ExportsChangeEventArgs.cs (2)
66Debug.Assert(_addedExports != null); 83Debug.Assert(_removedExports != null);
System\ComponentModel\Composition\Hosting\FilteredCatalog.DependenciesTraversal.cs (1)
66Debug.Assert(_exportersIndex != null);
System\ComponentModel\Composition\Hosting\FilteredCatalog.DependentsTraversal.cs (1)
70Debug.Assert(_importersIndex != null);
System\ComponentModel\Composition\Hosting\ImportSourceImportDefinitionHelpers.cs (1)
58Debug.Assert(reply != null);
System\ComponentModel\Composition\MetadataViewProvider.cs (1)
47Debug.Assert(implementationAttribute != null);
System\ComponentModel\Composition\Primitives\ComposablePartCatalog.cs (1)
116Debug.Assert(exports != null || _EmptyExportsList != null);
System\ComponentModel\Composition\Primitives\ContractBasedImportDefinition.cs (1)
215Debug.Assert(_requiredMetadata != null);
System\ComponentModel\Composition\Primitives\Export.cs (1)
173Debug.Assert(Definition.Metadata != null);
System\ComponentModel\Composition\Primitives\ExportDefinition.cs (1)
119Debug.Assert(_metadata != null);
System\ComponentModel\Composition\Primitives\ImportDefinition.cs (2)
133Debug.Assert(_contractName != null); 163Debug.Assert(_metadata != null);
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePart.cs (2)
353Debug.Assert(member != null); 478Debug.Assert(import != null);
System\ComponentModel\Composition\ReflectionModel\ReflectionModelServices.cs (1)
85Debug.Assert(reflectionParameterImportDefinition.ImportingLazyParameter != null);
System.ComponentModel.TypeConverter (23)
src\libraries\Common\src\System\Drawing\ColorConverterCommon.cs (2)
14Debug.Assert(culture != null); 105Debug.Assert(culture != null);
System\ComponentModel\BindingList.cs (1)
519Debug.Assert(_itemTypeProperties != null);
System\ComponentModel\CultureInfoConverter.cs (4)
184Debug.Assert(invariantIndex >= 0 && invariantIndex < installedCultures.Length); 195Debug.Assert(array[0] == null); 232Debug.Assert(cultureConverter != null); 551Debug.Assert(result.Count == Count);
System\ComponentModel\Design\DesigntimeLicenseContextSerializer.cs (1)
96Debug.Assert(_readFirstByte);
System\ComponentModel\Design\PropertyTabAttribute.cs (1)
102Debug.Assert(_tabClassNames != null);
System\ComponentModel\Design\Serialization\MemberRelationshipService.cs (2)
49Debug.Assert(source.Member != null); 62Debug.Assert(source.Member != null);
System\ComponentModel\ExtenderProvidedPropertyAttribute.cs (4)
69Debug.Assert(other.Provider == null); 70Debug.Assert(other.ReceiverType == null); 71Debug.Assert(Provider == null); 72Debug.Assert(ReceiverType == null);
System\ComponentModel\Int128Converter.cs (2)
25Debug.Assert(radix == 16); 26Debug.Assert(value is not null);
System\ComponentModel\InterlockedBitVector32.cs (1)
43Debug.Assert(previous != unchecked((int)0x80000000));
System\ComponentModel\ReflectTypeDescriptionProvider.cs (3)
935Debug.Assert(td != null); 943Debug.Assert(td != null); 1611Debug.Assert(callingType != typeof(Uri) && callingType != typeof(CultureInfo));
System\ComponentModel\UInt128Converter.cs (2)
25Debug.Assert(radix == 16); 26Debug.Assert(value is not null);
System.Composition.Hosting (1)
System\Composition\Hosting\CompositionHost.cs (1)
27Debug.Assert(rootLifetimeContext != null);
System.Composition.Runtime (2)
System\Composition\Runtime\Util\Formatters.cs (2)
24Debug.Assert(closedGenericType != null); 25Debug.Assert(closedGenericType.IsConstructedGenericType);
System.Console (43)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
13Debug.Assert(errorInfo.Error != Error.SUCCESS);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
69Debug.Assert(passwd.Name != null);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (1)
101Debug.Assert(passwd.HomeDirectory != null);
System\Console.cs (3)
198Debug.Assert(!Monitor.IsEntered(s_syncObject)); 603Debug.Assert(s_sigQuitRegistration is null); 999Debug.Assert(ctx.Signal == PosixSignal.SIGINT || ctx.Signal == PosixSignal.SIGQUIT);
System\ConsolePal.Unix.cs (11)
256Debug.Assert(left >= 0); 446Debug.Assert(!Console.IsInputRedirected); 489Debug.Assert(!string.IsNullOrEmpty(TerminalFormatStrings.CursorPositionReport)); 526Debug.Assert(readBytesPos > 0 && readBytesPos <= readBytes.Length); 527Debug.Assert(escPos == 0 && bracketPos > escPos && semiPos > bracketPos && rPos > semiPos); 528Debug.Assert(readBytes[escPos] == Esc); 529Debug.Assert(readBytes[bracketPos] == '['); 530Debug.Assert(readBytes[semiPos] == ';'); 531Debug.Assert(readBytes[rPos] == 'R'); 953Debug.Assert(result <= buffer.Length); 961Debug.Assert(handle is not null);
System\IO\ConsoleStream.cs (1)
18Debug.Assert(access == FileAccess.Read || access == FileAccess.Write);
System\IO\KeyParser.cs (3)
21Debug.Assert(length > 0); 370Debug.Assert(single != 'b' && single != '\t' && single != '\n' && single != '\r'); 383Debug.Assert(single == default || char.IsBetween(single, (char)28, (char)31));
System\IO\StdInReader.cs (7)
37Debug.Assert(!Console.IsInputRedirected); // stdin is a terminal. 75Debug.Assert(_endIndex > 0); 91Debug.Assert(result >= 0 && result <= bufferSize); // may be 0 if hits EOL 130Debug.Assert(!buffer.IsEmpty); 151Debug.Assert(_tmpKeys.Count == 0); 152Debug.Assert(consumeKeys || _availableKeys.Count == 0); 340Debug.Assert(_availableKeys.Count == 0);
System\IO\SyncTextReader.cs (1)
20Debug.Assert(reader != null);
System\IO\SyncTextReader.Unix.cs (1)
18Debug.Assert(inner != null);
System\TermInfo.cs (5)
188Debug.Assert(char.IsAsciiDigit(format[pos])); 199Debug.Assert(char.IsAsciiDigit(format[pos])); 207Debug.Assert(format[pos + 2] == '\''); 298Debug.Assert(format[pos] == 'e' || format[pos] == ';'); 361Debug.Assert(arg is string || arg is int);
System\TermInfo.Database.cs (3)
110Debug.Assert(index >= 0); 135Debug.Assert(name != null); 147Debug.Assert(index >= 0);
System.Data.Common (370)
System\Data\Common\DataStorage.cs (1)
377Debug.Assert(storageType != StorageType.Empty);
System\Data\Common\DbConnectionStringBuilder.cs (4)
147Debug.Assert(keyword != null); 444Debug.Assert(reflected != null); 473Debug.Assert(keyword != null); 558Debug.Assert(property != null);
System\Data\Common\DbDataAdapter.cs (1)
1366Debug.Assert(rowUpdatedEvent.Rows != null);
System\Data\Common\DbDataReaderExtensions.cs (1)
80Debug.Assert(row != null);
System\Data\Common\DbDataSource.cs (2)
103Debug.Assert(wrappedCommand.Connection is not null); 362Debug.Assert(wrappedBatch.Connection is not null);
System\Data\Common\FieldNameLookup.cs (1)
31Debug.Assert(null != fieldNames[i]);
System\Data\ConstraintCollection.cs (3)
32Debug.Assert(table != null); 667Debug.Assert(name != null); 795Debug.Assert(constr._parentTableName != null);
System\Data\DataColumn.cs (4)
405Debug.Assert(!string.IsNullOrEmpty(_encodedColumnName)); 455Debug.Assert(value != null); 1095Debug.Assert(table != null || !Unique); 1821Debug.Assert(_table != null);
System\Data\DataColumnCollection.cs (1)
821Debug.Assert(name != null);
System\Data\DataRelation.cs (1)
716Debug.Assert(destination != null);
System\Data\DataRelationCollection.cs (2)
399Debug.Assert(name != null); 628Debug.Assert(relation != null);
System\Data\DataRowComparer.cs (5)
96Debug.Assert(!ReferenceEquals(a, b)); 97Debug.Assert(a != null); 98Debug.Assert(b != null); 99Debug.Assert(a.Length == b.Length); 186Debug.Assert(row.Table != null);
System\Data\DataSet.cs (4)
318Debug.Assert(info != null); 2952Debug.Assert(dataSet != null); 2970Debug.Assert(dataSet != null); 3022Debug.Assert(table != null);
System\Data\DataTable.cs (19)
519Debug.Assert(DataSet != null); 549Debug.Assert(fk != null); 620Debug.Assert(con.Equals("F")); 863Debug.Assert(bitStates != null); 864Debug.Assert(bitStates.Length > bitIndex); 894Debug.Assert(Rows.Count > rowIndex); 895Debug.Assert(rowErrors != null); 896Debug.Assert(colErrors != null); 925Debug.Assert(Rows.Count > rowIndex); 926Debug.Assert(rowErrors != null); 927Debug.Assert(colErrors != null); 940Debug.Assert(columnsInError.Length == columnErrors.Length); 2138Debug.Assert(ndx != null); 3368Debug.Assert(key.HasValue); 5031Debug.Assert(result.Max >= result.Min); 6550Debug.Assert(DataSet != null); 6772Debug.Assert(table != null); 6823Debug.Assert(ds != null); 7015Debug.Assert(column._table != null);
System\Data\DataTableCollection.cs (1)
737Debug.Assert(name != null);
System\Data\EnumerableRowCollection.cs (1)
280Debug.Assert(pred != null);
System\Data\EnumerableRowCollectionExtensions.cs (1)
153Debug.Assert(source != null);
System\Data\Filter\BinaryNode.cs (1)
144Debug.Assert(IsConstant());
System\Data\ForeignKeyConstraint.cs (4)
260Debug.Assert(row.Table.DataSet != null); 360Debug.Assert(row.Table.DataSet != null); 405Debug.Assert(Table?.DataSet != null && row.Table.DataSet != null); 498Debug.Assert(Table?.DataSet != null);
System\Data\LinqDataView.cs (1)
111Debug.Assert(base.Sort != null);
System\Data\Merger.cs (4)
45Debug.Assert(_dataSet != null); 234Debug.Assert(_dataSet != null); 469Debug.Assert(_dataSet != null); 521Debug.Assert(_dataSet != null);
System\Data\ProviderBase\SchemaMapping.cs (8)
310Debug.Assert(_readerDataValues != null); 566Debug.Assert(_dataTable != null); 567Debug.Assert(_fieldNames != null); 568Debug.Assert(_tableMapping != null); 762Debug.Assert(_dataTable != null); 763Debug.Assert(_schemaTable != null); 764Debug.Assert(_fieldNames != null); 765Debug.Assert(_tableMapping != null);
System\Data\Select.cs (12)
60Debug.Assert(_candidateColumns != null); 183Debug.Assert(_candidateColumns != null); 237Debug.Assert(_candidateColumns != null); 316Debug.Assert(_candidateColumns != null); 475Debug.Assert(_candidateColumns != null); 515Debug.Assert(_candidateColumns != null); 718Debug.Assert(_index != null && _candidateColumns != null); 754Debug.Assert(_index != null); 773Debug.Assert(_index != null); 791Debug.Assert(_index != null); 810Debug.Assert(_index != null); 839Debug.Assert(_index != null);
System\Data\Selection.cs (1)
113Debug.Assert(indexFields != null);
System\Data\SortExpressionBuilder.cs (6)
52Debug.Assert(keySelector != null); 53Debug.Assert(compare != null); 64Debug.Assert(_currentSelector != null); 65Debug.Assert(_currentComparer != null); 97Debug.Assert(a != null && b != null && a.Count == Count); 119Debug.Assert(_selectors.Count == _comparers.Count);
System\Data\SQLTypes\SQLBinary.cs (3)
42Debug.Assert(!copy); 374Debug.Assert(length >= 0); 379Debug.Assert(rgbValue.Length >= length);
System\Data\SQLTypes\SQLBoolean.cs (1)
131Debug.Assert(x.m_value == x_Null);
System\Data\SQLTypes\SQLBytes.cs (5)
460Debug.Assert(_state >= SqlBytesCharsState.Null && _state <= SqlBytesCharsState.Stream); 467Debug.Assert((_lCurLen >= 0 && _lCurLen <= x_lMaxLen) || FStream()); 468Debug.Assert(FStream() || (_rgbBuf != null && _lCurLen <= _rgbBuf.Length)); 469Debug.Assert(!FStream() || (_lCurLen == x_lNull)); 478Debug.Assert(FStream());
System\Data\SQLTypes\SQLChars.cs (6)
425Debug.Assert(_state >= SqlBytesCharsState.Null && _state <= SqlBytesCharsState.Stream); 432Debug.Assert((_lCurLen >= 0 && _lCurLen <= x_lMaxLen) || FStream()); 433Debug.Assert(FStream() || (_rgchBuf != null && _lCurLen <= _rgchBuf.Length)); 434Debug.Assert(!FStream() || (_lCurLen == x_lNull)); 436Debug.Assert(_rgchWorkBuf == null || _rgchWorkBuf.Length == 1); 450Debug.Assert(FStream());
System\Data\SQLTypes\SQLDateTime.cs (2)
121Debug.Assert(timeticks == s_maxTime + 1); 242Debug.Assert(time == s_maxTime + 1);
System\Data\SQLTypes\SQLDecimal.cs (22)
786Debug.Assert(rglData.Length >= 4); 834Debug.Assert(!IsNull); 840Debug.Assert(!IsNull); 1252Debug.Assert(ResInteger <= MaxPrecision); 1256Debug.Assert(ResScale <= MaxScale); 1265Debug.Assert(ResPrec - ResInteger >= 0); 1315Debug.Assert(dwlAccum < s_ulInt32Base); 1515Debug.Assert(dwlAccum < s_ulInt32Base * 2); 1518Debug.Assert(dwlAccum < s_ulInt32Base); // can never final accum > 1 more UI4 1534Debug.Assert(s_NUMERIC_MAX_PRECISION == ResPrec); 2096Debug.Assert(Prec == 9 || Prec == 18 || Prec == 27); 2168Debug.Assert(dwlAccum < s_ulInt32Base); 2237Debug.Assert(dwlAccum < dwlDivisor); 2239Debug.Assert((dwlAccum / dwlDivisor) < s_ulInt32Base); 2266Debug.Assert(dwlAccum < s_ulInt32Base); 2504Debug.Assert(iulX > s_uiZero); 2537Debug.Assert(rgulU.Length == s_cNumeMax); 2605Debug.Assert(rgulU.Length == s_cNumeMax); 2606Debug.Assert(rgulD.Length == s_cNumeMax); 3018Debug.Assert(uiDigit < 10); 3025Debug.Assert(rguiData.Length == 4); 3034Debug.Assert(_bPrec >= 1);
System\Data\SQLTypes\SQLGuid.cs (4)
118Debug.Assert(!x.IsNull); 119Debug.Assert(!y.IsNull); 124Debug.Assert(xWrote); 128Debug.Assert(yWrote);
System\Data\SQLTypes\SQLInt64.cs (2)
164Debug.Assert(lHigh2 == 0); 171Debug.Assert(lHigh1 == 0);
System\Data\SQLTypes\SQLMoney.cs (1)
83Debug.Assert(snum.Scale == s_iMoneyScale);
System\Data\SQLTypes\SQLString.cs (4)
263Debug.Assert(!IsNull); 728Debug.Assert(cbX % 2 == 0); 729Debug.Assert(cbY % 2 == 0); 775Debug.Assert(!x.IsNull && !y.IsNull);
System\Data\TypeLimiter.cs (4)
25Debug.Assert(scope != null); 200Debug.Assert(allowedTypes != null); 223Debug.Assert(type != null); 265Debug.Assert(type != null);
System\Data\xmlsaver.cs (11)
1016Debug.Assert(ds == null || dt == null); 1017Debug.Assert(_dsElement != null); 1236Debug.Assert(_prefixes != null); 1417Debug.Assert(_prefixes != null); 1418Debug.Assert(_dc != null); 1719Debug.Assert(_prefixes != null); 1720Debug.Assert(_dc != null); 1721Debug.Assert(_dsElement != null); 2789Debug.Assert(_ds != null || _dt != null); 2832Debug.Assert(_ds != null || _dt != null); 2924Debug.Assert(_xmlw != null);
System\Xml\DataPointer.cs (22)
52Debug.Assert(rowElem != null); 53Debug.Assert(rowElem.Row != null); 71Debug.Assert(rowElem.Row != null); 85Debug.Assert(_node == _doc || _node.OwnerDocument == _doc); 96Debug.Assert(node == _doc || node.OwnerDocument == _doc); 107Debug.Assert(node == _doc || node.OwnerDocument == _doc); 414Debug.Assert(name != null); 472Debug.Assert(name != null); 704Debug.Assert(_column == null); 709Debug.Assert(_column == null); 714Debug.Assert(_column == null); 731Debug.Assert(_column == null); 736Debug.Assert(_column == null); 741Debug.Assert(_column == null); 755Debug.Assert(_column == null); 779Debug.Assert(_column == null); 800Debug.Assert(_column == null); 821Debug.Assert(_column == null); 842Debug.Assert(rowElem != null); 845Debug.Assert(row != null); 852Debug.Assert(!Convert.IsDBNull(row[_column, rowVersion])); 855Debug.Assert((_column.ColumnMapping == MappingType.SimpleContent) ? _fOnValue : true);
System\Xml\DataSetMappper.cs (10)
32Debug.Assert(_dataSet == null); 89Debug.Assert(elem != null); 103Debug.Assert(rowElem.Row != null); 117Debug.Assert(a.Prefix != null && a.Prefix.Length == 0); 118Debug.Assert(a.NamespaceURI == (object)strReservedXmlns); 122Debug.Assert(a.NamespaceURI == (object)strReservedXmlns); 126Debug.Assert(a.NamespaceURI == (object)strReservedXmlns); 151Debug.Assert(rowElem != null); 153Debug.Assert((node is XmlBoundElement) ? ((XmlBoundElement)node).Row == null : true); 241Debug.Assert(rowElem.Row != null);
System\Xml\RegionIterator.cs (17)
25Debug.Assert(rowElement != null && rowElement.Row != null); 39Debug.Assert(oldState != ElementState.None); 48Debug.Assert(CurrentNode != null); 50Debug.Assert((oldState == ElementState.Defoliated) ? (_rowElement.ElementState == ElementState.Defoliated) : true); 72Debug.Assert(oldState != ElementState.None); 80Debug.Assert((oldState == ElementState.Defoliated) ? (_rowElement.ElementState == ElementState.Defoliated) : true); 83Debug.Assert(CurrentNode != null); 98Debug.Assert((oldState == ElementState.Defoliated) ? (_rowElement.ElementState == ElementState.Defoliated) : true); 105Debug.Assert(nextNode.NextSibling != null); 109Debug.Assert((oldState == ElementState.Defoliated) ? (_rowElement.ElementState == ElementState.Defoliated) : true); 113Debug.Assert(CurrentNode != null); 122Debug.Assert(CurrentNode != null); 123Debug.Assert(CurrentNode.NodeType == XmlNodeType.Element); 138Debug.Assert(oldState != ElementState.None); 145Debug.Assert((oldState == ElementState.Defoliated) ? (_rowElement.ElementState == ElementState.Defoliated) : true); 151Debug.Assert(!XmlDataDocument.IsTextLikeNode(n)); 155Debug.Assert((oldState == ElementState.Defoliated) ? (_rowElement.ElementState == ElementState.Defoliated) : true);
System\Xml\TreeIterator.cs (2)
18Debug.Assert(nodeTop != null); 72Debug.Assert(nextNode.NextSibling != null);
System\Xml\XmlBoundElement.cs (4)
251Debug.Assert(element is XmlBoundElement); 296Debug.Assert(dp.NodeType == XmlNodeType.Element); 337Debug.Assert(dp.NodeType == XmlNodeType.Element); 412Debug.Assert(((IXmlDataVirtualNode)dp).IsOnColumn(null));
System\Xml\XmlDataDocument.cs (129)
55Debug.Assert(_pointers.ContainsValue(pointer) == false); 65Debug.Assert(temp != null); 102Debug.Assert(_dataSet == null); 103Debug.Assert(ds != null); 196Debug.Assert(_ignoreXmlEvents); 212Debug.Assert(DocumentElement == null || !fLoadFromDataSet); 246Debug.Assert(_fDataRowCreatedSpecial == false); 247Debug.Assert(_fBoundToDataSet == false && _fBoundToDocument == false); 255Debug.Assert(_fDataRowCreatedSpecial); 275Debug.Assert(_dataSet != null); 356Debug.Assert((_fBoundToDataSet == false) && (_fBoundToDocument == false)); 358Debug.Assert(_fBoundToDataSet ? _fBoundToDocument : (!_fBoundToDocument)); 372Debug.Assert(_fDataRowCreatedSpecial == false); 386Debug.Assert(be != null); 414Debug.Assert(rowElem.Row != null); 447Debug.Assert(_mapper.GetColumnSchemaForNode(rowElem, node) != null); 456Debug.Assert((node is XmlBoundElement) && (((XmlBoundElement)node).Row != null)); 505Debug.Assert(_ignoreXmlEvents); 507Debug.Assert(GetRowFromElement(DocumentElement) != null); 515Debug.Assert(docElem.LastChild == docElem.FirstChild); 534Debug.Assert(!_mapper.IsMapped()); 535Debug.Assert(!_fBoundToDocument); 536Debug.Assert(!_fBoundToDataSet); 548Debug.Assert(_fDataRowCreatedSpecial == false); 549Debug.Assert(_mapper.IsMapped()); 550Debug.Assert(_fBoundToDataSet && _fBoundToDocument); 554Debug.Assert(fAssociateDataRowOld == _fAssociateDataRow); 580Debug.Assert(fIsChildConnected == IsConnected(childElem)); 581Debug.Assert(IsRowLive(r) ? IsConnected(childElem) : !IsConnected(childElem)); 592Debug.Assert(newState == ElementState.WeakFoliation || newState == ElementState.StrongFoliation); 605Debug.Assert(rowElemState == ElementState.StrongFoliation || rowElemState == ElementState.WeakFoliation); 625Debug.Assert(node.Row != null); 675Debug.Assert(node.Row != null); 676Debug.Assert(node.Row.RowState != DataRowState.Deleted); 728Debug.Assert(col.ColumnMapping == MappingType.SimpleContent); 847Debug.Assert(c == row.Table.XmlText); 851Debug.Assert(cTextCols == 0 || cTextCols == 1); 853Debug.Assert(row.Table.XmlText == null); 901Debug.Assert(be != null); 917Debug.Assert(pointer != null); 978Debug.Assert(DataSet.EnforceConstraints == false); 990Debug.Assert(newNode != null); 1009Debug.Assert(_ignoreDataSetEvents); 1010Debug.Assert(_ignoreXmlEvents); 1011Debug.Assert(IsFoliationEnabled == false); 1054Debug.Assert(clone.FirstChild == null); 1199Debug.Assert(reader is XmlTextReader); 1226Debug.Assert(DocumentElement != null); 1264Debug.Assert(r.Element == null); 1300Debug.Assert(node != null); 1310Debug.Assert(r == null); 1318Debug.Assert(be.Row != null); 1338Debug.Assert(row.RowState == DataRowState.Detached); 1350Debug.Assert(row.RowState == DataRowState.Detached); 1362Debug.Assert(row.Element == null); 1364Debug.Assert(row.RowState == DataRowState.Detached); 1372Debug.Assert(row.Element == null); 1385Debug.Assert(tb != null); 1396Debug.Assert(_ignoreXmlEvents); 1399Debug.Assert(rowElement != null); 1405Debug.Assert(rowElement != null); 1452Debug.Assert((pointer != null) && !((IXmlDataVirtualNode)pointer).IsOnColumn(col)); 1535Debug.Assert(e != null); 1595Debug.Assert(relation.ChildTable == row.Table); 1605Debug.Assert(args.Row.RowState != DataRowState.Deleted); 1623Debug.Assert(be != null); 1641Debug.Assert(row != null); 1642Debug.Assert(rowElement != null); 1671Debug.Assert(_ignoreXmlEvents); 1716Debug.Assert(pointer != null); 1746Debug.Assert(child.Element == childElement && childElement.Row == child); 1748Debug.Assert(_ignoreXmlEvents); 1778Debug.Assert(colInParent != null); 1792Debug.Assert(fChildElementConnected == IsConnected(childElement)); 1793Debug.Assert(IsRowLive(child) ? IsConnected(childElement) : !IsConnected(childElement)); 1817Debug.Assert(DataSet.EnforceConstraints == false); 1854Debug.Assert(DataSet.EnforceConstraints == false); 1867Debug.Assert(oldParent == null); 1909Debug.Assert(DataSet.EnforceConstraints == false); 1918Debug.Assert(args.NewParent == null); 1984Debug.Assert(!IsRowLive(row)); 1993Debug.Assert(!IsRowLive(be.Row)); 2026Debug.Assert(rowElement != null); 2238Debug.Assert(!(args.Action == CollectionChangeAction.Add || args.Action == CollectionChangeAction.Remove) || rel!.Nested == false); 2287Debug.Assert(child.ParentNode != prevSibling.ParentNode); 2289Debug.Assert(prevSibling.ParentNode != null); 2290Debug.Assert(IsFoliationEnabled == false); 2291Debug.Assert(IgnoreXmlEvents); 2293Debug.Assert(prevSibling != DocumentElement); 2297Debug.Assert(child.ParentNode == null); 2305Debug.Assert(parent != null); 2306Debug.Assert(parent.NodeType != XmlNodeType.Attribute); // We need to get the grand-parent region 2307Debug.Assert(parent != DocumentElement); // We cannot promote children of the DocumentElement 2317Debug.Assert(iter.CurrentNode is XmlBoundElement && ((XmlBoundElement)(iter.CurrentNode)).Row != null); 2327Debug.Assert(parent != null); 2411Debug.Assert(col.ColumnMapping != MappingType.Hidden); 2422Debug.Assert(xmlText != null); 2423Debug.Assert(row.Table.DataSet!.EnforceConstraints == false); 2429Debug.Assert(oVal != null && !(oVal is DBNull)); 2454Debug.Assert(row != null); 2492Debug.Assert(rowElement != null); 2493Debug.Assert(rowElement.Row != null); 2494Debug.Assert(DataSet.EnforceConstraints == false); 2497Debug.Assert(row != null); 2541Debug.Assert(c.Table == row.Table); 2737Debug.Assert(rowElemList[0] != null && rowElemList[0] is XmlBoundElement); 2741Debug.Assert(subRowElem != null); 2757Debug.Assert(!IsRowLive(be.Row!)); 2767Debug.Assert(rowElemList[0] != null && rowElemList[0] is XmlBoundElement); 2790Debug.Assert(rowElem.Row != null); 2801Debug.Assert(row.Table.DataSet!.EnforceConstraints == false); 2825Debug.Assert(row.Table.DataSet!.EnforceConstraints == false); 2846Debug.Assert(IsRowLive(rowElem.Row)); 2853Debug.Assert(rowElem.Row != null); 2864Debug.Assert(row.Table.DataSet!.EnforceConstraints == false); 2898Debug.Assert(!IsRowLive(rowElem.Row)); 2909Debug.Assert(row != null); 2926Debug.Assert(row != null); 2928Debug.Assert(row.RowState == DataRowState.Detached || row.RowState == DataRowState.Deleted); 2938Debug.Assert(childRowElem.Row != null); 2955Debug.Assert(parentRowElem.Row != null); 3010Debug.Assert(node.OwnerDocument == this || node == this); 3028Debug.Assert(be.IsFoliated); 3050Debug.Assert(IsRowLive(rowElement.Row)); 3055Debug.Assert(rowElement!.Row != null); 3056Debug.Assert(IsRowLive(rowElement.Row)); 3073Debug.Assert(!IsRowLive(rowElement.Row)); 3078Debug.Assert(rowElement!.Row != null); 3079Debug.Assert(!IsRowLive(rowElement.Row));
System\Xml\XPathNodePointer.cs (32)
51Debug.Assert(XmlDataDocument.IsTextNode(node.NodeType)); 87Debug.Assert(xnt != -1); 107Debug.Assert(owner != null); 436Debug.Assert(rowElem != null); 437Debug.Assert(rowElem.Row != null); 453Debug.Assert(rowElem.Row != null); 477Debug.Assert(node == _doc || node.OwnerDocument == _doc); 486Debug.Assert(node == _doc || node.OwnerDocument == _doc); 606Debug.Assert(_node.Attributes != null); 688Debug.Assert(xntInt != -1); 711Debug.Assert(xntInt != -1); 731Debug.Assert(_column.ColumnMapping != MappingType.Attribute && _column.ColumnMapping != MappingType.Hidden); 1015Debug.Assert(_parentOfNS != null); 1101Debug.Assert(other.NodeType != XPathNodeType.Namespace); 1116Debug.Assert(NodeType != XPathNodeType.Namespace); 1137Debug.Assert(_fOnValue != other._fOnValue); 1145Debug.Assert(Row == other.Row); //in the same row 1160Debug.Assert(curNode1 != null); 1161Debug.Assert(curNode2 != null); 1278Debug.Assert(_column != null); 1460Debug.Assert(curAttr.NamespaceURI == StrReservedXmlns); 1462Debug.Assert(attrs != null); 1561Debug.Assert(_parentOfNS != null); 1566Debug.Assert(_column.Namespace == StrReservedXmlns); 1570Debug.Assert(be != null); 1572Debug.Assert(curRow != null); 1595Debug.Assert(attr != null); 1643Debug.Assert(rowElem != null); 1646Debug.Assert(row != null); 1650Debug.Assert(!Convert.IsDBNull(row[_column, rowVersion])); 1653Debug.Assert((_column.ColumnMapping == MappingType.SimpleContent) ? _fOnValue : true); 1656Debug.Assert(!_fOnValue);
System.Diagnostics.DiagnosticSource (77)
src\libraries\Common\src\System\Diagnostics\DiagnosticsHelper.cs (4)
141Debug.Assert(index >= 0); 142Debug.Assert(index < _maxIndex); 152Debug.Assert(index >= 0); 153Debug.Assert(index < _maxIndex);
src\libraries\Common\src\System\HexConverter.cs (1)
165Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
System\Diagnostics\Activity.cs (9)
375Debug.Assert(activity != null); 1227Debug.Assert(!string.IsNullOrEmpty(Parent.Id)); 1233Debug.Assert(ParentId.Length != 0); 1322Debug.Assert(_traceId is null); 1344Debug.Assert(!W3CIdFlagsSet); 1594Debug.Assert(_last != null); 1683Debug.Assert(_last != null); 1908Debug.Assert(outBytes.Length == 16 || outBytes.Length == 8); 1925Debug.Assert(outBytes.Length * 2 == charData.Length);
System\Diagnostics\Activity.GenerateRootId.netcoreapp.cs (2)
16Debug.Assert(s_uniqSuffix.Length < 50); // Ensure stackalloc not too large 20Debug.Assert(formatted);
System\Diagnostics\ActivitySource.cs (2)
345Debug.Assert(activity != null); 357Debug.Assert(activity != null);
System\Diagnostics\DiagLinkedList.cs (3)
28Debug.Assert(e is not null); 56Debug.Assert(_first is not null); 57Debug.Assert(_last is not null);
System\Diagnostics\DiagnosticListener.cs (1)
360Debug.Assert(Monitor.IsEntered(s_allListenersLock)); // We should only be called when we hold this lock
System\Diagnostics\DiagnosticSourceEventSource.cs (20)
410Debug.Assert(str2 != null); 545Debug.Assert(filterAndPayloadSpec != null && startIdx >= 0 && startIdx <= endIdx && endIdx <= filterAndPayloadSpec.Length); 728Debug.Assert(endIdx - startIdx >= 4); 729Debug.Assert(IsActivitySourceEntry(filterAndPayloadSpec, startIdx, endIdx)); 862Debug.Assert(eventSource._activityListener == null); 863Debug.Assert(eventSource._activitySourceSpecs != null); 941Debug.Assert(eventSource._activityListener == null); 942Debug.Assert(eventSource._activitySourceSpecs != null); 962Debug.Assert(lastWildcardList != null); 975Debug.Assert(lastSpecificList != null); 986Debug.Assert(firstSpecificList != null || firstWildcardList != null); 990Debug.Assert(lastWildcardList != null && lastSpecificList != null); 1161Debug.Assert(transformSpec != null && startIdx >= 0 && startIdx < endIdx && endIdx <= transformSpec.Length); 1256Debug.Assert(obj != null || IsStatic); 1404Debug.Assert(typeof(TObject).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo())); 1409Debug.Assert(obj is TObject); 1423Debug.Assert(typeof(TStruct) == type); 1428Debug.Assert(obj is TStruct); 1462Debug.Assert(enumerable is not null); 1525Debug.Assert(obj is IEnumerable<ElementType>);
System\Diagnostics\DistributedContextPropagator.cs (1)
76Debug.Assert(s_current is not null);
System\Diagnostics\Metrics\AggregationManager.cs (4)
110Debug.Assert(collectionPeriod.TotalSeconds >= MinCollectionTimeSecs); 148Debug.Assert(_collectThread == null && !_cts.IsCancellationRequested); 149Debug.Assert(CollectionPeriod.TotalSeconds >= MinCollectionTimeSecs); 187Debug.Assert(collectionIntervalSecs >= MinCollectionTimeSecs);
System\Diagnostics\Metrics\AggregatorStore.cs (1)
88Debug.Assert(match);
System\Diagnostics\Metrics\ExponentialHistogramAggregator.cs (1)
128Debug.Assert(count == 0);
System\Diagnostics\Metrics\Instrument.cs (1)
172Debug.Assert(false);
System\Diagnostics\Metrics\Meter.cs (5)
36Debug.Assert(options.Name is not null); 40Debug.Assert(Name is not null); 71Debug.Assert(Name is not null); 471Debug.Assert(instrumentList is not null); 498Debug.Assert(instrumentList is not null);
System\Diagnostics\Metrics\MeterOptions.cs (1)
55Debug.Assert(_name is not null);
System\Diagnostics\Metrics\MetricsEventSource.cs (1)
424Debug.Assert(AggregationManager.MinCollectionTimeSecs <= defaultIntervalSecs);
System\Diagnostics\Metrics\TagList.cs (15)
86Debug.Assert(_tagsCount > 8); 118Debug.Assert(index < _overflowTags.Length); 122Debug.Assert(index <= 7); 147Debug.Assert(index < _overflowTags.Length); 163Debug.Assert(false); 193Debug.Assert(_tagsCount <= 8); 206Debug.Assert(_overflowTags is null); 208Debug.Assert(_overflowTags is not null); 213Debug.Assert(_overflowTags is null); 238Debug.Assert(_tagsCount <= 8); 298Debug.Assert(_overflowTags is not null); 317Debug.Assert(_tagsCount < 8 && index < 7); 329Debug.Assert(false); // we shouldn't come here 358Debug.Assert(_tagsCount <= 8 && index <= 7); 433Debug.Assert(_tagsCount <= 8);
System.Diagnostics.Process (46)
Microsoft\Win32\SafeHandles\SafeProcessHandle.Unix.cs (1)
44Debug.Assert(_handle != null);
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.ParseMapModules.cs (1)
34Debug.Assert(lines != null);
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (2)
104Debug.Assert(valueParsed); 119Debug.Assert(!string.IsNullOrEmpty(path));
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ForkAndExecProcess.cs (1)
71Debug.Assert(bytesWritten == byteLength);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
69Debug.Assert(passwd.Name != null);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetSetPriority.cs (1)
40Debug.Assert((nice >= -20) && (nice <= 20));
src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (7)
25Debug.Assert(capacity >= 0); 54Debug.Assert(index >= 0 && index < _count); 78Debug.Assert(_count > 0); 87Debug.Assert(_count > 0); 104Debug.Assert(_array != null); // Nonzero _count should imply this 134Debug.Assert(_count < Capacity); 141Debug.Assert(minimum > Capacity);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
System\Diagnostics\Process.ConfigureTerminalForChildProcesses.Unix.cs (4)
15Debug.Assert(increment != 0); 20Debug.Assert(s_processStartLock.IsReadLockHeld); 21Debug.Assert(configureConsole); 28Debug.Assert(s_processStartLock.IsWriteLockHeld);
System\Diagnostics\Process.Linux.cs (1)
291Debug.Assert(bytesRead < buffer.Length);
System\Diagnostics\Process.Unix.cs (10)
178Debug.Assert(_waitHandle == null); 179Debug.Assert(_registeredWaitHandle == null); 206Debug.Assert(exited || milliseconds != Timeout.Infinite); 272Debug.Assert(pri >= -20 && pri <= 20); 468Debug.Assert(stdinFd >= 0); 475Debug.Assert(stdoutFd >= 0); 481Debug.Assert(stderrFd >= 0); 532Debug.Assert(childPid >= 0); 842Debug.Assert(fd >= 0); 963Debug.Assert(!string.IsNullOrEmpty(startInfo.UserName));
System\Diagnostics\ProcessManager.Linux.cs (1)
158Debug.Assert(pid >= 0);
System\Diagnostics\ProcessWaitState.Unix.cs (11)
168Debug.Assert(foundState); 228Debug.Assert(processId >= 0); 238Debug.Assert(!Monitor.IsEntered(_gate)); 253Debug.Assert(Monitor.IsEntered(_gate)); 266Debug.Assert(!Monitor.IsEntered(_gate)); 299Debug.Assert(_exited); 348Debug.Assert(Monitor.IsEntered(_gate)); 397Debug.Assert(!Monitor.IsEntered(_gate)); 506Debug.Assert(Monitor.IsEntered(_gate)); 507Debug.Assert(!_isChild); 546Debug.Assert(!_exited);
System.Diagnostics.StackTrace (1)
System\Diagnostics\StackTraceSymbols.cs (1)
146Debug.Assert(inMemoryPdbAddress != IntPtr.Zero);
System.Diagnostics.TextWriterTraceListener (3)
System\Diagnostics\XmlWriterTraceListener.cs (3)
399Debug.Assert(charsWritten > 0); 411Debug.Assert(charsWritten == span.Length); 423Debug.Assert(charsWritten > 0);
System.Diagnostics.TraceSource (2)
System\Diagnostics\CorrelationManager.cs (1)
57Debug.Assert(stack != null);
System\Diagnostics\TraceSource.cs (1)
105Debug.Assert(_listeners != null);
System.Drawing.Primitives (8)
src\libraries\Common\src\System\Drawing\ColorConverterCommon.cs (2)
14Debug.Assert(culture != null); 105Debug.Assert(culture != null);
System\Drawing\Color.cs (1)
395Debug.Assert(name != null);
System\Drawing\KnownColorNames.cs (1)
199Debug.Assert(color > 0 && color <= KnownColor.RebeccaPurple);
System\Drawing\KnownColorTable.cs (4)
468Debug.Assert((argb & Color.ARGBAlphaMask) == Color.ARGBAlphaMask); 469Debug.Assert(ColorValueTable.Length == ColorKindTable.Length); 486Debug.Assert(color > 0 && color <= KnownColor.RebeccaPurple); 503Debug.Assert(Color.IsKnownColorSystem(color));
System.Formats.Asn1 (82)
src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (3)
17Debug.Assert(arraySegment.Array != null); 18Debug.Assert(arraySegment.Offset == 0); 25Debug.Assert(clearSize <= array.Length);
System\Formats\Asn1\Asn1Tag.cs (3)
232Debug.Assert(bytesConsumed > 0); 338Debug.Assert(segment <= byte.MaxValue); 344Debug.Assert(idx == 0);
System\Formats\Asn1\AsnCharacterStringEncodings.cs (3)
216Debug.Assert(minCharAllowed <= maxCharAllowed); 217Debug.Assert(maxCharAllowed <= 0x7F); 237Debug.Assert(isAllowed[c] == false);
System\Formats\Asn1\AsnDecoder.BitString.cs (4)
367Debug.Assert(unusedBitCount == 0); 492Debug.Assert(length != null); 626Debug.Assert(bytesWritten == contentLength); 663Debug.Assert(contentsLength.HasValue);
System\Formats\Asn1\AsnDecoder.cs (5)
440Debug.Assert(bytesRead > 0); 533Debug.Assert(validity != LengthValidity.Valid); 647Debug.Assert(offset >= 0); 659Debug.Assert(offset >= 0); 695Debug.Assert(ruleSet >= AsnEncodingRules.BER && ruleSet <= AsnEncodingRules.DER);
System\Formats\Asn1\AsnDecoder.GeneralizedTime.cs (4)
192Debug.Assert(!contents.IsEmpty); 194Debug.Assert(state == GetNextState(octet)); 267Debug.Assert(!contents.IsEmpty); 269Debug.Assert(state == GetNextState(octet));
System\Formats\Asn1\AsnDecoder.Integer.cs (2)
434Debug.Assert(sizeLimit <= sizeof(long)); 473Debug.Assert(sizeLimit <= sizeof(ulong));
System\Formats\Asn1\AsnDecoder.NamedBitList.cs (1)
368Debug.Assert(valueSpan.Length <= sizeof(long));
System\Formats\Asn1\AsnDecoder.OctetString.cs (4)
212Debug.Assert(contentLength.HasValue); 355Debug.Assert(length != null); 472Debug.Assert(bytesWritten == contentLength); 485Debug.Assert(rented == null);
System\Formats\Asn1\AsnDecoder.Oid.cs (8)
85Debug.Assert(source.Length > 0); 161Debug.Assert(idx == nextStop); 162Debug.Assert(writeSpan.Length >= SemanticByteCount); 165Debug.Assert(accumValueBytes[7] == 0); 186Debug.Assert(paddingByteCount >= 0 && paddingByteCount < sizeof(long)); 251Debug.Assert(largeValue != null); 256Debug.Assert(firstIdentifier > long.MaxValue); 272Debug.Assert((smallValue == null) != (largeValue == null));
System\Formats\Asn1\AsnDecoder.UtcTime.cs (2)
177Debug.Assert( 193Debug.Assert(contents.IsEmpty);
System\Formats\Asn1\AsnWriter.BitString.cs (3)
111Debug.Assert(contentLength > MaxCERContentSize); 119Debug.Assert( 147Debug.Assert(payload.Length > MaxCERContentSize);
System\Formats\Asn1\AsnWriter.Boolean.cs (2)
31Debug.Assert(!tag.IsConstructed); 35Debug.Assert(_offset < _buffer.Length);
System\Formats\Asn1\AsnWriter.cs (17)
83Debug.Assert(_buffer != null); 171Debug.Assert(bytesWritten == _offset); 320Debug.Assert(length >= -1); 332Debug.Assert(length >= 0); 363Debug.Assert(idx == _offset); 476Debug.Assert(tag.IsConstructed); 494Debug.Assert(tag.IsConstructed); 504Debug.Assert(tagType == UniversalTagNumber.SetOf); 524Debug.Assert(containedLength >= 0); 564Debug.Assert(_offset == expectedEnd); 587Debug.Assert(_offset - lenOffset - 1 == shiftSize); 593Debug.Assert(buffer != null); 594Debug.Assert(end >= start); 631Debug.Assert(pos == end); 646Debug.Assert(pos == len); 741Debug.Assert(writer._nestingStack != null); 750Debug.Assert(_writer == null || _writer._nestingStack != null);
System\Formats\Asn1\AsnWriter.GeneralizedTime.cs (3)
93Debug.Assert(fraction[0] == (byte)'0'); 94Debug.Assert(fraction[1] == (byte)'.'); 110Debug.Assert(!tag.IsConstructed);
System\Formats\Asn1\AsnWriter.Integer.cs (7)
141Debug.Assert(!tag.IsConstructed); 160Debug.Assert(_buffer[_offset] != 0xFF || _buffer[_offset + 1] < 0x80); 193Debug.Assert(!tag.IsConstructed); 212Debug.Assert(_buffer[_offset] != 0 || _buffer[_offset + 1] > 0x7F); 232Debug.Assert(!tag.IsConstructed); 270Debug.Assert(!tag.IsConstructed); 281Debug.Assert(!tag.IsConstructed);
System\Formats\Asn1\AsnWriter.Null.cs (1)
30Debug.Assert(!tag.IsConstructed);
System\Formats\Asn1\AsnWriter.OctetString.cs (2)
106Debug.Assert(payload.Length > MaxCERSegmentSize); 117Debug.Assert(
System\Formats\Asn1\AsnWriter.Oid.cs (2)
138Debug.Assert(!tag.IsConstructed); 193Debug.Assert(dest.Length > 0);
System\Formats\Asn1\AsnWriter.Sequence.cs (2)
59Debug.Assert(tag.IsConstructed); 66Debug.Assert(tag.IsConstructed);
System\Formats\Asn1\AsnWriter.SetOf.cs (2)
68Debug.Assert(tag.IsConstructed); 75Debug.Assert(tag.IsConstructed);
System\Formats\Asn1\AsnWriter.Text.cs (1)
118Debug.Assert(size > AsnReader.MaxCERSegmentSize);
System\Formats\Asn1\AsnWriter.UtcTime.cs (1)
80Debug.Assert(!tag.IsConstructed);
System.Formats.Cbor (31)
System\Formats\Cbor\CborConformanceLevel.cs (1)
234Debug.Assert(!left.IsEmpty && !right.IsEmpty);
System\Formats\Cbor\Reader\CborReader.cs (6)
207Debug.Assert(_nestedDataItems?.Count > 0); 235Debug.Assert(_definiteLength is null || _definiteLength - _itemsRead > 0); 257Debug.Assert(_offset + length <= _data.Length); 266Debug.Assert(position <= _data.Length); 387Debug.Assert(_nestedDataItems != null); 420Debug.Assert(CurrentDepth == checkpoint.Depth);
System\Formats\Cbor\Reader\CborReader.Map.cs (4)
104Debug.Assert(_currentKeyOffset != null && _itemsRead % 2 == 0); 125Debug.Assert(_currentKeyOffset != null && _itemsRead % 2 != 0); 132Debug.Assert(_currentKeyOffset != null); 160Debug.Assert(_currentKeyOffset != null);
System\Formats\Cbor\Reader\CborReader.PeekState.cs (2)
32Debug.Assert(!AllowMultipleRootLevelValues); 74Debug.Assert(AllowMultipleRootLevelValues);
System\Formats\Cbor\Reader\CborReader.SkipValue.cs (1)
43Debug.Assert(0 <= depth && depth <= CurrentDepth);
System\Formats\Cbor\Reader\CborReader.String.cs (3)
344Debug.Assert(target.IsEmpty); 407Debug.Assert(target.IsEmpty); 485Debug.Assert(type == CborMajorType.ByteString || type == CborMajorType.TextString);
System\Formats\Cbor\Writer\CborWriter.Array.cs (1)
72Debug.Assert(majorType == CborMajorType.Array || majorType == CborMajorType.Map);
System\Formats\Cbor\Writer\CborWriter.cs (4)
245Debug.Assert(MaxArrayLength == Array.MaxLength); 303Debug.Assert(_nestedDataItems?.Count > 0); // implied by previous check 390Debug.Assert(_definiteLength == null); 405Debug.Assert(_itemsWritten % 2 == 0);
System\Formats\Cbor\Writer\CborWriter.Map.cs (4)
95Debug.Assert(_currentKeyOffset != null && _currentValueOffset == null); 119Debug.Assert(_currentKeyOffset != null && _currentValueOffset != null); 152Debug.Assert(_keyValuePairEncodingRanges != null); 171Debug.Assert(s.IsEmpty);
System\Formats\Cbor\Writer\CborWriter.String.cs (5)
52Debug.Assert(_currentIndefiniteLengthStringRanges != null); 149Debug.Assert(_currentIndefiniteLengthStringRanges != null); 200Debug.Assert(type == CborMajorType.ByteString || type == CborMajorType.TextString); 201Debug.Assert(_currentIndefiniteLengthStringRanges != null); 224Debug.Assert(s.IsEmpty);
System.Formats.Tar (120)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
13Debug.Assert(errorInfo.Error != Error.SUCCESS);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
69Debug.Assert(passwd.Name != null);
src\libraries\Common\src\System\IO\Archiving.Utils.cs (2)
14Debug.Assert(buffer != null); 15Debug.Assert(min > 0);
src\libraries\Common\src\System\IO\PathInternal.cs (1)
124Debug.Assert(rootLength > 0);
src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
31Debug.Assert(DirectorySeparatorChar == AltDirectorySeparatorChar);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
System\Formats\Tar\PaxTarEntry.cs (3)
57Debug.Assert(_header._mTime != default); 99Debug.Assert(_header._mTime != default); 161Debug.Assert(!useMTime || (useMTime && _header._mTime != default));
System\Formats\Tar\PosixTarEntry.cs (2)
37Debug.Assert(other._header._uName != null); 38Debug.Assert(other._header._gName != null);
System\Formats\Tar\SeekableSubReadStream.cs (2)
57Debug.Assert(count >= 0); 58Debug.Assert(count <= origCount);
System\Formats\Tar\SubReadStream.cs (3)
119Debug.Assert(count >= 0); 120Debug.Assert(count <= origCount); 157Debug.Assert(!_hasReachedEnd);
System\Formats\Tar\TarEntry.cs (11)
28Debug.Assert(header._format == format); 38Debug.Assert(!isGea || entryType is TarEntryType.GlobalExtendedAttributes); 332Debug.Assert(!string.IsNullOrEmpty(destinationDirectoryPath)); 333Debug.Assert(Path.IsPathFullyQualified(destinationDirectoryPath)); 427Debug.Assert(EntryType is not TarEntryType.RegularFile or TarEntryType.V7RegularFile or TarEntryType.ContiguousFile); 435Debug.Assert(Directory.Exists(Path.GetDirectoryName(filePath))); 436Debug.Assert(!Directory.Exists(filePath)); 449Debug.Assert(!string.IsNullOrEmpty(linkTargetPath)); 455Debug.Assert(!string.IsNullOrEmpty(linkTargetPath)); 520Debug.Assert(!Path.Exists(destinationFileName)); 536Debug.Assert(!Path.Exists(destinationFileName));
System\Formats\Tar\TarEntry.Unix.cs (6)
16Debug.Assert(EntryType is TarEntryType.BlockDevice); 23Debug.Assert(EntryType is TarEntryType.CharacterDevice); 30Debug.Assert(EntryType is TarEntryType.Fifo); 37Debug.Assert(EntryType is TarEntryType.HardLink); 38Debug.Assert(!string.IsNullOrEmpty(targetFilePath)); 39Debug.Assert(!string.IsNullOrEmpty(hardLinkFilePath));
System\Formats\Tar\TarFile.cs (12)
358Debug.Assert(!string.IsNullOrEmpty(sourceDirectoryName)); 359Debug.Assert(!string.IsNullOrEmpty(destinationFileName)); 477Debug.Assert(!string.IsNullOrEmpty(sourceFileName)); 478Debug.Assert(!string.IsNullOrEmpty(destinationDirectoryFullPath)); 523Debug.Assert(!string.IsNullOrEmpty(sourceDirectoryName)); 524Debug.Assert(destination != null); 525Debug.Assert(Path.IsPathFullyQualified(sourceDirectoryName)); 526Debug.Assert(destination.CanWrite); 532Debug.Assert(source != null); 533Debug.Assert(!string.IsNullOrEmpty(destinationDirectoryPath)); 534Debug.Assert(Path.IsPathFullyQualified(destinationDirectoryPath)); 535Debug.Assert(source.CanRead);
System\Formats\Tar\TarHeader.cs (2)
115Debug.Assert(_ea == null); 116Debug.Assert(existing != null);
System\Formats\Tar\TarHeader.Read.cs (1)
78Debug.Assert(header._format is TarEntryFormat.Ustar or TarEntryFormat.Pax or TarEntryFormat.Gnu);
System\Formats\Tar\TarHeader.Write.cs (45)
31Debug.Assert(format is > TarEntryFormat.Unknown and <= TarEntryFormat.Gnu); 32Debug.Assert(_dataStream == null || _dataStream.CanSeek); 47Debug.Assert(format is > TarEntryFormat.Unknown and <= TarEntryFormat.Gnu); 48Debug.Assert(_dataStream == null || _dataStream.CanSeek); 64Debug.Assert(destinationStream.CanSeek); 65Debug.Assert(_dataStream != null); 66Debug.Assert(!_dataStream.CanSeek); 113Debug.Assert(destinationStream.CanSeek); 114Debug.Assert(_dataStream != null); 115Debug.Assert(!_dataStream.CanSeek); 203Debug.Assert(_typeFlag is TarEntryType.GlobalExtendedAttributes); 204Debug.Assert(globalExtendedAttributesEntryNumber >= 0); 209Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 223Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 236Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 250Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 265Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 266Debug.Assert(_typeFlag is not TarEntryType.GlobalExtendedAttributes); 308Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 309Debug.Assert(_typeFlag is not TarEntryType.GlobalExtendedAttributes); 352Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 358Debug.Assert(longLinkHeader._dataStream != null && longLinkHeader._dataStream.CanSeek); // We generate the long metadata data stream, should always be seekable 367Debug.Assert(longPathHeader._dataStream != null && longPathHeader._dataStream.CanSeek); // We generate the long metadata data stream, should always be seekable 387Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 394Debug.Assert(longLinkHeader._dataStream != null && longLinkHeader._dataStream.CanSeek); // We generate the long metadata data stream, should always be seekable 403Debug.Assert(longPathHeader._dataStream != null && longPathHeader._dataStream.CanSeek); // We generate the long metadata data stream, should always be seekable 422Debug.Assert(entryType is TarEntryType.LongPath or TarEntryType.LongLink); 452Debug.Assert(_dataStream == null || (extendedAttributes.Count > 0 && _dataStream.CanSeek)); // We generate the extended attributes data stream, should always be seekable 461Debug.Assert(_dataStream == null || (extendedAttributes.Count > 0 && _dataStream.CanSeek)); // We generate the extended attributes data stream, should always be seekable 468Debug.Assert(isGea && globalExtendedAttributesEntryNumber >= 0 || !isGea && globalExtendedAttributesEntryNumber < 0); 586Debug.Assert(prefix.Length != 1 || !PathInternal.Utf8DirectorySeparators.Contains(prefix[0])); 603Debug.Assert(!string.IsNullOrEmpty(_linkName) ^ (_typeFlag is not TarEntryType.SymbolicLink and not TarEntryType.HardLink)); 635Debug.Assert(_typeFlag is not TarEntryType.ExtendedAttributes and not TarEntryType.GlobalExtendedAttributes); 636Debug.Assert(Convert.ToInt64(ExtendedAttributes[PaxEaSize]) > TarHelpers.MaxSizeLength); 675Debug.Assert(_dataStream.CanSeek); 780Debug.Assert(paddingAfterData <= TarHelpers.RecordSize); 796Debug.Assert(paddingAfterData <= TarHelpers.RecordSize); 854Debug.Assert(length == CountDigits(length) + 3 + Encoding.UTF8.GetByteCount(attribute) + Encoding.UTF8.GetByteCount(value)); 868Debug.Assert(formatted); 891Debug.Assert(value >= 0); 915Debug.Assert(_typeFlag is TarEntryType.SymbolicLink or TarEntryType.HardLink); 984Debug.Assert(destination.Length > 1); 998Debug.Assert(destination.Length > 1); 1084Debug.Assert(globalExtendedAttributesEntryNumber >= 1); 1100Debug.Assert(GetUtf8TextLength(text) > utf8MaxLength);
System\Formats\Tar\TarHelpers.Unix.cs (2)
60Debug.Assert(pendingModes is not null); 104Debug.Assert(pendingModes is not null);
System\Formats\Tar\TarReader.cs (18)
123Debug.Assert(_archiveStream.CanRead); 188Debug.Assert(_archiveStream.CanRead); 209Debug.Assert(_previouslyReadEntry._header._endOfHeaderAndDataAndBlockAlignment > 0); 251Debug.Assert(_previouslyReadEntry._header._endOfHeaderAndDataAndBlockAlignment > 0); 319Debug.Assert(!_reachedEndMarkers); 361Debug.Assert(!_reachedEndMarkers); 504Debug.Assert(header._linkName != null); 505Debug.Assert(secondHeader._name != null); 512Debug.Assert(header._name != null); 513Debug.Assert(secondHeader._linkName != null); 525Debug.Assert(header._linkName != null); 530Debug.Assert(header._name != null); 580Debug.Assert(header._linkName != null); 581Debug.Assert(secondHeader._name != null); 588Debug.Assert(header._name != null); 589Debug.Assert(secondHeader._linkName != null); 601Debug.Assert(header._linkName != null); 606Debug.Assert(header._name != null);
System\Formats\Tar\TarWriter.Unix.cs (2)
21Debug.Assert(!string.IsNullOrEmpty(fullPath)); 99Debug.Assert(entry._header._dataStream == null);
System.IO.Compression (102)
System\IO\Compression\Crc32Helper.ZLib.cs (1)
14Debug.Assert((buffer != null) && (offset >= 0) && (length >= 0) && (offset <= buffer.Length - length));
System\IO\Compression\DeflateManaged\DeflateManagedStream.cs (1)
30Debug.Assert(method == ZipArchiveEntry.CompressionMethodValues.Deflate64);
System\IO\Compression\DeflateManaged\InflaterManaged.cs (3)
351Debug.Assert(_literalLengthTree != null); 425Debug.Assert(_distanceTree != null); 570Debug.Assert(_codeLengthTree != null);
System\IO\Compression\DeflateManaged\InputBuffer.cs (10)
131Debug.Assert(_bitsInBuffer % 8 == 0); 163Debug.Assert(output != null); 164Debug.Assert(offset >= 0); 165Debug.Assert(length >= 0); 166Debug.Assert(offset <= output.Length - length); 167Debug.Assert((_bitsInBuffer % 8) == 0); 202Debug.Assert(buffer != null); 203Debug.Assert(offset >= 0); 204Debug.Assert(length >= 0); 205Debug.Assert(offset <= buffer.Length - length);
System\IO\Compression\DeflateZLib\Deflater.cs (5)
33Debug.Assert(windowBits >= minWindowBits && windowBits <= maxWindowBits); 125Debug.Assert(!inputBuffer.IsEmpty); 139Debug.Assert(inputBufferPtr != null); 140Debug.Assert(count > 0); 172Debug.Assert(outputBuffer?.Length > 0);
System\IO\Compression\DeflateZLib\DeflateStream.cs (25)
93Debug.Assert(stream != null); 108Debug.Assert(_buffer == null); 186Debug.Assert(_deflater != null && _buffer != null); 201Debug.Assert(flushSuccessful == (compressedBytes > 0)); 232Debug.Assert(_inflater != null); 262Debug.Assert(_inflater != null); 311Debug.Assert(bytesRead == 0); 400Debug.Assert(_inflater != null); 516Debug.Assert(_deflater != null); 533Debug.Assert(_deflater != null && _buffer != null); 552Debug.Assert(_deflater != null && _buffer != null); 563Debug.Assert(flushSuccessful == (compressedBytes > 0)); 583Debug.Assert(_deflater != null && _buffer != null); 630Debug.Assert(_deflater != null && _buffer != null); 814Debug.Assert(_deflater != null); 833Debug.Assert(_deflater != null && _buffer != null); 886Debug.Assert(deflateStream != null); 887Debug.Assert(destination != null); 888Debug.Assert(bufferSize > 0); 901Debug.Assert(_deflateStream._inflater != null); 937Debug.Assert(_deflateStream._inflater != null); 969Debug.Assert(buffer != _arrayPoolBuffer); 994Debug.Assert(_deflateStream._inflater is not null); 1017Debug.Assert(buffer != _arrayPoolBuffer); 1031Debug.Assert(_deflateStream._inflater != null);
System\IO\Compression\DeflateZLib\Inflater.cs (10)
36Debug.Assert(windowBits >= MinWindowBits && windowBits <= MaxWindowBits); 57Debug.Assert(bytesRead == 0 || bytesRead == 1); 146Debug.Assert(!NeedsInput()); 147Debug.Assert(IsGzipStream()); 148Debug.Assert(IsInputBufferHandleAllocated); 186Debug.Assert(inputBuffer != null); 187Debug.Assert(startIndex >= 0 && count >= 0 && count + startIndex <= inputBuffer.Length); 188Debug.Assert(!IsInputBufferHandleAllocated); 196Debug.Assert(!IsInputBufferHandleAllocated); 330Debug.Assert(IsInputBufferHandleAllocated);
System\IO\Compression\ZipArchive.cs (10)
188Debug.Assert(mode == ZipArchiveMode.Update); 310Debug.Assert(_mode == ZipArchiveMode.Update || _mode == ZipArchiveMode.Create); 436internal void DebugAssertIsStillArchiveStreamOwner(ZipArchiveEntry entry) => Debug.Assert(_archiveStreamOwner == entry); 440Debug.Assert(_archiveStreamOwner == entry); 494Debug.Assert(_archiveReader != null); 535Debug.Assert(_archiveReader != null); 539Debug.Assert(eocdProper); // we just found this using the signature finder, so it should be okay 593Debug.Assert(_archiveReader != null); 598Debug.Assert(zip64eocdLocatorProper); // we just found this using the signature finder, so it should be okay 634Debug.Assert(_readEntries);
System\IO\Compression\ZipArchiveEntry.cs (21)
341Debug.Assert(_archive.Mode == ZipArchiveMode.Update); 368Debug.Assert(_archive.ArchiveReader != null); 464Debug.Assert(_storedEntryNameBytes.Length <= ushort.MaxValue); 540Debug.Assert(_fileComment.Length <= ushort.MaxValue); 565Debug.Assert(IsOpenable(false, true, out _)); 572Debug.Assert(_archive.ArchiveReader != null); 621Debug.Assert(CompressionMethod == CompressionMethodValues.Deflate 672Debug.Assert(CompressionMethod == CompressionMethodValues.Stored); 767Debug.Assert(_archive.ArchiveReader != null); 849Debug.Assert(_storedEntryNameBytes.Length <= ushort.MaxValue); 862Debug.Assert(_compressedSize == 0); 863Debug.Assert(_uncompressedSize == 0); 864Debug.Assert(_crc32 == 0); 877Debug.Assert(_crc32 == 0); 981Debug.Assert(_compressedBytes != null); 1082Debug.Assert((_generalPurposeBitFlag & BitFlagValues.DataDescriptor) != 0); 1237Debug.Assert(CanWrite); 1257Debug.Assert(CanWrite); 1286Debug.Assert(CanWrite); 1309Debug.Assert(CanWrite); 1317Debug.Assert(CanWrite);
System\IO\Compression\ZipBlocks.cs (1)
609Debug.Assert(archiveComment.Length <= ZipFileCommentMaxLength);
System\IO\Compression\ZipCustomStreams.cs (8)
297Debug.Assert(count >= 0); 298Debug.Assert(count <= origCount); 320Debug.Assert(count >= 0); 321Debug.Assert(count <= origCount); 508Debug.Assert(CanWrite); 528Debug.Assert(CanWrite); 556Debug.Assert(CanWrite); 582Debug.Assert(CanWrite);
System\IO\Compression\ZipHelper.cs (7)
91Debug.Assert(ValidZipDate_YearMin <= dateTime.Year && dateTime.Year <= ValidZipDate_YearMax); 108Debug.Assert(signatureToFind != 0); 109Debug.Assert(maxBytesToRead > 0); 123Debug.Assert(bufferPointer < buffer.Length); 156Debug.Assert(numBytesLeft >= 0); 228Debug.Assert(totalCodePoints > 0); 229Debug.Assert(totalCodePoints <= bytes.Length);
System.IO.Compression.Brotli (13)
System\IO\Compression\BrotliStream.cs (1)
192Debug.Assert(_activeAsyncOperation == 1);
System\IO\Compression\dec\BrotliDecoder.cs (4)
58Debug.Assert(_state != null); 82Debug.Assert(availableInput <= (nuint)source.Length); 83Debug.Assert(availableOutput <= (nuint)destination.Length); 122Debug.Assert(success ? availableOutput <= (nuint)destination.Length : availableOutput == 0);
System\IO\Compression\dec\BrotliStream.Decompress.cs (2)
215Debug.Assert(lastResult == OperationStatus.DestinationTooSmall); 218Debug.Assert(bytesWritten == 0);
System\IO\Compression\enc\BrotliEncoder.cs (6)
75Debug.Assert(_state != null && !_state.IsInvalid && !_state.IsClosed); 93Debug.Assert(_state != null && !_state.IsInvalid && !_state.IsClosed); 150Debug.Assert(_state != null); 171Debug.Assert(availableInput <= (nuint)source.Length); 172Debug.Assert(availableOutput <= (nuint)destination.Length); 225Debug.Assert(success ? availableOutput <= (nuint)destination.Length : availableOutput == 0);
System.IO.Compression.ZipFile (5)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
13Debug.Assert(errorInfo.Error != Error.SUCCESS);
src\libraries\Common\src\System\IO\Archiving.Utils.cs (2)
14Debug.Assert(buffer != null); 15Debug.Assert(min > 0);
System\IO\Compression\ZipFileExtensions.ZipArchive.Create.Unix.cs (2)
14Debug.Assert(!OperatingSystem.IsWindows()); 19Debug.Assert((uint)entry.ExternalAttributes == DefaultFileExternalAttributes);
System.IO.FileSystem.DriveInfo (1)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
13Debug.Assert(errorInfo.Error != Error.SUCCESS);
System.IO.FileSystem.Watcher (25)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
13Debug.Assert(errorInfo.Error != Error.SUCCESS);
src\libraries\Common\src\System\IO\PathInternal.cs (1)
124Debug.Assert(rootLength > 0);
src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
31Debug.Assert(DirectorySeparatorChar == AltDirectorySeparatorChar);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
System\IO\FileSystemWatcher.Linux.cs (17)
278Debug.Assert(watcher != null); 279Debug.Assert(inotifyHandle != null && !inotifyHandle.IsInvalid && !inotifyHandle.IsClosed); 280Debug.Assert(directoryPath != null); 286Debug.Assert(_buffer != null && _buffer.Length > (c_INotifyEventSize + NAME_MAX + 1)); 478Debug.Assert(_includeSubdirectories); 516Debug.Assert(result >= 0); 533Debug.Assert(result >= 0); // ignore errors; they're non-fatal, but they also shouldn't happen 788Debug.Assert(_buffer != null); 789Debug.Assert(_buffer.Length > 0); 790Debug.Assert(_bufferAvailable >= 0 && _bufferAvailable <= _buffer.Length); 791Debug.Assert(_bufferPos >= 0 && _bufferPos <= _bufferAvailable); 805Debug.Assert(_bufferAvailable <= this._buffer.Length); 813Debug.Assert(_bufferAvailable >= 0); 820Debug.Assert(_bufferAvailable >= c_INotifyEventSize); 832Debug.Assert(_bufferPos + c_INotifyEventSize <= _bufferAvailable); 855Debug.Assert(position > 0); 856Debug.Assert(nameLength >= 0 && (position + nameLength) <= _buffer.Length);
System.IO.Hashing (63)
System\IO\Hashing\Crc32.Vectorized.cs (1)
86Debug.Assert(length >= 16);
System\IO\Hashing\Crc64.Vectorized.cs (1)
119Debug.Assert(length >= 16);
System\IO\Hashing\NonCryptographicHashAlgorithm.cs (1)
324Debug.Assert(destination.Length == HashLengthInBytes);
System\IO\Hashing\XxHash128.cs (6)
252Debug.Assert(length >= 1 && length <= 3); 277Debug.Assert(length >= 4 && length <= 8); 303Debug.Assert(length >= 9 && length <= 16); 329Debug.Assert(length >= 17 && length <= 128); 355Debug.Assert(length >= 129 && length <= 240); 388Debug.Assert(length > 240);
System\IO\Hashing\XxHash3.cs (7)
223Debug.Assert(length >= 1 && length <= 3); 241Debug.Assert(length >= 4 && length <= 8); 258Debug.Assert(length >= 9 && length <= 16); 277Debug.Assert(length >= 17 && length <= 128); 306Debug.Assert(length >= 129 && length <= 240); 324Debug.Assert((length - 16 * 8) / 16 == 7); 355Debug.Assert(length > 240);
System\IO\Hashing\XxHash32.State.cs (1)
39Debug.Assert(source.Length >= StripeSize);
System\IO\Hashing\XxHash64.State.cs (1)
50Debug.Assert(source.Length >= StripeSize);
System\IO\Hashing\XxHashShared.cs (45)
117Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 120Debug.Assert(InternalBufferLengthBytes % StripeLengthBytes == 0); 123Debug.Assert(ReadLE64(defaultSecretUInt64[0]) == DefaultSecretUInt64_0); 124Debug.Assert(ReadLE64(defaultSecretUInt64[1]) == DefaultSecretUInt64_1); 125Debug.Assert(ReadLE64(defaultSecretUInt64[2]) == DefaultSecretUInt64_2); 126Debug.Assert(ReadLE64(defaultSecretUInt64[3]) == DefaultSecretUInt64_3); 127Debug.Assert(ReadLE64(defaultSecretUInt64[4]) == DefaultSecretUInt64_4); 128Debug.Assert(ReadLE64(defaultSecretUInt64[5]) == DefaultSecretUInt64_5); 129Debug.Assert(ReadLE64(defaultSecretUInt64[6]) == DefaultSecretUInt64_6); 130Debug.Assert(ReadLE64(defaultSecretUInt64[7]) == DefaultSecretUInt64_7); 131Debug.Assert(ReadLE64(defaultSecretUInt64[8]) == DefaultSecretUInt64_8); 132Debug.Assert(ReadLE64(defaultSecretUInt64[9]) == DefaultSecretUInt64_9); 133Debug.Assert(ReadLE64(defaultSecretUInt64[10]) == DefaultSecretUInt64_10); 134Debug.Assert(ReadLE64(defaultSecretUInt64[11]) == DefaultSecretUInt64_11); 135Debug.Assert(ReadLE64(defaultSecretUInt64[12]) == DefaultSecretUInt64_12); 136Debug.Assert(ReadLE64(defaultSecretUInt64[13]) == DefaultSecretUInt64_13); 137Debug.Assert(ReadLE64(defaultSecretUInt64[14]) == DefaultSecretUInt64_14); 138Debug.Assert(ReadLE64(defaultSecretUInt64[15]) == DefaultSecretUInt64_15); 141Debug.Assert(ReadLE64(defaultSecret3UInt64[0]) == DefaultSecret3UInt64_0); 142Debug.Assert(ReadLE64(defaultSecret3UInt64[1]) == DefaultSecret3UInt64_1); 143Debug.Assert(ReadLE64(defaultSecret3UInt64[2]) == DefaultSecret3UInt64_2); 144Debug.Assert(ReadLE64(defaultSecret3UInt64[3]) == DefaultSecret3UInt64_3); 145Debug.Assert(ReadLE64(defaultSecret3UInt64[4]) == DefaultSecret3UInt64_4); 146Debug.Assert(ReadLE64(defaultSecret3UInt64[5]) == DefaultSecret3UInt64_5); 147Debug.Assert(ReadLE64(defaultSecret3UInt64[6]) == DefaultSecret3UInt64_6); 148Debug.Assert(ReadLE64(defaultSecret3UInt64[7]) == DefaultSecret3UInt64_7); 149Debug.Assert(ReadLE64(defaultSecret3UInt64[8]) == DefaultSecret3UInt64_8); 150Debug.Assert(ReadLE64(defaultSecret3UInt64[9]) == DefaultSecret3UInt64_9); 151Debug.Assert(ReadLE64(defaultSecret3UInt64[10]) == DefaultSecret3UInt64_10); 152Debug.Assert(ReadLE64(defaultSecret3UInt64[11]) == DefaultSecret3UInt64_11); 153Debug.Assert(ReadLE64(defaultSecret3UInt64[12]) == DefaultSecret3UInt64_12); 154Debug.Assert(ReadLE64(defaultSecret3UInt64[13]) == DefaultSecret3UInt64_13); 204Debug.Assert(length > 240); 220Debug.Assert(stripes <= stripesPerBlock); // can handle max 1 scramble per invocation 221Debug.Assert(stripesSoFar < stripesPerBlock); 242Debug.Assert(state.BufferedCount <= InternalBufferLengthBytes); 272Debug.Assert(sourceIndex < source.Length); 278Debug.Assert(NumStripesPerBlock >= state.StripesProcessedInCurrentBlock); 282Debug.Assert(stripesToEnd <= stripes); 301Debug.Assert(sourceIndex < source.Length); // at least some bytes left 323Debug.Assert(sourceIndex < source.Length); 324Debug.Assert(remaining.Length <= InternalBufferLengthBytes); 325Debug.Assert(state.BufferedCount == 0); 362Debug.Assert(state.BufferedCount > 0); 778Debug.Assert(shift >= 0 && shift < 64);
System.IO.IsolatedStorage (2)
System\IO\IsolatedStorage\IsolatedStorageFile.cs (2)
609Debug.Assert(parentDirectory != null); 628Debug.Assert(parentDirectory != null);
System.IO.MemoryMappedFiles (19)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
13Debug.Assert(errorInfo.Error != Error.SUCCESS);
System\IO\MemoryMappedFiles\MemoryMappedFile.cs (10)
20Debug.Assert(handle != null); 21Debug.Assert(!handle.IsClosed); 22Debug.Assert(!handle.IsInvalid); 30Debug.Assert(handle != null); 31Debug.Assert(!handle.IsClosed); 32Debug.Assert(!handle.IsInvalid); 33Debug.Assert(fileHandle != null); 165Debug.Assert(handle != null); 166Debug.Assert(!handle.IsInvalid); 500Debug.Assert(access == MemoryMappedFileAccess.Write);
System\IO\MemoryMappedFiles\MemoryMappedFile.Unix.cs (2)
263Debug.Assert(charsWritten == 32); 266Debug.Assert(Encoding.UTF8.GetByteCount(span) <= MaxNameLength); // the standard uses Utf8
System\IO\MemoryMappedFiles\MemoryMappedView.cs (4)
18Debug.Assert(viewHandle != null); 75Debug.Assert(size >= 0); 76Debug.Assert(offset >= 0); 77Debug.Assert(allocationGranularity > 0);
System\IO\MemoryMappedFiles\MemoryMappedView.Unix.cs (2)
39Debug.Assert(pageSize > 0); 57Debug.Assert(!fd.IsInvalid);
System.IO.Pipelines (30)
System\IO\Pipelines\BufferSegment.cs (5)
27Debug.Assert(value <= AvailableMemory.Length); 83Debug.Assert(_array != null); 109Debug.Assert(segment != null); 110Debug.Assert(Next == null); 118Debug.Assert(segment.NextSegment != null);
System\IO\Pipelines\Pipe.cs (9)
232Debug.Assert(segment.MemoryOwner is null); 233Debug.Assert(sizeHint >= 0); 301Debug.Assert(_writingHead != null); 416Debug.Assert(_writerAwaitable.IsCompleted || _readerAwaitable.IsCompleted); 805Debug.Assert(completionCallbacks != null); 839Debug.Assert(completionData.SynchronizationContext != null || completionData.ExecutionContext != null); 871Debug.Assert(completionData.ExecutionContext != null); 974Debug.Assert(_readTail != null); 1102Debug.Assert(_writingHead != null);
System\IO\Pipelines\PipeAwaitable.cs (3)
106Debug.Assert(_completion == null); 107Debug.Assert(_completionState == null); 108Debug.Assert(_schedulingContext == null);
System\IO\Pipelines\PipeCompletion.cs (3)
71Debug.Assert(IsCompleted); 86Debug.Assert(IsCompleted); 87Debug.Assert(_callbacks == null);
System\IO\Pipelines\PipeReaderStream.cs (1)
18Debug.Assert(pipeReader != null);
System\IO\Pipelines\PipeWriterStream.cs (1)
16Debug.Assert(pipeWriter != null);
System\IO\Pipelines\StreamPipeReader.cs (4)
112Debug.Assert(_bufferedBytes >= 0); 273Debug.Assert(length + reader._readTail.End <= reader._readTail.AvailableMemory.Length); 495Debug.Assert(_readTail == null); 501Debug.Assert(_readTail != null);
System\IO\Pipelines\StreamPipeWriter.cs (4)
132Debug.Assert(_tail != null); 154Debug.Assert(sizeHint >= 0); 304Debug.Assert(_tail != null); 381Debug.Assert(_tail != null);
System.IO.Pipes (12)
Microsoft\Win32\SafeHandles\SafePipeHandle.Unix.cs (2)
52Debug.Assert(!IsInvalid); 110Debug.Assert(socket != null);
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
13Debug.Assert(errorInfo.Error != Error.SUCCESS);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
69Debug.Assert(passwd.Name != null);
System\IO\Pipes\NamedPipeServerStream.Unix.cs (5)
253Debug.Assert(!string.IsNullOrEmpty(path)); 254Debug.Assert(maxCount >= 1); 283Debug.Assert(server._currentCount >= 0 && server._currentCount < server._maxCount); 293Debug.Assert(_currentCount >= 1 && _currentCount <= _maxCount); 298Debug.Assert(removed);
System\IO\Pipes\PipeStream.Unix.cs (3)
258Debug.Assert(_handle != null); 282Debug.Assert(_handle != null); 322Debug.Assert(bytesWritten > 0 && bytesWritten <= source.Length);
System.Linq (191)
System\Linq\AppendPrepend.cs (8)
46Debug.Assert(source is not null); 52Debug.Assert(_enumerator is null); 62Debug.Assert(_enumerator is not null); 179Debug.Assert(prepended is not null || appended is not null); 180Debug.Assert(prependCount > 0 || appendCount > 0); 181Debug.Assert(prependCount + appendCount >= 2); 182Debug.Assert((prepended?.GetCount() ?? 0) == prependCount); 183Debug.Assert((appended?.GetCount() ?? 0) == appendCount);
System\Linq\AppendPrepend.SpeedOpt.cs (2)
15Debug.Assert(GetCount(onlyIfCheap: true) == -1); 185Debug.Assert(GetCount(onlyIfCheap: true) == -1);
System\Linq\Cast.cs (1)
62Debug.Assert(_enumerator is not null);
System\Linq\Chunk.cs (1)
111Debug.Assert(local.Length == size);
System\Linq\Concat.cs (10)
61Debug.Assert(first is not null); 62Debug.Assert(second is not null); 80Debug.Assert(index >= 0 && index <= 2); 142Debug.Assert(tail is not null); 143Debug.Assert(head is not null); 144Debug.Assert(headIndex >= 2); 172Debug.Assert(index >= 0); 190Debug.Assert(index == 0 || index == 1); 191Debug.Assert(node._tail is Concat2Iterator<TSource>); 243Debug.Assert(_enumerator is not null);
System\Linq\Concat.SpeedOpt.cs (5)
173Debug.Assert(!_hasOnlyCollections || collection is not null); 183Debug.Assert(node._tail is Concat2Iterator<TSource>); 193Debug.Assert(!_hasOnlyCollections); 225Debug.Assert(_hasOnlyCollections); 228Debug.Assert(count >= 0);
System\Linq\DefaultIfEmpty.cs (2)
37Debug.Assert(source is not null); 63Debug.Assert(_enumerator is not null);
System\Linq\Distinct.cs (3)
104Debug.Assert(source is not null); 130Debug.Assert(_enumerator is not null); 131Debug.Assert(_set is not null);
System\Linq\ElementAt.cs (2)
134Debug.Assert(source is not null); 157Debug.Assert(source is not null);
System\Linq\Grouping.cs (12)
161Debug.Assert(_g is not null); 162Debug.Assert(_lookup is not null); 175Debug.Assert(_g is not null); 217Debug.Assert(_g is not null); 218Debug.Assert(_lookup is not null); 231Debug.Assert(_g is not null); 273Debug.Assert(_g is not null); 274Debug.Assert(_lookup is not null); 287Debug.Assert(_g is not null); 326Debug.Assert(_g is not null); 327Debug.Assert(_lookup is not null); 340Debug.Assert(_g is not null);
System\Linq\Lookup.cs (9)
84Debug.Assert(source is not null); 85Debug.Assert(keySelector is not null); 86Debug.Assert(elementSelector is not null); 99Debug.Assert(source is not null); 100Debug.Assert(keySelector is not null); 147Debug.Assert(g is not null); 166Debug.Assert(g is not null); 188Debug.Assert(g is not null); 279Debug.Assert(g is not null);
System\Linq\Lookup.SpeedOpt.cs (1)
21Debug.Assert(g is not null);
System\Linq\OfType.cs (1)
47Debug.Assert(_enumerator is not null);
System\Linq\OfType.SpeedOpt.cs (1)
155Debug.Assert(o is TResult);
System\Linq\OrderedEnumerable.cs (17)
130Debug.Assert(_buffer is not null); 131Debug.Assert(_map is not null); 132Debug.Assert(_map.Length == _buffer.Length); 175Debug.Assert(TypeIsImplicitlyStable<TElement>()); 204Debug.Assert(buffer is not null); 417Debug.Assert(typeof(TKey) == typeof(TElement)); 427Debug.Assert(keys is not null); 448Debug.Assert(typeof(TKey).IsValueType); 449Debug.Assert(_comparer == Comparer<TKey>.Default); 450Debug.Assert(_next is null); 451Debug.Assert(!_descending); 454Debug.Assert(keys is not null); 464Debug.Assert(typeof(TKey).IsValueType); 465Debug.Assert(_comparer == Comparer<TKey>.Default); 466Debug.Assert(_next is null); 467Debug.Assert(_descending); 470Debug.Assert(keys is not null);
System\Linq\OrderedEnumerable.SpeedOpt.cs (2)
468Debug.Assert(_buffer is not null); 469Debug.Assert(_map is not null);
System\Linq\PartialArrayEnumerator.cs (1)
19Debug.Assert(array is not null);
System\Linq\Range.cs (2)
41Debug.Assert(count > 0); 55Debug.Assert(_start != _end);
System\Linq\Repeat.cs (1)
37Debug.Assert(count > 0);
System\Linq\Repeat.SpeedOpt.cs (3)
38Debug.Assert(count > 0); 50Debug.Assert(count > 0); 86Debug.Assert(_count > 0);
System\Linq\Reverse.cs (3)
37Debug.Assert(source is not null); 51Debug.Assert(_state == -1 || _state == 0); 73Debug.Assert(_buffer is not null);
System\Linq\SegmentedArrayBuilder.cs (1)
61Debug.Assert(segmentsCount > 0);
System\Linq\Select.cs (11)
101Debug.Assert(source is not null); 102Debug.Assert(selector is not null); 130Debug.Assert(_enumerator is not null); 161Debug.Assert(source is not null); 162Debug.Assert(selector is not null); 163Debug.Assert(source.Length > 0); // Caller should check this beforehand and return a cached result 205Debug.Assert(source is not null); 206Debug.Assert(selector is not null); 255Debug.Assert(source is not null); 256Debug.Assert(selector is not null); 274Debug.Assert(_enumerator is not null);
System\Linq\Select.SpeedOpt.cs (32)
139Debug.Assert(source.Length > 0); 150Debug.Assert(source.Length > 0); 184Debug.Assert(count > 0); 195Debug.Assert(count > 0); 216Debug.Assert(_source.Length > 0); // See assert in constructor 224Debug.Assert(_source.Length > 0); // See assert in constructor 239Debug.Assert(start < end); 240Debug.Assert((uint)(end - start) <= (uint)int.MaxValue); 241Debug.Assert(selector is not null); 260Debug.Assert(_start < _end - index); 309Debug.Assert(count > 0); 321Debug.Assert(count > 0); 345Debug.Assert(_end > _start); 352Debug.Assert(_end > _start); 412Debug.Assert(count > 0); 418Debug.Assert(count > 0); 515Debug.Assert(count > 0); 521Debug.Assert(count > 0); 576Debug.Assert(source is not null); 577Debug.Assert(selector is not null); 594Debug.Assert(_enumerator is not null); 624Debug.Assert(count > 0); 631Debug.Assert(count > 0); 662Debug.Assert(_source.GetCount(onlyIfCheap: true) == -1); 681Debug.Assert(count > 0); 682Debug.Assert(count == _source.GetCount(onlyIfCheap: true)); 774Debug.Assert(source is not null); 775Debug.Assert(selector is not null); 776Debug.Assert(minIndexInclusive >= 0); 777Debug.Assert(minIndexInclusive <= maxIndexInclusive); 809Debug.Assert(count > 0); 816Debug.Assert(count > 0);
System\Linq\SelectMany.cs (4)
155Debug.Assert(source is not null); 156Debug.Assert(selector is not null); 195Debug.Assert(_sourceEnumerator is not null); 209Debug.Assert(_subEnumerator is not null);
System\Linq\SingleLinkedNode.cs (4)
30Debug.Assert(linked is not null); 74Debug.Assert(index >= 0 && index < GetCount()); 80Debug.Assert(node is not null); 92Debug.Assert(count == GetCount());
System\Linq\SkipTake.SpeedOpt.cs (12)
24Debug.Assert(source is not null); 25Debug.Assert(minIndexInclusive >= 0); 26Debug.Assert(minIndexInclusive <= maxIndexInclusive); 212Debug.Assert(source is not null); 214Debug.Assert(minIndexInclusive >= 0); 215Debug.Assert(maxIndexInclusive >= -1); 220Debug.Assert(maxIndexInclusive == -1 || minIndexInclusive <= maxIndexInclusive); 296Debug.Assert(_enumerator is not null); 306Debug.Assert(_enumerator is not null); 409Debug.Assert(!HasLimit || Limit > 0); 521Debug.Assert(index >= 0); 527Debug.Assert(en is not null);
System\Linq\Sum.cs (3)
83Debug.Assert(span.Length >= Vector<T>.Count * 4); 84Debug.Assert(Vector<T>.Count > 2); 85Debug.Assert(Vector.IsHardwareAccelerated);
System\Linq\Take.cs (8)
51Debug.Assert(startIndex >= 0); 52Debug.Assert(endIndex >= 0); 73Debug.Assert(source is not null); 74Debug.Assert(isStartIndexFromEnd || isEndIndexFromEnd); 75Debug.Assert(isStartIndexFromEnd 135Debug.Assert(queue.Count == Math.Min(count, startIndex)); 140Debug.Assert(endIndex - startIndex <= queue.Count); 149Debug.Assert(!isStartIndexFromEnd && isEndIndexFromEnd);
System\Linq\Take.SpeedOpt.cs (4)
13Debug.Assert(source is not null && !IsEmptyArray(source)); 14Debug.Assert(count > 0); 24Debug.Assert(source is not null && !IsEmptyArray(source)); 25Debug.Assert(startIndex >= 0 && startIndex < endIndex);
System\Linq\Union.cs (8)
137Debug.Assert(_enumerator is not null); 148Debug.Assert(_enumerator is not null); 149Debug.Assert(_set is not null); 220Debug.Assert(first is not null); 221Debug.Assert(second is not null); 230Debug.Assert(index >= 0 && index <= 2); 258Debug.Assert(headIndex >= 2); 259Debug.Assert(sources?.GetCount() == headIndex + 1);
System\Linq\Where.cs (17)
96Debug.Assert(source is not null); 97Debug.Assert(predicate is not null); 124Debug.Assert(_enumerator is not null); 160Debug.Assert(source is not null && source.Length > 0); 161Debug.Assert(predicate is not null); 208Debug.Assert(source is not null); 209Debug.Assert(predicate is not null); 263Debug.Assert(source is not null && source.Length > 0); 264Debug.Assert(predicate is not null); 265Debug.Assert(selector is not null); 312Debug.Assert(source is not null); 313Debug.Assert(predicate is not null); 314Debug.Assert(selector is not null); 367Debug.Assert(source is not null); 368Debug.Assert(predicate is not null); 369Debug.Assert(selector is not null); 398Debug.Assert(_enumerator is not null);
System.Linq.Expressions (450)
src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (7)
25Debug.Assert(capacity >= 0); 54Debug.Assert(index >= 0 && index < _count); 78Debug.Assert(_count > 0); 87Debug.Assert(_count > 0); 104Debug.Assert(_array != null); // Nonzero _count should imply this 134Debug.Assert(_count < Capacity); 141Debug.Assert(minimum > Capacity);
System\Dynamic\BindingRestrictions.cs (5)
77Debug.Assert(obj != null); 241Debug.Assert(expression != null); 262Debug.Assert(parameter != null); 263Debug.Assert(type != null); 285Debug.Assert(parameter != null);
System\Dynamic\DynamicObject.cs (2)
579Debug.Assert(binder is ConvertBinder && fallbackInvoke == null); 583Debug.Assert(convert.Method == null);
System\Dynamic\ExpandoObject.cs (6)
144Debug.Assert(data[exactMatch] == Uninitialized); 154Debug.Assert(index != ExpandoObject.NoMatch); 242Debug.Assert(index >= 0 && index <= _data.Length); 265Debug.Assert(oldClass != newClass); 930Debug.Assert(originalClass != klass); 982Debug.Assert(index != ExpandoObject.NoMatch);
System\Dynamic\Utils\ContractUtils.cs (6)
41Debug.Assert(!string.IsNullOrEmpty(paramName)); 67Debug.Assert(!string.IsNullOrEmpty(paramName)); 110Debug.Assert(!string.IsNullOrEmpty(arrayName)); 137Debug.Assert(!string.IsNullOrEmpty(offsetName)); 138Debug.Assert(!string.IsNullOrEmpty(countName)); 139Debug.Assert(array != null);
System\Dynamic\Utils\ExpressionUtils.cs (3)
102Debug.Assert(nodeKind == ExpressionType.Invoke || nodeKind == ExpressionType.Call || nodeKind == ExpressionType.Dynamic || nodeKind == ExpressionType.New); 248Debug.Assert(current != null); 264Debug.Assert(current != null);
System\Dynamic\Utils\ListArgumentProvider.cs (1)
97Debug.Assert(n > 0);
System\Dynamic\Utils\TypeExtensions.cs (2)
24Debug.Assert(types != null); 40Debug.Assert(argTypes != null);
System\Dynamic\Utils\TypeUtils.cs (25)
95Debug.Assert(nullableType.IsNullableType()); 290Debug.Assert(source != null && dest != null); 321Debug.Assert(source != null && dest != null); 359Debug.Assert(source != typeof(object) && dest != typeof(object)); 441Debug.Assert(source.IsArray); 468Debug.Assert(dest.IsSZArray); 495Debug.Assert(t != null); 501Debug.Assert(t != null); 507Debug.Assert(t != null); 513Debug.Assert(t != null); 519Debug.Assert(source != null && dest != null); 547Debug.Assert(genericParameters != null); 548Debug.Assert(sourceArguments != null); 549Debug.Assert(destArguments != null); 550Debug.Assert(genericParameters.Length == sourceArguments.Length); 551Debug.Assert(genericParameters.Length == destArguments.Length); 558Debug.Assert(sourceArgument != null && destArgument != null); 568Debug.Assert(genericParameter != null); 670Debug.Assert(left.IsValueType); 868Debug.Assert(!definition.IsInterface); 896Debug.Assert(name == "op_False" || name == "op_True"); 969Debug.Assert(typeof(Delegate).IsAssignableFrom(delegateType)); 1010Debug.Assert(arrayType.IsArray); 1018Debug.Assert(arrayType.IsArray); 1026Debug.Assert(arrayType.IsArray);
System\Linq\Expressions\BinaryExpression.cs (13)
137Debug.Assert(IsOpAssignment(op)); 315Debug.Assert(nodeType != ExpressionType.Assign); 318Debug.Assert(method == null && TypeUtils.AreEquivalent(type, right.Type) && nodeType == ExpressionType.Coalesce); 395Debug.Assert(IsLiftedLogical); 401Debug.Assert(opTrueFalse != null); 633System.Diagnostics.Debug.Assert(method != null); 763Debug.Assert(method != null); 1393Debug.Assert(typeof(System.MulticastDelegate).IsAssignableFrom(delegateType) && delegateType != typeof(System.MulticastDelegate)); 1400Debug.Assert(pms.Length == conversion.ParameterCount); 1549Debug.Assert(typeof(System.MulticastDelegate).IsAssignableFrom(delegateType) && delegateType != typeof(System.MulticastDelegate)); 1552Debug.Assert(pms.Length == conversion.ParameterCount); 1561Debug.Assert(method != null); 2750Debug.Assert(method != null);
System\Linq\Expressions\BlockExpression.cs (31)
210Debug.Assert(expressions != null); 241Debug.Assert(args != null); 242Debug.Assert(args.Length == 2); 243Debug.Assert(variables == null || variables.Count == 0); 263Debug.Assert(expressions != null); 307Debug.Assert(args != null); 308Debug.Assert(args.Length == 3); 309Debug.Assert(variables == null || variables.Count == 0); 330Debug.Assert(expressions != null); 379Debug.Assert(args != null); 380Debug.Assert(args.Length == 4); 381Debug.Assert(variables == null || variables.Count == 0); 414Debug.Assert(expressions != null); 457Debug.Assert(args != null); 458Debug.Assert(args.Length == 5); 459Debug.Assert(variables == null || variables.Count == 0); 471Debug.Assert(expressions.Count != 0); 481Debug.Assert(index >= 0 && index < _expressions.Count); 495Debug.Assert(variables == null || variables.Count == 0); 496Debug.Assert(args != null); 554Debug.Assert(expressions != null); 590Debug.Assert(variables!.Count == Variables.Count); 594Debug.Assert(args.Length == 1); 595Debug.Assert(variables == null || variables.Count == Variables.Count); 629Debug.Assert(variables!.Count == Variables.Count); 633Debug.Assert(args.Length == ExpressionCount); 634Debug.Assert(variables == null || variables.Count == Variables.Count); 654Debug.Assert(variables!.Count == Variables.Count); 658Debug.Assert(args.Length == ExpressionCount); 659Debug.Assert(variables == null || variables.Count == Variables.Count); 770Debug.Assert(n > 0);
System\Linq\Expressions\Compiler\BoundConstants.cs (1)
97Debug.Assert(!ILGen.CanEmitConstant(value, type));
System\Linq\Expressions\Compiler\CompilerScope.cs (3)
187Debug.Assert(locals != null); 288Debug.Assert(_parent == null && parent != this); 402Debug.Assert(ShouldCache(v) && !_locals.ContainsKey(v));
System\Linq\Expressions\Compiler\DelegateHelpers.Generated.cs (2)
136Debug.Assert(types != null && types.Length > 0); 183Debug.Assert(result != null);
System\Linq\Expressions\Compiler\ILGen.cs (45)
21Debug.Assert(methodBase is MethodInfo || methodBase is ConstructorInfo); 38Debug.Assert(index >= 0); 39Debug.Assert(index < ushort.MaxValue); 46Debug.Assert(index >= 0); 47Debug.Assert(index < ushort.MaxValue); 54Debug.Assert(index >= 0); 55Debug.Assert(index < ushort.MaxValue); 65Debug.Assert(type != null); 118Debug.Assert(type != null); 163Debug.Assert(type != null); 215Debug.Assert(type != null); 258Debug.Assert(type != null); 270Debug.Assert(fi != null); 277Debug.Assert(fi != null); 284Debug.Assert(fi != null); 291Debug.Assert(ci != null); 292Debug.Assert(!ci.DeclaringType!.ContainsGenericParameters); 308Debug.Assert(value != null); 484Debug.Assert(value != null); 559Debug.Assert(typeFrom != typeof(void) && typeTo != typeof(void)); 603Debug.Assert(!typeTo.IsValueType); 652Debug.Assert(typeFrom != typeTo); 789Debug.Assert(typeFrom.IsNullableType()); 790Debug.Assert(typeTo.IsNullableType()); 823Debug.Assert(!typeFrom.IsNullableType()); 824Debug.Assert(typeTo.IsNullableType()); 833Debug.Assert(typeFrom.IsNullableType()); 834Debug.Assert(!typeTo.IsNullableType()); 844Debug.Assert(typeFrom.IsNullableType()); 845Debug.Assert(!typeTo.IsNullableType()); 846Debug.Assert(typeTo.IsValueType); 859Debug.Assert(typeFrom.IsNullableType()); 870Debug.Assert(isTypeFromNullable || isTypeToNullable); 881Debug.Assert(nullableType.IsNullableType()); 884Debug.Assert(nullableType.IsValueType); 890Debug.Assert(nullableType.IsNullableType()); 893Debug.Assert(nullableType.IsValueType); 899Debug.Assert(nullableType.IsNullableType()); 902Debug.Assert(nullableType.IsValueType); 936Debug.Assert(elementType != null); 937Debug.Assert(count >= 0); 952Debug.Assert(arrayType != null); 953Debug.Assert(arrayType.IsArray); 967Debug.Assert(ci != null); 1069Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Compiler\LabelInfo.cs (1)
382Debug.Assert(CanJumpInto);
System\Linq\Expressions\Compiler\LambdaCompiler.Address.cs (6)
24Debug.Assert(node != null); 68Debug.Assert(node.NodeType == ExpressionType.ArrayIndex && node.Method == null); 74Debug.Assert(node.Right.Type == typeof(int)); 209Debug.Assert(node.NodeType == ExpressionType.Unbox); 210Debug.Assert(type.IsValueType); 219Debug.Assert(TypeUtils.AreReferenceAssignable(type, node.Type));
System\Linq\Expressions\Compiler\LambdaCompiler.Binary.cs (21)
24Debug.Assert(b.NodeType != ExpressionType.AndAlso && b.NodeType != ExpressionType.OrElse && b.NodeType != ExpressionType.Coalesce); 41Debug.Assert(!b.IsLiftedToNull || b.Type == typeof(bool?)); 71Debug.Assert(e.Type.IsNullableType()); 72Debug.Assert(op == ExpressionType.Equal || op == ExpressionType.NotEqual); 107Debug.Assert(mc.Type == typeof(bool)); 108Debug.Assert(b.NodeType == ExpressionType.Equal 118Debug.Assert(TypeUtils.AreReferenceAssignable(p1.Type, b.Left.Type.GetNonNullableType())); 119Debug.Assert(TypeUtils.AreReferenceAssignable(p2.Type, b.Right.Type.GetNonNullableType())); 131Debug.Assert(op != ExpressionType.Coalesce); 134Debug.Assert(rightType == typeof(int)); 150Debug.Assert(!leftType.IsNullableType()); 151Debug.Assert(!rightType.IsNullableType()); 152Debug.Assert(leftType.IsPrimitive || (op == ExpressionType.Equal || op == ExpressionType.NotEqual) && (!leftType.IsValueType || leftType.IsEnum)); 237Debug.Assert(rightType == typeof(int)); 242Debug.Assert(rightType == typeof(int)); 268Debug.Assert(!resultType.IsNullableType()); 289Debug.Assert(leftType.IsNullableType() || rightType.IsNullableType()); 331Debug.Assert(leftType == rightType); 334Debug.Assert(resultType == typeof(bool?)); 339Debug.Assert(resultType == typeof(bool)); 422Debug.Assert(leftIsNullable || rightIsNullable);
System\Linq\Expressions\Compiler\LambdaCompiler.ControlFlow.cs (3)
47Debug.Assert(_labelBlock != null && _labelBlock.Kind == kind); 54Debug.Assert(node.Target != null); 72Debug.Assert(label != null);
System\Linq\Expressions\Compiler\LambdaCompiler.cs (3)
231Debug.Assert(local != null); 263Debug.Assert(_method is DynamicMethod); 288Debug.Assert(_method is DynamicMethod);
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (23)
39Debug.Assert(newValue == CompilationFlags.EmitAsTail || newValue == CompilationFlags.EmitAsMiddle || newValue == CompilationFlags.EmitAsNoTail); 49Debug.Assert(newValue == CompilationFlags.EmitExpressionStart || newValue == CompilationFlags.EmitNoExpressionStart); 59Debug.Assert(newValue == CompilationFlags.EmitAsDefaultType || newValue == CompilationFlags.EmitAsVoidType); 85Debug.Assert(node != null); 136Debug.Assert(TypeUtils.AreReferenceAssignable(type, node.Type)); 214Debug.Assert(wb.Count > 0); 251Debug.Assert(!node.IsByRef); 376Debug.Assert(obj != null); 516Debug.Assert(args.ArgumentCount + skipParameters == pis.Length); 567Debug.Assert(value != null); 588Debug.Assert(_method is DynamicMethod); 616Debug.Assert(siteType.IsGenericType && siteType.GetGenericTypeDefinition() == typeof(CallSite<>)); 681Debug.Assert(!type.IsValueType); 688Debug.Assert(result == AnalyzeTypeIsResult.Unknown); 787Debug.Assert(!node.IsByRef); 819Debug.Assert(member is PropertyInfo); 863Debug.Assert(member is PropertyInfo); 881Debug.Assert(instance.NodeType == ExpressionType.Parameter); 882Debug.Assert(type!.IsValueType); 966Debug.Assert(binding.Member is PropertyInfo); 1104Debug.Assert(member is FieldInfo || member is PropertyInfo); 1114Debug.Assert(TypeUtils.AreEquivalent(resultType.GetNonNullableType(), mc.Type.GetNonNullableType())); 1186Debug.Assert(nodeType == ExpressionType.LessThan
System\Linq\Expressions\Compiler\LambdaCompiler.Generated.cs (1)
24Debug.Assert(node != null);
System\Linq\Expressions\Compiler\LambdaCompiler.Lambda.cs (4)
28Debug.Assert(_method is DynamicMethod); 99Debug.Assert(dynamicMethod != null); 133Debug.Assert(_method is DynamicMethod); 246Debug.Assert(_labelBlock.Parent == null && _labelBlock.Kind == LabelScopeKind.Lambda);
System\Linq\Expressions\Compiler\LambdaCompiler.Logical.cs (17)
18Debug.Assert(node.Test.Type == typeof(bool)); 89Debug.Assert(b.Method == null); 97Debug.Assert(!b.Left.Type.IsValueType); 112Debug.Assert(b.Method == null); 126Debug.Assert(b.Conversion.ParameterCount == 1); 128Debug.Assert(p.Type.IsAssignableFrom(b.Left.Type) || 189Debug.Assert(b.Conversion!.ParameterCount == 1); 226Debug.Assert(!b.Left.Type.IsValueType); 278Debug.Assert(b.Method!.IsStatic); 384Debug.Assert(b.Method!.IsStatic); 458Debug.Assert(node.Type == typeof(bool)); 508Debug.Assert(node.NodeType == ExpressionType.Equal || node.NodeType == ExpressionType.NotEqual); 509Debug.Assert(!node.IsLiftedToNull); 530Debug.Assert(!node.Right.Type.IsValueType); 544Debug.Assert(!node.Left.Type.IsValueType); 583Debug.Assert(node.NodeType == ExpressionType.AndAlso || node.NodeType == ExpressionType.OrElse); 584Debug.Assert(!node.IsLiftedToNull);
System\Linq\Expressions\Compiler\LambdaCompiler.Statements.cs (6)
107Debug.Assert(_scope.Node == node); 179Debug.Assert(node.Type == typeof(void)); 222Debug.Assert(TypeUtils.AreReferenceAssignable(testValue.Type, test.Type)); 295Debug.Assert(key > buckets[buckets.Count - 1].Key); 623Debug.Assert(key == bucket[bucket.Count - 1].Key + 1); 624Debug.Assert(slot == jmpLabels.Length);
System\Linq\Expressions\Compiler\LambdaCompiler.Unary.cs (7)
34Debug.Assert(typeof(LambdaExpression).IsAssignableFrom(quote.Type)); 75Debug.Assert(type == node.Operand.Type); 149Debug.Assert(TypeUtils.AreEquivalent(operandType, resultType)); 274Debug.Assert(node.Type.IsValueType); 309Debug.Assert(pis != null && pis.Length == 1); 317Debug.Assert(operand.Method == null); 321Debug.Assert(node.Method == null);
System\Linq\Expressions\Compiler\StackSpiller.ChildRewriter.cs (3)
122Debug.Assert(!_done); 379Debug.Assert(_comma!.Capacity == _comma.Count + 1); 450Debug.Assert(first == 0);
System\Linq\Expressions\Compiler\StackSpiller.cs (3)
133Debug.Assert(result.Node != null); 1043Debug.Assert(original != null); 1044Debug.Assert(max < original.Count);
System\Linq\Expressions\Compiler\StackSpiller.Temps.cs (6)
143Debug.Assert(_freeTemps == null || !_freeTemps.Contains(temp)); 144Debug.Assert(_usedTemps == null || !_usedTemps.Contains(temp)); 160Debug.Assert(_freeTemps == null || !_freeTemps.Contains(temp)); 190Debug.Assert(_usedTemps == null || mark <= _usedTemps.Count); 192Debug.Assert(mark == 0 || _usedTemps != null); 211Debug.Assert(_usedTemps == null || _usedTemps.Count == 0);
System\Linq\Expressions\Compiler\VariableBinder.cs (1)
221Debug.Assert(referenceScope != null);
System\Linq\Expressions\DebugViewWriter.cs (8)
99Debug.Assert(string.IsNullOrEmpty(le.Name)); 105Debug.Assert(string.IsNullOrEmpty(p.Name)); 111Debug.Assert(string.IsNullOrEmpty(target.Name)); 120Debug.Assert(node != null); 121Debug.Assert(writer != null); 555Debug.Assert(parent != null); 598Debug.Assert(child.NodeType == parent.NodeType); 611Debug.Assert(binary != null);
System\Linq\Expressions\DynamicExpression.cs (7)
24Debug.Assert(delegateType.GetInvokeMethod().GetReturnType() == typeof(object) || GetType() != typeof(DynamicExpression)); 516Debug.Assert(args.Length == ((IArgumentProvider)this).ArgumentCount); 527Debug.Assert(delegateType.GetInvokeMethod().GetReturnType() == returnType); 574Debug.Assert(args.Length == 1); 643Debug.Assert(args.Length == 2); 718Debug.Assert(args.Length == 3); 799Debug.Assert(args.Length == 4);
System\Linq\Expressions\Expression.cs (2)
240Debug.Assert(items != null); 272Debug.Assert(member is FieldInfo);
System\Linq\Expressions\ExpressionStringBuilder.cs (6)
71Debug.Assert(node != null); 79Debug.Assert(node != null); 87Debug.Assert(node != null); 98Debug.Assert(node != null); 109Debug.Assert(node != null); 757Debug.Assert(node.Indexer != null);
System\Linq\Expressions\IndexExpression.cs (4)
30Debug.Assert(instance != null && instance.Type.IsArray); 31Debug.Assert(instance.Type.GetArrayRank() == arguments.Count); 122Debug.Assert(instance != null); 123Debug.Assert(arguments == null || arguments.Length == _arguments.Count);
System\Linq\Expressions\Interpreter\AddInstruction.cs (2)
165Debug.Assert(type.IsArithmetic()); 301Debug.Assert(type.IsArithmetic());
System\Linq\Expressions\Interpreter\BranchLabel.cs (4)
46Debug.Assert(_targetIndex != UnknownIndex && _stackDepth != UnknownDepth && _continuationStackDepth != UnknownDepth); 70Debug.Assert(((_targetIndex == UnknownIndex) == (_stackDepth == UnknownDepth))); 71Debug.Assert(((_targetIndex == UnknownIndex) == (_continuationStackDepth == UnknownDepth))); 86Debug.Assert(_targetIndex != UnknownIndex);
System\Linq\Expressions\Interpreter\CallInstruction.Generated.cs (1)
137Debug.Assert(pi.Length == 2);
System\Linq\Expressions\Interpreter\ControlFlowInstructions.cs (12)
25Debug.Assert(_offset == Unknown && offset != Unknown); 59Debug.Assert(_offset != Unknown); 81Debug.Assert(_offset != Unknown); 104Debug.Assert(_offset != Unknown); 148Debug.Assert(_offset != Unknown); 166Debug.Assert(_labelIndex != UnknownInstrIndex); 172Debug.Assert(_labelIndex != UnknownInstrIndex); 179Debug.Assert(_labelIndex != UnknownInstrIndex); 325Debug.Assert(!(unwrappedException is RethrowException)); 415Debug.Assert(tryHandler != null); 567Debug.Assert(!frame.IsJumpHappened()); 590Debug.Assert(!frame.IsJumpHappened());
System\Linq\Expressions\Interpreter\DecrementInstruction.cs (1)
157Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\DefaultValueInstruction.cs (2)
17Debug.Assert(type.IsValueType); 18Debug.Assert(!type.IsNullableType());
System\Linq\Expressions\Interpreter\DivInstruction.cs (1)
165Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\EqualInstruction.cs (2)
528Debug.Assert(type.GetNonNullableType().GetTypeCode() == TypeCode.Double); 550Debug.Assert(type.IsNullableOrReferenceType());
System\Linq\Expressions\Interpreter\FieldOperations.cs (2)
27Debug.Assert(field.IsStatic); 88Debug.Assert(field.IsStatic);
System\Linq\Expressions\Interpreter\GreaterThanInstruction.cs (1)
279Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\GreaterThanOrEqualInstruction.cs (1)
279Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\IncrementInstruction.cs (1)
157Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\InstructionList.cs (2)
239Debug.Assert(Count > 0); 770Debug.Assert(_instructions[_instructions.Count - 1] == NullCheckInstruction.Instance);
System\Linq\Expressions\Interpreter\InterpretedFrame.cs (1)
213Debug.Assert(_pendingContinuation >= 0);
System\Linq\Expressions\Interpreter\LabelInfo.cs (1)
329Debug.Assert(CanJumpInto);
System\Linq\Expressions\Interpreter\LessThanInstruction.cs (1)
278Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\LessThanOrEqualInstruction.cs (1)
279Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\LightCompiler.cs (34)
43Debug.Assert(exceptionType != null); 71Debug.Assert((FinallyStartIndex != Instruction.UnknownInstrIndex) == (FinallyEndIndex != Instruction.UnknownInstrIndex)); 220Debug.Assert(d1 != null && d2 != null); 329Debug.Assert(_instructions.CurrentStackDepth == (node.ReturnType != typeof(void) ? 1 : 0)); 461Debug.Assert(local.IsBoxed); 692Debug.Assert(fi != null); 898Debug.Assert(node.Right.Type == typeof(int)); 979Debug.Assert(IsNullComparison(left, right) || left.Type == right.Type || !left.Type.IsValueType && !right.Type.IsValueType); 989Debug.Assert(IsNullComparison(left, right) || left.Type == right.Type || !left.Type.IsValueType && !right.Type.IsValueType); 1000Debug.Assert(left.Type == right.Type && left.Type.IsNumeric()); 1017Debug.Assert(left.Type == right.Type && left.Type.IsArithmetic()); 1043Debug.Assert(parameters.Length == 1); 1115Debug.Assert(typeFrom != typeof(void) && typeTo != typeof(void)); 1366Debug.Assert(expr.Method.IsStatic); 1548Debug.Assert(node.Type == typeof(void)); 1644Debug.Assert(!hasValue); 1688Debug.Assert(!hasValue); 1744Debug.Assert(label != null); 1787Debug.Assert(_labelBlock != null && _labelBlock.Kind == kind); 1990Debug.Assert(enterTryInstr != null); 2071Debug.Assert(startOfFinally != null); 2087Debug.Assert(exHandlers != null); 2100Debug.Assert(expr.Finally == null); 2101Debug.Assert(expr.Handlers.Count == 0); 2107Debug.Assert(enterTryInstr == _instructions.GetInstruction(tryStart)); 2154Debug.Assert(parameters.Length == arguments.ArgumentCount); 2324Debug.Assert(member.Member is PropertyInfo); 2426Debug.Assert(type.IsValueType); 2451Debug.Assert(!forBinding); 2517Debug.Assert(typeof(NewArrayExpression).GetCustomAttribute<RequiresDynamicCodeAttribute>() is not null); 2534Debug.Assert(node.NodeType == ExpressionType.NewArrayBounds); 2900Debug.Assert(expr.NodeType == ExpressionType.TypeEqual); 2923Debug.Assert(expr.NodeType == ExpressionType.TypeIs); 3009Debug.Assert(_instructions.CurrentStackDepth == startingStackDepth);
System\Linq\Expressions\Interpreter\LightDelegateCreator.cs (2)
18Debug.Assert(interpreter != null); 19Debug.Assert(lambda != null);
System\Linq\Expressions\Interpreter\LocalAccess.cs (1)
273Debug.Assert(defaultValue != null);
System\Linq\Expressions\Interpreter\LocalVariables.cs (1)
115Debug.Assert(!local.IsBoxed && !local.InClosure);
System\Linq\Expressions\Interpreter\ModuloInstruction.cs (1)
165Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\MulInstruction.cs (2)
165Debug.Assert(type.IsArithmetic()); 302Debug.Assert(type.IsArithmetic());
System\Linq\Expressions\Interpreter\NegateInstruction.cs (2)
106Debug.Assert(!type.IsEnum); 182Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\NotEqualInstruction.cs (2)
510Debug.Assert(type.GetNonNullableType().GetTypeCode() == TypeCode.Double); 532Debug.Assert(type.IsNullableOrReferenceType());
System\Linq\Expressions\Interpreter\SubInstruction.cs (2)
165Debug.Assert(type.IsArithmetic()); 301Debug.Assert(type.IsArithmetic());
System\Linq\Expressions\Interpreter\TypeOperations.cs (7)
154Debug.Assert(!mi.ReturnType.IsNullableType()); 356Debug.Assert(!t.IsEnum); 386Debug.Assert(t.IsEnum); 393Debug.Assert( 410Debug.Assert(t.IsEnum); 417Debug.Assert(from != null); 456Debug.Assert(_t.GetTypeCode() == TypeCode.Boolean);
System\Linq\Expressions\Interpreter\Utilities.cs (6)
178Debug.Assert(key != null); 201Debug.Assert(key != null); 222Debug.Assert(key != null); 272Debug.Assert(key != null); 284Debug.Assert(key != null); 340Debug.Assert(var != null);
System\Linq\Expressions\InvocationExpression.cs (14)
146Debug.Assert(lambda != null); 147Debug.Assert(arguments == null || arguments.Length == _arguments.Count); 174Debug.Assert(lambda != null); 175Debug.Assert(arguments == null || arguments.Length == 0); 207Debug.Assert(lambda != null); 208Debug.Assert(arguments == null || arguments.Length == 1); 247Debug.Assert(lambda != null); 248Debug.Assert(arguments == null || arguments.Length == 2); 290Debug.Assert(lambda != null); 291Debug.Assert(arguments == null || arguments.Length == 3); 336Debug.Assert(lambda != null); 337Debug.Assert(arguments == null || arguments.Length == 4); 385Debug.Assert(lambda != null); 386Debug.Assert(arguments == null || arguments.Length == 5);
System\Linq\Expressions\LambdaExpression.cs (13)
122Debug.Assert(lambdaExpressionType.IsAssignableTo(typeof(LambdaExpression))); 145Debug.Assert(CanInterpret); 225Debug.Assert(CanInterpret); 377Debug.Assert(body != null); 378Debug.Assert(parameters == null || parameters.Length == 0); 421Debug.Assert(body != null); 422Debug.Assert(parameters == null || parameters.Length == 1); 483Debug.Assert(body != null); 484Debug.Assert(parameters == null || parameters.Length == 2); 551Debug.Assert(body != null); 552Debug.Assert(parameters == null || parameters.Length == 3); 584Debug.Assert(body != null); 585Debug.Assert(parameters == null || parameters.Length == _parameters.Count);
System\Linq\Expressions\MemberExpression.cs (2)
35Debug.Assert(property != null); 41Debug.Assert(field != null);
System\Linq\Expressions\MethodCallExpression.cs (25)
159Debug.Assert(instance != null); 191Debug.Assert(instance == null); 192Debug.Assert(args == null || args.Count == _arguments.Count); 222Debug.Assert(instance != null); 223Debug.Assert(args == null || args.Count == _arguments.Count); 253Debug.Assert(instance == null); 254Debug.Assert(args == null || args.Count == 0); 300Debug.Assert(instance == null); 301Debug.Assert(args == null || args.Count == 1); 366Debug.Assert(instance == null); 367Debug.Assert(args == null || args.Count == 2); 437Debug.Assert(instance == null); 438Debug.Assert(args == null || args.Count == 3); 514Debug.Assert(instance == null); 515Debug.Assert(args == null || args.Count == 4); 597Debug.Assert(instance == null); 598Debug.Assert(args == null || args.Count == 5); 633Debug.Assert(instance != null); 634Debug.Assert(args == null || args.Count == 0); 682Debug.Assert(instance != null); 683Debug.Assert(args == null || args.Count == 1); 747Debug.Assert(instance != null); 748Debug.Assert(args == null || args.Count == 2); 818Debug.Assert(instance != null); 819Debug.Assert(args == null || args.Count == 3);
System\Linq\Expressions\NewArrayExpression.cs (1)
28Debug.Assert(type.IsArray);
System\Linq\Expressions\TryExpression.cs (3)
184Debug.Assert(tryBody != null); 208Debug.Assert(cb.Body != null); 221Debug.Assert(cb.Body != null);
System\Linq\Expressions\UnaryExpression.cs (8)
124Debug.Assert(Operand.NodeType == ExpressionType.Parameter); 145Debug.Assert(NodeType == ExpressionType.PreDecrementAssign || NodeType == ExpressionType.PostDecrementAssign); 262Debug.Assert(i == temps.Length); 268Debug.Assert(i == temps.Length); 271Debug.Assert(i == block.Length); 382Debug.Assert(method != null); 428Debug.Assert(method != null); 1063Debug.Assert(kind == ExpressionType.PreDecrementAssign || kind == ExpressionType.PostDecrementAssign);
System\Runtime\CompilerServices\CallSiteBinder.cs (1)
221Debug.Assert(result != null);
System\Runtime\CompilerServices\RuntimeOps.ExpressionQuoter.cs (1)
28Debug.Assert(hoistedLocals != null && locals != null);
System\Runtime\CompilerServices\RuntimeOps.RuntimeVariableList.cs (2)
76Debug.Assert(data != null); 77Debug.Assert(indexes != null);
System.Linq.Parallel (518)
System\Linq\Parallel\Channels\AsynchronousChannel.cs (11)
258Debug.Assert(_producerChunk != null); 289Debug.Assert(chunk != null); 315Debug.Assert(_consumerEvent != null); 327Debug.Assert(_producerEvent != null); 383Debug.Assert(1 <= _producerChunkIndex && _producerChunkIndex <= _chunkSize); 410Debug.Assert(_consumerChunk == null); 488Debug.Assert(_consumerChunk == null); 606Debug.Assert(!IsChunkBufferEmpty); 630Debug.Assert(_producerEvent != null); 664Debug.Assert(_producerEvent != null); 665Debug.Assert(_consumerEvent != null);
System\Linq\Parallel\Channels\SynchronousChannel.cs (4)
67Debug.Assert(_queue != null); 89Debug.Assert(_queue != null); 117Debug.Assert(_queue != null && array != null); 132Debug.Assert(_queue != null);
System\Linq\Parallel\Enumerables\AggregationMinMaxHelpers.cs (2)
25Debug.Assert(source != null); 26Debug.Assert(sign == -1 || sign == 1);
System\Linq\Parallel\Enumerables\EnumerableWrapperWeakToStrong.cs (2)
32Debug.Assert(wrappedEnumerable != null); 60Debug.Assert(wrappedEnumerator != null);
System\Linq\Parallel\Enumerables\OrderedParallelQuery.cs (1)
29Debug.Assert(sortOp is IOrderedEnumerable<TSource>);
System\Linq\Parallel\Enumerables\ParallelEnumerableWrapper.cs (2)
31Debug.Assert(source != null); 89Debug.Assert(_wrappedEnumerable != null);
System\Linq\Parallel\Merging\ArrayMergeHelper.cs (1)
86Debug.Assert(_outputArray != null);
System\Linq\Parallel\Merging\AsynchronousChannelMergeEnumerator.cs (5)
48Debug.Assert(channels != null); 50foreach (AsynchronousChannel<T> c in channels) Debug.Assert(c != null); 226Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 227Debug.Assert(_consumerEvent != null); 271Debug.Assert(currChannelIndex == _channels.Length);
System\Linq\Parallel\Merging\DefaultMergeHelper.cs (7)
48Debug.Assert(partitions != null); 67Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 86Debug.Assert(_asyncChannels == null || _asyncChannels.Length == partitions.PartitionCount); 87Debug.Assert(_syncChannels == null || _syncChannels.Length == partitions.PartitionCount); 103Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 118Debug.Assert(_partitions.PartitionCount == 1); 128Debug.Assert(_ignoreOutput || _channelEnumerator != null);
System\Linq\Parallel\Merging\MergeEnumerator.cs (2)
30Debug.Assert(taskGroupState != null); 68Debug.Assert(_taskGroupState.CancellationState.TopLevelDisposedFlag.Value);
System\Linq\Parallel\Merging\MergeExecutor.cs (8)
53Debug.Assert(partitions != null); 54Debug.Assert(partitions.PartitionCount > 0); 62Debug.Assert(options == ParallelMergeOptions.NotBuffered || options == ParallelMergeOptions.AutoBuffered); 67Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 102Debug.Assert(_mergeHelper != null); 118Debug.Assert(_mergeHelper != null); 128Debug.Assert(_mergeHelper != null); 151Debug.Assert(options == ParallelMergeOptions.NotBuffered || options == ParallelMergeOptions.AutoBuffered);
System\Linq\Parallel\Merging\OrderPreservingMergeHelper.cs (2)
41Debug.Assert(partitions != null); 69Debug.Assert(_results.Value != null);
System\Linq\Parallel\Merging\OrderPreservingPipeliningMergeHelper.cs (7)
122Debug.Assert(partitions != null); 139Debug.Assert(typeof(TKey) == typeof(int)); 415Debug.Assert(_mergeHelper._producerDone[producer]); 427Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 452Debug.Assert(gotElement); 471Debug.Assert(_privateBuffer[producer]!.Count == 0); 535Debug.Assert(x.MaxKey >= 0 && y.MaxKey >= 0); // Guarantees no overflow on next line
System\Linq\Parallel\Merging\SynchronousChannelMergeEnumerator.cs (5)
36Debug.Assert(channels != null); 38foreach (SynchronousChannel<T> c in channels) Debug.Assert(c != null); 78Debug.Assert(_channels != null); 90Debug.Assert(current != null); 109Debug.Assert(_channelIndex == _channels.Length);
System\Linq\Parallel\Partitioning\HashRepartitionEnumerator.cs (12)
69Debug.Assert(source != null); 70Debug.Assert(keySelector != null || typeof(THashKey) == typeof(NoKeyMemoizationRequired)); 71Debug.Assert(repartitionStream != null); 72Debug.Assert(barrier != null); 73Debug.Assert(valueExchangeMatrix != null); 76Debug.Assert(0 <= partitionIndex && partitionIndex < partitionCount); 88Debug.Assert(partitionCount == 1); 126Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 135Debug.Assert(mutables._currentBufferIndex != ENUMERATION_NOT_STARTED); 158Debug.Assert(mutables._currentBuffer == null || mutables._currentBuffer.Count > 0); 202Debug.Assert(mutables != null); 225Debug.Assert(typeof(THashKey) == typeof(NoKeyMemoizationRequired));
System\Linq\Parallel\Partitioning\HashRepartitionStream.cs (2)
54Debug.Assert(_keyComparer == null || _elementComparer == null); 55Debug.Assert(_elementComparer == null || typeof(THashKey) == typeof(NoKeyMemoizationRequired));
System\Linq\Parallel\Partitioning\OrderedHashRepartitionEnumerator.cs (15)
71Debug.Assert(source != null); 72Debug.Assert(keySelector != null || typeof(THashKey) == typeof(NoKeyMemoizationRequired)); 73Debug.Assert(repartitionStream != null); 74Debug.Assert(barrier != null); 75Debug.Assert(valueExchangeMatrix != null); 78Debug.Assert(0 <= partitionIndex && partitionIndex < partitionCount); 124Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 133Debug.Assert(mutables._currentBufferIndex != ENUMERATION_NOT_STARTED); 145Debug.Assert(mutables._currentKeyBuffer != null); 161Debug.Assert(mutables._currentBuffer == null || mutables._currentBuffer.Count > 0); 162Debug.Assert((mutables._currentBuffer == null) == (mutables._currentKeyBuffer == null)); 163Debug.Assert(mutables._currentBuffer == null || mutables._currentBuffer.Count == mutables._currentKeyBuffer!.Count); 208Debug.Assert(mutables != null); 232Debug.Assert(typeof(THashKey) == typeof(NoKeyMemoizationRequired)); 249Debug.Assert(keyBuffer == null);
System\Linq\Parallel\Partitioning\PartitionedDataSource.cs (21)
74Debug.Assert(source != null); 75Debug.Assert(partitionCount > 0); 81Debug.Assert(source != null); 138Debug.Assert(partitions.Length == partitionCount); 161Debug.Assert(source != null); 162Debug.Assert(partitionCount > 0); 251Debug.Assert(sectionSize > 0); 277Debug.Assert(mutables != null); 278Debug.Assert(mutables._currentPositionInChunk >= mutables._currentChunkSize); 422Debug.Assert(sectionSize > 0); 448Debug.Assert(mutables != null); 449Debug.Assert(mutables._currentPositionInChunk >= mutables._currentChunkSize); 595Debug.Assert(source != null); 596Debug.Assert(sourceSyncLock != null); 597Debug.Assert(currentIndex != null); 614Debug.Assert(mutables._chunkBuffer != null); 624Debug.Assert(_source != null); 625Debug.Assert(chunkBuffer != null); 626Debug.Assert(mutables._currentChunkSize > 0); 627Debug.Assert(0 <= currentChunkIndex && currentChunkIndex < chunkBuffer.Length); 641Debug.Assert(0 <= mutables._nextChunkMaxSize && mutables._nextChunkMaxSize <= chunkBuffer.Length);
System\Linq\Parallel\Partitioning\PartitionedStream.cs (5)
40Debug.Assert(partitionCount > 0); 57Debug.Assert(_partitions != null); 63Debug.Assert(_partitions != null); 64Debug.Assert(value != null); 78Debug.Assert(_partitions != null);
System\Linq\Parallel\QueryOperators\AssociativeAggregationOperator.cs (7)
105Debug.Assert(_finalReduce != null); 106Debug.Assert(_resultSelector != null); 242Debug.Assert(source != null); 243Debug.Assert(reduceOperator != null); 261Debug.Assert(_reduceOperator != null); 286Debug.Assert(typeof(TInput) == typeof(TIntermediate)); 319Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Binary\ConcatQueryOperator.cs (8)
90Debug.Assert(!ExchangeUtilities.IsWorseThan(leftStream.OrdinalIndexState, OrdinalIndexState.Increasing)); 109Debug.Assert(!ExchangeUtilities.IsWorseThan(rightStream.OrdinalIndexState, OrdinalIndexState.Increasing)); 172Debug.Assert(firstSource != null); 173Debug.Assert(secondSource != null); 189Debug.Assert(_firstSource != null); 190Debug.Assert(_secondSource != null); 257Debug.Assert(leftChildQueryResults.IsIndexible && rightChildQueryResults.IsIndexible); 272Debug.Assert(_leftChildCount >= 0 && _rightChildCount >= 0);
System\Linq\Parallel\QueryOperators\Binary\ExceptQueryOperator.cs (12)
56Debug.Assert(leftStream.PartitionCount == rightStream.PartitionCount); 156Debug.Assert(leftSource != null); 157Debug.Assert(rightSource != null); 171Debug.Assert(_leftSource != null); 172Debug.Assert(_rightSource != null); 199Debug.Assert(_outputLoopCount != null); 221Debug.Assert(_leftSource != null && _rightSource != null); 248Debug.Assert(leftSource != null); 249Debug.Assert(rightSource != null); 264Debug.Assert(_leftSource != null); 265Debug.Assert(_rightSource != null); 326Debug.Assert(_leftSource != null && _rightSource != null);
System\Linq\Parallel\QueryOperators\Binary\GroupJoinQueryOperator.cs (6)
75Debug.Assert(rightStream.PartitionCount == leftStream.PartitionCount); 224Debug.Assert(dataSource != null); 250Debug.Assert(baseLookup != null); 314Debug.Assert(dataSource != null); 354Debug.Assert(baseLookup != null); 434Debug.Assert(baseLookup != null);
System\Linq\Parallel\QueryOperators\Binary\HashJoinQueryOperatorEnumerator.cs (11)
69Debug.Assert(leftSource != null); 70Debug.Assert(rightLookupBuilder != null); 71Debug.Assert(resultSelector != null); 72Debug.Assert(outputKeyBuilder != null); 96Debug.Assert(_leftSource != null); 97Debug.Assert(_rightLookupBuilder != null); 133Debug.Assert(mutables._rightHashLookup != null); 164Debug.Assert(mutables._currentRightMatches != null); 165Debug.Assert(0 <= mutables._currentRightMatchesIndex && mutables._currentRightMatchesIndex < mutables._currentRightMatches.Count); 179Debug.Assert(_leftSource != null && _rightLookupBuilder != null); 241Debug.Assert(dataSource != null);
System\Linq\Parallel\QueryOperators\Binary\IntersectQueryOperator.cs (12)
58Debug.Assert(leftPartitionedStream.PartitionCount == rightPartitionedStream.PartitionCount); 144Debug.Assert(leftSource != null); 145Debug.Assert(rightSource != null); 159Debug.Assert(_leftSource != null); 160Debug.Assert(_rightSource != null); 188Debug.Assert(_outputLoopCount != null); 210Debug.Assert(_leftSource != null && _rightSource != null); 247Debug.Assert(leftSource != null); 248Debug.Assert(rightSource != null); 263Debug.Assert(_leftSource != null); 264Debug.Assert(_rightSource != null); 325Debug.Assert(_leftSource != null && _rightSource != null);
System\Linq\Parallel\QueryOperators\Binary\JoinQueryOperator.cs (5)
78Debug.Assert(rightStream.PartitionCount == leftStream.PartitionCount); 201Debug.Assert(dataSource != null); 220Debug.Assert(_dataSource != null); 234Debug.Assert(baseLookup != null); 271Debug.Assert(baseLookup != null);
System\Linq\Parallel\QueryOperators\Binary\UnionQueryOperator.cs (10)
60Debug.Assert(leftStream.PartitionCount == rightStream.PartitionCount); 202Debug.Assert(leftSource != null); 203Debug.Assert(rightSource != null); 223Debug.Assert(_hashLookup != null); 263Debug.Assert(_outputLoopCount != null); 315Debug.Assert(leftSource != null); 316Debug.Assert(rightSource != null); 335Debug.Assert(_leftSource != null); 336Debug.Assert(_rightSource != null); 397Debug.Assert(_leftSource != null && _rightSource != null);
System\Linq\Parallel\QueryOperators\Binary\ZipQueryOperator.cs (6)
88Debug.Assert(settings.DegreeOfParallelism != null); 90Debug.Assert(settings.TaskScheduler != null); 97Debug.Assert(merger.MergeExecutor != null); 108Debug.Assert(merger.MergeExecutor != null); 181Debug.Assert(_leftChildResults.IsIndexible); 182Debug.Assert(_rightChildResults.IsIndexible);
System\Linq\Parallel\QueryOperators\BinaryQueryOperator.cs (5)
42Debug.Assert(leftChild != null && rightChild != null); 105Debug.Assert(IsIndexible == (_op.OrdinalIndexState == OrdinalIndexState.Indexable)); 106Debug.Assert(_settings.ExecutionMode != null); 110Debug.Assert(_settings.DegreeOfParallelism != null); 119Debug.Assert(_settings.DegreeOfParallelism != null);
System\Linq\Parallel\QueryOperators\Inlined\CountAggregationOperator.cs (2)
89Debug.Assert(source != null); 133Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DecimalAverageAggregationOperator.cs (2)
96Debug.Assert(source != null); 145Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DecimalMinMaxAggregationOperator.cs (2)
114Debug.Assert(source != null); 175Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DecimalSumAggregationOperator.cs (2)
83Debug.Assert(source != null); 126Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DoubleAverageAggregationOperator.cs (2)
97Debug.Assert(source != null); 146Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DoubleMinMaxAggregationOperator.cs (2)
121Debug.Assert(source != null); 183Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DoubleSumAggregationOperator.cs (2)
83Debug.Assert(source != null); 125Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\FloatAverageAggregationOperator.cs (2)
97Debug.Assert(source != null); 146Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\FloatMinMaxAggregationOperator.cs (2)
119Debug.Assert(source != null); 180Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\FloatSumAggregationOperator.cs (2)
84Debug.Assert(source != null); 127Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\IntAverageAggregationOperator.cs (2)
96Debug.Assert(source != null); 145Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\IntMinMaxAggregationOperator.cs (2)
114Debug.Assert(source != null); 176Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\IntSumAggregationOperator.cs (2)
87Debug.Assert(source != null); 133Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\LongAverageAggregationOperator.cs (2)
96Debug.Assert(source != null); 145Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\LongCountAggregationOperator.cs (2)
87Debug.Assert(source != null); 132Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\LongMinMaxAggregationOperator.cs (2)
115Debug.Assert(source != null); 177Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\LongSumAggregationOperator.cs (2)
86Debug.Assert(source != null); 132Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalAverageAggregationOperator.cs (2)
95Debug.Assert(source != null); 139Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalMinMaxAggregationOperator.cs (2)
113Debug.Assert(source != null); 175Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalSumAggregationOperator.cs (2)
83Debug.Assert(source != null); 126Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleAverageAggregationOperator.cs (2)
95Debug.Assert(source != null); 139Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleMinMaxAggregationOperator.cs (2)
121Debug.Assert(source != null); 185Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleSumAggregationOperator.cs (2)
83Debug.Assert(source != null); 127Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableFloatAverageAggregationOperator.cs (2)
95Debug.Assert(source != null); 140Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableFloatMinMaxAggregationOperator.cs (2)
121Debug.Assert(source != null); 185Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableFloatSumAggregationOperator.cs (2)
83Debug.Assert(source != null); 126Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableIntAverageAggregationOperator.cs (2)
95Debug.Assert(source != null); 140Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableIntMinMaxAggregationOperator.cs (2)
113Debug.Assert(source != null); 174Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableIntSumAggregationOperator.cs (2)
86Debug.Assert(source != null); 131Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableLongAverageAggregationOperator.cs (2)
96Debug.Assert(source != null); 140Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableLongMinMaxAggregationOperator.cs (2)
114Debug.Assert(source != null); 176Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableLongSumAggregationOperator.cs (2)
87Debug.Assert(source != null); 133Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\PartitionerQueryOperator.cs (3)
130Debug.Assert(_settings.DegreeOfParallelism.HasValue); 233Debug.Assert(_sourceEnumerator != null); 263Debug.Assert(_sourceEnumerator != null);
System\Linq\Parallel\QueryOperators\QueryOpeningEnumerator.cs (1)
50Debug.Assert(queryOperator != null);
System\Linq\Parallel\QueryOperators\QueryOperator.cs (14)
127Debug.Assert(querySettings.ExecutionMode != null); 138Debug.Assert(mergeOptions != null); 152Debug.Assert(querySettings.TaskScheduler != null); 166Debug.Assert(merger.MergeExecutor != null); 178Debug.Assert(querySettings.TaskScheduler != null); 179Debug.Assert(querySettings.DegreeOfParallelism.HasValue); 180Debug.Assert(querySettings.ExecutionMode.HasValue); 200Debug.Assert(querySettings.ExecutionMode != null); 233Debug.Assert(querySettings.TaskScheduler != null); 238Debug.Assert(merger.MergeExecutor != null); 241Debug.Assert(output != null); 287Debug.Assert(taskScheduler != null); 310Debug.Assert(source != null); 335Debug.Assert(sourceAsOperator != null);
System\Linq\Parallel\QueryOperators\QueryOperatorEnumerator.cs (1)
60Debug.Assert(operatorEnumerator != null);
System\Linq\Parallel\QueryOperators\QuerySettings.cs (12)
40Debug.Assert(_cancellationState != null); 93Debug.Assert(_cancellationState != null); 159Debug.Assert(settings.CancellationState.InternalCancellationTokenSource != null); 160Debug.Assert(settings.CancellationState.MergedCancellationToken.CanBeCanceled); 161Debug.Assert(settings.CancellationState.TopLevelDisposedFlag != null); 185Debug.Assert(settings.TaskScheduler != null); 186Debug.Assert(settings.DegreeOfParallelism.HasValue); 187Debug.Assert(settings.DegreeOfParallelism.Value >= 1 && settings.DegreeOfParallelism <= Scheduling.MAX_SUPPORTED_DOP); 188Debug.Assert(settings.ExecutionMode != null); 189Debug.Assert(settings.MergeOptions != null); 191Debug.Assert(settings.MergeOptions != ParallelMergeOptions.Default); 207Debug.Assert(_cancellationState.MergedCancellationTokenSource != null);
System\Linq\Parallel\QueryOperators\ScanQueryOperator.cs (3)
33Debug.Assert(data != null); 59Debug.Assert(settings.DegreeOfParallelism.HasValue); 131Debug.Assert(_settings.DegreeOfParallelism != null);
System\Linq\Parallel\QueryOperators\Unary\AnyAllSearchOperator.cs (5)
166Debug.Assert(source != null); 167Debug.Assert(predicate != null); 168Debug.Assert(resultFoundFlag != null); 186Debug.Assert(_predicate != null); 234Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\ContainsSearchOperator.cs (5)
144Debug.Assert(source != null); 145Debug.Assert(comparer != null); 146Debug.Assert(resultFoundFlag != null); 164Debug.Assert(_comparer != null); 211Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\DefaultIfEmptyQueryOperator.cs (7)
62Debug.Assert(partitionCount == 1); 125Debug.Assert(source != null); 126Debug.Assert(0 <= partitionIndex && partitionIndex < partitionCount); 127Debug.Assert(partitionCount > 0); 128Debug.Assert(sharedEmptyCount != null); 129Debug.Assert(sharedLatch != null); 146Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\DistinctQueryOperator.cs (8)
134Debug.Assert(source != null); 146Debug.Assert(_source != null); 147Debug.Assert(_hashLookup != null); 176Debug.Assert(_source != null); 210Debug.Assert(source != null); 226Debug.Assert(_source != null); 227Debug.Assert(_hashLookup != null); 272Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\ElementAtQueryOperator.cs (5)
75Debug.Assert(intKeyStream.OrdinalIndexState == OrdinalIndexState.Indexable); 182Debug.Assert(source != null); 183Debug.Assert(index >= 0); 184Debug.Assert(resultFoundFlag != null); 225Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\FirstQueryOperator.cs (6)
76Debug.Assert(partitionCount == 1); 143Debug.Assert(source != null); 144Debug.Assert(operatorState != null); 145Debug.Assert(sharedBarrier != null); 146Debug.Assert(keyComparer != null); 163Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\ForAllOperator.cs (5)
47Debug.Assert(_elementAction != null); 65Debug.Assert(enumerator == null); 136Debug.Assert(source != null); 137Debug.Assert(elementAction != null); 173Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\GroupByQueryOperator.cs (22)
114Debug.Assert(typeof(TSource) == typeof(TElement)); 153Debug.Assert(typeof(TSource) == typeof(TElement)); 192Debug.Assert(typeof(TElement) == typeof(TSource)); 243Debug.Assert(source != null); 258Debug.Assert(_source != null); 271Debug.Assert(mutables._hashLookup != null); 345Debug.Assert(currentValue != null); 374Debug.Assert(elementSelector != null); 407Debug.Assert(currentValue != null); 446Debug.Assert(source != null); 447Debug.Assert(keySelector != null); 464Debug.Assert(_source != null); 465Debug.Assert(_keySelector != null); 478Debug.Assert(mutables._hashLookup != null); 582Debug.Assert(currentValue != null); 616Debug.Assert(elementSelector != null); 657Debug.Assert(currentValue != null); 689Debug.Assert(keyValues.Value != null); 711Debug.Assert(_keyValues.Value != null); 759Debug.Assert(_sortedValues != null); 774Debug.Assert(_values != null); 784Debug.Assert(_values != null);
System\Linq\Parallel\QueryOperators\Unary\IndexedSelectQueryOperator.cs (6)
71Debug.Assert(!ExchangeUtilities.IsWorseThan(indexState, OrdinalIndexState.Correct)); 103Debug.Assert(typeof(TKey) == typeof(int)); 145Debug.Assert(source != null); 146Debug.Assert(selector != null); 217Debug.Assert(_childQueryResults.IsIndexible); 226Debug.Assert(_childCount >= 0);
System\Linq\Parallel\QueryOperators\Unary\IndexedWhereQueryOperator.cs (4)
97Debug.Assert(typeof(TKey) == typeof(int)); 152Debug.Assert(source != null); 153Debug.Assert(predicate != null); 188Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\LastQueryOperator.cs (6)
76Debug.Assert(partitionCount == 1); 139Debug.Assert(source != null); 140Debug.Assert(operatorState != null); 141Debug.Assert(sharedBarrier != null); 142Debug.Assert(keyComparer != null); 159Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\ReverseQueryOperator.cs (7)
118Debug.Assert(source != null); 147Debug.Assert(_bufferIndex != null); 196Debug.Assert(_childQueryResults.IsIndexible); 209Debug.Assert(_count >= 0); 216Debug.Assert(_count >= 0); 217Debug.Assert(index >= 0); 218Debug.Assert(index < _count);
System\Linq\Parallel\QueryOperators\Unary\SelectManyQueryOperator.cs (15)
208Debug.Assert(_indexedRightChildSelector != null); 261Debug.Assert(leftSource != null); 262Debug.Assert(selectManyOperator != null); 294Debug.Assert(_selectManyOperator._indexedRightChildSelector != null); 299Debug.Assert(rightChild != null); 302Debug.Assert(_currentRightSource != null); 320Debug.Assert(_mutables != null); 333Debug.Assert(_currentRightSourceAsOutput != null); 390Debug.Assert(leftSource != null); 391Debug.Assert(selectManyOperator != null); 424Debug.Assert(_selectManyOperator._rightChildSelector != null); 428Debug.Assert(rightChild != null); 431Debug.Assert(_currentRightSource != null); 449Debug.Assert(_mutables != null); 462Debug.Assert(_currentRightSourceAsOutput != null);
System\Linq\Parallel\QueryOperators\Unary\SelectQueryOperator.cs (6)
104Debug.Assert(source != null); 105Debug.Assert(selector != null); 163Debug.Assert(op._selector != null); 165Debug.Assert(_childQueryResults.IsIndexible); 181Debug.Assert(index >= 0); 182Debug.Assert(index < ElementsCount);
System\Linq\Parallel\QueryOperators\Unary\SingleQueryOperator.cs (3)
113Debug.Assert(source != null); 114Debug.Assert(totalElementCount != null); 127Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\SortQueryOperator.cs (3)
180Debug.Assert(source != null); 195Debug.Assert(_source != null); 209Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipQueryOperator.cs (13)
112Debug.Assert(partitionCount == 1); 175Debug.Assert(source != null); 176Debug.Assert(sharedIndices != null); 177Debug.Assert(sharedBarrier != null); 178Debug.Assert(keyComparer != null); 195Debug.Assert(_sharedIndices != null); 243Debug.Assert(_buffer != null && _bufferIndex != null); 275Debug.Assert(_buffer != null && _bufferIndex != null); 360Debug.Assert(_childQueryResults.IsIndexible); 374Debug.Assert(_childCount >= 0); 388Debug.Assert(_childCount >= 0); 389Debug.Assert(index >= 0); 390Debug.Assert(index < ElementsCount);
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipWhileQueryOperator.cs (11)
131Debug.Assert(partitionCount == 1); 137Debug.Assert(_indexedPredicate == null || typeof(TKey) == typeof(int)); 176Debug.Assert(_predicate != null); 186Debug.Assert(_predicate != null); 232Debug.Assert(source != null); 233Debug.Assert(predicate != null || indexedPredicate != null); 234Debug.Assert(operatorState != null); 235Debug.Assert(sharedBarrier != null); 236Debug.Assert(keyComparer != null); 303Debug.Assert(_indexedPredicate != null); 342Debug.Assert(_bufferIndex != null);
System\Linq\Parallel\QueryOperators\Unary\WhereQueryOperator.cs (3)
116Debug.Assert(source != null); 117Debug.Assert(predicate != null); 152Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\UnaryQueryOperator.cs (2)
110Debug.Assert(IsIndexible == (_op.OrdinalIndexState == OrdinalIndexState.Indexable)); 112Debug.Assert(_settings.ExecutionMode != null && _settings.DegreeOfParallelism != null);
System\Linq\Parallel\Scheduling\OrderPreservingPipeliningSpoolingTask.cs (12)
67Debug.Assert(partition != null); 68Debug.Assert(taskGroupState != null); 69Debug.Assert(consumerWaiting != null); 70Debug.Assert(producerWaiting != null && producerWaiting.Length == consumerWaiting.Length); 71Debug.Assert(producerDone != null && producerDone.Length == consumerWaiting.Length); 72Debug.Assert(buffers != null && buffers.Length == consumerWaiting.Length); 73Debug.Assert(partitionIndex >= 0 && partitionIndex < consumerWaiting.Length); 153Debug.Assert(groupState != null); 154Debug.Assert(partitions != null); 155Debug.Assert(producerDone != null && producerDone.Length == partitions.PartitionCount); 156Debug.Assert(buffers != null && buffers.Length == partitions.PartitionCount); 157Debug.Assert(bufferLocks != null);
System\Linq\Parallel\Scheduling\OrderPreservingSpoolingTask.cs (9)
48Debug.Assert(groupState != null); 49Debug.Assert(results != null); 50Debug.Assert(sortHelper != null); 74Debug.Assert(groupState != null); 75Debug.Assert(partitions != null); 76Debug.Assert(results != null); 77Debug.Assert(results.Value == null); 131Debug.Assert(_sortHelper != null); 143Debug.Assert(sortedOutput != null);
System\Linq\Parallel\Scheduling\QueryTask.cs (4)
35Debug.Assert(groupState != null); 46Debug.Assert(o != null); 75Debug.Assert(o != null); 94Debug.Assert(unused == null);
System\Linq\Parallel\Scheduling\QueryTaskGroupState.cs (2)
86Debug.Assert(_rootTask != null); 158Debug.Assert(_cancellationState.TopLevelDisposedFlag.Value);
System\Linq\Parallel\Scheduling\SpoolingTask.cs (8)
36Debug.Assert(partitions.PartitionCount == channels.Length); 37Debug.Assert(groupState != null); 92Debug.Assert(partitions.PartitionCount == channels.Length); 93Debug.Assert(groupState != null); 136Debug.Assert(groupState != null); 207Debug.Assert(source != null); 296Debug.Assert(source != null); 380Debug.Assert(source != null);
System\Linq\Parallel\Scheduling\SpoolingTaskBase.cs (1)
62Debug.Assert(_groupState.CancellationState.InternalCancellationTokenSource != null);
System\Linq\Parallel\Utils\ExchangeUtilities.cs (1)
71Debug.Assert(returnValue.PartitionCount == partitionCount);
System\Linq\Parallel\Utils\FixedMaxHeap.cs (3)
36Debug.Assert(comparer != null); 133Debug.Assert(_count > 0); 144Debug.Assert(_count > 0);
System\Linq\Parallel\Utils\GrowingArray.cs (1)
56Debug.Assert(newSize > _array.Length);
System\Linq\Parallel\Utils\ListChunk.cs (2)
31Debug.Assert(size > 0); 81Debug.Assert(curr._chunkCount == curr._chunk.Length || curr._nextChunk == null);
System\Linq\Parallel\Utils\Lookup.cs (1)
121Debug.Assert(!_dict.ContainsKey(grouping.Key));
System\Linq\Parallel\Utils\Sorting.cs (28)
62Debug.Assert(source != null); 63Debug.Assert(groupState != null); 64Debug.Assert(sharedIndices != null); 65Debug.Assert(sharedkeys != null); 66Debug.Assert(sharedValues != null); 67Debug.Assert(sharedBarriers != null); 68Debug.Assert(sharedIndices.Length <= sharedkeys.Length); 69Debug.Assert(sharedIndices.Length == sharedValues.Length); 86Debug.Assert(_sharedKeys.Length >= _sharedValues.Length); 203Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 267Debug.Assert(keys != null); 268Debug.Assert(values != null); 269Debug.Assert(keys.Count == values.Count); 425Debug.Assert(myKeysArr != null); 435Debug.Assert(myIndices != null); 451Debug.Assert(mergedIndices != null); 458Debug.Assert(rightIndices != null); 465Debug.Assert(mergedIndices != null); 499Debug.Assert(leftValues != null); 500Debug.Assert(leftKeys != null); 512Debug.Assert(myIndices != null); 522Debug.Assert(leftIndices != null); 529Debug.Assert(mergedIndices != null); 542Debug.Assert(mergedIndices != null); 585Debug.Assert(keys.Length >= indices.Length); 586Debug.Assert(left <= right); 587Debug.Assert(0 <= left && left < keys.Length); 588Debug.Assert(0 <= right && right < keys.Length);
System\Linq\Parallel\Utils\WrapperEqualityComparer.cs (2)
29Debug.Assert(_comparer != null); 35Debug.Assert(_comparer != null);
System\Linq\ParallelEnumerable.cs (8)
1524Debug.Assert(source != null); 1525Debug.Assert(reduce != null); 1547Debug.Assert(source != null); 1548Debug.Assert(func != null); 1549Debug.Assert(seedIsSpecified || typeof(TSource) == typeof(TAccumulate)); 4888Debug.Assert(input != null); 5150Debug.Assert(groupings is QueryOperator<IGrouping<TKey, TSource>>); 5237Debug.Assert(groupings is QueryOperator<IGrouping<TKey, TElement>>);
System.Linq.Queryable (2)
System\Linq\EnumerableRewriter.cs (2)
247Debug.Assert(matchingMethods.Length > 1); 278Debug.Assert(left.Length == right.Length);
System.Memory (53)
src\libraries\Common\src\System\Buffers\ArrayBufferWriter.cs (5)
95Debug.Assert(_buffer.Length >= _index); 164Debug.Assert(_buffer.Length > _index); 195Debug.Assert(_buffer.Length > _index); 227Debug.Assert(needed > currentLength); 240Debug.Assert(FreeCapacity > 0 && FreeCapacity >= sizeHint);
System\Buffers\ReadOnlySequence.cs (9)
81Debug.Assert((startSegment != null && endSegment != null) || 205Debug.Assert(startObject != null); 230Debug.Assert(beginObject != null); 305Debug.Assert(sliceEndIndex >= 0 && startIndex >= 0 && endIndex >= 0); 334Debug.Assert(start <= int.MaxValue - startIndex); 387Debug.Assert(sliceStartIndex >= 0 && startIndex >= 0 && endIndex >= 0); 417Debug.Assert(length <= int.MaxValue - sliceStartIndex); 560Debug.Assert(positionSequenceObject != null); 578Debug.Assert(currentSegment!.RunningIndex + positionIndex >= 0);
System\Buffers\ReadOnlySequence.Helpers.cs (27)
32Debug.Assert(positionObject is ReadOnlySequenceSegment<T>); 58Debug.Assert(positionObject is T[]); 64Debug.Assert(positionObject is string); 70Debug.Assert(type == SequenceType.MemoryManager); 71Debug.Assert(positionObject is MemoryManager<T>); 130Debug.Assert(startIndex < 0 || endIndex < 0); 135Debug.Assert(endIndex < 0); 206Debug.Assert(startIndex < 0 || endIndex < 0); 211Debug.Assert(endIndex < 0); 244Debug.Assert(startObject != null); 260Debug.Assert(startObject == endObject); 280Debug.Assert(startObject != null); 296Debug.Assert(startObject == endObject); 309Debug.Assert(currentSegment != null); // currentSegment parameter is marked as nullable as the parameter is reused/reassigned in the body 310Debug.Assert(offset >= 0); 359Debug.Assert(position.GetObject() != null); 397Debug.Assert(sliceStartIndex >= 0 && startIndex >= 0 && endIndex >= 0); 530Debug.Assert(_endObject != null); 547Debug.Assert(_startObject != null); 564Debug.Assert(_startObject != null); 575Debug.Assert(start <= int.MaxValue); 576Debug.Assert(end <= int.MaxValue); 577Debug.Assert(start <= end); 601Debug.Assert(start <= long.MaxValue); 602Debug.Assert(end <= long.MaxValue); 603Debug.Assert(start <= end); 678Debug.Assert(startIndex < 0);
System\Buffers\SequenceReader.cs (7)
148Debug.Assert(CurrentSpanIndex + offset >= 0); 153Debug.Assert(offset <= int.MaxValue); 335Debug.Assert(count >= 0); 350Debug.Assert(count >= 0); 355Debug.Assert(CurrentSpanIndex < CurrentSpan.Length); 381Debug.Assert(count >= 0); 434Debug.Assert(firstSpan.Length < destination.Length);
System\Buffers\SequenceReader.Search.cs (4)
78Debug.Assert(sequence.Length > 0); 195Debug.Assert(skip >= 0); 439Debug.Assert(sequence.Length > 0); 809Debug.Assert(currentSpan.Length < next.Length);
System\Buffers\SequenceReaderExtensions.Binary.cs (1)
39Debug.Assert(reader.UnreadSpan.Length < sizeof(T));
System.Net.Http (710)
src\libraries\Common\src\System\HexConverter.cs (1)
165Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\IO\DelegatingStream.cs (1)
65Debug.Assert(innerStream != null);
src\libraries\Common\src\System\Net\ArrayBuffer.cs (9)
34Debug.Assert(initialSize > 0 || usePool); 46Debug.Assert(buffer.Length > 0); 71Debug.Assert(_usePool); 72Debug.Assert(_bytes is not null); 111Debug.Assert(byteCount <= AvailableLength); 127Debug.Assert(AvailableLength < byteCount); 131Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0); 143Debug.Assert(byteCount <= AvailableLength); 171Debug.Assert(byteCount <= AvailableLength);
src\libraries\Common\src\System\Net\CredentialCacheKey.cs (4)
20Debug.Assert(uriPrefix != null); 21Debug.Assert(authenticationType != null); 60Debug.Assert(uri != null); 61Debug.Assert(prefixUri != null);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackEncoder.cs (17)
95Debug.Assert(indexLength >= 1); 127Debug.Assert(indexLength >= 1); 159Debug.Assert(indexLength >= 1); 197Debug.Assert(indexLength >= 1); 369Debug.Assert(Ascii.IsValid(value)); 376Debug.Assert(integerLength >= 1); 382Debug.Assert(status == OperationStatus.Done); 383Debug.Assert(valueBytesWritten == value.Length); 397Debug.Assert(destination.Length >= value.Length); 406Debug.Assert(status == OperationStatus.Done); 407Debug.Assert(bytesWritten == value.Length); 426Debug.Assert(integerLength >= 1); 470Debug.Assert(integerLength >= 1); 481Debug.Assert(written == encodedStringLength); 528Debug.Assert(separator != null); 529Debug.Assert(Ascii.IsValid(separator)); 551Debug.Assert(integerLength >= 1);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\IntegerDecoder.cs (1)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\Helpers\VariableLengthIntegerHelper.cs (8)
69Debug.Assert((firstByte & LengthMask) == InitialEightByteLengthMask); 118Debug.Assert(result); 119Debug.Assert(bytesRead == length); 149Debug.Assert(longToEncode >= 0); 150Debug.Assert(longToEncode <= EightByteLimit); 193Debug.Assert(res); 199Debug.Assert(value >= 0); 200Debug.Assert(value <= EightByteLimit);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\HeaderField.cs (1)
17Debug.Assert(name.Length > 0);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackEncoder.cs (14)
42Debug.Assert(res); 97Debug.Assert(res); 106Debug.Assert(res); 167Debug.Assert(res); 177Debug.Assert(res); 204Debug.Assert(written == encodedStringLength); 235Debug.Assert(separator != null); 236Debug.Assert(Ascii.IsValid(separator)); 303Debug.Assert(buffer.Length >= s.Length); 312Debug.Assert(status == OperationStatus.Done); 313Debug.Assert(bytesWritten == s.Length); 318Debug.Assert(Ascii.IsValid(s)); 331Debug.Assert(status == OperationStatus.Done); 332Debug.Assert(valueBytesWritten == s.Length);
src\libraries\Common\src\System\Net\HttpKnownHeaderNames.TryGetHeaderName.cs (18)
35Debug.Assert(length >= 0); 55Debug.Assert(name != null); 89Debug.Assert(key != null); 90Debug.Assert(startIndex >= 0); 91Debug.Assert(length >= 0); 92Debug.Assert(charAt != null); 93Debug.Assert(equals != null); 335Debug.Assert(potentialHeader != null); 345Debug.Assert(known != null); 346Debug.Assert(known.Length > 0); 347Debug.Assert(startIndex >= 0); 348Debug.Assert(length > 0); 349Debug.Assert(equals != null); 353Debug.Assert(known.Length == length); 367Debug.Assert(left != null); 368Debug.Assert(right != IntPtr.Zero); 369Debug.Assert(rightLength > 0); 372Debug.Assert(left.Length == rightLength);
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.Associate.cs (1)
35Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (31)
38Debug.Assert(initialBufferSize >= 0); 70Debug.Assert(byteCount >= 0); 112Debug.Assert(toReturn is not null); 120Debug.Assert(byteCount >= 0); 130Debug.Assert(byteCount >= 0); 131Debug.Assert(limit >= 0); 147Debug.Assert(byteCount >= 0); 157Debug.Assert(byteCount > AvailableMemory.Length); 169Debug.Assert(_allocatedEnd == 0); 170Debug.Assert(_activeStart == 0); 171Debug.Assert(_availableStart == 0); 183Debug.Assert(_allocatedEnd % BlockSize == 0); 184Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize); 225Debug.Assert(_allocatedEnd % BlockSize == 0); 227Debug.Assert(allocatedBlockCount == 0 || _blocks[allocatedBlockCount - 1] is not null); 230Debug.Assert(_blocks[allocatedBlockCount] is null); 237Debug.Assert(byteCount <= AvailableMemory.Length); 247Debug.Assert(_activeStart == 0); 248Debug.Assert(_availableStart == 0); 249Debug.Assert(_allocatedEnd == 0); 253Debug.Assert(_activeStart <= _availableStart); 254Debug.Assert(_availableStart <= _allocatedEnd); 255Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize); 264Debug.Assert(_blocks[i] is null); 269Debug.Assert(_blocks[i] is not null); 274Debug.Assert(_blocks[i] is null); 307Debug.Assert(blocks is not null); 308Debug.Assert(start <= int.MaxValue); 309Debug.Assert(length <= int.MaxValue); 310Debug.Assert(start + length <= blocks.Length * BlockSize); 350Debug.Assert(_blocks is not null);
src\libraries\Common\src\System\Net\Security\SslClientAuthenticationOptionsExtensions.cs (1)
39Debug.Assert(properties.Length == 13);
src\libraries\Common\src\System\Text\SimpleRegex.cs (1)
68Debug.Assert(patternPos <= pattern.Length);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
System\Net\Http\DiagnosticsHandler.cs (2)
27Debug.Assert(IsGloballyEnabled()); 28Debug.Assert(innerHandler is not null && propagator is not null);
System\Net\Http\Headers\AltSvcHeaderParser.cs (2)
27Debug.Assert(startIndex >= 0); 28Debug.Assert(startIndex < value.Length);
System\Net\Http\Headers\AuthenticationHeaderValue.cs (3)
48Debug.Assert(source != null); 118Debug.Assert(startIndex >= 0); 237Debug.Assert(input[parseEndIndex] == ',');
System\Net\Http\Headers\ByteArrayHeaderParser.cs (1)
22Debug.Assert(value is byte[]);
System\Net\Http\Headers\CacheControlHeaderValue.cs (5)
67Debug.Assert(sizeof(Flags) == sizeof(int)); 171Debug.Assert(source != null); 351Debug.Assert(startIndex >= 0); 371Debug.Assert(nameValue is not null); 491Debug.Assert(nameValue != null);
System\Net\Http\Headers\ContentDispositionHeaderValue.cs (5)
135Debug.Assert(source != null); 210Debug.Assert(startIndex >= 0); 256Debug.Assert((input != null) && (input.Length > 0) && (startIndex < input.Length)); 351Debug.Assert(nameParameter.Value != null); 461Debug.Assert(input != null);
System\Net\Http\Headers\ContentRangeHeaderValue.cs (2)
86Debug.Assert(source != null); 159Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\DateHeaderParser.cs (1)
22Debug.Assert(value is DateTimeOffset);
System\Net\Http\Headers\EntityTagHeaderValue.cs (4)
55Debug.Assert(source != null); 111Debug.Assert(startIndex >= 0); 157Debug.Assert(startIndex == 0); 158Debug.Assert(!isWeak);
System\Net\Http\Headers\GenericHeaderParser.cs (1)
59Debug.Assert(getParsedValueLength != null);
System\Net\Http\Headers\HeaderDescriptor.cs (7)
61Debug.Assert(!string.IsNullOrEmpty(headerName)); 83Debug.Assert(headerName.Length > 0); 104Debug.Assert(index >= 0); 108Debug.Assert(qpackStaticTable.Length == 99); 127Debug.Assert(_descriptor is KnownHeader); 128Debug.Assert(HeaderType != HttpHeaderType.Custom); 253Debug.Assert(candidate is null || candidate.Length == contentTypeValue.Length);
System\Net\Http\Headers\HeaderUtilities.cs (7)
32Debug.Assert(parameters != null); 124Debug.Assert(parameters != null); 210Debug.Assert(xItem != null); 246Debug.Assert(input != null); 247Debug.Assert(startIndex <= input.Length); // it's OK if index == value.Length. 277Debug.Assert(store != null); 294Debug.Assert(store != null);
System\Net\Http\Headers\HttpGeneralHeaders.cs (1)
151Debug.Assert(parent != null);
System\Net\Http\Headers\HttpHeaderParser.cs (4)
35Debug.Assert(!string.IsNullOrEmpty(separator)); 36Debug.Assert(Ascii.IsValid(separator)); 55Debug.Assert((value == null) || ((index >= 0) && (index <= value.Length))); 73Debug.Assert(value != null);
System\Net\Http\Headers\HttpHeaders.cs (46)
68Debug.Assert((allowedHeaderTypes & treatAsCustomHeaderTypes) == 0); 92Debug.Assert(!Contains(descriptor)); 124Debug.Assert(!Contains(descriptor)); 154Debug.Assert(currentValue is string); 179Debug.Assert(storeValueRef is not null); 184Debug.Assert(value is string); 251Debug.Assert(singleValue is not null ^ multiValue is not null); 263Debug.Assert(multiValue is not null && multiValue.Length > 0); 283Debug.Assert(singleValue is not null ^ multiValue is not null); 327Debug.Assert(Contains(entry.Key)); 352Debug.Assert(value != null); 366Debug.Assert(value != null); 395Debug.Assert(value != null); 473Debug.Assert(value != null); 529Debug.Assert(sourceHeaders != null); 569Debug.Assert(sourceValue is string); 621Debug.Assert(source is not InvalidValue); 667Debug.Assert(!Contains(descriptor)); 673Debug.Assert((descriptor.HeaderType & _treatAsCustomHeaderTypes) == 0); 707Debug.Assert(value is string); 725Debug.Assert(!info.IsEmpty); 738Debug.Assert(rawValue is not null); 743Debug.Assert(info.ParsedAndInvalidValues is not null); 751Debug.Assert(Monitor.IsEntered(info)); 790Debug.Assert(!Contains(descriptor)); 800Debug.Assert(info != null); 801Debug.Assert(descriptor.Parser != null); 876Debug.Assert(value != null); 919Debug.Assert(currentStoreValue is T); 923Debug.Assert(value is T); 967Debug.Assert(info != null); 1091Debug.Assert(singleValue is not null ^ multiValue is not null); 1100Debug.Assert(sourceValues is string); 1127Debug.Assert(currentIndex == length); 1138Debug.Assert(sourceValues is string); 1152Debug.Assert(length > 0); 1162Debug.Assert(currentIndex == length); 1170Debug.Assert(info != null); 1171Debug.Assert(Monitor.IsEntered(info)); 1196Debug.Assert(item != null); 1206Debug.Assert(value != null); 1223Debug.Assert(value is not null); 1262Debug.Assert(item is not InvalidValue); 1267Debug.Assert(ParsedAndInvalidValues is not InvalidValue); 1452Debug.Assert(dictionary.Count == _count - 1); 1470Debug.Assert(!Contains(entry.Key));
System\Net\Http\Headers\HttpHeadersNonValidated.cs (2)
69Debug.Assert(singleValue is not null ^ multiValue is not null); 146Debug.Assert(singleValue is not null ^ multiValue is not null);
System\Net\Http\Headers\HttpHeaderValueCollection.cs (5)
102Debug.Assert(storeValue is T); 116Debug.Assert(item is T); 153Debug.Assert(item is T); 159Debug.Assert(storeValue is T); 190Debug.Assert(typeof(T) == typeof(string));
System\Net\Http\Headers\HttpRequestHeaders.cs (1)
277Debug.Assert(sourceRequestHeaders != null);
System\Net\Http\Headers\HttpResponseHeaders.cs (1)
149Debug.Assert(sourceResponseHeaders != null);
System\Net\Http\Headers\Int32NumberHeaderParser.cs (1)
26Debug.Assert(value is int);
System\Net\Http\Headers\Int64NumberHeaderParser.cs (1)
26Debug.Assert(value is long);
System\Net\Http\Headers\KnownHeader.cs (5)
14Debug.Assert(!string.IsNullOrEmpty(name)); 15Debug.Assert(name[0] == ':' || HttpRuleParser.IsToken(name)); 20Debug.Assert(!string.IsNullOrEmpty(name)); 21Debug.Assert(name[0] == ':' || HttpRuleParser.IsToken(name)); 32Debug.Assert(asciiBytes == name.Length);
System\Net\Http\Headers\MediaTypeHeaderParser.cs (1)
19Debug.Assert(mediaTypeCreator != null);
System\Net\Http\Headers\MediaTypeHeaderValue.cs (4)
86Debug.Assert(source != null); 179Debug.Assert(mediaTypeCreator != null); 180Debug.Assert(startIndex >= 0); 229Debug.Assert((input != null) && (input.Length > 0) && (startIndex < input.Length));
System\Net\Http\Headers\NameValueHeaderValue.cs (10)
54Debug.Assert(source != null); 62Debug.Assert(_name != null); 168Debug.Assert(destination != null); 209Debug.Assert(input != null); 210Debug.Assert(startIndex >= 0); 211Debug.Assert(nameValueCreator != null); 268Debug.Assert(nameValueCollection != null); 269Debug.Assert(startIndex >= 0); 306Debug.Assert((name != null) && (name.Length > 0)); 325Debug.Assert(input != null);
System\Net\Http\Headers\NameValueWithParametersHeaderValue.cs (3)
98Debug.Assert(input != null); 99Debug.Assert(startIndex >= 0); 120Debug.Assert(nameValueWithParameters != null);
System\Net\Http\Headers\ObjectCollection.cs (5)
41Debug.Assert(item != null); 53Debug.Assert(_size == 1); 72Debug.Assert(_size > 0); 73Debug.Assert(_size == array.Length); 103Debug.Assert(_size == 0 || _size == 1);
System\Net\Http\Headers\ProductHeaderValue.cs (2)
45Debug.Assert(source != null); 106Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\ProductInfoHeaderValue.cs (4)
38Debug.Assert(source != null); 48Debug.Assert(_comment != null); 76Debug.Assert(_comment != null); 117Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\RangeConditionHeaderValue.cs (2)
38Debug.Assert(source != null); 75Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\RangeHeaderValue.cs (2)
43Debug.Assert(source != null); 133Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\RangeItemHeaderValue.cs (4)
46Debug.Assert(source != null); 82Debug.Assert(rangeCollection != null); 83Debug.Assert(startIndex >= 0); 129Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\RetryConditionHeaderValue.cs (2)
38Debug.Assert(source != null); 79Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\StringWithQualityHeaderValue.cs (2)
42Debug.Assert(source != null); 87Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\TimeSpanHeaderParser.cs (1)
20Debug.Assert(value is TimeSpan);
System\Net\Http\Headers\TransferCodingHeaderParser.cs (1)
25Debug.Assert(transferCodingCreator != null);
System\Net\Http\Headers\TransferCodingHeaderValue.cs (3)
28Debug.Assert(source != null); 63Debug.Assert(transferCodingCreator != null); 64Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\UriHeaderParser.cs (1)
90Debug.Assert(value is Uri);
System\Net\Http\Headers\ViaHeaderValue.cs (3)
71Debug.Assert(source != null); 158Debug.Assert(startIndex >= 0); 176Debug.Assert(protocolVersion != null);
System\Net\Http\Headers\WarningHeaderValue.cs (2)
53Debug.Assert(source != null); 123Debug.Assert(startIndex >= 0);
System\Net\Http\HttpClient.cs (2)
129Debug.Assert(HttpContent.MaxBufferSize <= int.MaxValue); 612Debug.Assert(_timeout.TotalSeconds > 0);
System\Net\Http\HttpContent.cs (16)
80Debug.Assert(encoding != null); 81Debug.Assert(preamble != null); 93Debug.Assert(actualPreamble.Length >= 2); 150Debug.Assert(IsBuffered); 235Debug.Assert(_bufferedContent != null); 638Debug.Assert(contentLength >= 0); 722Debug.Assert(StreamCopyExceptionNeedsWrapping(e)); 733Debug.Assert(data != null); 734Debug.Assert(encoding != null); 771Debug.Assert(data != null); 849Debug.Assert(capacity <= maxSize); 950Debug.Assert(_buffer != null); 981Debug.Assert(value > _buffer.Length); 1007Debug.Assert(buffer != null); 1008Debug.Assert(offset >= 0); 1009Debug.Assert(count >= 0);
System\Net\Http\HttpMethod.SocketsHttpHandler.cs (1)
56Debug.Assert(Ascii.IsValid(Method));
System\Net\Http\HttpRequestMessage.cs (1)
184Debug.Assert(value);
System\Net\Http\HttpResponseMessage.cs (1)
118Debug.Assert(headers.ContainsTrailingHeaders);
System\Net\Http\HttpRuleParser.cs (11)
34Debug.Assert(input is not null); 51Debug.Assert(IsToken(input)); 58Debug.Assert(input != null); 90Debug.Assert(input != null); 91Debug.Assert((startIndex >= 0) && (startIndex < input.Length)); 134Debug.Assert(input != null); 135Debug.Assert(startIndex >= 0); 185Debug.Assert(input != null); 186Debug.Assert((startIndex >= 0) && (startIndex < input.Length)); 221Debug.Assert(input != null); 222Debug.Assert((startIndex >= 0) && (startIndex < input.Length));
System\Net\Http\HttpTelemetry.AnyOS.cs (1)
27Debug.Assert(versionMajor is 1 or 2 or 3);
System\Net\Http\HttpTelemetry.cs (4)
46Debug.Assert(request.RequestUri != null && request.RequestUri.IsAbsoluteUri); 189Debug.Assert(count >= 0); 204Debug.Assert(count >= 0); 219Debug.Assert(count >= 0);
System\Net\Http\MessageProcessingHandler.cs (1)
143Debug.Assert(handler != null);
System\Net\Http\Metrics\HttpMetricsEnrichmentContext.cs (2)
88Debug.Assert(context._callbacks.Count == 0); 122Debug.Assert(_tags.Count == 0);
System\Net\Http\Metrics\MetricsHandler.cs (1)
228Debug.Assert(statusCode >= 400 && statusCode <= 599);
System\Net\Http\MultipartContent.cs (4)
158Debug.Assert(stream != null); 202Debug.Assert(stream != null); 236Debug.Assert(task.IsCompleted); 422Debug.Assert(streams != null);
System\Net\Http\NetEventSource.Http.cs (4)
24Debug.Assert(Log.IsEnabled()); 35Debug.Assert(Log.IsEnabled()); 58Debug.Assert(Log.IsEnabled()); 69Debug.Assert(Log.IsEnabled());
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.cs (5)
222Debug.Assert(pool.PreAuthCredentials != null); 228Debug.Assert(pool.PreAuthCredentials.GetCredential(authUri, NegotiateScheme) == null); 229Debug.Assert(pool.PreAuthCredentials.GetCredential(authUri, NtlmScheme) == null); 230Debug.Assert(pool.PreAuthCredentials.GetCredential(authUri, DigestScheme) == null); 355Debug.Assert(request.RequestUri != null);
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.Digest.cs (4)
108Debug.Assert(request.RequestUri != null); 222Debug.Assert(written == SHA256.HashSizeInBytes); 229Debug.Assert(written == MD5.HashSizeInBytes); 316Debug.Assert(currentIndex < data.Length && !CharIsSpaceOrTab(data[currentIndex]));
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.NtAuth.cs (1)
242Debug.Assert(request.RequestUri != null);
System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs (15)
71Debug.Assert(_connection.RemainingBuffer.Length == 0); 72Debug.Assert(buffer.Length != 0); 154Debug.Assert(_state == ParsingState.Done); 166Debug.Assert(_connection != null); 187Debug.Assert(_connection.RemainingBuffer.Length == 0); 188Debug.Assert(buffer.Length != 0); 296Debug.Assert(buffer.Length > 0); 305Debug.Assert(bytesRead.Length <= buffer.Length); 315Debug.Assert(_connection != null); 359Debug.Assert(_chunkBytesRemaining > 0); 368Debug.Assert(bytesToConsume > 0 || maxBytesToRead == 0); 470Debug.Assert(_connection != null); 528Debug.Assert(_connection is not null); 532Debug.Assert(fillTask.IsCompleted); 538Debug.Assert(_connection is not null);
System\Net\Http\SocketsHttpHandler\ChunkedEncodingWriteStream.cs (3)
26Debug.Assert(connection._currentRequest != null); 36Debug.Assert(writeTask.IsCompleted); 50Debug.Assert(connection._currentRequest != null);
System\Net\Http\SocketsHttpHandler\ConnectHelper.cs (1)
48Debug.Assert(localRequest != null);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (40)
84Debug.Assert(host is not null || (kind == HttpConnectionKind.Proxy && proxyUri is not null)); 97Debug.Assert(host != null); 98Debug.Assert(port != 0); 99Debug.Assert(sslHostName == null); 100Debug.Assert(proxyUri == null); 106Debug.Assert(host != null); 107Debug.Assert(port != 0); 108Debug.Assert(sslHostName != null); 109Debug.Assert(proxyUri == null); 113Debug.Assert(host == null); 114Debug.Assert(port == 0); 115Debug.Assert(sslHostName == null); 116Debug.Assert(proxyUri != null); 123Debug.Assert(host != null); 124Debug.Assert(port != 0); 125Debug.Assert(sslHostName == null); 126Debug.Assert(proxyUri != null); 133Debug.Assert(host != null); 134Debug.Assert(port != 0); 135Debug.Assert(sslHostName != null); 136Debug.Assert(proxyUri != null); 142Debug.Assert(host != null); 143Debug.Assert(port != 0); 144Debug.Assert(sslHostName == null); 145Debug.Assert(proxyUri != null); 158Debug.Assert(host != null); 159Debug.Assert(port != 0); 160Debug.Assert(proxyUri != null); 193Debug.Assert(Encoding.ASCII.GetString(_hostHeaderLineBytes) == $"Host: {hostHeader}\r\n"); 260Debug.Assert(sslHostName != null); 308Debug.Assert(!Monitor.IsEntered(_http11Connections)); 419Debug.Assert(async); 458Debug.Assert(connection is not null || !_http2Enabled); 507Debug.Assert(retryCount >= 0 && retryCount <= MaxConnectionFailureRetries); 557Debug.Assert(http11ConnectionWaiter is null || http2ConnectionWaiter?.ConnectionCancellationTokenSource is null); 611Debug.Assert(stream != null); 790Debug.Assert(_proxyUri != null); 800Debug.Assert(!(e is HttpRequestException)); 822Debug.Assert(desiredVersion == 2 || desiredVersion == 3); 835Debug.Assert(!HasSyncObjLock);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http1.cs (11)
120Debug.Assert(success == waiter is not null); 158Debug.Assert(connection is not null); 186Debug.Assert(HasSyncObjLock); 255Debug.Assert(connectionException is not null); 282Debug.Assert(_associatedHttp11ConnectionCount > 0); 283Debug.Assert(_pendingHttp11ConnectionCount > 0); 310Debug.Assert(_pendingHttp11ConnectionCount > 0); 382Debug.Assert(_associatedHttp11ConnectionCount > 0); 383Debug.Assert(!disposing || Array.IndexOf(_http11Connections.ToArray(), connection) < 0); 401Debug.Assert(pool.HasSyncObjLock); 402Debug.Assert(connections.Count <= pool._associatedHttp11ConnectionCount);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http2.cs (16)
66Debug.Assert(_kind == HttpConnectionKind.Https || _kind == HttpConnectionKind.SslProxyTunnel || _kind == HttpConnectionKind.Http || _kind == HttpConnectionKind.SocksTunnel || _kind == HttpConnectionKind.SslSocksTunnel); 140Debug.Assert(HasSyncObjLock); 242Debug.Assert(connectionException is not null); 280Debug.Assert(_associatedHttp2ConnectionCount > 0); 281Debug.Assert(_pendingHttp2Connection); 298Debug.Assert(_pendingHttp2Connection); 299Debug.Assert(_associatedHttp2ConnectionCount > 0); 368Debug.Assert(!HasSyncObjLock); 375Debug.Assert(_availableHttp2Connections is null || !_availableHttp2Connections.Contains(connection)); 376Debug.Assert(_associatedHttp2ConnectionCount > (_availableHttp2Connections?.Count ?? 0)); 400Debug.Assert(_pendingHttp2Connection); 437Debug.Assert(!added); 456Debug.Assert(_disposed); 519Debug.Assert(_availableHttp2Connections is null || !_availableHttp2Connections.Contains(connection)); 520Debug.Assert(_associatedHttp2ConnectionCount > 0); 545Debug.Assert(_associatedHttp2ConnectionCount >= _availableHttp2Connections.Count);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (7)
108Debug.Assert(_kind == HttpConnectionKind.Https); 109Debug.Assert(_http3Enabled); 233Debug.Assert(_authorityExpireTimer != null || _disposed); 359Debug.Assert(badAuthority != null); 409Debug.Assert(_authorityExpireTimer != null); 413Debug.Assert(_altSvcBlocklistTimerCancellation != null); 457Debug.Assert(_authorityExpireTimer != null || _disposed);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionWaiter.cs (2)
29Debug.Assert(typeof(T) == typeof(HttpConnection) || typeof(T) == typeof(Http2Connection)); 52Debug.Assert(connection is not null);
System\Net\Http\SocketsHttpHandler\ConnectionPool\RequestQueue.cs (2)
50Debug.Assert(_size > 0); 166Debug.Assert(_attemptedConnectionsOffset >= 0);
System\Net\Http\SocketsHttpHandler\ContentLengthReadStream.cs (11)
31Debug.Assert(_contentBytesRemaining > 0); 44Debug.Assert((ulong)bytesRead <= _contentBytesRemaining); 67Debug.Assert(_contentBytesRemaining > 0); 106Debug.Assert((ulong)bytesRead <= _contentBytesRemaining); 146Debug.Assert(_connection != null); 174Debug.Assert(maxBytesToRead > 0); 175Debug.Assert(_contentBytesRemaining > 0); 176Debug.Assert(_connection != null); 185Debug.Assert(bytesToConsume > 0); 197Debug.Assert(_connection != null); 198Debug.Assert(_contentBytesRemaining > 0);
System\Net\Http\SocketsHttpHandler\ContentLengthWriteStream.cs (2)
32Debug.Assert(connection._currentRequest != null); 46Debug.Assert(connection._currentRequest != null);
System\Net\Http\SocketsHttpHandler\CookieHelper.cs (1)
19Debug.Assert(response.RequestMessage != null && response.RequestMessage.RequestUri != null);
System\Net\Http\SocketsHttpHandler\CreditManager.cs (4)
22Debug.Assert(owner != null); 23Debug.Assert(!string.IsNullOrWhiteSpace(name)); 105Debug.Assert(waiter != null); 111Debug.Assert(_waitersTail == waiter);
System\Net\Http\SocketsHttpHandler\DecompressionHandler.cs (9)
28Debug.Assert(decompressionMethods != DecompressionMethods.None); 29Debug.Assert(innerHandler != null); 71Debug.Assert(response.Content != null); 157Debug.Assert(task.IsCompleted); 333Debug.Assert(_firstByteStatus == FirstByteStatus.None); 349Debug.Assert(_firstByteStatus == FirstByteStatus.None); 379Debug.Assert(_firstByteStatus == FirstByteStatus.Consumed); 397Debug.Assert(_firstByteStatus == FirstByteStatus.Consumed); 403Debug.Assert(_firstByteStatus != FirstByteStatus.None);
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (49)
259Debug.Assert(Monitor.IsEntered(SyncObject)); 260Debug.Assert(!_pool.HasSyncObjLock); 280Debug.Assert(!_pool.HasSyncObjLock); 308Debug.Assert(!_pool.HasSyncObjLock); 314Debug.Assert(_availableStreamsWaiter is null || _streamsInUse >= _maxConcurrentStreams); 318Debug.Assert(_streamsInUse >= _httpStreams.Count); 341Debug.Assert(!_pool.HasSyncObjLock); 367Debug.Assert(Monitor.IsEntered(SyncObject)); 371Debug.Assert(_shutdown != result); 496Debug.Assert(InitialSettingsReceived.Task.IsCompleted); 535Debug.Assert(bytesRead >= 0); 636Debug.Assert(frameHeader.Type == FrameType.Headers); 739Debug.Assert(frameHeader.Type == FrameType.AltSvc); 740Debug.Assert(!Monitor.IsEntered(SyncObject)); 768Debug.Assert(frameHeader.Type == FrameType.Data); 797Debug.Assert(frameHeader.Type == FrameType.Settings); 833Debug.Assert((settings.Length % 6) == 0); 923Debug.Assert(_availableStreamsWaiter is null || _streamsInUse >= _maxConcurrentStreams); 936Debug.Assert(newSize >= 0); 953Debug.Assert(frameHeader.Type == FrameType.Priority); 967Debug.Assert(frameHeader.Type == FrameType.Ping); 982Debug.Assert(sizeof(long) == FrameHeader.PingLength); 1001Debug.Assert(frameHeader.Type == FrameType.WindowUpdate); 1011Debug.Assert(amount >= 0); 1038Debug.Assert(frameHeader.Type == FrameType.RstStream); 1071Debug.Assert(lastStreamId >= 0); 1085Debug.Assert(streamId == kvp.Value.StreamId); 1103Debug.Assert(frameHeader.Type == FrameType.GoAway); 1186Debug.Assert(_shutdown && _streamsInUse == 0); 1291Debug.Assert(sizeof(long) == FrameHeader.PingLength); 1315Debug.Assert(!_pool.HasSyncObjLock); 1500Debug.Assert(request.RequestUri != null); 1627Debug.Assert(headerBytes.Length > 0); 1673Debug.Assert(span.Length == 0); 1753Debug.Assert(amount > 0); 1769Debug.Assert(amount > 0); 1770Debug.Assert(_pendingWindowUpdate < ConnectionWindowThreshold); 1800Debug.Assert(_pool.HasSyncObjLock); 1831Debug.Assert(streamId == kvp.Value.StreamId); 1848Debug.Assert(_shutdown); 1849Debug.Assert(_streamsInUse == 0); 1910Debug.Assert(streamId >= 0); 1926Debug.Assert(buffer.Length >= Size); 1938Debug.Assert(destination.Length >= Size); 1939Debug.Assert(type <= FrameType.Last); 1940Debug.Assert((flags & FrameFlags.ValidBits) == flags); 1941Debug.Assert((uint)payloadLength <= MaxPayloadLength); 1993Debug.Assert(async); 1994Debug.Assert(!_pool.HasSyncObjLock);
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (66)
170Debug.Assert(_response != null); 182Debug.Assert(_requestCompletionState == StreamCompletionState.Completed); 187Debug.Assert(_requestBodyCancellationSource != null); 245Debug.Assert(!Monitor.IsEntered(SyncObject)); 255Debug.Assert(_responseCompletionState == StreamCompletionState.Completed); 257Debug.Assert(!ConnectProtocolEstablished); 265Debug.Assert(!sendReset); 269Debug.Assert(!ConnectProtocolEstablished); 287Debug.Assert(!Monitor.IsEntered(SyncObject)); 322Debug.Assert(!ConnectProtocolEstablished); 335Debug.Assert(_request?.Content != null); 364Debug.Assert(Monitor.IsEntered(SyncObject)); 365Debug.Assert(_requestCompletionState != StreamCompletionState.InProgress); 366Debug.Assert(_responseCompletionState != StreamCompletionState.InProgress); 383Debug.Assert(Monitor.IsEntered(SyncObject)); 384Debug.Assert(_requestCompletionState != StreamCompletionState.InProgress); 385Debug.Assert(_responseCompletionState != StreamCompletionState.InProgress); 410Debug.Assert(!Monitor.IsEntered(SyncObject)); 416Debug.Assert(requestBodyCancellationSource != null); 453Debug.Assert(Monitor.IsEntered(SyncObject)); 555Debug.Assert(index >= FirstHPackRequestPseudoHeaderId && index <= LastHPackNormalHeaderId); 578Debug.Assert(index >= FirstHPackRequestPseudoHeaderId && index <= LastHPackNormalHeaderId); 619Debug.Assert(!Monitor.IsEntered(SyncObject)); 641Debug.Assert(_response != null); 683Debug.Assert(!Monitor.IsEntered(SyncObject)); 710Debug.Assert(_trailers != null); 716Debug.Assert(_response != null && _response.Content != null); 722Debug.Assert(_response != null); 731Debug.Assert(name.Length > 0); 763Debug.Assert(!Monitor.IsEntered(SyncObject)); 786Debug.Assert(!Monitor.IsEntered(SyncObject)); 850Debug.Assert(_requestCompletionState != StreamCompletionState.Failed); 869Debug.Assert(!Monitor.IsEntered(SyncObject)); 924Debug.Assert(_requestCompletionState != StreamCompletionState.Failed); 949Debug.Assert(!Monitor.IsEntered(SyncObject)); 988Debug.Assert(requestBodyCancellationSource != null); 1001Debug.Assert(_requestBodyAbandoned); 1002Debug.Assert(!cancel); 1013Debug.Assert(Monitor.IsEntered(SyncObject)); 1034Debug.Assert(!Monitor.IsEntered(SyncObject)); 1040Debug.Assert(!_hasWaiter); 1067Debug.Assert(!wait); 1070Debug.Assert(_response is not null); 1079Debug.Assert(_response != null && _response.Content != null); 1108Debug.Assert(!Monitor.IsEntered(SyncObject)); 1127Debug.Assert(_responseProtocolState == ResponseProtocolState.ExpectingData || _responseProtocolState == ResponseProtocolState.ExpectingTrailingHeaders); 1129Debug.Assert(!_hasWaiter); 1143Debug.Assert(bytesRead == 0); 1146Debug.Assert(!wait); 1167Debug.Assert(bytesRead == 0); 1170Debug.Assert(!wait); 1197Debug.Assert(bytesRead == 0); 1200Debug.Assert(!wait); 1233Debug.Assert(bytesRead == 0); 1236Debug.Assert(!wait); 1268Debug.Assert(_requestBodyCancellationSource != null); 1311Debug.Assert(_creditWaiter != null); 1324Debug.Assert(sendSize > 0); 1376Debug.Assert(!Monitor.IsEntered(SyncObject)); 1421Debug.Assert(!Monitor.IsEntered(SyncObject)); 1435Debug.Assert(!_waitSource.RunContinuationsAsynchronously); 1441Debug.Assert(_waitSource.RunContinuationsAsynchronously); 1459Debug.Assert(!Monitor.IsEntered(thisRef.SyncObject)); 1517Debug.Assert(contentLength >= -1); 1551Debug.Assert(http2Stream != null); 1552Debug.Assert(http2Stream._response != null);
System\Net\Http\SocketsHttpHandler\Http2StreamWindowManager.cs (5)
48Debug.Assert(_lastWindowUpdate != default); // Make sure Start() has been invoked, otherwise we should not be receiving DATA. 49Debug.Assert(bytesConsumed > 0); 50Debug.Assert(_deliveredBytes < StreamWindowThreshold); 120Debug.Assert(_streamWindowSize <= MaxStreamWindowSize); 244Debug.Assert(payload < 0);
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (7)
64Debug.Assert(Monitor.IsEntered(SyncObj)); 119Debug.Assert(Monitor.IsEntered(SyncObj)); 120Debug.Assert(ShuttingDown); 398Debug.Assert(ex.ApplicationErrorCode.HasValue); 415Debug.Assert(payloadLength <= VariableLengthIntegerHelper.OneByteLimit); 459Debug.Assert(ex.ApplicationErrorCode.HasValue); 594Debug.Assert(ex.ApplicationErrorCode.HasValue);
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (16)
208Debug.Assert(_response != null && _response.Content != null); 248Debug.Assert(ex.ApplicationErrorCode.HasValue); 272Debug.Assert(ex.ApplicationErrorCode.HasValue); 294Debug.Assert(_requestBodyCancellationSource.IsCancellationRequested); 334Debug.Assert(_response == null); 351Debug.Assert(_response != null); 564Debug.Assert(_sendBuffer.ActiveLength == 0); 588Debug.Assert(request.RequestUri != null); 648Debug.Assert(actualHeadersLengthEncodedSize == headersLengthEncodedSize); 898Debug.Assert(name.Length > 0); 1094Debug.Assert(_response == null); 1167Debug.Assert(_response == null); 1246Debug.Assert(e.ApplicationErrorCode.HasValue); 1251Debug.Assert(e.ApplicationErrorCode.HasValue); 1402Debug.Assert(_response != null); 1415Debug.Assert(_response != null);
System\Net\Http\SocketsHttpHandler\HttpAuthority.cs (1)
21Debug.Assert(host != null);
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (56)
80Debug.Assert(pool != null); 81Debug.Assert(stream != null); 158Debug.Assert(_readAheadTaskStatus == ReadAheadTask_NotStarted); 206Debug.Assert(_readAheadTask == default); 217Debug.Assert(_readAheadTask == default); 218Debug.Assert(_readBuffer.ActiveLength == 0); 269Debug.Assert(bytesToConsume <= _readBuffer.ActiveLength); 275Debug.Assert(request.RequestUri is not null); 296Debug.Assert(request.RequestUri.Scheme == Uri.UriSchemeHttp); 305Debug.Assert(request.Version.Major >= 0 && request.Version.Minor >= 0); // guaranteed by Version class 315Debug.Assert(Kind != HttpConnectionKind.Proxy); 320Debug.Assert(Kind == HttpConnectionKind.Proxy); 375Debug.Assert(success); 383Debug.Assert(_currentRequest is not null); 455Debug.Assert(Ascii.IsValid(s)); 460Debug.Assert(status == OperationStatus.Done); 461Debug.Assert(bytesWritten == s.Length); 480Debug.Assert(status == OperationStatus.Done); 481Debug.Assert(bytesWritten == s.Length); 500Debug.Assert(_readAheadTaskStatus != ReadAheadTask_Started); 563Debug.Assert(_readBuffer.ActiveLength == 0); 572Debug.Assert(_readAheadTask != default); 573Debug.Assert(_readAheadTaskStatus == ReadAheadTask_CompletionReserved); 818Debug.Assert(_readAheadTaskStatus == ReadAheadTask_CompletionReserved); 906Debug.Assert(request.Content is not null); 932Debug.Assert(stream.BytesWritten == 0); 1105Debug.Assert(_allowedReadLineBytes >= 0); 1282Debug.Assert(added); 1336Debug.Assert(source.Length <= _writeBuffer.AvailableLength); 1494Debug.Assert(formatted); 1500Debug.Assert(_writeBuffer.Capacity >= 8); 1586Debug.Assert(!ReadAheadTaskHasStarted); 1587Debug.Assert(_readBuffer.AvailableLength == _readBuffer.Capacity); 1588Debug.Assert(_readBuffer.AvailableLength >= InitialReadBufferSize); 1602Debug.Assert(_readAheadTask == default); 1642Debug.Assert(_readBuffer.ActiveStartOffset == 0); 1643Debug.Assert(_readBuffer.ActiveLength > searchOffset); 1656Debug.Assert(searchOffset == readLength - 1 && _readBuffer.ActiveReadOnlySpan[searchOffset] == '\n'); 1673Debug.Assert(buffer.Length > 0); 1775Debug.Assert(_readBuffer.AvailableLength == _readBuffer.Capacity); 1808Debug.Assert(_readBuffer.AvailableLength == _readBuffer.Capacity); 1821Debug.Assert(count <= _readBuffer.ActiveLength); 1841Debug.Assert(destination != null); 1860Debug.Assert(remaining > 0); 1877Debug.Assert(destination != null); 1878Debug.Assert(length > 0); 1946Debug.Assert(origReadBuffer.Length > 0); 1967Debug.Assert(_currentRequest == null); 1968Debug.Assert(!_inUse); 1975Debug.Assert(_inUse); 1993Debug.Assert(_inUse); 2031Debug.Assert(_inUse); 2038Debug.Assert(response.Content != null); 2042Debug.Assert(responseStream != null || stream is EmptyReadStream); 2046Debug.Assert(response.RequestMessage == _currentRequest); 2055Debug.Assert(_currentRequest == null);
System\Net\Http\SocketsHttpHandler\HttpConnectionBase.cs (4)
40Debug.Assert(this is HttpConnection or Http2Connection or Http3Connection); 41Debug.Assert(pool.Settings._metrics is not null); 122Debug.Assert(cache is not null); 207Debug.Assert(task.IsFaulted);
System\Net\Http\SocketsHttpHandler\HttpConnectionPoolManager.cs (5)
259Debug.Assert(uri != null); 263Debug.Assert(uri == proxyUri); 286Debug.Assert(HttpUtilities.IsSupportedProxyScheme(proxyUri.Scheme)); 385Debug.Assert(request.RequestUri != null); 475Debug.Assert(_cleaningTimer != null);
System\Net\Http\SocketsHttpHandler\HttpConnectionResponseContent.cs (3)
18Debug.Assert(stream != null); 19Debug.Assert(stream.CanRead); 20Debug.Assert(!_consumedStream);
System\Net\Http\SocketsHttpHandler\HttpContentReadStream.cs (1)
75Debug.Assert(connection != null);
System\Net\Http\SocketsHttpHandler\HttpContentWriteStream.cs (1)
18Debug.Assert(connection != null);
System\Net\Http\SocketsHttpHandler\Metrics\SocketsHttpHandlerMetrics.cs (1)
28Debug.Assert(versionMajor is 1 or 2 or 3);
System\Net\Http\SocketsHttpHandler\MultiProxy.cs (8)
51Debug.Assert(failedProxyCache != null); 80Debug.Assert(failedProxyCache != null); 98Debug.Assert(_failedProxyCache != null); 115Debug.Assert(_failedProxyCache != null); 141Debug.Assert(uri != null); 171Debug.Assert(_proxyConfig != null); 177Debug.Assert(_currentIndex <= _proxyConfig.Length); 258Debug.Assert(charactersConsumed > 0);
System\Net\Http\SocketsHttpHandler\PreAuthCredentialCache.cs (6)
18Debug.Assert(uriPrefix != null); 19Debug.Assert(authType != null); 31Debug.Assert(uriPrefix != null); 32Debug.Assert(authType != null); 46Debug.Assert(uriPrefix != null); 47Debug.Assert(authType != null);
System\Net\Http\SocketsHttpHandler\RedirectHandler.cs (4)
19Debug.Assert(initialInnerHandler != null); 20Debug.Assert(redirectInnerHandler != null); 21Debug.Assert(maxAutomaticRedirections > 0); 34Debug.Assert(request.RequestUri != null);
System\Net\Http\SocketsHttpHandler\SocketsHttpHandler.cs (1)
538Debug.Assert(_decompressionHandlerFactory is not null);
System\Net\Http\SocketsHttpHandler\SocksHelper.cs (6)
162Debug.Assert(bytesWritten == 4); 167Debug.Assert(hostIP.AddressFamily == AddressFamily.InterNetworkV6); 170Debug.Assert(bytesWritten == 16); 270Debug.Assert(isVersion4a); 279Debug.Assert(bytesWritten == 4); 328Debug.Assert(Encoding.UTF8.GetByteCount(chars) > 255);
System\Net\Http\StreamContent.cs (2)
50Debug.Assert(stream != null); 67Debug.Assert(stream != null);
System\Net\Http\StreamToStreamCopy.cs (6)
25Debug.Assert(source != null); 26Debug.Assert(destination != null); 27Debug.Assert(bufferSize >= 0); 52Debug.Assert(source != null); 53Debug.Assert(destination != null); 54Debug.Assert(bufferSize >= 0);
System.Net.Http.Json (5)
System\Net\Http\Json\HttpClientJsonExtensions.cs (1)
121Debug.Assert(client.MaxResponseContentBufferSize is > 0 and <= int.MaxValue);
System\Net\Http\Json\JsonContent.cs (2)
27Debug.Assert(jsonTypeInfo is not null); 28Debug.Assert(inputValue is null || jsonTypeInfo.Type.IsAssignableFrom(inputValue.GetType()));
System\Net\Http\Json\JsonHelpers.cs (2)
19Debug.Assert(type is not null); 53Debug.Assert(encoding != null);
System.Net.HttpListener (16)
src\libraries\Common\src\System\HexConverter.cs (1)
165Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (1)
402Debug.Assert(state is LazyAsyncResult);
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.Associate.cs (1)
35Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\WebHeaderEncoding.cs (1)
23Debug.Assert(bytes != null && (uint)byteIndex <= (uint)bytes.Length && (uint)(byteIndex + byteCount) <= (uint)bytes.Length);
System\Net\HttpListener.cs (1)
210Debug.Assert(operationStatus == OperationStatus.Done);
System\Net\HttpListenerRequestUriBuilder.cs (3)
176Debug.Assert(_rawPath != null); 229Debug.Assert(_requestUriString != null); 288Debug.Assert(_rawOctets != null);
System\Net\Managed\ChunkStream.cs (1)
137Debug.Assert(offset == 0);
System\Net\Managed\HttpListenerRequest.Managed.cs (1)
152Debug.Assert(_rawUrl != null);
System\Net\Managed\HttpRequestStream.Managed.cs (2)
122Debug.Assert(nread <= _remainingBody); 208Debug.Assert(nread <= _remainingBody);
System\Net\ServiceNameStore.cs (2)
137Debug.Assert(!string.IsNullOrEmpty(uriPrefix)); 166Debug.Assert(!string.IsNullOrEmpty(uriPrefix));
System.Net.Mail (19)
src\libraries\Common\src\System\HexConverter.cs (1)
165Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (1)
402Debug.Assert(state is LazyAsyncResult);
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.Associate.cs (1)
35Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
System\Net\Mail\MailAddress.cs (1)
76Debug.Assert(parseSuccess);
System\Net\Mail\MailAddressParser.cs (1)
69Debug.Assert(!string.IsNullOrEmpty(data));
System\Net\Mail\MailBnfHelper.cs (2)
362Debug.Assert(index >= 0); 363Debug.Assert(index < data.Length);
System\Net\Mail\MailPriority.cs (1)
492System.Diagnostics.Debug.Assert(_headersEncoding != null);
System\Net\Mail\MailWriter.cs (1)
55Diagnostics.Debug.Assert(_contentStream == sender);
System\Net\Mail\SmtpReplyReaderFactory.cs (2)
309System.Diagnostics.Debug.Assert(_readState == ReadState.Status0); 394System.Diagnostics.Debug.Assert(_parent._readState == ReadState.Status0);
System\Net\Mime\SmtpDateTime.cs (1)
268Debug.Assert(dateValue.Kind == DateTimeKind.Unspecified);
System.Net.NameResolution (11)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (4)
28Debug.Assert(ipv4 > 0); 29Debug.Assert(ipv6 > 0); 30Debug.Assert(uds > 0); 31Debug.Assert(max >= ipv4 && max >= ipv6 && max >= uds);
System\Net\Dns.cs (2)
435Debug.Assert(name != null); 670Debug.Assert(!Monitor.IsEntered(s_tasks));
System\Net\NameResolutionPal.Unix.cs (1)
166Debug.Assert(bytesWritten == rawAddressLength);
System\Net\NameResolutionTelemetry.cs (2)
86Debug.Assert(startingTimestamp.HasValue); 119Debug.Assert(hostNameOrAddress is not null);
System.Net.NetworkInformation (11)
src\libraries\Common\src\System\HexConverter.cs (1)
165Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\IO\RowConfigReader.cs (1)
66Debug.Assert(_buffer != null);
System\Net\NetworkInformation\NetEventSource.NetworkInformation.cs (1)
24Debug.Assert(IsEnabled());
System\Net\NetworkInformation\NetworkAddressChange.Unix.cs (4)
24Debug.Assert(Monitor.IsEntered(s_gate)); 29Debug.Assert(Monitor.IsEntered(s_gate)); 152Debug.Assert(Monitor.IsEntered(s_gate)); 177Debug.Assert(Monitor.IsEntered(s_gate));
System\Net\NetworkInformation\StringParsingHelpers.Connections.cs (1)
360Debug.Assert(hexAddress.Length == 32);
System\Net\NetworkInformation\UnicastIPAddressInformation.cs (3)
72Debug.Assert((0 <= prefixLength) && (prefixLength <= 126)); 73Debug.Assert((family == AddressFamily.InterNetwork) || (family == AddressFamily.InterNetworkV6)); 80Debug.Assert(prefixLength <= (addressBytes.Length * 8));
System.Net.Ping (5)
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (1)
46Debug.Assert(written == IPAddressParserStatics.IPv6AddressBytes);
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (4)
28Debug.Assert(ipv4 > 0); 29Debug.Assert(ipv6 > 0); 30Debug.Assert(uds > 0); 31Debug.Assert(max >= ipv4 && max >= ipv6 && max >= uds);
System.Net.Primitives (46)
src\libraries\Common\src\System\HexConverter.cs (1)
165Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Net\CredentialCacheKey.cs (4)
20Debug.Assert(uriPrefix != null); 21Debug.Assert(authenticationType != null); 60Debug.Assert(uri != null); 61Debug.Assert(prefixUri != null);
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (1)
46Debug.Assert(written == IPAddressParserStatics.IPv6AddressBytes);
src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (1)
114Debug.Assert(start < end);
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\SocketAddress.cs (4)
107Debug.Assert(bytesWritten == IPAddressParserStatics.IPv6AddressBytes); 117Debug.Assert(ipAddress.AddressFamily == AddressFamily.InterNetwork); 178Debug.Assert(formatted); 193Debug.Assert(formatted);
src\libraries\Common\src\System\Net\SocketAddressExtensions.cs (1)
14Debug.Assert(socketAddress.Family == AddressFamily.InterNetwork || socketAddress.Family == AddressFamily.InterNetworkV6);
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (4)
28Debug.Assert(ipv4 > 0); 29Debug.Assert(ipv6 > 0); 30Debug.Assert(uds > 0); 31Debug.Assert(max >= ipv4 && max >= ipv6 && max >= uds);
System\Net\Cookie.cs (1)
80Debug.Assert(MaxSupportedVersion.ToString(NumberFormatInfo.InvariantInfo).Equals(MaxSupportedVersionString, StringComparison.Ordinal));
System\Net\CookieContainer.cs (4)
361Debug.Assert(m_maxCookies != 0); 362Debug.Assert(m_maxCookiesPerDomain != 0); 405Debug.Assert(cc != null); 1080Debug.Assert(value != null);
System\Net\CredentialCache.cs (7)
177Debug.Assert(cache != null); 200Debug.Assert(cache != null); 250Debug.Assert(table != null); 275Debug.Assert(cache._cacheForHosts != null); 356Debug.Assert(!string.IsNullOrEmpty(host)); 357Debug.Assert(port >= 0); 358Debug.Assert(authenticationType != null);
System\Net\IPAddress.cs (11)
77Debug.Assert(IsIPv4); 82Debug.Assert(IsIPv4); 93Debug.Assert(IsIPv6); 98Debug.Assert(IsIPv6); 145Debug.Assert(numbers.Length == NumberOfLabels); 153Debug.Assert(numbers != null); 154Debug.Assert(numbers.Length == NumberOfLabels); 305Debug.Assert(numbers != null && numbers.Length == NumberOfLabels); 345Debug.Assert(_numbers != null && _numbers.Length == NumberOfLabels); 466Debug.Assert(tmpDestination.Length >= IPAddressParser.MaxIPv4StringLength); 642Debug.Assert(comparand != null);
System\Net\IPAddressParser.cs (1)
70Debug.Assert(numbersLength >= IPAddressParserStatics.IPv6AddressShorts);
System\Net\IPNetwork.cs (4)
114Debug.Assert(bytesWritten == IPAddressParserStatics.IPv6AddressBytes); 116Debug.Assert(bytesWritten == IPAddressParserStatics.IPv6AddressBytes); 193Debug.Assert(prefixLength >= 0); // Parsing with NumberStyles.None should ensure that prefixLength is always non-negative. 222Debug.Assert(bytesWritten == IPAddressParserStatics.IPv6AddressBytes);
System.Net.Quic (88)
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (2)
41Debug.Assert(currentHandle.IsInvalid); 51Debug.Assert(handle != null);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (1)
46Debug.Assert(addedRef);
src\libraries\Common\src\System\HexConverter.cs (1)
165Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Net\ArrayBuffer.cs (9)
34Debug.Assert(initialSize > 0 || usePool); 46Debug.Assert(buffer.Length > 0); 71Debug.Assert(_usePool); 72Debug.Assert(_bytes is not null); 111Debug.Assert(byteCount <= AvailableLength); 127Debug.Assert(AvailableLength < byteCount); 131Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0); 143Debug.Assert(byteCount <= AvailableLength); 171Debug.Assert(byteCount <= AvailableLength);
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (1)
46Debug.Assert(written == IPAddressParserStatics.IPv6AddressBytes);
src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (1)
114Debug.Assert(start < end);
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (31)
38Debug.Assert(initialBufferSize >= 0); 70Debug.Assert(byteCount >= 0); 112Debug.Assert(toReturn is not null); 120Debug.Assert(byteCount >= 0); 130Debug.Assert(byteCount >= 0); 131Debug.Assert(limit >= 0); 147Debug.Assert(byteCount >= 0); 157Debug.Assert(byteCount > AvailableMemory.Length); 169Debug.Assert(_allocatedEnd == 0); 170Debug.Assert(_activeStart == 0); 171Debug.Assert(_availableStart == 0); 183Debug.Assert(_allocatedEnd % BlockSize == 0); 184Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize); 225Debug.Assert(_allocatedEnd % BlockSize == 0); 227Debug.Assert(allocatedBlockCount == 0 || _blocks[allocatedBlockCount - 1] is not null); 230Debug.Assert(_blocks[allocatedBlockCount] is null); 237Debug.Assert(byteCount <= AvailableMemory.Length); 247Debug.Assert(_activeStart == 0); 248Debug.Assert(_availableStart == 0); 249Debug.Assert(_allocatedEnd == 0); 253Debug.Assert(_activeStart <= _availableStart); 254Debug.Assert(_availableStart <= _allocatedEnd); 255Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize); 264Debug.Assert(_blocks[i] is null); 269Debug.Assert(_blocks[i] is not null); 274Debug.Assert(_blocks[i] is null); 307Debug.Assert(blocks is not null); 308Debug.Assert(start <= int.MaxValue); 309Debug.Assert(length <= int.MaxValue); 310Debug.Assert(start + length <= blocks.Length * BlockSize); 350Debug.Assert(_blocks is not null);
src\libraries\Common\src\System\Net\Security\SslKeyLogger.cs (3)
46Debug.Assert(s_fileStream != null); 71Debug.Assert(s_fileStream != null); 72Debug.Assert(!clientRandom.IsEmpty);
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (4)
28Debug.Assert(ipv4 > 0); 29Debug.Assert(ipv6 > 0); 30Debug.Assert(uds > 0); 31Debug.Assert(max >= ipv4 && max >= ipv6 && max >= uds);
src\libraries\Common\src\System\Net\StreamBuffer.cs (17)
39Debug.Assert(!Monitor.IsEntered(SyncObject)); 51Debug.Assert(!Monitor.IsEntered(SyncObject)); 63Debug.Assert(!Monitor.IsEntered(SyncObject)); 80Debug.Assert(!Monitor.IsEntered(SyncObject)); 95Debug.Assert(buffer.Length > 0); 97Debug.Assert(!Monitor.IsEntered(SyncObject)); 145Debug.Assert(bytesWritten == buffer.Length); 168Debug.Assert(bytesWritten == buffer.Length); 179Debug.Assert(!Monitor.IsEntered(SyncObject)); 195Debug.Assert(!Monitor.IsEntered(SyncObject)); 229Debug.Assert(bytesRead == 0); 232Debug.Assert(!wait); 245Debug.Assert(bytesRead == 0); 248Debug.Assert(!wait); 258Debug.Assert(!Monitor.IsEntered(SyncObject)); 303Debug.Assert(_hasWaiter == 0); 323Debug.Assert(cancellationToken.IsCancellationRequested);
System\Net\Quic\Internal\MsQuicApi.cs (2)
211Debug.Assert(IsQuicSupported); 223Debug.Assert(MsQuicOpenVersion != null);
System\Net\Quic\Internal\MsQuicBuffers.cs (3)
52Debug.Assert(index < _count); 53Debug.Assert(_buffers[index].Buffer is null); 54Debug.Assert(_buffers[index].Length == 0);
System\Net\Quic\Internal\MsQuicConfiguration.Cache.cs (3)
180Debug.Assert(handle.IsClosed); 226Debug.Assert(removed); 228Debug.Assert(handle.IsClosed);
System\Net\Quic\Internal\MsQuicSafeHandle.cs (1)
107Debug.Assert(_disposable is null);
System\Net\Quic\Internal\ResettableValueTaskSource.cs (1)
101Debug.Assert(!_keepAlive.IsAllocated);
System\Net\Quic\Internal\ValueTaskSource.cs (1)
84Debug.Assert(!_keepAlive.IsAllocated);
System\Net\Quic\QuicConnection.cs (2)
311Debug.Assert(host is not null); 719Debug.Assert(_connectedTcs.IsCompleted);
System\Net\Quic\QuicConnection.SslConnectionOptions.cs (1)
131Debug.Assert(certificate == null);
System\Net\Quic\QuicListener.cs (1)
259Debug.Assert(task.IsFaulted);
System\Net\Quic\QuicStream.cs (1)
735Debug.Assert(_startedTcs.IsCompleted);
System.Net.Requests (15)
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (1)
402Debug.Assert(state is LazyAsyncResult);
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.Associate.cs (1)
35Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
System\Net\HttpWebRequest.cs (6)
1025Debug.Assert(_sendRequestCts != null); 1679Debug.Assert(settings != null); 1681Debug.Assert(fi != null); 1688Debug.Assert(handler.UseCookies); // Default of handler.UseCookies is true. 1702Debug.Assert(handler.UseProxy); // Default of handler.UseProxy is true. 1703Debug.Assert(handler.Proxy == null); // Default of handler.Proxy is null.
System\Net\RequestBufferingStream.cs (1)
109Debug.Assert(success); // Buffer should always be visible since default MemoryStream constructor was used.
System\Net\RequestStreamContent.cs (1)
20Debug.Assert(stream is not null);
System\Net\ServicePoint\ServicePoint.cs (1)
21Debug.Assert(address != null);
System\Net\TaskExtensions.cs (1)
35Debug.Assert(tcs.Task.IsCanceled);
System\Net\WebException.cs (1)
82Debug.Assert(exception != null);
System.Net.Security (119)
src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssBuffer.cs (1)
74Debug.Assert(sizeof(GssBuffer) == 16);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (14)
70Debug.Assert((sslAuthenticationOptions.EnabledSslProtocols & FakeAlpnSslProtocol) == 0); 142Debug.Assert(cipherList.IsEmpty || cipherList[^1] == 0); 145Debug.Assert(cipherSuites == null || (cipherSuites.Length >= 1 && cipherSuites[cipherSuites.Length - 1] == 0)); 177Debug.Assert(result == 1); 232Debug.Assert(sslAuthenticationOptions.CertificateContext.CertificateHandle != null); 233Debug.Assert(sslAuthenticationOptions.CertificateContext.KeyHandle != null); 286Debug.Assert(sslAuthenticationOptions.CertificateContext != null); 340Debug.Assert(Interop.Ssl.SslGetData(sslHandle) == IntPtr.Zero); 708Debug.Assert(ssl != IntPtr.Zero); 709Debug.Assert(session != IntPtr.Zero); 733Debug.Assert(ctx != IntPtr.Zero && session != IntPtr.Zero); 750Debug.Assert(name != IntPtr.Zero); 763Debug.Assert(count >= 0); 764Debug.Assert(buffer.Length >= count);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (1)
258Debug.Assert(stapledResponse.Length > 0);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtx.cs (10)
108Debug.Assert(_gch.IsAllocated); 120Debug.Assert(_sslSessions == null); 124Debug.Assert(_gch.IsAllocated); 131Debug.Assert(_sslSessions != null && session != IntPtr.Zero); 139Debug.Assert(targetName != null); 157Debug.Assert(added); 181Debug.Assert(_sslSessions != null); 184Debug.Assert(targetName != null); 210Debug.Assert(_sslSessions != null); 219Debug.Assert(Interop.Ssl.SslGetData(sslHandle) == IntPtr.Zero);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (2)
41Debug.Assert(currentHandle.IsInvalid); 51Debug.Assert(handle != null);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (1)
46Debug.Assert(addedRef);
src\libraries\Common\src\System\HexConverter.cs (1)
165Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Net\ArrayBuffer.cs (9)
34Debug.Assert(initialSize > 0 || usePool); 46Debug.Assert(buffer.Length > 0); 71Debug.Assert(_usePool); 72Debug.Assert(_bytes is not null); 111Debug.Assert(byteCount <= AvailableLength); 127Debug.Assert(AvailableLength < byteCount); 131Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0); 143Debug.Assert(byteCount <= AvailableLength); 171Debug.Assert(byteCount <= AvailableLength);
src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (1)
31Debug.Assert(task.IsCompletedSuccessfully);
src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (1)
114Debug.Assert(start < end);
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\Security\MD4.cs (1)
65Debug.Assert(destination.Length == 128 >> 3);
src\libraries\Common\src\System\Net\Security\RC4.cs (2)
78Debug.Assert(input.Length == output.Length); 79Debug.Assert(state != null);
src\libraries\Common\src\System\Net\Security\SslKeyLogger.cs (3)
46Debug.Assert(s_fileStream != null); 71Debug.Assert(s_fileStream != null); 72Debug.Assert(!clientRandom.IsEmpty);
src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (3)
17Debug.Assert(arraySegment.Array != null); 18Debug.Assert(arraySegment.Offset == 0); 25Debug.Assert(clearSize <= array.Length);
src\libraries\Common\src\System\Text\UrlBase64Encoding.cs (2)
26Debug.Assert(charsWritten == base64Len); 65Debug.Assert(source[0] == '=');
System\Net\CertificateValidationPal.Unix.cs (1)
148Debug.Assert(storeLocation == StoreLocation.CurrentUser);
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (18)
233Debug.Assert(clientOptions.Package == NegotiationInfoClass.NTLM); 271Debug.Assert(incomingBlob.IsEmpty); 287Debug.Assert(!incomingBlob.IsEmpty); 297Debug.Assert(HeaderLength == NtlmHeader.Length); 298Debug.Assert(asBytes.Length == sizeof(NegotiateMessage)); 384Debug.Assert(written == HMACMD5.HashSizeInBytes); 400Debug.Assert(serverChallenge.Length == ChallengeLength); 401Debug.Assert(clientChallenge.Length == ChallengeLength); 402Debug.Assert(ntlm2hash.Length == DigestLength); 448Debug.Assert(written == MD5.HashSizeInBytes); 524Debug.Assert(bytesWritten == spnSize); 650Debug.Assert(payloadOffset == sizeof(AuthenticateMessage) + ChallengeResponseLength + sizeof(NtChallengeResponse) + targetInfoBuffer.Length); 661Debug.Assert(flags.HasFlag(Flags.NegotiateSign) && flags.HasFlag(Flags.NegotiateKeyExchange)); 666Debug.Assert(sessionKeyWritten == HMACMD5.HashSizeInBytes); 678Debug.Assert(_negotiateMessage != null); 697Debug.Assert(payloadOffset == responseBytes.Length); 753Debug.Assert(_clientSeal is not null); 754Debug.Assert(_clientSigningKey is not null);
System\Net\NegotiateAuthenticationPal.ManagedSpnego.cs (1)
83Debug.Assert(clientOptions.Package == NegotiationInfoClass.Negotiate);
System\Net\NegotiateAuthenticationPal.Unix.cs (7)
134Debug.Assert(_securityContext is not null); 332Debug.Assert(_securityContext is not null); 363Debug.Assert(_securityContext is not null); 391Debug.Assert(_securityContext is not null); 422Debug.Assert(_securityContext is not null); 448Debug.Assert(_securityContext is not null); 591Debug.Assert(appDataOffset < channelBinding.Size);
System\Net\Security\NegotiateAuthentication.cs (1)
406Debug.Assert(_extendedProtectionPolicy != null);
System\Net\Security\NegotiateStream.cs (7)
341Debug.Assert(_context is not null); 506Debug.Assert(_context is not null); 507Debug.Assert(_writeBuffer is not null); 724Debug.Assert(_context != null); 753Debug.Assert(_context != null); 862Debug.Assert(_framer != null); 888Debug.Assert(_context != null);
System\Net\Security\NetSecurityTelemetry.cs (3)
141Debug.Assert(sizeof(SslProtocols) == 4); 242Debug.Assert(count >= 0); 245Debug.Assert(count >= 0);
System\Net\Security\Pal.Managed\SafeChannelBindingHandle.cs (2)
24Debug.Assert(certHashBytes.Length <= CertHashMaxSize); 33Debug.Assert(kind == ChannelBindingKind.Endpoint || kind == ChannelBindingKind.Unique);
System\Net\Security\SslApplicationProtocol.cs (1)
29Debug.Assert(protocol != null);
System\Net\Security\SslStream.cs (1)
767Debug.Assert(bytesRead == 0 || bytesRead == 1);
System\Net\Security\SslStream.IO.cs (4)
278Debug.Assert(token.Payload != null); 828Debug.Assert(_buffer.EncryptedLength == 0); 833Debug.Assert(_buffer.DecryptedLength == 0); 973Debug.Assert(_buffer.DecryptedLength > 0);
System\Net\Security\SslStream.Protocol.cs (4)
742Debug.Assert(_sslAuthenticationOptions.CertificateContext != null); 963Debug.Assert(_securityContext != null); 1362Debug.Assert(Payload == null); 1399Debug.Assert(Payload != null || Size == 0);
System\Net\Security\SslStreamCertificateContext.Linux.cs (8)
245Debug.Assert(_rootCertificate != null); 248Debug.Assert(_ocspUrls is not null); 249Debug.Assert(_ocspUrls.Count > 0); 250Debug.Assert(caCert is not null); 254Debug.Assert(subject != 0); 255Debug.Assert(issuer != 0); 363Debug.Assert(baseUri.Length > 0); 364Debug.Assert(encodedRequest.Count > 0);
System\Net\Security\SslStreamPal.Unix.cs (1)
188Debug.Assert(sslAuthenticationOptions.IsClient);
System\Net\Security\TlsFrameHelper.cs (1)
237Debug.Assert(gotHeader);
System\Net\SslStreamContext.cs (1)
16Debug.Assert(sslStream != null);
System\Security\Authentication\ExtendedProtection\ServiceNameCollection.cs (4)
45Debug.Assert(list != null); 46Debug.Assert(additionalCapacity >= 0); 109Debug.Assert(serviceNames != null); 122Debug.Assert(serviceNames != null);
System.Net.Sockets (96)
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (1)
46Debug.Assert(written == IPAddressParserStatics.IPv6AddressBytes);
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\SocketAddressExtensions.cs (1)
14Debug.Assert(socketAddress.Family == AddressFamily.InterNetwork || socketAddress.Family == AddressFamily.InterNetworkV6);
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (4)
28Debug.Assert(ipv4 > 0); 29Debug.Assert(ipv6 > 0); 30Debug.Assert(uds > 0); 31Debug.Assert(max >= ipv4 && max >= ipv6 && max >= uds);
System\Net\Sockets\SafeSocketHandle.cs (1)
174Debug.Assert(!IsClosed);
System\Net\Sockets\Socket.cs (10)
89Debug.Assert(_handle.IsInvalid); 95Debug.Assert(!_handle.IsInvalid); 139Debug.Assert(SocketPal.MaximumAddressSize <= 512); 151Debug.Assert(bufferLength <= buffer.Length); 1036Debug.Assert(acceptedSocketHandle.IsInvalid); 1047Debug.Assert(!acceptedSocketHandle.IsInvalid); 3606Debug.Assert(fd != null && !fd.IsInvalid); 3664Debug.Assert(_nonBlockingConnectInProgress == false); 3883Debug.Assert(t.IsCanceled || t.IsFaulted); 3890Debug.Assert(t.Exception != null);
System\Net\Sockets\Socket.Tasks.cs (14)
65Debug.Assert(saea.BufferList is null); 66Debug.Assert(saea.AcceptSocket is null); 113Debug.Assert(cancellationToken.CanBeCanceled); 206Debug.Assert(endPoint.Port == port); 218Debug.Assert(lastException != null); 323Debug.Assert(saea.BufferList == null); 413Debug.Assert(saea.BufferList == null); 453Debug.Assert(saea.BufferList == null); 514Debug.Assert(saea.BufferList == null); 569Debug.Assert(saea.BufferList == null); 587Debug.Assert(saea.BufferList == null); 677Debug.Assert(saea.BufferList == null); 707Debug.Assert(saea.BufferList == null); 805Debug.Assert(index == packetsCount);
System\Net\Sockets\Socket.Unix.cs (2)
58Debug.Assert(!_handle.LastConnectFailed); 99Debug.Assert(rv == 0 || blocking); // ignore failures
System\Net\Sockets\SocketAsyncContext.Unix.cs (24)
246Debug.Assert(_state == (int)State.Canceled); 285Debug.Assert(Event == null); 471Debug.Assert(SocketAddress.Length == 0); 695Debug.Assert(lockObject != null); 699Debug.Assert(!Monitor.IsEntered(_lockObject)); 711Debug.Assert(Monitor.IsEntered(_lockObject)); 777Debug.Assert(_queueLock == null); 796Debug.Assert(sizeof(QueueState) == sizeof(int)); 852Debug.Assert(!_isNextOperationSynchronous); 875Debug.Assert(_tail == null); 902Debug.Assert(error != Interop.Error.SUCCESS); 944Debug.Assert(_isNextOperationSynchronous == (op.Event != null)); 963Debug.Assert(_tail == null); 983Debug.Assert(!skipAsyncEvents); 1019Debug.Assert(_tail == null); 1047Debug.Assert(_tail == null); 1079Debug.Assert(_tail == null); 1107Debug.Assert(result != OperationResult.Pending); 1114Debug.Assert(op.Event != null); 1123Debug.Assert(_tail == null); 1197Debug.Assert(_state != QueueState.Stopped); 1203Debug.Assert(_state != QueueState.Stopped); 1265Debug.Assert(_isHandleNonBlocking); 2184Debug.Assert((events & Interop.Sys.SocketEvents.Error) == 0);
System\Net\Sockets\SocketAsyncEventArgs.cs (4)
120Debug.Assert(success); 651Debug.Assert(endPoint.AddressFamily == AddressFamily.Unspecified || 736Debug.Assert(existing.Port == port); 1003Debug.Assert(socketError != SocketError.IOPending);
System\Net\Sockets\SocketAsyncEventArgs.Unix.cs (4)
38Debug.Assert(socketAddress.Length > 0); 183Debug.Assert(socketAddress.Length == socketAddressSize); 240Debug.Assert(_sendPacketsElements != null); 327Debug.Assert(NetEventSource.Log.IsEnabled());
System\Net\Sockets\SocketPal.Unix.cs (20)
104Debug.Assert(!handle.IsSocket); 119Debug.Assert(socket.IsSocket); 143Debug.Assert(socket.IsSocket); 155Debug.Assert(socketAddress.Length != 0 || sockAddr == null); 184Debug.Assert(!handle.IsSocket); 213Debug.Assert(socket.IsSocket); 240Debug.Assert(socket.IsSocket); 284Debug.Assert(socket.IsSocket); 374Debug.Assert(socket.IsSocket); 472Debug.Assert(socket.IsSocket); 488Debug.Assert(socketAddress.Length != 0 || rawSocketAddress == null); 530Debug.Assert(socket.IsSocket); 751Debug.Assert(flags == SocketFlags.None); 810Debug.Assert(flags == SocketFlags.None); 811Debug.Assert(buffers == null); 949Debug.Assert(flags == SocketFlags.None); 950Debug.Assert(buffers == null); 1630Debug.Assert((uint)optionLength <= optionValue.Length); 1831Debug.Assert(refsAdded == 0); 1930Debug.Assert(elements.Length == fileHandles.Length);
System\Net\Sockets\SocketsTelemetry.cs (5)
94Debug.Assert(newCount >= 0); 98Debug.Assert(exceptionMessage is null); 132Debug.Assert(exceptionMessage is null); 146Debug.Assert(count >= 0); 153Debug.Assert(count >= 0);
System\Net\Sockets\TCPClient.cs (1)
338Debug.Assert(_clientSocket == null);
System\Net\Sockets\TCPListener.cs (1)
281Debug.Assert(OperatingSystem.IsWindows());
System\Net\Sockets\UnixDomainSocketEndPoint.cs (2)
57Debug.Assert(bufferLength - (isAbstract ? 0 : 1) == bytesEncoded); 69Debug.Assert(AddressFamily.Unix == SocketAddressPal.GetAddressFamily(socketAddress));
System.Net.WebClient (19)
src\libraries\Common\src\System\HexConverter.cs (1)
165Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\IO\ChunkedMemoryStream.cs (3)
29Debug.Assert(chunk._next == null || chunk._freeOffset == chunk._buffer.Length); 97Debug.Assert(_headChunk == null); 102Debug.Assert(_headChunk != null);
src\libraries\Common\src\System\IO\DelegatingStream.cs (1)
65Debug.Assert(innerStream != null);
src\libraries\Common\src\System\Threading\Tasks\BeginEndAwaitableAdapter.cs (3)
13Debug.Assert(asyncResult != null); 14Debug.Assert(asyncResult.IsCompleted); 15Debug.Assert(asyncResult.AsyncState is BeginEndAwaitableAdapter);
src\libraries\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs (8)
45Debug.Assert(c == null || c == s_completionSentinel); 55Debug.Assert(_continuation != null); 96Debug.Assert(exception != null); 109Debug.Assert(c != s_completionSentinel); 125Debug.Assert(continuation != null); 130Debug.Assert(c == s_completionSentinel); 145Debug.Assert(_resultSet ^ (_error != null)); 149Debug.Assert(!_resultSet && _error == null);
System\Net\WebClient.cs (3)
516Debug.Assert(conversionStatus == OperationStatus.Done); 872Debug.Assert(asyncOp != null); 1009Debug.Assert(asyncOp != null);
System.Net.WebHeaderCollection (1)
System\Net\HeaderInfoTable.cs (1)
142Debug.Assert(headers.Count == Items);
System.Net.WebProxy (1)
System\Net\WebProxy.cs (1)
182Debug.Assert(formatted);
System.Net.WebSockets (31)
System\Net\WebSockets\AsyncMutex.cs (9)
106Debug.Assert(_waitersTail.Next != null && _waitersTail.Prev != null); 129Debug.Assert(w.Prev != null); 144Debug.Assert(m._waitersTail == w); 191Debug.Assert(_lockedSemaphoreFull); 200Debug.Assert(w.Next != null && w.Prev != null); 201Debug.Assert(w.Next != w || w.Prev == w); 202Debug.Assert(w.Prev != w || w.Next == w); 211Debug.Assert(w.Next != null && w.Prev != null); 212Debug.Assert(w.Next != w && w.Prev != w);
System\Net\WebSockets\Compression\WebSocketDeflater.cs (8)
60Debug.Assert(consumed == payload.Length); 95Debug.Assert(written == output.Length); 124Debug.Assert(_stream is not null); 155Debug.Assert(_stream is not null); 156Debug.Assert(_stream.AvailIn == 0); 157Debug.Assert(output.Length > 0); 171Debug.Assert(errorCode is ErrorCode.Ok or ErrorCode.BufError); 185Debug.Assert(errorCode == ErrorCode.Ok);
System\Net\WebSockets\Compression\WebSocketInflater.cs (5)
74Debug.Assert(_available > 0); 98Debug.Assert(_available == 0); 166Debug.Assert(_stream is not null && _stream.AvailIn == 0); 167Debug.Assert(_available == 0); 230Debug.Assert(destination.Length > 0);
System\Net\WebSockets\ManagedWebSocket.cs (6)
379Debug.Assert(_sentCloseFrame); 547Debug.Assert(_sendBuffer != null); 821Debug.Assert(_inflater is not null); 831Debug.Assert(receiveBufferBytesToCopy > 0); 1450Debug.Assert(_sendBuffer == null); // would only fail if had some catastrophic error previously that prevented cleaning up 1489Debug.Assert(maskIndex < sizeof(int));
System\Net\WebSockets\ValueWebSocketReceiveResult.cs (3)
26Debug.Assert(count == Count); 27Debug.Assert(messageType == MessageType); 28Debug.Assert(endOfMessage == EndOfMessage);
System.Net.WebSockets.Client (13)
System\Net\WebSockets\ClientWebSocket.cs (4)
49Debug.Assert((InternalState)_state == InternalState.Disposed); 140Debug.Assert(_state == (int)InternalState.Disposed); 177Debug.Assert(_innerWebSocket != null); 178Debug.Assert(_innerWebSocket.WebSocket != null);
System\Net\WebSockets\WebSocketHandle.Managed.cs (9)
152Debug.Assert(subprotocolEnumerableValues is string[]); 194Debug.Assert(connectedStream.CanWrite); 195Debug.Assert(connectedStream.CanRead); 300Debug.Assert(handler.SslOptions.ClientCertificates == null); 439Debug.Assert(builder.Length <= ClientWebSocketDeflateConstants.MaxExtensionLength); 448Debug.Assert(response.Version == HttpVersion.Version11 || response.Version == HttpVersion.Version20); 457Debug.Assert(secValue != null); 493Debug.Assert(success); 502Debug.Assert(bytesWritten == 20 /* SHA1 hash length */);
System.Numerics.Tensors (315)
System\NIndex.cs (1)
170Debug.Assert(formatted);
System\NRange.cs (2)
74Debug.Assert(formatted); 85Debug.Assert(formatted);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IAggregationOperator.cs (54)
162Debug.Assert(((nuint)xPtr % (uint)sizeof(Vector128<T>)) == 0); 331Debug.Assert(((nuint)xPtr % (uint)sizeof(Vector256<T>)) == 0); 500Debug.Assert(((nuint)xPtr % (uint)sizeof(Vector512<T>)) == 0); 648Debug.Assert(sizeof(T) == 8); 656Debug.Assert(sizeof(T) == 1); 694Debug.Assert(Vector256.IsHardwareAccelerated); 708Debug.Assert(Vector256.IsHardwareAccelerated); 733Debug.Assert(Vector128.IsHardwareAccelerated); 747Debug.Assert(Vector128.IsHardwareAccelerated); 827Debug.Assert(sizeof(T) == 2); 849Debug.Assert(Vector256.IsHardwareAccelerated); 863Debug.Assert(Vector256.IsHardwareAccelerated); 880Debug.Assert(Vector128.IsHardwareAccelerated); 894Debug.Assert(Vector128.IsHardwareAccelerated); 942Debug.Assert(sizeof(T) == 4); 955Debug.Assert(Vector256.IsHardwareAccelerated); 968Debug.Assert(Vector256.IsHardwareAccelerated); 980Debug.Assert(Vector128.IsHardwareAccelerated); 993Debug.Assert(Vector128.IsHardwareAccelerated); 1031Debug.Assert(sizeof(T) == 8); 1040Debug.Assert(Vector256.IsHardwareAccelerated); 1053Debug.Assert(Vector256.IsHardwareAccelerated); 1063Debug.Assert(Vector128.IsHardwareAccelerated); 1076Debug.Assert(Vector128.IsHardwareAccelerated); 1249Debug.Assert(((nuint)xPtr % (uint)sizeof(Vector128<T>)) == 0); 1440Debug.Assert(((nuint)xPtr % (uint)sizeof(Vector256<T>)) == 0); 1631Debug.Assert(((nuint)xPtr % (uint)sizeof(Vector512<T>)) == 0); 1796Debug.Assert(sizeof(T) == 8); 1804Debug.Assert(sizeof(T) == 1); 1842Debug.Assert(Vector256.IsHardwareAccelerated); 1858Debug.Assert(Vector256.IsHardwareAccelerated); 1884Debug.Assert(Vector128.IsHardwareAccelerated); 1900Debug.Assert(Vector128.IsHardwareAccelerated); 1981Debug.Assert(sizeof(T) == 2); 2003Debug.Assert(Vector256.IsHardwareAccelerated); 2019Debug.Assert(Vector256.IsHardwareAccelerated); 2037Debug.Assert(Vector128.IsHardwareAccelerated); 2053Debug.Assert(Vector128.IsHardwareAccelerated); 2102Debug.Assert(sizeof(T) == 4); 2115Debug.Assert(Vector256.IsHardwareAccelerated); 2130Debug.Assert(Vector256.IsHardwareAccelerated); 2143Debug.Assert(Vector128.IsHardwareAccelerated); 2158Debug.Assert(Vector128.IsHardwareAccelerated); 2199Debug.Assert(sizeof(T) == 8); 2208Debug.Assert(Vector256.IsHardwareAccelerated); 2223Debug.Assert(Vector256.IsHardwareAccelerated); 2234Debug.Assert(Vector128.IsHardwareAccelerated); 2249Debug.Assert(Vector128.IsHardwareAccelerated); 2302Debug.Assert(Unsafe.SizeOf<T>() == 8); 2338Debug.Assert(Unsafe.SizeOf<T>() == 8); 2374Debug.Assert(Unsafe.SizeOf<T>() == 8); 2410Debug.Assert(Unsafe.SizeOf<T>() == 8); 2446Debug.Assert(Unsafe.SizeOf<T>() == 8); 2482Debug.Assert(Unsafe.SizeOf<T>() == 8);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IBinaryOperator.cs (49)
200Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector128<T>)) == 0); 442Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector256<T>)) == 0); 684Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector512<T>)) == 0); 899Debug.Assert(sizeof(T) == 8); 907Debug.Assert(sizeof(T) == 1); 944Debug.Assert(Vector256.IsHardwareAccelerated); 960Debug.Assert(Vector256.IsHardwareAccelerated); 986Debug.Assert(Vector128.IsHardwareAccelerated); 1002Debug.Assert(Vector128.IsHardwareAccelerated); 1095Debug.Assert(sizeof(T) == 2); 1116Debug.Assert(Vector256.IsHardwareAccelerated); 1132Debug.Assert(Vector256.IsHardwareAccelerated); 1150Debug.Assert(Vector128.IsHardwareAccelerated); 1166Debug.Assert(Vector128.IsHardwareAccelerated); 1219Debug.Assert(sizeof(T) == 4); 1231Debug.Assert(Vector256.IsHardwareAccelerated); 1246Debug.Assert(Vector256.IsHardwareAccelerated); 1259Debug.Assert(Vector128.IsHardwareAccelerated); 1274Debug.Assert(Vector128.IsHardwareAccelerated); 1313Debug.Assert(sizeof(T) == 8); 1321Debug.Assert(Vector256.IsHardwareAccelerated); 1336Debug.Assert(Vector256.IsHardwareAccelerated); 1347Debug.Assert(Vector128.IsHardwareAccelerated); 1362Debug.Assert(Vector128.IsHardwareAccelerated); 1531Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector128<T>)) == 0); 1769Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector256<T>)) == 0); 2007Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector512<T>)) == 0); 2219Debug.Assert(sizeof(T) == 8); 2227Debug.Assert(sizeof(T) == 1); 2264Debug.Assert(Vector256.IsHardwareAccelerated); 2282Debug.Assert(Vector256.IsHardwareAccelerated); 2308Debug.Assert(Vector128.IsHardwareAccelerated); 2326Debug.Assert(Vector128.IsHardwareAccelerated); 2419Debug.Assert(sizeof(T) == 2); 2440Debug.Assert(Vector256.IsHardwareAccelerated); 2458Debug.Assert(Vector256.IsHardwareAccelerated); 2476Debug.Assert(Vector128.IsHardwareAccelerated); 2494Debug.Assert(Vector128.IsHardwareAccelerated); 2547Debug.Assert(sizeof(T) == 4); 2559Debug.Assert(Vector256.IsHardwareAccelerated); 2576Debug.Assert(Vector256.IsHardwareAccelerated); 2589Debug.Assert(Vector128.IsHardwareAccelerated); 2606Debug.Assert(Vector128.IsHardwareAccelerated); 2645Debug.Assert(sizeof(T) == 8); 2653Debug.Assert(Vector256.IsHardwareAccelerated); 2670Debug.Assert(Vector256.IsHardwareAccelerated); 2681Debug.Assert(Vector128.IsHardwareAccelerated); 2698Debug.Assert(Vector128.IsHardwareAccelerated); 2763Debug.Assert(Unsafe.SizeOf<T>() == 8);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IIndexOfOperator.cs (1)
77Debug.Assert(sizeof(T) == 1);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IStatefulUnaryOperator.cs (24)
160Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector128<T>)) == 0); 371Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector256<T>)) == 0); 582Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector512<T>)) == 0); 771Debug.Assert(sizeof(T) == 8); 779Debug.Assert(sizeof(T) == 1); 816Debug.Assert(Vector256.IsHardwareAccelerated); 830Debug.Assert(Vector256.IsHardwareAccelerated); 855Debug.Assert(Vector128.IsHardwareAccelerated); 869Debug.Assert(Vector128.IsHardwareAccelerated); 947Debug.Assert(sizeof(T) == 2); 968Debug.Assert(Vector256.IsHardwareAccelerated); 982Debug.Assert(Vector256.IsHardwareAccelerated); 999Debug.Assert(Vector128.IsHardwareAccelerated); 1013Debug.Assert(Vector128.IsHardwareAccelerated); 1059Debug.Assert(sizeof(T) == 4); 1071Debug.Assert(Vector256.IsHardwareAccelerated); 1084Debug.Assert(Vector256.IsHardwareAccelerated); 1096Debug.Assert(Vector128.IsHardwareAccelerated); 1109Debug.Assert(Vector128.IsHardwareAccelerated); 1145Debug.Assert(sizeof(T) == 8); 1153Debug.Assert(Vector256.IsHardwareAccelerated); 1166Debug.Assert(Vector256.IsHardwareAccelerated); 1176Debug.Assert(Vector128.IsHardwareAccelerated); 1189Debug.Assert(Vector128.IsHardwareAccelerated);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.ITernaryOperator.cs (72)
182Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector128<T>)) == 0); 455Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector256<T>)) == 0); 728Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector512<T>)) == 0); 969Debug.Assert(sizeof(T) == 8); 977Debug.Assert(sizeof(T) == 1); 1014Debug.Assert(Vector256.IsHardwareAccelerated); 1032Debug.Assert(Vector256.IsHardwareAccelerated); 1059Debug.Assert(Vector128.IsHardwareAccelerated); 1077Debug.Assert(Vector128.IsHardwareAccelerated); 1185Debug.Assert(sizeof(T) == 2); 1206Debug.Assert(Vector256.IsHardwareAccelerated); 1224Debug.Assert(Vector256.IsHardwareAccelerated); 1243Debug.Assert(Vector128.IsHardwareAccelerated); 1261Debug.Assert(Vector128.IsHardwareAccelerated); 1321Debug.Assert(sizeof(T) == 4); 1333Debug.Assert(Vector256.IsHardwareAccelerated); 1350Debug.Assert(Vector256.IsHardwareAccelerated); 1364Debug.Assert(Vector128.IsHardwareAccelerated); 1381Debug.Assert(Vector128.IsHardwareAccelerated); 1423Debug.Assert(sizeof(T) == 8); 1431Debug.Assert(Vector256.IsHardwareAccelerated); 1448Debug.Assert(Vector256.IsHardwareAccelerated); 1460Debug.Assert(Vector128.IsHardwareAccelerated); 1477Debug.Assert(Vector128.IsHardwareAccelerated); 1656Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector128<T>)) == 0); 1925Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector256<T>)) == 0); 2194Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector512<T>)) == 0); 2432Debug.Assert(sizeof(T) == 8); 2440Debug.Assert(sizeof(T) == 1); 2477Debug.Assert(Vector256.IsHardwareAccelerated); 2497Debug.Assert(Vector256.IsHardwareAccelerated); 2524Debug.Assert(Vector128.IsHardwareAccelerated); 2544Debug.Assert(Vector128.IsHardwareAccelerated); 2652Debug.Assert(sizeof(T) == 2); 2673Debug.Assert(Vector256.IsHardwareAccelerated); 2693Debug.Assert(Vector256.IsHardwareAccelerated); 2712Debug.Assert(Vector128.IsHardwareAccelerated); 2732Debug.Assert(Vector128.IsHardwareAccelerated); 2792Debug.Assert(sizeof(T) == 4); 2804Debug.Assert(Vector256.IsHardwareAccelerated); 2823Debug.Assert(Vector256.IsHardwareAccelerated); 2837Debug.Assert(Vector128.IsHardwareAccelerated); 2856Debug.Assert(Vector128.IsHardwareAccelerated); 2898Debug.Assert(sizeof(T) == 8); 2906Debug.Assert(Vector256.IsHardwareAccelerated); 2925Debug.Assert(Vector256.IsHardwareAccelerated); 2937Debug.Assert(Vector128.IsHardwareAccelerated); 2956Debug.Assert(Vector128.IsHardwareAccelerated); 3135Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector128<T>)) == 0); 3404Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector256<T>)) == 0); 3673Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector512<T>)) == 0); 3911Debug.Assert(sizeof(T) == 8); 3919Debug.Assert(sizeof(T) == 1); 3956Debug.Assert(Vector256.IsHardwareAccelerated); 3976Debug.Assert(Vector256.IsHardwareAccelerated); 4003Debug.Assert(Vector128.IsHardwareAccelerated); 4023Debug.Assert(Vector128.IsHardwareAccelerated); 4131Debug.Assert(sizeof(T) == 2); 4152Debug.Assert(Vector256.IsHardwareAccelerated); 4172Debug.Assert(Vector256.IsHardwareAccelerated); 4191Debug.Assert(Vector128.IsHardwareAccelerated); 4211Debug.Assert(Vector128.IsHardwareAccelerated); 4271Debug.Assert(sizeof(T) == 4); 4283Debug.Assert(Vector256.IsHardwareAccelerated); 4302Debug.Assert(Vector256.IsHardwareAccelerated); 4316Debug.Assert(Vector128.IsHardwareAccelerated); 4335Debug.Assert(Vector128.IsHardwareAccelerated); 4377Debug.Assert(sizeof(T) == 8); 4385Debug.Assert(Vector256.IsHardwareAccelerated); 4404Debug.Assert(Vector256.IsHardwareAccelerated); 4416Debug.Assert(Vector128.IsHardwareAccelerated); 4435Debug.Assert(Vector128.IsHardwareAccelerated);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryOneToTwoOperator.cs (7)
35Debug.Assert(sizeof(TInput) * 2 == sizeof(TOutput)); 48Debug.Assert(Vector512<TInput>.IsSupported); 49Debug.Assert(Vector512<TOutput>.IsSupported); 81Debug.Assert(Vector256<TInput>.IsSupported); 82Debug.Assert(Vector256<TOutput>.IsSupported); 114Debug.Assert(Vector128<TInput>.IsSupported); 115Debug.Assert(Vector128<TOutput>.IsSupported);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryOperator.cs (24)
200Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector128<TInput>)) == 0); 411Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector256<TInput>)) == 0); 622Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector512<TInput>)) == 0); 811Debug.Assert(sizeof(TInput) == 8); 819Debug.Assert(sizeof(TInput) == 1); 856Debug.Assert(Vector256.IsHardwareAccelerated); 870Debug.Assert(Vector256.IsHardwareAccelerated); 895Debug.Assert(Vector128.IsHardwareAccelerated); 909Debug.Assert(Vector128.IsHardwareAccelerated); 987Debug.Assert(sizeof(TInput) == 2); 1008Debug.Assert(Vector256.IsHardwareAccelerated); 1022Debug.Assert(Vector256.IsHardwareAccelerated); 1039Debug.Assert(Vector128.IsHardwareAccelerated); 1053Debug.Assert(Vector128.IsHardwareAccelerated); 1099Debug.Assert(sizeof(TInput) == 4); 1111Debug.Assert(Vector256.IsHardwareAccelerated); 1124Debug.Assert(Vector256.IsHardwareAccelerated); 1136Debug.Assert(Vector128.IsHardwareAccelerated); 1149Debug.Assert(Vector128.IsHardwareAccelerated); 1185Debug.Assert(sizeof(TInput) == 8); 1193Debug.Assert(Vector256.IsHardwareAccelerated); 1206Debug.Assert(Vector256.IsHardwareAccelerated); 1216Debug.Assert(Vector128.IsHardwareAccelerated); 1229Debug.Assert(Vector128.IsHardwareAccelerated);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryTwoToOneOperator.cs (7)
35Debug.Assert(sizeof(TInput) == sizeof(TOutput) * 2); 48Debug.Assert(Vector512<TInput>.IsSupported); 49Debug.Assert(Vector512<TOutput>.IsSupported); 81Debug.Assert(Vector256<TInput>.IsSupported); 82Debug.Assert(Vector256<TOutput>.IsSupported); 114Debug.Assert(Vector128<TInput>.IsSupported); 115Debug.Assert(Vector128<TOutput>.IsSupported);
System\Numerics\Tensors\netcore\TensorPrimitives.Cbrt.cs (3)
41Debug.Assert(typeof(T) == typeof(double)); 54Debug.Assert(typeof(T) == typeof(double)); 67Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.Ceiling.cs (3)
39Debug.Assert(typeof(T) == typeof(double)); 52Debug.Assert(typeof(T) == typeof(double)); 65Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.Cos.cs (3)
75Debug.Assert(typeof(T) == typeof(double)); 88Debug.Assert(typeof(T) == typeof(double)); 101Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.Cosh.cs (3)
85Debug.Assert(typeof(T) == typeof(double)); 106Debug.Assert(typeof(T) == typeof(double)); 127Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.CosPi.cs (3)
52Debug.Assert(typeof(T) == typeof(double)); 74Debug.Assert(typeof(T) == typeof(double)); 96Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.Exp.cs (3)
51Debug.Assert(typeof(T) == typeof(float)); 76Debug.Assert(typeof(T) == typeof(float)); 101Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.Floor.cs (3)
39Debug.Assert(typeof(T) == typeof(double)); 52Debug.Assert(typeof(T) == typeof(double)); 65Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.FusedMultiplyAdd.cs (3)
110Debug.Assert(typeof(T) == typeof(float)); 163Debug.Assert(typeof(T) == typeof(float)); 188Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.IndexOfMax.cs (3)
152Debug.Assert(sizeof(T) is 1 or 2 or 4 or 8); 243Debug.Assert(sizeof(T) is 1 or 2 or 4 or 8); 334Debug.Assert(sizeof(T) is 1 or 2 or 4 or 8);
System\Numerics\Tensors\netcore\TensorPrimitives.LeadingZeroCount.cs (2)
48Debug.Assert(AdvSimd.IsSupported); 53Debug.Assert(sizeof(T) == 4);
System\Numerics\Tensors\netcore\TensorPrimitives.Log.cs (3)
93Debug.Assert(typeof(T) == typeof(float)); 118Debug.Assert(typeof(T) == typeof(float)); 143Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.Log2.cs (3)
53Debug.Assert(typeof(T) == typeof(float)); 78Debug.Assert(typeof(T) == typeof(float)); 103Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.MultiplyAddEstimate.cs (3)
133Debug.Assert(typeof(T) == typeof(float)); 167Debug.Assert(typeof(T) == typeof(float)); 191Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.PopCount.cs (3)
88Debug.Assert(sizeof(T) == 4); 136Debug.Assert(sizeof(T) == 4); 184Debug.Assert(sizeof(T) == 4);
System\Numerics\Tensors\netcore\TensorPrimitives.Pow.cs (3)
74Debug.Assert(typeof(T) == typeof(double)); 87Debug.Assert(typeof(T) == typeof(double)); 100Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.RootN.cs (3)
43Debug.Assert(typeof(T) == typeof(double)); 56Debug.Assert(typeof(T) == typeof(double)); 69Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.Round.cs (5)
113Debug.Assert(typeof(T) == typeof(double)); 224Debug.Assert(typeof(T) == typeof(double)); 237Debug.Assert(typeof(T) == typeof(double)); 250Debug.Assert(typeof(T) == typeof(double)); 265Debug.Assert(typeof(T) == typeof(float) || typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.Sin.cs (3)
65Debug.Assert(typeof(T) == typeof(double)); 78Debug.Assert(typeof(T) == typeof(double)); 91Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.Sinh.cs (3)
69Debug.Assert(typeof(T) == typeof(double)); 94Debug.Assert(typeof(T) == typeof(double)); 119Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.SinPi.cs (3)
52Debug.Assert(typeof(T) == typeof(double)); 74Debug.Assert(typeof(T) == typeof(double)); 96Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.Tan.cs (3)
69Debug.Assert(typeof(T) == typeof(double)); 82Debug.Assert(typeof(T) == typeof(double)); 95Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.TrailingZeroCount.cs (1)
46Debug.Assert(PopCountOperator<T>.Vectorizable);
System\Numerics\Tensors\netcore\TensorPrimitives.Truncate.cs (3)
46Debug.Assert(typeof(T) == typeof(double)); 69Debug.Assert(typeof(T) == typeof(double)); 91Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorSpanHelpers.cs (4)
66Debug.Assert(strides.Length == indexes.Length); 88Debug.Assert(strides.Length == indexes.Length); 110Debug.Assert(strides.Length == indexes.Length); 126Debug.Assert(strides.Length == lengths.Length);
System\Numerics\Tensors\TensorPrimitives.Helpers.cs (2)
38Debug.Assert(sizeof(TFrom) == sizeof(TTo)); 50Debug.Assert(sizeof(TFrom) == sizeof(TTo));
System.ObjectModel (3)
System\Collections\ObjectModel\KeyedCollection.cs (1)
51Debug.Assert(base.Items is List<TItem>);
System\Collections\ObjectModel\ObservableCollection.cs (1)
307Debug.Assert(collection != null);
System\Collections\Specialized\NotifyCollectionChangedEventArgs.cs (1)
282Debug.Assert(list != null);
System.Private.CoreLib (2692)
src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\ExceptionHandling.cs (1)
673Debug.Assert(false);
src\libraries\Common\src\Interop\Interop.ICU.cs (2)
17Debug.Assert(icuuc != IntPtr.Zero); 18Debug.Assert(icuin != IntPtr.Zero);
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (2)
104Debug.Assert(valueParsed); 119Debug.Assert(!string.IsNullOrEmpty(path));
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
13Debug.Assert(errorInfo.Error != Error.SUCCESS);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
69Debug.Assert(passwd.Name != null);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetUnixVersion.cs (1)
39Debug.Assert(Array.IndexOf<byte>(version, 0) != -1);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadDir.cs (1)
38Debug.Assert(buffer.Length >= Encoding.UTF8.GetMaxCharCount(NameBufferSize - 1 - 1));
src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (7)
25Debug.Assert(capacity >= 0); 54Debug.Assert(index >= 0 && index < _count); 78Debug.Assert(_count > 0); 87Debug.Assert(_count > 0); 104Debug.Assert(_array != null); // Nonzero _count should imply this 134Debug.Assert(_count < Capacity); 141Debug.Assert(minimum > Capacity);
src\libraries\Common\src\System\Collections\Generic\BitHelper.cs (2)
24Debug.Assert(bitPosition >= 0); 38Debug.Assert(bitPosition >= 0);
src\libraries\Common\src\System\HexConverter.cs (7)
98Debug.Assert(Ssse3.IsSupported || AdvSimd.Arm64.IsSupported); 114Debug.Assert(bytes.Length >= Vector128<int>.Count); 165Debug.Assert(chars.Length >= bytes.Length * 2); 247Debug.Assert(Ssse3.IsSupported || AdvSimd.Arm64.IsSupported); 248Debug.Assert(chars.Length <= bytes.Length * 2); 249Debug.Assert(chars.Length % 2 == 0); 250Debug.Assert(chars.Length >= Vector128<ushort>.Count * 2);
src\libraries\Common\src\System\IO\PathInternal.cs (1)
124Debug.Assert(rootLength > 0);
src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
31Debug.Assert(DirectorySeparatorChar == AltDirectorySeparatorChar);
src\libraries\Common\src\System\IO\Win32Marshal.cs (1)
29Debug.Assert(errorCode != Interop.Errors.ERROR_SUCCESS);
src\libraries\Common\src\System\Number.Formatting.Common.cs (11)
144Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 281Debug.Assert(format is 'G' or 'g'); 293Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 716Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 750Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 865Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 886Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 913Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 935Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 959Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 1013Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte));
src\libraries\Common\src\System\Number.NumberBuffer.cs (3)
38Debug.Assert(digits != null); 46Debug.Assert(!digits.IsEmpty); 67Debug.Assert((Kind == NumberBufferKind.Integer) || (Kind == NumberBufferKind.Decimal) || (Kind == NumberBufferKind.FloatingPoint));
src\libraries\Common\src\System\Number.Parsing.Common.cs (11)
16Debug.Assert(str != null); 17Debug.Assert(strEnd != null); 18Debug.Assert(str <= strEnd); 19Debug.Assert((styles & (NumberStyles.AllowHexSpecifier | NumberStyles.AllowBinarySpecifier)) == 0); 28Debug.Assert(number.DigitsCount == 0); 29Debug.Assert(number.Scale == 0); 30Debug.Assert(!number.IsNegative); 31Debug.Assert(!number.HasNonZeroTail); 228Debug.Assert(numberOfTrailingZeros >= 0); 283Debug.Assert(info != null); 339Debug.Assert((p != null) && (pEnd != null) && (p <= pEnd));
src\libraries\Common\src\System\Reflection\AssemblyNameFormatter.cs (1)
16Debug.Assert(name.Length != 0);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
src\libraries\Common\src\System\Threading\Tasks\TaskToAsyncResult.cs (1)
136Debug.Assert(task is not null);
src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeFileHandle.ThreadPoolValueTaskSource.cs (3)
82Debug.Assert(_operation >= Operation.Read && _operation <= Operation.WriteGather); 105Debug.Assert(_readScatterBuffers != null); 109Debug.Assert(_writeGatherBuffers != null);
src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeFileHandle.Unix.cs (9)
74Debug.Assert(value == false); // We should only use the setter to disable random access. 95Debug.Assert(path != null); 140Debug.Assert(_path is not null); 180Debug.Assert(fileLength >= 0); 347Debug.Assert(Interop.Sys.LSeek(this, 0, Interop.Sys.SeekWhence.SEEK_CUR) >= 0); 452Debug.Assert(mode == FileMode.Create || mode == FileMode.CreateNew); 467Debug.Assert(lockOperation == Interop.Sys.LockOperations.LOCK_EX || lockOperation == Interop.Sys.LockOperations.LOCK_SH); 515Debug.Assert(!IsClosed); 516Debug.Assert(!IsInvalid);
src\libraries\System.Private.CoreLib\src\System\AggregateException.cs (1)
175Debug.Assert(_innerExceptions[i] != null);
src\libraries\System.Private.CoreLib\src\System\AppContext.AnyOS.cs (1)
72Debug.Assert(s_dataStore is not null);
src\libraries\System.Private.CoreLib\src\System\AppDomain.cs (1)
414Debug.Assert(mi != null);
src\libraries\System.Private.CoreLib\src\System\Array.cs (10)
71Debug.Assert(array != null); 614Debug.Assert(low <= hi); 2336Debug.Assert(hi >= lo); 2337Debug.Assert(depthLimit >= 0); 2344Debug.Assert(partitionSize >= 2); 2379Debug.Assert(hi - lo >= IntrosortSizeThreshold); 2553Debug.Assert(hi >= lo); 2554Debug.Assert(depthLimit >= 0); 2561Debug.Assert(partitionSize >= 2); 2596Debug.Assert(hi - lo >= IntrosortSizeThreshold);
src\libraries\System.Private.CoreLib\src\System\Array.Enumerators.cs (1)
115Debug.Assert(array == null || endIndex == array.Length);
src\libraries\System.Private.CoreLib\src\System\ArraySegment.cs (6)
203Debug.Assert(index < 0 || 244Debug.Assert(index < 0 || 290Debug.Assert(arraySegment.Array != null); 291Debug.Assert(arraySegment.Offset >= 0); 292Debug.Assert(arraySegment.Count >= 0); 293Debug.Assert(arraySegment.Offset + arraySegment.Count <= arraySegment.Array.Length);
src\libraries\System.Private.CoreLib\src\System\Attribute.cs (2)
116Debug.Assert(thisValueArray.Rank == 1 && thatValueArray.Rank == 1); 130Debug.Assert(!(thisValue is Attribute));
src\libraries\System.Private.CoreLib\src\System\Buffer.cs (1)
195Debug.Assert(byteCount > BulkMoveWithWriteBarrierChunk);
src\libraries\System.Private.CoreLib\src\System\Buffers\StandardFormat.cs (1)
160Debug.Assert(destination.Length == FormatStringLength);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Decoder.cs (3)
128Debug.Assert(destLength < (int.MaxValue / 4 * 3)); 848Debug.Assert((Ssse3.IsSupported || AdvSimd.Arm64.IsSupported) && BitConverter.IsLittleEndian); 998Debug.Assert((Ssse3.IsSupported || AdvSimd.Arm64.IsSupported) && BitConverter.IsLittleEndian);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\FormattingHelpers.CountDigits.cs (2)
25Debug.Assert(log2ToPow10.Length == 64); 55Debug.Assert((index + 1) <= powersOf10.Length);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\FormattingHelpers.CountDigits.Int128.cs (2)
36Debug.Assert(value.Upper == 0); 46Debug.Assert(digits == 21);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.Date.cs (1)
108Debug.Assert(bytesWritten == DateTimeFormat.FormatRLength);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Date.cs (1)
83Debug.Assert(kind == DateTimeKind.Unspecified);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Date.Helpers.cs (2)
113Debug.Assert(year <= 9999); // All of our callers to date parse the year from fixed 4-digit fields so this value is trusted. 146Debug.Assert(fraction >= 0 && fraction <= Utf8Constants.MaxDateTimeFraction); // All of our callers to date parse the fraction from fixed 7-digit fields so this value is trusted.
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Date.O.cs (1)
227Debug.Assert(offsetChar == Utf8Constants.Plus || offsetChar == Utf8Constants.Minus);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Number.cs (5)
18Debug.Assert(number.DigitsCount == 0); 19Debug.Assert(number.Scale == 0); 20Debug.Assert(!number.IsNegative); 21Debug.Assert(!number.HasNonZeroTail); 112Debug.Assert(dstIndex == 0);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.TimeSpan.cs (2)
121Debug.Assert(digitCount == 1); 145Debug.Assert(fraction <= Utf8Constants.MaxDateTimeFraction); // This value comes from TryParseTimeSpanFraction() which already rejects any fraction string longer than 7 digits.
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.TimeSpanSplitter.cs (4)
98Debug.Assert(result == ComponentParseResult.Colon || result == ComponentParseResult.Period); 118Debug.Assert(result == ComponentParseResult.Colon || result == ComponentParseResult.Period); 138Debug.Assert(result == ComponentParseResult.Colon || result == ComponentParseResult.Period); 158Debug.Assert(result == ComponentParseResult.Colon || result == ComponentParseResult.Period);
src\libraries\System.Private.CoreLib\src\System\Buffers\Utilities.cs (1)
27Debug.Assert(maxSize >= 0);
src\libraries\System.Private.CoreLib\src\System\Char.cs (1)
362Debug.Assert(IsLatin1(c));
src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentQueue.cs (19)
240Debug.Assert(count == i); 369Debug.Assert(head._preservedForObservation); 370Debug.Assert(head._frozenForEnqueues); 371Debug.Assert(tail._preservedForObservation); 372Debug.Assert(tail._frozenForEnqueues); 403Debug.Assert(s._preservedForObservation); 404Debug.Assert(s._frozenForEnqueues); 469Debug.Assert(count == i - index); 499Debug.Assert(head != null); 500Debug.Assert(tail != null); 501Debug.Assert(tail._nextSegment == null); 509Debug.Assert(s._frozenForEnqueues); // any non-tail should already be marked 524Debug.Assert(segment._preservedForObservation); 544Debug.Assert(head._preservedForObservation); 545Debug.Assert(head._frozenForEnqueues); 546Debug.Assert(tail._preservedForObservation); 547Debug.Assert(tail._frozenForEnqueues); 719Debug.Assert(head._frozenForEnqueues); 782Debug.Assert(next == s._nextSegment);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ArraySortHelper.cs (41)
101Debug.Assert(i != j); 114Debug.Assert(i != j); 123Debug.Assert(comparer != null); 136Debug.Assert(!keys.IsEmpty); 137Debug.Assert(depthLimit >= 0); 138Debug.Assert(comparer != null); 181Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold); 182Debug.Assert(comparer != null); 219Debug.Assert(comparer != null); 220Debug.Assert(!keys.IsEmpty); 237Debug.Assert(comparer != null); 401Debug.Assert(!Unsafe.AreSame(ref i, ref j)); 413Debug.Assert(!keys.IsEmpty); 414Debug.Assert(depthLimit >= 0); 460Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold); 510Debug.Assert(!keys.IsEmpty); 636Debug.Assert(comparer != null); 637Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 638Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 639Debug.Assert(i != j); 656Debug.Assert(i != j); 669Debug.Assert(comparer != null); 670Debug.Assert(keys.Length == values.Length); 680Debug.Assert(!keys.IsEmpty); 681Debug.Assert(values.Length == keys.Length); 682Debug.Assert(depthLimit >= 0); 683Debug.Assert(comparer != null); 726Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold); 727Debug.Assert(comparer != null); 764Debug.Assert(comparer != null); 765Debug.Assert(!keys.IsEmpty); 782Debug.Assert(comparer != null); 809Debug.Assert(comparer != null); 879Debug.Assert(i != j); 897Debug.Assert(i != j); 910Debug.Assert(!keys.IsEmpty); 911Debug.Assert(values.Length == keys.Length); 912Debug.Assert(depthLimit >= 0); 955Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold); 1000Debug.Assert(!keys.IsEmpty); 1114Debug.Assert(typeof(TKey) == typeof(double) || typeof(TKey) == typeof(float));
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (20)
129Debug.Assert(source._entries is not null); 130Debug.Assert(_entries is not null); 131Debug.Assert(_entries.Length >= source.Count); 132Debug.Assert(_count == 0); 244Debug.Assert(modified); 251Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 444Debug.Assert(comparer is not null); 519Debug.Assert(_buckets != null); 525Debug.Assert(comparer is not null || typeof(TKey).IsValueType); 567Debug.Assert(comparer is not null); 660Debug.Assert(dictionary._buckets != null); 666Debug.Assert(comparer is not null || typeof(TKey).IsValueType); 699Debug.Assert(comparer is not null); 826Debug.Assert(!forceNewHashCodes || !typeof(TKey).IsValueType); 828Debug.Assert(newSize >= _entries.Length); 837Debug.Assert(_comparer is NonRandomizedStringEqualityComparer); 884Debug.Assert(typeof(TKey).IsValueType || comparer is not null); 957Debug.Assert(typeof(TKey).IsValueType || comparer is not null); 1178Debug.Assert(oldEntries is not null); 1185Debug.Assert(_entries is not null);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (9)
184Debug.Assert(Count == source.Count); 252Debug.Assert(comparer is not null); 300Debug.Assert(typeof(T).IsValueType || comparer is not null); 966Debug.Assert(!forceNewHashCodes || !typeof(T).IsValueType); 968Debug.Assert(newSize >= _entries.Length); 977Debug.Assert(_comparer is NonRandomizedStringEqualityComparer); 1094Debug.Assert(_buckets != null); 1133Debug.Assert(comparer is not null); 1194Debug.Assert(location >= 0);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\List.cs (3)
216Debug.Assert(_size == _items.Length); 466Debug.Assert(insertionCount > 0); 490Debug.Assert(_items.Length < capacity);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\NonRandomizedStringEqualityComparer.cs (1)
30Debug.Assert(underlyingComparer != null);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Queue.cs (4)
312Debug.Assert(capacity >= _size); 349Debug.Assert(_size == 0); 397Debug.Assert(_array.Length < capacity); 495Debug.Assert(_index == -1 || _index == -2);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (5)
28Debug.Assert(value >= 0); 29Debug.Assert(value <= _span.Length); 38Debug.Assert(index < _pos); 106Debug.Assert(length >= 0); 134Debug.Assert(_pos == _span.Length);
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (2)
103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
src\libraries\System.Private.CoreLib\src\System\Collections\Hashtable.cs (6)
536Debug.Assert(array != null); 537Debug.Assert(array.Rank == 1); 555Debug.Assert(array != null); 556Debug.Assert(array.Rank == 1); 607Debug.Assert(array != null); 608Debug.Assert(array.Rank == 1);
src\libraries\System.Private.CoreLib\src\System\ComAwareWeakReference.cs (5)
64Debug.Assert(pComWeakRef != IntPtr.Zero); 80Debug.Assert(weakHandle != 0); 152Debug.Assert((taggedHandle & ComAwareBit) != 0); 158Debug.Assert((taggedHandle & ComAwareBit) != 0); 175Debug.Assert((taggedHandle & ComAwareBit) == 0);
src\libraries\System.Private.CoreLib\src\System\Convert.Base64.cs (1)
153Debug.Assert((consumed % 4) == 0);
src\libraries\System.Private.CoreLib\src\System\Convert.cs (15)
2422Debug.Assert(converted == charLengthRequired); 2461Debug.Assert(converted == charLengthRequired); 2477Debug.Assert(bytes.Length >= Base64VectorizationLengthThreshold); 2478Debug.Assert(chars.Length >= charLengthRequired); 2479Debug.Assert(charLengthRequired % 4 == 0); 2483Debug.Assert(status == OperationStatus.Done && charLengthRequired == bytesWritten); 2543Debug.Assert(Unsafe.AreSame(ref srcBeginning, ref src)); 2688Debug.Assert(chars.Length != 0); // If TryDecodeFromUtf16() consumed the entire buffer, it could not have returned false. 2717Debug.Assert(chars.Length != 0 && !chars[0].IsSpace()); 2765Debug.Assert(tempBuffer.Length != 0); // We only bound-check after writing a character to the tempBuffer. 2828Debug.Assert(0 <= inputLength); 2843Debug.Assert(0 <= resultLength); 2873Debug.Assert(0 <= inputLength); 2896Debug.Assert(0 <= usefulInputLength); 2900Debug.Assert(0 <= padding);
src\libraries\System.Private.CoreLib\src\System\DateOnly.cs (5)
38Debug.Assert((uint)dayNumber <= MaxDayNumber); 692Debug.Assert(result != ParseFailureKind.None); 699Debug.Assert(result == ParseFailureKind.Format_DateTimeOnlyContainsNoneDateParts); 758Debug.Assert(charsWritten == destination.Length); 765Debug.Assert(charsWritten == destination.Length);
src\libraries\System.Private.CoreLib\src\System\DateTime.cs (1)
673Debug.Assert(newTicks <= MaxTicks);
src\libraries\System.Private.CoreLib\src\System\DateTimeOffset.cs (1)
344Debug.Assert(new DateTimeOffset(utcNow) == result); // ensure lack of verification does not break anything
src\libraries\System.Private.CoreLib\src\System\Decimal.cs (1)
382Debug.Assert((exponent >= 67) && (exponent <= 95));
src\libraries\System.Private.CoreLib\src\System\Decimal.DecCalc.cs (19)
324Debug.Assert(den > bufNum.High64); 408Debug.Assert(bufDen.U2 > bufNum.U3); 512Debug.Assert(hiRes < Buf24.Length); 640Debug.Assert(cur + 1 < Buf24.Length); 710Debug.Assert(bufQuo.U2 == 0); 978Debug.Assert(cur < Buf24.Length); 990Debug.Assert(hiProd + 1 < Buf24.Length); 1026Debug.Assert(cur < Buf24.Length); 1028Debug.Assert(hiProd < Buf24.Length); 1053Debug.Assert(cur < Buf24.Length); 1552Debug.Assert(dbl < 1E7); 1557Debug.Assert(dbl >= 1E6); 1716Debug.Assert(dbl < 1E15); 1721Debug.Assert(dbl >= 1E14); 1761Debug.Assert(power <= 14); 2228Debug.Assert(d2.High == 0); 2229Debug.Assert(scale == 0); 2286Debug.Assert(high + 1 < Buf28.Length); 2448Debug.Assert(mode == MidpointRounding.ToPositiveInfinity);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Contracts\ContractFailedEventArgs.cs (1)
19Debug.Assert(originalException == null || failureKind == ContractFailureKind.PostconditionOnException);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\StackTrace.cs (3)
371Debug.Assert(mb != null); 411Debug.Assert(method != null); 412Debug.Assert(method.DeclaringType != null);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Stopwatch.cs (2)
122Debug.Assert(IsHighResolution); 158Debug.Assert(IsHighResolution);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\ActivityTracker.cs (4)
61Debug.Assert((options & EventActivityOptions.Disable) == 0); 181Debug.Assert(orphan.m_stopped != 0); 505Debug.Assert(value < 16); 506Debug.Assert(ptr < endPtr);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\CounterGroup.cs (9)
50Debug.Assert(e.Command == EventCommand.Enable || e.Command == EventCommand.Disable); 56Debug.Assert(e.Arguments != null); 78Debug.Assert(e.Command == EventCommand.Disable); 95Debug.Assert((s_counterGroupEnabledList == null && !_eventSource.IsEnabled()) 113Debug.Assert(Monitor.IsEntered(s_counterGroupLock)); 132Debug.Assert(s_counterGroups != null); 153Debug.Assert(pollingIntervalInSeconds > 0); 154Debug.Assert(Monitor.IsEntered(s_counterGroupLock)); 189Debug.Assert(Monitor.IsEntered(s_counterGroupLock));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\DiagnosticCounter.cs (6)
44Debug.Assert(_group is null); 45Debug.Assert(Name != null); 46Debug.Assert(EventSource != null); 119Debug.Assert(Monitor.IsEntered(this)); 129Debug.Assert(_metadata.Count > 0); 131Debug.Assert(gotOne);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventCounter.cs (2)
82Debug.Assert(Monitor.IsEntered(this)); 176Debug.Assert(Monitor.IsEntered(this));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventDispatcher.cs (8)
68Debug.Assert(Monitor.IsEntered(m_dispatchControlLock)); 125Debug.Assert(Volatile.Read(ref m_sessionID) == 0); 134Debug.Assert(Monitor.IsEntered(m_dispatchControlLock)); 135Debug.Assert(sessionID != 0); 144Debug.Assert(Monitor.IsEntered(m_dispatchControlLock)); 152Debug.Assert(sessionID != 0); 160Debug.Assert(sessionID != 0); 218Debug.Assert((syncTimeUtc.Ticks != 0) && (syncTimeQPC != 0) && (timeQPCFrequency != 0));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventProvider.cs (2)
75Debug.Assert(!_gcHandle.IsAllocated); 125Debug.Assert(userDataCount >= 0);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeMetadataGenerator.cs (10)
177Debug.Assert(offset == v1MetadataLength); 207Debug.Assert(totalMetadataLength == offset); 225Debug.Assert(bufferLength >= (offset + srcLength)); 235Debug.Assert(bufferLength >= (offset + sizeof(T))); 311Debug.Assert(property != null); 312Debug.Assert(pMetadataBlob != null); 385Debug.Assert(pMetadataBlob != null); 405Debug.Assert(typeInfo != null); 406Debug.Assert(pMetadataBlob != null); 612Debug.Assert(property != null);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventProvider.cs (3)
170Debug.Assert(!Monitor.IsEntered(EventListener.EventListenersLock)); 698Debug.Assert((EventOpcode)eventDescriptor.Opcode == EventOpcode.Send || 1376Debug.Assert(filterData != null);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (62)
408Debug.Assert(EventListener.s_EventSources != null); 715Debug.Assert(m_eventData != null); 716Debug.Assert(m_eventPipeProvider != null); 743Debug.Assert(eventHandle != IntPtr.Zero); 1308Debug.Assert(m_eventData != null); // You must have initialized this if you enabled the source. 1473Debug.Assert(!Monitor.IsEntered(EventListener.EventListenersLock)); 1645Debug.Assert(!m_eventSourceEnabled); // We can't be enabled until we are completely initted. 1716Debug.Assert(data->Size == 4); 1728Debug.Assert(dataType.IsEnum); 1748Debug.Assert(*(int*)dataPointer == (data + 1)->Size); 1763Debug.Assert(!dataType.IsEnum); 1766Debug.Assert(size == 1); 1771Debug.Assert(size == 1); 1776Debug.Assert(size == 2); 1781Debug.Assert(size == 2); 1786Debug.Assert(size == 2); 1823Debug.Assert(size == 16); 1828Debug.Assert(size == 16); 1904Debug.Assert(m_eventData != null); // You must have initialized this if you enabled the source. 2012Debug.Assert(m_eventData != null); 2031Debug.Assert(m_eventData != null); 2060Debug.Assert(m_eventData != null); 2090Debug.Assert(data->Size == 4); 2111Debug.Assert(dispatcher.m_EventEnabled != null); 2289Debug.Assert(m_eventData != null); 2585Debug.Assert(m_completelyInited); 2599Debug.Assert(m_eventData != null); 2657Debug.Assert(commandArgs.perEventSourceSessionId >= -1 && commandArgs.perEventSourceSessionId <= SessionMask.MAX); 2675Debug.Assert(m_eventData != null); 2691Debug.Assert(dispatcher.m_EventEnabled != null); 2751Debug.Assert(m_eventData != null); 2768Debug.Assert(dispatcher.m_EventEnabled != null); 2783Debug.Assert(m_eventData != null); 2799Debug.Assert(Monitor.IsEntered(EventListener.EventListenersLock)); 2803Debug.Assert(m_rawManifest == null); 2805Debug.Assert(m_eventData != null); 2846Debug.Assert(!SelfDescribingEvents); 2950Debug.Assert(attributeType == typeof(EventAttribute) || attributeType == typeof(EventSourceAttribute)); 2965Debug.Assert(data.ConstructorArguments.Count <= 1); 3254Debug.Assert(0 <= startEventId); // Since we reserve id 0, we know that id-1 is <= 0 3293Debug.Assert(eventData != null); 3327Debug.Assert(eventData != null); 3551Debug.Assert(eventAttribute.Task != EventTask.None || eventAttribute.Opcode != EventOpcode.Info); 3798Debug.Assert(((m_config & EventSourceSettings.EtwManifestEventFormat) != 0) != 4163Debug.Assert(s_EventSources != null); 4222Debug.Assert(EventSource.IsSupported); 4226Debug.Assert(s_EventSources != null); 4238Debug.Assert(!Monitor.IsEntered(EventListenersLock)); 4285Debug.Assert(Monitor.IsEntered(EventListenersLock)); 4287Debug.Assert(s_EventSources != null); 4361Debug.Assert(s_EventSources != null); 4433Debug.Assert(s_EventSources != null); 5022Debug.Assert(perEventSourceSessionId < MAX); 5040Debug.Assert(perEventSourceSessionId < MAX); 5045Debug.Assert(perEventSourceSessionId < MAX); 5272Debug.Assert(channel >= EventChannel.Admin && channel <= EventChannel.Debug); 5314Debug.Assert(numParams == 0); 5315Debug.Assert(this.eventName == null); 5393Debug.Assert(eventName != null); 5512Debug.Assert(channelInfo.Name != null); 5545Debug.Assert(localEnumType.IsEnum); 5773Debug.Assert(info!.Attribs != null);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\NativeRuntimeEventSource.Threading.NativeSinks.cs (5)
91Debug.Assert(IsEnabled(EventLevel.Informational, Keywords.ContentionKeyword)); 112Debug.Assert(IsEnabled(EventLevel.Informational, Keywords.ContentionKeyword)); 131Debug.Assert(IsEnabled(EventLevel.Informational, Keywords.ContentionKeyword)); 361Debug.Assert(IsEnabled(EventLevel.Verbose, Keywords.WaitHandleKeyword)); 375Debug.Assert(IsEnabled(EventLevel.Verbose, Keywords.WaitHandleKeyword));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\RuntimeEventSource.cs (1)
64Debug.Assert(s_RuntimeEventSource == null);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\DataCollector.cs (6)
98Debug.Assert(buffer != null); 133Debug.Assert(buffer != null); 172Debug.Assert(buffer != null); 213Debug.Assert(value != null && buffer != null); 238Debug.Assert(buffer != null); 271Debug.Assert(buffer != null);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\EventPayload.cs (1)
19Debug.Assert(payloadNames.Length == payloadValues.Length);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\FieldMetadata.cs (1)
214Debug.Assert(custom != null);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\SimpleEventTypes.cs (1)
33Debug.Assert(instance != null);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\SimpleTypeInfos.cs (1)
319Debug.Assert(typeArgs.Length == 1);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingEventHandleTable.cs (1)
41Debug.Assert(Monitor.IsEntered(this));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingEventSource.cs (4)
420Debug.Assert(eventHandle != IntPtr.Zero); 530Debug.Assert(eventHandle != IntPtr.Zero); 598Debug.Assert(eventHandle != IntPtr.Zero); 790Debug.Assert(ProviderMetadata.SequenceEqual(m_providerMetadata));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\XplatEventLogger.cs (1)
151Debug.Assert(byteArray != null);
src\libraries\System.Private.CoreLib\src\System\Double.cs (7)
295Debug.Assert(IsNaN(value)); 1602Debug.Assert(ax >= ay); 1690Debug.Assert(n == 0); 1729Debug.Assert(IsPositiveInfinity(x)); 1734Debug.Assert(IsNegativeInfinity(x)); 1774Debug.Assert(IsPositiveInfinity(x)); 1779Debug.Assert(IsNegativeInfinity(x));
src\libraries\System.Private.CoreLib\src\System\Enum.cs (21)
260Debug.Assert(enumType.IsActualEnum); 343Debug.Assert(enumType.IsActualEnum); 373Debug.Assert(enumType.IsActualEnum); 586Debug.Assert(success && result is not null); 606Debug.Assert(success && result is not null); 648Debug.Assert(success); 665Debug.Assert(success); 1547Debug.Assert(success); 1548Debug.Assert(charsWritten == Unsafe.SizeOf<TStorage>() * 2); 1807Debug.Assert(typeof(TEnum).IsEnum); 1808Debug.Assert(value is not null); 1935Debug.Assert(names.Length == values.Length); 1966Debug.Assert(!isDestinationTooSmall); 1970Debug.Assert(names.Length == values.Length); 2300Debug.Assert( 2315if (typeof(TUnderlying) == typeof(sbyte)) Debug.Assert(typeof(TStorage) == typeof(byte)); 2316else if (typeof(TUnderlying) == typeof(short)) Debug.Assert(typeof(TStorage) == typeof(ushort)); 2317else if (typeof(TUnderlying) == typeof(int)) Debug.Assert(typeof(TStorage) == typeof(uint)); 2318else if (typeof(TUnderlying) == typeof(long)) Debug.Assert(typeof(TStorage) == typeof(ulong)); 2319else if (typeof(TUnderlying) == typeof(nint)) Debug.Assert(typeof(TStorage) == typeof(nuint)); 2320else Debug.Assert(typeof(TUnderlying) == typeof(TStorage));
src\libraries\System.Private.CoreLib\src\System\Enum.EnumInfo.cs (1)
40Debug.Assert(sizeof(TStorage) == sizeof(TResult));
src\libraries\System.Private.CoreLib\src\System\Environment.cs (4)
148Debug.Assert(processId != 0); 174Debug.Assert(processPath != null); 197Debug.Assert(osVersion != null); 226Debug.Assert(target != EnvironmentVariableTarget.Process);
src\libraries\System.Private.CoreLib\src\System\Environment.GetFolderPathCore.Unix.cs (2)
24Debug.Assert(path != null); 42Debug.Assert(option == SpecialFolderOption.Create);
src\libraries\System.Private.CoreLib\src\System\Environment.Variables.Windows.cs (1)
130Debug.Assert(success != Interop.BOOL.FALSE);
src\libraries\System.Private.CoreLib\src\System\Exception.cs (1)
175Debug.Assert(resultSpan.Length == 0);
src\libraries\System.Private.CoreLib\src\System\Gen2GcCallback.cs (2)
70Debug.Assert(_callback1 != null); 92Debug.Assert(_callback0 != null);
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.cs (1)
104Debug.Assert(!GlobalizationMode.Invariant);
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Icu.cs (9)
37Debug.Assert(!GlobalizationMode.UseNls); 61Debug.Assert(this.saMonthNames != null); 64Debug.Assert(calendarId == CalendarId.HEBREW && saMonthNames.Length == 13); 88Debug.Assert(!GlobalizationMode.Invariant); 89Debug.Assert(!GlobalizationMode.UseNls); 114Debug.Assert(!GlobalizationMode.UseNls); 122Debug.Assert(!GlobalizationMode.Invariant); 222Debug.Assert(index + 3 < modifiedPattern.Length); 387Debug.Assert(calendarId == CalendarId.HEBREW && callbackContext.Results.Count == 14);
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Nls.cs (3)
17Debug.Assert(!GlobalizationMode.Invariant); 18Debug.Assert(GlobalizationMode.UseNls); 74Debug.Assert(context->strings != null);
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Unix.cs (1)
31Debug.Assert(!GlobalizationMode.UseNls);
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendricalCalculationsHelper.cs (7)
147Debug.Assert(gregorianYear < 1620 || 2020 <= gregorianYear); 156Debug.Assert(1988 <= gregorianYear && gregorianYear <= 2019); 162Debug.Assert(1900 <= gregorianYear && gregorianYear <= 1987); 169Debug.Assert(1800 <= gregorianYear && gregorianYear <= 1899); 176Debug.Assert(1700 <= gregorianYear && gregorianYear <= 1799); 183Debug.Assert(1620 <= gregorianYear && gregorianYear <= 1699); 389Debug.Assert(day != upperBoundNewYearDay);
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.cs (2)
395Debug.Assert(offset2 > (string2 == null ? 0 : string2.Length) - length2); 1058Debug.Assert(matchLengthPtr != null);
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Icu.cs (41)
39Debug.Assert(!GlobalizationMode.UseNls); 40Debug.Assert(interopCultureName != null); 52Debug.Assert(!GlobalizationMode.Invariant); 53Debug.Assert(!GlobalizationMode.UseNls); 54Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 68Debug.Assert(!GlobalizationMode.Invariant); 69Debug.Assert(!GlobalizationMode.UseNls); 70Debug.Assert(target.Length != 0); 106Debug.Assert(!GlobalizationMode.Invariant); 109Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 222Debug.Assert(!GlobalizationMode.Invariant); 225Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 328Debug.Assert(!GlobalizationMode.Invariant); 329Debug.Assert(!GlobalizationMode.UseNls); 332Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 357Debug.Assert(!GlobalizationMode.Invariant); 360Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 439Debug.Assert(!GlobalizationMode.Invariant); 442Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 512Debug.Assert(!GlobalizationMode.Invariant); 513Debug.Assert(!GlobalizationMode.UseNls); 516Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 541Debug.Assert(!GlobalizationMode.Invariant); 544Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 624Debug.Assert(!GlobalizationMode.Invariant); 627Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 698Debug.Assert(!GlobalizationMode.Invariant); 699Debug.Assert(!GlobalizationMode.UseNls); 758Debug.Assert(!GlobalizationMode.Invariant); 759Debug.Assert(!GlobalizationMode.UseNls); 760Debug.Assert((options & ValidCompareMaskOffFlags) == 0); 809Debug.Assert(!GlobalizationMode.Invariant); 810Debug.Assert(!GlobalizationMode.UseNls); 811Debug.Assert((options & ValidCompareMaskOffFlags) == 0); 841Debug.Assert(!GlobalizationMode.Invariant); 842Debug.Assert(!GlobalizationMode.UseNls); 866Debug.Assert(!GlobalizationMode.Invariant); 867Debug.Assert(!GlobalizationMode.UseNls); 868Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 972Debug.Assert(!GlobalizationMode.Invariant); 973Debug.Assert(!GlobalizationMode.UseNls);
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Invariant.cs (6)
46Debug.Assert(sortKey.Length >= source.Length * sizeof(char)); 58Debug.Assert(sortKey.Length >= source.Length * sizeof(char)); 85Debug.Assert(GlobalizationMode.Invariant); 86Debug.Assert((options & ValidCompareMaskOffFlags) == 0); 111Debug.Assert(GlobalizationMode.Invariant); 112Debug.Assert((options & ValidCompareMaskOffFlags) == 0);
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Nls.cs (55)
14Debug.Assert(GlobalizationMode.UseNls); 50Debug.Assert(!GlobalizationMode.Invariant); 57Debug.Assert(pSource != null); 58Debug.Assert(pValue != null); 68Debug.Assert(ret >= -1 && ret <= source.Length); 71Debug.Assert(ret >= 0 || Marshal.GetLastPInvokeError() == Interop.Errors.ERROR_SUCCESS); 79Debug.Assert(!GlobalizationMode.Invariant); 80Debug.Assert(GlobalizationMode.UseNls); 82Debug.Assert(source.Length != 0); 83Debug.Assert(value.Length != 0); 91Debug.Assert(!GlobalizationMode.Invariant); 92Debug.Assert(GlobalizationMode.UseNls); 94Debug.Assert(source != null); 95Debug.Assert(value != null); 108Debug.Assert(!GlobalizationMode.Invariant); 109Debug.Assert(GlobalizationMode.UseNls); 110Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 186Debug.Assert(!GlobalizationMode.Invariant); 187Debug.Assert(GlobalizationMode.UseNls); 189Debug.Assert(count1 > 0); 190Debug.Assert(count2 > 0); 195Debug.Assert(char1 != null); 196Debug.Assert(char2 != null); 210Debug.Assert(!GlobalizationMode.Invariant); 211Debug.Assert(GlobalizationMode.UseNls); 212Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 234Debug.Assert(*pString1 >= 0); // assert that we can always dereference this 235Debug.Assert(*pString2 >= 0); // assert that we can always dereference this 264Debug.Assert(!GlobalizationMode.Invariant); 286Debug.Assert(pSource != null && pValue != null); 300Debug.Assert(result >= -1 && result <= lpStringSource.Length); 303Debug.Assert(result >= 0 || Marshal.GetLastPInvokeError() == Interop.Errors.ERROR_SUCCESS); 311Debug.Assert(!GlobalizationMode.Invariant); 312Debug.Assert(GlobalizationMode.UseNls); 314Debug.Assert(target.Length != 0); 322Debug.Assert(!GlobalizationMode.Invariant); 323Debug.Assert(GlobalizationMode.UseNls); 326Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 343Debug.Assert(!GlobalizationMode.Invariant); 344Debug.Assert(GlobalizationMode.UseNls); 347Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 373Debug.Assert(!GlobalizationMode.Invariant); 374Debug.Assert(GlobalizationMode.UseNls); 425Debug.Assert(!GlobalizationMode.Invariant); 426Debug.Assert((options & ValidCompareMaskOffFlags) == 0); 467Debug.Assert(pSource != null); 468Debug.Assert(pSortKey != null); 519Debug.Assert(actualSortKeyLength <= destination.Length); 525Debug.Assert(!GlobalizationMode.Invariant); 526Debug.Assert((options & ValidCompareMaskOffFlags) == 0); 545Debug.Assert(pSource != null); 568Debug.Assert(!GlobalizationMode.Invariant); 569Debug.Assert(GlobalizationMode.UseNls); 618Debug.Assert(!GlobalizationMode.Invariant); 619Debug.Assert(GlobalizationMode.UseNls);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.cs (4)
2042Debug.Assert(str != null); 2043Debug.Assert(start >= 0); 2044Debug.Assert(end >= 0); 2270Debug.Assert(_sRealName != null);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Icu.cs (23)
34Debug.Assert(name is not null); 35Debug.Assert(name.Length <= ICU_ULOC_FULLNAME_CAPACITY); 104Debug.Assert(_sRealName != null); 105Debug.Assert(!GlobalizationMode.Invariant); 142Debug.Assert(_sWindowsName != null); 203Debug.Assert(!GlobalizationMode.Invariant); 204Debug.Assert(!GlobalizationMode.UseNls); 219Debug.Assert(!GlobalizationMode.UseNls); 243Debug.Assert(!GlobalizationMode.UseNls); 268Debug.Assert(!GlobalizationMode.UseNls); 291Debug.Assert(!GlobalizationMode.UseNls); 325Debug.Assert(!GlobalizationMode.UseNls); 340Debug.Assert(icuFormatString.Length < ICU_ULOC_FULLNAME_CAPACITY); 394Debug.Assert(!GlobalizationMode.Invariant); 395Debug.Assert(!GlobalizationMode.UseNls); 403Debug.Assert(!GlobalizationMode.UseNls); 413Debug.Assert(!GlobalizationMode.UseNls); 420Debug.Assert(!GlobalizationMode.UseNls); 421Debug.Assert(cultureName != null); 454Debug.Assert(!GlobalizationMode.UseNls); 460Debug.Assert(!GlobalizationMode.Invariant); 461Debug.Assert(!GlobalizationMode.UseNls); 535Debug.Assert(!GlobalizationMode.UseNls);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Nls.cs (19)
44Debug.Assert(!GlobalizationMode.Invariant); 51Debug.Assert(ShouldUseUserOverrideNlsData); 60Debug.Assert(ShouldUseUserOverrideNlsData); 68Debug.Assert(IsWin32Installed); 85Debug.Assert(ShouldUseUserOverrideNlsData); 92Debug.Assert(GlobalizationMode.UseNls); 98Debug.Assert(ShouldUseUserOverrideNlsData); 105Debug.Assert(ShouldUseUserOverrideNlsData); 118Debug.Assert(!GlobalizationMode.Invariant); 119Debug.Assert(GlobalizationMode.UseNls); 120Debug.Assert(regionName != null); 142Debug.Assert(GlobalizationMode.UseNls); 162Debug.Assert(GlobalizationMode.UseNls); 449Debug.Assert(!GlobalizationMode.Invariant); 456Debug.Assert(GlobalizationMode.UseNls); 462Debug.Assert(!GlobalizationMode.Invariant); 463Debug.Assert(GlobalizationMode.UseNls); 513Debug.Assert(GlobalizationMode.UseNls); 521Debug.Assert(GlobalizationMode.UseNls);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Unix.cs (1)
17Debug.Assert(!GlobalizationMode.Invariant);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureInfo.cs (3)
181Debug.Assert(cultureData != null); 189Debug.Assert(name != null); 798Debug.Assert(!GlobalizationMode.Invariant);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureInfo.Unix.cs (1)
18Debug.Assert(localeName != null);
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (19)
167Debug.Assert(minimumLength <= 16); 755Debug.Assert(typeof(TChar) == typeof(byte)); 770Debug.Assert(typeof(TChar) == typeof(byte)); 782Debug.Assert(charCount != 0); 841Debug.Assert(tokenLen >= 3); 934Debug.Assert(charsWritten == FormatSLength); 941Debug.Assert(charsWritten == FormatInvariantGMinLength); 960Debug.Assert(charsWritten == FormatInvariantGMaxLength); 979Debug.Assert(charsWritten is >= FormatOMinLength and <= FormatOMaxLength); 986Debug.Assert(charsWritten == str.Length); 993Debug.Assert(charsWritten == str.Length); 1000Debug.Assert(charsWritten == str.Length); 1034Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1405Debug.Assert((uint)dayOfWeek < 7); 1407Debug.Assert(dayAbbrev.Length == 3); 1410Debug.Assert(monthAbbrev.Length == 3); 1615Debug.Assert(dayAbbrev.Length == 3); 1618Debug.Assert(monthAbbrev.Length == 3); 1718Debug.Assert(dtfi != null);
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfo.cs (11)
243Debug.Assert(cultureData != null); 244Debug.Assert(cal != null); 254Debug.Assert(cultureData != null); 359Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 608Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 811Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 993Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1038Debug.Assert(values.Length >= length); 1263Debug.Assert(patterns1 != null); 1264Debug.Assert(patterns2 != null); 1732Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeParse.cs (1)
3182Debug.Assert(maxDigitLen <= DateTimeFormat.MaxSecondsFractionDigits);
src\libraries\System.Private.CoreLib\src\System\Globalization\HebrewNumber.cs (2)
213Debug.Assert(typeof(TChar) == typeof(byte)); 399Debug.Assert(s_numberPassingState.Length == HebrewTokenCount * ((int)HS.S9_DQ + 1));
src\libraries\System.Private.CoreLib\src\System\Globalization\IcuLocaleData.cs (3)
3779Debug.Assert(CulturesCount == (ThreeLetterWindowsLanguageName.Length / 3)); 3815Debug.Assert(ch <= 'z'); 3821Debug.Assert(CulturesCount * 2 == LocalesNamesIndexes.Length);
src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.cs (1)
157Debug.Assert(inputLength > 0);
src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.Icu.cs (9)
12Debug.Assert(!GlobalizationMode.Invariant); 13Debug.Assert(!GlobalizationMode.UseNls); 14Debug.Assert(unicodeString != null && unicodeString.Length >= count); 56Debug.Assert(!GlobalizationMode.Invariant); 57Debug.Assert(!GlobalizationMode.UseNls); 58Debug.Assert(asciiString != null && asciiString.Length >= count); 81Debug.Assert(!GlobalizationMode.Invariant); 82Debug.Assert(!GlobalizationMode.UseNls); 83Debug.Assert(asciiString != null && asciiString.Length >= count);
src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.Nls.cs (14)
14Debug.Assert(!GlobalizationMode.Invariant); 15Debug.Assert(GlobalizationMode.UseNls); 16Debug.Assert(unicodeString != null && unicodeString.Length >= count); 46Debug.Assert(!GlobalizationMode.Invariant); 47Debug.Assert(GlobalizationMode.UseNls); 48Debug.Assert(unicodeString != null && unicodeString.Length >= count); 55Debug.Assert(length == outputLength); 61Debug.Assert(!GlobalizationMode.Invariant); 62Debug.Assert(GlobalizationMode.UseNls); 63Debug.Assert(asciiString != null && asciiString.Length >= count); 93Debug.Assert(!GlobalizationMode.Invariant); 94Debug.Assert(GlobalizationMode.UseNls); 95Debug.Assert(asciiString != null && asciiString.Length >= count); 102Debug.Assert(length == outputLength);
src\libraries\System.Private.CoreLib\src\System\Globalization\InvariantModeCasing.cs (13)
113Debug.Assert(GlobalizationMode.Invariant); 114Debug.Assert(source.Length <= destination.Length); 139Debug.Assert(GlobalizationMode.Invariant); 140Debug.Assert(source.Length <= destination.Length); 183Debug.Assert(GlobalizationMode.Invariant); 199Debug.Assert(codePointLengthA == codePointLengthB); 211Debug.Assert(codePointLengthA == codePointLengthB); 226Debug.Assert(value.Length > 0); 227Debug.Assert(value.Length <= source.Length); 228Debug.Assert(GlobalizationMode.Invariant); 288Debug.Assert(value.Length > 0); 289Debug.Assert(value.Length <= source.Length); 290Debug.Assert(GlobalizationMode.Invariant);
src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseCalendar.Icu.cs (3)
20Debug.Assert(!GlobalizationMode.UseNls); 114Debug.Assert(abbrevEnglishEraNames == s_abbreviatedEnglishEraNames || eras.Count <= abbrevEnglishEraNames.Length); 141Debug.Assert(!GlobalizationMode.Invariant);
src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Icu.cs (6)
15Debug.Assert(!GlobalizationMode.Invariant); 16Debug.Assert(!GlobalizationMode.UseNls); 43Debug.Assert(!GlobalizationMode.Invariant); 44Debug.Assert(!GlobalizationMode.UseNls); 86Debug.Assert(realLen > StackallocThreshold); 115Debug.Assert(strInput != null);
src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Nls.cs (7)
15Debug.Assert(!GlobalizationMode.Invariant); 16Debug.Assert(GlobalizationMode.UseNls); 17Debug.Assert(strInput != null); 58Debug.Assert(!GlobalizationMode.Invariant); 59Debug.Assert(GlobalizationMode.UseNls); 60Debug.Assert(strInput != null); 108Debug.Assert(realLength > StackallocThreshold);
src\libraries\System.Private.CoreLib\src\System\Globalization\NumberFormatInfo.cs (14)
270Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 362Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 384Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 430Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 515Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 538Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 574Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 595Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 632Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 655Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 691Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 712Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 733Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 755Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
src\libraries\System.Private.CoreLib\src\System\Globalization\Ordinal.cs (5)
84Debug.Assert(length >= TVector.Count); 248Debug.Assert(length == 1); 272Debug.Assert(length == 0); 465Debug.Assert(offset + ch1ch2Distance + Vector256<ushort>.Count <= source.Length); 531Debug.Assert(offset + ch1ch2Distance + Vector128<ushort>.Count <= source.Length);
src\libraries\System.Private.CoreLib\src\System\Globalization\Ordinal.Utf8.cs (10)
107Debug.Assert(lengthA >= Vector128<byte>.Count); 108Debug.Assert(lengthB >= Vector128<byte>.Count); 109Debug.Assert(Vector128.IsHardwareAccelerated); 275Debug.Assert(length == 1); 302Debug.Assert(length == 0); 417Debug.Assert(sourceLength >= Vector128<byte>.Count); 418Debug.Assert(prefixLength >= Vector128<byte>.Count); 419Debug.Assert(Vector128.IsHardwareAccelerated); 585Debug.Assert(length == 1); 616Debug.Assert(length == 0);
src\libraries\System.Private.CoreLib\src\System\Globalization\OrdinalCasing.Icu.cs (15)
158Debug.Assert(!GlobalizationMode.Invariant); 159Debug.Assert(!GlobalizationMode.UseNls); 188Debug.Assert(!GlobalizationMode.Invariant); 189Debug.Assert(!GlobalizationMode.UseNls); 260Debug.Assert(lowSurrogateA != '\0'); 261Debug.Assert(lowSurrogateB != '\0'); 290Debug.Assert(value.Length > 0); 291Debug.Assert(value.Length <= source.Length); 293Debug.Assert(!GlobalizationMode.Invariant); 294Debug.Assert(!GlobalizationMode.UseNls); 354Debug.Assert(value.Length > 0); 355Debug.Assert(value.Length <= source.Length); 357Debug.Assert(!GlobalizationMode.Invariant); 358Debug.Assert(!GlobalizationMode.UseNls); 431Debug.Assert(pageNumber >= 0 && pageNumber < 256);
src\libraries\System.Private.CoreLib\src\System\Globalization\PersianCalendar.cs (13)
126Debug.Assert(ordinalDay <= 366); 138Debug.Assert(1 <= month && month <= 12); 155Debug.Assert(y >= 1); 170Debug.Assert(ordinalDay >= 1); 171Debug.Assert(m >= 1 && m <= 12); 178Debug.Assert(1 <= d); 179Debug.Assert(d <= 31); 205Debug.Assert(year >= 1); 211Debug.Assert(ordinalDay >= 1); 212Debug.Assert(month >= 1 && month <= 12); 215Debug.Assert(1 <= day); 216Debug.Assert(day <= 31); 282Debug.Assert(daysInMonth == 30);
src\libraries\System.Private.CoreLib\src\System\Globalization\SurrogateCasing.cs (8)
15Debug.Assert(char.IsHighSurrogate(h)); 16Debug.Assert(char.IsLowSurrogate(l)); 20Debug.Assert(char.IsHighSurrogate(hr)); 21Debug.Assert(char.IsLowSurrogate(lr)); 27Debug.Assert(char.IsHighSurrogate(h)); 28Debug.Assert(char.IsLowSurrogate(l)); 32Debug.Assert(char.IsHighSurrogate(hr)); 33Debug.Assert(char.IsLowSurrogate(lr));
src\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.cs (10)
186Debug.Assert(!GlobalizationMode.Invariant); 214Debug.Assert(destination.Length >= source.Length); 221Debug.Assert(destination.Length >= source.Length); 228Debug.Assert(!GlobalizationMode.Invariant); 229Debug.Assert(typeof(TConversion) == typeof(ToUpperConversion) || typeof(TConversion) == typeof(ToLowerConversion)); 247Debug.Assert(operationStatus == OperationStatus.Done); 261Debug.Assert(typeof(TConversion) == typeof(ToUpperConversion) || typeof(TConversion) == typeof(ToLowerConversion)); 264Debug.Assert(!GlobalizationMode.Invariant); 265Debug.Assert(source != null); 476Debug.Assert(_isAsciiCasingSameAsInvariant == Tristate.True || _isAsciiCasingSameAsInvariant == Tristate.False);
src\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.Icu.cs (3)
14Debug.Assert(localeName != null); 21Debug.Assert(!GlobalizationMode.Invariant); 25Debug.Assert(!GlobalizationMode.UseNls);
src\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.Nls.cs (7)
12Debug.Assert(!GlobalizationMode.Invariant); 16Debug.Assert(GlobalizationMode.UseNls); 17Debug.Assert(pSource != null); 18Debug.Assert(pResult != null); 19Debug.Assert(pSourceLen >= 0); 20Debug.Assert(pResultLen >= 0); 21Debug.Assert(pSourceLen <= pResultLen);
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanFormat.cs (15)
53Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 111Debug.Assert(format == StandardFormat.C || format == StandardFormat.G || format == StandardFormat.g); 127Debug.Assert(ticks == long.MinValue /* -9223372036854775808 */); 144Debug.Assert(fraction < 10_000_000); 167Debug.Assert(format == StandardFormat.g); 182Debug.Assert(seconds < 60); 190Debug.Assert(minutes < 60); 194Debug.Assert(totalHoursRemaining <= uint.MaxValue); 201Debug.Assert(hours < 24); 216Debug.Assert(dayDigits <= 8); 251Debug.Assert(hourDigits == 1 || hourDigits == 2); 289Debug.Assert(p - dest == requiredOutputLength); 299Debug.Assert(dtfi != null); 522Debug.Assert(field >= 0 && field <= 5); 597Debug.Assert(field == 5);
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanParse.cs (15)
109Debug.Assert(_ttt == TTT.Num); 110Debug.Assert(_num > -1); 146Debug.Assert(_zeroes > 0); // Already validated that in the condition _zeroes == 0 && _num > MaxFraction 155Debug.Assert(totalDigitsCount - MaxFractionDigits <= MaxFractionDigits); 159Debug.Assert(_num < MaxFraction); 187Debug.Assert(pos > -1); 407Debug.Assert(dtfi != null); 540Debug.Assert(argumentName != null); 591Debug.Assert(powersOfTen.Length == MaxFractionDigits + 1); 719Debug.Assert(tokenizer.EOL); 774Debug.Assert(raw._numCount == 5); 844Debug.Assert(raw._numCount == 4); 970Debug.Assert(raw._numCount == 3); 1096Debug.Assert(raw._numCount == 2); 1165Debug.Assert(raw._numCount == 1);
src\libraries\System.Private.CoreLib\src\System\Guid.cs (4)
741Debug.Assert(lookup.Length == 256); 1366Debug.Assert(p == guidChars + charsWritten - ((byte)flags != 0 ? 1 : 0)); 1411Debug.Assert(p == guidChars + charsWritten - 1); 1422Debug.Assert((Ssse3.IsSupported || AdvSimd.Arm64.IsSupported) && BitConverter.IsLittleEndian);
src\libraries\System.Private.CoreLib\src\System\Half.cs (2)
465Debug.Assert(IsNaN(other)); 1570Debug.Assert(IsSubnormal(x));
src\libraries\System.Private.CoreLib\src\System\HashCode.cs (4)
340Debug.Assert(Unsafe.ByteOffset(ref pos, ref end) >= sizeof(int)); 345Debug.Assert(Unsafe.ByteOffset(ref pos, ref end) >= sizeof(int)); 350Debug.Assert(Unsafe.ByteOffset(ref pos, ref end) >= sizeof(int)); 362Debug.Assert(Unsafe.ByteOffset(ref pos, ref blockEnd) >= (sizeof(int) * 4));
src\libraries\System.Private.CoreLib\src\System\Index.cs (1)
160Debug.Assert(formatted);
src\libraries\System.Private.CoreLib\src\System\Int128.cs (5)
526Debug.Assert(value >= -TwoPow127); 527Debug.Assert(double.IsFinite(value)); 528Debug.Assert(value < TwoPow127); 765Debug.Assert((sign == 0) || (sign == -1)); 847Debug.Assert((sign == 0) || (sign == -1));
src\libraries\System.Private.CoreLib\src\System\Int16.cs (2)
309Debug.Assert((sign == 0) || (sign == -1)); 384Debug.Assert((sign == 0) || (sign == -1));
src\libraries\System.Private.CoreLib\src\System\Int32.cs (2)
323Debug.Assert((sign == 0) || (sign == -1)); 405Debug.Assert((sign == 0) || (sign == -1));
src\libraries\System.Private.CoreLib\src\System\Int64.cs (2)
320Debug.Assert((sign == 0) || (sign == -1)); 402Debug.Assert((sign == 0) || (sign == -1));
src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (2)
331Debug.Assert((sign == 0) || (sign == -1)); 413Debug.Assert((sign == 0) || (sign == -1));
src\libraries\System.Private.CoreLib\src\System\IO\BinaryReader.cs (4)
180Debug.Assert(charsRead > 0); 317Debug.Assert(!_disposed); 359Debug.Assert(_stream is MemoryStream); 463Debug.Assert(_stream is MemoryStream);
src\libraries\System.Private.CoreLib\src\System\IO\BufferedStream.cs (68)
92Debug.Assert(_stream != null); 100Debug.Assert(_stream != null); 108Debug.Assert(_stream != null); 116Debug.Assert(_buffer != null); 117Debug.Assert(_bufferSize > 0); 132Debug.Assert(_bufferSize > 0); 270Debug.Assert(_writePos == 0 && _readPos == 0 && _readLen == 0); 292Debug.Assert(_writePos == 0 && (!_stream.CanSeek || (_readPos == 0 && _readLen == 0))); 315Debug.Assert(_stream != null); 323Debug.Assert(_writePos == 0 && _readPos == 0 && _readLen == 0); 344Debug.Assert(_writePos == 0 && (!_stream.CanSeek || (_readPos == 0 && _readLen == 0))); 353Debug.Assert(_writePos == 0 && _readPos == _readLen); 367Debug.Assert(_stream != null); 382Debug.Assert(_stream != null); 393Debug.Assert(_readPos < _readLen); 406Debug.Assert(_stream != null); 419Debug.Assert(_stream != null); 433Debug.Assert(readbytes >= 0); 449Debug.Assert(readbytes >= 0); 477Debug.Assert(_stream != null); 532Debug.Assert(_stream != null); 675Debug.Assert(_stream != null); 676Debug.Assert(_stream.CanRead); 677Debug.Assert(_bufferSize > 0); 678Debug.Assert(_asyncActiveSemaphore != null); 679Debug.Assert(semaphoreLockTask != null); 699Debug.Assert(_readLen == _readPos); 742Debug.Assert(_readPos == _readLen); 751Debug.Assert(_stream != null); 798Debug.Assert(_stream != null); 863Debug.Assert(_writePos < _bufferSize); 880Debug.Assert(count == 0); 884Debug.Assert(count >= 0); 885Debug.Assert(_writePos == _bufferSize); 886Debug.Assert(_buffer != null); 893Debug.Assert(count == 0); 894Debug.Assert(_writePos < _bufferSize); 901Debug.Assert(_buffer != null); 902Debug.Assert(totalUserbytes >= _bufferSize); 927Debug.Assert(_stream != null); 952Debug.Assert(bytesWritten == buffer.Length); 957Debug.Assert(_writePos == _bufferSize); 958Debug.Assert(_buffer != null); 966Debug.Assert(bytesWritten == buffer.Length); 968Debug.Assert(_writePos < _bufferSize); 975Debug.Assert(_buffer != null); 976Debug.Assert(totalUserbytes >= _bufferSize); 1028Debug.Assert(_writePos < _bufferSize); 1035Debug.Assert(bytesWritten == buffer.Length); 1058Debug.Assert(_stream != null); 1059Debug.Assert(_stream.CanWrite); 1060Debug.Assert(_bufferSize > 0); 1061Debug.Assert(_asyncActiveSemaphore != null); 1062Debug.Assert(semaphoreLockTask != null); 1090Debug.Assert(buffer.Length == 0); 1094Debug.Assert(buffer.Length >= 0); 1095Debug.Assert(_writePos == _bufferSize); 1096Debug.Assert(_buffer != null); 1102Debug.Assert(bytesWritten == buffer.Length); 1104Debug.Assert(_writePos < _bufferSize); 1112Debug.Assert(_buffer != null); 1113Debug.Assert(totalUserBytes >= _bufferSize); 1175Debug.Assert(_writePos < _bufferSize); 1182Debug.Assert(_stream != null); 1203Debug.Assert(oldPos == _stream.Position + (_readPos - _readLen)); 1237Debug.Assert(_stream != null); 1248Debug.Assert(_stream != null); 1283Debug.Assert(_stream != null);
src\libraries\System.Private.CoreLib\src\System\IO\Directory.Unix.cs (1)
55Debug.Assert(path[^1] == 0);
src\libraries\System.Private.CoreLib\src\System\IO\DirectoryInfo.cs (1)
190Debug.Assert(path != null);
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (10)
819Debug.Assert(writer != null); 820Debug.Assert(contents != null); 928Debug.Assert(!string.IsNullOrEmpty(path)); 929Debug.Assert(encoding != null); 1047Debug.Assert(bytesRead < rentedArray.Length); 1093Debug.Assert(!string.IsNullOrEmpty(path)); 1094Debug.Assert(encoding != null); 1143Debug.Assert(writer != null); 1144Debug.Assert(contents != null); 1251Debug.Assert(bytesRead < buffer.Length);
src\libraries\System.Private.CoreLib\src\System\IO\FileStatus.Unix.cs (6)
42Debug.Assert(_state != Uninitialized); // Use this after EnsureCachesInitialized has been called. 53Debug.Assert(_state != Uninitialized); // Use this after EnsureCachesInitialized has been called. 136Debug.Assert(_state != Uninitialized); // Use this after EnsureCachesInitialized has been called. 195Debug.Assert(handle is not null || path.Length > 0); 500Debug.Assert(handle is not null || path.Length > 0); 522Debug.Assert(errorInfo.RawErrno > 0); // Expect a positive integer
src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.Unix.cs (7)
251Debug.Assert(directoryName != null); 287Debug.Assert(fullPath.Length > 0); 288Debug.Assert(PathInternal.IsDirectorySeparator(fullPath[0])); 335Debug.Assert(!PathInternal.IsDirectorySeparator(fullPath[i])); 402Debug.Assert(!isCaseSensitiveRename || !PathInternal.IsCaseSensitive); 474Debug.Assert(recursive); 715Debug.Assert(sb.Length > 0);
src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (1)
555Debug.Assert(MemStreamMaxLength == int.MaxValue); // Check parameter validation logic in this method if this fails.
src\libraries\System.Private.CoreLib\src\System\IO\Path.cs (3)
782Debug.Assert(fourth.Length == destination.Length); 799Debug.Assert(bytes != null); 871Debug.Assert(comparisonType == StringComparison.Ordinal || comparisonType == StringComparison.OrdinalIgnoreCase);
src\libraries\System.Private.CoreLib\src\System\IO\Path.Unix.cs (3)
56Debug.Assert(!string.IsNullOrEmpty(path)); 57Debug.Assert(!path.Contains('\0')); 126Debug.Assert(path[^1] == 0);
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (1)
101Debug.Assert(passwd.HomeDirectory != null);
src\libraries\System.Private.CoreLib\src\System\IO\ReadLinesIterator.cs (4)
36Debug.Assert(path != null); 37Debug.Assert(path.Length > 0); 38Debug.Assert(encoding != null); 39Debug.Assert(reader != null);
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs (14)
254Debug.Assert(_readPos == _readLen); 352Debug.Assert(!_strategy.CanSeek); 393Debug.Assert(_asyncActiveSemaphore != null); 394Debug.Assert(_strategy.CanSeek); 575Debug.Assert(_writePos <= _bufferSize); 660Debug.Assert(!_strategy.CanSeek); 676Debug.Assert(_asyncActiveSemaphore != null); 677Debug.Assert(_strategy.CanSeek); 780Debug.Assert(_writePos == 0 && (!_strategy.CanSeek || (_readPos == 0 && _readLen == 0))); 804Debug.Assert(_writePos == 0 && _readPos == 0 && _readLen == 0); 819Debug.Assert(_writePos == 0 && (!_strategy.CanSeek || (_readPos == 0 && _readLen == 0))); 824Debug.Assert(_writePos == 0 && _readPos == _readLen); 917Debug.Assert(oldPos == _strategy.Position + (_readPos - _readLen)); 987Debug.Assert(_readPos < _readLen);
src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (11)
428Debug.Assert(minimumBytes <= buffer.Length); 558Debug.Assert(readWriteTask != null); 559Debug.Assert(asyncWaiter != null); 581Debug.Assert(readWriteTask != null); 618Debug.Assert(writeTask.Status == TaskStatus.RanToCompletion); 667Debug.Assert(function != null); 668Debug.Assert(stream != null); 693Debug.Assert(completedTask is ReadWriteTask); 696Debug.Assert(callback != null); 712Debug.Assert(callback != null); 896Debug.Assert(minimumBytes <= buffer.Length);
src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (6)
99Debug.Assert(this is NullStreamReader); 550Debug.Assert(_checkPreamble); 698Debug.Assert(charsRead == 0); 1136Debug.Assert(n == 0); 1164Debug.Assert(n == 0); 1212Debug.Assert(n == 0);
src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (2)
165Debug.Assert(GetType() == typeof(NullStreamWriter)); 254Debug.Assert(GetType() == typeof(StreamWriter));
src\libraries\System.Private.CoreLib\src\System\IO\TextWriter.CreateBroadcasting.cs (1)
49Debug.Assert(writers is { Length: > 0 });
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryAccessor.cs (1)
465Debug.Assert(intsWritten == 4);
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStream.cs (2)
435Debug.Assert(ex is not OperationCanceledException); 712Debug.Assert(!(ex is OperationCanceledException));
src\libraries\System.Private.CoreLib\src\System\Marvin.OrdinalIgnoreCase.cs (4)
41Debug.Assert(ucount < 2); 77Debug.Assert(ucount <= int.MaxValue); // this should fit into a signed int 83Debug.Assert(count > 0); 89Debug.Assert(charsWritten == count); // invariant case conversion should involve simple folding; preserve code unit count
src\libraries\System.Private.CoreLib\src\System\Math.cs (1)
861Debug.Assert(double.IsSubnormal(x));
src\libraries\System.Private.CoreLib\src\System\MathF.cs (1)
212Debug.Assert(float.IsSubnormal(x));
src\libraries\System.Private.CoreLib\src\System\Memory.cs (7)
126Debug.Assert(manager != null); 150Debug.Assert(manager != null); 166Debug.Assert((obj == null) 305Debug.Assert(tmpObject is T[]); 318Debug.Assert(tmpObject is MemoryManager<T>); 409Debug.Assert(tmpObject is T[]); 428Debug.Assert(tmpObject is MemoryManager<T>);
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (9)
1640Debug.Assert(lowInclusive is null || highInclusive is null); 3621Debug.Assert(span.Length == other.Length); 3897Debug.Assert(startInclusive <= endExclusive); 4222Debug.Assert(index > 2); 4502Debug.Assert(alignment > value.Length); 4586Debug.Assert(_hasCustomFormatter); 4587Debug.Assert(_provider != null); 4605Debug.Assert(startingPos >= 0 && startingPos <= _pos); 4606Debug.Assert(alignment != 0);
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Globalization.cs (6)
64Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); 116Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); 147Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); 182Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); 316Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); 354Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase);
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Globalization.Utf8.cs (1)
58Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase);
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Trim.cs (3)
167Debug.Assert((uint)start <= span.Length); 499Debug.Assert((uint)start <= span.Length); 862Debug.Assert((uint)start <= span.Length);
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Trim.Utf8.cs (1)
20Debug.Assert(!Rune.IsWhiteSpace(Rune.ReplacementChar));
src\libraries\System.Private.CoreLib\src\System\Net\WebUtility.cs (8)
332Debug.Assert(offset < end && end <= originalBytes.Length); 340Debug.Assert(i >= pos); 661Debug.Assert(_numBytes > 0); 702Debug.Assert(_numChars > 0); 717Debug.Assert(s_lookupTable[ToUInt64Key("quot")] == '\x0022'); 718Debug.Assert(s_lookupTable[ToUInt64Key("alpha")] == '\x03b1'); 719Debug.Assert(s_lookupTable[ToUInt64Key("diams")] == '\x2666'); 1017Debug.Assert(entity.Length <= 8);
src\libraries\System.Private.CoreLib\src\System\Number.BigInteger.cs (26)
369Debug.Assert(carry == 1); 370Debug.Assert(resultIndex == resultLength); 371Debug.Assert(unchecked((uint)(resultLength)) < MaxBlockCount); 390Debug.Assert(unchecked((uint)(lhs._length)) <= MaxBlockCount); 391Debug.Assert(unchecked((uint)(rhs._length)) <= MaxBlockCount); 405Debug.Assert(rhsLength == 0); 451Debug.Assert(!rhs.IsZero()); 587Debug.Assert(carry == t + 1); 593Debug.Assert(carry == 1); 756Debug.Assert(unchecked((uint)(resultLength)) < MaxBlockCount); 805Debug.Assert(unchecked((uint)(maxResultLength)) <= MaxBlockCount); 863Debug.Assert(unchecked((uint)result._length) <= MaxBlockCount); 912Debug.Assert((Pow10BigNumTableIndices[^1] + MaxBlockCount + 2) == Pow10BigNumTable.Length); 954Debug.Assert(lhsLength >= 0); 955Debug.Assert(rhsLength >= 0); 956Debug.Assert(lhsLength >= rhsLength); 976Debug.Assert(q <= 0xFFFFFFFF); 1009Debug.Assert(lhsLength >= 0); 1010Debug.Assert(rhsLength >= 0); 1011Debug.Assert(lhsLength >= rhsLength); 1012Debug.Assert(q <= uint.MaxValue); 1064Debug.Assert(unchecked((uint)(length)) < MaxBlockCount); 1082Debug.Assert(index < _length); 1137Debug.Assert(unchecked((uint)(length)) < MaxBlockCount); 1226Debug.Assert(unchecked((uint)(length)) < MaxBlockCount); 1255Debug.Assert(unchecked((uint)(length)) < MaxBlockCount);
src\libraries\System.Private.CoreLib\src\System\Number.DiyFp.cs (9)
73Debug.Assert(double.IsFinite(value)); 74Debug.Assert(value > 0.0); 80Debug.Assert(float.IsFinite(value)); 81Debug.Assert(value > 0.0f); 87Debug.Assert(Half.IsFinite(value)); 88Debug.Assert((float)value > 0.0f); 135Debug.Assert(f != 0); 145Debug.Assert(e == other.e); 146Debug.Assert(f >= other.f);
src\libraries\System.Private.CoreLib\src\System\Number.Dragon4.cs (23)
17Debug.Assert(v > 0); 18Debug.Assert(double.IsFinite(v)); 32Debug.Assert(mantissa != 0); 47Debug.Assert((double)v > 0.0); 48Debug.Assert(Half.IsFinite(v)); 62Debug.Assert(mantissa != 0); 77Debug.Assert(v > 0); 78Debug.Assert(float.IsFinite(v)); 92Debug.Assert(mantissa != 0); 119Debug.Assert(buffer.Length > 0); 126Debug.Assert(mantissa != 0); 308Debug.Assert(cutoffNumber > 0); 314Debug.Assert(cutoffNumber >= 0); 332Debug.Assert(scale.GetLength() > 0); 341Debug.Assert(hiBlock != 0); 343Debug.Assert((hiBlockLog2 < 3) || (hiBlockLog2 > 27)); 363Debug.Assert(isSignificantDigits); 364Debug.Assert(digitExponent >= cutoffExponent); 373Debug.Assert(outputDigit < 10); 416Debug.Assert((cutoffNumber > 0) || ((cutoffNumber == 0) && !isSignificantDigits)); 426Debug.Assert(outputDigit < 10); 454Debug.Assert((0 < outputDigit) && (outputDigit < 10)); 537Debug.Assert(outputLen <= buffer.Length);
src\libraries\System.Private.CoreLib\src\System\Number.Formatting.cs (91)
343Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 410Debug.Assert(s is null || typeof(TChar) == typeof(char)); 601Debug.Assert(((precision != -1) && (precision < DoublePrecision)) || (BitConverter.DoubleToInt64Bits(value) == BitConverter.DoubleToInt64Bits(NumberToFloat<double>(ref number)))); 607Debug.Assert((fmt == 'G') || (fmt == 'g') || (fmt == 'R') || (fmt == 'r')); 621Debug.Assert(precision == DoublePrecisionCustomFormat); 640Debug.Assert(s is null || typeof(TChar) == typeof(char)); 656Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 712Debug.Assert(((precision != -1) && (precision < SinglePrecision)) || (BitConverter.SingleToInt32Bits(value) == BitConverter.SingleToInt32Bits(NumberToFloat<float>(ref number)))); 718Debug.Assert((fmt == 'G') || (fmt == 'g') || (fmt == 'R') || (fmt == 'r')); 732Debug.Assert(precision == SinglePrecisionCustomFormat); 753Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 807Debug.Assert(((precision != -1) && (precision < HalfPrecision)) || (BitConverter.HalfToInt16Bits(value) == BitConverter.HalfToInt16Bits(NumberToFloat<Half>(ref number)))); 813Debug.Assert((fmt == 'G') || (fmt == 'g') || (fmt == 'R') || (fmt == 'r')); 827Debug.Assert(precision == HalfPrecisionCustomFormat); 835Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 840Debug.Assert(s is null || typeof(TChar) == typeof(char)); 851Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 852Debug.Assert(source != null); 1054Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1170Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1286Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1403Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1521Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1616Debug.Assert(value < 0); 1628Debug.Assert(p == buffer + sNegative.Length); 1634Debug.Assert(p == buffer); 1641Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1642Debug.Assert(value < 0); 1660Debug.Assert(p == buffer + sNegative.Length); 1666Debug.Assert(p == buffer); 1683Debug.Assert(p == buffer); 1690Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1708Debug.Assert(p == buffer); 1716Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1739Debug.Assert(p == buffer); 1746Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1764Debug.Assert(p == buffer); 1772Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1809Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1810Debug.Assert(value <= 99); 1825Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1826Debug.Assert(value <= 9999); 1854Debug.Assert(value < 10); 1855Debug.Assert(cur == ptr); 1862Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1891Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1925Debug.Assert(value < SmallNumberCacheLength); 1942Debug.Assert(p == buffer); 1958Debug.Assert(p == buffer); 1965Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1974Debug.Assert(p == buffer); 1985Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1998Debug.Assert(p == buffer); 2049Debug.Assert(value < 0); 2061Debug.Assert(p == buffer + sNegative.Length); 2067Debug.Assert(p == buffer); 2074Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2075Debug.Assert(value < 0); 2093Debug.Assert(p == buffer + sNegative.Length); 2099Debug.Assert(p == buffer); 2116Debug.Assert(p == buffer); 2123Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2141Debug.Assert(p == buffer); 2151Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2188Debug.Assert(p == buffer); 2195Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2213Debug.Assert(p == buffer); 2223Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2284Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2323Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2368Debug.Assert(p == buffer); 2386Debug.Assert(p == buffer); 2393Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2403Debug.Assert(p == buffer); 2425Debug.Assert(p == buffer); 2489Debug.Assert(p == buffer + sNegative.Length); 2495Debug.Assert(p == buffer); 2502Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2523Debug.Assert(p == buffer + sNegative.Length); 2529Debug.Assert(p == buffer); 2548Debug.Assert(p == buffer); 2555Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2575Debug.Assert(p == buffer); 2611Debug.Assert(p == buffer); 2618Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2638Debug.Assert(p == buffer); 2694Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2706Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2730Debug.Assert(p == buffer); 2748Debug.Assert(p == buffer); 2766Debug.Assert(p == buffer);
src\libraries\System.Private.CoreLib\src\System\Number.Grisu3.cs (45)
328Debug.Assert(v > 0); 329Debug.Assert(double.IsFinite(v)); 348Debug.Assert((requestedDigits == -1) || (length == requestedDigits)); 362Debug.Assert((double)v > 0); 363Debug.Assert(Half.IsFinite(v)); 382Debug.Assert((requestedDigits == -1) || (length == requestedDigits)); 396Debug.Assert(v > 0); 397Debug.Assert(float.IsFinite(v)); 416Debug.Assert((requestedDigits == -1) || (length == requestedDigits)); 431Debug.Assert(requestedDigits > 0); 438Debug.Assert(MinimalTargetExponent <= (w.e + tenMk.e + DiyFp.SignificandSize)); 439Debug.Assert(MaximalTargetExponent >= (w.e + tenMk.e + DiyFp.SignificandSize)); 483Debug.Assert(boundaryPlus.e == w.e); 490Debug.Assert(MinimalTargetExponent <= (w.e + tenMk.e + DiyFp.SignificandSize)); 491Debug.Assert(MaximalTargetExponent >= (w.e + tenMk.e + DiyFp.SignificandSize)); 504Debug.Assert(scaledW.e == (boundaryPlus.e + tenMk.e + DiyFp.SignificandSize)); 539Debug.Assert(number < (1U << (numberBits + 1))); 543Debug.Assert((uint)(exponentGuess) < SmallPowersOfTen.Length); 582Debug.Assert(MinimalTargetExponent <= w.e); 583Debug.Assert(w.e <= MaximalTargetExponent); 584Debug.Assert(MinimalTargetExponent >= -60); 585Debug.Assert(MaximalTargetExponent <= -32); 611Debug.Assert(buffer[0] == '\0'); 629Debug.Assert(digit <= 9); 665Debug.Assert(one.e >= MinimalTargetExponent); 666Debug.Assert(fractionals < one.f); 667Debug.Assert((ulong.MaxValue / 10) >= one.f); 676Debug.Assert(digit <= 9); 751Debug.Assert(low.e == w.e); 752Debug.Assert(w.e == high.e); 754Debug.Assert((low.f + 1) <= (high.f - 1)); 756Debug.Assert(MinimalTargetExponent <= w.e); 757Debug.Assert(w.e <= MaximalTargetExponent); 808Debug.Assert(digit <= 9); 847Debug.Assert(one.e >= MinimalTargetExponent); 848Debug.Assert(fractionals < one.f); 849Debug.Assert((ulong.MaxValue / 10) >= one.f); 860Debug.Assert(digit <= 9); 887Debug.Assert(CachedPowersSignificand.Length == CachedPowersBinaryExponent.Length); 888Debug.Assert(CachedPowersSignificand.Length == CachedPowersDecimalExponent.Length); 893Debug.Assert((uint)(index) < CachedPowersSignificand.Length); 895Debug.Assert(minExponent <= CachedPowersBinaryExponent[index]); 896Debug.Assert(CachedPowersBinaryExponent[index] <= maxExponent); 916Debug.Assert(rest < tenKappa); 1062Debug.Assert(rest <= unsafeInterval);
src\libraries\System.Private.CoreLib\src\System\Number.NumberToFloatingPointBits.cs (11)
829Debug.Assert((TFloat.DenormalMantissaMask & (1UL << TFloat.DenormalMantissaBits)) == 0); 831Debug.Assert((shiftedExponent & TFloat.DenormalMantissaMask) == 0); 832Debug.Assert((mantissa & ~TFloat.DenormalMantissaMask) == 0); 833Debug.Assert((shiftedExponent & ~(((1UL << TFloat.ExponentBits) - 1) << TFloat.DenormalMantissaBits)) == 0); // exponent fits in its place 895Debug.Assert((1 <= count) && (count <= 9)); 919Debug.Assert((1 <= count) && (count <= 19)); 975Debug.Assert(TFloat.DenormalMantissaBits <= FloatingPointMaxDenormalMantissaBits); 977Debug.Assert(number.DigitsPtr[0] != '0'); 979Debug.Assert(number.Scale <= FloatingPointMaxExponent); 980Debug.Assert(number.Scale >= FloatingPointMinExponent); 982Debug.Assert(number.DigitsCount != 0);
src\libraries\System.Private.CoreLib\src\System\Number.Parsing.cs (5)
118Debug.Assert(p != null); 809Debug.Assert((c == 0) || !hasZeroTail); 892Debug.Assert(typeof(TChar) == typeof(byte)); 910Debug.Assert(typeof(TChar) == typeof(byte)); 928Debug.Assert(typeof(TChar) == typeof(byte));
src\libraries\System.Private.CoreLib\src\System\Numerics\Quaternion.Extensions.cs (2)
50Debug.Assert((index >= 0) && (index < Quaternion.Count)); 58Debug.Assert((index >= 0) && (index < Quaternion.Count));
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector.cs (8)
298Debug.Assert(Vector<double>.Count == Vector256<double>.Count); 303Debug.Assert(Vector<double>.Count == Vector128<double>.Count); 318Debug.Assert(Vector<double>.Count == Vector256<double>.Count); 323Debug.Assert(Vector<double>.Count == Vector128<double>.Count); 423Debug.Assert(Vector<float>.Count == Vector256<float>.Count); 428Debug.Assert(Vector<float>.Count == Vector128<float>.Count); 2188Debug.Assert((index >= 0) && (index < Vector<T>.Count)); 2196Debug.Assert((index >= 0) && (index < Vector<T>.Count));
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector2.Extensions.cs (2)
50Debug.Assert((index >= 0) && (index < Vector2.Count)); 58Debug.Assert((index >= 0) && (index < Vector2.Count));
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector3.Extensions.cs (2)
50Debug.Assert((index >= 0) && (index < Vector3.Count)); 58Debug.Assert((index >= 0) && (index < Vector3.Count));
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector4.Extensions.cs (2)
50Debug.Assert((index >= 0) && (index < Vector4.Count)); 58Debug.Assert((index >= 0) && (index < Vector4.Count));
src\libraries\System.Private.CoreLib\src\System\ParseNumbers.cs (2)
242Debug.Assert(radix == 2 || radix == 8 || radix == 10 || radix == 16); 301Debug.Assert(radix == 2 || radix == 8 || radix == 10 || radix == 16);
src\libraries\System.Private.CoreLib\src\System\Progress.cs (1)
35Debug.Assert(_synchronizationContext != null);
src\libraries\System.Private.CoreLib\src\System\Random.cs (1)
50Debug.Assert(isThreadSafeRandom);
src\libraries\System.Private.CoreLib\src\System\Random.Net5CompatImpl.cs (4)
74Debug.Assert(minValue == maxValue || minValue + 1 == maxValue); 191Debug.Assert(minValue == maxValue || minValue + 1 == maxValue); 260Debug.Assert(_seedArray is null); 325Debug.Assert(_seedArray is not null);
src\libraries\System.Private.CoreLib\src\System\Random.Xoshiro256StarStarImpl.cs (5)
93Debug.Assert(maxValue >= 0); 100Debug.Assert(minValue <= maxValue); 122Debug.Assert(maxValue >= 0); 129Debug.Assert(minValue <= maxValue); 162Debug.Assert(buffer.Length < sizeof(ulong));
src\libraries\System.Private.CoreLib\src\System\Range.cs (2)
79Debug.Assert(formatted); 90Debug.Assert(formatted);
src\libraries\System.Private.CoreLib\src\System\ReadOnlyMemory.cs (5)
101Debug.Assert((obj == null) 227Debug.Assert(tmpObject is T[]); 240Debug.Assert(tmpObject is MemoryManager<T>); 324Debug.Assert(tmpObject is T[]); 343Debug.Assert(tmpObject is MemoryManager<T>);
src\libraries\System.Private.CoreLib\src\System\ReadOnlySpan.cs (1)
128Debug.Assert(length >= 0);
src\libraries\System.Private.CoreLib\src\System\Reflection\ConstructorInvoker.cs (3)
245Debug.Assert(_argCount <= MaxStackAllocArgCount); 403Debug.Assert(copyOfParameters[i] != null); 404Debug.Assert(((RuntimeType)copyOfParameters[i]!.GetType()).IsNullableOfT);
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeNameBuilder.cs (6)
37Debug.Assert(_instNesting != 0); 53Debug.Assert(_instNesting != 0); 69Debug.Assert(_instNesting != 0); 81Debug.Assert(name != null); 93Debug.Assert(rank > 0); 134Debug.Assert(_instNesting == 0);
src\libraries\System.Private.CoreLib\src\System\Reflection\FieldAccessor.cs (11)
21Debug.Assert(_fieldInfo.m_declaringType != null); 125Debug.Assert(obj != null); 134Debug.Assert(obj != null); 141Debug.Assert(obj != null); 216Debug.Assert(obj != null); 224Debug.Assert(obj != null); 232Debug.Assert(obj != null); 240Debug.Assert(obj != null); 248Debug.Assert(obj != null); 345Debug.Assert(!IsStatic()); 379Debug.Assert(IsStatic());
src\libraries\System.Private.CoreLib\src\System\Reflection\InvokerEmitUtil.cs (5)
21Debug.Assert(!method.ContainsGenericParameters); 88Debug.Assert(!method.ContainsGenericParameters); 145Debug.Assert(!method.ContainsGenericParameters); 203Debug.Assert(parameterType.IsValueType); 254Debug.Assert(method is DynamicMethod);
src\libraries\System.Private.CoreLib\src\System\Reflection\InvokeUtils.cs (3)
107Debug.Assert(dstObject != null); 108Debug.Assert(dstObject.GetType() == dstType); 121Debug.Assert(srcObject is not Pointer);
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs (8)
48Debug.Assert(_argCount == 0); 72Debug.Assert(_argCount == 1); 118Debug.Assert(_argCount <= MaxStackAllocArgCount); 155Debug.Assert(_argCount <= MaxStackAllocArgCount); 193Debug.Assert(_argCount > MaxStackAllocArgCount); 295Debug.Assert(_argCount == 1); 338Debug.Assert(copyOfParameters[i] != null); 339Debug.Assert(((RuntimeType)copyOfParameters[i]!.GetType()).IsNullableOfT);
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInvoker.cs (4)
292Debug.Assert(_method is RuntimeConstructorInfo); 298Debug.Assert(_argCount <= MaxStackAllocArgCount); 456Debug.Assert(copyOfParameters[i] != null); 457Debug.Assert(((RuntimeType)copyOfParameters[i]!.GetType()).IsNullableOfT);
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInvokerCommon.cs (1)
90Debug.Assert(!method.IsStatic);
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedFunctionPointerType.cs (1)
21Debug.Assert(unmodifiedType.IsFunctionPointer);
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedGenericType.cs (1)
16Debug.Assert(unmodifiedType.IsGenericType);
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedHasElementType.cs (1)
19Debug.Assert(unmodifiedType.HasElementType);
src\libraries\System.Private.CoreLib\src\System\Reflection\NullabilityInfoContext.cs (2)
497Debug.Assert(genericParameter.IsGenericParameter); 531Debug.Assert(genericParameter.IsGenericParameter && !genericParameter.IsGenericMethodParameter);
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureArrayType.cs (2)
13Debug.Assert(rank > 0); 14Debug.Assert(rank == 1 || isMultiDim);
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureGenericParameterType.cs (1)
12Debug.Assert(position >= 0);
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureHasElementType.cs (1)
12Debug.Assert(elementType != null);
src\libraries\System.Private.CoreLib\src\System\Resources\ManifestBasedResourceGroveler.cs (7)
112Debug.Assert(_mediator.NeutralResourcesCulture != null); 208Debug.Assert(_mediator.MainAssembly != null); 362Debug.Assert(_mediator.MainAssembly != null); 424Debug.Assert(_mediator.MainAssembly != null); 432Debug.Assert(_mediator.NeutralResourcesCulture != null); 467Debug.Assert(_mediator.BaseName != null); 478Debug.Assert(_mediator.MainAssembly != null);
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceManager.cs (5)
252Debug.Assert(MainAssembly != null); 289Debug.Assert(_resourceSets != null); 410Debug.Assert(MainAssembly != null); 415Debug.Assert(localResourceSets != null); 431Debug.Assert(_resourceSets != null);
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (10)
340Debug.Assert(Monitor.IsEntered(this)); // uses _store 541Debug.Assert(Monitor.IsEntered(this)); // uses _store 561Debug.Assert(Monitor.IsEntered(this)); // uses _store 623Debug.Assert(Monitor.IsEntered(this)); // uses _store 643Debug.Assert(Monitor.IsEntered(this)); // uses _store 781Debug.Assert(!Monitor.IsEntered(this)); // only called during init 804Debug.Assert(!Monitor.IsEntered(this)); // only called during init 993Debug.Assert(Monitor.IsEntered(this)); // uses _store 1033Debug.Assert(Monitor.IsEntered(this)); // uses _store 1117Debug.Assert(!Monitor.IsEntered(_reader));
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceSet.cs (2)
191Debug.Assert(_table != null); 192Debug.Assert(Reader != null);
src\libraries\System.Private.CoreLib\src\System\Resources\RuntimeResourceSet.cs (1)
288Debug.Assert(!Monitor.IsEntered(reader));
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncMethodBuilderCore.cs (1)
91Debug.Assert(stateMachine != null);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilder.cs (1)
86Debug.Assert(m_task == null);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilderT.cs (5)
290Debug.Assert(s is AsyncStateMachineBox<TStateMachine>); 354Debug.Assert(!IsCompleted); 365Debug.Assert(StateMachine != null); 395Debug.Assert(IsCompleted); 442Debug.Assert(m_task == null);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\CastCache.cs (4)
38Debug.Assert(BitOperations.PopCount((uint)initialCacheSize) == 1 && initialCacheSize > 1); 39Debug.Assert(BitOperations.PopCount((uint)maxCacheSize) == 1 && maxCacheSize >= initialCacheSize); 217Debug.Assert(size > 1); 219Debug.Assert((size & (size - 1)) == 0);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConditionalWeakTable.cs (18)
395Debug.Assert(Monitor.IsEntered(_lock)); 396Debug.Assert(key != null); // key already validated as non-null and not already in table. 462Debug.Assert(parent != null); 463Debug.Assert(BitOperations.IsPow2(InitialCapacity)); 482Debug.Assert(parent != null); 483Debug.Assert(buckets != null); 484Debug.Assert(entries != null); 485Debug.Assert(buckets.Length == entries.Length); 486Debug.Assert(BitOperations.IsPow2(buckets.Length)); 501Debug.Assert(key != null); // key already validated as non-null and not already in table. 502Debug.Assert(HasCapacity); 525Debug.Assert(key != null); // Key already validated as non-null 539Debug.Assert(key != null); // Key already validated as non-null. 616Debug.Assert(entryIndex >= 0 && entryIndex < _firstFreeEntry); 631Debug.Assert(entryIndex != -1); 647Debug.Assert(!HasCapacity); 688Debug.Assert(newSize >= _buckets.Length); 689Debug.Assert(BitOperations.IsPow2(newSize));
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConfiguredValueTaskAwaitable.cs (6)
55Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 77Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 97Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 160Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 182Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 202Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\DefaultInterpolatedStringHandler.cs (6)
504Debug.Assert(provider is not null); 522Debug.Assert(_hasCustomFormatter); 523Debug.Assert(_provider != null); 539Debug.Assert(startingPos >= 0 && startingPos <= _pos); 540Debug.Assert(alignment != 0); 608Debug.Assert(additionalChars > _chars.Length - _pos);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\GenericCache.cs (4)
75Debug.Assert(BitOperations.PopCount((uint)initialCacheSize) == 1 && initialCacheSize > 1); 76Debug.Assert(BitOperations.PopCount((uint)maxCacheSize) == 1 && maxCacheSize >= initialCacheSize); 200Debug.Assert(size > 1); 202Debug.Assert((size & (size - 1)) == 0);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs (3)
195Debug.Assert(stateMachineBox != null); 395Debug.Assert((options & ~(ConfigureAwaitOptions.ContinueOnCapturedContext | ConfigureAwaitOptions.SuppressThrowing | ConfigureAwaitOptions.ForceYielding)) == 0); 477Debug.Assert((options & ~(ConfigureAwaitOptions.ContinueOnCapturedContext | ConfigureAwaitOptions.ForceYielding)) == 0);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\Unsafe.cs (2)
922Debug.Assert(nuint.IsPow2(alignment)); 934Debug.Assert(nuint.IsPow2(alignment));
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ValueTaskAwaiter.cs (6)
50Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 70Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 89Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 132Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 152Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 171Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\YieldAwaitable.cs (1)
117Debug.Assert(box != null);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\GCHandle.cs (1)
138Debug.Assert(target is Array);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\BStrStringMarshaller.cs (1)
96Debug.Assert(lengthInBytes == Marshal.SysStringByteLen((IntPtr)ptrToFirstChar));
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ComVariant.cs (3)
29Debug.Assert(variantSize == (4 * IntPtr.Size)); 33Debug.Assert(IntPtr.Size == 8); 34Debug.Assert(variantSize == (3 * IntPtr.Size));
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\MemoryMarshal.cs (4)
300Debug.Assert(obj is MemoryManager<T>); 361Debug.Assert(length >= 0); 450Debug.Assert(offset >= 0); 451Debug.Assert(count >= 0);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\PosixSignalRegistration.Unix.cs (1)
96Debug.Assert(tokens.Length != 0);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\RuntimeInformation.Unix.cs (1)
29Debug.Assert(osArch >= 0);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\SafeHandle.cs (4)
121Debug.Assert(_fullyInitialized); 127Debug.Assert(_fullyInitialized); 160Debug.Assert(_fullyInitialized); 198Debug.Assert(_fullyInitialized || disposeOrFinalizeOperation);
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.cs (4)
270Debug.Assert(Vector<T>.Count >= Vector128<T>.Count); 316Debug.Assert(Vector<T>.Count >= Vector128<T>.Count); 3219Debug.Assert((index >= 0) && (index < Vector128<T>.Count)); 3227Debug.Assert((index >= 0) && (index < Vector128<T>.Count));
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector256.cs (4)
235Debug.Assert(Vector256<T>.Count >= Vector<T>.Count); 252Debug.Assert(Vector256<T>.Count >= Vector<T>.Count); 3149Debug.Assert((index >= 0) && (index < Vector256<T>.Count)); 3157Debug.Assert((index >= 0) && (index < Vector256<T>.Count));
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector512.cs (4)
235Debug.Assert(Vector512<T>.Count >= Vector<T>.Count); 252Debug.Assert(Vector512<T>.Count >= Vector<T>.Count); 3161Debug.Assert((index >= 0) && (index < Vector512<T>.Count)); 3169Debug.Assert((index >= 0) && (index < Vector512<T>.Count));
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector64.cs (2)
3083Debug.Assert((index >= 0) && (index < Vector64<T>.Count)); 3091Debug.Assert((index >= 0) && (index < Vector64<T>.Count));
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\VectorMath.cs (8)
879Debug.Assert(typeof(TVectorSingle) == typeof(Vector64<float>)); 884Debug.Assert(typeof(TVectorSingle) == typeof(Vector128<float>)); 889Debug.Assert(typeof(TVectorSingle) == typeof(Vector256<float>)); 894Debug.Assert(typeof(TVectorSingle) == typeof(Vector512<float>)); 914Debug.Assert(typeof(TVectorDouble) == typeof(Vector64<double>)); 919Debug.Assert(typeof(TVectorDouble) == typeof(Vector128<double>)); 924Debug.Assert(typeof(TVectorDouble) == typeof(Vector256<double>)); 929Debug.Assert(typeof(TVectorDouble) == typeof(Vector512<double>));
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (3)
121Debug.Assert(IsCollectible); 123Debug.Assert(_state != InternalState.Unloading); 766Debug.Assert(assemblyName.CultureName?.Length > 0);
src\libraries\System.Private.CoreLib\src\System\Runtime\Serialization\SerializationInfo.SerializationGuard.cs (1)
46Debug.Assert(!string.IsNullOrWhiteSpace(switchSuffix));
src\libraries\System.Private.CoreLib\src\System\Runtime\Versioning\FrameworkName.cs (4)
26Debug.Assert(_identifier != null); 35Debug.Assert(_version != null); 44Debug.Assert(_profile != null); 57Debug.Assert(_fullName != null);
src\libraries\System.Private.CoreLib\src\System\RuntimeType.cs (16)
442Debug.Assert(IsSetField); 457Debug.Assert(flds != null); 545Debug.Assert(!IsSetField); 552Debug.Assert(isSetProperty); 554Debug.Assert(!IsGetField); 573Debug.Assert(semiFinalist != null); 591Debug.Assert(results.Count > 1); 596Debug.Assert(finalists == null || finalist != null); 637Debug.Assert(results.Count > 1); 779Debug.Assert(!IsGenericParameter); 823Debug.Assert(!IsGenericParameter); 847Debug.Assert(value != null); 889Debug.Assert(type.IsValueType); 890Debug.Assert(!type.IsByRefLike); 895Debug.Assert(type.IsEquivalentTo(value.GetType())); 914Debug.Assert(!sigElementType.IsGenericParameter);
src\libraries\System.Private.CoreLib\src\System\SByte.cs (2)
312Debug.Assert((sign == 0) || (sign == -1)); 365Debug.Assert((sign == 0) || (sign == -1));
src\libraries\System.Private.CoreLib\src\System\SearchValues\Any1CharPackedIgnoreCaseSearchValues.cs (1)
20Debug.Assert((value | 0x20) == value);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Any1SearchValues.cs (2)
21Debug.Assert(Unsafe.SizeOf<T>() == Unsafe.SizeOf<TImpl>()); 22Debug.Assert(values.Length == 1);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Any2CharPackedIgnoreCaseSearchValues.cs (2)
23Debug.Assert((value0 | 0x20) == value0 && char.IsAscii(value0)); 24Debug.Assert((value1 | 0x20) == value1 && char.IsAscii(value1));
src\libraries\System.Private.CoreLib\src\System\SearchValues\Any2SearchValues.cs (2)
21Debug.Assert(Unsafe.SizeOf<T>() == Unsafe.SizeOf<TImpl>()); 22Debug.Assert(values.Length == 2);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Any3SearchValues.cs (2)
21Debug.Assert(Unsafe.SizeOf<T>() == Unsafe.SizeOf<TImpl>()); 22Debug.Assert(values.Length == 3);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Any4SearchValues.cs (2)
21Debug.Assert(Unsafe.SizeOf<T>() == Unsafe.SizeOf<TImpl>()); 22Debug.Assert(values.Length == 4);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Any5SearchValues.cs (2)
21Debug.Assert(Unsafe.SizeOf<T>() == Unsafe.SizeOf<TImpl>()); 22Debug.Assert(values.Length == 5);
src\libraries\System.Private.CoreLib\src\System\SearchValues\BitmapCharSearchValues.cs (1)
17Debug.Assert(maxInclusive <= char.MaxValue);
src\libraries\System.Private.CoreLib\src\System\SearchValues\BitVector256.cs (2)
28Debug.Assert(c < 256); 49Debug.Assert(b < 256);
src\libraries\System.Private.CoreLib\src\System\SearchValues\IndexOfAnyAsciiSearcher.cs (3)
70Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(char)); 139Debug.Assert(searchSpaceLength >= Vector128<short>.Count); 166Debug.Assert(searchSpaceLength >= Vector128<short>.Count);
src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticMap.cs (17)
405Debug.Assert(Avx512Vbmi.VL.IsSupported); 406Debug.Assert(searchSpaceLength >= 16); 449Debug.Assert(searchSpaceLength is > 32 and <= 64); 466Debug.Assert(searchSpaceLength is >= 16 and <= 32); 489Debug.Assert(Sse41.IsSupported || AdvSimd.Arm64.IsSupported); 490Debug.Assert(searchSpaceLength >= 16); 580Debug.Assert(Avx512Vbmi.VL.IsSupported); 581Debug.Assert(searchSpaceLength >= 16); 597Debug.Assert(Unsafe.ByteOffset(ref searchSpace, ref cur) >= 64 * sizeof(char)); 625Debug.Assert(searchSpaceLength is > 32 and <= 64); 626Debug.Assert(Unsafe.ByteOffset(ref searchSpace, ref cur) >= 32 * sizeof(char)); 643Debug.Assert(searchSpaceLength is >= 16 and <= 32); 644Debug.Assert(Unsafe.ByteOffset(ref searchSpace, ref cur) >= 16 * sizeof(char)); 667Debug.Assert(Sse41.IsSupported || AdvSimd.Arm64.IsSupported); 668Debug.Assert(searchSpaceLength >= 16); 686Debug.Assert(Unsafe.ByteOffset(ref searchSpace, ref cur) >= 32 * sizeof(char)); 728Debug.Assert(Unsafe.ByteOffset(ref searchSpace, ref cur) >= 16 * sizeof(char));
src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticMapState.cs (17)
59Debug.Assert((IntPtr)valuesPtr != IntPtr.Zero); 67Debug.Assert(_hashEntries is not null); 78Debug.Assert(_hashEntries is not null); 79Debug.Assert((IntPtr)_slowContainsValuesPtr == IntPtr.Zero); 88Debug.Assert(offset < (ulong)hashEntries.Length); 96Debug.Assert(_hashEntries is null); 97Debug.Assert((IntPtr)_slowContainsValuesPtr != IntPtr.Zero); 108Debug.Assert(_hashEntries is null); 109Debug.Assert((IntPtr)_slowContainsValuesPtr != IntPtr.Zero); 133Debug.Assert(maxInclusive <= char.MaxValue); 169Debug.Assert(modulus < MaxModulus); 213Debug.Assert(divisor > 0); 214Debug.Assert(divisor <= MaxModulus); 223Debug.Assert(multiplier == GetFastModMultiplier(divisor)); 227Debug.Assert(result == (value % divisor)); 241Debug.Assert(state._hashEntries is not null); 281Debug.Assert(state._hashEntries is not null);
src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticWithAsciiCharSearchValues.cs (3)
23Debug.Assert(values.ContainsAnyInRange((char)0, (char)127)); 53Debug.Assert(_asciiState.Lookup.Contains(0) != _inverseAsciiState.Lookup.Contains(0)); 150Debug.Assert(_asciiState.Lookup.Contains(0) != _inverseAsciiState.Lookup.Contains(0));
src\libraries\System.Private.CoreLib\src\System\SearchValues\SearchValues.cs (1)
46Debug.Assert(values.Length is 2 or 3 or 4 or 5);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\AsciiStringSearchValuesTeddyBase.cs (11)
121Debug.Assert(!TBucketized.Value); 122Debug.Assert(n is 2 or 3); 137Debug.Assert(TBucketized.Value); 138Debug.Assert(n is 2 or 3); 252Debug.Assert(span.Length >= CharsPerIterationAvx2 + MatchStartOffsetN2); 304Debug.Assert(span.Length >= CharsPerIterationAvx512 + MatchStartOffsetN2); 429Debug.Assert(span.Length >= CharsPerIterationAvx2 + MatchStartOffsetN3); 484Debug.Assert(span.Length >= CharsPerIterationAvx512 + MatchStartOffsetN3); 561Debug.Assert(bucket is not null); 606Debug.Assert(bucket is not null); 651Debug.Assert(bucket is not null);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasick.cs (22)
79Debug.Assert(typeof(TCaseSensitivity) != typeof(StringSearchValuesHelper.CaseInsensitiveUnicode)); 87Debug.Assert(nodeIndex == 0); 122Debug.Assert((uint)i < (uint)span.Length); 127Debug.Assert((uint)nodeIndex < (uint)_nodes.Length); 135Debug.Assert((uint)nodeIndex < (uint)_nodes.Length); 140Debug.Assert(result == -1 || result >= i + 1 - matchLength); 168Debug.Assert(nodeIndex == -1); 169Debug.Assert(result >= 0); 231Debug.Assert((uint)i < (uint)span.Length); 258Debug.Assert(lowSurrogateUpper != LowSurrogateNotSet); 269Debug.Assert(c == destination[0]); 270Debug.Assert(lowSurrogateUpper == LowSurrogateNotSet || lowSurrogateUpper == destination[1]); 276Debug.Assert((uint)nodeIndex < (uint)_nodes.Length); 284Debug.Assert((uint)nodeIndex < (uint)_nodes.Length); 289Debug.Assert(result == -1 || result >= i + 1 - matchLength); 317Debug.Assert(nodeIndex == -1); 318Debug.Assert(result >= 0); 331Debug.Assert(char.IsHighSurrogate(h)); 332Debug.Assert(char.IsLowSurrogate(l)); 338Debug.Assert(written == 2); 343Debug.Assert(char.IsHighSurrogate(hr)); 344Debug.Assert(char.IsLowSurrogate(lr));
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasickBuilder.cs (2)
25Debug.Assert(!string.IsNullOrEmpty(values[0])); 31Debug.Assert(values[i - 1].Length <= values[i].Length);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasickNode.cs (3)
40Debug.Assert(children is int[] || children is Dictionary<char, int>); 96Debug.Assert(ReferenceEquals(_children, EmptyChildrenSentinel)); 139Debug.Assert(children.Count > 0);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\CharacterFrequencyHelper.cs (5)
34Debug.Assert(value.Length > 1); 35Debug.Assert(!ignoreCase || char.IsAscii(value[0])); 43Debug.Assert(!ignoreCase); 74Debug.Assert(ch2Offset != 0); 75Debug.Assert(ch2Offset != ch3Offset);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\RabinKarp.cs (5)
42Debug.Assert(values.Length <= MaxValues); 50Debug.Assert(minimumLength > 1); 111Debug.Assert(typeof(TCaseSensitivity) != typeof(CaseInsensitiveUnicode)); 128Debug.Assert(_buckets is not null); 175Debug.Assert(charsWritten == upperCase.Length);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\StringSearchValuesHelper.cs (10)
20Debug.Assert(searchSpaceLength >= 0); 28Debug.Assert(offset >= 0); 31Debug.Assert(currentByteOffset >= 0); 32Debug.Assert((currentByteOffset & 1) == 0); 36Debug.Assert(offset <= availableLength); 58Debug.Assert(lengthRemaining > 0); 136Debug.Assert(candidate.Length > 1); 158Debug.Assert(candidate.Length is 2 or 3); 190Debug.Assert(candidate.Length > 1); 191Debug.Assert(candidate.ToUpperInvariant() == candidate);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\TeddyBucketizer.cs (7)
17Debug.Assert(values.Length <= 8); 29Debug.Assert(char.IsAscii(c)); 50Debug.Assert(valueBuckets.Length <= 8); 62Debug.Assert(char.IsAscii(c)); 86Debug.Assert(values.Length <= RabinKarp.MaxValues); 104Debug.Assert(char.IsAscii(value[j])); 136Debug.Assert(count == strings.Length);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\SingleStringSearchValuesThreeChars.cs (5)
37Debug.Assert(value.Length > 1); 38Debug.Assert((value.Length >= 8) == TValueLength.AtLeast8CharsOrUnknown); 42Debug.Assert(ch3Offset == 0 || ch3Offset > ch2Offset); 324Debug.Assert(bitPos % 2 == 0); 356Debug.Assert(bitPos % 2 == 0);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValues.cs (12)
64Debug.Assert(i == normalizedValues.Length); 91Debug.Assert(charsWritten == upperCase.Length); 109Debug.Assert(newCount <= values.Length - unreachableValues.Count); 110Debug.Assert(newCount > 0); 252Debug.Assert(!(asciiStartLettersOnly && asciiStartUnaffectedByCaseConversion)); 292Debug.Assert(typeof(TStartCaseSensitivity) != typeof(CaseInsensitiveUnicode)); 293Debug.Assert(values.Length > 1); 294Debug.Assert(n is 2 or 3); 317Debug.Assert(n is 2 or 3); 318Debug.Assert(values.Length < maxValues); 329Debug.Assert(char.IsAscii(c)); 373Debug.Assert(newValuesCount == newValues.Length);
src\libraries\System.Private.CoreLib\src\System\Security\SecureString.cs (8)
59Debug.Assert(_buffer != null); 82Debug.Assert(_buffer != null); 102Debug.Assert(_buffer != null); 132Debug.Assert(_buffer != null); 183Debug.Assert(_buffer != null); 230Debug.Assert(_buffer != null); 262Debug.Assert(_buffer != null); 427Debug.Assert(byteLength >= 0);
src\libraries\System.Private.CoreLib\src\System\Single.cs (7)
294Debug.Assert(IsNaN(value)); 1539Debug.Assert(IsNaN(x) || IsNaN(y)); 1572Debug.Assert(n == 0); 1611Debug.Assert(IsPositiveInfinity(x)); 1616Debug.Assert(IsNegativeInfinity(x)); 1656Debug.Assert(IsPositiveInfinity(x)); 1661Debug.Assert(IsNegativeInfinity(x));
src\libraries\System.Private.CoreLib\src\System\Span.cs (1)
133Debug.Assert(length >= 0);
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Byte.cs (24)
18Debug.Assert(searchSpaceLength >= 0); 19Debug.Assert(valueLength >= 0); 83Debug.Assert(offset >= 0); 85Debug.Assert(offset + ch1ch2Distance + Vector512<byte>.Count <= searchSpaceLength); 144Debug.Assert(offset >= 0); 146Debug.Assert(offset + ch1ch2Distance + Vector256<byte>.Count <= searchSpaceLength); 205Debug.Assert(offset >= 0); 207Debug.Assert(offset + ch1ch2Distance + Vector128<byte>.Count <= searchSpaceLength); 254Debug.Assert(searchSpaceLength >= 0); 255Debug.Assert(valueLength >= 0); 276Debug.Assert(0 <= offset && offset <= searchSpaceLength); // Ensures no deceptive underflows in the computation of "remainingSearchSpaceLength". 828Debug.Assert(lengthToExamine < length); 858Debug.Assert(lengthToExamine < length); 888Debug.Assert(lengthToExamine < length); 918Debug.Assert(length <= (nuint)sizeof(nuint) * 2); 929Debug.Assert(length >= (nuint)sizeof(nuint)); 934Debug.Assert(lengthToExamine < length); 965Debug.Assert(firstLength >= 0); 966Debug.Assert(secondLength >= 0); 1014Debug.Assert(result != 0); 1055Debug.Assert(result != 0); 1092Debug.Assert(result != 0); 1202Debug.Assert(length >= (uint)Vector128<byte>.Count); 1301Debug.Assert(length > 1);
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.ByteMemOps.cs (14)
59Debug.Assert(len > 16 && len <= 64); 100Debug.Assert(len > 16 && len <= 64); 118Debug.Assert(len >= 8 && len <= 16); 134Debug.Assert(len >= 4 && len < 8); 141Debug.Assert(len < 4); 175Debug.Assert(len > 64 && len <= MemmoveNativeThreshold); 231Debug.Assert(len > 0); 242Debug.Assert(len > 0); 266Debug.Assert(len > 16 && len <= 64); 307Debug.Assert(len > 16 && len <= 64); 325Debug.Assert(len >= 8 && len <= 16); 341Debug.Assert(len >= 4 && len < 8); 348Debug.Assert(len < 4); 377Debug.Assert(len > 64 && len <= ZeroMemoryNativeThreshold);
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Char.cs (20)
16Debug.Assert(searchSpaceLength >= 0); 17Debug.Assert(valueLength >= 0); 89Debug.Assert(offset + ch1ch2Distance + Vector512<ushort>.Count <= searchSpaceLength); 156Debug.Assert(offset + ch1ch2Distance + Vector256<ushort>.Count <= searchSpaceLength); 218Debug.Assert(offset + ch1ch2Distance + Vector128<ushort>.Count <= searchSpaceLength); 266Debug.Assert(searchSpaceLength >= 0); 267Debug.Assert(valueLength >= 0); 288Debug.Assert(0 <= offset && offset <= searchSpaceLength); // Ensures no deceptive underflows in the computation of "remainingSearchSpaceLength". 467Debug.Assert(firstLength >= 0); 468Debug.Assert(secondLength >= 0); 585Debug.Assert(length - offset >= Vector128<ushort>.Count); 646Debug.Assert(lengthToExamine >= Vector512<ushort>.Count); 675Debug.Assert(lengthToExamine >= Vector256<ushort>.Count); 698Debug.Assert(lengthToExamine >= Vector128<ushort>.Count); 729Debug.Assert(length - offset >= Vector128<ushort>.Count); 763Debug.Assert(lengthToExamine >= Vector256<ushort>.Count); 786Debug.Assert(lengthToExamine >= Vector128<ushort>.Count); 817Debug.Assert(length - offset >= Vector128<ushort>.Count); 824Debug.Assert(lengthToExamine >= Vector128<ushort>.Count); 889Debug.Assert(length > 1);
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.cs (8)
35Debug.Assert(pointerSizeLength <= 7); 68Debug.Assert(pointerSizeLength >= 4); 77Debug.Assert(pointerSizeLength >= 2); 84Debug.Assert(pointerSizeLength >= 1); 92Debug.Assert(length > 1); 197Debug.Assert(length > 1); 303Debug.Assert(length > 1); 335Debug.Assert(length > 1);
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Packed.cs (24)
26Debug.Assert(PackedIndexOfIsSupported); 27Debug.Assert(RuntimeHelpers.IsBitwiseEquatable<T>()); 28Debug.Assert(sizeof(T) == sizeof(ushort)); 67Debug.Assert((value | 0x20) == value); 76Debug.Assert((value | 0x20) == value); 85Debug.Assert((value0 | 0x20) == value0); 86Debug.Assert((value1 | 0x20) == value1); 95Debug.Assert((value0 | 0x20) == value0); 96Debug.Assert((value1 | 0x20) == value1); 114Debug.Assert(CanUsePackedIndexOf(value)); 318Debug.Assert(CanUsePackedIndexOf(value)); 521Debug.Assert(CanUsePackedIndexOf(value0)); 522Debug.Assert(CanUsePackedIndexOf(value1)); 734Debug.Assert(CanUsePackedIndexOf(value0)); 735Debug.Assert(CanUsePackedIndexOf(value1)); 736Debug.Assert(CanUsePackedIndexOf(value2)); 952Debug.Assert(CanUsePackedIndexOf(lowInclusive)); 953Debug.Assert(CanUsePackedIndexOf((short)(lowInclusive + rangeInclusive))); 954Debug.Assert(rangeInclusive >= 0); 1147Debug.Assert(Avx512BW.IsSupported); 1159Debug.Assert(Avx2.IsSupported); 1171Debug.Assert(Sse2.IsSupported); 1305Debug.Assert(Avx2.IsSupported); 1317Debug.Assert(Avx512F.IsSupported);
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.T.cs (28)
193Debug.Assert(searchSpaceLength >= 0); 194Debug.Assert(valueLength >= 0); 206Debug.Assert(0 <= index && index <= searchSpaceLength); // Ensures no deceptive underflows in the computation of "remainingSearchSpaceLength". 229Debug.Assert(length >= 0); 235Debug.Assert(value is not null); 301Debug.Assert(length >= 0); 306Debug.Assert(value is not null); 390Debug.Assert(length >= 0); 396Debug.Assert(value0 is not null && value1 is not null); 496Debug.Assert(length >= 0); 502Debug.Assert(value0 is not null && value1 is not null && value2 is not null); 601Debug.Assert(searchSpaceLength >= 0); 602Debug.Assert(valueLength >= 0); 672Debug.Assert(searchSpaceLength >= 0); 673Debug.Assert(valueLength >= 0); 691Debug.Assert(0 <= index && index <= searchSpaceLength); // Ensures no deceptive underflows in the computation of "remainingSearchSpaceLength". 712Debug.Assert(length >= 0); 716Debug.Assert(value is not null); 795Debug.Assert(length >= 0); 800Debug.Assert(value0 is not null && value1 is not null); 900Debug.Assert(length >= 0); 905Debug.Assert(value0 is not null && value1 is not null && value2 is not null); 1005Debug.Assert(searchSpaceLength >= 0); 1006Debug.Assert(valueLength >= 0); 1197Debug.Assert(length >= 0); 1289Debug.Assert(firstLength >= 0); 1290Debug.Assert(secondLength >= 0); 3064Debug.Assert(oldValue is not null);
src\libraries\System.Private.CoreLib\src\System\StartupHookProvider.cs (5)
146Debug.Assert(Path.IsPathFullyQualified(startupHook.Path)); 151Debug.Assert(startupHook.AssemblyName != null); 167Debug.Assert(assembly != null); 197Debug.Assert(initializeMethod == null); 209Debug.Assert(initializeMethod != null &&
src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (15)
24Debug.Assert(strA != null); 25Debug.Assert(strB != null); 26Debug.Assert(strA.Length == strB.Length); 37Debug.Assert(strA != null); 38Debug.Assert(strB != null); 39Debug.Assert(indexA >= 0 && indexB >= 0); 40Debug.Assert(countA >= 0 && countB >= 0); 41Debug.Assert(indexA + countA <= strA.Length && indexB + countB <= strB.Length); 70Debug.Assert(strA.Length == strB.Length); 77Debug.Assert(strA != null); 78Debug.Assert(strB != null); 419Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); // CheckStringComparison validated these earlier 909Debug.Assert(charsWritten == length); 1041Debug.Assert((uint)comparisonType <= (uint)StringComparison.OrdinalIgnoreCase); 1061Debug.Assert(comparisonType == StringComparison.Ordinal || comparisonType == StringComparison.OrdinalIgnoreCase);
src\libraries\System.Private.CoreLib\src\System\String.cs (4)
228Debug.Assert(numBytes >= 0); 229Debug.Assert(pb <= (pb + numBytes)); 531Debug.Assert(bytes != null); 532Debug.Assert(byteLength >= 0);
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (16)
43Debug.Assert(dest != null); 44Debug.Assert(src != null); 45Debug.Assert(src.Length <= dest.Length - destPos); 123Debug.Assert(s != null); 669Debug.Assert(index > 2); 1221Debug.Assert(compareInfo != null); 1411Debug.Assert(indices.Length > 0); 1442Debug.Assert(this.Length - thisIdx == dstSpan.Length - dstIdx); 1816Debug.Assert(count >= 0); 1860Debug.Assert(count >= 2); 1897Debug.Assert(count >= 2); 1950Debug.Assert(arrIndex < maxItems); 2039Debug.Assert(sourceSpan.Length >= Vector128<ushort>.Count); 2258Debug.Assert(startIndex == 0); 2500Debug.Assert(trimChars != null); 2501Debug.Assert(trimCharsLength > 0);
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.CaseConversion.cs (7)
185Debug.Assert(numElementsActuallyConverted <= numElementsToConvert); 199Debug.Assert(numElementsActuallyConverted <= (nuint)buffer.Length); 211Debug.Assert(typeof(TFrom) == typeof(byte) || typeof(TFrom) == typeof(ushort)); 212Debug.Assert(typeof(TTo) == typeof(byte) || typeof(TTo) == typeof(ushort)); 213Debug.Assert(typeof(TCasing) == typeof(ToUpperConversion) || typeof(TCasing) == typeof(ToLowerConversion)); 346Debug.Assert(Vector128.IsHardwareAccelerated); 405Debug.Assert(Vector128.IsHardwareAccelerated);
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.cs (3)
50Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort)); 146Debug.Assert((int)i > 3 * Vector256<T>.Count); 198Debug.Assert((int)i > 3 * Vector128<T>.Count);
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Equality.cs (6)
46Debug.Assert( 70Debug.Assert(Vector512<TLeft>.Count == Vector512<TRight>.Count 100Debug.Assert(Vector256<TLeft>.Count == Vector256<TRight>.Count 200Debug.Assert( 550Debug.Assert(Vector256<byte>.Count == Vector256<ushort>.Count * 2); 575Debug.Assert(Vector512<byte>.Count == Vector512<ushort>.Count * 2);
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Transcoding.cs (2)
40Debug.Assert(numElementsActuallyConverted <= numElementsToConvert); 75Debug.Assert(numElementsActuallyConverted <= numElementsToConvert);
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Utility.cs (23)
48Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort)); 74Debug.Assert((mask != 0) ? index < 16 : index >= 16); 337Debug.Assert(sseMask != uint.MaxValue); 338Debug.Assert(Sse2.IsSupported); 345Debug.Assert(advSimdIndex != uint.MaxValue); 346Debug.Assert(AdvSimd.IsSupported); 611Debug.Assert(bufferLength < SizeOfVector128); 739Debug.Assert(bufferLength <= nuint.MaxValue / sizeof(char)); 967Debug.Assert(bufferLength <= nuint.MaxValue / sizeof(char)); 1162Debug.Assert(bufferLength < SizeOfVector128InChars); 1246Debug.Assert(AllCharsInUInt64AreAscii(value)); 1300Debug.Assert(AllCharsInUInt32AreAscii(value)); 1364Debug.Assert(currentOffset <= elementCount); 1586Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort)); 1597Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort)); 1621Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort)); 1641Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort)); 1691Debug.Assert(elementCount >= 2 * SizeOfVector128); 1809Debug.Assert(elementCount >= 2 * Vector256.Size); 1926Debug.Assert(elementCount >= 2 * Vector512.Size); 2055Debug.Assert(currentOffset <= elementCount); 2225Debug.Assert(typeof(TVectorByte) == typeof(Vector128<byte>)); 2239Debug.Assert(AllBytesInUInt32AreAscii(value));
src\libraries\System.Private.CoreLib\src\System\Text\CompositeFormat.cs (8)
35Debug.Assert(format is not null); 39Debug.Assert(segments is not null); 60Debug.Assert(literalLength >= 0); 61Debug.Assert(formattedCount >= 0); 62Debug.Assert(formattedCount == 0 || argsRequired > 0); 184Debug.Assert(format[pos - 1] == '{'); 185Debug.Assert(ch != '{'); 316Debug.Assert(format[pos] == '}');
src\libraries\System.Private.CoreLib\src\System\Text\DecoderNLS.cs (5)
76Debug.Assert(_encoding is not null); 127Debug.Assert(_encoding is not null); 183Debug.Assert(_encoding is not null); 237Debug.Assert(_encoding is not null); 295Debug.Assert(_encoding is not null);
src\libraries\System.Private.CoreLib\src\System\Text\EncoderFallback.cs (2)
197Debug.Assert(encoding != null); 247Debug.Assert(encoding != null);
src\libraries\System.Private.CoreLib\src\System\Text\EncoderNLS.cs (7)
72Debug.Assert(_encoding is not null); 114Debug.Assert(_encoding is not null); 170Debug.Assert(_encoding is not null); 214Debug.Assert(_encoding is not null); 285Debug.Assert(_encoding is not null); 308Debug.Assert(_fallbackBuffer is not null); 359Debug.Assert(_encoding is not null);
src\libraries\System.Private.CoreLib\src\System\Text\Encoding.cs (2)
631Debug.Assert(byteCount == bytesReceived); 657Debug.Assert(byteCount == bytesReceived);
src\libraries\System.Private.CoreLib\src\System\Text\Encoding.Internal.cs (3)
688Debug.Assert(encoder is null); 1272Debug.Assert(fallbackBuffer.Remaining == 0); 1285Debug.Assert(decoder is null);
src\libraries\System.Private.CoreLib\src\System\Text\EncodingTable.cs (6)
57Debug.Assert(EncodingNameIndices.Length == CodePagesByName.Length + 1); 58Debug.Assert(EncodingNameIndices[^1] == EncodingNames.Length); 68Debug.Assert(index < EncodingNameIndices.Length - 1); 91Debug.Assert(left < EncodingNameIndices.Length - 1); 131Debug.Assert(arrayEncodingInfoIdx == arrayEncodingInfo.Length); 137Debug.Assert(encodingInfoList != null);
src\libraries\System.Private.CoreLib\src\System\Text\Latin1Utility.cs (11)
40Debug.Assert(bufferLength <= nuint.MaxValue / sizeof(char)); 204Debug.Assert(bufferLength <= nuint.MaxValue / sizeof(char)); 451Debug.Assert(bufferLength < SizeOfVector128InChars); 630Debug.Assert(currentOffset <= elementCount); 779Debug.Assert(Sse2.IsSupported); 780Debug.Assert(BitConverter.IsLittleEndian); 781Debug.Assert(elementCount >= 2 * SizeOfVector128); 971Debug.Assert(Sse2.IsSupported); 972Debug.Assert(BitConverter.IsLittleEndian); 997Debug.Assert(0 < currentOffset && currentOffset <= SizeOfVector128 / sizeof(char)); 1071Debug.Assert(!Sse2.IsSupported);
src\libraries\System.Private.CoreLib\src\System\Text\Latin1Utility.Helpers.cs (2)
51Debug.Assert(AllCharsInUInt64AreLatin1(value)); 95Debug.Assert(AllCharsInUInt32AreLatin1(value));
src\libraries\System.Private.CoreLib\src\System\Text\Rune.cs (7)
180Debug.Assert(codeUnitCount > 0 && codeUnitCount <= MaxUtf16CharsPerRune); 197Debug.Assert(codeUnitCount > 0 && codeUnitCount <= MaxUtf8BytesPerRune); 451Debug.Assert(UnicodeUtility.IsInRangeInclusive(tempValue, 0x0080, 0x07FF)); 502Debug.Assert(UnicodeUtility.IsInRangeInclusive(tempValue, 0x0800, 0xFFFF)); 531Debug.Assert(1 <= bytesConsumed && bytesConsumed <= 4); // Valid subsequences are always length [1..4] 537Debug.Assert(0 <= index && index <= 3); // Incomplete subsequences are always length 0..3 544Debug.Assert(1 <= index && index <= 3); // Invalid subsequences are always length 1..3
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (34)
245Debug.Assert(currentBlock.m_MaxCapacity == maxCapacity); 246Debug.Assert(currentBlock.m_ChunkChars != null); 248Debug.Assert(currentBlock.m_ChunkLength <= currentBlock.m_ChunkChars.Length); 249Debug.Assert(currentBlock.m_ChunkLength >= 0); 250Debug.Assert(currentBlock.m_ChunkOffset >= 0); 255Debug.Assert(currentBlock.m_ChunkOffset == 0); 259Debug.Assert(currentBlock.m_ChunkOffset == prevBlock.m_ChunkOffset + prevBlock.m_ChunkLength); 559Debug.Assert(next.m_ChunkPrevious != null); 585Debug.Assert(stringBuilder != null); 638Debug.Assert(stringBuilder != null); 904Debug.Assert(chunk != null); 956Debug.Assert(insertingChars + this.Length < int.MaxValue); 1236Debug.Assert(values != null); 1238Debug.Assert(separatorLength >= 0); 1589Debug.Assert(format[pos - 1] == '{'); 1590Debug.Assert(ch != '{'); 1693Debug.Assert(format[pos] == '}'); 1921Debug.Assert(index > 2); 2010Debug.Assert(thisChunk != null && sbChunk != null); 2047Debug.Assert(offset == Length); 2242Debug.Assert(chunk.m_ChunkPrevious != null); 2505Debug.Assert(0 <= index && index <= Length); 2510Debug.Assert(result.m_ChunkPrevious != null); 2514Debug.Assert(result != null); 2548Debug.Assert(minBlockCharCount > 0); 2638Debug.Assert(count > 0); 2639Debug.Assert(index >= 0); 2650Debug.Assert(chunk.m_ChunkPrevious != null); 2707Debug.Assert(size > 0); 2708Debug.Assert(maxCapacity > 0); 2733Debug.Assert(startIndex >= 0 && startIndex < Length); 2761Debug.Assert(chunk.m_ChunkPrevious != null); 3134Debug.Assert(_hasCustomFormatter); 3135Debug.Assert(_provider != null);
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.Debug.cs (2)
24Debug.Assert(head.m_ChunkPrevious != null); 35Debug.Assert(current.m_ChunkPrevious != null);
src\libraries\System.Private.CoreLib\src\System\Text\TranscodingStream.cs (4)
55Debug.Assert(innerStream != null); 56Debug.Assert(innerEncoding != null); 57Debug.Assert(thisEncoding != null); 150Debug.Assert(pendingData.Count != 0);
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf16Utility.cs (10)
42Debug.Assert(AllCharsInUInt32AreAscii(value)); 72Debug.Assert(AllCharsInUInt32AreAscii(value)); 101Debug.Assert(AllCharsInUInt64AreAscii(value)); 130Debug.Assert(AllCharsInUInt64AreAscii(value)); 158Debug.Assert(AllCharsInUInt32AreAscii(value)); 183Debug.Assert(AllCharsInUInt32AreAscii(value)); 209Debug.Assert(AllCharsInUInt32AreAscii(valueA)); 210Debug.Assert(AllCharsInUInt32AreAscii(valueB)); 266Debug.Assert(AllCharsInUInt64AreAscii(valueA)); 267Debug.Assert(AllCharsInUInt64AreAscii(valueB));
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf16Utility.Validation.cs (3)
33Debug.Assert(0 <= numAsciiCharsConsumedJustNow && numAsciiCharsConsumedJustNow <= inputLength); 75Debug.Assert(pHighestAddressWhereCanReadOneVector >= pInputBuffer); 271Debug.Assert(pHighestAddressWhereCanReadOneVector >= pInputBuffer);
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8.cs (8)
654Debug.Assert(_hasCustomFormatter); 655Debug.Assert(_provider is not null); 675Debug.Assert(value is ISpanFormattable); 685Debug.Assert(value is ISpanFormattable); 722Debug.Assert(typeof(T).IsEnum); 732Debug.Assert(value is ISpanFormattable); 766Debug.Assert(startingPos >= 0 && startingPos <= _pos); 767Debug.Assert(alignment != 0);
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.cs (8)
62Debug.Assert(AllBytesInUInt32AreAscii(value)); 92Debug.Assert(AllBytesInUInt32AreAscii(value)); 121Debug.Assert(AllBytesInUInt64AreAscii(value)); 150Debug.Assert(AllBytesInUInt64AreAscii(value)); 179Debug.Assert(AllBytesInUInt32AreAscii(valueA)); 180Debug.Assert(AllBytesInUInt32AreAscii(valueB)); 242Debug.Assert(AllBytesInUInt64AreAscii(valueA)); 243Debug.Assert(AllBytesInUInt64AreAscii(valueB));
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.Helpers.cs (9)
20Debug.Assert(UInt32BeginsWithUtf8ThreeByteMask(value)); 45Debug.Assert(UInt32BeginsWithUtf8TwoByteMask(value) && !UInt32BeginsWithOverlongUtf8TwoByteSequence(value)); 108Debug.Assert(IsWellFormedUtf16SurrogatePair(value)); 186Debug.Assert(IsFirstCharTwoUtf8Bytes(value) && IsSecondCharTwoUtf8Bytes(value)); 214Debug.Assert(IsFirstCharTwoUtf8Bytes(value)); 456Debug.Assert(UInt32BeginsWithUtf8TwoByteMask(value)); 575Debug.Assert(UInt32EndsWithUtf8TwoByteMask(value)); 639Debug.Assert(BitConverter.IsLittleEndian); 658Debug.Assert(BitConverter.IsLittleEndian);
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.Transcoding.cs (8)
62Debug.Assert(pInputBuffer <= pFinalPosWhereCanReadDWordFromInputBuffer); 132Debug.Assert(!Ascii.AllBytesInUInt32AreAscii(secondDWord)); 150Debug.Assert(!Ascii.AllBytesInUInt32AreAscii(thisDWord)); // this should have been handled earlier 222Debug.Assert(outputCharsRemaining == 1); 896Debug.Assert(pInputBuffer <= pFinalPosWhereCanReadDWordFromInputBuffer); 1053Debug.Assert(!Utf16Utility.AllCharsInUInt64AreAscii(possibleNonAsciiQWord)); // this condition should've been checked earlier 1120Debug.Assert(!Utf16Utility.AllCharsInUInt32AreAscii(thisDWord)); // this should have been handled earlier 1397Debug.Assert(inputLength < CharsPerDWord);
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.Validation.cs (5)
177Debug.Assert((AdvSimd.Arm64.IsSupported && BitConverter.IsLittleEndian) || Sse2.IsSupported); 185Debug.Assert(trailingZeroCount < 16); 221Debug.Assert(!Ascii.AllBytesInUInt32AreAscii(thisDWord)); // this should have been handled earlier 647Debug.Assert(inputLength < 4); 657Debug.Assert(inputBufferRemainingBytes < 4);
src\libraries\System.Private.CoreLib\src\System\Text\UTF32Encoding.cs (1)
849Debug.Assert(baseDecoder is not null);
src\libraries\System.Private.CoreLib\src\System\Text\UTF7Encoding.cs (1)
62Debug.Assert(_base64Bytes.Length == 64);
src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.Sealed.cs (6)
57Debug.Assert(s != null); 58Debug.Assert(s.Length <= MaxSmallInputElementCount); 68Debug.Assert(0 <= bytesWritten && bytesWritten <= s.Length * MaxUtf8BytesPerChar); 135Debug.Assert(bytes != null); 136Debug.Assert(bytes.Length <= MaxSmallInputElementCount); 146Debug.Assert(0 <= charsWritten && charsWritten <= sourceLength); // should never have more output chars than input bytes
src\libraries\System.Private.CoreLib\src\System\Text\ValueStringBuilder.AppendFormat.cs (3)
85Debug.Assert(format[pos - 1] == '{'); 86Debug.Assert(ch != '{'); 189Debug.Assert(format[pos] == '}');
src\libraries\System.Private.CoreLib\src\System\Threading\AsyncLocal.cs (6)
51Debug.Assert(_valueChangedHandler is not null); 104Debug.Assert(asyncLocalValueMap is not null); 105Debug.Assert(asyncLocalValueMap == Empty || asyncLocalValueMap.GetType() != typeof(EmptyAsyncLocalValueMap)); 392Debug.Assert(keyValues.Length is >= 5 and <= MaxMultiElements); 522Debug.Assert(index == MultiElementAsyncLocalValueMap.MaxMultiElements); 535Debug.Assert(map.Count == count - 1);
src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (11)
323Debug.Assert(IsCancellationRequested); 586Debug.Assert(callback is Action<object?> || callback is Action<object?, CancellationToken>); 770Debug.Assert(node.Registrations.Source == this); 771Debug.Assert(node.Prev == null); 987Debug.Assert(d is Action<object?> || d is Action<object?, CancellationToken>); 1033Debug.Assert(_lock == 1); 1084Debug.Assert(node.Prev == null); 1089Debug.Assert(node.Prev != null); 1183Debug.Assert(_lock == 1); 1212Debug.Assert(Callback != null); 1220Debug.Assert(node.Callback != null);
src\libraries\System.Private.CoreLib\src\System\Threading\DeferredDisposableLifetime.cs (1)
81Debug.Assert(oldCount != 0 && oldCount != -1);
src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs (17)
84Debug.Assert(isFlowSuppressed != m_isFlowSuppressed); 250Debug.Assert(threadPoolThread == Thread.CurrentThread); 314Debug.Assert(currentThread == Thread.CurrentThread); 315Debug.Assert(contextToRestore != currentContext); 350Debug.Assert(!Thread.IsThreadStartSupported || Thread.CurrentThread.IsThreadPoolThread); // there are no dedicated threadpool threads on runtimes where we can't start threads 357Debug.Assert(previousExecutionCtx != nextExecutionCtx); 364Debug.Assert(previousChangeNotifications != null || nextChangeNotifications != null); 372Debug.Assert(previousExecutionCtx!.m_localValues != null); 373Debug.Assert(nextExecutionCtx!.m_localValues != null); 407Debug.Assert(previousExecutionCtx!.m_localValues != null); 421Debug.Assert(nextExecutionCtx!.m_localValues != null); 456Debug.Assert(!current.IsDefault); 470Debug.Assert(!current.IsDefault); 493Debug.Assert(!current.IsDefault); 513Debug.Assert(newChangeNotifications != null); 514Debug.Assert(Array.IndexOf(newChangeNotifications, local) >= 0); 556Debug.Assert(currentThread == Thread.CurrentThread);
src\libraries\System.Private.CoreLib\src\System\Threading\IOCompletionCallbackHelper.cs (2)
34Debug.Assert(pNativeOverlapped != null); 52Debug.Assert(callback is IOCompletionCallbackHelper);
src\libraries\System.Private.CoreLib\src\System\Threading\LazyInitializer.cs (3)
70Debug.Assert(target != null); 121Debug.Assert(target != null); 277Debug.Assert(target != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Lock.cs (55)
77Debug.Assert(currentThreadId.IsInitialized); 84Debug.Assert(currentThreadId.IsInitialized); 85Debug.Assert(currentThreadId.Id == _owningThreadId); 234Debug.Assert(timeoutMs >= -1); 239Debug.Assert(!new ThreadId(_owningThreadId).IsInitialized); 240Debug.Assert(_recursionCount == 0); 273Debug.Assert(currentThreadId.IsInitialized); 274Debug.Assert(currentThreadId.Id == ThreadId.Current_NoInitialize.Id); 287Debug.Assert(new ThreadId(_owningThreadId).IsInitialized); 288Debug.Assert(_owningThreadId == ThreadId.Current_NoInitialize.Id); 289Debug.Assert(new State(this).IsLocked); 312Debug.Assert(timeoutMs >= -1); 319Debug.Assert(_owningThreadId != currentThreadId.Id); 327Debug.Assert(new State(this).IsLocked); 372Debug.Assert(IsAdaptiveSpinEnabled(minSpinCountForAdaptiveSpin)); 429Debug.Assert(tryLockResult == TryLockResult.Wait); 451Debug.Assert(tryLockResult == TryLockResult.Wait); 458Debug.Assert(tryLockResult != TryLockResult.Spin); 464Debug.Assert(tryLockResult == TryLockResult.Locked); 467Debug.Assert(!new ThreadId(_owningThreadId).IsInitialized); 468Debug.Assert(_recursionCount == 0); 559Debug.Assert(!new ThreadId(_owningThreadId).IsInitialized); 560Debug.Assert(_recursionCount == 0); 636Debug.Assert(_waitEvent != null); 638Debug.Assert(signaled); 651Debug.Assert(!isHeld || new State(this).IsLocked); 663Debug.Assert(_waitEvent != null); 729Debug.Assert(!IsLocked); 737Debug.Assert(!ShouldNotPreemptWaiters); 738Debug.Assert(HasAnyWaiters); 745Debug.Assert(ShouldNotPreemptWaiters); 753Debug.Assert(HasAnyWaiters || !ShouldNotPreemptWaiters); 773Debug.Assert(HasAnySpinners); 781Debug.Assert(HasAnyWaiters); 782Debug.Assert(NeedToSignalWaiter); 789Debug.Assert(IsWaiterSignaledToWake); 801Debug.Assert(lockObj._state == 0); 824Debug.Assert(HasAnyWaiters); 832Debug.Assert(HasAnyWaiters); 881Debug.Assert(IsLockedMask == 1); 884Debug.Assert(!state.IsLocked); 920Debug.Assert(spinCount >= 0); 942Debug.Assert(!newState.ShouldNotPreemptWaiters); 976Debug.Assert(state.HasAnySpinners); 1004Debug.Assert(new State(state._state + SpinnerCountIncrement).HasAnySpinners); 1008Debug.Assert(state.HasAnyWaiters || !state.ShouldNotPreemptWaiters); 1068Debug.Assert(state.HasAnyWaiters || waiterStartTimeWasReset); 1092Debug.Assert(state.HasAnyWaiters); 1093Debug.Assert(state.IsWaiterSignaledToWake); 1124Debug.Assert(!state.ShouldNotPreemptWaiters || waiterStartTimeWasRecorded); 1148Debug.Assert(new State(state._state + IsWaiterSignaledToWakeMask).IsWaiterSignaledToWake); 1153Debug.Assert(state.HasAnyWaiters); 1183Debug.Assert(!state.ShouldNotPreemptWaiters || waiterStartTimeWasRecorded); 1207Debug.Assert(state.HasAnyWaiters); 1237Debug.Assert(state.HasAnyWaiters);
src\libraries\System.Private.CoreLib\src\System\Threading\Lock.NonNativeAot.cs (4)
53Debug.Assert(!IsInitialized); 54Debug.Assert(t_threadId == 0); 65Debug.Assert(id != 0); 76Debug.Assert(IsInitialized);
src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelLifoSemaphore.cs (19)
26Debug.Assert(initialSignalCount >= 0); 27Debug.Assert(initialSignalCount <= maximumSignalCount); 28Debug.Assert(maximumSignalCount > 0); 29Debug.Assert(spinCount >= 0); 42Debug.Assert(timeoutMs >= -1); 57Debug.Assert(counts.SignalCount <= _maximumSignalCount); 153Debug.Assert(timeoutMs > 0 || timeoutMs == -1); 173Debug.Assert(counts.WaiterCount != 0); 211Debug.Assert(releaseCount > 0); 212Debug.Assert(releaseCount <= _maximumSignalCount); 248Debug.Assert(releaseCount <= _maximumSignalCount - counts.SignalCount); 287Debug.Assert(value <= uint.MaxValue - SignalCount); 295Debug.Assert(SignalCount != 0); 307Debug.Assert(WaiterCount < ushort.MaxValue); 313Debug.Assert(WaiterCount != 0); 320Debug.Assert(countsAfterUpdate.WaiterCount != ushort.MaxValue); // underflow check 331Debug.Assert(SpinnerCount < byte.MaxValue); 337Debug.Assert(SpinnerCount != 0); 359Debug.Assert(CountOfWaitersSignaledToWake != 0);
src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelLock.cs (9)
62Debug.Assert(!isLocked || (_state & LockedMask) != 0); 72Debug.Assert(_ownerThread == Thread.CurrentThread); 74Debug.Assert((_state & LockedMask) != 0); 82Debug.Assert(_ownerThread != Thread.CurrentThread); 90Debug.Assert(_ownerThread == null); 159Debug.Assert((_state & LockedMask) != 0); 187Debug.Assert((uint)state >= WaiterCountIncrement); 192Debug.Assert((_state & LockedMask) != 0); 198Debug.Assert((_state & LockedMask) != 0);
src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelMonitor.cs (4)
36Debug.Assert(IsLocked); 44Debug.Assert(!IsLocked); 52Debug.Assert(_ownerThread == null); 97Debug.Assert(timeoutMilliseconds >= -1);
src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelMonitor.Unix.cs (1)
49Debug.Assert(timeoutMilliseconds >= -1);
src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelSpinWaiter.cs (3)
21Debug.Assert(condition != null); 56Debug.Assert(spinIndex >= 0); 57Debug.Assert(sleep0Threshold >= 0);
src\libraries\System.Private.CoreLib\src\System\Threading\ManualResetEventSlim.cs (3)
86Debug.Assert(m_eventObj != null); 280Debug.Assert(m_lock != null); // if waiters>0, then m_lock has already been created. 652Debug.Assert(mre.m_lock != null); // the lock should have been created before this callback is registered for use.
src\libraries\System.Private.CoreLib\src\System\Threading\Overlapped.cs (3)
181Debug.Assert(GCHandleCountRef(pNativeOverlapped) == handleCount); 229Debug.Assert(target is Overlapped); 232Debug.Assert(overlapped._pNativeOverlapped == pNativeOverlapped);
src\libraries\System.Private.CoreLib\src\System\Threading\PeriodicTimer.cs (1)
258Debug.Assert(!Monitor.IsEntered(this));
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.Blocking.cs (5)
44Debug.Assert(_numBlockedThreads > 0); 70Debug.Assert(BlockingConfig.IsCooperativeBlockingEnabled); 71Debug.Assert(Thread.CurrentThread.IsThreadPoolThread); 77Debug.Assert(_numBlockedThreads > 0); 123Debug.Assert(_pendingBlockingAdjustment != PendingBlockingAdjustment.None);
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.cs (2)
324Debug.Assert(t_completionCountObject == null); 347Debug.Assert(threadLocalCompletionCountObject != null);
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.GateThread.cs (4)
227Debug.Assert(numRuns >= 0); 228Debug.Assert(numRuns <= MaxRuns); 297Debug.Assert(nextDelay <= GateActivitiesPeriodMs); 315Debug.Assert(HasBlockingAdjustmentDelay);
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.HillClimbing.cs (3)
438Debug.Assert(numSamples >= period); // can't measure a wave that doesn't fit 439Debug.Assert(period >= 2); // can't measure above the Nyquist frequency 440Debug.Assert(numSamples <= samples.Length); // can't measure more samples than we have
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.ThreadCounts.cs (6)
37Debug.Assert(value >= 0); 42Debug.Assert(value >= 0); 55Debug.Assert(value >= 0); 60Debug.Assert(value >= 0); 73Debug.Assert(value > 0); 78Debug.Assert(value > 0);
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WaitThread.cs (10)
220Debug.Assert(registeredWait != null); 250Debug.Assert(signaledHandleIndex != WaitHandle.WaitAbandoned); // the first wait handle is an event 262Debug.Assert(signaledHandle != null); 276Debug.Assert(registeredHandle != null); 295Debug.Assert(_numPendingRemoves >= 0); 296Debug.Assert(_numPendingRemoves <= _pendingRemoves.Length); 297Debug.Assert(_numUserWaits >= 0); 298Debug.Assert(_numUserWaits <= _registeredWaits.Length); 317Debug.Assert(j < numUserWaits); 405Debug.Assert(success);
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WorkerTracking.cs (3)
87Debug.Assert(Current == HighWatermark); 88Debug.Assert(Current != short.MaxValue); 95Debug.Assert(Current > 0);
src\libraries\System.Private.CoreLib\src\System\Threading\ProcessorIdCache.cs (1)
36Debug.Assert(s_processorIdRefreshRate <= ProcessorIdCacheCountDownMask);
src\libraries\System.Private.CoreLib\src\System\Threading\ReaderWriterLockSlim.cs (24)
149Debug.Assert(_spinLock.IsHeld); 157Debug.Assert(_spinLock.IsHeld); 553Debug.Assert(_fIsReentrant); 554Debug.Assert(_fUpgradeThreadHoldingRead); 611Debug.Assert((_owners & WRITER_HELD) > 0); 692Debug.Assert((_owners & WRITER_HELD) > 0); 799Debug.Assert(lrwc.readercount == 1); 907Debug.Assert(_spinLock.IsHeld); 908Debug.Assert(waitEvent == null); 931Debug.Assert(enterLockType == EnterLockType.UpgradeToWrite); 954Debug.Assert(_spinLock.IsHeld); 975Debug.Assert(enterLockType == EnterLockType.UpgradeToWrite); 1067Debug.Assert(_spinLock.IsHeld); 1129Debug.Assert(_spinLock.IsHeld); 1138Debug.Assert(_numReadWaiters != 0 || _numUpgradeWaiters != 0); 1469Debug.Assert( 1489Debug.Assert(DeprioritizeEnterAnyReadIncrement == (1 << 16)); 1498Debug.Assert(DeprioritizeEnterAnyWriteIncrement == 1); 1505Debug.Assert((reason & EnterSpinLockReason.Wait) != 0 || reason == (reason & EnterSpinLockReason.OperationMask)); 1506Debug.Assert( 1515Debug.Assert( 1526Debug.Assert((GetEnterDeprioritizationStateChange(reason) & DeprioritizeEnterAnyWriteIncrement) == 0); 1530Debug.Assert((GetEnterDeprioritizationStateChange(reason) & DeprioritizeEnterAnyWriteIncrement) != 0); 1595Debug.Assert(
src\libraries\System.Private.CoreLib\src\System\Threading\RegisteredWaitHandle.Portable.cs (8)
88Debug.Assert(!IsInfiniteTimeout); 96Debug.Assert(WaitThread != null); 172Debug.Assert(handleValue == handle!.DangerousGetHandle()); 194Debug.Assert(_numRequestedCallbacks != 0); 272Debug.Assert(IsBlocking); 273Debug.Assert(_unregisterCalled); // Should only be called when the wait is unregistered by the user. 282Debug.Assert(!IsBlocking); 283Debug.Assert(_unregisterCalled); // Should only be called when the wait is unregistered by the user.
src\libraries\System.Private.CoreLib\src\System\Threading\RegisteredWaitHandle.Unix.cs (1)
35Debug.Assert(_waitHandle != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Semaphore.Windows.cs (3)
22Debug.Assert(initialCount >= 0); 23Debug.Assert(maximumCount >= 1); 24Debug.Assert(initialCount <= maximumCount);
src\libraries\System.Private.CoreLib\src\System\Threading\SemaphoreSlim.cs (1)
790Debug.Assert(m_countOfWaitersPulsedToWake <= waitCount);
src\libraries\System.Private.CoreLib\src\System\Threading\SpinLock.cs (3)
365Debug.Assert((newOwner & WAITERS_MASK) >= 0); 397Debug.Assert(!IsThreadOwnerTrackingEnabled); // Make sure the waiters never be negative which will cause the thread tracking bit to be flipped 409Debug.Assert(IsThreadOwnerTrackingEnabled);
src\libraries\System.Private.CoreLib\src\System\Threading\SpinWait.cs (4)
101Debug.Assert(value >= 0); 158Debug.Assert(sleep1Threshold >= -1); 159Debug.Assert(sleep1Threshold < 0 || sleep1Threshold >= YieldThreshold); 263Debug.Assert(result);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (1)
211Debug.Assert(state is ConcurrentExclusiveSchedulerPair);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Future.cs (3)
410Debug.Assert(success); 487Debug.Assert(m_action != null); 1422Debug.Assert(task != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\FutureFactory.cs (9)
1270Debug.Assert(thisRef != null); 1634Debug.Assert(continuationAction != null); 1679Debug.Assert(state is Func<Task[], TResult>); 1686Debug.Assert(continuationAction != null); 1691Debug.Assert(state is Action<Task[]>); 1999Debug.Assert(state is Func<Task, TResult>); 2006Debug.Assert(continuationAction != null); 2010Debug.Assert(state is Action<Task>); 2052Debug.Assert(continuationAction != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (35)
639Debug.Assert(continuation != null); 1991Debug.Assert(userDelegateExecute || m_contingentProperties != null); 2153Debug.Assert(childTask != null); 2198Debug.Assert(props != null); 2220Debug.Assert(exceptionHolder != null); 2382Debug.Assert(obj is Task); 2415Debug.Assert(unhandledException != null); 2485Debug.Assert(continuationAction != null); 2556Debug.Assert(stateMachineBox != null); 2862Debug.Assert(source != null); 2863Debug.Assert(millisecondsDelay != 0); 2917Debug.Assert(completingTask.IsCompleted); 3007Debug.Assert(IsCompleted || millisecondsTimeout != Timeout.Infinite); 3221Debug.Assert(m_contingentProperties is null || m_contingentProperties.m_cancellationToken == default); 3242Debug.Assert(m_contingentProperties!.m_cancellationToken == default); 3435Debug.Assert(continuationObject != null); 3537Debug.Assert(currentContinuation is TaskContinuation); 3574Debug.Assert(currentContinuation is ITaskCompletionAction); 4594Debug.Assert(tc != null); 5312Debug.Assert(firstCompleted.Status == TaskStatus.RanToCompletion); 5314Debug.Assert(signaledTaskIndex >= 0); 5445Debug.Assert(exception != null); 5459Debug.Assert(exception != null); 5752Debug.Assert(millisecondsDelay != 0); 5811Debug.Assert(token.CanBeCanceled); 6072Debug.Assert(failedOrCanceled is List<Task>); 6095Debug.Assert(completed); 6127Debug.Assert(failedOrCanceled is Task); 6145Debug.Assert(IsCompleted); 6391Debug.Assert(task.Status == TaskStatus.RanToCompletion); 6565Debug.Assert(task1 != null && task2 != null); 6601Debug.Assert(task1 != null && task2 != null); 6602Debug.Assert(task1.IsCompleted || task2.IsCompleted); 6860Debug.Assert(_waitForNextCompletedTask.GetStatus(_waitForNextCompletedTask.Version) == ValueTaskSourceStatus.Pending); 6981Debug.Assert(outerTask != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskAsyncEnumerableExtensions.ToBlockingEnumerable.cs (2)
45Debug.Assert(moveNextTask.IsCompleted); 63Debug.Assert(disposeTask.IsCompleted);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskContinuation.cs (19)
39Debug.Assert(m_action != null); 85Debug.Assert(m_action != null); 131Debug.Assert(m_action != null); 177Debug.Assert(m_action != null); 216Debug.Assert(task != null); 217Debug.Assert(task.m_taskScheduler != null); 291Debug.Assert(completedTask != null); 295Debug.Assert(continuationTask != null); 369Debug.Assert(state is Action); 385Debug.Assert(context != null); 418Debug.Assert(state is SynchronizationContextAwaitTaskContinuation); 466Debug.Assert(scheduler != null); 534Debug.Assert(action != null); 549Debug.Assert(action != null); 550Debug.Assert(scheduler != null); 669Debug.Assert(state is Action); 683Debug.Assert(callback != null); 684Debug.Assert(currentTask == Task.t_currentTask); 826Debug.Assert(m_action != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskFactory.cs (3)
1598Debug.Assert(tasksCopy != null); 1668Debug.Assert(tasksCopy != null); 2338Debug.Assert(tasks != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskScheduler.cs (2)
232Debug.Assert(task != null); 605Debug.Assert(s is Task);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ThreadPoolTaskScheduler.cs (1)
34Debug.Assert(s is Task);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TplEventSource.cs (1)
546Diagnostics.Debug.Assert(stateMachineBox != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ValueTask.cs (12)
175Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 301Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 324Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 346Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 373Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 394Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 575Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 707Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 730Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 752Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 779Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 803Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>);
src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs (8)
42Debug.Assert(state != null); 280Debug.Assert(startHelper != null); 397Debug.Assert(this == CurrentThread); 398Debug.Assert(IsThreadPoolThread); 424Debug.Assert(this == CurrentThread); 425Debug.Assert(!IsThreadStartSupported || IsThreadPoolThread); // there are no dedicated threadpool threads on runtimes where we can't start threads 426Debug.Assert(_mayNeedResetForThreadPool); 698Debug.Assert(slot.Data != null);
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadBlockingInfo.cs (8)
66Debug.Assert(objectPtr != null); 77Debug.Assert(_objectPtr != null); 78Debug.Assert(t_first != null); 79Debug.Assert(t_first->_next == _next); 95Debug.Assert(_objectPtr != null); 114Debug.Assert(_objectKind == ObjectKind.Condition); 134Debug.Assert(_objectPtr != null); 147Debug.Assert(_objectKind == ObjectKind.Condition);
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadInt64PersistentCounter.cs (6)
30Debug.Assert(threadLocalCountObject is ThreadLocalNode); 37Debug.Assert(threadLocalCountObject is ThreadLocalNode); 99Debug.Assert(counter != null); 139Debug.Assert(count != 0); 154Debug.Assert(count != 0); 180Debug.Assert(node != null);
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadLocal.cs (4)
516Debug.Assert(table.Length < minLength); 554Debug.Assert(minSize > 0); 707Debug.Assert(slotArray != null); 746Debug.Assert(linkedSlot._previous != null);
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolBoundHandle.Portable.cs (1)
81Debug.Assert(wrapper._boundHandle != null);
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (30)
31Debug.Assert(queue != null); 35Debug.Assert(Array.IndexOf(oldQueues, queue) < 0); 49Debug.Assert(queue != null); 182Debug.Assert(m_headIndex <= m_tailIndex); 200Debug.Assert(unused == null || unused == obj); 431Debug.Assert(s_assignableWorkItemQueueCount > 0); 442Debug.Assert(count >= 0); 473Debug.Assert(s_assignableWorkItemQueueCount > 0); 488Debug.Assert(_assignedWorkItemQueueThreadCounts[queueIndex] >= 0); 511Debug.Assert(s_assignableWorkItemQueueCount > 0); 519Debug.Assert(newCount >= 0); 547Debug.Assert(ThreadPoolWorkQueueThreadLocals.threadLocals == null); 596Debug.Assert((callback is IThreadPoolWorkItem) ^ (callback is Task)); 620Debug.Assert((workItem is IThreadPoolWorkItem) ^ (workItem is Task)); 723Debug.Assert(!tl.isProcessingHighPriorityWorkItems); 985Debug.Assert(ThreadPool.EnableWorkerTracking); 986Debug.Assert(currentThread == Thread.CurrentThread); 1011Debug.Assert(workItem is IThreadPoolWorkItem); 1100Debug.Assert(_isScheduledForProcessing != 0); 1121Debug.Assert(tl != null); 1123Debug.Assert(currentThread == Thread.CurrentThread); 1193Debug.Assert(quwi._callback != null); 1202Debug.Assert(context != null); 1225Debug.Assert(callback != null); 1236Debug.Assert(_callback != null); 1251Debug.Assert(callback != null); 1262Debug.Assert(_callback != null); 1279Debug.Assert(callback != null); 1290Debug.Assert(_callback != null); 1614Debug.Assert(null != workItem);
src\libraries\System.Private.CoreLib\src\System\Threading\TimeoutHelper.cs (1)
33Debug.Assert(originalWaitMillisecondsTimeout != Timeout.Infinite);
src\libraries\System.Private.CoreLib\src\System\Threading\Timer.cs (7)
405Debug.Assert(timer._short); 410Debug.Assert(!timer._short); 431Debug.Assert(ActiveCount >= 0); 582Debug.Assert(toSignal != null); 648Debug.Assert( 699Debug.Assert(toSignal is WaitHandle || toSignal is Task); 737Debug.Assert(state is TimerQueueTimer);
src\libraries\System.Private.CoreLib\src\System\Threading\TimerQueue.Portable.cs (2)
29Debug.Assert(s_scheduledTimers == null); 50Debug.Assert((int)actualDuration >= 0);
src\libraries\System.Private.CoreLib\src\System\Threading\WaitHandle.cs (9)
113Debug.Assert(millisecondsTimeout >= -1); 242Debug.Assert(waitHandles.Length > 0); 243Debug.Assert(waitHandles.Length <= MaxWaitHandles); 287Debug.Assert(lastSafeWaitHandle != null); 372Debug.Assert(safeWaitHandles.Length != 0); 373Debug.Assert(safeWaitHandles.Length <= MaxWaitHandles); 374Debug.Assert(millisecondsTimeout >= -1); 385Debug.Assert(safeWaitHandles[i] != null); 395Debug.Assert(safeWaitHandles[i] != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Win32ThreadPoolNativeOverlapped.cs (4)
109Debug.Assert(dataArray![dataIndex] == data); 117Debug.Assert(callback != null); 189Debug.Assert(!data._completed); 219Debug.Assert(state != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Win32ThreadPoolNativeOverlapped.OverlappedData.cs (1)
23Debug.Assert(_boundHandle == null); //not in use
src\libraries\System.Private.CoreLib\src\System\ThrowHelper.cs (1)
720Debug.Assert(array.Length - offset < count);
src\libraries\System.Private.CoreLib\src\System\TimeOnly.cs (4)
862Debug.Assert(result != ParseFailureKind.None); 869Debug.Assert(result == ParseFailureKind.Format_DateTimeOnlyContainsNoneDateParts); 930Debug.Assert(charsWritten == destination.Length); 937Debug.Assert(charsWritten == destination.Length);
src\libraries\System.Private.CoreLib\src\System\TimeSpan.cs (2)
314System.Diagnostics.Debug.Assert(minUnits < 0); 315System.Diagnostics.Debug.Assert(maxUnits > 0);
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.cs (3)
313Debug.Assert(_adjustmentRules != null); 2044Debug.Assert(zone != null); 2055Debug.Assert(Monitor.IsEntered(cachedData));
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.FullGlobalizationData.Unix.cs (1)
77Debug.Assert(!GlobalizationMode.Invariant);
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.cs (4)
281Debug.Assert(Monitor.IsEntered(cachedData)); 297Debug.Assert(Monitor.IsEntered(cachedData)); 908Debug.Assert(date[0] == 'J'); 939Debug.Assert(i > 0 && i < days.Length);
src\libraries\System.Private.CoreLib\src\System\UInt128.cs (13)
546Debug.Assert(value >= 0); 547Debug.Assert(double.IsFinite(value)); 548Debug.Assert(value < TwoPow128); 738Debug.Assert(destination.Length >= Size); 1117Debug.Assert(left.Length >= right.Length); 1137Debug.Assert(q <= 0xFFFFFFFF); 1191Debug.Assert(left.Length >= 1); 1192Debug.Assert(right.Length >= 1); 1193Debug.Assert(left.Length >= right.Length); 1257Debug.Assert(carry == (t + 1)); 1263Debug.Assert(carry == 1); 1287Debug.Assert(left.Length >= right.Length); 1288Debug.Assert(q <= 0xFFFFFFFF);
src\libraries\System.Private.CoreLib\src\System\Version.cs (3)
85Debug.Assert(version != null); 175Debug.Assert(success); 205Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
src\libraries\System.Private.CoreLib\src\System\WeakReference.cs (1)
223Debug.Assert(this.GetType() != typeof(WeakReference));
src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeNameParserHelpers.cs (2)
24Debug.Assert(genericArgs.Length > 0); 183Debug.Assert(rankOrModifier >= 2);
src\System\Array.CoreCLR.cs (11)
101Debug.Assert(sourceArray.Rank == destinationArray.Rank); 156Debug.Assert(!destTH.IsTypeDesc && destTH.AsMethodTable()->IsValueType); 157Debug.Assert(!RuntimeHelpers.GetMethodTable(sourceArray)->GetArrayElementTypeHandle().AsMethodTable()->IsValueType); 198Debug.Assert(!srcTH.IsTypeDesc && srcTH.AsMethodTable()->IsValueType); 199Debug.Assert(!RuntimeHelpers.GetMethodTable(destinationArray)->GetArrayElementTypeHandle().AsMethodTable()->IsValueType); 387Debug.Assert(destElType == CorElementType.ELEMENT_TYPE_R8); 426Debug.Assert(totalByteLength % (nuint)sizeof(IntPtr) == 0); 473Debug.Assert(Rank == 1); 489Debug.Assert(indices.Length == Rank); 503Debug.Assert((nuint)flattenedIndex < (nuint)LongLength); 528Debug.Assert((nuint)flattenedIndex < NativeLength);
src\System\Attribute.CoreCLR.cs (13)
18Debug.Assert(element != null); 19Debug.Assert(type != null); 20Debug.Assert(type.IsSubclassOf(typeof(Attribute)) || type == typeof(Attribute)); 88Debug.Assert(property != null); 122Debug.Assert(element != null); 123Debug.Assert(type != null); 124Debug.Assert(type.IsSubclassOf(typeof(Attribute)) || type == typeof(Attribute)); 162Debug.Assert(ev != null); 180Debug.Assert(element != null); 211Debug.Assert(param != null); 239Debug.Assert(param != null); 328Debug.Assert(param != null); 329Debug.Assert(type != null);
src\System\Collections\Generic\ComparerHelpers.cs (2)
30Debug.Assert(type != null && type is RuntimeType); 64Debug.Assert(type != null && type is RuntimeType);
src\System\Enum.CoreCLR.cs (5)
23Debug.Assert(rt.IsActualEnum); 72Debug.Assert(s_underlyingTypes[(int)CorElementType.ELEMENT_TYPE_U] == typeof(nuint)); 77Debug.Assert(underlyingType != null); 106Debug.Assert(values!.GetType() == typeof(TStorage[])); 107Debug.Assert(!getNames || names!.GetType() == typeof(string[]));
src\System\GC.CoreCLR.cs (7)
498Debug.Assert(status == StartNoGCRegionStatus.Succeeded); 689Debug.Assert(false); 702Debug.Assert(pWorkItem->scheduled); 829Debug.Assert(name != null); 830Debug.Assert(configurationContext != null); 833Debug.Assert(context.Configurations != null); 946Debug.Assert(status == RefreshMemoryStatus.Succeeded);
src\System\MulticastDelegate.CoreCLR.cs (4)
125Debug.Assert(d != null); 126Debug.Assert(_invocationList is object[]); 135Debug.Assert(invocationList[i] is Delegate); 297Debug.Assert(_invocationList is object[]);
src\System\Object.CoreCLR.cs (1)
25Debug.Assert(clone != this);
src\System\Reflection\Associates.cs (2)
48Debug.Assert(declaredType != null); 49Debug.Assert(reflectedType != null);
src\System\Reflection\Emit\DynamicILGenerator.cs (1)
753Debug.Assert(m_exceptions != null);
src\System\Reflection\Emit\DynamicMethod.CoreCLR.cs (2)
105Debug.Assert(_methodHandle != null); 106Debug.Assert(_parameterTypes != null);
src\System\Reflection\Emit\RuntimeAssemblyBuilder.cs (1)
94Debug.Assert(name is not null);
src\System\Reflection\Emit\RuntimeILGenerator.cs (11)
30Debug.Assert(incoming != null); 87Debug.Assert(methodBuilder != null); 88Debug.Assert(methodBuilder is MethodBuilder || methodBuilder is DynamicMethod); 158Debug.Assert(m_depthAdjustment >= 0); 159Debug.Assert(m_curDepth >= 0); 317Debug.Assert(depth >= -1); 318Debug.Assert(targetDepth >= -1); 332Debug.Assert(m_depthAdjustment >= 0); 362Debug.Assert(m_RelocFixupList == null); 1099Debug.Assert(depth >= -1); 1449Debug.Assert(exc != null);
src\System\Reflection\Emit\RuntimeMethodBuilder.cs (7)
867Debug.Assert(tryStartOffset >= 0); 868Debug.Assert(tryEndOffset >= 0); 869Debug.Assert(filterOffset >= 0); 870Debug.Assert(handlerStartOffset >= 0); 871Debug.Assert(handlerEndOffset >= 0); 872Debug.Assert(IsValidKind((ExceptionHandlingClauseOptions)kind)); 873Debug.Assert(kind != (int)ExceptionHandlingClauseOptions.Clause || (exceptionTypeToken & 0x00FFFFFF) != 0);
src\System\Reflection\Emit\RuntimeModuleBuilder.cs (7)
129Debug.Assert(method != null); 139Debug.Assert(method != null); 152Debug.Assert(runtimeField != null); 416Debug.Assert(methodBase is RuntimeMethodInfo || methodBase is RuntimeConstructorInfo); 420Debug.Assert(masmi != null); 460Debug.Assert(method is RuntimeMethodInfo || method is RuntimeConstructorInfo); 1073Debug.Assert(methodInfo != null);
src\System\Reflection\Emit\RuntimeTypeBuilder.cs (4)
47Debug.Assert(m_con != null); 360Debug.Assert(declMeth != null); 374Debug.Assert(declType != null); 1474Debug.Assert(m_isHiddenGlobalType || typeInfo != null);
src\System\Reflection\Emit\SignatureHelper.cs (6)
273Debug.Assert(clsArgument != null); 293Debug.Assert(!MetadataToken.IsNullToken(token)); 315Debug.Assert(!MetadataToken.IsNullToken(token)); 736Debug.Assert(clsArgument != null); 756Debug.Assert(!MetadataToken.IsNullToken(token)); 779Debug.Assert(!MetadataToken.IsNullToken(token));
src\System\Reflection\MdImport.cs (3)
194Debug.Assert(0 <= index && index < Length); 284Debug.Assert(marshalTypeName is not null); 363Debug.Assert(stringMetadataEncoding != null);
src\System\Reflection\RuntimeAssembly.cs (1)
743Debug.Assert((type != null) != (exception != null)); // Exactly one of these must be non-null.
src\System\Reflection\RuntimeConstructorInfo.CoreCLR.cs (2)
39Debug.Assert((flags & InvocationFlags.Initialized) == InvocationFlags.Initialized); 206Debug.Assert((InvocationFlags & InvocationFlags.RunClassConstructor) != 0);
src\System\Reflection\RuntimeCustomAttributeData.cs (64)
20Debug.Assert(target is not null); 30Debug.Assert(target is not null); 40Debug.Assert(target is not null); 50Debug.Assert(target is not null); 57Debug.Assert(target is not null); 64Debug.Assert(target is not null); 71Debug.Assert(target is not null); 81Debug.Assert(target is not null); 90Debug.Assert(target is not null); 100Debug.Assert(pseudoAttributes.Count != 0); 405Debug.Assert(allCtors.Length == 1); 406Debug.Assert(allCtors[0].GetParametersAsSpan().Length == 0); 476Debug.Assert(p.MemberInfo is not null); 547Debug.Assert(type is not null); 672Debug.Assert(customAttributeCtorParameters is not null); 673Debug.Assert(customAttributeNamedParameters is not null); 785Debug.Assert(namedArgType.EncodedEnumType == argType.EncodedEnumType); 936Debug.Assert(size <= (_blob.Length - _curr)); 1086Debug.Assert(parameterType is not null); 1124Debug.Assert(type is not null); 1153Debug.Assert(method is not null); 1154Debug.Assert(caType is not null); 1180Debug.Assert(ctor is not null); 1181Debug.Assert(caType is not null); 1190Debug.Assert(property is not null); 1191Debug.Assert(caType is not null); 1200Debug.Assert(e is not null); 1201Debug.Assert(caType is not null); 1210Debug.Assert(field is not null); 1211Debug.Assert(caType is not null); 1221Debug.Assert(parameter is not null); 1222Debug.Assert(caType is not null); 1232Debug.Assert(assembly is not null); 1233Debug.Assert(caType is not null); 1241Debug.Assert(module is not null); 1242Debug.Assert(caType is not null); 1251Debug.Assert(type is not null); 1252Debug.Assert(caType is not null); 1296Debug.Assert(method is not null); 1297Debug.Assert(caType is not null); 1338Debug.Assert(ctor != null); 1339Debug.Assert(caType != null); 1348Debug.Assert(property is not null); 1349Debug.Assert(caType is not null); 1358Debug.Assert(e is not null); 1359Debug.Assert(caType is not null); 1368Debug.Assert(field is not null); 1369Debug.Assert(caType is not null); 1380Debug.Assert(parameter is not null); 1381Debug.Assert(caType is not null); 1392Debug.Assert(assembly is not null); 1393Debug.Assert(caType is not null); 1403Debug.Assert(module is not null); 1404Debug.Assert(caType is not null); 1437Debug.Assert(attributeCtorToken == 0); 1456Debug.Assert(attributeFilterType is null); 2002Debug.Assert(type is not null); 2003Debug.Assert(caType is not null); 2046Debug.Assert(method is not null); 2047Debug.Assert(caType is not null); 2086Debug.Assert(parameter is not null); 2087Debug.Assert(caType is not null); 2142Debug.Assert(field is not null); 2143Debug.Assert(caType is not null);
src\System\Reflection\RuntimeEventInfo.cs (3)
30Debug.Assert(declaredType != null); 31Debug.Assert(reflectedTypeCache != null); 32Debug.Assert(!reflectedTypeCache.IsGlobal);
src\System\Reflection\RuntimeMethodInfo.CoreCLR.cs (3)
38Debug.Assert((flags & InvocationFlags.Initialized) == InvocationFlags.Initialized); 59Debug.Assert(!handle.IsNullHandle()); 60Debug.Assert(methodAttributes == RuntimeMethodHandle.GetAttributes(handle));
src\System\Reflection\RuntimeParameterInfo.cs (15)
16Debug.Assert(method is RuntimeMethodInfo || method is RuntimeConstructorInfo); 23Debug.Assert(method is RuntimeMethodInfo || method is RuntimeConstructorInfo); 35Debug.Assert(ReferenceEquals(methodHandle, member)); 130Debug.Assert(result != null); 164Debug.Assert(m_originalMember != null); 183Debug.Assert(member != null); 184Debug.Assert(MdToken.IsNullToken(tkParamDef) == scope.Equals((MetadataImport)default)); 185Debug.Assert(MdToken.IsNullToken(tkParamDef) || MdToken.IsTokenOfType(tkParamDef, MetadataTokenType.ParamDef)); 221Debug.Assert(m_signature != null); 229Debug.Assert(parameterType != null); 335Debug.Assert(!m_noMetadata); 376Debug.Assert(attr.Constructor.DeclaringType == typeof(DecimalConstantAttribute)); 378Debug.Assert(args.Count == 5); 397Debug.Assert(attr.Constructor.DeclaringType == typeof(DateTimeConstantAttribute)); 398Debug.Assert(attr.ConstructorArguments.Count == 1);
src\System\Reflection\RuntimePropertyInfo.cs (6)
34Debug.Assert(declaredType != null); 35Debug.Assert(reflectedTypeCache != null); 36Debug.Assert(!reflectedTypeCache.IsGlobal); 106Debug.Assert(Name.Equals(target.Name)); 107Debug.Assert(this != target); 108Debug.Assert(this.ReflectedType == target.ReflectedType);
src\System\Reflection\TypeNameResolver.CoreCLR.cs (1)
122Debug.Assert(type != null);
src\System\Runtime\CompilerServices\CastHelpers.cs (5)
171Debug.Assert(!((MethodTable*)toTypeHnd)->HasTypeEquivalence); 224Debug.Assert(result != CastResult.CannotCast); 396Debug.Assert(index >= 0); 413Debug.Assert(index >= 0); 455Debug.Assert(obj != null);
src\System\Runtime\CompilerServices\RuntimeHelpers.CoreCLR.cs (7)
283Debug.Assert(ObjectHasComponentSize(array)); 291Debug.Assert(GetMultiDimensionalArrayRank(array) > 0); 660Debug.Assert(HasComponentSize); 672Debug.Assert(HasComponentSize); 711Debug.Assert(HasComponentSize); 736Debug.Assert(HasCheckedCanCompareBitsOrUseFastGetHashCode); 782Debug.Assert(!IsTypeDesc);
src\System\RuntimeHandles.cs (2)
276Debug.Assert(rt != null); 884Debug.Assert(method != null);
src\System\RuntimeType.ActivatorCache.cs (2)
35Debug.Assert(rt != null); 95Debug.Assert(_ctorIsPublic); // implicit parameterless ctor is always considered public
src\System\RuntimeType.CoreCLR.cs (55)
76Debug.Assert(index < Count); 175Debug.Assert(retVal || RequiresStringComparison()); 568Debug.Assert(false); 583Debug.Assert(cachedMembers![freeSlotIndex] == null); 600Debug.Assert(declaringType != null); 615Debug.Assert(!methodHandle.IsNullHandle()); 620Debug.Assert( 671Debug.Assert(!methodHandle.IsNullHandle()); 677Debug.Assert( 709Debug.Assert( 726Debug.Assert((methodAttributes & (MethodAttributes.Virtual | MethodAttributes.Abstract)) == 0); 775Debug.Assert(!methodHandle.IsNullHandle()); 781Debug.Assert( 880Debug.Assert(declaringType != null); 881Debug.Assert(ReflectedType != null); 896Debug.Assert(!runtimeFieldHandle.IsNullHandle()); 926Debug.Assert(declaringType != null); 927Debug.Assert(ReflectedType != null); 943Debug.Assert(MdToken.IsTokenOfType(tkField, MetadataTokenType.FieldDef)); 944Debug.Assert(!MdToken.IsNullToken(tkField)); 1033Debug.Assert(interfaceType.IsInterface); 1140Debug.Assert(ReflectedType != null); 1188Debug.Assert(!MdToken.IsNullToken(tkEvent)); 1189Debug.Assert(MdToken.IsTokenOfType(tkEvent, MetadataTokenType.Event)); 1231Debug.Assert(ReflectedType != null); 1237Debug.Assert(declaringType != null); 1300Debug.Assert((declaringType.IsInterface && isInterface && csPropertyInfos == null) || 1307Debug.Assert(!MdToken.IsNullToken(tkProperty)); 1308Debug.Assert(MdToken.IsTokenOfType(tkProperty, MetadataTokenType.Property)); 1349Debug.Assert(associateMethod.IsVirtual); 1424Debug.Assert(listType == MemberListType.All); 1519Debug.Assert(m_runtimeType.IsFunctionPointer); 1524Debug.Assert(value.Length > 0); 1600Debug.Assert(enclosingType != typeof(void)); 1646Debug.Assert(m_runtimeType.IsGenericType); 1806Debug.Assert(!methodHandle.IsNullHandle()); 2045Debug.Assert(fullname.Equals(ns + "." + name)); 2133Debug.Assert(name != null); 2154Debug.Assert(memberInfo != null); 2155Debug.Assert(name is null || (bindingFlags & BindingFlags.IgnoreCase) == 0 || (name.ToLowerInvariant().Equals(name))); 2228Debug.Assert(type is not null); 2229Debug.Assert(type is RuntimeType); 2261Debug.Assert(methodBase != null); 2309Debug.Assert((callConv & CallingConventions.VarArgs) != 0); 2428Debug.Assert(cache == null || cache is RuntimeTypeCache); 2445Debug.Assert(cache is RuntimeTypeCache); 2474Debug.Assert(cache != null); 2710Debug.Assert(i == members.Length); 2730Debug.Assert(interfaceType.IsInterface); // VerifyInterfaceIsImplemented enforces this invariant 2731Debug.Assert(!IsInterface); // VerifyInterfaceIsImplemented enforces this invariant 2752Debug.Assert(ifaceMethodBase is RuntimeMethodInfo); 2769Debug.Assert(rtTypeMethodBase is null || rtTypeMethodBase is RuntimeMethodInfo); 3112Debug.Assert(i == compressMembers.Length); 3728Debug.Assert(parameters.Length > 0); 3856Debug.Assert((invokeMethod.CallingConvention & CallingConventions.VarArgs) ==
src\System\RuntimeType.CreateUninitializedCache.CoreCLR.cs (2)
27Debug.Assert(rt != null); 60Debug.Assert(rt != null);
src\System\StubHelpers.cs (3)
1548Debug.Assert(success); 1567Debug.Assert(success); 1586Debug.Assert(success);
src\System\Text\StringBuilder.CoreCLR.cs (1)
15Debug.Assert(requiredCapacity <= m_MaxCapacity);
src\System\Threading\LowLevelLifoSemaphore.Unix.cs (7)
20Debug.Assert(maximumSignalCount > 0); 26Debug.Assert(_semaphore != null); 27Debug.Assert(timeoutMs >= -1); 30Debug.Assert(waitResult == WaitHandle.WaitSuccess || waitResult == WaitHandle.WaitTimeout); 39Debug.Assert(_semaphore != null); 40Debug.Assert(count > 0); 47Debug.Assert(_semaphore != null);
src\System\Threading\Monitor.CoreCLR.cs (1)
48Debug.Assert(lockTaken);
src\System\Threading\Thread.CoreCLR.cs (3)
101Debug.Assert(startHelper != null); 366Debug.Assert(this == CurrentThread); 367Debug.Assert(IsThreadPoolThread);
src\System\Threading\ThreadPool.CoreCLR.cs (2)
47Debug.Assert(nextConfigVariableIndex > configVariableIndex); 50Debug.Assert(appContextConfigNameUnsafe != null);
src\System\TypedReference.CoreCLR.cs (1)
36Debug.Assert(pMethodTable is not null);
src\System\ValueType.cs (2)
138Debug.Assert(fieldSize != 0); 143Debug.Assert(fieldMT != null);
System.Private.CoreLib.Generators (5)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (5)
28Debug.Assert(value >= 0); 29Debug.Assert(value <= _span.Length); 38Debug.Assert(index < _pos); 106Debug.Assert(length >= 0); 134Debug.Assert(_pos == _span.Length);
System.Private.DataContractSerialization (328)
src\libraries\Common\src\System\HexConverter.cs (1)
165Debug.Assert(chars.Length >= bytes.Length * 2);
System\Runtime\Serialization\ClassDataContract.cs (6)
189Debug.Assert(UnderlyingType != Globals.TypeOfSchemaDefinedType); 219Debug.Assert(UnderlyingType != Globals.TypeOfSchemaDefinedType); 385Debug.Assert(context != null); 957Debug.Assert(Members != null); 1105Debug.Assert(method.DeclaringType != null); 1122Debug.Assert(method.DeclaringType != null);
System\Runtime\Serialization\CodeGenerator.cs (6)
25Debug.Assert(s_getTypeFromHandle != null); 39Debug.Assert(s_objectEquals != null); 53Debug.Assert(s_arraySetValue != null); 67Debug.Assert(s_objectToString != null); 81Debug.Assert(s_stringFormat != null); 91Debug.Assert(typeof(Delegate).IsAssignableFrom(delegateType));
System\Runtime\Serialization\CollectionDataContract.cs (8)
617Debug.Assert(KeyName != null); 618Debug.Assert(ValueName != null); 1159Debug.Assert(knownInterfaceType != null); 1169Debug.Assert(getEnumeratorMethod != null); 1230Debug.Assert(addMethodTypeArray != null); 1235Debug.Assert(getEnumeratorMethod != null); 1558Debug.Assert(context != null); 1569Debug.Assert(context != null);
System\Runtime\Serialization\DataContract.cs (3)
1025Debug.Assert(value != null); 1035Debug.Assert(value != null); 2424Debug.Assert(_paramGenericInfos != null);
System\Runtime\Serialization\EnumDataContract.cs (1)
112Debug.Assert(retVal != null); // Enums can only have certain base types. We shouldn't come up empty here.
System\Runtime\Serialization\ExtensionDataReader.cs (5)
537Debug.Assert(_element != null); 556Debug.Assert(_element != null); 575Debug.Assert(_element != null); 610Debug.Assert(dataNode.OwnerDocument != null); // OwnerDocument is always set on initialized dataNodes 659Debug.Assert(dataNode.Value != null);
System\Runtime\Serialization\Json\JsonClassDataContract.cs (1)
108Debug.Assert(context != null);
System\Runtime\Serialization\Json\JsonCollectionDataContract.cs (2)
131Debug.Assert(context != null); 153Debug.Assert(context != null);
System\Runtime\Serialization\Json\JsonDataContract.cs (2)
133Debug.Assert(context != null); 142Debug.Assert(context != null);
System\Runtime\Serialization\Json\JsonEncodingStreamWrapper.cs (6)
185Debug.Assert(_bytes != null); 186Debug.Assert(_chars != null); 261Debug.Assert(_bytes != null); 262Debug.Assert(_chars != null); 356Debug.Assert(_bytes != null); 420Debug.Assert(_bytes != null);
System\Runtime\Serialization\Json\JsonFormatGeneratorStatics.cs (33)
96Debug.Assert(s_boxPointer != null); 109Debug.Assert(s_collectionItemNameProperty != null); 129Debug.Assert(s_ienumeratorGetCurrentMethod != null); 142Debug.Assert(s_getItemContractMethod != null); 155Debug.Assert(s_getJsonDataContractMethod != null); 168Debug.Assert(s_getJsonMemberIndexMethod != null); 181Debug.Assert(s_getRevisedItemContractMethod != null); 194Debug.Assert(s_getUninitializedObjectMethod != null); 207Debug.Assert(s_isStartElementMethod0 != null); 219Debug.Assert(s_isStartElementMethod2 != null); 231Debug.Assert(s_localNameProperty != null); 243Debug.Assert(s_namespaceProperty != null); 255Debug.Assert(s_ienumeratorMoveNextMethod != null); 267Debug.Assert(s_moveToContentMethod != null); 279Debug.Assert(s_nodeTypeProperty != null); 291Debug.Assert(s_onDeserializationMethod != null); 305Debug.Assert(s_readJsonValueMethod != null); 317Debug.Assert(s_serializationExceptionCtor != null); 330Debug.Assert(s_throwDuplicateMemberExceptionMethod != null); 342Debug.Assert(s_throwMissingRequiredMembersMethod != null); 354Debug.Assert(s_typeHandleProperty != null); 366Debug.Assert(s_unboxPointer != null); 378Debug.Assert(s_useSimpleDictionaryFormatReadProperty != null); 390Debug.Assert(s_useSimpleDictionaryFormatWriteProperty != null); 402Debug.Assert(s_writeAttributeStringMethod != null); 414Debug.Assert(s_writeEndElementMethod != null); 427Debug.Assert(s_writeJsonISerializableMethod != null); 439Debug.Assert(s_writeJsonNameWithMappingMethod != null); 452Debug.Assert(s_writeJsonValueMethod != null); 464Debug.Assert(s_writeStartElementMethod != null); 477Debug.Assert(s_writeStartElementStringMethod != null); 490Debug.Assert(s_parseEnumMethod != null); 503Debug.Assert(s_getJsonMemberNameMethod != null);
System\Runtime\Serialization\Json\JsonFormatReaderGenerator.cs (3)
685Debug.Assert(growingCollection != null); 1010Debug.Assert(collectionContract.AddMethod != null); 1020Debug.Assert(collectionContract.AddMethod != null);
System\Runtime\Serialization\Json\JsonFormatWriterGenerator.cs (3)
339Debug.Assert(collectionContract.GetEnumeratorMethod != null); 426Debug.Assert(keyValueTypes != null); 437Debug.Assert(keyValueTypes != null);
System\Runtime\Serialization\Json\ReflectionJsonFormatReader.cs (7)
25Debug.Assert(classDataContract != null); 34Debug.Assert(_classContract != null); 65Debug.Assert(jsonContext != null); 120Debug.Assert(jsonContext != null); 121Debug.Assert(collectionContract.Kind == CollectionKind.Dictionary || collectionContract.Kind == CollectionKind.GenericDictionary); 133Debug.Assert(jsonContext != null); 240Debug.Assert(dictionary != null);
System\Runtime\Serialization\Json\ReflectionJsonFormatWriter.cs (1)
204Debug.Assert(memberNames != null);
System\Runtime\Serialization\Json\XmlJsonReader.cs (1)
418Debug.Assert(_charactersToSkipOnNextRead != null);
System\Runtime\Serialization\ReflectionClassWriter.cs (1)
53Debug.Assert(memberValue != null);
System\Runtime\Serialization\ReflectionReader.cs (4)
37Debug.Assert(context != null); 49Debug.Assert(memberNames != null); 229Debug.Assert(dataMember != null); 241Debug.Assert(memberInfo != null);
System\Runtime\Serialization\ReflectionXmlFormatReader.cs (3)
25Debug.Assert(classDataContract != null); 63Debug.Assert(memberNamespaces != null); 126Debug.Assert(collectionContract.Kind == CollectionKind.Dictionary || collectionContract.Kind == CollectionKind.GenericDictionary);
System\Runtime\Serialization\SchemaExporter.cs (1)
309Debug.Assert(genericArgumentCounts != null);
System\Runtime\Serialization\SchemaImporter.cs (6)
484Debug.Assert(dataContract != null); // Throws above if false 664Debug.Assert(dataContract.BaseClassContract != null); // ImportBaseContract will always set this... or throw. 836Debug.Assert(dataContract.BaseClassContract != null); // ImportBaseContract will always set this... or throw. 997Debug.Assert(dataContract.Members != null); // This method is only called from ImportClass() after that method has initialized the Members collection. 998Debug.Assert(memberName != null); // At this point, elements without a name should have been handled. 1060Debug.Assert(element.Name != null);
System\Runtime\Serialization\XmlFormatGeneratorStatics.cs (74)
23Debug.Assert(s_writeStartElementMethod2 != null); 37Debug.Assert(s_writeStartElementMethod3 != null); 51Debug.Assert(s_writeEndElementMethod != null); 65Debug.Assert(s_writeNamespaceDeclMethod != null); 85Debug.Assert(s_dictionaryEnumeratorCtor != null); 99Debug.Assert(s_ienumeratorMoveNextMethod != null); 113Debug.Assert(s_ienumeratorGetCurrentMethod != null); 128Debug.Assert(s_getItemContractMethod != null); 142Debug.Assert(s_isStartElementMethod2 != null); 156Debug.Assert(s_isStartElementMethod0 != null); 171Debug.Assert(s_getUninitializedObjectMethod != null); 185Debug.Assert(s_onDeserializationMethod != null); 202Debug.Assert(s_nodeTypeProperty != null); 224Debug.Assert(s_hashtableCtor != null); 238Debug.Assert(s_getStreamingContextMethod != null); 252Debug.Assert(s_getCollectionMemberMethod != null); 266Debug.Assert(s_storeCollectionMemberInfoMethod != null); 280Debug.Assert(s_resetCollectionMemberInfoMethod != null); 294Debug.Assert(s_storeIsGetOnlyCollectionMethod != null); 308Debug.Assert(s_resetIsGetOnlyCollection != null); 322Debug.Assert(s_throwNullValueReturnedForGetOnlyCollectionExceptionMethod != null); 336Debug.Assert(s_throwArrayExceededSizeExceptionMethod != null); 350Debug.Assert(s_incrementItemCountMethod != null); 365Debug.Assert(s_internalDeserializeMethod != null); 379Debug.Assert(s_moveToNextElementMethod != null); 394Debug.Assert(s_getMemberIndexMethod != null); 409Debug.Assert(s_getMemberIndexWithRequiredMembersMethod != null); 423Debug.Assert(s_throwRequiredMemberMissingExceptionMethod != null); 437Debug.Assert(s_skipUnknownElementMethod != null); 452Debug.Assert(s_readIfNullOrRefMethod != null); 466Debug.Assert(s_readAttributesMethod != null); 480Debug.Assert(s_resetAttributesMethod != null); 494Debug.Assert(s_getObjectIdMethod != null); 508Debug.Assert(s_getArraySizeMethod != null); 522Debug.Assert(s_addNewObjectMethod != null); 536Debug.Assert(s_addNewObjectWithIdMethod != null); 550Debug.Assert(s_replaceDeserializedObjectMethod != null); 565Debug.Assert(s_getExistingObjectMethod != null); 579Debug.Assert(s_getRealObjectMethod != null); 593Debug.Assert(s_ensureArraySizeMethod != null); 607Debug.Assert(s_trimArraySizeMethod != null); 621Debug.Assert(s_checkEndOfArrayMethod != null); 635Debug.Assert(s_getArrayLengthMethod != null); 650Debug.Assert(s_readSerializationInfoMethod != null); 664Debug.Assert(s_createUnexpectedStateExceptionMethod != null); 679Debug.Assert(s_internalSerializeReferenceMethod != null); 694Debug.Assert(s_internalSerializeMethod != null); 709Debug.Assert(s_writeNullMethod != null); 723Debug.Assert(s_incrementArrayCountMethod != null); 737Debug.Assert(s_incrementCollectionCountMethod != null); 751Debug.Assert(s_incrementCollectionCountGenericMethod != null); 765Debug.Assert(s_getDefaultValueMethod != null); 787Debug.Assert(s_getNullableValueMethod != null); 801Debug.Assert(s_throwRequiredMemberMustBeEmittedMethod != null); 815Debug.Assert(s_getHasValueMethod != null); 830Debug.Assert(s_writeISerializableMethod != null); 852Debug.Assert(s_writeXmlValueMethod != null); 867Debug.Assert(s_readXmlValueMethod != null); 881Debug.Assert(s_namespaceProperty != null); 895Debug.Assert(s_contractNamespacesField != null); 909Debug.Assert(s_memberNamesField != null); 927Debug.Assert(s_childElementNamespacesProperty != null); 941Debug.Assert(s_collectionItemNameProperty != null); 956Debug.Assert(s_childElementNamespaceProperty != null); 970Debug.Assert(s_getDateTimeOffsetMethod != null); 984Debug.Assert(s_getDateTimeOffsetAdapterMethod != null); 998Debug.Assert(s_getMemoryStreamMethod != null); 1012Debug.Assert(s_getMemoryStreamAdapterMethod != null); 1026Debug.Assert(s_getTypeHandleMethod != null); 1040Debug.Assert(s_getTypeMethod != null); 1054Debug.Assert(s_throwInvalidDataContractExceptionMethod != null); 1068Debug.Assert(s_serializeReadOnlyTypesProperty != null); 1082Debug.Assert(s_classSerializationExceptionMessageProperty != null); 1096Debug.Assert(s_collectionSerializationExceptionMessageProperty != null);
System\Runtime\Serialization\XmlFormatReaderGenerator.cs (12)
292Debug.Assert(_objectLocal != null); 293Debug.Assert(_objectType != null); 309Debug.Assert(_objectLocal != null); 310Debug.Assert(_objectType != null); 331Debug.Assert(_objectLocal != null); 417Debug.Assert(_objectLocal != null); 418Debug.Assert(_objectType != null); 490Debug.Assert(_objectLocal != null); 491Debug.Assert(_objectType != null); 715Debug.Assert(growingCollection != null); 841Debug.Assert(_objectLocal != null); 915Debug.Assert(collectionContract.AddMethod != null);
System\Runtime\Serialization\XmlFormatWriterGenerator.cs (1)
418Debug.Assert(collectionContract.GetEnumeratorMethod != null);
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (10)
153Debug.Assert(attributes != null); 296Debug.Assert(attributes != null); 327Debug.Assert(attributes != null); 339Debug.Assert(attributes != null); 592Debug.Assert(attributes != null); 713Debug.Assert(attributes != null); 767Debug.Assert(attributes != null); 809Debug.Assert(attributes != null); 866Debug.Assert(attributes != null); 1099Debug.Assert(attributes != null);
System\Runtime\Serialization\XmlObjectSerializerReadContextComplex.cs (2)
63Debug.Assert(_serializationSurrogateProvider != null); 123Debug.Assert(attributes != null);
System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (2)
146Debug.Assert(rootTypeDataContract != null); 602Debug.Assert(DataContractResolver != null);
System\Text\Base64Encoding.cs (5)
73Debug.Assert(pch + 4 <= pchMax); 133Debug.Assert(pch + 4 <= pchMax); 206Debug.Assert(pch + 4 <= pchMax); 331Debug.Assert(pb - pbMax == 3); 416Debug.Assert(pb - pbMax == 3);
System\Xml\EncodingStreamWrapper.cs (5)
596Debug.Assert(_bytes != null); 597Debug.Assert(_chars != null); 633Debug.Assert(_bytes != null); 695Debug.Assert(_bytes != null); 696Debug.Assert(_chars != null);
System\Xml\PrefixHandle.cs (4)
37Debug.Assert(type != PrefixHandleType.Buffer); 121Debug.Assert(type != PrefixHandleType.Buffer); 127Debug.Assert(index >= 0 && index < 26); 133Debug.Assert(type != PrefixHandleType.Buffer);
System\Xml\StringHandle.cs (7)
103Debug.Assert(_type == StringHandleType.UTF8); 160Debug.Assert(type == StringHandleType.EscapedUTF8); 197Debug.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString); 208Debug.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString); 219Debug.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString); 230Debug.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString); 243Debug.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString);
System\Xml\ValueHandle.cs (19)
511Debug.Assert(bytes != null); 542Debug.Assert(str[i] < 128); 844Debug.Assert(_type == ValueHandleType.UTF8); 852Debug.Assert(_type == ValueHandleType.Unicode); 858Debug.Assert(_type == ValueHandleType.EscapedUTF8); 876Debug.Assert(_type == ValueHandleType.Char); 882Debug.Assert(_type == ValueHandleType.Int8); 888Debug.Assert(_type == ValueHandleType.Int16); 894Debug.Assert(_type == ValueHandleType.Int32); 900Debug.Assert(_type == ValueHandleType.Int64 || _type == ValueHandleType.TimeSpan || _type == ValueHandleType.DateTime); 906Debug.Assert(_type == ValueHandleType.UInt64); 912Debug.Assert(_type == ValueHandleType.Single); 918Debug.Assert(_type == ValueHandleType.Double); 924Debug.Assert(_type == ValueHandleType.Decimal); 930Debug.Assert(_type == ValueHandleType.UniqueId); 936Debug.Assert(_type == ValueHandleType.Guid); 942Debug.Assert(_type == ValueHandleType.Base64); 948Debug.Assert(_type == ValueHandleType.Dictionary); 954Debug.Assert(_type == ValueHandleType.QName);
System\Xml\XmlBaseReader.cs (23)
661Debug.Assert(qnameType == QNameType.Xmlns); 749Debug.Assert(qnameType == QNameType.Xmlns); 892Debug.Assert(qnameType == QNameType.Xmlns); 1068Debug.Assert(qnameType == QNameType.Xmlns); 1109Debug.Assert(qnameType == QNameType.Xmlns); 1423Debug.Assert(_trailBytes != null); 1930Debug.Assert(qnameType == QNameType.Xmlns); 2104public StringHandle LocalName { get { Debug.Assert(_qnameType != QNameType.Xmlns); return _localName; } } 2105public PrefixHandle Prefix { get { Debug.Assert(_qnameType != QNameType.Xmlns); return _prefix; } } 2110public ValueHandle Value { get { Debug.Assert(_qnameType != QNameType.Xmlns); return _value; } } 2206Debug.Assert(_qnameType == QNameType.Xmlns); 2219Debug.Assert(_qnameType == QNameType.Xmlns); 2232Debug.Assert(_qnameType == QNameType.Xmlns); 2245Debug.Assert(_qnameType == QNameType.Xmlns); 2258Debug.Assert(_qnameType == QNameType.Xmlns); 2271Debug.Assert(_qnameType == QNameType.Xmlns); 2284Debug.Assert(_qnameType == QNameType.Xmlns); 2297Debug.Assert(_qnameType == QNameType.Xmlns); 2311Debug.Assert(_qnameType == QNameType.Xmlns); 2325Debug.Assert(_qnameType == QNameType.Xmlns); 2340Debug.Assert(_qnameType == QNameType.Xmlns); 2681Debug.Assert(qnameType == QNameType.Xmlns); 3067Debug.Assert(s != null);
System\Xml\XmlBaseWriter.cs (3)
1745Debug.Assert(_trailBytes != null); 1761Debug.Assert(_trailBytes != null); 2373Debug.Assert(nsCount >= 1 && _namespaces![0].Prefix!.Length == 0 && _namespaces[0].Uri!.Length == 0);
System\Xml\XmlBinaryReader.cs (1)
415Debug.Assert(_arrayState == ArrayState.Element);
System\Xml\XmlBinaryWriter.cs (12)
87Debug.Assert(nodeType == XmlBinaryNodeType.Chars8Text || nodeType == XmlBinaryNodeType.Bytes8Text || nodeType == XmlBinaryNodeType.UnicodeChars8Text); 228Debug.Assert(nodeType >= XmlBinaryNodeType.MinText && nodeType <= XmlBinaryNodeType.MaxText && ((byte)nodeType & 1) == 0); 357Debug.Assert(t.Dictionary == _dictionary); 406Debug.Assert(length < 128); 630Debug.Assert(charCount > 0); 666Debug.Assert(length <= byte.MaxValue); 779Debug.Assert(intsWritten == 4); 826Debug.Assert(!_inList); 837Debug.Assert(_inList); 962Debug.Assert(intsWritten == 4); 1066Debug.Assert(result); 1136Debug.Assert(result);
System\Xml\XmlBufferReader.cs (19)
193Debug.Assert(_offsetMax < _windowOffsetMax); 214Debug.Assert(_offset <= int.MaxValue - count); 225Debug.Assert(newOffsetMax <= _windowOffsetMax); 235Debug.Assert(needed > 0); 248Debug.Assert(_offset + count <= _offsetMax); 254Debug.Assert(_stream != null); 295Debug.Assert(value >= _offsetMin && value <= _offsetMax); 302Debug.Assert(count >= 0); 706Debug.Assert(buffer[offset + 0] == '&'); 707Debug.Assert(buffer[offset + 1] == '#'); 708Debug.Assert(buffer[offset + length - 1] == ';'); 725Debug.Assert(buffer[offset + 0] == '&'); 726Debug.Assert(buffer[offset + 1] == '#'); 727Debug.Assert(buffer[offset + 2] == 'x'); 728Debug.Assert(buffer[offset + length - 1] == ';'); 736Debug.Assert(digit >= 0 && digit < 16); 749Debug.Assert(buffer[offset] == '&'); 750Debug.Assert(buffer[offset + length - 1] == ';'); 1025Debug.Assert(nodeType != XmlBinaryNodeType.StartListText);
System\Xml\XmlCanonicalWriter.cs (3)
279Debug.Assert(_xmlnsBuffer != null); 623Debug.Assert(_xmlnsBuffer != null); 783Debug.Assert(attribute.nsOffset == 0 && attribute.nsLength == 0);
System\Xml\XmlConverter.cs (6)
706Debug.Assert(value >= int.MinValue && value <= int.MaxValue); 788Debug.Assert(s[i] < 128); 1004Debug.Assert(value >= 0 && value < 100); 1021Debug.Assert(value >= 0 && value < 10000); 1029Debug.Assert(value >= 0 && value < 10000000); 1142Debug.Assert(count == chars.Length);
System\Xml\XmlDictionaryAsyncCheckWriter.cs (1)
22Debug.Assert(writer is IXmlTextWriterInitializer);
System\Xml\XmlSigningNodeWriter.cs (5)
85Debug.Assert(prefix != null); 99Debug.Assert(prefix != null); 112Debug.Assert(prefix != null); 119Debug.Assert(prefix != null); 133Debug.Assert(prefix != null);
System\Xml\XmlStreamNodeWriter.cs (9)
69Debug.Assert(count >= 0 && count <= bufferLength); 81Debug.Assert(offset + count <= bufferLength); 93Debug.Assert(count >= 0 && count <= bufferLength); 105Debug.Assert(offset + count <= bufferLength); 116Debug.Assert(_offset + count <= bufferLength); 155Debug.Assert(ch < 0x80); 161Debug.Assert(ch < 0x80); 202Debug.Assert(ch1 < 0x80 && ch2 < 0x80); 208Debug.Assert(ch1 < 0x80 && ch2 < 0x80);
System\Xml\XmlUTF8TextReader.cs (1)
1088Debug.Assert(BufferReader.GetByte() == '&');
System.Private.Uri (81)
src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (7)
25Debug.Assert(capacity >= 0); 54Debug.Assert(index >= 0 && index < _count); 78Debug.Assert(_count > 0); 87Debug.Assert(_count > 0); 104Debug.Assert(_array != null); // Nonzero _count should imply this 134Debug.Assert(_count < Capacity); 141Debug.Assert(minimum > Capacity);
src\libraries\Common\src\System\HexConverter.cs (1)
165Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (1)
114Debug.Assert(start < end);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
System\DomainNameHelper.cs (3)
75Debug.Assert(index == -1 || char.IsAsciiLetterUpper(str[start + index])); 212Debug.Assert(ReferenceEquals(hostname, UriHelper.StripBidiControlCharacters(hostname, hostname))); 269Debug.Assert(charsWritten == label.Length);
System\IPv6AddressHelper.cs (5)
38Debug.Assert(success); 43Debug.Assert(success); 48Debug.Assert(success); 53Debug.Assert(success); 82Debug.Assert(success);
System\IriHelper.cs (2)
32Debug.Assert(char.IsHighSurrogate(highSurr)); 134Debug.Assert(charactersRead > 0);
System\PercentEncodingHelper.cs (14)
18Debug.Assert(length >= 3); 19Debug.Assert(input[0] == '%'); 20Debug.Assert(UriHelper.DecodeHexChars(input[1], input[2]) != Uri.c_DummyChar); 21Debug.Assert(UriHelper.DecodeHexChars(input[1], input[2]) >= 128); 61Debug.Assert(value >= 128); 80Debug.Assert(totalCharsConsumed % 3 == 0); 81Debug.Assert(bytesLeftInBuffer == 2 || bytesLeftInBuffer == 3 || bytesLeftInBuffer == 4); 82Debug.Assert((fourByteBuffer & (BitConverter.IsLittleEndian ? 0x00000080 : 0x80000000)) != 0); 83Debug.Assert((fourByteBuffer & (BitConverter.IsLittleEndian ? 0x00008000 : 0x00800000)) != 0); 84Debug.Assert(bytesLeftInBuffer < 3 || (fourByteBuffer & (BitConverter.IsLittleEndian ? 0x00800000 : 0x00008000)) != 0); 85Debug.Assert(bytesLeftInBuffer < 4 || (fourByteBuffer & (BitConverter.IsLittleEndian ? 0x80000000 : 0x00000080)) != 0); 116Debug.Assert(bytesLeftInBuffer < 4); 121Debug.Assert(bytesLeftInBuffer == 2 || bytesLeftInBuffer == 3); 164Debug.Assert(bytesLeftInBuffer == 0 || bytesLeftInBuffer == 1);
System\Uri.cs (23)
147Debug.Assert((_flags & Flags.Debug_LeftConstructor) == 0); 201Debug.Assert(_syntax != null); 206Debug.Assert(sizeof(Flags) == sizeof(ulong)); 326Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 713Debug.Assert(IsAbsoluteUri); 964Debug.Assert(_info != null); 965Debug.Assert(_info.Host != null); 1901Debug.Assert((flags & Flags.Debug_LeftConstructor) == 0); 1926Debug.Assert((err is ParsingError.None) == (syntax is not null)); 1944Debug.Assert(_syntax != null && !_syntax.IsSimple); 1945Debug.Assert((_flags & Flags.CustomParser_ParseMinimalAlreadyCalled) != 0); 1971Debug.Assert(_syntax != null); 1982Debug.Assert(ReferenceEquals(_string, OriginalString)); 2393Debug.Assert(sizeof(Flags) == sizeof(ulong)); 2658Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 2697Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 2895Debug.Assert(success); 3361Debug.Assert(_syntax.InFact(UriSyntaxFlags.MayHaveFragment)); 3613Debug.Assert(err == ParsingError.None); 3614Debug.Assert((flags & Flags.Debug_LeftConstructor) == 0); 3712Debug.Assert(error == ParsingError.None); 3782Debug.Assert((_flags & Flags.Debug_LeftConstructor) == 0 || (!_syntax.IsSimple && Monitor.IsEntered(_info))); 3792Debug.Assert((_flags & Flags.HasUserInfo) == 0 && (_flags & Flags.HostTypeMask) == 0);
System\UriBuilder.cs (3)
247Debug.Assert(_uri is not null); 280Debug.Assert(_uri is not null); 363Debug.Assert(success);
System\UriExt.cs (5)
30Debug.Assert(_originalUnicodeString is null && _info is null && _syntax is null && _flags == Flags.Zero); 577Debug.Assert(backingString is null || backingString.Length == charsToUnescape.Length); 648Debug.Assert(newLength <= charsToUnescape.Length); 663Debug.Assert(vsb.RawChars.Overlaps(destination)); 764Debug.Assert(syntax != null);
System\UriHelper.cs (10)
19Debug.Assert(charsWritten == buffer.Length); 157Debug.Assert(newLength > charsToEscape.Length); 172Debug.Assert(vsb.RawChars.Overlaps(destination)); 194Debug.Assert(backingString is null || backingString.Length == charsToEscape.Length); 256Debug.Assert(stringToEscape.EnumerateRunes() is { } e && e.MoveNext() && e.Current == r); 257Debug.Assert(charsConsumed is 1 or 2); 299Debug.Assert(charsToCopy > 0); 502Debug.Assert(charactersRead > 0); 598Debug.Assert(backingString is null || strToClean.Length == backingString.Length); 633Debug.Assert(buffer.Length == destIndex);
System\UriScheme.cs (1)
77Debug.Assert(sizeof(Uri.Flags) == sizeof(ulong));
System\UriSyntax.cs (1)
271Debug.Assert(sizeof(Uri.Flags) == sizeof(ulong));
System.Private.Xml (2409)
src\libraries\Common\src\System\HexConverter.cs (1)
165Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
System\Xml\Base64Decoder.cs (5)
86Debug.Assert(buffer != null); 87Debug.Assert(count >= 0); 88Debug.Assert(index >= 0); 89Debug.Assert(buffer.Length - index >= count); 90Debug.Assert((buffer as byte[]) != null);
System\Xml\BinaryXml\SqlUtils.cs (5)
85Debug.Assert(rgulU.Length == s_cNumeMax); 136Debug.Assert(uiDigit < 10); 323Debug.Assert(val >= 0 && val < 100); 329Debug.Assert(val > -10000 && val < 10000); 341Debug.Assert(val >= 0 && val < 1000);
System\Xml\BinaryXml\XmlBinaryReader.cs (33)
356Debug.Assert(len >= 2 && (data[0] == 0xdf && data[1] == 0xff)); 457Debug.Assert(_textXmlReader != null); 496Debug.Assert(_textXmlReader != null); 525Debug.Assert(_textXmlReader != null); 585Debug.Assert(_textXmlReader != null); 607Debug.Assert(_textXmlReader != null); 638Debug.Assert(_textXmlReader != null); 651Debug.Assert(_textXmlReader != null); 670Debug.Assert(_textXmlReader != null); 686Debug.Assert(_textXmlReader != null); 701Debug.Assert(_textXmlReader != null); 723Debug.Assert(_textXmlReader != null); 742Debug.Assert(_textXmlReader != null); 758Debug.Assert(_textXmlReader != null); 785Debug.Assert(_textXmlReader != null); 817Debug.Assert(_textXmlReader != null); 866Debug.Assert(_textXmlReader != null); 904Debug.Assert(_textXmlReader != null); 911Debug.Assert(decl != null); 943Debug.Assert(_textXmlReader != null); 1810Debug.Assert(_textXmlReader != null); 1850Debug.Assert(_textXmlReader != null); 2025Debug.Assert((_attributes[i].contentPos >= 0) && (_attributes[i].contentPos <= (end))); 2032Debug.Assert(_attrCount == 0); 2049Debug.Assert((_pos + require) >= _end); 2089Debug.Assert(0 != (b & 0x80)); 2322Debug.Assert(pos >= 0 && cch >= 0); 2950Debug.Assert(_mark < 0); 3075Debug.Assert(_pos >= 3); 3080Debug.Assert(_pos >= 1); 3086Debug.Assert(_pos >= 2); 3182Debug.Assert(_prevNameInfo != null); 3234Debug.Assert(_textXmlReader != null);
System\Xml\BinHexDecoder.cs (5)
90Debug.Assert(buffer != null); 91Debug.Assert(count >= 0); 92Debug.Assert(index >= 0); 93Debug.Assert(buffer.Length - index >= count); 94Debug.Assert((buffer as byte[]) != null);
System\Xml\Cache\XPathDocumentBuilder.cs (24)
153Debug.Assert(prefix != null && localName != null && ns != null && localName.Length != 0 && baseUri != null); 214Debug.Assert(_pageParent != null && _pageParent[_idxParent].NodeType == XPathNodeType.Element); 288Debug.Assert(namespaceName != null); 289Debug.Assert(prefix != null && !prefix.Equals("xmlns")); 290Debug.Assert(_idxParent == 0 || (_pageParent != null && _pageParent[_idxParent].NodeType == XPathNodeType.Element)); 291Debug.Assert(_idxSibling == 0 || (_pageSibling != null && _pageSibling[_idxSibling].NodeType == XPathNodeType.Attribute)); 308Debug.Assert(_pageSibling != null); 309Debug.Assert(_pageSibling[_idxSibling].NodeType == XPathNodeType.Attribute); 322Debug.Assert(id != null); 482Debug.Assert(_pageParent != null && _pageParent[_idxParent].NodeType == XPathNodeType.Element); 494Debug.Assert(_idxSibling == 0 || (_pageSibling != null && _pageSibling[_idxSibling].NodeType == XPathNodeType.Attribute)); 495Debug.Assert(!prefix.Equals("xmlns") && !namespaceName.Equals(XmlReservedNs.NsXmlNs)); 496Debug.Assert(_idxParent == 0 || _idxNmsp != 0); 497Debug.Assert(_idxParent == 0 || (_pageParent != null && _pageParent[_idxParent].NodeType == XPathNodeType.Element)); 530Debug.Assert(pageOrig != null); 569Debug.Assert(_pageParent != null); 632Debug.Assert(pageElem == null || pageElem[idxElem].NodeType == XPathNodeType.Element); 662Debug.Assert(xptyp != XPathNodeType.Namespace); 734Debug.Assert(xptyp != XPathNodeType.Root && xptyp != XPathNodeType.Namespace); 744Debug.Assert(_pageParent != null); 751Debug.Assert(_idxParent + 1 == idxNew || idxNew == 1); 755Debug.Assert(_pageSibling != null); 903Debug.Assert((int)XPathNodeType.Text < (int)XPathNodeType.SignificantWhitespace); 904Debug.Assert((int)XPathNodeType.SignificantWhitespace < (int)XPathNodeType.Whitespace);
System\Xml\Cache\XPathDocumentNavigator.cs (16)
36Debug.Assert(pageCurrent != null && idxCurrent != 0); 37Debug.Assert((pageParent == null) == (idxParent == 0)); 97Debug.Assert(_pageCurrent[_idxCurrent].NodeType == XPathNodeType.Text); 100Debug.Assert(value != null); 120Debug.Assert(page[idx].NodeType == XPathNodeType.Element || page[idx].IsText); 122Debug.Assert(value != null); 373Debug.Assert(page != null); 434Debug.Assert(_pageCurrent != null); 454Debug.Assert(_pageParent != null); 494Debug.Assert(page != null); 496Debug.Assert(page[idx].NodeType == XPathNodeType.Element); 584Debug.Assert(_pageCurrent != null); 663Debug.Assert(_pageCurrent != null); 695Debug.Assert(page[idx].HasCollapsedText); 697Debug.Assert(_pageCurrent != null); 704Debug.Assert(page[idx].IsText);
System\Xml\Cache\XPathNode.cs (4)
173Debug.Assert(pageNode != null); 361Debug.Assert(info != null && idxParent <= ushort.MaxValue); 400Debug.Assert(NodeType == XPathNodeType.Element); 411Debug.Assert(NodeType == XPathNodeType.Element);
System\Xml\Cache\XPathNodeHelper.cs (13)
26Debug.Assert(pageElem[idxElem].NodeType == XPathNodeType.Element); 75Debug.Assert(pageNode[idxNode].NodeType == XPathNodeType.Attribute); 119Debug.Assert(idx != 0); 120Debug.Assert(page != null); 180Debug.Assert(idxNode <= ushort.MaxValue); 181Debug.Assert(pageNode[0].PageInfo!.PageNumber <= short.MaxValue); 200Debug.Assert(idx != 0); 312Debug.Assert(typ != XPathNodeType.Attribute && typ != XPathNodeType.Namespace); 332Debug.Assert(pageNode[idxNode].NodeType != XPathNodeType.Attribute); 348Debug.Assert(pagePrec != null); 369Debug.Assert(idxAnc != 0 && pageAnc != null); 454Debug.Assert(page != null); 669Debug.Assert(pageNode != null);
System\Xml\Cache\XPathNodeInfoAtom.cs (6)
123Debug.Assert(localName != null && namespaceUri != null && prefix != null && doc != null); 291Debug.Assert(other != null); 292Debug.Assert((object?)_doc == (object?)other._doc); 293Debug.Assert(_pageInfo == null); 326Debug.Assert(_localName != null); 333Debug.Assert(_prefix != null);
System\Xml\Core\CharEntityEncoderFallback.cs (3)
35Debug.Assert(_textContentMarks != null); 128Debug.Assert(_charEntityIndex < _charEntity.Length); 141Debug.Assert(_charEntityIndex <= _charEntity.Length);
System\Xml\Core\HtmlEncodedRawTextWriter.cs (21)
50Debug.Assert(name != null && name.Length > 0); 97Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 103Debug.Assert(prefix.Length == 0); 143Debug.Assert(prefix.Length == 0); 168Debug.Assert(prefix.Length == 0); 288Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 292Debug.Assert(prefix.Length == 0); 356Debug.Assert(!string.IsNullOrEmpty(target) && text != null); 378Debug.Assert(text != null); 413Debug.Assert(buffer != null); 414Debug.Assert(index >= 0); 415Debug.Assert(count >= 0 && index + count <= buffer.Length); 440Debug.Assert((int)ElementProperties.URI_PARENT == (int)AttributeProperties.URI); 441Debug.Assert((int)ElementProperties.BOOL_PARENT == (int)AttributeProperties.BOOLEAN); 442Debug.Assert((int)ElementProperties.NAME_PARENT == (int)AttributeProperties.NAME); 564Debug.Assert(pSrc <= pSrcEnd); 652Debug.Assert(pSrc <= pSrcEnd); 702Debug.Assert(_uriEscapingBuffer?.Length > 0); 816Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 824Debug.Assert(prefix.Length == 0); 880Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null);
System\Xml\Core\HtmlUtf8RawTextWriter.cs (21)
45Debug.Assert(name != null && name.Length > 0); 90Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 96Debug.Assert(prefix.Length == 0); 134Debug.Assert(prefix.Length == 0); 157Debug.Assert(prefix.Length == 0); 275Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 279Debug.Assert(prefix.Length == 0); 339Debug.Assert(!string.IsNullOrEmpty(target) && text != null); 359Debug.Assert(text != null); 392Debug.Assert(buffer != null); 393Debug.Assert(index >= 0); 394Debug.Assert(count >= 0 && index + count <= buffer.Length); 417Debug.Assert((int)ElementProperties.URI_PARENT == (int)AttributeProperties.URI); 418Debug.Assert((int)ElementProperties.BOOL_PARENT == (int)AttributeProperties.BOOLEAN); 419Debug.Assert((int)ElementProperties.NAME_PARENT == (int)AttributeProperties.NAME); 541Debug.Assert(pSrc <= pSrcEnd); 629Debug.Assert(pSrc <= pSrcEnd); 679Debug.Assert(_uriEscapingBuffer?.Length > 0); 788Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 794Debug.Assert(prefix.Length == 0); 850Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null);
System\Xml\Core\IncrementalReadDecoders.cs (17)
63Debug.Assert(_buffer != null); 64Debug.Assert(chars != null); 65Debug.Assert(len >= 0); 66Debug.Assert(startPos >= 0); 67Debug.Assert(chars.Length - startPos >= len); 69Debug.Assert(len > 0); 85Debug.Assert(_buffer != null); 86Debug.Assert(str != null); 87Debug.Assert(len >= 0); 88Debug.Assert(startPos >= 0); 89Debug.Assert(str.Length - startPos >= len); 91Debug.Assert(len > 0); 111Debug.Assert(buffer != null); 112Debug.Assert(count >= 0); 113Debug.Assert(index >= 0); 114Debug.Assert(buffer.Length - index >= count); 116Debug.Assert((buffer as char[]) != null);
System\Xml\Core\QueryOutputWriter.cs (2)
138Debug.Assert(!_outputDocType); 351Debug.Assert(!_inCDataSection);
System\Xml\Core\QueryOutputWriterV1.cs (6)
128Debug.Assert(!_outputDocType); 161Debug.Assert(_qnameCData != null); 162Debug.Assert(_bitsCData != null); 178Debug.Assert(_bitsCData != null); 191Debug.Assert(_bitsCData != null); 319Debug.Assert(!_inCDataSection);
System\Xml\Core\ReadContentAsBinaryHelper.cs (7)
97Debug.Assert(_state == State.InReadContent); 140Debug.Assert(_state == State.InReadContent); 183Debug.Assert(_state == State.InReadElementContent); 226Debug.Assert(_state == State.InReadElementContent); 276Debug.Assert(_reader.NodeType == XmlNodeType.Element); 330Debug.Assert(_decoder != null); 355Debug.Assert(_valueOffset == _valueChunkLength);
System\Xml\Core\ReadContentAsBinaryHelperAsync.cs (7)
48Debug.Assert(_state == State.InReadContent); 92Debug.Assert(_state == State.InReadContent); 136Debug.Assert(_state == State.InReadElementContent); 180Debug.Assert(_state == State.InReadElementContent); 224Debug.Assert(_reader.NodeType == XmlNodeType.Element); 252Debug.Assert(_decoder != null); 277Debug.Assert(_valueOffset == _valueChunkLength);
System\Xml\Core\XmlAsyncCheckReader.cs (3)
36Debug.Assert(!(reader is IXmlSchemaInfo)); 41Debug.Assert(!(reader is IXmlSchemaInfo)); 44Debug.Assert(!(reader is IXmlSchemaInfo));
System\Xml\Core\XmlAutoDetectWriter.cs (6)
33Debug.Assert(writerSettings.OutputMethod == XmlOutputMethod.AutoDetect); 106Debug.Assert(_wrapped != null); 309Debug.Assert(_wrapped != null); 315Debug.Assert(_wrapped != null); 321Debug.Assert(_wrapped != null); 399Debug.Assert(_wrapped == null);
System\Xml\Core\XmlCharCheckingReader.cs (2)
51Debug.Assert(checkCharacters || ignoreWhitespace || ignoreComments || ignorePis || (int)dtdProcessing != -1); 643Debug.Assert(readerAsNSResolver != null);
System\Xml\Core\XmlCharCheckingWriter.cs (1)
33Debug.Assert(checkValues || replaceNewLines);
System\Xml\Core\XmlEncodedRawTextWriter.cs (45)
114Debug.Assert(writer != null && settings != null); 136Debug.Assert(stream != null && settings != null); 253Debug.Assert(name != null && name.Length > 0); 294Debug.Assert(localName != null && localName.Length > 0); 295Debug.Assert(prefix != null); 326Debug.Assert(localName != null && localName.Length > 0); 327Debug.Assert(prefix != null); 358Debug.Assert(localName != null && localName.Length > 0); 359Debug.Assert(prefix != null); 378Debug.Assert(localName != null && localName.Length > 0); 379Debug.Assert(prefix != null); 412Debug.Assert(prefix != null && namespaceName != null); 429Debug.Assert(prefix != null); 468Debug.Assert(text != null); 475Debug.Assert(_bufPos >= 4); 505Debug.Assert(text != null); 524Debug.Assert(name != null && name.Length > 0); 525Debug.Assert(text != null); 546Debug.Assert(name != null && name.Length > 0); 593Debug.Assert(ws != null); 615Debug.Assert(text != null); 652Debug.Assert(buffer != null); 653Debug.Assert(index >= 0); 654Debug.Assert(count >= 0 && index + count <= buffer.Length); 676Debug.Assert(buffer != null); 677Debug.Assert(index >= 0); 678Debug.Assert(count >= 0 && index + count <= buffer.Length); 694Debug.Assert(data != null); 791Debug.Assert(_stream != null || _writer != null); 811Debug.Assert(_textContentMarks![0] == 1); 875Debug.Assert(_bufPos == 1); 912Debug.Assert(pSrc <= pSrcEnd); 1035Debug.Assert(pSrc <= pSrcEnd); 1136Debug.Assert(s != null); 1166Debug.Assert(pSrc <= pSrcEnd); 1231Debug.Assert(pSrc <= pSrcEnd); 1351Debug.Assert(pSrc <= pSrcEnd); 1502Debug.Assert(pSrc <= pSrcEnd); 1610Debug.Assert(XmlCharType.IsSurrogate(*pSrc)); 1636Debug.Assert(!XmlCharType.IsWhiteSpace((char)ch)); 1637Debug.Assert(!XmlCharType.IsAttributeValueChar((char)ch)); 1686Debug.Assert(_inTextContent != value); 1687Debug.Assert(_inTextContent || ((_lastMarkPos & 1) == 0)); 1698Debug.Assert(_lastMarkPos + 1 == _textContentMarks!.Length); 1963Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null);
System\Xml\Core\XmlEncodedRawTextWriterAsync.cs (42)
135Debug.Assert(name != null && name.Length > 0); 177Debug.Assert(localName != null && localName.Length > 0); 178Debug.Assert(prefix != null); 205Debug.Assert(localName != null && localName.Length > 0); 206Debug.Assert(prefix != null); 240Debug.Assert(localName != null && localName.Length > 0); 241Debug.Assert(prefix != null); 262Debug.Assert(localName != null && localName.Length > 0); 263Debug.Assert(prefix != null); 307Debug.Assert(prefix != null && namespaceName != null); 317Debug.Assert(prefix != null); 362Debug.Assert(text != null); 369Debug.Assert(_bufPos >= 4); 400Debug.Assert(text != null); 420Debug.Assert(name != null && name.Length > 0); 421Debug.Assert(text != null); 443Debug.Assert(name != null && name.Length > 0); 492Debug.Assert(ws != null); 511Debug.Assert(text != null); 548Debug.Assert(buffer != null); 549Debug.Assert(index >= 0); 550Debug.Assert(count >= 0 && index + count <= buffer.Length); 570Debug.Assert(buffer != null); 571Debug.Assert(index >= 0); 572Debug.Assert(count >= 0 && index + count <= buffer.Length); 586Debug.Assert(data != null); 623Debug.Assert(_stream != null || _writer != null); 643Debug.Assert(_textContentMarks![0] == 1); 707Debug.Assert(_bufPos == 1); 747Debug.Assert(pSrc <= pSrcEnd); 952Debug.Assert(pSrc <= pSrcEnd); 1192Debug.Assert(pSrc <= pSrcEnd); 1259Debug.Assert(text1 != null); 1260Debug.Assert(text2 != null || (text3 == null && text4 == null)); 1261Debug.Assert(text3 != null || (text4 == null)); 1317Debug.Assert(text1 != null); 1318Debug.Assert(text2 != null || (text3 == null && text4 == null)); 1319Debug.Assert(text3 != null || (text4 == null)); 1368Debug.Assert(pSrc <= pSrcEnd); 1570Debug.Assert(pSrc <= pSrcEnd); 1760Debug.Assert(pSrc <= pSrcEnd); 1922Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null);
System\Xml\Core\XmlEventCache.cs (2)
125Debug.Assert(idxPage + 1 == _pages.Count); 279Debug.Assert(idxPage + 1 == _pages.Count);
System\Xml\Core\XmlRawWriter.cs (1)
309Debug.Assert(_base64Encoder != null);
System\Xml\Core\XmlRawWriterAsync.cs (1)
223Debug.Assert(_base64Encoder != null);
System\Xml\Core\XmlReader.cs (58)
964Debug.Assert(parentDepth == 0); 988Debug.Assert(NodeType == XmlNodeType.EndElement || NodeType == XmlNodeType.None || ReadState == ReadState.Error); 1005Debug.Assert(parentDepth == 0); 1030Debug.Assert(NodeType == XmlNodeType.EndElement); 1306Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.None))); 1307Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Element))); 1308Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Attribute))); 1309Debug.Assert(0 != (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Text))); 1310Debug.Assert(0 != (IsTextualNodeBitmap & (1 << (int)XmlNodeType.CDATA))); 1311Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.EntityReference))); 1312Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Entity))); 1313Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.ProcessingInstruction))); 1314Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Comment))); 1315Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Document))); 1316Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.DocumentType))); 1317Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.DocumentFragment))); 1318Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Notation))); 1319Debug.Assert(0 != (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Whitespace))); 1320Debug.Assert(0 != (IsTextualNodeBitmap & (1 << (int)XmlNodeType.SignificantWhitespace))); 1321Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.EndElement))); 1322Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.EndEntity))); 1323Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.XmlDeclaration))); 1333Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.None))); 1334Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Element))); 1335Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Attribute))); 1336Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Text))); 1337Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.CDATA))); 1338Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.EntityReference))); 1339Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Entity))); 1340Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.ProcessingInstruction))); 1341Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Comment))); 1342Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Document))); 1343Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.DocumentType))); 1344Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.DocumentFragment))); 1345Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Notation))); 1346Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Whitespace))); 1347Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.SignificantWhitespace))); 1348Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.EndElement))); 1349Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.EndEntity))); 1350Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.XmlDeclaration))); 1360Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.None))); 1361Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.Element))); 1362Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.Attribute))); 1363Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.Text))); 1364Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.CDATA))); 1365Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.EntityReference))); 1366Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.Entity))); 1367Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.ProcessingInstruction))); 1368Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.Comment))); 1369Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.Document))); 1370Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.DocumentType))); 1371Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.DocumentFragment))); 1372Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.Notation))); 1373Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.Whitespace))); 1374Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.SignificantWhitespace))); 1375Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.EndElement))); 1376Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.EndEntity))); 1377Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.XmlDeclaration)));
System\Xml\Core\XmlReaderSettings.cs (1)
473Debug.Assert(_addValidationFunc != null);
System\Xml\Core\XmlSubtreeReader.cs (41)
432Debug.Assert(reader.NodeType == XmlNodeType.Element); 457Debug.Assert(_curNode.type == XmlNodeType.Attribute); 479Debug.Assert(reader.Depth >= _initialDepth); 489Debug.Assert(reader.NodeType == XmlNodeType.Element && !reader.IsEmptyElement); 550Debug.Assert(reader.Depth >= _initialDepth); 587Debug.Assert(reader.Depth >= _initialDepth); 601Debug.Assert(reader.NodeType == XmlNodeType.EndElement || 616Debug.Assert(reader.Depth >= _initialDepth); 868Debug.Assert(_binDecoder != null); 875Debug.Assert(AttributeCount > 0); 1006Debug.Assert(_binDecoder != null); 1013Debug.Assert(AttributeCount > 0); 1338Debug.Assert(_state == State.ClearNsAttributes || _state == State.Interactive || _state == State.PopNamespaceScope); 1366Debug.Assert(index >= 0 && index <= _nsAttrCount); 1399Debug.Assert(_state == State.Interactive); 1406Debug.Assert(_state == State.ReadElementContentAsBase64 || _state == State.ReadElementContentAsBinHex); 1440Debug.Assert(_state == State.ReadContentAsBase64 || _state == State.ReadContentAsBinHex); 1470Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.Initial))); 1471Debug.Assert(0 != (AttributeActiveStates & (1 << (int)State.Interactive))); 1472Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.Error))); 1473Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.EndOfFile))); 1474Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.Closed))); 1475Debug.Assert(0 != (AttributeActiveStates & (1 << (int)State.PopNamespaceScope))); 1476Debug.Assert(0 != (AttributeActiveStates & (1 << (int)State.ClearNsAttributes))); 1477Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.ReadElementContentAsBase64))); 1478Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.ReadElementContentAsBinHex))); 1479Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.ReadContentAsBase64))); 1480Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.ReadContentAsBinHex))); 1491Debug.Assert(0 == (NamespaceActiveStates & (1 << (int)State.Initial))); 1492Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.Interactive))); 1493Debug.Assert(0 == (NamespaceActiveStates & (1 << (int)State.Error))); 1494Debug.Assert(0 == (NamespaceActiveStates & (1 << (int)State.EndOfFile))); 1495Debug.Assert(0 == (NamespaceActiveStates & (1 << (int)State.Closed))); 1496Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.PopNamespaceScope))); 1497Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.ClearNsAttributes))); 1498Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.ReadElementContentAsBase64))); 1499Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.ReadElementContentAsBinHex))); 1500Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.ReadContentAsBase64))); 1501Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.ReadContentAsBinHex))); 1509Debug.Assert(_tmpNode.localName == string.Empty && _tmpNode.prefix == string.Empty && _tmpNode.name == string.Empty && _tmpNode.namespaceUri == string.Empty); 1560Debug.Assert(_state == State.Interactive ||
System\Xml\Core\XmlSubtreeReaderAsync.cs (12)
42Debug.Assert(reader.Depth >= _initialDepth); 52Debug.Assert(reader.NodeType == XmlNodeType.Element && !reader.IsEmptyElement); 113Debug.Assert(reader.Depth >= _initialDepth); 127Debug.Assert(reader.NodeType == XmlNodeType.EndElement || 142Debug.Assert(reader.Depth >= _initialDepth); 274Debug.Assert(_binDecoder != null); 281Debug.Assert(AttributeCount > 0); 412Debug.Assert(_binDecoder != null); 419Debug.Assert(AttributeCount > 0); 583Debug.Assert(_state == State.Interactive); 590Debug.Assert(_state == State.ReadElementContentAsBase64 || _state == State.ReadElementContentAsBinHex); 624Debug.Assert(_state == State.ReadContentAsBase64 || _state == State.ReadContentAsBinHex);
System\Xml\Core\XmlTextEncoder.cs (11)
74Debug.Assert(_attrValue != null); 88Debug.Assert(_attrValue != null); 120Debug.Assert(_attrValue != null); 208Debug.Assert((ch < 0x20 && !XmlCharType.IsWhiteSpace(ch)) || (ch > 0xFFFD)); 228Debug.Assert(_attrValue != null); 247Debug.Assert(_attrValue != null); 364Debug.Assert((ch < 0x20 && !XmlCharType.IsWhiteSpace(ch)) || (ch > 0xFFFD)); 387Debug.Assert(_attrValue != null); 446Debug.Assert(_attrValue != null); 465Debug.Assert(_attrValue != null); 478Debug.Assert(_attrValue != null);
System\Xml\Core\XmlTextReaderImpl.cs (252)
317Debug.Assert(nt != null); 330Debug.Assert(_index == 0); 371Debug.Assert(_nameTableFromSettings == false); 393Debug.Assert(_index == 0); 601Debug.Assert(baseUri == null); 629Debug.Assert(_laterInitParam != null); 630Debug.Assert(_laterInitParam.inputUriResolver != null); 631Debug.Assert(_laterInitParam.inputbaseUri != null); 632Debug.Assert(_reportedBaseUri != null); 699Debug.Assert(baseUri == null); 730Debug.Assert(_laterInitParam != null); 731Debug.Assert(_laterInitParam.inputStream != null); 732Debug.Assert(_reportedBaseUri != null); 789Debug.Assert(_laterInitParam != null); 790Debug.Assert(_laterInitParam.inputTextReader != null); 791Debug.Assert(_reportedBaseUri != null); 812Debug.Assert(xmlFragment != null); 1195Debug.Assert(_laterInitParam != null); 1234Debug.Assert(_nextParsingFunction == ParsingFunction.DocumentContent); 1237Debug.Assert(!_ps.appendMode); 1265Debug.Assert(_parsingFunction == ParsingFunction.ElementContent || 1270Debug.Assert(_curNode.type == XmlNodeType.Element); 1394Debug.Assert(_curNode.type == XmlNodeType.EndElement); 1395Debug.Assert(_parsingFunction != ParsingFunction.Eof); 1415Debug.Assert(_namespaceManager != null); 1498Debug.Assert(_parsingMode == ParsingMode.Full); 1559Debug.Assert(value is XmlTextReader); 1578Debug.Assert(_outerReader is XmlTextReaderImpl); 1867Debug.Assert(_ps.chars != null); 1891Debug.Assert(_ps.chars != null); 1944Debug.Assert(_namespaceManager != null); 1952Debug.Assert(_namespaceManager != null); 1988Debug.Assert(_namespaceManager != null); 2137Debug.Assert(_namespaceManager != null); 2166Debug.Assert(_stringBuilder.Length == 0); 2207Debug.Assert(_outerReader is XmlTextReader); 2243Debug.Assert(_outerReader is XmlTextReader); 2277Debug.Assert(_outerReader is XmlTextReader); 2404Debug.Assert(value >= 0 && value <= _ps.charsUsed); 2490Debug.Assert(_parsingMode == ParsingMode.Full); 2578Debug.Assert(_parsingStatesStackTop == -1); 2579Debug.Assert((systemId != null && systemId.Length > 0) || (publicId != null && publicId.Length > 0)); 2586Debug.Assert(_xmlResolver != null); 2598Debug.Assert(_ps.appendMode); 2614Debug.Assert(_parsingStatesStackTop == -1); 2615Debug.Assert(internalDtd != null); 2788Debug.Assert(InAttributeValueIterator); 2825Debug.Assert(baseUriStr != null); 2831Debug.Assert(baseUri != null); 2842Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0 && _ps.textReader == null); 2843Debug.Assert(baseUriStr != null); 2844Debug.Assert(baseUri == null || (baseUri.ToString().Equals(baseUriStr))); 2917Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0 && _ps.stream == null); 2918Debug.Assert(baseUriStr != null); 2946Debug.Assert(_ps.stream == null && _ps.textReader == null); 2947Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0); 2948Debug.Assert(baseUriStr != null); 2949Debug.Assert(str != null); 3004Debug.Assert(_parsingFunction == ParsingFunction.SwitchToInteractiveXmlDecl); 3008Debug.Assert(_parsingFunction == ParsingFunction.SwitchToInteractiveXmlDecl); 3009Debug.Assert(_nextParsingFunction == ParsingFunction.DocumentContent); 3034Debug.Assert(context != null && context.HasDtdInfo); 3056Debug.Assert(_url != null && _url.Length > 0); 3081Debug.Assert(_ps.stream != null); 3089Debug.Assert(_ps.bytes != null); 3090Debug.Assert(_ps.bytePos == 0); 3176Debug.Assert(_ps.charPos == 0); 3194Debug.Assert(_ps.encoding != null); 3195Debug.Assert(_ps.bytes != null); 3206Debug.Assert(_ps.encoding != null); 3209Debug.Assert(_ps.stream != null); 3221Debug.Assert(_ps.encoding != null); 3270Debug.Assert(newEncoding != null); 3271Debug.Assert(newEncoding.EncodingName != "UTF-8"); 3285Debug.Assert(_ps.stream != null && _ps.decoder != null && _ps.bytes != null); 3314Debug.Assert(_ps.encoding != null); 3315Debug.Assert(_ps.chars != null); 3341Debug.Assert(_ps.chars != null); 3364Debug.Assert(_ps.bytes != null); 3423Debug.Assert(_ps.bytes != null); 3438Debug.Assert(_ps.bytes != null); 3477Debug.Assert(_ps.charsUsed < _ps.chars.Length); 3488Debug.Assert(_ps.stream != null && _ps.decoder != null && _ps.bytes != null); 3489Debug.Assert(_ps.chars != null); 3490Debug.Assert(maxCharsCount <= _ps.chars.Length - _ps.charsUsed - 1); 3514Debug.Assert(maxCharsCount >= charsCount); 3529Debug.Assert(_ps.decoder != null); 3530Debug.Assert(_ps.bytes != null); 3531Debug.Assert(_ps.chars != null); 3579Debug.Assert(_ps.chars != null); 3609Debug.Assert(_stringBuilder.Length == 0 || isTextDecl); 3653Debug.Assert(_ps.encoding != null); 3730Debug.Assert(attr != null); 3762Debug.Assert(attr != null); 3788Debug.Assert(attr != null); 3804Debug.Assert(attr != null); 3819Debug.Assert(!isTextDecl); 3825Debug.Assert(attr != null); 3871Debug.Assert(_ps.encoding != null); 3895Debug.Assert(_ps.chars != null); 4077Debug.Assert(pos == _ps.charsUsed && !_ps.isEof); 4097Debug.Assert(_index == 0); 4120Debug.Assert(_ps.chars != null); 4294Debug.Assert(_ps.chars != null); 4360Debug.Assert(_namespaceManager != null); 4452Debug.Assert(_curNode.type == XmlNodeType.Element); 4453Debug.Assert(_dtdInfo != null); 4545Debug.Assert(_ps.chars != null); 4634Debug.Assert(_index > 0); 4639Debug.Assert(_curNode == startTagNode); 4656Debug.Assert(_ps.chars != null); 4666Debug.Assert(startTag.type == XmlNodeType.EntityReference); 4675Debug.Assert(_ps.chars != null); 4679Debug.Assert(_attrCount == 0); 4728Debug.Assert(_curNode.type == XmlNodeType.Element); 4736Debug.Assert(_curNode.type == XmlNodeType.Element); 4840Debug.Assert(attrNameLineNo == _ps.LineNo); 4962Debug.Assert(_curNode.type == XmlNodeType.Element); 5096Debug.Assert(_ps.chars != null); 5103Debug.Assert(_stringBuilder.Length == 0); 5258Debug.Assert(_ps.entity != null); 5315Debug.Assert(_ps.isEof); 5373Debug.Assert(attr.nextAttrValueChunk == null); 5402Debug.Assert(_stringBuilder.Length == 0); 5418Debug.Assert(endPos - startPos > 0); 5419Debug.Assert(_ps.chars != null); 5442Debug.Assert(_stringBuilder.Length > 0); 5463Debug.Assert(endPos - startPos > 0); 5464Debug.Assert(_ps.chars != null); 5539Debug.Assert(_ps.chars != null); 5729Debug.Assert(_ps.isEof); 5771Debug.Assert(_stringBuilder.Length == 0); 5772Debug.Assert(_parsingFunction == ParsingFunction.PartialTextValue || 5786Debug.Assert(_stringBuilder.Length > 0); 5840Debug.Assert(_parsingFunction == ParsingFunction.PartialTextValue || _parsingFunction == ParsingFunction.InReadValueChunk || 5850Debug.Assert(_parsingFunction == ParsingFunction.InReadValueChunk); 5855Debug.Assert((_index > 0) ? _nextParsingFunction == ParsingFunction.ElementContent : _nextParsingFunction == ParsingFunction.DocumentContent); 5867Debug.Assert(_parsingFunction == ParsingFunction.InReadContentAsBinary || _parsingFunction == ParsingFunction.InReadElementContentAsBinary); 5872Debug.Assert((_index > 0) ? _nextParsingFunction == ParsingFunction.ElementContent : _nextParsingFunction == ParsingFunction.DocumentContent); 5900Debug.Assert(_stringBuilder.Length == 0); 5904Debug.Assert(_ps.chars != null); 5942Debug.Assert(_ps.chars != null); 5943Debug.Assert(_ps.chars[_ps.charPos] == '&'); 5952Debug.Assert(_ps.chars != null); 5953Debug.Assert(_ps.chars[_ps.charPos] == '&'); 5968Debug.Assert(entityType == EntityType.CharacterDec || entityType == EntityType.CharacterHex); 6046Debug.Assert(entity != null); 6163Debug.Assert(_lastEntity != null); 6169Debug.Assert(_curNode.depth == _index); 6182Debug.Assert(_curNode.type == XmlNodeType.EntityReference); 6183Debug.Assert(_lastEntity != null); 6184Debug.Assert(Ref.Equal(_lastEntity.Name, _curNode.localName)); 6203Debug.Assert(_stringBuilder.Length == 0); 6207Debug.Assert(_ps.chars != null); 6230Debug.Assert(_ps.charPos < _ps.charsUsed); 6274Debug.Assert(_stringBuilder.Length == 0); 6308Debug.Assert(_ps.chars != null); 6330Debug.Assert(!_ps.eolNormalized); 6477Debug.Assert(_stringBuilder.Length == 0); 6480Debug.Assert(_ps.chars != null); 6513Debug.Assert(_ps.chars != null); 6537Debug.Assert(!_ps.eolNormalized); 6686Debug.Assert(_ps.chars != null); 6719Debug.Assert(_dtdProcessing == DtdProcessing.Ignore); 6751Debug.Assert(_ps.chars != null); 6848Debug.Assert(_ps.chars != null); 6867Debug.Assert(_ps.chars != null); 7048Debug.Assert(_ps.isEof); 7064Debug.Assert(_ps.chars != null); 7149Debug.Assert(_ps.isEof); 7158Debug.Assert(_ps.chars != null); 7159Debug.Assert(_ps.chars[startPos] == '&'); 7192Debug.Assert(_ps.chars != null); 7193Debug.Assert(_ps.chars[_ps.charPos] == '&'); 7213Debug.Assert(_ps.chars != null); 7214Debug.Assert(_ps.chars[startPos] == '&' && _ps.chars[startPos + 1] == '#'); 7269Debug.Assert(badDigitExceptionString != null); 7321Debug.Assert(pos > 0); 7355Debug.Assert(_ps.chars != null); 7356Debug.Assert(_ps.chars[_ps.charPos] == '&'); 7376Debug.Assert(startPos < _ps.charsUsed); 7377Debug.Assert(_ps.chars != null); 7378Debug.Assert(_ps.chars[startPos] == '&'); 7379Debug.Assert(_ps.chars[startPos + 1] != '#'); 7487Debug.Assert(pos > 0); 7512Debug.Assert(_ps.chars != null); 7575Debug.Assert(_ps.chars != null); 7608Debug.Assert(_ps.chars != null); 7623Debug.Assert(nodeIndex < _nodes.Length); 7624Debug.Assert(_nodes[_nodes.Length - 1] == null); 7637Debug.Assert(nodeIndex < _nodes.Length); 7644Debug.Assert(nodeIndex < _nodes.Length); 7661Debug.Assert(_ps.chars != null); 7714Debug.Assert(attr.type == XmlNodeType.Attribute); 7730Debug.Assert(_namespaceManager != null); 7749Debug.Assert(_ps.isEof); 7762Debug.Assert(_namespaceManager != null); 7800Debug.Assert(_namespaceManager != null); 7813Debug.Assert(_xmlContext.defaultNamespace == uri); 7850Debug.Assert(_curNode.xmlContextPushed); 7892Debug.Assert(_xmlResolver != null); 7950Debug.Assert(_xmlResolver != null); 7987Debug.Assert(entity.IsExternal); 7991Debug.Assert(_xmlResolver != null); 8002Debug.Assert(_ps.appendMode); 8033Debug.Assert(!entity.IsExternal); 8099Debug.Assert(_parsingStatesStackTop == -1); 8115Debug.Assert(_parsingStatesStackTop >= 0); 8116Debug.Assert(_parsingStatesStack != null); 8163Debug.Assert(_incReadDecoder != null); 8173Debug.Assert(_incReadDecoder != null); 8174Debug.Assert(_ps.chars != null); 8223Debug.Assert(_ps.chars.AsSpan(_ps.charPos - 2).StartsWith("?>")); 8231Debug.Assert(_ps.chars.AsSpan(_ps.charPos - 3).StartsWith("-->")); 8239Debug.Assert(_ps.chars.AsSpan(_ps.charPos - 3).StartsWith("]]>")); 8264Debug.Assert(_incReadState == IncrementalReadState.Text || 8373Debug.Assert(_ps.charPos - pos == 0); 8374Debug.Assert(_ps.charPos - startPos == 0); 8413Debug.Assert(_ps.charPos - pos == 0); 8414Debug.Assert(_ps.charPos - startPos == 0); 8534Debug.Assert(_fragmentType == XmlNodeType.Attribute); 8551Debug.Assert(_parsingFunction == ParsingFunction.InReadAttributeValue); 8564Debug.Assert(_ps.chars != null); 8579Debug.Assert(_stringBuilder.Length == 0); 8783Debug.Assert(_ps.chars != null); 8796Debug.Assert(_ps.charPos < _ps.charsUsed); 8861Debug.Assert(_ps.chars != null); 8874Debug.Assert(_dtdInfo == null && _fragmentParserContext != null && _fragmentParserContext.HasDtdInfo); 8890Debug.Assert(_parsingFunction != ParsingFunction.InReadContentAsBinary); 8917Debug.Assert(_parsingFunction != ParsingFunction.InReadElementContentAsBinary); 8918Debug.Assert(_curNode.type == XmlNodeType.Element); 9001Debug.Assert(context != null); 9022Debug.Assert(nt != null); 9039Debug.Assert(_nameTableFromSettings == false); 9064Debug.Assert(_dtdInfo == null); 9224Debug.Assert(attr != null); 9245Debug.Assert(_namespaceManager != null); 9248Debug.Assert(prefix != null); 9266Debug.Assert(attr != null); 9298Debug.Assert(_nodes[_index].type == XmlNodeType.Element); 9316Debug.Assert(_nodes[_index].type == XmlNodeType.Element); 9317Debug.Assert(_namespaceManager != null); 9351Debug.Assert(_incReadDecoder != null); 9385Debug.Assert(_ps.chars != null); 9464Debug.Assert(_parsingFunction != ParsingFunction.InReadElementContentAsBinary); 9520Debug.Assert(characters >= 0); 9562Debug.Assert(startPos >= 0); 9563Debug.Assert(endPos < chars.Length); 9564Debug.Assert(startPos <= endPos); 9571Debug.Assert(startPos >= 0); 9572Debug.Assert(endPos < str.Length); 9573Debug.Assert(startPos <= endPos);
System\Xml\Core\XmlTextReaderImplAsync.cs (72)
94Debug.Assert(_reportedBaseUri != null); 125Debug.Assert(_reportedBaseUri != null); 178Debug.Assert(!_ps.appendMode); 198Debug.Assert(_parsingFunction == ParsingFunction.ElementContent || 203Debug.Assert(_curNode.type == XmlNodeType.Element); 356Debug.Assert(_curNode.type == XmlNodeType.EndElement); 357Debug.Assert(_parsingFunction != ParsingFunction.Eof); 762Debug.Assert(_parsingMode == ParsingMode.Full); 828Debug.Assert(_parsingStatesStackTop == -1); 829Debug.Assert((systemId != null && systemId.Length > 0) || (publicId != null && publicId.Length > 0)); 846Debug.Assert(_ps.appendMode); 862Debug.Assert(baseUri != null); 868Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0 && _ps.textReader == null); 869Debug.Assert(baseUriStr != null); 870Debug.Assert(baseUri == null || (baseUri.ToString().Equals(baseUriStr))); 944Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0 && _ps.stream == null); 945Debug.Assert(baseUriStr != null); 977Debug.Assert(context != null && context.HasDtdInfo); 1003Debug.Assert(_ps.stream != null); 1161Debug.Assert(_ps.charsUsed < _ps.chars.Length); 1193Debug.Assert(_stringBuilder.Length == 0 || isTextDecl); 1399Debug.Assert(!isTextDecl); 1597Debug.Assert(pos == _ps.charsUsed && !_ps.isEof); 1712Debug.Assert(_index == 0); 2252Debug.Assert(_index > 0); 2257Debug.Assert(_curNode == startTagNode); 2299Debug.Assert(startTag.type == XmlNodeType.EntityReference); 2311Debug.Assert(_attrCount == 0); 2361Debug.Assert(_curNode.type == XmlNodeType.Element); 2369Debug.Assert(_curNode.type == XmlNodeType.Element); 2483Debug.Assert(attrNameLineNo == _ps.LineNo); 2613Debug.Assert(_stringBuilder.Length == 0); 2830Debug.Assert(_ps.isEof); 2899Debug.Assert(_stringBuilder.Length == 0); 2929Debug.Assert(endPos - startPos > 0); 2967Debug.Assert(_stringBuilder.Length == 0); 2988Debug.Assert(endPos - startPos > 0); 3018Debug.Assert(_stringBuilder.Length > 0); 3039Debug.Assert(endPos - startPos > 0); 3475Debug.Assert(_ps.isEof); 3529Debug.Assert(_stringBuilder.Length == 0); 3530Debug.Assert(_parsingFunction == ParsingFunction.PartialTextValue || 3555Debug.Assert(_stringBuilder.Length > 0); 3609Debug.Assert(_parsingFunction == ParsingFunction.PartialTextValue || _parsingFunction == ParsingFunction.InReadValueChunk || 3625Debug.Assert(_parsingFunction == ParsingFunction.InReadValueChunk); 3630Debug.Assert((_index > 0) ? _nextParsingFunction == ParsingFunction.ElementContent : _nextParsingFunction == ParsingFunction.DocumentContent); 3644Debug.Assert(_parsingFunction == ParsingFunction.InReadContentAsBinary || _parsingFunction == ParsingFunction.InReadElementContentAsBinary); 3649Debug.Assert((_index > 0) ? _nextParsingFunction == ParsingFunction.ElementContent : _nextParsingFunction == ParsingFunction.DocumentContent); 3677Debug.Assert(_stringBuilder.Length == 0); 3718Debug.Assert(_ps.chars[_ps.charPos] == '&'); 3729Debug.Assert(_ps.chars[_ps.charPos] == '&'); 3749Debug.Assert(entityType == EntityType.CharacterDec || entityType == EntityType.CharacterHex); 3908Debug.Assert(_stringBuilder.Length == 0); 3934Debug.Assert(_ps.charPos < _ps.charsUsed); 3988Debug.Assert(_stringBuilder.Length == 0); 4053Debug.Assert(!_ps.eolNormalized); 4202Debug.Assert(_stringBuilder.Length == 0); 4279Debug.Assert(!_ps.eolNormalized); 4460Debug.Assert(_dtdProcessing == DtdProcessing.Ignore); 4791Debug.Assert(_ps.isEof); 4891Debug.Assert(_ps.isEof); 4920Debug.Assert(_ps.chars[_ps.charPos] == '&'); 4954Debug.Assert(_ps.chars[_ps.charPos] == '&'); 5161Debug.Assert(_xmlResolver != null); 5197Debug.Assert(entity.IsExternal); 5211Debug.Assert(_ps.appendMode); 5255Debug.Assert(_dtdInfo == null && _fragmentParserContext != null && _fragmentParserContext.HasDtdInfo); 5270Debug.Assert(_parsingFunction != ParsingFunction.InReadContentAsBinary); 5296Debug.Assert(_parsingFunction != ParsingFunction.InReadElementContentAsBinary); 5297Debug.Assert(_curNode.type == XmlNodeType.Element); 5359Debug.Assert(_incReadDecoder != null); 5473Debug.Assert(_parsingFunction != ParsingFunction.InReadElementContentAsBinary);
System\Xml\Core\XmlTextReaderImplHelpers.cs (22)
284Debug.Assert(internalDtd != null); 417Debug.Assert(type == XmlNodeType.Element); 430Debug.Assert(type == XmlNodeType.Attribute); 451Debug.Assert(_chars != null); 462Debug.Assert(_chars != null); 467Debug.Assert(_value != null); 511Debug.Assert(value != null); 537Debug.Assert(localName != null); 538Debug.Assert(localName.Length > 0); 567Debug.Assert(_valueStartPos != -1); 568Debug.Assert(_chars != null); 578Debug.Assert(_valueStartPos != -1); 579Debug.Assert(_chars != null); 599Debug.Assert(_valueStartPos != -1); 600Debug.Assert(_chars != null); 625Debug.Assert(_valueStartPos != -1); 626Debug.Assert(_chars != null); 643Debug.Assert(_chars != null); 648Debug.Assert(_value != null); 668Debug.Assert(nameWPrefix == null); 725Debug.Assert(x == null || x is NodeData || x is IDtdDefaultAttributeInfo); 726Debug.Assert(y == null || y is NodeData || y is IDtdDefaultAttributeInfo);
System\Xml\Core\XmlTextWriter.cs (7)
1549Debug.Assert(_useNsHashtable); 1550Debug.Assert(_nsHashtable != null); 1565Debug.Assert(_useNsHashtable); 1566Debug.Assert(_nsHashtable != null); 1570Debug.Assert(_nsHashtable.ContainsKey(_nsStack[i].prefix)); 1607Debug.Assert(_nsHashtable != null); 1632Debug.Assert(_nsHashtable != null);
System\Xml\Core\XmlUtf8RawTextWriter.cs (40)
99Debug.Assert(stream != null && settings != null); 199Debug.Assert(name != null && name.Length > 0); 238Debug.Assert(localName != null && localName.Length > 0); 239Debug.Assert(prefix != null); 268Debug.Assert(localName != null && localName.Length > 0); 269Debug.Assert(prefix != null); 298Debug.Assert(localName != null && localName.Length > 0); 299Debug.Assert(prefix != null); 316Debug.Assert(localName != null && localName.Length > 0); 317Debug.Assert(prefix != null); 347Debug.Assert(prefix != null && namespaceName != null); 364Debug.Assert(prefix != null); 398Debug.Assert(text != null); 403Debug.Assert(_bufPos >= 4); 433Debug.Assert(text != null); 450Debug.Assert(name != null && name.Length > 0); 451Debug.Assert(text != null); 470Debug.Assert(name != null && name.Length > 0); 513Debug.Assert(ws != null); 533Debug.Assert(text != null); 567Debug.Assert(buffer != null); 568Debug.Assert(index >= 0); 569Debug.Assert(count >= 0 && index + count <= buffer.Length); 589Debug.Assert(buffer != null); 590Debug.Assert(index >= 0); 591Debug.Assert(count >= 0 && index + count <= buffer.Length); 605Debug.Assert(data != null); 672Debug.Assert(_stream != null); 731Debug.Assert(pSrc <= pSrcEnd); 853Debug.Assert(pSrc <= pSrcEnd); 953Debug.Assert(s != null); 983Debug.Assert(pSrc <= pSrcEnd); 1047Debug.Assert(pSrc <= pSrcEnd); 1166Debug.Assert(pSrc <= pSrcEnd); 1316Debug.Assert(pSrc <= pSrcEnd); 1430Debug.Assert(XmlCharType.IsSurrogate(*pSrc)); 1463Debug.Assert(!XmlCharType.IsWhiteSpace((char)ch)); 1464Debug.Assert(!XmlCharType.IsAttributeValueChar((char)ch)); 1519Debug.Assert(ch >= 0x80 && !XmlCharType.IsSurrogate(ch)); 1820Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null);
System\Xml\Core\XmlUtf8RawTextWriterAsync.cs (40)
113Debug.Assert(name != null && name.Length > 0); 153Debug.Assert(localName != null && localName.Length > 0); 154Debug.Assert(prefix != null); 179Debug.Assert(localName != null && localName.Length > 0); 180Debug.Assert(prefix != null); 212Debug.Assert(localName != null && localName.Length > 0); 213Debug.Assert(prefix != null); 232Debug.Assert(localName != null && localName.Length > 0); 233Debug.Assert(prefix != null); 273Debug.Assert(prefix != null && namespaceName != null); 283Debug.Assert(prefix != null); 322Debug.Assert(text != null); 327Debug.Assert(_bufPos >= 4); 358Debug.Assert(text != null); 376Debug.Assert(name != null && name.Length > 0); 377Debug.Assert(text != null); 397Debug.Assert(name != null && name.Length > 0); 442Debug.Assert(ws != null); 459Debug.Assert(text != null); 492Debug.Assert(buffer != null); 493Debug.Assert(index >= 0); 494Debug.Assert(count >= 0 && index + count <= buffer.Length); 512Debug.Assert(buffer != null); 513Debug.Assert(index >= 0); 514Debug.Assert(count >= 0 && index + count <= buffer.Length); 526Debug.Assert(data != null); 558Debug.Assert(_stream != null); 618Debug.Assert(pSrc <= pSrcEnd); 822Debug.Assert(pSrc <= pSrcEnd); 1061Debug.Assert(pSrc <= pSrcEnd); 1127Debug.Assert(text1 != null); 1128Debug.Assert(text2 != null || (text3 == null && text4 == null)); 1129Debug.Assert(text3 != null || (text4 == null)); 1185Debug.Assert(text1 != null); 1186Debug.Assert(text2 != null || (text3 == null && text4 == null)); 1187Debug.Assert(text3 != null || (text4 == null)); 1236Debug.Assert(pSrc <= pSrcEnd); 1437Debug.Assert(pSrc <= pSrcEnd); 1626Debug.Assert(pSrc <= pSrcEnd); 1787Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null);
System\Xml\Core\XmlValidatingReaderImpl.cs (4)
746Debug.Assert(value is XmlValidatingReader); 1013Debug.Assert(_parserContext != null); 1014Debug.Assert(_coreReaderImpl.DtdInfo == null); 1052Debug.Assert(_coreReader.NodeType == XmlNodeType.EntityReference);
System\Xml\Core\XmlValidatingReaderImplAsync.cs (3)
175Debug.Assert(_parserContext != null); 176Debug.Assert(_coreReaderImpl.DtdInfo == null); 193Debug.Assert(_coreReader.NodeType == XmlNodeType.EntityReference);
System\Xml\Core\XmlWellFormedWriter.cs (21)
240Debug.Assert(writer != null); 241Debug.Assert(settings != null); 242Debug.Assert(MaxNamespacesWalkCount <= 3); 456Debug.Assert(prefix.Length == 0); 484Debug.Assert(_attrHashTable != null); 743Debug.Assert(_attrValueCache != null); 785Debug.Assert(_curDeclPrefix != null); 1262Debug.Assert(i >= 0); 1273Debug.Assert(i >= 0); 1581Debug.Assert(_stateTable == s_stateTableAuto); 1625Debug.Assert(prefix == "xmlns"); 1779Debug.Assert(_nsHashtable != null); 1795Debug.Assert(_nsHashtable != null); 1817Debug.Assert(_useNsHashtable); 1818Debug.Assert(_nsHashtable != null); 1819Debug.Assert(indexFrom <= indexTo); 1822Debug.Assert(_nsHashtable.ContainsKey(_nsStack[i].prefix)); 2031Debug.Assert(ncname != null && ncname.Length > 0); 2123Debug.Assert(_attrHashTable.Count == 0); 2148Debug.Assert(_attrHashTable != null); 2166Debug.Assert(prev >= 0 && _attrStack[prev].localName == localName);
System\Xml\Core\XmlWellFormedWriterAsync.cs (3)
229Debug.Assert(prefix.Length == 0); 645Debug.Assert(_attrValueCache != null); 690Debug.Assert(_curDeclPrefix != null);
System\Xml\Core\XmlWellFormedWriterHelpers.cs (3)
96Debug.Assert(kind == NamespaceKind.NeedToWrite); 505Debug.Assert(_singleStringValue != null); 506Debug.Assert(_lastItem == -1);
System\Xml\Core\XmlWellFormedWriterHelpersAsync.cs (1)
31Debug.Assert(kind == NamespaceKind.NeedToWrite);
System\Xml\Core\XmlWrappingReader.cs (1)
25Debug.Assert(baseReader != null);
System\Xml\Core\XmlWrappingWriter.cs (1)
23Debug.Assert(baseWriter != null);
System\Xml\Core\XmlWriterSettings.cs (1)
367Debug.Assert(Encoding.UTF8.WebName == "utf-8");
System\Xml\Core\XsdCachingReader.cs (8)
483Debug.Assert(_coreReader.NodeType == XmlNodeType.EndElement || (_coreReader.NodeType == XmlNodeType.Element && _coreReader.IsEmptyElement)); 488Debug.Assert(endElementNode.NodeType == XmlNodeType.EndElement); 496Debug.Assert(_coreReader.NodeType == XmlNodeType.EndElement || (_coreReader.NodeType == XmlNodeType.Element && _coreReader.IsEmptyElement)); 561Debug.Assert(_cacheState == CachingReaderState.Replay); 591Debug.Assert(_cacheState == CachingReaderState.Replay); 653Debug.Assert(attIndex < _attributeEvents.Length); 671Debug.Assert(_contentIndex <= _contentEvents.Length); 692Debug.Assert(_coreReader.NodeType == XmlNodeType.Element);
System\Xml\Core\XsdCachingReaderAsync.cs (1)
127Debug.Assert(_cacheState == CachingReaderState.Replay);
System\Xml\Core\XsdValidatingReader.cs (48)
219Debug.Assert(_cachedNode != null); 243Debug.Assert(_cachedNode != null); 264Debug.Assert(_cachedNode != null); 279Debug.Assert(_cachedNode != null); 294Debug.Assert(_cachedNode != null); 323Debug.Assert(_cachedNode != null); 338Debug.Assert(_cachedNode != null); 425Debug.Assert(_xmlSchemaInfo.SchemaType!.Datatype != null); 434Debug.Assert(AttributeSchemaInfo.SchemaType!.Datatype != null); 1177Debug.Assert(attNode != null); 1208Debug.Assert(_readBinaryHelper != null); 1235Debug.Assert(_attributePSVI != null); 1263Debug.Assert(_readBinaryHelper != null); 1304Debug.Assert(_readBinaryHelper != null); 1342Debug.Assert(_readBinaryHelper != null); 1356Debug.Assert(moveTo); 1384Debug.Assert(_readBinaryHelper != null); 1456Debug.Assert(_readBinaryHelper != null); 1570Debug.Assert(_readBinaryHelper != null); 1579Debug.Assert(_cachedNode != null); 1617Debug.Assert(_readBinaryHelper != null); 1644Debug.Assert(_readBinaryHelper != null); 1671Debug.Assert(_readBinaryHelper != null); 1698Debug.Assert(_readBinaryHelper != null); 1927Debug.Assert(_nsManager != null); 1940Debug.Assert(_nsManager != null); 1953Debug.Assert(_nsManager != null); 1990Debug.Assert(_attributePSVI != null); 2072Debug.Assert(_nsManager != null); 2111Debug.Assert(_nsManager != null); 2137Debug.Assert(_atomicValue != null); 2140Debug.Assert(_cachingReader != null); 2148Debug.Assert(_nsManager != null); 2236Debug.Assert(_coreReaderNameTable.Get(localName) != null); 2237Debug.Assert(_coreReaderNameTable.Get(ns) != null); 2281Debug.Assert(_coreReaderNameTable.Get(attrLocalName) != null); 2282Debug.Assert(_coreReaderNameTable.Get(ns) != null); 2304Debug.Assert(attIndex < _attributePSVINodes.Length); 2330Debug.Assert(_inlineSchemaParser != null); 2440Debug.Assert(this.NodeType == XmlNodeType.Element); 2552Debug.Assert(_nsManager != null); 2587Debug.Assert(_coreReader.NodeType == XmlNodeType.EndElement); 2626Debug.Assert(_cachingReader != null); 2646Debug.Assert(_cachingReader != null); 2709Debug.Assert(_cachingReader != null); 2723Debug.Assert(xmlType != null && xmlType.Datatype != null); 2727Debug.Assert(listType != null); 2740Debug.Assert(NodeType != XmlNodeType.Attribute);
System\Xml\Core\XsdValidatingReaderAsync.cs (19)
24Debug.Assert(_cachedNode != null); 321Debug.Assert(_readBinaryHelper != null); 400Debug.Assert(_readBinaryHelper != null); 427Debug.Assert(_readBinaryHelper != null); 454Debug.Assert(_readBinaryHelper != null); 481Debug.Assert(_readBinaryHelper != null); 571Debug.Assert(_nsManager != null); 609Debug.Assert(_nsManager != null); 635Debug.Assert(_atomicValue != null); 638Debug.Assert(_cachingReader != null); 646Debug.Assert(_nsManager != null); 653Debug.Assert(_inlineSchemaParser != null); 716Debug.Assert(_originalAtomicValueString != null); 735Debug.Assert(value != null); 737Debug.Assert(_originalAtomicValueString != null); 776Debug.Assert(this.NodeType == XmlNodeType.Element); 790Debug.Assert(_originalAtomicValueString != null); 816Debug.Assert(_originalAtomicValueString != null); 890Debug.Assert(_nsManager != null);
System\Xml\Dom\DocumentSchemaValidator.cs (15)
67Debug.Assert(schemas != null && schemas.Count > 0); 89Debug.Assert(nodeToValidate.SchemaInfo != null); 115Debug.Assert(schemaElement.ElementSchemaType == schemaInfo.SchemaType); 324Debug.Assert(elementNode != null); 338Debug.Assert(_nameTable.Get(attr.NamespaceURI) != null); 339Debug.Assert(_nameTable.Get(attr.LocalName) != null); 435Debug.Assert(_attributeSchemaInfo != null); 447Debug.Assert(simpleValue != null); 485Debug.Assert(elementToValidate.ParentNode!.NodeType != XmlNodeType.Document); //Handle if it is the documentElement separately 608Debug.Assert(_nodeSequenceToValidate![0] == elementToValidate.ParentNode); 673Debug.Assert(elementNode != null); 687Debug.Assert(_nameTable.Get(attr.NamespaceURI) != null); 688Debug.Assert(_nameTable.Get(attr.LocalName) != null); 757Debug.Assert(child == childToStopAt); 791Debug.Assert(ex != null);
System\Xml\Dom\DocumentXmlWriter.cs (3)
433Debug.Assert(elem != null); 438Debug.Assert(attr != null); 449Debug.Assert(attr != null);
System\Xml\Dom\DocumentXPathNavigator.cs (34)
179Debug.Assert(_source.Value != null); 220Debug.Assert(value != null); 527Debug.Assert(attributes != null); 547Debug.Assert(attributes != null && attributes.parent != null); 578Debug.Assert(_namespaceParent != null); 640Debug.Assert(attributes != null); 641Debug.Assert(0 <= index && index < attributes.Count); 661Debug.Assert(attributes != null && attributes.parent != null); 724Debug.Assert(parent != null); 760Debug.Assert(parent != null); 788Debug.Assert(sibling != null); 1271Debug.Assert(ownerDocument != null); 1307Debug.Assert(node1 != null); 1308Debug.Assert(node2 != null); 1311Debug.Assert(OwnerNode(node1) == OwnerNode(node2)); 1317Debug.Assert(element != null); 1393Debug.Assert(node1 != node2); 1412Debug.Assert(node2 != null); 1427Debug.Assert(node1 != null); 1436Debug.Assert(node1 != node2); 1456Debug.Assert(this.NodeType != XPathNodeType.Attribute && this.NodeType != XPathNodeType.Namespace && this.NodeType != XPathNodeType.All); 2257Debug.Assert(((XmlNode)nav.UnderlyingObject).NodeType != XmlNodeType.Attribute); 2270Debug.Assert(node != null); 2311Debug.Assert(((XmlNode)nav.UnderlyingObject).NodeType != XmlNodeType.Attribute); 2312Debug.Assert(Ref.Equal(nav.NameTable.Get(nsAtom), nsAtom)); 2326Debug.Assert(node != null); 2327Debug.Assert(node.NodeType == XmlNodeType.Element); 2369Debug.Assert(((XmlNode)nav.UnderlyingObject).NodeType != XmlNodeType.Attribute); 2370Debug.Assert(Ref.Equal(nav.NameTable.Get(localNameAtom), localNameAtom)); 2371Debug.Assert(Ref.Equal(nav.NameTable.Get(nsAtom), nsAtom)); 2372Debug.Assert(localNameAtom.Length > 0); // Use DocumentXPathNodeIterator_ElemChildren_NoLocalName class for special magic value of localNameAtom 2391Debug.Assert(node != null); 2392Debug.Assert(node.NodeType == XmlNodeType.Element); 2402Debug.Assert(localNameAtom.Length > 0); // Use DocumentXPathNodeIterator_ElemChildren_AndSelf_NoLocalName if localName == String.Empty
System\Xml\Dom\DomNameTable.cs (1)
26Debug.Assert((_entries.Length & _mask) == 0); // entries.Length must be a power of two
System\Xml\Dom\XmlAttribute.cs (3)
21Debug.Assert(name != null); 22Debug.Assert(doc != null); 54Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlAttributeCollection.cs (10)
194Debug.Assert(offset != -1); // the if statement above guarantees that the ref node is in the collection 223Debug.Assert(offset != -1); // the if statement above guarantees that the ref node is in the collection 303Debug.Assert(retNode is XmlAttribute); 319Debug.Assert(retNode is XmlAttribute); 386Debug.Assert(parentElem != null); 388Debug.Assert(doc != null); 403Debug.Assert(parentElem != null); 405Debug.Assert(doc != null); 418Debug.Assert(-1 == FindNodeOffset(node)); 421Debug.Assert(retNode is XmlAttribute);
System\Xml\Dom\XmlCDataSection.cs (1)
72Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlCharacterData.cs (1)
201Debug.Assert(XmlDocument.IsTextNode(n.NodeType) || (n.ParentNode != null && n.ParentNode.NodeType == XmlNodeType.EntityReference));
System\Xml\Dom\XmlComment.cs (1)
37Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlDeclaration.cs (1)
160Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlDocument.cs (12)
217Debug.Assert((prefix == null) ? (n.Prefix.Length == 0) : (prefix == n.Prefix)); 218Debug.Assert(n.LocalName == localName); 219Debug.Assert((namespaceURI == null) ? (n.NamespaceURI.Length == 0) : (n.NamespaceURI == namespaceURI)); 226Debug.Assert(n == null || ((prefix == null) ? (n.Prefix.Length == 0) : (prefix == n.Prefix))); 227Debug.Assert(n == null || n.LocalName == localName); 228Debug.Assert(n == null || ((namespaceURI == null) ? (n.NamespaceURI.Length == 0) : (n.NamespaceURI == namespaceURI))); 235Debug.Assert((prefix == null) ? (xmlName.Prefix.Length == 0) : (prefix == xmlName.Prefix)); 236Debug.Assert(xmlName.LocalName == localName); 237Debug.Assert((namespaceURI == null) ? (xmlName.NamespaceURI.Length == 0) : (xmlName.NamespaceURI == namespaceURI)); 977Debug.Assert(((XmlAttribute)node).Specified); 1042Debug.Assert(toNode.NodeType != XmlNodeType.EntityReference); 1772Debug.Assert(doc == this);
System\Xml\Dom\XmlDocumentFragment.cs (3)
109Debug.Assert(OwnerDocument != null); 155Debug.Assert(newChild != null); //should be checked that newChild is not null before this function call 171Debug.Assert(newChild != null); //should be checked that newChild is not null before this function call
System\Xml\Dom\XmlDocumentType.cs (2)
30Debug.Assert(doc != null); 61Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlElement.cs (5)
23Debug.Assert(name != null); 54Debug.Assert(OwnerDocument != null); 481Debug.Assert(n != null); 495Debug.Assert(n != null); 503Debug.Assert(n != null);
System\Xml\Dom\XmlElementList.cs (11)
29Debug.Assert(parent != null); 30Debug.Assert(parent.NodeType == XmlNodeType.Element || parent.NodeType == XmlNodeType.Document); 32Debug.Assert(parent.Document != null); 72Debug.Assert(parent.Document != null); 74Debug.Assert(nt != null); 83Debug.Assert(parent.Document != null); 85Debug.Assert(nt != null); 108Debug.Assert(curNode != null); 135Debug.Assert(curNode != null); 183Debug.Assert(n != null); 197Debug.Assert(n != null);
System\Xml\Dom\XmlEntityReference.cs (1)
84Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlLoader.cs (17)
57Debug.Assert(_reader != null); 58Debug.Assert(parentDoc != null); 148Debug.Assert(parent.NodeType == XmlNodeType.Element); 170Debug.Assert(parent == null); 225Debug.Assert(node != null); 251Debug.Assert(_reader!.NodeType == XmlNodeType.Attribute); 292Debug.Assert(node != null); 301Debug.Assert(_reader!.IsDefault); 350Debug.Assert(node != null); 358Debug.Assert(_reader!.NodeType == XmlNodeType.EntityReference); 381Debug.Assert(_reader!.NodeType == XmlNodeType.XmlDeclaration); 419Debug.Assert(_reader!.NodeType == XmlNodeType.DocumentType); 494Debug.Assert(parent!.NodeType == XmlNodeType.Element); 549Debug.Assert(node != null); 749Debug.Assert(parentNode.NodeType != XmlNodeType.Document); 751Debug.Assert(_doc != null); 944Debug.Assert(tr.EntityHandling == EntityHandling.ExpandCharEntities);
System\Xml\Dom\XmlName.cs (2)
89Debug.Assert(_prefix != null); 109Debug.Assert(Ref.Equal(_name, ownerDoc.NameTable.Get(_name)));
System\Xml\Dom\XmlNode.cs (9)
44Debug.Assert(doc != null); 56Debug.Assert(nodeIterator.Current != null); 128Debug.Assert(parentNode != null); 187Debug.Assert(parentNode != null); 791Debug.Assert(firstNode.NodeType == XmlNodeType.Text 1433Debug.Assert(prevNode.IsText); 1434Debug.Assert(nextNode.IsText); 1441Debug.Assert(prevNode.IsText); 1442Debug.Assert(nextNode.IsText);
System\Xml\Dom\XmlNodeReader.cs (11)
110Debug.Assert(nt == XmlNodeType.XmlDeclaration || nt == XmlNodeType.DocumentType); 131Debug.Assert(_curNode.NodeType == XmlNodeType.XmlDeclaration || _curNode.NodeType == XmlNodeType.DocumentType); 136Debug.Assert(_nAttrInd >= 0 && _nAttrInd < AttributeCount); 214Debug.Assert(_curNode.NodeType == XmlNodeType.XmlDeclaration || _curNode.NodeType == XmlNodeType.DocumentType); 215Debug.Assert(_nAttrInd >= 0 && _nAttrInd < AttributeCount); 235Debug.Assert(nt == XmlNodeType.XmlDeclaration || nt == XmlNodeType.DocumentType); 236Debug.Assert(_nAttrInd >= 0 && _nAttrInd < AttributeCount); 608Debug.Assert(IsOnDeclOrDocType); 1053Debug.Assert(_curNode.NodeType == XmlNodeType.XmlDeclaration || _curNode.NodeType == XmlNodeType.DocumentType); 1082Debug.Assert(_curNode != null); 1627Debug.Assert(_curDepth == 0);
System\Xml\Dom\XmlProcessingInstruction.cs (1)
82Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlSignificantWhiteSpace.cs (1)
72Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlText.cs (1)
76Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlWhitespace.cs (1)
88Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XPathNodeList.cs (1)
49Debug.Assert(_nodeIterator.Current != null);
System\Xml\Resolvers\XmlPreloadedResolver.cs (2)
214Debug.Assert(s_rss091_Dtd.Length == 1); 352Debug.Assert(uri != null);
System\Xml\Schema\BaseProcessor.cs (2)
25Debug.Assert(nameTable != null); 146Debug.Assert(item is XmlSchemaElement);
System\Xml\Schema\BaseValidator.cs (6)
49Debug.Assert(schemaCollection == null || schemaCollection.NameTable == reader.NameTable); 171Debug.Assert(context != null); 191Debug.Assert(names.Count > 0); 209Debug.Assert(context != null); 232Debug.Assert(textString != null); 239Debug.Assert(textValue != null);
System\Xml\Schema\BitSet.cs (1)
73Debug.Assert(startFrom >= -1 && startFrom <= _count);
System\Xml\Schema\Chameleonkey.cs (1)
66Debug.Assert((chameleonLocation.OriginalString.Length == 0 && originalSchema != null)
System\Xml\Schema\CompiledidEntityConstraint.cs (1)
61Debug.Assert(fields.Count > 0);
System\Xml\Schema\ConstraintStruct.cs (5)
211Debug.Assert(_dstruct != null); 219Debug.Assert(_dstruct != null); 363Debug.Assert(arr1 != null); 378Debug.Assert(arr2 != null); 398Debug.Assert(dim > 0);
System\Xml\Schema\ContentValidator.cs (17)
86Debug.Assert(_particles.Count == _last + 1); 123Debug.Assert(_particles.Count == _last + 1); 138Debug.Assert(name != null); 910Debug.Assert(parent is SequenceNode); 911Debug.Assert(this == parent.RightChild); 1234Debug.Assert(ContentType == XmlSchemaContentType.ElementOnly || ContentType == XmlSchemaContentType.Mixed); 1243Debug.Assert(!IsOpen); 1328Debug.Assert(lrNode != null); 1346Debug.Assert(lrNode1 != null); 1394Debug.Assert(lrNode != null); 1463Debug.Assert(state == stateTable[statePosSet]); // just make sure that statePosSet is for correct state 1852Debug.Assert(_minMaxNodesCount != 0); 1951Debug.Assert(_minMaxNodesCount > 0); 1973Debug.Assert(lrNode != null); 2046Debug.Assert(runningPositions[i].curpos != null); 2089Debug.Assert(runningPositions[i].curpos != null); 2149Debug.Assert(_elements.Count > 0);
System\Xml\Schema\DataTypeImplementation.cs (13)
172Debug.Assert(qname != null && dataType != null); 188Debug.Assert(derivedType != null && baseType != null); 363Debug.Assert(currentType != null); 538Debug.Assert(typedValue != null); 559Debug.Assert(typedValue != null); 953Debug.Assert(arr1 != null && arr2 != null); 964Debug.Assert(atomicValues2 != null); 1030Debug.Assert(valuesToCheck != null); 1111Debug.Assert(unionTypedValue != null); 1128Debug.Assert(_itemType.ListValueType.GetElementType() == _itemType.ValueType); 1259Debug.Assert(typedValue != null); 1315Debug.Assert(memberType != null); 2627Debug.Assert(uri != null);
System\Xml\Schema\DtdParser.cs (34)
208Debug.Assert((int)Token.CDATA == (int)XmlTokenizedType.CDATA && (int)XmlTokenizedType.CDATA == 0); 209Debug.Assert((int)Token.ID == (int)XmlTokenizedType.ID && (int)XmlTokenizedType.ID == 1); 210Debug.Assert((int)Token.IDREF == (int)XmlTokenizedType.IDREF && (int)XmlTokenizedType.IDREF == 2); 211Debug.Assert((int)Token.IDREFS == (int)XmlTokenizedType.IDREFS && (int)XmlTokenizedType.IDREFS == 3); 212Debug.Assert((int)Token.ENTITY == (int)XmlTokenizedType.ENTITY && (int)XmlTokenizedType.ENTITY == 4); 213Debug.Assert((int)Token.ENTITIES == (int)XmlTokenizedType.ENTITIES && (int)XmlTokenizedType.ENTITIES == 5); 214Debug.Assert((int)Token.NMTOKEN == (int)XmlTokenizedType.NMTOKEN && (int)XmlTokenizedType.NMTOKEN == 6); 215Debug.Assert((int)Token.NMTOKENS == (int)XmlTokenizedType.NMTOKENS && (int)XmlTokenizedType.NMTOKENS == 7); 216Debug.Assert((int)Token.NOTATION == (int)XmlTokenizedType.NOTATION && (int)XmlTokenizedType.NOTATION == 8); 235Debug.Assert(readerAdapter != null); 492Debug.Assert(ParsingInternalSubset); 498Debug.Assert(_externalEntitiesDepth == 0); 519Debug.Assert(_readerAdapter.EntityStackLength == 0 || 589Debug.Assert(_curPos > 0 && _chars[_curPos - 1] == ']'); 601Debug.Assert(_readerAdapter.EntityStackLength == 0 || 625Debug.Assert(_scanningFunction == ScanningFunction.SubsetContent); 1494Debug.Assert(idTokenType == Token.PUBLIC); 2393Debug.Assert(_chars[_curPos] == '"' || _chars[_curPos] == '\''); 2609Debug.Assert(_curPos - _tokenStartPos == 0); 3109Debug.Assert(_chars[_curPos] == 'P'); 3128Debug.Assert(_chars[_curPos] == 'S'); 3150Debug.Assert(_curPos - _tokenStartPos > 0); 3172Debug.Assert(_curPos - _tokenStartPos > 0); 3195Debug.Assert(_curPos == 0 || _chars[_curPos - 1] == '"' || _chars[_curPos - 1] == '\''); 3228Debug.Assert(_internalSubsetValueSb != null); 3244Debug.Assert(_chars[_curPos] == '&' || _chars[_curPos] == '%'); 3252Debug.Assert(_chars[_curPos - 1] == ';'); 3317Debug.Assert(!ParsingInternalSubset || _freeFloatingDtd); 3318Debug.Assert(_currentEntityId == 0); 3342Debug.Assert(_chars[_curPos - 1] == ';'); 3398Debug.Assert(_validate); 3404Debug.Assert(_validate); 3410Debug.Assert(_validate); 3528Debug.Assert(startPos < _charsUsed);
System\Xml\Schema\DtdParserAsync.cs (15)
136Debug.Assert(ParsingInternalSubset); 142Debug.Assert(_externalEntitiesDepth == 0); 163Debug.Assert(_readerAdapter.EntityStackLength == 0 || 233Debug.Assert(_curPos > 0 && _chars[_curPos - 1] == ']'); 245Debug.Assert(_readerAdapter.EntityStackLength == 0 || 269Debug.Assert(_scanningFunction == ScanningFunction.SubsetContent); 993Debug.Assert(_internalSubsetValueSb != null); 1021Debug.Assert(_internalSubsetValueSb != null); 1119Debug.Assert(idTokenType == Token.PUBLIC); 1839Debug.Assert(_chars[_curPos] == '"' || _chars[_curPos] == '\''); 2055Debug.Assert(_curPos - _tokenStartPos == 0); 2522Debug.Assert(_chars[_curPos] == 'P'); 2541Debug.Assert(_chars[_curPos] == 'S'); 2574Debug.Assert(_chars[_curPos] == '&' || _chars[_curPos] == '%'); 2582Debug.Assert(_chars[_curPos - 1] == ';');
System\Xml\Schema\DtdValidator.cs (2)
46Debug.Assert(reader != null); 149Debug.Assert(reader.NodeType == XmlNodeType.Element);
System\Xml\Schema\FacetChecker.cs (5)
1017Debug.Assert(restriction != null); 1500Debug.Assert(restriction != null); 1629Debug.Assert(values != null); 1675Debug.Assert(list != null); 1683Debug.Assert(enumValue != null);
System\Xml\Schema\Inference\Infer.cs (6)
278Debug.Assert(compiledAttributes != null); //AttributeUses is never null 1003Debug.Assert(elem.ElementDecl == null); 1202Debug.Assert(_xtr!.NodeType == XmlNodeType.Attribute); 1242Debug.Assert(ct != null); 1253Debug.Assert(ct != null); //either the user-defined type itself is a complex type or we switched from a simple type to a complex type 1257Debug.Assert(sce != null);
System\Xml\Schema\NamespaceList.cs (5)
29Debug.Assert(targetNamespace != null); 69Debug.Assert(_set != null); 179Debug.Assert(super._type == ListType.Set); 197Debug.Assert(o1 != o2); 315Debug.Assert(o1 != o2); //clause 1
System\Xml\Schema\Parser.cs (7)
89Debug.Assert(_schemaType == SchemaType.XDR); 241Debug.Assert(_parentNode != null); 324Debug.Assert(currentNode != null); 325Debug.Assert(_parentNode != null); 333Debug.Assert(_reader!.NodeType == XmlNodeType.Element); 418Debug.Assert(_reader!.NodeType == XmlNodeType.Attribute); 444Debug.Assert(_reader!.NodeType == XmlNodeType.EntityReference);
System\Xml\Schema\ParserAsync.cs (1)
50Debug.Assert(_schemaType == SchemaType.XDR);
System\Xml\Schema\Preprocessor.cs (3)
304Debug.Assert(import != null); 823Debug.Assert(_currentSchema != null); 977Debug.Assert((currentSchemaObject as XmlSchema) == null); // The current object should not be schema
System\Xml\Schema\SchemaCollectionCompiler.cs (7)
54Debug.Assert(!members.Contains(element)); 514Debug.Assert(group.CanonicalParticle != null); 1030Debug.Assert(baseType.ElementDecl.ContentValidator != null); 1859Debug.Assert(attribute.Use != XmlSchemaUse.Prohibited); 2252Debug.Assert(xe.ElementSchemaType != null); 2486Debug.Assert(particle == XmlSchemaParticle.Empty); 2531Debug.Assert(!p.IsEmpty);
System\Xml\Schema\SchemaSetCompiler.cs (10)
128Debug.Assert(_schemaForSchema != null); 499Debug.Assert(examplar != null); //Headelement presence is checked while building subst groups 596Debug.Assert(group.CanonicalParticle != null); 2224Debug.Assert(attribute.Use != XmlSchemaUse.Prohibited); 2711Debug.Assert(xe.ElementSchemaType != null); 2730Debug.Assert(decl != null); 2912Debug.Assert(!((XmlSchemaParticle)particles[i]).IsEmpty); 3086Debug.Assert(baseFixedValue != null); 3093Debug.Assert(derivedFixedValue != null); 3109Debug.Assert(simpleFixedValue != null);
System\Xml\Schema\XdrBuilder.cs (1)
623Debug.Assert(_GroupDef != null);
System\Xml\Schema\XmlAtomicValue.cs (1)
169Debug.Assert(qname != null); //string representation is handled in a different overload
System\Xml\Schema\XmlSchema.cs (2)
226Debug.Assert(_isPreprocessed); 523Debug.Assert(extList != null && schema != null);
System\Xml\Schema\XmlSchemaObjectTable.cs (8)
32Debug.Assert(oldValue != null); 34Debug.Assert(matchedIndex >= 0); 36Debug.Assert(_entries[matchedIndex].qname == name); 51Debug.Assert(oldValue != null); 53Debug.Assert(_entries[matchedIndex].qname == name); 71Debug.Assert(matchedIndex >= 0); 72Debug.Assert(_entries[matchedIndex].qname == name); 94Debug.Assert(_table.Count == _entries.Count);
System\Xml\Schema\XmlSchemaSet.cs (2)
869Debug.Assert(ns != null); 880Debug.Assert(schema.BaseUri!.Equals(schemaUri));
System\Xml\Schema\XmlSchemaSimpleType.cs (1)
15Debug.Assert(SchemaContentType == XmlSchemaContentType.TextOnly);
System\Xml\Schema\XmlSchemaValidator.cs (32)
333Debug.Assert(_validatedNamespaces != null); 586Debug.Assert(_currentState == ValidatorState.TopLevelAttribute); //Re-set state back to start on error with partial validation type 596Debug.Assert(currentElementDecl != null); 598Debug.Assert(ct != null); 615Debug.Assert(attributeDef != null); 636Debug.Assert(simpleValue != null); 782Debug.Assert(names.Count > 0); 910Debug.Assert(_context.Validity != XmlSchemaValidity.Valid); 1047Debug.Assert(attSchemaInfo != null); 1270Debug.Assert(typedValue != null); 1417Debug.Assert(currentElementDecl.Datatype != null); 1479Debug.Assert(simpleValue != null); 1493Debug.Assert(decl != null && decl.SchemaType != null); 1535Debug.Assert(_validationStack.Length > 1); 1616Debug.Assert(_partialValidationType is XmlSchemaAttribute); 1654Debug.Assert(elementDecl.DefaultValueTyped != null); 1806Debug.Assert(elementDecl.ContentValidator!.ContentType == XmlSchemaContentType.Mixed && elementDecl.DefaultValueTyped != null); 1819Debug.Assert(decl != null); 1830Debug.Assert(_xmlResolver != null); 1922Debug.Assert(dtype != null); 1938Debug.Assert(typedValue != null); 1961Debug.Assert(dtype != null); 1970Debug.Assert(typedValue != null); 2086Debug.Assert(currentElementDecl != null); 2300Debug.Assert(datatype != null); 2507Debug.Assert(contentValidator is DfaContentValidator || contentValidator is NfaContentValidator || contentValidator is RangeContentValidator || contentValidator is AllElementsContentValidator); 2531Debug.Assert(names.Count > 0); 2564Debug.Assert(schemaSet != null); 2583Debug.Assert(names.Count > 0); 2622Debug.Assert(builder.Length != 0); 2633Debug.Assert(nextParticle != null); 2733Debug.Assert(nsList.Length > 0);
System\Xml\Schema\XmlValueConverter.cs (2)
282Debug.Assert(_clrTypeDefault!.IsArray); 3146Debug.Assert(schemaType.DerivedBy == XmlSchemaDerivationMethod.Union);
System\Xml\Schema\XsdBuilder.cs (2)
705Debug.Assert(_currentEntry.InitFunc != null); 708Debug.Assert(_xso != null);
System\Xml\Schema\XsdDateTime.cs (1)
501Debug.Assert(success);
System\Xml\Schema\XsdDuration.cs (3)
117Debug.Assert(durationType == DurationType.Duration || durationType == DurationType.DayTimeDuration); 347Debug.Assert(success); 426Debug.Assert(successCopy);
System\Xml\Schema\XsdValidator.cs (1)
494Debug.Assert(attnDef.SchemaType != null);
System\Xml\Serialization\CodeGenerator.cs (33)
46System.Diagnostics.Debug.Assert(typeBuilder != null); 60Debug.Assert(iType.IsInterface); 131System.Diagnostics.Debug.Assert(_argList != null && _argList.ContainsKey(name)); 137System.Diagnostics.Debug.Assert(_currentScope != null && _currentScope.ContainsKey(name)); 212Debug.Assert(_currentScope!.parent != null); 221Debug.Assert(_freeLocals != null); 243Debug.Assert(!_currentScope!.ContainsKey(name)); 259Debug.Assert(local.LocalType == type); 281Debug.Assert(forState != null); 308Debug.Assert(ICollection_get_Count.IsVirtual && !ICollection_get_Count.DeclaringType!.IsValueType); 402Debug.Assert(methodInfo != null); 411Debug.Assert(ctor != null); 417Debug.Assert(constructorInfo != null); 551System.Diagnostics.Debug.Assert(memberInfo is PropertyInfo); 558System.Diagnostics.Debug.Assert(getMethod != null); 584System.Diagnostics.Debug.Assert(memberInfo is PropertyInfo); 591System.Diagnostics.Debug.Assert(getMethod != null); 619System.Diagnostics.Debug.Assert(memberInfo is PropertyInfo); 625System.Diagnostics.Debug.Assert(setMethod != null); 929Debug.Assert(_currentScope!.ContainsKey(name)); 941Debug.Assert(local.LocalType == type); 952Debug.Assert(_currentScope!.ContainsKey(name)); 954Debug.Assert(local.LocalType == type); 1038Debug.Assert(!opCode.Equals(OpCodes.Nop)); 1245Debug.Assert(ifState != null); 1278Debug.Assert(_initElseIfStack == -1); 1288Debug.Assert(_initIfStack == -1); 1308Debug.Assert(_initIfStack == -1 && _initElseIfStack == -1); 1329Debug.Assert(_initIfStack == -1 && _initElseIfStack == -1); 1613Debug.Assert(this.MethodBuilder.ReturnType == returnType); 1614Debug.Assert(this.MethodBuilder.Attributes == attributes); 1615Debug.Assert(this.ParameterTypes.Length == parameterTypes.Length); 1618Debug.Assert(this.ParameterTypes[i] == parameterTypes[i]);
System\Xml\Serialization\CodeIdentifier.cs (1)
175Debug.Assert(ident != null);
System\Xml\Serialization\Compiler.cs (1)
75Debug.Assert(originalAssemblyInfo != null);
System\Xml\Serialization\Mappings.cs (4)
754Debug.Assert(a1 != null); 755Debug.Assert(a2 != null); 867Debug.Assert(m1 != null); 868Debug.Assert(m2 != null);
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (3)
172Debug.Assert(a != null); 296Debug.Assert(o is byte[]); 813Debug.Assert(ai is byte[]);
System\Xml\Serialization\SourceInfo.cs (4)
119Debug.Assert(get_Item != null); 196Debug.Assert(match.Groups["arg"].Value == Arg); 197Debug.Assert(match.Groups["cast"].Value == CodeIdentifier.GetCSharpName(Type!)); 224System.Diagnostics.Debug.Assert(targetType == nullableType || targetType.IsAssignableFrom(nullableType.GetGenericArguments()[0]));
System\Xml\Serialization\Types.cs (2)
1094Debug.Assert(propertyInfo != null); 1095Debug.Assert(typeDesc != null);
System\Xml\Serialization\XmlSerializationILGen.cs (5)
48System.Diagnostics.Debug.Assert(access == "public"); 63get { System.Diagnostics.Debug.Assert(_moduleBuilder != null); return _moduleBuilder; } 64set { System.Diagnostics.Debug.Assert(_moduleBuilder == null && value != null); _moduleBuilder = value; } 102System.Diagnostics.Debug.Assert(_methodBuilders.ContainsKey(methodName)); 592System.Diagnostics.Debug.Assert(memberInfos.ContainsKey(source.Substring(3)));
System\Xml\Serialization\XmlSerializationReaderILGen.cs (20)
254Debug.Assert(_idNameFields.ContainsKey(id)); 314Debug.Assert(node == "null" || node == "(object)p"); 688System.Diagnostics.Debug.Assert(source == "Reader.ReadElementString()" || source == "Reader.ReadString()" 798System.Diagnostics.Debug.Assert(source == "Reader.Value" || source == "Reader.ReadElementString()" || source == "vals[i]"); 916System.Diagnostics.Debug.Assert(source == "false"); 1062Debug.Assert(get_TableName != null); 1760System.Diagnostics.Debug.Assert(source == "Reader"); 2030System.Diagnostics.Debug.Assert(elseCall == "UnknownNode"); 2333Debug.Assert(anyText != null); 2659Debug.Assert(!soapRefs); 2739Debug.Assert(match.Groups["locA1"].Value == match.Groups["locA2"].Value); 2740Debug.Assert(match.Groups["locA1"].Value == match.Groups["locA3"].Value); 2741Debug.Assert(match.Groups["locI1"].Value == match.Groups["locI2"].Value); 2785System.Diagnostics.Debug.Assert(CodeGenerator.GetVariableType(ilg.GetVariable(match.Groups["a"].Value)).IsArray); 2811Debug.Assert(elementType != null && variable is LocalBuilder); 2821Debug.Assert(memberInfos.ContainsKey(source.Substring(3))); 2849Debug.Assert(!localA.LocalType.IsGenericType || (localA.LocalType.GetGenericArguments().Length == 1 && localA.LocalType.GetGenericArguments()[0].IsAssignableFrom(elementType))); 2855Debug.Assert(Add != null); 2868System.Diagnostics.Debug.Assert(varType.IsArray); 2896Debug.Assert(memberInfos.ContainsKey(source.Substring(3)));
System\Xml\Serialization\XmlSerializationWriterILGen.cs (11)
1058System.Diagnostics.Debug.Assert(xmlnsSource.StartsWith("o.@", StringComparison.Ordinal)); 1380System.Diagnostics.Debug.Assert(parent == "o" || parent == "p"); 2212Debug.Assert(!local.LocalType.IsValueType); 2398Debug.Assert(type.IsValueType); 2533Debug.Assert(initValue.MemberInfo != null); 2534Debug.Assert(initValue.MemberInfo.Name == initValue.Arg.Substring(3)); 2580Debug.Assert(typeName == arrayTypeDesc.CSharpName || typeName == $"{arrayTypeDesc.CSharpName}[]"); 2589Debug.Assert(type != null); 2590Debug.Assert(ilg != null); 2597Debug.Assert(arrayType != null); 2598Debug.Assert(ilg != null);
System\Xml\ValidateNames.cs (7)
38Debug.Assert(s != null && offset <= s.Length); 69Debug.Assert(s != null && offset <= s.Length); 107Debug.Assert(s != null && offset <= s.Length); 157Debug.Assert(s != null && offset <= s.Length); 376Debug.Assert(offsetBadChar < s.Length); 396Debug.Assert(offsetBadChar < s.Length); 453Debug.Assert(prefix != null && localName != null && ns != null);
System\Xml\XmlCharType.cs (7)
23Debug.Assert(PublicIdChars.Contains(c) == IsPubidChar(c)); 24Debug.Assert(AsciiCharDataChars.Contains(c) == IsCharData(c)); 25Debug.Assert(WhiteSpaceChars.Contains(c) == IsWhiteSpace(c)); 168Debug.Assert(str != null); 169Debug.Assert(startPos <= str.Length); 170Debug.Assert(startPos + len <= str.Length); 181Debug.Assert(start <= end);
System\Xml\XmlEncoding.cs (1)
408Debug.Assert(i == 1);
System\Xml\XmlException.cs (3)
227Debug.Assert(invCharIndex < data.Length); 228Debug.Assert(invCharIndex < length); 229Debug.Assert(length <= data.Length);
System\Xml\XmlNamespacemanager.cs (18)
102Debug.Assert(_nsdecls != null); 108Debug.Assert(_hashTable != null); 113Debug.Assert(decl >= 2); 126Debug.Assert(_nameTable != null); 127Debug.Assert(_nsdecls != null); 170Debug.Assert(_hashTable != null); 177Debug.Assert(_hashTable == null); 193Debug.Assert(_nsdecls != null); 208Debug.Assert(_nsdecls != null); 226Debug.Assert(_nsdecls != null); 242Debug.Assert(i >= 2); 253Debug.Assert(prefix != null); 274Debug.Assert(_nsdecls != null); 281Debug.Assert(_nsdecls != null); 285Debug.Assert(_hashTable != null); 322Debug.Assert(_nsdecls != null); 341Debug.Assert(_nsdecls != null); 367Debug.Assert(_nsdecls != null);
System\Xml\XPath\Internal\AbsoluteQuery.cs (1)
16Debug.Assert(context.Current != null);
System\Xml\XPath\Internal\AttributeQuery.cs (2)
42Debug.Assert(currentNode != null); 48Debug.Assert(!currentNode.NamespaceURI.Equals(XmlReservedNs.NsXmlNs));
System\Xml\XPath\Internal\Axis.cs (2)
39Debug.Assert(prefix != null); 40Debug.Assert(name != null);
System\Xml\XPath\Internal\BaseAxisQuery.cs (4)
34Debug.Assert(qyInput != null); 64Debug.Assert(context != null); 89Debug.Assert(_nsUri != null); 120Debug.Assert(this is AttributeQuery || this is ChildrenQuery);
System\Xml\XPath\Internal\BooleanExpr.cs (2)
19Debug.Assert(op == Operator.Op.AND || op == Operator.Op.OR); 20Debug.Assert(opnd1 != null && opnd2 != null);
System\Xml\XPath\Internal\BooleanFunctions.cs (1)
79Debug.Assert(nodeIterator.Current != null);
System\Xml\XPath\Internal\CacheAxisQuery.cs (2)
40Debug.Assert(0 <= count && count <= outputBuffer.Count); 52Debug.Assert(0 <= count && count <= outputBuffer.Count);
System\Xml\XPath\Internal\CacheOutputQuery.cs (2)
51Debug.Assert(0 <= count && count <= outputBuffer.Count); 63Debug.Assert(0 <= count && count <= outputBuffer.Count);
System\Xml\XPath\Internal\CompiledXPathExpr.cs (1)
124Debug.Assert(prefix != null);
System\Xml\XPath\Internal\DescendantoverDescendantQuery.cs (3)
63Debug.Assert(currentNode != null); 75Debug.Assert(currentNode != null); 86Debug.Assert(currentNode != null);
System\Xml\XPath\Internal\ForwardPositionQuery.cs (1)
13Debug.Assert(input != null);
System\Xml\XPath\Internal\FunctionQuery.cs (3)
77Debug.Assert(nodeIterator.Current != null); 83Debug.Assert(_function != null); 87Debug.Assert(retVal != null);
System\Xml\XPath\Internal\IdQuery.cs (1)
18Debug.Assert(context.Current != null);
System\Xml\XPath\Internal\IteratorFilter.cs (1)
36Debug.Assert(_innerIterator.Current != null);
System\Xml\XPath\Internal\LogicalExpr.cs (4)
19Debug.Assert( 70Debug.Assert(cmp != null); 97Debug.Assert(op == Operator.Op.EQ || op == Operator.Op.NE); 130Debug.Assert(
System\Xml\XPath\Internal\MergeFilterQuery.cs (1)
62Debug.Assert(current != null);
System\Xml\XPath\Internal\NamespaceQuery.cs (1)
58Debug.Assert(e.NodeType == XPathNodeType.Namespace);
System\Xml\XPath\Internal\NumberFunctions.cs (5)
58Debug.Assert(nodeIterator!.Current != null); 86Debug.Assert(_arg != null); 98Debug.Assert(_arg != null); 104Debug.Assert(_arg != null); 110Debug.Assert(_arg != null);
System\Xml\XPath\Internal\NumericExpr.cs (3)
19Debug.Assert( 24Debug.Assert(opnd1 != null && opnd2 != null); 59Debug.Assert(op == Operator.Op.PLUS || op == Operator.Op.MINUS || op == Operator.Op.MOD || op == Operator.Op.DIV || op == Operator.Op.MUL);
System\Xml\XPath\Internal\Operator.cs (1)
49Debug.Assert(Op.EQ <= op && op <= Op.GE);
System\Xml\XPath\Internal\Query.cs (1)
147Debug.Assert(0 <= l && l < r);
System\Xml\XPath\Internal\QueryBuilder.cs (2)
420Debug.Assert(root.Prefix != null); 421Debug.Assert(root.Name != null);
System\Xml\XPath\Internal\SortQuery.cs (6)
82Debug.Assert(0 <= count && count <= _results.Count); 94Debug.Assert(0 <= count && count <= _results.Count); 159Debug.Assert(_expressions.Length == _comparers.Length); 160Debug.Assert(0 < _expressions.Length); 161Debug.Assert(0 <= _numSorts && _numSorts <= _expressions.Length); 175Debug.Assert(_numSorts < _expressions.Length);
System\Xml\XPath\Internal\StringFunctions.cs (10)
91Debug.Assert(GetXPathType(argVal) == XPathResultType.Number); 95Debug.Assert(nodeIterator.Current != null); 131Debug.Assert(_argList.Count > 1); 139Debug.Assert(_argList.Count > 1); 147Debug.Assert(_argList.Count > 1); 157Debug.Assert(_argList.Count > 1); 167Debug.Assert(_argList.Count > 0); 212Debug.Assert(nodeIterator!.Current != null); 225Debug.Assert(nodeIterator!.Current != null); 257Debug.Assert(_argList.Count > 2);
System\Xml\XPath\Internal\VariableQuery.cs (2)
48Debug.Assert(_variable != null); 52Debug.Assert(retVal != null);
System\Xml\XPath\Internal\XPathArrayIterator.cs (3)
35Debug.Assert(nodeIterator.Current != null); 54Debug.Assert(index <= list.Count); 69Debug.Assert(index <= list.Count);
System\Xml\XPath\Internal\XPathMultyIterator.cs (3)
26Debug.Assert(iterator != null); 69Debug.Assert(firstNotEmpty <= item && item < arr.Length); 74Debug.Assert(it.Current != null && itNext.Current != null);
System\Xml\XPath\Internal\XPathParser.cs (4)
415Debug.Assert(nodeType != XPathNodeType.Root); 464Debug.Assert(IsPrimaryExpr); 655Debug.Assert(_scanner.CanBeFunction); 867Debug.Assert(_scanner.Kind == XPathScanner.LexKind.Axe);
System\Xml\XPath\Internal\XPathScanner.cs (19)
43Debug.Assert(0 <= _xpathExprIndex && _xpathExprIndex <= _xpathExpr.Length); 64Debug.Assert(_kind == LexKind.Name || _kind == LexKind.Axe); 65Debug.Assert(_name != null); 74Debug.Assert(_kind == LexKind.Name); 75Debug.Assert(_prefix != null); 84Debug.Assert(_kind == LexKind.String); 85Debug.Assert(_stringValue != null); 94Debug.Assert(_kind == LexKind.Number); 95Debug.Assert(!double.IsNaN(_numberValue)); 106Debug.Assert(_kind == LexKind.Name); 122Debug.Assert(XmlCharType.IsWhiteSpace(CurrentChar)); 277Debug.Assert(CurrentChar == '.' || char.IsAsciiDigit(CurrentChar)); 297Debug.Assert(char.IsAsciiDigit(CurrentChar)); 299Debug.Assert(0 <= start && _xpathExpr[start] == '.'); 322Debug.Assert(CurrentChar == endChar); 331Debug.Assert(!span.IsEmpty); 332Debug.Assert(span[0] == CurrentChar); 333Debug.Assert(XmlCharType.IsStartNCNameSingleChar(span[0])); 334Debug.Assert(XmlCharType.IsNCNameSingleChar(span[0]));
System\Xml\XPath\Internal\XPathSingletonIterator.cs (1)
16Debug.Assert(nav != null);
System\Xml\XPath\XPathDocument.cs (4)
210Debug.Assert(reader.LocalName == "xmlns"); 215Debug.Assert(reader.Prefix == "xmlns"); 385Debug.Assert(pageElem[idxElem].NodeType == XPathNodeType.Element && pageNmsp[idxNmsp].NodeType == XPathNodeType.Namespace); 398Debug.Assert(pageElem[idxElem].NodeType == XPathNodeType.Element);
System\Xml\XPath\XPathNavigator.cs (8)
1091Debug.Assert(args != null); 1191Debug.Assert(context.Current != null); 1821Debug.Assert(!n1.IsSamePosition(n2)); 1823Debug.Assert(p1.MoveToParent() && p2.MoveToParent() && p1.IsSamePosition(p2)); 2055Debug.Assert(reader.LocalName == "xmlns"); 2060Debug.Assert(reader.Prefix == "xmlns"); 2116Debug.Assert(reader.LocalName == "xmlns"); 2121Debug.Assert(reader.Prefix == "xmlns");
System\Xml\XPath\XPathNavigatorReader.cs (2)
515Debug.Assert(value == null); 641Debug.Assert(XPathNodeType.Namespace == _nav.NodeType);
System\Xml\XPath\XPathNodeIterator.cs (1)
66Debug.Assert(_current.Current != null);
System\Xml\Xsl\IlGen\GenerateHelper.cs (8)
1098Debug.Assert(nameType == GenerateNameType.TagNameAndNamespace); 1134Debug.Assert(_locXOut != null); 1468Debug.Assert(_isDebug && _lastSourceInfo != null); 1469Debug.Assert(sourceInfo != null); 1501Debug.Assert(_module.EmitSymbols); 1613Debug.Assert(opcode.OperandType == OperandType.InlineI || opcode.OperandType == OperandType.InlineVar); 1623Debug.Assert(opcode.OperandType == OperandType.InlineI8); 1734Debug.Assert(opcode.Equals(OpCodes.Brtrue) || opcode.Equals(OpCodes.Brtrue_S) ||
System\Xml\Xsl\IlGen\IteratorDescriptor.cs (3)
334Debug.Assert(_hasNext); 403Debug.Assert(_storage.IsCached); 476Debug.Assert(brctxt != BranchingContext.None);
System\Xml\Xsl\IlGen\OptimizerPatterns.cs (3)
245Debug.Assert(Enum.IsDefined(pattern)); 246Debug.Assert((int)pattern < 32); 256Debug.Assert(Enum.IsDefined(pattern));
System\Xml\Xsl\IlGen\StaticDataManager.cs (2)
119Debug.Assert(ndNmspDecl != null); 120Debug.Assert(ndNmspDecl.Left is QilLiteral && ndNmspDecl.Right is QilLiteral);
System\Xml\Xsl\IlGen\XmlILConstructAnalyzer.cs (14)
196Debug.Assert(value); 220Debug.Assert(value); 244Debug.Assert(value); 442Debug.Assert(ndContent != null); 491case QilNodeType.NamespaceDecl: Debug.Assert(ndContent == null); break; 492case QilNodeType.TextCtor: Debug.Assert(ndContent == null); break; 493case QilNodeType.RawTextCtor: Debug.Assert(ndContent == null); break; 497case QilNodeType.XsltCopyOf: Debug.Assert(ndContent == null); break; 715Debug.Assert(!typ.IsSingleton); 751Debug.Assert(!typ.IsSingleton); 801Debug.Assert(ndElem!.NodeType == QilNodeType.ElementCtor); 839Debug.Assert(binaryNode != null); 858Debug.Assert(ndName != null); 1059Debug.Assert(nd.NodeType == QilNodeType.NamespaceDecl);
System\Xml\Xsl\IlGen\XmlILModule.cs (1)
79Debug.Assert(!(useLRE && emitSymbols));
System\Xml\Xsl\IlGen\XmlILOptimizerVisitor.cs (1)
5489Debug.Assert(left.NodeType == right.NodeType);
System\Xml\Xsl\IlGen\XmlIlVisitor.cs (43)
93Debug.Assert(iter.NodeType == QilNodeType.Let || iter.NodeType == QilNodeType.Parameter); 223Debug.Assert(iter.NodeType == QilNodeType.Parameter); 758Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None); 843Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None); 909Debug.Assert(info.ConstructMethod == XmlILConstructMethod.Iterator); 912Debug.Assert(ndCond.Left.XmlType!.TypeCode == XmlTypeCode.Boolean); 949Debug.Assert(!ndCond.Center.XmlType!.IsSingleton || !ndCond.Right.XmlType!.IsSingleton); 986Debug.Assert(itemStorageType == typeof(bool)); 1012Debug.Assert(XmlILConstructInfo.Read(ndChoice).PushToWriterFirst); 1630Debug.Assert(ndParsedTagName.Right.XmlType.IsSingleton); 2110Debug.Assert(ndIter != null); 2123Debug.Assert(ndIter.NodeType == QilNodeType.Let || ndIter.NodeType == QilNodeType.Parameter); 2124Debug.Assert(!patt.MatchesPattern(OptimizerPatternName.IsPositional)); 2141Debug.Assert(ndFor.XmlType!.IsSingleton); 2203Debug.Assert(!ndLet.XmlType!.IsSingleton); 2234Debug.Assert(ndIter != null); 2248Debug.Assert(ndIter.NodeType == QilNodeType.For); 2251Debug.Assert(locPos != null); 2265Debug.Assert(ndSort.Variable.NodeType == QilNodeType.For); 2286Debug.Assert(!_iterNested!.Storage.IsCached); 2552Debug.Assert(!XmlILConstructInfo.Read(ndInvoke).PushToWriterFirst || useWriter); 3375Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None); 3562Debug.Assert(XmlILConstructInfo.Read(ndInvoke).ConstructMethod != XmlILConstructMethod.Writer); 3745Debug.Assert(XmlILConstructInfo.Read(ndCopy).PushToWriterFirst); 3751Debug.Assert(ndCopy.Left.XmlType!.IsNode); 3763Debug.Assert(ndCopy.Left.XmlType.IsNode); 3988Debug.Assert(ndDod.NodeType == QilNodeType.DocOrderDistinct && ndLoop != null); 4124Debug.Assert(ValidateNames.ValidateName(prefix, localName, ns, nodeType, ValidateNames.Flags.AllExceptPrefixMapping)); 4201Debug.Assert(relOp == QilNodeType.Eq || relOp == QilNodeType.Ne); 4240Debug.Assert(relOp == QilNodeType.Eq || relOp == QilNodeType.Ne); 4267Debug.Assert(ndSecond.NodeType == QilNodeType.NameOf); 4345Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None); 4378Debug.Assert(relOp == QilNodeType.Eq || relOp == QilNodeType.Ne); 4398Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None); 4583Debug.Assert(xmlTypes == XmlNodeKindFlags.PI); 4616Debug.Assert(xmlTypes == XmlNodeKindFlags.Element); 4623Debug.Assert(!isXmlTypeUnion || (xmlTypes & XmlNodeKindFlags.Content) == XmlNodeKindFlags.Content); 4772Debug.Assert(!XmlILConstructInfo.Read(nd).PushToWriterLast); 4786Debug.Assert(!XmlILConstructInfo.Read(nd).PushToWriterLast); 4805Debug.Assert(!XmlILConstructInfo.Read(nd).PushToWriterLast); 4815Debug.Assert(!XmlILConstructInfo.Read(nd).PushToWriterLast); 4825Debug.Assert(nd.XmlType!.IsSingleton && !XmlILConstructInfo.Read(nd).PushToWriterLast); 4839Debug.Assert(!XmlILConstructInfo.Read(nd).PushToWriterLast);
System\Xml\Xsl\QIL\QilPatternFactory.cs (5)
26Debug.Assert(f != null); 595Debug.Assert(args.NodeType == QilNodeType.FormalParameterList); 600Debug.Assert(args.NodeType == QilNodeType.FormalParameterList); 606Debug.Assert(args.NodeType == QilNodeType.ActualParameterList); 607Debug.Assert(func.Arguments.Count == args.Count);
System\Xml\Xsl\QIL\QilValidationVisitor.cs (1)
36Debug.Assert(node != null);
System\Xml\Xsl\QIL\SubstitutionList.cs (1)
51Debug.Assert(_s.Count % 2 == 0);
System\Xml\Xsl\QueryReaderSettings.cs (1)
26Debug.Assert(xmlNameTable != null);
System\Xml\Xsl\Runtime\ContentIterators.cs (2)
116Debug.Assert(nodeType != XPathNodeType.Attribute && nodeType != XPathNodeType.Namespace); 440Debug.Assert(_state == IteratorState.HaveCurrentHaveNext);
System\Xml\Xsl\Runtime\DecimalFormatter.cs (3)
43Debug.Assert(formatPicture != null && decimalFormat != null); 266Debug.Assert(i + 1 < result.Length); 268Debug.Assert(char.IsAsciiDigit(ch) || ch == EscChar);
System\Xml\Xsl\Runtime\DocumentOrderComparer.cs (1)
40Debug.Assert(GetDocumentIndex(navThis) != GetDocumentIndex(navThat!));
System\Xml\Xsl\Runtime\EarlyBoundInfo.cs (1)
22Debug.Assert(namespaceUri != null && ebType != null);
System\Xml\Xsl\Runtime\NumberFormatter.cs (3)
81Debug.Assert(1 <= val && val <= MaxAlphabeticValue); 82Debug.Assert(Math.Pow(totalChars, MaxAlphabeticLength) >= MaxAlphabeticValue); 104Debug.Assert(1 <= val && val <= MaxRomanValue);
System\Xml\Xsl\Runtime\StringConcat.cs (1)
55Debug.Assert(value != null);
System\Xml\Xsl\Runtime\TreeIterators.cs (3)
498Debug.Assert(_state == IteratorState.HaveCurrentHaveNext || _state == IteratorState.HaveCurrentNoNext); 523Debug.Assert(_state == IteratorState.HaveCurrentHaveNext || _state == IteratorState.HaveCurrentNoNext); 834Debug.Assert(_state == IteratorState.HaveCurrentHaveNext || _state == IteratorState.HaveCurrentNoNext);
System\Xml\Xsl\Runtime\WhitespaceRuleLookup.cs (7)
39Debug.Assert(rules != null); 89Debug.Assert(_nameTable != null && _ruleTemp != null); 90Debug.Assert(localName != null && (object?)_nameTable.Get(localName) == (object)localName); 91Debug.Assert(namespaceName != null && (object?)_nameTable.Get(namespaceName) == (object)namespaceName); 173Debug.Assert(obj is InternalWhitespaceRule); 176Debug.Assert(LocalName != null && that!.LocalName != null); 177Debug.Assert(NamespaceName != null && that.NamespaceName != null);
System\Xml\Xsl\Runtime\WhitespaceRuleReader.cs (1)
49Debug.Assert(wsRules != null);
System\Xml\Xsl\Runtime\XmlAttributeCache.cs (6)
87Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 96Debug.Assert(_numEntries != 0); 144Debug.Assert(text != null); 145Debug.Assert(_arrAttrs != null && _numEntries != 0); 157Debug.Assert(_arrAttrs != null && _numEntries != 0); 361Debug.Assert(_numEntries == _arrAttrs.Length);
System\Xml\Xsl\Runtime\XmlCollation.cs (1)
104Debug.Assert(((int)value & Mask) == 0);
System\Xml\Xsl\Runtime\XmlExtensionFunction.cs (2)
221Debug.Assert(methMatch.ContainsGenericParameters == false); 308Debug.Assert(that != null);
System\Xml\Xsl\Runtime\XmlNavigatorFilter.cs (2)
159Debug.Assert(s_typeFilters[(int)nodeType] != null); 168Debug.Assert(nodeType != XPathNodeType.Attribute && nodeType != XPathNodeType.Namespace);
System\Xml\Xsl\Runtime\XmlNavigatorStack.cs (2)
53Debug.Assert(!IsEmpty); 62Debug.Assert(!IsEmpty);
System\Xml\Xsl\Runtime\XmlQueryOutput.cs (13)
231Debug.Assert(ValidateNames.ValidateName(prefix, localName, ns, XPathNodeType.Attribute, ValidateNames.Flags.All)); 538Debug.Assert(prefix != null && ns != null); 542Debug.Assert(prefix.Length == 0 || ns.Length != 0); 699Debug.Assert(prefix != null && ns != null); 1037Debug.Assert(navigator != null); 1205Debug.Assert(navigator.NodeType == XPathNodeType.Element); 1257Debug.Assert(rootType == XPathNodeType.Element || rootType == XPathNodeType.Comment || rootType == XPathNodeType.ProcessingInstruction); 1288Debug.Assert(rootType == XPathNodeType.Attribute || rootType == XPathNodeType.Namespace); 1319Debug.Assert(_nsmgr != null); 1351Debug.Assert(prefix.Length != 0 && ns.Length != 0); 1399Debug.Assert(prefix != null && !string.IsNullOrEmpty(ns)); 1505Debug.Assert(ValidateNames.ParseNCName(name.Name, 0) == name.Name.Length); 1554Debug.Assert(_stkNames != null);
System\Xml\Xsl\Runtime\XmlQueryRuntime.cs (9)
72Debug.Assert(data != null); 332Debug.Assert(_atomizedNames != null); 341Debug.Assert(_filters != null); 395Debug.Assert(_prefixMappingsList != null); 462Debug.Assert(_types != null); 829Debug.Assert(_collations != null); 890Debug.Assert(context != null); 927Debug.Assert(context != null); 1078Debug.Assert(node.NodeType == XPathNodeType.Namespace);
System\Xml\Xsl\Runtime\XmlQuerySequence.cs (1)
582Debug.Assert(cmp == XmlNodeOrder.Before || cmp == XmlNodeOrder.Unknown);
System\Xml\Xsl\Runtime\XmlQueryStaticData.cs (1)
41Debug.Assert(defaultWriterSettings != null && staticData != null);
System\Xml\Xsl\Runtime\XmlSortKey.cs (6)
70Debug.Assert(_nextKey != null && that._nextKey != null); 74Debug.Assert(_priority != that._priority); 85Debug.Assert(that != null && !(this is XmlEmptySortKey)); 125Debug.Assert(obj is XmlSortKey); 342Debug.Assert(_dblVal == double.NegativeInfinity || _dblVal == double.PositiveInfinity); 348Debug.Assert(that._dblVal == double.NegativeInfinity || that._dblVal == double.PositiveInfinity);
System\Xml\Xsl\Runtime\XslNumber.cs (5)
33Debug.Assert(startIdx >= 0 && tokLen > 0); 50Debug.Assert(startIdx >= 0 && tokLen > 0); 128Debug.Assert(groupingSeparator.Length <= 1); 274Debug.Assert(1 <= dblVal && dblVal < double.PositiveInfinity); 319Debug.Assert(groupSeparator.Length == 1);
System\Xml\Xsl\Runtime\XsltFunctions.cs (6)
69Debug.Assert(value.Length < startIndex || double.IsNaN(startIndex)); 91Debug.Assert(0 <= startIndex && startIndex <= endIndex && endIndex <= value.Length); 96Debug.Assert(endIndex <= startIndex || double.IsNaN(endIndex)); 283Debug.Assert(item is XPathNavigator); 345Debug.Assert(stringValue != null); 531Debug.Assert(lang != null);
System\Xml\Xsl\Runtime\XsltLibrary.cs (7)
384Debug.Assert(op == ComparisonOperator.Eq || op == ComparisonOperator.Ne); 391Debug.Assert(compType == TypeCode.Boolean); 399Debug.Assert(compType == TypeCode.Boolean || compType == TypeCode.Double || compType == TypeCode.String); 439Debug.Assert(op == ComparisonOperator.Eq || op == ComparisonOperator.Ne); 487Debug.Assert(ComparisonOperator.Lt <= op && op <= ComparisonOperator.Ge); 526Debug.Assert(XPathNodeType.SignificantWhitespace == XPathNodeType.Text + 1); 527Debug.Assert(XPathNodeType.Whitespace == XPathNodeType.Text + 2);
System\Xml\Xsl\SourceLineInfo.cs (3)
70Debug.Assert(lineInfo.Start.Line == lineInfo.End.Line); 71Debug.Assert(lineInfo.Start.Pos == 0 && lineInfo.End.Pos == 0); 84Debug.Assert(uriString != null);
System\Xml\Xsl\XmlILCommand.cs (2)
29Debug.Assert(delExec != null && staticData != null); 83Debug.Assert(results != null);
System\Xml\Xsl\XmlIlGenerator.cs (2)
136Debug.Assert(_qil.Root != null); 210Debug.Assert(ndParam.NodeType == QilNodeType.Parameter);
System\Xml\Xsl\XmlQueryCardinality.cs (1)
24Debug.Assert(0x00 <= value && value <= 0x07);
System\Xml\Xsl\XmlQueryType.cs (1)
509Debug.Assert(IsAtomicValue && baseType.IsAtomicValue);
System\Xml\Xsl\XmlQueryTypeFactory.cs (3)
63Debug.Assert(schemaType.DerivedBy == XmlSchemaDerivationMethod.Union); 470Debug.Assert(!isNillable); 513Debug.Assert(!IsAtomicValue || schemaType.Datatype!.Variety == XmlSchemaDatatypeVariety.Atomic);
System\Xml\Xsl\XPath\XPathBuilder.cs (17)
115Debug.Assert(op != XPathOperator.Unknown); 118Debug.Assert((opGroup != XPathOperatorGroup.Negate && right != null) || (opGroup == XPathOperatorGroup.Negate && right == null)); 136Debug.Assert(op == XPathOperator.Or || op == XPathOperator.And); 147Debug.Assert(compType == XmlTypeCode.Boolean || compType == XmlTypeCode.Double || compType == XmlTypeCode.String); 169Debug.Assert(val.XmlType!.IsSingleton); 214Debug.Assert(op == XPathOperator.Eq || op == XPathOperator.Ne); 247Debug.Assert(op == XPathOperator.Lt || op == XPathOperator.Le || op == XPathOperator.Gt || op == XPathOperator.Ge); 278Debug.Assert(op == XPathOperator.UnaryMinus); 301Debug.Assert(op == XPathOperator.Union); 853Debug.Assert(current != null); 866Debug.Assert(environment != null); 890Debug.Assert(unknown.NodeType == QilNodeType.Unknown); 933Debug.Assert(_last != null); 938Debug.Assert(unknown != null); 988Debug.Assert(maxArgs == 0 || maxArgs == Infinity || argTypes != null && argTypes.Length == maxArgs); 1024Debug.Assert(numArgs > maxArgs); 1046Debug.Assert(args.Count == 0 || argTypes != null);
System\Xml\Xsl\XPath\XPathParser.cs (4)
26Debug.Assert(_scanner == null && _builder == null); 27Debug.Assert(scanner != null && builder != null); 262Debug.Assert(scanner.Name == "processing-instruction"); 509Debug.Assert(IsPrimaryExpr());
System\Xml\Xsl\XPath\XPathQilFactory.cs (2)
133Debug.Assert(op == QilNodeType.Eq || op == QilNodeType.Ne); 149Debug.Assert(op == QilNodeType.Lt || op == QilNodeType.Le || op == QilNodeType.Gt || op == QilNodeType.Ge);
System\Xml\Xsl\XPath\XPathScanner.cs (20)
78Debug.Assert(xpathExpr != null); 93Debug.Assert(0 <= index && index <= _xpathExpr.Length); 100Debug.Assert(-1 <= _curIndex && _curIndex < _xpathExpr.Length); 108Debug.Assert(_curIndex == _xpathExpr.Length); 117Debug.Assert(_kind == LexKind.Name); 118Debug.Assert(_name != null); 127Debug.Assert(_kind == LexKind.Name); 128Debug.Assert(_prefix != null); 152Debug.Assert(_kind == LexKind.String); 153Debug.Assert(_stringValue != null); 167Debug.Assert(_kind == LexKind.Name); 176Debug.Assert(_kind == LexKind.Axis); 177Debug.Assert(_axis != XPathAxis.Unknown); 424Debug.Assert(_prefix != null); 425Debug.Assert(_name != null); 485Debug.Assert(IsAsciiDigit(_curChar) || _curChar == '.'); 530Debug.Assert(XmlCharType.IsStartNCNameSingleChar(_curChar)); 554Debug.Assert(LexKind.FirstStringable <= t); 571Debug.Assert(LexKind.FirstStringable <= t); 575Debug.Assert("()[].@,*/$}".Contains((char)t));
System\Xml\Xsl\XPathConvert.cs (116)
163Debug.Assert(0 != (u & 0x80000000)); 224Debug.Assert(dec.MantissaSize > 0); 235Debug.Assert(dec[ib] > 0 && dec[ib] <= 9); 246Debug.Assert(dec[ib] >= 0 && dec[ib] <= 9); 279Debug.Assert(exponent > 0 && exponent < 512); 296Debug.Assert(digit <= 9); 297Debug.Assert(0 != (_u2 & 0x80000000)); 301Debug.Assert(_exp >= 4); 351Debug.Assert(1 == rgu[4]); 378Debug.Assert(this.IsZero); 444Debug.Assert(0 != (_u2 & 0x80000000)); 445Debug.Assert(0 != (numOp._u2 & 0x80000000)); 459Debug.Assert(uHi < 0xFFFFFFFF); 464Debug.Assert(uHi < 0xFFFFFFFF); 472Debug.Assert(uHi < 0xFFFFFFFF); 480Debug.Assert(uHi < 0xFFFFFFFF); 488Debug.Assert(uHi < 0xFFFFFFFF); 494Debug.Assert(0 != uT); 496Debug.Assert(uHi < 0xFFFFFFFF); 504Debug.Assert(uHi < 0xFFFFFFFF); 512Debug.Assert(uHi < 0xFFFFFFFF); 521Debug.Assert(_error <= 2 || numOp._error <= 2); 545Debug.Assert(0 != (rgu5 & 0x40000000)); 568Debug.Assert(0 == rgu3); 569Debug.Assert(0 == rgu4); 570Debug.Assert(0 == rgu5); 596Debug.Assert(0 != (bn._u2 & 0x80000000)); 618Debug.Assert(wT >= 12 && wT < 32); 635Debug.Assert(wT > 0 && wT < 32); 673Debug.Assert(_exp <= 32); 683Debug.Assert(_error < 0xFFFFFFFF); 688Debug.Assert(0 == _u2 && 0 == _u1); 699Debug.Assert(_error < 0xFFFFFFFF); 735Debug.Assert(!IsSpecial(dbl)); 736Debug.Assert(0 < dbl); 813Debug.Assert(iT >= 0 && iT < 16); 817Debug.Assert(numHH._exp + tenPower._exp > 1); 826Debug.Assert(iT > 0 && iT <= 32); 828Debug.Assert(numHH._exp + tenPower._exp > 1); 837Debug.Assert(iT >= 0 && iT < 16); 841Debug.Assert(numHH._exp + tenPower._exp <= 32); 850Debug.Assert(iT > 0 && iT <= 32); 852Debug.Assert(numHH._exp + tenPower._exp <= 32); 859Debug.Assert(numHH._exp > 0 && numHH._exp < 32); 872Debug.Assert(uLL <= uLH && uLH <= uHL && uHL <= uHH); 900Debug.Assert(uHH >= uScale && uHH / uScale < 10); 904Debug.Assert(uLL <= uHH); 915Debug.Assert(0 != uHH || !numHH.IsZero); 948Debug.Assert(0 <= bLL && bLL < bHH && bHH <= 9); 992Debug.Assert(dblInt == Math.Floor(dblInt) && 1 <= dblInt && dblInt <= 9007199254740991.0d); 1011Debug.Assert(iT >= 0 && iT <= 15); 1012Debug.Assert(dblInt >= C10toN[iT] && dblInt < C10toN[iT + 1]); 1017Debug.Assert(iT >= 0); 1020Debug.Assert(dblInt == Math.Floor(dblInt) && 0 <= dblInt && dblInt < C10toN[iT]); 1035Debug.Assert(exponent == exponentPrec && mantissaSize == mantissaSizePrec); 1083Debug.Assert(!IsSpecial(dbl)); 1084Debug.Assert(0 < dbl); 1098Debug.Assert(0 == (dblHi & 0x7FF00000)); 1108Debug.Assert(0 != (DblHi(dblT) & 0x7FF00000)); 1150Debug.Assert(1 <= dblT && dblT < 2); 1196Debug.Assert(0 == c5Den); 1217Debug.Assert(cu <= 2); 1234Debug.Assert(c2Num > 0 && c2Den > 0); 1241Debug.Assert(0 == (biDen[biDen.Length - 1] & 0xF0000000)); 1242Debug.Assert(0 != (biDen[biDen.Length - 1] & 0x08000000)); 1714Debug.Assert(0 <= idx && idx < _length); 1722Debug.Assert(_capacity >= InitCapacity); 1723Debug.Assert(_length >= 0 && _length <= _capacity); 1730Debug.Assert(0 == _length || 0 != _digits[_length - 1]); 1759Debug.Assert(cu >= 0); 1779Debug.Assert(2 <= _capacity); 1796Debug.Assert((object)this != (object)biSrc); 1810Debug.Assert(dec.MantissaSize >= 0); 1823Debug.Assert(dec[ib] >= 0 && dec[ib] <= 9); 1833Debug.Assert(1 < uMul); 1843Debug.Assert(0 != uMul); 1867Debug.Assert(c5 >= 0); 1899Debug.Assert(cbit >= 0); 1966Debug.Assert(cu >= 0); 1987Debug.Assert(cbit >= 0); 2023Debug.Assert(obj != null); 2050Debug.Assert(idx >= 0 && idx < _length); 2051Debug.Assert(_digits[idx] != bi._digits[idx]); 2060Debug.Assert((object)this != (object)bi); 2114Debug.Assert((object)this != (object)bi); 2127Debug.Assert(0 == wCarry || 1 == wCarry); 2174Debug.Assert((object)this != (object)bi); 2182Debug.Assert(_length <= cu); 2190Debug.Assert(uQuo >= 0 && uQuo <= 9); 2205Debug.Assert(0 == wCarry || 1 == wCarry); 2217Debug.Assert(1 == wCarry); 2218Debug.Assert(idx == cu); 2241Debug.Assert(CompareTo(bi) < 0); 2342Debug.Assert(value <= MaxDigits); 2351Debug.Assert(0 <= ib && ib < _mantissaSize); 2370Debug.Assert(dbl == (double)this); 2375Debug.Assert(!this.Equals(decAfter)); 2380Debug.Assert(!this.Equals(decBefore)); 2472Debug.Assert(0 != mantissaSize && 0 != dec[0] && 0 != dec[mantissaSize - 1]); 2485Debug.Assert(dec[ib] >= 0 && dec[ib] <= 9); 2496Debug.Assert(dec[ib] >= 0 && dec[ib] <= 9); 2561Debug.Assert(dbl == dblLo); 2579Debug.Assert(dbl == (double)num); 2581Debug.Assert(dbl == dblLo || double.IsNaN(dblLo)); 2600Debug.Assert(double.IsNaN(dblLowPrec) || dblLowPrec == dbl); 2719Debug.Assert(c2Dbl < 32 || 0 != biDec[0]); 2737Debug.Assert(0 == c2Dbl || 0 == c2Dec); 2738Debug.Assert(0 == c5Dbl || 0 == c5Dec); 2874Debug.Assert(double.IsInfinity(dbl)); 2880Debug.Assert(0 != dec.MantissaSize); 2921Debug.Assert(dec[ib] >= 0 && dec[ib] <= 9); 2939Debug.Assert(0 != cntDigits); 2940Debug.Assert(sizeFract == cntDigits || sizeFract > cntDigits && pch[-1] == '0'); 2950Debug.Assert(sizeFract == cntDigits); 2954Debug.Assert(dec[ib] >= 0 && dec[ib] <= 9); 2960Debug.Assert(0 == sizeInt && 0 == cntDigits);
System\Xml\Xsl\XslException.cs (1)
164Debug.Assert(lineInfo == null || lineInfo.Uri != null);
System\Xml\Xsl\Xslt\Compiler.cs (9)
75Debug.Assert(stylesheet != null); 163Debug.Assert(var.NodeType == XslNodeType.Variable || var.NodeType == XslNodeType.Param); 201Debug.Assert(qname != null); 218Debug.Assert(nameTest != null); 235Debug.Assert(name != null); 279Debug.Assert(value <= ErrorCount); 302Debug.Assert((_savedErrorCount = -1) < 0); 305Debug.Assert((_savedErrorCount = -1) < 0); 452Debug.Assert(characters.Length == 8);
System\Xml\Xsl\Xslt\CompilerScopeManager.cs (6)
201Debug.Assert(varName.LocalName != null && varName.NamespaceUri != null); 209Debug.Assert(prefix != null); 249Debug.Assert(nsUri != null); 257Debug.Assert(recPrefix == null); 301Debug.Assert(localName != null); 415Debug.Assert(_scope._records[_currentRecord].IsNamespace);
System\Xml\Xsl\Xslt\Focus.cs (4)
47Debug.Assert(focusType != SingletonFocusType.Iterator); 109Debug.Assert(_current.Name!.NamespaceUri == XmlReservedNs.NsXslDebug && _current.Name.LocalName == "current"); 114Debug.Assert(_position.Name!.NamespaceUri == XmlReservedNs.NsXslDebug && _position.Name.LocalName == "position"); 119Debug.Assert(_last.Name!.NamespaceUri == XmlReservedNs.NsXslDebug && _last.Name.LocalName == "last");
System\Xml\Xsl\Xslt\InvokeGenerator.cs (2)
104Debug.Assert(argName != null); 151Debug.Assert(_invokeArgs[prevArg] is QilIterator);
System\Xml\Xsl\Xslt\KeyMatchBuilder.cs (4)
48Debug.Assert(base.numFixupLast == 0); 49Debug.Assert(base.numFixupPosition == 0); 77Debug.Assert(node != null); 78Debug.Assert(fixup != null);
System\Xml\Xsl\Xslt\MatcherBuilder.cs (6)
234Debug.Assert(!double.IsNaN(x!._priority)); 235Debug.Assert(!double.IsNaN(y!._priority)); 398Debug.Assert(patternList.Count > 0); 423Debug.Assert((int)(QilLiteral)matcher == NoMatch); 450Debug.Assert(pattern.Priority > lastPriority); 522Debug.Assert(priority == branches.Length - 1);
System\Xml\Xsl\Xslt\OutputScopeManager.cs (3)
60Debug.Assert(prefix != null); 61Debug.Assert(uri != null); 142Debug.Assert(prefix != null);
System\Xml\Xsl\Xslt\QilGenerator.cs (36)
136Debug.Assert(compiler != null); 227Debug.Assert(IsDebug && _curLoop.IsFocusSet); 436Debug.Assert(var.XmlType!.IsSubtypeOf(T.NamespaceS)); 437Debug.Assert(var.Binding is QilList); 446Debug.Assert(nsList[i].NodeType == QilNodeType.NamespaceDecl); 447Debug.Assert(varList[i].NodeType == QilNodeType.NamespaceDecl); 478Debug.Assert(tmpl != null && tmpl.Function == null); 479Debug.Assert(tmpl.NodeType == XslNodeType.AttributeSet || tmpl.NodeType == XslNodeType.Template); 508Debug.Assert(tmpl.NodeType == XslNodeType.Template); 643Debug.Assert(tmpl != null && tmpl.Function != null && tmpl.Function.Definition.NodeType == QilNodeType.Unknown); 700Debug.Assert(instructions != null); 983Debug.Assert(pos < source.Length); 1019Debug.Assert(i == source.Length || source[i] == '{'); 1073Debug.Assert(avt != null); 1125Debug.Assert(_curLoop.IsFocusSet); 1179Debug.Assert(withParam.NodeType == XslNodeType.WithParam); 1215Debug.Assert(node.NodeType == XslNodeType.ApplyImports); 1417Debug.Assert(when.NodeType == XslNodeType.If || when.NodeType == XslNodeType.Otherwise); 1460Debug.Assert(node.NodeType == XslNodeType.Variable); 1470Debug.Assert(node.NodeType == XslNodeType.Variable || node.NodeType == XslNodeType.Param || node.NodeType == XslNodeType.WithParam); 1502Debug.Assert(varValue.SourceLine == null); 1508Debug.Assert(withParam.NodeType == XslNodeType.WithParam); 1718Debug.Assert(result.XmlType == T.StringX); 1726Debug.Assert(sort.NodeType == XslNodeType.Sort); 2119Debug.Assert(num.Level == NumberLevel.Any); 2139Debug.Assert(sheet.TemplateMatches.Count == 0); 2223Debug.Assert(varPar.NodeType == XslNodeType.Variable || varPar.NodeType == XslNodeType.Param); 2259Debug.Assert(varPar.NodeType == XslNodeType.Variable || varPar.NodeType == XslNodeType.Param); 2346Debug.Assert(expr != null); 2375Debug.Assert(pttrn != null); 2401Debug.Assert(pttrn != null); 2515Debug.Assert( 2800Debug.Assert(n.SourceLine == null); 2824Debug.Assert(nsVar.XmlType!.IsSubtypeOf(T.NamespaceS)); 2869Debug.Assert(let.NodeType == QilNodeType.Let); 2875Debug.Assert(0 <= varScope && varScope <= _vars.Count);
System\Xml\Xsl\Xslt\QilGeneratorEnv.cs (6)
76Debug.Assert(ns != null); 146Debug.Assert(ns != null); 409Debug.Assert(name.XmlType == T.StringX && key.XmlType == T.StringX); 439Debug.Assert(defList != null && defList.Count > 0); 456Debug.Assert(defList != null && defList.Count > 0); 667Debug.Assert(propValue.ValueType == typeof(double));
System\Xml\Xsl\Xslt\QilStrConcatenator.cs (3)
28Debug.Assert(!_inUse); 61Debug.Assert(value.XmlType!.TypeCode == XmlTypeCode.String); 76Debug.Assert(_inUse); // If we want allow multiple calls to ToQil() this logic should be changed
System\Xml\Xsl\Xslt\Stylesheet.cs (2)
86Debug.Assert(var.NodeType == XslNodeType.Variable || var.NodeType == XslNodeType.Param); 104Debug.Assert(template.ImportPrecedence == 0);
System\Xml\Xsl\Xslt\XPathPatternBuilder.cs (18)
28Debug.Assert(environment != null); 53Debug.Assert(filter.Variable.XmlType!.IsSubtypeOf(T.NodeNotRtf)); 54Debug.Assert(filter.Variable.Binding!.NodeType == QilNodeType.Unknown); // fixupNode 55Debug.Assert(filter.Body.XmlType!.IsSubtypeOf(T.Boolean)); 80Debug.Assert(op == XPathOperator.Union); 81Debug.Assert(left != null); 82Debug.Assert(right != null); 122Debug.Assert( 190Debug.Assert(left != null); 191Debug.Assert(right != null); 195Debug.Assert(nop.Child == _fixupNode); 200Debug.Assert(left.NodeType == QilNodeType.Filter); 209Debug.Assert(nop.Child != null); 213Debug.Assert(right.NodeType == QilNodeType.Filter); 215Debug.Assert(lastParent != null); 291Debug.Assert(prefix.Length == 0); 355Debug.Assert(parent.NodeType == QilNodeType.Filter); 430Debug.Assert(current != null);
System\Xml\Xsl\Xslt\XPathPatternParser.cs (7)
27Debug.Assert(_scanner == null && _ptrnBuilder == null); 28Debug.Assert(scanner != null && ptrnBuilder != null); 124Debug.Assert(_scanner!.CanBeFunction); 125Debug.Assert(_scanner.Prefix.Length == 0); 126Debug.Assert(_scanner.Name == "id" || _scanner.Name == "key"); 258Debug.Assert(_scanner!.Kind == LexKind.LBracket); 261Debug.Assert(_scanner.Kind == LexKind.RBracket);
System\Xml\Xsl\Xslt\XslAst.cs (5)
68Debug.Assert(nsUri != null || Prefix == null); 119Debug.Assert(node != null); 162Debug.Assert(node != null && node.NodeType == XslNodeType.List); 250Debug.Assert(list != null && list.Count > 0); 265Debug.Assert(name != null);
System\Xml\Xsl\Xslt\XslAstAnalyzer.cs (8)
286Debug.Assert(tmpl.Match != null); 408Debug.Assert(target != null); 429Debug.Assert(instr.NodeType == XslNodeType.WithParam); 1014Debug.Assert(op != XPathOperator.Unknown); 1407Debug.Assert(split > 0); 1436Debug.Assert(scoperecord.IsNamespace || scoperecord.ncName == null); 1437Debug.Assert(!Compiler.IsPhantomNamespace(scoperecord.nsUri!)); 1478Debug.Assert(parent.Content.Count == split + 1);
System\Xml\Xsl\Xslt\XsltInput.cs (21)
43Debug.Assert(reader != null); 44Debug.Assert(atoms != null); 201Debug.Assert( 244Debug.Assert(_reader.NodeType == XmlNodeType.EntityReference); 246Debug.Assert(local[0] == '#' || local == "lt" || local == "gt" || local == "quot" || local == "apos"); 258Debug.Assert(_reader.NodeType == XmlNodeType.Text || _reader.NodeType == XmlNodeType.Whitespace || _reader.NodeType == XmlNodeType.SignificantWhitespace); 261Debug.Assert(_reader.NodeType == XmlNodeType.EndEntity); 332Debug.Assert(_reader.NodeType != XmlNodeType.EntityReference); 441Debug.Assert(_nodeType == XmlNodeType.Text || _nodeType == XmlNodeType.Whitespace || _nodeType == XmlNodeType.SignificantWhitespace); 488Debug.Assert(_reader.NodeType == XmlNodeType.Element); 650Debug.Assert(IsKeyword(_atoms.Version)); 714Debug.Assert(NodeType == XmlNodeType.Element); 715Debug.Assert(attributes.Length <= _xsltAttributeNumber.Length); 843Debug.Assert(NodeType == XmlNodeType.Element); 921Debug.Assert(NodeType == XmlNodeType.Element && IsXsltNamespace()); 948Debug.Assert(extensions ? IsKeyword(_atoms.ExtensionElementPrefixes) : IsKeyword(_atoms.ExcludeResultPrefixes)); 1001Debug.Assert(IsKeyword(_atoms.XPathDefaultNamespace)); 1013Debug.Assert(IsKeyword(_atoms.DefaultCollation)); 1095Debug.Assert(prefix != null); 1179Debug.Assert(input.NodeType == XmlNodeType.EndElement); 1184Debug.Assert(input.NodeType == XmlNodeType.Element || input.NodeType == XmlNodeType.Attribute);
System\Xml\Xsl\Xslt\XsltLoader.cs (29)
43Debug.Assert(compiler != null); 102Debug.Assert(compiler.Root != null); 298Debug.Assert(_input.NodeType == XmlNodeType.Element); 323Debug.Assert(!_input.IsXsltNamespace()); 324Debug.Assert(_curTemplate == null); 355Debug.Assert(_input.IsXsltNamespace() && (_input.IsKeyword(_atoms.Stylesheet) || _input.IsKeyword(_atoms.Transform))); 468Debug.Assert(_input.NodeType == XmlNodeType.Text); 825Debug.Assert(attSet != null); 836Debug.Assert(attSet.CycleCheck == CycleCheck.Processing); 837Debug.Assert(attSet.Content[0].SourceLine != null); 957Debug.Assert(NumCharAttrs == DefaultValues.Length); 993Debug.Assert(name.Equals(format.Name)); 1112Debug.Assert(_input.NodeType == XmlNodeType.Text); 1123Debug.Assert(_curTemplate == null); 1124Debug.Assert(_input.CanHaveApplyImports == false); 1141Debug.Assert(_curTemplate == null); 1455Debug.Assert(_input.NodeType == XmlNodeType.Text); 1503Debug.Assert(_input.NodeType == XmlNodeType.Text); 1716Debug.Assert(_input.NodeType == XmlNodeType.Text); 1921Debug.Assert(nodeType != XslNodeType.Unknown); 2034Debug.Assert(_input.NodeType == XmlNodeType.Element); 2480Debug.Assert(_input.NodeType == XmlNodeType.Element); 2523Debug.Assert(content != null && withParam != null); 2524Debug.Assert(withParam.NodeType == XslNodeType.WithParam); 2537Debug.Assert(content != null); 2546Debug.Assert(content != null); 3073Debug.Assert(node != null); 3080Debug.Assert(node != null); 3090Debug.Assert(to != null);
System\Xml\Xsl\Xslt\XsltQilFactory.cs (2)
140Debug.Assert(format != null); 153Debug.Assert(format != null);
System\Xml\Xsl\XsltOld\ActionFrame.cs (7)
100Debug.Assert(_variables != null && index < _variables.Length); 106Debug.Assert(_variables != null && index < _variables.Length); 129Debug.Assert(nodeSet != null); 136Debug.Assert(nodeSet != null); 143Debug.Assert(0 < sortarray.Count); 184Debug.Assert(parent != null); 221Debug.Assert(_action is ContainerAction);
System\Xml\Xsl\XsltOld\ApplyImportsAction.cs (1)
29Debug.Assert(processor != null && frame != null);
System\Xml\Xsl\XsltOld\ApplyTemplatesAction.cs (7)
32Debug.Assert(s_BuiltInRule != null); 45Debug.Assert(mode != null); 65Debug.Assert(_mode == null); 133Debug.Assert(processor != null && frame != null); 169Debug.Assert(frame.State == ProcessNextNode); 170Debug.Assert(frame.NewNodeSet != null); 184Debug.Assert(frame.State == PositionAdvanced);
System\Xml\Xsl\XsltOld\AttributeAction.cs (1)
118Debug.Assert(processor != null && frame != null);
System\Xml\Xsl\XsltOld\AttributeSetAction.cs (1)
34Debug.Assert(this.name == null);
System\Xml\Xsl\XsltOld\Avt.cs (6)
21Debug.Assert(constAvt != null); 27Debug.Assert(eventList != null); 45Debug.Assert(_constAvt != null); 50Debug.Assert(processor != null && frame != null); 65Debug.Assert(compiler != null); 66Debug.Assert(avtText != null);
System\Xml\Xsl\XsltOld\AvtEvent.cs (2)
18Debug.Assert(key != Compiler.InvalidQueryKey); 24Debug.Assert(_key != Compiler.InvalidQueryKey);
System\Xml\Xsl\XsltOld\BeginEvent.cs (2)
26Debug.Assert(input != null); 27Debug.Assert(input.NodeType != XPathNodeType.Namespace);
System\Xml\Xsl\XsltOld\BuilderInfo.cs (1)
85Debug.Assert(info.NodeType != XmlNodeType.Text || XmlCharType.IsOnlyWhitespace(info.Value));
System\Xml\Xsl\XsltOld\CallTemplateAction.cs (2)
30Debug.Assert(_name == null); 84Debug.Assert(processor != null && frame != null);
System\Xml\Xsl\XsltOld\CommentAction.cs (1)
26Debug.Assert(processor != null && frame != null);
System\Xml\Xsl\XsltOld\Compiler.cs (33)
100Debug.Assert(_atoms != null); 123Debug.Assert(Document != null); 129Debug.Assert(Document != null); 135Debug.Assert(Document != null); 149Debug.Assert(_rootAction == null); 151Debug.Assert(_currentTemplate == null); 172Debug.Assert(input != null); 173Debug.Assert(xmlResolver != null); 174Debug.Assert(_input == null && _atoms == null); 186Debug.Assert(_input != null && _atoms != null); 216Debug.Assert(_rootAction != null); 217Debug.Assert(this.stylesheet != null); 218Debug.Assert(_queryStore != null); 219Debug.Assert(_input == null && _atoms == null); 321Debug.Assert(_rootAction != null); 326Debug.Assert(_currentTemplate != null); 327Debug.Assert(variable.VarType == VariableType.LocalVariable || variable.VarType == VariableType.LocalParameter || variable.VarType == VariableType.WithParameter); 464Debug.Assert(value != null); 465Debug.Assert((object)value == (object)Input!.Value); // this is always true. Why we passing value to this function. 568Debug.Assert(_xmlResolver != null); 580Debug.Assert(_xmlResolver != null); 605Debug.Assert(newInput != null); 618Debug.Assert(_input != null); 619Debug.Assert(_input.Atoms == _atoms); 654Debug.Assert(this.stylesheet == _stylesheets!.Peek()); 666Debug.Assert(this.stylesheet == _stylesheets!.Peek()); 676Debug.Assert(this.stylesheet == _stylesheets!.Peek()); 682Debug.Assert(_currentTemplate != null); 690Debug.Assert(_currentTemplate != null); 709Debug.Assert(_queryStore != null); 781Debug.Assert( 898Debug.Assert(start <= avt.Length); 922Debug.Assert(avtText != null);
System\Xml\Xsl\XsltOld\ContainerAction.cs (7)
168Debug.Assert(compiler.Input.NodeType == XPathNodeType.Element); 230Debug.Assert(uri != null); 674Debug.Assert(Ref.Equal(input.NamespaceURI, input.Atoms.UriXsl)); 758Debug.Assert(action != null); 854Debug.Assert((object)this == (object)compiler.RootAction); 953Debug.Assert(processor != null && frame != null); 981Debug.Assert(actionIndex == 0 || this.containedActions != null);
System\Xml\Xsl\XsltOld\CopyAction.cs (1)
52Debug.Assert(processor != null && frame != null);
System\Xml\Xsl\XsltOld\CopyAttributesAction.cs (13)
22Debug.Assert(s_Action != null); 28Debug.Assert(processor != null && frame != null); 45Debug.Assert(frame.State == BeginEvent); 46Debug.Assert(frame.Node!.NodeType == XPathNodeType.Attribute); 57Debug.Assert(frame.State == TextEvent); 58Debug.Assert(frame.Node!.NodeType == XPathNodeType.Attribute); 69Debug.Assert(frame.State == EndEvent); 70Debug.Assert(frame.Node!.NodeType == XPathNodeType.Attribute); 81Debug.Assert(frame.State == Advance); 82Debug.Assert(frame.Node!.NodeType == XPathNodeType.Attribute); 102Debug.Assert(node.NodeType == XPathNodeType.Attribute); 108Debug.Assert(node.NodeType == XPathNodeType.Attribute); 114Debug.Assert(node.NodeType == XPathNodeType.Attribute);
System\Xml\Xsl\XsltOld\CopyCodeAction.cs (5)
31Debug.Assert(copyEvents != null); 46Debug.Assert(processor != null && frame != null); 47Debug.Assert(_copyEvents != null && _copyEvents.Count > 0); 57Debug.Assert(frame.State == Outputting); 61Debug.Assert(frame.Counter < _copyEvents.Count);
System\Xml\Xsl\XsltOld\CopyNamespacesAction.cs (8)
19Debug.Assert(s_Action != null); 25Debug.Assert(processor != null && frame != null); 42Debug.Assert(frame.State == BeginEvent); 43Debug.Assert(frame.Node!.NodeType == XPathNodeType.Namespace); 54Debug.Assert(frame.State == EndEvent); 55Debug.Assert(frame.Node!.NodeType == XPathNodeType.Namespace); 66Debug.Assert(frame.State == Advance); 67Debug.Assert(frame.Node!.NodeType == XPathNodeType.Namespace);
System\Xml\Xsl\XsltOld\CopyNodeSetAction.cs (5)
24Debug.Assert(s_Action != null); 30Debug.Assert(processor != null && frame != null); 47Debug.Assert(frame.State == BeginEvent); 58Debug.Assert(frame.State == Contents); 97Debug.Assert(frame.State == EndEvent);
System\Xml\Xsl\XsltOld\CopyOfAction.cs (4)
44Debug.Assert(processor != null && frame != null); 49Debug.Assert(frame.NodeSet != null); 83Debug.Assert(frame.StoredOutput != null); 89Debug.Assert(frame.State == NodeSetCopied);
System\Xml\Xsl\XsltOld\DocumentScope.cs (4)
28Debug.Assert(prefix != null && prefix.Length > 0); 34Debug.Assert(scope.Uri != null); 44Debug.Assert(prefix != null && prefix.Length > 0); 50Debug.Assert(scope.Uri != null);
System\Xml\Xsl\XsltOld\ElementAction.cs (2)
70Debug.Assert(_empty == false); 103Debug.Assert(processor != null && frame != null);
System\Xml\Xsl\XsltOld\EndEvent.cs (1)
17Debug.Assert(nodeType != XPathNodeType.Namespace);
System\Xml\Xsl\XsltOld\ForEachAction.cs (4)
54Debug.Assert(processor != null && frame != null); 71Debug.Assert(processor.SortArray.Count != 0); 78Debug.Assert(frame.State == ProcessNextNode); 79Debug.Assert(frame.NewNodeSet != null);
System\Xml\Xsl\XsltOld\IfAction.cs (3)
65Debug.Assert(processor != null && frame != null); 72Debug.Assert(_testKey != Compiler.InvalidQueryKey); 88Debug.Assert(frame.Container != null);
System\Xml\Xsl\XsltOld\InputScope.cs (1)
92Debug.Assert(variable != null);
System\Xml\Xsl\XsltOld\InputScopeManager.cs (9)
32Debug.Assert(_scopeStack != null); 33Debug.Assert(_scopeStack.Parent != null); 76Debug.Assert(prefix != null); 77Debug.Assert(nspace != null); 96Debug.Assert(!string.IsNullOrEmpty(prefix)); 119Debug.Assert(prefix != null); 129Debug.Assert(prefix != null); 140Debug.Assert(nsList != null); 163Debug.Assert(nsList != null);
System\Xml\Xsl\XsltOld\MessageAction.cs (2)
46Debug.Assert(processor != null && frame != null); 58Debug.Assert(recOutput != null);
System\Xml\Xsl\XsltOld\NameSpaceEvent.cs (4)
18Debug.Assert(input != null); 19Debug.Assert(input.NodeType == XPathNodeType.Namespace); 44Debug.Assert(res); // Namespace node as any other attribute can't fail because it doesn't signal record change 46Debug.Assert(res);
System\Xml\Xsl\XsltOld\NavigatorInput.cs (2)
212Debug.Assert(navigator.NameTable != null); 237Debug.Assert(_Navigator != null);
System\Xml\Xsl\XsltOld\NavigatorOutput.cs (2)
28Debug.Assert(record != null); 40Debug.Assert(record.AttributeList[attrib] is BuilderInfo);
System\Xml\Xsl\XsltOld\newinstructionaction.cs (1)
51Debug.Assert(processor != null && frame != null);
System\Xml\Xsl\XsltOld\NumberAction.cs (12)
84Debug.Assert(dblVal >= 1); 256Debug.Assert( 342Debug.Assert(nav.NodeType != XPathNodeType.Attribute && nav.NodeType != XPathNodeType.Namespace); 343Debug.Assert(MatchCountKey(processor, contextNode, nav)); 371Debug.Assert(!(value is int)); 394Debug.Assert(processor != null && frame != null); 399Debug.Assert(frame != null); 400Debug.Assert(frame.NodeSet != null); 445Debug.Assert(frame.StoredOutput != null); 515Debug.Assert(prefix == null || prefix.isSeparator); 536Debug.Assert(thisSeparator.isSeparator); 541Debug.Assert(!thisFormat.isSeparator);
System\Xml\Xsl\XsltOld\OutKeywords.cs (3)
17Debug.Assert(nameTable != null); 115Debug.Assert(keyword != null); 116Debug.Assert((object)keyword == (object?)_NameTable.Get(keyword));
System\Xml\Xsl\XsltOld\OutputScope.cs (1)
85Debug.Assert(urn != null);
System\Xml\Xsl\XsltOld\OutputScopeManager.cs (14)
30Debug.Assert(_elementScopesStack.Peek() != null); // We adding rootElementScope to garantee this 47Debug.Assert(nameTable != null); 48Debug.Assert(atoms != null); 68Debug.Assert(prefix != null); 69Debug.Assert(nspace != null); 80Debug.Assert(name != null); 81Debug.Assert(nspace != null); 82Debug.Assert(prefix != null); 92Debug.Assert(elementScope != null); 100Debug.Assert(elementScope != null); // We're adding rootElementScope to guarantee this 115Debug.Assert(prefix != null); 135Debug.Assert(_elementScopesStack[i] is OutputScope); 152Debug.Assert(nspace != null); 155Debug.Assert(_elementScopesStack[i] is OutputScope);
System\Xml\Xsl\XsltOld\PrefixQName.cs (1)
36Debug.Assert(qname != null);
System\Xml\Xsl\XsltOld\ProcessingInstructionAction.cs (2)
61Debug.Assert(processor != null && frame != null); 88Debug.Assert(frame.StoredOutput != null);
System\Xml\Xsl\XsltOld\Processor.cs (28)
128Debug.Assert(_execResult == ExecResult.Continue); 280Debug.Assert(!_stringBuilderLocked); 437Debug.Assert(_actionStack != null); 445Debug.Assert(_builder != null); 477Debug.Assert(frame != null); 506Debug.Assert(_templateLookup != null); 513Debug.Assert(key != Compiler.InvalidQueryKey); 519Debug.Assert(key != Compiler.InvalidQueryKey); 534Debug.Assert(key != Compiler.InvalidQueryKey); 603Debug.Assert(nav.NodeType == XPathNodeType.Element); 722Debug.Assert(_builder != null); 732Debug.Assert(_xsm != null); 746Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State); 747Debug.Assert(ExecutionResult == ExecResult.Continue); 751Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State); 775Debug.Assert(_xsm != null); 788Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State); 789Debug.Assert(ExecutionResult == ExecResult.Continue); 793Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State); 810Debug.Assert(_xsm != null); 824Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State); 934Debug.Assert(navigator != null); 957Debug.Assert(output != null); 968Debug.Assert(_builder != null); 1017Debug.Assert(saveStackSize == _actionStack.Length); 1030Debug.Assert(1 < _actionStack.Length); 1043Debug.Assert(2 < _actionStack.Length); 1086Debug.Assert(2 <= _debuggerStack!.Length);
System\Xml\Xsl\XsltOld\ReaderOutput.cs (28)
43Debug.Assert(processor != null); 44Debug.Assert(processor.NameTable != null); 190Debug.Assert(ordinal >= 0); 195Debug.Assert(ordinal == -1); 205Debug.Assert(ordinal >= 0); 210Debug.Assert(ordinal == -1); 236Debug.Assert(ordinal >= 0); 242Debug.Assert(ordinal == -1); 252Debug.Assert(ordinal >= 0); 258Debug.Assert(ordinal == -1); 274Debug.Assert(_attributeCount == 0); 308Debug.Assert(_processor != null || _state == ReadState.Closed); 360Debug.Assert(_processor.ExecutionDone); 446Debug.Assert(_builder != null); 450Debug.Assert(NodeType == XmlNodeType.EndElement); 484Debug.Assert(_builder != null); 518Debug.Assert(_nameTable != null); 536Debug.Assert(NodeType != XmlNodeType.EntityReference); 604Debug.Assert(0 <= attrib && attrib < _attributeCount); 605Debug.Assert(0 <= attrib && attrib < _attributeList!.Count); 606Debug.Assert(_attributeList[attrib] is BuilderInfo); 617Debug.Assert(_attributeList![attrib] is BuilderInfo); 629Debug.Assert(_attributeList![index] is BuilderInfo); 649Debug.Assert(_attributeList![index] is BuilderInfo); 676Debug.Assert(_currentInfo != null); 677Debug.Assert(_attributeCount == 0 || _attributeList != null); 678Debug.Assert((_currentIndex == -1) == (_currentInfo == _mainNode)); 679Debug.Assert((_currentIndex == -1) || (_currentInfo == _attributeValue || _attributeList![_currentIndex] is BuilderInfo && _attributeList[_currentIndex] == _currentInfo));
System\Xml\Xsl\XsltOld\RecordBuilder.cs (24)
55Debug.Assert(output != null); 110Debug.Assert(_recordState != HaveRecord); 134Debug.Assert(_recordState == NoRecord || (state & StateMachine.BeginRecord) == 0); 186Debug.Assert(_recordState == NoRecord || (state & StateMachine.BeginRecord) == 0); 257Debug.Assert(_attributeCount <= _attributeList.Count); 261Debug.Assert(_attributeList[attrib] != null && _attributeList[attrib] is BuilderInfo); 284Debug.Assert(_attributeCount == 0); 298Debug.Assert(_attributeCount == 0); 312Debug.Assert(_attributeCount == _attributeList.Count); 327Debug.Assert(_attributeList[attrib] != null && _attributeList[attrib] is BuilderInfo); 413Debug.Assert(_recordState == NoRecord || _recordState == SomeRecord); 440Debug.Assert(_recordState == NoRecord || _recordState == SomeRecord); 458Debug.Assert(_recordState == NoRecord || _recordState == SomeRecord); 476Debug.Assert(_mainNode != null); 487Debug.Assert(_mainNode.NodeType == XmlNodeType.Element); 491Debug.Assert(_attributeList[attr] is BuilderInfo); 512Debug.Assert(_mainNode.NodeType == XmlNodeType.Element); 562Debug.Assert(_attributeList[attr] is BuilderInfo); 614Debug.Assert(_mainNode.NodeType == XmlNodeType.Comment); 615Debug.Assert((object?)_currentInfo == (object)_mainNode); 667Debug.Assert(_mainNode.NodeType == XmlNodeType.ProcessingInstruction || _mainNode.NodeType == XmlNodeType.XmlDeclaration); 740Debug.Assert(_namespaceCount == _namespaceList.Count); 750Debug.Assert(_namespaceList[index] != null && _namespaceList[index] is BuilderInfo); 781Debug.Assert(prefix != null && prefix.Length > 0);
System\Xml\Xsl\XsltOld\RootAction.cs (5)
187Debug.Assert(mark == null); 252Debug.Assert(processor != null && frame != null); 269Debug.Assert(frame.State == QueryInitialized); 271Debug.Assert(Processor.IsRoot(frame.Node!)); 284Debug.Assert(frame.State == RootProcessed);
System\Xml\Xsl\XsltOld\SequentialOutput.cs (11)
109Debug.Assert(record.MainNode.NodeType == XmlNodeType.Element); 407Debug.Assert(_outputCache[record] is BuilderInfo); 536Debug.Assert(value != null); 542Debug.Assert(value != null); 574Debug.Assert(value != null); 575Debug.Assert(_isHtmlOutput); 630Debug.Assert(value != null); 631Debug.Assert(find.Length == replace.Length); 681Debug.Assert(value != null); 687Debug.Assert(count <= list.Count); 690Debug.Assert(list[attrib] is BuilderInfo);
System\Xml\Xsl\XsltOld\SortAction.cs (2)
174Debug.Assert(processor != null && frame != null); 175Debug.Assert(frame.State == Initialized);
System\Xml\Xsl\XsltOld\StateMachine.cs (4)
100Debug.Assert(newState != Assrt); 107Debug.Assert(newState != Assrt); 119Debug.Assert(newState != Assrt); 126Debug.Assert(newState != Assrt);
System\Xml\Xsl\XsltOld\Stylesheet.cs (18)
150Debug.Assert(attributeSet.Name != null); 172Debug.Assert(_templateNameTable != null); 202Debug.Assert(_templates == null); 206Debug.Assert(manager != null); 220Debug.Assert(enumerator.Value is TemplateManager); 230Debug.Assert(_imports[importIndex] is Stylesheet); 232Debug.Assert(stylesheet != null); 283Debug.Assert(processor != null && navigator != null); 284Debug.Assert(mode != null); 296Debug.Assert(manager.Mode.Equals(mode)); 320Debug.Assert(_imports[importIndex] is Stylesheet); 322Debug.Assert(stylesheet != null); 342Debug.Assert(processor != null && navigator != null); 343Debug.Assert(_templates == null && _modeManagers == null || _templates == _modeManagers![XmlQualifiedName.Empty]); 388Debug.Assert(_imports[importIndex] is Stylesheet); 390Debug.Assert(stylesheet != null); 420Debug.Assert(_imports[importIndex] is Stylesheet); 422Debug.Assert(stylesheet != null);
System\Xml\Xsl\XsltOld\TemplateAction.cs (6)
48Debug.Assert(_templateId == 0); 96Debug.Assert(_matchKey == Compiler.InvalidQueryKey); 101Debug.Assert(_name == null); 106Debug.Assert(double.IsNaN(_priority)); 115Debug.Assert(_mode == null); 225Debug.Assert(processor != null && frame != null);
System\Xml\Xsl\XsltOld\TemplateLookupAction.cs (7)
25Debug.Assert(processor != null && frame != null); 26Debug.Assert(frame.State == Initialized); 59Debug.Assert(node != null); 98Debug.Assert(processor != null && frame != null); 99Debug.Assert(frame.State == Initialized); 100Debug.Assert(processor.Debugger != null); 108Debug.Assert(this.mode != Compiler.BuiltInMode);
System\Xml\Xsl\XsltOld\TemplateManager.cs (8)
22Debug.Assert(x != null && x is TemplateAction); 23Debug.Assert(y != null && y is TemplateAction); 28Debug.Assert(!double.IsNaN(tx.Priority)); 29Debug.Assert(!double.IsNaN(ty.Priority)); 33Debug.Assert(tx.TemplateId != ty.TemplateId || tx == ty); 58Debug.Assert(template != null); 59Debug.Assert( 82Debug.Assert(this.templates != null);
System\Xml\Xsl\XsltOld\TextAction.cs (1)
69Debug.Assert(processor != null && frame != null);
System\Xml\Xsl\XsltOld\TextEvent.cs (2)
19Debug.Assert(text != null); 26Debug.Assert(input.NodeType == XPathNodeType.Text || input.NodeType == XPathNodeType.SignificantWhitespace);
System\Xml\Xsl\XsltOld\UseAttributeSetsAction.cs (2)
26Debug.Assert(Ref.Equal(compiler.Input.LocalName, compiler.Atoms.UseAttributeSets)); 29Debug.Assert(_useAttributeSets == null);
System\Xml\Xsl\XsltOld\ValueOfAction.cs (9)
22Debug.Assert(s_BuiltInRule != null); 56Debug.Assert(processor != null && frame != null); 61Debug.Assert(frame != null); 62Debug.Assert(frame.NodeSet != null); 78Debug.Assert(frame.StoredOutput != null); 95Debug.Assert(processor != null && frame != null); 100Debug.Assert(frame != null); 101Debug.Assert(frame.NodeSet != null); 117Debug.Assert(frame.StoredOutput != null);
System\Xml\Xsl\XsltOld\VariableAction.cs (4)
98Debug.Assert(this.name == null && this.nameStr == null); 116Debug.Assert(processor != null && frame != null && frame.State != ValueCalculated); 169Debug.Assert(recOutput is NavigatorOutput); 174Debug.Assert(value != null);
System\Xml\Xsl\XsltOld\WithParamAction.cs (2)
34Debug.Assert(processor != null && frame != null); 61Debug.Assert(recOutput is NavigatorOutput);
System\Xml\Xsl\XsltOld\WriterOutput.cs (2)
91Debug.Assert(list.Count >= count); 94Debug.Assert(list[attrib] is BuilderInfo);
System\Xml\Xsl\XsltOld\XsltCompileContext.cs (7)
255Debug.Assert(thisUri != null && baseUri != null); 656Debug.Assert(it != null); 920Debug.Assert(resultCollection.Count != 0); 921Debug.Assert(newList.Count != 0); 925Debug.Assert(resultCollection[0] is XPathNavigator); 962Debug.Assert(extension != null); 963Debug.Assert(method != null);
System\Xml\Xsl\XsltOld\XsltOutput.cs (1)
147Debug.Assert(_encoding != null);
System\Xml\Xslt\XslTransform.cs (6)
112Debug.Assert(_QueryStore != null); 113Debug.Assert(_RootAction != null); 245Debug.Assert(stylesheet != null); 251Debug.Assert(compiler.CompiledStylesheet != null); 252Debug.Assert(compiler.QueryStore != null); 253Debug.Assert(compiler.RootAction != null);
System.Private.Xml.Linq (12)
System\Xml\Linq\XContainer.cs (1)
1247Debug.Assert(content != null);
System\Xml\Linq\XElement.cs (1)
1982Debug.Assert(e != null);
System\Xml\Linq\XHelper.cs (1)
13Debug.Assert(type != null);
System\Xml\Linq\XNode.cs (1)
65Debug.Assert(parent.content != null);
System\Xml\Linq\XObject.cs (1)
144Debug.Assert(type != null);
System\Xml\Schema\XNodeValidator.cs (6)
95Debug.Assert(sa.AttributeSchemaType != null); 98Debug.Assert(st.Datatype != null); 102Debug.Assert(st.Content != null); 108Debug.Assert(mt.Datatype != null); 109Debug.Assert(value != null); 313Debug.Assert(si.SchemaElement != null);
System\Xml\XPath\XNodeNavigator.cs (1)
883Debug.Assert(navigator.UnderlyingObject != null);
System.Reflection.Context (72)
System\Reflection\Context\Custom\AttributeUtils.cs (2)
156Debug.Assert(attributeFilterType.IsInstanceOfType(newAttribute)); 162Debug.Assert(attributeFilterType.IsAssignableFrom(attributeType));
System\Reflection\Context\Custom\CustomType.cs (2)
265Debug.Assert(types == null || types.Length == 0); 277Debug.Assert(getPropertySetter && types != null && types.Length == 1);
System\Reflection\Context\CustomReflectionContext.Projector.cs (16)
27Debug.Assert(ReflectionContext.SourceContext != null); 40Debug.Assert(ReflectionContext.SourceContext != null); 55Debug.Assert(NeedsProjection(value)); 66Debug.Assert(NeedsProjection(value)); 77Debug.Assert(NeedsProjection(value)); 88Debug.Assert(NeedsProjection(value)); 99Debug.Assert(NeedsProjection(value)); 110Debug.Assert(NeedsProjection(value)); 121Debug.Assert(NeedsProjection(value)); 149Debug.Assert(NeedsProjection(value)); 160Debug.Assert(NeedsProjection(value)); 171Debug.Assert(NeedsProjection(value)); 182Debug.Assert(NeedsProjection(value)); 193Debug.Assert(NeedsProjection(value)); 204Debug.Assert(NeedsProjection(value)); 215Debug.Assert(NeedsProjection(value));
System\Reflection\Context\Delegation\DelegatingAssembly.cs (1)
20Debug.Assert(null != assembly);
System\Reflection\Context\Delegation\DelegatingConstructorInfo.cs (1)
14Debug.Assert(null != constructor);
System\Reflection\Context\Delegation\DelegatingCustomAttributeData.cs (1)
13Debug.Assert(null != attribute);
System\Reflection\Context\Delegation\DelegatingEventInfo.cs (1)
13Debug.Assert(null != @event);
System\Reflection\Context\Delegation\DelegatingExceptionHandlingClause.cs (1)
14Debug.Assert(clause != null);
System\Reflection\Context\Delegation\DelegatingFieldInfo.cs (1)
14Debug.Assert(null != field);
System\Reflection\Context\Delegation\DelegatingLocalVariableInfo.cs (1)
12Debug.Assert(variable != null);
System\Reflection\Context\Delegation\DelegatingManifestResourceInfo.cs (1)
13Debug.Assert(null != resource);
System\Reflection\Context\Delegation\DelegatingMethodBody.cs (1)
15Debug.Assert(null != body);
System\Reflection\Context\Delegation\DelegatingMethodInfo.cs (1)
16Debug.Assert(null != method);
System\Reflection\Context\Delegation\DelegatingModule.cs (1)
14Debug.Assert(null != module);
System\Reflection\Context\Delegation\DelegatingParameterInfo.cs (1)
13Debug.Assert(null != parameter);
System\Reflection\Context\Delegation\DelegatingPropertyInfo.cs (1)
14Debug.Assert(null != property);
System\Reflection\Context\Delegation\DelegatingType.cs (2)
18Debug.Assert(null != type); 398Debug.Assert(bindingAttr == (BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public));
System\Reflection\Context\Projection\ProjectingAssembly.cs (1)
18Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingConstructorInfo.cs (1)
16Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingCustomAttributeData.cs (1)
18Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingEventInfo.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingExceptionHandlingClause.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingFieldInfo.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingLocalVariableInfo.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingManifestResourceInfo.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingMethodBody.cs (1)
18Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingMethodInfo.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingModule.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingParameterInfo.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingPropertyInfo.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingType.cs (2)
19Debug.Assert(null != projector); 255Debug.Assert(i == members.Length);
System\Reflection\Context\Projection\Projector.cs (5)
37Debug.Assert(!(value is IProjectable) || ((IProjectable)value).Projector != this); 107Debug.Assert(value != null); 125Debug.Assert(null != project); 126Debug.Assert(values != null && values.Count > 0); 134Debug.Assert(NeedsProjection(value));
System\Reflection\Context\Virtual\InheritedMethodInfo.cs (4)
18Debug.Assert(reflectedType != null); 19Debug.Assert(reflectedType.IsSubclassOf(baseMethod.DeclaringType!)); 20Debug.Assert(baseMethod is VirtualMethodBase); 23Debug.Assert(baseMethod.ReflectedType!.Equals(baseMethod.DeclaringType));
System\Reflection\Context\Virtual\InheritedPropertyInfo.cs (4)
18Debug.Assert(reflectedType != null); 19Debug.Assert(reflectedType.IsSubclassOf(baseProperty.DeclaringType!)); 20Debug.Assert(baseProperty is VirtualPropertyBase); 23Debug.Assert(baseProperty.ReflectedType!.Equals(baseProperty.DeclaringType));
System\Reflection\Context\Virtual\VirtualParameter.cs (1)
22Debug.Assert(position >= -1);
System\Reflection\Context\Virtual\VirtualPropertyBase.cs (3)
29Debug.Assert(context != null); 88Debug.Assert(getMethod != null || setMethod != null); 219Debug.Assert(null != method);
System\Reflection\Context\Virtual\VirtualPropertyBase.FuncPropertyAccessorBase.cs (1)
14Debug.Assert(null != declaringProperty);
System\Reflection\Context\Virtual\VirtualPropertyInfo.cs (2)
47Debug.Assert(_getter == null || _getter.IsPublic); 54Debug.Assert(_setter == null || _setter.IsPublic);
System\Reflection\Context\Virtual\VirtualPropertyInfo.PropertyGetter.cs (1)
21Debug.Assert(null != getter);
System\Reflection\Context\Virtual\VirtualPropertyInfo.PropertySetter.cs (1)
22Debug.Assert(null != setter);
System.Reflection.DispatchProxy (11)
System\Reflection\DispatchProxyGenerator.cs (11)
68Debug.Assert(baseType != null); 69Debug.Assert(interfaceType != null); 72Debug.Assert(alc != null); 296Debug.Assert(baseCtor != null); 405Debug.Assert(ei.EventHandlerType != null); 607Debug.Assert(!target.IsByRef); 613Debug.Assert(!isAddress); 624Debug.Assert(!opCode.Equals(OpCodes.Nop)); 629Debug.Assert(source.IsAssignableFrom(target)); 646Debug.Assert(source.IsAssignableFrom(target) || target.IsInterface || source.IsInterface); 706Debug.Assert(_paramTypes[i].IsByRef);
System.Reflection.Emit (27)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeNameBuilder.cs (6)
37Debug.Assert(_instNesting != 0); 53Debug.Assert(_instNesting != 0); 69Debug.Assert(_instNesting != 0); 81Debug.Assert(name != null); 93Debug.Assert(rank > 0); 134Debug.Assert(_instNesting == 0);
System\Reflection\Emit\FieldBuilderImpl.cs (1)
127Debug.Assert(binaryAttribute.Length >= 6);
System\Reflection\Emit\ILGeneratorImpl.cs (2)
455Debug.Assert(labelStartDepth >= -1); 456Debug.Assert(targetDepth >= -1);
System\Reflection\Emit\ModuleBuilderImpl.cs (8)
154Debug.Assert(typeBuilder._handle.Equals(typeHandle)); 364Debug.Assert(method._handle == handle); 494Debug.Assert(previousNonHiddenStartColumn < 0); 572Debug.Assert(deltaLines != 0 || deltaColumns != 0 || sequencePoint.IsHidden); 582Debug.Assert(deltaLines > 0); 635Debug.Assert(field._handle == handle); 995Debug.Assert(tb.IsCreated()); 1002Debug.Assert(eb._typeBuilder.IsCreated());
System\Reflection\Emit\PseudoCustomAttributesData.cs (10)
151Debug.Assert(_marshalArrayElementCount >= 0); 181Debug.Assert(_marshalArrayElementType >= 0); 241Debug.Assert(parameterIndex == null || parameterIndex >= 0 && parameterIndex <= MaxMarshalInteger); 249Debug.Assert(elementCount == null || elementCount >= 0 && elementCount <= MaxMarshalInteger); 250Debug.Assert(parameterIndex == null || parameterIndex >= 0); 260Debug.Assert(elementCount == null || elementCount >= 0 && elementCount <= MaxMarshalInteger); 261Debug.Assert(elementType == null || elementType >= 0 && (int)elementType <= MaxMarshalInteger); 270Debug.Assert(elementType == null || elementType >= 0 && (int)elementType <= MaxMarshalInteger); 279Debug.Assert(elementCount >= 0 && elementCount <= MaxMarshalInteger); 287Debug.Assert(type >= 0 && (int)type <= MaxMarshalInteger);
System.Reflection.Metadata (368)
src\libraries\Common\src\System\HexConverter.cs (1)
165Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Reflection\AssemblyNameFormatter.cs (1)
16Debug.Assert(name.Length != 0);
src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (1)
66Debug.Assert(input.Length > 0);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
System\Reflection\Internal\MemoryBlocks\ByteArrayMemoryProvider.cs (2)
19Debug.Assert(!array.IsDefault); 25Debug.Assert(disposing);
System\Reflection\Internal\MemoryBlocks\ExternalMemoryBlockProvider.cs (1)
44Debug.Assert(disposing);
System\Reflection\Internal\MemoryBlocks\StreamMemoryBlockProvider.cs (2)
40Debug.Assert(stream.CanSeek && stream.CanRead); 51Debug.Assert(disposing);
System\Reflection\Internal\Utilities\BitArithmetic.cs (3)
49Debug.Assert(CountBits(alignment) == 1); 62Debug.Assert(position >= 0 && alignment > 0); 63Debug.Assert(CountBits(alignment) == 1);
System\Reflection\Internal\Utilities\BlobUtilities.cs (6)
16Debug.Assert(buffer.Length > 0); 82Debug.Assert(written); 119Debug.Assert(byteCount >= charCount); 131Debug.Assert(*charPtr <= 0x7f); 185Debug.Assert(ptr == bufferPtr + start + byteCount); 186Debug.Assert(charPtr == strEnd);
System\Reflection\Internal\Utilities\EncodingHelper.netcoreapp.cs (2)
19Debug.Assert(utf8Decoder != null); 36Debug.Assert(utf8Decoder != null);
System\Reflection\Internal\Utilities\ImmutableMemoryStream.cs (1)
17Debug.Assert(!array.IsDefault);
System\Reflection\Internal\Utilities\MemoryBlock.cs (9)
21Debug.Assert(length >= 0 && (buffer != null || length == 0)); 297Debug.Assert(terminator <= 0x7F); 316Debug.Assert(terminator <= 0x7f); 338Debug.Assert(asciiChar != 0 && asciiChar <= 0x7f); 377Debug.Assert(result == FastComparisonResult.Inconclusive); 397Debug.Assert(terminator <= 0x7F); 460Debug.Assert(asciiPrefix[i] > 0 && asciiPrefix[i] <= 0x7f); 484Debug.Assert(asciiString[i] > 0 && asciiString[i] <= 0x7f); 848Debug.Assert(i == result.Length);
System\Reflection\Internal\Utilities\PooledStringBuilder.cs (2)
24Debug.Assert(pool != null); 67Debug.Assert(builder.Builder.Length == 0);
System\Reflection\Internal\Utilities\StreamExtensions.cs (1)
60Debug.Assert(count > 0);
System\Reflection\Metadata\BlobBuilder.cs (18)
124Debug.Assert(_buffer != null); 125Debug.Assert(Length >= 0 && Length <= _buffer.Length); 126Debug.Assert(_nextOrPrevious != null); 130Debug.Assert(_previousLengthOrFrozenSuffixLengthDelta >= 0); 136Debug.Assert(chunk.IsHead || chunk.Length > 0); 140Debug.Assert(totalLength == Count); 150Debug.Assert(IsHead); 155Debug.Assert(IsHead); 231Debug.Assert(leftStart == 0 || rightStart == 0); 283Debug.Assert(bufferStart >= chunkStart); 288Debug.Assert(bytesToCopy >= 0); 302Debug.Assert(bufferStart == bufferEnd); 597Debug.Assert(byteCount >= 0); 616Debug.Assert(byteCount <= MinChunkSize); 945Debug.Assert(unchecked((ushort)reference) == reference); 1077Debug.Assert(start >= 0); 1078Debug.Assert(length >= 0); 1079Debug.Assert(start + length <= str.Length);
System\Reflection\Metadata\BlobBuilder.Enumerators.cs (1)
22Debug.Assert(builder.IsHead);
System\Reflection\Metadata\BlobReader.cs (3)
40Debug.Assert(block.Length >= 0 && (block.Pointer != null || block.Length == 0)); 138Debug.Assert(remainder >= 0 && remainder < alignment); 514Debug.Assert(bytesRead == 4);
System\Reflection\Metadata\BlobWriter.cs (5)
40Debug.Assert(buffer != null); 41Debug.Assert(count >= 0); 42Debug.Assert(count <= buffer.Length - start); 109Debug.Assert(value >= 0); 359Debug.Assert(unchecked((ushort)reference) == reference);
System\Reflection\Metadata\BlobWriterImpl.cs (1)
18Debug.Assert(value <= MaxCompressedIntegerValue);
System\Reflection\Metadata\Ecma335\BlobDictionary.cs (1)
58Debug.Assert(immutableKey.AsSpan().SequenceEqual(key));
System\Reflection\Metadata\Ecma335\Encoding\ControlFlowBuilder.cs (9)
119Debug.Assert(operandOffset >= 0); 120Debug.Assert(_branches.Count == 0 || operandOffset > _branches[_branches.Count - 1].OperandOffset); 126Debug.Assert(opCode.GetBranchOperandSize() == 1); 129Debug.Assert(opCode == ILOpCode.Switch || opCode.GetBranchOperandSize() == 4); 132Debug.Assert(instructionEndDisplacement > 4 && instructionEndDisplacement % 4 == 0 && opCode == ILOpCode.Switch); 141Debug.Assert(ilOffset >= 0); 295Debug.Assert( 319Debug.Assert( 414Debug.Assert(_lazyExceptionHandlers != null);
System\Reflection\Metadata\Ecma335\Encoding\ExceptionRegionEncoder.cs (2)
82Debug.Assert(exceptionRegionCount > 0); 99Debug.Assert(dataSize <= 0x00ffffff);
System\Reflection\Metadata\Ecma335\Encoding\LabelHandle.cs (1)
18Debug.Assert(id >= 1);
System\Reflection\Metadata\Ecma335\Encoding\SwitchInstructionEncoder.cs (1)
22Debug.Assert(encoder.ControlFlowBuilder is not null);
System\Reflection\Metadata\Ecma335\MetadataAggregator.cs (3)
67Debug.Assert(baseTableRowCounts != null); 271Debug.Assert(sizes[generation] == size); 304Debug.Assert(sizes[generation].AggregateInserts == rowId);
System\Reflection\Metadata\Ecma335\MetadataBuilder.cs (5)
17Debug.Assert(HeapIndex.UserString == 0); 18Debug.Assert((int)HeapIndex.String == 1); 19Debug.Assert((int)HeapIndex.Blob == 2); 20Debug.Assert((int)HeapIndex.Guid == 3); 97Debug.Assert(endOffset - startOffset == sizes.MetadataHeaderSize);
System\Reflection\Metadata\Ecma335\MetadataBuilder.Tables.cs (2)
1872Debug.Assert(metadataSizes.MetadataTableStreamSize == endPosition - startPosition); 1919Debug.Assert(metadataSizes.CalculateTableStreamHeaderSize() == endPosition - startPosition);
System\Reflection\Metadata\Ecma335\MetadataReaderExtensions.cs (2)
126Debug.Assert(reader != null); 227Debug.Assert(reader != null);
System\Reflection\Metadata\Ecma335\MetadataRootBuilder.cs (1)
61Debug.Assert(BlobUtilities.GetUTF8ByteCount(DefaultMetadataVersionString) == DefaultMetadataVersionString.Length);
System\Reflection\Metadata\Ecma335\MetadataSizes.cs (18)
127Debug.Assert(rowCounts.Length == MetadataTokens.TableCount); 128Debug.Assert(externalRowCounts.Length == MetadataTokens.TableCount); 129Debug.Assert(heapSizes.Length == MetadataTokens.HeapCount); 155Debug.Assert((PresentTablesMask & ExternalTablesMask) == 0); 275Debug.Assert(rowCounts[(int)TableIndex.FieldPtr] == 0); 277Debug.Assert(rowCounts[(int)TableIndex.MethodPtr] == 0); 279Debug.Assert(rowCounts[(int)TableIndex.ParamPtr] == 0); 291Debug.Assert(rowCounts[(int)TableIndex.EventPtr] == 0); 294Debug.Assert(rowCounts[(int)TableIndex.PropertyPtr] == 0); 305Debug.Assert(rowCounts[(int)TableIndex.AssemblyProcessor] == 0); 306Debug.Assert(rowCounts[(int)TableIndex.AssemblyOS] == 0); 308Debug.Assert(rowCounts[(int)TableIndex.AssemblyRefProcessor] == 0); 309Debug.Assert(rowCounts[(int)TableIndex.AssemblyRefOS] == 0); 362Debug.Assert(RegularStreamHeaderSizes == 369Debug.Assert(EncDeltaMarkerStreamHeaderSize == GetMetadataStreamHeaderSize("#JTD")); 370Debug.Assert(StandalonePdbStreamHeaderSize == GetMetadataStreamHeaderSize("#Pdb")); 445Debug.Assert(result % StreamAlignment == 0); 480Debug.Assert(RowCounts[(int)table] == 0 || ExternalRowCounts[(int)table] == 0);
System\Reflection\Metadata\Ecma335\PortablePdbBuilder.cs (3)
63Debug.Assert(BlobUtilities.GetUTF8ByteCount(MetadataVersion) == MetadataVersion.Length); 116Debug.Assert(_serializedMetadata.Sizes.CalculateStandalonePdbStreamSize() == endPosition - startPosition); 150Debug.Assert(idWriter.RemainingBytes == 0);
System\Reflection\Metadata\Ecma335\SignatureDecoder.cs (1)
323Debug.Assert(handle.IsNil); // will fall through to throw in release.
System\Reflection\Metadata\EntityHandle.cs (1)
93Debug.Assert(!IsVirtual);
System\Reflection\Metadata\Handle.cs (9)
38Debug.Assert(value >= 0); 45Debug.Assert(IsHeapHandle && value <= HeapHandleType.OffsetMask || 54Debug.Assert(!IsHeapHandle); 64Debug.Assert(IsHeapHandle); 92Debug.Assert((_value & TokenTypeIds.RIDMask) == _value); 104Debug.Assert((_value & TokenTypeIds.RIDMask) == _value); 155Debug.Assert(IsEntityOrUserStringHandle); 156Debug.Assert(!IsVirtual); 157Debug.Assert((_value & TokenTypeIds.RIDMask) == _value);
System\Reflection\Metadata\IL\MethodBodyBlock.cs (1)
29Debug.Assert(!exceptionRegions.IsDefault);
System\Reflection\Metadata\Internal\MetadataWriterUtilities.cs (1)
19Debug.Assert(!value.GetType().GetTypeInfo().IsEnum);
System\Reflection\Metadata\Internal\NamespaceCache.cs (14)
21Debug.Assert(reader != null); 36Debug.Assert(!handle.HasFullName); // we should not hit the cache in this case. 44Debug.Assert(_rootNamespace != null); 78Debug.Assert(!handleContainingSegment.IsVirtual); 93Debug.Assert(lastFoundIndex >= 0 || currentSegment == 0); 178Debug.Assert(data.Namespaces!.Count == 0); 208Debug.Assert(realChild.HasFullName); 233Debug.Assert(child != null && parent != null); 234Debug.Assert(!child.Handle.IsNil); 247Debug.Assert(realChild.Handle.HasFullName); 327Debug.Assert(table != null); 359Debug.Assert(table != null); 377Debug.Assert(namespaceHandle.HasFullName); 397Debug.Assert(_namespaceTable != null);
System\Reflection\Metadata\Internal\StringHeap.cs (11)
164Debug.Assert(handle.StringKind != StringKind.Virtual); 172Debug.Assert(handle.StringKind != StringKind.Virtual); 183Debug.Assert(handle.StringKind != StringKind.Virtual); 194Debug.Assert(handle.IsVirtual); 206Debug.Assert(handle.IsVirtual); 249Debug.Assert(value != null); 268Debug.Assert(value != null); 290Debug.Assert(!rawHandle.IsVirtual); 300Debug.Assert(asciiChar != 0 && asciiChar <= 0x7f); 309Debug.Assert(!rawHandle.IsVirtual); 319Debug.Assert(!rawHandle.IsVirtual);
System\Reflection\Metadata\Internal\Tables.cs (11)
44Debug.Assert(NumberOfRows > 0); 50Debug.Assert(NumberOfRows > 0); 56Debug.Assert(NumberOfRows > 0); 62Debug.Assert(NumberOfRows > 0); 68Debug.Assert(NumberOfRows > 0); 1909Debug.Assert(NumberOfRows == 1); 1915Debug.Assert(NumberOfRows == 1); 1925Debug.Assert(NumberOfRows == 1); 1931Debug.Assert(NumberOfRows == 1); 1937Debug.Assert(NumberOfRows == 1); 1943Debug.Assert(NumberOfRows == 1);
System\Reflection\Metadata\MetadataReader.cs (5)
129Debug.Assert(AssemblyTable.NumberOfRows <= 1); 787Debug.Assert(local.Length == external.Length); 1429Debug.Assert(!enclosingClass.IsNil); 1443Debug.Assert(builder == groupedNestedTypes[enclosingClass]); 1466Debug.Assert(_lazyNestedTypesMap != null);
System\Reflection\Metadata\MetadataReader.WinMD.cs (10)
96Debug.Assert(s_projectionInfos != null && projectionIndex >= 0 && projectionIndex < s_projectionInfos.Length); 102Debug.Assert(s_projectionInfos != null && projectionIndex >= 0 && projectionIndex < s_projectionInfos.Length); 108Debug.Assert(s_projectionInfos != null && projectionIndex >= 0 && projectionIndex < s_projectionInfos.Length); 114Debug.Assert(s_projectionInfos != null && projectionIndex >= 0 && projectionIndex < s_projectionInfos.Length); 187Debug.Assert(k == keys.Length && v == keys.Length && k == v); 200Debug.Assert(string.CompareOrdinal(keys[i], keys[i + 1]) < 0); 223Debug.Assert(_metadataKind != MetadataKind.Ecma335); 320Debug.Assert(_metadataKind != MetadataKind.Ecma335); 513Debug.Assert(!namespaceHandle.IsVirtual && !nameHandle.IsVirtual); 667Debug.Assert(_metadataKind != MetadataKind.Ecma335);
System\Reflection\Metadata\MetadataReaderProvider.cs (2)
35Debug.Assert(metadataBlock != null); 41Debug.Assert(blockProvider != null);
System\Reflection\Metadata\MetadataStringComparer.cs (1)
54Debug.Assert(reader != null);
System\Reflection\Metadata\MetadataStringDecoder.cs (1)
70Debug.Assert(Encoding != null);
System\Reflection\Metadata\PortablePdb\CustomDebugInformation.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\PortablePdb\Document.cs (2)
23Debug.Assert(reader != null); 24Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\PortablePdb\DocumentNameBlobHandle.cs (1)
28Debug.Assert(HeapHandleType.IsValidHeapOffset((uint)heapOffset));
System\Reflection\Metadata\PortablePdb\HandleCollections.Debug.cs (8)
20Debug.Assert(reader != null); 119Debug.Assert(reader != null); 218Debug.Assert(reader != null); 426Debug.Assert(reader != null); 532Debug.Assert(reader != null); 638Debug.Assert(reader != null); 737Debug.Assert(reader != null); 746Debug.Assert(reader != null);
System\Reflection\Metadata\PortablePdb\Handles.Debug.cs (7)
18Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 101Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 196Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 279Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 362Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 445Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 528Debug.Assert(TokenTypeIds.IsValidRowId(rowId));
System\Reflection\Metadata\PortablePdb\ImportDefinition.cs (1)
24Debug.Assert(
System\Reflection\Metadata\PortablePdb\ImportScope.cs (2)
23Debug.Assert(reader != null); 24Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\PortablePdb\LocalConstant.cs (2)
23Debug.Assert(reader != null); 24Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\PortablePdb\LocalScope.cs (2)
23Debug.Assert(reader != null); 24Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\PortablePdb\LocalVariable.cs (2)
23Debug.Assert(reader != null); 24Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\PortablePdb\MethodDebugInformation.cs (1)
23Debug.Assert(reader != null);
System\Reflection\Metadata\PortablePdb\SequencePointCollection.cs (1)
101Debug.Assert(_previousNonHiddenStartColumn == 0);
System\Reflection\Metadata\TypeNameParserHelpers.cs (2)
24Debug.Assert(genericArgs.Length > 0); 183Debug.Assert(rankOrModifier >= 2);
System\Reflection\Metadata\TypeSystem\AssemblyDefinition.cs (1)
14Debug.Assert(reader != null);
System\Reflection\Metadata\TypeSystem\AssemblyFile.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\AssemblyReference.cs (3)
20Debug.Assert(reader != null); 21Debug.Assert(treatmentAndRowId != 0); 24Debug.Assert((treatmentAndRowId & ~(TokenTypeIds.VirtualBit | TokenTypeIds.RIDMask)) == 0);
System\Reflection\Metadata\TypeSystem\Constant.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(rowId != 0);
System\Reflection\Metadata\TypeSystem\CustomAttribute.cs (2)
18Debug.Assert(reader != null); 19Debug.Assert(treatmentAndRowId != 0);
System\Reflection\Metadata\TypeSystem\DeclarativeSecurityAttribute.cs (2)
18Debug.Assert(reader != null); 19Debug.Assert(rowId != 0);
System\Reflection\Metadata\TypeSystem\EventDefinition.cs (2)
19Debug.Assert(reader != null); 20Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\ExportedType.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(rowId != 0);
System\Reflection\Metadata\TypeSystem\FieldDefinition.cs (2)
18Debug.Assert(reader != null); 19Debug.Assert(treatmentAndRowId != 0);
System\Reflection\Metadata\TypeSystem\GenericParameter.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\GenericParameterConstraint.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\HandleCollections.TypeSystem.cs (23)
237Debug.Assert(reader != null); 245Debug.Assert(reader != null); 357Debug.Assert(reader != null); 365Debug.Assert(reader != null); 366Debug.Assert(!handle.IsNil); 464Debug.Assert(reader != null); 472Debug.Assert(reader != null); 473Debug.Assert(!containingType.IsNil); 584Debug.Assert(reader != null); 592Debug.Assert(reader != null); 593Debug.Assert(!containingType.IsNil); 704Debug.Assert(reader != null); 712Debug.Assert(reader != null); 713Debug.Assert(!containingType.IsNil); 824Debug.Assert(reader != null); 832Debug.Assert(reader != null); 833Debug.Assert(!containingType.IsNil); 942Debug.Assert(reader != null); 1047Debug.Assert(reader != null); 1048Debug.Assert(!containingMethod.IsNil); 1159Debug.Assert(reader != null); 1160Debug.Assert(!implementingType.IsNil); 1660Debug.Assert(reader != null);
System\Reflection\Metadata\TypeSystem\Handles.TypeSystem.cs (43)
18Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 101Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 184Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 267Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 362Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 445Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 528Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 611Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 694Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 777Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 860Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 943Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1026Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1109Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1192Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1275Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1358Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1441Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1524Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1629Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1635Debug.Assert(virtualIndex < VirtualIndex.Count); 1725Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1808Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1891Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1974Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 2057Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 2149Debug.Assert((offset & 0xFF000000) == 0); 2299Debug.Assert((value & StringHandleType.TypeMask) == StringHandleType.String || 2314Debug.Assert(virtualIndex < VirtualIndex.Count); 2325Debug.Assert(StringKind == StringKind.Plain); 2331Debug.Assert(StringKind == StringKind.Plain); 2337Debug.Assert(StringKind == StringKind.Plain); 2338Debug.Assert(prefixByteLength >= 0); 2383Debug.Assert(!IsVirtual || StringKind == StringKind.WinRTPrefixed); 2389Debug.Assert(IsVirtual && StringKind != StringKind.WinRTPrefixed); 2395Debug.Assert(IsNil || IsVirtual && StringKind == StringKind.Virtual); 2462Debug.Assert(virtualIndex != 0); 2507Debug.Assert(!IsVirtual); 2518Debug.Assert(HasFullName); 2588Debug.Assert(virtualIndex < VirtualIndex.Count); 2596Debug.Assert(blob.Length >= TemplateParameterOffset_AttributeUsageTarget + 4); 2633Debug.Assert(!IsVirtual); 2639Debug.Assert(IsVirtual);
System\Reflection\Metadata\TypeSystem\InterfaceImplementation.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\ManifestResource.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\MemberReference.cs (2)
18Debug.Assert(reader != null); 19Debug.Assert(treatmentAndRowId != 0);
System\Reflection\Metadata\TypeSystem\MethodDefinition.cs (2)
18Debug.Assert(reader != null); 19Debug.Assert(treatmentAndRowId != 0);
System\Reflection\Metadata\TypeSystem\MethodImplementation.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\MethodSpecification.cs (2)
18Debug.Assert(reader != null); 19Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\ModuleDefinition.cs (1)
14Debug.Assert(reader != null);
System\Reflection\Metadata\TypeSystem\ModuleReference.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\NamespaceDefinition.cs (1)
16Debug.Assert(data != null);
System\Reflection\Metadata\TypeSystem\Parameter.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\PropertyDefinition.cs (2)
19Debug.Assert(reader != null); 20Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\StandaloneSignature.cs (2)
19Debug.Assert(reader != null); 20Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\TypeDefinition.cs (2)
19Debug.Assert(reader != null); 20Debug.Assert(treatmentAndRowId != 0);
System\Reflection\Metadata\TypeSystem\TypeReference.cs (2)
18Debug.Assert(reader != null); 19Debug.Assert(treatmentAndRowId != 0);
System\Reflection\Metadata\TypeSystem\TypeSpecification.cs (2)
18Debug.Assert(reader != null); 19Debug.Assert(!handle.IsNil);
System\Reflection\PortableExecutable\DebugDirectory\CodeViewDebugDirectoryData.cs (1)
27Debug.Assert(path != null);
System\Reflection\PortableExecutable\DebugDirectory\PdbChecksumDebugDirectoryData.cs (2)
23Debug.Assert(!string.IsNullOrEmpty(algorithmName)); 24Debug.Assert(!checksum.IsDefaultOrEmpty);
System\Reflection\PortableExecutable\ManagedPEBuilder.cs (2)
187Debug.Assert(_nativeResourcesOpt != null); 207Debug.Assert(builder.Count == 0);
System\Reflection\PortableExecutable\ManagedTextSection.cs (16)
150Debug.Assert(MetadataSize % 4 == 0); 151Debug.Assert(ResourceDataSize % 4 == 0); 190Debug.Assert(MappedFieldDataSize % MappedFieldDataAlignment == 0); 251Debug.Assert(builder.Count == 0); 252Debug.Assert(metadataBuilder.Count == MetadataSize); 253Debug.Assert(metadataBuilder.Count % 4 == 0); 254Debug.Assert(ilBuilder.Count == ILStreamSize); 255Debug.Assert((mappedFieldDataBuilderOpt?.Count ?? 0) == MappedFieldDataSize); 256Debug.Assert((resourceBuilderOpt?.Count ?? 0) == ResourceDataSize); 257Debug.Assert((resourceBuilderOpt?.Count ?? 0) % 4 == 0); 311Debug.Assert(builder.Count == ComputeSizeOfTextSection()); 333Debug.Assert(builder.Count - start == SizeOfImportAddressTable); 370Debug.Assert(builder.Count - start == SizeOfImportTable); 380Debug.Assert(builder.Count - start == SizeOfNameTable); 435Debug.Assert(builder.Count - start == CorHeaderSize); 436Debug.Assert(builder.Count % 4 == 0);
System\Reflection\PortableExecutable\PEBinaryReader.cs (4)
28Debug.Assert(size >= 0 && size <= (stream.Length - stream.Position)); 113Debug.Assert(count <= sizeof(long)); // Error message assumes we're trying to read constant small number of bytes. 114Debug.Assert(_reader.BaseStream.Position >= 0 && _maxOffset >= 0); 125Debug.Assert(startPosition >= 0 && _maxOffset >= 0);
System\Reflection\PortableExecutable\PEBuilder.cs (5)
118Debug.Assert(stampWriter.RemainingBytes == 0); 157Debug.Assert(DosHeader.Length == DosHeaderSize); 497Debug.Assert(peImage != null); 498Debug.Assert(signatureProvider != null); 533Debug.Assert(segment.Count > 0);
System\Reflection\PortableExecutable\PEHeader.cs (1)
307Debug.Assert(magic == PEMagic.PE32);
System\Reflection\PortableExecutable\PEMemoryBlock.cs (2)
19Debug.Assert(block != null); 20Debug.Assert(offset >= 0 && offset <= block.Size);
System\Reflection\PortableExecutable\PEReader.cs (5)
301Debug.Assert(_lazyPEHeaders != null); 333Debug.Assert(imageStartPosition >= 0 && imageStartPosition <= stream.Length); 383Debug.Assert(index >= 0 && index < PEHeaders.SectionHeaders.Length); 539Debug.Assert(PEHeaders.PEHeader != null); 763Debug.Assert(errorToReport is BadImageFormatException || errorToReport is IOException);
System.Reflection.MetadataLoadContext (145)
System\CoreRtBridge.cs (1)
21Debug.Assert(t.IsGenericTypeDefinition);
System\Reflection\DefaultBinder.cs (1)
234Debug.Assert(returnType != null);
System\Reflection\MetadataLoadContext.CoreAssembly.cs (1)
17Debug.Assert(_coreAssembly == null);
System\Reflection\MetadataLoadContext.Resolving.cs (3)
27Debug.Assert(refName != null); 48Debug.Assert(refName != null); 59Debug.Assert(refName != null);
System\Reflection\PathAssemblyResolver.cs (1)
57Debug.Assert(assemblyName.Name != null);
System\Reflection\Runtime\BindingFlagSupport\ConstructorPolicies.cs (1)
22Debug.Assert(reflectedType.Equals(type)); // Constructor queries are always performed as if BindingFlags.DeclaredOnly are set so the reflectedType should always be the declaring type.
System\Reflection\Runtime\BindingFlagSupport\NestedTypePolicies.cs (1)
28Debug.Assert(reflectedType.Equals(type)); // NestedType queries are always performed as if BindingFlags.DeclaredOnly are set so the reflectedType should always be the declaring type.
System\Reflection\Runtime\BindingFlagSupport\QueriedMemberList.cs (6)
70Debug.Assert(index >= 0 && index < _totalCount); 78Debug.Assert(index >= 0 && index < _totalCount); 174Debug.Assert((allFlagsThatMustMatch & ~validBits) == 0); 175Debug.Assert(((allFlagsThatMustMatch & BindingFlags.Public) == 0) != ((allFlagsThatMustMatch & BindingFlags.NonPublic) == 0)); 176Debug.Assert(((allFlagsThatMustMatch & BindingFlags.Instance) == 0) != ((allFlagsThatMustMatch & BindingFlags.Static) == 0)); 177Debug.Assert((allFlagsThatMustMatch & BindingFlags.FlattenHierarchy) == 0 || (allFlagsThatMustMatch & BindingFlags.Static) != 0);
System\Reflection\Runtime\BindingFlagSupport\Shared.cs (2)
25Debug.Assert(methodBase != null); 26Debug.Assert(argumentTypes != null);
System\Reflection\Runtime\General\ListBuilder.cs (1)
28Debug.Assert(index < Count);
System\Reflection\Runtime\SignatureTypeExtensions.cs (3)
35Debug.Assert(pattern.IsSignatureType()); 107Debug.Assert(signatureType.IsSignatureType()); 113Debug.Assert(signatureType.IsSignatureType());
System\Reflection\TypeLoading\Assemblies\AssemblyFileInfo.cs (1)
16Debug.Assert(name != null);
System\Reflection\TypeLoading\Assemblies\Ecma\EcmaAssembly.cs (4)
22Debug.Assert(loader != null); 23Debug.Assert(peReader != null); 24Debug.Assert(reader != null); 25Debug.Assert(location != null);
System\Reflection\TypeLoading\Assemblies\RoAssembly.GetForwardedTypes.cs (1)
38Debug.Assert((type != null) != (exception != null)); // Exactly one of these must be non-null.
System\Reflection\TypeLoading\Assemblies\RoAssembly.Modules.cs (1)
110Debug.Assert(afi.RowIndex != 0); // Since we excluded the manifest module from the search.
System\Reflection\TypeLoading\Constructors\RoDefinitionConstructor.cs (2)
21Debug.Assert(declaringType != null); 51Debug.Assert(ReflectedType == other.ReflectedType);
System\Reflection\TypeLoading\Constructors\RoSyntheticConstructor.cs (1)
23Debug.Assert(declaringType != null);
System\Reflection\TypeLoading\Events\Ecma\EcmaEvent.cs (4)
24Debug.Assert(!handle.IsNil); 25Debug.Assert(declaringType != null); 26Debug.Assert(reflectedType != null); 27Debug.Assert(declaringType.Module is EcmaModule);
System\Reflection\TypeLoading\Events\RoEvent.cs (2)
19Debug.Assert(declaringType != null); 20Debug.Assert(reflectedType != null);
System\Reflection\TypeLoading\Fields\Ecma\EcmaField.cs (4)
23Debug.Assert(!handle.IsNil); 24Debug.Assert(declaringType != null); 25Debug.Assert(reflectedType != null); 26Debug.Assert(declaringType.Module is EcmaModule);
System\Reflection\TypeLoading\Fields\RoField.cs (2)
21Debug.Assert(declaringType != null); 22Debug.Assert(reflectedType != null);
System\Reflection\TypeLoading\General\Assignability.cs (4)
184Debug.Assert(!(fromTypeInfo.IsArray || fromTypeInfo.IsByRef || fromTypeInfo.IsPointer || fromTypeInfo.IsGenericParameter)); 185Debug.Assert(!(toTypeInfo.IsArray || toTypeInfo.IsByRef || toTypeInfo.IsPointer || toTypeInfo.IsGenericParameter)); 335Debug.Assert(fromTypeInfo.IsArray); 336Debug.Assert(toTypeInfo.IsInterface);
System\Reflection\TypeLoading\General\Ecma\EcmaResolver.cs (10)
16Debug.Assert(!handle.IsNil); 17Debug.Assert(module != null); 30Debug.Assert(!handle.IsNil); 31Debug.Assert(module != null); 41Debug.Assert(!handle.IsNil); 42Debug.Assert(module != null); 120Debug.Assert(!handle.IsNil); 121Debug.Assert(module != null); 128Debug.Assert(!handle.IsNil); 129Debug.Assert(module != null);
System\Reflection\TypeLoading\General\Ecma\EcmaToStringHelpers.cs (2)
21Debug.Assert(!handle.IsNil); 22Debug.Assert(reader != null);
System\Reflection\TypeLoading\General\Ecma\GuardedPEReader.cs (3)
29Debug.Assert(loader != null); 30Debug.Assert(peReader != null); 31Debug.Assert(reader != null);
System\Reflection\TypeLoading\General\Ecma\MetadataTable.cs (2)
31Debug.Assert(!handle.IsNil); 32Debug.Assert(factory != null);
System\Reflection\TypeLoading\General\Helpers.cs (4)
92Debug.Assert(rank == 1 || multiDim); 209Debug.Assert(fullName != null); 233Debug.Assert(name != null); 316Debug.Assert(assembly is RoAssembly);
System\Reflection\TypeLoading\General\MethodSig.cs (3)
25Debug.Assert(parameterCount >= 0); 33Debug.Assert(position >= -1 && position < Parameters.Length); 39Debug.Assert(position >= -1 && position < Parameters.Length);
System\Reflection\TypeLoading\General\RoAssemblyName.cs (2)
38Debug.Assert(name != null); 54Debug.Assert(other is not null);
System\Reflection\TypeLoading\Methods\RoConstructedGenericMethod.cs (2)
21Debug.Assert(genericMethodDefinition != null); 22Debug.Assert(genericMethodArguments != null);
System\Reflection\TypeLoading\Methods\RoDefinitionMethod.cs (2)
19Debug.Assert(reflectedType != null); 39Debug.Assert(declaringType != null);
System\Reflection\TypeLoading\Methods\RoMethod.cs (1)
20Debug.Assert(reflectedType != null);
System\Reflection\TypeLoading\Methods\RoSyntheticMethod.cs (1)
24Debug.Assert(declaringType != null);
System\Reflection\TypeLoading\Modules\Ecma\EcmaModule.cs (4)
28Debug.Assert(assembly != null); 29Debug.Assert(fullyQualifiedName != null); 30Debug.Assert(peReader != null); 31Debug.Assert(reader != null);
System\Reflection\TypeLoading\Modules\GetTypeCoreCache.cs (6)
155Debug.Assert(newNextFreeEntry <= _nextFreeEntry); 177Debug.Assert(_nextFreeEntry >= 0 && _nextFreeEntry <= _entries.Length); 186Debug.Assert(walk1 >= 0 && walk1 < _nextFreeEntry); 187Debug.Assert(walk2 >= -1 && walk2 < _nextFreeEntry); 190Debug.Assert(storedBucket == bucket); 202Debug.Assert(numEntriesEncountered <= _nextFreeEntry);
System\Reflection\TypeLoading\Modules\RoModule.cs (1)
25Debug.Assert(fullyQualifiedName != null);
System\Reflection\TypeLoading\Modules\RoResourceModule.cs (2)
24Debug.Assert(assembly != null); 25Debug.Assert(fullyQualifiedName != null);
System\Reflection\TypeLoading\Parameters\Ecma\EcmaFatMethodParameter.cs (4)
23Debug.Assert(roMethodBase != null); 24Debug.Assert(parameterType != null); 25Debug.Assert(!handle.IsNil); 28Debug.Assert(roMethodBase.MethodBase.Module is EcmaModule);
System\Reflection\TypeLoading\Parameters\RoFatMethodParameter.cs (2)
18Debug.Assert(roMethodBase != null); 19Debug.Assert(parameterType != null);
System\Reflection\TypeLoading\Parameters\RoMethodParameter.cs (2)
19Debug.Assert(roMethodBase != null); 20Debug.Assert(parameterType != null);
System\Reflection\TypeLoading\Parameters\RoParameter.cs (1)
19Debug.Assert(member != null);
System\Reflection\TypeLoading\Parameters\RoPropertyIndexParameter.cs (2)
20Debug.Assert(member != null); 21Debug.Assert(backingParameter != null);
System\Reflection\TypeLoading\Parameters\RoThinMethodParameter.cs (2)
18Debug.Assert(roMethodBase != null); 19Debug.Assert(parameterType != null);
System\Reflection\TypeLoading\Properties\Ecma\EcmaProperty.cs (4)
23Debug.Assert(!handle.IsNil); 24Debug.Assert(declaringType != null); 25Debug.Assert(reflectedType != null); 26Debug.Assert(declaringType.Module is EcmaModule);
System\Reflection\TypeLoading\Properties\RoProperty.cs (2)
20Debug.Assert(declaringType != null); 21Debug.Assert(reflectedType != null);
System\Reflection\TypeLoading\RuntimeTypeInfo.BindingFlags.cs (9)
16Debug.Assert(types != null); 66Debug.Assert(name != null); 72Debug.Assert(genericParameterCount == GenericParameterCountAny); 73Debug.Assert(binder == null); 74Debug.Assert(callConvention == CallingConventions.Any); 75Debug.Assert(modifiers == null); 110Debug.Assert(name != null); 116Debug.Assert(binder == null); 117Debug.Assert(modifiers == null);
System\Reflection\TypeLoading\RuntimeTypeInfo.GetMember.cs (1)
89Debug.Assert(numCopied == numMatches);
System\Reflection\TypeLoading\Types\Ecma\EcmaDefinitionType.cs (2)
21Debug.Assert(module != null); 22Debug.Assert(!handle.IsNil);
System\Reflection\TypeLoading\Types\Ecma\EcmaGenericMethodParameterType.cs (1)
17Debug.Assert(!handle.IsNil);
System\Reflection\TypeLoading\Types\Ecma\EcmaGenericParameterType.cs (1)
20Debug.Assert(!handle.IsNil);
System\Reflection\TypeLoading\Types\RoArrayType.cs (2)
20Debug.Assert(elementType != null); 21Debug.Assert(multiDim || rank == 1);
System\Reflection\TypeLoading\Types\RoArrayType.Key.cs (1)
18Debug.Assert(elementType != null);
System\Reflection\TypeLoading\Types\RoByRefType.cs (1)
17Debug.Assert(elementType != null);
System\Reflection\TypeLoading\Types\RoConstructedGenericType.cs (2)
23Debug.Assert(genericTypeDefinition != null); 24Debug.Assert(genericTypeArguments != null);
System\Reflection\TypeLoading\Types\RoConstructedGenericType.Key.cs (2)
15Debug.Assert(genericTypeDefinition != null); 16Debug.Assert(genericTypeArguments != null);
System\Reflection\TypeLoading\Types\RoDefinitionType.cs (3)
38Debug.Assert(!IsConstructedGenericType); 39Debug.Assert(!IsGenericParameter); 40Debug.Assert(!HasElementType);
System\Reflection\TypeLoading\Types\RoFunctionPointerType.cs (1)
32Debug.Assert(module != null);
System\Reflection\TypeLoading\Types\RoHasElementType.cs (1)
21Debug.Assert(elementType != null);
System\Reflection\TypeLoading\Types\RoModifiedFunctionPointerType.cs (1)
23Debug.Assert(functionPointerType.IsFunctionPointer);
System\Reflection\TypeLoading\Types\RoModifiedGenericType.cs (1)
18Debug.Assert(genericType.IsGenericType);
System\Reflection\TypeLoading\Types\RoModifiedHasElementType.cs (1)
18Debug.Assert(unmodifiedType.HasElementType);
System\Reflection\TypeLoading\Types\RoModifiedType.cs (2)
60Debug.Assert(_requiredModifiers == null); 67Debug.Assert(_optionalModifiers == null);
System\Reflection\TypeLoading\Types\RoPointerType.cs (1)
17Debug.Assert(elementType != null);
System\Reflection\TypeLoading\Types\RoWrappedType.cs (1)
16Debug.Assert(unmodifiedType != null);
System.Resources.Extensions (15)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (2)
152Debug.Assert(_resourceList != null); 517Debug.Assert(writer != null);
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (10)
340Debug.Assert(Monitor.IsEntered(this)); // uses _store 541Debug.Assert(Monitor.IsEntered(this)); // uses _store 561Debug.Assert(Monitor.IsEntered(this)); // uses _store 623Debug.Assert(Monitor.IsEntered(this)); // uses _store 643Debug.Assert(Monitor.IsEntered(this)); // uses _store 781Debug.Assert(!Monitor.IsEntered(this)); // only called during init 804Debug.Assert(!Monitor.IsEntered(this)); // only called during init 993Debug.Assert(Monitor.IsEntered(this)); // uses _store 1033Debug.Assert(Monitor.IsEntered(this)); // uses _store 1117Debug.Assert(!Monitor.IsEntered(_reader));
src\libraries\System.Private.CoreLib\src\System\Resources\RuntimeResourceSet.cs (1)
288Debug.Assert(!Monitor.IsEntered(reader));
System\Resources\Extensions\PreserializedResourceWriter.cs (2)
109Debug.Assert(primitiveValue.GetType() == primitiveType); 230Debug.Assert(record != null);
System.Resources.Writer (3)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (2)
152Debug.Assert(_resourceList != null); 517Debug.Assert(writer != null);
System\Resources\ResourceWriter.core.cs (1)
51Debug.Assert(data != null);
System.Runtime.Caching (5)
System\Runtime\Caching\CacheExpires.cs (2)
594Debug.Assert(cacheEntry == entries[entryIndex]._cacheEntry); 775Debug.Assert(NUMBUCKETS < byte.MaxValue);
System\Runtime\Caching\CacheMemoryMonitor.cs (1)
173Debug.Assert(SAMPLE_COUNT == 2);
System\Runtime\Caching\MemoryCacheKeyEqualityComparer.cs (2)
13Debug.Assert(x != null && x is MemoryCacheKey); 14Debug.Assert(y != null && y is MemoryCacheKey);
System.Runtime.InteropServices (3)
System\Runtime\InteropServices\Marshalling\ComObject.cs (3)
45Debug.Assert(Marshal.IsComObject(_runtimeCallableWrapper)); 142Debug.Assert(found); 163Debug.Assert(_runtimeCallableWrapper != null);
System.Runtime.Numerics (223)
src\libraries\Common\src\System\HexConverter.cs (1)
165Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Number.Formatting.Common.cs (11)
144Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 281Debug.Assert(format is 'G' or 'g'); 293Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 716Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 750Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 865Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 886Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 913Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 935Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 959Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 1013Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte));
src\libraries\Common\src\System\Number.NumberBuffer.cs (3)
38Debug.Assert(digits != null); 46Debug.Assert(!digits.IsEmpty); 67Debug.Assert((Kind == NumberBufferKind.Integer) || (Kind == NumberBufferKind.Decimal) || (Kind == NumberBufferKind.FloatingPoint));
src\libraries\Common\src\System\Number.Parsing.Common.cs (11)
16Debug.Assert(str != null); 17Debug.Assert(strEnd != null); 18Debug.Assert(str <= strEnd); 19Debug.Assert((styles & (NumberStyles.AllowHexSpecifier | NumberStyles.AllowBinarySpecifier)) == 0); 28Debug.Assert(number.DigitsCount == 0); 29Debug.Assert(number.Scale == 0); 30Debug.Assert(!number.IsNegative); 31Debug.Assert(!number.HasNonZeroTail); 228Debug.Assert(numberOfTrailingZeros >= 0); 283Debug.Assert(info != null); 339Debug.Assert((p != null) && (pEnd != null) && (p <= pEnd));
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\FormattingHelpers.CountDigits.cs (2)
25Debug.Assert(log2ToPow10.Length == 64); 55Debug.Assert((index + 1) <= powersOf10.Length);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (5)
28Debug.Assert(value >= 0); 29Debug.Assert(value <= _span.Length); 38Debug.Assert(index < _pos); 106Debug.Assert(length >= 0); 134Debug.Assert(_pos == _span.Length);
System\Number.BigInteger.cs (21)
273Debug.Assert(leading != 0); 455Debug.Assert(char.IsDigit(digitChar)); 468Debug.Assert(0 <= remainingIntDigitCount); 485Debug.Assert(currentBlock == 0); 486Debug.Assert(bufferIndex == -1); 511Debug.Assert(blockSize == lowerLen); 512Debug.Assert(blockSize == multiplier.Length); 513Debug.Assert(multiplier.Length == lowerLen); 568Debug.Assert(buffer.Length == currentBufferSize || buffer[currentBufferSize] == 0); 663Debug.Assert(format == 'x' || format == 'X'); 672Debug.Assert(success); 753Debug.Assert(success); 757Debug.Assert(!bytes.IsEmpty); 766Debug.Assert(arrayToReturnToPool is not null); 774Debug.Assert(digits < Array.MaxLength); 813Debug.Assert(sb.Length == charsIncludeDigits); 862Debug.Assert(formatString == null || formatString.Length == formatSpan.Length); 889Debug.Assert(formatString != null); 901Debug.Assert((long)BigInteger.MaxLength * (kcchBase + 1) / kcchBase + 1 < (long)int.MaxValue); // won't overflow 915Debug.Assert(base1E9Buffer[iuDst] < kuBase); 1078Debug.Assert(destination.Length * TParser.DigitsPerBlock == input.Length);
System\Number.Polyfill.cs (11)
84Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 92Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 100Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 108Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 116Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 124Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 132Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 140Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 148Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 156Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 164Debug.Assert(typeof(TChar) == typeof(Utf16Char));
System\Numerics\BigInteger.cs (44)
162Debug.Assert(sign == +1 || sign == -1); 170Debug.Assert(man < (1UL << 53)); 171Debug.Assert(exp <= 0 || man >= (1UL << 52)); 200Debug.Assert(0 <= cbit && cbit < kcbitUint); 201Debug.Assert(cu >= 1); 221Debug.Assert(bits.Length == 4 && (bits[3] & DecimalScaleFactorMask) == 0); 759Debug.Assert(dividend._bits != null); 786Debug.Assert(divisor._bits != null); 879Debug.Assert(right._bits != null); 887Debug.Assert(left._bits != null); 893Debug.Assert(left._bits != null && right._bits != null); 907Debug.Assert(BigIntegerCalculator.Compare(leftBits, rightBits) >= 0); 1369Debug.Assert(bits.Length > 0); 1370Debug.Assert(bits[bits.Length - 1] != 0); 1380Debug.Assert(highDword <= uint.MaxValue - 1); 1386Debug.Assert(sign == 1); 1467Debug.Assert(msbIndex >= 0 && msbIndex <= 3); 1486Debug.Assert(isBigEndian || (!needExtraByte && curByte == length - 1) || (needExtraByte && curByte == length - 2)); 1488Debug.Assert(!isBigEndian || (!needExtraByte && curByte == 0) || (needExtraByte && curByte == 1)); 1507Debug.Assert(_bits is null || _sign == 0 ? buffer.Length == 2 : buffer.Length >= _bits.Length + 1); 1646Debug.Assert(!rightBits.IsEmpty); 1658Debug.Assert(!leftBits.IsEmpty); 1670Debug.Assert(!leftBits.IsEmpty && !rightBits.IsEmpty); 1682Debug.Assert(!leftBits.IsEmpty && !rightBits.IsEmpty); 1724Debug.Assert(!rightBits.IsEmpty); 1736Debug.Assert(!leftBits.IsEmpty); 1758Debug.Assert(!leftBits.IsEmpty && !rightBits.IsEmpty); 2699Debug.Assert(!right.IsEmpty); 2711Debug.Assert(!left.IsEmpty); 2733Debug.Assert(!left.IsEmpty && !right.IsEmpty); 2746Debug.Assert(!left.IsEmpty && !right.IsEmpty); 2788Debug.Assert(dividend._bits != null); 2808Debug.Assert(dividend._bits != null && divisor._bits != null); 2853Debug.Assert(dividend._bits != null); 2858Debug.Assert(dividend._bits != null && divisor._bits != null); 3103Debug.Assert(_bits is null ? xd.Length == 1 : xd.Length == _bits.Length); 3122Debug.Assert(_sign == 1 || _sign == -1); 3124Debug.Assert(_bits.Length > 0); 3126Debug.Assert(_bits.Length > 1 || _bits[0] >= kuMaskHighBit); 3128Debug.Assert(_bits[_bits.Length - 1] != 0); 3130Debug.Assert(_bits.Length <= MaxLength); 3135Debug.Assert(_sign > int.MinValue); 3679Debug.Assert(Unsafe.AreSame(ref startAddress, ref Unsafe.Add(ref address, sizeof(uint)))); 3780Debug.Assert(Unsafe.AreSame(ref lastAddress, ref Unsafe.Subtract(ref address, sizeof(uint))));
System\Numerics\BigIntegerCalculator.AddSub.cs (15)
21Debug.Assert(left.Length >= 1); 22Debug.Assert(bits.Length == left.Length + 1); 29Debug.Assert(right.Length >= 1); 30Debug.Assert(left.Length >= right.Length); 31Debug.Assert(bits.Length == left.Length + 1); 61Debug.Assert(left.Length >= right.Length); 87Debug.Assert(carry == 0); 92Debug.Assert(left.Length >= 1); 93Debug.Assert(left[0] >= right || left.Length >= 2); 94Debug.Assert(bits.Length == left.Length); 101Debug.Assert(right.Length >= 1); 102Debug.Assert(left.Length >= right.Length); 103Debug.Assert(Compare(left, right) >= 0); 104Debug.Assert(bits.Length == left.Length); 134Debug.Assert(left.Length >= right.Length);
System\Numerics\BigIntegerCalculator.DivRem.cs (28)
13Debug.Assert(left.Length >= 1); 14Debug.Assert(quotient.Length == left.Length); 34Debug.Assert(left.Length >= 1); 35Debug.Assert(quotient.Length == left.Length); 51Debug.Assert(left.Length >= 1); 66Debug.Assert(left.Length >= 1); 67Debug.Assert(right.Length >= 1); 68Debug.Assert(left.Length >= right.Length); 69Debug.Assert(quotient.Length == left.Length - right.Length + 1); 70Debug.Assert(remainder.Length == left.Length); 78Debug.Assert(left.Length >= 1); 79Debug.Assert(right.Length >= 1); 80Debug.Assert(left.Length >= right.Length); 81Debug.Assert(quotient.Length == left.Length - right.Length + 1); 102Debug.Assert(left.Length >= 1); 103Debug.Assert(right.Length >= 1); 104Debug.Assert(left.Length >= right.Length); 105Debug.Assert(remainder.Length >= left.Length); 115Debug.Assert(left.Length >= 1); 116Debug.Assert(right.Length >= 1); 117Debug.Assert(left.Length >= right.Length); 118Debug.Assert(bits.Length == left.Length - right.Length + 1 177Debug.Assert(carry == t + 1); 183Debug.Assert(carry == 1); 198Debug.Assert(left.Length >= right.Length); 217Debug.Assert(left.Length >= right.Length); 218Debug.Assert(q <= 0xFFFFFFFF); 242Debug.Assert(q <= 0xFFFFFFFF);
System\Numerics\BigIntegerCalculator.FastReducer.cs (9)
25Debug.Assert(!modulus.IsEmpty); 26Debug.Assert(r.Length == modulus.Length * 2 + 1); 27Debug.Assert(mu.Length == r.Length - modulus.Length + 1); 28Debug.Assert(q1.Length == modulus.Length * 2 + 2); 29Debug.Assert(q2.Length == modulus.Length * 2 + 2); 46Debug.Assert(value.Length <= _modulus.Length * 2); 70Debug.Assert(!right.IsEmpty); 71Debug.Assert(!bits.IsEmpty); 72Debug.Assert(bits.Length + k >= left.Length + right.Length);
System\Numerics\BigIntegerCalculator.GcdInv.cs (20)
46Debug.Assert(left.Length >= 1); 47Debug.Assert(right != 0); 59Debug.Assert(left.Length >= 2); 60Debug.Assert(right.Length >= 2); 61Debug.Assert(Compare(left, right) >= 0); 62Debug.Assert(result.Length == left.Length); 80Debug.Assert(left.Length >= 2); 81Debug.Assert(right.Length >= 2); 82Debug.Assert(left.Length >= right.Length); 205Debug.Assert(buffer.Length >= 2); 225Debug.Assert(xBuffer.Length >= 3); 226Debug.Assert(yBuffer.Length >= 3); 227Debug.Assert(xBuffer.Length >= yBuffer.Length); 272Debug.Assert(x >= y); 280Debug.Assert(x.Length >= 1); 281Debug.Assert(y.Length >= 1); 282Debug.Assert(x.Length >= y.Length); 283Debug.Assert(a <= 0x7FFFFFFF && b <= 0x7FFFFFFF); 284Debug.Assert(c <= 0x7FFFFFFF && d <= 0x7FFFFFFF); 306Debug.Assert(bits.Length >= maxLength);
System\Numerics\BigIntegerCalculator.PowMod.cs (11)
23Debug.Assert(bits.Length == PowBound(power, value.Length)); 50Debug.Assert(value.Length >= valueLength); 51Debug.Assert(temp.Length == result.Length); 52Debug.Assert(value.Length == temp.Length); 72Debug.Assert(leftLength <= left.Length); 95Debug.Assert(valueLength <= value.Length); 96Debug.Assert(temp.Length >= valueLength + valueLength); 211Debug.Assert(!modulus.IsEmpty); 212Debug.Assert(bits.Length == modulus.Length + modulus.Length); 260Debug.Assert(!modulus.IsEmpty); 261Debug.Assert(bits.Length == modulus.Length + modulus.Length);
System\Numerics\BigIntegerCalculator.SquMul.cs (18)
23Debug.Assert(bits.Length == value.Length + value.Length); 133Debug.Assert(bits.Length == left.Length + 1); 161Debug.Assert(left.Length >= right.Length); 162Debug.Assert(bits.Length >= left.Length + right.Length); 163Debug.Assert(bits.Trim(0u).IsEmpty); 164Debug.Assert(MultiplyKaratsubaThreshold >= 2); 214Debug.Assert(leftLow.Length >= leftHigh.Length); 249Debug.Assert(left.Length >= right.Length); 250Debug.Assert(2 * n - left.Length is 0 or 1); 251Debug.Assert(right.Length > n); 252Debug.Assert(bits.Length >= left.Length + right.Length); 272Debug.Assert(leftLow.Length >= leftHigh.Length); 273Debug.Assert(rightLow.Length >= rightHigh.Length); 274Debug.Assert(bitsLow.Length >= bitsHigh.Length); 320Debug.Assert(ActualLength(core) <= left.Length + 1); 333Debug.Assert(right.Length < MultiplyKaratsubaThreshold); 364Debug.Assert(left.Length >= right.Length); 365Debug.Assert(core.Length >= left.Length);
System\Numerics\BigIntegerCalculator.Utils.cs (2)
20Debug.Assert(left.Length <= right.Length || left.Slice(right.Length).ContainsAnyExcept(0u)); 21Debug.Assert(left.Length >= right.Length || right.Slice(left.Length).ContainsAnyExcept(0u));
System\Numerics\Complex.cs (4)
338Debug.Assert((x >= 0.0) || double.IsNaN(x)); 577Debug.Assert((x >= 0.0) || double.IsNaN(x)); 578Debug.Assert((y >= 0.0) || double.IsNaN(y)); 2237Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
System\Numerics\NumericsHelpers.cs (2)
59Debug.Assert((man & 0xFFF0000000000000) == 0x0010000000000000); 82Debug.Assert(bits != 0);
System.Runtime.Serialization.Formatters (98)
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (2)
103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
System\Runtime\Serialization\Formatters\Binary\BinaryArray.cs (2)
58Debug.Assert(_lengthA != null); 90Debug.Assert(_lowerBoundA != null);
System\Runtime\Serialization\Formatters\Binary\BinaryAssembly.cs (1)
25Debug.Assert(_assemblyString != null);
System\Runtime\Serialization\Formatters\Binary\BinaryFormatterEventSource.cs (2)
47Debug.Assert(type != null); 82Debug.Assert(type != null);
System\Runtime\Serialization\Formatters\Binary\BinaryFormatterWriter.cs (2)
120Debug.Assert(typeNameInfo != null); // Explicitly called with null. Potential bug, but closed as Won't Fix: https://github.com/dotnet/runtime/issues/31402 127Debug.Assert(objectName != null);
System\Runtime\Serialization\Formatters\Binary\BinaryObjectInfo.cs (13)
46Debug.Assert(_serObjectInfoInit != null); 189Debug.Assert(_si != null); 241Debug.Assert(_serObjectInfoInit != null && _objectType != null); 251Debug.Assert(_serObjectInfoInit != null && _objectType != null); 550Debug.Assert(si != null); 559Debug.Assert(memberData != null); 571Debug.Assert(_objectType != null); 579Debug.Assert(_cache._memberNames != null); 607Debug.Assert(_cache != null && _cache._memberInfos != null); 618Debug.Assert(_cache != null && _cache._memberInfos != null); 631Debug.Assert(_cache._memberNames != null); 670Debug.Assert(_cache._memberInfos != null); 714Debug.Assert(_cache._memberNames != null);
System\Runtime\Serialization\Formatters\Binary\BinaryObjectReader.cs (30)
116Debug.Assert(_objectManager != null); 156Debug.Assert(_crossAppDomainArray != null); 285Debug.Assert(_objectManager != null); 307Debug.Assert(_stack != null); 339Debug.Assert(objectPr._objectInfo != null); 351Debug.Assert(fixup != null && parentPr != null); 368Debug.Assert(_stack != null); 371Debug.Assert(pr._value != null); 406Debug.Assert(pr._lengthA != null); 442Debug.Assert(pr._newObj != null); 472Debug.Assert(pr._lengthA != null); 475Debug.Assert(pr._lowerBoundA != null); 500Debug.Assert(pr._rectangularMap != null && pr._lengthA != null && pr._indexMap != null); 535Debug.Assert(_stack != null); 538Debug.Assert(objectPr != null && objectPr._indexMap != null && objectPr._lowerBoundA != null); 548Debug.Assert(objectPr._rectangularMap != null); 568Debug.Assert(_objectManager != null); 588Debug.Assert(objectPr._newObj != null); 606Debug.Assert(objectPr._newObj != null); 637Debug.Assert(objectPr._newObj != null); 666Debug.Assert(objectPr._newObj != null); 675Debug.Assert(pr._value != null); 688Debug.Assert(objectPr._newObj != null); 722Debug.Assert(_stack != null); 734Debug.Assert(objectPr != null && objectPr._objectInfo != null && pr._name != null); 768Debug.Assert(_objectManager != null); 795Debug.Assert(pr._value != null); 848Debug.Assert(_stack != null); 902Debug.Assert(_objectManager != null); 909Debug.Assert(obj != null);
System\Runtime\Serialization\Formatters\Binary\BinaryObjectWithMap.cs (1)
39Debug.Assert(_name != null && _memberNames != null);
System\Runtime\Serialization\Formatters\Binary\BinaryObjectWithMapTyped.cs (1)
46Debug.Assert(_name != null && _memberNames != null && _binaryTypeEnumA != null && _typeInformationA != null && _memberAssemIds != null);
System\Runtime\Serialization\Formatters\Binary\BinaryObjectWriter.cs (18)
121Debug.Assert(_serWriter != null); 146Debug.Assert(memberNames != null && memberTypes != null && memberData != null); 165Debug.Assert(_serObjectInfoInit != null && _formatterConverter != null); 208Debug.Assert(_serWriter != null); 220Debug.Assert(memberNameInfo != null); 358Debug.Assert(_serWriter != null); 380Debug.Assert(memberObjectInfo != null); 424Debug.Assert(_serObjectInfoInit != null && _formatterConverter != null); 469Debug.Assert(_serWriter != null); 633Debug.Assert(_serObjectInfoInit != null && _formatterConverter != null); 647Debug.Assert(_serWriter != null); 738Debug.Assert(realObj != null); 759Debug.Assert(_idGenerator != null); 794Debug.Assert(_objectQueue != null); 816Debug.Assert(_serWriter != null); 851Debug.Assert(_serWriter != null); 873Debug.Assert(_serWriter != null); 999Debug.Assert(_serWriter != null);
System\Runtime\Serialization\Formatters\Binary\BinaryParser.cs (9)
449Debug.Assert(record._name != null && record._memberNames != null); 452Debug.Assert(objectType != null); 552Debug.Assert(record._name != null && record._memberNames != null && record._binaryTypeEnumA != null && record._typeInformationA != null && record._memberAssemIds != null); 813Debug.Assert(record._lengthA != null); 820Debug.Assert(record._lowerBoundA != null); 865Debug.Assert(pr._lengthA != null); 926Debug.Assert(objectOp != null); 954Debug.Assert(objectOp != null); 982Debug.Assert(objectOp != null);
System\Runtime\Serialization\Formatters\Binary\BinaryTypeConverter.cs (1)
59Debug.Assert(assembly != null);
System\Runtime\Serialization\Formatters\Binary\BinaryUtilClasses.cs (2)
410Debug.Assert(_objectInfo!._objectManager != null); 478Debug.Assert(_type != null);
System\Runtime\Serialization\Formatters\Binary\ObjectProgress.cs (1)
110Debug.Assert(_binaryTypeEnumA != null && _typeInformationA != null && _memberNames != null && _memberTypes != null);
System\Runtime\Serialization\FormatterServices.cs (4)
27Debug.Assert(type != null); 205Debug.Assert(fi != null); 344Debug.Assert(rank >= 1); 378Debug.Assert(innerSurrogate != null);
System\Runtime\Serialization\ObjectManager.cs (5)
181Debug.Assert(holder.SerializationInfo != null); 243Debug.Assert(holder.ObjectValue != null); 313Debug.Assert(tempHolder != null); 443Debug.Assert(holderValue != null); 596Debug.Assert(temp != null);
System\Runtime\Serialization\SerializationFieldInfo.cs (2)
17Debug.Assert(field != null); 18Debug.Assert(namePrefix != null);
System\Runtime\Serialization\SurrogateSelector.cs (2)
122Debug.Assert(tempPrev != null); 182Debug.Assert(type != null);
System.Security.Cryptography (448)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
69Debug.Assert(passwd.Name != null);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Dsa.cs (4)
46Debug.Assert(size * 2 < DsaEncodedSignatureSize(dsa)); 181Debug.Assert(i >= 0); 194Debug.Assert(value1 >= 0); 195Debug.Assert(value2 >= 0);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Encode.cs (2)
43Debug.Assert(size == size2); 79Debug.Assert(size == size2);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EVP.Mac.cs (6)
80Debug.Assert(ret == 0); 92Debug.Assert(ret == 0); 104Debug.Assert(ret == 0); 133Debug.Assert(ret == 0); 145Debug.Assert(ret == 0); 157Debug.Assert(ret == 0);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EVP.MacAlgs.cs (1)
38Debug.Assert(mac.IsInvalid);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EvpPkey.cs (6)
154Debug.Assert(written == size); 205Debug.Assert(written == size); 226Debug.Assert(engineName is not null); 227Debug.Assert(keyName is not null); 249Debug.Assert(engineName is not null); 250Debug.Assert(keyName is not null);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EvpPkey.Ecdh.cs (2)
28Debug.Assert(ctx != null); 29Debug.Assert(!ctx.IsInvalid);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EvpPkey.Rsa.cs (5)
19Debug.Assert(rsa != IntPtr.Zero); 76Debug.Assert(written == -1); 111Debug.Assert(written == -1); 146Debug.Assert(written == -1); 189Debug.Assert(ret == -1);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Hmac.cs (1)
47Debug.Assert(result == 0);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.RAND.cs (1)
13Debug.Assert(count >= 0);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeDsaHandle.Unix.cs (1)
32Debug.Assert(handle != IntPtr.Zero);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeEcKeyHandle.Unix.cs (1)
32Debug.Assert(handle != IntPtr.Zero);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (2)
41Debug.Assert(currentHandle.IsInvalid); 51Debug.Assert(handle != null);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (1)
46Debug.Assert(addedRef);
src\libraries\Common\src\System\HexConverter.cs (1)
165Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (1)
31Debug.Assert(task.IsCompletedSuccessfully);
src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs12\PfxAsn.manual.cs (2)
27Debug.Assert(MacData.HasValue); 67Debug.Assert(expectedOutputSize <= 64); // SHA512 is the largest digest size we know about
src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (3)
17Debug.Assert(arraySegment.Array != null); 18Debug.Assert(arraySegment.Offset == 0); 25Debug.Assert(clearSize <= array.Length);
src\libraries\Common\src\System\Security\Cryptography\DSAOpenSsl.cs (1)
246Debug.Assert(bytesWritten == p1363SignatureSize);
src\libraries\Common\src\System\Security\Cryptography\EccKeyFormatHelper.cs (7)
167Debug.Assert((x == null) == (y == null)); 538Debug.Assert(oid.FriendlyName != null); 546Debug.Assert(ecParameters.Curve.IsPrime || ecParameters.Curve.IsCharacteristic2); 588Debug.Assert(ecParameters.Curve.IsCharacteristic2); 614Debug.Assert(k2 < 0); 615Debug.Assert(k1 > 0); 853Debug.Assert(ecParameters.Q.Y != null);
src\libraries\Common\src\System\Security\Cryptography\ECDiffieHellmanDerivation.cs (9)
23Debug.Assert(otherPartyPublicKey != null); 24Debug.Assert(!string.IsNullOrEmpty(hashAlgorithm.Name)); 32Debug.Assert(secretAgreement == null); 48Debug.Assert(otherPartyPublicKey != null); 49Debug.Assert(!string.IsNullOrEmpty(hashAlgorithm.Name)); 63Debug.Assert(hmacKey != null); 82Debug.Assert(secretAgreement == null); 106Debug.Assert(otherPartyPublicKey != null); 120Debug.Assert(secretAgreement != null);
src\libraries\Common\src\System\Security\Cryptography\ECDiffieHellmanOpenSsl.Derive.cs (3)
79Debug.Assert(secretAgreement is not null); 88Debug.Assert(otherPartyPublicKey != null); 89Debug.Assert(_key is not null); // Callers should validate prior.
src\libraries\Common\src\System\Security\Cryptography\ECDsaOpenSsl.cs (1)
132Debug.Assert(bytesWritten == encodedSize);
src\libraries\Common\src\System\Security\Cryptography\ECOpenSsl.ImportExport.cs (3)
109Debug.Assert(parameters.Curve.IsNamed); 126Debug.Assert(parameters.Curve.IsPrime); 146Debug.Assert(parameters.Curve.IsCharacteristic2);
src\libraries\Common\src\System\Security\Cryptography\KeyBlobHelpers.cs (1)
71Debug.Assert(!integer.IsEmpty);
src\libraries\Common\src\System\Security\Cryptography\Oids.Shared.cs (2)
82Debug.Assert(oidValue != null); 163Debug.Assert(oid is not null);
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (15)
29Debug.Assert(pbeParameters != null); 32Debug.Assert(pbeParameters.IterationCount > 0); 75Debug.Assert(destination.Length >= encryptedData.Length); 148Debug.Assert(digestAlgorithmName.Name != null); 149Debug.Assert(cipher != null); 201Debug.Assert(written == buf.Length); 238Debug.Assert(pbeParameters != null); 305Debug.Assert(hmacOid == Oids.HmacWithSha1 || !isPkcs12); 353Debug.Assert(password.Length > 0 || passwordBytes.IsEmpty); 354Debug.Assert(pbeParameters.HashAlgorithm == HashAlgorithmName.SHA1); 378Debug.Assert(pwdTmpBytes!.Length == passwordBytes.Length); 393Debug.Assert(pwdTmpBytes!.Length == 0); 411Debug.Assert(encryptor.CanTransformMultipleBlocks); 491Debug.Assert(written == buf.Length); 945Debug.Assert(decryptor.CanTransformMultipleBlocks);
src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (5)
86Debug.Assert(iterationCount >= 1); 104Debug.Assert(v <= 1024); 239Debug.Assert(into.Length == addend.Length); 253Debug.Assert(bytes.Length > 0); 274Debug.Assert(destination.Length % 2 == 0);
src\libraries\Common\src\System\Security\Cryptography\RSAKeyFormatHelper.cs (1)
210Debug.Assert(copyFrom == null || pkcs1PrivateKey.IsEmpty);
src\libraries\Common\src\System\Security\Cryptography\RSAOpenSsl.cs (19)
175Debug.Assert(!key.IsInvalid); 194Debug.Assert(padding.OaepHashAlgorithm.Name != null); 261Debug.Assert(padding.OaepHashAlgorithm.Name != null); 272Debug.Assert(written == rsaSize); 390Debug.Assert(read == spki.Length); 401Debug.Assert(read == spki.Length); 444Debug.Assert(read == spki.Length); 548Debug.Assert(!newKey.IsInvalid); 595Debug.Assert(!newKey.IsInvalid); 658Debug.Assert(!newKey.IsInvalid); 747Debug.Assert(signature != null); 770Debug.Assert(alloced == null); 783Debug.Assert(!string.IsNullOrEmpty(hashAlgorithm.Name)); 784Debug.Assert(padding != null); 795Debug.Assert(destination.Length == 0); 806Debug.Assert(written == bytesRequired); 850Debug.Assert(read == pkcs8.Length); 903Debug.Assert(padding == RSASignaturePadding.Pkcs1); 907Debug.Assert(padding == RSASignaturePadding.Pss);
src\libraries\Common\src\System\Security\Cryptography\RsaPaddingProcessor.cs (9)
182Debug.Assert(source.Length > 11); 206Debug.Assert(lenIfBad < 0); 234Debug.Assert((selector | (selector - 1)) == -1); 321Debug.Assert(hasher.HashLengthInBytes == hLen); 425Debug.Assert(hasher.HashLengthInBytes == hLen); 484Debug.Assert(em.Length >= emLen); 524Debug.Assert(hasher.HashLengthInBytes == hLen); 606Debug.Assert(bytesWritten == hLen); 619Debug.Assert(bytesWritten == hLen);
src\libraries\Common\src\System\Security\Cryptography\SP800108HmacCounterKdfImplementationManaged.cs (1)
81Debug.Assert(current > 0);
src\libraries\Common\src\System\Text\UrlBase64Encoding.cs (2)
26Debug.Assert(charsWritten == base64Len); 65Debug.Assert(source[0] == '=');
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (1)
101Debug.Assert(passwd.HomeDirectory != null);
System\Security\Cryptography\AesCcm.OpenSsl.cs (1)
22Debug.Assert(_keyBox is null);
System\Security\Cryptography\AesGcm.cs (1)
160Debug.Assert(tagSizeInBytes.IsLegalSize(TagByteSizes));
System\Security\Cryptography\AsnFormatter.cs (2)
21Debug.Assert(sArray != null && sArray.Length != 0); 41Debug.Assert(j == hexOrder.Length);
System\Security\Cryptography\AsymmetricAlgorithmHelpers.Der.cs (4)
35Debug.Assert(input.Length % 2 == 0); 36Debug.Assert(input.Length > 1); 68Debug.Assert(destination.Length >= encodedSize); 127Debug.Assert(payloadLength >= 0);
System\Security\Cryptography\AsymmetricSignatureDeformatter.cs (1)
20Debug.Assert(hash.Hash != null);
System\Security\Cryptography\AsymmetricSignatureFormatter.cs (1)
20Debug.Assert(hash.Hash != null);
System\Security\Cryptography\Base64Transforms.cs (11)
53Debug.Assert(status == OperationStatus.Done); 54Debug.Assert(consumed == input.Length); 55Debug.Assert(written == output.Length); 78Debug.Assert(written == output.Length); 79Debug.Assert(status == OperationStatus.Done); 80Debug.Assert(consumed == inputCount); 226Debug.Assert(written == outputSize); 295Debug.Assert(bytesToTransform >= 4); 300Debug.Assert(_inputIndex < _inputBuffer.Length); 308Debug.Assert(consumed == bytesToTransform); 312Debug.Assert(status == OperationStatus.InvalidData);
System\Security\Cryptography\CapiHelper.DSA.Shared.cs (3)
132Debug.Assert(dsaParameters.Y != null); 162Debug.Assert(cspPublicBlob == null); 299Debug.Assert(dsaParameters.Y.Length > 0);
System\Security\Cryptography\CngAlgorithm.cs (3)
57Debug.Assert(_algorithm != null); 74Debug.Assert(_algorithm != null); 80Debug.Assert(_algorithm != null);
System\Security\Cryptography\CngAlgorithmGroup.cs (3)
58Debug.Assert(_algorithmGroup != null); 75Debug.Assert(_algorithmGroup != null); 81Debug.Assert(_algorithmGroup != null);
System\Security\Cryptography\CngKeyBlobFormat.cs (3)
58Debug.Assert(_format != null); 75Debug.Assert(_format != null); 81Debug.Assert(_format != null);
System\Security\Cryptography\CngProvider.cs (3)
55Debug.Assert(_provider != null); 72Debug.Assert(_provider != null); 78Debug.Assert(_provider != null);
System\Security\Cryptography\CryptoConfig.cs (3)
96Debug.Assert(ht.Count <= capacity); // if more entries are added in the future, increase initial capacity. 274Debug.Assert(ht.Count <= capacity); // // if more entries are added in the future, increase initial capacity. 588Debug.Assert(encodedOidNumsIndex == encodedOidNumsLength);
System\Security\Cryptography\CryptographicOperations.cs (17)
119Debug.Assert(hashAlgorithm.Name is not null); 123Debug.Assert(written == hashSizeInBytes); 188Debug.Assert(hashAlgorithm.Name is not null); 197Debug.Assert(bytesWritten == hashSizeInBytes); 230Debug.Assert(hashAlgorithm.Name is not null); 266Debug.Assert(hashAlgorithm.Name is not null); 270Debug.Assert(written == hashSizeInBytes); 316Debug.Assert(hashAlgorithm.Name is not null); 364Debug.Assert(hashAlgorithm.Name is not null); 423Debug.Assert(hashAlgorithm.Name is not null); 427Debug.Assert(written == hashSizeInBytes); 503Debug.Assert(hashAlgorithm.Name is not null); 512Debug.Assert(bytesWritten == hashSizeInBytes); 578Debug.Assert(hashAlgorithm.Name is not null); 616Debug.Assert(hashAlgorithm.Name is not null); 708Debug.Assert(hashAlgorithm.Name is not null); 754Debug.Assert(hashAlgorithm.Name is not null);
System\Security\Cryptography\CryptoStream.cs (9)
265Debug.Assert(_outputBuffer != null); 296Debug.Assert(completedValueTask.IsCompleted); 328Debug.Assert(_outputBufferIndex == 0); 331Debug.Assert(_inputBufferIndex == 0); 543Debug.Assert(_inputBuffer != null); 569Debug.Assert(_inputBuffer != null && _outputBuffer != null); 624Debug.Assert(_outputBuffer != null); 639Debug.Assert(_inputBuffer != null); 654Debug.Assert(segment.Array is not null);
System\Security\Cryptography\DSA.cs (1)
883Debug.Assert(tmp.Length == HashBufferStackSize);
System\Security\Cryptography\DSA.Xml.cs (1)
106Debug.Assert(keyParameters.P != null);
System\Security\Cryptography\DSAWrapper.cs (1)
16Debug.Assert(wrapped != null);
System\Security\Cryptography\ECCurve.cs (1)
242Debug.Assert(CurveType == ECCurveType.Implicit);
System\Security\Cryptography\ECDiffieHellmanWrapper.cs (2)
14Debug.Assert(wrapped != null); 179Debug.Assert(wrapped != null);
System\Security\Cryptography\ECDsa.cs (1)
1203Debug.Assert(tmp.Length == HashBufferStackSize);
System\Security\Cryptography\ECDsaWrapper.cs (1)
16Debug.Assert(wrapped != null);
System\Security\Cryptography\HashProvider.cs (1)
44Debug.Assert(written == HashSizeInBytes);
System\Security\Cryptography\HashProviderDispenser.OpenSsl.cs (3)
41Debug.Assert(macHandle is not null); 48Debug.Assert(evpType != IntPtr.Zero); 55Debug.Assert(ret == 0);
System\Security\Cryptography\HashProviderDispenser.Unix.cs (5)
41Debug.Assert(evpType != IntPtr.Zero); 52Debug.Assert(written == hashSize); 59Debug.Assert(evpType != IntPtr.Zero); 75Debug.Assert(ret == 0); 79Debug.Assert(length == hashSize);
System\Security\Cryptography\HKDF.cs (2)
68Debug.Assert(HashLength(hashAlgorithmName) == hashLength); 129Debug.Assert(HashLength(hashAlgorithmName) == hashLength);
System\Security\Cryptography\HMACCommon.cs (5)
30Debug.Assert(!string.IsNullOrEmpty(hashAlgorithmId)); 31Debug.Assert(blockSize > 0 || blockSize == -1); 72Debug.Assert(SHA3_256.IsSupported); 76Debug.Assert(SHA3_384.IsSupported); 80Debug.Assert(SHA3_512.IsSupported);
System\Security\Cryptography\HMACMD5.cs (3)
48Debug.Assert(HashSizeValue == HashSizeInBits); 109Debug.Assert(written == buffer.Length); 159Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\HMACSHA1.cs (3)
47Debug.Assert(HashSizeValue == HashSizeInBits); 113Debug.Assert(written == buffer.Length); 161Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\HMACSHA256.cs (3)
46Debug.Assert(HashSizeValue == HashSizeInBits); 105Debug.Assert(written == buffer.Length); 153Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\HMACSHA3_256.cs (3)
68Debug.Assert(HashSizeValue == _hMacCommon.HashSizeInBits); 141Debug.Assert(written == buffer.Length); 191Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\HMACSHA3_384.cs (3)
68Debug.Assert(HashSizeValue == _hMacCommon.HashSizeInBits); 141Debug.Assert(written == buffer.Length); 191Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\HMACSHA3_512.cs (3)
68Debug.Assert(HashSizeValue == _hMacCommon.HashSizeInBits); 141Debug.Assert(written == buffer.Length); 191Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\HMACSHA384.cs (3)
45Debug.Assert(HashSizeValue == HashSizeInBits); 122Debug.Assert(written == buffer.Length); 170Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\HMACSHA512.cs (2)
119Debug.Assert(written == buffer.Length); 167Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\IncrementalHash.cs (14)
30Debug.Assert(!string.IsNullOrEmpty(name.Name)); 31Debug.Assert(hash != null); 40Debug.Assert(!string.IsNullOrEmpty(name.Name)); 41Debug.Assert(hmac != null); 104Debug.Assert((_hash != null) ^ (_hmac != null)); 129Debug.Assert(written == HashLengthInBytes); 176Debug.Assert(destination.Length >= HashLengthInBytes); 178Debug.Assert((_hash != null) ^ (_hmac != null)); 201Debug.Assert(written == HashLengthInBytes); 266Debug.Assert(destination.Length >= HashLengthInBytes); 268Debug.Assert((_hash != null) ^ (_hmac != null)); 380Debug.Assert(!HMACSHA3_256.IsSupported); 383Debug.Assert(!HMACSHA3_384.IsSupported); 386Debug.Assert(!HMACSHA3_512.IsSupported);
System\Security\Cryptography\Kmac128.cs (4)
107Debug.Assert(written == outputLength); 125Debug.Assert(written == destination.Length); 148Debug.Assert(written == outputLength); 165Debug.Assert(written == destination.Length);
System\Security\Cryptography\Kmac256.cs (4)
107Debug.Assert(written == outputLength); 125Debug.Assert(written == destination.Length); 148Debug.Assert(written == outputLength); 165Debug.Assert(written == destination.Length);
System\Security\Cryptography\KmacXof128.cs (4)
107Debug.Assert(written == outputLength); 125Debug.Assert(written == destination.Length); 148Debug.Assert(written == outputLength); 165Debug.Assert(written == destination.Length);
System\Security\Cryptography\KmacXof256.cs (4)
107Debug.Assert(written == outputLength); 125Debug.Assert(written == destination.Length); 148Debug.Assert(written == outputLength); 165Debug.Assert(written == destination.Length);
System\Security\Cryptography\LiteHash.OpenSsl.cs (1)
40Debug.Assert(!algorithm.IsInvalid);
System\Security\Cryptography\LiteHash.Unix.cs (13)
40Debug.Assert(algorithm != IntPtr.Zero); 102Debug.Assert(result == 0); 118Debug.Assert(algorithm != IntPtr.Zero); 145Debug.Assert(destination.Length >= _hashSizeInBytes); 150Debug.Assert(length == _hashSizeInBytes); 163Debug.Assert(length == _hashSizeInBytes); 178Debug.Assert(result == 0); 193Debug.Assert(algorithm != IntPtr.Zero); 218Debug.Assert(destination.Length >= _hashSizeInBytes); 222Debug.Assert(length == _hashSizeInBytes); 228Debug.Assert(destination.Length >= _hashSizeInBytes); 232Debug.Assert(length == _hashSizeInBytes); 252Debug.Assert(result == 0);
System\Security\Cryptography\LiteHashProvider.cs (3)
24Debug.Assert(written == hashSizeInBytes); 76Debug.Assert(written == hashSizeInBytes); 179Debug.Assert(written == result.Length);
System\Security\Cryptography\LiteHashProvider.Xof.cs (4)
17Debug.Assert(written == destination.Length); 25Debug.Assert(written == outputLength); 39Debug.Assert(written == destination.Length); 53Debug.Assert(written == outputLength);
System\Security\Cryptography\MD5.cs (2)
71Debug.Assert(written == buffer.Length); 117Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\Oid.cs (2)
140Debug.Assert(value != null); 141Debug.Assert(friendlyName != null);
System\Security\Cryptography\OidCollection.cs (1)
21Debug.Assert(initialCapacity >= 0);
System\Security\Cryptography\OpenSslCipher.cs (4)
37Debug.Assert(input.Length > 0); 38Debug.Assert((input.Length % PaddingSizeInBytes) == 0); 44Debug.Assert((input.Length % PaddingSizeInBytes) == 0); 45Debug.Assert(input.Length <= output.Length);
System\Security\Cryptography\OpenSslCipherLite.cs (1)
32Debug.Assert(algorithm != IntPtr.Zero);
System\Security\Cryptography\PasswordDeriveBytes.cs (1)
201Debug.Assert(_hash != null);
System\Security\Cryptography\Pbkdf2Implementation.OpenSsl.cs (2)
17Debug.Assert(!destination.IsEmpty); 18Debug.Assert(hashAlgorithmName.Name is not null);
System\Security\Cryptography\PemEncoding.cs (5)
171Debug.Assert(destination.Length >= size); 181Debug.Assert(startPosition <= str.Length); 391Debug.Assert(encodedSize == charsWritten); 433Debug.Assert(remainingData.Length < BytesPerLine); 487Debug.Assert(charsWritten == encodedSize);
System\Security\Cryptography\PemKeyHelpers.cs (2)
150Debug.Assert(bytesWritten == base64size); 236Debug.Assert(bytesWritten == base64size);
System\Security\Cryptography\PKCS1MaskGenerationMethod.cs (1)
49Debug.Assert(hasher.Hash != null);
System\Security\Cryptography\RandomNumberGenerator.cs (1)
313Debug.Assert(!destination.IsEmpty);
System\Security\Cryptography\RandomNumberGeneratorImplementation.OpenSsl.cs (1)
12Debug.Assert(count > 0);
System\Security\Cryptography\RC2Implementation.cs (5)
78Debug.Assert(EffectiveKeySize == KeySize); 91Debug.Assert(EffectiveKeySize == KeySize); 115Debug.Assert(EffectiveKeySize == KeySize); 140Debug.Assert(EffectiveKeySize == KeySize); 165Debug.Assert(EffectiveKeySize == KeySize);
System\Security\Cryptography\Rfc2898DeriveBytes.cs (4)
182Debug.Assert(_blockSize > 0); 287Debug.Assert(_blockSize == _buffer.Length); 297Debug.Assert(bytesWritten == _blockSize); 305Debug.Assert(bytesWritten == _blockSize);
System\Security\Cryptography\Rfc2898DeriveBytes.OneShot.cs (4)
268Debug.Assert(hashAlgorithm.Name is not null); 269Debug.Assert(iterations > 0); 309Debug.Assert(hashAlgorithm.Name is not null); 310Debug.Assert(iterations > 0);
System\Security\Cryptography\RijndaelImplementation.cs (1)
35Debug.Assert(BlockSizeValue == 128);
System\Security\Cryptography\RijndaelManaged.cs (1)
31Debug.Assert(BlockSizeValue == 128);
System\Security\Cryptography\RSAOpenSsl.cs (1)
48Debug.Assert(!pkey.IsInvalid);
System\Security\Cryptography\RSAWrapper.cs (1)
16Debug.Assert(wrapped != null);
System\Security\Cryptography\SHA1.cs (2)
68Debug.Assert(written == buffer.Length); 112Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\SHA256.cs (2)
67Debug.Assert(written == buffer.Length); 112Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\SHA3_256.cs (2)
93Debug.Assert(written == buffer.Length); 145Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\SHA3_384.cs (2)
93Debug.Assert(written == buffer.Length); 146Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\SHA3_512.cs (2)
93Debug.Assert(written == buffer.Length); 145Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\SHA384.cs (2)
67Debug.Assert(written == buffer.Length); 111Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\SHA512.cs (2)
67Debug.Assert(written == buffer.Length); 111Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\SP800108HmacCounterKdfImplementationManaged.cs (2)
33Debug.Assert(destination.Length <= 0x1FFFFFFF); 68Debug.Assert(hmacBufferWritten > destination.Length);
System\Security\Cryptography\SymmetricPadding.cs (1)
13Debug.Assert(plaintextLength >= 0);
System\Security\Cryptography\TripleDES.cs (4)
81Debug.Assert(start1 >= 0); 82Debug.Assert(start2 >= 0); 83Debug.Assert((start1 + count) <= rgbKey.Length); 84Debug.Assert((start2 + count) <= rgbKey.Length);
System\Security\Cryptography\UniversalCryptoDecryptor.cs (1)
157Debug.Assert(written == buffer.Length);
System\Security\Cryptography\UniversalCryptoEncryptor.cs (3)
35Debug.Assert(!inputBuffer.Overlaps(outputBuffer)); 42Debug.Assert(padWritten == transformWritten); 52Debug.Assert(written == buffer.Length);
System\Security\Cryptography\UniversalCryptoOneShot.cs (4)
108Debug.Assert(input.Length > cipher.BlockSizeInBytes); 121Debug.Assert(paddedBlock.Length % cipher.BlockSizeInBytes == 0); 122Debug.Assert(paddedBlock.Length <= MaxInStackDecryptionBuffer); 223Debug.Assert(padWritten == bytesWritten);
System\Security\Cryptography\UniversalCryptoTransform.cs (1)
86Debug.Assert(numBytesWritten >= 0 && numBytesWritten <= inputCount);
System\Security\Cryptography\X509Certificates\CertCollectionLoader.cs (2)
28Debug.Assert(collection != null); 31Debug.Assert(localCerts != null);
System\Security\Cryptography\X509Certificates\CertificateRequest.cs (1)
503Debug.Assert(_generator != null);
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.cs (1)
31Debug.Assert(revoked != null);
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.Load.cs (1)
285Debug.Assert(bytesConsumed == bytesWritten);
System\Security\Cryptography\X509Certificates\ECDsaX509SignatureGenerator.cs (2)
16Debug.Assert(key != null); 100Debug.Assert(ecParameters.Q.X!.Length == ecParameters.Q.Y!.Length);
System\Security\Cryptography\X509Certificates\FindPal.cs (2)
32Debug.Assert(s_keyUsages.Count == NamedKeyUsageFlagsCount); 164Debug.Assert(findValue != null);
System\Security\Cryptography\X509Certificates\ManagedCertificateFinder.cs (2)
298Debug.Assert(written == SHA1.HashSizeInBytes); 348Debug.Assert(!ReferenceEquals(cert, clone));
System\Security\Cryptography\X509Certificates\OpenSslCachedDirectoryStoreProvider.cs (1)
79Debug.Assert(ret != null);
System\Security\Cryptography\X509Certificates\OpenSslCachedSystemStoreProvider.cs (4)
105Debug.Assert(ret != null); 163Debug.Assert(s_rootStoreDirectories is not null); 164Debug.Assert(s_directoryLastWrite is not null); 361Debug.Assert(set.Count == 0);
System\Security\Cryptography\X509Certificates\OpenSslDirectoryBasedStoreProvider.cs (3)
47Debug.Assert(!X509Store.DisallowedStoreName.Equals(storeName, StringComparison.OrdinalIgnoreCase)); 75Debug.Assert(collection != null); 331Debug.Assert(storeName != null);
System\Security\Cryptography\X509Certificates\OpenSslExportProvider.cs (1)
58Debug.Assert(alg != null);
System\Security\Cryptography\X509Certificates\OpenSslPkcsFormatReader.cs (1)
224Debug.Assert(readPals != null); // null if single == true
System\Security\Cryptography\X509Certificates\OpenSslSingleCertLoader.cs (2)
26Debug.Assert(collection != null); 29Debug.Assert(localCert != null);
System\Security\Cryptography\X509Certificates\OpenSslX509CertificateReader.cs (7)
36Debug.Assert(cert.Pal != null); 45Debug.Assert(password != null); 67Debug.Assert(openSslException != null); 99Debug.Assert(pal != null); 109Debug.Assert(bioPosition >= 0); 792Debug.Assert(bytes != null); 835Debug.Assert(exported != null);
System\Security\Cryptography\X509Certificates\OpenSslX509ChainProcessor.cs (6)
381Debug.Assert(revocationFlag == X509RevocationFlag.EntireChain); 484Debug.Assert(refErrors.HasRevocationUnknown()); 520Debug.Assert(chainSize == 1 || revocationFlag != X509RevocationFlag.EndCertificateOnly); 568Debug.Assert(workingChain.LastError <= start - 1); 832Debug.Assert(baseUri.Length > 0); 833Debug.Assert(resource.Length > 0);
System\Security\Cryptography\X509Certificates\OpenSslX509Encoder.cs (1)
106Debug.Assert(bioPosition >= 0);
System\Security\Cryptography\X509Certificates\Pkcs10CertificationRequestInfo.cs (3)
40Debug.Assert(signatureGenerator != null); 41Debug.Assert(Subject != null); 42Debug.Assert(PublicKey != null);
System\Security\Cryptography\X509Certificates\RSAPkcs1X509SignatureGenerator.cs (1)
15Debug.Assert(key != null);
System\Security\Cryptography\X509Certificates\RSAPssX509SignatureGenerator.cs (3)
17Debug.Assert(key != null); 18Debug.Assert(padding != null); 19Debug.Assert(padding.Mode == RSASignaturePaddingMode.Pss);
System\Security\Cryptography\X509Certificates\StorePal.OpenSsl.cs (7)
22Debug.Assert(password != null); 32Debug.Assert(singleCert != null); 44Debug.Assert(certPals != null); 49Debug.Assert(openSslException != null); 72Debug.Assert(bioPosition >= 0); 128Debug.Assert(openSslException != null); 154Debug.Assert(storeLocation == StoreLocation.LocalMachine);
System\Security\Cryptography\X509Certificates\UnixExportProvider.cs (8)
49Debug.Assert(password != null); 91Debug.Assert(_certs != null); 291Debug.Assert(tmpWriter.GetEncodedLength() == 0); 328Debug.Assert(tmpWriter.GetEncodedLength() == 0); 340Debug.Assert(certContentsIv.Length * 8 == cipher.BlockSize); 389Debug.Assert(encryptedLength <= requestedSize); 406Debug.Assert(tmpWriter.GetEncodedLength() == 0); 514Debug.Assert(tmpWriter.GetEncodedLength() == 0);
System\Security\Cryptography\X509Certificates\UnixPkcs12Reader.cs (4)
82Debug.Assert(certs != null); 259Debug.Assert(_pfxAsn.MacData.HasValue); 803Debug.Assert(safeBag.BagId == Oids.Pkcs12KeyBag); 840Debug.Assert(_rented == null);
System\Security\Cryptography\X509Certificates\X500DistinguishedNameBuilder.cs (1)
231Debug.Assert(written == 2);
System\Security\Cryptography\X509Certificates\X500NameEncoder.cs (10)
102Debug.Assert(dnSeparators.Length != 0); 276Debug.Assert(tagStart >= 0); 378Debug.Assert(hasTagOid); 379Debug.Assert(valueEnd != -1); 380Debug.Assert(valueStart != -1); 440Debug.Assert(!hadEscapedQuote); 447Debug.Assert(valueStart != -1); 448Debug.Assert(valueEnd != -1); 547Debug.Assert(destination.Length >= chars.Length); 562Debug.Assert(skippedQuote == (c == '"'));
System\Security\Cryptography\X509Certificates\X500NameEncoder.ManagedDecode.cs (1)
151Debug.Assert(tavReader.RuleSet == AsnEncodingRules.DER);
System\Security\Cryptography\X509Certificates\X500RelativeDistinguishedName.cs (1)
65Debug.Assert(offset > 0);
System\Security\Cryptography\X509Certificates\X509AuthorityInformationAccessExtension.cs (1)
179Debug.Assert(_decoded is not null);
System\Security\Cryptography\X509Certificates\X509Certificate.cs (1)
139Debug.Assert(pal != null);
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (1)
1297Debug.Assert(rawSAN.GetType() == typeof(X509Extension));
System\Security\Cryptography\X509Certificates\X509Certificate2Enumerator.cs (1)
16Debug.Assert(collection != null);
System\Security\Cryptography\X509Certificates\X509Chain.cs (1)
31Debug.Assert(_pal != null);
System\Security\Cryptography\X509Certificates\X509Store.cs (1)
82Debug.Assert(_storePal != null);
System\Security\Cryptography\X509Certificates\X509SubjectAlternativeNameExtension.cs (1)
72Debug.Assert(value.Length is 4 or 16);
System\Security\Cryptography\X509Certificates\X509SubjectKeyIdentifierExtension.cs (2)
174Debug.Assert(written == SHA1.HashSizeInBytes); 211Debug.Assert(written >= TruncateSize);
System\Security\Cryptography\XmlKeyHelper.cs (4)
79Debug.Assert(buf != null); 124Debug.Assert(name.Length > 0); 125Debug.Assert(value.Length > 0); 126Debug.Assert(builder != null);
System.Security.Cryptography.Cose (41)
System\Security\Cryptography\Cose\CoseHeaderMap.cs (2)
353Debug.Assert(!map.ContainsKey(CoseHeaderLabel.Algorithm)); 377Debug.Assert(bytesWritten == ComputeEncodedSize(map, algHeaderValueToSlip));
System\Security\Cryptography\Cose\CoseHelpers.cs (8)
118Debug.Assert(keyType == KeyType.RSA); 119Debug.Assert(signer.RSASignaturePadding != null); 131Debug.Assert(hasher.HashLengthInBytes <= 512 / 8); // largest hash we can get (SHA512). 152Debug.Assert(hasher.HashLengthInBytes <= 512 / 8); // largest hash we can get (SHA512). 210Debug.Assert(keyType == KeyType.RSA); 274Debug.Assert(keyType == KeyType.RSA); 285Debug.Assert(algorithm >= KnownCoseAlgorithms.RS512); 290Debug.Assert(algorithm >= KnownCoseAlgorithms.PS512 && algorithm <= KnownCoseAlgorithms.PS256);
System\Security\Cryptography\Cose\CoseMessage.cs (10)
162Debug.Assert(reader.BytesRemaining == 0); 248Debug.Assert(reader.BytesRemaining == 0); 403Debug.Assert(reader.BytesRemaining == 0); 499Debug.Assert(context == SigStructureContext.Signature1); 500Debug.Assert(signProtected.Length == 0); 511Debug.Assert(bytesWritten == ComputeToBeSignedEncodedSize(context, bodyProtected.Length, signProtected.Length, associatedData.Length, content.Length)); 530Debug.Assert(context == SigStructureContext.Signature1); 531Debug.Assert(signProtectedLength == 0); 568Debug.Assert(length > 0); 599Debug.Assert(bytesWritten == buffer.Length);
System\Security\Cryptography\Cose\CoseMultiSignMessage.cs (5)
219Debug.Assert(expectedSize == bytesWritten); 290Debug.Assert(buffer.Length == bytesWritten); 365Debug.Assert(expectedSize == bytesWritten); 513Debug.Assert(protectedHeadersSize == 1); 628Debug.Assert(bytesWritten == GetEncodedLength());
System\Security\Cryptography\Cose\CoseSign1Message.cs (9)
180Debug.Assert(contentStream == null || (isDetached && contentBytes.Length == 0)); 188Debug.Assert(expectedSize == bytesWritten); 240Debug.Assert(buffer.Length == bytesWritten); 303Debug.Assert(expectedSize == bytesWritten); 611Debug.Assert(contentStream == null || contentBytes.Length == 0); 746Debug.Assert(hasher.HashLengthInBytes <= 512 / 8); // largest hash we can get (SHA512). 757Debug.Assert(keyType == KeyType.RSA); 758Debug.Assert(padding != null); 834Debug.Assert(bytesWritten == GetEncodedLength());
System\Security\Cryptography\Cose\CoseSignature.cs (4)
63Debug.Assert(_message != null); 454Debug.Assert(hasher.HashLengthInBytes <= 512 / 8); // largest hash we can get (SHA512). 467Debug.Assert(keyType == KeyType.RSA); 468Debug.Assert(padding != null);
System\Security\Cryptography\Cose\CoseSigner.cs (3)
189Debug.Assert(_keyType == KeyType.RSA); 190Debug.Assert(RSASignaturePadding != null); 203Debug.Assert(RSASignaturePadding == RSASignaturePadding.Pkcs1);
System.Text.Encoding.CodePages (20)
System\Text\BaseCodePageEncoding.cs (4)
107Debug.Assert(bytesRead == codePageDataFileHeader.Length); 145Debug.Assert(bytesRead == codePageIndex.Length); 191Debug.Assert(bytesRead == codePageHeader.Length); 370Debug.Assert(pNativeMemory != null);
System\Text\BaseCodePageEncoding.netcoreapp.cs (1)
18Debug.Assert(bytesRead == codePageIndex.Length);
System\Text\DBCSCodePageEncoding.cs (1)
87Debug.Assert(m_codePageHeader?.Length > 0);
System\Text\DecoderFallbackBufferHelper.cs (3)
25Debug.Assert(_fallbackBuffer != null); 47Debug.Assert(_fallbackBuffer != null); 103Debug.Assert(_fallbackBuffer != null);
System\Text\EncoderFallbackBufferHelper.cs (3)
34Debug.Assert(_fallbackBuffer != null); 56Debug.Assert(_fallbackBuffer != null); 75Debug.Assert(_fallbackBuffer != null);
System\Text\EncodingTable.cs (7)
71Debug.Assert(encodingNameIndices.Length == CodePagesByName.Length + 1); 72Debug.Assert(encodingNameIndices[encodingNameIndices.Length - 1] == EncodingNames.Length); 82Debug.Assert(index < encodingNameIndices.Length - 1); 104Debug.Assert(left < encodingNameIndices.Length - 1); 145Debug.Assert(MappedCodePages.Length + 1 == indices.Length); 146Debug.Assert(indices[indices.Length - 1] == names.Length); 161Debug.Assert(i < indices.Length - 1);
System\Text\SBCSCodePageEncoding.cs (1)
62Debug.Assert(m_codePageHeader?.Length > 0);
System.Text.Encodings.Web (43)
src\libraries\Common\src\System\HexConverter.cs (1)
165Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
System\IO\TextWriterExtensions.cs (2)
19Debug.Assert(writer != null); 20Debug.Assert(value != null);
System\Text\Encodings\Web\AllowedBmpCodePointsBitmap.cs (1)
70Debug.Assert(definedCharsBitmapAsLittleEndian.Length == thisAllowedCharactersBitmap.Length * sizeof(uint));
System\Text\Encodings\Web\AsciiByteMap.cs (2)
20Debug.Assert(key < BufferSize); 21Debug.Assert(value != 0);
System\Text\Encodings\Web\OptimizedInboxTextEncoder.AdvSimd64.cs (10)
16Debug.Assert(AdvSimd.Arm64.IsSupported); 17Debug.Assert(BitConverter.IsLittleEndian); 115Debug.Assert(lengthInBytes - i <= 3); 129Debug.Assert(resultScalar != ulong.MaxValue); 136Debug.Assert(resultScalar != ulong.MaxValue); 150Debug.Assert(AdvSimd.Arm64.IsSupported); 151Debug.Assert(BitConverter.IsLittleEndian); 230Debug.Assert(lengthInChars - i <= 3); 244Debug.Assert(resultScalar != ulong.MaxValue); 251Debug.Assert(resultScalar != ulong.MaxValue);
System\Text\Encodings\Web\OptimizedInboxTextEncoder.cs (7)
39Debug.Assert(scalarEscaper != null); 296Debug.Assert(scalarValue == Rune.ReplacementChar); // DecodeFromUtfXX should've set replacement character on failure 368Debug.Assert(0 <= asciiBytesSkippedNInt && asciiBytesSkippedNInt <= (uint)dataOriginalLength); 375Debug.Assert(asciiBytesSkipped == data.Length); 389Debug.Assert(!data.IsEmpty); 429Debug.Assert(0 <= idx && idx <= lengthInChars); 466Debug.Assert(0 <= idx && idx <= lengthInChars);
System\Text\Encodings\Web\OptimizedInboxTextEncoder.Ssse3.cs (8)
15Debug.Assert(Ssse3.IsSupported); 16Debug.Assert(BitConverter.IsLittleEndian); 108Debug.Assert(lengthInBytes - i <= 3); 122Debug.Assert(pmovmskb != 0); 135Debug.Assert(Ssse3.IsSupported); 136Debug.Assert(BitConverter.IsLittleEndian); 210Debug.Assert(lengthInChars - i <= 3); 224Debug.Assert(pmovmskb != 0);
System\Text\Encodings\Web\TextEncoder.cs (5)
345Debug.Assert(scalarValue == Rune.ReplacementChar); // DecodeFromUtf8 should've performed substitution 467Debug.Assert(scalarValue == Rune.ReplacementChar); // should be replacement char 514Debug.Assert(output != null); 578Debug.Assert(!string.IsNullOrEmpty(source)); 598Debug.Assert(unicodeScalar < ushort.MaxValue);
System\Text\Unicode\UnicodeHelpers.cs (2)
29Debug.Assert(0x10000 <= scalar && scalar <= UNICODE_LAST_CODEPOINT); 45Debug.Assert(scalar <= UNICODE_LAST_CODEPOINT);
System.Text.Json (1206)
src\libraries\Common\src\System\HexConverter.cs (1)
165Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Text\Json\PooledByteBufferWriter.cs (21)
32Debug.Assert(MaximumBufferSize == Array.MaxLength); 38Debug.Assert(initialCapacity > 0); 48Debug.Assert(_rentedBuffer != null); 49Debug.Assert(_index <= _rentedBuffer.Length); 58Debug.Assert(_rentedBuffer != null); 67Debug.Assert(_rentedBuffer != null); 76Debug.Assert(_rentedBuffer != null); 88Debug.Assert(_rentedBuffer != null); 98Debug.Assert(_rentedBuffer != null); 99Debug.Assert(_index <= _rentedBuffer.Length); 121Debug.Assert(initialCapacity > 0); 122Debug.Assert(_rentedBuffer is null); 132Debug.Assert(_rentedBuffer != null); 133Debug.Assert(count >= 0); 134Debug.Assert(_index <= _rentedBuffer.Length - count); 176Debug.Assert(_rentedBuffer != null); 177Debug.Assert(sizeHint > 0); 208Debug.Assert(oldBuffer.Length >= _index); 209Debug.Assert(_rentedBuffer.Length >= _index); 217Debug.Assert(_rentedBuffer.Length - _index > 0); 218Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (1)
18Debug.Assert(char.IsPunctuation(separator));
src\libraries\System.Text.Json\Common\ReflectionExtensions.cs (8)
49Debug.Assert(baseType.IsGenericType); 50Debug.Assert(!baseType.IsInterface); 51Debug.Assert(baseType == baseType.GetGenericTypeDefinition()); 86Debug.Assert(interfaceType.IsGenericType); 87Debug.Assert(interfaceType.IsInterface); 88Debug.Assert(interfaceType == interfaceType.GetGenericTypeDefinition()); 162Debug.Assert(type.IsImmutableDictionaryType()); 183Debug.Assert(type.IsImmutableEnumerableType());
System\Text\Json\BitStack.cs (4)
122Debug.Assert(_array != null); 134Debug.Assert(_array != null); 136Debug.Assert(minSize >= 0 && minSize >= _array.Length); 139Debug.Assert(nextDouble > minSize);
System\Text\Json\Document\JsonDocument.cs (20)
44Debug.Assert(!utf8Json.IsEmpty); 47Debug.Assert(isDisposable || 51Debug.Assert(extraRentedArrayPoolBytes == null || extraPooledByteBufferWriter == null); 236Debug.Assert(row.TokenType == JsonTokenType.PropertyName); 298Debug.Assert(status != OperationStatus.DestinationTooSmall); 306Debug.Assert(status == OperationStatus.Done); 347Debug.Assert(idx != -1); 383Debug.Assert(segment.IndexOf(JsonConstants.BackSlash) == -1); 652Debug.Assert(segment.IndexOf(JsonConstants.BackSlash) == -1); 687Debug.Assert(segment.IndexOf(JsonConstants.BackSlash) == -1); 722Debug.Assert(segment.IndexOf(JsonConstants.BackSlash) == -1); 851Debug.Assert(row.TokenType == JsonTokenType.String || row.TokenType == JsonTokenType.PropertyName); 882Debug.Assert(row.TokenType == JsonTokenType.PropertyName); 936Debug.Assert(reader.TokenStartIndex <= int.MaxValue); 1020Debug.Assert(tokenStart < int.MaxValue); 1029Debug.Assert(!inArray); 1033Debug.Assert(tokenType >= JsonTokenType.String && tokenType <= JsonTokenType.Null); 1045Debug.Assert(tokenStart < int.MaxValue); 1063Debug.Assert(reader.BytesConsumed == utf8JsonSpan.Length); 1088Debug.Assert(readerOptions.CommentHandling >= 0 && readerOptions.CommentHandling <= JsonCommentHandling.Allow);
System\Text\Json\Document\JsonDocument.DbRow.cs (5)
57Debug.Assert(sizeof(DbRow) == Size); 63Debug.Assert(jsonTokenType > JsonTokenType.None && jsonTokenType <= JsonTokenType.Null); 64Debug.Assert((byte)jsonTokenType < 1 << 4); 65Debug.Assert(location >= 0); 66Debug.Assert(sizeOrLength >= UnknownSize);
System\Text\Json\Document\JsonDocument.MetadataDb.cs (9)
178Debug.Assert(_data != null); 219Debug.Assert( 244Debug.Assert(MaxArrayLength == Array.MaxLength); 269Debug.Assert(index >= 0); 277Debug.Assert(length >= 0); 285Debug.Assert(numberOfRows >= 1 && numberOfRows <= 0x0FFFFFFF); 309Debug.Assert(lookupType == JsonTokenType.StartObject || lookupType == JsonTokenType.StartArray); 353Debug.Assert(endIndex <= Length); 395Debug.Assert(newDbInts[i] >= locationOffset);
System\Text\Json\Document\JsonDocument.Parse.cs (15)
126Debug.Assert(drained.Array != null); 151Debug.Assert(utf8Json != null); 154Debug.Assert(drained.Array != null); 176Debug.Assert(json != null); 215Debug.Assert(drained.Array != null); 235Debug.Assert(drained.Array != null); 275Debug.Assert(expectedByteCount == actualByteCount); 301Debug.Assert(expectedByteCount == actualByteCount); 508Debug.Assert( 559Debug.Assert(payloadLength > 1); 603Debug.Assert(!reader.HasValueSequence); 683Debug.Assert(tokenType == JsonTokenType.Null); 729Debug.Assert( 788Debug.Assert(rented.Length >= utf8Bom.Length); 871Debug.Assert(rented.Length >= JsonConstants.Utf8Bom.Length);
System\Text\Json\Document\JsonDocument.StackRow.cs (2)
23Debug.Assert(sizeOrLength >= 0); 24Debug.Assert(numberOfRows >= -1);
System\Text\Json\Document\JsonDocument.StackRowStack.cs (2)
55Debug.Assert(_rentedBuffer != null); 56Debug.Assert(_topOfStack <= _rentedBuffer!.Length - StackRow.Size);
System\Text\Json\Document\JsonDocument.TryGetProperty.cs (7)
59Debug.Assert(row.TokenType != JsonTokenType.PropertyName); 68Debug.Assert(row.NumberOfRows > 0); 73Debug.Assert(row.TokenType == JsonTokenType.PropertyName); 150Debug.Assert(row.TokenType != JsonTokenType.PropertyName); 159Debug.Assert(row.NumberOfRows > 0); 164Debug.Assert(row.TokenType == JsonTokenType.PropertyName); 175Debug.Assert(idx >= 0);
System\Text\Json\Document\JsonDocumentOptions.cs (1)
32Debug.Assert(value >= 0);
System\Text\Json\Document\JsonElement.ArrayEnumerator.cs (1)
27Debug.Assert(target.TokenType == JsonTokenType.StartArray);
System\Text\Json\Document\JsonElement.cs (2)
26Debug.Assert(idx >= 0); 1429Debug.Assert(_parent != null);
System\Text\Json\Document\JsonElement.ObjectEnumerator.cs (1)
27Debug.Assert(target.TokenType == JsonTokenType.StartObject);
System\Text\Json\JsonEncodedText.cs (2)
34Debug.Assert(utf8Value != null); 94Debug.Assert(expectedByteCount == utf8Bytes.Length);
System\Text\Json\JsonHelpers.cs (3)
21Debug.Assert(reader.TokenType is JsonTokenType.String or JsonTokenType.PropertyName); 72Debug.Assert(tokenType == reader.TokenType); 142Debug.Assert(result);
System\Text\Json\JsonHelpers.Date.cs (7)
146Debug.Assert(source.Length >= 10); 240Debug.Assert(source.Length >= 16); 273Debug.Assert(source.Length >= 19); 332Debug.Assert(sourceIndex <= source.Length); 386Debug.Assert(source.Length == 2); 504Debug.Assert(parseData.Year <= 9999); // All of our callers to date parse the year from fixed 4-digit fields so this value is trusted. 539Debug.Assert(parseData.Fraction >= 0 && parseData.Fraction <= JsonConstants.MaxDateTimeFraction); // All of our callers to date parse the fraction from fixed 7-digit fields so this value is trusted.
System\Text\Json\JsonHelpers.Escaping.cs (4)
33Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length); 34Debug.Assert(firstEscapeIndexVal >= 0 && firstEscapeIndexVal < utf8Value.Length); 61Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length); 62Debug.Assert(firstEscapeIndexVal >= 0 && firstEscapeIndexVal < utf8Value.Length);
System\Text\Json\JsonPropertyDictionary.cs (3)
77Debug.Assert(propertyName != null); 273Debug.Assert(existing == null); 399Debug.Assert(success);
System\Text\Json\Nodes\JsonArray.cs (4)
203Debug.Assert(element.ValueKind == JsonValueKind.Array); 246Debug.Assert(index >= 0); 252Debug.Assert(formatted); 304Debug.Assert(jElement.ValueKind == JsonValueKind.Array);
System\Text\Json\Nodes\JsonObject.cs (1)
72Debug.Assert(element.ValueKind == JsonValueKind.Object);
System\Text\Json\Nodes\JsonValue.cs (1)
95Debug.Assert(child == null);
System\Text\Json\Nodes\JsonValueOfT.cs (5)
17Debug.Assert(value != null); 18Debug.Assert(value is not JsonElement or JsonElement { ValueKind: not JsonValueKind.Null }); 223Debug.Assert(str != null); 336Debug.Assert(strResult != null); 365Debug.Assert(str != null);
System\Text\Json\Nodes\JsonValueOfTCustomized.cs (1)
18Debug.Assert(jsonTypeInfo.IsConfigured);
System\Text\Json\Nodes\JsonValueOfTPrimitive.cs (1)
22Debug.Assert(converter is { IsInternalConverter: true, ConverterStrategy: ConverterStrategy.Value });
System\Text\Json\Reader\JsonReaderHelper.cs (9)
84Debug.Assert(source.Length <= JsonConstants.MaximumEscapedDateTimeOffsetParseLength); 88Debug.Assert(written > 0); 91Debug.Assert(!sourceUnescaped.IsEmpty); 106Debug.Assert(source.Length <= JsonConstants.MaximumEscapedDateTimeOffsetParseLength); 110Debug.Assert(written > 0); 113Debug.Assert(!sourceUnescaped.IsEmpty); 128Debug.Assert(source.Length <= JsonConstants.MaximumEscapedGuidLength); 132Debug.Assert(written > 0); 135Debug.Assert(!utf8Unescaped.IsEmpty);
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (35)
23Debug.Assert(written > 0); 26Debug.Assert(!utf8Unescaped.IsEmpty); 53Debug.Assert(written > 0); 56Debug.Assert(!utf8Unescaped.IsEmpty); 80Debug.Assert(written > 0); 83Debug.Assert(!propertyName.IsEmpty); 96Debug.Assert(utf8Source.Length >= other.Length && utf8Source.Length / JsonConstants.MaxExpansionFactorWhileEscaping <= other.Length); 105Debug.Assert(written > 0); 108Debug.Assert(!utf8Unescaped.IsEmpty); 123Debug.Assert(!utf8Source.IsSingleSegment); 124Debug.Assert(utf8Source.Length >= other.Length && utf8Source.Length / JsonConstants.MaxExpansionFactorWhileEscaping <= other.Length); 143Debug.Assert(written > 0); 146Debug.Assert(!utf8Unescaped.IsEmpty); 152Debug.Assert(escapedArray != null); 196Debug.Assert(bytesConsumed == utf8Unescaped.Length); 402Debug.Assert(destination.Length >= source.Length); 405Debug.Assert(idx >= 0); 408Debug.Assert(result); 413Debug.Assert(idx >= 0 && idx < source.Length); 414Debug.Assert(source[idx] == JsonConstants.BackSlash); 415Debug.Assert(destination.Length >= source.Length); 418Debug.Assert(result); 427Debug.Assert(idx >= 0); 437Debug.Assert(idx >= 0 && idx < source.Length); 438Debug.Assert(source[idx] == JsonConstants.BackSlash); 450Debug.Assert(source[idx] == JsonConstants.BackSlash); 488Debug.Assert(source.Length >= idx + 5); 491Debug.Assert(result); 492Debug.Assert(bytesConsumed == 4); 503Debug.Assert(JsonHelpers.IsInRangeInclusive((uint)scalar, JsonConstants.HighSurrogateStartValue, JsonConstants.HighSurrogateEndValue)); 514Debug.Assert(result); 515Debug.Assert(bytesConsumed == 4); 542Debug.Assert(bytesWritten <= 4); 566Debug.Assert(nextUnescapedSegmentLength > 0); 588Debug.Assert(idx == source.Length || source[idx] == JsonConstants.BackSlash);
System\Text\Json\Reader\JsonReaderOptions.cs (1)
32Debug.Assert(value >= 0);
System\Text\Json\Reader\Utf8JsonReader.cs (53)
83Debug.Assert(_totalConsumed == 0); 111Debug.Assert(readerDepth >= 1); 172Debug.Assert(_currentPosition.GetObject() != null); 323Debug.Assert(_isFinalBlock); 330Debug.Assert(result); 341Debug.Assert(result); 397Debug.Assert(0 <= targetDepth && targetDepth <= CurrentDepth); 428Debug.Assert(targetDepth == CurrentDepth); 552Debug.Assert(status != OperationStatus.DestinationTooSmall); 560Debug.Assert(status == OperationStatus.Done); 575Debug.Assert(HasValueSequence); 584Debug.Assert(!localSequence.IsSingleSegment); 611Debug.Assert(!HasValueSequence); 620Debug.Assert(idx != -1); 632Debug.Assert(HasValueSequence); 633Debug.Assert(!ValueSequence.IsSingleSegment); 1047Debug.Assert((_trailingCommaBeforeComment && _readerOptions.CommentHandling == JsonCommentHandling.Allow) || !_trailingCommaBeforeComment); 1048Debug.Assert((_trailingCommaBeforeComment && marker != JsonConstants.Slash) || !_trailingCommaBeforeComment); 1092Debug.Assert(_readerOptions.CommentHandling == JsonCommentHandling.Skip); 1139Debug.Assert(span.Length > 0); 1140Debug.Assert(span[0] == 'n' || span[0] == 't' || span[0] == 'f'); 1156Debug.Assert(span.Length > 0 && span[0] == literal[0]); 1177Debug.Assert(indexOfFirstMismatch > 0 && indexOfFirstMismatch < literal.Length); 1201Debug.Assert(firstByte == 'n'); 1221Debug.Assert(IsLastSpan); 1232Debug.Assert( 1284Debug.Assert(_buffer.Length >= _consumed + 1); 1285Debug.Assert(_buffer[_consumed] == JsonConstants.Quote); 1329Debug.Assert(idx >= 0 && idx < data.Length); 1330Debug.Assert(data[idx] != JsonConstants.Quote); 1331Debug.Assert(data[idx] == JsonConstants.BackSlash || data[idx] < JsonConstants.Space); 1431Debug.Assert(data.Length > 0); 1442Debug.Assert(signResult == ConsumeNumberResult.OperationIncomplete); 1445Debug.Assert(nextByte >= '0' && nextByte <= '9'); 1459Debug.Assert(result == ConsumeNumberResult.OperationIncomplete); 1475Debug.Assert(result == ConsumeNumberResult.OperationIncomplete); 1484Debug.Assert(nextByte == '.' || nextByte == 'E' || nextByte == 'e'); 1499Debug.Assert(result == ConsumeNumberResult.OperationIncomplete); 1508Debug.Assert(nextByte == 'E' || nextByte == 'e'); 1517Debug.Assert(signResult == ConsumeNumberResult.OperationIncomplete); 1530Debug.Assert(resultExponent == ConsumeNumberResult.OperationIncomplete); 1570Debug.Assert(data[i] == (byte)'0'); 1743Debug.Assert(_readerOptions.CommentHandling == JsonCommentHandling.Skip); 1838Debug.Assert(_readerOptions.CommentHandling == JsonCommentHandling.Allow); 1839Debug.Assert(_tokenType == JsonTokenType.Comment); 1850Debug.Assert(_tokenType != JsonTokenType.Comment); 1875Debug.Assert(first != JsonConstants.Slash); 1997Debug.Assert(first != JsonConstants.CloseBrace); 2019Debug.Assert(first != JsonConstants.CloseBracket); 2036Debug.Assert(_tokenType == JsonTokenType.EndArray || _tokenType == JsonTokenType.EndObject); 2039Debug.Assert(first != JsonConstants.CloseBrace); 2056Debug.Assert(first != JsonConstants.CloseBracket); 2344Debug.Assert(localBuffer[idx] == JsonConstants.CarriageReturn);
System\Text\Json\Reader\Utf8JsonReader.MultiSegment.cs (54)
94Debug.Assert(!_nextPosition.Equals(_currentPosition)); 229Debug.Assert(_isNotPrimitive && IsLastSpan); 303Debug.Assert(!_isMultiSegment || _currentPosition.GetObject() != null); 320Debug.Assert(!_isMultiSegment || _currentPosition.GetObject() != null); 408Debug.Assert((_trailingCommaBeforeComment && _readerOptions.CommentHandling == JsonCommentHandling.Allow) || !_trailingCommaBeforeComment); 409Debug.Assert((_trailingCommaBeforeComment && marker != JsonConstants.Slash) || !_trailingCommaBeforeComment); 459Debug.Assert(_readerOptions.CommentHandling == JsonCommentHandling.Skip); 517Debug.Assert(span.Length > 0); 518Debug.Assert(span[0] == 'n' || span[0] == 't' || span[0] == 'f'); 544Debug.Assert(span.Length > 0 && span[0] == literal[0] && literal.Length <= JsonConstants.MaximumLiteralLength); 632Debug.Assert(span.Length > 0); 649Debug.Assert(indexOfFirstMismatch >= 0 && indexOfFirstMismatch < literal.Length); 668Debug.Assert(firstByte == 'n'); 687Debug.Assert(IsLastSpan); 698Debug.Assert( 750Debug.Assert(_buffer.Length >= _consumed + 1); 751Debug.Assert(_buffer[_consumed] == JsonConstants.Quote); 959Debug.Assert(idx >= 0 && idx < data.Length); 960Debug.Assert(data[idx] != JsonConstants.Quote); 961Debug.Assert(data[idx] == JsonConstants.BackSlash || data[idx] < JsonConstants.Space); 1124Debug.Assert(data.Length > 0); 1138Debug.Assert(signResult == ConsumeNumberResult.OperationIncomplete); 1141Debug.Assert(nextByte >= '0' && nextByte <= '9'); 1156Debug.Assert(result == ConsumeNumberResult.OperationIncomplete); 1172Debug.Assert(result == ConsumeNumberResult.OperationIncomplete); 1181Debug.Assert(nextByte == '.' || nextByte == 'E' || nextByte == 'e'); 1198Debug.Assert(result == ConsumeNumberResult.OperationIncomplete); 1207Debug.Assert(nextByte == 'E' || nextByte == 'e'); 1218Debug.Assert(signResult == ConsumeNumberResult.OperationIncomplete); 1233Debug.Assert(resultExponent == ConsumeNumberResult.OperationIncomplete); 1256Debug.Assert(i == 0); 1279Debug.Assert(i == 1); 1298Debug.Assert(data[i] == (byte)'0'); 1299Debug.Assert(i == 0 || i == 1); 1576Debug.Assert(_readerOptions.CommentHandling == JsonCommentHandling.Skip); 1680Debug.Assert(_readerOptions.CommentHandling == JsonCommentHandling.Allow); 1681Debug.Assert(_tokenType == JsonTokenType.Comment); 1692Debug.Assert(_tokenType != JsonTokenType.Comment); 1717Debug.Assert(first != JsonConstants.Slash); 1848Debug.Assert(first != JsonConstants.CloseBrace); 1872Debug.Assert(first != JsonConstants.CloseBracket); 1889Debug.Assert(_tokenType == JsonTokenType.EndArray || _tokenType == JsonTokenType.EndObject); 1892Debug.Assert(first != JsonConstants.CloseBrace); 1909Debug.Assert(first != JsonConstants.CloseBracket); 2175Debug.Assert( 2325Debug.Assert(dangerousLineSeparatorBytesConsumed >= 0 && dangerousLineSeparatorBytesConsumed <= 2); 2339Debug.Assert(localBuffer[idx] == JsonConstants.CarriageReturn); 2399Debug.Assert(dangerousLineSeparatorBytesConsumed >= 0 && dangerousLineSeparatorBytesConsumed <= 2); 2409Debug.Assert(dangerousLineSeparatorBytesConsumed >= 1 && dangerousLineSeparatorBytesConsumed <= 2 && localBuffer.Length <= 1); 2440Debug.Assert(localBuffer.Length < 2); 2449Debug.Assert(dangerousLineSeparatorBytesConsumed == 1 || dangerousLineSeparatorBytesConsumed == 2); 2503Debug.Assert(localBuffer.Length > 0); 2549Debug.Assert(marker == JsonConstants.CarriageReturn); 2583Debug.Assert(!localBuffer.IsEmpty);
System\Text\Json\Reader\Utf8JsonReader.TryGet.cs (12)
46Debug.Assert(span.IndexOf(JsonConstants.BackSlash) == -1); 81Debug.Assert(_tokenType is JsonTokenType.String or JsonTokenType.PropertyName or JsonTokenType.Number); 145Debug.Assert(_tokenType is JsonTokenType.String or JsonTokenType.PropertyName or JsonTokenType.Number); 161Debug.Assert(success); 197Debug.Assert(_tokenType is JsonTokenType.String or JsonTokenType.PropertyName); 198Debug.Assert(ValueIsEscaped); 262Debug.Assert((HasValueSequence ? ValueSequence.ToArray() : ValueSpan).Length == 4); 271Debug.Assert((HasValueSequence ? ValueSequence.ToArray() : ValueSpan).Length == 5); 841Debug.Assert(span.IndexOf(JsonConstants.BackSlash) == -1); 1277Debug.Assert(span.IndexOf(JsonConstants.BackSlash) == -1); 1342Debug.Assert(span.IndexOf(JsonConstants.BackSlash) == -1); 1408Debug.Assert(span.IndexOf(JsonConstants.BackSlash) == -1);
System\Text\Json\Serialization\Converters\CastingConverter.cs (1)
24Debug.Assert(typeof(T).IsInSubtypeRelationshipWith(sourceConverter.Type!));
System\Text\Json\Serialization\Converters\Collection\IAsyncEnumerableOfTConverter.cs (4)
76Debug.Assert(state.Current.AsyncDisposable is IAsyncEnumerator<TElement>); 82Debug.Assert(state.PendingTask is Task<bool> && state.PendingTask.IsCompleted); 95Debug.Assert(moveNextTask.IsCompleted); 129Debug.Assert(state.PendingTask is null);
System\Text\Json\Serialization\Converters\Collection\ICollectionOfTConverter.cs (1)
45Debug.Assert(Type.IsInterface);
System\Text\Json\Serialization\Converters\Collection\IDictionaryConverter.cs (1)
105Debug.Assert(Type.IsInterface);
System\Text\Json\Serialization\Converters\Collection\IDictionaryOfTKeyTValueConverter.cs (1)
47Debug.Assert(Type.IsInterface);
System\Text\Json\Serialization\Converters\Collection\IEnumerableConverterFactory.cs (2)
171Debug.Assert(typeof(IEnumerable).IsAssignableFrom(typeToConvert)); 192Debug.Assert(numberOfGenericArgs == 3);
System\Text\Json\Serialization\Converters\Collection\IEnumerableConverterFactoryHelpers.cs (2)
72Debug.Assert(type.IsImmutableEnumerableType()); 85Debug.Assert(type.IsImmutableDictionaryType());
System\Text\Json\Serialization\Converters\Collection\IEnumerableDefaultConverter.cs (2)
19Debug.Assert(value is not null); 33Debug.Assert(state.Current.CollectionEnumerator is IEnumerator<TElement>);
System\Text\Json\Serialization\Converters\Collection\IListConverter.cs (1)
84Debug.Assert(Type.IsInterface);
System\Text\Json\Serialization\Converters\Collection\IListOfTConverter.cs (1)
45Debug.Assert(Type.IsInterface);
System\Text\Json\Serialization\Converters\Collection\ImmutableDictionaryOfTKeyTValueConverter.cs (1)
32Debug.Assert(creator != null);
System\Text\Json\Serialization\Converters\Collection\ImmutableEnumerableOfTConverter.cs (1)
32Debug.Assert(creator != null);
System\Text\Json\Serialization\Converters\Collection\ISetOfTConverter.cs (1)
42Debug.Assert(Type.IsInterface);
System\Text\Json\Serialization\Converters\Collection\JsonCollectionConverter.cs (8)
41Debug.Assert(state.Current.ReturnValue is TCollection); 53Debug.Assert(state.Current.JsonPropertyInfo != null); 161Debug.Assert(!IsValueType); 179Debug.Assert(state.ReferenceId != null); 180Debug.Assert(options.ReferenceHandlingStrategy == ReferenceHandlingStrategy.Preserve); 181Debug.Assert(state.Current.ReturnValue is TCollection); 259Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 265Debug.Assert(reader.TokenType is JsonTokenType.EndObject);
System\Text\Json\Serialization\Converters\Collection\JsonDictionaryConverter.cs (8)
56Debug.Assert(state.Current.ReturnValue is TDictionary); 110Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 136Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 187Debug.Assert(!IsValueType); 206Debug.Assert(state.ReferenceId != null); 207Debug.Assert(options.ReferenceHandlingStrategy == ReferenceHandlingStrategy.Preserve); 208Debug.Assert(state.Current.ReturnValue is TDictionary); 243Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Collection\MemoryConverterFactory.cs (1)
26Debug.Assert(CanConvert(typeToConvert));
System\Text\Json\Serialization\Converters\Collection\StackOrQueueConverter.cs (2)
19Debug.Assert(addMethodDelegate != null); 40Debug.Assert(typeInfo.AddMethodDelegate != null);
System\Text\Json\Serialization\Converters\FSharp\FSharpTypeConverterFactory.cs (2)
31Debug.Assert(CanConvert(typeToConvert)); 66Debug.Assert(objectFactory.CanConvert(typeToConvert));
System\Text\Json\Serialization\Converters\JsonMetadataServicesConverter.cs (1)
51Debug.Assert(jsonTypeInfo is JsonTypeInfo<T> typeInfo && typeInfo.SerializeHandler != null);
System\Text\Json\Serialization\Converters\Node\JsonArrayConverter.cs (1)
31Debug.Assert(false);
System\Text\Json\Serialization\Converters\Node\JsonNodeConverter.cs (1)
54Debug.Assert(false);
System\Text\Json\Serialization\Converters\Node\JsonNodeConverterFactory.cs (1)
29Debug.Assert(typeof(JsonNode) == typeToConvert);
System\Text\Json\Serialization\Converters\Node\JsonObjectConverter.cs (4)
25Debug.Assert(success); // Node converters are not resumable. 27Debug.Assert(obj is JsonObject); 30Debug.Assert(value == null || value is JsonNode); 56Debug.Assert(false);
System\Text\Json\Serialization\Converters\Object\ObjectConverter.cs (2)
106Debug.Assert(options.UnknownTypeHandling == JsonUnknownTypeHandling.JsonNode); 132Debug.Assert(options.UnknownTypeHandling == JsonUnknownTypeHandling.JsonNode);
System\Text\Json\Serialization\Converters\Object\ObjectConverterFactory.cs (1)
33Debug.Assert(!typeof(IEnumerable).IsAssignableFrom(typeToConvert));
System\Text\Json\Serialization\Converters\Object\ObjectDefaultConverter.cs (13)
50Debug.Assert(obj != null); 91Debug.Assert(!IsValueType); 127Debug.Assert(state.ReferenceId != null); 128Debug.Assert(options.ReferenceHandlingStrategy == ReferenceHandlingStrategy.Preserve); 142Debug.Assert(obj != null); 172Debug.Assert(tokenType == JsonTokenType.PropertyName); 177Debug.Assert(options.AllowOutOfOrderMetadataProperties); 195Debug.Assert(state.Current.JsonPropertyInfo != null); 256Debug.Assert(obj != null); 289Debug.Assert(tokenType == JsonTokenType.PropertyName); 348Debug.Assert(success); 363Debug.Assert(success); 397Debug.Assert(jsonPropertyInfo.EffectiveConverter.ConverterStrategy != ConverterStrategy.Value);
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.cs (18)
70Debug.Assert(properties != null); 89Debug.Assert(tempReader.TokenType == JsonTokenType.PropertyName); 99Debug.Assert(jsonPropertyInfo == state.Current.JsonTypeInfo.ExtensionDataProperty); 149Debug.Assert(!IsValueType); 199Debug.Assert(state.ReferenceId != null); 200Debug.Assert(options.ReferenceHandlingStrategy == ReferenceHandlingStrategy.Preserve); 217Debug.Assert(jsonPropertyInfo.Set != null); 229Debug.Assert(jsonPropertyInfo == state.Current.JsonTypeInfo.ExtensionDataProperty); 255Debug.Assert(obj != null); 300Debug.Assert(tokenType == JsonTokenType.PropertyName); 305Debug.Assert(options.AllowOutOfOrderMetadataProperties); 331Debug.Assert(jsonParameterInfo.MatchingProperty != null); 413Debug.Assert(tokenType == JsonTokenType.PropertyName); 418Debug.Assert(options.AllowOutOfOrderMetadataProperties); 456Debug.Assert(jsonPropertyInfo == null); 553Debug.Assert(jsonPropertyInfo.CanDeserialize); 604Debug.Assert(state.Current.CtorArgumentState != null); 619Debug.Assert(state.Current.JsonTypeInfo.Kind == JsonTypeInfoKind.Object);
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.Large.cs (4)
19Debug.Assert(jsonParameterInfo.ShouldDeserialize); 36Debug.Assert(frame.CtorArgumentState != null); 37Debug.Assert(frame.JsonTypeInfo.CreateObjectWithArgs != null); 54Debug.Assert(typeInfo.ParameterCache != null);
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.Small.cs (3)
30Debug.Assert(state.Current.CtorArgumentState!.Arguments != null); 63Debug.Assert(jsonParameterInfo.ShouldDeserialize); 85Debug.Assert(typeInfo.CreateObjectWithArgs != null);
System\Text\Json\Serialization\Converters\Value\BooleanConverter.cs (1)
23Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\ByteConverter.cs (1)
27Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\CharConverter.cs (1)
49Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\DateOnlyConverter.cs (3)
27Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 66Debug.Assert(formattedSuccessfully && charsWritten == FormatLength); 78Debug.Assert(formattedSuccessfully && charsWritten == FormatLength);
System\Text\Json\Serialization\Converters\Value\DateTimeConverter.cs (1)
22Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\DateTimeOffsetConverter.cs (1)
22Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\DecimalConverter.cs (1)
27Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\DoubleConverter.cs (1)
27Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (3)
71Debug.Assert(names.Length == values.Length); 211Debug.Assert(original.Contains(ValueSeparator)); 458Debug.Assert(value is T);
System\Text\Json\Serialization\Converters\Value\EnumConverterFactory.cs (1)
23Debug.Assert(CanConvert(type));
System\Text\Json\Serialization\Converters\Value\GuidConverter.cs (1)
22Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\HalfConverter.cs (3)
59Debug.Assert(!Half.IsNaN(result) && !Half.IsInfinity(result)); 76Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 214Debug.Assert(formattedSuccessfully);
System\Text\Json\Serialization\Converters\Value\Int128Converter.cs (2)
81Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 152Debug.Assert(formattedSuccessfully);
System\Text\Json\Serialization\Converters\Value\Int16Converter.cs (1)
28Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\Int32Converter.cs (1)
28Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\Int64Converter.cs (1)
27Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\NullableConverterFactory.cs (2)
21Debug.Assert(typeToConvert.IsNullableOfT()); 37Debug.Assert(valueTypeToConvert.IsValueType && !valueTypeToConvert.IsNullableOfT());
System\Text\Json\Serialization\Converters\Value\SByteConverter.cs (1)
27Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\SingleConverter.cs (1)
28Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\StringConverter.cs (1)
30Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\TimeOnlyConverter.cs (5)
27Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 33Debug.Assert(reader.TokenType is JsonTokenType.String or JsonTokenType.PropertyName); 73Debug.Assert(TimeOnly.MinValue.ToTimeSpan() <= timespan && timespan <= TimeOnly.MaxValue.ToTimeSpan()); 82Debug.Assert(result); 92Debug.Assert(result);
System\Text\Json\Serialization\Converters\Value\TimeSpanConverter.cs (4)
27Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 33Debug.Assert(reader.TokenType is JsonTokenType.String or JsonTokenType.PropertyName); 80Debug.Assert(result); 90Debug.Assert(result);
System\Text\Json\Serialization\Converters\Value\UInt128Converter.cs (2)
80Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 151Debug.Assert(formattedSuccessfully);
System\Text\Json\Serialization\Converters\Value\UInt16Converter.cs (1)
28Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\UInt32Converter.cs (1)
28Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\UInt64Converter.cs (1)
27Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\UnsupportedTypeConverterFactory.cs (1)
35Debug.Assert(CanConvert(type));
System\Text\Json\Serialization\Converters\Value\UriConverter.cs (1)
28Debug.Assert(reader.TokenType is JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\VersionConverter.cs (3)
35Debug.Assert(reader.TokenType is JsonTokenType.PropertyName or JsonTokenType.String); 94Debug.Assert(formattedSuccessfully && charsWritten >= MinimumVersionLength); 120Debug.Assert(formattedSuccessfully && charsWritten >= MinimumVersionLength);
System\Text\Json\Serialization\IgnoreReferenceResolver.cs (2)
16Debug.Assert(_stackForCycleDetection != null); 29Debug.Assert(!_stackForCycleDetection.Contains(wrappedValue));
System\Text\Json\Serialization\JsonConverter.cs (1)
116Debug.Assert(this is not JsonConverterFactory);
System\Text\Json\Serialization\JsonConverter.MetadataHandling.cs (23)
16Debug.Assert(!IsValueType); 17Debug.Assert(CanHaveMetadata); 18Debug.Assert((state.Current.MetadataPropertyNames & MetadataPropertyName.Type) != 0); 19Debug.Assert(state.Current.PolymorphicSerializationState != PolymorphicSerializationState.PolymorphicReEntryStarted); 20Debug.Assert(jsonTypeInfo.PolymorphicTypeResolver?.UsesTypeDiscriminators == true); 27Debug.Assert(!state.IsContinuation); 28Debug.Assert(state.PolymorphicTypeDiscriminator != null); 33Debug.Assert(Type!.IsAssignableFrom(resolvedType.Type)); 51Debug.Assert(Type!.IsAssignableFrom(polymorphicConverter.Type)); 55Debug.Assert(state.Current.PolymorphicJsonTypeInfo is null); 71Debug.Assert(!IsValueType); 72Debug.Assert(value != null && Type!.IsAssignableFrom(value.GetType())); 73Debug.Assert(CanBePolymorphic || jsonTypeInfo.PolymorphicTypeResolver != null); 74Debug.Assert(state.PolymorphicTypeDiscriminator is null); 81Debug.Assert(!state.IsContinuation); 87Debug.Assert(Type == typeof(object)); 94Debug.Assert(jsonTypeInfo.Converter.CanHaveMetadata); 121Debug.Assert(state.IsContinuation); 123Debug.Assert(Type.IsAssignableFrom(polymorphicConverter.Type)); 127Debug.Assert(state.IsContinuation); 140Debug.Assert(!IsValueType); 141Debug.Assert(!state.IsContinuation); 142Debug.Assert(value != null);
System\Text\Json\Serialization\JsonConverterFactory.cs (1)
41Debug.Assert(CanConvert(typeToConvert));
System\Text\Json\Serialization\JsonConverterOfT.cs (22)
170Debug.Assert(!state.IsContinuation); 212Debug.Assert(IsInternalConverter); 224Debug.Assert(this is ObjectConverter); 226Debug.Assert(success); 239Debug.Assert(Type == state.Current.JsonTypeInfo.Type); 245Debug.Assert(state.Current.OriginalTokenType == JsonTokenType.None); 248Debug.Assert(state.Current.OriginalDepth == 0); 281Debug.Assert(ReferenceEquals(originalJsonTypeInfo, state.Current.JsonTypeInfo)); 348Debug.Assert(!state.IsContinuation); 365Debug.Assert(IsInternalConverter); 382Debug.Assert(jsonTypeInfo.Converter.Type == Type); 419Debug.Assert(Type == state.Current.JsonTypeInfo.Type); 425Debug.Assert(state.Current.OriginalDepth == 0); 444Debug.Assert(ReferenceEquals(originalJsonTypeInfo, state.Current.JsonTypeInfo)); 451Debug.Assert(value != null); 465Debug.Assert(Type == typeof(Nodes.JsonObject)); 481Debug.Assert(state.Current.OriginalDepth == 0); 505Debug.Assert(isValueConverter == (ConverterStrategy == ConverterStrategy.Value)); 553Debug.Assert(reader.TokenType == tokenType); 605Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 647Debug.Assert(!IsInternalConverter && Type == typeof(string)); 673Debug.Assert(defaultConverter != this);
System\Text\Json\Serialization\JsonSerializer.Helpers.cs (3)
34Debug.Assert(inputType != null); 54Debug.Assert(context != null); 55Debug.Assert(inputType != null);
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (12)
27Debug.Assert(state.Current.ObjectState == StackFrameObjectState.StartToken); 28Debug.Assert(state.Current.CanContainMetadata); 74Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 161Debug.Assert(state.Current.LatestMetadataPropertyName == MetadataPropertyName.None); 209Debug.Assert(state.Current.PropertyState == StackFramePropertyState.ReadValue); 242Debug.Assert(state.PolymorphicTypeDiscriminator == null); 285Debug.Assert(state.Current.LatestMetadataPropertyName == MetadataPropertyName.None); 508Debug.Assert(metadataValueKind != JsonValueKind.Undefined); 532Debug.Assert(state.Current.MetadataPropertyNames is MetadataPropertyName.None || state.Current.MetadataPropertyNames.HasFlag(MetadataPropertyName.Values)); 544Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 553Debug.Assert(!typeof(T).IsValueType); 554Debug.Assert(state.ReferenceId != null);
System\Text\Json\Serialization\JsonSerializer.Read.HandlePropertyName.cs (6)
113Debug.Assert(jsonPropertyInfo != null); 123Debug.Assert(underlyingIDictionaryType.IsGenericType); 124Debug.Assert(genericArgs.Length == 2); 125Debug.Assert(genericArgs[0].UnderlyingSystemType == typeof(string)); 126Debug.Assert( 149Debug.Assert(jsonPropertyInfo.Set != null);
System\Text\Json\Serialization\JsonSerializer.Read.Span.cs (4)
152Debug.Assert(jsonTypeInfo.IsConfigured); 163Debug.Assert(reader.BytesConsumed == (actualByteCount ?? utf8Json.Length)); 169Debug.Assert(jsonTypeInfo.IsConfigured); 180Debug.Assert(reader.BytesConsumed == (actualByteCount ?? utf8Json.Length));
System\Text\Json\Serialization\JsonSerializer.Read.Stream.cs (2)
470Debug.Assert(jsonTypeInfo.IsConfigured); 480Debug.Assert(queueTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializer.Read.String.cs (2)
428Debug.Assert(jsonTypeInfo.IsConfigured); 459Debug.Assert(jsonTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializer.Read.Utf8JsonReader.cs (5)
287Debug.Assert(jsonTypeInfo.IsConfigured); 312Debug.Assert(jsonTypeInfo.IsConfigured); 389Debug.Assert(reader.TokenType is JsonTokenType.EndObject or JsonTokenType.EndArray); 417Debug.Assert(payloadLength > 1); 468Debug.Assert(!valueSpan.IsEmpty ^ !valueSequence.IsEmpty);
System\Text\Json\Serialization\JsonSerializer.Write.ByteArray.cs (2)
140Debug.Assert(jsonTypeInfo.IsConfigured); 157Debug.Assert(jsonTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializer.Write.Document.cs (2)
133Debug.Assert(jsonTypeInfo.IsConfigured); 154Debug.Assert(jsonTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializer.Write.Element.cs (2)
134Debug.Assert(jsonTypeInfo.IsConfigured); 153Debug.Assert(options != null);
System\Text\Json\Serialization\JsonSerializer.Write.HandleMetadata.cs (8)
22Debug.Assert(jsonConverter.CanHaveMetadata); 23Debug.Assert(!state.IsContinuation); 24Debug.Assert(state.CurrentContainsMetadata); 37Debug.Assert(state.PolymorphicTypeResolver != null); 50Debug.Assert(discriminator is int); 58Debug.Assert(writtenMetadata != MetadataPropertyName.None); 79Debug.Assert(state.NewReferenceId == null); 82Debug.Assert(referenceId != null);
System\Text\Json\Serialization\JsonSerializer.Write.Node.cs (2)
135Debug.Assert(jsonTypeInfo.IsConfigured); 153Debug.Assert(jsonTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializer.Write.String.cs (2)
157Debug.Assert(jsonTypeInfo.IsConfigured); 174Debug.Assert(jsonTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializerContext.cs (2)
42Debug.Assert(!options.IsReadOnly); 54Debug.Assert(options != null);
System\Text\Json\Serialization\JsonSerializerOptions.Caching.cs (8)
27Debug.Assert(IsReadOnly); 167Debug.Assert(rootValue != null); 193Debug.Assert(IsReadOnly); 280Debug.Assert(!entry.HasResult); 305Debug.Assert(!entry.HasResult); 408Debug.Assert(options._typeInfoResolver != null); 442Debug.Assert(weakRef.TryGetTarget(out _) is false); 492Debug.Assert(left != null && right != null);
System\Text\Json\Serialization\JsonSerializerOptions.cs (5)
641Debug.Assert(value >= 0); 790Debug.Assert(IsReadOnly); 791Debug.Assert(TypeInfoResolver != null); 861Debug.Assert(IsReadOnly); 910Debug.Assert(_typeInfoResolver != null);
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Converters.cs (5)
84Debug.Assert(converters.Count <= NumberOfSimpleConverters); 115Debug.Assert(converter != null); 135Debug.Assert(memberInfo is FieldInfo or PropertyInfo); 136Debug.Assert(typeToConvert != null); 201Debug.Assert(converter != null);
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (11)
92Debug.Assert(!typeInfo.IsReadOnly); 93Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Object); 136Debug.Assert(memberType is MemberTypes.Field or MemberTypes.Property); 159Debug.Assert(!typeInfo.IsReadOnly); 160Debug.Assert(currentType.IsAssignableFrom(typeInfo.Type)); 225Debug.Assert(jsonPropertyInfo.Name != null); 294Debug.Assert(typeInfo.Converter.ConstructorInfo != null); 306Debug.Assert(typeInfo.Converter.ConstructorInfo.DeclaringType != null); 335Debug.Assert(jsonPropertyInfo.AttributeProvider == null); 415Debug.Assert(memberInfo is FieldInfo or PropertyInfo); 435Debug.Assert(fieldInfo.IsPublic || useNonPublicAccessors);
System\Text\Json\Serialization\Metadata\FSharpCoreReflectionProxy.cs (8)
99Debug.Assert(fsharpCoreAssembly.GetName().Name == "FSharp.Core"); 149Debug.Assert(typeof(TFSharpOption).GetGenericTypeDefinition() == _fsharpOptionType); 158Debug.Assert(typeof(TFSharpOption).GetGenericTypeDefinition() == _fsharpOptionType); 168Debug.Assert(typeof(TFSharpValueOption).GetGenericTypeDefinition() == _fsharpValueOptionType); 177Debug.Assert(typeof(TFSharpOption).GetGenericTypeDefinition() == _fsharpValueOptionType); 186Debug.Assert(typeof(TFSharpList).GetGenericTypeDefinition() == _fsharpListType); 194Debug.Assert(typeof(TFSharpSet).GetGenericTypeDefinition() == _fsharpSetType); 202Debug.Assert(typeof(TFSharpMap).GetGenericTypeDefinition() == _fsharpMapType);
System\Text\Json\Serialization\Metadata\JsonDerivedType.cs (1)
47Debug.Assert(typeDiscriminator is null or int or string);
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Helpers.cs (7)
86Debug.Assert(typeInfo.Kind != JsonTypeInfoKind.None); 115Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Object); 116Debug.Assert(!typeInfo.IsReadOnly); 130Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Object); 131Debug.Assert(!typeInfo.IsConfigured); 132Debug.Assert(typeInfo.Type != JsonTypeInfo.ObjectType); 133Debug.Assert(typeInfo.Converter.ElementType is null);
System\Text\Json\Serialization\Metadata\JsonParameterInfo.cs (1)
40Debug.Assert(matchingProperty.IsConfigured);
System\Text\Json\Serialization\Metadata\JsonParameterInfoOfT.cs (2)
21Debug.Assert(parameterInfoValues.ParameterType == typeof(T)); 22Debug.Assert(matchingPropertyInfo.IsConfigured);
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (25)
29Debug.Assert(_effectiveConverter != null); 142Debug.Assert(!IsConfigured); 296Debug.Assert(declaringTypeInfo is null || declaringType.IsAssignableFrom(declaringTypeInfo.Type)); 308Debug.Assert(!info.IsForTypeInfo); 309Debug.Assert(!info.CanSerialize); 310Debug.Assert(!info.CanDeserialize); 331Debug.Assert(ParentTypeInfo != null); 332Debug.Assert(!IsConfigured); 374Debug.Assert(!IgnoreNullTokensOnRead); 388Debug.Assert(Name != null); 406Debug.Assert(Options.DefaultIgnoreCondition == JsonIgnoreCondition.Never); 432Debug.Assert(MemberType is 0 or MemberTypes.Field or MemberTypes.Property); 466Debug.Assert(!ParentTypeInfo.IsConfigured); 562Debug.Assert(_jsonTypeInfo != null); 563Debug.Assert(_jsonTypeInfo.IsConfigurationStarted); 609Debug.Assert(EffectiveConverter.ElementType != null); 674Debug.Assert(MemberType == MemberTypes.Property || MemberType == MemberTypes.Field || MemberType == default); 712Debug.Assert(_name != null); 797Debug.Assert(propValue is Nodes.JsonObject); 812Debug.Assert(dictionaryValueInfo is JsonTypeInfo<TValue>); 823Debug.Assert(this == state.Current.JsonTypeInfo.ExtensionDataProperty); 879Debug.Assert(_jsonTypeInfo?.IsConfigurationStarted == true); 978Debug.Assert(IsConfigured); 979Debug.Assert(IsRequired); 984Debug.Assert(!IsConfigured);
System\Text\Json\Serialization\Metadata\JsonPropertyInfoOfT.cs (14)
38Debug.Assert(getter is null or Func<object, object?> or Func<object, T>); 39Debug.Assert(!IsConfigured); 61Debug.Assert(setter is null or Action<object, object?> or Action<object, T>); 62Debug.Assert(!IsConfigured); 92Debug.Assert(predicate is null or Func<object, object?, bool> or Func<object, T?, bool>); 93Debug.Assert(!IsConfigured); 122Debug.Assert(_typedEffectiveConverter != null); 136Debug.Assert(jsonTypeInfo is JsonTypeInfo<T>); 154Debug.Assert(HasGetter); 177Debug.Assert(value == null); 197Debug.Assert(PropertyTypeCanBeNull); 269Debug.Assert(CanDeserialize || EffectiveObjectCreationHandling == JsonObjectCreationHandling.Populate); 288Debug.Assert(!state.IsContinuation); 351Debug.Assert(!state.IsContinuation);
System\Text\Json\Serialization\Metadata\JsonTypeInfo.Cache.cs (12)
42Debug.Assert(IsConfigured); 81Debug.Assert(jsonPropertyInfo.PropertyType == propertyType); 236Debug.Assert(info != null); 315Debug.Assert(ParameterCache != null); 319Debug.Assert(info != null); 325Debug.Assert(key == GetKey(info.NameAsUtf8Bytes.AsSpan())); 338Debug.Assert(key == GetKey(info.NameAsUtf8Bytes!.AsSpan())); 344Debug.Assert(info == null); 472Debug.Assert(frame.PropertyRefCache != null); 485Debug.Assert(replacementList.Count <= PropertyNameCountCacheThreshold); 508Debug.Assert(frame.CtorArgumentState!.ParameterRefCache != null); 521Debug.Assert(replacementList.Count <= ParameterNameCountCacheThreshold);
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (30)
250Debug.Assert(!IsReadOnly); 360Debug.Assert(IsConfigured); 361Debug.Assert(_elementTypeInfo is null or { IsConfigurationStarted: true }); 372Debug.Assert(!IsReadOnly); 373Debug.Assert(value is null || value.Type == ElementType); 386Debug.Assert(IsConfigured); 387Debug.Assert(_keyTypeInfo is null or { IsConfigurationStarted: true }); 398Debug.Assert(!IsReadOnly); 399Debug.Assert(value is null || value.Type == KeyType); 674Debug.Assert(Options.IsReadOnly); 675Debug.Assert(IsReadOnly); 722Debug.Assert(IsConfigured); 723Debug.Assert(Type != typeof(object)); 750Debug.Assert(IsReadOnly); 751Debug.Assert(!IsConfigured); 763Debug.Assert(property.IsConfigured); 787Debug.Assert(IsCompatibleWithCurrentOptions); 950Debug.Assert(jsonTypeInfo.Type == type); 1029Debug.Assert(obj is ParameterLookupKey); 1049Debug.Assert(Kind == JsonTypeInfoKind.Object); 1050Debug.Assert(PropertyCache is null); 1051Debug.Assert(ExtensionDataProperty is null); 1062Debug.Assert(property.ParentTypeInfo == this); 1120Debug.Assert(Kind == JsonTypeInfoKind.Object); 1122Debug.Assert(PropertyCache is not null); 1123Debug.Assert(ParameterCache is null); 1168Debug.Assert(matchingEntry.JsonPropertyInfo != null); 1306Debug.Assert(converter is ObjectConverter); 1317Debug.Assert(converter is JsonConverterFactory); 1364Debug.Assert(!_jsonTypeInfo.IsConfigured);
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.cs (6)
60Debug.Assert(createObject is null or Func<object> or Func<T>); 66Debug.Assert(_createObject == null); 67Debug.Assert(_typedCreateObject == null); 73Debug.Assert(_createObject is null); 74Debug.Assert(_typedCreateObject == null); 93Debug.Assert(createObject is Func<object>);
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.ReadHelper.cs (4)
21Debug.Assert(IsConfigured); 27Debug.Assert(IsConfigured); 55Debug.Assert(IsConfigured); 108Debug.Assert(reader.BytesConsumed <= bufferState.Bytes.Length);
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.WriteHelpers.cs (24)
24Debug.Assert(IsConfigured); 25Debug.Assert(rootValueBoxed is null || rootValueBoxed is T); 33Debug.Assert(SerializeHandler != null); 34Debug.Assert(Converter is JsonMetadataServicesConverter<T>); 47Debug.Assert(typeof(T) == typeof(object)); 57Debug.Assert(success); 85Debug.Assert(IsConfigured); 86Debug.Assert(rootValueBoxed is null || rootValueBoxed is T); 92Debug.Assert(SerializeHandler != null); 93Debug.Assert(CanUseSerializeHandler); 94Debug.Assert(Converter is JsonMetadataServicesConverter<T>); 129Debug.Assert(typeof(T) == typeof(object)); 158Debug.Assert(!isFinalBlock); 159Debug.Assert(state.PendingTask is not null); 199Debug.Assert(writer.BytesPending == 0); 223Debug.Assert(IsConfigured); 224Debug.Assert(rootValueBoxed is null || rootValueBoxed is T); 230Debug.Assert(SerializeHandler != null); 231Debug.Assert(CanUseSerializeHandler); 232Debug.Assert(Converter is JsonMetadataServicesConverter<T>); 258Debug.Assert(typeof(T) == typeof(object)); 283Debug.Assert(state.PendingTask == null); 291Debug.Assert(writer.BytesPending == 0); 328Debug.Assert(CanUseSerializeHandler);
System\Text\Json\Serialization\Metadata\JsonTypeInfoResolverWithAddedModifiers.cs (1)
15Debug.Assert(modifiers.Length > 0);
System\Text\Json\Serialization\Metadata\PolymorphicTypeResolver.cs (12)
37Debug.Assert(typeDiscriminator is null or int or string); 103Debug.Assert(BaseType.IsAssignableFrom(runtimeType)); 147Debug.Assert(typeDiscriminator is int or string); 148Debug.Assert(UsesTypeDiscriminators); 149Debug.Assert(_discriminatorIdtoType != null); 153Debug.Assert(typeDiscriminator.Equals(result.TypeDiscriminator)); 183Debug.Assert(!type.IsAbstract); 184Debug.Assert(BaseType.IsAssignableFrom(type)); 185Debug.Assert(UnknownDerivedTypeHandling == JsonUnknownDerivedTypeHandling.FallBackToNearestAncestor); 197Debug.Assert(candidate != null); 238Debug.Assert(typeInfo.IsConfigured); 318Debug.Assert(typeDiscriminator is null or int or string);
System\Text\Json\Serialization\Metadata\ReflectionEmitMemberAccessor.cs (18)
25Debug.Assert(type != null); 26Debug.Assert(constructorInfo is null || constructorInfo.GetParameters().Length == 0); 49Debug.Assert(type.IsValueType); 82Debug.Assert(type != null); 83Debug.Assert(!type.IsAbstract); 84Debug.Assert(constructor.IsPublic && !constructor.IsStatic); 125Debug.Assert(type != null); 126Debug.Assert(!type.IsAbstract); 127Debug.Assert(!constructor.IsStatic); 143Debug.Assert(index <= JsonConstants.UnboxedParameterCountThreshold); 252Debug.Assert(realMethod != null); 255Debug.Assert(declaringType != null); 282Debug.Assert(!runtimePropertyType.IsValueType); 298Debug.Assert(realMethod != null); 301Debug.Assert(declaringType != null); 319Debug.Assert(!runtimePropertyType.IsValueType); 336Debug.Assert(declaringType != null); 370Debug.Assert(declaringType != null);
System\Text\Json\Serialization\Metadata\ReflectionMemberAccessor.cs (7)
23Debug.Assert(type != null); 24Debug.Assert(ctorInfo is null || ctorInfo.GetParameters().Length == 0); 45Debug.Assert(!type.IsAbstract); 46Debug.Assert(constructor.DeclaringType == type && constructor.IsPublic && !constructor.IsStatic); 80Debug.Assert(!type.IsAbstract); 81Debug.Assert(constructor.DeclaringType == type && constructor.IsPublic && !constructor.IsStatic); 85Debug.Assert(parameterCount <= JsonConstants.UnboxedParameterCountThreshold);
System\Text\Json\Serialization\PreserveReferenceResolver.cs (3)
33Debug.Assert(_referenceIdToObjectMap != null); 43Debug.Assert(_objectToReferenceIdMap != null); 62Debug.Assert(_referenceIdToObjectMap != null);
System\Text\Json\Serialization\ReadBufferState.cs (2)
107Debug.Assert(bytesConsumed <= _count); 153Debug.Assert(_buffer.Length >= JsonConstants.Utf8Bom.Length);
System\Text\Json\Serialization\ReadStack.cs (14)
29Debug.Assert(_count > 1); 30Debug.Assert(_stack is not null); 166Debug.Assert(_count > 0); 167Debug.Assert(JsonPath() is not null); 198Debug.Assert(_continuationCount == 0); 212Debug.Assert(!IsContinuation); 213Debug.Assert(Current.PolymorphicJsonTypeInfo == null); 214Debug.Assert(Current.PolymorphicSerializationState == PolymorphicSerializationState.None); 232Debug.Assert(Current.PolymorphicJsonTypeInfo != null); 233Debug.Assert(Current.PolymorphicSerializationState == PolymorphicSerializationState.PolymorphicReEntrySuspended); 246Debug.Assert(Current.PolymorphicJsonTypeInfo != null); 247Debug.Assert(Current.PolymorphicSerializationState == PolymorphicSerializationState.PolymorphicReEntryStarted); 375Debug.Assert(!IsContinuation); 385Debug.Assert(Current.JsonTypeInfo.UsesParameterizedConstructor);
System\Text\Json\Serialization\ReadStackFrame.cs (3)
133Debug.Assert(RequiredPropertiesSet != null); 141Debug.Assert(RequiredPropertiesSet == null); 154Debug.Assert(RequiredPropertiesSet != null);
System\Text\Json\Serialization\WriteStack.cs (13)
34Debug.Assert(_count - _indexOffset > 0); 35Debug.Assert(_stack is not null); 148Debug.Assert(!IsContinuation); 149Debug.Assert(CurrentDepth == 0); 160Debug.Assert(options.ReferenceHandler != null); 177Debug.Assert(Current.PolymorphicSerializationState != PolymorphicSerializationState.PolymorphicReEntryStarted); 185Debug.Assert(Current.PolymorphicSerializationState != PolymorphicSerializationState.PolymorphicReEntrySuspended); 233Debug.Assert(_count > 0); 265Debug.Assert(_continuationCount == 0); 280Debug.Assert(CompletedAsyncDisposables?.Count > 0); 311Debug.Assert(Current.AsyncDisposable is null); 317Debug.Assert(_stack[i].AsyncDisposable is null); 365Debug.Assert(!(collectionEnumerator is not null && asyncDisposable is not null));
System\Text\Json\Serialization\WriteStackFrame.cs (4)
120Debug.Assert(PolymorphicSerializationState == PolymorphicSerializationState.None); 142Debug.Assert(PolymorphicSerializationState is PolymorphicSerializationState.None or PolymorphicSerializationState.PolymorphicReEntryStarted); 154Debug.Assert(PolymorphicSerializationState == PolymorphicSerializationState.PolymorphicReEntrySuspended); 155Debug.Assert(PolymorphicTypeInfo is not null);
System\Text\Json\ThrowHelper.cs (8)
129Debug.Assert(value.Length > JsonConstants.MaxUnescapedTokenSize); 143Debug.Assert(value.Length > JsonConstants.MaxCharacterTokenSize); 157Debug.Assert(value.Length > JsonConstants.MaxUnescapedTokenSize); 171Debug.Assert(value.Length > JsonConstants.MaxCharacterTokenSize); 186Debug.Assert(propertyName.Length > JsonConstants.MaxCharacterTokenSize); 195Debug.Assert(currentDepth >= maxDepth); 239Debug.Assert(propertyName.Length > JsonConstants.MaxCharacterTokenSize); 576Debug.Assert(token == JsonConstants.CloseBracket || token == JsonConstants.CloseBrace);
System\Text\Json\ThrowHelper.Serialization.cs (11)
137Debug.Assert(propertyName == null); 141Debug.Assert(propertyName != null); 150Debug.Assert(memberInfo == null); 154Debug.Assert(memberInfo != null); 277Debug.Assert(parent.PropertyCache != null); 370Debug.Assert(!jsonPropertyInfo.IsForTypeInfo); 409Debug.Assert(ex.Path == null); 442Debug.Assert(ex.Path is null); // do not overwrite existing path information 480Debug.Assert(ex.Path is null); // do not overwrite existing path information 543Debug.Assert(!message.Contains(" Path: ")); 571Debug.Assert(!message.Contains(" Path: "));
System\Text\Json\Writer\JsonWriterHelper.cs (5)
15Debug.Assert(buffer.Length >= indent); 158Debug.Assert(!utf8FormattedNumber.IsEmpty); 211Debug.Assert(i < utf8FormattedNumber.Length); 291Debug.Assert(status is OperationStatus.Done or OperationStatus.DestinationTooSmall or OperationStatus.InvalidData); 292Debug.Assert(charsRead == source.Length || status is not OperationStatus.Done);
System\Text\Json\Writer\JsonWriterHelper.Date.cs (4)
19Debug.Assert(result); 28Debug.Assert(result); 51Debug.Assert(buffer.Length == maxDateTimeLength || 102Debug.Assert(buffer[maxDateTimeLength] == 'Z');
System\Text\Json\Writer\JsonWriterHelper.Escaping.cs (16)
77Debug.Assert(textLength > 0); 78Debug.Assert(firstIndexToEscape >= 0 && firstIndexToEscape < textLength); 84Debug.Assert(encoder != null); 88Debug.Assert(result != OperationStatus.DestinationTooSmall); 89Debug.Assert(result != OperationStatus.NeedMoreData); 96Debug.Assert(encoderBytesConsumed == value.Length); 103Debug.Assert(indexOfFirstByteToEscape >= 0 && indexOfFirstByteToEscape < value.Length); 182Debug.Assert(result); 183Debug.Assert(bytesWritten == 4); 195Debug.Assert(encoder != null); 199Debug.Assert(result != OperationStatus.DestinationTooSmall); 200Debug.Assert(result != OperationStatus.NeedMoreData); 207Debug.Assert(encoderBytesConsumed == value.Length); 214Debug.Assert(indexOfFirstByteToEscape >= 0 && indexOfFirstByteToEscape < value.Length); 260Debug.Assert(IsAsciiValue(value)); 296Debug.Assert(charsWritten == 4);
System\Text\Json\Writer\Utf8JsonWriter.cs (35)
254Debug.Assert(_output is null && _stream is null && _arrayBufferWriter is null); 306Debug.Assert(_arrayBufferWriter != null); 330Debug.Assert(_output != null); 420Debug.Assert(_arrayBufferWriter != null); 444Debug.Assert(_output != null); 515Debug.Assert(_options.Indented || !_options.SkipValidation); 528Debug.Assert(!_options.SkipValidation); 541Debug.Assert(_tokenType != JsonTokenType.None && _tokenType != JsonTokenType.StartArray); 547Debug.Assert(_tokenType != JsonTokenType.PropertyName); 548Debug.Assert(_tokenType != JsonTokenType.StartObject); 561Debug.Assert(indent <= _indentLength * _options.MaxDepth); 618Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 682Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 710Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 711Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 837Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 865Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 866Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 942Debug.Assert(_options.Indented || !_options.SkipValidation); 954Debug.Assert(!_options.SkipValidation); 969Debug.Assert(_tokenType != JsonTokenType.None); 975Debug.Assert(token == JsonConstants.CloseBrace); 1005Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1006Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.None); 1053Debug.Assert(token == JsonConstants.OpenBrace); 1061Debug.Assert(requiredSize > 0); 1071Debug.Assert(BytesPending != 0); 1075Debug.Assert(_arrayBufferWriter != null); 1082Debug.Assert(_memory.Length >= sizeHint); 1086Debug.Assert(_output != null); 1103Debug.Assert(_memory.Length == 0); 1104Debug.Assert(BytesPending == 0); 1110Debug.Assert(_arrayBufferWriter != null); 1112Debug.Assert(_memory.Length >= sizeHint); 1116Debug.Assert(_output != null);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Bytes.cs (15)
23Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 109Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 125Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 139Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 140Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 162Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 163Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 213Debug.Assert(escapedPropertyName.Length * JsonConstants.MaxExpansionFactorWhileTranscoding < int.MaxValue - encodedLength - 6); 248Debug.Assert(escapedPropertyName.Length < int.MaxValue - encodedLength - 6); 283Debug.Assert(indent <= _indentLength * _options.MaxDepth); 287Debug.Assert(escapedPropertyName.Length * JsonConstants.MaxExpansionFactorWhileTranscoding < int.MaxValue - indent - encodedLength - 7 - _newLineLength); 305Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 333Debug.Assert(indent <= _indentLength * _options.MaxDepth); 337Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - encodedLength - 7 - _newLineLength); 355Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTime.cs (15)
27Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 116Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 132Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 146Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 147Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 169Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 170Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 218Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatDateTimeOffsetLength - 6); 252Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatDateTimeOffsetLength - 6); 287Debug.Assert(indent <= _indentLength * _options.MaxDepth); 289Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatDateTimeOffsetLength - 7 - _newLineLength); 307Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 336Debug.Assert(indent <= _indentLength * _options.MaxDepth); 338Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatDateTimeOffsetLength - 7 - _newLineLength); 355Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTimeOffset.cs (15)
26Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 115Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 131Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 145Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 146Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 168Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 169Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 217Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatDateTimeOffsetLength - 6); 251Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatDateTimeOffsetLength - 6); 286Debug.Assert(indent <= _indentLength * _options.MaxDepth); 288Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatDateTimeOffsetLength - 7 - _newLineLength); 306Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 335Debug.Assert(indent <= _indentLength * _options.MaxDepth); 337Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatDateTimeOffsetLength - 7 - _newLineLength); 354Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Decimal.cs (20)
26Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 115Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 131Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 145Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 146Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 168Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 169Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 217Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatDecimalLength - 4); 242Debug.Assert(result); 248Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatDecimalLength - 4); 273Debug.Assert(result); 280Debug.Assert(indent <= _indentLength * _options.MaxDepth); 282Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatDecimalLength - 5 - _newLineLength); 300Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 319Debug.Assert(result); 326Debug.Assert(indent <= _indentLength * _options.MaxDepth); 328Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatDecimalLength - 5 - _newLineLength); 345Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 365Debug.Assert(result); 373Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Double.cs (20)
26Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 119Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 135Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 149Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 150Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 172Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 173Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 221Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatDoubleLength - 4); 246Debug.Assert(result); 252Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatDoubleLength - 4); 277Debug.Assert(result); 284Debug.Assert(indent <= _indentLength * _options.MaxDepth); 286Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatDoubleLength - 5 - _newLineLength); 304Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 323Debug.Assert(result); 330Debug.Assert(indent <= _indentLength * _options.MaxDepth); 332Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatDoubleLength - 5 - _newLineLength); 349Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 369Debug.Assert(result); 378Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Float.cs (20)
26Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 119Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 135Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 149Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 150Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 172Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 173Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 221Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatSingleLength - 4); 246Debug.Assert(result); 252Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatSingleLength - 4); 277Debug.Assert(result); 284Debug.Assert(indent <= _indentLength * _options.MaxDepth); 286Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatSingleLength - 5 - _newLineLength); 304Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 323Debug.Assert(result); 330Debug.Assert(indent <= _indentLength * _options.MaxDepth); 332Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatSingleLength - 5 - _newLineLength); 349Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 369Debug.Assert(result); 377Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.FormattedNumber.cs (6)
86Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 102Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 116Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 117Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 139Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 140Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Guid.cs (20)
26Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 115Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 131Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 145Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 146Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 168Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 169Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 217Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatGuidLength - 6); 244Debug.Assert(result); 252Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatGuidLength - 6); 279Debug.Assert(result); 288Debug.Assert(indent <= _indentLength * _options.MaxDepth); 290Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatGuidLength - 7 - _newLineLength); 308Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 329Debug.Assert(result); 338Debug.Assert(indent <= _indentLength * _options.MaxDepth); 340Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatGuidLength - 7 - _newLineLength); 357Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 379Debug.Assert(result); 389Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Helpers.cs (11)
41Debug.Assert(_tokenType != JsonTokenType.StartObject); 54Debug.Assert(_tokenType != JsonTokenType.StartObject); 63Debug.Assert(escapedPropertyName.Length < int.MaxValue - 5); 92Debug.Assert(indent <= _indentLength * _options.MaxDepth); 94Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - 6 - _newLineLength); 111Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 135Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - 5); 164Debug.Assert(indent <= _indentLength * _options.MaxDepth); 166Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - 6 - _newLineLength); 184Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 209Debug.Assert(status == OperationStatus.Done);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Literal.cs (23)
38Debug.Assert(escapedPropertyNameSection.Length <= JsonConstants.MaxUnescapedTokenSize - 3); 51Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 237Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 253Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 267Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 268Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 290Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 291Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 339Debug.Assert(value.Length <= JsonConstants.MaxUnescapedTokenSize); 340Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - value.Length - 4); 370Debug.Assert(value.Length <= JsonConstants.MaxUnescapedTokenSize); 371Debug.Assert(escapedPropertyName.Length < int.MaxValue - value.Length - 4); 403Debug.Assert(value.Length <= JsonConstants.MaxUnescapedTokenSize); 404Debug.Assert(escapedPropertyNameSection.Length < int.MaxValue - value.Length - 1); 430Debug.Assert(indent <= _indentLength * _options.MaxDepth); 432Debug.Assert(value.Length <= JsonConstants.MaxUnescapedTokenSize); 433Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - value.Length - 5 - _newLineLength); 451Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 476Debug.Assert(indent <= _indentLength * _options.MaxDepth); 478Debug.Assert(value.Length <= JsonConstants.MaxUnescapedTokenSize); 479Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - value.Length - 5 - _newLineLength); 496Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 524Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.SignedNumber.cs (20)
26Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 191Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 207Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 221Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 222Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 244Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 245Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 293Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatInt64Length - 4); 318Debug.Assert(result); 324Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatInt64Length - 4); 349Debug.Assert(result); 356Debug.Assert(indent <= _indentLength * _options.MaxDepth); 358Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatInt64Length - 5 - _newLineLength); 376Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 395Debug.Assert(result); 402Debug.Assert(indent <= _indentLength * _options.MaxDepth); 404Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatInt64Length - 5 - _newLineLength); 421Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 441Debug.Assert(result); 453Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.String.cs (76)
33Debug.Assert(escapedPropertyNameSection.Length <= JsonConstants.MaxUnescapedTokenSize - 3); 45Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 98Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length && propertyIdx < int.MaxValue / 2); 115Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 161Debug.Assert(escapedPropertyName.Length <= JsonConstants.MaxEscapedTokenSize); 162Debug.Assert(escapedPropertyName.Length < (int.MaxValue - 4) / JsonConstants.MaxExpansionFactorWhileTranscoding); 190Debug.Assert(indent <= _indentLength * _options.MaxDepth); 192Debug.Assert(escapedPropertyName.Length <= JsonConstants.MaxEscapedTokenSize); 193Debug.Assert(escapedPropertyName.Length < (int.MaxValue - 5 - indent - _newLineLength) / JsonConstants.MaxExpansionFactorWhileTranscoding); 247Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length && propertyIdx < int.MaxValue / 2); 274Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 322Debug.Assert(escapedPropertyName.Length <= JsonConstants.MaxEscapedTokenSize); 323Debug.Assert(escapedPropertyName.Length < int.MaxValue - 4); 352Debug.Assert(escapedPropertyNameSection.Length <= JsonConstants.MaxEscapedTokenSize - 3); 353Debug.Assert(escapedPropertyNameSection.Length < int.MaxValue - 4); 378Debug.Assert(indent <= _indentLength * _options.MaxDepth); 380Debug.Assert(escapedPropertyName.Length <= JsonConstants.MaxEscapedTokenSize); 381Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - 5 - _newLineLength); 398Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 431Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize && utf8Value.Length <= JsonConstants.MaxUnescapedTokenSize); 604Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 610Debug.Assert(valueIdx >= -1 && valueIdx < value.Length && valueIdx < int.MaxValue / 2); 694Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 700Debug.Assert(valueIdx >= -1 && valueIdx < utf8Value.Length && valueIdx < int.MaxValue / 2); 784Debug.Assert(utf8Value.Length <= JsonConstants.MaxUnescapedTokenSize); 790Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length && propertyIdx < int.MaxValue / 2); 856Debug.Assert(utf8Value.Length <= JsonConstants.MaxUnescapedTokenSize); 862Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length && propertyIdx < int.MaxValue / 2); 911Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length); 912Debug.Assert(firstEscapeIndex >= 0 && firstEscapeIndex < utf8Value.Length); 934Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= value.Length); 935Debug.Assert(firstEscapeIndex >= 0 && firstEscapeIndex < value.Length); 957Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 958Debug.Assert(firstEscapeIndex >= 0 && firstEscapeIndex < propertyName.Length); 980Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 981Debug.Assert(firstEscapeIndex >= 0 && firstEscapeIndex < utf8PropertyName.Length); 1006Debug.Assert(valueIdx >= -1 && valueIdx < value.Length && valueIdx < int.MaxValue / 2); 1007Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length && propertyIdx < int.MaxValue / 2); 1025Debug.Assert(valueIdx >= -1 && valueIdx < utf8Value.Length && valueIdx < int.MaxValue / 2); 1026Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length && propertyIdx < int.MaxValue / 2); 1044Debug.Assert(valueIdx >= -1 && valueIdx < utf8Value.Length && valueIdx < int.MaxValue / 2); 1045Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length && propertyIdx < int.MaxValue / 2); 1063Debug.Assert(valueIdx >= -1 && valueIdx < value.Length && valueIdx < int.MaxValue / 2); 1064Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length && propertyIdx < int.MaxValue / 2); 1079Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= value.Length); 1080Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 1139Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length); 1140Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 1199Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length); 1200Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 1259Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= value.Length); 1260Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 1372Debug.Assert(escapedValue.Length <= JsonConstants.MaxUnescapedTokenSize); 1373Debug.Assert(escapedPropertyName.Length < ((int.MaxValue - 6) / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length); 1407Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1408Debug.Assert(escapedPropertyName.Length < int.MaxValue - escapedValue.Length - 6); 1443Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1444Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length - 6); 1479Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1480Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length - 6); 1516Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1518Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1519Debug.Assert(escapedPropertyName.Length < ((int.MaxValue - 7 - indent - _newLineLength) / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length); 1537Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 1566Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1568Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1569Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - escapedValue.Length - 7 - _newLineLength); 1586Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 1617Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1619Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1620Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length - 7 - indent - _newLineLength); 1638Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 1668Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1670Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1671Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length - 7 - indent - _newLineLength); 1689Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.UnsignedNumber.cs (20)
27Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 200Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 216Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 230Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 231Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 253Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 254Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 302Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatUInt64Length - 4); 327Debug.Assert(result); 333Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatUInt64Length - 4); 358Debug.Assert(result); 365Debug.Assert(indent <= _indentLength * _options.MaxDepth); 367Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatUInt64Length - 5 - _newLineLength); 385Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 404Debug.Assert(result); 411Debug.Assert(indent <= _indentLength * _options.MaxDepth); 413Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatUInt64Length - 5 - _newLineLength); 430Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 450Debug.Assert(result); 462Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Bytes.cs (4)
62Debug.Assert(encodingLength <= int.MaxValue - 3); 67Debug.Assert((uint)maxRequired <= int.MaxValue); 91Debug.Assert(indent <= _indentLength * _options.MaxDepth); 107Debug.Assert((uint)maxRequired <= int.MaxValue - 3);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Comment.cs (8)
76Debug.Assert(value.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - 4); 93Debug.Assert(status != OperationStatus.DestinationTooSmall); 108Debug.Assert(indent <= _indentLength * _options.MaxDepth); 110Debug.Assert(value.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - 4 - _newLineLength); 134Debug.Assert(status != OperationStatus.DestinationTooSmall); 191Debug.Assert(utf8Value.Length < int.MaxValue - 4); 215Debug.Assert(indent <= _indentLength * _options.MaxDepth); 217Debug.Assert(utf8Value.Length < int.MaxValue - indent - 4 - _newLineLength);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.DateTime.cs (1)
69Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.DateTimeOffset.cs (1)
70Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Decimal.cs (4)
59Debug.Assert(result); 66Debug.Assert(indent <= _indentLength * _options.MaxDepth); 93Debug.Assert(result); 101Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Double.cs (4)
63Debug.Assert(result); 70Debug.Assert(indent <= _indentLength * _options.MaxDepth); 97Debug.Assert(result); 149Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Float.cs (4)
63Debug.Assert(result); 70Debug.Assert(indent <= _indentLength * _options.MaxDepth); 97Debug.Assert(result); 149Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.FormattedNumber.cs (2)
70Debug.Assert(indent <= _indentLength * _options.MaxDepth); 72Debug.Assert(utf8Value.Length < int.MaxValue - indent - 1 - _newLineLength);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Guid.cs (3)
61Debug.Assert(result); 70Debug.Assert(indent <= _indentLength * _options.MaxDepth); 100Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Helpers.cs (5)
15Debug.Assert(!_options.SkipValidation); 21Debug.Assert(_tokenType != JsonTokenType.None && _tokenType != JsonTokenType.StartArray); 27Debug.Assert(_tokenType != JsonTokenType.PropertyName); 42Debug.Assert(status == OperationStatus.Done); 43Debug.Assert(consumed == bytes.Length);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Literal.cs (3)
66Debug.Assert(utf8Value.Length <= 5); 89Debug.Assert(indent <= _indentLength * _options.MaxDepth); 90Debug.Assert(utf8Value.Length <= 5);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Raw.cs (2)
171Debug.Assert(utf8JsonLen < int.MaxValue); 244Debug.Assert(len < int.MaxValue);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.SignedNumber.cs (4)
72Debug.Assert(result); 79Debug.Assert(indent <= _indentLength * _options.MaxDepth); 106Debug.Assert(result); 114Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.String.cs (13)
21Debug.Assert(utf8Value.Length <= JsonConstants.MaxUnescapedTokenSize); 86Debug.Assert(valueIdx >= -1 && valueIdx < value.Length); 118Debug.Assert(escapedValue.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - 3); 146Debug.Assert(indent <= _indentLength * _options.MaxDepth); 148Debug.Assert(escapedValue.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - 3 - _newLineLength); 185Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= value.Length); 186Debug.Assert(firstEscapeIndexVal >= 0 && firstEscapeIndexVal < value.Length); 233Debug.Assert(valueIdx >= -1 && valueIdx < utf8Value.Length); 265Debug.Assert(escapedValue.Length < int.MaxValue - 3); 293Debug.Assert(indent <= _indentLength * _options.MaxDepth); 295Debug.Assert(escapedValue.Length < int.MaxValue - indent - 3 - _newLineLength); 332Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length); 333Debug.Assert(firstEscapeIndexVal >= 0 && firstEscapeIndexVal < utf8Value.Length);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.UnsignedNumber.cs (4)
74Debug.Assert(result); 81Debug.Assert(indent <= _indentLength * _options.MaxDepth); 108Debug.Assert(result); 116Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriterCache.cs (4)
66Debug.Assert(t_threadLocalState != null); 73Debug.Assert((rentedWriters == 0) == (ReferenceEquals(state.BufferWriter, bufferWriter) && ReferenceEquals(state.Writer, writer))); 78Debug.Assert(t_threadLocalState != null); 84Debug.Assert((rentedWriters == 0) == ReferenceEquals(state.Writer, writer));
System.Text.Json.SourceGeneration (47)
Helpers\RoslynExtensions.cs (5)
24Debug.Assert(type.FullName != null); 152Debug.Assert(baseType.IsGenericTypeDefinition()); 206Debug.Assert(member is IFieldSymbol or IPropertySymbol); 212Debug.Assert(member is IFieldSymbol or IPropertySymbol); 213Debug.Assert(otherMember is IFieldSymbol or IPropertySymbol);
JsonSourceGenerator.Emitter.cs (15)
96Debug.Assert(_typeIndex.Count == 0); 97Debug.Assert(_propertyNames.Count == 0); 98Debug.Assert(!_emitGetConverterForNullablePropertyMethod); 153Debug.Assert(contextClasses.Count > 0); 242Debug.Assert(typeMetadata.ConverterType != null); 263Debug.Assert(typeMetadata.NullableUnderlyingType != null); 320Debug.Assert(!(typeGenerationSpec.ClassType == ClassType.Dictionary && collectionKeyType == null)); 325Debug.Assert(collectionValueType != null); 362Debug.Assert(keyTypeFQN != null); 366Debug.Assert(keyTypeFQN != null); 408Debug.Assert(typeGenerationSpec.CollectionValueType != null); 461Debug.Assert(typeGenerationSpec.CollectionKeyType != null); 462Debug.Assert(typeGenerationSpec.CollectionValueType != null); 690Debug.Assert(paramCount > 0); 784Debug.Assert(!_propertyNames.TryGetValue(effectiveJsonPropertyName, out string? existingName) || existingName == propertyNameFieldName);
JsonSourceGenerator.Parser.cs (25)
55Debug.Assert(_contextClassLocation != null); 85Debug.Assert(_knownSymbols.JsonSerializerContextType != null); 88Debug.Assert(_typesToGenerate.Count == 0); 89Debug.Assert(_generatedTypes.Count == 0); 90Debug.Assert(_contextClassLocation is null); 93Debug.Assert(contextTypeSymbol != null); 96Debug.Assert(_contextClassLocation is not null); 116Debug.Assert(rootSerializableTypes.Count > 0); 151Debug.Assert(_generatedTypes.Count > 0); 195Debug.Assert(typeSymbol != null); 203Debug.Assert(typeDeclarations?.Count > 0); 234Debug.Assert(_knownSymbols.JsonSerializableAttributeType != null); 235Debug.Assert(_knownSymbols.JsonSourceGenerationOptionsAttributeType != null); 290Debug.Assert(attributeData.ConstructorArguments.Length == 1 & attributeData.ConstructorArguments[0].Type?.Name is nameof(JsonSerializerDefaults)); 436Debug.Assert(attributeData.ConstructorArguments.Length == 1); 463Debug.Assert(attributeLocation != null); 540Debug.Assert(_knownSymbols.JsonStringEnumConverterOfTType != null); 702Debug.Assert(attributeData.ConstructorArguments.Length > 0); 733Debug.Assert(!SymbolEqualityComparer.Default.Equals(type, _knownSymbols.MemoryByteType)); 741Debug.Assert(!SymbolEqualityComparer.Default.Equals(type, _knownSymbols.ReadOnlyMemoryByteType)); 1098Debug.Assert(memberInfo is IFieldSymbol or IPropertySymbol); 1203Debug.Assert(memberInfo is IFieldSymbol or IPropertySymbol); 1416Debug.Assert(constructor != null); 1509Debug.Assert(_knownSymbols.JsonConverterAttributeType.IsAssignableFrom(attributeData.AttributeClass)); 1517Debug.Assert(attributeData.ConstructorArguments.Length == 1 && attributeData.ConstructorArguments[0].Value is null or ITypeSymbol);
src\libraries\Common\src\SourceGenerators\SourceWriter.cs (1)
66Debug.Assert(_indentation == 0 && _sb.Length > 0);
src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (1)
18Debug.Assert(char.IsPunctuation(separator));
System.Text.RegularExpressions (424)
src\libraries\Common\src\System\HexConverter.cs (1)
165Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (5)
28Debug.Assert(value >= 0); 29Debug.Assert(value <= _span.Length); 38Debug.Assert(index < _pos); 106Debug.Assert(length >= 0); 134Debug.Assert(_pos == _span.Length);
System\Text\RegularExpressions\CaptureCollection.cs (1)
58Debug.Assert(_captures != null);
System\Text\RegularExpressions\Match.cs (4)
101Debug.Assert(Text != null); 267Debug.Assert(mode != RegexRunnerMode.ExistenceRequired); 275Debug.Assert(_textbeg == 0); 296Debug.Assert(!_balancing);
System\Text\RegularExpressions\Regex.Cache.cs (6)
76Debug.Assert(value >= 0); 104Debug.Assert(s_cacheList.Count == value); 105Debug.Assert(s_cacheDictionary.Count == value); 199Debug.Assert(s_cacheList.Count == s_cacheDictionary.Count); 262Debug.Assert(s_cacheList.Count <= s_maxCacheSize); 263Debug.Assert(s_cacheList.Count == s_cacheDictionary.Count);
System\Text\RegularExpressions\Regex.cs (6)
463Debug.Assert(mode <= RegexRunnerMode.BoundsRequired); 467Debug.Assert(startat <= input.Length); 529Debug.Assert(inputString is null || inputSpan.SequenceEqual(inputString)); 530Debug.Assert((uint)startat <= (uint)inputSpan.Length); 547Debug.Assert(match is not null); 612Debug.Assert(match is not null);
System\Text\RegularExpressions\RegexCaseEquivalences.cs (4)
81Debug.Assert(cultureName[0] is >= 'a' and <= 'z'); 82Debug.Assert(cultureName[1] is >= 'a' and <= 'z'); 133Debug.Assert((c / CharactersPerRange) < 0xFF); 145Debug.Assert(((c % CharactersPerRange) + firstLevelLookupValue) < 0xFFFF);
System\Text\RegularExpressions\RegexCharClass.cs (14)
337Debug.Assert(whitespaceSet.Contains((char)i) == char.IsWhiteSpace((char)i)); 409Debug.Assert(!set.IsEmpty); 701Debug.Assert(c != 0); 869Debug.Assert(count <= evaluated); 913Debug.Assert(set1Negated == set2Negated); 947Debug.Assert(!IsNegated(set1) && !IsNegated(set2)); 998Debug.Assert((uint)comparison <= char.MaxValue); 1063Debug.Assert(twoChars.Length >= 2); 1149Debug.Assert(!hasSubtraction); 1278Debug.Assert(ch < 128); 1296Debug.Assert(ch < 128); 1467Debug.Assert(curcat < 0); 1552Debug.Assert(chars[index] < chars[index + 1]); 1617Debug.Assert(i == span.Length);
System\Text\RegularExpressions\RegexCompiler.cs (45)
377Debug.Assert(_pool != null); 378Debug.Assert(_local != null); 379Debug.Assert(!_pool.Contains(_local)); 388Debug.Assert(_regexTree != null); 409Debug.Assert(minRequiredLength >= 0); 754Debug.Assert(opts.FindMode is FindNextStartingPositionMode.LeadingString_LeftToRight or 809Debug.Assert(!string.IsNullOrEmpty(prefix)); 841Debug.Assert(_regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 }); 915Debug.Assert(primarySet.Chars.Length > 0); 1097Debug.Assert(needLoop); 1113Debug.Assert(setIndex is 0 or 1); 1116Debug.Assert(needLoop); 1172Debug.Assert(_regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 }); 1175Debug.Assert(set.Distance == 0); 1243Debug.Assert(_regexTree.FindOptimizations.LiteralAfterLoop is not null); 1246Debug.Assert(target.LoopNode.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic); 1247Debug.Assert(target.LoopNode.N == int.MaxValue); 1277Debug.Assert(target.Literal.StringComparison is StringComparison.Ordinal); 1423Debug.Assert(_regexTree != null); 1611Debug.Assert(requiredLength > 0); 1649Debug.Assert(childCount >= 2); 1656Debug.Assert(node.Parent is not null); 1844Debug.Assert(sliceStaticPos == 0); 2124Debug.Assert(needsEndConditional); 2330Debug.Assert(resumeAt is not null); 2492Debug.Assert(startingCapturePos != null); 2966Debug.Assert(!rtl || offset is null); 3072Debug.Assert(node.Kind == RegexNodeKind.NonECMABoundary); 3083Debug.Assert((node.Options & RegexOptions.RightToLeft) == 0 || sliceStaticPos == 0); 3084Debug.Assert(sliceStaticPos >= 0); 3086Debug.Assert(sliceStaticPos >= 0); 3226Debug.Assert(str.Length >= 2); 3230Debug.Assert(emitLengthCheck); 3292Debug.Assert(node.M < node.N); 3505Debug.Assert(node.M < node.N); 3954Debug.Assert(sliceStaticPos == 0); 4034Debug.Assert(entriesPerIteration >= 1); 4373Debug.Assert(node.N > node.M); 4613Debug.Assert(node.M == 0 && node.N == 1); 4864Debug.Assert(sliceStaticPos == 0); 5018Debug.Assert(startingStackpos is not null); 5294Debug.Assert(count >= 1); 5713Debug.Assert(rangeLower.LowInclusive != rangeUpper.LowInclusive); 6204Debug.Assert(values is char[] or string[]); 6205Debug.Assert(comparison is StringComparison.Ordinal || values is string[]);
System\Text\RegularExpressions\RegexFindOptimizations.cs (10)
111Debug.Assert(!RegexCharClass.IsNegated(charClass)); 118Debug.Assert(!RegexCharClass.IsNegated(charClass) || chars is null); 165Debug.Assert(fixedDistanceSets is null || fixedDistanceSets.Count != 0); 342Debug.Assert(chars is { Length: 1 }); 470Debug.Assert(FindMode == FindNextStartingPositionMode.NoSearch); 651Debug.Assert(FixedDistanceLiteral.Distance <= MinRequiredLength); 666Debug.Assert(FixedDistanceLiteral.Distance <= MinRequiredLength); 760Debug.Assert(LiteralAfterLoop is not null); 763Debug.Assert(loopNode.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic); 764Debug.Assert(loopNode.N == int.MaxValue);
System\Text\RegularExpressions\RegexInterpreter.cs (4)
326Debug.Assert(runregex is not null); 327Debug.Assert(runtrack is not null); 328Debug.Assert(runstack is not null); 329Debug.Assert(runcrawl is not null);
System\Text\RegularExpressions\RegexNode.cs (60)
89Debug.Assert(Kind is RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or 92Debug.Assert(M > 0); 115Debug.Assert(culture is not null); 332Debug.Assert(rootNode.Kind == RegexNodeKind.Capture); 333Debug.Assert(rootNode.Parent is null); 334Debug.Assert(rootNode.ChildCount() == 1); 560Debug.Assert(Kind is RegexNodeKind.Alternate or RegexNodeKind.Concatenate); 577Debug.Assert(Kind == RegexNodeKind.Group); 582Debug.Assert(u.ChildCount() == 1); 605Debug.Assert(Kind == RegexNodeKind.Atomic); 606Debug.Assert(ChildCount() == 1); 647Debug.Assert(branches is not null && branches.Count != 0); 767Debug.Assert(Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop); 876Debug.Assert(Kind is RegexNodeKind.Set or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy); 877Debug.Assert(!string.IsNullOrEmpty(Str)); 925Debug.Assert(Kind == RegexNodeKind.Alternate); 1077Debug.Assert(alternation.Kind == RegexNodeKind.Alternate); 1078Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 }); 1098Debug.Assert(children[startingIndex].Children is List<RegexNode> { Count: >= 2 }); 1172Debug.Assert(node.Kind == RegexNodeKind.Alternate); 1173Debug.Assert(node.ChildCount() >= 2); 1215Debug.Assert(alternation.Kind == RegexNodeKind.Alternate); 1216Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 }); 1247Debug.Assert(startingSpan.Length > 0); 1276Debug.Assert(startingNode.Kind == RegexNodeKind.Multi); 1277Debug.Assert(startingNode.Str!.Length > 0); 1300Debug.Assert(startingSpan.Length > 0); 1323Debug.Assert(startingSpan.Length == 1); 1324Debug.Assert(startingSpan[0] == node.Ch); 1330Debug.Assert(node.Kind == RegexNodeKind.Multi); 1331Debug.Assert(node.Str.AsSpan().StartsWith(startingSpan, StringComparison.Ordinal)); 1385Debug.Assert(Kind is RegexNodeKind.One or RegexNodeKind.Multi || (IsOneFamily && M > 0)); 1386Debug.Assert((Options & RegexOptions.RightToLeft) == 0); 1445Debug.Assert(lowInclusive < highInclusive); 1481Debug.Assert(@string is not null); 1487Debug.Assert(setChars is not null); 1500Debug.Assert(Kind == RegexNodeKind.Concatenate); 1542Debug.Assert(Kind == RegexNodeKind.Concatenate); 1543Debug.Assert(Children is List<RegexNode>); 1625Debug.Assert(Kind == RegexNodeKind.Concatenate); 1626Debug.Assert(Children is List<RegexNode>); 1733Debug.Assert(matchingCharsInMulti < nextNode.Str.Length); 1827Debug.Assert(Children is List<RegexNode>); 1932Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop); 1966Debug.Assert(Kind is RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround); 1967Debug.Assert(ChildCount() == 1); 1994Debug.Assert(Kind == RegexNodeKind.BackreferenceConditional); 1995Debug.Assert(ChildCount() is 1 or 2); 2012Debug.Assert(Kind == RegexNodeKind.ExpressionConditional); 2013Debug.Assert(ChildCount() is 2 or 3); 2066Debug.Assert(subsequent.Kind != RegexNodeKind.Group); 2290Debug.Assert(childCount >= 2); 2323Debug.Assert(ChildCount() == 1); 2407Debug.Assert(childCount >= 2); 2461Debug.Assert(ChildCount() == 1); 2690Debug.Assert(max >= 2); 2735Debug.Assert(Children is List<RegexNode>); 2746Debug.Assert(Children != null); 2747Debug.Assert(index < ChildCount()); 2777Debug.Assert(Children is RegexNode);
System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (6)
247Debug.Assert(childCount >= 2); // otherwise it would have been optimized out 266Debug.Assert(alternateBranchResults.Count > 0); 773Debug.Assert(sameDistance.HasValue); 813Debug.Assert(!s2Negated); 1129Debug.Assert(node.ChildCount() >= 2); 1175Debug.Assert(
System\Text\RegularExpressions\RegexReplacement.cs (2)
218Debug.Assert(_rules.Length <= 1); 219Debug.Assert(_rules.Length == 0 || (_rules[0] == 0 && _strings.Length == 1));
System\Text\RegularExpressions\RegexTree.cs (9)
47Debug.Assert(captureNumberSparseMapping is null || captureNames is not null); 48Debug.Assert((captureNames is null) == (captureNameToNumberMapping is null)); 49Debug.Assert(captureNames is null || captureCount == captureNames.Length); 50Debug.Assert(captureNumberSparseMapping is null || captureCount == captureNumberSparseMapping.Count); 51Debug.Assert(captureNameToNumberMapping is null || captureCount == captureNameToNumberMapping.Count); 54Debug.Assert(captureNameToNumberMapping is not null); 60Debug.Assert(captureNumber is not null); 65Debug.Assert(captureNumber is not null); 68Debug.Assert(captureNumber == i);
System\Text\RegularExpressions\RegexWriter.cs (2)
31Debug.Assert(!Enum.IsDefined(BeforeChild)); 32Debug.Assert(!Enum.IsDefined(AfterChild));
System\Text\RegularExpressions\Symbolic\BDD.cs (10)
90Debug.Assert((One is null) == (Zero is null)); 112Debug.Assert(!set.IsEmpty); 174Debug.Assert(nodes[nodes.Length - 1] == this); 175Debug.Assert(nodes.Length <= (1 << 24)); 224Debug.Assert(v >= 0); 315Debug.Assert(serialized[i] > 0); 353Debug.Assert((bytes.Length - 1) % bytesPerLong == 0); 381Debug.Assert(oneId < i && zeroId < i); 382Debug.Assert(nodes[oneId] is not null); 383Debug.Assert(nodes[zeroId] is not null);
System\Text\RegularExpressions\Symbolic\BDDRangeConverter.cs (1)
101Debug.Assert(!set.IsLeaf);
System\Text\RegularExpressions\Symbolic\BitVector.cs (7)
32Debug.Assert(length > 0); 42Debug.Assert(length > 0); 73Debug.Assert(i >= 0 && i < Length); 81Debug.Assert(i >= 0 && i < Length); 89Debug.Assert(x.Length == y.Length); 106Debug.Assert(x.Length == y.Length); 123Debug.Assert(!bitVectors.IsEmpty);
System\Text\RegularExpressions\Symbolic\CharSetSolver.cs (3)
223Debug.Assert(op is BooleanOperation.Or or BooleanOperation.And or BooleanOperation.Xor); 264Debug.Assert(!set2.IsLeaf); 364Debug.Assert(terminal >= 0);
System\Text\RegularExpressions\Symbolic\DoublyLinkedList.cs (2)
44Debug.Assert(_first is not null); 74Debug.Assert(_last is not null);
System\Text\RegularExpressions\Symbolic\MatchingState.cs (3)
57Debug.Assert(IsNullableFor(nextCharKind)); 58Debug.Assert(CharKind.IsValidCharKind(nextCharKind)); 101Debug.Assert(CharKind.IsValidCharKind(nextCharKind));
System\Text\RegularExpressions\Symbolic\MintermGenerator.cs (3)
73Debug.Assert(_right is null); 79Debug.Assert(_right is not null); 102Debug.Assert(node._left is not null && node._right is not null);
System\Text\RegularExpressions\Symbolic\RegexNodeConverter.cs (17)
31Debug.Assert(_builder is not null); 47Debug.Assert(childResults is null || childResults.Length != 0); 73Debug.Assert(str is not null); 90Debug.Assert(childResults is not null && childResults.Length == node.ChildCount()); 126Debug.Assert(set is not null); 204Debug.Assert(node.ChildCount() > 0); 205Debug.Assert(childResults is not null); 206Debug.Assert(childResults.Length == node.ChildCount()); 207Debug.Assert(result.Count == 0); 253Debug.Assert(childResults.Length == 1); 267Debug.Assert(node.Kind == RegexNodeKind.Capture && node.N == -1); 269Debug.Assert(childResults.Length == 1); 285Debug.Assert(rootResult.Count == 1 || root.Kind == RegexNodeKind.Concatenate || root.Kind == RegexNodeKind.Capture); 312Debug.Assert(node.Kind == RegexNodeKind.Set); 315Debug.Assert(set is not null); 378Debug.Assert(!Enum.IsDefined((UnicodeCategory)UnicodeCategoryCount)); 516Debug.Assert(result is not null);
System\Text\RegularExpressions\Symbolic\SparseIntMap.cs (4)
41Debug.Assert(entryKey < sparse.Length); 68Debug.Assert(0 <= index && index < _dense.Count); 69Debug.Assert(_dense[index].Key == key); 76Debug.Assert(newLength > _sparse.Length);
System\Text\RegularExpressions\Symbolic\SymbolicRegexBuilder.cs (6)
234Debug.Assert(node._set is not null); 244Debug.Assert(node._left is not null); 324Debug.Assert(node._set is not null); 328Debug.Assert(node._left is not null); 332Debug.Assert(node._left is not null && node._right is not null); 356Debug.Assert(node._left is not null);
System\Text\RegularExpressions\Symbolic\SymbolicRegexInfo.cs (5)
33Debug.Assert(!isAlwaysNullable || canBeNullable); 34Debug.Assert(!startsWithLineAnchor || containsLineAnchor); 35Debug.Assert(!startsWithLineAnchor || startsWithSomeAnchor); 36Debug.Assert(!containsLineAnchor || containsSomeAnchor); 37Debug.Assert(!startsWithSomeAnchor || containsSomeAnchor);
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Automata.cs (14)
102Debug.Assert(newSize >= array.Length); 113Debug.Assert(Monitor.IsEntered(this)); 127Debug.Assert(Monitor.IsEntered(this)); 151Debug.Assert(Monitor.IsEntered(this)); 172Debug.Assert(_stateArray is not null); 205Debug.Assert(Monitor.IsEntered(this)); 206Debug.Assert(node.Kind != SymbolicRegexNodeKind.Alternate); 238Debug.Assert(nfaStateId < _nfaCoreIdArray.Length); 252Debug.Assert(stateId > 0); 254Debug.Assert(state is not null); 261Debug.Assert(nfaStateId < _nfaCoreIdArray.Length); 262Debug.Assert(_nfaCoreIdArray[nfaStateId] < _stateArray.Length); 271Debug.Assert(offset < _dfaDelta.Length); 300Debug.Assert(nfaOffset < _nfaDelta.Length);
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.cs (16)
161Debug.Assert(solverMinterms is not null); 200Debug.Assert(CharKind.General == 0); 266Debug.Assert(Solver.IsEmpty(Solver.And(Solver.Not(_builder._wordLetterForBoundariesSet), minterm))); 313Debug.Assert(_checkTimeout); 328Debug.Assert(perThreadData is not null); 384Debug.Assert(matchEnd >= startat - 1); 623Debug.Assert(i >= matchStartBoundary); 665Debug.Assert(lastStart != -1); 709Debug.Assert(perThreadData.Current is not null && perThreadData.Next is not null); 720Debug.Assert(next.Count == 0); 749Debug.Assert(!flags.IsDeadend()); 770Debug.Assert(current.Count > 0); 840Debug.Assert(CaptureStarts.Length == other.CaptureStarts.Length); 841Debug.Assert(CaptureEnds.Length == other.CaptureEnds.Length); 1189Debug.Assert(nextStates.Count == 0 || sourceStates.Count > 0); 1294Debug.Assert(!matcher._pattern._info.ContainsSomeAnchor);
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Dgml.cs (1)
152Debug.Assert(deltas.Length == matcher._minterms.Length);
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Sample.cs (4)
54Debug.Assert(_minterms is not null); 82Debug.Assert(states.NfaStateSet.Count > 0); 138Debug.Assert(success); 176Debug.Assert(!bdd.IsEmpty);
System\Text\RegularExpressions\Symbolic\SymbolicRegexNode.cs (133)
80Debug.Assert(kind != SymbolicRegexNodeKind.Singleton || set is not null); 114Debug.Assert(node.CanBeNullable); 128Debug.Assert(node._left is not null && node._right is not null); 141Debug.Assert(node._left is not null); 153Debug.Assert(node._kind is SymbolicRegexNodeKind.BeginningAnchor or 174Debug.Assert(_info.CanBeNullable || !_info.IsNullable); 187Debug.Assert(listKind is SymbolicRegexNodeKind.Concat or SymbolicRegexNodeKind.Alternate); 203Debug.Assert(node._left is not null && node._right is not null); 244Debug.Assert(context < CharKind.ContextLimit); 258Debug.Assert(_left is not null); 263Debug.Assert(_left is not null && _right is not null); 268Debug.Assert(_left is not null && _right is not null); 315Debug.Assert(_left is not null); 323Debug.Assert(_kind == SymbolicRegexNodeKind.EndAnchorZReverse); 339Debug.Assert(_left is not null); 342Debug.Assert(_left._set is not null); 355Debug.Assert(_set is not null); 392Debug.Assert(kind is 409Debug.Assert(lower >= 0 && lower <= upper); 414Debug.Assert(body._left is not null); 430Debug.Assert(node._left is not null && node._right is not null); 460Debug.Assert(right._kind is not SymbolicRegexNodeKind.Effect); 463Debug.Assert(left._left is not null && left._right is not null); 519Debug.Assert(current._left is not null && current._right is not null); 521Debug.Assert(current._left._kind != SymbolicRegexNodeKind.Alternate); 581Debug.Assert(left._kind != SymbolicRegexNodeKind.Alternate); 582Debug.Assert(deduplicated); 651Debug.Assert(left._left is not null && left._right is not null); 659Debug.Assert(right._left is not null && right._right is not null); 667Debug.Assert(left._left is not null && right._left is not null && right._right is not null); 671Debug.Assert(rl._left is not null); 681Debug.Assert(left._left is not null && left._right is not null); 685Debug.Assert(ll._left is not null); 694Debug.Assert(left._left is not null && left._right is not null); 713Debug.Assert(prefix._left is not null && prefix._right is not null); 717Debug.Assert(node._left is not null && node._right is not null); 729Debug.Assert(node._left is not null && node._right is not null); 750Debug.Assert(current._left is not null); 773Debug.Assert(right.Subsumes(builder, left)); 789Debug.Assert(left._left is not null && left._right is not null); 790Debug.Assert(right.Subsumes(builder, left._left)); 812Debug.Assert(right._left is not null && right._right is not null); 813Debug.Assert(right._left.Subsumes(builder, left)); 821Debug.Assert(right._left is not null && right._right is not null); 842Debug.Assert(suffix._left is not null && suffix._right is not null); 844Debug.Assert(suffix.Subsumes(builder, left)); 909Debug.Assert(_left is not null); 927Debug.Assert(_left is not null && _right is not null); 946Debug.Assert(_left is not null && _right is not null); 960Debug.Assert(_left is not null); 988Debug.Assert(_left is not null && _right is not null); 995Debug.Assert(_left is not null && _right is not null); 1011Debug.Assert(_lower == lengthSoFar); 1067Debug.Assert(_left is not null); 1102Debug.Assert(_left is not null && _right is not null); 1113Debug.Assert(_left is not null && _right is not null); 1144Debug.Assert(_left is not null && _right is not null); 1159Debug.Assert(loop.Kind == SymbolicRegexNodeKind.Loop && loop._left is not null); 1198Debug.Assert(loop._left.IsNullableFor(context)); 1213Debug.Assert(_kind == SymbolicRegexNodeKind.Loop && _left is not null); 1267Debug.Assert(_set is not null); 1285Debug.Assert(_left is not null && _right is not null); 1317Debug.Assert(_left is not null); 1318Debug.Assert(_upper > 0); 1338Debug.Assert(_left is not null && _right is not null); 1379Debug.Assert(_left is not null && _right is not null); 1384Debug.Assert(_left is not null && _right is not null); 1385Debug.Assert(_left._info.ContainsEffect && !_right._info.ContainsEffect); 1389Debug.Assert(_left is not null && _right is not null); 1398Debug.Assert(_left is not null); 1402Debug.Assert(_left is not null); 1451Debug.Assert(_left is not null && _right is not null); 1463Debug.Assert(_left is not null && _right is not null); 1464Debug.Assert(_left._info.ContainsEffect && !_right._info.ContainsEffect); 1478Debug.Assert(_left is not null && _right is not null); 1487Debug.Assert(_left is not null); 1504Debug.Assert(_left is not null); 1542Debug.Assert(_left is not null && _right is not null); 1543Debug.Assert(_left.IsNullableFor(context) && _right.IsNullableFor(context)); 1549Debug.Assert(_left is not null); 1553Debug.Assert(_left.IsNullableFor(context)); 1559Debug.Assert(_left is not null && _right is not null); 1568Debug.Assert(_right.IsNullableFor(context)); 1582Debug.Assert(_left is not null); 1649Debug.Assert(_left is not null && _right is not null); 1658Debug.Assert(_left is not null && _right is not null); 1669Debug.Assert(_set is not null); 1674Debug.Assert(_left is not null); 1733Debug.Assert(_left is not null && _right is not null); 1747Debug.Assert(_lower >= 0); 1753Debug.Assert(_lower >= 0); 1759Debug.Assert(_left is not null); 1854Debug.Assert(_set is not null); 1859Debug.Assert(_left is not null); 1864Debug.Assert(_left is not null && _right is not null); 1874Debug.Assert(conc._left is not null && conc._right is not null); 1882Debug.Assert(_left is not null); 1918Debug.Assert(_left is not null); 1923Debug.Assert(_left is not null && _right is not null); 1928Debug.Assert(rest._left is not null && rest._right is not null); 1939Debug.Assert(_left is not null && _right is not null); 1969Debug.Assert(_left is not null); 1995Debug.Assert(_left is not null && _right is not null); 1999Debug.Assert(_left is not null && _right is not null); 2003Debug.Assert(_left is not null); 2016Debug.Assert(kind != SymbolicRegexNodeKind.Singleton); 2036Debug.Assert(left is not null); 2040Debug.Assert(left is not null && right is not null); 2044Debug.Assert(left is not null && right is not null); 2049Debug.Assert(left is not null); 2121Debug.Assert(_left is not null); 2129Debug.Assert(_left is not null && _right is not null); 2133Debug.Assert(left1 is not null && right1 is not null); 2141Debug.Assert(_left is not null && _right is not null); 2145Debug.Assert(left1 is not null && right1 is not null); 2153Debug.Assert(_left is not null && _right is not null); 2161Debug.Assert(_left is not null); 2181Debug.Assert(IsNullableFor(context)); 2195Debug.Assert(_left is not null && _right is not null); 2204Debug.Assert(_right.IsNullableFor(context)); 2209Debug.Assert(_left is not null && _right is not null); 2227Debug.Assert(_left is not null); 2229Debug.Assert(_left._kind is not SymbolicRegexNodeKind.DisableBacktrackingSimulation); 2241Debug.Assert(current._left is not null && current._right is not null); 2242Debug.Assert(current._left._kind is not SymbolicRegexNodeKind.Alternate); 2291Debug.Assert(_left is not null && _right is not null); 2296Debug.Assert(_left is not null && _right is null); 2297Debug.Assert(_lower >= 0 && _upper > 0 && _upper >= _lower); 2307Debug.Assert(_lower > 0); 2322Debug.Assert(_left is not null); 2326Debug.Assert(_left is null && _right is null); 2336Debug.Assert(m >= 0 && n >= 0); 2343Debug.Assert(m >= 0 && n >= 0);
System\Text\RegularExpressions\Symbolic\SymbolicRegexRunnerFactory.cs (5)
17Debug.Assert((options & (RegexOptions.RightToLeft | RegexOptions.ECMAScript)) == 0); 27Debug.Assert(threshold > 0); 86Debug.Assert(pos.CaptureEnds != null); 87Debug.Assert(pos.CaptureStarts.Length == pos.CaptureEnds.Length); 92Debug.Assert(pos.CaptureEnds[cap] >= pos.CaptureStarts[cap]);
System\Text\RegularExpressions\Symbolic\UInt64Solver.cs (1)
17Debug.Assert(minterms.Length <= 64);
System\Text\RegularExpressions\Symbolic\UnicodeCategoryConditions.cs (1)
30Debug.Assert(Enum.GetValues<UnicodeCategory>().Length == UnicodeCategoryValueCount);
System\Text\RegularExpressions\Symbolic\UnicodeCategoryRangesGenerator.cs (3)
23Debug.Assert(namespacename != null); 24Debug.Assert(classname != null); 25Debug.Assert(path != null);
System\Text\StructListBuilder.cs (1)
61Debug.Assert(array.Length == _count);
System.Text.RegularExpressions.Generator (155)
RegexGenerator.cs (1)
92Debug.Assert(state is DiagnosticData);
RegexGenerator.Emitter.cs (42)
394Debug.Assert(chars.Length > 3); 703Debug.Assert(minRequiredLength >= 0); 976Debug.Assert(!string.IsNullOrEmpty(substring)); 983Debug.Assert(!string.IsNullOrEmpty(substring)); 987Debug.Assert(!string.IsNullOrEmpty(regexTree.FindOptimizations.FixedDistanceLiteral.String)); 1056Debug.Assert(opts.FindMode is FindNextStartingPositionMode.LeadingStrings_LeftToRight or FindNextStartingPositionMode.LeadingStrings_OrdinalIgnoreCase_LeftToRight); 1102Debug.Assert(regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 }); 1151Debug.Assert(primarySet.Chars.Length > 0); 1249Debug.Assert(setIndex is 0 or 1); 1255Debug.Assert(needLoop); 1290Debug.Assert(regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 }); 1293Debug.Assert(set.Distance == 0); 1324Debug.Assert(regexTree.FindOptimizations.LiteralAfterLoop is not null); 1327Debug.Assert(target.LoopNode.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic); 1328Debug.Assert(target.LoopNode.N == int.MaxValue); 1598Debug.Assert(requiredLength > 0); 1634Debug.Assert(childCount >= 2); 1641Debug.Assert(node.Parent is not null); 1703Debug.Assert(startingLiteralNode.IsSetFamily); 1774Debug.Assert(numChars != 0); 1816Debug.Assert(remainder is null); 2063Debug.Assert(sliceStaticPos == 0); 3093Debug.Assert(!rtl || offset is null); 3094Debug.Assert(!rtl || !clauseOnly); 3162Debug.Assert((node.Options & RegexOptions.RightToLeft) == 0 || sliceStaticPos == 0); 3163Debug.Assert(sliceStaticPos >= 0); 3228Debug.Assert(node.Str is not null); 3234Debug.Assert(str.Length >= 2); 3235Debug.Assert(!clauseOnly || (!emitLengthCheck && !rightToLeft)); 3239Debug.Assert(emitLengthCheck); 3296Debug.Assert(node.M < node.N); 3437Debug.Assert(node.M < node.N); 3764Debug.Assert(sliceStaticPos == 0); 3830Debug.Assert(entriesPerIteration >= 1); 4098Debug.Assert(node.N > node.M); 4149Debug.Assert(maxIterations > 1); 4224Debug.Assert(node.M == 0 && node.N == 1); 4399Debug.Assert(sliceStaticPos == 0); 4532Debug.Assert(startingStackpos is not null); 4663Debug.Assert(args.Length is >= 1); 4715Debug.Assert(args.Length is >= 1); 5151Debug.Assert(rangeLower.LowInclusive != rangeUpper.LowInclusive);
src\libraries\Common\src\System\HexConverter.cs (1)
165Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (5)
28Debug.Assert(value >= 0); 29Debug.Assert(value <= _span.Length); 38Debug.Assert(index < _pos); 106Debug.Assert(length >= 0); 134Debug.Assert(_pos == _span.Length);
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCaseEquivalences.cs (4)
81Debug.Assert(cultureName[0] is >= 'a' and <= 'z'); 82Debug.Assert(cultureName[1] is >= 'a' and <= 'z'); 133Debug.Assert((c / CharactersPerRange) < 0xFF); 145Debug.Assert(((c % CharactersPerRange) + firstLevelLookupValue) < 0xFFFF);
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (14)
337Debug.Assert(whitespaceSet.Contains((char)i) == char.IsWhiteSpace((char)i)); 409Debug.Assert(!set.IsEmpty); 701Debug.Assert(c != 0); 869Debug.Assert(count <= evaluated); 913Debug.Assert(set1Negated == set2Negated); 947Debug.Assert(!IsNegated(set1) && !IsNegated(set2)); 998Debug.Assert((uint)comparison <= char.MaxValue); 1063Debug.Assert(twoChars.Length >= 2); 1149Debug.Assert(!hasSubtraction); 1278Debug.Assert(ch < 128); 1296Debug.Assert(ch < 128); 1467Debug.Assert(curcat < 0); 1552Debug.Assert(chars[index] < chars[index + 1]); 1617Debug.Assert(i == span.Length);
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexFindOptimizations.cs (4)
111Debug.Assert(!RegexCharClass.IsNegated(charClass)); 118Debug.Assert(!RegexCharClass.IsNegated(charClass) || chars is null); 165Debug.Assert(fixedDistanceSets is null || fixedDistanceSets.Count != 0); 342Debug.Assert(chars is { Length: 1 });
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (60)
89Debug.Assert(Kind is RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or 92Debug.Assert(M > 0); 115Debug.Assert(culture is not null); 332Debug.Assert(rootNode.Kind == RegexNodeKind.Capture); 333Debug.Assert(rootNode.Parent is null); 334Debug.Assert(rootNode.ChildCount() == 1); 560Debug.Assert(Kind is RegexNodeKind.Alternate or RegexNodeKind.Concatenate); 577Debug.Assert(Kind == RegexNodeKind.Group); 582Debug.Assert(u.ChildCount() == 1); 605Debug.Assert(Kind == RegexNodeKind.Atomic); 606Debug.Assert(ChildCount() == 1); 647Debug.Assert(branches is not null && branches.Count != 0); 767Debug.Assert(Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop); 876Debug.Assert(Kind is RegexNodeKind.Set or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy); 877Debug.Assert(!string.IsNullOrEmpty(Str)); 925Debug.Assert(Kind == RegexNodeKind.Alternate); 1077Debug.Assert(alternation.Kind == RegexNodeKind.Alternate); 1078Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 }); 1098Debug.Assert(children[startingIndex].Children is List<RegexNode> { Count: >= 2 }); 1172Debug.Assert(node.Kind == RegexNodeKind.Alternate); 1173Debug.Assert(node.ChildCount() >= 2); 1215Debug.Assert(alternation.Kind == RegexNodeKind.Alternate); 1216Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 }); 1247Debug.Assert(startingSpan.Length > 0); 1276Debug.Assert(startingNode.Kind == RegexNodeKind.Multi); 1277Debug.Assert(startingNode.Str!.Length > 0); 1300Debug.Assert(startingSpan.Length > 0); 1323Debug.Assert(startingSpan.Length == 1); 1324Debug.Assert(startingSpan[0] == node.Ch); 1330Debug.Assert(node.Kind == RegexNodeKind.Multi); 1331Debug.Assert(node.Str.AsSpan().StartsWith(startingSpan, StringComparison.Ordinal)); 1385Debug.Assert(Kind is RegexNodeKind.One or RegexNodeKind.Multi || (IsOneFamily && M > 0)); 1386Debug.Assert((Options & RegexOptions.RightToLeft) == 0); 1445Debug.Assert(lowInclusive < highInclusive); 1481Debug.Assert(@string is not null); 1487Debug.Assert(setChars is not null); 1500Debug.Assert(Kind == RegexNodeKind.Concatenate); 1542Debug.Assert(Kind == RegexNodeKind.Concatenate); 1543Debug.Assert(Children is List<RegexNode>); 1625Debug.Assert(Kind == RegexNodeKind.Concatenate); 1626Debug.Assert(Children is List<RegexNode>); 1733Debug.Assert(matchingCharsInMulti < nextNode.Str.Length); 1827Debug.Assert(Children is List<RegexNode>); 1932Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop); 1966Debug.Assert(Kind is RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround); 1967Debug.Assert(ChildCount() == 1); 1994Debug.Assert(Kind == RegexNodeKind.BackreferenceConditional); 1995Debug.Assert(ChildCount() is 1 or 2); 2012Debug.Assert(Kind == RegexNodeKind.ExpressionConditional); 2013Debug.Assert(ChildCount() is 2 or 3); 2066Debug.Assert(subsequent.Kind != RegexNodeKind.Group); 2290Debug.Assert(childCount >= 2); 2323Debug.Assert(ChildCount() == 1); 2407Debug.Assert(childCount >= 2); 2461Debug.Assert(ChildCount() == 1); 2690Debug.Assert(max >= 2); 2735Debug.Assert(Children is List<RegexNode>); 2746Debug.Assert(Children != null); 2747Debug.Assert(index < ChildCount()); 2777Debug.Assert(Children is RegexNode);
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (6)
247Debug.Assert(childCount >= 2); // otherwise it would have been optimized out 266Debug.Assert(alternateBranchResults.Count > 0); 773Debug.Assert(sameDistance.HasValue); 813Debug.Assert(!s2Negated); 1129Debug.Assert(node.ChildCount() >= 2); 1175Debug.Assert(
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexTree.cs (9)
47Debug.Assert(captureNumberSparseMapping is null || captureNames is not null); 48Debug.Assert((captureNames is null) == (captureNameToNumberMapping is null)); 49Debug.Assert(captureNames is null || captureCount == captureNames.Length); 50Debug.Assert(captureNumberSparseMapping is null || captureCount == captureNumberSparseMapping.Count); 51Debug.Assert(captureNameToNumberMapping is null || captureCount == captureNameToNumberMapping.Count); 54Debug.Assert(captureNameToNumberMapping is not null); 60Debug.Assert(captureNumber is not null); 65Debug.Assert(captureNumber is not null); 68Debug.Assert(captureNumber == i);
UpgradeToGeneratedRegexAnalyzer.cs (2)
112Debug.Assert(syntaxNodeForDiagnostic != null); 144Debug.Assert(syntaxNodeForDiagnostic is not null);
UpgradeToGeneratedRegexCodeFixer.cs (2)
151Debug.Assert(typeDeclarationOrCompilationUnit is not null); 284Debug.Assert(parameterName is UpgradeToGeneratedRegexAnalyzer.OptionsArgumentName or UpgradeToGeneratedRegexAnalyzer.PatternArgumentName);
System.Threading (76)
System\Threading\Barrier.cs (2)
511Debug.Assert(result); 735Debug.Assert(phase < CurrentPhaseNumber);
System\Threading\CountdownEvent.cs (2)
176Debug.Assert(_event != null); 219Debug.Assert(_event != null);
System\Threading\ReaderWriterLock.cs (72)
87Debug.Assert(threadLocalLockEntry._readerLevel == 0); 92Debug.Assert((_state & LockStates.ReadersMask) != 0); 105Debug.Assert(threadLocalLockEntry.IsFree); 202Debug.Assert(threadLocalLockEntry.HasLockID(_lockID)); 207Debug.Assert((_state & LockStates.ReaderSignaled) != 0); 208Debug.Assert((_state & LockStates.ReadersMask) < LockStates.ReadersMask); 231Debug.Assert(readerEvent != null); 237Debug.Assert((_state & LockStates.ReadersMask) < LockStates.ReadersMask); 248Debug.Assert(threadLocalLockEntry.IsFree); 258Debug.Assert((knownState & LockStates.ReaderSignaled) != 0); 259Debug.Assert((knownState & LockStates.ReadersMask) < LockStates.ReadersMask); 272Debug.Assert((_state & LockStates.Writer) == 0); 273Debug.Assert((_state & LockStates.ReadersMask) != 0); 289Debug.Assert((_state & LockStates.ReadersMask) == 0); 373Debug.Assert((_state & LockStates.WriterSignaled) != 0); 389Debug.Assert(writerEvent != null); 408Debug.Assert((knownState & LockStates.WriterSignaled) != 0); 409Debug.Assert((knownState & LockStates.Writer) == 0); 413Debug.Assert(_writerLevel == 0); 430Debug.Assert((_state & LockStates.Writer) != 0); 431Debug.Assert((_state & LockStates.ReadersMask) == 0); 432Debug.Assert(_writerID == InvalidThreadID); 458Debug.Assert((_state & LockStates.Writer) == 0); 459Debug.Assert((_state & LockStates.ReadersMask) != 0); 460Debug.Assert(threadLocalLockEntry._readerLevel > 0); 494Debug.Assert(currentState != knownState); 519Debug.Assert(currentState != knownState); 531Debug.Assert((knownState & LockStates.Writer) == 0); 532Debug.Assert((knownState & LockStates.ReadersMask) != 0); 542Debug.Assert((_state & LockStates.WriterSignaled) != 0); 543Debug.Assert(writerEvent != null); 549Debug.Assert((_state & LockStates.ReaderSignaled) != 0); 550Debug.Assert(readerEvent != null); 560Debug.Assert(threadLocalLockEntry.IsFree); 570Debug.Assert((_state & LockStates.ReadersMask) == 0); 571Debug.Assert((_state & LockStates.Writer) != 0); 572Debug.Assert(_writerLevel > 0); 614Debug.Assert(currentState != knownState); 628Debug.Assert(currentState != knownState); 639Debug.Assert((knownState & LockStates.ReadersMask) == 0); 640Debug.Assert((knownState & LockStates.Writer) != 0); 647Debug.Assert((_state & LockStates.ReaderSignaled) != 0); 648Debug.Assert(readerEvent != null); 654Debug.Assert((_state & LockStates.WriterSignaled) != 0); 655Debug.Assert(writerEvent != null); 694Debug.Assert((_state & LockStates.ReadersMask) != 0); 695Debug.Assert(threadLocalLockEntry._readerLevel > 0); 707Debug.Assert(threadLocalLockEntry.IsFree); 770Debug.Assert(_writerLevel > 0); 804Debug.Assert(currentState != knownState); 810Debug.Assert((knownState & LockStates.ReadersMask) == 0); 817Debug.Assert((_state & LockStates.ReaderSignaled) != 0); 818Debug.Assert(readerEvent != null); 851Debug.Assert(_writerLevel > 0); 852Debug.Assert(_writerLevel > requestedWriterLevel); 865Debug.Assert((flags & LockCookieFlags.OwnedWriter) != 0 || _writerID != threadID); 897Debug.Assert((_state & LockStates.ReadersMask) != 0); 898Debug.Assert(threadLocalLockEntry._readerLevel > 0); 954Debug.Assert(threadLocalLockEntry.IsFree); 995Debug.Assert(threadLocalLockEntry != null); 1003Debug.Assert(threadID != InvalidThreadID); 1090Debug.Assert((_state & LockStates.CachingEvents) == LockStates.CachingEvents); 1225Debug.Assert(lockID != 0); 1226Debug.Assert(afterEntry != null); 1232Debug.Assert(currentEntry._lockID != lockID || currentEntry.IsFree); 1238Debug.Assert(lockID != 0); 1257Debug.Assert(lockID != 0); 1271Debug.Assert(lockID != 0); 1272Debug.Assert(headEntry == t_lockEntryHead); 1273Debug.Assert(headEntry == null || headEntry._lockID != lockID); 1319Debug.Assert(emptyEntry == headEntry); 1332Debug.Assert(entry._lockID == lockID);
System.Threading.Channels (17)
src\libraries\Common\src\System\Collections\Generic\Deque.cs (6)
52Debug.Assert(!IsEmpty); // caller's responsibility to make sure there are elements remaining 68Debug.Assert(!IsEmpty); // caller's responsibility to make sure there are elements remaining 74Debug.Assert(!IsEmpty); // caller's responsibility to make sure there are elements remaining 85Debug.Assert(!IsEmpty); // caller's responsibility to make sure there are elements remaining 112Debug.Assert(_size == _array.Length); 113Debug.Assert(_head == _tail);
System\Threading\Channels\AsyncOperation.cs (4)
221Debug.Assert(_executionContext == null); 228Debug.Assert(_schedulingContext == null); 291Debug.Assert(ts != null); 317Debug.Assert(_registration == default);
System\Threading\Channels\BoundedChannel.cs (2)
48Debug.Assert(bufferedCapacity > 0); 246Debug.Assert(Monitor.IsEntered(parent.SyncObj));
System\Threading\Channels\ChannelUtilities.cs (3)
59Debug.Assert(error != null); 99Debug.Assert(completed || c.CancellationToken.CanBeCanceled); 112Debug.Assert(error != null);
System\Threading\Channels\SingleConsumerUnboundedChannel.cs (1)
332Debug.Assert(blockedReader != null);
System\Threading\Channels\UnboundedChannel.cs (1)
169Debug.Assert(parent._items.IsThreadSafe || Monitor.IsEntered(parent.SyncObj));
System.Threading.RateLimiting (42)
src\libraries\Common\src\System\Collections\Generic\Deque.cs (6)
52Debug.Assert(!IsEmpty); // caller's responsibility to make sure there are elements remaining 68Debug.Assert(!IsEmpty); // caller's responsibility to make sure there are elements remaining 74Debug.Assert(!IsEmpty); // caller's responsibility to make sure there are elements remaining 85Debug.Assert(!IsEmpty); // caller's responsibility to make sure there are elements remaining 112Debug.Assert(_size == _array.Length); 113Debug.Assert(_head == _tail);
System\Threading\RateLimiting\ConcurrencyLimiter.cs (9)
146Debug.Assert(_options.QueueLimit >= _queueCount); 156Debug.Assert(_queueCount >= 0); 190Debug.Assert(_queueCount <= _options.QueueLimit); 217Debug.Assert(_permitCount >= 0); 245Debug.Assert(_permitCount <= _options.PermitLimit); 283Debug.Assert(_permitCount >= 0); 308Debug.Assert(_queueCount >= 0); 318Debug.Assert(_idleSince is null); 384Debug.Assert(count == 0 ? limiter is null : true);
System\Threading\RateLimiting\FixedWindowRateLimiter.cs (8)
163Debug.Assert(_options.QueueLimit >= _queueCount); 173Debug.Assert(_queueCount >= 0); 207Debug.Assert(_queueCount <= _options.QueueLimit); 243Debug.Assert(_permitCount >= 0); 274Debug.Assert(limiter is not null); 339Debug.Assert(_permitCount >= 0); 362Debug.Assert(_queueCount >= 0); 373Debug.Assert(_idleSince is null);
System\Threading\RateLimiting\SlidingWindowRateLimiter.cs (9)
175Debug.Assert(_options.QueueLimit >= _queueCount); 185Debug.Assert(_queueCount >= 0); 219Debug.Assert(_queueCount <= _options.QueueLimit); 247Debug.Assert(_permitCount >= 0); 280Debug.Assert(limiter is not null); 319Debug.Assert(_permitCount <= _options.PermitLimit); 351Debug.Assert(_permitCount >= 0); 375Debug.Assert(_queueCount >= 0); 386Debug.Assert(_idleSince is null);
System\Threading\RateLimiting\TokenBucketRateLimiter.cs (10)
168Debug.Assert(_options.QueueLimit >= _queueCount); 178Debug.Assert(_queueCount >= 0); 212Debug.Assert(_queueCount <= _options.QueueLimit); 223Debug.Assert(_options.TokensPerPeriod > 0); 250Debug.Assert(_tokenCount >= 0); 281Debug.Assert(limiter is not null); 325Debug.Assert(_tokenCount <= _options.TokenLimit); 353Debug.Assert(_tokenCount >= 0); 376Debug.Assert(_queueCount >= 0); 387Debug.Assert(_idleSince is null);
System.Threading.Tasks.Dataflow (7)
Blocks\ActionBlock.cs (5)
136Debug.Assert(_defaultTarget != null); 160Debug.Assert(_defaultTarget != null); 206Debug.Assert(_defaultTarget != null); 232Debug.Assert(_spscTarget != null); 251Debug.Assert(_spscTarget != null);
Blocks\TransformManyBlock.IAsyncEnumerable.cs (1)
43t.ContinueWith(static t => Debug.Assert(t.IsCompletedSuccessfully), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
Internal\SourceCore.cs (1)
371Debug.Assert(items != null);
System.Threading.Tasks.Parallel (26)
System\Threading\Tasks\Parallel.cs (7)
923Debug.Assert(typeof(TInt) == typeof(int) || typeof(TInt) == typeof(long)); 1024Debug.Assert(sharedPStateFlags != null); 1029Debug.Assert(sharedPStateFlags != null); 1703Debug.Assert(array != null); 1762Debug.Assert(list != null); 2821Debug.Assert(exObj is Exception); 2833Debug.Assert(first is OperationCanceledException);
System\Threading\Tasks\Parallel.ForEachAsync.cs (11)
80Debug.Assert(fromInclusive != null); 81Debug.Assert(toExclusive != null); 82Debug.Assert(scheduler != null); 83Debug.Assert(body != null); 273Debug.Assert(source != null); 274Debug.Assert(scheduler != null); 275Debug.Assert(body != null); 428Debug.Assert(source != null); 429Debug.Assert(scheduler != null); 430Debug.Assert(body != null); 677Debug.Assert(!Cancellation.IsCancellationRequested);
System\Threading\Tasks\ParallelLoopState.cs (3)
186Debug.Assert(typeof(TInt) == typeof(int) || typeof(TInt) == typeof(long)); 239Debug.Assert(typeof(TInt) == typeof(int) || typeof(TInt) == typeof(long)); 367Debug.Assert(typeof(TInt) == typeof(long));
System\Threading\Tasks\ParallelRangeManager.cs (5)
178Debug.Assert(typeof(TInt) == typeof(int) || typeof(TInt) == typeof(long)); 182Debug.Assert( 241Debug.Assert((uSpan / uRangeSize) < int.MaxValue); 275Debug.Assert(i == nNumRanges - 1); 291Debug.Assert(_indexRanges != null && _indexRanges.Length != 0);
System.Transactions.Local (108)
System\Transactions\CommittableTransaction.cs (6)
64Debug.Assert(_internalTransaction.State != null); 98Debug.Assert(_internalTransaction.State != null); 133Debug.Assert(_internalTransaction.State != null); 173Debug.Assert(_internalTransaction.State != null); 203Debug.Assert(_internalTransaction.State != null); 223Debug.Assert(_internalTransaction.State != null);
System\Transactions\DependentTransaction.cs (2)
20Debug.Assert(_internalTransaction.State != null); 51Debug.Assert(_internalTransaction.State != null);
System\Transactions\DurableEnlistmentState.cs (8)
182Debug.Assert(enlistment.Transaction.State != null); 192Debug.Assert(enlistment.Transaction.State != null); 202Debug.Assert(enlistment.Transaction.State != null); 214Debug.Assert(enlistment.Transaction.State != null); 231Debug.Assert(enlistment.PromotableSinglePhaseNotification != null); 239Debug.Assert(enlistment.Transaction.State != null); 251Debug.Assert(enlistment.Transaction.State != null); 263Debug.Assert(enlistment.Transaction.State != null);
System\Transactions\Enlistment.cs (8)
142Debug.Assert(_twoPhaseState != null); 234Debug.Assert(Transaction._phase0Volatiles._preparedVolatileEnlistments <= 260Debug.Assert(_singlePhaseNotifications != null); 275Debug.Assert(_twoPhaseNotifications != null); 282Debug.Assert(_twoPhaseNotifications != null); 289Debug.Assert(_twoPhaseNotifications != null); 296Debug.Assert(_twoPhaseNotifications != null); 388Debug.Assert(_transaction._phase1Volatiles._preparedVolatileEnlistments <=
System\Transactions\EnlistmentState.cs (7)
118Debug.Assert(enlistment.PromotedEnlistment != null); 132Debug.Assert(enlistment.PromotedEnlistment != null); 146Debug.Assert(enlistment.PromotedEnlistment != null); 160Debug.Assert(enlistment.PromotedEnlistment != null); 174Debug.Assert(enlistment.PromotedEnlistment != null); 188Debug.Assert(enlistment.PromotedEnlistment != null); 202Debug.Assert(enlistment.PromotedEnlistment != null);
System\Transactions\InternalTransaction.cs (3)
300Debug.Assert(tx.PromotedTransaction != null); 304Debug.Assert(tx.State! != null); 355Debug.Assert(_committableTransaction != null);
System\Transactions\Transaction.cs (12)
461Debug.Assert(_internalTransaction.State != null); 502Debug.Assert(_internalTransaction.State != null); 550Debug.Assert(_internalTransaction.State != null); 576Debug.Assert(_internalTransaction.State != null); 600Debug.Assert(_internalTransaction.State != null); 637Debug.Assert(_internalTransaction.State != null); 676Debug.Assert(_internalTransaction.State != null); 797Debug.Assert(_internalTransaction.State != null); 948Debug.Assert(_internalTransaction.State != null); 993Debug.Assert(_internalTransaction.State != null); 1031Debug.Assert(_internalTransaction.State != null); 1048Debug.Assert(_internalTransaction.State != null);
System\Transactions\TransactionInformation.cs (2)
59Debug.Assert(_internalTransaction.State != null); 88Debug.Assert(_internalTransaction.State != null);
System\Transactions\TransactionScope.cs (7)
538Debug.Assert(_threadContextData != null); 559Debug.Assert(rollbackTransaction != null); 792Debug.Assert(rollbackTransaction != null); 818Debug.Assert(_expectedCurrent != null); 938Debug.Assert(ContextKey != null); 985Debug.Assert(_savedCurrentScope.ContextKey != null); 1027Debug.Assert(_threadContextData != null);
System\Transactions\TransactionState.cs (33)
615Debug.Assert(tx._phase0Volatiles._dependentClones >= 0); 618Debug.Assert(tx._phase0Volatiles._preparedVolatileEnlistments <= 636Debug.Assert(tx._phase1Volatiles._dependentClones >= 0); 664Debug.Assert(tx.promotedToken != null); 845Debug.Assert(tx._promoter != null); 1183Debug.Assert(tx._committableTransaction != null); 1879Debug.Assert(tx._phase0Volatiles._preparedVolatileEnlistments <= 1893Debug.Assert(tx._phase0WaveDependentCloneCount >= 0); 1927Debug.Assert(tx._phase1Volatiles._dependentClones >= 0); 1934Debug.Assert(0 <= tx._abortingDependentCloneCount); 1969Debug.Assert(tx.PromotedTransaction != null); 1991Debug.Assert(tx.PromotedTransaction != null); 2065Debug.Assert(tx.PromotedTransaction != null); 2131Debug.Assert(tx.PromotedTransaction != null && tx.PromotedTransaction.RealTransaction != null); 2255Debug.Assert(tx.PromotedTransaction != null); 2271Debug.Assert(tx.PromotedTransaction != null); 2296Debug.Assert(tx.PromotedTransaction != null && tx.PromotedTransaction.RealTransaction != null); 2300Debug.Assert(tx.State != null); 2541Debug.Assert(tx._phase0Volatiles.VolatileDemux._promotedEnlistment != null); 2649Debug.Assert(tx._phase1Volatiles.VolatileDemux._promotedEnlistment != null); 2766Debug.Assert(tx._phase0Volatiles.VolatileDemux._promotedEnlistment != null); 2777Debug.Assert(tx.PromotedTransaction != null); 2808Debug.Assert(tx._phase1Volatiles.VolatileDemux._promotedEnlistment != null); 2894Debug.Assert(tx.PromotedTransaction != null); 3364Debug.Assert(tx._durableEnlistment != null); 3535Debug.Assert(tx._phase0Volatiles._preparedVolatileEnlistments <= 3554Debug.Assert(tx._phase1Volatiles._dependentClones >= 0); 3746Debug.Assert(tx._committableTransaction != null); 3847Debug.Assert(tx._durableEnlistment != null); 4307Debug.Assert(tx.PromotedTransaction != null); 4422Debug.Assert(tx._promoter != null); 4616Debug.Assert(tx._durableEnlistment != null); 4652Debug.Assert(tx._durableEnlistment != null);
System\Transactions\TransactionTable.cs (2)
332Debug.Assert(lastBucketSet != null); 377Debug.Assert(tx._tableBucket != null);
System\Transactions\VolatileEnlistmentMultiplexing.cs (8)
258Debug.Assert(_promotedEnlistment != null && _transaction.State != null); 285Debug.Assert(_promotedEnlistment != null && _transaction.State != null); 295Debug.Assert(_promotedEnlistment != null && _transaction.State != null); 305Debug.Assert(_transaction.State != null); 349Debug.Assert(_promotedEnlistment != null && _transaction.State != null); 377Debug.Assert(_promotedEnlistment != null && _transaction.State != null); 388Debug.Assert(_promotedEnlistment != null && _transaction.State != null); 399Debug.Assert(_transaction.State != null);
System\Transactions\VolatileEnlistmentState.cs (10)
147Debug.Assert(enlistment.EnlistmentNotification != null); 179Debug.Assert(enlistment.Transaction.State != null); 222Debug.Assert(enlistment.SinglePhaseNotification != null); 241Debug.Assert(enlistment.Transaction.State != null); 248Debug.Assert(enlistment.Transaction.State != null); 256Debug.Assert(enlistment.Transaction.State != null); 266Debug.Assert(enlistment.Transaction.State != null); 372Debug.Assert(enlistment.EnlistmentNotification != null); 415Debug.Assert(enlistment.EnlistmentNotification != null); 449Debug.Assert(enlistment.EnlistmentNotification != null);
System.Web.HttpUtility (4)
src\libraries\Common\src\System\HexConverter.cs (1)
165Debug.Assert(chars.Length >= bytes.Length * 2);
System\Web\Util\HttpEncoder.cs (3)
471Debug.Assert(!string.IsNullOrEmpty(str)); 472Debug.Assert(e != null); 648Debug.Assert(_byteBuffer != null);
System.Windows.Controls.Ribbon (57)
Microsoft\Windows\Controls\KeyTipAdorner.cs (1)
99Debug.Assert(_keyTipControl == null && keyTipControl.KeyTipAdorner == null);
Microsoft\Windows\Controls\KeyTipService.cs (3)
246Debug.Assert(element != null); 1116Debug.Assert(_currentGlobalScope != null); 1180Debug.Assert(_scopeStack.Count > 0);
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonGalleryCategoriesPanel.cs (1)
148Debug.Assert(IsScrolling);
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonGalleryItemsPanel.cs (1)
336Debug.Assert(maxColumnCount >= minColumnCount);
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonGroupsPanel.cs (4)
442Debug.Assert(DoubleUtil.GreaterThan(remainingSpace, 0)); 480Debug.Assert(index >= 0 && index < starInfoList.Count); 507Debug.Assert(distributionCount > 0 && distributionCount <= starInfoList.Count); 508Debug.Assert(DoubleUtil.GreaterThan(remainingSpace, 0));
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonQuickAccessToolBarPanel.cs (15)
190Debug.Assert(generatedChild != null); 315Debug.Assert(GeneratedChildren.Count > InternalChildren.Count); 317Debug.Assert(QAT.OverflowPanel.Children.Count == numItemsExpectedInOverflowPanel); 323Debug.Assert(object.ReferenceEquals(InternalChildren[j], GeneratedChildren[j])); 325Debug.Assert(currentChild != null); 326Debug.Assert(RibbonQuickAccessToolBar.GetIsOverflowItem(currentChild) == false); 327Debug.Assert(this.Children.Contains(currentChild) == true); 328Debug.Assert(QAT.OverflowPanel.Children.Contains(currentChild) == false); 329Debug.Assert(currentChild.IsVisible == this.IsVisible); 330Debug.Assert(currentChild.DesiredSize.Width > 0.0); 337Debug.Assert(object.ReferenceEquals(QAT.OverflowPanel.Children[overflowPanelIndex], GeneratedChildren[k])); 339Debug.Assert(currentChild != null); 340Debug.Assert(RibbonQuickAccessToolBar.GetIsOverflowItem(currentChild) == true); 341Debug.Assert(this.Children.Contains(currentChild) == false); 342Debug.Assert(QAT.OverflowPanel.Children.Contains(currentChild) == true);
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonTabHeadersPanel.cs (3)
250Debug.Assert(ribbon.TabDisplayIndexToIndexMap.ContainsKey(i)); 252Debug.Assert(children.Count > index && index >= 0); 736Debug.Assert(child != null);
Microsoft\Windows\Controls\Ribbon\RibbonComboBox.cs (1)
622Debug.Assert(_editableTextBoxSite == sender);
Microsoft\Windows\Controls\Ribbon\RibbonControlLengthConverter.cs (1)
235Debug.Assert(unit == RibbonControlLengthUnitType.Pixel || unit == RibbonControlLengthUnitType.Item ||
Microsoft\Windows\Controls\Ribbon\RibbonGallery.cs (6)
106Debug.Assert(_filterMenuButton.ItemContainerGenerator != null); 114Debug.Assert(_filterMenuButton.ItemContainerGenerator != null); 1488Debug.Assert(String.IsNullOrEmpty(path) || path == "/InnerText"); 2355Debug.Assert(gallery.ItemContainerGenerator.Status == GeneratorStatus.ContainersGenerated); 2652Debug.Assert(e.RoutedEvent == Mouse.MouseMoveEvent || e.RoutedEvent == Mouse.MouseLeaveEvent); 2653Debug.Assert(_localMousePosition.HasValue);
Microsoft\Windows\Controls\Ribbon\RibbonGroup.cs (1)
1179Debug.Assert(groupSizeDefinition != null && groupSizeDefinition.IsCollapsed);
Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs (7)
208Debug.Assert(property != null); 214Debug.Assert(d != null); 215Debug.Assert(property != null); 216Debug.Assert(v != null); 1004Debug.Assert(element != null); 1381Debug.Assert(starLayoutProvider != null); 2491Debug.Assert(parentItemsControl != null);
Microsoft\Windows\Controls\Ribbon\RibbonKeyTipAndContentSyncHelper.cs (5)
33Debug.Assert(element != null); 76Debug.Assert(element != null); 96Debug.Assert(element != null); 121Debug.Assert(element != null); 140Debug.Assert(element != null);
Microsoft\Windows\Controls\Ribbon\RibbonMenuButton.cs (3)
1488Debug.Assert(GetType().IsSubclassOf(type)); // RibbonMenuButton is a subclass of MenuBase 1492Debug.Assert(property != null); 1497Debug.Assert(method != null);
Microsoft\Windows\Controls\Ribbon\RibbonTab.cs (1)
459Debug.Assert(resizeStatusCount > 0);
Microsoft\Windows\Controls\Ribbon\RibbonTwoLineText.cs (2)
341Debug.Assert(_textBlock1 != null && _textBlock2 != null); 375Debug.Assert(_textBlock1 != null && _textBlock2 != null);
Microsoft\Windows\Controls\TextSearchInternal.cs (2)
808Debug.Assert(_attachedTo != null); 823Debug.Assert(_attachedTo != null);
System.Windows.Input.Manipulations (77)
System\Windows\Input\Manipulations\Exceptions.cs (12)
101Debug.Assert(paramName1 != null); 102Debug.Assert(paramName2 != null); 119Debug.Assert(paramName1 != null); 120Debug.Assert(paramName2 != null); 139Debug.Assert(paramName1 != null); 140Debug.Assert(paramName2a != null); 141Debug.Assert(paramName2b != null); 199Debug.Assert(paramName != null); 200Debug.Assert(messageFormat != null); 218Debug.Assert(paramName != null); 219Debug.Assert(paramName.Length > 0); 238Debug.Assert(format != null);
System\Windows\Input\Manipulations\InertiaParameters2D.cs (3)
30Debug.Assert(isEqual != null); 31Debug.Assert(setNewValue != null); 32Debug.Assert(paramName != null);
System\Windows\Input\Manipulations\InertiaProcessor2D.cs (33)
364Debug.Assert(!IsRunning); 417Debug.Assert(handler != null); 687Debug.Assert(!DoubleUtil.IsZero(state.InitialVelocity)); 727Debug.Assert(state.Duration >= 0); 728Debug.Assert(!double.IsNaN(state.Deceleration)); 729Debug.Assert(!double.IsNaN(state.Offset)); 747Debug.Assert(this.processorState == ProcessorState.Running); 848Debug.Assert(!DoubleUtil.IsZero(previousExpansionValue)); 907Debug.Assert(!double.IsNaN(initialVelocity) && !double.IsInfinity(initialValue)); 908Debug.Assert(!double.IsNaN(initialVelocity) && !double.IsInfinity(initialVelocity)); 909Debug.Assert(!double.IsNaN(deceleration) && !double.IsInfinity(deceleration)); 910Debug.Assert(!double.IsNaN(timeDelta) && !double.IsInfinity(timeDelta) && timeDelta >= 0); 924Debug.Assert(!double.IsNaN(timeDelta) && !double.IsInfinity(timeDelta) && timeDelta >= 0); 1020Debug.Assert(false); 1054Debug.Assert(!double.IsInfinity(value)); 1072Debug.Assert(!double.IsNaN(length) && length >= 0 && !double.IsInfinity(length)); 1073Debug.Assert(!double.IsInfinity(baseVector.X)); 1074Debug.Assert(!double.IsInfinity(baseVector.Y)); 1241Debug.Assert(initialState != null); 1242Debug.Assert(initialState.AbsoluteDeceleration >= 0 || double.IsNaN(initialState.AbsoluteDeceleration)); 1243Debug.Assert(initialState.AbsoluteOffset >= 0 || double.IsNaN(initialState.AbsoluteOffset)); 1263Debug.Assert(elapsedTimeSinceInitialTimestamp >= 0); 1275Debug.Assert(Validations.IsFinite((float)result)); 1301Debug.Assert(this.ExtrapolationResult == ExtrapolationResult.Skip); 1305Debug.Assert(!double.IsNaN(this.InitialValue) && !double.IsInfinity(this.InitialValue)); 1306Debug.Assert(!double.IsNaN(this.InitialVelocity) && !double.IsInfinity(this.InitialVelocity)); 1307Debug.Assert(!double.IsNaN(this.Offset)); // can be infinity 1308Debug.Assert(!double.IsNaN(this.AbsoluteDeceleration) && this.AbsoluteDeceleration >= 0 && !double.IsInfinity(this.InitialVelocity)); 1309Debug.Assert(!double.IsNaN(this.Duration) && this.Duration >= 0); // can be infinity 1310Debug.Assert(!double.IsNaN(this.FinalValue)); // can be infinity 1349Debug.Assert(!double.IsNaN(value) && !double.IsInfinity(value)); 1350Debug.Assert(!double.IsNaN(delta) && !double.IsInfinity(delta)); 1351Debug.Assert(!double.IsNaN(total) && !double.IsInfinity(total));
System\Windows\Input\Manipulations\Lazy.cs (1)
32Debug.Assert(getValue != null);
System\Windows\Input\Manipulations\Manipulation2DStartedEventArgs.cs (2)
43Debug.Assert(Validations.IsFinite(originX)); 44Debug.Assert(Validations.IsFinite(originY));
System\Windows\Input\Manipulations\ManipulationPivot2D.cs (1)
142Debug.Assert(processor != null);
System\Windows\Input\Manipulations\ManipulationProcessor2D.cs (3)
330Debug.Assert(sender != null); 353Debug.Assert(object.ReferenceEquals(sender, this.currentManipulation)); 367Debug.Assert(object.ReferenceEquals(sender, this.currentManipulation));
System\Windows\Input\Manipulations\ManipulationSequence.cs (16)
279Debug.Assert(!float.IsNaN(result) && !float.IsInfinity(result)); 599Debug.Assert(this.log.Length > 0); // makes a good breakpoint to read the log 758Debug.Assert(!double.IsNaN(value)); 802Debug.Assert(this.manipulatorStates != null); 836Debug.Assert(!float.IsNaN(smoothedRotation) && !float.IsInfinity(smoothedRotation)); 842Debug.Assert(!float.IsNaN(smoothedExpansion) && !float.IsInfinity(smoothedExpansion)); 848Debug.Assert(!float.IsNaN(smoothedScale) && !float.IsInfinity(smoothedScale)); 1017Debug.Assert(this.manipulatorStates != null && this.manipulatorStates.Count > 0); 1038Debug.Assert(this.manipulatorStates != null && this.manipulatorStates.Count > 0); 1077Debug.Assert(queue != null); 1139Debug.Assert(queue != null); 1554Debug.Assert(!float.IsNaN(position.X) && !float.IsNaN(position.Y)); 1555Debug.Assert(!float.IsInfinity(position.Y) && !float.IsInfinity(position.Y)); 1556Debug.Assert(!float.IsNaN(scale) && !float.IsInfinity(scale) && scale > 0); 1557Debug.Assert(!float.IsNaN(expansion) && !float.IsInfinity(expansion)); 1558Debug.Assert(!float.IsNaN(orientation) && !float.IsInfinity(orientation));
System\Windows\Input\Manipulations\ManipulationVelocities2D.cs (4)
88Debug.Assert(Validations.IsFinite(linearVelocityX)); 89Debug.Assert(Validations.IsFinite(linearVelocityY)); 90Debug.Assert(Validations.IsFinite(angularVelocity)); 91Debug.Assert(Validations.IsFinite(expansionVelocity));
System\Windows\Input\Manipulations\Validations.cs (2)
31Debug.Assert(paramName != null); 55Debug.Assert(paramName != null);
System.Xaml (117)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SafeSecurityHelper.cs (1)
388Debug.Assert(target != null);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Context\XamlContextStack.cs (5)
30Debug.Assert(CurrentFrame != null); 31Debug.Assert(CurrentFrame.Depth == Depth); 89Debug.Assert(iteratorFrame != null); 113Debug.Assert(CurrentFrame.Depth == Depth); 126Debug.Assert(CurrentFrame.Depth == Depth);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Utility\FrugalList.cs (2)
1279Debug.Assert(collection is not null); 1287Debug.Assert(collection is not null);
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlCompatibilityReader.cs (1)
341Debug.Assert(Scope.ShouldProcessContent(namespaceName, Reader.LocalName));
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlWrappingReader.cs (1)
33Debug.Assert( baseReader != null );
System\Xaml\Context\ContextServices.cs (1)
19Debug.Assert(xamlContext.ParentProperty != null);
System\Xaml\Context\NameFixupGraph.cs (8)
61Debug.Assert(fixupToken.Target.Instance == null && 64Debug.Assert(_deferredRootProvideValue == null); 74Debug.Assert(parentObject != null); 80Debug.Assert(fixupToken.FixupType == FixupType.UnresolvedChildren || 84Debug.Assert(!_dependenciesByChildObject.ContainsKey(fixupToken.ReferencedObject)); 90Debug.Assert(fixupToken.FixupType != FixupType.UnresolvedChildren && 438Debug.Assert(outEdge.FixupType == FixupType.UnresolvedChildren); 451Debug.Assert(parentDependencies.Contains(token));
System\Xaml\Context\NameFixupToken.cs (1)
131Debug.Assert(_runtime == null);
System\Xaml\Context\ObjectWriterContext.cs (6)
141Debug.Assert(!_nameResolutionComplete || value); 424Debug.Assert(frame != null); 465Debug.Assert(frame != null); 832Debug.Assert(frame.NameScopeDictionary != null || frame.Depth == 0); 846Debug.Assert(nameScopeDictionary != null); 878Debug.Assert(rootFrame.Depth == 1);
System\Xaml\Context\XamlContext.cs (1)
261Debug.Assert(typeName.Namespace != null);
System\Xaml\InfosetObjects\DeferredWriter.cs (2)
148Debug.Assert(!property.IsDirective && !property.IsUnknown); 199Debug.Assert(_deferredTreeDepth == 0);
System\Xaml\InfosetObjects\XamlObjectWriter.cs (19)
399Debug.Assert(_context.CurrentProperty.DeferringLoader != null); 428Debug.Assert(_context.LiveDepth > 0); 504Debug.Assert(_context.LiveDepth > 1); 609Debug.Assert(_context.LiveDepth > 0); 818Debug.Assert(_context.CurrentProperty.DeferringLoader != null); 1173Debug.Assert(inst != null); // runtime throws before it returns null. 1401Debug.Assert(ctx.ParentProperty == XamlLanguage.Key); 1612Debug.Assert(inst == ctx.ParentInstance); 1699Debug.Assert(parentInstance != null || parentProperty != null && parentProperty.IsDirective || ctx.LiveDepth == 1); 1743Debug.Assert(ctx.LiveDepth > 1); 1876Debug.Assert(ctx.CurrentProperty == null); 2085Debug.Assert(token.Target.Property == XamlLanguage.Key); 2339Debug.Assert(!_inNameResolution); 2342Debug.Assert(_nameFixupGraph != null); 2430Debug.Assert(token.NeededNames.Count == 0 || nameResolutionIsComplete); 2525Debug.Assert(token.FixupType == FixupType.MarkupExtensionFirstRun && _lastInstance == token.ReferencedObject); 2553Debug.Assert(token.Target.KeyHolder.Key == token); 2562Debug.Assert(pendingAdd.Key == token); 2572Debug.Assert(pendingAdd.Item == token);
System\Xaml\Parser\GenericTypeNameParser.cs (4)
169Debug.Assert(_scanner.Token == GenericTypeNameScannerToken.NAME); 199Debug.Assert(_scanner.Token == GenericTypeNameScannerToken.OPEN); 230Debug.Assert(_scanner.Token == GenericTypeNameScannerToken.COMMA); 241Debug.Assert(_scanner.Token == GenericTypeNameScannerToken.SUBSCRIPT);
System\Xaml\Parser\GenericTypeNameScanner.cs (3)
298Debug.Assert(_multiCharTokenStartIdx == -1 && _multiCharTokenLength == 0); 306Debug.Assert(_multiCharTokenStartIdx != -1 && _multiCharTokenLength > 0); 359Debug.Assert(KnownStrings.WhitespaceChars.Length == 5);
System\Xaml\Parser\MeScanner.cs (1)
552Debug.Assert(KnownStrings.WhitespaceChars.Length == 5);
System\Xaml\Parser\NodeStreamSorter.cs (5)
553Debug.Assert(deepestIdx != -1); 561Debug.Assert(_sortingInfoArray[start].XamlNodeType == XamlNodeType.StartMember); 587Debug.Assert(_sortingInfoArray[current].XamlNodeType == XamlNodeType.StartMember); 607Debug.Assert(_sortingInfoArray[current].XamlNodeType == XamlNodeType.StartMember); 655Debug.Assert(length1 > 0 && length2 > 0);
System\Xaml\Parser\XamlScanner.cs (4)
248Debug.Assert(_xmlReader.NodeType == XmlNodeType.Element); 284Debug.Assert(_xmlReader.NodeType == XmlNodeType.Element); 426Debug.Assert(_xmlReader.NodeType == XmlNodeType.Element); 773Debug.Assert(prop.IsUnknown);
System\Xaml\Parser\XamlScannerStack.cs (2)
77Debug.Assert(_stack.Count != 0); 87Debug.Assert(_stack.Count != 0);
System\Xaml\Parser\XamlText.cs (2)
264Debug.Assert(start > 0); 265Debug.Assert(end < text.Length);
System\Xaml\Runtime\DynamicMethodRuntime.cs (2)
131Debug.Assert(schemaContext != null); 132Debug.Assert(accessLevel != null);
System\Xaml\Schema\Reflector.cs (3)
252Debug.Assert(attributeType == typeof(XamlDeferLoadAttribute)); 253Debug.Assert(count == 2); 358Debug.Assert(value || (bitMask & bitToSet) == 0);
System\Xaml\Schema\TypeReflector.cs (2)
347Debug.Assert(!IsUnknown); 1106Debug.Assert(value);
System\Xaml\Schema\XamlDirective.cs (2)
25Debug.Assert(immutableXamlNamespaces is not null); 28Debug.Assert(ns is not null);
System\Xaml\Schema\XamlNamespace.cs (3)
160Debug.Assert(typeArgs[n] != null); 161Debug.Assert(typeArgs[n].UnderlyingType != null); 180Debug.Assert(_assemblyNamespaces.Count == 1);
System\Xaml\XamlBackgroundReader.cs (1)
154Debug.Assert(XamlNode.IsEof_Helper(nodeType, data));
System\Xaml\XamlMember.cs (1)
1018Debug.Assert(xamlMember2.IsDirective);
System\Xaml\XamlNodeList.cs (1)
79Debug.Assert(XamlNode.IsEof_Helper(nodeType, data));
System\Xaml\XamlNodeQueue.cs (1)
71Debug.Assert(XamlNode.IsEof_Helper(nodeType, data));
System\Xaml\XamlObjectReader.cs (2)
301Debug.Assert(false); //should never reach here 1766Debug.Assert(Object != null);
System\Xaml\XamlType.cs (4)
1185Debug.Assert(typeArgs.Length == 1); 1225Debug.Assert(typeArgs.Length == 1); 1804Debug.Assert(xamlType1.IsUnknown); 1805Debug.Assert(xamlType2.IsUnknown);
System\Xaml\XamlXmlWriter.cs (26)
343Debug.Assert(writer.namespaceScopes.Peek().AllocatingNodeType == XamlNodeType.StartMember); 383Debug.Assert(ns != null); 384Debug.Assert(prefix != null); 502Debug.Assert(objectFrame.AllocatingNodeType == XamlNodeType.StartObject || 524Debug.Assert(frame.AllocatingNodeType == nodeType); 803Debug.Assert(writer.namespaceScopes.Count > 1); 806Debug.Assert(frame.AllocatingNodeType == XamlNodeType.StartMember); 821Debug.Assert(writer.namespaceScopes.Count > 1); 824Debug.Assert(frame.AllocatingNodeType == XamlNodeType.StartMember); 942Debug.Assert(writer.namespaceScopes.Count == 1); 989Debug.Assert(writer.namespaceScopes.Count > 0); 1075Debug.Assert(writer.namespaceScopes.Count > 0); 1147Debug.Assert(writer.namespaceScopes.Count > 0); 1148Debug.Assert(writer.namespaceScopes.Peek().AllocatingNodeType == XamlNodeType.StartObject || 1225Debug.Assert(writer.namespaceScopes.Count > 0); 1353Debug.Assert(writer.namespaceScopes.Count > 0); 1418Debug.Assert(writer.namespaceScopes.Count > 0); 1420Debug.Assert(memberFrame.AllocatingNodeType == XamlNodeType.StartMember || 1551Debug.Assert(writer.namespaceScopes.Count > 0); 1553Debug.Assert(memberFrame.AllocatingNodeType == XamlNodeType.StartMember || 1740Debug.Assert(value != null); 1885Debug.Assert(frame.AllocatingNodeType == XamlNodeType.StartObject); 1888Debug.Assert(objectXamlType != null); 1929Debug.Assert(member != null); 2055Debug.Assert(writer.ppStateInfo.CurrentDepth != 0); 2056Debug.Assert(writer.ppStateInfo.NodesList.Count != 0);
Templates.Blazor.Tests (1)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
574Debug.Assert(pemEnvelope != null);
Templates.Blazor.WebAssembly.Auth.Tests (1)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
574Debug.Assert(pemEnvelope != null);
Templates.Blazor.WebAssembly.Tests (1)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
574Debug.Assert(pemEnvelope != null);
Templates.Mvc.Tests (1)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
574Debug.Assert(pemEnvelope != null);
Templates.Tests (1)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
574Debug.Assert(pemEnvelope != null);
UIAutomationClient (10)
MS\Internal\Automation\HwndProxyElementProvider.cs (1)
48Debug.Assert( hwnd != NativeMethods.HWND.NULL );
MS\Internal\Automation\SelectionPatternProviderSideWrapper.cs (1)
28Debug.Assert(target != null);
MS\Internal\Automation\UiaCoreApi.cs (1)
460Debug.Assert(offsets.Length == treeStructures.Length);
System\Windows\Automation\AutomationElement.cs (1)
768Debug.Assert(responses.Length == 1);
System\Windows\Automation\BasePattern.cs (1)
29Debug.Assert(el != null);
System\Windows\Automation\CacheRequest.cs (1)
552Debug.Assert( _request != null );
System\Windows\Automation\Text\TextRange.cs (2)
64Debug.Assert(!hTextRange.IsInvalid); 65Debug.Assert(pattern != null);
System\Windows\Automation\TextPattern.cs (2)
35Debug.Assert(el != null); 36Debug.Assert(!hPattern.IsInvalid);
UIAutomationClientSideProviders (38)
MS\Internal\AutomationProxies\Accessible.cs (7)
324Debug.Assert(parent != null); 335Debug.Assert(false); 351Debug.Assert(parent != null); 362Debug.Assert(false); 752Debug.Assert(_idChild == NativeMethods.CHILD_SELF); 799Debug.Assert(false); 1011Debug.Assert(_accessibleChildrenIndex < 0);
MS\Internal\AutomationProxies\CommonXSendMessage.cs (1)
96System.Diagnostics.Debug.Assert(remoteTextArea.ToInt32() == remoteTextArea.ToInt64());
MS\Internal\AutomationProxies\Misc.cs (2)
1993Debug.Assert(System.Environment.OSVersion.Version.Major < 6); 2064Debug.Assert(System.Environment.OSVersion.Version.Major >= 6);
MS\Internal\AutomationProxies\MSAAEventDispatcher.cs (2)
127Debug.Assert(refcount >= 0); 364Debug.Assert(eventId == NativeMethods.EVENT_OBJECT_REORDER);
MS\Internal\AutomationProxies\MSAANativeProvider.cs (5)
58Debug.Assert(hwnd != IntPtr.Zero); 230Debug.Assert(_hwnd == UnsafeNativeMethods.WindowFromPhysicalPoint((int)x, (int)y)); 346Debug.Assert(false); 1030Debug.Assert(!IsRoot); 1083Debug.Assert(_hwnd != IntPtr.Zero);
MS\Internal\AutomationProxies\WindowsEditBox.cs (4)
519Debug.Assert(!IsMultiline); 526Debug.Assert(IsMultiline); 964Debug.Assert(floor >= 0); 975Debug.Assert(i >= floor);
MS\Internal\AutomationProxies\WindowsEditBoxRange.cs (1)
46Debug.Assert(provider != null);
MS\Internal\AutomationProxies\WindowsListView.cs (1)
1965System.Diagnostics.Debug.Assert(el is ListViewItemCheckbox);
MS\Internal\AutomationProxies\WindowsRichEdit.cs (4)
231Debug.Assert(_document != null); 271Debug.Assert(_document != null); 278Debug.Assert(range.Start == range.End); 314Debug.Assert(_document != null);
MS\Internal\AutomationProxies\WindowsRichEditRange.cs (11)
28Debug.Assert(range != null); 29Debug.Assert(pattern != null); 248Debug.Assert(text == null || text.Length == maxLength); 1124Debug.Assert(charMoved == 0 || charMoved == 1); 1127Debug.Assert(paraMoved == 0 || paraMoved == 1); 1153Debug.Assert(charMoved == 0 || charMoved == -1); 1156Debug.Assert(paraMoved == 0 || paraMoved == -1); 1182Debug.Assert(charMoved == 0 || charMoved == 1); 1185Debug.Assert(paraMoved == 0 || paraMoved == 1); 1211Debug.Assert(charMoved == 0 || charMoved == -1); 1214Debug.Assert(paraMoved == 0 || paraMoved == -1);
UIAutomationTypes (2)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\NativeMethodsOther.cs (1)
41Debug.Assert((0xFFFF0000 & errorCode) == 0);
System\Windows\Automation\AutomationIdentifier.cs (1)
49Debug.Assert(id != 0);
WindowsFormsIntegration (1)
System\Windows\Integration\ApplicationInterop.cs (1)
219Debug.Assert(windowFilter != null);
xunit.console (1)
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\DependencyContextLoader.cs (1)
97Debug.Assert(_fileSystem.File.Exists(location));