28758 references to Debug
ClientSample (6)
Tcp\SocketAwaitable.cs (1)
36Debug.Assert(ReferenceEquals(_callback, _callbackCompleted));
Tcp\SocketSender.cs (2)
82Debug.Assert(!buffer.IsEmpty); 83Debug.Assert(!buffer.IsSingleSegment);
UploadSample.cs (3)
55Debug.WriteLine($"You message was: {result}"); 66Debug.WriteLine(result); 101Debug.WriteLine($"received '{item}'.");
CodeGenerator (7)
HttpUtilities\HttpUtilities.cs (1)
308Debug.Assert(str.Length == sizeof(ulong), string.Format(CultureInfo.InvariantCulture, "String must be exactly {0} (ASCII) characters long.", sizeof(ulong)));
src\Servers\Kestrel\shared\KnownHeaders.cs (4)
773Debug.Assert(requestHeaders.Length <= 64); 774Debug.Assert(requestHeaders.Max(x => x.Index) <= 62); 778Debug.Assert(responseHeaders.Length <= 63); 779Debug.Assert(responseHeaders.Count(x => x.Index == 63) == 1);
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http3\QPack\HeaderField.cs (1)
17Debug.Assert(name.Length > 0);
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 (45)
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (4)
177Debug.Fail("HPACK decoder reach an invalid state"); 244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (19)
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); 603Debug.Assert(success, $"Stack-allocated space was too small for index '{index}'."); 615Debug.Assert(success, $"Stack-allocated space was too small for \"{name}\".");
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (2)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8); 40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
246Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
223Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload 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);
IIS.FunctionalTests (45)
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (4)
177Debug.Fail("HPACK decoder reach an invalid state"); 244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (19)
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); 603Debug.Assert(success, $"Stack-allocated space was too small for index '{index}'."); 615Debug.Assert(success, $"Stack-allocated space was too small for \"{name}\".");
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (2)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8); 40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
246Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
223Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload 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);
IIS.LongTests (45)
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (4)
177Debug.Fail("HPACK decoder reach an invalid state"); 244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (19)
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); 603Debug.Assert(success, $"Stack-allocated space was too small for index '{index}'."); 615Debug.Assert(success, $"Stack-allocated space was too small for \"{name}\".");
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (2)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8); 40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
246Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
223Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload 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);
IIS.NewHandler.FunctionalTests (45)
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (4)
177Debug.Fail("HPACK decoder reach an invalid state"); 244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (19)
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); 603Debug.Assert(success, $"Stack-allocated space was too small for index '{index}'."); 615Debug.Assert(success, $"Stack-allocated space was too small for \"{name}\".");
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (2)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8); 40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
246Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
223Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload 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);
IIS.NewShim.FunctionalTests (45)
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (4)
177Debug.Fail("HPACK decoder reach an invalid state"); 244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (19)
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); 603Debug.Assert(success, $"Stack-allocated space was too small for index '{index}'."); 615Debug.Assert(success, $"Stack-allocated space was too small for \"{name}\".");
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (2)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8); 40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
246Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
223Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload 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);
IIS.ShadowCopy.Tests (15)
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
246Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
223Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload 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);
IISExpress.FunctionalTests (45)
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (4)
177Debug.Fail("HPACK decoder reach an invalid state"); 244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (19)
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); 603Debug.Assert(success, $"Stack-allocated space was too small for index '{index}'."); 615Debug.Assert(success, $"Stack-allocated space was too small for \"{name}\".");
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (2)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8); 40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
246Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
223Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload 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);
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 (206)
ILLink.RoslynAnalyzer (87)
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 (24)
103 Debug.Assert (OwningSymbol is IMethodSymbol or IFieldSymbol or IPropertySymbol, 111 Debug.Assert (OwningSymbol is IMethodSymbol, 176 Debug.Assert (assemblyType != null); 180 Debug.Assert (method != null); 204 Debug.Assert (local.ContainingSymbol is IMethodSymbol or IFieldSymbol, // backing field for property initializers 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); 451 Debug.Assert (!IsLValueFlowCapture (operation.Id), 453 Debug.Assert (operation.GetValueUsageInfo (OwningSymbol).HasFlag (ValueUsageInfo.Read), 472 Debug.Assert (operation.GetValueUsageInfo (OwningSymbol).HasFlag (ValueUsageInfo.Write), 474 Debug.Assert (operation.GetValueUsageInfo (OwningSymbol).HasFlag (ValueUsageInfo.Reference), 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\LValueFlowCaptureProvider.cs (1)
80 Debug.Assert (kind == FlowCaptureKind.LValueAndRValueCapture || !rvalueFlowCaptureIds.Contains (captureId), "Flow capture used as both an r-value and an l-value, but with incorrect flow capture kind");
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 (2)
100 Debug.Fail ("Unhandled declaration pattern context"); 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 (4)
86 Debug.Assert (requiresDataFlowAnalysis || annotatedMethodReturnValue.DynamicallyAccessedMemberTypes == DynamicallyAccessedMemberTypes.None); 90 Debug.Assert (instanceValue.IsEmpty ()); 91 Debug.Assert (argumentValues.Count == 1); 399 Debug.Fail ("Unreachable.");
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\MethodReturnValue.cs (1)
22 Debug.Assert (!isNewObj || methodSymbol.MethodKind == MethodKind.Constructor, "isNewObj can only be true for constructors");
TrimAnalysis\ParameterProxy.cs (1)
31 Debug.Fail ($"Unexpected RefKind {Method.Method.Parameters[MetadataIndex].RefKind} found on parameter {GetDisplayName ()}");
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\TrimAnalysisPatternStore.cs (1)
103 Debug.Assert (existingPattern == pattern, "Return values should be identical");
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);
TrimAnalysis\TrimDataFlowAnalysis.cs (2)
136 Debug.WriteLine (tracingInfo); 154 Debug.Write (tracingInfo);
InMemory.FunctionalTests (12)
Http2\Http2TestBase.cs (2)
430Debug.Assert(index <= H2StaticTable.Count); 438Debug.Assert(index <= H2StaticTable.Count);
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (2)
122Debug.Assert(streamId == 0 || streamId == -1, "StreamId sent that was non-zero, which isn't handled by tests"); 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\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
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.Common (4)
src\Common\Internal\AssemblyResolver.cs (4)
45Debug.WriteLine($"Considering {probingPath} based on RequestingAssembly"); 58Debug.WriteLine($"Considering {probingPath} based on ExecutingAssembly"); 67Debug.WriteLine($"Considering {probingPath} based on BaseDirectory"); 74Debug.WriteLine($"Considering {fileName}");
Microsoft.Arcade.Test.Common (2)
DiffUtil.cs (2)
198Debug.Assert(lengthA >= 0 && lengthB >= 0); 212Debug.Assert(lcsLength <= max);
Microsoft.AspNetCore (6)
BootstrapHostBuilder.cs (1)
111Debug.Assert(descriptor.ImplementationType?.Name == "GenericWebHostService");
WebApplicationBuilder.cs (5)
82Debug.Assert(slim, "should only be called with slim: true"); 148Debug.Assert(!slim, "should only be called with slim: false"); 149Debug.Assert(empty, "should only be called with empty: true"); 391Debug.Assert(_builtApplication is not null); 495Debug.Assert(_builtApplication is not null);
Microsoft.AspNetCore.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 (81)
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 (13)
76Debug.Assert(expectedValueText == actualValueText); 82Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 86Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 95Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 104Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 114Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 118Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 132Debug.Assert(!token.ContainsDiagnostics); 136Debug.Assert(startDelimiter == ""); 137Debug.Assert(endDelimiter == ""); 144Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 150Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 218Debug.Assert(char.IsSurrogate(ch));
Infrastructure\VirtualChars\CSharpVirtualCharService.cs (18)
58Debug.Assert(!token.ContainsDiagnostics); 250Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 256Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 341Debug.Assert(char.IsSurrogate(ch)); 351Debug.Assert(tokenText[index] == '\\'); 364Debug.Assert(tokenText[index] == '\\'); 397Debug.Assert(tokenText[index] == '\\'); 407Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 416Debug.Assert(tokenText[index] == '\\'); 427Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 436Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 447Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 461Debug.Assert(uintChar is > 0x0000FFFF and <= 0x0010FFFF); 479Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 488Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 501Debug.Assert(character == 'x'); 507Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 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);
RouteHandlers\DetectMisplacedLambdaAttribute.cs (1)
30Debug.Fail("Expected a single top-level BlockOperation for all lambdas.");
src\Shared\Diagnostics\AnalyzerDebug.cs (4)
12/// <inheritdoc cref="Debug.Assert(bool)"/> 14public static void Assert([DoesNotReturnIf(false)] bool b) => Debug.Assert(b); 16/// <inheritdoc cref="Debug.Assert(bool, string)"/> 19=> Debug.Assert(b, message);
src\Shared\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));
src\Shared\RoslynUtils\WellKnownTypes.cs (1)
46Debug.Assert(name == typeIdName, $"Enum name ({typeIdName}) and type name ({name}) must match at {i}");
Microsoft.AspNetCore.App.CodeFixes (2)
Authorization\AddAuthorizationBuilderFixer.cs (2)
76Debug.Assert(false, "AddAuthorizationBuilderAnalyzer should not have emitted a diagnostic."); 110Debug.Assert(false, "AddAuthorizationBuilderAnalyzer should not have emitted a diagnostic.");
Microsoft.AspNetCore.Authentication (1)
RemoteAuthenticationHandler.cs (1)
145Debug.Assert(ticket != null);
Microsoft.AspNetCore.Authentication.Cookies (1)
CookieAuthenticationHandler.cs (1)
212Debug.Assert(result.Ticket != null);
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (1)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
47Debug.Assert(tfms.Length > 0);
Microsoft.AspNetCore.Authentication.Negotiate (5)
Internal\LdapAdapter.cs (1)
47Debug.Assert(settings.LdapConnection != null);
NegotiateHandler.cs (3)
140Debug.Assert(exception != null); 209Debug.Assert(object.ReferenceEquals(persistence?.State, _negotiateState), 401Debug.Assert(!items.ContainsKey(AuthPersistenceKey), "This should only be registered once per connection");
PostConfigureNegotiateOptions.cs (1)
49Debug.Assert(_serverAuth.AuthenticationScheme != null);
Microsoft.AspNetCore.Authentication.Test (3)
OpenIdConnect\TestSettings.cs (3)
76Debug.WriteLine(buf.ToString()); 114Debug.WriteLine(buf.ToString()); 153Debug.WriteLine(buf.ToString());
Microsoft.AspNetCore.Components (45)
Rendering\RenderTreeBuilder.cs (2)
790Debug.Assert(_hasSeenAddMultipleAttributes); 812Debug.Assert(frame.FrameTypeField == RenderTreeFrameType.Attribute, $"Frame type is {frame.FrameTypeField} at {i}");
RenderTree\Renderer.cs (2)
282Debug.Assert(_pendingTasks == null); 339Debug.Assert(_pendingTasks is null || _pendingTasks.Count == 0);
RenderTree\RenderTreeDiffBuilder.cs (1)
174Debug.Assert(action switch
Routing\SupplyParameterFromQueryValueProvider.cs (3)
54Debug.Assert(_subscribers is not null); 96Debug.Assert(url is not null); 126Debug.Assert(_subscribers is not null);
src\Components\Shared\src\ArrayBuilder.cs (1)
180Debug.Assert(newCapacity > _items.Length);
src\Http\Http.Abstractions\src\Routing\RouteValueDictionary.cs (1)
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 (9)
111Debug.Assert(pathSegment != null); 168Debug.Assert(pathSegment != null); 169Debug.Assert(pathSegment.IsSimple); 172Debug.Assert(part.IsParameter); 240Debug.Assert(!pathSegment.IsSimple); 338Debug.Assert(routeSegment != null); 339Debug.Assert(routeSegment.Parts.Count > 1); 361Debug.Assert(part.IsLiteral || part.IsSeparator); 434Debug.Assert(false, "indexOfLastSegementUsed should always be 0 from the check above");
src\Http\Routing\src\Patterns\RoutePatternParser.cs (8)
51Debug.Assert(context.AtEnd() || context.Current == Separator); 73Debug.Assert(context != null); 74Debug.Assert(segments != null); 145Debug.Assert(context.Current == OpenBrace); 445Debug.Assert(context != null); 446Debug.Assert(literal != null); 485Debug.Assert(template != null); 526Debug.Assert(_index >= 0);
src\Http\Routing\src\Patterns\RoutePatternSeparatorPart.cs (1)
39Debug.Assert(!string.IsNullOrEmpty(content));
src\Http\Routing\src\Template\RoutePrecedence.cs (3)
69Debug.Assert(digit >= 0 && digit < 10); 125Debug.Assert(digit >= 0 && digit < 10); 191Debug.Assert(parameterPart != null);
src\Http\Routing\src\Tree\TreeEnumerator.cs (1)
94Debug.Assert(next.Depth < _tokenizer.Count);
src\Http\Routing\src\Tree\UrlMatchingTree.cs (2)
98Debug.Assert(segment.Parts.Count == 1); 231Debug.Fail("We shouldn't get here.");
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 (26)
BlazorPack\SequenceOfT.cs (3)
168Debug.Assert(last != null, "Cannot advance before acquiring memory."); 407Debug.Assert(segment != null, "Null not allowed."); 433Debug.Assert(offset >= this.Start, "Trying to rewind.");
Circuits\CircuitRegistry.cs (2)
133Debug.Assert(result, "This operation operates inside of a lock. We expect the previously inspected value to be still here."); 276Debug.Fail($"Unexpected {nameof(EvictionReason)} {reason}");
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);
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\MessagePackReader.cs (1)
228Debug.Fail("Missing handler for code: " + code);
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequenceReader.cs (9)
263Debug.Assert(this.usingSequence, "usingSequence"); 270Debug.Assert(this.usingSequence, "usingSequence"); 305Debug.Assert(this.usingSequence, "usingSequence"); 365Debug.Assert(count >= 0, "count >= 0"); 382Debug.Assert(count >= 0, "count >= 0"); 387Debug.Assert(this.CurrentSpanIndex < this.CurrentSpan.Length, "this.CurrentSpanIndex < this.CurrentSpan.Length"); 408Debug.Assert(this.usingSequence, "usingSequence"); 430Debug.Assert(count >= 0, "count >= 0"); 474Debug.Assert(firstSpan.Length < destination.Length, "firstSpan.Length < destination.Length");
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequenceReaderExtensions.cs (1)
72Debug.Assert(reader.UnreadSpan.Length < sizeof(T), "reader.UnreadSpan.Length < sizeof(T)");
Microsoft.AspNetCore.Components.Server.Tests (2)
src\SignalR\common\SignalR.Common\test\Internal\Protocol\MessagePackHubProtocolTestBase.cs (2)
465Debug.Assert(size < 16, "Test code doesn't support array sizes greater than 15"); 472Debug.Assert(size < 16, "Test code doesn't support string sizes greater than 15");
Microsoft.AspNetCore.Components.Web (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.WebAssembly (2)
HotReload\WebAssemblyHotReload.cs (1)
50Interlocked.CompareExchange(ref _hotReloadAgent, new HotReloadAgent(m => Debug.WriteLine(m)), null);
Services\WebAssemblyConsoleLogger.cs (1)
95Debug.Assert(logLevel != LogLevel.None, "This method is never called with LogLevel.None.");
Microsoft.AspNetCore.Components.WebView (1)
src\Components\Shared\src\ArrayBuilder.cs (1)
180Debug.Assert(newCapacity > _items.Length);
Microsoft.AspNetCore.CookiePolicy (1)
ResponseCookiesWrapper.cs (1)
98Debug.Assert(key != null);
Microsoft.AspNetCore.Cryptography.Internal (6)
CryptoUtil.cs (1)
61Debug.Fail(message);
SafeHandles\BCryptAlgorithmHandle.cs (1)
45Debug.Assert(pbKey != null);
UnsafeNativeMethods.cs (1)
479Debug.Assert(lastError != 0, "This method should only be called if there was an error.");
WeakReferenceHelpers.cs (3)
38Debug.Assert(newTarget != null); 41Debug.Assert(newWeakRef != null); 53Debug.Assert(currentWeakRef != null);
Microsoft.AspNetCore.Cryptography.KeyDerivation (17)
PBKDF2\ManagedPbkdf2Provider.cs (5)
19Debug.Assert(password != null); 20Debug.Assert(salt != null); 21Debug.Assert(iterationCount > 0); 22Debug.Assert(numBytesRequested > 0); 96Debug.Assert(src.Length == dest.Length);
PBKDF2\NetCorePbkdf2Provider.cs (4)
19Debug.Assert(password != null); 20Debug.Assert(salt != null); 21Debug.Assert(iterationCount > 0); 22Debug.Assert(numBytesRequested > 0);
PBKDF2\Win7Pbkdf2Provider.cs (4)
18Debug.Assert(password != null); 19Debug.Assert(salt != null); 20Debug.Assert(iterationCount > 0); 21Debug.Assert(numBytesRequested > 0);
PBKDF2\Win8Pbkdf2Provider.cs (4)
20Debug.Assert(password != null); 21Debug.Assert(salt != null); 22Debug.Assert(iterationCount > 0); 23Debug.Assert(numBytesRequested > 0);
Microsoft.AspNetCore.DataProtection (48)
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 (4)
135Debug.Assert(_descriptorException is null); // Mutually exclusive with _descriptor 151Debug.Assert(_descriptorFactory is not null, "Key constructed without either descriptor or descriptor factory"); 171Debug.Fail("ResetDescriptor called with descriptor available"); 172Debug.Assert(_descriptorException is null); // Mutually exclusive with _descriptor
KeyManagement\KeyRingBasedDataProtector.cs (6)
35Debug.Assert(keyRingProvider != null); 188Debug.Assert(protectedData != null); 299Debug.Assert(success, "Failed to write Guid."); 331Debug.Assert(ms.Position == sizeof(uint)); 338Debug.Assert(purpose != null); 356Debug.Assert(existingTemplate.Length >= sizeof(uint) /* MAGIC_HEADER */ + sizeof(Guid) /* keyId */);
KeyManagement\KeyRingProvider.cs (10)
173Debug.Assert(defaultKey != null); 176Debug.Assert(defaultKey.CreateEncryptor() != null); 228Debug.Assert(utcNow.Kind == DateTimeKind.Utc); 312Debug.Assert(existingCacheableKeyRing != null); 328Debug.Assert(utcNow.Kind == DateTimeKind.Utc); 387Debug.Assert(taskKeyRing is not null, "How did _cacheableKeyRingTask change while we were holding the lock?"); 395Debug.Assert(!forceRefresh, "Consumed cached key ring even though forceRefresh is true"); 396Debug.Assert(!CacheableKeyRing.IsValid(existingCacheableKeyRing, utcNow), "Should have returned a valid cached key ring above"); 446Debug.Assert(task.IsCompleted); 447Debug.Assert(!task.IsCanceled, "How did a task with no cancellation token get canceled?");
KeyManagement\XmlKeyManager.cs (10)
261Debug.Assert(_cacheExpirationTokenSource != null, $"{nameof(TriggerAndResetCacheExpirationToken)} must have been called first."); 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 (4)
CryptoUtil.cs (1)
21Debug.Fail(message);
DataProtectionCommonExtensions.cs (1)
53Debug.Assert(retVal is IDataProtector); // CreateProtector is supposed to return an instance of this interface
src\Shared\WebEncoders\WebEncoders.cs (2)
111Debug.Assert(arraySizeRequired % 4 == 0, "Invariant: Array length must be a multiple of 4."); 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 (12)
src\Shared\Diagnostics\AnalyzerDebug.cs (4)
12/// <inheritdoc cref="Debug.Assert(bool)"/> 14public static void Assert([DoesNotReturnIf(false)] bool b) => Debug.Assert(b); 16/// <inheritdoc cref="Debug.Assert(bool, string)"/> 19=> Debug.Assert(b, message);
src\Shared\Diagnostics\BaseView.cs (3)
110Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 118Debug.Assert(AttributeValues != null); 119Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
src\Shared\RazorViews\BaseView.cs (3)
150Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 158Debug.Assert(AttributeValues != null); 159Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
198Debug.Assert(method != null); 199Debug.Assert(method.DeclaringType != null);
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (10)
src\Shared\Diagnostics\AnalyzerDebug.cs (4)
12/// <inheritdoc cref="Debug.Assert(bool)"/> 14public static void Assert([DoesNotReturnIf(false)] bool b) => Debug.Assert(b); 16/// <inheritdoc cref="Debug.Assert(bool, string)"/> 19=> Debug.Assert(b, message);
src\Shared\Diagnostics\BaseView.cs (3)
110Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 118Debug.Assert(AttributeValues != null); 119Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
src\Shared\RazorViews\BaseView.cs (3)
150Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 158Debug.Assert(AttributeValues != null); 159Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
Microsoft.AspNetCore.Grpc.JsonTranscoding (5)
Internal\Json\MessageTypeInfoResolver.cs (1)
126Debug.Assert(!field.IsRepeated && !field.IsMap, "Collections shouldn't have a setter.");
Internal\JsonRequestHelpers.cs (1)
357Debug.Assert(read == data.Length);
src\Grpc\JsonTranscoding\src\Shared\HttpRoutePatternParser.cs (3)
343Debug.Assert(CurrentVariable.FieldPath.Any()); 344Debug.Assert(CurrentVariable.StartSegment < CurrentVariable.EndSegment); 345Debug.Assert(CurrentVariable.EndSegment <= _segments.Count);
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (3)
ConverterTests\JsonConverterReadTests.cs (1)
661Debug.Assert(objectOld != null);
UnaryServerCallHandlerTests.cs (2)
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 (17)
Http\DefaultHttpContextFactory.cs (2)
56Debug.Assert(featureCollection != null); 57Debug.Assert(httpContext != null);
Internal\ConfigureContainerBuilder.cs (1)
24Debug.Assert(MethodInfo != null, "Shouldn't be called when there is no Configure method.");
Internal\HostingApplicationDiagnostics.cs (1)
160Debug.Assert(context.MetricsTagsFeature != null, "MetricsTagsFeature should be set if MetricsEnabled is true.");
Internal\HostingRequestFinishedLog.cs (2)
28Debug.Assert(_context.HttpContext != null); 62Debug.Assert(_context.HttpContext != null);
Internal\StartupMethods.cs (2)
14Debug.Assert(configure != null); 15Debug.Assert(configureServices != null);
Internal\WebHost.cs (4)
81Debug.Assert(_applicationServices != null, "Initialize must be called before accessing services."); 126Debug.Assert(_applicationServices != null, "Initialize must be called first."); 202Debug.Assert(_applicationServices != null, "Initialize must be called first."); 255Debug.Assert(_applicationServices != null, "Initialize must be called first.");
src\Shared\RazorViews\BaseView.cs (3)
150Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 158Debug.Assert(AttributeValues != null); 159Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
198Debug.Assert(method != null); 199Debug.Assert(method.DeclaringType != null);
Microsoft.AspNetCore.Html.Abstractions (2)
HtmlFormattableString.cs (2)
89Debug.Assert(formatProvider != null); 90Debug.Assert(encoder != null);
Microsoft.AspNetCore.Http (12)
src\Http\Shared\StreamCopyOperationInternal.cs (4)
39Debug.Assert(source != null); 40Debug.Assert(destination != null); 41Debug.Assert(!bytesRemaining.HasValue || bytesRemaining.GetValueOrDefault() >= 0); 42Debug.Assert(buffer != null);
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (8)
229Debug.Assert(_arrayStorage == null); 515Debug.Assert(_arrayStorage != null); 545Debug.Assert(_arrayStorage is not null); 546Debug.Assert(_count <= _arrayStorage.Length); 556Debug.Assert(_dictionaryStorage == null); 557Debug.Assert(_arrayStorage != null); 576Debug.Assert(_dictionaryStorage == null); 577Debug.Assert(_arrayStorage != null);
Microsoft.AspNetCore.Http.Abstractions (26)
Extensions\UseMiddlewareExtensions.cs (2)
201Debug.Assert(!RuntimeFeature.IsDynamicCodeSupported, "Use reflection fallback when dynamic code is not supported."); 227Debug.Assert(RuntimeFeature.IsDynamicCodeSupported, "Use compiled expression when dynamic code is supported.");
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 (8)
Internal\HttpConnectionContext.cs (2)
522Debug.Assert(Status == HttpConnectionStatus.Disposed); 629Debug.Assert(TransportType != HttpTransportType.None, "Transport has not been initialized yet");
Internal\HttpConnectionsMetrics.cs (1)
57Debug.Assert(transportType != HttpTransportType.None);
Internal\Transports\WebSocketsServerTransport.cs (1)
39Debug.Assert(context.WebSockets.IsWebSocketRequest, "Not a websocket request");
src\Shared\WebEncoders\WebEncoders.cs (2)
111Debug.Assert(arraySizeRequired % 4 == 0, "Invariant: Array length must be a multiple of 4."); 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 (31)
RequestDelegateFactory.cs (9)
246Debug.Assert(untargetableRequestDelegate is not null); 258Debug.Assert(targetableRequestDelegate is not null); 416Debug.Assert(factoryContext.EndpointBuilder.FilterFactories.Count > 0); 1268Debug.Assert(factoryContext.JsonRequestBodyParameter is not null, "factoryContext.JsonRequestBodyParameter is null for a JSON body."); 1275Debug.Assert(parameterName is not null, "CreateArgument() should throw if parameter.Name is null."); 1403Debug.Assert(factoryContext.FirstFormRequestBodyParameter is not null, "factoryContext.FirstFormRequestBodyParameter is null for a form body."); 1410Debug.Assert(parameterName is not null, "CreateArgument() should throw if parameter.Name is null."); 1952Debug.Assert(bindAsyncMethod.Expression is not null); 2245Debug.Assert(parameterName is not null, "CreateArgument() should throw if parameter.Name is null.");
src\Components\Endpoints\src\FormMapping\Factories\NullableConverterFactory.cs (3)
26Debug.Assert(underlyingType != null); 29Debug.Assert(underlyingConverter != null); 32Debug.Assert(expectedConverterType != null);
src\Components\Endpoints\src\FormMapping\FormDataReader.cs (3)
202Debug.Assert(_currentDepth >= 0); 206Debug.Assert(_currentPrefixBuffer.Length >= keyLength); 235Debug.Assert(_prefixBuffer.Length >= (_currentPrefixBuffer.Length + separator.Length));
src\Http\Shared\StreamCopyOperationInternal.cs (4)
39Debug.Assert(source != null); 40Debug.Assert(destination != null); 41Debug.Assert(!bytesRemaining.HasValue || bytesRemaining.GetValueOrDefault() >= 0); 42Debug.Assert(buffer != null);
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (2)
106Debug.Assert(_executor != null, "Sync execution is not supported."); 132Debug.Assert(_executorAsync != null, "Async execution is not supported.");
src\Shared\ParameterBindingMethodCache.cs (2)
519Debug.Fail("No suitable System.Enum.TryParse method found."); 719Debug.Assert(obj is ParameterLookupKey);
src\Shared\PropertyAsParameterInfo.cs (1)
25Debug.Assert(propertyInfo != null, "PropertyInfo must be provided.");
src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
47Debug.Assert(_pos == _span.Length);
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (6)
37Debug.Assert(value >= 0); 38Debug.Assert(value <= _chars.Length); 48Debug.Assert(capacity >= 0); 86Debug.Assert(index < _pos); 289Debug.Assert(additionalCapacityBeyondPos > 0); 290Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.AspNetCore.Http.RequestDelegateGenerator (5)
src\Shared\Diagnostics\AnalyzerDebug.cs (4)
12/// <inheritdoc cref="Debug.Assert(bool)"/> 14public static void Assert([DoesNotReturnIf(false)] bool b) => Debug.Assert(b); 16/// <inheritdoc cref="Debug.Assert(bool, string)"/> 19=> Debug.Assert(b, message);
src\Shared\RoslynUtils\WellKnownTypes.cs (1)
46Debug.Assert(name == typeIdName, $"Enum name ({typeIdName}) and type name ({name}) must match at {i}");
Microsoft.AspNetCore.Http.Results (7)
ResultsOfTHelper.cs (1)
44Debug.Assert(populateMetadataMethod != null, $"Couldn't find PopulateMetadata method on {typeof(TTarget)}.");
src\Http\Shared\StreamCopyOperationInternal.cs (4)
39Debug.Assert(source != null); 40Debug.Assert(destination != null); 41Debug.Assert(!bytesRemaining.HasValue || bytesRemaining.GetValueOrDefault() >= 0); 42Debug.Assert(buffer != null);
src\Shared\RangeHelper\RangeHelper.cs (1)
67Debug.Assert(rangeHeader.Ranges.Count == 1);
src\Shared\ResultsHelpers\SharedUrlHelper.cs (1)
26Debug.Assert(path.HasValue);
Microsoft.AspNetCore.HttpLogging (15)
BufferingStream.cs (1)
147Debug.Assert(_tail != null);
src\Shared\Buffers\BufferSegment.cs (4)
27Debug.Assert(value <= AvailableMemory.Length); 64Debug.Assert(_memoryOwner != null); 102Debug.Assert(segment != null); 103Debug.Assert(Next == null);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
47Debug.Assert(_pos == _span.Length);
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (6)
37Debug.Assert(value >= 0); 38Debug.Assert(value <= _chars.Length); 48Debug.Assert(capacity >= 0); 86Debug.Assert(index < _pos); 289Debug.Assert(additionalCapacityBeyondPos > 0); 290Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.AspNetCore.Identity (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 (10)
ModelBinding\ModelMetadata.cs (6)
152Debug.Assert(BoundConstructor != null, "This API can be only called for types with bound constructors."); 167Debug.Assert(BoundConstructor != null, "This API can be only called for types with bound constructors."); 564Debug.Assert(_parameterMapping != null); 565Debug.Assert(_boundConstructorPropertyMapping != null); 652Debug.Assert(ModelType != null); 695Debug.Assert(
ModelBinding\ModelStateDictionary.cs (2)
552Debug.Assert(key != null); 930Debug.Assert(ChildNodes != null);
src\Shared\ParameterBindingMethodCache.cs (2)
519Debug.Fail("No suitable System.Enum.TryParse method found."); 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.ApiExplorer (1)
src\Shared\PropertyAsParameterInfo.cs (1)
25Debug.Assert(propertyInfo != null, "PropertyInfo must be provided.");
Microsoft.AspNetCore.Mvc.Core (244)
ActionConstraints\ActionConstraintCache.cs (1)
95Debug.Assert(entry.ActionConstraints != null || entry.Items != null);
ApplicationModels\ApplicationModelFactory.cs (1)
79Debug.Assert(result != null);
ApplicationModels\ControllerActionDescriptorBuilder.cs (1)
134Debug.Assert(IsAttributeRouted(actionDescriptor));
Authorization\AuthorizeFilter.cs (1)
205Debug.Assert(AuthorizeData != null);
Controllers\ControllerBinderDelegateProvider.cs (1)
60Debug.Assert(valueProvider is not null);
Filters\DefaultFilterProvider.cs (2)
68Debug.Assert(actualFilter != null, "actualFilter should not be null"); 69Debug.Assert(filterMetadata != null, "filterMetadata should not be null");
Formatters\AcceptHeaderParser.cs (3)
43Debug.Fail("ParseAcceptHeader should advance charIndex, this is a bug."); 124Debug.Assert(input != null); 125Debug.Assert(startIndex <= input.Length); // it's OK if index == value.Length.
Infrastructure\ActionSelectionTable.cs (2)
178Debug.Assert(matches != null); 179Debug.Assert(matches.Count >= 0);
Infrastructure\ControllerActionInvoker.cs (16)
116Debug.Assert(state != null); 117Debug.Assert(_actionExecutingContext != null); 140Debug.Assert(state != null); 141Debug.Assert(_actionExecutingContext != null); 171Debug.Assert(state != null); 172Debug.Assert(_actionExecutingContext != null); 220Debug.Assert(state != null); 221Debug.Assert(_actionExecutingContext != null); 222Debug.Assert(_actionExecutedContext != null); 314Debug.Assert(_actionExecutedContext != null); 336Debug.Assert(invoker._actionExecutedContext != null); 342Debug.Assert(_actionExecutingContext != null); 355Debug.Assert(_actionExecutedContext != null); 362Debug.Assert(invoker._actionExecutedContext != null); 523Debug.Assert(_cacheEntry.ControllerBinderDelegate != null); 538Debug.Assert(actionParameters != null, "Expect arguments to be initialized.");
Infrastructure\DefaultActionDescriptorCollectionProvider.cs (4)
57Debug.Assert(_collection != null); 58Debug.Assert(_changeToken != null); 72Debug.Assert(_collection != null); 73Debug.Assert(_changeToken != null);
Infrastructure\ObjectResultExecutor.cs (1)
124Debug.Assert(result.ContentTypes != null);
Infrastructure\ResourceInvoker.cs (50)
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); 822Debug.Fail("unreachable"); 856Debug.Assert(scope == Scope.Invoker || scope == Scope.Resource); 889Debug.Assert(scope == Scope.Invoker); 908Debug.Assert(_resourceExecutingContext != null); 922Debug.Assert(_resourceExecutedContext != null); 929Debug.Assert(invoker._resourceExecutedContext != null); 971Debug.Assert(_resourceExecutedContext != null); 993Debug.Assert(invoker._resourceExecutedContext != null); 1168Debug.Assert(state != null); 1169Debug.Assert(_resultExecutingContext != null); 1192Debug.Assert(state != null); 1193Debug.Assert(_resultExecutingContext != null); 1225Debug.Assert(state != null); 1226Debug.Assert(_resultExecutingContext != null); 1274Debug.Assert(state != null); 1275Debug.Assert(_resultExecutingContext != null); 1276Debug.Assert(_resultExecutedContext != null); 1373Debug.Assert(_resultExecutedContext != null); 1396Debug.Assert(invoker._resultExecutedContext != null); 1404Debug.Assert(_resultExecutingContext != null); 1418Debug.Assert(_resultExecutedContext != null); 1425Debug.Assert(invoker._resultExecutedContext != null);
ModelBinding\Binders\ArrayModelBinder.cs (2)
94Debug.Assert(targetType == typeof(TElement[]), "GenericModelBinder only creates this binder for arrays."); 102Debug.Assert(targetType == typeof(TElement?[]), "GenericModelBinder only creates this binder for arrays.");
ModelBinding\Binders\CollectionModelBinder.cs (2)
168Debug.Assert(model != null); 472Debug.Assert(targetCollection != null, "This binder is instantiated only for ICollection<T> model types.");
ModelBinding\Binders\ComplexObjectModelBinder.cs (3)
68Debug.Assert(propertyData == GreedyPropertiesMayHaveData || propertyData == ValueProviderDataAvailable); 440Debug.Assert(property.MetadataKind == ModelMetadataKind.Property); 485Debug.Assert(parameter.MetadataKind == ModelMetadataKind.Parameter);
ModelBinding\Binders\ComplexTypeModelBinder.cs (1)
97Debug.Assert(propertyData == GreedyPropertiesMayHaveData || propertyData == ValueProviderDataAvailable);
ModelBinding\Binders\DictionaryModelBinder.cs (1)
119Debug.Assert(result.Model != null);
ModelBinding\Binders\FormFileModelBinder.cs (2)
105Debug.Assert(postedFiles is List<IFormFile>); 110Debug.Assert(postedFiles is List<IFormFile>);
ModelBinding\Binders\HeaderModelBinder.cs (1)
194Debug.Assert(values != null);
ModelBinding\Metadata\DefaultModelMetadataProvider.cs (2)
227Debug.Fail($"Unable to find property '{propertyKey.Name}' on type '{propertyKey.ContainerType}."); 358Debug.Assert(propertyKey.MetadataKind == ModelMetadataKind.Property);
ModelBinding\ModelBinderFactory.cs (4)
79Debug.Assert(!(binder is PlaceholderBinder)); 176Debug.Assert(metadata != null); 177Debug.Assert(binder != null); 189Debug.Assert(metadata != null);
ModelBinding\PlaceholderBinder.cs (1)
20Debug.Assert(Inner is not null, "Inner must be resolved before BindModelAsync can be called.");
ModelBinding\PrefixContainer.cs (2)
202Debug.Assert(candidate.StartsWith(prefix, StringComparison.OrdinalIgnoreCase)); 259Debug.Assert(candidate.StartsWith(prefix, StringComparison.OrdinalIgnoreCase));
ModelBinding\SuppressChildValidationMetadataProvider.cs (2)
80Debug.Fail("We shouldn't get here."); 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\ObjectMethodExecutor\ObjectMethodExecutor.cs (2)
106Debug.Assert(_executor != null, "Sync execution is not supported."); 132Debug.Assert(_executorAsync != null, "Async execution is not supported.");
src\Shared\PropertyHelper\PropertyHelper.cs (18)
161Debug.Assert(propertyInfo != null); 181Debug.Assert(propertyInfo != null); 195Debug.Assert(propertyInfo != null); 198Debug.Assert(propertyGetterWrapperMethod != null); 199Debug.Assert(propertyGetterWrapperMethod.IsGenericMethodDefinition); 200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 203Debug.Assert(propertyGetterByRefWrapperMethod != null); 204Debug.Assert(propertyGetterByRefWrapperMethod.IsGenericMethodDefinition); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 208Debug.Assert(getMethod != null); 209Debug.Assert(!getMethod.IsStatic); 210Debug.Assert(getMethod.GetParameters().Length == 0); 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 (2)
Properties\Resources.Designer.cs (1)
49System.Diagnostics.Debug.Assert(value != null);
ViewLocalizer.cs (1)
90Debug.Assert(!string.IsNullOrEmpty(path), "Couldn't determine a path for the view");
Microsoft.AspNetCore.Mvc.NewtonsoftJson (2)
BsonTempDataSerializer.cs (2)
182Debug.Assert(genericTypeArguments.Length == 1, "IList<T> has one generic argument"); 188Debug.Assert(
Microsoft.AspNetCore.Mvc.Razor (7)
Compilation\DefaultViewCompiler.cs (1)
120Debug.Assert(relativePath != null);
RazorPageBase.cs (2)
304Debug.Assert(_valueBuffer is not null); 607Debug.Assert(_tagHelperAttributeInfo.ExecutionContext != null);
RazorView.cs (2)
97Debug.Assert(_bufferScope != null); 280Debug.Assert(originalLocations is not null && layoutPageResult.SearchedLocations is not null);
RazorViewEngine.cs (2)
482Debug.Assert(!string.IsNullOrEmpty(name)); 488Debug.Assert(!string.IsNullOrEmpty(name));
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (17)
CSharpCompiler.cs (4)
117Debug.Assert(_parseOptions is not null); 118Debug.Assert(_compilationOptions is not null); 119Debug.Assert(_emitOptions is not null); 229Debug.Fail($"LanguageVersion {languageVersion} specified in the deps file could not be parsed.");
PageActionDescriptorChangeProvider.cs (1)
32Debug.Assert(!string.IsNullOrEmpty(rootDirectory));
RuntimeViewCompiler.cs (5)
138Debug.Assert(item.ExpirationTokens != null); 152Debug.Assert(item.Descriptor != null); 162Debug.Assert(taskSource != null); 168Debug.Assert(item.Descriptor != null); 383Debug.Assert(relativePath != null);
src\Mvc\Mvc.RazorPages\src\ApplicationModels\PageRouteModelFactory.cs (7)
89Debug.Assert(relativePath.StartsWith('/')); 129Debug.Assert(path.StartsWith(rootDirectory, StringComparison.OrdinalIgnoreCase)); 130Debug.Assert(path.EndsWith(RazorViewEngine.ViewExtension, StringComparison.OrdinalIgnoreCase)); 140Debug.Assert(!string.IsNullOrEmpty(areaName)); 141Debug.Assert(!string.IsNullOrEmpty(viewEnginePath)); 142Debug.Assert(viewEnginePath.StartsWith('/')); 175Debug.Assert(directory.StartsWith('/'));
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (2)
TestInfrastructure\DirectoryNode.cs (2)
34Debug.Assert(directory != null); 113Debug.Assert(!string.IsNullOrEmpty(path));
Microsoft.AspNetCore.Mvc.RazorPages (80)
ApplicationModels\PageRouteModelFactory.cs (7)
89Debug.Assert(relativePath.StartsWith('/')); 129Debug.Assert(path.StartsWith(rootDirectory, StringComparison.OrdinalIgnoreCase)); 130Debug.Assert(path.EndsWith(RazorViewEngine.ViewExtension, StringComparison.OrdinalIgnoreCase)); 140Debug.Assert(!string.IsNullOrEmpty(areaName)); 141Debug.Assert(!string.IsNullOrEmpty(viewEnginePath)); 142Debug.Assert(viewEnginePath.StartsWith('/')); 175Debug.Assert(directory.StartsWith('/'));
DependencyInjection\RazorPagesRazorViewEngineOptionsSetup.cs (1)
26Debug.Assert(!string.IsNullOrEmpty(rootDirectory));
Infrastructure\DynamicPageEndpointMatcherPolicy.cs (1)
183Debug.Assert(currentSelector == null || ReferenceEquals(currentSelector, selector));
Infrastructure\DynamicPageEndpointSelectorCache.cs (1)
35Debug.Assert(dataSourceId is not null);
Infrastructure\PageActionInvoker.cs (29)
192Debug.Assert(_instance is not null); 213Debug.Assert(handlerBinder is not null); 214Debug.Assert(_arguments is not null); 253Debug.Assert(_instance is not null); 254Debug.Assert(_arguments is not null); 267Debug.Assert(executor != null, "We should always find a executor for a handler"); 321Debug.Assert(_instance is not null); 357Debug.Assert(state != null); 358Debug.Assert(_handlerSelectedContext != null); 381Debug.Assert(state != null); 382Debug.Assert(_handlerSelectedContext != null); 397Debug.Assert(state != null); 398Debug.Assert(_handlerSelectedContext != null); 439Debug.Assert(_instance is not null); 440Debug.Assert(_arguments is not null); 471Debug.Assert(state != null); 472Debug.Assert(_handlerExecutingContext != null); 495Debug.Assert(state != null); 496Debug.Assert(_handlerExecutingContext != null); 498Debug.Assert(_instance is not null); 529Debug.Assert(state != null); 530Debug.Assert(_handlerExecutingContext != null); 531Debug.Assert(_instance is not null); 580Debug.Assert(state != null); 581Debug.Assert(_handlerExecutingContext != null); 582Debug.Assert(_handlerExecutedContext != null); 670Debug.Assert(_handlerExecutedContext != null); 675Debug.Assert(_handlerExecutingContext != null); 690Debug.Assert(_handlerExecutedContext != null);
Infrastructure\PageActionInvokerCache.cs (1)
47Debug.Assert(compiledPageActionDescriptor != null, "PageLoader didn't run!");
MvcRazorPagesDiagnosticListenerExtensions.cs (40)
20Debug.Assert(diagnosticListener != null); 21Debug.Assert(actionContext != null); 22Debug.Assert(handlerMethodDescriptor != null); 23Debug.Assert(arguments != null); 24Debug.Assert(instance != null); 56Debug.Assert(diagnosticListener != null); 57Debug.Assert(actionContext != null); 58Debug.Assert(handlerMethodDescriptor != null); 59Debug.Assert(arguments != null); 60Debug.Assert(instance != null); 90Debug.Assert(diagnosticListener != null); 91Debug.Assert(handlerExecutionContext != null); 92Debug.Assert(filter != null); 120Debug.Assert(diagnosticListener != null); 121Debug.Assert(handlerExecutedContext != null); 122Debug.Assert(filter != null); 150Debug.Assert(diagnosticListener != null); 151Debug.Assert(handlerExecutingContext != null); 152Debug.Assert(filter != null); 180Debug.Assert(diagnosticListener != null); 181Debug.Assert(handlerExecutingContext != null); 182Debug.Assert(filter != null); 210Debug.Assert(diagnosticListener != null); 211Debug.Assert(handlerExecutedContext != null); 212Debug.Assert(filter != null); 240Debug.Assert(diagnosticListener != null); 241Debug.Assert(handlerExecutedContext != null); 242Debug.Assert(filter != null); 270Debug.Assert(diagnosticListener != null); 271Debug.Assert(handlerSelectedContext != null); 272Debug.Assert(filter != null); 300Debug.Assert(diagnosticListener != null); 301Debug.Assert(handlerSelectedContext != null); 302Debug.Assert(filter != null); 330Debug.Assert(diagnosticListener != null); 331Debug.Assert(handlerSelectedContext != null); 332Debug.Assert(filter != null); 360Debug.Assert(diagnosticListener != null); 361Debug.Assert(handlerSelectedContext != null); 362Debug.Assert(filter != null);
Microsoft.AspNetCore.Mvc.TagHelpers (9)
CacheTagHelper.cs (2)
164Debug.Fail($"{nameof(content)} should be an {nameof(CharBufferHtmlContent)}."); 269Debug.Assert(length == 0);
CurrentValues.cs (1)
12Debug.Assert(values != null);
JavaScriptResources.cs (1)
39Debug.Assert(
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 (47)
AttributeDictionary.cs (8)
76Debug.Assert(index >= 0 && index < Count && _items != null); 82Debug.Assert(index >= 0 && index <= Count); 83Debug.Assert(value.Key != null); 95Debug.Assert(index >= 0 && index <= Count); 96Debug.Assert(value.Key != null); 108Debug.Assert(index >= 0 && index < Count); 110Debug.Assert(_items != null); 119Debug.Assert(key != null);
Buffers\PagedBufferedTextWriter.cs (2)
50Debug.Assert(length > 0); 66Debug.Assert(length == 0);
Buffers\PagedCharBuffer.cs (2)
61Debug.Assert(copyLength > 0); 82Debug.Assert(copyLength > 0);
CachedExpressionCompiler.cs (2)
45Debug.Assert(expression != null); 223Debug.Assert(combinedNullTest.Type == typeof(bool));
DefaultDisplayTemplates.cs (1)
89Debug.Assert(elementMetadata != null);
DefaultEditorTemplates.cs (1)
71Debug.Assert(elementMetadata != null);
DefaultHtmlGenerator.cs (4)
199Debug.Assert(!isChecked.HasValue); 454Debug.Assert(!isChecked.HasValue); 457Debug.Assert(value != null); 966Debug.Assert(isTargetEnum ^ enumNames == null);
ExpressionHelper.cs (7)
131Debug.Assert(segmentCount >= 0); 134Debug.Assert(!doNotCache); 148Debug.Assert(doNotCache); 157Debug.Assert(doNotCache); 168Debug.Assert(!name.Contains("__")); 182Debug.Assert(false); 187Debug.Assert(segmentCount == 0);
ExpressionMetadataProvider.cs (1)
118Debug.Assert(metadata != null);
Filters\SaveTempDataPropertyFilterBase.cs (1)
70Debug.Assert(Subject != null, "Subject must be set before this method is invoked.");
ModelExplorer.cs (2)
127Debug.Assert(Container != null); 202Debug.Assert(propertyHelper != null);
ModelExplorerExtensions.cs (1)
53Debug.Assert(enumGroupedDisplayNamesAndValues != null);
src\Shared\PooledArrayBufferWriter.cs (6)
80Debug.Assert(_rentedBuffer != null); 144Debug.Assert(_rentedBuffer != null); 165Debug.Assert(oldBuffer.Length >= _index); 166Debug.Assert(_rentedBuffer.Length >= _index); 174Debug.Assert(_rentedBuffer.Length - _index > 0); 175Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
TempDataDictionary.cs (1)
152Debug.Assert(_initialKeys is not null && _retainedKeys is not null && _data is not null);
TemplateBuilder.cs (1)
107Debug.Assert(enumGrouped != null);
ValidationHelpers.cs (4)
13Debug.Assert(modelError != null); 29Debug.Assert(modelError != null); 30Debug.Assert(containingEntry != null); 31Debug.Assert(modelExplorer != null);
ViewDataDictionaryFactory.cs (2)
18Debug.Assert(constructor != null); 39Debug.Assert(constructor != null);
ViewDataEvaluator.cs (1)
100Debug.Assert(expression != null);
Microsoft.AspNetCore.OpenApi (25)
Extensions\ApiDescriptionExtensions.cs (1)
44Debug.Assert(apiDescription.RelativePath != null, "Relative path cannot be null.");
Schemas\JsonSchemaMapper\JsonSchemaMapper.cs (9)
226Debug.Assert(typeInfo.IsReadOnly); 310Debug.Assert(derivedType.TypeDiscriminator is null or int or string); 551Debug.Fail("Unreachable code"); 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);
Services\OpenApiDocumentService.cs (1)
107Debug.Assert(descriptions.Key != null, "Relative path mapped to OpenApiPath key cannot be null.");
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (2)
106Debug.Assert(_executor != null, "Sync execution is not supported."); 132Debug.Assert(_executorAsync != null, "Async execution is not supported.");
src\Shared\ParameterBindingMethodCache.cs (2)
519Debug.Fail("No suitable System.Enum.TryParse method found."); 719Debug.Assert(obj is ParameterLookupKey);
src\Shared\PropertyAsParameterInfo.cs (1)
25Debug.Assert(propertyInfo != null, "PropertyInfo must be provided.");
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
126Debug.Assert(charsUsed == 1);
Transformers\TypeBasedOpenApiDocumentTransformer.cs (1)
26Debug.Assert(transformer != null, $"The type {_transformerType} does not implement {nameof(IOpenApiDocumentTransformer)}.");
Microsoft.AspNetCore.OutputCaching (21)
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);
OutputCacheEntryFormatter.cs (1)
373Debug.Assert(reader.IsEOF, "should have read entire payload");
RecyclableArrayBufferWriter.cs (4)
66Debug.Assert(_buffer.Length > _index); 73Debug.Assert(_buffer.Length > _index); 107Debug.Assert(needed > currentLength); 127Debug.Assert(FreeCapacity > 0 && FreeCapacity >= sizeHint);
RecyclableSequenceBuilder.cs (2)
73Debug.Assert(_currentSegment is not null); 75Debug.Assert(_currentSegmentIndex >= 0 && _currentSegmentIndex <= current.Length);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (7)
RedisOutputCacheStore.cs (7)
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); 497Debug.WriteLine(ex);
Microsoft.AspNetCore.Razor (1)
TagHelpers\DefaultTagHelperContent.cs (1)
34Debug.Assert(_buffer.Count == 0);
Microsoft.AspNetCore.Razor.Runtime (1)
Runtime\TagHelpers\TagHelperExecutionContext.cs (1)
221Debug.Assert(!Output.IsContentModified);
Microsoft.AspNetCore.Razor.Runtime.Test (1)
Runtime\TagHelpers\TagHelperRunnerTest.cs (1)
259Debug.Assert(ProcessOrderTracker != null);
Microsoft.AspNetCore.ResponseCaching (3)
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
Microsoft.AspNetCore.ResponseCompression (5)
ResponseCompressionMiddleware.cs (1)
51Debug.Assert(originalBodyFeature != null);
ResponseCompressionProvider.cs (1)
83Debug.Assert(false, "Duplicate check failed.");
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
Microsoft.AspNetCore.Rewrite (9)
ApacheModRewrite\ConditionEvaluator.cs (1)
52Debug.Assert(condResult != null, "ConditionEvaluator must be passed at least one condition to evaluate.");
ApacheModRewrite\CookieActionFactory.cs (1)
59Debug.Assert(action != null || tokenType == Fields.Name);
ApacheModRewrite\RuleBuilder.cs (4)
65Debug.Assert(input.Operand != null); 76Debug.Assert(input.Operand != null); 102Debug.Assert(input.Operand != null); 162Debug.Assert(input.Operand != null);
PatternSegments\RuleMatchSegment.cs (1)
19Debug.Assert(ruleBackReferences != null);
UrlMatches\IntegerMatch.cs (1)
59Debug.Fail("This is never reached.");
UrlMatches\StringMatch.cs (1)
41Debug.Fail("This is never reached.");
Microsoft.AspNetCore.Routing (91)
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 (5)
43Debug.Assert(x != null); 44Debug.Assert(y != null); 79Debug.Assert(x != null); 80Debug.Assert(y != null); 88Debug.Fail("We don't expect this to be called.");
Matching\ILEmitTrieFactory.cs (4)
524Debug.Assert(entries.Length == 1, "We should have a single entry"); 534Debug.Assert(index + 4 <= text.Length); 544Debug.Assert(index + 4 <= text.Length); 552Debug.Assert(index + 1 <= text.Length);
Matching\SingleEntryAsciiJumpTable.cs (1)
47Debug.Assert(a.Length == b.Length && b.Length == length);
ParameterPolicyActivator.cs (1)
161Debug.Assert(constructors.Count > 0);
ParameterPolicyFactory.cs (1)
40Debug.Assert(reference.ParameterPolicy != null || reference.Content != null);
PathTokenizer.cs (3)
47Debug.Assert(_path[0] == '/'); 97Debug.Assert(_path[_path.Length - 1] != '/'); 98Debug.Assert(currentSegmentIndex == index);
Patterns\RoutePattern.cs (5)
48Debug.Assert(defaults != null); 49Debug.Assert(parameterPolicies != null); 50Debug.Assert(parameters != null); 51Debug.Assert(requiredValues != null); 52Debug.Assert(pathSegments != null);
Patterns\RoutePatternLiteralPart.cs (1)
22Debug.Assert(!string.IsNullOrEmpty(content));
Patterns\RoutePatternMatcher.cs (9)
111Debug.Assert(pathSegment != null); 168Debug.Assert(pathSegment != null); 169Debug.Assert(pathSegment.IsSimple); 172Debug.Assert(part.IsParameter); 240Debug.Assert(!pathSegment.IsSimple); 338Debug.Assert(routeSegment != null); 339Debug.Assert(routeSegment.Parts.Count > 1); 361Debug.Assert(part.IsLiteral || part.IsSeparator); 434Debug.Assert(false, "indexOfLastSegementUsed should always be 0 from the check above");
Patterns\RoutePatternParser.cs (8)
51Debug.Assert(context.AtEnd() || context.Current == Separator); 73Debug.Assert(context != null); 74Debug.Assert(segments != null); 145Debug.Assert(context.Current == OpenBrace); 445Debug.Assert(context != null); 446Debug.Assert(literal != null); 485Debug.Assert(template != null); 526Debug.Assert(_index >= 0);
Patterns\RoutePatternSeparatorPart.cs (1)
39Debug.Assert(!string.IsNullOrEmpty(content));
RequestDelegateFilterPipelineBuilder.cs (1)
19Debug.Assert(options.EndpointBuilder != null);
RouteBase.cs (2)
313Debug.Assert(_constraintLogger != null); 324Debug.Assert(_constraintLogger != null);
RouteCollection.cs (1)
150Debug.Assert(_options != null);
RouteEndpointDataSource.cs (2)
213Debug.Assert(entry.InferMetadataFunc != null, "A func to infer metadata must be provided for route handlers."); 247Debug.Assert(factoryCreatedRequestDelegate is not null);
RouteOptions.cs (1)
34Debug.Assert(_endpointDataSources != null, "Endpoint data sources should have been set in DI.");
src\Shared\PropertyHelper\PropertyHelper.cs (18)
161Debug.Assert(propertyInfo != null); 181Debug.Assert(propertyInfo != null); 195Debug.Assert(propertyInfo != null); 198Debug.Assert(propertyGetterWrapperMethod != null); 199Debug.Assert(propertyGetterWrapperMethod.IsGenericMethodDefinition); 200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 203Debug.Assert(propertyGetterByRefWrapperMethod != null); 204Debug.Assert(propertyGetterByRefWrapperMethod.IsGenericMethodDefinition); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 208Debug.Assert(getMethod != null); 209Debug.Assert(!getMethod.IsStatic); 210Debug.Assert(getMethod.GetParameters().Length == 0); 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 (2)
98Debug.Assert(segment.Parts.Count == 1); 231Debug.Fail("We shouldn't get here.");
UriBuildingContext.cs (2)
137Debug.Assert(_lastValueOffset != -1, "Cannot invoke Remove more than once."); 171Debug.Assert(result);
Microsoft.AspNetCore.Routing.Abstractions (19)
RouteData.cs (1)
146Debug.Assert(_routers != null);
src\Shared\PropertyHelper\PropertyHelper.cs (18)
161Debug.Assert(propertyInfo != null); 181Debug.Assert(propertyInfo != null); 195Debug.Assert(propertyInfo != null); 198Debug.Assert(propertyGetterWrapperMethod != null); 199Debug.Assert(propertyGetterWrapperMethod.IsGenericMethodDefinition); 200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 203Debug.Assert(propertyGetterByRefWrapperMethod != null); 204Debug.Assert(propertyGetterByRefWrapperMethod.IsGenericMethodDefinition); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 208Debug.Assert(getMethod != null); 209Debug.Assert(!getMethod.IsStatic); 210Debug.Assert(getMethod.GetParameters().Length == 0); 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.Routing.Tests (1)
Patterns\RoutePatternParserTest.cs (1)
717Debug.Fail("This should not be reachable. Do you need to update the comparison logic?");
Microsoft.AspNetCore.Server.HttpSys (59)
AsyncAcceptContext.cs (5)
72Debug.Assert(_requestContext != null); 138Debug.Assert(false, nameof(SetExpectCompletion)); // fail hard in debug 150Debug.Assert(false, nameof(CancelExpectCompletion)); // fail hard in debug 162Debug.Assert(false, nameof(ObserveCompletion)); // fail hard in debug 172Debug.Assert(_requestContext != null);
AuthenticationManager.cs (1)
87Debug.Assert(_urlGroup == null, "SetUrlGroupSecurity called more than once.");
HttpSysListener.cs (3)
262Debug.Assert(_serverSession != null, "ServerSessionHandle is null in CloseV2Config"); 263Debug.Assert(!_serverSession.Id.IsInvalid, "ServerSessionHandle is invalid in CloseV2Config"); 274Debug.Assert(_state != State.Stopped, "Listener has been stopped.");
MessagePump.cs (4)
104Debug.Assert(RequestContextFactory == null, "Start called twice!"); 106Debug.Assert(application != null); 162Debug.Assert(RequestContextFactory != null); 270Debug.Assert(_messagePump.Stopping);
NativeInterop\RequestQueue.cs (2)
109Debug.Assert(Created); 125Debug.Assert(Created);
NativeInterop\SafeNativeOverlapped.cs (1)
36Debug.Assert(_boundHandle != null, "ReleaseHandle can't be called on SafeNativeOverlapped.Zero.");
NativeInterop\ServerSession.cs (1)
22Debug.Assert(serverSessionId != 0, "Invalid id returned by HttpCreateServerSession");
NativeInterop\UrlGroup.cs (3)
43Debug.Assert(urlGroupId != 0, "Invalid id returned by HttpCreateUrlGroup"); 89Debug.Assert(info != IntPtr.Zero, "SetUrlGroupProperty called with invalid pointer"); 193Debug.Assert(Id != 0, "HttpCloseUrlGroup called with invalid url group id");
RequestProcessing\RequestContext.FeatureCollection.cs (1)
79Debug.Assert(_features != null);
RequestProcessing\Response.cs (4)
285Debug.Assert(!HasStarted, "HttpListenerResponse::SendHeaders()|SentHeaders is true."); 386Debug.Assert(!HasComputedHeaders, nameof(HasComputedHeaders) + " is true."); 602Debug.Assert(HasTrailers); 648Debug.Assert(unknownHeadersOffset == trailerCount);
RequestProcessing\ResponseBody.cs (4)
114Debug.Assert(!(endOfRequest && data.Count > 0), "Data is not supported at the end of the request."); 195Debug.Assert(!(addTrailers && chunked), "Trailers aren't currently supported for HTTP/1.1 chunking."); 223Debug.Assert(hasData); 272Debug.Assert(currentChunk == dataChunks.Length, "All chunks should be accounted for");
RequestProcessing\ResponseStreamAsyncResult.cs (2)
94Debug.Assert(currentChunk == _dataChunks.Length); 135Debug.Assert(currentChunk == _dataChunks.Length);
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
204Debug.Assert(_memoryHandle.HasValue);
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (6)
119Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 128Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 168Debug.Assert(_backingBuffer != null); 177Debug.Assert(_nativeRequest != null, "RequestContextBase::ReleasePins()|ReleasePins() called twice."); 215Debug.Assert(_nativeRequest == null, "RequestContextBase::Dispose()|Dispose() called before ReleasePins()."); 226Debug.Assert((int)HTTP_VERB.HttpVerbMaximum == HttpVerbs.Length);
src\Shared\HttpSys\RequestProcessing\PathNormalizer.cs (2)
36Debug.Assert(ch1 == '/', "Path segment must always start with a '/'"); 155Debug.Assert(ch1 == '/', "Path segment must always start with a '/'");
src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (1)
22Debug.Assert(rawUrlBytes.Length != 0, "Length of the URL cannot be zero.");
src\Shared\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 (34)
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (4)
177Debug.Fail("HPACK decoder reach an invalid state"); 244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (19)
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); 603Debug.Assert(success, $"Stack-allocated space was too small for index '{index}'."); 615Debug.Assert(success, $"Stack-allocated space was too small for \"{name}\".");
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (2)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8); 40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
246Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
223Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
Microsoft.AspNetCore.Server.IIS (52)
Core\HttpRequestStream.cs (2)
62Debug.Assert(_body != null, "Stream must be accepting reads."); 75Debug.Assert(_body != null, "Stream must be accepting reads.");
Core\IISHttpContext.cs (2)
442Debug.Assert(_hasResponseStarted == false); 482Debug.Assert(!HasStartedConsumingRequestBody);
Core\IISHttpContext.FeatureCollection.cs (1)
364Debug.Assert(_readBodyTask == null || _readBodyTask.IsCompleted);
Core\IISHttpServer.cs (1)
164Debug.Assert(server._iisContextFactory != null, "StartAsync must be called first.");
Core\IISServerAuthenticationHandlerInternal.cs (4)
24Debug.Assert(_iisHttpContext != null, "Handler must be initialized."); 25Debug.Assert(Scheme != null, "Handler must be initialized."); 41Debug.Assert(_context != null, "Handler must be initialized."); 51Debug.Assert(_context != null, "Handler must be initialized.");
Core\IO\AsyncIOEngine.cs (1)
175Debug.Assert(_runningOperation != null);
Core\IO\AsyncIOEngine.Flush.cs (1)
30Debug.Assert(_requestHandler != null, "Must initialize first.");
Core\IO\AsyncIOEngine.Read.cs (1)
34Debug.Assert(_requestHandler != null, "Must initialize first.");
Core\IO\AsyncIOOperation.cs (1)
13private static readonly Action<object?> CallbackCompleted = _ => { Debug.Assert(false, "Should not be invoked"); };
Core\IO\AsyncWriteOperationBase.cs (1)
26Debug.Assert(_requestHandler != null, "Must initialize first.");
Core\IO\WebSocketsAsyncIOEngine.cs (2)
37Debug.Assert(!read.InUse()); 53Debug.Assert(!write.InUse());
Core\IO\WebSocketsAsyncIOEngine.Initialize.cs (1)
28Debug.Assert(_requestHandler != null, "Must initialize first.");
Core\IO\WebSocketsAsyncIOEngine.Read.cs (1)
42Debug.Assert(_requestHandler != null, "Must initialize first.");
Core\OutputProducer.cs (1)
119Debug.Assert(false);
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
204Debug.Assert(_memoryHandle.HasValue);
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (6)
119Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 128Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 168Debug.Assert(_backingBuffer != null); 177Debug.Assert(_nativeRequest != null, "RequestContextBase::ReleasePins()|ReleasePins() called twice."); 215Debug.Assert(_nativeRequest == null, "RequestContextBase::Dispose()|Dispose() called before ReleasePins()."); 226Debug.Assert((int)HTTP_VERB.HttpVerbMaximum == HttpVerbs.Length);
src\Shared\HttpSys\RequestProcessing\PathNormalizer.cs (2)
36Debug.Assert(ch1 == '/', "Path segment must always start with a '/'"); 155Debug.Assert(ch1 == '/', "Path segment must always start with a '/'");
src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (1)
22Debug.Assert(rawUrlBytes.Length != 0, "Length of the URL cannot be zero.");
src\Shared\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.IISIntegration (3)
AuthenticationHandler.cs (3)
19Debug.Assert(_scheme != null, "Handler must be initialized."); 33Debug.Assert(_context != null, "Handler must be initialized."); 42Debug.Assert(_context != null, "Handler must be initialized.");
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Common\TestUriHelper.cs (1)
38Debug.Assert(scheme == "http", "Https not supported");
Microsoft.AspNetCore.Server.Kestrel.Core (342)
AnyIPListenOptions.cs (1)
20Debug.Assert(IPEndPoint != null);
HttpsConfigurationService.cs (4)
135Debug.Assert(_useHttpsWithDefaults is not null); 136Debug.Assert(_tlsConfigurationLoader is not null); 137Debug.Assert(_populateMultiplexedTransportFeatures is not null); 138Debug.Assert(_httpsLogger is not null);
Internal\CertificatePathWatcher.cs (2)
113Debug.Assert(certificateConfig.IsFileCert, "AddWatch called on non-file cert"); 216Debug.Assert(certificateConfig.IsFileCert, "RemoveWatch called on non-file cert");
Internal\Http\Http1ChunkedEncodingMessageBody.cs (2)
90Debug.Assert(!RequestUpgrade, "Upgraded connections should never use this code path!"); 170Debug.Assert(_pumpTask != null, "OnReadStartedAsync must have been called.");
Internal\Http\Http1Connection.cs (8)
149Debug.Assert(MinRequestBodyDataRate != null); 283Debug.Assert(target.Length != 0, "Request target must be non-zero length"); 317Debug.Assert(RawTarget != null, "RawTarget was not set"); 318Debug.Assert(((IHttpRequestFeature)this).Method != null, "Method was not set"); 319Debug.Assert(Path != null, "Path was not set"); 320Debug.Assert(QueryString != null, "QueryString was not set"); 321Debug.Assert(HttpVersion != null, "HttpVersion was not set"); 327Debug.Assert(target[0] == ByteForwardSlash, "Should only be called when path starts with /");
Internal\Http\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 (4)
718Debug.Assert(_bodyControl != null); 1010Debug.Assert(_requestRejectedException != null); 1340Debug.Assert(!HasResponseStarted, $"{nameof(SetErrorResponseHeaders)} called after response had already started."); 1616Debug.Assert(!HasResponseStarted);
Internal\Http\PathNormalizer.cs (2)
75Debug.Assert(ch1 == '/', "Path segment must always start with a '/'"); 192Debug.Assert(ch1 == '/', "Path segment must always start with a '/'");
Internal\Http\ReasonPhrases.cs (1)
84Debug.Assert(!string.IsNullOrEmpty(reasonPhrase));
Internal\Http2\FlowControl\FlowControl.cs (3)
12Debug.Assert(initialWindowSize <= Http2PeerSettings.MaxWindowSize, $"{nameof(initialWindowSize)} too large."); 23Debug.Assert(!IsAborted, $"({nameof(Advance)} called after abort."); 24Debug.Assert(bytes == 0 || (bytes > 0 && bytes <= Available), $"{nameof(Advance)}({bytes}) called with {Available} bytes available.");
Internal\Http2\FlowControl\InputFlowControl.cs (2)
20Debug.Assert(initialWindowSize >= minWindowSizeIncrement, "minWindowSizeIncrement is greater than the window size."); 74Debug.Assert(false, $"{nameof(TryUpdateWindow)} attempted to grow window past max size.");
Internal\Http2\FlowControl\StreamInputFlowControl.cs (2)
39Debug.Assert(connectionSuccess, "Connection-level input flow control should never be aborted."); 88Debug.Assert(connectionSuccess, "Connection-level input flow control should never be aborted.");
Internal\Http2\Http2Connection.cs (14)
233Debug.Assert(Limits.MinRequestBodyDataRate != null); 378Debug.Assert(_currentHeadersStream != null); 610Debug.Assert(buffer.Length >= ClientPreface.Length, "Not enough content to match preface."); 778Debug.Assert(TimeoutControl.TimerReason == TimeoutReason.KeepAlive, "Non keep-alive timeout set at start of stream."); 1113Debug.Assert(TimeoutControl.TimerReason == TimeoutReason.RequestHeaders, "Received continuation frame without request header timeout being set."); 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); 1551Debug.Fail($"Unexpected header type: {headerType}"); 1664Debug.Assert(staticTableIndex > 0, "Static table starts at 1.");
Internal\Http2\Http2FrameWriter.cs (6)
223Debug.Assert(actual <= int.MaxValue); 249Debug.Assert(flushHeaders, "The app completed successfully without flushing headers!"); 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 (8)
377Debug.Assert(streamDirectionFeature != null); 378Debug.Assert(streamIdFeature != null); 579Debug.Assert(persistentStateFeature != null, $"Required {nameof(IPersistentStateFeature)} not on stream context."); 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 (6)
205Debug.Assert(index <= H3StaticTable.Count); 213Debug.Assert(index <= H3StaticTable.Count); 344Debug.Fail($"Unexpected header type: {headerType}"); 458Debug.Assert(staticTableIndex >= 0, "Static table starts at 0."); 811Debug.Fail("Unexpected header parsing state."); 1156Debug.Assert(32 < ch && ch < 127);
Internal\Http3\QPackHeaderWriter.cs (1)
15Debug.Assert(hasValue == true);
Internal\HttpConnection.cs (6)
94Debug.Assert(connectionHeartbeatFeature != null, nameof(IConnectionHeartbeatFeature) + " is missing!"); 95Debug.Assert(connectionLifetimeNotificationFeature != null, nameof(IConnectionLifetimeNotificationFeature) + " is missing!"); 140Debug.Assert(previousState != ProtocolSelectionState.Initializing, "The state should never be initializing"); 159Debug.Assert(previousState != ProtocolSelectionState.Initializing, "The state should never be initializing"); 179Debug.Assert(previousState != ProtocolSelectionState.Initializing, "The state should never be initializing"); 279Debug.Assert(false, "Invalid TimeoutReason");
Internal\Infrastructure\HttpUtilities.cs (8)
55Debug.Assert(str.Length == 8, "String must be exactly 8 (ASCII) characters long."); 60Debug.Assert(operationStatus == OperationStatus.Done); 67Debug.Assert(str.Length == 4, "String must be exactly 4 (ASCII) characters long."); 72Debug.Assert(operationStatus == OperationStatus.Done); 79Debug.Assert(bytes.Length == 8, "Mask must be exactly 8 bytes long."); 265Debug.Assert(WordListForPerfectHashOfMethods.Length == (MaxHashValue + 1) && methodsLookup.Length == (MaxHashValue + 1)); 314Debug.Assert(char.IsAscii(c), "Must already be validated"); 449Debug.Fail("Unexpected HttpVersion: " + httpVersion);
Internal\Infrastructure\PipeWriterHelpers\ConcurrentPipeWriter.cs (5)
62Debug.Assert(_currentFlushTcs == null, "There should not be a pending flush."); 163Debug.Assert(_currentFlushTcs != null); 240Debug.Assert(_tail != null); 296Debug.Assert(_currentFlushTcs != null); 329Debug.Assert(_tail != null);
Internal\Infrastructure\ResourceCounter.cs (1)
64Debug.Assert(_count >= 0, "Resource count is negative. More resources were released than were locked.");
Internal\Infrastructure\StatusCheckPipeWriter.cs (1)
33Debug.Assert(_context != null);
Internal\Infrastructure\StatusCheckWriteStream.cs (1)
27Debug.Assert(_context != null);
Internal\Infrastructure\StreamCloseAwaitable.cs (1)
22Debug.Assert(ReferenceEquals(_callback, _callbackCompleted));
Internal\Infrastructure\TimeoutControl.cs (4)
116Debug.Assert(_minReadRate != null); 170Debug.Assert(_timeoutTimestamp == long.MaxValue, "Concurrent timeouts are not supported."); 206Debug.Assert(_concurrentIncompleteRequestBodies == 0 || minRate == _minReadRate, "Multiple simultaneous read data rates are not supported."); 261Debug.Assert(count >= 0, "BytesRead count must not be negative.");
Internal\KestrelServerImpl.cs (1)
341Debug.Assert(Options.ConfigurationLoader != null, "Rebind can only happen when there is a ConfigurationLoader.");
Internal\SniOptionsSelector.cs (1)
154Debug.Assert(_fallbackServerCertificateSelector != null,
Internal\ThrowHelper.cs (1)
24Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
Internal\WebTransport\WebTransportSession.cs (1)
136Debug.Assert(success);
KestrelConfigurationLoader.cs (5)
50Debug.Assert(reloadOnChange || (certificatePathWatcher is null), "If reloadOnChange is false, then certificatePathWatcher should be null"); 267Debug.Assert(!!_loaded || _reloadToken is null, "Shouldn't have a reload token before first load"); 268Debug.Assert(!!ReloadOnChange || _reloadToken is null, "Shouldn't have a reload token unless reload-on-change is set"); 297Debug.Assert(ReloadOnChange); 374Debug.Assert(o.EndpointConfig?.Certificate?.FileHasChanged != true, "Preserving an endpoint with file changes");
KestrelServerOptions.cs (3)
295Debug.Assert(ApplicationServices.GetRequiredService<IHttpsConfigurationService>().IsInitialized, "HTTPS configuration should have been enabled"); 312Debug.Assert(DevelopmentCertificate is null); 394Debug.Assert(status.FailureMessage != null, "Status with a failure result must have a message.");
Middleware\HttpsConnectionMiddleware.cs (4)
93Debug.Assert(_serverCertificate != null); 250Debug.Assert(!certificate.HasPrivateKey, "This should only be called with certificates that don't have a private key"); 315Debug.Assert(_options != null, "Middleware must be created with options."); 411Debug.Assert(_options != null, "Middleware must be created with options.");
src\Shared\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 (5)
71Debug.Assert(!_pendingTableSizeUpdate, "Dynamic table size update should be encoded before headers."); 153Debug.Assert(headerSize <= _maxHeaderTableSize, "Header is bigger than dynamic table size."); 158Debug.Assert(removed != null); 212Debug.Assert(headerSize <= _maxHeaderTableSize, "Header is bigger than dynamic table size."); 213Debug.Assert(headerSize <= _maxHeaderTableSize - _headerTableSize, "Not enough room in dynamic table.");
src\Shared\Hpack\EncoderHeaderEntry.cs (2)
32Debug.Assert(name != null); 33Debug.Assert(value != null);
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (4)
177Debug.Fail("HPACK decoder reach an invalid state"); 244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (19)
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); 603Debug.Assert(success, $"Stack-allocated space was too small for index '{index}'."); 615Debug.Assert(success, $"Stack-allocated space was too small for \"{name}\".");
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (2)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8); 40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\runtime\Http3\Frames\Http3Frame.cs (1)
43Debug.Assert(VariableLengthIntegerHelper.GetByteCount((long)frameType) == 1, $"{nameof(TryWriteFrameEnvelope)} assumes {nameof(frameType)} will fit within a single byte varint.");
src\Shared\runtime\Http3\Helpers\VariableLengthIntegerHelper.cs (9)
69Debug.Assert((firstByte & LengthMask) == InitialEightByteLengthMask); 73Debug.Assert(value >= 0 && value <= EightByteLimit, "Serialized values are within [0, 2^62)."); 118Debug.Assert(result); 119Debug.Assert(bytesRead == length); 149Debug.Assert(longToEncode >= 0); 150Debug.Assert(longToEncode <= EightByteLimit); 193Debug.Assert(res); 199Debug.Assert(value >= 0); 200Debug.Assert(value <= EightByteLimit);
src\Shared\runtime\Http3\QPack\HeaderField.cs (1)
17Debug.Assert(name.Length > 0);
src\Shared\runtime\Http3\QPack\QPackDecoder.cs (3)
233Debug.Fail("QPACK decoder reach an invalid state"); 428Debug.Assert(_state == State.CompressedHeaders, "Should be ready to parse a new header."); 646Debug.Assert(_stringOctets != null, "String buffer should have a value.");
src\Shared\runtime\Http3\QPack\QPackEncoder.cs (14)
42Debug.Assert(res); 97Debug.Assert(res); 106Debug.Assert(res); 167Debug.Assert(res); 177Debug.Assert(res); 204Debug.Assert(written == encodedStringLength); 235Debug.Assert(separator != null); 236Debug.Assert(Ascii.IsValid(separator)); 303Debug.Assert(buffer.Length >= s.Length); 312Debug.Assert(status == OperationStatus.Done); 313Debug.Assert(bytesWritten == s.Length); 318Debug.Assert(Ascii.IsValid(s)); 331Debug.Assert(status == OperationStatus.Done); 332Debug.Assert(valueBytesWritten == s.Length);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
246Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
223Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload 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);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (13)
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\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
src\Shared\test\Shared.Tests\runtime\Http2\DynamicTableTest.cs (2)
149Debug.Assert((insertSize % 64) == 0, $"{nameof(insertSize)} must be a multiple of 64 ({nameof(HeaderField)}.{nameof(HeaderField.RfcOverhead)} * 2)"); 157Debug.Assert(data.Length == 16);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (12)
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 (2)
122Debug.Assert(streamId == 0 || streamId == -1, "StreamId sent that was non-zero, which isn't handled by tests"); 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\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (10)
Internal\NamedPipeConnectionListener.cs (2)
63Debug.Assert(!stream.IsConnected, "Stream should have been successfully disconnected to reach this point."); 71Debug.Assert(_completeListeningTask == null, "Already started");
Internal\NamedPipeTransportFactory.cs (1)
28Debug.Assert(OperatingSystem.IsWindows(), "Named pipes transport requires a Windows operating system.");
src\Servers\Kestrel\shared\TransportConnection.cs (1)
72Debug.Assert(Application != null);
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
204Debug.Assert(_memoryHandle.HasValue);
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (30)
Internal\QuicConnectionContext.cs (2)
178Debug.Assert(cancellationToken.IsCancellationRequested, "Error requires cancellation is requested."); 189Debug.Fail($"Unexpected exception in {nameof(QuicConnectionContext)}.{nameof(AcceptAsync)}: {ex}");
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\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
src\Shared\ServerInfrastructure\StringUtilities.cs (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 (14)
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 (2)
51Debug.Assert(listenSocket.LocalEndPoint != null); 65Debug.Assert(_listenSocket != null, "Bind must be called first.");
src\Servers\Kestrel\shared\TransportConnection.cs (1)
72Debug.Assert(Application != null);
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
204Debug.Assert(_memoryHandle.HasValue);
src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
Microsoft.AspNetCore.Shared.Tests (123)
runtime\Http2\DynamicTableTest.cs (2)
149Debug.Assert((insertSize % 64) == 0, $"{nameof(insertSize)} must be a multiple of 64 ({nameof(HeaderField)}.{nameof(HeaderField.RfcOverhead)} * 2)"); 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 (5)
71Debug.Assert(!_pendingTableSizeUpdate, "Dynamic table size update should be encoded before headers."); 153Debug.Assert(headerSize <= _maxHeaderTableSize, "Header is bigger than dynamic table size."); 158Debug.Assert(removed != null); 212Debug.Assert(headerSize <= _maxHeaderTableSize, "Header is bigger than dynamic table size."); 213Debug.Assert(headerSize <= _maxHeaderTableSize - _headerTableSize, "Not enough room in dynamic table.");
src\Shared\Hpack\EncoderHeaderEntry.cs (2)
32Debug.Assert(name != null); 33Debug.Assert(value != null);
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (6)
119Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 128Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 168Debug.Assert(_backingBuffer != null); 177Debug.Assert(_nativeRequest != null, "RequestContextBase::ReleasePins()|ReleasePins() called twice."); 215Debug.Assert(_nativeRequest == null, "RequestContextBase::Dispose()|Dispose() called before ReleasePins()."); 226Debug.Assert((int)HTTP_VERB.HttpVerbMaximum == HttpVerbs.Length);
src\Shared\HttpSys\RequestProcessing\PathNormalizer.cs (2)
36Debug.Assert(ch1 == '/', "Path segment must always start with a '/'"); 155Debug.Assert(ch1 == '/', "Path segment must always start with a '/'");
src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (1)
22Debug.Assert(rawUrlBytes.Length != 0, "Length of the URL cannot be zero.");
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (2)
106Debug.Assert(_executor != null, "Sync execution is not supported."); 132Debug.Assert(_executorAsync != null, "Async execution is not supported.");
src\Shared\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\HPackDecoder.cs (4)
177Debug.Fail("HPACK decoder reach an invalid state"); 244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (19)
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); 603Debug.Assert(success, $"Stack-allocated space was too small for index '{index}'."); 615Debug.Assert(success, $"Stack-allocated space was too small for \"{name}\".");
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (2)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8); 40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\runtime\Http3\Frames\Http3Frame.cs (1)
43Debug.Assert(VariableLengthIntegerHelper.GetByteCount((long)frameType) == 1, $"{nameof(TryWriteFrameEnvelope)} assumes {nameof(frameType)} will fit within a single byte varint.");
src\Shared\runtime\Http3\Helpers\VariableLengthIntegerHelper.cs (9)
69Debug.Assert((firstByte & LengthMask) == InitialEightByteLengthMask); 73Debug.Assert(value >= 0 && value <= EightByteLimit, "Serialized values are within [0, 2^62)."); 118Debug.Assert(result); 119Debug.Assert(bytesRead == length); 149Debug.Assert(longToEncode >= 0); 150Debug.Assert(longToEncode <= EightByteLimit); 193Debug.Assert(res); 199Debug.Assert(value >= 0); 200Debug.Assert(value <= EightByteLimit);
src\Shared\runtime\Http3\QPack\HeaderField.cs (1)
17Debug.Assert(name.Length > 0);
src\Shared\runtime\Http3\QPack\QPackDecoder.cs (3)
233Debug.Fail("QPACK decoder reach an invalid state"); 428Debug.Assert(_state == State.CompressedHeaders, "Should be ready to parse a new header."); 646Debug.Assert(_stringOctets != null, "String buffer should have a value.");
src\Shared\runtime\Http3\QPack\QPackEncoder.cs (14)
42Debug.Assert(res); 97Debug.Assert(res); 106Debug.Assert(res); 167Debug.Assert(res); 177Debug.Assert(res); 204Debug.Assert(written == encodedStringLength); 235Debug.Assert(separator != null); 236Debug.Assert(Ascii.IsValid(separator)); 303Debug.Assert(buffer.Length >= s.Length); 312Debug.Assert(status == OperationStatus.Done); 313Debug.Assert(bytesWritten == s.Length); 318Debug.Assert(Ascii.IsValid(s)); 331Debug.Assert(status == OperationStatus.Done); 332Debug.Assert(valueBytesWritten == s.Length);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
246Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
223Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload 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\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 (2)
111Debug.Assert(arraySizeRequired % 4 == 0, "Invariant: Array length must be a multiple of 4."); 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.Common.Tests (2)
Internal\Protocol\MessagePackHubProtocolTestBase.cs (2)
465Debug.Assert(size < 16, "Test code doesn't support array sizes greater than 15"); 472Debug.Assert(size < 16, "Test code doesn't support string sizes greater than 15");
Microsoft.AspNetCore.SignalR.Core (22)
HubConnectionContext.cs (1)
300Debug.Assert(_messageBuffer is not null);
Internal\ChannelBasedSemaphore.cs (1)
74Debug.Assert(false);
Internal\DefaultHubActivator.cs (2)
23Debug.Assert(!_created.HasValue, "hub activators must not be reused."); 40Debug.Assert(_created.HasValue, "hubs must be released with the hub activator they were created");
Internal\DefaultHubDispatcher.cs (3)
343Debug.Assert(hub.Clients is HubCallerClients); 612Debug.Assert(authorizePolicy != null); 689Debug.Assert(false, $"Failed to bind argument of type '{descriptor.OriginalParameterTypes[parameterPointer].Name}' for hub method '{descriptor.MethodExecutor.MethodInfo.Name}'.");
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (2)
106Debug.Assert(_executor != null, "Sync execution is not supported."); 132Debug.Assert(_executorAsync != null, "Async execution is not supported.");
src\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 (2)
HubConnectionHandlerTests.cs (1)
3698Debug.Write(response);
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 (6)
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);
StaticAssetsInvoker.cs (1)
169Debug.Fail(exception.ToString());
Microsoft.AspNetCore.StaticFiles (2)
src\Shared\RangeHelper\RangeHelper.cs (1)
67Debug.Assert(rangeHeader.Ranges.Count == 1);
StaticFileContext.cs (1)
345Debug.Fail(exception.ToString());
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 (11)
HandshakeHelpers.cs (4)
175Debug.Assert(ret); 176Debug.Assert(written == len); 270Debug.Assert(ret); 271Debug.Assert(written == len);
src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
47Debug.Assert(_pos == _span.Length);
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (6)
37Debug.Assert(value >= 0); 38Debug.Assert(value <= _chars.Length); 48Debug.Assert(capacity >= 0); 86Debug.Assert(index < _pos); 289Debug.Assert(additionalCapacityBeyondPos > 0); 290Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.AspNetCore.WebUtilities (24)
FileBufferingReadStream.cs (2)
238Debug.Assert(_tempFileDirectoryAccessor != null); 240Debug.Assert(_tempFileDirectory != null);
FileBufferingWriteStream.cs (2)
124Debug.Assert(PagedByteBuffer.Length <= _memoryThreshold); 163Debug.Assert(PagedByteBuffer.Length <= _memoryThreshold);
FormPipeReader.cs (1)
269Debug.Assert(segmentConsumed == keyValuePair.FirstSpan.Length);
HttpRequestStreamReader.cs (3)
258Debug.Assert(charsRemaining == 0); 269Debug.Assert(charsRemaining == 0); 279Debug.Assert(charsRemaining > 0);
HttpResponseStreamWriter.cs (8)
215Debug.Assert(_charBufferCount == _charBufferSize); 251Debug.Assert(count > 0); 252Debug.Assert(_charBufferSize - _charBufferCount < count); 295Debug.Assert(count > 0); 296Debug.Assert(_charBufferSize - _charBufferCount < count); 344Debug.Assert(value.Length > 0); 345Debug.Assert(_charBufferSize - _charBufferCount < value.Length); 616Debug.Assert(_charBufferSize - _charBufferCount >= value.Length);
MultipartReaderStream.cs (6)
202Debug.Assert(matchCount == length); 219Debug.Assert(read == length); // It should have all been buffered 227Debug.Assert(stream.FinalBoundaryFound || remainder.IsEmpty, "Un-expected data found on the boundary line: " + remainder.ToString()); 288Debug.Assert(matchCount == length); 305Debug.Assert(read == length); // It should have all been buffered 313Debug.Assert(stream.FinalBoundaryFound || string.Equals(string.Empty, remainder, StringComparison.Ordinal), "Un-expected data found on the boundary line: " + remainder);
src\Shared\WebEncoders\WebEncoders.cs (2)
111Debug.Assert(arraySizeRequired % 4 == 0, "Invariant: Array length must be a multiple of 4."); 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 (90)
BackEnd\BuildManager\BuildManager.cs (21)
682Debug.Assert(Monitor.IsEntered(_syncLock)); 1035Debug.Assert(allMismatchedProjectStartedEventsDueToLoggerErrors, "There was a mismatched project started event not caused by an exception result"); 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\Client\MSBuildClient.cs (1)
517Debug.Assert(KnownTelemetry.PartialBuildTelemetry == null || KnownTelemetry.PartialBuildTelemetry.StartAt.HasValue, "BuildTelemetry.StartAt was not initialized!");
BackEnd\Components\RequestBuilder\TaskHost.cs (1)
843Debug.Assert(coresAcquired >= 1);
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (1)
191Debug.Fail("Unexpected finalization. Dispose should already have been called.");
Collections\RetrievableEntryHashSet\HashHelpers.cs (1)
61Debug.Assert(min >= 0, "min less than zero; handle overflow checking before calling HashHelpers");
Collections\RetrievableEntryHashSet\HashSet.cs (10)
238Debug.Assert(String.Equals(name, value.Key, StringComparison.Ordinal)); 266Debug.Assert(_buckets != null, "m_buckets was null but m_lastIndex > 0"); 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)); 706Debug.Assert(_count >= 0, "m_count is negative"); 717Debug.Assert(_buckets != null, "m_buckets was null but m_count > 0"); 743Debug.Assert(newSlots.Length <= _slots.Length, "capacity increased after TrimExcess"); 763Debug.Assert(_buckets == null, "Initialize was called but m_buckets was non-null"); 779Debug.Assert(_buckets != null, "IncreaseCapacity called on a set with no elements");
Construction\ProjectElementContainer.cs (1)
444Debug.Assert(child.ExpressedAsAttribute, nameof(SetElementAsAttributeValue) + " method requires that " +
Definition\BuiltInMetadata.cs (1)
76Debug.Assert(FileUtilities.ItemSpecModifiers.IsItemSpecModifier(name));
Definition\ProjectCollection.cs (3)
1653Debug.Assert(_locker.IsWriteLockHeld); 1671Debug.Assert(_locker.IsWriteLockHeld); 1723Debug.Assert(!_locker.IsWriteLockHeld, "We should never raise events while holding a private lock.");
Evaluation\Conditionals\Scanner.cs (2)
84Debug.Assert(false, "What code path did not set an appropriate error resource? Expression: " + _expression); 111Debug.Assert(-1 != _errorPosition); // We should have set it
Evaluation\LazyItemEvaluator.cs (2)
207Debug.Assert(_applyCalls == cacheCount, "Apply should only be called once per globsToIgnore. Otherwise caching is not working"); 213Debug.Assert(_cache == null);
Evaluation\Profiler\ProfilerResultPrettyPrinter.cs (1)
70Debug.Assert(totalTime != null, "There should be at least one evaluation pass result");
FileMatcher.cs (5)
862Debug.Assert(FileUtilities.PathsEqual(searchToExclude.BaseDirectory, recursionState.BaseDirectory), "Expected exclude search base directory to match include search base directory"); 1963Debug.Assert(projectDirectoryUnescaped != null); 1964Debug.Assert(filespecUnescaped != null); 1965Debug.Assert(Path.IsPathRooted(projectDirectoryUnescaped)); 2522Debug.Assert(excludeState.SearchData.RegexFileMatch != null || excludeState.SearchData.DirectoryPattern != null,
FileUtilities.cs (3)
85Debug.Fail("Casing test failed: " + exc); 721Debug.Assert(allowedExtensions?.Length > 0); 729Debug.Assert(!String.IsNullOrEmpty(extension) && extension[0] == '.');
Graph\ProjectGraph.cs (1)
840Debug.Assert(_evaluationContext is not null);
Instance\ProjectItemInstance.cs (2)
1132Debug.Fail($"metadatum from {_itemDefinitions[i]} is null, see https://github.com/dotnet/msbuild/issues/5267"); 1148Debug.Fail("metadatum in _directMetadata is null, see https://github.com/dotnet/msbuild/issues/5267");
Instance\TaskFactories\TaskHostTask.cs (1)
411Debug.WriteLine("[TaskHostTask] Handling packet {0} at {1}", packet.Type, DateTime.Now);
InterningBinaryReader.cs (1)
173Debug.Assert(false, e.ToString());
Logging\BaseConsoleLogger.cs (2)
1210Debug.Assert(shared != null, "This is not supposed to be used in multiple threads or multiple time. One method is expected to return it before next acquire. Most probably it was not returned."); 1266Debug.Assert(previous == null, "This is not supposed to be used in multiple threads or multiple time. One method is expected to return it before next acquire. Most probably it was double returned.");
Logging\InProcessConsoleConfiguration.cs (1)
39Debug.Assert(false, $"MSBuild client warning: problem during enabling support for VT100: {ex}.");
Logging\LogFormatter.cs (1)
39Debug.Assert(timeStamp != DateTime.MinValue, "Timestamp missing");
Logging\ProfilerLogger.cs (3)
105Debug.Assert(_aggregatedLocations == null, 141Debug.Assert(result, 254Debug.Assert(pair.Key.ParentId.HasValue,
ResourceUtilities.cs (3)
281Debug.Fail("The resource string \"" + resourceName + "\" was not found."); 288Debug.Fail("The resource string \"" + resourceName + "\" was not found."); 295Debug.Fail("The resource string \"" + resourceName + "\" was not found.");
TaskEngineAssemblyResolver.cs (2)
54Debug.Assert(_eventHandler == null, "The TaskEngineAssemblyResolver.InstallHandler method should only be called once!"); 84Debug.Assert(false, "There is no handler to remove.");
TaskLoggingHelper.cs (2)
274Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?"); 469Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?");
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);
Utilities\Utilities.cs (4)
661Debug.Fail($"In {nameof(EnumerateProperties)}(): Unexpected: property is null"); 665Debug.Fail($"In {nameof(EnumerateProperties)}(): Unexpected property {item} of type {item?.GetType().ToString()}"); 715Debug.Fail($"In {nameof(EnumerateItems)}(): Unexpected: {nameof(item)} is null"); 719Debug.Fail($"In {nameof(EnumerateItems)}(): Unexpected {nameof(item)} {item} of type {item?.GetType().ToString()}");
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.Conversion.Core (7)
AdditionalOptionsParser.cs (7)
339Debug.Assert(false, "Cannot parse boolean switch: " + compSwitch); 354Debug.Assert(false, "Cannot parse string switch: " + compSwitch); 359Debug.Assert( 375Debug.Assert(false, "Cannot parse multistring switch: " + compSwitch); 380Debug.Assert(false, "Unknown switch value type"); 426Debug.Assert(compSwitchInfo.SwitchValue != null, "Expected non null value for multistring switch"); 437Debug.Assert(false, "Unknown switch value type");
Microsoft.Build.Engine (23)
Conditionals\Scanner.cs (2)
101Debug.Assert(false, "What code path did not set an appropriate error resource? Expression: " + expression); 128Debug.Assert(-1 != errorPosition); // We should have set it
Engine\Engine.cs (2)
1486Debug.Assert(this.projectsLoadedByHost.Count == 0, "Shouldn't the host have unloaded the projects already?"); 2762Debug.Assert(!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("_NTROOT")),
Engine\TargetDependencyAnalyzer.cs (1)
221Debug.Assert(GetItemSpecsFromItemVectors(itemVectorsInTargetInputs).Count > 0, "The target must have inputs.");
Engine\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);
Engine\TaskEngineAssemblyResolver.cs (2)
52Debug.Assert(eventHandler == null, "The TaskEngineAssemblyResolver.InstallHandler method should only be called once!"); 71Debug.Assert(false, "There is no handler to remove.");
LocalProvider\SharedMemory.cs (2)
464Debug.Assert(type == SharedMemoryType.WriteOnly, "Should only be calling Write from a writeonly shared memory object"); 609Debug.Assert(objectToWrite != null, "Expect to get a non-null object from the queue");
Logging\ParallelLogger\ParallelConsoleLogger.cs (1)
1557Debug.Assert(startedEvent != null, "Cannot have finished counter without started counter. ");
Logging\SerialConsoleLogger.cs (1)
787Debug.Assert(false, errorMessage);
Shared\AssemblyNameExtension.cs (1)
285Debug.Assert(result == baselineResult, "Optimized version of CompareBaseNameTo didn't return the same result as the baseline.");
Shared\FileMatcher.cs (1)
578Debug.Assert((filespec == null) || (regexFileMatch == null),
Shared\FileUtilities.cs (1)
356Debug.Assert(FileUtilitiesRegex.UNCPattern.IsMatch(modifiedItemSpec),
Shared\ResourceUtilities.cs (4)
203Debug.Fail("The resource string \"" + resourceName + "\" was not found."); 209Debug.Fail("The resource string \"" + resourceName + "\" was not found."); 214Debug.Fail("The resource string \"" + resourceName + "\" was not found."); 219Debug.Fail("The resource string \"" + resourceName + "\" was not found.");
Microsoft.Build.Engine.OM.UnitTests (11)
FileUtilities.cs (3)
85Debug.Fail("Casing test failed: " + exc); 721Debug.Assert(allowedExtensions?.Length > 0); 729Debug.Assert(!String.IsNullOrEmpty(extension) && extension[0] == '.');
ResourceUtilities.cs (3)
281Debug.Fail("The resource string \"" + resourceName + "\" was not found."); 288Debug.Fail("The resource string \"" + resourceName + "\" was not found."); 295Debug.Fail("The resource string \"" + resourceName + "\" was not found.");
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 (88)
ArraySortHelper.cs (52)
63Debug.Assert(comparer != null, "Check the arguments in the caller!"); 82Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 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); 338Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 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));
BuildException\BuildExceptionBase.cs (1)
112Debug.Assert((exception.Data?.Count ?? 0) == 0,
ChangeWaves.cs (1)
175Debug.Assert(_runningTests || AllWaves.Contains(wave), $"Change wave version {wave} is invalid");
EncodingUtilities.cs (2)
72Debug.Assert(false, "GetEncoding(default OEM encoding) threw an ArgumentException in EncodingUtilities.CurrentSystemOemEncoding! Please log a bug against MSBuild.", ex.Message); 76Debug.Assert(false, "GetEncoding(default OEM encoding) threw a NotSupportedException in EncodingUtilities.CurrentSystemOemEncoding! Please log a bug against MSBuild.", ex.Message);
HashHelpers.cs (3)
89Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 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);
InternalErrorException.cs (1)
134Debug.Fail(message, innerMessage);
ITaskItemExtensions.cs (1)
59Debug.Fail(e.ToString());
ReuseableStringBuilder.cs (1)
326Debug.Assert(returningBuilder.Capacity > returning._borrowedWithCapacity, "Capacity can only increase");
SegmentedArray.cs (6)
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); 483Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
SegmentedArrayHelper.cs (1)
120Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
SegmentedDictionary`2.cs (14)
195Debug.Assert(modified); 202Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 236Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 237Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 337Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 479Debug.Assert(_buckets.Length > 0); 482Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 618Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 650Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 651Debug.Assert(newSize >= _entries.Length); 687Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 709Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 759Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 783Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
StringBuilderCache.cs (1)
92Debug.Assert(StringBuilderCache.t_cachedInstance == null, "Unexpected replacing of other StringBuilder.");
ThrowHelper.cs (2)
273Debug.Fail("The enum value is not defined, please check the ExceptionArgument Enum."); 309Debug.Fail("The enum value is not defined, please check the ExceptionResource Enum.");
Microsoft.Build.Framework.UnitTests (3)
ResourceUtilities.cs (3)
281Debug.Fail("The resource string \"" + resourceName + "\" was not found."); 288Debug.Fail("The resource string \"" + resourceName + "\" was not found."); 295Debug.Fail("The resource string \"" + resourceName + "\" was not found.");
Microsoft.Build.Tasks.Core (96)
AssemblyDependency\CandidateAssemblyFilesResolver.cs (1)
88Debug.Assert(considered.Reason != NoMatchReason.Unknown, "Expected a no match reason here.");
AssemblyDependency\Reference.cs (4)
210Debug.Assert(dependee.FullPath.Length > 0, "Cannot add dependee that doesn't have a full name. This should have already been resolved."); 424Debug.Assert(filenameExtension[0] == '.', "Expected extension to start with '.'"); 445Debug.Assert(!Path.IsPathRooted(filename), "Satellite path should be relative to the current reference."); 457Debug.Assert(!Path.IsPathRooted(filename), "Serialization assembly path should be relative to the current reference.");
AssemblyDependency\ResolveAssemblyReference.cs (6)
1669Debug.Assert(false, "Should have handled this case."); 1714Debug.Assert(false, "Unexpected exception type."); 1852Debug.Assert(false, "Should have handled this case."); 1970Debug.Assert(false, "Should have handled this case."); 2009Debug.Assert(!reference.IsPrimary, "A primary reference should never lose a conflict because of version. This is an insoluble conflict instead."); 2040Debug.Assert(false, "Should have handled this case.");
AssignCulture.cs (1)
191Debug.Assert(false, "Unexpected exception in AssignCulture.Execute. " +
BootstrapperUtil\BootstrapperBuilder.cs (21)
552Debug.Fail(ex.Message); 577Debug.Fail("Already found resources for culture " + stringNode.InnerText); 801Debug.Assert(filePath != null, "null filePath?"); 802Debug.Assert(schemaPath != null, "null schemaPath?"); 803Debug.Assert(schemaNamespace != null, "null schemaNamespace?"); 817Debug.Fail("Could not locate schema '" + schemaPath + "', so no validation of '" + filePath + "' is possible."); 826Debug.Fail("Could not locate data file '" + filePath + "'."); 848Debug.Assert(_document != null, "our document should have been created by now!"); 854Debug.Fail("Failed to load document '" + filePath + "' due to the following exception:\r\n" + ex.Message); 859Debug.Fail("Failed to load document '" + filePath + "' due to the following exception:\r\n" + ex.Message); 867Debug.Assert(xmlDocument.DocumentElement != null && 944Debug.Assert(langDoc != null, "we couldn't load package.xml in '" + strLangManifestFilename + "'...?"); 951Debug.Assert(langNode != null, string.Format(CultureInfo.CurrentCulture, "Unable to find a package node in {0}", strLangManifestFilename)); 1043Debug.WriteLine(String.Format(CultureInfo.CurrentCulture, "Validation results already added for Product Code '{0}'", productCodeAttribute)); 1052Debug.Fail(ex.Message); 1056Debug.Fail(ex.Message); 1060Debug.Fail(ex.Message); 1258Debug.Assert(false, "Specified key does not exist for node " + nextNode.InnerXml); 1564Debug.Assert(sourceAttribute != null, "we should not be here if there is no ProductCode attribute"); 1894Debug.Fail(ex.Message); 1986Debug.Assert(s != null, String.Format(CultureInfo.CurrentCulture, "EmbeddedResource '{0}' not found", name));
BootstrapperUtil\PackageCollection.cs (1)
39Debug.Fail("Package with culture " + package.Culture + " has already been added.");
BootstrapperUtil\Product.cs (2)
34Debug.Fail("Products are not to be created in this fashion. Please use IBootstrapperBuilder.Products instead."); 171Debug.WriteLine(String.Format(CultureInfo.CurrentCulture, "A package with culture '{0}' has already been added to product '{1}'", package.Culture.ToLowerInvariant(), ProductCode));
BootstrapperUtil\ProductCollection.cs (1)
37System.Diagnostics.Debug.WriteLine("Product '{0}' has already been added to the product list", product.ProductCode.ToUpperInvariant());
BootstrapperUtil\productvalidationresults.cs (1)
36System.Diagnostics.Debug.Fail("Validation results have already been added for culture '{0}'", culture);
CSharptokenEnumerator.cs (2)
96Debug.Assert(false, "Code defect in tokenizer: Should have yielded a closing tick."); 160Debug.Assert(false, "Defect in tokenizer: Should have yielded a terminating quote.");
FileMatcher.cs (5)
862Debug.Assert(FileUtilities.PathsEqual(searchToExclude.BaseDirectory, recursionState.BaseDirectory), "Expected exclude search base directory to match include search base directory"); 1963Debug.Assert(projectDirectoryUnescaped != null); 1964Debug.Assert(filespecUnescaped != null); 1965Debug.Assert(Path.IsPathRooted(projectDirectoryUnescaped)); 2522Debug.Assert(excludeState.SearchData.RegexFileMatch != null || excludeState.SearchData.DirectoryPattern != null,
FileUtilities.cs (3)
85Debug.Fail("Casing test failed: " + exc); 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 (3)
3045Debug.Fail("Unknown format " + format.ToString()); 3340Debug.Fail("Unknown format " + format.ToString()); 3370Debug.Assert(_logger.HasLoggedErrors);
InterningBinaryReader.cs (1)
173Debug.Assert(false, e.ToString());
ManifestUtil\ConvertUtil.cs (2)
29Debug.Fail(String.Format(CultureInfo.CurrentCulture, "Invalid value '{0}' for {1}, returning {2}", value, typeof(bool).Name, defaultValue.ToString())); 33Debug.Fail(String.Format(CultureInfo.CurrentCulture, "Invalid value '{0}' for {1}, returning {2}", value, typeof(bool).Name, defaultValue.ToString()));
ManifestUtil\Manifest.cs (4)
528Debug.Assert(false, "AssemblyName cannot be empty"); 774Debug.Fail("Comparing null objects"); 782Debug.Fail("Objects do not have a SortName"); 789Debug.Fail("Comparing objects that are not BaseReferences");
ManifestUtil\TrustInfo.cs (1)
318Debug.Assert(document != null, "GetPermissionSetElement was passed a null document");
ManifestUtil\Util.cs (4)
220Debug.Assert(s != null, String.Format(CultureInfo.CurrentCulture, "EmbeddedResource '{0}' not found", name)); 612Debug.Fail("Comparing null objects"); 617Debug.Fail("Comparing objects that are not ITaskItem"); 624Debug.Fail("Objects do not have a ItemSpec");
ManifestUtil\XmlUtil.cs (1)
194Debug.Fail(String.Format(CultureInfo.CurrentCulture, "ResourceResolver could not find file '{0}'", filename));
RedistList.cs (3)
862Debug.Assert(isValidEntry, string.Format(CultureInfo.InvariantCulture, "Missing attribute in redist file: {0}, line #{1}", path, 895Debug.Assert(firstEntry != null && secondEntry != null); 1084Debug.Assert(name != null && frameworkDirectory != null);
ResGenDependencies.cs (3)
370Debug.Assert(outputFiles != null, "OutputFiles hasn't been set"); 395Debug.Assert(OutputFiles != null, "This has not been initialized"); 396Debug.Assert(otherLibrary.OutputFiles != null, "The other library has not been initialized");
ResolveManifestFiles.cs (13)
349Debug.Assert(!String.IsNullOrEmpty(itemCulture), String.Format(CultureInfo.CurrentCulture, "Satellite item '{0}' is missing expected attribute '{1}'", item.ItemSpec, "Culture")); 865Debug.Assert(!_dictionary.ContainsKey(key), String.Format(CultureInfo.CurrentCulture, "Two or more items with same key '{0}' detected", key)); 924Debug.Assert(!_dictionary.ContainsKey(key), String.Format(CultureInfo.CurrentCulture, "Two or more items with same key '{0}' detected", key)); 958Debug.Assert(!String.IsNullOrEmpty(targetPath)); 965Debug.Assert(!_dictionary.ContainsKey(key), String.Format(CultureInfo.CurrentCulture, "Two or more items with same '{0}' attribute detected", ItemMetadataNames.targetPath)); 1000Debug.Fail(String.Format(CultureInfo.CurrentCulture, "Invalid value '{0}' for {1}", value, "PublishState")); 1004Debug.Fail(String.Format(CultureInfo.CurrentCulture, "Invalid value '{0}' for {1}", value, "PublishState")); 1039Debug.Fail(String.Format(CultureInfo.CurrentCulture, "PublishState.DataFile is invalid for an assembly")); 1046Debug.Fail(String.Format(CultureInfo.CurrentCulture, "Unhandled value PublishFlags.{0}", state.ToString())); 1076Debug.Fail(String.Format(CultureInfo.CurrentCulture, "PublishState.Prerequisite is invalid for a file")); 1079Debug.Fail(String.Format(CultureInfo.CurrentCulture, "Unhandled value PublishFlags.{0}", state.ToString())); 1106Debug.Fail(String.Format(CultureInfo.CurrentCulture, "PublishState.DataFile is invalid for an assembly")); 1113Debug.Fail(String.Format(CultureInfo.CurrentCulture, "Unhandled value PublishFlags.{0}", state.ToString()));
ResourceUtilities.cs (3)
281Debug.Fail("The resource string \"" + resourceName + "\" was not found."); 288Debug.Fail("The resource string \"" + resourceName + "\" was not found."); 295Debug.Fail("The resource string \"" + resourceName + "\" was not found.");
SystemState.cs (1)
654Debug.Assert(false, "Using slow-path in SystemState.GetDirectories, was this intentional?");
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.Tasks.UnitTests (4)
QuotingUtilities.cs (1)
91Debug.Assert(false, "Null character in parameter");
XslTransformation_Tests.cs (3)
980System.Diagnostics.Debug.WriteLine(engine.Log); 1021System.Diagnostics.Debug.WriteLine(engine.Log); 1034System.Diagnostics.Debug.WriteLine(engine.Log);
Microsoft.Build.UnitTests.Shared (2)
DummyMappedDrive.cs (2)
57Debug.Fail("Exception in DummyMappedDrive finalizer: " + e.ToString()); 70Debug.Fail("Exception in DummyMappedDrive finalizer: " + e.ToString());
Microsoft.Build.Utilities.Core (20)
CommandLineBuilder.cs (1)
201Debug.Assert(!hasAllUnquotedCharacters || !hasSomeQuotedCharacters,
FileMatcher.cs (5)
862Debug.Assert(FileUtilities.PathsEqual(searchToExclude.BaseDirectory, recursionState.BaseDirectory), "Expected exclude search base directory to match include search base directory"); 1963Debug.Assert(projectDirectoryUnescaped != null); 1964Debug.Assert(filespecUnescaped != null); 1965Debug.Assert(Path.IsPathRooted(projectDirectoryUnescaped)); 2522Debug.Assert(excludeState.SearchData.RegexFileMatch != null || excludeState.SearchData.DirectoryPattern != null,
FileUtilities.cs (3)
85Debug.Fail("Casing test failed: " + exc); 721Debug.Assert(allowedExtensions?.Length > 0); 729Debug.Assert(!String.IsNullOrEmpty(extension) && extension[0] == '.');
ResourceUtilities.cs (3)
281Debug.Fail("The resource string \"" + resourceName + "\" was not found."); 288Debug.Fail("The resource string \"" + resourceName + "\" was not found."); 295Debug.Fail("The resource string \"" + resourceName + "\" was not found.");
TaskLoggingHelper.cs (2)
274Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?"); 469Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?");
ToolTask.cs (1)
436Debug.Assert(ExitCode != 0, "HandleTaskExecutionErrors should only be called if there were problems executing the task");
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.Cci.Extensions (2)
Traversers\ResolveAllReferencesTraverser.cs (2)
108System.Diagnostics.Debug.Write("Fail"); 121System.Diagnostics.Debug.WriteLine("No dependent for " + reference.ToString());
Microsoft.CSharp (859)
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 (3)
26Debug.Fail("Name should not be called for this binder"); 41Debug.Assert(name != null); 84Debug.Assert(_argumentInfo.Length == 2);
Microsoft\CSharp\RuntimeBinder\CSharpConvertBinder.cs (2)
25Debug.Fail("Name should not be called for this binder"); 35Debug.Assert(arguments.Length == 1);
Microsoft\CSharp\RuntimeBinder\CSharpGetMemberBinder.cs (1)
26Debug.Assert(arguments.Length == 1);
Microsoft\CSharp\RuntimeBinder\CSharpUnaryOperationBinder.cs (2)
26Debug.Fail("Name should not be called for this binder"); 70Debug.Assert(_argumentInfo.Length == 1);
Microsoft\CSharp\RuntimeBinder\DynamicDebuggerProxy.cs (1)
175Debug.Assert((numberOfArguments == argTypes.Length) && (numberOfArguments == argFlags.Length), "Argument arrays size mismatch.");
Microsoft\CSharp\RuntimeBinder\Errors\ErrorFacts.cs (1)
198Debug.Fail("Missing resources for the error " + code.ToString());
Microsoft\CSharp\RuntimeBinder\Errors\ErrorHandling.cs (5)
71Debug.Assert(0 != (arg.eaf & ErrArgFlags.Unique) && 0 == (arg.eaf & ErrArgFlags.NoStr)); 91Debug.Fail("Shouldn't be here!"); 101Debug.Assert(0 != (args[prgiarg[j]].eaf & ErrArgFlags.Unique)); 115Debug.Assert(0 != (arg2.eaf & ErrArgFlags.Unique) && 0 == (arg2.eaf & ErrArgFlags.NoStr)); 135Debug.Fail("Shouldn't be here!");
Microsoft\CSharp\RuntimeBinder\Errors\UserStringBuilder.cs (8)
18Debug.Assert(_strBuilder == null || _strBuilder.Length == 0); 24Debug.Assert(_strBuilder != null); 60Debug.Fail("impossible sk"); 189Debug.Assert(meth == prop.SetterMethod); 209Debug.Assert(meth == @event.methRemove); 386Debug.Fail($"Bad symbol kind: {sym.getKind()}"); 469Debug.Assert(elementType != null, "No element type"); 532Debug.Fail("Bad type kind");
Microsoft\CSharp\RuntimeBinder\ExpressionTreeCallRewriter.cs (26)
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); 206Debug.Fail("Invalid Predefined Method in VisitCALL"); 271Debug.Fail("How did we get a call that doesn't have a methodinfo?"); 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 || 408Debug.Fail("How did we get a prop that doesn't have a propinfo?"); 427Debug.Assert(fieldInfo != null); 501Debug.Assert(list != null); 553Debug.Fail("Invalid Predefined Method in GenerateBinaryOperator"); 573Debug.Assert(isLifted != null); 630Debug.Fail("Invalid Predefined Method in GenerateUserDefinedBinaryOperator"); 655Debug.Fail("Invalid Predefined Method in GenerateUnaryOperator"); 685Debug.Fail("Invalid Predefined Method in GenerateUserDefinedUnaryOperator"); 703Debug.Assert(pExpr.Type is NullType); 710Debug.Assert(call != null); 712Debug.Assert(pm == PREDEFMETH.PM_EXPRESSION_CONVERT || 881Debug.Fail("Invalid Predefined Method in GetExpression"); 912Debug.Assert(expressions.Count == arrinit.DimensionSizes[0]);
Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs (22)
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); 562Debug.Fail("Unhandled kind"); 693Debug.Assert(t != null); // Would have thrown in PopulateSymbolTableWithPayloadInformation already 750Debug.Fail("Unexpected type returned from lookup"); 821Debug.Assert(result != null); 857Debug.Assert(prop != null); 945Debug.Assert(arguments.Length == 1); 985Debug.Assert(arguments.Length == 2); 1014Debug.Fail("Unknown operator: " + p); 1137Debug.Assert(type != typeof(string)); 1145Debug.Assert(callingObject.Type is ArrayType); 1176Debug.Fail("Unexpected type returned from lookup"); 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 (10)
141Debug.Fail("Bad kind in CompareTypes"); 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 (40)
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); 497Debug.Assert(exprType <= FUNDTYPE.FT_LASTNUMERIC, "Error in constant conversion logic!"); 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 (33)
74Debug.Assert((_flags & CONVERTTYPE.STANDARD) == 0); 134Debug.Fail($"Bad type kind: {_typeDest.TypeKind}"); 189Debug.Assert(_typeSrc != null); 190Debug.Assert(_typeDest != null); 204Debug.Assert(valueSrc.Type == _typeSrc.StripNubs()); 207Debug.Fail("BindExplicitConversion failed unexpectedly"); 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 (27)
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); 1190Debug.Fail("Unreachable"); 1218Debug.Assert(0 == (_pGroup.Flags & EXPRFLAG.EXF_CTOR)); 1224Debug.Assert(!(_pGroup.ParentType is TypeParameterType));
Microsoft\CSharp\RuntimeBinder\Semantics\ImplicitConversion.cs (20)
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); 149Debug.Fail($"Bad type symbol kind: {_typeSrc.TypeKind}"); 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); 382Debug.Fail("bind(Im|Ex)plicitConversion failed unexpectedly"); 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 (134)
177Debug.Assert(prgbofs != null); 193Debug.Assert(rgbofs != null); 216Debug.Fail("Shouldn't happen!"); 238Debug.Assert(typeSig1.IsValueType); 265Debug.Assert(typeSig1.IsValueType); 302Debug.Fail("Shouldn't happen!"); 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)); 1146Debug.Fail($"Bad op: {op}"); 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); 1417Debug.Fail("Shouldn't happen!"); 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); 1775Debug.Fail($"Bad kind: {ek}"); 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); 2174Debug.Fail($"Bad ek: {ek}"); 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 (10)
61Debug.Assert(_Params == null, "Should only be set once"); 92Debug.Assert(index < Params.Count); 103Debug.Assert(_optionalParameterIndex != null); 125Debug.Assert(index < Params.Count); 126Debug.Assert(_defaultParameterIndex != null); 132Debug.Assert(_defaultParameterIndex != null); 140Debug.Assert(HasDefaultParameterValue(index)); 141Debug.Assert(_defaultParameterIndex != null); 147Debug.Assert(HasDefaultParameterValue(index)); 164Debug.Assert(IsMarshalAsParameter(index));
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\MethodSymbol.cs (7)
40Debug.Assert(!_inferenceMustFail); 114Debug.Assert(isPropertyAccessor()); 120Debug.Assert(isPropertyAccessor()); 126Debug.Assert(isEventAccessor()); 132Debug.Assert(isEventAccessor()); 139Debug.Assert(MethKind == MethodKindEnum.ExplicitConv || MethKind == MethodKindEnum.ImplicitConv); 166Debug.Fail("cannot find property for accessor");
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 (3)
86Debug.Assert(_access != ACCESS.ACC_UNKNOWN); 169Debug.Fail("GetAssemblyID called on bad sym kind"); 192Debug.Fail("InternalsVisibleTo called on bad sym kind");
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 (4)
28Debug.Assert(child.nextSameName == null); 29Debug.Assert(child.parent == null || child.parent == parent); 54Debug.Assert(sym != null && sym.nextSameName == null); 96Debug.Fail("Sub-optimal overload called. Check if this can be avoided.");
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\Constant.cs (1)
40Debug.Assert(
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\EXPR.cs (3)
34Debug.Assert(!(this is ExprList)); 35Debug.Assert(_type != null); 47Debug.Fail("Invalid Expr in GetObject");
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 (12)
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); 315Debug.Fail("Unexpected type."); 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\NullableType.cs (1)
63Debug.Fail("Constant nullable?");
Microsoft\CSharp\RuntimeBinder\Semantics\Types\PointerType.cs (1)
37Debug.Fail("Constant of pointer in dynamic code?");
Microsoft\CSharp\RuntimeBinder\Semantics\Types\PredefinedTypes.cs (1)
187Debug.Assert(s_types[i].Type == (PredefinedType)i);
Microsoft\CSharp\RuntimeBinder\Semantics\Types\Type.cs (1)
132Debug.Fail("Bad type for AsAggregateType");
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeArray.cs (4)
73Debug.Fail("Sub-optimal overload called. Check if this can be avoided."); 88Debug.Assert(types != null); 101Debug.Assert(Count >= 0); 102Debug.Assert(Array.TrueForAll(Items, item => item != null));
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeManager.cs (46)
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); 91Debug.Assert(atsOuter == null || atsOuter.OwningAggregate == agg.Parent, ""); 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); 152Debug.Assert(!(pUnderlyingType is NullableType), "Attempt to make nullable of nullable"); 174Debug.Assert(pParamModifier.ParameterType == paramType); 184Debug.Assert(typeSrc != null); 191Debug.Assert(typeSrc != null); 257Debug.Fail("Unknown type kind"); 298Debug.Assert(tvs.GetIndexInOwnParameters() == tvs.GetIndexInTotalParameters()); 301Debug.Assert(pctx.MethodTypes != null); 317Debug.Assert(typeDst.Equals(SubstType(typeSrc, typeArgsCls, typeArgsMeth, denormMeth))); 372Debug.Fail("Bad Symbol kind in SubstEqualTypesCore"); 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); 468Debug.Fail("Bad Symbol kind in TypeContainsType"); 474Debug.Assert(typeFind.TypeKind != type.TypeKind); 507Debug.Fail("Bad Symbol kind in TypeContainsTyVars"); 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 (6)
33Debug.Fail("Sub-optimal overload called. Check if this can be avoided."); 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 (4)
82Debug.Fail("Sub-optimal equality called. Check if this is correct."); 91Debug.Fail("If using this as a key, implement IEquatable<SymWithType>"); 131Debug.Assert(ats == null || sym.parent == ats.OwningAggregate); 225Debug.Assert(ats == null || mps != null && mps.getClass() == ats.OwningAggregate);
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (27)
41Debug.Fail("Sub-optimal overload called. Check if this can be avoided."); 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); 639Debug.Fail("Should be unreachable"); 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 (18)
DifferenceWriter.cs (1)
69Debug.Assert(_differences.Count == 0);
NamespaceRemappingComparer.cs (9)
19Debug.Assert(_mappings.Count > 0, "NamespaceRemappingComparers has no namespace remappings."); 39Debug.Assert(name != null); 41Debug.Assert(_mappings.Count > 0, "NamespaceRemappingComparers has no namespace remappings."); 88Debug.Assert(name != null); 91Debug.Assert(name.IndexOf('+') < 0, "Encountered a nested type. Not sure whether to treat that as two types or one, or to only remap the outer type."); 102Debug.Assert(!String.IsNullOrEmpty(mappingFile)); 104Debug.Assert(File.Exists(mappingFile), String.Format("Excepting namespace mapping file \"{0}\" to exist.", mappingFile)); 116Debug.WriteLine("ApiCompat NamespaceRemappingComparer: unparsable line found in file {0}. Line: \"{1}\"", mappingFile, mapping); 123Debug.Assert(_mappings.Count > 0, "Expected to find namespace mappings in our namespace mapping text file. Is this intentional?");
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.Installers (4)
src\Common\Internal\AssemblyResolver.cs (4)
45Debug.WriteLine($"Considering {probingPath} based on RequestingAssembly"); 58Debug.WriteLine($"Considering {probingPath} based on ExecutingAssembly"); 67Debug.WriteLine($"Considering {probingPath} based on BaseDirectory"); 74Debug.WriteLine($"Considering {fileName}");
Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk (4)
src\Common\Internal\AssemblyResolver.cs (4)
45Debug.WriteLine($"Considering {probingPath} based on RequestingAssembly"); 58Debug.WriteLine($"Considering {probingPath} based on ExecutingAssembly"); 67Debug.WriteLine($"Considering {probingPath} based on BaseDirectory"); 74Debug.WriteLine($"Considering {fileName}");
Microsoft.DotNet.Build.Tasks.VisualStudio (1)
Vsix\GetPkgDefAssemblyDependencyGuid.cs (1)
63Debug.Assert(reducedHash.Length == targetBlockSize);
Microsoft.DotNet.Helix.Sdk (4)
src\Common\Internal\AssemblyResolver.cs (4)
45Debug.WriteLine($"Considering {probingPath} based on RequestingAssembly"); 58Debug.WriteLine($"Considering {probingPath} based on ExecutingAssembly"); 67Debug.WriteLine($"Considering {probingPath} based on BaseDirectory"); 74Debug.WriteLine($"Considering {fileName}");
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.SharedFramework.Sdk (4)
src\Common\Internal\AssemblyResolver.cs (4)
45Debug.WriteLine($"Considering {probingPath} based on RequestingAssembly"); 58Debug.WriteLine($"Considering {probingPath} based on ExecutingAssembly"); 67Debug.WriteLine($"Considering {probingPath} based on BaseDirectory"); 74Debug.WriteLine($"Considering {fileName}");
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.SwaggerGenerator.CodeGenerator (2)
HelperFactory.cs (2)
165Debug.WriteLine("Compiling Expression: " + result); 199Debug.WriteLine("Compiling Expression: " + result.ToString());
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 (25)
Internal\BufferChunk.cs (10)
40Debug.Assert(array is not null, "expected valid array input"); 48Debug.Assert(!ReturnToPool, "do not return right-sized arrays"); 49Debug.Assert(Length == array.Length, "array length not respected"); 54Debug.Assert(array is not null, "expected valid array input"); 55Debug.Assert(length >= 0, "expected valid length"); 58Debug.Assert(ReturnToPool == returnToPool, "return-to-pool not respected"); 59Debug.Assert(Length == length, "length not respected"); 69Debug.Assert(Array is null && !ReturnToPool, "expected clean slate after recycle"); 78Debug.Assert(copy.Length == Length, "same length expected"); 79Debug.Assert(!copy.ReturnToPool, "do not return to pool");
Internal\DefaultHybridCache.CacheItem.cs (1)
45Debug.Assert(newCount >= 0, "over-release detected");
Internal\DefaultHybridCache.L2.cs (1)
86Debug.Assert(buffer.Array is not null);
Internal\DefaultHybridCache.Stampede.cs (1)
100Debug.Assert(existingType != newType);
Internal\DefaultHybridCache.StampedeStateT.cs (7)
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); 173Debug.Assert(value.Array is not null, "expected buffer"); 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 (2)
CacheEntry.CacheEntryTokens.cs (1)
116Debug.Assert(entry._tokens != null);
CacheEntry.cs (1)
204Debug.Assert(_current.Value == this, "Entries disposed in invalid order");
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 (9)
RedisCache.cs (9)
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); 689Debug.WriteLine(ex); 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 (16)
DependencyInjectionEventSource.cs (1)
265Debug.Assert(instance != null, "descriptor.ImplementationInstance != null");
ServiceLookup\CallSiteFactory.cs (9)
72Debug.Assert(implementationType != null); 105Debug.Assert(serviceTypeGenericArguments.Length == implementationTypeGenericArguments.Length); 174Debug.Fail("_descriptorLookup didn't contain requested serviceDescriptor"); 301Debug.Assert(callSite != null); 429Debug.Assert(implementationType != null, "descriptor.ImplementationType != null"); 554Debug.Assert(parameterCallSites != null); 726Debug.Assert(_item != null); 737Debug.Assert(_items == null); 787Debug.Assert(_items == null);
ServiceLookup\CallSiteRuntimeResolver.cs (1)
180Debug.Assert(!ServiceProvider.VerifyAotCompatibility || !elementType.IsValueType, "VerifyAotCompatibility=true will throw during building the IEnumerableCallSite if elementType is a ValueType.");
ServiceLookup\DynamicServiceProviderEngine.cs (1)
44Debug.Fail($"We should never get exceptions from the background compilation.{Environment.NewLine}{ex}");
ServiceLookup\Expressions\ExpressionResolverBuilder.cs (2)
121Debug.Assert(!ServiceProvider.VerifyAotCompatibility || !elementType.IsValueType, "VerifyAotCompatibility=true will throw during building the IEnumerableCallSite if elementType is a ValueType."); 130Debug.Assert(!ServiceProvider.VerifyAotCompatibility || !elementType.IsValueType, "VerifyAotCompatibility=true will throw during building the IEnumerableCallSite if elementType is a ValueType.");
ServiceLookup\IEnumerableCallSite.cs (1)
18Debug.Assert(!ServiceProvider.VerifyAotCompatibility || !itemType.IsValueType, "If VerifyAotCompatibility=true, an IEnumerableCallSite should not be created with a ValueType.");
ServiceProvider.cs (1)
180System.Diagnostics.Debug.Assert(result is null || CallSiteFactory.IsService(serviceIdentifier));
Microsoft.Extensions.DependencyInjection.Abstractions (11)
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 (3)
308Debug.Assert(typeArguments.Length == 2); 327Debug.Assert(typeArguments.Length == 3); 333Debug.Assert(false, "ImplementationType, ImplementationInstance, ImplementationFactory or KeyedImplementationFactory must be non null");
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 (8)
Metrics\DebugConsoleMetricListener.cs (2)
44Debug.Assert(userState == this); 63Debug.Assert(state == this);
Metrics\DefaultMeterFactory.cs (1)
30Debug.Assert(options.Name is not null);
Metrics\ListenerSubscription.cs (1)
55Debug.Assert(false, "InstrumentPublished called for an instrument we're already listening to.");
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 (7)
Internal\FileSystemInfoHelper.cs (1)
51Debug.Assert(fileInfo.Exists);
PhysicalFileProvider.cs (1)
153Debug.Assert(!_fileWatcherInitialized);
PhysicalFilesWatcher.cs (1)
469Debug.Assert(state != null);
PollingFileChangeToken.cs (1)
72Debug.Assert(_tokenSource == null, "We expect CancellationTokenSource to be initialized exactly once.");
PollingWildCardChangeToken.cs (3)
75Debug.Assert(_tokenSource == null, "We expect CancellationTokenSource to be initialized exactly once."); 160Debug.Assert(previousHash.Length == currentHash.Length); 176Debug.Assert(_byteBuffer.Length > sizeof(long));
Microsoft.Extensions.Hosting (4)
HostApplicationBuilder.cs (1)
120Debug.Assert(empty, "should only be called with empty: true");
Internal\ConsoleLifetime.netcoreapp.cs (1)
26Debug.Assert(context.Signal == PosixSignal.SIGINT || context.Signal == PosixSignal.SIGQUIT || context.Signal == PosixSignal.SIGTERM);
Internal\Host.cs (1)
241Debug.Assert(_hostedServices != null, "Hosted services are resolved when host is started.");
Internal\ServiceFactoryAdapter.cs (1)
36Debug.Assert(_factoryResolver != null && _contextResolver != null);
Microsoft.Extensions.Hosting.Systemd (1)
SystemdLifetime.netcoreapp.cs (1)
23Debug.Assert(context.Signal == PosixSignal.SIGTERM);
Microsoft.Extensions.Hosting.WindowsServices (3)
WindowsServiceLifetimeHostBuilderExtensions.cs (3)
110Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); 116Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); 137Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
Microsoft.Extensions.Http (8)
ActiveHandlerTrackingEntry.cs (3)
61Debug.Assert(Lifetime != Timeout.InfiniteTimeSpan); 78Debug.Assert(_callback != null); 79Debug.Assert(_timer != null);
DefaultHttpClientFactory.cs (3)
200Debug.Assert(removed, "Entry not found. We should always be able to remove the entry"); 201Debug.Assert(object.ReferenceEquals(active, found!.Value), "Different entry found. The entry should not have been replaced"); 279Debug.Assert(entry != null, "Entry was null, we should always get an entry back from TryDequeue");
DependencyInjection\DefaultHttpClientBuilder.cs (1)
15Debug.Assert(tracker != null);
DependencyInjection\HttpClientBuilderExtensions.cs (1)
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 (5)
LoggerFactoryScopeProvider.cs (2)
139Debug.Assert(activity != null); 140Debug.Assert(activityTrackingOption != ActivityTrackingOptions.None);
LoggerInformation.cs (2)
50Debug.Assert(logger != null || externalScopeProvider != null, "Logger can't be null when there isn't an ExternalScopeProvider"); 67Debug.Assert(Logger != null);
src\libraries\Common\src\Extensions\ProviderAliasUtilities\ProviderAliasUtilities.cs (1)
27Debug.Assert(arg.ArgumentType == typeof(string));
Microsoft.Extensions.Logging.Abstractions (6)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0); 298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
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.Debug (1)
DebugLogger.debug.cs (1)
15System.Diagnostics.Debug.WriteLine(message, category: name);
Microsoft.Extensions.Logging.EventSource (1)
LoggingEventSource.cs (1)
510Debug.Assert(pinnedString == rePinnedString);
Microsoft.Extensions.Logging.Generators (15)
LoggerMessageGenerator.Parser.cs (3)
104Debug.Assert(logMethodSymbol != null, "log method is present."); 184Debug.Assert(false, "Unexpected number of arguments in attribute constructor."); 740Debug.Assert(searchedBrace is '{' or '}');
src\libraries\Common\src\Roslyn\CSharpSyntaxHelper.cs (2)
42Debug.Assert(container != null); 82Debug.Fail("This should not be reachable. Caller already checked we had a compilation unit or namespace.");
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 (6)
28Debug.Assert(value >= 0); 29Debug.Assert(value <= _span.Length); 38Debug.Assert(index < _pos); 91Debug.Assert(index == 0, "Implementation currently only supports index == 0"); 106Debug.Assert(length >= 0); 134Debug.Assert(_pos == _span.Length);
Microsoft.Extensions.ObjectPool (1)
LeakTrackingObjectPool.cs (1)
78Debug.Fail($"{typeof(T).Name} was leaked. Created at: {Environment.NewLine}{_stack}");
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 (7)
CompositeChangeToken.cs (2)
124Debug.Assert(state != null); 149Debug.Assert(disposables != null);
StringSegment.cs (1)
108Debug.Assert(Buffer is not null);
StringValues.cs (1)
192Debug.Assert(value is string[]);
ThrowHelper.cs (3)
61Debug.Assert(Enum.IsDefined(typeof(ExceptionResource), resource), 72Debug.Fail($"Unexpected resource {resource}"); 79Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument),
Microsoft.Extensions.SecretManager.Tools.Tests (1)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
47Debug.Assert(tfms.Length > 0);
Microsoft.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 (3)
LibraryImportGenerator.cs (3)
259Debug.Assert(generatedDllImportAttr is not null); 439Debug.Assert(!options.GenerateForwarders, "GenerateForwarders should have already been handled to use a forwarder stub"); 499Debug.Assert(target.StringMarshalling == StringMarshalling.Utf16);
Microsoft.Interop.SourceGeneration (15)
ArrayMarshallingInfoProvider.cs (1)
83Debug.WriteLine("Default marshallers for arrays should be a valid shape.");
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);
ManualTypeMarshallingHelper.cs (1)
177Debug.WriteLine($"{attr} has {attr.ConstructorArguments.Length} constructor arguments - expected 3");
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 (4)
DotNetObjectReferenceOfT.cs (1)
51Debug.Assert(_objectId != 0, "Accessing ObjectId without tracking is always incorrect.");
Infrastructure\DotNetDispatcher.cs (1)
227Debug.Assert(count == receivedBytes);
JSRuntime.cs (1)
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 (3)
HeaderUtilities.cs (2)
266Debug.Assert(false, $"Index '{nameof(current)}' not advanced, this is a bug."); 320Debug.Assert(false, $"Index '{nameof(current)}' not advanced, this is a bug.");
SetCookieHeaderValue.cs (1)
269Debug.Assert(formatted);
Microsoft.NET.Sdk.WebAssembly.Pack.Tasks (2)
GenerateWasmBootJson.cs (2)
268Debug.Assert(!string.IsNullOrEmpty(targetPath), "Target path for '{0}' must exist.", resource.ItemSpec); 314Debug.Assert(!string.IsNullOrEmpty(targetPath), "Target path for '{0}' must exist.", resource.ItemSpec);
Microsoft.VisualBasic.Core (344)
Microsoft\VisualBasic\Collection.vb (17)
58Debug.Assert(m_KeyedNodesHash.ContainsKey(Key), "We got an argumentexception from a hashtable add, but it wasn't a duplicate key.") 78Debug.Assert(BeforeNode IsNot Nothing) 93Debug.Assert(AfterNode IsNot Nothing) 156Debug.Assert(node IsNot Nothing) 162Debug.Assert(node.m_Key IsNot Nothing, "How can that be? We just found it by its key.") 170Debug.Assert(node Is Nothing) 178Debug.Assert(node IsNot Nothing, "Should have thrown exception rather than return Nothing") 197Debug.Assert(node IsNot Nothing, "Should have thrown rather than returning Nothing") 213Debug.Assert(node IsNot Nothing) 337Debug.Assert(CultureInfo IsNot Nothing) 385Debug.Assert(NodeToBeDeleted IsNot Nothing, "How can we remove a non-existent node ?") 448Debug.Assert(NodeToInsertBefore IsNot Nothing, "FastList.InsertBefore: NodeToInsertBefore may not be nothing") 456Debug.Assert(NodeToInsertAfter IsNot Nothing, "FastList.InsertAfter: NodeToInsertAfter may not be nothing") 514Debug.Assert(NodeToBeDeleted IsNot Nothing, "How can we delete a non-existent node ?") 518Debug.Assert(NodeToBeDeleted Is m_StartOfList, "How can any node besides the first node not have a previous node ?") 571Debug.Assert(NewOrRemovedNode IsNot Nothing, "AdjustIndexes: Node shouldn't be Nothing") 681Debug.Assert(node IsNot Nothing, "Should have thrown exception rather than return Nothing")
Microsoft\VisualBasic\CompilerServices\ConversionResolution.vb (34)
150Debug.Assert(GetTypeCode(Result.GetType()) = tc, "Widest type is invalid") 160Debug.Assert(TypeCode.Empty = 0, "wrong value!") 161Debug.Assert(TypeCode.Object = 1, "wrong value!") 162Debug.Assert(TypeCode.Boolean = 3, "yte is wrong value!") 163Debug.Assert(TypeCode.Char = 4, "wrong value!") 164Debug.Assert(TypeCode.SByte = 5, "wrong value!") 165Debug.Assert(TypeCode.Byte = 6, "wrong value!") 166Debug.Assert(TypeCode.Int16 = 7, "wrong value!") 167Debug.Assert(TypeCode.UInt16 = 8, "wrong value!") 168Debug.Assert(TypeCode.Int32 = 9, "wrong value!") 169Debug.Assert(TypeCode.UInt32 = 10, "wrong value!") 170Debug.Assert(TypeCode.Int64 = 11, "wrong value!") 171Debug.Assert(TypeCode.UInt64 = 12, "wrong value!") 172Debug.Assert(TypeCode.Single = 13, "wrong value!") 173Debug.Assert(TypeCode.Double = 14, "wrong value!") 174Debug.Assert(TypeCode.Decimal = 15, "wrong value!") 175Debug.Assert(TypeCode.DateTime = 16, "wrong value!") 176Debug.Assert(TypeCode.String = 18, "wrong value!") 185Debug.Assert(Not targetType.IsByRef AndAlso Not sourceType.IsByRef, "ByRef types unexpected.") 204Debug.Assert(IsIntrinsicType(targetTypeCode) AndAlso IsIntrinsicType(sourceTypeCode), "expected intrinsics here") 213Debug.Assert(Not targetType.IsByRef AndAlso Not sourceType.IsByRef, "ByRef types unexpected.") 250Debug.Assert(False, "all conversions from interface should have been handled by now") 331Debug.Assert(Not IsInterface(sourceType), 362Debug.Assert(IsInterface(targetInterface), "Non-Interface type unexpected!!!") 363Debug.Assert(IsArrayType(sourceArrayType), "Non-Array type unexpected!!!") 478Debug.Assert(Not targetType.IsByRef AndAlso Not sourceType.IsByRef, "ByRef types unexpected.") 590Debug.Assert(types.Count > 0, "unexpected empty set") 597Debug.Assert(candidate Is maxEncompassing OrElse Not Encompasses(maxEncompassing, candidate), 616Debug.Assert(types.Count > 0, "unexpected empty set") 624Debug.Assert(candidate Is maxEncompassed OrElse Not Encompasses(candidate, maxEncompassed), 839Debug.Assert(Not wideningOnly AndAlso sourceDeriveds.Count > 0, "unexpected state") 848Debug.Assert(Not wideningOnly AndAlso targetBases.Count > 0, "unexpected state") 944Debug.Assert(ClassifyPredefinedConversion(targetType, sourceType) = ConversionClass.None, 979Debug.Assert(operatorSet.Count > 0, "expected operators")
Microsoft\VisualBasic\CompilerServices\Conversions.vb (8)
2419Debug.Assert(iconv.GetTypeCode = GetTypeCode(TargetType), "expected types to match") 2439Debug.Fail("shouldn't reach here") 2457Debug.Assert(IsIntrinsicType(Expression.GetType) OrElse IsEnum(Expression.GetType), "this function converts between intrinsic types only") 2482Debug.Fail("Expected intrinsic type only, not: " & TargetType.Name) 2517Debug.Assert(Not SourceType.IsByRef, "never expected to see byref source type") 2548Debug.Assert(ClassifyPredefinedConversion(TargetType, SourceType) = ConversionClass.None OrElse 2612Debug.Assert(Result = ConversionClass.Widening OrElse Result = ConversionClass.Narrowing, 2643Debug.Assert(
Microsoft\VisualBasic\CompilerServices\LateBinding.vb (6)
293Debug.Assert(OperatingSystem.IsWindows()) 599Debug.Assert(False, ex.Message) 851Debug.Assert(False) 1212Debug.Assert(Not Member Is Nothing, "How can this be Nothing ?") 1229Debug.Assert(False, "How can a property get here ?") 1234Debug.Assert(False, "How did we get here ?")
Microsoft\VisualBasic\CompilerServices\LikeOperator.vb (31)
78Debug.Assert(Options <> CompareOptions.Ordinal, "Char expansion check unexpected during binary compare") 455Debug.Assert(Comparer IsNot Nothing, "Like Operator - Comparer expected for option compare text") 456Debug.Assert(Not MatchBothCharsOfExpandedCharInRight OrElse Not UseUnexpandedCharForRight, "Conflicting compare options") 493Debug.Assert(LeftEnd < LeftLength AndAlso RightEnd < RightLength, "Comparing chars beyond end of string") 517Debug.Assert(Comparer IsNot Nothing, "Like Operator - Comparer expected for option compare text") 537Debug.Assert(Comparer IsNot Nothing, "Like Operator - Comparer expected for option compare text") 563Debug.Assert(PatternIndex <= PatternLength AndAlso 567Debug.Assert(RangeList Is Nothing OrElse ValidatePatternWithoutMatching, "Unexpected options to MatchRange") 784Debug.Assert(Not ValidatePatternWithoutMatching, "Unexpected string matching when validating pattern string") 912Debug.Assert(PatType = PatternType.STRING, "Unexpected pattern group type") 916Debug.Assert(PatType = PatternType.STRING, "Unexpected pattern group type") 924Debug.Assert(PatType = PatternType.STRING, "Unexpected pattern group type") 928Debug.Assert(PatType = PatternType.STRING, "Unexpected pattern group type") 942Debug.Assert(PatType = PatternType.STAR OrElse PatType = PatternType.NONE, "Unexpected pattern group type") 946Debug.Assert(PatType = PatternType.STAR OrElse PatType = PatternType.NONE, "Unexpected pattern group type") 958Debug.Assert(PatType = PatternType.EXCLIST OrElse PatType = PatternType.INCLIST, "Unexpected pattern group type") 962Debug.Assert(PatType = PatternType.EXCLIST OrElse PatType = PatternType.INCLIST, "Unexpected pattern group type") 971Debug.Assert(PatType = PatternType.EXCLIST OrElse PatType = PatternType.INCLIST, "Unexpected pattern group type") 975Debug.Assert(PatType = PatternType.EXCLIST OrElse PatType = PatternType.INCLIST, "Unexpected pattern group type") 1165Debug.Assert(False, "Unexpected pattern kind") 1190Debug.Assert(PatternIndex <= PatternLength AndAlso 1229Debug.Assert(PatternGroups IsNot Nothing AndAlso 1281Debug.Assert(PatternGroups(PGIndex).PatType = PatternType.NONE, "Unexpected pattern end") 1310Debug.Assert(False, "Unexpected pattern kind") 1356Debug.Assert(PatternGroups(PGIndex).PatType = PatternType.STAR, "Unexpected start of pattern groups list") 1498Debug.Assert(SourceIndex <= PGCurrent.MaxSourceIndex, "Pattern matching lost") 1524Debug.Assert(PatternGroups(PGPrevMismatchIndex).PatType <> PatternType.NONE, "Bad previous mismatch index") 1605Debug.Assert(PG.PatType = PatternType.EXCLIST OrElse PG.PatType = PatternType.INCLIST, "Unexpected pattern group") 1611Debug.Assert(RangeList IsNot Nothing AndAlso RangeList.Count > 0, "Empty RangeList unexpected") 1617Debug.Assert(Range.Start >= 0, "NULL Range start unexpected") 1729Debug.Assert(Options <> CompareOptions.Ordinal, "This method should not be invoked in Option compare binary mode")
Microsoft\VisualBasic\CompilerServices\NewLateBinding.vb (27)
522Debug.Assert(False, "the resolution should have thrown an exception") 720Debug.Assert(False, "the resolution should have thrown an exception - should never reach here") 1096Debug.Assert(False, "the resolution should have thrown an exception") 1182Debug.Assert(baseReference IsNot Nothing, "Nothing unexpected") 1183Debug.Assert(arguments IsNot Nothing, "Nothing unexpected") 1184Debug.Assert(argumentNames IsNot Nothing, "Nothing unexpected") 1185Debug.Assert(typeArguments IsNot Nothing, "Nothing unexpected") 1217Debug.Assert(False, "If ReportErrors is True, GetMembers should have thrown above") 1244Debug.Assert(targetProcedure.IsProperty, "advertised property method isn't.") 1255Debug.Assert(targetProcedure.IsProperty, "advertised property method isn't.") 1259Debug.Assert(propInfo.GetSetMethod Is Nothing OrElse HasIsExternalInitModifier(propInfo.GetSetMethod), "expected error condition") 1263Debug.Assert(propInfo.GetGetMethod Is Nothing, "expected error condition") 1293Debug.Assert(baseReference IsNot Nothing, "expected a base reference") 1294Debug.Assert(methodName IsNot Nothing, "expected method name") 1295Debug.Assert(members IsNot Nothing AndAlso members.Length > 0, "expected members") 1296Debug.Assert(arguments IsNot Nothing AndAlso 1353Debug.Assert(failure = OverloadResolution.ResolutionFailure.None OrElse Not reportErrors, 1357Debug.Assert(resolutionResult Is Nothing, "resolution failed so should have no result") 1361Debug.Assert(resolutionResult IsNot Nothing, "resolution didn't fail, so should have result") 1384Debug.Assert(result = False AndAlso errors.Count > 0, "expected this candidate to fail") 1415Debug.Assert(resolutionResult.IsMethod, "must be a method") 1429Debug.Assert(GetCallTarget(resolutionResult, lookupFlags).Name.StartsWith("set_"), "expected set accessor") 1460Debug.Assert(result = False AndAlso errors.Count > 0, "expected this candidate to fail") 1483Debug.Assert(False, "not a method or property??") 1493Debug.Assert(targetProcedure IsNot Nothing AndAlso arguments IsNot Nothing, "expected arguments") 1504Debug.Assert(arguments.Length > 0, "must have an argument for property set Value") 1515Debug.Assert(GetCallTarget(targetProcedure, lookupFlags).Name.StartsWith("set_"), "expected set accessor")
Microsoft\VisualBasic\CompilerServices\ObjectType.vb (2)
330Diagnostics.Debug.Assert(Not FromType Is ToType, "IsWideningConversion invalid for like types") 1080Diagnostics.Debug.Assert(Int16Result <= 0, "Invalid result")
Microsoft\VisualBasic\CompilerServices\Operators.Resolution.vb (5)
116Debug.Assert((IsBinaryOperator(op) AndAlso arguments.Length = 2) OrElse 137Debug.Assert(arguments.Length > 1, "unary op on Nothing unexpected here") 138Debug.Assert(arguments(1) IsNot Nothing, "binary op on Nothing operands unexpected here") 193Debug.Assert(operatorMethod IsNot Nothing, "Operator can't be nothing at this point") 209Debug.Assert(result = False AndAlso errors.Count > 0, "expected this candidate to fail")
Microsoft\VisualBasic\CompilerServices\Operators.vb (13)
56Debug.Assert(left Is Nothing OrElse right Is Nothing OrElse left.GetType.GetTypeCode = right.GetType.GetTypeCode, 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 (50)
98Debug.Assert(IsNumericType(leftType) AndAlso Not IsEnum(leftType) AndAlso 105Debug.Assert(GetTypeCode(leftType) <> GetTypeCode(rightType), 414Debug.Assert(False, "Unexpected comparison type!!!") 424Debug.Assert(Not (leftWinsAtLeastOnce AndAlso rightWinsAtLeastOnce), 493Debug.Assert(arguments Is Nothing OrElse arguments.Length = argumentCount, "Inconsistency in arguments!!!") 654Debug.Assert((baseReference IsNot Nothing AndAlso baseReference.IsWindowsRuntimeObject) OrElse 686Debug.Assert(False, "unexpected code path") 728Debug.Assert(arguments Is Nothing OrElse arguments.Length = argumentCount, "Inconsistency in arguments!!!") 783Debug.Assert(propertyBlock.GetSetMethod Is Nothing OrElse 790Debug.Assert(setMethod IsNot Nothing, "must have set here") 813Debug.Assert(False, "what is this? just ignore it.") 822Debug.Assert(candidateSignature IsNot Nothing, "must have signature if we have a method") 876Debug.Assert(Not collectOnlyOperators, "didn't expect operator with paramarray") 1040Debug.Assert(Not IsGenericParameter(argumentType), "Generic parameter unexpected!!!") 1116Debug.Assert(Not parameterType.IsByRef, "didn't expect byref parameter type here") 1117Debug.Assert(IsRawGeneric(targetProcedure), "Type inference for instantiated generic unexpected!!!") 1171Debug.Assert(parameterTypeParameters.Length = argumentTypeArguments.Length, 1219Debug.Assert(IsParamArray(parameter), "expected ParamArray parameter") 1319Debug.Assert(targetProcedure.IsMethod, "we shouldn't be inferring type arguments for non-methods") 1348Debug.Assert(parameter IsNot Nothing AndAlso parameterType IsNot Nothing) 1426Debug.Assert(Not (errors Is Nothing AndAlso 1449Debug.Assert(arguments.Length <= parameters.Length OrElse 1486Debug.Assert(paramIndex = targetProcedure.ParamArrayIndex, 1527Debug.Assert(arguments.Length - argIndex <= 1, 1578Debug.Assert(parameters.Length > 0, "expected some parameters here") 'Candidate collection guarantees this. 1672Debug.Assert(typeArguments.Length = targetProcedure.TypeParameters.Length, "expected length match") 1715Debug.Assert(targetProcedure.ArgumentsValidated, 1717Debug.Assert(matchedArguments.Length = parameters.Length OrElse 1720Debug.Assert(arguments.Length <= parameters.Length OrElse 1747Debug.Assert(paramIndex = targetProcedure.ParamArrayIndex, 1775Debug.Assert(arguments.Length - argIndex = 1, 1803Debug.Assert(parameters.Length > 0, "expected some parameters here") 'Candidate collection guarantees this. 1822Debug.Assert(Not matchedParameters(paramIndex), "named argument match collision") 1834Debug.Assert(parameters(index).IsOptional, 1857Debug.Assert(arguments.Length <= parameters.Length OrElse 1890Debug.Assert(paramIndex = targetProcedure.ParamArrayIndex, 1915Debug.Assert(arguments.Length - argIndex <= 1, 1942Debug.Assert(parameters.Length > 0, "expected some parameters here") 'Candidate collection guarantees this. 2006Debug.Assert(copyBack.Length = arguments.Length, "array sizes must match") 2007Debug.Assert(parameterResults.Length = targetProcedure.Parameters.Length, "parameter arrays must match") 2113Debug.Assert(candidate.ArgumentMatchingDone = False, "Argument matching being done multiple times!!!") 2217Debug.Assert(False, "Unexpected comparison type!!!") 2296Debug.Assert(Not (leftWinsAtLeastOnce AndAlso rightWinsAtLeastOnce), 2357Debug.Assert(candidateCount = 1, "Surprising overload candidate remains.") 2462Debug.Assert(errors IsNot Nothing, "expected error table") 2477Debug.Assert(errors IsNot Nothing, "expected error table") 2490Debug.Assert(errors IsNot Nothing, "expected error table") 2499Debug.Assert(errors IsNot Nothing, "expected error table") 2552Debug.Assert(result = False AndAlso errors.Count > 0, "expected this candidate to fail") 2565Debug.Assert(candidateReportCount > 0, "expected at least one candidate")
Microsoft\VisualBasic\CompilerServices\StructUtils.vb (1)
96Debug.Assert(PackSize = 1, "PackSize is not actually set to anything other than 1 in the current library. " _
Microsoft\VisualBasic\CompilerServices\Symbols.vb (28)
181Debug.Assert(IsUserDefinedOperator(method), "expected operator here") 431Debug.Assert(Not IsInterface(implementor), "interfaces can't implement, so why call this?") 432Debug.Assert(IsInterface([interface]), "expected interface, not " & [interface].FullName) 447Debug.Assert((Not derived.IsByRef) AndAlso (Not derived.IsPointer)) 448Debug.Assert((Not base.IsByRef) AndAlso (Not base.IsPointer)) 517Debug.Assert(type.GetGenericTypeDefinition IsNot Nothing, "expected bound generic type") 523Debug.Assert(IsGenericParameter(genericParameter), "expected type parameter") 530Debug.Assert(IsGenericParameter(genericParameter), "expected type parameter") 542Debug.Assert(genericMethodDef IsNot Nothing AndAlso IsRawGeneric(genericMethodDef), "Uninstantiated generic expected!!!") 563Debug.Assert(referringType.DeclaringMethod.IsGenericMethodDefinition, "Unexpected generic method instantiation!!!") 626Debug.Assert(method1 IsNot Nothing AndAlso IsRawGeneric(method1), "Generic method def expected!!!") 627Debug.Assert(method2 IsNot Nothing AndAlso IsRawGeneric(method2), "Generic method def expected!!!") 666Debug.Assert(False, "unexpected membertype") 678Debug.Assert(type.HasElementType, "expected type with element type") 708Debug.Assert(parameters IsNot Nothing, "expected parameter array") 938Debug.Assert(Me.IsWindowsRuntimeObject(), "Expected a Windows Runtime Object") 1002Debug.Assert(Me.IsWindowsRuntimeObject(), "Expected a Windows Runtime Object") 1149Debug.Assert(Me.IsArray, "expected array when getting array value") 1150Debug.Assert(indices IsNot Nothing, "expected valid indices") 1198Debug.Assert(Me.IsArray, "expected array when setting array value") 1199Debug.Assert(arguments IsNot Nothing, "expected valid indices") 1261Debug.Assert(callTarget IsNot Nothing, "must have valid MethodBase") 1263Debug.Assert(Not targetProcedure.IsGeneric OrElse 1393Debug.Assert(rawMethod IsNot Nothing) 1481Debug.Assert(Me.ArgumentsValidated, "can't bind without validating arguments") 1482Debug.Assert(Me.IsMethod, "binding to a non-method") 1494Debug.Assert(Me.IsMethod, "casting a non-method to a method") 1499Debug.Assert(Me.IsProperty, "casting a non-property to a property")
Microsoft\VisualBasic\CompilerServices\Utils.LateBinder.vb (1)
360Debug.Assert(typ IsNot Nothing AndAlso Not typ.IsArray, "Error in array type processing")
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 (8)
1060Diagnostics.Debug.Assert(AmbiguousCount > 0) 1240Debug.Assert(Not SelectedMatch Is Nothing, "Should have already thrown an exception") 1967Diagnostics.Debug.Assert(False, "Should never be reached") 1976Debug.Assert((invokeAttr And BindingFlags.CreateInstance) = 0, "CreateInstance not supported") 1978Debug.Assert(Not name Is Nothing, "Invalid argument") 2248Debug.Assert((Not m_objType Is Nothing) AndAlso (Not m_BindToName Is Nothing)) 2286Debug.Assert(Not Member Is Nothing, "How can this be Nothing ?") 2299Debug.Assert(False, "How can a property get here ?")
Microsoft\VisualBasic\ErrObject.vb (2)
175Diagnostics.Debug.Assert((Not m_HelpContextIsSet) OrElse (Not m_HelpFileIsSet), "Why is this getting called?") 369Diagnostics.Debug.Assert(e IsNot Nothing, "Exception shouldn't be Nothing")
Microsoft\VisualBasic\FileIO\FileSystem.vb (44)
685Debug.Assert(GetParentPath(FullNewPath).Equals(GetParentPath(directory), 722Debug.Assert(GetParentPath(FullNewPath).Equals(GetParentPath(file), 863Debug.Assert(StrCollection IsNot Nothing, "StrCollection is NULL") 895Debug.Assert([Enum].IsDefined(operation), "Invalid Operation") 936Debug.Assert(TargetDirectoryFullPath.Length > SourceDirectoryFullPath.Length, "Target path should be longer") 964Debug.Assert([Enum].IsDefined(operation), "Invalid Operation") 965Debug.Assert(sourceDirectoryPath <> "" And IO.Path.IsPathRooted(sourceDirectoryPath), "Invalid Source") 966Debug.Assert(targetDirectoryPath <> "" And IO.Path.IsPathRooted(targetDirectoryPath), "Invalid Target") 987Debug.Assert(IO.Directory.Exists(targetDirectoryPath), "Should be able to create Target Directory") 1013Debug.Assert([Enum].IsDefined(Operation), "Invalid Operation") 1014Debug.Assert(Exceptions IsNot Nothing, "Null exception list") 1015Debug.Assert(SourceDirectoryNode IsNot Nothing, "Null source node") 1032Debug.Assert(IO.Directory.Exists(SourceDirectoryNode.TargetPath), "TargetPath should have existed or exception should be thrown") 1095Debug.Assert([Enum].IsDefined(operation), "Invalid Operation") 1267Debug.Assert(FilePath <> "" AndAlso IO.Path.IsPathRooted(FilePath), FilePath) 1268Debug.Assert(Text <> "", "Empty text") 1313Debug.Assert(ByteCount <= ByteBuffer.Length) 1330Debug.Assert(Not (TypeOf ex Is ArgumentException Or TypeOf ex Is ArgumentOutOfRangeException Or 1382Debug.Assert(Results IsNot Nothing, "Results is NULL") 1449Debug.Assert(Path <> "" AndAlso IO.Path.IsPathRooted(Path), Path) 1450Debug.Assert(Path.Equals(IO.Path.GetFullPath(Path)), Path) 1451Debug.Assert(NewName <> "", "Null NewName") 1452Debug.Assert(ArgumentName <> "", "Null argument name") 1485Debug.Assert(Not FullPath = "" AndAlso IO.Path.IsPathRooted(FullPath), "Must be full path") 1497Debug.Assert(DInfo.GetFiles(IO.Path.GetFileName(FullPath)).Length = 1, "Must found exactly 1") 1500Debug.Assert(DInfo.GetDirectories(IO.Path.GetFileName(FullPath)).Length = 1, 1517Debug.Assert(Not (TypeOf ex Is ArgumentException OrElse 1600Debug.Assert([Enum].IsDefined(Operation)) 1601Debug.Assert([Enum].IsDefined(TargetType)) 1602Debug.Assert(FullSourcePath <> "" And IO.Path.IsPathRooted(FullSourcePath), "Invalid FullSourcePath") 1603Debug.Assert(FullTargetPath <> "" And IO.Path.IsPathRooted(FullTargetPath), "Invalid FullTargetPath") 1604Debug.Assert(ShowUI <> UIOptionInternal.NoUI, "Why call ShellDelete if ShowUI is NoUI???") 1667Debug.Assert(FullPath <> "" And IO.Path.IsPathRooted(FullPath), "FullPath must be a full path") 1668Debug.Assert(ShowUI <> UIOptionInternal.NoUI, "Why call ShellDelete if ShowUI is NoUI???") 2096Debug.Assert(IO.Directory.Exists(DirectoryPath), "Directory does not exist") 2097Debug.Assert(TargetDirectoryPath <> "" And IO.Path.IsPathRooted(TargetDirectoryPath), "Invalid TargetPath") 2157Debug.Assert(Encoding IsNot Nothing, "Null Decoder") 2158Debug.Assert(Text <> "", "Empty Text") 2179Debug.Assert(ByteBuffer IsNot Nothing, "Null ByteBuffer") 2180Debug.Assert(Count > 0, Count.ToString(CultureInfo.InvariantCulture)) 2181Debug.Assert(m_Decoder IsNot Nothing, "Null Decoder") 2182Debug.Assert(m_Preamble IsNot Nothing, "Null Preamble") 2211Debug.Assert(CharCount = ExpectedCharCount, "Should read all characters") 2245Debug.Assert(BigBuffer.Length > SmallBuffer.Length, "BigBuffer should be longer")
Microsoft\VisualBasic\FileIO\TextFieldParser.vb (26)
364Debug.Fail("The TextFieldType is not supported") 656Debug.Assert(m_Buffer IsNot Nothing, "There's no buffer") 657Debug.Assert(m_Reader IsNot Nothing, "There's no StreamReader") 662Debug.Assert(BufferLength >= DEFAULT_BUFFER_LENGTH, "Buffer shrunk to below default") 688Debug.Assert(m_Buffer IsNot Nothing, "There's no buffer") 689Debug.Assert(m_Reader IsNot Nothing, "There's no StreamReader") 690Debug.Assert(m_Position >= 0 And m_Position <= m_Buffer.Length, "The cursor is out of range") 717Debug.Assert(m_Buffer IsNot Nothing, "There's no buffer") 718Debug.Assert(m_Reader IsNot Nothing, "There's no StreamReader") 719Debug.Assert(m_Position = 0, "Non-zero position") 739Debug.Assert(CharsRead <= m_Buffer.Length - m_CharsRead, "We've read more chars than we have space for") 811Debug.Assert(m_Buffer IsNot Nothing, "There's no buffer") 812Debug.Assert(Cursor >= 0 And Cursor <= m_CharsRead, "The cursor is out of range") 1007Debug.Assert(m_FieldWidths IsNot Nothing, "No field widths") 1070Debug.Assert(Line IsNot Nothing, "We are parsing a Nothing") 1073Debug.Assert(Length > 0, "A blank line shouldn't be parsed") 1076Debug.Assert(Line(0) <> vbCr And Line(0) <> vbLf, "A blank line shouldn't be parsed") 1098Debug.Assert(Line IsNot Nothing, "No Line sent") 1128Debug.Assert(m_FieldWidths(i) > 0, "Bad field width, this should have been caught on input") 1150Debug.Assert(Widths IsNot Nothing, "There are no field widths") 1197Debug.Fail("Delimiter element is empty. This should have been caught on input") 1229Debug.Fail("Unknown TextFieldType") 1281Debug.Assert((m_DelimitersCopy Is Nothing And m_Delimiters Is Nothing) Or (m_DelimitersCopy IsNot Nothing And m_Delimiters IsNot Nothing), "Delimiters and copy are not both Nothing or both not Nothing") 1299Debug.Assert((m_FieldWidthsCopy Is Nothing And m_FieldWidths Is Nothing) Or (m_FieldWidthsCopy IsNot Nothing And m_FieldWidths IsNot Nothing), "FieldWidths and copy are not both Nothing or both not Nothing") 1316Debug.Fail("Unknown TextFieldType") 1414Debug.Assert(m_Delimiters IsNot Nothing, "No delimiters set!")
Microsoft\VisualBasic\FileSystem.vb (12)
56Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly, 95Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly, 106Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly, 114Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly, 132Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly, 162Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly, 199Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly, 214Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly, 300Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly, 315Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly, 344Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly, 375Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly,
Microsoft\VisualBasic\Helpers\ForEachEnum.vb (5)
69Debug.Assert(Not mAtBeginning) 80Debug.Assert(mNext Is Nothing) 119Debug.Fail("Node shouldn't be nothing") 130Debug.Assert(Node IsNot mCurrent, "If we just inserted Node, then it couldn't be the current node because it's not in the list yet") 157Debug.Fail("Unexpected adjustment type in enumerator")
Microsoft\VisualBasic\Strings.vb (4)
703System.Diagnostics.Debug.Assert(Expression <> "", "Expression is empty") 704System.Diagnostics.Debug.Assert(Find <> "", "Find is empty") 705System.Diagnostics.Debug.Assert(Count > 0, "Number of replacements is 0 or less") 706System.Diagnostics.Debug.Assert([Compare] = CompareMethod.Text Or [Compare] = CompareMethod.Binary, "Unknown compare.")
MSBuild (21)
CommandLineSwitches.cs (4)
407Debug.Assert(s_parameterlessSwitchesMap.Length == (int)ParameterlessSwitch.NumberOfParameterlessSwitches, 409Debug.Assert(s_parameterizedSwitchesMap.Length == (int)ParameterizedSwitch.NumberOfParameterizedSwitches, 414Debug.Assert(i == (int)(s_parameterlessSwitchesMap[i].parameterlessSwitch), 420Debug.Assert(i == (int)(s_parameterizedSwitchesMap[i].parameterizedSwitch),
CoreCLRAssemblyLoader.cs (1)
51Debug.Assert(Path.IsPathRooted(fullPath));
FileUtilities.cs (3)
85Debug.Fail("Casing test failed: " + exc); 721Debug.Assert(allowedExtensions?.Length > 0); 729Debug.Assert(!String.IsNullOrEmpty(extension) && extension[0] == '.');
InterningBinaryReader.cs (1)
173Debug.Assert(false, e.ToString());
QuotingUtilities.cs (1)
91Debug.Assert(false, "Null character in parameter");
ResourceUtilities.cs (3)
281Debug.Fail("The resource string \"" + resourceName + "\" was not found."); 288Debug.Fail("The resource string \"" + resourceName + "\" was not found."); 295Debug.Fail("The resource string \"" + resourceName + "\" was not found.");
TaskEngineAssemblyResolver.cs (1)
84Debug.Assert(false, "There is no handler to remove.");
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);
XMake.cs (2)
3420Debug.WriteLine("An error has happened, throwing an exception"); 3726Debug.Assert((parameterSections.Length >= 1) && (parameterSections.Length <= 2),
MSBuildTaskHost (27)
BuildExceptionBase.cs (1)
112Debug.Assert((exception.Data?.Count ?? 0) == 0,
ChangeWaves.cs (1)
175Debug.Assert(_runningTests || AllWaves.Contains(wave), $"Change wave version {wave} is invalid");
Concurrent\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 (4)
167Debug.Assert(head._frozenForEnqueues); 231Debug.Assert(next == s._nextSegment); 294Debug.Assert(boundedLength >= 2, $"Must be >= 2, got {boundedLength}"); 295Debug.Assert((boundedLength & (boundedLength - 1)) == 0, $"Must be a power of 2, got {boundedLength}");
FileUtilities.cs (3)
85Debug.Fail("Casing test failed: " + exc); 721Debug.Assert(allowedExtensions?.Length > 0); 729Debug.Assert(!String.IsNullOrEmpty(extension) && extension[0] == '.');
InternalErrorException.cs (1)
134Debug.Fail(message, innerMessage);
InterningBinaryReader.cs (1)
173Debug.Assert(false, e.ToString());
ResourceUtilities.cs (3)
281Debug.Fail("The resource string \"" + resourceName + "\" was not found."); 288Debug.Fail("The resource string \"" + resourceName + "\" was not found."); 295Debug.Fail("The resource string \"" + resourceName + "\" was not found.");
StringBuilderCache.cs (1)
92Debug.Assert(StringBuilderCache.t_cachedInstance == null, "Unexpected replacing of other StringBuilder.");
TaskEngineAssemblyResolver.cs (2)
54Debug.Assert(_eventHandler == null, "The TaskEngineAssemblyResolver.InstallHandler method should only be called once!"); 84Debug.Assert(false, "There is no handler to remove.");
netstandard (1)
netstandard.cs (1)
648[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.Debug))]
PresentationBuildTasks (214)
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 (29)
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); 2535Debug.Assert(_codeContexts == null || _codeContexts.Count == 0, "mismatched CodeContexts"); 2554Debug.Assert(HasLocalReference, "if we have a local event, there should be a local mapping PI for it"); 2998Debug.Assert(_codeContexts.Count == 0, "mismatched codecontext"); 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 (5)
43Debug.Assert(bamlWriter != null, "Need a BamlRecordWriter for compiling to Baml"); 152Debug.Assert(_name == null && _nameField == null, "Name has already been set"); 347Debug.Assert(_name == null && _nameField == null, "Name has already been set"); 793Debug.Assert(_name == null && _nameField == null, "Name definition has already been set"); 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);
MS\Internal\Tasks\CompilerLocalReference.cs (3)
181Debug.Assert(String.IsNullOrEmpty(_localCacheFile) != true, "_localCacheFile must not be empty."); 182Debug.Assert(mcPass1 != null, "A valid instance of MarkupCompilePass1 must be passed to method SaveCacheInformation."); 243Debug.Assert(String.IsNullOrEmpty(_localCacheFile) != true, "_localCacheFile must not be empty.");
MS\Internal\Tasks\CompilerState.cs (7)
94Debug.Assert(String.IsNullOrEmpty(_stateFilePath) != true, "StateFilePath must not be empty."); 95Debug.Assert(mcPass1 != null, "A valid instance of MarkupCompilePass1 must be passed to method SaveCacheInformation."); 96Debug.Assert(_cacheInfoList.Length == (int)CompilerStateType.MaxCount, "The Cache string array should be already allocated."); 155Debug.Assert(String.IsNullOrEmpty(_stateFilePath) != true, "_stateFilePath must be not be empty."); 156Debug.Assert(_cacheInfoList.Length == (int)CompilerStateType.MaxCount, "The Cache string array should be already allocated."); 264Debug.Assert(src[str.Length] == '\0', "src[str.Length] == '\\0'"); 265Debug.Assert(((int)src) % 4 == 0, "Managed string should start at 4 bytes boundary");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\MS\Internal\Globalization\LocalizationComments.cs (1)
355Debug.Assert(enumPrefix != null && enumNames != null);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlMapTable.cs (10)
72Debug.Assert(null != xamlTypeMapper); 158Debug.Assert(cmp > 0); 1024Debug.Assert(assemblyFullName.Length != 0, "empty assembly"); 1058Debug.Assert(bamlAssemblyInfoRecord.AssemblyId >= 0); 1094Debug.Assert( 1106Debug.Assert(bamlAssemblyInfoRecord.AssemblyId >= 0); 1286Debug.Assert(ownerTypeName != null); 1287Debug.Assert(attributeName != null); 1470Debug.Assert(GetHashTableData(stringValue) == null, 1504Debug.Assert(targetType != null && memberName != null);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecordHelper.cs (1)
132Debug.Assert(false, "Unhandled case in DoesRecordTypeHaveDebugExtension");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecords.cs (27)
700Debug.Assert(false,"Assembly, Type and Attribute records are not cached, so don't ask for one."); 725Debug.Assert(false,"Unknown RecordType"); 778Debug.Assert(null == _writeCache[(int)record.RecordType]); 868set { Debug.Assert (value == -1, "Setting fixed record to an invalid size"); } 877Debug.Assert(false, "Must override RecordType"); 915Debug.Assert( value <= 3 && value >= 0 ); 1103Debug.Assert(RecordSize < 0); 1513Debug.Assert(_valuePositionPosition != -1, 1696Debug.Assert(_valuePositionPosition != -1, 2061set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2131set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2192set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2399Debug.Assert(value <= ExtensionIdMask); 2419set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 2996set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 3210set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3297set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3446Debug.Assert(_contentSizePosition != -1, 3491set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3651set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 3749set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 3827set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 4012Debug.Assert(FilePos != -1,"UpdateWrite called but Write Never was"); 4555Debug.Assert( SerializerTypeId != 0 ); 4708Debug.Assert((propertyMember is MethodInfo) || (propertyMember is PropertyInfo) 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 (21)
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); 467Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 567Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 604Debug.Assert(!InStaticResourceSection, "We do not support x:Shared within a StaticResource Section"); 788Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 844Debug.Assert(keyRecord.RecordList.Count == 0, "Should have empty record list"); 870Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 881Debug.Assert(_deferElementDepth == 2); 1070Debug.Assert(extensionTypeId != (short)KnownElements.TypeExtension); 1087Debug.Assert(typeValue != null); 1632Debug.Assert(keyRecord != null, "Unknown key record type in defer load dictionary"); 1643Debug.Assert(keyIndex == _deferKeys.Count, 1666Debug.Assert(_deferElementDepth > 0 && CollectingValues, 1674Debug.Assert(valueDeferRecord.Record != null && 1686Debug.Assert(valueDeferRecord.Record != null && valueDeferRecord.Record.RecordType == BamlRecordType.ElementEnd,
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlVersionHeader.cs (2)
104Debug.Assert(length == BamlVersionHeader.BinarySerializationSize, 109Debug.Assert((posEnd-posStart) == BamlVersionHeader.BinarySerializationSize,
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\KnownTypes.cs (3)
4762Debug.Assert(asmFramework != null, "asmFramework must not be null"); 4763Debug.Assert(asmCore != null, "asmCore must not be null"); 4764Debug.Assert(asmBase != null, "asmBase must not be null");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\MarkupExtensionParser.cs (3)
1189Debug.Assert(sb.Length > 0); 1190Debug.Assert(!Char.IsWhiteSpace(sb[0])); 1544Debug.Assert(null != info, "No property or method info for field Name");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\StyleModeStack.cs (2)
51Debug.Assert(Depth >= 0, $"StyleModeStack's depth was {Depth}, should be >= 0"); 68Debug.Assert(Depth >= 0, $"StyleMode::Pop() with depth of {Depth}, should be >= 0");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\StyleXamlParser.cs (3)
510Debug.Assert(_inEventSetter); 1225Debug.Assert(!xamlClrEventNode.IsTemplateEvent && _inEventSetter); 1298Debug.Assert (mode != StyleMode.Base || xamlPropertyNode.PropName != XamlStyleSerializer.TargetTypePropertyName,
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\TreeBuilder.cs (1)
94Debug.Assert (false, "Parse Fragment was not overidden");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlParser.cs (5)
535Debug.Assert(false,"Unknown Xaml Token."); 1101Debug.Assert(null != assemblyName, "assembly name returned from GetBaseElement is null"); 1102Debug.Assert(null != typeFullName, "Type name returned from GetBaseElement is null"); 1247Debug.Assert(SkipActionDepthCount == -1); 1353Debug.Assert(null == _bamlWriter || null == value, "XamlParser already had a bamlWriter");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (53)
128Debug.Assert(xamlParser != null, "Cannot have null xaml parser"); 129Debug.Assert(parserContext != null, "Cannot have null parser context"); 130Debug.Assert(xmlReader != null, "Cannot have null xmlReader"); 341Debug.Assert(null != xamlNode, "null returned from the collection"); 370Debug.Assert(null != XmlReader); 409Debug.Assert(!IsMoreData(), "Setting state to done but not done parsing."); 442Debug.Assert(null != xamlNode, "null returned from the collection"); 1188Debug.Assert(null != typeFullName, "type name not set"); 1189Debug.Assert(null != dynamicObjectName, "dynamicObject name not set"); 1190Debug.Assert(null != assemblyName, "assembly name not set"); 1518Debug.Assert( (null==ContentPropertyInfo && null==ContentPropertyName) 1842Debug.Assert(null == dynamicObject,"DynamicObject should be null for code"); 2006Debug.Assert(false == endTagHasBeenRead, "Read past end tag on end tag"); 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); 3186Debug.Assert(null != assemblyName, "property without an AssemblyName"); 3187Debug.Assert(null != declaringTypeFullName, "property without a type name"); 3188Debug.Assert(null != dynamicObjectName, "property without a field Name"); 3709Debug.Assert(typeAndSerializer == null || 3763Debug.Assert(CurrentContext.ContextType == ElementContextType.PropertyComplex || 4143Debug.Assert(null != assemblyName, "property without an AssemblyName"); 4144Debug.Assert(null != typeFullName, "property without a type name"); 4145Debug.Assert(null != dynamicObjectName, "property without a field Name"); 4823Debug.Assert( collectionTypeID >= 0 5061Debug.Assert( xmlNodeType == XmlNodeType.Text || 5094Debug.Assert( isWhitespace, 5142Debug.Assert (parentNodeType == ElementContextType.Unknown, 5273Debug.Assert(null != XmlReader, "XmlReader is not yet set"); 5321Debug.Assert(false, "XmlReader doesn't support LineNumber"); 5352Debug.Assert(false, "XmlReader doesn't support LinePosition"); 5504Debug.Assert(currentPos > 0 && currentPos < s.Length - 1); 5579Debug.Assert(null != text, "String passed to CollapseText cannot be null"); 5580Debug.Assert(textLength > 0, "String passed to Collapsed Text cannot be empty"); 5840Debug.Assert((_nodeIndex == 0 && _xamlNodes.Count == 0 ) || (_nodeIndex < _xamlNodes.Count), 5860Debug.Assert((_nodeIndex == 0 && _xamlNodes.Count == 0 ) || (_nodeIndex < _xamlNodes.Count), 5887Debug.Assert(!value || _insertionIndex == -1, "Attribute node collection is already marked for insertion."); 5946Debug.Assert(_nodeIndex == _xamlNodes.Count, "NodeIndex is larger than node count."); 6014Debug.Assert( _typeConverterDecisionState == TypeConverterDecisionState.ElementEnd, 6077Debug.Assert(((XamlNode)_xamlNodes[_typeConverterCandidateIndex]).TokenType==XamlNodeType.ElementStart, 6096Debug.Assert(((XamlNode)_xamlNodes[_typeConverterCandidateIndex])==xamlNode, 6120Debug.Assert(((XamlNode)_xamlNodes[_typeConverterCandidateIndex])==xamlNode, 6136Debug.Assert( _typeConverterTextWrittenAndNotProcessed != null, 6165Debug.Assert(((XamlNode)_xamlNodes[_typeConverterCandidateIndex]).TokenType==XamlNodeType.ElementStart, 6357Debug.Fail($"State machine checking for TypeConverter syntax has encountered an unexpected XamlNode type {tokenType}"); 6441Debug.Assert(null != textFlowData, "No data for TextFlow"); 6463Debug.Assert(null != typeRightTag, "ElementType not yet assigned to Node"); 6584Debug.Assert(0 == textFlowData.InlineCount, "Text stack still has an inline count");
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlTypeMapper.cs (18)
954Debug.Assert(null != localName, "null localName"); 955Debug.Assert(null != xmlNamespace, "null xmlNamespace"); 1921Debug.Assert(typeInfo != null, "Must have cached type info at this point"); 2319Debug.Assert(memberName != null); 2322Debug.Assert(memberInfo != null); 2337Debug.Assert(targetType != null); 2413Debug.Assert(null != xmlNamespace,"null value passed for xmlNamespace"); 2414Debug.Assert(null != localName,"null value passed for localName"); 2452Debug.Assert(null != xmlNamespace,"null value passed for xmlNamespace"); 2453Debug.Assert(null != localName,"null value passed for localName"); 2603Debug.Assert(namespaceMap.ClrNamespace != null,"Null CLR Namespace"); 2604Debug.Assert(localName != null,"Null localName"); 3161Debug.Assert(false, "Should initialize cache prior to compiling"); 3432Debug.Assert(false, "Should initialize cache prior to compiling"); 3451Debug.Assert(null != type, "Null passed for type to GetTypeConverterType"); 3526Debug.Assert(null != propType, "Null passed for propType to GetPropertyConverterType"); 3755Debug.Assert(null != type, "null value for type passed to GetWhitespace"); 4021Debug.Assert(_dpLookupHashtable != null,
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XmlnsDictionary.cs (1)
713Debug.Assert(prefix != null);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\TokenizerHelper.cs (2)
195Debug.Assert(!Char.IsWhiteSpace(currentChar),"Token started on Whitespace"); 337Debug.Assert(null != numberFormat);
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (2)
133Debug.Assert(null != type, "Type passed to IsInternalType is null"); 154Debug.Assert(null != type, "Type passed to IsPublicType is null");
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\TypeConverterHelper.cs (2)
103Debug.Assert(null != memberInfo, "Null passed for memberInfo to GetConverterType"); 120Debug.Assert(null != type, "Null passed for type to GetConverterType");
src\Microsoft.DotNet.Wpf\src\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 );
src\Microsoft.DotNet.Wpf\src\WindowsBase\MS\Internal\IO\Packaging\CompoundFile\ContainerUtilities.cs (1)
90Debug.Assert(length >= 0, "The length cannot be negative. Caller must verify this");
PresentationCore (2225)
MS\Internal\AppModel\CookieHandler.cs (1)
116Debug.Assert(size > 0);
MS\Internal\Automation\EventPropertyMap.cs (1)
115Debug.Assert(properties != null);
MS\Internal\DpiUtil\DpiUtil+ProcessDpiAwarenessHelper.cs (1)
105Debug.Assert(windowThreadProcessId != 0, "GetWindowThreadProcessId failed");
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 (2)
142Debug.Assert(fc <= first); 473Debug.Assert(
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 (12)
28System.Diagnostics.Debug.Assert((nodeShape != null) && nodeShape.IsEllipse); 42Debug.Assert(_nodeShapeToCircle.HasInverse, "About to invert a non-invertible transform"); 54Debug.Assert(_nodeShapeToCircle.HasInverse, "Just rotated an invertible transform and produced a non-invertible one"); 70Debug.Assert(_nodeShapeToCircle.HasInverse, "Just scaled an invertible transform and produced a non-invertible one"); 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 (2)
188System.Diagnostics.Debug.Assert(propertyToRemove != null); 325System.Diagnostics.Debug.Assert(!this.Contains(extendedProperty.Id), "ExtendedProperty already belongs to the collection");
MS\Internal\Ink\GestureRecognizer\NativeRecognizer.cs (11)
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)); 687Debug.Assert(!(bestResultColumnCount != 0 && pRecoLattice->pLatticeColumns == IntPtr.Zero), "Invalid results!"); 701Debug.Assert(0 < recoColumn.cLatticeElements, "Invalid results!"); 708Debug.Assert((RECO_TYPE)(recoElement.type) == RECO_TYPE.RECO_TYPE_WCHAR, "The Application gesture has to be WCHAR type" ); 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 (3)
326Debug.Assert(strm != null); 441System.Diagnostics.Debug.Assert(guid == Guid.Empty); 958Debug.Assert(false, "Missing case statement!");
MS\Internal\Ink\InkSerializedFormat\DrawingAttributeSerializer.cs (16)
293System.Diagnostics.Debug.Assert(false, "Corrupt Matrix in the ExtendedPropertyCollection!"); 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); 509System.Diagnostics.Debug.Assert(da.Color != (Color)DrawingAttributes.GetDefaultDrawingAttributeValue(KnownIds.Color), "Color was put in the EPC for the default value!"); 515Debug.Assert(bw != null); 528Debug.Assert(bw != null); 546Debug.Assert(bw != null); 610System.Diagnostics.Debug.Assert(da.StylusTip != StylusTip.Ellipse, "StylusTip was put in the EPC for the default value!"); 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 (8)
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); 2692System.Diagnostics.Debug.WriteLine(message); 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 (2)
299System.Diagnostics.Debug.Assert(false, "ExtendedProperties for points are not supported"); 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 (20)
42System.Diagnostics.Debug.Assert(operations != null); 43System.Diagnostics.Debug.Assert((nodeData.IsEmpty == false) && (index >= 0)); 266Debug.Assert(false, "StrokeNodeOperations.GetPointsAtStartOfSegment failed to find the D position"); 292Debug.Assert(!endNodeRect.Contains(point)); 379Debug.Assert(false, "StrokeNodeOperations.GetPointsAtEndOfSegment failed to find the B position"); 646Debug.Assert(false, "Couldn't find all 4 indexes in StrokeNodeOperations.GetPointsAtMiddleSegment"); 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 (28)
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); 353Debug.Assert(!prevStrokeNode.GetConnectingQuad().IsEmpty, "prevStrokeNode.GetConnectingQuad() is Empty!"); 459Debug.Assert(!strokeNode.GetConnectingQuad().IsEmpty, "strokeNode.GetConnectingQuad was empty, this is unexpected"); 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\ByteRangeDownloader.cs (3)
79Debug.Assert(fileMutex != null, "FileMutex must be a valid mutex"); 80Debug.Assert(tempStream != null, "ByteRangeDownloader requires a stream to write to"); 196Debug.Assert(byteRanges.GetLength(0) == 1, "We don't support a request with multiple byte ranges");
MS\Internal\IO\Packaging\NetStream.cs (10)
731Debug.Assert(_fullStreamLength >= 0, "We assume _fullStreamLength is correct for Http cases - only Ftp can return bogus values"); 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); 1165Debug.Assert(_fullDownloadComplete, "Do not call this unless full download is complete.");
MS\Internal\IO\Packaging\PseudoWebRequest.cs (3)
52Debug.Assert(uri != null, "PackWebRequest uri cannot be null"); 53Debug.Assert(packageUri != null, "packageUri cannot be null"); 54Debug.Assert(partUri != null, "partUri cannot be null");
MS\Internal\IO\Packaging\ResponseStream.cs (4)
50Debug.Assert(container != null, "Logic error: use other constructor for full package request streams"); 51Debug.Assert(owningStream != null, "Logic error: use other constructor for full package request streams"); 74Debug.Assert(s != null, "Logic error: base stream cannot be null"); 75Debug.Assert(response != null, "Logic error: response cannot be null");
MS\Internal\LoadedOrUnloadedOperation.cs (1)
27Debug.Assert(callback != null && target != null);
MS\Internal\Media\VisualTreeUtils.cs (7)
120Debug.Assert(element == null); 179Debug.Fail("How did a ray hit a Visual3D not parented to a Viewport3DVisual?"); 184Debug.Fail(String.Format("Unhandled HitTestResult type '{0}'", result.GetType().Name)); 242Debug.Assert((visual == null) != (visual3D == null), 263Debug.Assert(castSucceeded && ((visual == null) != (visual3D == null)), 270Debug.Assert(!castSucceeded && visual == null && visual3D == null, 288Debug.Fail(String.Format(
MS\Internal\Media3D\GeneralTransform2DTo3DTo2D.cs (1)
492Debug.Assert(uv.Length == p.Length, "vertices and texture coordinate sizes should match");
MS\Internal\Media3D\GeneralTransform3DTo2DTo3D.cs (1)
42Debug.Assert(transform3DTo2D != null && transform2DTo3D != null);
MS\Internal\Media3D\M3DUtil.cs (4)
44Debug.Assert(!bounds.IsEmpty, 148Debug.Assert(matrix.IsAffine); 326Debug.Assert(!matrix.IsAffine); 388Debug.Assert(camera != null, "Caller is responsible for ensuring camera is not null.");
MS\Internal\PartialArray.cs (1)
37Debug.Assert(initialIndex >= 0 && initialIndex + count <= array.Length);
MS\Internal\Shaping\GlyphInfoList.cs (1)
60Debug.Assert(_glyphs.Offset + _glyphs.Length == cch, "Invalid glyph length!");
MS\Internal\Shaping\OpenTypeCommon.cs (11)
232Debug.Assert(TableTag==OpenTypeTags.GSUB || TableTag==OpenTypeTags.GPOS); 233Debug.Assert(FirstGlyph<AfterLastGlyph); 234Debug.Assert(AfterLastGlyph<=GlyphInfo.Length); 599Debug.Assert(false,"Unknown OpenType layout table!"); 735Debug.Assert(featureDescription.Parameter != 0); 785Debug.Assert( FlagToSet==GlyphFlags.NotChanged || 929Debug.Assert(tableTag == OpenTypeTags.GSUB || tableTag == OpenTypeTags.GPOS); 1080Debug.Assert(false,"Ext.Lookup processed earlier!"); 1165Debug.Assert(false,"Ext.Lookup processed earlier!"); 1178Debug.Assert(false,"Unknown OpenType layout table!"); 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 (9)
167Debug.Assert(ichItem == unicodeString.Length); 182Debug.Assert(index >= 0); 226Debug.Assert(false, "Invalid font face spans"); 399Debug.Assert(index >= 0, "Invalid scaled shapeable typeface index spans"); 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\Shaping\UshortList2.cs (4)
142Debug.Assert(false, "Not supported"); 148Debug.Assert(false, "Not supported"); 154Debug.Assert(false, "Not supported"); 159Debug.Assert(false, "Not supported");
MS\Internal\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\Bidi.cs (30)
693Debug.Assert(CharProperty[1, (int) startClass]==1 || (startClass == DirectionClass.ArabicLetter), 696Debug.Assert(CharProperty[1, (int) endClass]==1, ("Cannot use non strong type to resolve neutrals")); 719Debug.Assert(CharProperty[2, (int) characterClass[counter + classIndex]]==0, 744Debug.Assert(CharProperty[2, (int) characterClass[counter + classIndex]]==0, "Changing class of a fixed class"); 855Debug.Assert(startOfNeutrals == PositionInvalid, 900Debug.Assert(startOfDelayed != PositionInvalid, 945Debug.Assert(startOfNeutrals == PositionInvalid, 950Debug.Assert(startOfDelayed != PositionInvalid, 1050Debug.Assert(startOfNeutrals != PositionInvalid, 1089Debug.Assert(startOfNeutrals != PositionInvalid, 1122Debug.Assert(startOfNeutrals == PositionInvalid, 1140Debug.Assert(startOfNeutrals == PositionInvalid, 1153Debug.Assert(startOfDelayed != PositionInvalid, 1167Debug.Assert(startOfNeutrals == PositionInvalid, 1172Debug.Assert(startOfDelayed != PositionInvalid, 1183Debug.Assert(startOfNeutrals != PositionInvalid, 1192Debug.Assert(startOfNeutrals == PositionInvalid, 1210Debug.Assert(startOfDelayed != PositionInvalid, 1214Debug.Assert(lastClass == DirectionClass.EuropeanTerminator, 1221Debug.Assert(startOfNeutrals == PositionInvalid, 1226Debug.Assert(startOfDelayed != PositionInvalid, 1275Debug.Assert(startOfNeutrals != PositionInvalid, 1289Debug.Assert(startOfNeutrals == PositionInvalid, 1294Debug.Assert(startOfDelayed != PositionInvalid, 1326Debug.Assert(startOfNeutrals == PositionInvalid, 1353Debug.Assert(startOfNeutrals == PositionInvalid, 1398Debug.Assert(startOfNeutrals == PositionInvalid, 1434Debug.Assert(startOfDelayed != PositionInvalid, 1576Debug.Assert(startOfNeutrals == PositionInvalid, 2467Debug.Assert(runLengthResolved == runLength,
MS\Internal\TextFormatting\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 (2)
292Debug.Assert(lsccp > 0, "Zero-length text line!"); 302Debug.Assert(!TextStore.IsMarker(plsrun));
MS\Internal\TextFormatting\LineServicesCallbacks.cs (24)
192Debug.Assert(TextStore.IsContent(plsrun), "Unrecognizable run!"); 193Debug.Assert(lsrun.RunProp != null, "invalid lsrun!"); 236Debug.Assert(lsrun.RunProp != null); 517Debug.Assert(Draw.CurrentLine.FullTextState != null); 525Debug.Assert(lsrun.Shapeable != null && stringLength > 0); 624Debug.Assert(markerStore != null, "No marker store, yet autonumbering is specified!"); 692Debug.Assert( 723Debug.Assert(ulInfo.dvpFirstUnderlineSize >= 0); 756Debug.Assert( 772Debug.Assert(stInfo.dvpLowerStrikethroughSize >= 0); 1266Debug.Assert(false, "Not supported TextDecorationUnit"); 1293Debug.Assert(false, "Not supported TextDecorationUnit"); 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); 2342Debug.Assert(false, "Unsupported installed object!"); 2388Debug.Assert(textObject != null); 2446Debug.Assert(false); 2469Debug.Assert(lsrun.Type == Plsrun.InlineObject); 2481Debug.Assert(textObject != null); 2482Debug.Assert(textFlow != LsTFlow.lstflowWS || runDirection != 0); 2630Debug.Assert(fGeometryProvided == 0, "Line enumeration doesn't need geometry information"); 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 (6)
55Debug.Assert(markerStyle != TextMarkerStyle.None); 103Debug.Assert(autoNumberingIndex > 0); 134Debug.Assert(false, "Invalid marker style"); 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\TextRunCacheImp.cs (2)
190Debug.Assert(textRun != null && runLength > 0, "Invalid run!"); 263Debug.Assert(
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\Internal\UIElementHelper.cs (3)
22Debug.Assert(o != null, "UIElementHelper.IsHitTestVisible called with null argument"); 38Debug.Assert(o != null, "UIElementHelper.IsVisible called with null argument"); 54Debug.Assert(o != null, "UIElementHelper.PredictFocus called with null argument");
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 (26)
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); 1089Debug.Assert(_others == null, "There shouldn't be anything stored in the others array."); 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\CharacterBuffer.cs (2)
251Debug.Assert(characterOffset >= 0 && characterOffset < _characterArray.Length, "Invalid character index"); 351Debug.Assert(characterOffset >= 0 && characterOffset < _string.Length, "Invalid character index");
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\IO\Packaging\PackWebRequest.cs (2)
73Debug.Assert(uri != null, "PackWebRequest uri cannot be null"); 74Debug.Assert(packageUri != null, "packageUri cannot be null");
System\IO\Packaging\PackWebResponse.cs (1)
625Debug.Assert(false, "Cannot return full-container stream from cached container object");
System\Windows\Automation\Peers\AutomationPeer.cs (1)
1642Debug.Assert(caller._children != null, "iteration over a null family");
System\Windows\ClassHandlersStore.cs (4)
38Debug.Assert(index != -1, "There should exist a set of handlers for the given routedEvent"); 75Debug.Assert(index != -1, "There should exist a set of handlers for the given index"); 86Debug.Assert(GetHandlersIndex(routedEvent) == -1, "There should not exist a set of handlers for the given routedEvent"); 104Debug.Assert(baseClassListeners != null, "Update only when there are base class listeners to be updated");
System\Windows\Diagnostics\VisualDiagnostics.cs (1)
294System.Diagnostics.Debug.WriteLine(SR.Format(SR.ReentrantVisualTreeChangeWarning, nameof(VisualTreeChanged)));
System\Windows\DragDrop.cs (2)
573Debug.Assert(dragSource != null, "Invalid dragSource"); 574Debug.Assert(dataObject != null, "Invalid dataObject");
System\Windows\DragEventArgs.cs (3)
58Debug.Assert(false, "Invalid dragDropKeyStates"); 63Debug.Assert(false, "Invalid allowedEffects"); 68Debug.Assert(false, "Invalid target");
System\Windows\DurationConverter.cs (1)
129Debug.Assert(durationValue == Duration.Automatic); // Only other legal duration type
System\Windows\EventHandlersStore.cs (2)
259Debug.Assert(key != null, "Search key cannot be null"); 277Debug.Assert(key != null, "Search key cannot be null");
System\Windows\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 (3)
186Debug.Assert(_collection.Count == 0); 1008Debug.Assert(list != null, "list may not be null."); 1106Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Generated\TextDecorationCollection.cs (3)
106Debug.Assert(_collection.Count == 0); 754Debug.Assert(list != null, "list may not be null."); 852Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\GiveFeedbackEventArgs.cs (1)
44Debug.Assert(false, "Invalid effects");
System\Windows\GlobalEventManager.cs (3)
26Debug.Assert(GetRoutedEventFromName(name, ownerType, false) == null, 59Debug.Assert( 64Debug.Assert(routedEvent.IsLegalHandler(handler),
System\Windows\Ink\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 (20)
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)); 214Debug.Assert(false, "Benign assert. IncrementalHitTester's _strokeInfos cache is out of sync, rebuilding."); 222Debug.Assert(false, "Benign assert. IncrementalHitTester's _strokeInfos cache is out of sync, rebuilding."); 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\AccessKeyManager.cs (2)
253Debug.Assert(target != null, "Targets should only be UIElements"); 615Debug.Assert(element is IInputElement, "Element in AccessKeyManager store was not of type IInputElement");
System\Windows\Input\Command\CommandBinding.cs (2)
189Debug.Assert(Executed != null, nameof(Executed) + " != null"); 197Debug.Assert(PreviewExecuted != null, nameof(PreviewExecuted) + " != null");
System\Windows\Input\InputLanguageSource.cs (1)
204Debug.Assert(_ipp == null, "_EnsureInputProcesoorProfile has been called.");
System\Windows\Input\InputMethod.cs (6)
565Debug.Assert(value != InputMethodState.DoNotCare); 626Debug.Assert(value != InputMethodState.DoNotCare); 660Debug.Assert(value != InputMethodState.DoNotCare); 729Debug.Assert(false, "Unknown Speech Mode"); 829Debug.Assert((value & ImeConversionModeValues.DoNotCare) == 0); 1080Debug.Assert((value & ImeSentenceModeValues.DoNotCare) == 0);
System\Windows\Input\InputMethodStateTypeInfo.cs (1)
102Debug.Assert(false, "The guid does not match.");
System\Windows\Input\InputProcessorProfiles.cs (5)
67Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "Initialize called on MTA thread!"); 69Debug.Assert(_ipp.Value == null, "Initialize called twice"); 87Debug.Assert(_ipp.Value != null, "Uninitialize called without initializing"); 187Debug.Assert(_cookie == UnsafeNativeMethods.TF_INVALID_COOKIE, "Cookie is already set."); 202Debug.Assert(_cookie != UnsafeNativeMethods.TF_INVALID_COOKIE, "Cookie is not set.");
System\Windows\Input\InputProcessorProfilesLoader.cs (1)
66Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "Load called on MTA thread!");
System\Windows\Input\Manipulation.cs (1)
44Debug.Assert(element != null, "element should be non-null.");
System\Windows\Input\ManipulationDevice.cs (7)
84Debug.Assert(element != null, "element should be non-null."); 113Debug.Assert(element != null, "element should be non-null."); 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 (3)
229Debug.Assert(_lastManipulationBeforeInertia != null); 307Debug.Assert(_generatedEvent == null, "There is already a generated event waiting to be pushed."); 647Debug.Assert(_containerLayoutUpdated != null);
System\Windows\Input\MouseDevice.cs (1)
1475Debug.Assert(_mouseOver == null, "_mouseOver should be null because we have called ChangeMouseOver(null) already.");
System\Windows\Input\Stylus\Common\DynamicRenderer.cs (4)
512Debug.Assert(si!=null); // should never get here unless we are transitioning a stroke. 601Debug.Assert(_waitingForRenderComplete, "We were expecting to be waiting for a RenderComplete to call our OnRenderComplete, we might never reset and get flashing strokes from here on out"); 963Debug.Assert(si.StrokeHV.Clip == null); 965Debug.Assert(_renderCompleteStrokeInfo == null);
System\Windows\Input\Stylus\Common\DynamicRendererThreadManager.cs (2)
177Debug.Assert(__inkingDispatcher != null); // We should have a valid ref here 262Debug.WriteLine(String.Format("Dispatcher.CriticalInvokeShutdown() Failed. Error={0}", e.NativeErrorCode));
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 (3)
427Debug.Assert(_transformToDeviceMatrices[hwndSource.CompositionTarget.CurrentDpiScale].HasInverse); 745Debug.Assert(GetFlickAction(flickData) == FlickAction.Scroll); // Make sure scroll action is set in flickdata. 791Debug.Assert(false, "Unknown Flick Action encountered");
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 (6)
153Debug.Assert(0 == rawPacketData.Length % lengthPerPoint, "Invalid assumption about packet length, there shouldn't be any remainder"); 372Debug.Assert(count <= this.Count); 541Debug.Assert(additionalData.Length == countToCopy); 567Debug.Assert(this.Count != 0, "Why are we serializing an empty StylusPointCollection???"); 617Debug.Assert( this.Description.ButtonCount > 0 ? 650Debug.Assert(e.Cancel, "This event should always be cancelled");
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\StylusPointPropertyInfo.cs (1)
124Debug.Assert(( stylusPointPropertyInfo1.Id != StylusPointPropertyIds.X &&
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\Pointer\PointerTabletDeviceInfo.cs (3)
262Debug.Assert(properties[StylusPointDescription.RequiredXIndex /*0*/].Id == StylusPointPropertyIds.X || !seenX, 264Debug.Assert(properties[StylusPointDescription.RequiredYIndex /*1*/].Id == StylusPointPropertyIds.Y || !seenY, 266Debug.Assert(properties[StylusPointDescription.RequiredPressureIndex /*1*/].Id == StylusPointPropertyIds.NormalPressure /*2*/,
System\Windows\Input\Stylus\Wisp\PenContext.cs (9)
122Debug.Assert(!_contexts._inputSource.Value.CheckAccess()); 125Debug.Assert(_pimcContext != null && _pimcContext.Value != null); 153Debug.Assert(_statusPropertyIndex != -1); // We should always see this. 169Debug.Assert(propertyInfos[StylusPointDescription.RequiredXIndex /*0*/].Id == StylusPointPropertyIds.X, "X isn't where we expect it! Fix PenImc to ask for X at index 0"); 170Debug.Assert(propertyInfos[StylusPointDescription.RequiredYIndex /*0*/].Id == StylusPointPropertyIds.Y, "Y isn't where we expect it! Fix PenImc to ask for Y at index 1"); 171Debug.Assert(pressureIndex == -1 || pressureIndex == StylusPointDescription.RequiredPressureIndex /*2*/, 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\PenThreadPool.cs (1)
152Debug.Assert(false, "Retry limit reached when acquiring PenThread");
System\Windows\Input\Stylus\Wisp\PenThreadWorker.cs (11)
164Debug.WriteLine("WorkerOperationGetTabletsInfo.OnDoWork failed due to: {0}{1}", Environment.NewLine, e.ToString()); 220Debug.WriteLine("WorkerOperationCreateContext.OnDoWork failed due to a {0}{1}", Environment.NewLine, e.ToString()); 327Debug.WriteLine("WorkerOperationRefreshCursorInfo.OnDoWork failed due to a {0}{1}", Environment.NewLine, e.ToString()); 369Debug.WriteLine("WorkerOperationGetTabletInfo.OnDoWork failed due to {0}{1}", Environment.NewLine, e.ToString()); 409Debug.WriteLine("WorkerOperationWorkerGetUpdatedSizes.OnDoWork failed due to a {0}{1}", Environment.NewLine, e.ToString()); 525Debug.Assert(penContext != null); 552Debug.Assert(penContext != null); 942Debug.Assert(properties[StylusPointDescription.RequiredXIndex /*0*/].Id == StylusPointPropertyIds.X, "X isn't where we expect it! Fix PenImc to ask for X at index 0"); 943Debug.Assert(properties[StylusPointDescription.RequiredYIndex /*1*/].Id == StylusPointPropertyIds.Y, "Y isn't where we expect it! Fix PenImc to ask for Y at index 1"); 1045Debug.Assert(pc != null && pc.CommHandle != IntPtr.Zero); 1099Debug.Assert(pc != null && pc.CommHandle != IntPtr.Zero);
System\Windows\Input\Stylus\Wisp\WispLogic.cs (13)
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()); 3291Debug.Assert(!_inputEnabled, "StylusLogic has been enabled unexpectly.");
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 (7)
166System.Diagnostics.Debug.WriteLine("TabletDeviceCollection: GetRawInputDeviceInfo failed!"); 173System.Diagnostics.Debug.WriteLine("TabletDeviceCollection: GetRawInputDeviceList failed!"); 272Debug.Assert(false, "Error acquiring PenThread in UpdateTabletsImpl()"); 420Debug.Assert(false, "Error acquiring PenThread in HandleTabletAdded()"); 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\TextServicesCompartment.cs (2)
95Debug.Assert(_cookie == UnsafeNativeMethods.TF_INVALID_COOKIE, "cookie is already set."); 116Debug.Assert(_cookie != UnsafeNativeMethods.TF_INVALID_COOKIE, "cookie is not set.");
System\Windows\Input\TextServicesContext.cs (1)
53Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "SetDispatcherThreaad on MTA thread");
System\Windows\Input\TouchDevice.cs (4)
614Debug.Assert(oldCapture != null, "oldCapture should be non-null."); 623Debug.Assert(captured != null, "captured should be non-null."); 861Debug.Assert(newDirectlyOver != _directlyOver, "ChangeDirectlyOver called when newDirectlyOver is the same as _directlyOver."); 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 (13)
51Debug.Assert( null != _source ); 66Debug.Assert( null != _source ); 158System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: AcquireFocus failed!"); 185System.Diagnostics.Debug.WriteLine("HwndKeyboardInputProvider: GetMessageTime failed!"); 216System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetTickCount failed!"); 574System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetKeyState failed!"); 608System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: MapVirtualKey failed!"); 661System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: MapVirtualKey failed!"); 717Debug.Assert( null != _source ); 750Debug.Assert( null != _source ); 822Debug.Assert( null != _source ); 840System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetKeyboardState failed!"); 855System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetMessageExtraInfo failed!");
System\Windows\InterOp\HwndMouseInputProvider.cs (26)
48Debug.Assert(null != _source && null != _source.Value); 57System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: Dispose: GetCapture failed!"); 68System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: Dispose: GetCapture failed!"); 79Debug.Assert(null != _source && null != _source.Value); 113System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: SetCursor failed!"); 129Debug.Assert(null != _source && null != _source.Value); 142System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: SetCapture or GetCapture failed!"); 167System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: ScreenToClient failed!"); 204System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: ReleaseCapture failed!"); 318System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetIntermediatePoints failed!"); 359System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetMessageTime failed!"); 493System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: ScreenToClient failed!"); 690System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetCapture failed!"); 795System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetCapture failed!"); 931System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetMessagePos failed!"); 944System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: WindowFromPoint failed!"); 974System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetClientRect or ScreenToClient failed!"); 1155System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: TrackMouseEvent failed!"); 1173System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: TrackMouseEvent failed!"); 1194Debug.Assert(null != _source && null != _source.Value); 1239Debug.Assert(null != _source && null != _source.Value); 1316System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetCursorPos failed!"); 1325System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: WindowFromPoint failed!"); 1334System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: Spurious mouse event received!"); 1409System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetWindowStyle or GetClientRect failed!"); 1424System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetMessageExtraInfo failed!");
System\Windows\InterOp\HwndSource.cs (6)
749Debug.Assert(_weakMenuModeMessageHandler == null); 773Debug.Assert(_weakMenuModeMessageHandler != null); 1041Debug.Assert(_hwndTarget!= null, "HwndTarget is null"); 1042Debug.Assert(_hwndTarget.IsDisposed == false, "HwndTarget is disposed"); 1546Debug.Assert(_adjustSizingForNonClientArea == true); 2284Debug.Assert(null!=ikis, "ChildSinkWithFocus called when none had focus");
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 (3)
75Debug.Assert(animatedPropertiesMap.Count > 0); 100Debug.Assert(animatedPropertiesMap.Count > 0); 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 (19)
21Debug.Assert(ownerStorage != null); 32Debug.Assert( 39Debug.Assert(defaultDestinationValue != DependencyProperty.UnsetValue, 86Debug.Assert(handoffBehavior == HandoffBehavior.Compose, 88Debug.Assert(defaultDestinationValue == DependencyProperty.UnsetValue, 108Debug.Assert(_animationClocks != null); 123Debug.Assert(animationClocks != null); 124Debug.Assert(animationClocks.Count > 0); 125Debug.Assert(!animationClocks.Contains(null)); 126Debug.Assert(_animationClocks == null); 140Debug.Assert(_hasStickySnapshotValue, 150Debug.Assert(_animationClocks != null 158Debug.Assert(index >= 0, 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 (41)
50Debug.Assert( _animationClocks == null 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); 251Debug.Assert(animatedPropertyMap.Count > 0); 252Debug.Assert(animatedPropertyMap[_dependencyProperty.GlobalIndex] != DependencyProperty.UnsetValue); 509Debug.Assert( _animationClocks != null 517Debug.Assert(index > -1, 546Debug.Assert(_hasStickySnapshotValue, 558Debug.Assert(_animationClocks.Count > 0); 597Debug.Assert(animationClocks != null, 599Debug.Assert(animationClocks.Count > 0, 601Debug.Assert(!animationClocks.Contains(null), 603Debug.Assert(HandoffBehaviorEnum.IsDefined(handoffBehavior), 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)); 716Debug.Assert(HandoffBehaviorEnum.IsDefined(handoffBehavior), 786Debug.Assert(animation == null || IsAnimationValid(dp, animation)); 787Debug.Assert(IsPropertyAnimatable(d, dp)); 789Debug.Assert(HandoffBehaviorEnum.IsDefined(handoffBehavior), 858Debug.Assert(storage._animationClocks != null && storage._animationClocks.Count > 0, 905Debug.Assert(storage != null, 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 1156Debug.Assert(type == typeof(Vector3D), "Application is trying to create independent animation storage for an unsupported type.");
System\Windows\Media\Animation\Clock.cs (145)
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); 1409Debug.Assert(_resolvedDuration != Duration.Automatic, "_resolvedDuration should never be set to Automatic."); 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); 1957Debug.Assert(_currentDuration != Duration.Automatic, "_currentDuration should never be Automatic."); 1958Debug.Assert(_beginTime.HasValue); 1960Debug.Assert(parentTime >= _beginTime.Value); // We are active or in postfill 1976Debug.Assert(_currentClockState != ClockState.Active); 2184Debug.Assert(_currentDuration == Duration.Forever, "_currentDuration has an invalid enum value."); 2185Debug.Assert(_currentClockState == ClockState.Active 2203Debug.Assert(this is ClockGroup, "ComputeCurrentIterationWithGrow should only run on ClockGroups."); 2204Debug.Assert(CanGrow, "ComputeCurrentIterationWithGrow should only run on clocks with CanGrow."); 2205Debug.Assert(_currentIterationBeginTime.HasValue, "ComputeCurrentIterationWithGrow should only be called when _currentIterationBeginTime has a value."); 2206Debug.Assert(_resolvedDuration.HasTimeSpan, "ComputeCurrentIterationWithGrow should only be called when _resolvedDuration has a value."); // We must have a computed duration 2207Debug.Assert(_currentDuration.HasTimeSpan, "ComputeCurrentIterationWithGrow should only be called when _currentDuration has a value."); 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); 2354Debug.Assert(_currentDuration != Duration.Automatic, "_currentDuration should never be Automatic."); 2358Debug.Assert(_currentDuration.TimeSpan > TimeSpan.Zero, "ComputeCurrentTime was entered with _currentDuration <= 0"); 2365Debug.Assert(transitionTime <= 1, "The values of the accel and decel attributes incorrectly add to more than 1.0"); 2366Debug.Assert(transitionTime >= 0, "The values of the accel and decel attributes incorrectly add to less than 0.0"); 2429Debug.Assert(_currentDuration == Duration.Forever, "_currentDuration has an invalid enum value."); 2443Debug.Assert(!IsTimeManager); 2457Debug.Assert(_resolvedDuration == Duration.Forever, "_resolvedDuration should be Forever when NaturalDuration is Automatic."); 2485Debug.Assert(!IsTimeManager); 2486Debug.Assert(!IsInteractivelyStopped || IsRoot); 2490Debug.Assert(_resolvedDuration != Duration.Automatic, "_resolvedDuration should never be Automatic."); 2491Debug.Assert(_currentDuration != Duration.Automatic, "_currentDuration should never be Automatic."); 2513Debug.Assert(_currentDuration.HasTimeSpan, "_currentDuration is invalid, neither Forever nor a TimeSpan."); 2514Debug.Assert(_currentDuration == _resolvedDuration, "For clocks which cannot grow, _currentDuration must equal _resolvedDuration."); 2526Debug.Assert(_resolvedDuration.HasTimeSpan, "_resolvedDuration is invalid, neither Forever nor a TimeSpan."); 2527Debug.Assert(_currentDuration.HasTimeSpan, "_currentDuration is invalid, neither Forever nor a TimeSpan."); 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); 2667Debug.Assert(!_currentIterationBeginTime.HasValue, "_currentIterationBeginTime should not have a value when _beginTime has no value."); 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); 3093Debug.Assert(_rootData != null, "A root Clock must have the _rootData structure initialized."); 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); 3407Debug.Assert(!current.IsRoot, "Root nodes never should reset their Slip amounts with ResetSlipOnSubtree(), even when seeking."); 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 4192Debug.Assert(Math.Abs(optimizedInputTime - inputTime) <= error,
System\Windows\Media\Animation\ClockController.cs (1)
45Debug.Assert(owner != null, "ClockController must have a non-null owner.");
System\Windows\Media\Animation\ClockGroup.cs (19)
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); 413Debug.Assert(!IsTimeManager, "Cannot associate a root with multiple timing trees"); 414Debug.Assert(this._timeManager == null, "Cannot use a timeline already in the timing tree as a root"); 415Debug.Assert(timeManager.TimeManagerClock == this, "Cannot associate more than one root per timing tree"); 416Debug.Assert(this._parent == null && _children == null, "Cannot use a timeline connected to other timelines as a root"); 438Debug.Assert(IsRoot); 463Debug.Assert(IsTimeManager, "Invalid call to RootActivate for a non-root Clock"); 464Debug.Assert(_timeManager != null); // RootActivate should be called by our own TimeManager 479Debug.Assert(IsTimeManager, "Invalid call to RootCleanChildren for a non-root Clock"); 502Debug.Assert(IsTimeManager, "Invalid call to RootHasChildren for a non-root Clock"); 513Debug.Assert(IsTimeManager, "Invalid call to RootDeactivate for a non-root Clock");
System\Windows\Media\Animation\DoubleAnimationUsingPath.cs (2)
173Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 266Debug.Assert(!_isValid);
System\Windows\Media\Animation\Generated\BooleanAnimationUsingKeyFrames.cs (7)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 542Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 549Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 599Debug.Assert(!_areKeyTimesValid, "KeyFrameBooleanAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 741Debug.Assert(index < keyFrameCount, 817Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\BooleanKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\ByteAnimation.cs (2)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 316Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\ByteAnimationUsingKeyFrames.cs (7)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameByteAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\ByteKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\CharAnimationUsingKeyFrames.cs (7)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 542Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 549Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 599Debug.Assert(!_areKeyTimesValid, "KeyFrameCharAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 741Debug.Assert(index < keyFrameCount, 817Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\CharKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\ColorAnimation.cs (2)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 316Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\ColorAnimationUsingKeyFrames.cs (7)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameColorAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\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 (2)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 316Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\DecimalAnimationUsingKeyFrames.cs (7)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameDecimalAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\DecimalKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\DoubleAnimation.cs (2)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 316Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\DoubleAnimationUsingKeyFrames.cs (7)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameDoubleAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\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 (2)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 316Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\Int16AnimationUsingKeyFrames.cs (7)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameInt16Animaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Int16KeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\Int32Animation.cs (2)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 316Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\Int32AnimationUsingKeyFrames.cs (7)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameInt32Animaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Int32KeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\Int64Animation.cs (2)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 316Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\Int64AnimationUsingKeyFrames.cs (7)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameInt64Animaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Int64KeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\MatrixAnimationUsingKeyFrames.cs (7)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 542Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 549Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 599Debug.Assert(!_areKeyTimesValid, "KeyFrameMatrixAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 741Debug.Assert(index < keyFrameCount, 817Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\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 (7)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 542Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 549Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 599Debug.Assert(!_areKeyTimesValid, "KeyFrameObjectAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 741Debug.Assert(index < keyFrameCount, 817Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\ObjectKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\Point3DAnimation.cs (2)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 316Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\Point3DAnimationUsingKeyFrames.cs (7)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFramePoint3DAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\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 (2)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 316Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\PointAnimationUsingKeyFrames.cs (7)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFramePointAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\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 (2)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 316Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\QuaternionAnimationUsingKeyFrames.cs (7)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameQuaternionAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\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 (2)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 316Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\RectAnimationUsingKeyFrames.cs (7)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameRectAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\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 (2)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 316Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\Rotation3DAnimationUsingKeyFrames.cs (7)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameRotation3DAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Rotation3DKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\SingleAnimation.cs (2)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 316Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\SingleAnimationUsingKeyFrames.cs (7)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameSingleAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\SingleKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\SizeAnimation.cs (2)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 316Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\SizeAnimationUsingKeyFrames.cs (7)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameSizeAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\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 (7)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 542Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 549Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 599Debug.Assert(!_areKeyTimesValid, "KeyFrameStringAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 741Debug.Assert(index < keyFrameCount, 817Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\StringKeyFrameCollection.cs (1)
484Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\TimelineCollection.cs (3)
113Debug.Assert(_collection.Count == 0); 772Debug.Assert(list != null, "list may not be null."); 871Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Animation\Generated\TimelineGroup.cs (1)
199Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Animation\Generated\Vector3DAnimation.cs (2)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 316Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\Vector3DAnimationUsingKeyFrames.cs (7)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameVector3DAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\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 (2)
218Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 316Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\VectorAnimationUsingKeyFrames.cs (7)
328Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 353Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 634Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 641Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 691Debug.Assert(!_areKeyTimesValid, "KeyFrameVectorAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 833Debug.Assert(index < keyFrameCount, 909Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\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\RepeatBehavior.cs (3)
207Debug.Fail("Unhandled RepeatBehaviorType"); 252Debug.Fail("Unhandled RepeatBehaviorType"); 318Debug.Fail("Unhandled RepeatBehaviorType.");
System\Windows\Media\Animation\RepeatBehaviorConverter.cs (1)
146Debug.Fail("Unknown type of RepeatBehavior passed to RepeatBehaviorConverter.");
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\TimelineClockCollection.cs (2)
433Debug.Assert(owner != null, "ClockCollection must have a non-null owner."); 442Debug.Assert(false, "Parameterless constructor is illegal for ClockCollection.");
System\Windows\Media\Animation\TimeManager.cs (1)
590Debug.Assert(false, "Unrecognized TimeState enumeration value");
System\Windows\Media\Animation\WeakRefEnumerator.cs (2)
59Debug.Assert(_valid); 77Debug.Assert(_valid);
System\Windows\Media\BitmapCacheBrush.cs (11)
192Debug.Assert(InternalTarget == AutoWrapVisual, 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 (8)
328Debug.Assert(sizeof(MIL_PATHGEOMETRY) <= _currOffset); 329Debug.Assert(_currentPathGeometryData.Size == (uint)_currOffset); 433Debug.Assert(_chunkList.Count != 0); 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\BitmapEffectCollection.cs (3)
112Debug.Assert(_collection.Count == 0); 760Debug.Assert(list != null, "list may not be null."); 858Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Effects\Generated\BitmapEffectGroup.cs (1)
217Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Effects\Generated\BitmapEffectInput.cs (1)
250Debug.Assert(s_Input == null || s_Input.IsFrozen,
System\Windows\Media\Effects\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 (8)
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)); 731Debug.Assert(!hBrush.IsNull || ss._brush == null, "If brush isn't null, hBrush better not be"); 807Debug.Assert(_duceResource.IsOnChannel(channel)); 960Debug.Assert(false);
System\Windows\Media\EventProxy.cs (2)
40Debug.Assert(((IntPtr)pEPD.m_handle) != IntPtr.Zero, "If this asserts fires: Why is it firing? It might be legal in future."); 117Debug.Assert(((IntPtr)epd.m_handle) != IntPtr.Zero, "Stream is disposed.");
System\Windows\Media\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 (6)
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); 1753Debug.Assert(_defaultParaProps.Indent == 0.0, "FormattedText was assumed to always have 0 indent. This assumption has changed and thus the calculation of Width and Overhangs should be revised."); 1754Debug.Assert(_defaultParaProps.TextMarkerProperties == null, "FormattedText was assumed to always have no TextMarkerProperties. This assumption has changed and thus the calculation of Width and Overhangs should be revised.");
System\Windows\Media\Generated\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 (6)
127Debug.Assert(!channel.IsOutOfBandChannel); 128Debug.Assert(!targetResource.GetHandle(channel).IsNull); 171Debug.Assert(!channel.IsOutOfBandChannel); 172Debug.Assert(!targetResource.GetHandle(channel).IsNull); 448Debug.Assert(s_Transform == null || s_Transform.IsFrozen, 452Debug.Assert(s_RelativeTransform == null || s_RelativeTransform.IsFrozen,
System\Windows\Media\Generated\CombinedGeometry.cs (8)
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)); 447Debug.Assert(s_Geometry1 == null || s_Geometry1.IsFrozen, 451Debug.Assert(s_Geometry2 == null || s_Geometry2.IsFrozen,
System\Windows\Media\Generated\DashStyle.cs (3)
166Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 234Debug.Assert(_duceResource.IsOnChannel(channel)); 346Debug.Assert(s_Dashes == null || s_Dashes.IsFrozen,
System\Windows\Media\Generated\DoubleCollection.cs (2)
783Debug.Assert(list != null, "list may not be null."); 881Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\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\DrawingCollection.cs (2)
803Debug.Assert(list != null, "list may not be null."); 901Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\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 (19)
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); 850Debug.Assert(s_Children == null || s_Children.IsFrozen,
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\GeneralTransformCollection.cs (3)
114Debug.Assert(_collection.Count == 0); 762Debug.Assert(list != null, "list may not be null."); 860Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\GeneralTransformGroup.cs (1)
207Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Generated\Geometry.cs (3)
125Debug.Assert(!channel.IsOutOfBandChannel); 126Debug.Assert(!targetResource.GetHandle(channel).IsNull); 372Debug.Assert(s_Transform == null || s_Transform.IsFrozen,
System\Windows\Media\Generated\GeometryCollection.cs (2)
803Debug.Assert(list != null, "list may not be null."); 901Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\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 (11)
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); 504Debug.Assert(s_Children == null || s_Children.IsFrozen,
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\GradientBrush.cs (1)
299Debug.Assert(s_GradientStops == null || s_GradientStops.IsFrozen,
System\Windows\Media\Generated\GradientStopCollection.cs (3)
114Debug.Assert(_collection.Count == 0); 865Debug.Assert(list != null, "list may not be null."); 963Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\GuidelineSet.cs (4)
188Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 263Debug.Assert(_duceResource.IsOnChannel(channel)); 367Debug.Assert(s_GuidelinesX == null || s_GuidelinesX.IsFrozen, 371Debug.Assert(s_GuidelinesY == null || s_GuidelinesY.IsFrozen,
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\Int32Collection.cs (2)
783Debug.Assert(list != null, "list may not be null."); 881Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\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\PathFigure.cs (1)
282Debug.Assert(s_Segments == null || s_Segments.IsFrozen,
System\Windows\Media\Generated\PathFigureCollection.cs (3)
115Debug.Assert(_collection.Count == 0); 852Debug.Assert(list != null, "list may not be null."); 950Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\PathGeometry.cs (2)
190Debug.Assert(_duceResource.IsOnChannel(channel)); 299Debug.Assert(s_Figures == null || s_Figures.IsFrozen,
System\Windows\Media\Generated\PathSegmentCollection.cs (3)
114Debug.Assert(_collection.Count == 0); 762Debug.Assert(list != null, "list may not be null."); 860Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\Pen.cs (7)
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)); 572Debug.Assert(s_DashStyle == null || s_DashStyle.IsFrozen,
System\Windows\Media\Generated\PointCollection.cs (2)
785Debug.Assert(list != null, "list may not be null."); 883Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\PolyBezierSegment.cs (1)
220Debug.Assert(s_Points == null || s_Points.IsFrozen,
System\Windows\Media\Generated\PolyLineSegment.cs (1)
220Debug.Assert(s_Points == null || s_Points.IsFrozen,
System\Windows\Media\Generated\PolyQuadraticBezierSegment.cs (1)
220Debug.Assert(s_Points == null || s_Points.IsFrozen,
System\Windows\Media\Generated\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 (14)
525Debug.Assert(_duceResource.IsOnChannel(channel)); 537Debug.Assert(cbExtraData <= (uint)Int32.MaxValue); 549Debug.Assert((_curOffset > 0) || (_dependentResources.Count == 0)); 553Debug.Assert((_buffer != null) || (_curOffset == 0)); 556Debug.Assert((_buffer == null) || (_curOffset <= _buffer.Length)); 1098Debug.Assert(false); 1118Debug.Assert((_curOffset > 0) || (_dependentResources.Count == 0)); 1122Debug.Assert((_buffer != null) || (_curOffset == 0)); 1125Debug.Assert((_buffer == null) || (_curOffset <= _buffer.Length)); 1438Debug.Assert(false); 1458Debug.Assert((_curOffset > 0) || (_dependentResources.Count == 0)); 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\TextEffectCollection.cs (3)
114Debug.Assert(_collection.Count == 0); 762Debug.Assert(list != null, "list may not be null."); 860Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\TransformCollection.cs (2)
803Debug.Assert(list != null, "list may not be null."); 901Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\TransformGroup.cs (11)
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); 455Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Generated\TranslateTransform.cs (2)
166Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 214Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\VectorCollection.cs (2)
785Debug.Assert(list != null, "list may not be null."); 883Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\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\GeometryHitTestParameters.cs (1)
99Debug.Assert(_hitGeometryInternal.Transform.Value == _hitGeometryCache.Transform.Value,
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 (10)
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); 339Debug.Assert(channelDispatcher == this.Dispatcher, "HostVisual connecting on a second thread");
System\Windows\Media\ImageSourceConverter.cs (1)
238Debug.Assert(rawData != null, "rawData is null.");
System\Windows\Media\Imaging\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\BitmapFrame.cs (2)
71Debug.Assert((stream == null), "Both stream and uri are non-null"); 92Debug.Assert((stream != null), "Both stream and uri are null");
System\Windows\Media\Imaging\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 (3)
91Debug.Assert ((sizeX > 0) && (sizeY > 0)); 92Debug.Assert ((dpiX > 0) && (dpiY > 0)); 107Debug.Assert (renderTargetBitmap != null, "Render Target is null");
System\Windows\Media\Imaging\Generated\ColorConvertedBitmap.cs (1)
376Debug.Assert(s_Source == null || s_Source.IsFrozen,
System\Windows\Media\Imaging\Generated\CroppedBitmap.cs (1)
319Debug.Assert(s_Source == null || s_Source.IsFrozen,
System\Windows\Media\Imaging\Generated\FormatConvertedBitmap.cs (1)
377Debug.Assert(s_Source == null || s_Source.IsFrozen,
System\Windows\Media\Imaging\Generated\TransformedBitmap.cs (2)
337Debug.Assert(s_Source == null || s_Source.IsFrozen, 341Debug.Assert(s_Transform == null || s_Transform.IsFrozen,
System\Windows\Media\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 (34)
211Debug.Assert(dispatcher.Reserved0 == null); 367Debug.Assert(CheckAccess()); 629Debug.Assert(InterlockIsEnabled, 726Debug.Assert(_interlockState == InterlockState.WaitingForResponse, 803Debug.Assert(!InterlockIsWaiting, 868Debug.Assert(InterlockIsWaiting, 1103Debug.Assert(IsClockSupported, "MediaContext.CurrentTime called when QueryPerformaceCounter is not supported"); 1362Debug.Assert(_interlockState == InterlockState.Disabled, 1371Debug.Assert(Channel != null); 1392Debug.Assert(dispatcher != null, "Dispatcher required"); 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); 2151Debug.Assert(_needToCommitChannel, "CommitChannel called with nothing on the channel"); 2155Debug.Assert(!InterlockIsWaiting, 2221Debug.Assert(InterlockIsEnabled, 2553Debug.Assert(_interlockState == InterlockState.WaitingForNextFrame
System\Windows\Media\MediaContextNotificationWindow.cs (1)
150Debug.Assert(_ownerMediaContext != null);
System\Windows\Media\mediaeventshelper.cs (3)
96Debug.Assert((sender != null), "Sender is null"); 97Debug.Assert((sender.Dispatcher != null), "Dispatcher is null"); 263Debug.Assert((cb == size), "Invalid event packet");
System\Windows\Media\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 (2)
136Debug.Assert(s_refCount > 0); 281Debug.Assert(reference != null, "The reference object can not be null.");
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 (21)
83Debug.Assert(_figures == null, "It is illegal to call SetFigureCount multiple times or after BeginFigure."); 84Debug.Assert(figureCount > 0); 92Debug.Assert(_figures != null, "It is illegal to call SetSegmentCount before BeginFigure."); 93Debug.Assert(_currentFigure != null, "It is illegal to call SetSegmentCount before BeginFigure."); 94Debug.Assert(_segments == null, "It is illegal to call SetSegmentCount multiple times per BeginFigure or after a *To method."); 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 (17)
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); 522Debug.Assert(_dependentResources.Count >= index);
System\Windows\Media\StreamAsIStream.cs (2)
67Debug.Assert(((IntPtr)pSD.m_handle) != IntPtr.Zero, "If this asserts fires: why is it firing. It might be legal in future."); 575Debug.Assert(((IntPtr)sd.m_handle) != IntPtr.Zero, "Stream is disposed.");
System\Windows\Media\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\UniqueEventHelper.cs (4)
42Debug.Assert(sender != null, "Sender is null"); 45Debug.Assert(handler != null, "Event handler is null"); 73Debug.Assert(sender != null, "Sender is null"); 76Debug.Assert(handler != null, "Event handler is null");
System\Windows\Media\VideoDrawing.cs (1)
43Debug.Assert(!ctx.ShouldStopWalking);
System\Windows\Media\Visual.cs (30)
174Debug.Assert(false, "TYPE_VISUAL or TYPE_VIEWPORT3DVISUAL expected."); 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. 1965Debug.Assert(Point.Equals(pointParams.HitPoint, backupHitPoint), 1996Debug.Assert(Matrix.Equals(geometryParams.InternalHitGeometry.Transform.Value, originalMatrix), 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); 3058Debug.Assert(bed != null, "Must be non-null because otherwise the code would have earlied out where new value is compared against old value."); 3220Debug.Assert(currentBitmapEffect.IsFrozen == emulatingEffect.IsFrozen); 3289Debug.Assert(bitmapEffectState != null); 3303Debug.Assert(EffectField.GetValue(this) == null, "Not expecting both BitmapEffect and Effect to be set on the same node"); 3978Debug.Assert(_parent != null, "If oldParent is null, current parent should != null."); 4490Debug.Assert(ancestor != null); 4607Debug.Assert((group == null) || (group.Children.Count > 0)); 4685Debug.Assert(ancestor != null); 5247Debug.Assert(cyclicBrushToChannelsMap != null, "Visual brush roots need to have the visual brush to channels map!");
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 (19)
90Debug.Assert(_owner != null); 96Debug.Assert(_owner != null); 102Debug.Assert(_owner != null); 109Debug.Assert(_owner != null); 273Debug.Assert(_items != null); 280Debug.Assert(value == 0, "There shouldn't be a case where value != 0."); 281Debug.Assert(_size == 0, "Size must be 0 here."); 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); 841Debug.Assert(newIndex >= 0 && newIndex <= _size, "New index is invalid"); 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\GeneralTransform2DTo3D.cs (1)
35Debug.Assert(child != null, "Going from 2D to 3D containingVisual3D.Visual should not be 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 (3)
114Debug.Assert(!channel.IsOutOfBandChannel); 115Debug.Assert(!targetResource.GetHandle(channel).IsNull); 351Debug.Assert(s_Transform == null || s_Transform.IsFrozen,
System\Windows\Media3D\Generated\DiffuseMaterial.cs (5)
128Debug.Assert(!channel.IsOutOfBandChannel); 129Debug.Assert(!targetResource.GetHandle(channel).IsNull); 221Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 267Debug.Assert(_duceResource.IsOnChannel(channel)); 381Debug.Assert(s_Brush == null || s_Brush.IsFrozen,
System\Windows\Media3D\Generated\DirectionalLight.cs (2)
140Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 208Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\EmissiveMaterial.cs (5)
121Debug.Assert(!channel.IsOutOfBandChannel); 122Debug.Assert(!targetResource.GetHandle(channel).IsNull); 199Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 244Debug.Assert(_duceResource.IsOnChannel(channel)); 353Debug.Assert(s_Brush == null || s_Brush.IsFrozen,
System\Windows\Media3D\Generated\GeneralTransform3DCollection.cs (3)
110Debug.Assert(_collection.Count == 0); 758Debug.Assert(list != null, "list may not be null."); 856Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Generated\GeneralTransform3DGroup.cs (1)
203Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media3D\Generated\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\MaterialCollection.cs (2)
799Debug.Assert(list != null, "list may not be null."); 897Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Generated\MaterialGroup.cs (11)
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); 451Debug.Assert(s_Children == null || s_Children.IsFrozen,
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 (6)
206Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 303Debug.Assert(_duceResource.IsOnChannel(channel)); 422Debug.Assert(s_Positions == null || s_Positions.IsFrozen, 426Debug.Assert(s_Normals == null || s_Normals.IsFrozen, 430Debug.Assert(s_TextureCoordinates == null || s_TextureCoordinates.IsFrozen, 434Debug.Assert(s_TriangleIndices == null || s_TriangleIndices.IsFrozen,
System\Windows\Media3D\Generated\Model3D.cs (3)
114Debug.Assert(!channel.IsOutOfBandChannel); 115Debug.Assert(!targetResource.GetHandle(channel).IsNull); 351Debug.Assert(s_Transform == null || s_Transform.IsFrozen,
System\Windows\Media3D\Generated\Model3DCollection.cs (2)
799Debug.Assert(list != null, "list may not be null."); 897Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Generated\Model3DGroup.cs (11)
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); 472Debug.Assert(s_Children == null || s_Children.IsFrozen,
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\Point3DCollection.cs (2)
782Debug.Assert(list != null, "list may not be null."); 880Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Generated\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 (5)
143Debug.Assert(!channel.IsOutOfBandChannel); 144Debug.Assert(!targetResource.GetHandle(channel).IsNull); 255Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 319Debug.Assert(_duceResource.IsOnChannel(channel)); 428Debug.Assert(s_Rotation == null || s_Rotation.IsFrozen,
System\Windows\Media3D\Generated\ScaleTransform3D.cs (2)
268Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 340Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\SpecularMaterial.cs (5)
121Debug.Assert(!channel.IsOutOfBandChannel); 122Debug.Assert(!targetResource.GetHandle(channel).IsNull); 221Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 267Debug.Assert(_duceResource.IsOnChannel(channel)); 381Debug.Assert(s_Brush == null || s_Brush.IsFrozen,
System\Windows\Media3D\Generated\SpotLight.cs (2)
184Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 294Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\Transform3DCollection.cs (2)
799Debug.Assert(list != null, "list may not be null."); 897Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Generated\Transform3DGroup.cs (11)
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); 451Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media3D\Generated\TranslateTransform3D.cs (2)
193Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 247Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\Vector3DCollection.cs (2)
782Debug.Assert(list != null, "list may not be null."); 880Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Geometry3D.cs (1)
80Debug.Assert(facesToHit != FaceType.None,
System\Windows\Media3D\HitTestParameters3D.cs (4)
68Debug.Assert(!HasModelTransformMatrix, 117Debug.Assert(HasWorldTransformMatrix, 150Debug.Assert(HasModelTransformMatrix, 190Debug.Assert(HasHitTestProjectionMatrix,
System\Windows\Media3D\Matrix3D.cs (11)
1045Debug.Assert(IsDistinguishedIdentity); 1057Debug.Assert(IsDistinguishedIdentity); 1073Debug.Assert(IsDistinguishedIdentity); 1199Debug.Assert(!IsDistinguishedIdentity); 1200Debug.Assert(IsAffine); 1216Debug.Assert(!IsDistinguishedIdentity); 1217Debug.Assert(IsAffine); 1228Debug.Assert(!(det < Determinant || det > Determinant), 1315Debug.Assert(!(det < Determinant || det > Determinant), 1408Debug.Assert( 1426Debug.Assert(IsDistinguishedIdentity == value,
System\Windows\Media3D\MeshGeometry3D.cs (7)
172Debug.Assert(hitTestableFaces != FaceType.None, 414Debug.Assert(!double.IsInfinity(pz / pw) && !double.IsNaN(pz / pw), 419Debug.Assert(dist > 0, "Distance is negative: " + dist); 500Debug.Assert(!double.IsInfinity(pz / pw) && !double.IsNaN(pz / pw), 536Debug.Assert(_cachedBounds.IsEmpty, 581Debug.Fail("Cached bounds are invalid. Caller needs to check for IsEmpty and call UpdateCachedBounds."); 585Debug.Fail("Cached bounds are invalid. We missed a call to SetCachedBoundsDirty.");
System\Windows\Media3D\Quaternion.cs (1)
538Debug.Assert(!(cosOmega < -1.0) && !(cosOmega > 1.0),
System\Windows\Media3D\Rect3D.cs (1)
62Debug.Assert(size.IsEmpty == IsEmpty);
System\Windows\Media3D\Viewport2DVisual3D.cs (9)
343Debug.Assert((newValue == null || newValue.InheritanceContext == null), 352Debug.Assert((newValue == null || newValue.InheritanceContext == null), 359Debug.Assert((newValue == null || newValue.InheritanceContext == null), 595Debug.Assert(Geometry == null || Geometry is MeshGeometry3D); 623Debug.Assert(Geometry == null || Geometry is MeshGeometry3D); 651Debug.Assert(Geometry == null || Geometry is MeshGeometry3D); 777Debug.Assert( (viewport2DVisual3D.InternalBitmapCacheBrush.InternalTarget == null 786Debug.Assert( (viewport2DVisual3D.InternalBitmapCacheBrush.InternalTarget == null 806Debug.Assert((viewport2DVisual3D.Visual == null || viewport2DVisual3D.Visual.InheritanceContext == null),
System\Windows\Media3D\Viewport3DVisual.cs (11)
264Debug.Assert(!e.IsASubPropertyChange, 342Debug.Assert(child != null); 343Debug.Assert(child.InternalVisualParent == null); 393Debug.Assert(child != null); 394Debug.Assert(child.InternalVisualParent == this); 645Debug.Fail("Cached bbox subgraph is incorrect!"); 656Debug.Assert( 676Debug.Assert( 730Debug.Assert(IsOnChannel(channel)); 778Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentNodeConnected), 819Debug.Assert(IsOnChannel(channel));
System\Windows\Media3D\Visual3D.cs (23)
246Debug.Assert(child != null); 247Debug.Assert(child.InternalVisualParent == null); 294Debug.Assert(child != null); 295Debug.Assert(child.InternalVisualParent == this); 467Debug.Assert(VisualTreeHelper.GetParent(this) != null, "If oldParent is null, current parent should != null."); 960Debug.Assert(InternalVisualParent == newParent); 968Debug.Assert(InternalVisualParent == newParent); 1068Debug.Assert(boundsAreEqual, errorString); 1090Debug.Assert(model != null); 1222Debug.Assert((flags & VisualProxyFlags.IsContentNodeConnected) == 0, 1270Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentConnected)); 1271Debug.Assert(IsOnChannel(channel)); 1462Debug.Assert(IsOnChannel(channel)); 1463Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentNodeConnected)); 1593Debug.Assert(child.InheritanceContext == this, 1660Debug.Assert(ancestor != null); 1808Debug.Assert(ancestor != null); 1845Debug.Assert(_2DParent.GetValue(this) == null, 1853Debug.Assert(parent2D == null || parent2D is Viewport3DVisual, 2059Debug.Assert(!e.CheckFlagsOr(VisualFlags.ShouldPostRender), 2061Debug.Assert(!e.CheckFlagsOr(VisualFlags.NodeIsCyclicBrushRoot), 2073Debug.Assert((viewport == null) == (e.InternalVisualParent == null), 2111Debug.Assert(_inheritanceContext.GetValue(this) == UseParentAsContext,
System\Windows\Media3D\Visual3DCollection.cs (7)
496Debug.Assert(InternalGetItem(i).ParentIndex == i - 1, 520Debug.Assert(InternalGetItem(i).ParentIndex == i + 1, 554Debug.Assert(_owner != null, "How did an Visual3DCollection get constructed without an owner?"); 562Debug.Assert(!duplicates.ContainsKey(visual), "How did the visual get re-inserted?"); 565Debug.Assert(visual.InternalVisualParent == _owner, "Why isn't our child's parent pointer the same as the collection owner?"); 566Debug.Assert(visual.ParentIndex == i, 616Debug.Assert(list != null, "list may not be null.");
System\Windows\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\QueryContinueDragEventArgs.cs (1)
46Debug.Assert(false, "Invalid dragDropKeyStates");
System\Windows\ReverseInheritProperty.cs (1)
207Debug.Assert(originChangedAction != null);
System\Windows\UIElement.cs (9)
264Debug.Assert(MeasureRequest == null, "can't be clean and still have MeasureRequest"); 297Debug.Assert(ArrangeRequest == null, "can't be clean and still have MeasureRequest"); 1893Debug.Assert(routedEvent != null, "RoutedEvent must not be null"); 1930Debug.Assert(routedEvent != null, "RoutedEvent must not be null"); 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 (2277)
MS\Internal\Annotations\Anchoring\AttachedAnnotation.cs (8)
70Debug.Assert(manager != null, "LocatorManager can not be null"); 71Debug.Assert(annotation != null, "Annotation can not be null"); 72Debug.Assert(anchor != null, "Anchor can not be null"); 73Debug.Assert(attachedAnchor != null, "AttachedAnchor can not be null"); 240Debug.Assert(attachedAnchor != null, "AttachedAnchor can not be null"); 241Debug.Assert(attachmentLevel > AttachmentLevel.Unresolved && attachmentLevel <= AttachmentLevel.Incomplete, 256Debug.Assert(_selectionProcessor != null, SR.Format(SR.NoProcessorForSelectionType, attachedAnchor.GetType())); 266Debug.Assert(_attachmentLevel != AttachmentLevel.Full, "Should only set fully resolved anchor if attachment level is not full.");
MS\Internal\Annotations\Anchoring\DataIdProcessor.cs (2)
408Debug.Assert(node != null, "DependencyObject can not be null"); 429Debug.Assert(d != null, "DependencyObject can not be null");
MS\Internal\Annotations\Anchoring\FixedPageProcessor.cs (1)
326Debug.Assert(page >= 0, "page can not be negative");
MS\Internal\Annotations\Anchoring\FixedTextSelectionProcessor.cs (3)
123Debug.Assert(numOfPages >= 0, "start page number is bigger than the end page number"); 301Debug.Assert(tv != null); 612Debug.Assert((start != null) && (end != null), "null start/end TextPointer on a non empty page");
MS\Internal\Annotations\Anchoring\LocatorManager.cs (13)
330Debug.Assert(attachedAnchor != null, "AttachedAnchor cannot be null if attachmentLevel is not Unresolved."); 380Debug.Assert(processor != null, "SubtreeProcessor can not be null"); 658Debug.Assert(startNode != null, "startNode can not be null"); 770Debug.Assert(node != null, "node can not be null"); 837Debug.Assert(data != null, "dataBlob is either null or not of ProcessingTreeState type"); 842Debug.Assert(processor != null, "SubtreeProcessor can not be null"); // There is always a default processor 864Debug.Assert(data != null, "dataBlob is either null or not of ProcessingTreeState type"); 868Debug.Assert(processor != null, "SubtreeProcessor can not be null"); 903Debug.Assert(locator != null, "locator can not be null"); 904Debug.Assert(startNode != null, "startNode can not be null"); 940Debug.Assert(offset >= 0 && offset < realLocator.Parts.Count, "offset out of range"); 1111Debug.Assert(locator != null, "locator can not be null"); 1112Debug.Assert(data.LocatorPartIndex >= 0 && data.LocatorPartIndex < locator.Parts.Count,
MS\Internal\Annotations\Anchoring\PathNode.cs (5)
227Debug.Assert(node != null, "node can not be null"); 281Debug.Assert(node != null, "node can not be null"); 320Debug.Assert(path != null, "path can not be null"); 321Debug.Assert(branch != null, "branch can not be null"); 325Debug.Assert(path.Node.Equals(branch.Node), "path.Node is not equal to branch.Node");
MS\Internal\Annotations\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\Annotations\AnnotationMap.cs (1)
84Debug.Assert(list != null, $"there should be an attached annotation list for the annotationId: {annotationId}");
MS\Internal\Annotations\Component\AdornerPresentationContext.cs (1)
439Debug.Assert((adorners != null) && (adorner != null), "null adorners list or adorner");
MS\Internal\Annotations\Component\AnnotationComponentManager.cs (9)
60Debug.Assert(attachedAnnotation != null, "AttachedAnnotation should not be null"); 77Debug.Assert(attachedAnnotation != null, "AttachedAnnotation should not be null"); 145Debug.Assert(attachedAnnotation != null, "AttachedAnnotation should not be null"); 148Debug.Assert(annotatedElement != null, "the annotatedElement should inherit from UIElement"); 168Debug.Assert(annotatedElement != null, "the annotatedElement should inherit from UIElement"); 211Debug.Assert(attachedAnnotation != null, "attachedAnnotation should not be null"); 212Debug.Assert(previousAttachedAnchor != null, "previousAttachedAnchor should not be null"); 272Debug.Assert(attachedAnnotation != null, "attachedAnnotation should not be null"); 273Debug.Assert(component != null, "component should not be null");
MS\Internal\Annotations\Component\AnnotationHighlightLayer.cs (21)
80Debug.Assert(start != null, "start pointer is null"); 81Debug.Assert(end != null, "end pointer is null"); 82Debug.Assert(start.CompareTo(end) <= 0, "end pointer before start"); 118Debug.Assert(highlightRange != null, "null range data"); 348Debug.Assert(highlightRange != null, " null highlight range"); 350Debug.Assert((rangeSegments != null) && (rangeSegments.Count > 0), "invalid rangeSegments"); 361Debug.Assert(highlightSegment != null, "null highlight segment"); 385Debug.Assert(rangeEnumerator.Current.IsNull || !next || 520Debug.Assert(false, "Mismatched segment data"); 643Debug.Assert(start != null, "start pointer is null"); 644Debug.Assert(end != null, "end pointer is null"); 645Debug.Assert(owners != null, "null owners list"); 646Debug.Assert(owners.Count > 0, "empty owners list"); 648Debug.Assert(owners[i] != null, "null owner"); 799Debug.Assert((ps1 != null) && (ps2 != null) && (ps1.CompareTo(ps2) <= 0), "invalid splitting points"); 873Debug.Assert(res.Count == 2, "unexpected resulting segment count after split"); 929Debug.Assert(textViews != null, "geometry text view not found"); 948Debug.Assert((view != null) && (parentView != null), "null text view"); 990Debug.Assert(!_segment.IsNull, "null TextSegment"); 1109Debug.Assert(TopOwner != null, "invalid TopOwner"); 1111Debug.Assert(parentView != null, "geometry parent text view not found");
MS\Internal\Annotations\Component\MarkedHighlightComponent.cs (26)
370Debug.Assert(anchor != null, "undefined anchor"); 371Debug.Assert(marker.Data != null || marker.Data == Geometry.Empty, "undefined geometry"); 375Debug.Assert(geometry != null, "unexpected geometry type"); 376Debug.Assert(geometry.Children.Count == 3, "unexpected geometry children count"); 443Debug.Assert(_uiParent != null, "No selection container"); 485Debug.Assert(textContainer != null, "TextAnchor does not belong to a TextContainer"); 633Debug.Assert(componentsRegister != null, "The selection is not registered"); 659Debug.Assert(anchor != null, "wrong attachedAnchor"); 892Debug.Assert(selection != null, "Unexpected sender of Changed event"); 902Debug.Assert(components != null, "No SN registered for this selection"); 910Debug.Assert(components[i].HighlightAnchor != null, "Missing highlight anchor component"); 931Debug.Assert(sender != null, "undefined sender"); 958Debug.Assert(pos != null, "null text pointer"); 972Debug.Assert((components != null) && (components.Count > 0), "invalid component registry"); 999Debug.Assert(selectionHandler != null, "SelectionHandler handler can not be null"); 1000Debug.Assert(mouseMoveHandler != null, "MouseMoveHandler handler can not be null"); 1013Debug.Assert(component != null, "component is null"); 1014Debug.Assert(_components != null, "_components are null"); 1048Debug.Assert(component != null, "component is null"); 1049Debug.Assert(_components != null, "_components are null"); 1104Debug.Assert(first != null, "first component is null"); 1105Debug.Assert((first.AttachedAnnotations != null) && (first.AttachedAnnotations.Count > 0), "first AttachedAnchor is null"); 1106Debug.Assert(second != null, "second component is null"); 1107Debug.Assert((second.AttachedAnnotations != null) && (second.AttachedAnnotations.Count > 0), "second AttachedAnchor is null"); 1112Debug.Assert(firstAnchor != null, " first TextAnchor is null"); 1113Debug.Assert(secondAnchor != null, " second TextAnchor is null");
MS\Internal\Annotations\Storage\StoreAnnotationsMap.cs (2)
50Debug.Assert(authorChanged != null && anchorChanged != null && cargoChanged != null, 76Debug.Assert(FindAnnotation(annotation.Id) == null, "annotation not found");
MS\Internal\AppModel\IconHelper.cs (1)
343Debug.Assert(nBytesCount > 0, "The N-Byte has to be greater than 0!");
MS\Internal\AppModel\Journaling.cs (16)
102Debug.Assert(_contentId == 0 || _contentId == value, 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); 382Debug.Assert(endingPF.ParentPageFunctionId == Guid.Empty, 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); 572Debug.Assert(ns != null, "Fragment navigation won't work when the INavigator doesn't have a NavigationService."); 578Debug.Assert(pageFunction != null); 659Debug.Assert(contentObject.GetType().AssemblyQualifiedName == this._typeName.Value, 793Debug.Assert(_markupUri != null, "_markupUri in JournalEntryPageFunctionUri should be set.");
MS\Internal\AppModel\JournalNavigationScope.cs (6)
277Debug.Assert(journal != null); 306Debug.Fail("Tried to navigate to a null JournalEntry."); 311Debug.Fail("Tried to navigate to a non-navigable journal entry."); 316Debug.Assert(navigationService != null, "NavigationService cannot be null for journal navigations"); 421Debug.Assert(_journal == null && value != null, 456Debug.Assert(sender == _journal);
MS\Internal\AppModel\ReturnEventSaver.cs (1)
114Debug.Assert(caller != null, "Caller should not be null");
MS\Internal\Commands\CommandHelpers.cs (3)
101Debug.Assert(controlType != null); 102Debug.Assert(command != null); 103Debug.Assert(executedRoutedEventHandler != null);
MS\Internal\Controls\ActiveXContainer.cs (3)
67Debug.Assert(_host != null, "gotta have the avalon activex host"); 213Debug.Assert(_siteUIActive == null, "Object did not call OnUIDeactivate"); 224Debug.Assert(this.ActiveXHost == site, "deactivating when not active...");
MS\Internal\Controls\ActiveXSite.cs (2)
222Debug.Fail(t.ToString()); 365Debug.Fail(t.ToString());
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 (2)
35Debug.Assert(inkCanvas != null); 281Debug.Assert(Children.Contains(hitElement), "The hit element should be a child of InnerCanvas.");
MS\Internal\Controls\InkCanvasSelectionAdorner.cs (1)
36Debug.Assert(adornedElement is InkCanvasInnerCanvas,
MS\Internal\Controls\ModelTreeEnumerator.cs (6)
150Debug.Assert(contentControl != null, "contentControl should be non-null."); 170Debug.Assert(headeredContentControl != null, "headeredContentControl should be non-null."); 171Debug.Assert(header != null, "Header should be non-null. If Header was null, the base ContentControl enumerator should have been used."); 230Debug.Assert(headeredItemsControl != null, "headeredItemsControl should be non-null."); 231Debug.Assert(items != null, "items should be non-null."); 232Debug.Assert(header != null, "header should be non-null. If Header was null, the base ItemsControl enumerator should have been used.");
MS\Internal\Controls\StickyNote\StickyNoteAnnotations.cs (14)
89Debug.Assert(annotation != null); 131Debug.Assert((token & AllValues) != 0); 619Debug.Assert(false); 634Debug.Assert(cargo != null); 658Debug.Assert(false); 706Debug.Assert(false); 732Debug.Assert(false, "The annotation data does match with the current content control in StickyNote"); 815Debug.Assert(snc.IsExpanded); 823Debug.Assert(snc.IsExpanded); 1261Debug.Assert(_attachedAnnotation != null && _attachedAnnotation.Annotation == args.Annotation); 1275Debug.Assert(_attachedAnnotation != null && _attachedAnnotation.Annotation == args.Annotation); 1378Debug.Assert(((IAnnotationComponent)this).AnnotatedElement != null, "undefined annotated element"); 1405Debug.Assert(adornerTransform != null, "transform to AnnotatedElement is null"); 1571Debug.Assert(_attachedAnnotation != null, "This property should never be acccessed from outside of CAF");
MS\Internal\Controls\StickyNote\StickyNoteContentControl.cs (4)
206Debug.Assert(node != null && !IsEmpty); 233Debug.Assert(node != null); 378Debug.Assert(node != null && !IsEmpty); 400Debug.Assert(node != null, "Try to load data from an invalid node");
MS\Internal\Controls\StickyNote\StickyNoteHelper.cs (2)
91Debug.Assert(!helper.IsLocked(flag)); 101Debug.Assert(_helper.IsLocked(_flag));
MS\Internal\Controls\TemplatedAdorner.cs (3)
48Debug.Assert(adornedElement != null, "adornedElement should not be null"); 49Debug.Assert(adornerTemplate != null, "adornerTemplate should not be null"); 142Debug.Assert(_child != null, "_child should not be null");
MS\Internal\Controls\WebBrowserEvent.cs (7)
44Debug.Assert(parent != null, "WebBrowser control required for hooking webbrowser events"); 54Debug.Assert(url == null || url is string, "invalid url type"); 55Debug.Assert(targetFrameName == null || targetFrameName is string, "invalid targetFrameName type"); 56Debug.Assert(headers == null || headers is string, "invalid headers type"); 175Debug.Assert(url == null || url is string, "invalid url type"); 193Debug.Assert(psi != null, "The Document does not implement IPersistStreamInit"); 230Debug.Assert(url == null || url is string, "invalid url type");
MS\Internal\Data\BindingWorker.cs (1)
34Debug.Assert((int)Feature.LastFeatureId <= 32, "UncommonValueTable supports only 32 Ids");
MS\Internal\Data\CollectionViewGroupInternal.cs (2)
525Debug.Assert(subgroup != null); 547Debug.Assert(subgroup != null);
MS\Internal\Data\CollectionViewGroupRoot.cs (2)
155Debug.Assert(System.Windows.Controls.ItemsControl.EqualsEx(item, ProtectedItems[index]), "RemoveSpecialItem finds inconsistent data"); 643Debug.Assert(false, "Failed to find item in expected subgroup after Move");
MS\Internal\Data\CompositeCollectionView.cs (4)
416Debug.Assert(startingIndex >= 0, "Source composite collection failed to supply an index"); 461Debug.Assert(args.Action == NotifyCollectionChangedAction.Remove); 1672Debug.Assert(false, "CurrentItem is not consistent with CurrentPosition"); 1677Debug.Assert(false, "CurrentItem is not consistent with CurrentPosition");
MS\Internal\Data\DataExtensionMethods.cs (1)
38Debug.Assert(false, "Unsupported list passed to Search");
MS\Internal\Data\DefaultValueConverter.cs (1)
477Debug.Assert(sourceType != targetType);
MS\Internal\Data\DisplayMemberTemplateSelector.cs (1)
28Debug.Assert(!(String.IsNullOrEmpty(displayMemberPath) && String.IsNullOrEmpty(stringFormat)));
MS\Internal\Data\IndexedEnumerable.cs (2)
405Debug.Assert(false, "EnsureCacheCurrent: _enumerator.Current failed with InvalidOperationException"); 407Debug.Assert(System.Windows.Controls.ItemsControl.EqualsEx(_cachedItem, current), "EnsureCacheCurrent: _cachedItem out of sync with _enumerator.Current");
MS\Internal\Data\LiveShapingBlock.cs (1)
94Debug.Assert(index < size, "FindPosition called with item not in its block");
MS\Internal\Data\LiveShapingList.cs (1)
263Debug.Assert(sdc.Count >= _compInfos.Length, "SortDescriptions don't match LivePropertyInfos");
MS\Internal\Data\PropertyPathWorker.cs (3)
621Debug.Assert(0 <= k && k < _arySVS.Length && _arySVS[k].collectionView == collectionView, "bad parameters to UpdateSourceValueState"); 1156Debug.Assert(_dependencySourcesChanged, "Cached accessor didn't change sources"); 1296Debug.Assert(sb.Length == 0,
MS\Internal\Data\RBNode.cs (4)
423Debug.Assert(successor != null && successor.Size < MaxSize, "InsertAt: successor should have room"); 444Debug.Assert(succsucc.Size == MaxSize, "InsertAt: outer nodes should be full"); 522Debug.Assert(index >= node.LeftSize + node.Size, "InsertNode: index should fall between nodes"); 575Debug.Assert(!deleteHere || node.Size == 0, "DeleteNode: Deleted node should be empty");
MS\Internal\Data\StaticPropertyChangedEventManager.cs (6)
87Debug.Assert(false, "Should never get here"); 95Debug.Assert(false, "Should never get here"); 157Debug.Assert(handler != null && type != null && propertyName != null, 182Debug.Assert(handler != null && type != null && propertyName != null, 403Debug.Assert((String)de.Key != AllListenersKey, "special key should not appear"); 491Debug.Assert(_toRemove.Count == 0, "to-remove list should be empty");
MS\Internal\Data\ValueChangedEventManager.cs (3)
193Debug.Assert(_toRemove.Count == 0, "to-remove list should be empty"); 301Debug.Assert(listener != null && source != null && pd != null, 309Debug.Assert(listener != null && source != null && pd != null,
MS\Internal\Data\ViewManager.cs (1)
240Debug.Assert(cvs != null, "Required CVS key is missing");
MS\Internal\Data\XDeferredAxisSource.cs (1)
80Debug.Assert(aryMembers.Length == 1, "XLinq changed XDeferredAxis to have more than one indexer");
MS\Internal\Data\XmlBindingWorker.cs (2)
40Debug.Assert(_xpath != null); 446Debug.Assert(ContextNode != null);
MS\Internal\DataStreams.cs (1)
276Debug.Assert(state != null);
MS\Internal\Documents\Application\DocumentApplicationJournalEntry.cs (1)
75Debug.Assert(docViewer != null, "PUIDocumentApplicationDocumentViewer not found.");
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 (6)
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); 197Debug.Assert(false, "Invalid state in HostedElements.cs");
MS\Internal\Documents\PageCache.cs (1)
740Debug.Assert(changes != null, "Attempt to fire PageCacheChangedEvent with null change set.");
MS\Internal\Documents\RowCache.cs (1)
1062Debug.Assert(false, "Requested to update a non-existent row.");
MS\Internal\Documents\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 (9)
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])); 346Debug.Assert(false, "Garbage in logical tree."); 373Debug.Assert(BelongsToOwner(Items[i])); 390Debug.Assert(BelongsToOwner(item) && Items[item.Index] == item);
MS\Internal\Documents\TextBoxView.cs (1)
1223System.Diagnostics.Debug.Assert(_host != null && _host.TextContainer != null && _host.TextContainer.Highlights != null,
MS\Internal\Documents\TextParagraphView.cs (11)
155Debug.Assert(lines != null && lines.Count > 0); 161Debug.Assert(false); 273Debug.Assert(lines != null && lines.Count > 0); 277Debug.Assert(lineIndex >= 0 && lineIndex < lines.Count); 329Debug.Assert(lines != null && lines.Count > 0, "Line array is empty."); 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 (3)
60Debug.Assert(output != null, "The output stream given is null"); 61Debug.Assert(tree != null && tree.Root != null, "The tree to be serialized is null."); 82Debug.Assert(elementNode != null);
MS\Internal\Globalization\BamlTreeMap.cs (3)
51Debug.Assert(tree != null, "Baml Tree is empty"); 52Debug.Assert(localizer != null, "BamlLocalizer is null"); 576Debug.Assert(node.NodeType == BamlNodeType.StartElement);
MS\Internal\Globalization\BamlTreeNode.cs (4)
43Debug.Assert(root != null, "Baml tree root is null!"); 44Debug.Assert(size > 0, "Baml tree size is less than 1"); 567Debug.Assert(value.Category != LocalizationCategory.Ignore && value.Category != LocalizationCategory.Inherit); 701Debug.Assert(value.Category != LocalizationCategory.Ignore && value.Category != LocalizationCategory.Inherit);
MS\Internal\Globalization\BamlTreeUpdater.cs (3)
34Debug.Assert(tree != null && tree.Root != null, "Empty Tree!"); 35Debug.Assert(treeMap != null, "Empty map!"); 36Debug.Assert(dictionary != null, "Empty dictionary");
MS\Internal\Globalization\LocalizableResourceBuilder.cs (2)
448Debug.Assert(inheritableAttribute != null); 518Debug.Assert(false, "Can't process localizability attribute on nodes other than Element, Property and LiteralContent.");
MS\Internal\Globalization\LocalizationComments.cs (1)
355Debug.Assert(enumPrefix != null && enumNames != null);
MS\Internal\Helper.cs (7)
409Debug.Assert( fe != null ); 604Debug.Assert(targetDependencyObject != null, "DependencyProperties can only be set on DependencyObjects"); 650Debug.Assert(targetMember is PropertyInfo || targetMember is MethodInfo, 663Debug.Assert(parameterInfos.Length == 2, "The signature of a static settor must contain two parameters"); 847Debug.Assert(item != null); 1264Debug.Assert(virtualizingElement != null, "Must have a virtualizingElement to clear"); 1342Debug.Assert(VisualTreeHelper.IsAncestorOf(pathEndElement, pathStartElement), "pathEndElement should be an ancestor of pathStartElement");
MS\Internal\Ink\ClipboardProcessor.cs (6)
85Debug.Assert(dataObject != null && _preferredClipboardData!= null); 131Debug.Assert(inkCanvasSelection.SelectedStrokes.Count == orderedStrokes.Count); 175Debug.Assert(false , "CopySelectData: InkCanvas should have a selection!"); 189Debug.Assert(dataObject != null && _preferredClipboardData!= null); 259Debug.Assert(_preferredClipboardData != null); 268Debug.Assert(value != null);
MS\Internal\Ink\EditingCoordinator.cs (22)
88Debug.Assert(ActiveEditingBehavior == SelectionEditor, 181Debug.Assert(currentBehavior is StylusEditingBehavior, 203Debug.Assert(currentBehavior is StylusEditingBehavior, 259Debug.Assert(behavior != null); 317Debug.Assert(_activationStack.Count == 1, "The behavior stack has to contain one behavior."); 363Debug.Assert(behavior == ActiveEditingBehavior); 373Debug.Assert(behavior == LassoSelectionBehavior || behavior == SelectionEditingBehavior, 384Debug.Assert(behavior != LassoSelectionBehavior && behavior != SelectionEditingBehavior, 453Debug.Assert((_capturedStylus != null && _capturedMouse == null) 611Debug.Assert(newEditingBehavior != null); 787Debug.Assert(stylusEditingBehavior != null || ActiveEditingBehavior == null, 870Debug.Assert(ActiveEditingBehavior == null || ActiveEditingBehavior is IStylusEditing, 942Debug.Assert(inputDevice != null, "A null device is passed in."); 943Debug.Assert(stylusEditingBehavior != null, "stylusEditingBehavior cannot be null."); 944Debug.Assert(!IsInMidStroke, "The previous device hasn't been released yet."); 992Debug.Assert(!resetDynamicRenderer, "The dynamic renderer shouldn't be reset for Mouse"); 1028Debug.Assert(IsInMidStroke || !releaseDevice, "The captured device has been release unexpectly."); 1070Debug.Assert(_capturedStylus == null || _capturedMouse == null, "InkCanvas cannot capture both stylus and mouse at the same time."); 1203Debug.Assert(false, "Unknown behavior"); 1240Debug.Assert(false, "Unknown behavior"); 1248Debug.Assert(!IsInMidStroke, "ChangeEditingBehavior cannot be called in a mid-stroke"); 1249Debug.Assert(_activationStack.Count <= 1, "The behavior stack has to contain at most one behavior when user is not editing.");
MS\Internal\Ink\EraserBehavior.cs (8)
91Debug.Assert(EditingCoordinator.IsInMidStroke, "SwitchToMode should only be called in a mid-stroke"); 109Debug.Assert(_cachedEraseMode != mode); 154Debug.Assert(false, "Unknown InkCanvasEditingMode!"); 163Debug.Assert(newEraseMode == InkCanvasEditingMode.EraseByPoint 187Debug.Assert(_cachedPointEraserCursor != null, "_cachedPointEraserCursor shouldn't be null."); 355Debug.Assert(null != e.HitStroke); 393Debug.Assert(null != e.HitStroke, "e.HitStroke cannot be null"); 409Debug.Assert(eraseResult != null, "eraseResult cannot be null");
MS\Internal\Ink\InkCanvasSelection.cs (11)
142Debug.Assert( _inkCanvas.EditingCoordinator.UserIsEditing == true ); 143Debug.Assert(activeSelectionHitResult != InkCanvasSelectionHitResult.None, "activeSelectionHitResult cannot be InkCanvasSelectionHitResult.None."); 153Debug.Assert(VisualTreeHelper.GetParent(feedbackAdorner) == null, 168Debug.Assert(VisualTreeHelper.GetParent(_inkCanvas.FeedbackAdorner) 186Debug.Assert(VisualTreeHelper.GetParent(feedbackAdorner) == adornerLayer, 208Debug.Assert(strokes != null && elements != null); 493Debug.Assert(false, "The updatedElement has to be the same type as the originalElement."); 613Debug.Assert(false, "An unexpected single selected Element"); 774Debug.Assert( SelectedElements.Count != 0, 892Debug.Assert(_inkCanvas.SelectionAdorner.Visibility == Visibility.Visible, 899Debug.Assert(_inkCanvas.SelectionAdorner.Visibility == Visibility.Collapsed,
MS\Internal\Ink\InkCollectionBehavior.cs (3)
114Debug.Assert(EditingCoordinator.IsInMidStroke, "SwitchToMode should only be called in a mid-stroke"); 173Debug.Assert(false, "Unknown InkCanvasEditingMode!"); 301Debug.Assert(_strokeDrawingAttributes != null, "_strokeDrawingAttributes can not be null, did we not see a down?");
MS\Internal\Ink\LassoHelper.cs (2)
172System.Diagnostics.Debug.Assert(null != points); 173System.Diagnostics.Debug.Assert((0 <= percentIntersect) && (100 >= percentIntersect));
MS\Internal\Ink\LassoSelectionBehavior.cs (11)
77Debug.Assert(EditingCoordinator.IsInMidStroke, "SwitchToMode should only be called in a mid-stroke"); 105Debug.Assert(false, "Cannot switch from Select to Select in mid-stroke"); 118Debug.Assert(false, "Unknown InkCanvasEditingMode!"); 130Debug.Assert(stylusPoints.Count != 0, "An empty stylusPoints has been passed in."); 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()); 596Debug.Assert(!_disableLasso && _lassoHelper == null, "StartLasso is called unexpectedly.");
MS\Internal\Ink\PenCursorManager.cs (2)
64Debug.Assert(DoubleUtil.IsZero(tranform.OffsetX) && DoubleUtil.IsZero(tranform.OffsetY), "The EraserShape cannot be translated."); 65Debug.Assert(tranform.HasInverse, "The transform has to be invertable.");
MS\Internal\Ink\SelectionEditingBehavior.cs (3)
78Debug.Assert(_hitResult != InkCanvasSelectionHitResult.None); 335Debug.Assert(false); 389Debug.Assert(EditingCoordinator.UserIsEditing == false, "Unexpect UserIsEditng state." );
MS\Internal\Ink\StrokeCollectionDefaultValueFactory.cs (1)
41Debug.Assert(property.PropertyType == typeof(StrokeCollection),
MS\Internal\IO\Packaging\ByteStream.cs (3)
42Debug.Assert(stream != null); 48Debug.Assert(_access == FileAccess.Read); 117Debug.Assert(_length > 0);
MS\Internal\IO\Packaging\ManagedFilter.cs (2)
72System.Diagnostics.Debug.Assert(_propType == PropSpecType.Name, "ManagedPropSpec.PropName - PropName only meaningful if PropType is type string"); 93System.Diagnostics.Debug.Assert(_propType == PropSpecType.Id, "ManagedPropSpec.PropId - PropId only meaningful if PropType is numeric");
MS\Internal\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\LayoutDump.cs (5)
466Debug.Assert(dpv != null, "Dump function has to match element type."); 482Debug.Assert(text != null, "Dump function has to match element type."); 515Debug.Assert(fdsv != null, "Dump function has to match element type."); 541Debug.Assert(fdView != null, "Dump function has to match element type."); 581Debug.Assert(flowDocumentPage != null, "Dump function has to match page type.");
MS\Internal\Navigation\JournalEntryStack.cs (1)
127Debug.Assert(_current != null, "If we are returning true, our current cannot be null");
MS\Internal\PtsHost\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 (6)
69Debug.Assert(Cell.Index != -1 && Cell.ColumnIndex != -1, 75Debug.Assert(Cell.Table != null); 141Debug.Assert(Cell.Index != -1 && Cell.ColumnIndex != -1, 144Debug.Assert(Cell.Table != null); 170Debug.Assert(Cell.Index != -1 && Cell.ColumnIndex != -1, 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\ErrorHandler.cs (2)
28System.Diagnostics.Debug.Assert(false, message); 42System.Diagnostics.Debug.Assert(false, message);
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 (2)
317Debug.Assert(false, "Tight wrap is not currently supported."); 441Debug.Assert(ParagraphEndCharacterPosition >= startPosition);
MS\Internal\PtsHost\FloaterBaseParagraph.cs (1)
126Debug.Assert(false, "Tight wrap is not currently supported.");
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 (5)
256Debug.Assert(pmcsclientOut == IntPtr.Zero); 504Debug.Assert(pmcsclientOut == IntPtr.Zero); 523Debug.Assert(pmcsclientOut == IntPtr.Zero); 609Debug.Assert(ParagraphEndCharacterPosition >= startPosition); 822Debug.Assert(false, "Unknown type of anchor.");
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 (6)
73Debug.Assert(_line != null, "Line has been already disposed."); 362Debug.Assert(!double.IsNaN(_trackWidth), "Track width must be set for measure pass."); 422Debug.Assert(DoubleUtil.GreaterThanOrClose(rect.Width, 0), "Negative inline object's width."); 678Debug.Assert(dcp >= 0 && (dcp + cch <= _line.Length)); 698Debug.Assert(cchGlyphRuns > 0 && glyphRunsCollection.Count > 0); 1024Debug.Assert(runBounds.Count == 1, "Expecting exactly one TextRunBounds for a single text position.");
MS\Internal\PtsHost\LineBase.cs (2)
146Debug.Assert(element != null, "Cannot use ITextContainer that does not provide TextElement instances."); 268Debug.Assert(element != null, "Element should be here.");
MS\Internal\PtsHost\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 (4)
62Debug.Assert(ptsContext != null, "Null argument 'ptsContext' - required for return value validation."); 97Debug.Assert(ptsContext != null, "Null argument 'ptsContext' - required for return value validation."); 164Debug.Assert(false); 214Debug.Assert(false, "Unknown WrapDirection value.");
MS\Internal\PtsHost\PtsHelper.cs (3)
593Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 594Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0); 903Debug.Assert(cColumns > 0, "At least one column is required.");
MS\Internal\PtsHost\PtsHost.cs (24)
398Debug.Assert(cnms == 1); // Only one section is supported right now. 584Debug.Assert(false, "PTS.GetSegmentDefinedColumnSpanAreaInfo is not implemented."); 596Debug.Assert(false, "PTS.GetHeightDefinedColumnSpanAreaInfo is not implemented."); 884Debug.Assert(false, "PTS.GetNumberEndnoteColumns is not implemented."); 896Debug.Assert(false, "PTS.GetEndnoteColumnInfo is not implemented."); 907Debug.Assert(false, "PTS.GetFootnoteSeparators is not implemented."); 916Debug.Assert(false, "PTS.FFootnoteBeneathText is not implemented."); 925Debug.Assert(false, "PTS.GetNumberFootnoteColumns is not implemented."); 937Debug.Assert(false, "PTS.GetFootnoteColumnInfo is not implemented."); 946Debug.Assert(false, "PTS.GetFootnoteSegment is not implemented."); 960Debug.Assert(false, "PTS.GetFootnotePresentationAndRejectionOrder is not implemented."); 969Debug.Assert(false, "PTS.FAllowFootnoteSeparation is not implemented."); 1267Debug.Assert(false, "PTS.GetFootnotes is not implemented."); 1286Debug.Assert(false, "PTS.FormatDropCap is not implemented."); 1304Debug.Assert(false, "PTS.GetDropCapPolygons is not implemented."); 1312Debug.Assert(false, "PTS.DestroyDropCap is not implemented."); 1724Debug.Assert(false, "PTS.SnapGridVertical is not implemented."); 1825Debug.Assert(false, "PTS.UpdGetDropCapChange is not implemented."); 1926Debug.Assert(false, "PTS.GetOptimalLineDcpCache is not implemented."); 2571Debug.Assert(false); 2956Debug.Assert(false, "PTS.ObjGetFootnoteInfo is not implemented."); 2966Debug.Assert(false); 3186Debug.Assert(false); 3265Debug.Assert(false);
MS\Internal\PtsHost\PtsPage.cs (13)
163Debug.Assert(!canUpdate || _section.CanUpdate); 172Debug.Assert(breakRecord == null || !_section.StructuralCache.DestroyStructure, "Cannot format from dirty break record unless StructuralCache.DestroyStructure is not set."); 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 (4)
201Debug.Assert(fSuppressTopSpace == 1, "Top space should be always suppressed at the top of broken paragraph."); 457Debug.Assert(pmcsclientOut == IntPtr.Zero); 616Debug.Assert(pmcsclientOut == IntPtr.Zero); 664Debug.Assert(ParagraphEndCharacterPosition >= startPosition);
MS\Internal\PtsHost\TableParaClient.cs (24)
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 1979Debug.Assert(false, "Unsupported unit type"); 2047Debug.Assert(_calculatedColumns[i].UserWidth.GridUnitType == GridUnitType.Auto || _calculatedColumns[i].UserWidth.GridUnitType == GridUnitType.Star || _calculatedColumns[i].UserWidth.GridUnitType == GridUnitType.Pixel, "Unexpected GridUnitType"); 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 (3)
316Debug.Assert(Table.RowGroups.Count > 0); 332Debug.Assert(currentRowGroup.Rows[nextRowIndex].Index != -1, 349Debug.Assert(Rows[0].Index != -1,
MS\Internal\PtsHost\TextFormatterHost.cs (6)
43Debug.Assert(Context != null, "TextFormatter host is not initialized."); 44Debug.Assert(textSourceCharacterIndex >= 0, "Character index must be non-negative."); 59Debug.Assert(Context != null, "TextFormatter host is not initialized."); 60Debug.Assert(textSourceCharacterIndexLimit >= 0, "Character index must be non-negative."); 73Debug.Assert(Context != null, "TextFormatter host is not initialized."); 74Debug.Assert(textSourceCharacterIndex>= 0, "Character index must be non-negative.");
MS\Internal\PtsHost\TextParaClient.cs (42)
137Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 138Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 164Debug.Assert(!((TextParagraph) Paragraph).HasFiguresFloatersOrInlineObjects()); 235Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 236Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 257Debug.Assert(Paragraph.Element as ContentElement != e); 324Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 325Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 377Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 378Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 719Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 720Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 800Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 801Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 832Debug.Assert(position is TextPointer); 863Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 864Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 882Debug.Assert(position is TextPointer); 913Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 914Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 1070Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 1071Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 1372Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 1373Debug.Assert(false, "Should not get here. ParaCache is not currently used."); 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\SystemDataHelper.cs (1)
86Debug.Assert(false, "Could not find Null field or property for SqlNullable type");
MS\Internal\Text\ComplexLine.cs (12)
69Debug.Assert(run != null, "TextRun has not been created."); 70Debug.Assert(run.Length > 0, "TextRun has to have positive length."); 85Debug.Assert(dcp >= 0); 160Debug.Assert(runs != null, "Cannot retrieve runs collection."); 183Debug.Assert(DoubleUtil.GreaterThanOrClose(rect.Width, 0), "Negative inline object's width."); 235Debug.Assert(runs != null, "Cannot retrieve runs collection."); 339Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text, "TextPointer does not point to characters."); 386Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart, "TextPointer does not point to element start edge."); 391Debug.Assert(element != null, "Cannot use ITextContainer that does not provide TextElement instances."); 477Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd, "TextPointer does not point to element end edge."); 482Debug.Assert(element != null, "Element should be here."); 527Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.EmbeddedElement, "TextPointer does not point to embedded object.");
MS\Internal\Text\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\Line.cs (7)
116Debug.Assert(_line != null, "Rendering line that has not been measured yet."); 123Debug.Assert(line.HasCollapsed, "Line has not been collapsed"); 316Debug.Assert(collapsedLine.HasCollapsed, "Line has not been collapsed"); 320Debug.Assert(collapsedRanges.Count == 1, "Multiple collapsed ranges are not supported."); 352Debug.Assert(collapsedLine.HasCollapsed, "Line has not been collapsed"); 483Debug.Assert(runBounds.Count == 1, "Expecting exactly one TextRunBounds for a single text position."); 506Debug.Assert(paraProperties.TextTrimming != TextTrimming.None, "Text trimming must be enabled.");
MS\Internal\Text\LineMetrics.cs (2)
116get { Debug.Assert((_packedData & HasBeenUpdatedMask) != 0); return _width; } 131get { Debug.Assert((_packedData & HasBeenUpdatedMask) != 0); return _start; }
MS\Internal\Text\SimpleLine.cs (3)
39Debug.Assert(dcp >= 0, "Character index must be non-negative."); 79Debug.Assert(dcp >= 0, "Character index must be non-negative."); 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 (3)
106Debug.Assert((uint)PropertyId.PropertyCount <= 32); 779Debug.Assert((uint)propertyId < (uint)PropertyId.PropertyCount, "Invalid typography property id"); 795Debug.Assert((uint)propertyId < (uint)PropertyId.PropertyCount, "Invalid typography property id");
MS\Internal\WeakHashtable.cs (1)
56Debug.Assert(!key.GetType().IsValueType, "WeakHashtable doesn't support value-type keys. Use WeakObjectHashtable instead.");
MS\Internal\WindowsRuntime\Generated\WinRT.cs (1)
174System.Diagnostics.Debug.Assert(_CanUnloadNow == null || _CanUnloadNow() == 0); // S_OK
MS\Win32\UxThemeWrapper.cs (1)
405Debug.Assert(themeState.IsActive, "Queried ThemeColor while UxTheme is not active.");
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Context\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\Internal\Xaml\Context\XamlFrame.cs (1)
46Debug.Assert(_depth != -1, "Context Frame is uninitialized");
System\Windows\Annotations\AnnotationHelper.cs (1)
639Debug.Assert((textSegments != null) && (textSegments.Count > 0), "Invalid selection TextSegments");
System\Windows\Annotations\Storage\XmlStreamStore.cs (2)
843Debug.Assert(knownNamespace != null, "null knownNamespace"); 862Debug.Assert(name != null, "null compatible namespace");
System\Windows\Application.cs (7)
122Debug.Assert(_appInstance == null, "_appInstance must be null here."); 551Debug.Assert(stream != null, "stream should not be null."); 552Debug.Assert(pc != null, "pc should not be null."); 735Debug.Assert( ((stream != null) && (sooPart == null)) != true, "When stream is not null, sooPart cannot be null either"); 1486Debug.Assert(CheckAccess(), "This should only be called on the Application thread"); 1545Debug.Assert(CheckAccess() == true, "DoShutdown can only be called on the Dispatcer thread"); 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\Automation\Peers\ItemAutomationPeer.cs (1)
707System.Diagnostics.Debug.Assert(Object.Equals(item, Item), "ItemPeer reuse for an unequal item is not supported");
System\Windows\Automation\Peers\ItemsControlAutomationPeer.cs (1)
643Debug.Assert(false,"it must not add already present Item");
System\Windows\BroadcastEventHelper.cs (9)
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); 172Debug.Assert(loadedPending != null && loadedPending.Length == 3, 209Debug.Assert(unloadedPending != null && unloadedPending.Length == 3, 513Debug.Assert( fo.IsFE );
System\Windows\Controls\AVElementHelper.cs (1)
60Debug.Assert((element != null), "Element is null");
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 (5)
640Debug.Assert(_editableTextBoxSite == sender); 1213Debug.Assert(_autoScrollTimer == null, "IsMouseCaptured went from true to true"); 1573Debug.Assert((increment > 0 && startIndex <= stopIndex) || (increment < 0 && startIndex >= stopIndex), "Infinite loop detected"); 1735Debug.Assert(!comboBox.CheckAccess() || Mouse.Captured != comboBox, "On the dispatcher thread, ComboBox should not have capture after closing the dropdown"); 1783Debug.Assert(!CheckAccess() || Mouse.Captured != this, "On the dispatcher thread, ComboBox should not have capture after closing the dropdown");
System\Windows\Controls\ContainerTracking.cs (2)
111Debug.Assert(IsInList(root), "This container should be in the tracking list."); 122Debug.Assert(!IsInList(root), "This container shouldn't be in our tracking list");
System\Windows\Controls\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\ContextMenu.cs (1)
489Debug.Assert(_parentPopup == null, "_parentPopup should be null");
System\Windows\Controls\DataGrid.cs (17)
1649Debug.Assert(info != null, "info is null."); 1650Debug.Assert(column != null, "column is null."); 1759Debug.Assert(_isDraggingSelection, "DoAutoScroll should only be called when dragging selection."); 3569Debug.Assert(CanUserAddRows, "AddNewItem called when the end-user cannot add new rows."); 3570Debug.Assert(!IsAddingNewItem, "AddNewItem called when a pending add is taking place."); 5283Debug.Assert(!IsUpdatingSelectedCells); 5289Debug.Assert(IsUpdatingSelectedCells); 5370Debug.Fail("Unknown SelectionUnit encountered."); 6417Debug.Assert(RelativeMousePosition != RelativeMousePositions.Over, "The mouse is not supposed to be over the DataGrid."); 7136Debug.Assert(sortColumn != null, "column should not be null"); 7294Debug.Assert(e.NewItems.Count == 1, "SortDescriptionCollection should handle one element at a time"); 7305Debug.Assert(e.OldItems.Count == 1, "SortDescriptionCollection should handle one element at a time"); 7325Debug.Assert(e.OldItems.Count == 1 && e.NewItems.Count == 1, "SortDescriptionCollection should handle one element at a time"); 7439Debug.Assert(e.NewItems.Count == 1, "GroupDescriptionCollection should handle one element at a time"); 7447Debug.Assert(e.OldItems.Count == 1, "GroupDescriptionCollection should handle one element at a time"); 7458Debug.Assert(e.OldItems.Count == 1 && e.NewItems.Count == 1, "GroupDescriptionCollection should handle one element at a time"); 7881Debug.Assert(dataGrid != null || columnCollection != null, "Both dataGrid and columnCollection cannot not be null at the same time");
System\Windows\Controls\DataGridAutoGeneratingColumnEventArgs.cs (1)
110Debug.Assert(
System\Windows\Controls\DataGridCell.cs (5)
97Debug.Assert(_owner == null || _owner == ownerRow, "_owner should be null before PrepareCell is called or the same value as the ownerRow."); 145Debug.Assert(_owner == ownerRow, "_owner should be the same as the DataGridRow that is clearing the cell."); 584Debug.Assert(!IsEditing, "Should not call BeginEdit when IsEditing is true."); 600Debug.Assert(IsEditing, "Should not call CancelEdit when IsEditing is false."); 614Debug.Assert(IsEditing, "Should not call CommitEdit when IsEditing is false.");
System\Windows\Controls\DataGridCellInfo.cs (9)
59Debug.Assert(item != null, "item should not be null."); 60Debug.Assert(column != null, "column should not be null."); 61Debug.Assert(owner != null, "owner should not be null."); 70Debug.Assert(info != null, "item should not be null."); 71Debug.Assert(column != null, "column should not be null."); 72Debug.Assert(owner != null, "owner should not be null."); 84Debug.Assert(item == DependencyProperty.UnsetValue, "This should only be used to make an Unset CellInfo."); 110Debug.Assert(owner != null, "owner should not be null."); 122Debug.Assert(owner != null, "owner should not be null.");
System\Windows\Controls\DataGridCellsPanel.cs (18)
172Debug.Assert(blockList != null, "RealizedColumnsBlockList shouldn't be null at this point."); 639Debug.Assert(!children.Contains(child), "we incorrectly identified a recycled container"); 654Debug.Assert(child == InternalChildren[childIndex], "Wrong child was generated"); 684Debug.Assert(container != null, "Null container was generated"); 720Debug.Assert(children[visualTreeIndex] != null, "MoveVisualChild interprets a null destination as 'move to end'"); 781Debug.Assert(false, "We should have found a child"); 1076Debug.Assert(columnIndex < columnCount, "columnIndex should be less than column count"); 1151Debug.Assert(startIndex >= 0); 1152Debug.Assert(children == _realizedChildren, "the given child list must be the _realizedChildren list when recycling"); 1343Debug.Assert( 1349Debug.Assert( 1426Debug.Assert(i >= arrangeState.FrozenColumnCount, "Frozen cells should have been realized or not visible"); 1460Debug.Assert(child != null, "child cannot be null."); 1475Debug.Assert(cell.Column != null, "column cannot be null."); 1580Debug.Assert(children.Count > blockElementCount, "Element count from blocks can't be less than total children count"); 1621Debug.Assert(columnIndex <= block.EndIndex, "Missing children for index in block list"); 1983Debug.Assert(ParentDataGrid != null, "ParentDataGrid should not be null"); 2101Debug.Assert((itemCount == itemUICount) || (itemUICount == 0), "Both ItemUICount and ItemCount should be equal or ItemUICount should be 0.");
System\Windows\Controls\DataGridColumn.cs (3)
595Debug.Assert(Width.IsStar); 902Debug.Assert(d is DataGridColumn, "d should be a DataGridColumn"); 1157Debug.Assert(itemProperty != null && itemProperty.PropertyType != null, "itemProperty and/or its PropertyType member cannot be null");
System\Windows\Controls\DataGridColumnCollection.cs (18)
25Debug.Assert(dataGridOwner != null, "We should have a valid DataGrid"); 232Debug.Assert(displayIndex >= 0 && displayIndex < DisplayIndexMap.Count, "displayIndex should have already been validated"); 330Debug.Assert(newDisplayIndex >= 0 && newDisplayIndex < Count, "The new DisplayIndex should have already been validated"); 363Debug.Assert(oldDisplayIndex != newDisplayIndex, "A column's display index must have changed for us to call OnColumnDisplayIndexChanged"); 364Debug.Assert(oldDisplayIndex >= 0 && oldDisplayIndex < Count, "The old DisplayIndex should be valid"); 415Debug.Assert( 418Debug.Assert(IsUpdatingDisplayIndex == false, "We don't add new columns as part of a display index update operation"); 475Debug.Assert(DisplayIndexMap.Count == 0, "DisplayIndexMap should be empty until first measure call."); 548Debug.Assert(assignedDisplayIndexMap.ContainsKey(displayIndex)); 559Debug.Assert( 562Debug.Assert(IsUpdatingDisplayIndex == false, "We don't remove columns as part of a display index update operation"); 567Debug.Assert(DisplayIndexMap.Count > Count, "Columns were just removed: the display index map shouldn't have yet been updated"); 603Debug.Assert(oldColumns.Count == 1 && newColumns.Count == 1, "Multi replace isn't possible with ObservableCollection"); 692Debug.Assert(removedDisplayIndex >= 0); 731Debug.Assert(Count == DisplayIndexMap.Count, "Display Index map is of the wrong size"); 734Debug.Assert(DisplayIndexMap[i] >= 0 && DisplayIndexMap[i] < Count, "DisplayIndex map entry doesn't point to a valid column"); 735Debug.Assert(ColumnFromDisplayIndex(i).DisplayIndex == i, "DisplayIndex map doesn't match column indices"); 902Debug.Assert(
System\Windows\Controls\DataGridColumnHeaderCollection.cs (2)
50Debug.Assert(e.Property == DataGridColumn.HeaderProperty, "We only want to know about the header property changing"); 51Debug.Assert(_columns.Contains(column));
System\Windows\Controls\DataGridHelper.cs (2)
243Debug.Assert((cell is DataGridCell) || (cell is DataGridColumnHeader), "provideColumn should be one of the cell or header containers."); 307Debug.Assert((cell is DataGridCell) || (cell is DataGridColumnHeader), "provideColumn should be one of the cell or header containers.");
System\Windows\Controls\DataGridHyperlinkColumn.cs (1)
294Debug.Assert(e.RoutedEvent == Keyboard.PreviewKeyDownEvent, "We should only reach here on the PreviewKeyDown event because the TextBox within is expected to handle the preview event and hence trump the successive KeyDown event.");
System\Windows\Controls\DataGridLengthConverter.cs (1)
266Debug.Assert(
System\Windows\Controls\DataGridRow.cs (3)
230Debug.Assert(stateCode != DATAGRIDROW_stateNullCode); 443Debug.Assert(_owner == null || _owner == owningDataGrid, "_owner should be null before PrepareRow is called or the same as the owningDataGrid."); 484Debug.Assert(_owner == owningDataGrid, "_owner should be the same as the DataGrid that is clearing the row.");
System\Windows\Controls\DataGridTextColumn.cs (1)
272Debug.Assert(e.RoutedEvent == Keyboard.PreviewKeyDownEvent, "We should only reach here on the PreviewKeyDown event because the TextBox within is expected to handle the preview event and hence trump the successive KeyDown event.");
System\Windows\Controls\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 (22)
451Debug.Assert(_ownJournalScope != null); 455Debug.Fail("UsesOwnJournal->Automatic transition should be blocked by CoerceJournalOwnership()."); 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 (22)
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); 2386Debug.Assert(!def.IsShared, "*-defs cannot be shared"); 3885Debug.Assert(grid != null);
System\Windows\Controls\GridSplitter.cs (4)
423Debug.Assert(_decorator != null); 446Debug.Assert(_decorator != null); 635Debug.Assert(_resizeData == null, "_resizeData is not null, DragCompleted was not called"); 869Debug.Assert(_resizeData != null, "_resizeData should not be null when calling MoveSplitter");
System\Windows\Controls\GridViewColumn.cs (1)
426Debug.Assert(false, "Invalid value for ActualWidth.");
System\Windows\Controls\GridViewColumnCollection.cs (3)
144Debug.Assert(IsImmutable != true, "IsImmutable is true before BlockWrite"); 153Debug.Assert(IsImmutable != false, "IsImmutable is flase before UnblockWrite"); 244Debug.Assert(oldIndex != newIndex, "oldIndex==newIndex when perform move action.");
System\Windows\Controls\GridViewColumnCollectionChangedEventArgs.cs (12)
48Debug.Assert(action == NotifyCollectionChangedAction.Add || action == NotifyCollectionChangedAction.Remove, 50Debug.Assert(changedItem != null, "changedItem can't be null"); 51Debug.Assert(index >= 0, "index must >= 0"); 52Debug.Assert(actualIndex >= 0, "actualIndex must >= 0"); 63Debug.Assert(newItem != null, "newItem can't be null"); 64Debug.Assert(oldItem != null, "oldItem can't be null"); 65Debug.Assert(index >= 0, "index must >= 0"); 66Debug.Assert(actualIndex >= 0, "actualIndex must >= 0"); 77Debug.Assert(changedItem != null, "changedItem can't be null"); 78Debug.Assert(index >= 0, "index must >= 0"); 79Debug.Assert(oldIndex >= 0, "oldIndex must >= 0"); 80Debug.Assert(actualIndex >= 0, "actualIndex must >= 0");
System\Windows\Controls\GridViewColumnHeader.cs (4)
294Debug.Assert(false, "Method ShouldSerializeProperty is called on an internally generated GridViewColumnHeader."); 431Debug.Assert(flag != Flags.None && ignoreFlag != Flags.None, "Invalid parameter dp."); 772Debug.Assert(stream != null, "stream is null"); 796Debug.Assert(gripperCursor != null, "gripper cursor is null");
System\Windows\Controls\GridViewHeaderRowPresenter.cs (16)
304Debug.Assert(_paddingHeader != null, "padding header is null"); 314Debug.Assert(_indicator != null, "_indicator is null"); 315Debug.Assert(_floatingHeader != null, "_floatingHeader is null"); 388Debug.Assert(_paddingHeader != null, "padding header is null"); 457Debug.Assert(_draggingSrcHeader != null, "_draggingSrcHeader is null"); 640Debug.Assert(column != null); 858Debug.Assert(index >= 0 && index < InternalChildren.Count, "Error index when GetVisualIndex"); 941Debug.Assert(false, "Head is container for itself, but parent is neither GridViewHeaderRowPresenter nor null."); 991Debug.Assert(header != null || index != -1); 1074Debug.Assert(header != null); 1083Debug.Assert(header != null); 1192Debug.Assert(header != null, "Cannot instantiate GridViewColumnHeader in AddFloatingHeader"); 1205Debug.Assert(srcHeader != null, "srcHeader is null"); 1206Debug.Assert(_floatingHeader != null, "floating header is null"); 1372Debug.Assert(index >= 0 && index < HeadersPositionList.Count, "wrong index"); 1565Debug.Assert(Columns != null, "Columns is null in OnHeaderDragCompleted");
System\Windows\Controls\GridViewRowPresenter.cs (3)
287Debug.Assert(column != null); 579Debug.Assert(column != null, "column shouldn't be null"); 656Debug.Assert(cell is TextBlock, "cells are either TextBlocks or ContentPresenters");
System\Windows\Controls\InkCanvas.cs (18)
578Debug.Assert(e.Property == InkCanvas.RightProperty || e.Property == InkCanvas.BottomProperty, 1042Debug.Assert(e != null, "EventArg can not be null"); 1261Debug.Assert(e != null, "EventArg can not be null"); 1318Debug.Assert(e != null, "EventArg can not be null"); 1372Debug.Assert(e != null, "EventArg can not be null"); 1406Debug.Assert(e != null, "EventArg can not be null"); 1437Debug.Assert(e != null, "EventArg can not be null"); 1473Debug.Assert(e != null, "EventArg can not be null"); 1549Debug.Assert(e != null, "EventArg can not be null"); 1579Debug.Assert(e != null, "EventArg can not be null"); 1613Debug.Assert(e != null, "EventArg can not be null"); 1643Debug.Assert(e != null, "EventArg can not be null"); 2265System.Diagnostics.Debug.Assert(_dynamicallySelectedStrokes.Contains(s)); 2336Debug.Assert(strokes != null 2563System.Diagnostics.Debug.Assert(object.ReferenceEquals(sender, DefaultDrawingAttributes)); 2663Debug.Assert(removeSelectedStrokes || removeSelectedElements, "At least either Strokes or Elements should be removed!"); 2702Debug.Assert(inkCanvas != null); 2775Debug.Assert(inkCanvas != null);
System\Windows\Controls\InkPresenter.cs (5)
460Debug.Assert(newStrokes != null, "Cannot set a null to InkPresenter"); 483System.Diagnostics.Debug.Assert(sender == this.Strokes); 491Debug.Assert(addedStrokes != null, "The added StrokeCollection cannot be null."); 533System.Diagnostics.Debug.Assert(stroke != null); 542System.Diagnostics.Debug.Assert(stroke != null);
System\Windows\Controls\ItemCollection.cs (17)
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); 2305Debug.Assert(IsShapingActive, "Shaping storage not available"); 2342Debug.Assert(!value, "Shaping storage not available"); 2374Debug.Assert(IsShapingActive, "Shaping storage not available"); 2407Debug.Assert(IsShapingActive, "Shaping storage not available"); 2440Debug.Assert(IsShapingActive, "Shaping storage not available");
System\Windows\Controls\ItemContainerGenerator.cs (9)
286Debug.Assert(false, "Unexpected reentrant call to ICG.Remove"); 332Debug.Assert(!_recyclableContainers.Contains(container), "trying to add a container to the collection twice"); 937Debug.Assert(item == null || ItemsControl.EqualsEx(item, target), 2217Debug.Assert(ItemsControl.EqualsEx(rib.ItemAt(rib.ContainerCount - 1), 2283Debug.Assert(!container.HasExpression(entryIndex, dp), "DataContext set by expression (unexpectedly)"); 2348Debug.Assert(!container.HasExpression(entryIndex, dp), "DataContext set by expression (unexpectedly)"); 2381Debug.Assert(ItemsControl.EqualsEx(item, ItemsInternal[index]), "Event contains the wrong index"); 2456Debug.Assert(false, "unexpected reentrant call to OnItemAdded"); 2644Debug.Assert(false, "unexpected reentrant call to OnItemMoved");
System\Windows\Controls\ItemsControl.cs (4)
2630Debug.Assert(ScrollHost != null, "This operation to adjust the offset along an edge is only possible when there is a ScrollHost available"); 2791Debug.Assert(direction == FocusNavigationDirection.Up || direction == FocusNavigationDirection.Down, "Can only get the first item on a page using North or South"); 3105Debug.Assert(element != viewPort && element.IsArrangeValid && parent != null, "GetElementViewportPosition called in unsupported situation"); 3171Debug.Assert(direction == FocusNavigationDirection.Up ||
System\Windows\Controls\ListBox.cs (1)
623Debug.Assert(_autoScrollTimer == null, "IsMouseCaptured went from true to true");
System\Windows\Controls\MenuItem.cs (6)
1755Debug.Assert(IsSelected, "When IsSubmenuOpen = true, IsSelected should be true as well"); 1937Debug.Assert(IsHighlighted, "MenuItem got Key.Enter but was not highlighted -- focus did not follow highlight?"); 2200Debug.Assert(Role == MenuItemRole.TopLevelHeader || Role == MenuItemRole.TopLevelItem, "MenuItem was not top-level"); 2240Debug.Assert(!parentMenu.OpenOnMouseEnter || parentMenu.IsMenuMode, "OpenOnMouseEnter can only be true when IsMenuMode is true"); 2589Debug.Assert(timer != null, "timer should not be null."); 2590Debug.Assert(!timer.IsEnabled, "timer should not be running.");
System\Windows\Controls\MultipleCopiesCollection.cs (9)
32Debug.Assert(item != null, "item should not be null."); 33Debug.Assert(count >= 0, "count should not be negative."); 53Debug.Assert( 60Debug.Assert( 67Debug.Assert( 74Debug.Assert( 119Debug.Assert(RepeatCount == newCount, "We should have properly updated the RepeatCount"); 202Debug.Assert((index >= 0) && (index < RepeatCount), "Index out of range"); 288Debug.Assert(_item != null, "_item should be non-null.");
System\Windows\Controls\Page.cs (2)
749Debug.Assert( p != null, "DependencyObject must be of type Page." ); 794Debug.Assert(_currentIws != null, "_currentIws cannot be null here. Caller should always verify it");
System\Windows\Controls\Panel.cs (9)
576Debug.Assert(_itemContainerGenerator == null, "Attempted to connect to a generator when Panel._itemContainerGenerator is non-null."); 599Debug.Assert(_itemContainerGenerator != null, "Attempted to disconnect from a generator when Panel._itemContainerGenerator is null."); 620Debug.Assert(IsItemsHost, "Should be invoked only on an ItemsHost panel"); 680Debug.Assert(_itemContainerGenerator != null, "Encountered a null _itemContainerGenerator while receiving an ItemsChanged from a generator."); 719Debug.Assert(_itemContainerGenerator != null, "Encountered a null _itemContainerGenerator while receiving an Add action from a generator."); 748Debug.Assert(itemCount == containerCount, "Panel expects Replace to affect only realized containers"); 749Debug.Assert(_itemContainerGenerator != null, "Encountered a null _itemContainerGenerator while receiving an Replace action from a generator."); 759Debug.Assert(e != null && !isNewlyRealized, "Panel expects Replace to affect only realized containers"); 778Debug.Assert(_itemContainerGenerator != null, "Encountered a null _itemContainerGenerator while receiving an Move action from a generator.");
System\Windows\Controls\PasswordTextContainer.cs (4)
905Debug.WriteLine($"{_positionList.Count} entries."); 913Debug.Write($"({position.DebugId}) {position.Offset}/{((position.LogicalDirection == LogicalDirection.Forward) ? "f " : "b ")}"); 917Debug.Write("-/- "); 921Debug.WriteLine("");
System\Windows\Controls\PasswordTextNavigator.cs (9)
32Debug.Assert(offset >= 0 && offset <= container.SymbolCount, "Bad PasswordTextPointer offset!"); 56Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 301Debug.Assert(false); 427Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 468Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 474Debug.Assert(false, "Bad distance!"); 494Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 512Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 513Debug.Assert(false, "No scoping element!");
System\Windows\Controls\PopupControlService.cs (3)
425Debug.Assert(_currentToolTip == null); 1613Debug.Assert(hwndSource != null && rootElement != null, "expect non-null hwndSource and rootElement"); 1615Debug.Assert(((int)pt.X == (int)Math.Round(pt2.X)) && ((int)pt.Y == (int)Math.Round(pt2.Y)), "got incorrect mouse point");
System\Windows\Controls\Primitives\BulletDecorator.cs (2)
155Debug.Assert(child1 != null, "First child should be non-null."); 156Debug.Assert(child2 != null, "Second child should be non-null.");
System\Windows\Controls\Primitives\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\DataGridCellsPresenter.cs (1)
354Debug.Assert(
System\Windows\Controls\Primitives\DataGridColumnHeader.cs (6)
108Debug.Assert(column != null, "This header must have been generated with for a particular column"); 109Debug.Assert(column.Header == item, "The data item for a ColumnHeader is the Header property of a column"); 328Debug.Assert(header != null, "Header should not be null"); 471Debug.Assert(Column != null, "column can't be null if we got a notification for this property change"); 481Debug.Assert(Column != null, "column can't be null if we got a notification for this property change"); 567Debug.Assert(Column != null, "column can't be null if we got a notification for this property change");
System\Windows\Controls\Primitives\DataGridColumnHeadersPresenter.cs (11)
232Debug.Assert(column != null, "We shouldn't have generated this column header if we don't have a column."); 268Debug.Assert(HeaderCollection != null, "This is a helper method for preparing and clearing a container; if it's called we must have a valid ItemSource"); 710Debug.Assert(ParentDataGrid != null, "ParentDataGrid is null"); 757Debug.Assert(_draggingSrcColumnHeader != null, "Dragging header is null"); 769Debug.Assert(_columnHeaderDragIndicator != null, "Drag indicator is null"); 770Debug.Assert(_draggingSrcColumnHeader != null, "Dragging header is null"); 788Debug.Assert(_draggingSrcColumnHeader != null, "Dragging header is null"); 800Debug.Assert(_columnHeaderDropLocationIndicator != null, "Drag indicator is null"); 801Debug.Assert(_draggingSrcColumnHeader != null, "Dragging header is null"); 818Debug.Assert(ParentDataGrid != null, "ParentDataGrid is null"); 934Debug.Assert(ParentDataGrid != null, "ParentDataGrid is null");
System\Windows\Controls\Primitives\DataGridRowHeader.cs (1)
494Debug.Assert(stateCode != DATAGRIDROWHEADER_stateNullCode);
System\Windows\Controls\Primitives\DatePickerTextBox.cs (3)
155Debug.Assert( 168Debug.Assert(e.NewValue is bool); 195Debug.Assert(datePickerTextBox != null, "The source is not an instance of a DatePickerTextBox!");
System\Windows\Controls\Primitives\MenuBase.cs (5)
244Debug.Assert(menu.HasPushedMenuMode); 808Debug.Assert(CheckAccess(), "IsMenuMode requires context access"); 898Debug.Assert(_pushedMenuMode == null); 900Debug.Assert(_pushedMenuMode != null); 909Debug.Assert(_pushedMenuMode != null);
System\Windows\Controls\Primitives\Popup.cs (12)
188Debug.Assert(popup != null, "Popup must be non-null"); 189Debug.Assert(placementTarget != null, "Placement target must be non-null."); 219Debug.Assert(popup != null, "Popup must be non-null"); 220Debug.Assert(placementTarget != null, "Placement target must be non-null."); 896Debug.Assert(!bindTreatMousePlacementAsBottomProperty || child is ToolTip, "child must be a Tooltip to bind TreatMousePlacementAsBottomProperty"); 1102Debug.Assert( Mouse.Captured == _popupRoot.Value, "_cacheValid[(int)CacheBits.CaptureEngaged] == true but Mouse.Captured != _popupRoot"); 1395Debug.Assert(popup != null, "popup should be non-null."); 1396Debug.Assert(child != null, "child should be non-null."); 1419Debug.Assert(child != null, "child should be non-null"); 1933Debug.Assert(CheckAccess(), "AsyncReposition not called on the dispatcher thread."); 2498Debug.Assert(i >= 0 && i < GetNumberOfCombinations(placement)); 3308Debug.Assert(!IsChildPopup || (IsChildPopup && !transparent), "Child popups cannot be transparent");
System\Windows\Controls\Primitives\ResizeGrip.cs (1)
72Debug.Assert(rg != null, "DependencyObject must be of type ResizeGrip.");
System\Windows\Controls\Primitives\ScrollContentPresenter.cs (2)
806Debug.Assert(IsScrollClient); 841Debug.Assert(IsScrollClient);
System\Windows\Controls\Primitives\Selector.cs (22)
593Debug.Assert(String.IsNullOrEmpty(path) || path == "/InnerText"); 1047Debug.Assert(CanSelectMultiple, "CanSelectMultiple should be true when calling SelectAllImpl"); 1435Debug.Assert(!SelectionChange.IsActive, "SelectionChange is already active -- use SelectionChange.Select or Unselect"); 1509Debug.Assert(!((SelectedIndex >= 0) && (_selectedItems.Count == 0)), "SelectedIndex >= 0 implies _selectedItems nonempty"); 1536Debug.Assert(IsSynchronizedWithCurrentItemPrivate); 1564Debug.Assert(IsSynchronizedWithCurrentItemPrivate); 1607Debug.Assert(SelectionChange.IsActive, "SelectionChange.IsActive should be true"); 1689Debug.Assert(SelectionChange.IsActive, "SelectionChange.IsActive should be true"); 2051Debug.Assert(SelectionChange.IsActive, "SelectionChange.IsActive should be true"); 2183Debug.Assert(String.IsNullOrEmpty(path) || path == "/InnerText"); 2282Debug.Assert(_owner.CheckAccess()); 2283Debug.Assert(!_active, SR.SelectionChangeActive); 2295Debug.Assert(_owner.CheckAccess()); 2296Debug.Assert(_active, "There must be a selection change active when you call SelectionChange.End()"); 2330Debug.Assert(_toSelect.Count <= 1, "_toSelect.Count was > 1"); 2505Debug.Assert(_owner.CheckAccess()); 2506Debug.Assert(_active, SR.SelectionChangeNotActive); 2507Debug.Assert(info != null, "parameter info should not be null"); 2562Debug.Assert(_owner.CheckAccess()); 2563Debug.Assert(_active, SR.SelectionChangeNotActive); 2564Debug.Assert(info != null, "info should not be null"); 2600Debug.Assert(_owner.CheckAccess());
System\Windows\Controls\Primitives\Thumb.cs (1)
258Debug.Assert(false,"Got MouseLeftButtonDown event while dragging!");
System\Windows\Controls\Primitives\ToolBarOverflowPanel.cs (1)
104Debug.Assert(childrenIndex == childrenCount, "ToolBarOverflowPanel.Children count mismatch after transferring children from GeneratedItemsCollection.");
System\Windows\Controls\Primitives\ToolBarPanel.cs (4)
151Debug.Assert(children[childrenIndex] == child, "InternalChildren is out of sync with _generatedItemsCollection."); 198Debug.Assert(children[childrenIndex] == child, "InternalChildren is out of sync with _generatedItemsCollection."); 467Debug.Assert(itemCount == containerCount, "ToolBarPanel expects Replace to affect only realized containers"); 477Debug.Assert(e != null && !isNewlyRealized, "ToolBarPanel expects Replace to affect only realized containers");
System\Windows\Controls\Primitives\Track.cs (6)
400Debug.Assert(_visualChildren == null || _visualChildren[1] == null, "Child[1] should be null if Child[0] == null)"); 401Debug.Assert(_visualChildren == null || _visualChildren[2] == null, "Child[2] should be null if Child[0] == null)"); 406Debug.Assert(_visualChildren[2] == null, "Child[2] should be null if Child[1] == null)"); 608Debug.Assert(decreaseButtonLength >= 0.0 && decreaseButtonLength <= remainingTrackLength, "decreaseButtonLength is outside bounds"); 609Debug.Assert(increaseButtonLength >= 0.0 && increaseButtonLength <= remainingTrackLength, "increaseButtonLength is outside bounds"); 623Debug.Assert(DoubleUtil.GreaterThanOrClose(offset, 0.0), "Invalid offest (negative value).");
System\Windows\Controls\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 (4)
1326Debug.Assert(!MeasureDirty); 1735Debug.Assert(_panningInfo != null); 1869Debug.Assert(_panningInfo != null); 2398Debug.Assert(DoubleUtil.GreaterThanOrClose(_xSize, 0.0) && DoubleUtil.GreaterThanOrClose(_ySize, 0.0), "Negative size for scrolling viewport. Bad IScrollInfo implementation.");
System\Windows\Controls\SelectedCellsChangedEventArgs.cs (2)
51Debug.Assert(_addedCells.IsReadOnly, "_addedCells should have ended up as read-only."); 52Debug.Assert(_removedCells.IsReadOnly, "_removedCells should have ended up as read-only.");
System\Windows\Controls\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 (27)
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); 1967Debug.Assert(_complexContent != null, "Inline objects are supported only in complex content."); 1997Debug.Assert(((InlineObject)inlineObjects[index]).Element == inlineObject.Element, "InlineObject cache is out of sync."); 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); 2966Debug.Assert(sender == _complexContent.TextContainer, "Received text change for foreign TextContainer."); 3416Debug.Assert(IsLayoutDataValid); 3417Debug.Assert(CheckFlags(Flags.RequiresAlignment)); 3435Debug.Assert(lineCount == LineCount); 3446Debug.Assert(DoubleUtil.AreClose(lineHeight, lineMetrics.Height), "Line height is out of sync."); 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 (5)
306Debug.Assert(String.IsNullOrEmpty(matchedText) == false, "matchedText cannot be null or empty"); 307Debug.Assert(String.IsNullOrEmpty(newText) == false, "newText cannot be null or empty"); 308Debug.Assert(matchedText.StartsWith(newText, ignoreCase, cultureInfo), "matchedText should start with newText"); 783Debug.Assert(_attachedTo != null); 798Debug.Assert(_attachedTo != null);
System\Windows\Controls\ToolTip.cs (1)
514Debug.Assert(_parentPopup == null, "_parentPopup should be null");
System\Windows\Controls\VirtualizedCellInfoCollection.cs (30)
28Debug.Assert(owner != null, "owner must not be null."); 41Debug.Assert(owner != null, "owner must not be null."); 91Debug.Assert(IsValidCell(cell), "The cell should be valid."); 92Debug.Assert(!Contains(cell), "VirtualizedCellInfoCollection does not support duplicate items."); 475Debug.Assert(left >= 0, "left must be positive."); 476Debug.Assert(top >= 0, "top must be positive."); 477Debug.Assert(width >= 0, "width must be positive."); 478Debug.Assert(height >= 0, "height must be positive."); 495Debug.Assert(value >= 0, "Value must be positive."); 509Debug.Assert(value >= 0, "Value must be positive."); 523Debug.Assert(value >= _left, "Right must be greater than or equal to Left."); 537Debug.Assert(value >= _top, "Bottom must be greater than or equal to Top."); 551Debug.Assert(value >= 0, "Value must be positive."); 565Debug.Assert(value >= 0, "Value must be positive."); 791Debug.Assert(!IsEmpty, "Don't call GetBoundingRegion when IsEmpty is true."); 823Debug.Assert(left <= right, "left should be less than or equal to right."); 824Debug.Assert(top <= bottom, "top should be less than or equal to bottom."); 834Debug.Assert(rowCount > 0, "rowCount should be greater than 0."); 835Debug.Assert(columnCount > 0, "columnCount should be greater than 0."); 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); 1638Debug.Assert(list != null, "list should not be null.");
System\Windows\Controls\VirtualizingStackPanel.cs (78)
407Debug.Assert(!IsPixelBased && IsScrolling && 484Debug.Assert(IsScrolling, "setting offset on non-scrolling panel"); 612Debug.Assert(IsScrolling, "setting offset on non-scrolling panel"); 803Debug.Assert(AnchorOperationField.GetValue(this) == null, "There is already a pending AnchorOperation."); 835Debug.Assert(_scrollData._firstContainerInViewport != null, "Must have an anchor element"); 861Debug.Assert(AnchorOperationField.GetValue(this) != null, "anchor state is inconsistent"); 892Debug.Assert(currFirstContainerInViewport != null, "Cannot find container in viewport"); 1147Debug.Assert(!IsPixelBased || !findTopContainer, "find 'top' container only makes sense when item-scrolling"); 1714Debug.Assert(IsVirtualizing && InRecyclingMode, "We should only modify the visual order when in recycling mode"); 2405Debug.Assert(!adjustToChangeInFirstItem || foundFirstItemInViewport, "This loop should only happen twice at most"); 3715Debug.Assert(args.Action == NotifyCollectionChangedAction.Reset && args.ItemCount == 1); 3869Debug.Assert(info != null, "Expected state from previous measure not found"); 3977Debug.Assert(IsScrolling && IsVirtualizing, "Only check viewport on scrolling panel when virtualizing"); 4378Debug.Assert(retryCount >=0, "retry MeasureCaches too often"); 4538Debug.Assert(effectiveOffsetInfo.ScrollGeneration <= scrollGeneration, 4737Debug.Assert(cacheUnit != VirtualizationCacheLengthUnit.Page, "Page cacheUnit is not expected here."); 4993Debug.Assert(IsScrolling, "The scrolling panel is the only one that should extend the viewport"); 5051Debug.Assert(virtualizationInfoProvider != null, "This method should only be invoked for a virtualizing owner"); 5052Debug.Assert(cacheUnit != VirtualizationCacheLengthUnit.Page, "Page after cache size is not expected here."); 5680Debug.Assert(itemIndex < items.Count, "index out of range"); 5780Debug.Assert(IsVirtualizing, "We should only need to extend the viewport beyond the generated items when virtualizing"); 6114Debug.Assert(!containerSize.IsEmpty, "We can't estimate an empty size"); 6130Debug.Assert(!IsVSP45Compat, "this method should not be called in VSP45Compat mode"); 6198Debug.Assert(!containerSize.IsEmpty, "We can't estimate an empty size"); 6410Debug.Assert(parentItemStorageProvider != null || container != null, 6453Debug.Assert(!IsVSP45Compat, "SetItemsHostInset should not be called in VSP45-compat mode"); 6489Debug.Assert(false, "SetInset should only be called for a container"); 6593Debug.Fail($"Unexpected container type: {((container == null) ? "null" : container.GetType().Name)}"); 6634Debug.Assert(cacheUnit != VirtualizationCacheLengthUnit.Page, "Page cacheUnit is not expected here."); 6842Debug.Assert(virtualizingChild != null, "This method should only be invoked for a virtualizing child"); 7280Debug.Assert(DoubleUtil.AreClose(pixelSizeInViewport + pixelSizeBeforeViewport + pixelSizeAfterViewport, childPixelSize.Width), "The computed sizes within and outside the viewport should add up to the childPixelSize."); 7372Debug.Assert(DoubleUtil.AreClose(pixelSizeInViewport + pixelSizeBeforeViewport + pixelSizeAfterViewport, childPixelSize.Height), "The computed sizes within and outside the viewport should add up to the childPixelSize."); 7467Debug.Assert(IsVSP45Compat, "this method should only be called in VSP45Compat mode"); 7473Debug.Assert(evaluateAreContainersUniformlySized || !computedAreContainersUniformlySized, "AreContainersUniformlySized starts off true and can only be flipped to false."); 7619Debug.Assert(!IsVSP45Compat, "this method should not be called in VSP45Compat mode"); 7625Debug.Assert(evaluateAreContainersUniformlySized || !computedAreContainersUniformlySized, "AreContainersUniformlySized starts off true and can only be flipped to false."); 7908Debug.Assert(itemStorageProvider != null || item == this, "An item storage provider must be available."); 7909Debug.Assert(item != null, "An item must be available."); 7933Debug.Assert(itemStorageProvider != null || item == this, "An item storage provider must be available."); 7934Debug.Assert(item != null, "An item must be available."); 7977Debug.Assert(itemStorageProvider != null || item == this, "An item storage provider must be available."); 7978Debug.Assert(item != null, "An item must be available."); 8035Debug.Assert(itemStorageProvider != null || item == this, "An item storage provider must be available."); 8036Debug.Assert(item != null, "An item must be available."); 8758Debug.Assert(container != null, "Null container was generated"); 8803Debug.Assert(children[visualTreeIndex] != null, "MoveVisualChild interprets a null destination as 'move to end'"); 8928Debug.Assert(!children.Contains(child), "we incorrectly identified a recycled container"); 8949Debug.Assert(child == InternalChildren[childIndex], "Wrong child was generated"); 8971Debug.Assert(args.ItemUICount == args.ItemCount, "Both ItemUICount and ItemCount should be equal or ItemUICount should be 0."); 8981Debug.Assert(child != null, "Null child was generated"); 8982Debug.Assert(!newlyRealized, "newlyRealized should be false after Replace"); 9011Debug.Assert((itemCount == itemUICount) || (itemUICount == 0), "Both ItemUICount and ItemCount should be equal or ItemUICount should be 0."); 9052Debug.Assert(IsVirtualizing, "Can't clean up containers if not virtualizing"); 9053Debug.Assert(itemsControl != null, "We can't cleanup if we aren't the itemshost"); 9198Debug.Assert(InRecyclingMode, "This method only applies to recycling mode"); 9217Debug.Assert(IsVirtualizing && InRecyclingMode, "Realized children only exist when recycling"); 9218Debug.Assert(_realizedChildren != null, "Realized children must exist to verify it"); 9231Debug.Assert(!_realizedChildren.Contains(child), "_realizedChildren should not contain recycled containers"); 9237Debug.Assert(_realizedChildren[position.Index] == child, "_realizedChildren is corrupt!"); 9249Debug.Assert(_realizedChildren.Count == children.Count, "Realized and visual children must match"); 9253Debug.Assert(_realizedChildren[i] == children[i], "Realized and visual children must match"); 9283Debug.Assert(false, "We should have found a child"); 9354Debug.Assert(_cleanupDelay != null); 9375Debug.Assert(_cleanupOperation != null); 9399Debug.Assert(!InRecyclingMode, "This method only applies to standard virtualization"); 9464Debug.Assert(startIndex >= 0 && count > 0); 9465Debug.Assert(children == _realizedChildren, "the given child list must be the _realizedChildren list when recycling"); 9611Debug.Assert(IsScrolling, "ScrollData must only be set on a scrolling panel."); 9738Debug.Assert(DoubleUtil.AreClose(viewportSize.Width - Math.Floor(viewportSize.Width), 0.0), "The viewport size must not contain fractional values when in item scrolling mode."); 9739Debug.Assert(DoubleUtil.AreClose(extentSize.Width - Math.Floor(extentSize.Width), 0.0), "The extent size must not contain fractional values when in item scrolling mode."); 9743Debug.Assert(DoubleUtil.AreClose(viewportSize.Height - Math.Floor(viewportSize.Height), 0.0), "The viewport size must not contain fractional values when in item scrolling mode."); 9744Debug.Assert(DoubleUtil.AreClose(extentSize.Height - Math.Floor(extentSize.Height), 0.0), "The extent size must not contain fractional values when in item scrolling mode."); 10465Debug.Assert(IsScrolling, "ScrollData must only be set on a scrolling panel."); 10590Debug.Assert(DoubleUtil.AreClose(viewportSize.Width - Math.Floor(viewportSize.Width), 0.0), "The viewport size must not contain fractional values when in item scrolling mode."); 10591Debug.Assert(DoubleUtil.AreClose(extentSize.Width - Math.Floor(extentSize.Width), 0.0), "The extent size must not contain fractional values when in item scrolling mode."); 10595Debug.Assert(DoubleUtil.AreClose(viewportSize.Height - Math.Floor(viewportSize.Height), 0.0), "The viewport size must not contain fractional values when in item scrolling mode."); 10596Debug.Assert(DoubleUtil.AreClose(extentSize.Height - Math.Floor(extentSize.Height), 0.0), "The extent size must not contain fractional values when in item scrolling mode."); 12239Debug.Assert(tracer != null, "Trace called when not tracing");
System\Windows\Controls\WebBrowser.cs (2)
546Debug.Assert(clsid.ToString("D") == CLSID.WebBrowser); 584Debug.Assert(_axIWebBrowser2 != null);
System\Windows\Data\BindingBase.cs (1)
72Debug.Assert((int)Feature.LastFeatureId <= 32, "UncommonValueTable supports only 32 Ids");
System\Windows\Data\BindingExpression.cs (1)
2166Debug.Assert(NeedsValidation, "check NeedsValidation before calling this");
System\Windows\Data\BindingExpressionBase.cs (3)
126Debug.Assert((int)Feature.LastFeatureId <= 32, "UncommonValueTable supports only 32 Ids"); 1699Debug.Assert(RootBindingExpression == this, "Only call this with a root binding"); 2531Debug.Assert((_flags & PrivateFlags.iPropagationMask) != PrivateFlags.iPropDefault,
System\Windows\Data\BindingGroup.cs (3)
1349Debug.Assert(_bindingExpressions.Count == 0, "Unexpected Reset event"); 1353Debug.Assert(false, "Unexpected change event"); 1794Debug.Assert(bindingExpression != null, "do not ask for source value from a [Multi,Priority]Binding");
System\Windows\Data\BindingListCollectionView.cs (5)
588Debug.Assert(_newItemIndex != -2 && newItem == _newItem, "AddNew did not raise expected events"); 621Debug.Assert(_newItemIndex == -2 && _newItem == NoNewItem, "unexpected call to BeginAddNew"); 739Debug.Assert(true); 1928Debug.Assert(_newItem == InternalList[index], "unexpected item while committing AddNew"); 1987Debug.Assert(item == InternalList[index], "unexpected item while committing AddNew");
System\Windows\Data\CollectionView.cs (1)
1826Debug.Assert(changeLog != null && changeLog.Count > 0, "don't defer when there's no work");
System\Windows\Data\ListCollectionView.cs (6)
775Debug.Assert(_newItemIndex != -2 && System.Windows.Controls.ItemsControl.EqualsEx(newItem, _newItem), "AddNew did not raise expected events"); 800Debug.Assert(_newItemIndex == -2 && _newItem == NoNewItem, "unexpected call to BeginAddNew"); 1710Debug.Assert(false, "Cannot update collection view from outside UIContext without index in event args"); 2459Debug.Assert(view != null, "lazyGetCollectionView should not return null"); 3141Debug.Assert(list.VerifyLiveSorting(lsi), "live sorting failed"); 3151Debug.Assert(list.VerifyLiveSorting(null), "live sorting not resotred");
System\Windows\Data\MultiBinding.cs (2)
115Debug.Assert(false, "Unexpected BindingMode value"); 138Debug.Assert(false, "Unexpected UpdateSourceTrigger value");
System\Windows\Data\MultiBindingExpression.cs (2)
188Debug.Assert(ParentMultiBinding.Converter != null || !String.IsNullOrEmpty(EffectiveStringFormat), 880Debug.Assert(NeedsValidation, "check NeedsValidation before calling this");
System\Windows\Data\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\PriorityBindingExpression.cs (2)
200Debug.Assert(MutableBindingExpressions.Count == 0, "expect to encounter empty BindingExpression collection when attaching MultiBinding"); 458Debug.Assert(NeedsValidation, "check NeedsValidation before calling this");
System\Windows\Data\RelativeSource.cs (3)
172Debug.Assert(_mode == RelativeSourceMode.FindAncestor); 210Debug.Assert((!IsUninitialized) || (_mode == RelativeSourceMode.FindAncestor)); 274Debug.Assert(IsUninitialized);
System\Windows\Data\XmlDataProvider.cs (2)
286Debug.Assert(_domSetDocument == null, "Should not be possible to be using Source and user-set Doc at the same time."); 772Debug.Assert(doc != null);
System\Windows\DataTrigger.cs (1)
190Debug.Assert( TriggerConditions != null && TriggerConditions.Length == 1,
System\Windows\DescendentsWalker.cs (1)
99Debug.Assert( false, "Tree walk priority should be Visual first or Logical first - but this instance of DescendentsWalker has an invalid priority setting that's neither of the two." );
System\Windows\Diagnostics\ResourceDictionaryDiagnostics.cs (5)
382Debug.Assert(result.Dictionary == null || result.Dictionary == rd, 423Debug.Assert(Object.Equals(result.Requester, requester), "Reverting a request for the wrong requester"); 432Debug.Assert(result.Dictionary != null, "simple lookup resolved incorrectly"); 459Debug.Assert(cachedDict == result.Dictionary, "conflicting dictionaries for a StaticResource reference"); 467Debug.Assert(cachedDict != null, "no dictionary found for StaticResource reference");
System\Windows\Documents\AdornerLayer.cs (5)
424Debug.Assert(adornerInfos != null, "No adorners found for element in AdornerLayer._zOrderMap"); 459Debug.Assert(adornerInfos != null, "No adorners found for element in AdornerLayer._zOrderMap"); 535Debug.Assert(adornerInfo != null, "Adorner should not be null"); 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 (2)
41Debug.Assert(scope != null); 141Debug.Assert(_adornerLayer == null, "Attempt to overwrite existing AdornerLayer!");
System\Windows\Documents\CompositionAdorner.cs (4)
59Debug.Assert(textView != null && textView.RenderScope != null); 364Debug.Assert(_adornerLayer == null, "Attempt to overwrite existing AdornerLayer!"); 589Debug.Assert(start.CompareTo(startLinePointer) <= 0, "The start pointer is positioned after the composition start line pointer!"); 612Debug.Assert(endLinePointer.CompareTo(textSegment.End) == 0, "The end line pointer is positioned after the composition text range end pointer!");
System\Windows\Documents\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 (2)
55Debug.Assert(false, "This method is not implemented and not expected to be called."); 78Debug.Assert(ranges.Count > 0);
System\Windows\Documents\DocumentSequenceTextContainer.cs (13)
45Debug.Assert(parent != null); 46Debug.Assert(parent is FixedDocumentSequence); 233Debug.Assert(_start != null); 246Debug.Assert(_end != null); 398Debug.Assert(docRef != null); 452Debug.Assert(false, "should never be here"); 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 (12)
38Debug.Assert(childBlock != null); 39Debug.Assert(childPosition != null); 57Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 453Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 482Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 502Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 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); 1092Debug.Assert(false, "invalid TextPointerContext");
System\Windows\Documents\FixedDocument.cs (11)
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); 1112Debug.Assert(!highlightTransitionPosition.IsNull, "Highlight start not followed by highlight end!"); 1128Debug.Assert(!highlightTransitionPosition.IsNull, "Highlight start not followed by highlight end!"); 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 (5)
612Debug.Assert(dpo != null, "GetLinkUri shouldn't be called for non-DependencyObjects."); 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 (12)
59Debug.Assert(stroke || fill, "should not be a nop"); 198Debug.Assert(false, "It should not be called"); 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\FixedTextPointer.cs (5)
385Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 388Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 418Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 429Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 680Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!");
System\Windows\Documents\FixedTextView.cs (12)
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); 1209Debug.Assert(!textPointer.IsFrozen, "Can't reposition a frozen pointer!");
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 (3)
304Debug.Assert(oldSource == null || newSource == null, 312Debug.Assert((oldSource == null) || (oldSource == _source)); 332Debug.Assert(newSource == _source);
System\Windows\Documents\NullTextContainer.cs (3)
183Debug.Assert(_start != null); 196Debug.Assert(_end != null); 256Debug.Assert(false, "Unexpected call to NullTextContainer.set_TextView!");
System\Windows\Documents\NullTextNavigator.cs (14)
50Debug.Assert(position is NullTextPointer || position is NullTextPointer); 66Debug.Assert(position is NullTextPointer || position is NullTextPointer); 199Debug.Assert(distance == 0); 228Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 238Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 250Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 252Debug.Assert(distance == 0, "Single possible position in this empty container"); 262Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 272Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 274Debug.Assert(false, "No scoping element!"); 282Debug.Assert(false, "NullTextPointer does not expect layout dependent method calls!"); 291Debug.Assert(false, "NullTextPointer does not expect layout dependent method calls!"); 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\SpellerStatusTable.cs (1)
739Debug.WriteLine($"{i}: {run.Position.TextContainer.Start.GetOffsetToPosition(run.Position)} {runType}");
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\TextServicesHost.cs (7)
70Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "OnRegisterTextStore must be called on STA thread"); 270Debug.Assert(_registeredtextstorecount > 0, "Overrelease TextStore!"); 288Debug.Assert(CheckAccess(), "OnDispatcherShutdownFinished called on bad thread!"); 289Debug.Assert(_isDispatcherShutdownFinished == false, "Was this dispather finished???"); 317Debug.Assert(CheckAccess(), "RegisterTextStore called on bad thread!"); 322Debug.Assert(_isDispatcherShutdownFinished == false, "Was this dispather finished?"); 323Debug.Assert(_registeredtextstorecount == 0, "TextStore was registered without ThreadMgr?");
System\Windows\Documents\TextStore.cs (1)
4836Debug.Assert(tracer != null, "Trace called when not tracing");
System\Windows\Documents\TextTreeDumper.cs (21)
53Debug.WriteLine($"<{tree}/>"); 66Debug.WriteLine($"<{tree}/>"); 83Debug.Write($"<{GetFlatPrefix(node)}{node.DebugId}"); 87Debug.Write(">"); 89Debug.WriteLine($"</{GetFlatPrefix(node)}{node.DebugId}>"); 93Debug.WriteLine("/>"); 100Debug.WriteLine($"Offset: {position.GetSymbolOffset()} {position}"); 121Debug.Write("<"); 122Debug.Write(node); 126Debug.WriteLine("/>"); 130Debug.WriteLine(">"); 136Debug.Write($"{indent}C "); 142Debug.Write($"{indent}L "); 148Debug.Write($"{indent}R "); 156Debug.WriteLine($"{indent}</RootNode>"); 160Debug.WriteLine($"{indent}</TextElementNode>"); 164Debug.WriteLine($"{indent}</UnknownNode>"); 174Debug.Write($"<{GetFlatPrefix(node)}{node.DebugId}"); 178Debug.Write(">"); 180Debug.Write($"</{GetFlatPrefix(node)}{node.DebugId}>"); 184Debug.Write("/>");
System\Windows\Documents\XamlToRtfWriter.cs (3)
232Debug.Assert(openLists.Count > 0); 406Debug.Assert(openLists.Count > 0); 437Debug.Assert(openLists.Count > 0);
System\Windows\DwmColorization.cs (6)
90System.Diagnostics.Debug.WriteLine("INFO | SystemAccentColor: " + systemAccent, "System.Windows.Accent"); 93.Debug 97.Debug 101.Debug 108System.Diagnostics.Debug.WriteLine("INFO | Text on accent is DARK", "System.Windows.Accent"); 128System.Diagnostics.Debug.WriteLine("INFO | Text on accent is LIGHT", "System.Windows.Accent");
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\FrameworkContextData.cs (1)
67Debug.Assert((walkerEntry.Data == data) && (walkerEntry.Walker == walker),
System\Windows\FrameworkElement.cs (19)
1181Debug.Assert(startNode.IsValid || unlinkedParent != null, 1392Debug.Assert(fo.IsValid, 1481Debug.Assert(target != null, "Don't call FindTemplateResource with a null target object"); 1487Debug.Assert(fo.IsValid, "Don't call FindTemplateResource with a target object that is neither a FrameworkElement nor a FrameworkContentElement"); 1925Debug.Assert(entry.Value == DependencyProperty.UnsetValue,"FrameworkElement.GetRawValue should never fall through with a value != DependencyProperty.UnsetValue. We're supposed to return as soon as we found something."); 1937Debug.Assert( IsTemplatedParentAnFE ); 2347Debug.Assert( foTemplatedParent.IsFE ); 2354Debug.Assert(templatedParentTemplate != null , 2542Debug.Assert(fceParent == null, "Nearest framework parent via the visual tree has to be an FE. It cannot be an FCE"); 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 (5)
692Debug.Assert( treeNodeFO.IsValid || (treeNodeVisual3D != null), 725Debug.Assert( _frameworkTemplate != null ); 801Debug.Assert( _frameworkTemplate != null ); 1183Debug.Assert(_frameworkTemplate != null, "ContentPresenter is an FE and can only have a FrameworkTemplate"); 1226Debug.Assert(_frameworkTemplate != null, "GridViewRowPresenter is an FE and can only have a FrameworkTemplate");
System\Windows\FrameworkTemplate.cs (7)
67Debug.Assert(templatedParent != null, 448Debug.Assert(!_sealed, "call this method before template is sealed"); 773Debug.Assert(fo.TemplatedParent == templatedParent); 839Debug.Assert(false, "We do not have support for DynamicResource within unshared template content"); 966Debug.Assert(templateReader != null, "PlayXaml returned null"); 1065Debug.Assert(false, "Unknown enum value"); 1144Debug.Assert(!(rootElement is FrameworkElement) ||
System\Windows\Generated\FrameworkContentElement.cs (1)
1166Debug.Assert(value == true,
System\Windows\Generated\FrameworkElement.cs (1)
1205Debug.Assert(value == true,
System\Windows\Input\Command\CommandConverter.cs (2)
812System.Diagnostics.Debug.Assert( propertyInfo == null, "KnownCommand isn't known to CommandConverter.GetKnownCommand" ); 815System.Diagnostics.Debug.Assert( fieldInfo == null, "KnownCommand isn't known to CommandConverter.GetKnownCommand" );
System\Windows\Input\KeyboardNavigation.cs (20)
505Debug.Assert(adornedElement != null, "adornedElement should not be null"); 506Debug.Assert(focusVisualStyle != null, "focusVisual should not be null"); 520Debug.Assert(adornedElement != null, "adornedElement should not be null"); 521Debug.Assert(adornedElementParent != null, "adornedElementParent should not be null"); 522Debug.Assert(contentHostParent != null, "contentHostParent should not be null"); 523Debug.Assert(contentHostParent is Visual, "contentHostParent should be Visual"); 524Debug.Assert(focusVisualStyle != null, "focusVisual should not be null"); 988Debug.Assert(currentElement != null, "currentElement should not be null"); 1349Debug.Assert(container != null, "container cannot be null"); 1800Debug.Assert(e != null, "e should not be null"); 1801Debug.Assert(container != null, "container should not be null"); 1879Debug.Assert(e != null, "e cannot be null"); 2093Debug.Assert(container != null, "container should not be null"); 2129Debug.Assert(IsTabStopOrGroup(nextTabElement), "nextTabElement should be IsTabStop or group"); 2268Debug.Assert(e != null || container != null, "e or container should not be null"); 2647Debug.Assert(sourceElement != null, "sourceElement must not be null"); 2901Debug.Assert(!(sourceElement == null && container == null), "Both sourceElement and container cannot be null"); 2906Debug.Assert(container != null, "container cannot be null"); 3118Debug.Assert(DoubleUtil.GreaterThanOrClose(rangeEnd1, rangeStart1)); 3119Debug.Assert(DoubleUtil.GreaterThanOrClose(rangeEnd2, rangeStart2));
System\Windows\Interop\ActiveXHost.cs (26)
232Debug.Assert(args.Key.Length > 0, "got an empty access key"); 424Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Loaded, "Failed transition"); 429Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Running, "Failed transition"); 434Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.InPlaceActive, "Failed transition"); 439Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.UIActive, "Failed transition"); 443Debug.Fail("bad state"); 475Debug.Fail("how did we ever get into the open state?"); 480Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.InPlaceActive, "Failed transition"); 485Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Running, "Failed transition"); 490Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Loaded, "Failed transition"); 495Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Passive, "Failed transition"); 499Debug.Fail("bad state"); 523Debug.Assert(hr == NativeMethods.S_OK, $"DoVerb call failed for verb 0x{verb:X}"); 566Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Passive, "Wrong start state to transition from"); 571Debug.Assert(_axInstance == null, "_axInstance must be null"); 574Debug.Assert(_axInstance != null, "w/o an exception being thrown we must have an object..."); 589Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Loaded, "Wrong start state to transition from"); 623Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Loaded, "Wrong start state to transition from"); 648Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Running, "Wrong start state to transition from"); 665Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Running, "Wrong start state to transition from"); 692Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.InPlaceActive, "Wrong start state to transition from"); 707Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.InPlaceActive, "Wrong start state to transition from"); 720Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.UIActive, "Wrong start state to transition from"); 724Debug.Assert(NativeMethods.Succeeded(hr), "Failed in IOleInPlaceObject.UiDeactivate"); 956Debug.Assert(_axInstance != null, "The native control is null"); 1001Debug.Fail(e.ToString());
System\Windows\Interop\HwndHost.cs (1)
985Debug.Assert(hwnd != null);
System\Windows\Interop\WindowInteropHelper.cs (2)
88Debug.Assert(_window != null, "Cannot be null since we verify in the constructor"); 93Debug.Assert(_window != null, "Cannot be null since we verify in the constructor");
System\Windows\Localization.cs (1)
118Debug.Assert(property == AttributesProperty);
System\Windows\LogicalTreeHelper.cs (1)
421Debug.Assert(parentFE != null || parentFCE != null, "Either parentFE or parentFCE should be non-null");
System\Windows\Markup\Baml2006\Baml2006KeyRecord.cs (1)
72Debug.Assert(StaticResources[StaticResources.Count - 1] is StaticResource);
System\Windows\Markup\Baml2006\Baml2006Reader.cs (5)
1533Debug.Assert(dataByteSize == 1); 1673Debug.Assert(ownerType != null); 1959Debug.Assert(sr != null); 2114Debug.Assert(_context.CurrentFrame.XamlType != null, "BAML Xmlns record is only legal between ElementStart and ElementEnd"); 2594Debug.Assert(property.Type.UnderlyingType == typeof(DependencyProperty));
System\Windows\Markup\Baml2006\Baml2006SchemaContext.cs (1)
196Debug.Assert(wpfMember.DependencyProperty != null);
System\Windows\Markup\Baml2006\SharedStream.cs (1)
290System.Diagnostics.Debug.Assert(_baseStream != null, "Stream has already been disposed");
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 (21)
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); 823Debug.Assert(attributeId >= 0, "Known Property Id must be a DependencyProperty."); 862Debug.Assert(memberId < 0); 1024Debug.Assert(assemblyFullName.Length != 0, "empty assembly"); 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); 1470Debug.Assert(GetHashTableData(stringValue) == null, 1504Debug.Assert(targetType != null && memberName != null); 1646Debug.Assert(AttributeIdMap.Count == record.AttributeId || 1662Debug.Assert(StringIdMap.Count == record.StringId ||
System\Windows\Markup\BamlReader.cs (2)
1390Debug.Assert(dictKey != null, "Bad Key record"); 1421Debug.Assert(keyStartRecord != null, "Bad Key Element Start record");
System\Windows\Markup\BamlRecordHelper.cs (1)
132Debug.Assert(false, "Unhandled case in DoesRecordTypeHaveDebugExtension");
System\Windows\Markup\BamlRecordReader.cs (46)
107Debug.Assert(null != bamlStream); 108Debug.Assert(null != parserContext && null != parserContext.XamlTypeMapper); 133Debug.Assert(null != parserContext && null != parserContext.XamlTypeMapper); 242Debug.Assert(false == XamlReaderStream.IsWriteComplete, 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); 1219Debug.Assert(!CurrentContext.CheckFlag(ReaderFlags.NeedToAddToTree), "Failed to add Element to tree before popping stack"); 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); 1516Debug.Assert(param != null && paramList == null, "Must have a single param"); 1530Debug.Assert(param == null && paramList != null, "Must have a paramList"); 1904Debug.Assert(staticResourceValues != null, "Must have a list of StaticResourceValues for lookup"); 1977Debug.Assert(staticResourceValues != null, "Must have a list of StaticResourceValues for lookup"); 2114Debug.Assert(serializerTypeId == (short)KnownElements.DependencyPropertyConverter); 2245Debug.Assert(element is DependencyObject, "Guaranteed by PropertyDefinition constructor"); 2539Debug.Assert(o is DependencyObject); 2713Debug.Assert( attributeUsage == BamlAttributeUsage.XmlSpace, 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); 3458Debug.Assert( CurrentContext.ObjectData == null && CurrentContext.ExpectedType != 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 && 4250Debug.Assert(!context.CreateUsingTypeConverter, 4903Debug.Assert(contentProperty != null); 5008Debug.Assert(false, "The only remaining option is attached property, which is not allowed in xaml for content properties"); 5754Debug.Assert(_attributeInfo != null); 5849Debug.Assert(this.AttachedPropertyGetter != null);
System\Windows\Markup\BamlRecords.cs (29)
700Debug.Assert(false,"Assembly, Type and Attribute records are not cached, so don't ask for one."); 725Debug.Assert(false,"Unknown RecordType"); 778Debug.Assert(null == _writeCache[(int)record.RecordType]); 868set { Debug.Assert (value == -1, "Setting fixed record to an invalid size"); } 877Debug.Assert(false, "Must override RecordType"); 915Debug.Assert( value <= 3 && value >= 0 ); 1103Debug.Assert(RecordSize < 0); 1513Debug.Assert(_valuePositionPosition != -1, 1696Debug.Assert(_valuePositionPosition != -1, 2061set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2131set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2192set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2399Debug.Assert(value <= ExtensionIdMask); 2419set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 2729Debug.Assert(!ValueObjectSet); 2808Debug.Assert (false, "Unknown custom serializer"); 2996set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 3210set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3297set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3446Debug.Assert(_contentSizePosition != -1, 3491set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3651set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 3749set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 3827set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 4012Debug.Assert(FilePos != -1,"UpdateWrite called but Write Never was"); 4555Debug.Assert( SerializerTypeId != 0 ); 4708Debug.Assert((propertyMember is MethodInfo) || (propertyMember is PropertyInfo) 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 (22)
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); 467Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 567Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 604Debug.Assert(!InStaticResourceSection, "We do not support x:Shared within a StaticResource Section"); 788Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 844Debug.Assert(keyRecord.RecordList.Count == 0, "Should have empty record list"); 870Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 881Debug.Assert(_deferElementDepth == 2); 1070Debug.Assert(extensionTypeId != (short)KnownElements.TypeExtension); 1087Debug.Assert(typeValue != null); 1632Debug.Assert(keyRecord != null, "Unknown key record type in defer load dictionary"); 1643Debug.Assert(keyIndex == _deferKeys.Count, 1666Debug.Assert(_deferElementDepth > 0 && CollectingValues, 1674Debug.Assert(valueDeferRecord.Record != null && 1686Debug.Assert(valueDeferRecord.Record != null && valueDeferRecord.Record.RecordType == BamlRecordType.ElementEnd,
System\Windows\Markup\BamlVersionHeader.cs (3)
73Debug.Assert((posEnd-posStart) == BamlVersionHeader.BinarySerializationSize, 104Debug.Assert(length == BamlVersionHeader.BinarySerializationSize, 109Debug.Assert((posEnd-posStart) == BamlVersionHeader.BinarySerializationSize,
System\Windows\Markup\BamlWriter.cs (6)
131Debug.Assert(null != assemblyName,"assembly name returned from GetBaseElement is null"); 132Debug.Assert(null != typeFullName,"Type name returned from GetBaseElement is null"); 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 (3)
1189Debug.Assert(sb.Length > 0); 1190Debug.Assert(!Char.IsWhiteSpace(sb[0])); 1544Debug.Assert(null != info, "No property or method info for field Name");
System\Windows\Markup\ParserContext.cs (1)
764Debug.Assert(canDecrement);
System\Windows\Markup\Primitives\ElementMarkupObject.cs (8)
52Debug.Assert(instance != null); 728Debug.Assert(obj != null); 752Debug.Assert(descriptor != null); 801Debug.Assert(DO != null); 943Debug.Assert(typeSerializer != null, "typeSerializer for Enum was null"); 1003Debug.Assert(serializer != null && serializer.CanConvertToString(_object.Instance, _object.Context), 1013Debug.WriteLine("ElementMarkupObject.Items is not implemented"); 1028Debug.Assert(serializer != null && serializer.CanConvertToString(_object.Instance, _object.Context),
System\Windows\Markup\Primitives\ExtensionSimplifierMarkupObject.cs (3)
309Debug.Fail("No items where found and IsComposite return true"); 320Debug.Assert(typeSerializer != null, "Could not retrieve typeSerializer for Type"); 355Debug.Assert(!propertyWritten, "An argument was returned after a property was set. All arguments must be returned first and in order");
System\Windows\Markup\Primitives\FrameworkElementFactoryMarkupObject.cs (2)
30Debug.Assert(factory != null); 201Debug.Fail("Unexpected property value type");
System\Windows\Markup\Primitives\MarkupWriter.cs (9)
259Debug.Assert( (object)key != null); 443Debug.Assert(item != null && _writer != null); 508Debug.Assert(!noOtherPropertiesAllowed || property.IsKey, 528Debug.Assert(first, "Problem with MarkupObject implemenation: Items returning a ValueAsString can have no other properties"); 544Debug.Assert(dependencyProperty != null, "Problem with MarkupObject implementation: If PropertyDescriptor is null one of the following needs to be true; IsKey, IsValueAsString, IsConstructorArgument, or DependencyProperty is not null"); 691Debug.Assert(!property.IsValueAsString, "Problem with MarkupObject implementation: String values cannnot be composite"); 833Debug.Assert(property.PropertyDescriptor != null); 1037Debug.Assert(property.Value != null); 1366Debug.Assert( ((bool)_xmlnsSpacePreserve) == _containingScope.XmlnsSpacePreserve ,
System\Windows\Markup\StyleModeStack.cs (2)
51Debug.Assert(Depth >= 0, $"StyleModeStack's depth was {Depth}, should be >= 0"); 68Debug.Assert(Depth >= 0, $"StyleMode::Pop() with depth of {Depth}, should be >= 0");
System\Windows\Markup\WpfXamlLoader.cs (2)
321System.Diagnostics.Debug.Assert(count == 0, "Mismatch StartMember/EndMember"); 391System.Diagnostics.Debug.Assert(xamlReader.Value is string, "XmlAttributeProperties.XmlSpaceProperty has the type string.");
System\Windows\Markup\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\XamlStream.cs (14)
84Debug.Assert(!WriteComplete,"Write called after close"); 86Debug.Assert(null != buffer,"Null buffer past to the Writer"); 98Debug.Assert(null != writeBuffer,"Null writeBuffer returned"); 118Debug.Assert(0 < bufferWriteCount,"Not writing any bytes to the buffer"); 123Debug.Assert(bufferOffset < BufferSize,"Trying to Read past bufer"); 189Debug.Assert(!WriteComplete,"UpdateReaderLength called after close"); 234Debug.Assert(bufferOffset < BufferSize,"Calculated bufferOffset is greater than buffer"); 254Debug.Assert(0 < bufferReadCount,"Not reading any bytes to the buffer"); 259Debug.Assert(bufferOffset < BufferSize,"Trying ot read past buffer"); 382Debug.Assert(bufferOffset < BufferSize,"Calculated bufferOffset is greater than buffer"); 387Debug.Assert(bufferArray.Count == bufferIndex,"Need to allocate more than one buffer"); 388Debug.Assert(false == reader,"Allocating a buffer on Read"); 793Debug.Assert(false,"Close called on ReaderStream"); 801Debug.Assert(false,"Flush called on ReaderStream");
System\Windows\Markup\XamlTypeMapper.cs (33)
562Debug.WriteLine($"Reflected for type converter on {propType.Name}.{propName}"); 835Debug.Assert(null != attribInfo, "null attribInfo"); 836Debug.Assert(null != currentParentType, "null currentParentType"); 875Debug.Assert(propertyOwnerType != null); 904Debug.Assert(attachedPropertyInfo.IsPublic || 954Debug.Assert(null != localName, "null localName"); 955Debug.Assert(null != xmlNamespace, "null xmlNamespace"); 1602Debug.Assert(null != eventName, "null eventName"); 1603Debug.Assert(null != owner, "null owner"); 1647Debug.Assert(null != localName, "null localName"); 1648Debug.Assert(null != xmlNamespace, "null xmlNamespace"); 1685Debug.Assert(null != baseType, "baseType not set"); 1778Debug.Assert(null != localName, "null localName"); 1779Debug.Assert(null != xmlNamespace, "null xmlNamespace"); 1921Debug.Assert(typeInfo != null, "Must have cached type info at this point"); 2138Debug.Assert( propertyMember is DependencyProperty); 2319Debug.Assert(memberName != null); 2322Debug.Assert(memberInfo != null); 2337Debug.Assert(targetType != null); 2413Debug.Assert(null != xmlNamespace,"null value passed for xmlNamespace"); 2414Debug.Assert(null != localName,"null value passed for localName"); 2452Debug.Assert(null != xmlNamespace,"null value passed for xmlNamespace"); 2453Debug.Assert(null != localName,"null value passed for localName"); 2603Debug.Assert(namespaceMap.ClrNamespace != null,"Null CLR Namespace"); 2604Debug.Assert(localName != null,"Null localName"); 3451Debug.Assert(null != type, "Null passed for type to GetTypeConverterType"); 3482Debug.Assert(null != type, "Null passed for type to GetTypeConverter"); 3526Debug.Assert(null != propType, "Null passed for propType to GetPropertyConverterType"); 3570Debug.Assert(null != propType, "Null passed for propType to GetPropertyConverter"); 3689Debug.Assert(_constructors != null, "This operation is legal only after the constructors have been fetched"); 3755Debug.Assert(null != type, "null value for type passed to GetWhitespace"); 3767Debug.Assert(1 == trimAttribute.Length,"More than one TrimWhitespace Attribute"); 4021Debug.Assert(_dpLookupHashtable != null,
System\Windows\Markup\XmlnsDictionary.cs (1)
713Debug.Assert(prefix != null);
System\Windows\Media\Animation\BeginStoryboard.cs (3)
180Debug.Assert( fe != null || fce != null, "Caller of internal function failed to verify that we have a FE or FCE - we have neither." ); 189Debug.Assert( frameworkTemplate != null ); 199Debug.Assert( fe != null, "Invoke needs an object as starting point");
System\Windows\Media\Animation\ControllableStoryboardAction.cs (4)
63Debug.Assert( fe != null || fce != null, "Caller of internal function failed to verify that we have a FE or FCE - we have neither." ); 64Debug.Assert( targetStyle != null || frameworkTemplate != null, 74Debug.Assert( frameworkTemplate != null ); 83Debug.Assert( fe != null, "Invoke needs an object as starting point");
System\Windows\Media\Animation\Generated\ThicknessAnimation.cs (2)
217Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 315Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\ThicknessAnimationUsingKeyFrames.cs (7)
327Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 352Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 633Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 640Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 690Debug.Assert(!_areKeyTimesValid, "KeyFrameThicknessAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 832Debug.Assert(index < keyFrameCount, 908Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\ThicknessKeyFrameCollection.cs (1)
483Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\PauseStoryboard.cs (1)
28Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\RemoveStoryboard.cs (1)
28Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\ResumeStoryboard.cs (1)
28Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\SeekStoryboard.cs (1)
93Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\SetStoryboardSpeedRatio.cs (1)
51Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\SkipStoryboardToFill.cs (1)
28Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\StopStoryboard.cs (1)
28Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\Storyboard.cs (9)
266Debug.Assert( nameScope == null ); 576Debug.Assert( mappedObject == null || mappedObject is AnimationClock || mappedObject is List<AnimationClock>, 617Debug.Assert( value is AnimationClock || value is List<AnimationClock> , 691Debug.Assert( i > 0, "The caller should not have set the PropertyPath context to a null object." ); 746Debug.Assert( i > 0, "The caller should not have set the PropertyPath context to a non DependencyObject." ); 811Debug.Assert(path.Length > 1, "This method shouldn't even be called for a simple property path."); 861Debug.Assert(targetPropertyValue is Freezable, "We shouldn't be trying to clone a type we don't understand. PropertyCloningRequired() has improperly flagged the current value as 'need to clone'."); 981Debug.Assert(cacheEntry.Source != DependencyProperty.UnsetValue, 2118Debug.Assert( target != null && clone != null && property != null && original != null,
System\Windows\MultiTrigger.cs (1)
134Debug.Assert( TriggerConditions[i].SourceChildIndex == 0,
System\Windows\Navigation\Journal.cs (13)
260Debug.Assert(ValidateIndexes()); 270Debug.Assert(ValidateIndexes()); 283Debug.Assert(journalEntry.ContentId != 0); 284Debug.Assert(!(journalEntry.IsAlive() && journalEntry.JEGroupState.JournalDataStreams != null), 314Debug.Assert(_uncommittedCurrentIndex == _currentEntryIndex, 333Debug.Assert(ValidateIndexes()); 427Debug.Assert(IsNavigable(target), "target must be navigable"); 428Debug.Assert(ValidateIndexes()); 476Debug.Assert(je.GetType().IsSerializable); 496Debug.Assert(index < TotalCount && index >= 0, "Invalid index passed to RemoveEntryInternal"); 497Debug.Assert(_uncommittedCurrentIndex == _currentEntryIndex, 501Debug.Assert(theEntry != null, "Journal list state is messed up"); 581Debug.Assert(ValidateIndexes());
System\Windows\Navigation\JournalEntry.cs (3)
280Debug.Assert(!_jeGroupState.JournalDataStreams.HasAnyData, 296Debug.Assert(_jeGroupState.JournalDataStreams == null); 313Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward);
System\Windows\Navigation\NavigationService.cs (46)
95Debug.Assert(_navigateQueueItem == null || _navigateQueueItem.IsPosted == false); 104Debug.Assert(e != null, "Hyperlink fired Navigate event with null NavigateEventArgs"); 117Debug.Assert(dobj != null, "RequestNavigateEventArgs.OriginalSource should be DependencyObject"); 254Debug.Assert(_bp != null, "NavigationService should not handle a nav from a hyperlink thats not in its hosted tree"); 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); 640Debug.Assert(ChildNavigationServices.Contains(ncChild), "Child NavigationService must already exist"); 703Debug.Assert(fe != null, "INavigatorHost needs to be FrameworkElement"); 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); 1145Debug.Assert(bpu == null || 1175Debug.Assert(navMode == NavigationMode.Refresh, 1193Debug.Assert(!JournalScope.Journal.HasUncommittedNavigation); 1210Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward); 1213Debug.Assert(_contentId != 0); 1217Debug.Assert(_journalEntryGroupState == null || 1951Debug.Assert(PendingNavigationList.Count == 0, 2061Debug.Assert(this.Application != null && 2115Debug.Assert(navigateInfo.IsConsistent); 2116Debug.Assert(source == null || 2166Debug.Assert(PendingNavigationList.Count == 0, 2176Debug.Assert(_navigateQueueItem == null, "Previous nav queue item should be cleared by now."); 2262Debug.Assert(_navStatus == NavigationStatus.Navigated); 2603Debug.Assert(sender == _bp); 3086Debug.Assert(IsConsistent(navigateInfo)); 3113Debug.Assert(navigationMode == NavigationMode.New || 3118Debug.Assert(destinationJournalEntry == null 3197Debug.Assert(_contentId != 0 && 3703Debug.Assert(ps._Resume); // should've been set by JournalEntryPFxx.ResumePageFunction() 3732Debug.Assert(_navigateQueueItem == null, 3807Debug.Assert(parentPF._Return == null); 3909Debug.Assert(parentEntryIndex < journal.CurrentIndex); 3914Debug.Fail("Could not find the finishing PageFunction in the journal."); 3971Debug.Fail($"Unhandled scenario: PageFunction returning to {parentEntry.GetType().Name}"); 4414Debug.Assert(_postedOp == null); 4505Debug.Assert(child != null); 4531Debug.Assert(node != null, "Trying to dispose a null Logical Tree Node");
System\Windows\Navigation\NavigationWindow.cs (10)
228Debug.Assert(_navigationService == null && _JNS == null); 320Debug.Assert(_JNS != null); 1017Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1024Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1032Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1039Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1047Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1054Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1061Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1073Debug.Assert(nw != null, "sender must be of type NavigationWindow.");
System\Windows\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 (16)
197Debug.Assert(classicResourceUri != null); 211Debug.Assert(genericResourceUri != null); 550Debug.Assert(_numDefer > 0, "The stream was closed before all deferred content was loaded."); 963Debug.Assert(IsInitialized == false, "Dictionary should not be initialized when EndInit is called"); 1024Debug.Assert(_numDefer > 0, "The stream was closed before all deferred content was loaded."); 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); 1295Debug.Assert(keyValue != null, "Didn't find the ResourceKey property or x:PositionalParameters directive"); 1299Debug.Assert(false, "StaticResources[] entry is not a StaticResource not OptimizedStaticResource"); 1314Debug.Assert(obj is DeferredResourceReference); 1726Debug.Assert(resourceKey != null, "ResourceKey cannot be null"); 2245Debug.Assert(IsThemeDictionary || _ownerApps != null || IsReadOnly, "This must be an App/Theme/Style/Template ResourceDictionary");
System\Windows\ResourceDictionaryCollection.cs (1)
18Debug.Assert(owner != null, "ResourceDictionaryCollection's owner cannot be null");
System\Windows\ResourceReferenceExpression.cs (2)
106Debug.Assert(_targetObject == d, "TargetObject that this expression is attached to must be the same as the one on which its value is being queried"); 546Debug.Assert(!_resource.IsFrozen);
System\Windows\ResourcesChangeInfo.cs (1)
224Debug.Assert(_oldDictionaries != null || _newDictionaries != null || _key != null, "Must have a dictionary or a key that has changed");
System\Windows\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\StaticResourceExtension.cs (1)
250Debug.Assert(ambientList != null, "IAmbientProvider.GetAllAmbientValues no longer returns List<>, please copy the list");
System\Windows\Style.cs (3)
364Debug.Assert(resourceKey != null, "Argument cannot be null"); 653Debug.Assert(setterBase != null, "Setter collection must contain non-null instances of SetterBase"); 682Debug.Assert(setterBase is EventSetter,
System\Windows\StyleHelper.cs (99)
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 ); 723Debug.Assert(freezable.IsFrozen, "Freezable within a Style or Template should have been frozen by now"); 779Debug.Assert(childIndex >= 0); 1133Debug.Assert(action.IsSealed, "TriggerAction should have already been sealed by this point."); 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 ); 1502Debug.Assert((container is FrameworkElement) || (container is FrameworkContentElement), "Caller has queried with non-framework element. Bad caller, bad!"); 1503Debug.Assert(dataType < InstanceStyleData.ArraySize, "Caller has queried using a value outside the range of the Enum. Bad caller, bad!"); 1606Debug.Assert(!freezable.CanFreeze, "If a freezable could have been frozen it would have been done by now."); 1633Debug.Assert(instanceValues != null, "InstanceValues hashtable should have been created at initialization time."); 1677Debug.Assert(oldStyle != null || oldFrameworkTemplate != null ); 1695Debug.Assert(dataField == ThemeStyleDataField); 1777Debug.Assert(frameworkTemplate != null ); 1818Debug.Assert(treeRoot is FrameworkElement || treeRoot is FrameworkContentElement, 1866Debug.Assert(treeRoot == null || treeRoot is FrameworkElement || treeRoot is FrameworkContentElement, 1894Debug.Assert( feContainer._buildVisualTreeVerification == VerificationState.WaitingForBuildVisualTree, 1902Debug.Assert(frameworkTemplate != null, "Only FrameworkTemplate has the ability to build a VisualTree by this means"); 1914Debug.Assert( feContainer._buildVisualTreeVerification == VerificationState.WaitingForBuildVisualTreeCompletion, 1919Debug.Assert( feContainer._buildVisualTreeVerification == VerificationState.WaitingForAddCustomTemplateRoot, 1954Debug.Assert( container._buildVisualTreeVerification != VerificationState.WaitingForBuildVisualTreeCompletion, 1956Debug.Assert( container._buildVisualTreeVerification == VerificationState.WaitingForAddCustomTemplateRoot, 1977Debug.Assert( null == VisualTreeHelper.GetParent(child), 2051Debug.Assert(frameworkTemplate != null ); 2065Debug.Assert( feWalkNode != null || fceWalkNode != null, 2138Debug.Assert(feContainer != null || fceContainer != null, 2157Debug.Assert(templatedChildren.Count > 0, 2189Debug.Assert(feContainer != null || fceContainer != null); 2224Debug.Assert(oldFrameworkTemplate != null ); 2273Debug.Assert( oldFrameworkTemplate != null ); 2401Debug.Assert(sender is FrameworkElement || sender is FrameworkContentElement, 2456Debug.Assert(sender is FrameworkElement || sender is FrameworkContentElement, 2487Debug.Assert( feTemplatedParent != null ); 2490Debug.Assert(templatedParentTemplate != null, "Must have a VisualTree owner"); 2511Debug.Assert(ownerStyle != null || frameworkTemplate != null ); 2523Debug.Assert( frameworkTemplate != null ); 2535Debug.Assert(action.ContainingTrigger is EventTrigger, 2626Debug.Assert(child.IsValid, "child should either be an FE or an FCE"); 2892Debug.Assert(dataField == ThemeStyleDataField); 2978Debug.Assert(value != NotYetApplied, "attempt to retrieve instance value that was never set"); 3034Debug.Assert(frameworkTemplate != null ); 3048Debug.Assert(frameworkTemplate != null ); 3083Debug.Assert(!StyleHelper.IsSetOnContainer(conditions[j].Property, ref containerDependents, true), 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); 3500Debug.Assert( oldTemplate == null || oldTemplate is FrameworkTemplate, 3502Debug.Assert( newTemplate == null || newTemplate is FrameworkTemplate, 3504Debug.Assert( (oldTemplate == null || newTemplate == null ) || 3908Debug.Assert(sourceType == ValueLookupType.Simple || 3938Debug.Assert(sourceType == ValueLookupType.Trigger || 3992Debug.Assert(sourceType == ValueLookupType.Simple || 4092Debug.Assert(styledChildren != null, "Should reach here only if the template tree has already been created"); 4202Debug.Assert(child.FE != null || child.FCE != null); 4221Debug.Assert(dp != null, "dp must not be null"); 4311Debug.Assert(ownerStyle != null || frameworkTemplate != null ); 4353Debug.Assert(candidateTrigger is List<TriggerBase>, 4382Debug.Assert(ownerStyle != null || frameworkTemplate != null ); 4453Debug.Assert( triggerBase is MultiDataTrigger, 4489Debug.Assert( triggerBase is MultiTrigger, 4553Debug.Assert( ft != null ); 4832Debug.Assert(!(action.ContainingTrigger is EventTrigger), 4848Debug.Assert( trigger.Property == changedProperty, 4855Debug.Assert( frameworkTemplate != null, 4863Debug.Assert( conditions != null && conditions.Length == 1, 4893Debug.Assert( conditions != null && conditions.Length == 1, 4926Debug.Assert( frameworkTemplate != null, 4937Debug.Assert(evaluationNode != null, 4999Debug.Assert( evaluationBinding != null, 5064Debug.Assert( existing is List<TriggerBase>, 5110Debug.Assert( existing is List<TriggerBase>, 5283Debug.Assert(candidateTrigger is List<TriggerBase>, 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); 5815Debug.Assert(false, "GetHashCode for value types will use reflection to generate the hashcode. Write a better hash code generation algorithm if this struct is to be used in a hashtable, or remove this assert if it's decided that reflection is OK.");
System\Windows\SystemResourceKey.cs (1)
1858Debug.Assert(((SystemResourceKeyID.InternalSystemColorsStart < id) && (id < SystemResourceKeyID.InternalSystemColorsEnd)) ||
System\Windows\SystemResources.cs (9)
363Debug.Assert(typeKey != null || resourceKey != null, "typeKey or resourceKey should be non-null"); 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 (12)
43Debug.Assert(_xamlType == null); 236Debug.Assert(TemplateLoadData.Reader != null); 322Debug.Assert(childIndex == lastIndex); 584Debug.Assert(iReader != null, "Template's Reader is not a Indexing Reader"); 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 (4)
55Debug.Assert(templatedParent == null || (templatedParent is FrameworkElement || templatedParent is FrameworkContentElement), 166Debug.Assert(_affectedChildren.Count == childIndex); 203Debug.Assert(false, "Should never be trying to unregister via this interface for templates"); 216Debug.Assert(fo.IsFE);
System\Windows\ThemeDictionaryExtension.cs (2)
190Debug.Assert(dictionary != null, "dictionary should not be null"); 191Debug.Assert(assemblyName != null, "assemblyName should not be null");
System\Windows\TreeChangeInfo.cs (2)
59Debug.Assert(d != null, "Must have non-null current node"); 118Debug.Assert(!inheritableProperties.Contains(dp), "EffectiveValues cache must not contains duplicate entries for the same DP");
System\Windows\TreeWalkHelper.cs (14)
44Debug.Assert(fe != null || fce != null, "Node with the tree change notification must be an FE or an FCE."); 45Debug.Assert(parent != null, "Must have a parent that the current node is connected to or disconnected from."); 246Debug.Assert(fe != null || fce != null, "Must have non-null current node"); 269Debug.Assert(inheritableProperty.IsPotentiallyInherited, "if we got here, it means that this property is inheritable by someone"); 286Debug.Assert(!currentInheritableProperties.Contains(inheritableProperty), "InheritableProperties list should not have duplicates"); 321Debug.Assert(d != null, "Must have non-null current node"); 324Debug.Assert(fMetadata.IsInherited == true, "This must be an inherited dependency property"); 327Debug.Assert(!wasSelfInheritanceParent || isSelfInheritanceParent, "IsSelfInheritanceParent changed from true to false"); 458Debug.Assert(fe != null || fce != null, "Node with the resources change notification must be an FE or an FCE."); 516Debug.Assert(d != null, "Must have non-null current node"); 681Debug.Assert(d != null, "Must have non-null current node"); 744Debug.Assert(d != null, "Must have non-null current node"); 906Debug.Assert(fo.IsValid, "Node with the resources change notification must be an FE or an FCE."); 938Debug.Assert(d != null, "Must have non-null current node");
System\Windows\Trigger.cs (2)
239Debug.Assert( TriggerConditions != null && TriggerConditions.Length == 1, 242Debug.Assert( TriggerConditions[0].SourceChildIndex == 0,
System\Windows\TriggerActionCollection.cs (1)
282Debug.Assert (Owner == null);
System\Windows\TriggerBase.cs (1)
376Debug.Assert( false,
System\Windows\TriggerCollection.cs (1)
107Debug.Assert (Owner == null);
System\Windows\Window.cs (57)
353Debug.Assert(_threadWindowHandles == null, "_threadWindowHandles must be null before enumerating the thread windows"); 670Debug.Assert(false); 1321Debug.Assert( IsSourceWindowNull == false , "IsSourceWindowNull cannot be true when _showingAsDialog is true"); 2235Debug.Assert( _swh != null ); 2244Debug.Assert( _swh != null ); 2929Debug.Assert( IsSourceWindowNull == false , "IsSourceWindowNull cannot be true when calling this function"); 3156Debug.Assert(Manager != null, "HwndStyleManager must have a valid value here"); 3477Debug.Assert(w != null, "Target must be of type Window."); 3500Debug.Assert(_threadWindowHandles != null, "_threadWindowHandles must not be null at this point"); 3523Debug.Assert(_threadWindowHandles != null, "_threadWindowHandles must not be null at this point"); 3676Debug.Assert(IsSourceWindowNull == false, "_swh should not be null here"); 3793Debug.Assert(hMonitor != IntPtr.Zero); 3826Debug.Assert(workAreaWidthDeviceUnits >= 0, string.Create(CultureInfo.InvariantCulture, $"workAreaWidth ({hMonitor})for monitor ({workAreaWidthDeviceUnits}) is negative")); 3827Debug.Assert(workAreaHeightDeviceUnits >= 0, string.Create(CultureInfo.InvariantCulture, $"workAreaHeight ({hMonitor}) for monitor ({workAreaHeightDeviceUnits}) is negative")); 3837Debug.Assert(IsSourceWindowNull == false, "_swh should not be null here"); 3964Debug.Assert(false, "Invalid value for ResizeMode"); 4342Debug.Assert(_showingAsDialog == true, "_showingAsDialog must be true when DoDialogHide is called"); 4383Debug.Assert(_threadWindowHandles != null, "_threadWindowHandles must not be null at this point"); 4424Debug.Assert(ownedWindows.Count == 0, "All owned windows should now be gone"); 4985Debug.Assert(w != null, "DependencyObject must be of type Window."); 5011Debug.Assert(w != null, "DependencyObject must be of type Window."); 5030Debug.Assert(w != null, "DependencyObject must be of type Window."); 5090Debug.Assert(w != null, "DependencyObject must be of type Window."); 5217Debug.Assert(w != null, "DependencyObject must be of type Window."); 5237Debug.Assert(w != null, "DependencyObject must be of type Window."); 5498Debug.Assert(_dispatcherFrame == null, "_dispatcherFrame must be null here"); 5557Debug.Assert(w != null, "DependencyObject must be of type Window."); 5568Debug.Assert(w != null, "DependencyObject must be of type Window."); 5628Debug.Assert(w != null, "d must be typeof Window"); 5651Debug.Assert(w != null, "d must be typeof Window"); 5690Debug.Assert(w != null, "d must be typeof Window"); 5728Debug.Assert(w != null, "d must be typeof Window"); 5749Debug.Assert(w != null, "d must be typeof Window"); 5790Debug.Assert(w != null, "d must be typeof Window"); 5882Debug.Assert(false, $"specifiedRestoreBounds can't be {specifiedRestoreBounds}"); 6016Debug.Assert( w != null, "DependencyObject must be of type Window." ); 6091Debug.Assert( w != null, "DependencyObject must be of type Window." ); 6148Debug.Assert( IsSourceWindowNull == false , "IsSourceWindowNull cannot be true when calling this function"); 6170Debug.Assert( w != null, "DependencyObject must be of type Window." ); 6202Debug.Assert(w != null, "DependencyObject must be of type Window."); 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 ); 7362Debug.Assert(IsSourceWindowNull != true, "IsSourceWindowNull cannot be true here"); 7453Debug.Assert( IsSourceWindowNull == false , "Should only be invoked when we know Handle is non-null" ); 7463Debug.Assert( IsSourceWindowNull == false , "Should only be invoked when we know Handle is non-null" ); 7488Debug.Assert( IsSourceWindowNull == false , "IsSourceWindowNull can't be true here"); 7507Debug.Assert( IsSourceWindowNull == false , "IsSourceWindowNull can't be true here");
System\Windows\WindowCollection.cs (1)
41Debug.Assert(count >= 0, "count must not be less than zero");
PresentationFramework.Aero (4)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
330Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 357Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 367Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
30Debug.Assert(_platformCulture != null);
PresentationFramework.Aero2 (4)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
330Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 357Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 367Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
30Debug.Assert(_platformCulture != null);
PresentationFramework.AeroLite (4)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
330Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 357Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 367Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
30Debug.Assert(_platformCulture != null);
PresentationFramework.Classic (22)
Microsoft\Windows\Themes\ClassicBorderDecorator.cs (18)
235Debug.Assert(rgbColor.Red >= 0 && rgbColor.Red <= 1, "Red must be between 0 and 1."); 236Debug.Assert(rgbColor.Green >= 0 && rgbColor.Green <= 1, "Green must be between 0 and 1."); 237Debug.Assert(rgbColor.Blue >= 0 && rgbColor.Blue <= 1, "Blue must be between 0 and 1."); 299Debug.Assert(hue >= 0 && hue <= 1, "Output hue should be between 0 and 1."); 300Debug.Assert(lightness >= 0 && lightness <= 1, "Output lightness should be between 0 and 1."); 301Debug.Assert(saturation >= 0 && saturation <= 1, "Output saturation should be between 0 and 1."); 303Debug.Assert(!isHueDefined || isSaturationDefined, "If hue is defined, saturation must also be defined."); 315Debug.Assert(hlsColor.Lightness >= 0 && hlsColor.Lightness <= 1, "Lightness must be between 0 and 1."); 316Debug.Assert(hlsColor.Saturation >= 0 && hlsColor.Saturation <= 1, "Saturation must be between 0 and 1."); 341Debug.Assert(red >= 0 && red <= 1, "Output red should be between 0 and 1."); 342Debug.Assert(green >= 0 && green <= 1, "Output green should be between 0 and 1."); 343Debug.Assert(blue >= 0 && blue <= 1, "Output blue should be between 0 and 1."); 350Debug.Assert(n1 >= 0 && n1 <= 1, "n1 must be between 0 and 1."); 351Debug.Assert(n2 >= 0 && n2 <= 1, "n2 must be between 0 and 1."); 352Debug.Assert(hue >= -6 && hue < 12, "Hue must be between -6 (inclusive) and 12 (exclusive)."); 1150Debug.Assert(_tabCache != null, "_tabCache is null. GetShadow1 should only be called after GetHighlight1"); 1163Debug.Assert(_tabCache != null, "_tabCache is null. GetHighlight2 should only be called after GetHighlight1"); 1176Debug.Assert(_tabCache != null, "_tabCache is null. GetHighlight2 should only be called after GetHighlight1");
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
330Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 357Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 367Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
30Debug.Assert(_platformCulture != null);
PresentationFramework.Luna (4)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
330Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 357Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 367Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
30Debug.Assert(_platformCulture != null);
PresentationFramework.Royale (4)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
330Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 357Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 367Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
30Debug.Assert(_platformCulture != null);
PresentationUI (5)
MS\Internal\Documents\Application\DocumentProperties.cs (1)
226System.Diagnostics.Debug.Assert(
MS\Internal\Documents\DocumentApplicationDocumentViewer.cs (1)
62System.Diagnostics.Debug.Assert(
MS\Internal\Documents\DocumentSignatureManager.cs (1)
839System.Diagnostics.Debug.Assert(
MS\Internal\Documents\RightsManagementManager.cs (1)
74System.Diagnostics.Debug.Assert(
MS\Internal\Documents\SignatureSummaryDialog.cs (1)
751Debug.Assert(item._displayImage != null, "Signature icon is null");
ReachFramework (123)
AlphaFlattener\BrushProxy.cs (55)
168Debug.Assert(pen != null, "pen expected"); 169Debug.Assert(brush != null, "brush expected"); 192Debug.Assert(_brush.BrushList == null, "Simple brush expected"); 273Debug.Assert(pen != null, "pen expected"); 274Debug.Assert(pen.Brush != null, "pen expected to have a brush"); 306Debug.Assert(pen != null, "pen expected"); 307Debug.Assert(pen.Brush != null, "pen expected to have a brush"); 544Debug.Assert(bp._opacityOnly == _opacityOnly, "Brush and OpacityMask can't mix in a single list"); 672Debug.Assert(Utility.IsRenderVisible(vb), "TileBrush.Viewbox area must be positive"); 679Debug.Assert(false, "IsOpaque(" + _brush.GetType() + ") not handled"); 739Debug.Assert(Utility.IsRenderVisible(vb), "TileBrush.Viewbox must be visible"); 775Debug.Assert(false, "IsTransparent not handled " + _brush.GetType()); 1082Debug.Assert(false, "Unexpected brush type"); 1198Debug.Assert(tileBrush.ViewportUnits == BrushMappingMode.Absolute); 1230Debug.Assert(tileBrush.ViewportUnits == BrushMappingMode.Absolute); 1255Debug.Assert(drawingBrush.Drawing != null, "DrawingBrush where Drawing == null should've been culled"); 1321Debug.Assert(_drawing != null, "_drawing primitive changed, but it's null"); 1390Debug.Assert(!_bounds.IsEmpty); 1398Debug.Assert(_brushList != null && _bounds.IsEmpty); 1736Debug.Assert(brush.ViewboxUnits == BrushMappingMode.Absolute); 1737Debug.Assert(brush.ViewportUnits == BrushMappingMode.Absolute); 1939Debug.Assert(false, "Unhandled GradientBrush type"); 1992Debug.Assert(g.GradientStops != null); 2047Debug.Assert(g.GradientStops.Count > 0); 2136Debug.Assert(b._brush is SolidColorBrush, "SolidColorBrush expected"); 2137Debug.Assert(!b._opacityOnly, "OpacityMask not expected"); 2149Debug.Assert(first, "prefix only"); 2377Debug.Assert(bp != null, "Blending visible ImageBrush with another brush should yield non-empty brush"); 2653Debug.Assert(brush != null, "null brush"); 2696Debug.Assert(gb.MappingMode == BrushMappingMode.Absolute, "absolute brush"); 2704Debug.Assert(tb.ViewportUnits == BrushMappingMode.Absolute, "absolute brush required for BrushProxy"); 2894Debug.Assert(false, "Unhandled GradientBrush type"); 2919Debug.Assert(false, "Unandled Brush type"); 2949Debug.Assert(gsc != null && gsc.Count > 0, "BrushProxy.IsEmpty should return true upon GradientBrush with zero stops"); 2989Debug.Assert(!bounds.IsEmpty, "Bounds must not be empty for BitmapCacheBrush"); 3067Debug.Assert(!bounds.IsEmpty, "Bounds must not be empty for VisualBrush"); 3205Debug.Assert(false, "Unhandled ImageBrush.ImageSource type"); 3260Debug.Assert(brushB.Brush != null, "null brush not expected"); 3348Debug.Assert(false, "Brush type not expected"); 3373Debug.Assert(Utility.NormalizeOpacity(value) == value, "BrushProxy.Opacity must always be normalized"); 3501Debug.Assert(false, "Unexpected brush type"); 3621Debug.Assert(false, "Single brush expected"); 3646Debug.Assert( 3713Debug.Assert(Utility.IsValid(opacity), "Opacity comes from BrushProxy, should be valid"); 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); 4182Debug.Assert(Utility.IsValid(opacity), "Opacity comes from BrushProxy, should be valid"); 4278Debug.Assert(_left <= left); 4279Debug.Assert(_right >= right);
AlphaFlattener\DrawingContext.cs (13)
254Debug.Assert(b != null, "LinearGradientBrush expected"); 377Debug.Assert(b != null, "RadialGradientBrush expected"); 479Debug.Assert(one != null); 498Debug.Assert(one.BrushList.Count == 2, "Only two brushes allowed here"); 551Debug.WriteLine("FillGeometry not implemented " + one + " " + two); 600Debug.Assert(brush != null, "brush expected"); 601Debug.Assert(shape != null, "shape expected"); 602Debug.Assert(!_costing, "in costing mode DrawImage"); 685Debug.Assert(false, "Opacity invalid at BrushProxyDecomposer"); 690Debug.Assert(false, "Opacity invalid at BrushProxyDecomposer"); 695Debug.Assert(brushTrans.IsIdentity, "brushTrans not supported"); 724Debug.Assert(pen == null, "no pen"); 932Debug.Assert(!_costing, "in costing mode DrawyGlyphs");
AlphaFlattener\Flattener.cs (2)
92Debug.Assert(Utility.IsValid(opacity) && Utility.IsValid(tree.Opacity), "Invalid opacity encountered, should've been normalized in conversion to Primitive"); 1177Debug.Assert(false, "Wrong Primitive type");
AlphaFlattener\ImageProxy.cs (4)
63Debug.Assert(image != null); 135Debug.Assert( 177Debug.Assert(opacityBrush.ViewportUnits == BrushMappingMode.Absolute, "TileBrush must have absolute viewport by this point"); 305Debug.Assert(!opacityOnly, "Opaque image OpacityMask should not be blended with brush");
AlphaFlattener\MetroDevice.cs (2)
452Debug.Assert(ticket != null); 496Debug.Assert(ticketXMLString == null);
AlphaFlattener\Optimizer.cs (2)
77Debug.Assert(GetPrimitiveIntersectAction() == PrimitiveIntersectAction.ClipToCluster); 88Debug.Assert(geometry != null, "No geometry available for primitive");
AlphaFlattener\Primitive.cs (10)
266Debug.Assert(Utility.NormalizeOpacity(value) == value, "Opacity should be normalized during tree walking"); 677Debug.Assert(Brush == null, "no brush expected"); 751Debug.Assert(brush.ViewportUnits == BrushMappingMode.Absolute); 1315Debug.Assert((Brush != null) || (Pen != null), "empty primitive"); 1388Debug.Assert(tb.ViewboxUnits == BrushMappingMode.Absolute, "Absolute Viewbox expected"); 1857Debug.Assert(false, "Image over Brush?"); 2027Debug.Assert(false, "GetShapeGeometry on Canvas"); 2033Debug.Assert(false, "Exclude on Canvas"); 2038Debug.Assert(false, "BlendBrush on Canvas"); 2045Debug.Assert(false, "BlendOverImage on Canvas");
AlphaFlattener\PrimitiveRenderer.cs (1)
66Debug.Assert(_brush == null, "no brush");
AlphaFlattener\SegmentTree.cs (1)
57Debug.Assert(count >= 2);
AlphaFlattener\Utility.cs (7)
978Debug.Assert(false, "Unsupported PathSegment"); 1401Debug.Assert( 1614Debug.Assert(false, "Unhandled TileBrush type"); 1685Debug.Assert(IsValidViewbox(viewbox, brush.Stretch != Stretch.None) && 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);
Packaging\XpsManager.cs (2)
1421Debug.Assert(package != null, "package cannot be null"); 1466Debug.Assert(package != null, "package cannot be null");
PrintConfig\PrintSchemaShim.cs (1)
663Debug.Assert(false, "PrintTicketScope enum is out of range");
PrintConfig\PTProvider.cs (1)
605Debug.Assert(resultLength >= 0);
Serialization\DrawingContextFlattener.cs (9)
91Debug.Assert(Utility.IsValid(opacity), "Invalid opacity should clip subtree"); 101Debug.Assert(!BrushProxy.IsEmpty(opacityMask), "empty opacity mask should not result in Push"); 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\Manager\MetroSerializationManager.cs (1)
854Debug.Assert(propertyInfo.PropertyType == dependencyProperty.PropertyType,
Serialization\VisualSerializer.cs (8)
265Debug.Assert(!BrushProxy.IsEmpty(brush), "Should not be serializing empty brush"); 395Debug.Assert(pos >= 0, "Missing offset"); 828Debug.Assert(false, "Brush not supported"); 1442Debug.Assert(forFill || forStroke, "Either forFill or forStoke should be true"); 1685Debug.Assert(_nameAttr.Length > 0, "Empty _nameAttr"); 2014Debug.Assert(Utility.IsScaleTranslate(bitmapToDrawingTransform)); 2354Debug.Assert(nameAttr == null || nameAttr.Length > 0, "Bad name attribute"); 2389Debug.Assert(_nameAttr == null, "Empty");
Serialization\VisualTreeFlattener.cs (3)
370Debug.Assert(treeWalkProgress != null); 385Debug.Assert(treeWalkProgress != null); 656Debug.Assert(_visualDepth >= 0, "StartVisual/EndVisual mismatch");
SignalRSamples (3)
Hubs\UploadHub.cs (3)
28Debug.WriteLine($"received: {item}"); 54Debug.WriteLine($"got score {item}"); 73Debug.WriteLine($"Echoing '{item}'.");
System (1)
src\libraries\shims\System\ref\System.cs (1)
484[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.Debug))]
System.Collections (80)
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 (3)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 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\LinkedList.cs (4)
389Debug.Assert(head == null && count == 0, "LinkedList must be empty when this method is called!"); 399Debug.Assert(node.list == this, "Deleting the node from another list!"); 400Debug.Assert(head != null, "This method shouldn't be called on empty list!"); 403Debug.Assert(count == 1 && head == node, "this should only be true for a list with only one node");
System\Collections\Generic\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 (35)
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); 1724Debug.Fail($"{nameof(rotation)}: {rotation} is not a defined {nameof(TreeRotation)} value."); 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 (91)
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (3)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
System\Collections\Concurrent\BlockingCollection.cs (15)
212Debug.Assert(boundedCapacity > 0 || boundedCapacity == NON_BOUNDED); 226Debug.Assert(boundedCapacity > 0); 257Debug.Assert(tryAddReturnValue, "TryAdd() was expected to return true."); 287Debug.Assert(tryAddReturnValue, "TryAdd() was expected to return true."); 458Debug.Assert((observedAdders + 1) <= (~COMPLETE_ADDING_ON_MASK), "The number of concurrent adders thread exceeded the maximum limit."); 492Debug.Assert((_currentAdders & ~COMPLETE_ADDING_ON_MASK) > 0); 711Debug.Assert(_boundedCapacity != NON_BOUNDED); 767Debug.Assert(tryAddAnyReturnValue >= 0 && tryAddAnyReturnValue < collections.Length, 809Debug.Assert(tryAddAnyReturnValue >= 0 && tryAddAnyReturnValue < collections.Length, 998Debug.Assert((index == WaitHandle.WaitTimeout) || (index >= 0 && index < handles.Count)); 1033Debug.Assert(result); 1050Debug.Assert(collections != null); 1097Debug.Assert(originalWaitMillisecondsTimeout != Timeout.Infinite); 1168Debug.Assert(returnValue >= 0 && returnValue < collections.Length, 1396Debug.Assert((index == WaitHandle.WaitTimeout) || (index >= 0 && index < handles.Count));
System\Collections\Concurrent\ConcurrentBag.cs (23)
149Debug.Assert(Monitor.IsEntered(GlobalQueuesLock)); 304Debug.Assert(copied == count); 321Debug.Assert(Monitor.IsEntered(GlobalQueuesLock)); 392Debug.Assert(copied == count); 521Debug.Assert(count >= 0); 605Debug.Assert(_locals != null); 617Debug.Assert(!Monitor.IsEntered(GlobalQueuesLock)); 644Debug.Assert(Monitor.IsEntered(GlobalQueuesLock) == lockTaken); 724Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 739Debug.Assert(_tailIndex == tail, "No other thread should be changing _tailIndex"); 750Debug.Assert(_headIndex - _tailIndex <= 0); 844Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 861Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 936Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 1027Debug.Assert(Monitor.IsEntered(this)); 1028Debug.Assert(_frozen); 1029Debug.Assert(array != null); 1030Debug.Assert(arrayIndex >= 0 && arrayIndex <= array.Length); 1034Debug.Assert( 1039Debug.Assert(arrayIndex <= array.Length - count); 1060Debug.Assert(Monitor.IsEntered(this)); 1064Debug.Assert(count >= 0, $"Expected _addTakeCount ({addTakeCount}) >= _stealCount ({stealCount})."); 1095Debug.Assert(array != null);
System\Collections\Concurrent\ConcurrentDictionary.cs (23)
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); 769Debug.Assert(index < int.MaxValue, "This method should only be called when there's no overflow risk"); 784Debug.Assert(index < int.MaxValue, "This method should only be called when there's no overflow risk"); 799Debug.Assert(index < int.MaxValue, "This method should only be called when there's no overflow risk"); 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 (27)
418Debug.Assert(_currentChunkSize == null); 423Debug.Assert(_currentChunkSize != null); 437Debug.Assert(_localOffset.Value == _currentChunkSize.Value - 1 || _currentChunkSize.Value == 0); 458Debug.Assert(requestedChunkSize > 0 && requestedChunkSize <= _maxChunkSize); 462Debug.Assert(_currentChunkSize.Value <= requestedChunkSize && _currentChunkSize.Value > 0); 694Debug.Assert(_useSingleChunking, "Expected _useSingleChecking to be true"); 695Debug.Assert(requestedChunkSize == 1, $"Got requested chunk size of {requestedChunkSize} when single-chunking was on"); 696Debug.Assert(actualNumElementsGrabbed == 0, $"Expected actualNumElementsGrabbed == 0, instead it is {actualNumElementsGrabbed}"); 697Debug.Assert(destArray.Length == 1, $"Expected destArray to be of length 1, instead its length is {destArray.Length}"); 743Debug.Assert(requestedChunkSize > 0); 744Debug.Assert(!_useSingleChunking, "Did not expect to be in single-chunking mode"); 782Debug.Assert(_sharedIndex != null); //already been allocated in MoveNext() before calling GrabNextChunk 913Debug.Assert(requestedChunkSize > 0); 950Debug.Assert(_localList != null); 951Debug.Assert(_localOffset!.Value >= 0 && _localOffset.Value < _currentChunkSize.Value); 1084Debug.Assert(requestedChunkSize > 0); 1088Debug.Assert(_sharedIndex != null); 1130Debug.Assert(_sharedIndex != null); 1221Debug.Assert(_localOffset!.Value >= 0 && _localOffset.Value < _currentChunkSize.Value); 1305Debug.Assert(_localOffset!.Value >= 0 && _localOffset.Value < _currentChunkSize.Value); 1488Debug.Assert(list != null); 1514Debug.Assert(startIndex >= 0 && endIndex <= list.Count - 1); 1528Debug.Assert(_offset >= _startIndex && _offset <= _endIndex); 1546Debug.Assert(array != null); 1571Debug.Assert(startIndex >= 0 && endIndex <= array.Length - 1); 1585Debug.Assert(_offset >= _startIndex && _offset <= _endIndex); 1659Debug.Assert((DEFAULT_BYTES_PER_CHUNK % IntPtr.Size) == 0, "bytes per chunk should be a multiple of pointer size");
System.Collections.Immutable (172)
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (3)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
System\Collections\Frozen\FrozenDictionary.cs (6)
107Debug.Assert(newDictionary is not null); 108Debug.Assert(newDictionary.Comparer.Equals(comparer)); 116Debug.Assert(source.Count > 0, "Empty sources should have been filtered out by caller"); 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 (4)
55Debug.Assert(newSet is not null); 56Debug.Assert(newSet.Comparer.Equals(comparer)); 62Debug.Assert(source.Count > 0, "Empty sources should have been filtered out by caller"); 119Debug.Assert(minLength >= 0 && maxLength >= minLength);
System\Collections\Frozen\FrozenSetInternalBase.cs (7)
33Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used."); 60Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used."); 87Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used."); 103Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used."); 131Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used."); 147Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used."); 192Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used.");
System\Collections\Frozen\Int32\Int32FrozenDictionary.cs (2)
23Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<int>.Default)); 24Debug.Assert(source.Count != 0);
System\Collections\Frozen\Int32\Int32FrozenSet.cs (2)
21Debug.Assert(source.Count != 0); 22Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<int>.Default));
System\Collections\Frozen\ItemsFrozenSet.cs (1)
19Debug.Assert(source.Count != 0);
System\Collections\Frozen\KeysAndValuesFrozenDictionary.cs (1)
20Debug.Assert(source.Count != 0);
System\Collections\Frozen\SmallFrozenDictionary.cs (1)
26Debug.Assert(source.Count != 0);
System\Collections\Frozen\SmallValueTypeComparableFrozenDictionary.cs (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.NonGeneric (1)
System\Collections\SortedList.cs (1)
219Debug.Assert(_size == 0, "Size is not zero");
System.Collections.Specialized (14)
System\Collections\Specialized\HybridDictionary.cs (3)
101Debug.Assert(hashtable != null); 121Debug.Assert(list != null); 242Debug.Assert(hashtable != null);
System\Collections\Specialized\ListDictionary.cs (1)
256Debug.Assert(last != null);
System\Collections\Specialized\NameValueCollection.cs (2)
118Debug.Assert(list != null); 123Debug.Assert(list != null);
System\Collections\Specialized\OrderedDictionary.cs (8)
59Debug.Assert(dictionary != null); 465Debug.Assert(_arrayEnumerator.Current != null); 485Debug.Assert(_arrayEnumerator.Current != null); 497Debug.Assert(_arrayEnumerator.Current != null); 509Debug.Assert(_arrayEnumerator.Current != null); 563Debug.Assert(o != null); 584Debug.Assert(_objectsTable is not null); 590Debug.Assert(o != null);
System.ComponentModel.Annotations (13)
System\ComponentModel\DataAnnotations\EnumDataTypeAttribute.cs (1)
69Debug.Assert(valueType == value.GetType(), "The valueType should equal the Type of the value");
System\ComponentModel\DataAnnotations\MaxLengthAttribute.cs (1)
119Debug.Assert(value != null);
System\ComponentModel\DataAnnotations\UIHintAttribute.cs (2)
146Debug.Assert(leftParams != null, "leftParams shouldn't be null"); 147Debug.Assert(rightParams != null, "rightParams shouldn't be null");
System\ComponentModel\DataAnnotations\ValidationAttribute.cs (4)
76Debug.Assert(populateErrorMessageResourceAccessor is false, "Use the default constructor instead"); 106Debug.Assert(_defaultErrorMessage is null && _errorMessageResourceName is null && _errorMessage is null && _errorMessageResourceType is null); 264Debug.Assert(_errorMessageResourceType != null); 265Debug.Assert(!string.IsNullOrEmpty(_errorMessageResourceName));
System\ComponentModel\DataAnnotations\ValidationAttributeStore.cs (2)
120Debug.Assert(type != null); 271Debug.Assert(propertyType != null);
System\ComponentModel\DataAnnotations\Validator.cs (3)
338Debug.Assert(validationContext != null); 408Debug.Assert(instance != null); 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.EventBasedAsync (1)
System\ComponentModel\BackgroundWorker.cs (1)
167Debug.Assert(_asyncOperation != null, "_asyncOperation not initialized");
System.ComponentModel.TypeConverter (138)
src\libraries\Common\src\System\Drawing\ColorConverterCommon.cs (2)
14Debug.Assert(culture != null); 105Debug.Assert(culture != null);
System\ComponentModel\AmbientValueAttribute.cs (1)
32Debug.Assert(IDesignerHost.IsSupported, "Runtime instantiation of this attribute is not allowed with trimming.");
System\ComponentModel\BindingList.cs (1)
519Debug.Assert(_itemTypeProperties != null);
System\ComponentModel\CultureInfoConverter.cs (4)
184Debug.Assert(invariantIndex >= 0 && invariantIndex < installedCultures.Length); 195Debug.Assert(array[0] == null); 232Debug.Assert(cultureConverter != null); 551Debug.Assert(result.Count == Count);
System\ComponentModel\DecimalConverter.cs (1)
49Debug.Assert(ctor != null, "Expected constructor to exist.");
System\ComponentModel\Design\DesigntimeLicenseContext.cs (1)
52Debug.Assert(fileName != null && fileName.Length > 0, "Cannot get local path, fileName is not valid");
System\ComponentModel\Design\DesigntimeLicenseContextSerializer.cs (3)
93Debug.Assert(_stream.Position != 0, "Expected the first byte to be read first"); 96Debug.Assert(_readFirstByte); 174Debug.Assert(binaryWriterIdentifier == BinaryWriterMagic, $"Expected the first byte to be {BinaryWriterMagic}");
System\ComponentModel\Design\PropertyTabAttribute.cs (1)
102Debug.Assert(_tabClassNames != null);
System\ComponentModel\Design\Serialization\MemberRelationshipService.cs (3)
49Debug.Assert(source.Member != null); 62Debug.Assert(source.Member != null); 151Debug.Assert(o is RelationshipEntry, "This is only called indirectly from a dictionary only containing RelationshipEntry structs.");
System\ComponentModel\EventDescriptorCollection.cs (3)
349Debug.Assert(foundCount == eventCount, "We did not completely fill our event array"); 421Debug.Assert(count == 0 || array != null, "if array is null, count should be 0"); 422Debug.Assert(array == null || count <= array.Length, "Trying to enumerate more than the array contains");
System\ComponentModel\ExtendedPropertyDescriptor.cs (5)
25Debug.Assert(extenderInfo != null, "ExtendedPropertyDescriptor must have extenderInfo"); 26Debug.Assert(provider != null, "ExtendedPropertyDescriptor must have provider"); 47Debug.Assert(extender != null, "The original PropertyDescriptor must be non-null"); 51Debug.Assert(attr != null, "The original PropertyDescriptor does not have an ExtenderProvidedPropertyAttribute"); 56Debug.Assert(reflectDesc != null, "The original PropertyDescriptor has an invalid ExtenderProperty");
System\ComponentModel\ExtenderProvidedPropertyAttribute.cs (4)
69Debug.Assert(other.Provider == null); 70Debug.Assert(other.ReceiverType == null); 71Debug.Assert(Provider == null); 72Debug.Assert(ReceiverType == null);
System\ComponentModel\GuidConverter.cs (1)
61Debug.Assert(ctor != null, "Expected constructor to exist.");
System\ComponentModel\Int128Converter.cs (2)
25Debug.Assert(radix == 16); 26Debug.Assert(value is not null);
System\ComponentModel\InterlockedBitVector32.cs (1)
43Debug.Assert(previous != unchecked((int)0x80000000));
System\ComponentModel\LicenseManager.cs (3)
196Debug.Assert(providerType != null, "Type cannot ever be null"); 205Debug.Assert(type != null, "IsValid Type cannot ever be null"); 216Debug.Assert(type != null, "IsValid Type cannot ever be null");
System\ComponentModel\LicFileLicenseProvider.cs (2)
52Debug.Assert(context != null, "No context provided!"); 84Debug.WriteLine($"Looking for license in: {licenseFile}");
System\ComponentModel\MaskedTextProvider.cs (15)
635Debug.Assert(AssignedEditPositionCount >= 0, "Invalid count of assigned chars."); 647Debug.Assert(AssignedEditPositionCount >= 0, "Invalid count of assigned chars."); 1266Debug.Assert(input != null && position >= 0 && position < _testString.Length, "input param out of range."); 1554Debug.Assert(startPosition >= 0 && startPosition <= endPosition && endPosition < _testString.Length, "Out of range input value."); 1946Debug.Assert(AssignedEditPositionCount >= 0, "Invalid count of assigned chars."); 1956Debug.Assert(startPosition >= 0 && endPosition >= 0 && endPosition >= startPosition && endPosition < _testString.Length, "position out of range."); 2025Debug.Assert(position >= 0 && position < _testString.Length, "Position out of range."); 2037Debug.Assert(position >= 0 && position < _testString.Length, "Position out of range."); 2038Debug.Assert(charDescriptor != null, "Null character descriptor."); 2051Debug.Assert(!IsLiteralPosition(charDex), "Setting char in literal position."); 2084Debug.Assert(AssignedEditPositionCount <= EditPositionCount, "Invalid count of assigned chars."); 2162Debug.Assert(position >= 0 && position < _testString.Length, "Position out of range."); 2324Debug.Fail("Invalid mask language character."); 2420Debug.Assert(input != null, "null input."); 2421Debug.Assert(position >= 0, "Position out of range.");
System\ComponentModel\NullableConverter.cs (1)
111Debug.Assert(ci != null, "Couldn't find constructor");
System\ComponentModel\PropertyDescriptorCollection.cs (1)
367Debug.Assert(foundCount == propCount, "We did not completely fill our property array");
System\ComponentModel\ReflectEventDescriptor.cs (10)
89Debug.Assert(type.IsSubclassOf(typeof(Delegate)), $"Not a valid ReflectEvent: {componentClass.FullName}. {name} {type.FullName}"); 99Debug.Assert(eventInfo.ReflectedType!.IsAssignableFrom(componentClass), "eventInfo.ReflectedType is used below, but only componentClass is annotated with DynamicallyAccessedMembers. Ensure ReflectedType is in componentClass's hierarchy."); 236Debug.Assert(_componentClass != null, "Must have a component class for FilterAttributes"); 243Debug.Assert(_removeMethod != null, $"Null remove method for {Name}"); 246Debug.Assert(_addMethod != null, $"Null remove method for {Name}"); 262Debug.Assert(currentReflectType != null, "currentReflectType cannot be null"); 263Debug.Assert(currentReflectType.IsAssignableFrom(_componentClass), "currentReflectType must be in _componentClass's hierarchy"); 368Debug.Fail($"Missing event accessors for {_componentClass.FullName}. {Name}"); 383Debug.Assert(currentReflectType != null, "currentReflectType cannot be null"); 384Debug.Assert(currentReflectType.IsAssignableFrom(_componentClass), "currentReflectType must be in _componentClass's hierarchy");
System\ComponentModel\ReflectPropertyDescriptor.cs (11)
88Debug.WriteLine($"Creating ReflectPropertyDescriptor for {componentClass?.FullName}.{name}"); 94Debug.WriteLine($"type == null, name == {name}"); 99Debug.WriteLine($"componentClass == null, name == {name}"); 107Debug.Fail($"Property '{name}' on component {componentClass?.FullName} failed to init."); 108Debug.Fail(t.ToString()); 751Debug.Assert(_componentClass != null, "Must have a component class for FillAttributes"); 903Debug.WriteLine($"[{Name}]: GetValue({component?.GetType().Name ?? "(null)"})"); 907Debug.WriteLine($"[{Name}]: ---> returning: null"); 911Debug.Assert(component != null, "GetValue must be given a component"); 943Debug.WriteLine("[" + Name + "]: ---> returning: null"); 1080Debug.WriteLine($"[{Name}]: SetValue({component?.GetType().Name ?? "(null)"}, {value?.GetType().Name ?? "(null)"})");
System\ComponentModel\ReflectTypeDescriptionProvider.cs (17)
225Debug.Assert(table != null, "COMPAT: Editor table should not be null"); // don't throw; RTM didn't so we can't do it either. 246Debug.Assert(objectType != null, "Should have arg-checked before coming in here"); 613Debug.Assert(eppa != null, $"Extender property {prop.Name} has no provider attribute. We will skip it."); 771Debug.Assert(idx < extenderCount, "There are more extenders than we expect"); 776Debug.Assert(idx == extenderCount, "Wrong number of extenders"); 787Debug.Assert(idx < extenderCount, "There are more extenders than we expect"); 792Debug.Assert(idx == extenderCount, "Wrong number of extenders"); 826Debug.Fail("This should never be invoked. TypeDescriptionNode should wrap for us."); 832Debug.Fail("This should never be invoked. TypeDescriptionNode should wrap for us."); 920Debug.Assert(objectType != null, "Should have arg-checked before coming in here"); 935Debug.Assert(td != null); 943Debug.Assert(td != null); 1055Debug.Fail("This should never be invoked. TypeDescriptionNode should wrap for us."); 1208Debug.Fail("Hey, assumption holds true. Rip this assert."); 1228Debug.Assert(dbgEvent != null, $"Holes in event array for type {type}"); 1425Debug.Assert(Array.TrueForAll(properties, dbgProp => dbgProp is not null), $"Holes in property array for type {type}"); 1611Debug.Assert(callingType != typeof(Uri) && callingType != typeof(CultureInfo));
System\ComponentModel\ReflectTypeDescriptionProvider.ReflectedTypeData.cs (2)
232Debug.Assert(_converter != null, "There is no intrinsic setup in the hashtable for the Object type"); 376Debug.Fail($"Editor {editor.GetType().FullName} is not an instance of {editorBaseType.FullName} but it is in that base types table.");
System\ComponentModel\TypeDescriptor.cs (36)
676Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here"); 702Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here"); 841Debug.Assert(converter != null, "Unexpected null TypeConverter."); 851Debug.Assert(converter != null, "Unexpected null TypeConverter."); 893Debug.Fail("COMPAT: Returning null, but you should not pass null here"); 915Debug.Fail("COMPAT: Returning null, but you should not pass null here"); 931Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here"); 953Debug.Fail("COMPAT: Returning null, but you should not pass null here"); 1091Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here"); 1118Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here"); 1177Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here"); 1328Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here"); 1355Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here"); 1434Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here"); 1644Debug.Assert(type != null, "Caller should validate"); 1732Debug.Assert(instance != null, "Caller should validate"); 1831Debug.Assert(target.Next == null, "Delegating provider should always be the last provider in the chain."); 1871Debug.Assert(pipelineType != PIPELINE_ATTRIBUTES, "PipelineAttributeFilter is not supported for attributes"); 1924Debug.Fail("unknown pipeline type"); 1961Debug.Assert(cache == null || list == null || !cache.Contains(s_pipelineFilterKeys[pipelineType]), "Earlier pipeline stage should have removed our cache"); 2019Debug.Assert(suffix != null, "Name collision with non-extender property."); 2051Debug.Fail("unknown pipeline type"); 2122Debug.Fail("unknown pipeline type"); 2263Debug.Fail("unknown pipeline type"); 2303Debug.Fail("COMPAT: Returning, but you should not pass null here"); 2390Debug.Fail("COMPAT: Returning, but you should not pass null here"); 2456Debug.Fail("COMPAT: Returning, but you should not pass null here"); 2518Debug.Fail("COMPAT: Returning, but you should not pass null here"); 2922Debug.Assert(newAttrs[idx] != null, "_attributes contains a null member"); 3089Debug.Assert(attrs != null, "Someone should have handled this"); 3100Debug.Assert(className != null, "Someone should have handled this"); 3120Debug.Assert(converter != null, "Someone should have handled this"); 3162Debug.Assert(events != null, "Someone should have handled this"); 3174Debug.Assert(events != null, "Someone should have handled this"); 3186Debug.Assert(properties != null, "Someone should have handled this"); 3200Debug.Assert(properties != null, "Someone should have handled this");
System\ComponentModel\UInt128Converter.cs (2)
25Debug.Assert(radix == 16); 26Debug.Assert(value is not null);
System\ComponentModel\UriTypeConverter.cs (1)
74Debug.Assert(ctor != null, "Couldn't find constructor");
System\ComponentModel\VersionConverter.cs (1)
75Debug.Assert(ctor != null, "Couldn't find constructor");
System\Drawing\ColorConverter.cs (1)
125Debug.Assert(member != null, "Could not convert color to member. Did someone change method name / signature and not update ColorConverter?");
System\Timers\Timer.cs (1)
155Debug.Assert(_timer != null, $"{nameof(_timer)} was expected not to be null");
System\Timers\TimersDescriptionAttribute.cs (1)
36Debug.Fail($"Unexpected resource {id}");
System.Composition.Hosting (11)
System\Composition\Hosting\CompositionHost.cs (1)
27Debug.Assert(rootLifetimeContext != null);
System\Composition\Hosting\Core\CompositionDependency.cs (1)
166Debug.Assert(IsError, "Should be in error state.");
System\Composition\Hosting\Core\CompositionOperation.cs (1)
86Debug.Assert(sharingLock != null, "Expected a sharing lock to be passed.");
System\Composition\Hosting\Core\CycleBreakingExportDescriptor.cs (2)
45Debug.WriteLine(SR.Diagnostic_ThrowingException, ex.ToString()); 49Debug.WriteLine("[System.Composition] Activating via cycle-breaking proxy.");
System\Composition\Hosting\Core\CycleBreakingMetadataDictionary.cs (1)
25Debug.WriteLine(SR.Diagnostic_ThrowingException, ex.ToString());
System\Composition\Hosting\Core\ExportDescriptorRegistry.cs (1)
51Debug.WriteLine(SR.Diagnostic_ThrowingException, ex.ToString());
System\Composition\Hosting\Core\ExportDescriptorRegistryUpdate.cs (2)
64Debug.WriteLine(SR.Diagnostic_ThrowingException, ex.ToString()); 102Debug.WriteLine(SR.Diagnostic_ThrowingException, ex.ToString());
System\Composition\Hosting\Core\LifetimeContext.cs (1)
96Debug.WriteLine(SR.Diagnostic_ThrowingException, ex.ToString());
System\Composition\Hosting\Providers\Metadata\MetadataViewProvider.cs (1)
88Debug.WriteLine(SR.Diagnostic_ThrowingException, ex.ToString());
System.Composition.Runtime (2)
System\Composition\Runtime\Util\Formatters.cs (2)
24Debug.Assert(closedGenericType != null); 25Debug.Assert(closedGenericType.IsConstructedGenericType);
System.Console (49)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
13Debug.Assert(errorInfo.Error != Error.SUCCESS); 14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
69Debug.Assert(passwd.Name != null);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0); 298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (1)
101Debug.Assert(passwd.HomeDirectory != null);
System\Console.cs (3)
198Debug.Assert(!Monitor.IsEntered(s_syncObject)); 603Debug.Assert(s_sigQuitRegistration is null); 999Debug.Assert(ctx.Signal == PosixSignal.SIGINT || ctx.Signal == PosixSignal.SIGQUIT);
System\ConsolePal.Unix.ConsoleStream.cs (2)
27Debug.Assert(handle != null, "Expected non-null console handle"); 28Debug.Assert(!handle.IsInvalid, "Expected valid console handle");
System\ConsolePal.Unix.cs (12)
256Debug.Assert(left >= 0); 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'); 618Debug.Assert(foundByteDstPos < foundByteDst.Length, "Should only be called when there's room for at least one byte."); 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\TerminalFormatStrings.cs (1)
92Debug.WriteLineIf(db.GetString(TermInfo.WellKnownStrings.CursorPositionReport) != CursorPositionReport,
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 (1046)
src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (3)
40Debug.Assert(ADP.IsCatchableExceptionType(e), "Invalid exception type, should have been re-thrown!"); 243Debug.Assert(e != null, "Unexpected null exception!"); 263Debug.Assert(e != null, "Unexpected null exception!");
src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (12)
422Debug.Assert(((0 < keyname.Length) && (';' != keyname[0]) && !char.IsWhiteSpace(keyname[0]) && (-1 == keyname.IndexOf('\u0000'))) == compValue, "IsValueValid mismatch with regex"); 438Debug.Assert(KeyIndex == parser.GroupNumberFromName("key"), "wrong key index"); 439Debug.Assert(ValueIndex == parser.GroupNumberFromName("value"), "wrong value index"); 504Debug.Assert(parsetableContainsKey, $"{nameof(ParseInternal)} code vs. regex mismatch keyname <{keyname}>"); 505Debug.Assert(value1 == value2, $"{nameof(ParseInternal)} code vs. regex mismatch keyvalue <{value1}> <{value2}>"); 530Debug.Assert(isEquivalent, $"ParseInternal code vs regex message mismatch: <{msg1}> <{msg2}>"); 534Debug.Fail($"ParseInternal code vs regex throw mismatch {f.Message}"); 540Debug.Fail("ParseInternal code threw exception vs regex mismatch"); 547Debug.Assert(null != connectionString, "null connectionstring"); 569Debug.Assert(IsKeyNameValid(keyname), "ParseFailure, invalid keyname"); 570Debug.Assert(IsValueValidInternal(keyvalue), "parse failure, invalid keyvalue"); 651Debug.Assert(expanded, "password/pwd was not removed");
src\libraries\Common\src\System\Data\Common\NameValuePair.cs (2)
17Debug.Assert(!string.IsNullOrEmpty(name), "empty keyname"); 27Debug.Assert(0 < _length, "NameValuePair zero Length usage");
System\Data\Common\AdapterUtil.Common.cs (21)
27Debug.Assert(e != null, "TraceException: null Exception"); 36Debug.Assert(IsCatchableExceptionType(e), "Invalid exception type, should have been re-thrown!"); 73Debug.Fail("valid AcceptRejectRule " + value.ToString()); 88Debug.Fail("valid CatalogLocation " + value.ToString()); 103Debug.Fail("valid ConflictOption " + value.ToString()); 121Debug.Fail("valid DataRowState " + value.ToString()); 136Debug.Fail("valid KeyRestrictionBehavior " + value.ToString()); 152Debug.Fail("valid LoadOption " + value.ToString()); 168Debug.Fail("valid MissingMappingAction " + value.ToString()); 185Debug.Fail("valid MissingSchemaAction " + value.ToString()); 201Debug.Fail("valid Rule " + value.ToString()); 216Debug.Fail("valid SchemaType " + value.ToString()); 234Debug.Fail("valid StatementType " + value.ToString()); 251Debug.Fail("valid UpdateStatus " + value.ToString()); 460Debug.Fail("shouldn't be here"); 495Debug.Fail("shouldn't be here"); 498Debug.Fail("isRowUpdatingCommand should have been true"); 592Debug.Fail("should be here"); 628Debug.Fail("isRowUpdatingCommand should have been true"); 728Debug.Assert(0 == (rowStates & dataRow.RowState), "flagged RowState"); 753Debug.Assert(0 == (rowStates & dataRow.RowState), "flagged RowState");
System\Data\Common\BigIntegerStorage.cs (3)
44Debug.Assert(0 <= recordNo, "Invalid record"); 45Debug.Assert(null != value, "null value"); 129Debug.Assert(null != value, "null value");
System\Data\Common\BooleanStorage.cs (3)
95Debug.Assert(0 <= recordNo, "Invalid record"); 96Debug.Assert(null != value, "null value"); 149System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\ByteStorage.cs (3)
167Debug.Assert(0 <= recordNo, "Invalid record"); 168System.Diagnostics.Debug.Assert(null != value, "null value"); 221System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\CharStorage.cs (3)
94Debug.Assert(0 <= recordNo, "Invalid record"); 95System.Diagnostics.Debug.Assert(null != value, "null value"); 148System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\DataAdapter.cs (2)
37Debug.Assert(readerHandler.FieldCount > 0, "Scenario expects non-empty results but no fields reported by reader"); 449Debug.Assert(null != dataTables[i], "null DataTable Fill");
System\Data\Common\DataColumnMapping.cs (3)
91Debug.Assert(null != columns, "GetDataColumnBySchemaAction: unexpected null DataColumnCollection"); 97Debug.Assert(null != dataColumn, "GetDataColumnBySchemaAction: unexpected null dataColumn"); 117Debug.Assert(dataTable != null, "Should not call with a null DataTable");
System\Data\Common\DataColumnMappingCollection.cs (2)
350Debug.Assert((null != _items) && (0 <= index) && (index < Count), "RemoveIndex, invalid"); 381Debug.Assert((null != _items) && (0 <= index) && (index < Count), "RemoveIndex, invalid");
System\Data\Common\DataRecordInternal.cs (2)
21Debug.Assert(null != schemaInfo, "invalid attempt to instantiate DataRecordInternal with null schema information"); 22Debug.Assert(null != values, "invalid attempt to instantiate DataRecordInternal with null value[]");
System\Data\Common\DataStorage.cs (14)
142Debug.Assert(storageType == GetStorageType(type), "Incorrect storage type specified"); 239Debug.Fail("not a String or SqlString column"); 293Debug.Assert(typeCode == GetStorageType(dataType), "Incorrect storage type specified"); 353Debug.Fail("shouldn't be here"); 377Debug.Assert(storageType != StorageType.Empty); 461Debug.Assert(result == dataType.IsValueType, "typeCode mismatches dataType"); 474Debug.Assert(typeCode == GetStorageType(dataType), "typeCode mismatches dataType"); 501Debug.Assert(nullable == typeof(INullable).IsAssignableFrom(dataType), "INullable"); 502Debug.Assert(changeTracking == typeof(System.ComponentModel.IChangeTracking).IsAssignableFrom(dataType), "IChangeTracking"); 503Debug.Assert(revertibleChangeTracking == typeof(System.ComponentModel.IRevertibleChangeTracking).IsAssignableFrom(dataType), "IRevertibleChangeTracking"); 504Debug.Assert(xmlSerializable == typeof(IXmlSerializable).IsAssignableFrom(dataType), "IXmlSerializable"); 509Debug.Assert(dataType != null, "Type should not be null"); 520Debug.Assert(typeCode == GetStorageType(dataType), "typeCode mismatches dataType"); 591Debug.Assert(null != type, "null type");
System\Data\Common\DataTableMappingCollection.cs (1)
287Debug.Assert((null != _items) && (0 <= index) && (index < Count), "RemoveIndex, invalid");
System\Data\Common\DateTimeOffsetStorage.cs (3)
106System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 107System.Diagnostics.Debug.Assert(null != value, "null value"); 156System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\DateTimeStorage.cs (3)
106System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 107System.Diagnostics.Debug.Assert(null != value, "null value"); 156System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\DBCommandBuilder.cs (13)
201Debug.Assert(_isMutatedName[iMutatedName], $"{_baseParameterNames[iMutatedName]} expected to be a mutated name"); 608Debug.Fail("Rowcount expected to be 1"); 799Debug.Assert(!string.IsNullOrEmpty(_quotedBaseTableName), "no table name"); 820Debug.Assert(!string.IsNullOrEmpty(_quotedBaseTableName), "no table name"); 911Debug.Assert(!string.IsNullOrEmpty(_quotedBaseTableName), "no table name"); 1135Debug.Assert(!string.IsNullOrEmpty(sourceColumn), "empty source column"); 1167Debug.Assert(null != _parameterNames, "How can we have a parameterName without a _parameterNames collection?"); 1168Debug.Assert(null != _parameterMarkerFormat, "How can we have a _parameterNames collection but no _parameterMarkerFormat?"); 1216Debug.Assert(null != _parameterNames, "How can we have a parameterName without a _parameterNames collection?"); 1217Debug.Assert(null != _parameterMarkerFormat, "How can we have a _parameterNames collection but no _parameterMarkerFormat?"); 1402Debug.Assert(null != p, "null CreateParameter"); 1552Debug.Fail("how did we get here?"); 1617Debug.Fail("how did we get here?");
System\Data\Common\DbConnectionOptions.cs (2)
159Debug.Assert(!_useOdbcRules, "ExpandKeyword not ready for Odbc"); 168Debug.Assert(keyname == keyname.ToLowerInvariant(), "missing ToLower");
System\Data\Common\DbConnectionStringBuilder.cs (5)
147Debug.Assert(keyword != null); 251Debug.Assert(null != values[i], $"null value {keylist.Current}"); 444Debug.Assert(reflected != null); 473Debug.Assert(keyword != null); 558Debug.Assert(property != null);
System\Data\Common\DbDataAdapter.cs (25)
775Debug.Assert(DbType.Int32 == parameter.DbType, "unexpected DbType"); 937Debug.Assert(null != tableMapping, "null TableMapping when MissingMappingAction.Error"); 966Debug.Assert((null != dataRows) && (0 < dataRows.Length), "Update: bad dataRows"); 967Debug.Assert(null != tableMapping, "Update: bad DataTableMapping"); 1038Debug.Fail("InvalidDataRowState"); 1366Debug.Assert(rowUpdatedEvent.Rows != null); 1451Debug.Assert(null == rowUpdatedEvent.Errors, "Continue - but contains an exception"); 1462Debug.Assert(null != connection, "unexpected null connection"); 1497Debug.Assert(null != rowUpdatedEvent, "null rowUpdatedEvent"); 1498Debug.Assert(null != dataCommand, "null dataCommand"); 1499Debug.Assert(rowUpdatedEvent.Command == dataCommand, "dataCommand differs from rowUpdatedEvent"); 1560Debug.Fail("unexpected StatementType"); 1585Debug.Assert(null == rowUpdatedEvent.Errors, "Continue - but contains an exception"); 1597Debug.Assert(null != rowUpdatedEvent, "null rowUpdatedEvent"); 1619Debug.Assert(null != batchCommands, "null batchCommands?"); 1638Debug.Assert(null != row, "null dataRow?"); 1654Debug.Assert(null != batchCommands, "null batchCommands?"); 1670Debug.Assert(null != row, "null dataRow?"); 1706Debug.Assert(null != batchCommands, "null batchCommands?"); 1713Debug.Assert(null != row, "null dataRow?"); 1724Debug.Assert(null != dataRow, "null dataRow"); 1771Debug.Assert(null != command, "GetConnection3: null command"); 1772Debug.Assert(!string.IsNullOrEmpty(method), "missing method name"); 1783Debug.Assert(null != command, "GetConnection4: null command"); 1824Debug.Assert(null != connection, "QuietOpen: null connection");
System\Data\Common\DbDataReaderExtensions.cs (1)
80Debug.Assert(row != null);
System\Data\Common\DbDataSource.cs (2)
103Debug.Assert(wrappedCommand.Connection is not null); 362Debug.Assert(wrappedBatch.Connection is not null);
System\Data\Common\DbEnumerator.cs (1)
60Debug.Assert(null != _schemaInfo && null != _descriptors, "unable to build schema information!");
System\Data\Common\DBSchemaRow.cs (3)
33Debug.Assert(null != dataRows, "GetSchemaRows: unexpected null dataRows"); 70Debug.Assert(null != _schemaTable.ColumnName, "no column ColumnName"); 84Debug.Assert(null != _schemaTable.Size, "no column Size");
System\Data\Common\DecimalStorage.cs (3)
172System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 173System.Diagnostics.Debug.Assert(null != value, "null value"); 217System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\DoubleStorage.cs (3)
167System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 168System.Diagnostics.Debug.Assert(null != value, "null value"); 221System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\FieldNameLookup.cs (1)
31Debug.Assert(null != fieldNames[i]);
System\Data\Common\Int16Storage.cs (3)
184System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 185System.Diagnostics.Debug.Assert(null != value, "null value"); 235System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\Int32Storage.cs (3)
183System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 184System.Diagnostics.Debug.Assert(null != value, "null value"); 234System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\Int64Storage.cs (3)
175System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 176System.Diagnostics.Debug.Assert(null != value, "null value"); 226System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\ObjectStorage.cs (3)
235Debug.Assert(null != value, "null value"); 422Debug.Assert(xmlReader is DataTextReader, "Invalid DataTextReader is being passed to customer"); 504Debug.Assert(xmlWriter is DataTextWriter, "Invalid DataTextWriter is being passed to customer");
System\Data\Common\SByteStorage.cs (3)
168System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 169System.Diagnostics.Debug.Assert(null != value, "null value"); 223System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\SingleStorage.cs (3)
168System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 169System.Diagnostics.Debug.Assert(null != value, "null value"); 222System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\SQLConvert.cs (16)
14Debug.Assert(value != null, "null argument in ConvertToSqlByte"); 32Debug.Assert(value != null, "null argument in ConvertToSqlInt16"); 51Debug.Assert(value != null, "null argument in ConvertToSqlInt32"); 74Debug.Assert(value != null, "null argument in ConvertToSqlInt64"); 99Debug.Assert(value != null, "null argument in ConvertToSqlDouble"); 132Debug.Assert(value != null, "null argument in ConvertToSqlDecimal"); 162Debug.Assert(value != null, "null argument in ConvertToSqlSingle"); 193Debug.Assert(value != null, "null argument in ConvertToSqlMoney"); 223Debug.Assert(value != null, "null argument in ConvertToSqlDateTime"); 241Debug.Assert(value != null, "null argument in ConvertToSqlBoolean"); 259Debug.Assert(value != null, "null argument in ConvertToSqlGuid"); 277Debug.Assert(value != null, "null argument in ConvertToSqlBinary"); 295Debug.Assert(value != null, "null argument in ConvertToSqlString"); 313Debug.Assert(value != null, "null argument in ConvertToSqlChars"); 329Debug.Assert(value != null, "null argument in ConvertToSqlBytes"); 561Debug.Assert(value is string || type == typeof(string), "invalid call to ChangeTypeForXML");
System\Data\Common\SQLTypes\SQLBinaryStorage.cs (3)
59Debug.Assert(null != value, "null value"); 116Debug.Assert(!DataStorage.IsObjectNull(value), "we should have null here"); 117Debug.Assert((value.GetType() == typeof(SqlBinary)), "wrong input type");
System\Data\Common\SQLTypes\SQlBooleanStorage.cs (3)
93Debug.Assert(null != value, "null value"); 150Debug.Assert(!DataStorage.IsObjectNull(value), "we should have null here"); 151Debug.Assert((value.GetType() == typeof(SqlBoolean)), "wrong input type");
System\Data\Common\SQLTypes\SQLBytesStorage.cs (2)
114Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 115Debug.Assert((value.GetType() == typeof(SqlBytes)), "wrong input type");
System\Data\Common\SQLTypes\SQLByteStorage.cs (3)
168Debug.Assert(null != value, "null value"); 226Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 227Debug.Assert((value.GetType() == typeof(SqlByte)), "wrong input type");
System\Data\Common\SQLTypes\SQLCharsStorage.cs (2)
117Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 118Debug.Assert((value.GetType() == typeof(SqlChars)), "wrong input type");
System\Data\Common\SQLTypes\SQLDateTimeStorage.cs (3)
95Debug.Assert(null != value, "null value"); 152Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 153Debug.Assert((value.GetType() == typeof(SqlDateTime)), "wrong input type");
System\Data\Common\SQLTypes\SQLDecimalStorage.cs (3)
167Debug.Assert(null != value, "null value"); 224Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 225Debug.Assert((value.GetType() == typeof(SqlDecimal)), "wrong input type");
System\Data\Common\SQLTypes\SQLDoubleStorage.cs (3)
168Debug.Assert(null != value, "null value"); 225Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 226Debug.Assert((value.GetType() == typeof(SqlDouble)), "wrong input type");
System\Data\Common\SQLTypes\SQLGuidStorage.cs (3)
60Debug.Assert(null != value, "null value"); 117Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 118Debug.Assert((value.GetType() == typeof(SqlGuid)), "wrong input type");
System\Data\Common\SQLTypes\SQLInt16Storage.cs (3)
168Debug.Assert(null != value, "null value"); 225Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 226Debug.Assert((value.GetType() == typeof(SqlInt16)), "wrong input type");
System\Data\Common\SQLTypes\SQLInt32Storage.cs (3)
168Debug.Assert(null != value, "null value"); 225Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 226Debug.Assert((value.GetType() == typeof(SqlInt32)), "wrong input type");
System\Data\Common\SQLTypes\SQLInt64Storage.cs (3)
169Debug.Assert(null != value, "null value"); 226Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 227Debug.Assert((value.GetType() == typeof(SqlInt64)), "wrong input type");
System\Data\Common\SQLTypes\SQLMoneyStorage.cs (3)
168Debug.Assert(null != value, "null value"); 225Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 226Debug.Assert((value.GetType() == typeof(SqlMoney)), "wrong input type");
System\Data\Common\SQLTypes\SQLSingleStorage.cs (3)
166Debug.Assert(null != value, "null value"); 223Debug.Assert(!DataStorage.IsObjectNull(value), "we should have null here"); 224Debug.Assert((value.GetType() == typeof(SqlSingle)), "wrong input type");
System\Data\Common\SQLTypes\SQLStringStorage.cs (3)
115Debug.Assert(null != value, "null value"); 178Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 179Debug.Assert((value.GetType() == typeof(SqlString)), "wrong input type");
System\Data\Common\SqlUDTStorage.cs (2)
189Debug.Assert(xmlReader is DataTextReader, "Invalid DataTextReader is being passed to customer"); 224Debug.Assert(xmlWriter is DataTextWriter, "Invalid DataTextWriter is being passed to customer");
System\Data\Common\StringStorage.cs (3)
102Debug.Assert(recordNo != -1, "Invalid (-1) parameter: 'recordNo'"); 103Debug.Assert(null != value, "null value"); 169Debug.Assert(null != value, "null value");
System\Data\Common\TimeSpanStorage.cs (3)
163System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 164System.Diagnostics.Debug.Assert(null != value, "null value"); 241System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\UInt16Storage.cs (3)
183System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 184System.Diagnostics.Debug.Assert(null != value, "null value"); 234System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\UInt32Storage.cs (3)
182System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 183System.Diagnostics.Debug.Assert(null != value, "null value"); 233System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\UInt64Storage.cs (3)
173System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 174System.Diagnostics.Debug.Assert(null != value, "null value"); 224System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\ConstraintCollection.cs (5)
32Debug.Assert(table != null); 284Debug.Assert(constraint != null, "Attempt to add null constraint to constraint array"); 564Debug.Assert(a1 != null && a2 != null, "Invalid Arguments"); 667Debug.Assert(name != null); 795Debug.Assert(constr._parentTableName != null);
System\Data\ConstraintEnumerator.cs (3)
46Debug.Assert(_constraints.Current is Constraint, "ConstraintEnumerator, contains object which is not constraint"); 60Debug.Assert(_currentObject != null, "GetObject should never be called w/ null currentObject."); 78Debug.Assert(CurrentObject != null, "GetObject should never be called w/ null currentObject.");
System\Data\DataColumn.cs (42)
405Debug.Assert(!string.IsNullOrEmpty(_encodedColumnName)); 455Debug.Assert(value != null); 646Debug.Assert(_defaultValue != null, "It should not have been set to null."); 858Debug.Assert(null != _storage, "no storage"); 867Debug.Assert(null != _storage, "no storage"); 876Debug.Assert(null != _storage, "no storage"); 887Debug.Assert(_simpleType.CanHaveMaxLength(), "expected simpleType to be string"); 1027Debug.Assert(2 <= _sortIndex.RefCount, "bad sortIndex refcount"); 1095Debug.Assert(table != null || !Unique); 1130Debug.Assert(null != _storage, "null storage"); 1138Debug.Assert(null != _storage, "no storage"); 1139Debug.Assert(null != value, "setting null, expecting dbnull"); 1141Debug.Assert(null != _table, "storage with no DataTable on column"); 1171Debug.Assert(null != _storage, "no storage"); 1180Debug.Assert(null != value, "setting null, expecting dbnull"); 1181Debug.Assert(null != _table, "storage with no DataTable on column"); 1182Debug.Assert(null != _storage, "no storage"); 1200Debug.Assert(null != _storage, "no storage"); 1239Debug.Assert(oldConstraint != null, "Should have found a column to remove from the collection."); 1254Debug.Assert(_table.Constraints.FindKeyConstraint(this) == null, "Should not be a duplication constraint in collection"); 1376Debug.Assert(IsStringType, "not a String or SqlString column"); 1396Debug.Assert(IsStringType, "not a String or SqlString column"); 1451Debug.Assert(null != _storage, "no storage"); 1471Debug.Assert(null != _storage, "null storage"); 1502Debug.Assert(null != _storage, "null storage"); 1508Debug.Assert(null != _storage, "null storage"); 1514Debug.Assert(null != _storage, "null storage"); 1591Debug.Assert(null != _storage, "no storage"); 1601Debug.Assert(null != _storage, "no storage"); 1636Debug.Assert(null != _storage, "no storage"); 1648Debug.Assert(rels != null, "Invalid ParentRelations"); 1652Debug.Assert(key.HasValue, "Invalid child key (null)"); 1660Debug.Assert(rels != null, "Invalid ChildRelations"); 1664Debug.Assert(key.HasValue, "Invalid parent key (null)"); 1760Debug.Assert(s != null, "Caller is responsible for missing element/attribute case"); 1773Debug.Assert(value != null && (value != DBNull.Value), "Caller is responsible for checking on DBNull"); 1780Debug.Assert(value != null && (value != DBNull.Value), "Caller is responsible for checking on DBNull"); 1791Debug.Assert(null != _storage, "no storage"); 1805Debug.Assert(!_dependentColumns.Contains(expressionColumn), "duplicate column - expected to be unique"); 1821Debug.Assert(_table != null); 1830Debug.Assert(null != col, "null datacolumn in expression dependencies"); 1959Debug.Assert(null != value && DataColumn.IsAutoIncrementType(value.GetType()) && !(value is BigInteger), "unexpected value for autoincrement");
System\Data\DataColumnCollection.cs (3)
548Debug.Assert(col.Computed, "invalid (non an expression) column in the expression dependent columns"); 821Debug.Assert(name != null); 861Debug.Assert(name != null, "Must specify a name");
System\Data\DataError.cs (4)
40Debug.Assert(column != null, "Invalid (null) argument"); 41Debug.Assert(column.Table != null, "Invalid (loose) column"); 88Debug.Assert(column._errors >= 0, "missing error counts"); 98Debug.Assert(_errorList[i]._column._errors >= 0, "missing error counts");
System\Data\DataException.cs (1)
313Debug.Assert(null != e, "TraceException: null Exception");
System\Data\DataKey.cs (2)
147Debug.Fail("don't put DataKey into a Hashtable"); 153Debug.Fail("need to directly call Equals(DataKey)");
System\Data\DataRelation.cs (5)
415Debug.Assert(DataSet == null || !_nested, "this relation supposed to be not in dataset or not nested"); 485Debug.Assert(ChildTable != null, "On a DataSet, but not on Table. Bad state"); 595Debug.Assert(_parentKeyConstraint == null || value == null, "ParentKeyConstraint should not have been set already."); 626Debug.Assert(_childKeyConstraint == null || value == null, "ChildKeyConstraint should not have been set already."); 716Debug.Assert(destination != null);
System\Data\DataRelationCollection.cs (2)
399Debug.Assert(name != null); 628Debug.Assert(relation != null);
System\Data\DataRow.cs (15)
340Debug.Assert(!_inChangingEvent, "how are we in a changing event to cancel?"); 341Debug.Assert(-1 != _tempRecord, "how no propsed record to cancel?"); 357Debug.Assert(!_inChangingEvent, "how are we in a changing event to end?"); 512Debug.Assert(!_inChangingEvent, "how are we in a changing event to cancel?"); 513Debug.Assert(-1 != _tempRecord, "how no propsed record to cancel?"); 530Debug.Assert(!_inChangingEvent, "how are we in a changing event to end?"); 608Debug.Assert(-1 != _tempRecord, "missing temp record"); 609Debug.Assert(0 == _countColumnChange, "unexpected column change count"); 610Debug.Assert(null == _lastChangedColumn, "unexpected last column change"); 626Debug.Assert(-1 == _tempRecord, "unexpected temp record"); 1033Debug.Assert(0 != (DataViewRowState.Added & viewState), "not DataViewRowState.Added"); 1038Debug.Assert(_action == DataRowAction.Rollback || 0 != (DataViewRowState.Deleted & viewState), "not DataViewRowState.Deleted"); 1047Debug.Assert(0 != (DataViewRowState.ModifiedOriginal & viewState), "not DataViewRowState.ModifiedOriginal"); 1352Debug.Assert(relation != null, "The relation should not be null here."); 1447Debug.Assert(valueFromStorage.Equals(column.DataExpression.Evaluate(this, version)),
System\Data\DataRowComparer.cs (5)
96Debug.Assert(!ReferenceEquals(a, b)); 97Debug.Assert(a != null); 98Debug.Assert(b != null); 99Debug.Assert(a.Length == b.Length); 186Debug.Assert(row.Table != null);
System\Data\DataSet.cs (11)
318Debug.Assert(info != null); 868Debug.Assert(null != _culture, "DataSet.Locale: null culture"); 1308Debug.Assert(value && !_rowChanges[index], "setting twice or to false"); 1340Debug.Assert(0 <= bitMatrix[i].HasChanges, "negative change count"); 1352Debug.Assert(bitMatrix[i].HasChanges <= table.Rows.Count, "to many changes"); 1390Debug.Assert(DataRowState.Added == rowState || 2240Debug.Assert(root.NamespaceURI != null, "root.NamespaceURI should not ne null, it should be empty string"); 2471Debug.Assert(reader.NodeType != XmlNodeType.Whitespace, "Should not be on Whitespace node"); 2952Debug.Assert(dataSet != null); 2970Debug.Assert(dataSet != null); 3022Debug.Assert(table != null);
System\Data\DataSetUtil.cs (2)
63Debug.Fail("valid DataRowState " + value.ToString()); 78Debug.Fail("valid LoadOption " + value.ToString());
System\Data\DataTable.cs (75)
275Debug.Assert(ds.RemotingFormat == SerializationFormat.Xml, "RemotingFormat must be SerializationFormat.Xml"); 324Debug.Assert(ds.Tables.Count == 1, "There should be exactly 1 table here"); 450Debug.Assert(Columns.Count == 0, "There is column in Table"); 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); 1404Debug.Assert(null != _culture, "null culture"); 1475Debug.Assert(null != culture, "SetLocaleValue: no locale"); 1564Debug.Assert(nRel.Length == _nestedParentRelations.Length, "nestedParent cache is broken"); 1567Debug.Assert(null != nRel[i], "null relation"); 1568Debug.Assert(null != _nestedParentRelations[i], "null relation"); 1569Debug.Assert(nRel[i] == _nestedParentRelations[i], "unequal relations"); 1631Debug.Assert(2 <= primayKeyConstraint.ConstraintIndex.RefCount, "bad primaryKey index RefCount"); 1725Debug.Assert(_primaryKey == null || Constraints.FindConstraint(_primaryKey) == _primaryKey, "PrimaryKey is not in ConstraintCollection"); 2093Debug.Assert(value != null, "Value should not be null ??"); 2094Debug.Assert(value.ColumnMapping == MappingType.SimpleContent, "should be text node here"); 2138Debug.Assert(ndx != null); 2158Debug.Assert(action == DataRowAction.Delete, "Unexpected SetNewRecord action in merge function."); 2245Debug.Assert(saveIdxRecord == ((saveRowState == DataRowState.Added) ? targetRow._newRecord : targetRow._oldRecord), "oops, you change index record without noticing it"); 2395Debug.Assert(clone != null, "The table passed in has to be newly created empty DataTable."); 2837Debug.Assert(null == _rowDiffId, "wasn't previously cleared"); 3126Debug.Assert(Enum.GetUnderlyingType(typeof(DataRowState)) == typeof(int), "Invalid DataRowState type"); 3368Debug.Assert(key.HasValue); 3551Debug.Assert(e != null, "e should not be null"); 3561Debug.Assert(e != null, "e should not be null"); 3617Debug.Assert((null != e) && ((null != _onRowChangedDelegate) || IsTypedDataTable), "OnRowChanged arguments"); 3630Debug.Assert((null != e) && ((null != _onRowChangingDelegate) || IsTypedDataTable), "OnRowChanging arguments"); 3643Debug.Assert((null != e) && ((null != _onRowDeletingDelegate) || IsTypedDataTable), "OnRowDeleting arguments"); 3656Debug.Assert((null != e) && ((null != _onRowDeletedDelegate) || IsTypedDataTable), "OnRowDeleted arguments"); 3759Debug.Assert(record != -1, "Record number must be given"); 3785Debug.Assert(oldIndex.Length == newIndex.Length, "Size oldIndexes and newIndexes should be the same"); 3786Debug.Assert(oldIndex.Length == _shadowIndexes!.Count, "Size of OldIndexes should be the same as size of Live indexes"); 4060Debug.Assert(null != _indexes, "unexpected null indexes"); 4279Debug.Assert(row != null, "Row can't be null."); 4294Debug.Assert(fireEvent, "SetNewRecord is called with wrong parameter"); 4300Debug.Assert(!row._inChangingEvent, "How can this row be in an infinite loop?"); 4551Debug.Assert(1 <= _shadowCount, "unexpected negative shadow count"); 4563Debug.Assert(0 == _shadowCount, "unexpected count"); 4569Debug.Assert(1 <= _shadowCount, "unexpected negative shadow count"); 4578Debug.Assert(0 < _indexes.Count, "unexpected"); 4601Debug.Assert(null == _loadIndex, "loadIndex should already be null"); 4690Debug.Assert(2 <= _loadIndex.RefCount, "bad loadIndex.RefCount"); 4697Debug.Assert(row != null, "Row can't be null for index record"); 4753Debug.Assert(_loadIndexwithCurrentDeleted != null, "loadIndexwithCurrentDeleted should not be null"); 4764Debug.Assert(_loadIndexwithOriginalAdded != null, "loadIndexwithOriginalAdded should not be null"); 4770Debug.Assert(2 <= indextoUse!.RefCount, "bad indextoUse.RefCount"); 4805Debug.Assert(row != null, "Row can't be null for index record"); 4878Debug.Assert(parentKey != null, "AddForeignKey: Invalid parameter.. related primary key is null"); 5031Debug.Assert(result.Max >= result.Min); 5160Debug.Fail("LoadOption.Upsert with deleted row, should not be here"); 5196Debug.Assert(dataRow._tempRecord == recordNo, "tempRecord has been changed in event handler"); 5512Debug.Assert(tableList != null, "tableList shouldnot be null"); 6550Debug.Assert(DataSet != null); 6771Debug.Assert(_targetTable == null, "do not reuse this section"); 6772Debug.Assert(table != null); 6773Debug.Assert(table._rowDiffId == null, "rowDiffId wasn't previously cleared"); 6775Debug.Assert(t_usedTables == null || !t_usedTables.Contains(table), 6793Debug.Assert(t_usedTables != null && t_usedTables.Contains(_targetTable), "missing Prepare before Cleanup"); 6811Debug.Assert(t_usedTables != null, message); 6822Debug.Assert(_targetDS == null, "do not reuse this section"); 6823Debug.Assert(ds != null); 6835Debug.Assert(!RowDiffIdUsageSection.t_usedTables.Contains(table), "Nested call with same table can cause data corruption!"); 6838Debug.Assert(table._rowDiffId == null, "rowDiffId wasn't previously cleared"); 6850Debug.Assert(RowDiffIdUsageSection.t_usedTables != null, "missing Prepare before Cleanup"); 7015Debug.Assert(column._table != null); 7016Debug.Assert(column.Computed, "Only computed columns should be re-evaluated.");
System\Data\DataTableCollection.cs (2)
618Debug.Assert(_list.Count == tableList.Count, "Both lists should have equal numbers of tables"); 737Debug.Assert(name != null);
System\Data\DataTableExtensions.cs (1)
218Debug.Assert(null != table, "null DataTable");
System\Data\DataView.cs (24)
275Debug.Assert(_rowViewCache.Count == CountFromIndex, "DataView.Count mismatch"); 360Debug.Assert(null != predicate, "null predicate"); 367Debug.Assert(DataRowVersion.Default != version, "not expecting Default"); 368Debug.Assert(DataRowVersion.Proposed != version, "not expecting Proposed"); 549Debug.Assert(null == _addNewRow, "AddNew addNewRow is not null"); 784Debug.Assert(null != _addNewRow, "null addNewRow"); 808Debug.Assert(flag, "didn't remove addNewRow"); 1099Debug.Assert(property != null, "property is null"); 1291Debug.Assert(null != row, "MaintainDataView.ItemAdded with null DataRow"); 1298Debug.Assert(flag, "row actually removed"); 1305Debug.Assert(0 <= index, "ItemAdded was actually deleted"); 1316Debug.Fail("ItemAdded DataRow already in view"); 1320Debug.Assert(null != row, "MaintainDataView.ItemDeleted with null DataRow"); 1321Debug.Assert(row != _addNewRow, "addNewRow being deleted"); 1333Debug.Fail("ItemDeleted DataRow not in view tracking"); 1338Debug.Fail("ItemDeleted DataRow not in view"); 1342Debug.Assert(null == row, "MaintainDataView.Reset with non-null DataRow"); 1351Debug.Fail("unexpected"); 1376Debug.Assert(((ListChangedType.ItemChanged == e.ListChangedType) && ((e.NewIndex == e.OldIndex) || (-1 == e.OldIndex))) || 1380Debug.Assert(0 <= e.NewIndex, "negative NewIndex"); 1471Debug.Assert(null != drv, "didn't contain addNewRow"); 1474Debug.Assert(rvc.Count == CountFromIndex, "didn't add expected count"); 1535Debug.Assert((0 == (DataViewRowState.ModifiedCurrent & newRowStates)) || 1552Debug.Assert(null == _comparison, "RelatedView should not have a comparison function");
System\Data\DataViewListener.cs (2)
96Debug.Assert(null == _table, "DataViewListener already registered table"); 152Debug.Assert(null == _index, "DataviewListener already registered index");
System\Data\EnumerableRowCollection.cs (3)
76Debug.Assert(!isDataViewable || table != null, "isDataViewable bug table is null"); 104Debug.Assert(null != enumerableRows, "null enumerableRows"); 280Debug.Assert(pred != null);
System\Data\EnumerableRowCollectionExtensions.cs (1)
153Debug.Assert(source != null);
System\Data\Filter\AggregateNode.cs (3)
44Debug.Assert(columnName != null, "Invalid parameter column name (null)."); 117Debug.Assert(_column != null, $"Failed to bind column {_columnName}"); 207Debug.Assert(DataRowVersion.Original == version, "wrong version");
System\Data\Filter\BinaryNode.cs (5)
144Debug.Assert(IsConstant()); 1110Debug.Assert((!DataStorage.IsObjectNull(vLeft)) && (!DataStorage.IsObjectNull(vRight)), "Impossible."); 1265Debug.Fail("Invalid (unmapped) precedence " + code.ToString()); 1589Debug.Fail("Unexpected LIKE kind"); 1675Debug.Assert(patchars[length - 1] == '*' || patchars[length - 1] == '%', "Invalid LIKE pattern formed.. ");
System\Data\Filter\ConstNode.cs (1)
62Debug.Fail("NYI");
System\Data\Filter\DataExpression.cs (2)
94Debug.Assert(_parsed, "Invalid calling order: Bind() before Parse()"); 220Debug.Assert(_dependency != null, "GetDependencies: null, we should have created an empty list");
System\Data\Filter\ExpressionParser.cs (34)
294Debug.Assert(_text[_start] == '\'' && _text[_pos - 1] == '\'', "The expression contains an invalid string constant"); 295Debug.Assert(_pos - _start > 1, "The expression contains an invalid string constant"); 301Debug.Assert(_text[_start] == '#' && _text[_pos - 1] == '#', "The expression contains invalid date constant."); 302Debug.Assert(_pos - _start > 2, "The expression contains invalid date constant '{0}'."); 308Debug.Fail("unhandled token"); 322Debug.Assert(_topOperator > 0, "Empty operator stack!!"); 393Debug.Assert(_topOperator > 1, "melformed operator stack."); 403Debug.Assert(opInfo._priority == Operators.PriParen, "melformed operator stack."); 415Debug.Assert(_topNode > 0 && NodePeek()!.GetType() == typeof(FunctionNode), "The function node should be created on '('"); 549Debug.Assert(_topNode == 1 || _topNode == 0, "Invalid Node Stack"); 562Debug.Assert(_token == Tokens.LeftParen, "ParseAggregateArgument(): Invalid argument, token <> '('"); 618Debug.Assert(_topNode > 0, "NodePop(): Corrupted node stack"); 620Debug.Assert(null != node, "null NodePop"); 640Debug.Assert(null != node, "null NodePush"); 658Debug.Assert(pri > Operators.PriStart && pri <= Operators.PriMax, "Invalid priority value"); 664Debug.Assert(_topOperator > 0, "Empty operator stack!!"); 670Debug.Assert(opInfo._priority >= pri, "Invalid prioriry value"); 710Debug.Assert(opInfo._op == Operators.Plus || 719Debug.Assert(nodeLeft != null, "Invalid left operand"); 720Debug.Assert(nodeRight != null, "Invalid right operand"); 751Debug.Assert(nodeLeft == null, "Invalid left operand"); 752Debug.Assert(nodeRight != null, "Invalid right operand"); 763Debug.Fail("Unhandled operator type"); 766Debug.Assert(expr != null, "Failed to create expression"); 992Debug.Assert(_pos != 0, "We have at least one digit in the buffer, ScanNumeric()"); 993Debug.Assert(IsDigit(text[_pos - 1]), "We have at least one digit in the buffer, ScanNumeric(), not a digit"); 1053Debug.Assert(chEnd != '\0', "Invalid bracket value"); 1054Debug.Assert(esc != '\0', "Invalid escape value"); 1072Debug.Assert(text[_pos] == chEnd, "Invalid bracket value"); 1111Debug.Assert(_token == Tokens.Name, "Exprecing an identifier."); 1112Debug.Assert(_pos > _start, "Exprecing an identifier."); 1115Debug.Assert(name != null, "Make sure the arguments for Compare method are OK"); 1125Debug.Assert(s_reservedwords[i]._word != null, "Make sure the arguments for Compare method are OK"); 1145Debug.Assert(_token == Tokens.Name, "Exprecing an identifier.");
System\Data\Filter\FilterException.cs (1)
97Debug.Fail(err);
System\Data\Filter\FunctionNode.cs (23)
123Debug.Assert(_info < s_funcs.Length && _info >= 0, "Invalid function info."); 127Debug.Assert(_argumentCount == s_funcs[_info]._argumentCount || s_funcs[_info]._isVariantArgumentList, "Invalid argument argumentCount."); 198Debug.Assert(_info > -1, "All function nodes should be bound at this point."); // default info is -1, it means if not bounded, it should be -1, not 0!! 258Debug.Assert(_info > -1, "Optimizing unbound function "); // default info is -1, it means if not bounded, it should be -1, not 0!! 321Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}"); 332Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}"); 344Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}"); 348Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}"); 352Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}"); 356Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}"); 360Debug.Assert(_argumentCount == 2, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}"); 362Debug.Assert(argumentValues[0] is string, $"Invalid argument type for {s_funcs[_info]._name}"); 363Debug.Assert(argumentValues[1] is string, $"Invalid argument type for {s_funcs[_info]._name}"); 377Debug.Assert(_argumentCount == 3, $"Invalid argument argumentCount: {_argumentCount.ToString(FormatProvider)}"); 396Debug.Assert(_argumentCount == 2, "Invalid argument argumentCount: "); 404Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}"); 405Debug.Assert((argumentValues[0] is string) || (argumentValues[0] is SqlString), $"Invalid argument type for {s_funcs[_info]._name}"); 423Debug.Assert(_argumentCount == 3, $"Invalid argument argumentCount: {_argumentCount.ToString(FormatProvider)}"); 424Debug.Assert((argumentValues[0] is string) || (argumentValues[0] is SqlString), $"Invalid first argument {argumentValues[0].GetType().FullName} in {s_funcs[_info]._name}"); 425Debug.Assert(argumentValues[1] is int, $"Invalid second argument {argumentValues[1].GetType().FullName} in {s_funcs[_info]._name}"); 426Debug.Assert(argumentValues[2] is int, $"Invalid third argument {argumentValues[2].GetType().FullName} in {s_funcs[_info]._name}"); 465Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}"); 466Debug.Assert((argumentValues[0] is string) || (argumentValues[0] is SqlString), $"Invalid argument type for {s_funcs[_info]._name}");
System\Data\Filter\LookupNode.cs (2)
58Debug.Assert(_relation != null, "Invalid relation: no parent table."); 59Debug.Assert(_columnName != null, "All Lookup expressions have columnName set.");
System\Data\Filter\NameNode.cs (1)
61Debug.Assert(_column != null, $"Failed to bind column {_name}");
System\Data\Filter\UnaryNode.cs (1)
118Debug.Fail("Missing a type conversion");
System\Data\Filter\ZeroOpNode.cs (2)
21Debug.Assert(op == Operators.True || op == Operators.False || op == Operators.Null, "Invalid zero-op"); 40Debug.Assert(_op == Operators.True || _op == Operators.False || _op == Operators.Null, "Invalid zero-op");
System\Data\ForeignKeyConstraint.cs (10)
260Debug.Assert(row.Table.DataSet != null); 352Debug.Fail("Unknown Rule value"); 360Debug.Assert(row.Table.DataSet != null); 405Debug.Assert(Table?.DataSet != null && row.Table.DataSet != null); 490Debug.Fail("Unknown Rule value"); 498Debug.Assert(Table?.DataSet != null); 507Debug.Assert(Table?.DataSet != null, $"Relation {ConstraintName} isn't part of a DataSet, so this check shouldn't be happening."); 520Debug.Assert(Table?.DataSet != null, $"ForeignKeyConstraint {ConstraintName} isn't part of a DataSet, so this check shouldn't be happening."); 554Debug.Fail("attempt to cascade unknown action: " + action.ToString()); 759Debug.Assert(Table == RelatedTable, "We call this clone just if we have the same datatable as parent and child ");
System\Data\LinqDataView.cs (3)
39Debug.Assert(table != null, "null DataTable"); 111Debug.Assert(base.Sort != null); 112Debug.Assert(!(!string.IsNullOrEmpty(base.Sort) && base.SortComparison != null),
System\Data\Merger.cs (7)
45Debug.Assert(_dataSet != null); 234Debug.Assert(_dataSet != null); 269Debug.Assert(MissingSchemaAction.Ignore == _missingSchemaAction, "MergeSchema failed"); 469Debug.Assert(_dataSet != null); 521Debug.Assert(_dataSet != null); 522Debug.Assert(MissingSchemaAction.Error == _missingSchemaAction || 600Debug.Assert(MissingSchemaAction.Error == _missingSchemaAction, $"Unexpected value of MissingSchemaAction parameter : {_missingSchemaAction}");
System\Data\ProviderBase\DataReaderContainer.cs (6)
30Debug.Assert(null != dataReader, "null dataReader"); 53Debug.Assert(null != fieldName, "null GetName"); 81Debug.Assert(null != dataReader, "null dbDataReader"); 98Debug.Assert(0 <= fieldCount, "negative FieldCount"); 107Debug.Assert(null != fieldType, "null FieldType"); 139Debug.Assert(0 <= fieldCount, "negative FieldCount");
System\Data\ProviderBase\SchemaMapping.cs (27)
64Debug.Assert(null != adapter, nameof(adapter)); 65Debug.Assert(null != dataReader, nameof(dataReader)); 66Debug.Assert(0 < dataReader.FieldCount, "FieldCount"); 67Debug.Assert(null != dataset || null != datatable, "SchemaMapping - null dataSet"); 68Debug.Assert(SchemaType.Mapped == schemaType || SchemaType.Source == schemaType, "SetupSchema - invalid schemaType"); 284Debug.Assert(_mappedLength == _indexMap!.Length, "incorrect precomputed length"); 299Debug.Assert(_mappedLength == Math.Min(_readerDataValues!.Length, _mappedDataValues!.Length), "incorrect precomputed length"); 310Debug.Assert(_readerDataValues != null); 363Debug.Assert(0 == _mappedMode, "incorrect mappedMode"); 364Debug.Assert((null == _chapterMap) && (null == _indexMap) && (null == _mappedDataValues), "incorrect MappedValues"); 367Debug.Assert((null == _chapterMap) && (null == _indexMap) && (null != _mappedDataValues), "incorrect MappedValues"); 371Debug.Assert((null == _chapterMap) && (null != _indexMap) && (null != _mappedDataValues), "incorrect MappedValues"); 375Debug.Assert((null != _chapterMap) && (null == _indexMap) && (null != _mappedDataValues), "incorrect MappedValues"); 379Debug.Assert((null != _chapterMap) && (null != _indexMap) && (null != _mappedDataValues), "incorrect MappedValues"); 420Debug.Fail("unexpected LoadOption"); 472Debug.Assert(null != _dataSet, "if chapters, then Fill(DataSet,...) not Fill(DataTable,...)"); 523Debug.Assert(rgcol != null, "invalid call to ResizeArray"); 524Debug.Assert(len <= rgcol.Length, "invalid len passed to ResizeArray"); 566Debug.Assert(_dataTable != null); 567Debug.Assert(_fieldNames != null); 568Debug.Assert(_tableMapping != null); 762Debug.Assert(_dataTable != null); 763Debug.Assert(_schemaTable != null); 764Debug.Assert(_fieldNames != null); 765Debug.Assert(_tableMapping != null); 769Debug.Assert(null != schemaRows, "SchemaSetup - null DbSchemaRow[]"); 770Debug.Assert(_dataReader.FieldCount <= schemaRows.Length, "unexpected fewer rows in Schema than FieldCount");
System\Data\RbTree.cs (30)
321Debug.Assert(_inUseNodeCount - 1 == SubTreeSize(root), "count mismatch"); 371Debug.Assert(page._slots[slotId]._leftId == NIL, "node not cleared"); 372Debug.Assert(page._slots[slotId]._rightId == NIL, "node not cleared"); 373Debug.Assert(page._slots[slotId]._parentId == NIL, "node not cleared"); 374Debug.Assert(page._slots[slotId]._nextId == NIL, "node not cleared"); 377Debug.Assert(page._slots[slotId]._nodeColor == NodeColor.red, "node not cleared"); 550Debug.Assert(NIL != x_id, "nil left"); 551Debug.Assert(NIL != z_id, "nil right"); 580Debug.Assert(-1 == position, "KEY_SEARCH_AND_INDEX with bad position"); 591Debug.Assert((NIL == Left(z_id)) || (0 > Compare(root_id, Left(z_id), z_id)), "Left is not left"); 598Debug.Assert((NIL == Right(z_id)) || (0 < Compare(root_id, Right(z_id), z_id)), "Right is not right"); 841Debug.Assert(_accessMethod == TreeAccessMethod.INDEX_ONLY, "not expecting anything else"); 1229Debug.Assert((NIL == Left(x_id)) || (0 > Compare(root_id, Left(x_id), x_id)), "Search duplicate Left is not left"); 1236Debug.Assert((NIL == Right(x_id)) || (0 < Compare(root_id, Right(x_id), x_id)), "Search duplicate Right is not right"); 1259Debug.Assert((NIL == Left(x_id)) || (0 > Compare(NIL, Left(x_id), x_id)), "Search Left is not left"); 1266Debug.Assert((NIL == Right(x_id)) || (0 < Compare(NIL, Right(x_id), x_id)), "Search Right is not right"); 1347Debug.Assert(NIL != node, "GetIndexByNode(NIL)"); 1513Debug.Assert(NIL == Next(x_id), "has unexpected satellite tree"); 1698Debug.Assert(nodeId != NIL, " in SetParent nodeId == NIL"); 1709Debug.Assert(nodeId != NIL, " in SetColor nodeId == NIL"); 1740Debug.Assert(nodeId != NIL && 1786Debug.Assert(myCorrectSize == size, "VerifySize"); 1907Debug.Assert(null != tree, "null tree"); 1908Debug.Assert((NIL == _nodeID && NIL == _mainTreeNodeID) || (NIL != _nodeID), "MainTreeNodeID is not NIL"); 1912Debug.Assert(NIL != tree.Next(_mainTreeNodeID), "MainTreeNodeID should have a Next"); 1918Debug.Assert(tree.root == node, "MainTreeNodeID parent change doesn't align"); 1922Debug.Assert(NIL == tree.Next(_nodeID), "NodeID should not have a Next"); 1935Debug.Assert(NIL == tree.Next(node), "duplicate node should not have a next"); 1939Debug.Assert((NIL == _mainTreeNodeID && tree.root == node) || 1989Debug.Assert((_slotMap[segmentPos] & freeSlot) == 0, "Slot position segment[segmentPos ]: [freeSlot] is in use. Expected to be empty");
System\Data\RecordManager.cs (9)
115Debug.Assert(record >= 0 && record < _recordCapacity, "NewRecord: Invalid record"); 121Debug.Assert(-1 <= record && record < _recordCapacity, "invalid record"); 185Debug.Assert(record >= 0 && record < _rows.Length, "Invalid record number"); 190Debug.Assert(record >= 0 && record < _rows.Length, "Invalid record number"); 212Debug.Assert(src != null, "Can not Merge record without a table"); 270Debug.Assert((record < _lastFreeRecord) && (-1 == _freeRecordList.IndexOf(record)), "accessing free record"); 272Debug.Assert((null == r) || 281Debug.Assert((record < _lastFreeRecord) && (-1 == _freeRecordList.IndexOf(record)), "accessing free record"); 282Debug.Assert((null == _rows[record]) || (row == _rows[record]), "record of a different row");
System\Data\RelatedView.cs (2)
27Debug.Assert(Table == _childKey.Table, "Key.Table Must be equal to Current Table"); 37Debug.Assert(Table == _childKey.Table, "Key.Table Must be equal to Current Table");
System\Data\Select.cs (20)
60Debug.Assert(_candidateColumns != null); 183Debug.Assert(_candidateColumns != null); 237Debug.Assert(_candidateColumns != null); 316Debug.Assert(_candidateColumns != null); 475Debug.Assert(_candidateColumns != null); 480Debug.Assert(_matchedCandidates > 0 && _matchedCandidates <= lenId, "BuildLinearExpression : Invalid Index"); 484Debug.Assert(canColumn != null && canColumn.expr != null, "BuildLinearExpression : Must be a matched candidate"); 515Debug.Assert(_candidateColumns != null); 563Debug.Assert(!needSorting, "What are we doing here if no real reuse of this index ?"); 711default: Debug.Assert(true, "Unsupported Binary Search Operator!"); break; 718Debug.Assert(_index != null && _candidateColumns != null); 743Debug.Assert(candidateColumn != null, "How come this is not a candidate column"); 744Debug.Assert(candidateColumn.expr != null, "How come there is no associated expression"); 754Debug.Assert(_index != null); 773Debug.Assert(_index != null); 791Debug.Assert(_index != null); 797Debug.Assert(_matchedCandidates <= _index._indexFields.Length, "GetBinaryFilteredRecords : Invalid Index"); 804Debug.Assert(lo <= hi, "GetBinaryFilteredRecords : Invalid Search Results"); 810Debug.Assert(_index != null); 839Debug.Assert(_index != null);
System\Data\Selection.cs (27)
19Debug.Assert(column != null, "null column"); 113Debug.Assert(indexFields != null); 114Debug.Assert(null != table, "null table"); 175Debug.Assert(recordIndex >= 0 && recordIndex < _recordCount, "recordIndex out of range"); 233Debug.Assert(0 <= _refCount, "AddRef on disposed index"); 234Debug.Assert(null != _records, "null records"); 298Debug.Assert(_records.CheckUnique(_records.root) != HasDuplicates, "CheckUnique difference"); 326Debug.Assert(null != row1, "record1 no datarow"); 327Debug.Assert(null != row2, "record2 no datarow"); 350Debug.Assert(0 == CompareDataRows(record1, record2), "duplicate record not a duplicate by user function"); 357Debug.Assert(0 == c, "duplicate record not a duplicate"); 362Debug.Assert(null != row1, "record1 no datarow"); 363Debug.Assert(null != row2, "record2 no datarow"); 448Debug.Assert(null != _comparison, "missing comparison"); 475Debug.Assert(record == row._newRecord, "newRecord has change during GetIndex"); 479Debug.Assert(record == row._oldRecord, "oldRecord has change during GetIndex"); 859Debug.Assert(DoListChanged, "supposed to check DoListChanged before calling to delay create ListChangedEventArgs"); 870Debug.Assert(-1 <= record, "bad record#"); 942Debug.Assert((-1 == oldRecord) || (-1 == newRecord) || 1073Debug.Assert(null != listener, "null listener"); 1074Debug.Assert(!Index.ContainsReference(_listeners, listener), "already contains reference"); 1086Debug.Assert(null != listener, "null listener"); 1089Debug.Assert(0 <= index, "listeners don't contain listener"); 1104Debug.Assert(null != action, "no action"); 1105Debug.Assert(0 <= _listenerReaderCount, "negative _listEventCount"); 1147Debug.Assert((-1 == nullIndex) || (null == _listeners[nullIndex]), "non-null listener"); 1148Debug.Assert(0 == _listenerReaderCount, "0 < _listenerReaderCount");
System\Data\SortExpressionBuilder.cs (6)
52Debug.Assert(keySelector != null); 53Debug.Assert(compare != null); 64Debug.Assert(_currentSelector != null); 65Debug.Assert(_currentComparer != null); 97Debug.Assert(a != null && b != null && a.Count == Count); 119Debug.Assert(_selectors.Count == _comparers.Count);
System\Data\SQLTypes\SQLBinary.cs (3)
42Debug.Assert(!copy); 374Debug.Assert(length >= 0); 379Debug.Assert(rgbValue.Length >= length);
System\Data\SQLTypes\SQLBoolean.cs (1)
131Debug.Assert(x.m_value == x_Null);
System\Data\SQLTypes\SQLBytes.cs (5)
460Debug.Assert(_state >= SqlBytesCharsState.Null && _state <= SqlBytesCharsState.Stream); 467Debug.Assert((_lCurLen >= 0 && _lCurLen <= x_lMaxLen) || FStream()); 468Debug.Assert(FStream() || (_rgbBuf != null && _lCurLen <= _rgbBuf.Length)); 469Debug.Assert(!FStream() || (_lCurLen == x_lNull)); 478Debug.Assert(FStream());
System\Data\SQLTypes\SQLChars.cs (6)
425Debug.Assert(_state >= SqlBytesCharsState.Null && _state <= SqlBytesCharsState.Stream); 432Debug.Assert((_lCurLen >= 0 && _lCurLen <= x_lMaxLen) || FStream()); 433Debug.Assert(FStream() || (_rgchBuf != null && _lCurLen <= _rgchBuf.Length)); 434Debug.Assert(!FStream() || (_lCurLen == x_lNull)); 436Debug.Assert(_rgchWorkBuf == null || _rgchWorkBuf.Length == 1); 450Debug.Assert(FStream());
System\Data\SQLTypes\SQLDateTime.cs (2)
121Debug.Assert(timeticks == s_maxTime + 1); 242Debug.Assert(time == s_maxTime + 1);
System\Data\SQLTypes\SQLDecimal.cs (49)
409Debug.Assert((precision == MaxPrecision + 1) || VerifyPrecision(precision), "Calcualted precision too low?"); 410Debug.Assert((precision == 1) || !VerifyPrecision((byte)(precision - 1)), "Calculated precision too high?"); 421Debug.Assert(precision == bActualPrecision, $"CalculatePrecision={precision}, BActualPrec={bActualPrecision}. Results must be equal!"); 433Debug.Assert(precision > 0, "Precision cannot be less than 1"); 434Debug.Assert(precision <= MaxPrecision, "Precision > MaxPrecision"); 720Debug.Assert(ulLen <= s_NUMERIC_MAX_PRECISION, "ulLen <= NUMERIC_MAX_PRECISION", ""); 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); 1809Debug.Assert(_bScale <= s_NUMERIC_MAX_PRECISION, "m_bScale <= NUMERIC_MAX_PRECISION", "In AssertValid"); 1810Debug.Assert(_bScale <= _bPrec, "m_bScale <= m_bPrec", "In AssertValid"); 1811Debug.Assert(_bScale >= 0, "m_bScale >= 0", "In AssertValid"); 1812Debug.Assert(_bPrec > 0, "m_bPrec > 0", "In AssertValid"); 1814Debug.Assert(CLenFromPrec(_bPrec) >= _bLen, "CLenFromPrec(m_bPrec) >= m_bLen", "In AssertValid"); 1815Debug.Assert(_bLen <= s_cNumeMax, "m_bLen <= x_cNumeMax", "In AssertValid"); 1822Debug.Assert(_bLen == 1, "m_bLen == 1", "In AssertValid"); 1827Debug.Assert(rglData[iulData] == 0, "rglData[iulData] == 0", "In AssertValid"); 1859Debug.Assert(rgulData.Length == s_cNumeMax, "rgulData.Length == x_cNumeMax", "Invalid array length"); 1912Debug.Assert(bPrec <= MaxPrecision && bPrec > 0, "bPrec <= MaxPrecision && bPrec > 0", 1933Debug.Assert(rglData.Length == 4, "rglData.Length == 4", $"Wrong array length: {rglData.Length}"); 2096Debug.Assert(Prec == 9 || Prec == 18 || Prec == 27); 2139Debug.Assert(dwlAccum < s_ulInt32Base, "dwlAccum < x_lInt32Base", ""); 2168Debug.Assert(dwlAccum < s_ulInt32Base); 2185Debug.Assert(dwlAccum < s_ulInt32Base, "dwlAccum < x_dwlBaseUI4", "Integer overflow"); 2237Debug.Assert(dwlAccum < dwlDivisor); 2239Debug.Assert((dwlAccum / dwlDivisor) < s_ulInt32Base); 2266Debug.Assert(dwlAccum < s_ulInt32Base); 2280Debug.Assert(!IsNull, "!IsNull", "In AdjustScale"); 2464Debug.Assert(rgulS.Length >= ciulS, "rgulS.Length >= ciulS", "Invalid array length"); 2465Debug.Assert(rgulD.Length >= ciulS, "rgulD.Length >= ciulS", "Invalid array length"); 2504Debug.Assert(iulX > s_uiZero); 2537Debug.Assert(rgulU.Length == s_cNumeMax); 2544Debug.Assert(iulD != 0, "iulD != 0", "Divided by zero!"); 2545Debug.Assert(iulD > 0, "iulD > 0", "Invalid data: less than zero"); 2546Debug.Assert(ciulU > 0, "ciulU > 0", "No data in the array"); 2603Debug.Assert(ciulU > 0, "ciulU > 0", "In method MpDiv"); 2604Debug.Assert(ciulD > 0, "ciulD > 0", "In method MpDiv"); 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 (7)
263Debug.Assert(!IsNull); 368Debug.Assert(!x.IsNull && !y.IsNull, 376Debug.Assert(x.FBinarySort() || (x.m_cmpInfo != null && y.m_cmpInfo != null), 442Debug.Fail("Invalid ecExpectedResult"); 728Debug.Assert(cbX % 2 == 0); 729Debug.Assert(cbY % 2 == 0); 775Debug.Assert(!x.IsNull && !y.IsNull);
System\Data\SQLTypes\SqlXml.cs (3)
89Debug.Assert(_createSqlReaderMethodInfo != null, "MethodInfo reference for XmlReader.CreateSqlReader should not be null."); 120Debug.Assert(CreateSqlReaderMethodInfo != null, "MethodInfo reference for XmlReader.CreateSqlReader should not be null."); 283Debug.Assert(_stream != null, "stream can not be null");
System\Data\TypeLimiter.cs (5)
25Debug.Assert(scope != null); 200Debug.Assert(allowedTypes != null); 213Debug.Fail("Scope was popped out of order."); 223Debug.Assert(type != null); 265Debug.Assert(type != null);
System\Data\UniqueConstraint.cs (3)
139Debug.Assert(null != _constraintIndex, "null UniqueConstraint index"); 148Debug.Assert(DataKey.ColumnsEqual(_key.ColumnsReference, sortIndexColumns), "UniqueConstraint index columns do not match the key sort index"); 189Debug.Assert(constraints.Table._primaryKey == this, "If the primary key and this are 'Equal', they should also be '=='");
System\Data\XDRSchema.cs (8)
40Debug.Assert(FEqualIdentity(schemaRoot, Keywords.XDR_SCHEMA, Keywords.XDRNS), "Illegal node"); 74Debug.Assert(FEqualIdentity(node, Keywords.XDR_ELEMENT, Keywords.XDRNS) || 133Debug.Assert(FEqualIdentity(node, Keywords.XDR_ELEMENTTYPE, Keywords.XDRNS), $"Invalid node type {node.LocalName}"); 184Debug.Assert(FEqualIdentity(node, Keywords.XDR_ELEMENTTYPE, Keywords.XDRNS) || 275Debug.Assert((s_mapNameTypeXdr[i - 1].CompareTo(s_mapNameTypeXdr[i].name)) < 0, "incorrect sorting"); 285Debug.Assert(nt.name != name, $"FindNameType('{name}') -- failed. Existed name not found"); 290Debug.Assert(s_mapNameTypeXdr[index].name == name, $"FindNameType('{name}') -- failed. Wrong name found"); 345Debug.Assert(FEqualIdentity(node, Keywords.XDR_ELEMENT, Keywords.XDRNS) ||
System\Data\XmlDataLoader.cs (5)
686Debug.Assert(table != null, "Table to be loaded is null on LoadTopMostTable() entry"); 687Debug.Assert(_topMostNode != null, "topMostNode is null on LoadTopMostTable() entry"); 688Debug.Assert(!_isDiffgram, "Diffgram mode is on while we have topMostNode table. This is bad."); 703Debug.Assert(entryDepth >= 0, "Wrong entry Depth for top most element."); 870Debug.Assert(table != null, "Table to be loaded is null on LoadTable() entry");
System\Data\XMLDiffLoader.cs (2)
32Debug.Assert(reader.LocalName == Keywords.MSD_ERRORS && reader.NamespaceURI == Keywords.DFFNS, "something fishy"); 68Debug.Assert(reader.LocalName == Keywords.MSD_ERRORS && reader.NamespaceURI == Keywords.DFFNS, "something fishy");
System\Data\xmlsaver.cs (15)
798Debug.Assert(nodeApp != null, "Need to create <application..> node first."); 1016Debug.Assert(ds == null || dt == null); 1017Debug.Assert(_dsElement != null); 1236Debug.Assert(_prefixes != null); 1417Debug.Assert(_prefixes != null); 1418Debug.Assert(_dc != null); 1423Debug.Assert(col.ColumnMapping != MappingType.SimpleContent, "Illegal state"); 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); 3090Debug.Assert(value != null, "Value can not be null"); 3306Debug.Assert(!(xr is DataTextReader), "XmlReader is DataTextReader");
System\Data\XMLSchema.cs (20)
332Debug.Assert(val is PropertyCollection, "We can set values only for classes that have ExtendedProperties"); 363Debug.Assert(dc != null, "HandleColumnExpression is supposed to be called for DataColumn"); 403Debug.Assert(val is PropertyCollection, "We can set values only for classes that have ExtendedProperties"); 417Debug.Assert(table != null, "ref table should have been already created"); 849Debug.Assert(schemaSet.Count == 1, "there should be one schema"); 920Debug.Assert(child == table, "table not the same"); 1066Debug.Assert(ct.BaseXmlSchemaType is XmlSchemaSimpleType, "Expected SimpleType or ComplexType"); 1084Debug.Assert(cContent is XmlSchemaComplexContentRestriction, "Expected complexContent extension or restriction"); 1096Debug.Assert(ct.ContentModel is XmlSchemaSimpleContent, "expected simpleContent or complexContent"); 1107Debug.Assert(ct.BaseXmlSchemaType is XmlSchemaSimpleType, "Expected SimpleType or ComplexType"); 1113Debug.Assert(cContent is XmlSchemaSimpleContentRestriction, "Expected SimpleContent extension or restriction"); 1150Debug.Assert(cContent is XmlSchemaComplexContentRestriction, "Expected complexContent extension or restriction"); 1156Debug.Assert(ct.ContentModel is XmlSchemaSimpleContent, "expected simpleContent or complexContent"); 1530Debug.Assert((node is XmlSchemaElement) || (node is XmlSchemaAttribute), "GetInstanceName should only be called on attribute or elements"); 1541Debug.Assert((instanceName != null) && (instanceName.Length != 0), "instanceName cannot be null or empty. There's an error in the XSD compiler"); 1781Debug.Assert((s_mapNameTypeXsd[i - 1].CompareTo(s_mapNameTypeXsd[i].name)) < 0, $"incorrect sorting {s_mapNameTypeXsd[i].name}"); 1847Debug.Assert((s_mapNameTypeXsd[i - 1].CompareTo(s_mapNameTypeXsd[i].name)) < 0, $"incorrect sorting {s_mapNameTypeXsd[i].name}"); 1895Debug.Assert((s_mapNameTypeXsd[i - 1].CompareTo(s_mapNameTypeXsd[i].name)) < 0, $"incorrect sorting {s_mapNameTypeXsd[i].name}"); 1905Debug.Assert(nt.name != name, $"FindNameType('{name}') -- failed. Existed name not found"); 1910Debug.Assert(s_mapNameTypeXsd[index].name == name, $"FindNameType('{name}') -- failed. Wrong name found");
System\Data\XmlToDatasetMap.cs (10)
107Debug.Assert(dataSet != null, "DataSet can't be null"); 108Debug.Assert(nameTable != null, "NameTable can't be null"); 116Debug.Assert(dataSet != null, "DataSet can't be null"); 117Debug.Assert(nameTable != null, "NameTable can't be null"); 125Debug.Assert(dataTable != null, "DataTable can't be null"); 126Debug.Assert(nameTable != null, "NameTable can't be null"); 134Debug.Assert(dataTable != null, "DataTable can't be null"); 135Debug.Assert(nameTable != null, "NameTable can't be null"); 438Debug.Assert(node != null, "Argument validation"); 506Debug.Assert(col.ColumnName.StartsWith("xml", StringComparison.OrdinalIgnoreCase), "column name should start with xml");
System\Xml\DataPointer.cs (23)
52Debug.Assert(rowElem != null); 53Debug.Assert(rowElem.Row != null); 71Debug.Assert(rowElem.Row != null); 85Debug.Assert(_node == _doc || _node.OwnerDocument == _doc); 96Debug.Assert(node == _doc || node.OwnerDocument == _doc); 107Debug.Assert(node == _doc || node.OwnerDocument == _doc); 414Debug.Assert(name != null); 472Debug.Assert(name != null); 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); 848Debug.Assert(state == ElementState.Defoliated, "Region is accessed using column, but it's state is FOLIATED"); 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 (18)
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); 130Debug.Fail("Reading the initial text value for sub-regions."); 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 (142)
55Debug.Assert(_pointers.ContainsValue(pointer) == false); 65Debug.Assert(temp != null); 85Debug.Fail("Pointer not present"); 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); 1116Debug.Fail("Found entity reference"); 1199Debug.Assert(reader is XmlTextReader); 1226Debug.Assert(DocumentElement != null); 1264Debug.Assert(r.Element == null); 1278Debug.Fail("We should not get rows in this state"); 1281Debug.Fail("Unknown row state"); 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); 2117Debug.Fail("This should have been handled above, irrespective of ignoreDataSetEvents value (true or false)"); 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); 2470Debug.Fail("We should not get any exceptions because we always handle data-type conversion"); 2483Debug.Fail("We should not get any exceptions because DataSet.EnforceConstraints should be always off"); 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); 2809Debug.Fail("We should not get any exceptions here"); 2825Debug.Assert(row.Table.DataSet!.EnforceConstraints == false); 2837Debug.Fail("We should not get any exceptions here"); 2843Debug.Fail("Handle your case above"); 2846Debug.Assert(IsRowLive(rowElem.Row)); 2853Debug.Assert(rowElem.Row != null); 2864Debug.Assert(row.Table.DataSet!.EnforceConstraints == false); 2871Debug.Fail("We should not get any exceptions here"); 2894Debug.Fail("Handle your case above"); 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)); 3145Debug.Assert(tableList[readPos] != null, "Temp Array is not supposed to reach to null");
System\Xml\XPathNodePointer.cs (33)
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); 1218Debug.Fail("Logically, we shouldn't reach here."); 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.Debug (1)
System.Diagnostics.Debug.cs (1)
4[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.Debug))]
System.Diagnostics.DiagnosticSource (84)
src\libraries\Common\src\System\Diagnostics\DiagnosticsHelper.cs (4)
141Debug.Assert(index >= 0); 142Debug.Assert(index < _maxIndex); 152Debug.Assert(index >= 0); 153Debug.Assert(index < _maxIndex);
src\libraries\Common\src\System\HexConverter.cs (3)
165Debug.Assert(chars.Length >= bytes.Length * 2); 332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0); 298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
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 (2)
301Debug.Assert(!(cur.Observer == Observer && cur.IsEnabled1Arg == IsEnabled1Arg && cur.IsEnabled3Arg == IsEnabled3Arg), "Did not remove subscription!"); 360Debug.Assert(Monitor.IsEntered(s_allListenersLock)); // We should only be called when we hold this lock
System\Diagnostics\DiagnosticSourceEventSource.cs (21)
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); 1308Debug.Assert(type != null, "Type should only be null for the well-known static fetchers already checked"); 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 (2)
88Debug.Assert(match); 293Debug.Fail("Unexpected sequence type");
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\ObservableInstrument.cs (1)
89Debug.Assert(false, "Execution shouldn't reach this point");
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 (75)
Microsoft\Win32\SafeHandles\SafeProcessHandle.Unix.cs (1)
44Debug.Assert(_handle != null);
src\libraries\Common\src\Interop\Linux\cgroups\Interop.cgroups.cs (6)
85Debug.Fail($"Failed to read \"{path}/memory.stat\": {e}"); 199Debug.Fail($"Failed to read \"{path}\": {e}"); 372Debug.Fail($"Unexpected cgroup version \"{cgroupVersion}\""); 386Debug.Fail($"Failed to read or parse \"{ProcMountInfoFilePath}\": {e}"); 458Debug.Fail($"Unexpected cgroup version: \"{cgroupVersion}\""); 465Debug.Fail($"Failed to read or parse \"{procCGroupFilePath}\": {e}");
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.cs (2)
90Debug.Assert(!b || result.pid == pid, "Expected process ID from stat file to match supplied pid"); 97Debug.Assert(!b || result.pid == tid, "Expected thread ID from stat file to match supplied tid");
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.ParseMapModules.cs (1)
34Debug.Assert(lines != null);
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (3)
39Debug.Assert(!b || result.Pid == pid, "Expected process ID from status file to match supplied pid"); 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.GetHostName.cs (1)
29Debug.Fail($"GetHostName failed with error {err}");
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\Interop\Unix\System.Native\Interop.MountPoints.FormatInfo.cs (1)
17System.Diagnostics.Debug.Assert(GetDriveType(name) != DriveType.Unknown,
src\libraries\Common\src\Interop\Unix\System.Native\Interop.UnixFileSystemTypes.cs (1)
159Debug.Assert(Enum.IsDefined(fileSystemType) || fstatfsResult == 0, $"GetFileSystemType returned {fstatfsResult}");
src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (7)
25Debug.Assert(capacity >= 0); 54Debug.Assert(index >= 0 && index < _count); 78Debug.Assert(_count > 0); 87Debug.Assert(_count > 0); 104Debug.Assert(_array != null); // Nonzero _count should imply this 134Debug.Assert(_count < Capacity); 141Debug.Assert(minimum > Capacity);
src\libraries\Common\src\System\IO\StringParser.cs (5)
177Debug.Assert(result == int.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 222Debug.Assert(result == long.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 253Debug.Assert(result == uint.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 280Debug.Assert(result == ulong.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 295Debug.Assert(result == char.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0); 298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Diagnostics\AsyncStreamReader.cs (2)
50Debug.Assert(stream != null && encoding != null && callback != null, "Invalid arguments!"); 51Debug.Assert(stream.CanRead, "Stream must be readable!");
System\Diagnostics\Process.ConfigureTerminalForChildProcesses.Unix.cs (4)
15Debug.Assert(increment != 0); 20Debug.Assert(s_processStartLock.IsReadLockHeld); 21Debug.Assert(configureConsole); 28Debug.Assert(s_processStartLock.IsWriteLockHeld);
System\Diagnostics\Process.cs (1)
781Debug.Assert(waitHandleContext != null, "Process.CompletionCallback called with no waitHandleContext");
System\Diagnostics\Process.Linux.cs (1)
291Debug.Assert(bytesRead < buffer.Length);
System\Diagnostics\Process.Unix.cs (14)
161Debug.Assert(_haveProcessId, $"{nameof(ConfigureAfterProcessIdSet)} should only be called once a process ID is set"); 178Debug.Assert(_waitHandle == null); 179Debug.Assert(_registeredWaitHandle == null); 180Debug.Assert(Associated, "Process.EnsureWatchingForExit called with no associated process"); 206Debug.Assert(exited || milliseconds != Timeout.Infinite); 272Debug.Assert(pri >= -20 && pri <= 20); 294Debug.Assert(value == ProcessPriorityClass.Normal, "Input should have been validated by caller"); 468Debug.Assert(stdinFd >= 0); 475Debug.Assert(stdoutFd >= 0); 481Debug.Assert(stderrFd >= 0); 532Debug.Assert(childPid >= 0); 842Debug.Assert(fd >= 0); 963Debug.Assert(!string.IsNullOrEmpty(startInfo.UserName)); 967Debug.Assert(userId.HasValue == groupId.HasValue, "userId and groupId both need to have values, or both need to be null.");
System\Diagnostics\ProcessManager.Linux.cs (3)
21Debug.Assert(processNameFilter is null, "Not used on Linux"); 158Debug.Assert(pid >= 0); 196Debug.Fail($"Unexpected status character: {c}");
System\Diagnostics\ProcessStartInfo.cs (1)
105Debug.Assert(!(e is IDisposable), "Environment.GetEnvironmentVariables should not be IDisposable.");
System\Diagnostics\ProcessWaitState.Unix.cs (12)
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)); 377Debug.Fail("Unexpected errno value from kill"); 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 (4)
System\Diagnostics\XmlWriterTraceListener.cs (4)
392Debug.Assert(typeof(T) == typeof(int) || typeof(T) == typeof(uint) || typeof(T) == typeof(long), "We only currently stackalloc enough space for these types."); 399Debug.Assert(charsWritten > 0); 411Debug.Assert(charsWritten == span.Length); 423Debug.Assert(charsWritten > 0);
System.Diagnostics.TraceSource (15)
System\Diagnostics\CorrelationManager.cs (1)
57Debug.Assert(stack != null);
System\Diagnostics\DefaultTraceListener.cs (2)
116/// Writes the output using <see cref="System.Diagnostics.Debug.Write(string)"/>. 126/// Writes the output followed by a line terminator using <see cref="System.Diagnostics.Debug.Write(string)"/>.
System\Diagnostics\Switch.cs (1)
172Debug.Assert(switchValueString is not null, "Unexpected 'switchValueString' null value");
System\Diagnostics\TraceInternal.cs (10)
69Debug.SetProvider(new TraceProvider()); 74defaultListener.IndentLevel = Debug.IndentLevel; 75defaultListener.IndentSize = Debug.IndentSize; 118get { return Debug.IndentLevel; } 122Debug.IndentLevel = value; 130return Debug.IndentSize; 135Debug.IndentSize = value; 141Debug.IndentLevel++; 146Debug.IndentLevel--; 325Debug.IndentSize = DiagnosticsConfiguration.IndentSize;
System\Diagnostics\TraceSource.cs (1)
105Debug.Assert(_listeners != null);
System.Drawing.Primitives (9)
src\libraries\Common\src\System\Drawing\ColorConverterCommon.cs (2)
14Debug.Assert(culture != null); 105Debug.Assert(culture != null);
System\Drawing\Color.cs (2)
395Debug.Assert(name != null); 402Debug.Assert(tablename != null, $"Could not find known color '{(KnownColor)knownColor}' in the KnownColorTable");
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 (111)
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 (8)
216Debug.Assert(minCharAllowed <= maxCharAllowed); 217Debug.Assert(maxCharAllowed <= 0x7F); 237Debug.Assert(isAllowed[c] == false); 269Debug.Fail("Fallback should have thrown"); 299Debug.Fail("Fallback should have thrown"); 338Debug.Fail("Fallback should have thrown"); 369Debug.Fail("Fallback should have thrown"); 385Debug.Fail("Fallback should have thrown");
System\Formats\Asn1\AsnDecoder.BitString.cs (6)
328Debug.Fail("TryCopyConstructedBitStringValue failed with a pre-allocated buffer"); 367Debug.Assert(unusedBitCount == 0); 492Debug.Assert(length != null); 548Debug.Fail("Non-overlapping data encountered..."); 626Debug.Assert(bytesWritten == contentLength); 663Debug.Assert(contentsLength.HasValue);
System\Formats\Asn1\AsnDecoder.cs (8)
315Debug.Fail($"No handler is present for status {status}."); 440Debug.Assert(bytesRead > 0); 533Debug.Assert(validity != LengthValidity.Valid); 544Debug.Fail($"No handler for validity {validity}."); 647Debug.Assert(offset >= 0); 659Debug.Assert(offset >= 0); 688Debug.Fail("AsnReader asked for a matching slice from a non-overlapping input"); 695Debug.Assert(ruleSet >= AsnEncodingRules.BER && ruleSet <= AsnEncodingRules.DER);
System\Formats\Asn1\AsnDecoder.GeneralizedTime.cs (6)
192Debug.Assert(!contents.IsEmpty); 194Debug.Assert(state == GetNextState(octet)); 211Debug.Fail($"Unhandled value '{octet:X2}' in {nameof(FracState)}"); 267Debug.Assert(!contents.IsEmpty); 269Debug.Assert(state == GetNextState(octet)); 291Debug.Fail($"Unhandled value '{octet:X2}' in {nameof(SuffixState)}");
System\Formats\Asn1\AsnDecoder.Integer.cs (2)
434Debug.Assert(sizeLimit <= sizeof(long)); 473Debug.Assert(sizeLimit <= sizeof(ulong));
System\Formats\Asn1\AsnDecoder.NamedBitList.cs (2)
347Debug.Fail("TryReadBitString failed with an over-allocated buffer"); 368Debug.Assert(valueSpan.Length <= sizeof(long));
System\Formats\Asn1\AsnDecoder.OctetString.cs (6)
212Debug.Assert(contentLength.HasValue); 355Debug.Assert(length != null); 413Debug.Fail("Non-overlapping data encountered..."); 472Debug.Assert(bytesWritten == contentLength); 485Debug.Assert(rented == null); 530Debug.Fail("TryCopyConstructedOctetStringContents failed with a pre-allocated buffer");
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 (3)
99Debug.Fail($"UtcTime did not fit in tmpSpace ({contents.Length} total)"); 177Debug.Assert( 193Debug.Assert(contents.IsEmpty);
System\Formats\Asn1\AsnWriter.BitString.cs (5)
111Debug.Assert(contentLength > MaxCERContentSize); 119Debug.Assert( 147Debug.Assert(payload.Length > MaxCERContentSize); 192Debug.Assert(_offset - savedOffset == expectedSize, $"expected size was {expectedSize}, actual was {_offset - savedOffset}"); 193Debug.Assert(_buffer == ensureNoExtraCopy, $"_buffer was replaced during {nameof(WriteConstructedCerBitString)}");
System\Formats\Asn1\AsnWriter.Boolean.cs (2)
31Debug.Assert(!tag.IsConstructed); 35Debug.Assert(_offset < _buffer.Length);
System\Formats\Asn1\AsnWriter.cs (19)
83Debug.Assert(_buffer != null); 171Debug.Assert(bytesWritten == _offset); 309Debug.Fail($"TryWrite failed or written was wrong value ({written} vs {spaceRequired})"); 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); 771Debug.Fail($"No handler for {_frame.ItemType}");
System\Formats\Asn1\AsnWriter.GeneralizedTime.cs (7)
65Debug.Assert(normalized.Year <= 9999, "DateTimeOffset guards against this internally"); 88Debug.Fail($"Utf8Formatter.TryFormat could not format {floatingTicks} / TicksPerSecond"); 92Debug.Assert(bytesWritten > 2, $"{bytesWritten} should be > 2"); 93Debug.Assert(fraction[0] == (byte)'0'); 94Debug.Assert(fraction[1] == (byte)'.'); 110Debug.Assert(!tag.IsConstructed); 132Debug.Fail($"Utf8Formatter.TryFormat failed to build components of {normalized:O}");
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 (4)
106Debug.Assert(payload.Length > MaxCERSegmentSize); 117Debug.Assert( 165Debug.Assert(_offset - savedOffset == expectedSize, $"expected size was {expectedSize}, actual was {_offset - savedOffset}"); 166Debug.Assert(_buffer == ensureNoExtraCopy, $"_buffer was replaced during {nameof(WriteConstructedCerOctetString)}");
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 (3)
108Debug.Fail( 118Debug.Assert(size > AsnReader.MaxCERSegmentSize); 125Debug.Fail(
System\Formats\Asn1\AsnWriter.UtcTime.cs (2)
80Debug.Assert(!tag.IsConstructed); 108Debug.Fail($"Utf8Formatter.TryFormat failed to build components of {normalized:O}");
System.Formats.Cbor (43)
System\Formats\Cbor\CborConformanceLevel.cs (2)
234Debug.Assert(!left.IsEmpty && !right.IsEmpty); 269Debug.Fail("Invalid conformance mode used in encoding sort.");
System\Formats\Cbor\CborInitialByte.cs (2)
47Debug.Assert((byte)majorType < 8, "CBOR Major Type is out of range"); 48Debug.Assert((byte)additionalInfo < 32, "CBOR initial byte additional info is out of range");
System\Formats\Cbor\Reader\CborReader.cs (9)
207Debug.Assert(_nestedDataItems?.Count > 0); 235Debug.Assert(_definiteLength is null || _definiteLength - _itemsRead > 0); 257Debug.Assert(_offset + length <= _data.Length); 266Debug.Assert(position <= _data.Length); 381Debug.Assert(restoreHeight >= 0, "Attempting to restore checkpoint outside of its original context."); 387Debug.Assert(_nestedDataItems != null); 388Debug.Assert(_nestedDataItems.ToArray()[restoreHeight - 1].FrameOffset == checkpoint.FrameOffset, 403Debug.Assert(checkpoint.FrameOffset == _frameOffset, "Attempting to restore checkpoint outside of its original context."); 420Debug.Assert(CurrentDepth == checkpoint.Depth);
System\Formats\Cbor\Reader\CborReader.Map.cs (4)
104Debug.Assert(_currentKeyOffset != null && _itemsRead % 2 == 0); 125Debug.Assert(_currentKeyOffset != null && _itemsRead % 2 != 0); 132Debug.Assert(_currentKeyOffset != null); 160Debug.Assert(_currentKeyOffset != null);
System\Formats\Cbor\Reader\CborReader.PeekState.cs (5)
32Debug.Assert(!AllowMultipleRootLevelValues); 38Debug.Fail("CborReader internal error. Invalid CBOR major type pushed to stack."); 74Debug.Assert(AllowMultipleRootLevelValues); 84Debug.Fail("CborReader internal error. Invalid CBOR major type pushed to stack."); 129Debug.Fail("CborReader internal error. Invalid CBOR major type.");
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 (5)
245Debug.Assert(MaxArrayLength == Array.MaxLength); 303Debug.Assert(_nestedDataItems?.Count > 0); // implied by previous check 390Debug.Assert(_definiteLength == null); 405Debug.Assert(_itemsWritten % 2 == 0); 409Debug.Fail("Invalid CBOR major type pushed to stack.");
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\Cbor\Writer\CborWriter.Tag.cs (2)
166Debug.Assert((flags & ScaleMask) == 0, "mantissa argument should be integral."); 197Debug.Fail("Unreachable code in decimal exponentiation logic");
System.Formats.Tar (127)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
13Debug.Assert(errorInfo.Error != Error.SUCCESS); 14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
69Debug.Assert(passwd.Name != null);
src\libraries\Common\src\System\IO\Archiving.Utils.cs (2)
14Debug.Assert(buffer != null); 15Debug.Assert(min > 0);
src\libraries\Common\src\System\IO\PathInternal.cs (1)
124Debug.Assert(rootLength > 0);
src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
31Debug.Assert(DirectorySeparatorChar == AltDirectorySeparatorChar);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0); 298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
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 (14)
28Debug.Assert(header._format == format); 38Debug.Assert(!isGea || entryType is TarEntryType.GlobalExtendedAttributes); 332Debug.Assert(!string.IsNullOrEmpty(destinationDirectoryPath)); 333Debug.Assert(Path.IsPathFullyQualified(destinationDirectoryPath)); 382Debug.Assert(Path.IsPathFullyQualified(qualifiedPath), $"{qualifiedPath} is not qualified"); 383Debug.Assert(PathInternal.EndsInDirectorySeparator(destinationDirectoryFullPath), "caller must ensure the path ends with a separator."); 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)); 475Debug.Assert(false, $"Metadata entry type should not be visible: '{EntryType}'"); 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 (2)
78Debug.Assert(header._format is TarEntryFormat.Ustar or TarEntryFormat.Pax or TarEntryFormat.Gnu); 378Debug.Assert(size <= TarHelpers.MaxSizeLength, "size exceeded the max value possible with 11 octal digits. Actual size " + size);
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.cs (1)
310Debug.Assert(entry.Format == TarEntryFormat.Unknown, "Missing format handler");
System\Formats\Tar\TarWriter.Unix.cs (2)
21Debug.Assert(!string.IsNullOrEmpty(fullPath)); 99Debug.Assert(entry._header._dataStream == null);
System.IO.Compression (128)
System\IO\Compression\Crc32Helper.ZLib.cs (1)
14Debug.Assert((buffer != null) && (offset >= 0) && (length >= 0) && (offset <= buffer.Length - length));
System\IO\Compression\DeflateManaged\DeflateManagedStream.cs (2)
30Debug.Assert(method == ZipArchiveEntry.CompressionMethodValues.Deflate64); 121Debug.Assert(_inflater.AvailableOutput == 0, "We should have copied all stuff out!");
System\IO\Compression\DeflateManaged\HuffmanTree.cs (3)
48Debug.Assert( 102Debug.Assert(length > 0 && length <= 16, "Invalid len"); 236Debug.Assert(value < 0, "CreateTable: Only negative numbers are used for tree pointers!");
System\IO\Compression\DeflateManaged\InflaterManaged.cs (7)
329Debug.Fail("check why we are here!"); 351Debug.Assert(_literalLengthTree != null); 396Debug.Assert(_extraBits != 0, "We handle other cases separately!"); 425Debug.Assert(_distanceTree != null); 472Debug.Fail("check why we are here!"); 570Debug.Assert(_codeLengthTree != null); 670Debug.Fail("check why we are here!");
System\IO\Compression\DeflateManaged\InputBuffer.cs (13)
35Debug.Assert(0 < count && count <= 16, "count is invalid."); 110Debug.Assert(0 < count && count <= 16, "count is invalid."); 131Debug.Assert(_bitsInBuffer % 8 == 0); 163Debug.Assert(output != null); 164Debug.Assert(offset >= 0); 165Debug.Assert(length >= 0); 166Debug.Assert(offset <= output.Length - length); 167Debug.Assert((_bitsInBuffer % 8) == 0); 202Debug.Assert(buffer != null); 203Debug.Assert(offset >= 0); 204Debug.Assert(length >= 0); 205Debug.Assert(offset <= buffer.Length - length); 213Debug.Assert(_bitsInBuffer >= n, "No enough bits in the buffer, Did you call EnsureBitsAvailable?");
System\IO\Compression\DeflateManaged\OutputWindow.cs (3)
35Debug.Assert(_bytesUsed < WindowSize, "Can't add byte when window is full!"); 43Debug.Assert((_bytesUsed + length) <= WindowSize, "No Enough space"); 148Debug.Assert(_bytesUsed >= 0, "check this function and find why we copied more bytes than we have");
System\IO\Compression\DeflateZLib\Deflater.cs (14)
33Debug.Assert(windowBits >= minWindowBits && windowBits <= maxWindowBits); 124Debug.Assert(NeedsInput(), "We have something left in previous input!"); 125Debug.Assert(!inputBuffer.IsEmpty); 138Debug.Assert(NeedsInput(), "We have something left in previous input!"); 139Debug.Assert(inputBufferPtr != null); 140Debug.Assert(count > 0); 151Debug.Assert(null != outputBuffer, "Can't pass in a null output buffer!"); 152Debug.Assert(!NeedsInput(), "GetDeflateOutput should only be called after providing input"); 172Debug.Assert(outputBuffer?.Length > 0); 191Debug.Assert(null != outputBuffer, "Can't pass in a null output buffer!"); 192Debug.Assert(outputBuffer.Length > 0, "Can't pass in an empty output buffer!"); 203Debug.Assert(null != outputBuffer, "Can't pass in a null output buffer!"); 204Debug.Assert(outputBuffer.Length > 0, "Can't pass in an empty output buffer!"); 205Debug.Assert(NeedsInput(), "We have something left in previous input!");
System\IO\Compression\DeflateZLib\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 (13)
36Debug.Assert(windowBits >= MinWindowBits && windowBits <= MaxWindowBits); 57Debug.Assert(bytesRead == 0 || bytesRead == 1); 68Debug.Assert(null != bytes, "Can't pass in a null output buffer!"); 146Debug.Assert(!NeedsInput()); 147Debug.Assert(IsGzipStream()); 148Debug.Assert(IsInputBufferHandleAllocated); 185Debug.Assert(NeedsInput(), "We have something left in previous input!"); 186Debug.Assert(inputBuffer != null); 187Debug.Assert(startIndex >= 0 && count >= 0 && count + startIndex <= inputBuffer.Length); 188Debug.Assert(!IsInputBufferHandleAllocated); 195Debug.Assert(NeedsInput(), "We have something left in previous input!"); 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 (14)
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 (3)
215Debug.Assert(lastResult == OperationStatus.DestinationTooSmall); 218Debug.Assert(bytesWritten == 0); 223Debug.Assert(
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 (6)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
13Debug.Assert(errorInfo.Error != Error.SUCCESS); 14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
src\libraries\Common\src\System\IO\Archiving.Utils.cs (2)
14Debug.Assert(buffer != null); 15Debug.Assert(min > 0);
System\IO\Compression\ZipFileExtensions.ZipArchive.Create.Unix.cs (2)
14Debug.Assert(!OperatingSystem.IsWindows()); 19Debug.Assert((uint)entry.ExternalAttributes == DefaultFileExternalAttributes);
System.IO.FileSystem.DriveInfo (4)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
13Debug.Assert(errorInfo.Error != Error.SUCCESS); 14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
src\libraries\Common\src\Interop\Unix\System.Native\Interop.MountPoints.FormatInfo.cs (1)
17System.Diagnostics.Debug.Assert(GetDriveType(name) != DriveType.Unknown,
src\libraries\Common\src\Interop\Unix\System.Native\Interop.UnixFileSystemTypes.cs (1)
159Debug.Assert(Enum.IsDefined(fileSystemType) || fstatfsResult == 0, $"GetFileSystemType returned {fstatfsResult}");
System.IO.FileSystem.Watcher (32)
src\libraries\Common\src\Interop\Linux\System.Native\Interop.INotify.cs (1)
37Debug.Fail("inotify_rm_watch failed with " + hr);
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
13Debug.Assert(errorInfo.Error != Error.SUCCESS); 14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
src\libraries\Common\src\System\IO\PathInternal.cs (1)
124Debug.Assert(rootLength > 0);
src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
31Debug.Assert(DirectorySeparatorChar == AltDirectorySeparatorChar);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0); 298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\IO\FileSystemWatcher.cs (3)
69Debug.Assert(c_notifyFiltersValidMask == s_notifyFiltersValidMask, "The NotifyFilters enum has changed. The c_notifyFiltersValidMask must be updated to reflect the values of the NotifyFilters enum."); 444Debug.Fail("Unknown FileSystemEvent change type! Value: " + changeType); 593Debug.Assert(EnableRaisingEvents, "Expected EnableRaisingEvents to be true");
System\IO\FileSystemWatcher.Linux.cs (18)
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); 811Debug.Fail("Buffer provided to read was too small"); 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 (67)
System\IO\Hashing\Crc32.Arm.cs (2)
15Debug.Assert(ArmCrc.Arm64.IsSupported, "ARM CRC support is required."); 43Debug.Assert(ArmCrc.IsSupported, "ARM CRC support is required.");
System\IO\Hashing\Crc32.Vectorized.cs (2)
34Debug.Assert(CanBeVectorized(source), "source cannot be vectorized."); 86Debug.Assert(length >= 16);
System\IO\Hashing\Crc64.Vectorized.cs (2)
48Debug.Assert(CanBeVectorized(source), "source cannot be vectorized."); 119Debug.Assert(length >= 16);
System\IO\Hashing\NonCryptographicHashAlgorithm.cs (1)
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 (5)
src\libraries\Common\src\System\Security\IdentityHelper.cs (2)
79Debug.Assert(((buff.Length % 5) == 0), "Unexpected hash length"); 119Debug.Assert(((b2 & 0xF8) == 0), "Unexpected set bits");
System\IO\IsolatedStorage\IsolatedStorageFile.cs (3)
541Debug.Assert(partialPath != null, "partialPath should be non null"); 609Debug.Assert(parentDirectory != null); 628Debug.Assert(parentDirectory != null);
System.IO.MemoryMappedFiles (24)
Microsoft\Win32\SafeMemoryMappedFileHandle.Unix.cs (1)
44Debug.Assert(!ownsFileHandle || fileHandle != null, "We can only own a FileStream we're actually given.");
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
13Debug.Assert(errorInfo.Error != Error.SUCCESS); 14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
System\IO\MemoryMappedFiles\MemoryMappedFile.cs (10)
20Debug.Assert(handle != null); 21Debug.Assert(!handle.IsClosed); 22Debug.Assert(!handle.IsInvalid); 30Debug.Assert(handle != null); 31Debug.Assert(!handle.IsClosed); 32Debug.Assert(!handle.IsInvalid); 33Debug.Assert(fileHandle != null); 165Debug.Assert(handle != null); 166Debug.Assert(!handle.IsInvalid); 500Debug.Assert(access == MemoryMappedFileAccess.Write);
System\IO\MemoryMappedFiles\MemoryMappedFile.Unix.cs (3)
209Debug.Fail($"shm_open failed with ENAMETOOLONG for {Encoding.UTF8.GetByteCount(mapName)} byte long name."); 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\MemoryMappedFiles\MemoryMappedViewAccessor.cs (1)
15Debug.Assert(view != null, "view is null");
System\IO\MemoryMappedFiles\MemoryMappedViewStream.cs (1)
15Debug.Assert(view != null, "view is null");
System.IO.Pipelines (39)
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 (15)
232Debug.Assert(segment.MemoryOwner is null); 233Debug.Assert(sizeHint >= 0); 280Debug.Assert(segment != _readHead, "Returning _readHead segment that's in use!"); 281Debug.Assert(segment != _readTail, "Returning _readTail segment that's in use!"); 282Debug.Assert(segment != _writingHead, "Returning _writingHead segment that's in use!"); 301Debug.Assert(_writingHead != null); 416Debug.Assert(_writerAwaitable.IsCompleted || _readerAwaitable.IsCompleted); 502Debug.Assert(_unconsumedBytes >= 0, "Length has gone negative"); 503Debug.Assert(ResumeWriterThreshold >= 1, "ResumeWriterThreshold is less than 1"); 573Debug.Assert(_writerAwaitable.IsCompleted, "PipeWriter.FlushAsync is isn't completed and will deadlock"); 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 (4)
63Debug.Assert(previousAwaitableState == _awaitableState, "The awaitable state changed!"); 106Debug.Assert(_completion == null); 107Debug.Assert(_completionState == null); 108Debug.Assert(_schedulingContext == null);
System\IO\Pipelines\PipeCompletion.cs (3)
71Debug.Assert(IsCompleted); 86Debug.Assert(IsCompleted); 87Debug.Assert(_callbacks == null);
System\IO\Pipelines\PipeReaderStream.cs (1)
18Debug.Assert(pipeReader != null);
System\IO\Pipelines\PipeWriterStream.cs (1)
16Debug.Assert(pipeWriter != null);
System\IO\Pipelines\StreamPipeReader.cs (6)
112Debug.Assert(_bufferedBytes >= 0); 273Debug.Assert(length + reader._readTail.End <= reader._readTail.AvailableMemory.Length); 495Debug.Assert(_readTail == null); 501Debug.Assert(_readTail != null); 555Debug.Assert(segment != _readHead, "Returning _readHead segment that's in use!"); 556Debug.Assert(segment != _readTail, "Returning _readTail segment that's in use!");
System\IO\Pipelines\StreamPipeWriter.cs (4)
132Debug.Assert(_tail != null); 154Debug.Assert(sizeHint >= 0); 304Debug.Assert(_tail != null); 381Debug.Assert(_tail != null);
System.IO.Pipes (28)
Microsoft\Win32\SafeHandles\SafePipeHandle.Unix.cs (2)
52Debug.Assert(!IsInvalid); 110Debug.Assert(socket != null);
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
13Debug.Assert(errorInfo.Error != Error.SUCCESS); 14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetHostName.cs (1)
29Debug.Fail($"GetHostName failed with error {err}");
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
69Debug.Assert(passwd.Name != null);
System\IO\Pipes\AnonymousPipeClientStream.cs (2)
65Debug.Assert(direction != PipeDirection.InOut, "anonymous pipes are unidirectional, caller should have verified before calling Init"); 66Debug.Assert(safePipeHandle != null && !safePipeHandle.IsInvalid, "safePipeHandle must be valid");
System\IO\Pipes\AnonymousPipeServerStream.Unix.cs (1)
17Debug.Assert(direction != PipeDirection.InOut, "Anonymous pipe direction shouldn't be InOut");
System\IO\Pipes\NamedPipeServerStream.Unix.cs (11)
28Debug.Assert(!string.IsNullOrEmpty(pipeName), "fullPipeName is null or empty"); 29Debug.Assert(direction >= PipeDirection.In && direction <= PipeDirection.InOut, "invalid pipe direction"); 30Debug.Assert(inBufferSize >= 0, "inBufferSize is negative"); 31Debug.Assert(outBufferSize >= 0, "outBufferSize is negative"); 32Debug.Assert((maxNumberOfServerInstances >= 1) || (maxNumberOfServerInstances == MaxAllowedServerInstances), "maxNumberOfServerInstances is invalid"); 33Debug.Assert(transmissionMode >= PipeTransmissionMode.Byte && transmissionMode <= PipeTransmissionMode.Message, "transmissionMode is out of range"); 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.cs (5)
59Debug.Assert(direction >= PipeDirection.In && direction <= PipeDirection.InOut, "invalid pipe direction"); 60Debug.Assert(transmissionMode >= PipeTransmissionMode.Byte && transmissionMode <= PipeTransmissionMode.Message, "transmissionMode is out of range"); 61Debug.Assert(outBufferSize >= 0, "outBufferSize is negative"); 107Debug.Assert(handle != null, "handle is null"); 108Debug.Assert(!handle.IsClosed, "handle is closed");
System\IO\Pipes\PipeStream.Unix.cs (3)
258Debug.Assert(_handle != null); 282Debug.Assert(_handle != null); 322Debug.Assert(bytesWritten > 0 && bytesWritten <= source.Length);
System.Linq (202)
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 (13)
161Debug.Assert(_g is not null); 162Debug.Assert(_lookup is not null); 175Debug.Assert(_g is not null); 217Debug.Assert(_g is not null); 218Debug.Assert(_lookup is not null); 231Debug.Assert(_g is not null); 273Debug.Assert(_g is not null); 274Debug.Assert(_lookup is not null); 287Debug.Assert(_g is not null); 326Debug.Assert(_g is not null); 327Debug.Assert(_lookup is not null); 340Debug.Assert(_g is not null); 391Debug.Assert(_count > 0, "A grouping should only have been created if an element was being added to it.");
System\Linq\Lookup.cs (10)
84Debug.Assert(source is not null); 85Debug.Assert(keySelector is not null); 86Debug.Assert(elementSelector is not null); 99Debug.Assert(source is not null); 100Debug.Assert(keySelector is not null); 147Debug.Assert(g is not null); 166Debug.Assert(g is not null); 173Debug.Assert(index == _count, "All list elements were not initialized."); 188Debug.Assert(g is not null); 279Debug.Assert(g is not null);
System\Linq\Lookup.SpeedOpt.cs (1)
21Debug.Assert(g is not null);
System\Linq\OfType.cs (1)
47Debug.Assert(_enumerator is not null);
System\Linq\OfType.SpeedOpt.cs (1)
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 (3)
393Debug.Assert(TypeIsImplicitlyStable<TElement>(), "Using Min/Max has different semantics for floating-point values."); 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 (33)
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)); 734Debug.Assert(index == results.Length, "All list elements were not initialized."); 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 (18)
24Debug.Assert(source is not null); 25Debug.Assert(minIndexInclusive >= 0); 26Debug.Assert(minIndexInclusive <= maxIndexInclusive); 212Debug.Assert(source is not null); 213Debug.Assert(!(source is IList<TSource>), $"The caller needs to check for {nameof(IList<TSource>)}."); 214Debug.Assert(minIndexInclusive >= 0); 215Debug.Assert(maxIndexInclusive >= -1); 219Debug.Assert(maxIndexInclusive == -1 || (maxIndexInclusive - minIndexInclusive < int.MaxValue), $"{nameof(Limit)} will overflow!"); 220Debug.Assert(maxIndexInclusive == -1 || minIndexInclusive <= maxIndexInclusive); 273Debug.Assert(count != (uint)int.MaxValue + 1 || _minIndexInclusive > 0, "Our return value will be incorrect."); 296Debug.Assert(_enumerator is not null); 306Debug.Assert(_enumerator is not null); 349Debug.Assert(minIndex >= 0, $"We should have taken care of all cases when {nameof(minIndex)} overflows."); 377Debug.Assert(maxIndex >= 0, $"We should have taken care of all cases when {nameof(maxIndex)} overflows."); 386Debug.Assert(_minIndexInclusive + index >= 0, $"Adding {nameof(index)} caused {nameof(_minIndexInclusive)} to overflow."); 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\ThrowHelper.cs (1)
64Debug.Fail("The ExceptionArgument value is not defined.");
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 (490)
src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (7)
25Debug.Assert(capacity >= 0); 54Debug.Assert(index >= 0 && index < _count); 78Debug.Assert(_count > 0); 87Debug.Assert(_count > 0); 104Debug.Assert(_array != null); // Nonzero _count should imply this 134Debug.Assert(_count < Capacity); 141Debug.Assert(minimum > Capacity);
System\Dynamic\BindingRestrictions.cs (5)
77Debug.Assert(obj != null); 241Debug.Assert(expression != null); 262Debug.Assert(parameter != null); 263Debug.Assert(type != null); 285Debug.Assert(parameter != null);
System\Dynamic\DynamicMetaObject.cs (1)
264Debug.Assert(expr != null, "Unexpected null expression; ctor should have caught this.");
System\Dynamic\DynamicObject.cs (3)
579Debug.Assert(binder is ConvertBinder && fallbackInvoke == null); 583Debug.Assert(convert.Method == null); 835Debug.Assert(Restrictions == BindingRestrictions.Empty, "We don't merge, restrictions are always empty");
System\Dynamic\ExpandoObject.cs (7)
144Debug.Assert(data[exactMatch] == Uninitialized); 154Debug.Assert(index != ExpandoObject.NoMatch); 242Debug.Assert(index >= 0 && index <= _data.Length); 265Debug.Assert(oldClass != newClass); 930Debug.Assert(originalClass != klass); 982Debug.Assert(index != ExpandoObject.NoMatch); 1010Debug.Assert(Restrictions == BindingRestrictions.Empty, "We don't merge, restrictions are always empty");
System\Dynamic\Utils\ContractUtils.cs (8)
22Debug.Fail("Unreachable"); 41Debug.Assert(!string.IsNullOrEmpty(paramName)); 67Debug.Assert(!string.IsNullOrEmpty(paramName)); 110Debug.Assert(!string.IsNullOrEmpty(arrayName)); 125Debug.Assert(Monitor.IsEntered(lockObject), "Expected lock is not held."); 137Debug.Assert(!string.IsNullOrEmpty(offsetName)); 138Debug.Assert(!string.IsNullOrEmpty(countName)); 139Debug.Assert(array != null);
System\Dynamic\Utils\ExpressionUtils.cs (3)
102Debug.Assert(nodeKind == ExpressionType.Invoke || nodeKind == ExpressionType.Call || nodeKind == ExpressionType.Dynamic || nodeKind == ExpressionType.New); 248Debug.Assert(current != null); 264Debug.Assert(current != null);
System\Dynamic\Utils\ListArgumentProvider.cs (1)
97Debug.Assert(n > 0);
System\Dynamic\Utils\TypeExtensions.cs (2)
24Debug.Assert(types != null); 40Debug.Assert(argTypes != null);
System\Dynamic\Utils\TypeUtils.cs (26)
27Debug.Assert(type != null, "type cannot be null"); 95Debug.Assert(nullableType.IsNullableType()); 290Debug.Assert(source != null && dest != null); 321Debug.Assert(source != null && dest != null); 359Debug.Assert(source != typeof(object) && dest != typeof(object)); 441Debug.Assert(source.IsArray); 468Debug.Assert(dest.IsSZArray); 495Debug.Assert(t != null); 501Debug.Assert(t != null); 507Debug.Assert(t != null); 513Debug.Assert(t != null); 519Debug.Assert(source != null && dest != null); 547Debug.Assert(genericParameters != null); 548Debug.Assert(sourceArguments != null); 549Debug.Assert(destArguments != null); 550Debug.Assert(genericParameters.Length == sourceArguments.Length); 551Debug.Assert(genericParameters.Length == destArguments.Length); 558Debug.Assert(sourceArgument != null && destArgument != null); 568Debug.Assert(genericParameter != null); 670Debug.Assert(left.IsValueType); 868Debug.Assert(!definition.IsInterface); 896Debug.Assert(name == "op_False" || name == "op_True"); 969Debug.Assert(typeof(Delegate).IsAssignableFrom(delegateType)); 1010Debug.Assert(arrayType.IsArray); 1018Debug.Assert(arrayType.IsArray); 1026Debug.Assert(arrayType.IsArray);
System\Linq\Expressions\BinaryExpression.cs (13)
137Debug.Assert(IsOpAssignment(op)); 315Debug.Assert(nodeType != ExpressionType.Assign); 318Debug.Assert(method == null && TypeUtils.AreEquivalent(type, right.Type) && nodeType == ExpressionType.Coalesce); 395Debug.Assert(IsLiftedLogical); 401Debug.Assert(opTrueFalse != null); 633System.Diagnostics.Debug.Assert(method != null); 763Debug.Assert(method != null); 1393Debug.Assert(typeof(System.MulticastDelegate).IsAssignableFrom(delegateType) && delegateType != typeof(System.MulticastDelegate)); 1400Debug.Assert(pms.Length == conversion.ParameterCount); 1549Debug.Assert(typeof(System.MulticastDelegate).IsAssignableFrom(delegateType) && delegateType != typeof(System.MulticastDelegate)); 1552Debug.Assert(pms.Length == conversion.ParameterCount); 1561Debug.Assert(method != null); 2750Debug.Assert(method != null);
System\Linq\Expressions\BlockExpression.cs (31)
210Debug.Assert(expressions != null); 241Debug.Assert(args != null); 242Debug.Assert(args.Length == 2); 243Debug.Assert(variables == null || variables.Count == 0); 263Debug.Assert(expressions != null); 307Debug.Assert(args != null); 308Debug.Assert(args.Length == 3); 309Debug.Assert(variables == null || variables.Count == 0); 330Debug.Assert(expressions != null); 379Debug.Assert(args != null); 380Debug.Assert(args.Length == 4); 381Debug.Assert(variables == null || variables.Count == 0); 414Debug.Assert(expressions != null); 457Debug.Assert(args != null); 458Debug.Assert(args.Length == 5); 459Debug.Assert(variables == null || variables.Count == 0); 471Debug.Assert(expressions.Count != 0); 481Debug.Assert(index >= 0 && index < _expressions.Count); 495Debug.Assert(variables == null || variables.Count == 0); 496Debug.Assert(args != null); 554Debug.Assert(expressions != null); 590Debug.Assert(variables!.Count == Variables.Count); 594Debug.Assert(args.Length == 1); 595Debug.Assert(variables == null || variables.Count == Variables.Count); 629Debug.Assert(variables!.Count == Variables.Count); 633Debug.Assert(args.Length == ExpressionCount); 634Debug.Assert(variables == null || variables.Count == Variables.Count); 654Debug.Assert(variables!.Count == Variables.Count); 658Debug.Assert(args.Length == ExpressionCount); 659Debug.Assert(variables == null || variables.Count == Variables.Count); 770Debug.Assert(n > 0);
System\Linq\Expressions\Compiler\BoundConstants.cs (1)
97Debug.Assert(!ILGen.CanEmitConstant(value, type));
System\Linq\Expressions\Compiler\CompilerScope.cs (3)
187Debug.Assert(locals != null); 288Debug.Assert(_parent == null && parent != this); 402Debug.Assert(ShouldCache(v) && !_locals.ContainsKey(v));
System\Linq\Expressions\Compiler\DelegateHelpers.Generated.cs (2)
136Debug.Assert(types != null && types.Length > 0); 183Debug.Assert(result != null);
System\Linq\Expressions\Compiler\ILGen.cs (45)
21Debug.Assert(methodBase is MethodInfo || methodBase is ConstructorInfo); 38Debug.Assert(index >= 0); 39Debug.Assert(index < ushort.MaxValue); 46Debug.Assert(index >= 0); 47Debug.Assert(index < ushort.MaxValue); 54Debug.Assert(index >= 0); 55Debug.Assert(index < ushort.MaxValue); 65Debug.Assert(type != null); 118Debug.Assert(type != null); 163Debug.Assert(type != null); 215Debug.Assert(type != null); 258Debug.Assert(type != null); 270Debug.Assert(fi != null); 277Debug.Assert(fi != null); 284Debug.Assert(fi != null); 291Debug.Assert(ci != null); 292Debug.Assert(!ci.DeclaringType!.ContainsGenericParameters); 308Debug.Assert(value != null); 484Debug.Assert(value != null); 559Debug.Assert(typeFrom != typeof(void) && typeTo != typeof(void)); 603Debug.Assert(!typeTo.IsValueType); 652Debug.Assert(typeFrom != typeTo); 789Debug.Assert(typeFrom.IsNullableType()); 790Debug.Assert(typeTo.IsNullableType()); 823Debug.Assert(!typeFrom.IsNullableType()); 824Debug.Assert(typeTo.IsNullableType()); 833Debug.Assert(typeFrom.IsNullableType()); 834Debug.Assert(!typeTo.IsNullableType()); 844Debug.Assert(typeFrom.IsNullableType()); 845Debug.Assert(!typeTo.IsNullableType()); 846Debug.Assert(typeTo.IsValueType); 859Debug.Assert(typeFrom.IsNullableType()); 870Debug.Assert(isTypeFromNullable || isTypeToNullable); 881Debug.Assert(nullableType.IsNullableType()); 884Debug.Assert(nullableType.IsValueType); 890Debug.Assert(nullableType.IsNullableType()); 893Debug.Assert(nullableType.IsValueType); 899Debug.Assert(nullableType.IsNullableType()); 902Debug.Assert(nullableType.IsValueType); 936Debug.Assert(elementType != null); 937Debug.Assert(count >= 0); 952Debug.Assert(arrayType != null); 953Debug.Assert(arrayType.IsArray); 967Debug.Assert(ci != null); 1069Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Compiler\LabelInfo.cs (1)
382Debug.Assert(CanJumpInto);
System\Linq\Expressions\Compiler\LambdaCompiler.Address.cs (6)
24Debug.Assert(node != null); 68Debug.Assert(node.NodeType == ExpressionType.ArrayIndex && node.Method == null); 74Debug.Assert(node.Right.Type == typeof(int)); 209Debug.Assert(node.NodeType == ExpressionType.Unbox); 210Debug.Assert(type.IsValueType); 219Debug.Assert(TypeUtils.AreReferenceAssignable(type, node.Type));
System\Linq\Expressions\Compiler\LambdaCompiler.Binary.cs (21)
24Debug.Assert(b.NodeType != ExpressionType.AndAlso && b.NodeType != ExpressionType.OrElse && b.NodeType != ExpressionType.Coalesce); 41Debug.Assert(!b.IsLiftedToNull || b.Type == typeof(bool?)); 71Debug.Assert(e.Type.IsNullableType()); 72Debug.Assert(op == ExpressionType.Equal || op == ExpressionType.NotEqual); 107Debug.Assert(mc.Type == typeof(bool)); 108Debug.Assert(b.NodeType == ExpressionType.Equal 118Debug.Assert(TypeUtils.AreReferenceAssignable(p1.Type, b.Left.Type.GetNonNullableType())); 119Debug.Assert(TypeUtils.AreReferenceAssignable(p2.Type, b.Right.Type.GetNonNullableType())); 131Debug.Assert(op != ExpressionType.Coalesce); 134Debug.Assert(rightType == typeof(int)); 150Debug.Assert(!leftType.IsNullableType()); 151Debug.Assert(!rightType.IsNullableType()); 152Debug.Assert(leftType.IsPrimitive || (op == ExpressionType.Equal || op == ExpressionType.NotEqual) && (!leftType.IsValueType || leftType.IsEnum)); 237Debug.Assert(rightType == typeof(int)); 242Debug.Assert(rightType == typeof(int)); 268Debug.Assert(!resultType.IsNullableType()); 289Debug.Assert(leftType.IsNullableType() || rightType.IsNullableType()); 331Debug.Assert(leftType == rightType); 334Debug.Assert(resultType == typeof(bool?)); 339Debug.Assert(resultType == typeof(bool)); 422Debug.Assert(leftIsNullable || rightIsNullable);
System\Linq\Expressions\Compiler\LambdaCompiler.ControlFlow.cs (3)
47Debug.Assert(_labelBlock != null && _labelBlock.Kind == kind); 54Debug.Assert(node.Target != null); 72Debug.Assert(label != null);
System\Linq\Expressions\Compiler\LambdaCompiler.cs (5)
231Debug.Assert(local != null); 256Debug.Assert(_hasClosureArgument, "must have a Closure argument"); 257Debug.Assert(_method.IsStatic, "must be a static method"); 263Debug.Assert(_method is DynamicMethod); 288Debug.Assert(_method is DynamicMethod);
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (25)
39Debug.Assert(newValue == CompilationFlags.EmitAsTail || newValue == CompilationFlags.EmitAsMiddle || newValue == CompilationFlags.EmitAsNoTail); 49Debug.Assert(newValue == CompilationFlags.EmitExpressionStart || newValue == CompilationFlags.EmitNoExpressionStart); 59Debug.Assert(newValue == CompilationFlags.EmitAsDefaultType || newValue == CompilationFlags.EmitAsVoidType); 85Debug.Assert(node != null); 136Debug.Assert(TypeUtils.AreReferenceAssignable(type, node.Type)); 214Debug.Assert(wb.Count > 0); 251Debug.Assert(!node.IsByRef); 376Debug.Assert(obj != null); 516Debug.Assert(args.ArgumentCount + skipParameters == pis.Length); 567Debug.Assert(value != null); 588Debug.Assert(_method is DynamicMethod); 616Debug.Assert(siteType.IsGenericType && siteType.GetGenericTypeDefinition() == typeof(CallSite<>)); 635Debug.Assert(node.ArgumentCount == 0, "Node with arguments must have a constructor."); 636Debug.Assert(node.Type.IsValueType, "Only value type may have constructor not set."); 681Debug.Assert(!type.IsValueType); 688Debug.Assert(result == AnalyzeTypeIsResult.Unknown); 787Debug.Assert(!node.IsByRef); 819Debug.Assert(member is PropertyInfo); 863Debug.Assert(member is PropertyInfo); 881Debug.Assert(instance.NodeType == ExpressionType.Parameter); 882Debug.Assert(type!.IsValueType); 966Debug.Assert(binding.Member is PropertyInfo); 1104Debug.Assert(member is FieldInfo || member is PropertyInfo); 1114Debug.Assert(TypeUtils.AreEquivalent(resultType.GetNonNullableType(), mc.Type.GetNonNullableType())); 1186Debug.Assert(nodeType == ExpressionType.LessThan
System\Linq\Expressions\Compiler\LambdaCompiler.Generated.cs (1)
24Debug.Assert(node != null);
System\Linq\Expressions\Compiler\LambdaCompiler.Lambda.cs (4)
28Debug.Assert(_method is DynamicMethod); 99Debug.Assert(dynamicMethod != null); 133Debug.Assert(_method is DynamicMethod); 246Debug.Assert(_labelBlock.Parent == null && _labelBlock.Kind == LabelScopeKind.Lambda);
System\Linq\Expressions\Compiler\LambdaCompiler.Logical.cs (19)
18Debug.Assert(node.Test.Type == typeof(bool)); 89Debug.Assert(b.Method == null); 97Debug.Assert(!b.Left.Type.IsValueType); 112Debug.Assert(b.Method == null); 126Debug.Assert(b.Conversion.ParameterCount == 1); 128Debug.Assert(p.Type.IsAssignableFrom(b.Left.Type) || 189Debug.Assert(b.Conversion!.ParameterCount == 1); 226Debug.Assert(!b.Left.Type.IsValueType); 278Debug.Assert(b.Method!.IsStatic); 284Debug.Assert(opFalse != null, "factory should check that the method exists"); 384Debug.Assert(b.Method!.IsStatic); 390Debug.Assert(opTrue != null, "factory should check that the method exists"); 458Debug.Assert(node.Type == typeof(bool)); 508Debug.Assert(node.NodeType == ExpressionType.Equal || node.NodeType == ExpressionType.NotEqual); 509Debug.Assert(!node.IsLiftedToNull); 530Debug.Assert(!node.Right.Type.IsValueType); 544Debug.Assert(!node.Left.Type.IsValueType); 583Debug.Assert(node.NodeType == ExpressionType.AndAlso || node.NodeType == ExpressionType.OrElse); 584Debug.Assert(!node.IsLiftedToNull);
System\Linq\Expressions\Compiler\LambdaCompiler.Statements.cs (6)
107Debug.Assert(_scope.Node == node); 179Debug.Assert(node.Type == typeof(void)); 222Debug.Assert(TypeUtils.AreReferenceAssignable(testValue.Type, test.Type)); 295Debug.Assert(key > buckets[buckets.Count - 1].Key); 623Debug.Assert(key == bucket[bucket.Count - 1].Key + 1); 624Debug.Assert(slot == jmpLabels.Length);
System\Linq\Expressions\Compiler\LambdaCompiler.Unary.cs (7)
34Debug.Assert(typeof(LambdaExpression).IsAssignableFrom(quote.Type)); 75Debug.Assert(type == node.Operand.Type); 149Debug.Assert(TypeUtils.AreEquivalent(operandType, resultType)); 274Debug.Assert(node.Type.IsValueType); 309Debug.Assert(pis != null && pis.Length == 1); 317Debug.Assert(operand.Method == null); 321Debug.Assert(node.Method == null);
System\Linq\Expressions\Compiler\StackSpiller.ChildRewriter.cs (3)
122Debug.Assert(!_done); 379Debug.Assert(_comma!.Capacity == _comma.Count + 1); 450Debug.Assert(first == 0);
System\Linq\Expressions\Compiler\StackSpiller.cs (9)
133Debug.Assert(result.Node != null); 136Debug.Assert((result.Action == RewriteAction.None) ^ (node != result.Node), "rewrite action does not match node object identity"); 139Debug.Assert(result.Node.NodeType != ExpressionType.Extension, "extension nodes must be rewritten"); 142Debug.Assert( 150Debug.Assert( 605Debug.Assert(node.NodeType != ExpressionType.Quote, "unexpected Quote"); 606Debug.Assert(node.NodeType != ExpressionType.Throw, "unexpected Throw"); 1043Debug.Assert(original != null); 1044Debug.Assert(max < original.Count);
System\Linq\Expressions\Compiler\StackSpiller.Temps.cs (6)
143Debug.Assert(_freeTemps == null || !_freeTemps.Contains(temp)); 144Debug.Assert(_usedTemps == null || !_usedTemps.Contains(temp)); 160Debug.Assert(_freeTemps == null || !_freeTemps.Contains(temp)); 190Debug.Assert(_usedTemps == null || mark <= _usedTemps.Count); 192Debug.Assert(mark == 0 || _usedTemps != null); 211Debug.Assert(_usedTemps == null || _usedTemps.Count == 0);
System\Linq\Expressions\Compiler\VariableBinder.cs (1)
221Debug.Assert(referenceScope != null);
System\Linq\Expressions\DebugViewWriter.cs (8)
99Debug.Assert(string.IsNullOrEmpty(le.Name)); 105Debug.Assert(string.IsNullOrEmpty(p.Name)); 111Debug.Assert(string.IsNullOrEmpty(target.Name)); 120Debug.Assert(node != null); 121Debug.Assert(writer != null); 555Debug.Assert(parent != null); 598Debug.Assert(child.NodeType == parent.NodeType); 611Debug.Assert(binary != null);
System\Linq\Expressions\DynamicExpression.cs (7)
24Debug.Assert(delegateType.GetInvokeMethod().GetReturnType() == typeof(object) || GetType() != typeof(DynamicExpression)); 516Debug.Assert(args.Length == ((IArgumentProvider)this).ArgumentCount); 527Debug.Assert(delegateType.GetInvokeMethod().GetReturnType() == returnType); 574Debug.Assert(args.Length == 1); 643Debug.Assert(args.Length == 2); 718Debug.Assert(args.Length == 3); 799Debug.Assert(args.Length == 4);
System\Linq\Expressions\Expression.cs (2)
240Debug.Assert(items != null); 272Debug.Assert(member is FieldInfo);
System\Linq\Expressions\ExpressionStringBuilder.cs (6)
71Debug.Assert(node != null); 79Debug.Assert(node != null); 87Debug.Assert(node != null); 98Debug.Assert(node != null); 109Debug.Assert(node != null); 757Debug.Assert(node.Indexer != null);
System\Linq\Expressions\IndexExpression.cs (4)
30Debug.Assert(instance != null && instance.Type.IsArray); 31Debug.Assert(instance.Type.GetArrayRank() == arguments.Count); 122Debug.Assert(instance != null); 123Debug.Assert(arguments == null || arguments.Length == _arguments.Count);
System\Linq\Expressions\Interpreter\AddInstruction.cs (2)
165Debug.Assert(type.IsArithmetic()); 301Debug.Assert(type.IsArithmetic());
System\Linq\Expressions\Interpreter\BranchLabel.cs (4)
46Debug.Assert(_targetIndex != UnknownIndex && _stackDepth != UnknownDepth && _continuationStackDepth != UnknownDepth); 70Debug.Assert(((_targetIndex == UnknownIndex) == (_stackDepth == UnknownDepth))); 71Debug.Assert(((_targetIndex == UnknownIndex) == (_continuationStackDepth == UnknownDepth))); 86Debug.Assert(_targetIndex != UnknownIndex);
System\Linq\Expressions\Interpreter\CallInstruction.Generated.cs (1)
137Debug.Assert(pi.Length == 2);
System\Linq\Expressions\Interpreter\ControlFlowInstructions.cs (20)
25Debug.Assert(_offset == Unknown && offset != Unknown); 59Debug.Assert(_offset != Unknown); 81Debug.Assert(_offset != Unknown); 104Debug.Assert(_offset != Unknown); 148Debug.Assert(_offset != Unknown); 166Debug.Assert(_labelIndex != UnknownInstrIndex); 172Debug.Assert(_labelIndex != UnknownInstrIndex); 179Debug.Assert(_labelIndex != UnknownInstrIndex); 267Debug.Assert(_tryHandler == null && tryHandler != null, "the tryHandler can be set only once"); 293Debug.Assert(_tryHandler != null, "the tryHandler must be set already"); 319Debug.Assert(instructions[index] is GotoInstruction, "should be the 'Goto' instruction that jumps out the try/catch/finally"); 325Debug.Assert(!(unwrappedException is RethrowException)); 353Debug.Assert(instructions[index] is GotoInstruction, "should be the 'Goto' instruction that jumps out the try/catch/finally"); 378Debug.Assert(!isFromJump || (isFromJump && _tryHandler.FinallyStartIndex == frame.InstructionIndex), "we should already jump to the first instruction of the finally"); 415Debug.Assert(tryHandler != null); 416Debug.Assert(_tryHandler == null, "the tryHandler can be set only once"); 422Debug.Assert(_tryHandler != null, "the tryHandler must be set already"); 451Debug.Assert(instructions[index] is GotoInstruction, "should be the 'Goto' instruction that jumps out the try/fault"); 567Debug.Assert(!frame.IsJumpHappened()); 590Debug.Assert(!frame.IsJumpHappened());
System\Linq\Expressions\Interpreter\DecrementInstruction.cs (1)
157Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\DefaultValueInstruction.cs (2)
17Debug.Assert(type.IsValueType); 18Debug.Assert(!type.IsNullableType());
System\Linq\Expressions\Interpreter\DivInstruction.cs (1)
165Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\EqualInstruction.cs (2)
528Debug.Assert(type.GetNonNullableType().GetTypeCode() == TypeCode.Double); 550Debug.Assert(type.IsNullableOrReferenceType());
System\Linq\Expressions\Interpreter\FieldOperations.cs (2)
27Debug.Assert(field.IsStatic); 88Debug.Assert(field.IsStatic);
System\Linq\Expressions\Interpreter\GreaterThanInstruction.cs (1)
279Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\GreaterThanOrEqualInstruction.cs (1)
279Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\IncrementInstruction.cs (1)
157Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\InstructionList.cs (5)
194Debug.Assert(instruction.ConsumedStack >= 0 && instruction.ProducedStack >= 0 && 198Debug.Assert(_currentStackDepth >= 0, $"negative stack depth {instruction}"); 206Debug.Assert(_currentContinuationsDepth >= 0, $"negative continuations {instruction}"); 239Debug.Assert(Count > 0); 770Debug.Assert(_instructions[_instructions.Count - 1] == NullCheckInstruction.Instance);
System\Linq\Expressions\Interpreter\InterpretedFrame.cs (2)
213Debug.Assert(_pendingContinuation >= 0); 255Debug.Assert(!gotoExceptionHandler || (gotoExceptionHandler && _continuationIndex == target.ContinuationStackDepth),
System\Linq\Expressions\Interpreter\LabelInfo.cs (1)
329Debug.Assert(CanJumpInto);
System\Linq\Expressions\Interpreter\LessThanInstruction.cs (1)
278Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\LessThanOrEqualInstruction.cs (1)
279Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\LightCompiler.cs (37)
43Debug.Assert(exceptionType != null); 71Debug.Assert((FinallyStartIndex != Instruction.UnknownInstrIndex) == (FinallyEndIndex != Instruction.UnknownInstrIndex)); 86Debug.Assert(handlers != null, "catch blocks should exist"); 220Debug.Assert(d1 != null && d2 != null); 329Debug.Assert(_instructions.CurrentStackDepth == (node.ReturnType != typeof(void) ? 1 : 0)); 461Debug.Assert(local.IsBoxed); 692Debug.Assert(fi != null); 898Debug.Assert(node.Right.Type == typeof(int)); 979Debug.Assert(IsNullComparison(left, right) || left.Type == right.Type || !left.Type.IsValueType && !right.Type.IsValueType); 989Debug.Assert(IsNullComparison(left, right) || left.Type == right.Type || !left.Type.IsValueType && !right.Type.IsValueType); 1000Debug.Assert(left.Type == right.Type && left.Type.IsNumeric()); 1017Debug.Assert(left.Type == right.Type && left.Type.IsArithmetic()); 1043Debug.Assert(parameters.Length == 1); 1115Debug.Assert(typeFrom != typeof(void) && typeTo != typeof(void)); 1360Debug.Assert(opTrue != null, "factory should check that the method exists"); 1366Debug.Assert(expr.Method.IsStatic); 1548Debug.Assert(node.Type == typeof(void)); 1644Debug.Assert(!hasValue); 1688Debug.Assert(!hasValue); 1744Debug.Assert(label != null); 1787Debug.Assert(_labelBlock != null && _labelBlock.Kind == kind); 1990Debug.Assert(enterTryInstr != null); 2071Debug.Assert(startOfFinally != null); 2087Debug.Assert(exHandlers != null); 2100Debug.Assert(expr.Finally == null); 2101Debug.Assert(expr.Handlers.Count == 0); 2107Debug.Assert(enterTryInstr == _instructions.GetInstruction(tryStart)); 2154Debug.Assert(parameters.Length == arguments.ArgumentCount); 2324Debug.Assert(member.Member is PropertyInfo); 2426Debug.Assert(type.IsValueType); 2451Debug.Assert(!forBinding); 2517Debug.Assert(typeof(NewArrayExpression).GetCustomAttribute<RequiresDynamicCodeAttribute>() is not null); 2534Debug.Assert(node.NodeType == ExpressionType.NewArrayBounds); 2900Debug.Assert(expr.NodeType == ExpressionType.TypeEqual); 2923Debug.Assert(expr.NodeType == ExpressionType.TypeIs); 3009Debug.Assert(_instructions.CurrentStackDepth == startingStackDepth); 3099Debug.Assert(_instructions.CurrentStackDepth == startingStackDepth + (expr.Type == typeof(void) ? 0 : 1),
System\Linq\Expressions\Interpreter\LightDelegateCreator.cs (2)
18Debug.Assert(interpreter != null); 19Debug.Assert(lambda != null);
System\Linq\Expressions\Interpreter\LocalAccess.cs (3)
273Debug.Assert(defaultValue != null); 377Debug.Assert(type.IsValueType, "MutableValue only supports value types."); 416Debug.Assert(type.IsValueType, "MutableBox only supports value types.");
System\Linq\Expressions\Interpreter\LocalVariables.cs (1)
115Debug.Assert(!local.IsBoxed && !local.InClosure);
System\Linq\Expressions\Interpreter\ModuloInstruction.cs (1)
165Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\MulInstruction.cs (2)
165Debug.Assert(type.IsArithmetic()); 302Debug.Assert(type.IsArithmetic());
System\Linq\Expressions\Interpreter\NegateInstruction.cs (2)
106Debug.Assert(!type.IsEnum); 182Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\NotEqualInstruction.cs (2)
510Debug.Assert(type.GetNonNullableType().GetTypeCode() == TypeCode.Double); 532Debug.Assert(type.IsNullableOrReferenceType());
System\Linq\Expressions\Interpreter\SubInstruction.cs (2)
165Debug.Assert(type.IsArithmetic()); 301Debug.Assert(type.IsArithmetic());
System\Linq\Expressions\Interpreter\TypeOperations.cs (8)
153Debug.Assert(mi.ReturnType.IsValueType, "Nullable is only allowed on value types."); 154Debug.Assert(!mi.ReturnType.IsNullableType()); 356Debug.Assert(!t.IsEnum); 386Debug.Assert(t.IsEnum); 393Debug.Assert( 410Debug.Assert(t.IsEnum); 417Debug.Assert(from != null); 456Debug.Assert(_t.GetTypeCode() == TypeCode.Boolean);
System\Linq\Expressions\Interpreter\Utilities.cs (6)
178Debug.Assert(key != null); 201Debug.Assert(key != null); 222Debug.Assert(key != null); 272Debug.Assert(key != null); 284Debug.Assert(key != null); 340Debug.Assert(var != null);
System\Linq\Expressions\InvocationExpression.cs (14)
146Debug.Assert(lambda != null); 147Debug.Assert(arguments == null || arguments.Length == _arguments.Count); 174Debug.Assert(lambda != null); 175Debug.Assert(arguments == null || arguments.Length == 0); 207Debug.Assert(lambda != null); 208Debug.Assert(arguments == null || arguments.Length == 1); 247Debug.Assert(lambda != null); 248Debug.Assert(arguments == null || arguments.Length == 2); 290Debug.Assert(lambda != null); 291Debug.Assert(arguments == null || arguments.Length == 3); 336Debug.Assert(lambda != null); 337Debug.Assert(arguments == null || arguments.Length == 4); 385Debug.Assert(lambda != null); 386Debug.Assert(arguments == null || arguments.Length == 5);
System\Linq\Expressions\LambdaExpression.cs (13)
122Debug.Assert(lambdaExpressionType.IsAssignableTo(typeof(LambdaExpression))); 145Debug.Assert(CanInterpret); 225Debug.Assert(CanInterpret); 377Debug.Assert(body != null); 378Debug.Assert(parameters == null || parameters.Length == 0); 421Debug.Assert(body != null); 422Debug.Assert(parameters == null || parameters.Length == 1); 483Debug.Assert(body != null); 484Debug.Assert(parameters == null || parameters.Length == 2); 551Debug.Assert(body != null); 552Debug.Assert(parameters == null || parameters.Length == 3); 584Debug.Assert(body != null); 585Debug.Assert(parameters == null || parameters.Length == _parameters.Count);
System\Linq\Expressions\MemberExpression.cs (2)
35Debug.Assert(property != null); 41Debug.Assert(field != null);
System\Linq\Expressions\MethodCallExpression.cs (25)
159Debug.Assert(instance != null); 191Debug.Assert(instance == null); 192Debug.Assert(args == null || args.Count == _arguments.Count); 222Debug.Assert(instance != null); 223Debug.Assert(args == null || args.Count == _arguments.Count); 253Debug.Assert(instance == null); 254Debug.Assert(args == null || args.Count == 0); 300Debug.Assert(instance == null); 301Debug.Assert(args == null || args.Count == 1); 366Debug.Assert(instance == null); 367Debug.Assert(args == null || args.Count == 2); 437Debug.Assert(instance == null); 438Debug.Assert(args == null || args.Count == 3); 514Debug.Assert(instance == null); 515Debug.Assert(args == null || args.Count == 4); 597Debug.Assert(instance == null); 598Debug.Assert(args == null || args.Count == 5); 633Debug.Assert(instance != null); 634Debug.Assert(args == null || args.Count == 0); 682Debug.Assert(instance != null); 683Debug.Assert(args == null || args.Count == 1); 747Debug.Assert(instance != null); 748Debug.Assert(args == null || args.Count == 2); 818Debug.Assert(instance != null); 819Debug.Assert(args == null || args.Count == 3);
System\Linq\Expressions\NewArrayExpression.cs (1)
28Debug.Assert(type.IsArray);
System\Linq\Expressions\TryExpression.cs (3)
184Debug.Assert(tryBody != null); 208Debug.Assert(cb.Body != null); 221Debug.Assert(cb.Body != null);
System\Linq\Expressions\TypeBinaryExpression.cs (1)
77Debug.Assert(TypeUtils.AreReferenceAssignable(typeof(object), Expression.Type), "Expecting reference types only after this point.");
System\Linq\Expressions\UnaryExpression.cs (8)
124Debug.Assert(Operand.NodeType == ExpressionType.Parameter); 145Debug.Assert(NodeType == ExpressionType.PreDecrementAssign || NodeType == ExpressionType.PostDecrementAssign); 262Debug.Assert(i == temps.Length); 268Debug.Assert(i == temps.Length); 271Debug.Assert(i == block.Length); 382Debug.Assert(method != null); 428Debug.Assert(method != null); 1063Debug.Assert(kind == ExpressionType.PreDecrementAssign || kind == ExpressionType.PostDecrementAssign);
System\Runtime\CompilerServices\CallSite.cs (3)
135Debug.Assert(s_cachedNoMatch != null, "all normal sites should have Update cached once there is an instance."); 140Debug.Assert(s_cachedUpdate != null, "all normal sites should have Update cached once there is an instance."); 191Debug.Assert(matchmaker?._match != false, "cached site should be set up for matchmaking");
System\Runtime\CompilerServices\CallSiteBinder.cs (1)
221Debug.Assert(result != null);
System\Runtime\CompilerServices\RuntimeOps.ExpressionQuoter.cs (1)
28Debug.Assert(hoistedLocals != null && locals != null);
System\Runtime\CompilerServices\RuntimeOps.RuntimeVariableList.cs (2)
76Debug.Assert(data != null); 77Debug.Assert(indexes != null);
System.Linq.Parallel (684)
System\Linq\Parallel\Channels\AsynchronousChannel.cs (21)
118Debug.Assert(chunkSize > 0, "chunk size must be greater than 0"); 119Debug.Assert(capacity > 1, "this impl doesn't support capacity of 1 or 0"); 258Debug.Assert(_producerChunk != null); 289Debug.Assert(chunk != null); 290Debug.Assert(!_done, "can't continue producing after the production is over"); 294Debug.Assert(!IsFull, "expected a non-full buffer"); 315Debug.Assert(_consumerEvent != null); 327Debug.Assert(_producerEvent != null); 383Debug.Assert(1 <= _producerChunkIndex && _producerChunkIndex <= _chunkSize); 410Debug.Assert(_consumerChunk == null); 418Debug.Assert(_consumerChunk != null, "consumer chunk is null"); 419Debug.Assert(0 <= _consumerChunkIndex && _consumerChunkIndex < _consumerChunk.Length, "chunk index out of bounds"); 488Debug.Assert(_consumerChunk == null); 496Debug.Assert(_consumerChunk != null, "consumer chunk is null"); 497Debug.Assert(0 <= _consumerChunkIndex && _consumerChunkIndex < _consumerChunk.Length, "chunk index out of bounds"); 587Debug.Assert(!IsChunkBufferEmpty, "single-consumer should never witness an empty queue here"); 606Debug.Assert(!IsChunkBufferEmpty); 630Debug.Assert(_producerEvent != null); 663Debug.Assert(_done, "Expected channel to be done before disposing"); 664Debug.Assert(_producerEvent != null); 665Debug.Assert(_consumerEvent != null);
System\Linq\Parallel\Channels\SynchronousChannel.cs (7)
67Debug.Assert(_queue != null); 69Debug.Assert(!_done, "trying to enqueue into the queue after production is done"); 89Debug.Assert(_queue != null); 91Debug.Assert(_done, "trying to dequeue before production is done -- this is not safe"); 117Debug.Assert(_queue != null && array != null); 119Debug.Assert(_done, "Can only copy from the channel after it's done being added to"); 132Debug.Assert(_queue != null);
System\Linq\Parallel\Enumerables\AggregationMinMaxHelpers.cs (4)
25Debug.Assert(source != null); 26Debug.Assert(sign == -1 || sign == 1); 101Debug.Assert(default(T) != null || element.Second != null, "nulls unexpected in final reduce"); 118Debug.Assert(accumulator.First || default(T) == null,
System\Linq\Parallel\Enumerables\EnumerableWrapperWeakToStrong.cs (2)
32Debug.Assert(wrappedEnumerable != null); 60Debug.Assert(wrappedEnumerator != null);
System\Linq\Parallel\Enumerables\OrderedParallelQuery.cs (1)
29Debug.Assert(sortOp is IOrderedEnumerable<TSource>);
System\Linq\Parallel\Enumerables\ParallelEnumerableWrapper.cs (3)
31Debug.Assert(source != null); 69Debug.Assert(wrappedEnumerable != null, "wrappedEnumerable must not be null."); 89Debug.Assert(_wrappedEnumerable != null);
System\Linq\Parallel\Enumerables\ParallelQuery.cs (4)
52Debug.Fail("The derived class must override this method."); 65Debug.Fail("The derived class must override this method."); 78Debug.Fail("The derived class must override this method."); 127Debug.Fail("The derived class must override this method.");
System\Linq\Parallel\Enumerables\RepeatEnumerable.cs (1)
33Debug.Assert(count >= 0, "count not within range (must be >= 0)");
System\Linq\Parallel\Merging\ArrayMergeHelper.cs (2)
76Debug.Fail("ArrayMergeHelper<>.GetEnumerator() is not intended to be used. Call GetResultsAsArray() instead."); 86Debug.Assert(_outputArray != null);
System\Linq\Parallel\Merging\AsynchronousChannelMergeEnumerator.cs (8)
48Debug.Assert(channels != null); 50foreach (AsynchronousChannel<T> c in channels) Debug.Assert(c != null); 153Debug.Assert(dequeueResult, "channel isn't empty, yet the dequeue failed, hmm"); 165Debug.Assert(_channels[currChannelIndex].IsDone, "thought this channel was done"); 166Debug.Assert(_channels[currChannelIndex].IsChunkBufferEmpty, "thought this channel was empty"); 226Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 227Debug.Assert(_consumerEvent != null); 271Debug.Assert(currChannelIndex == _channels.Length);
System\Linq\Parallel\Merging\DefaultMergeHelper.cs (8)
48Debug.Assert(partitions != null); 67Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 86Debug.Assert(_asyncChannels == null || _asyncChannels.Length == partitions.PartitionCount); 87Debug.Assert(_syncChannels == null || _syncChannels.Length == partitions.PartitionCount); 88Debug.Assert(_channelEnumerator != null, "enumerator can't be null if we're not ignoring output"); 103Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 118Debug.Assert(_partitions.PartitionCount == 1); 128Debug.Assert(_ignoreOutput || _channelEnumerator != null);
System\Linq\Parallel\Merging\MergeEnumerator.cs (2)
30Debug.Assert(taskGroupState != null); 68Debug.Assert(_taskGroupState.CancellationState.TopLevelDisposedFlag.Value);
System\Linq\Parallel\Merging\MergeExecutor.cs (9)
53Debug.Assert(partitions != null); 54Debug.Assert(partitions.PartitionCount > 0); 55Debug.Assert(!ignoreOutput || options == ParallelMergeOptions.FullyBuffered, "Pipelining with no output is not supported."); 62Debug.Assert(options == ParallelMergeOptions.NotBuffered || options == ParallelMergeOptions.AutoBuffered); 67Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 102Debug.Assert(_mergeHelper != null); 118Debug.Assert(_mergeHelper != null); 128Debug.Assert(_mergeHelper != null); 151Debug.Assert(options == ParallelMergeOptions.NotBuffered || options == ParallelMergeOptions.AutoBuffered);
System\Linq\Parallel\Merging\OrderPreservingMergeHelper.cs (2)
41Debug.Assert(partitions != null); 69Debug.Assert(_results.Value != null);
System\Linq\Parallel\Merging\OrderPreservingPipeliningMergeHelper.cs (10)
122Debug.Assert(partitions != null); 139Debug.Assert(typeof(TKey) == typeof(int)); 175Debug.Fail("An ordered pipelining merge is not intended to be used this way."); 375Debug.Fail("QueryEnd() should have thrown an exception."); 415Debug.Assert(_mergeHelper._producerDone[producer]); 421Debug.Assert(buffer.Count > 0, "Producer's buffer should not be empty here."); 427Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 452Debug.Assert(gotElement); 471Debug.Assert(_privateBuffer[producer]!.Count == 0); 535Debug.Assert(x.MaxKey >= 0 && y.MaxKey >= 0); // Guarantees no overflow on next line
System\Linq\Parallel\Merging\SynchronousChannelMergeEnumerator.cs (5)
36Debug.Assert(channels != null); 38foreach (SynchronousChannel<T> c in channels) Debug.Assert(c != null); 78Debug.Assert(_channels != null); 90Debug.Assert(current != null); 109Debug.Assert(_channelIndex == _channels.Length);
System\Linq\Parallel\Partitioning\HashRepartitionEnumerator.cs (15)
69Debug.Assert(source != null); 70Debug.Assert(keySelector != null || typeof(THashKey) == typeof(NoKeyMemoizationRequired)); 71Debug.Assert(repartitionStream != null); 72Debug.Assert(barrier != null); 73Debug.Assert(valueExchangeMatrix != null); 74Debug.Assert(valueExchangeMatrix.GetLength(0) == partitionCount, "expected square matrix of buffers (NxN)"); 75Debug.Assert(partitionCount > 0 && valueExchangeMatrix[0].Length == partitionCount, "expected square matrix of buffers (NxN)"); 76Debug.Assert(0 <= partitionIndex && partitionIndex < partitionCount); 88Debug.Assert(partitionCount == 1); 126Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 135Debug.Assert(mutables._currentBufferIndex != ENUMERATION_NOT_STARTED); 158Debug.Assert(mutables._currentBuffer == null || mutables._currentBuffer.Count > 0); 202Debug.Assert(mutables != null); 225Debug.Assert(typeof(THashKey) == typeof(NoKeyMemoizationRequired)); 229Debug.Assert(0 <= destinationIndex && destinationIndex < _partitionCount,
System\Linq\Parallel\Partitioning\HashRepartitionStream.cs (2)
54Debug.Assert(_keyComparer == null || _elementComparer == null); 55Debug.Assert(_elementComparer == null || typeof(THashKey) == typeof(NoKeyMemoizationRequired));
System\Linq\Parallel\Partitioning\OrderedHashRepartitionEnumerator.cs (19)
71Debug.Assert(source != null); 72Debug.Assert(keySelector != null || typeof(THashKey) == typeof(NoKeyMemoizationRequired)); 73Debug.Assert(repartitionStream != null); 74Debug.Assert(barrier != null); 75Debug.Assert(valueExchangeMatrix != null); 76Debug.Assert(valueExchangeMatrix.GetLength(0) == partitionCount, "expected square matrix of buffers (NxN)"); 77Debug.Assert(partitionCount > 0 && valueExchangeMatrix[0].Length == partitionCount, "expected square matrix of buffers (NxN)"); 78Debug.Assert(0 <= partitionIndex && partitionIndex < partitionCount); 124Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 133Debug.Assert(mutables._currentBufferIndex != ENUMERATION_NOT_STARTED); 145Debug.Assert(mutables._currentKeyBuffer != null); 151Debug.Assert(mutables._currentKeyBuffer != null, "expected same # of buffers/key-buffers"); 161Debug.Assert(mutables._currentBuffer == null || mutables._currentBuffer.Count > 0); 162Debug.Assert((mutables._currentBuffer == null) == (mutables._currentKeyBuffer == null)); 163Debug.Assert(mutables._currentBuffer == null || mutables._currentBuffer.Count == mutables._currentKeyBuffer!.Count); 208Debug.Assert(mutables != null); 232Debug.Assert(typeof(THashKey) == typeof(NoKeyMemoizationRequired)); 236Debug.Assert(0 <= destinationIndex && destinationIndex < _partitionCount, 249Debug.Assert(keyBuffer == null);
System\Linq\Parallel\Partitioning\PartitionedDataSource.cs (41)
74Debug.Assert(source != null); 75Debug.Assert(partitionCount > 0); 81Debug.Assert(source != null); 138Debug.Assert(partitions.Length == partitionCount); 161Debug.Assert(source != null); 162Debug.Assert(partitionCount > 0); 238Debug.Assert(data != null, "data mustn't be null"); 239Debug.Assert(partitionCount > 0, "partitionCount must be positive"); 240Debug.Assert(partitionIndex >= 0, "partitionIndex can't be negative"); 241Debug.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount"); 242Debug.Assert(maxChunkSize > 0, "maxChunkSize must be positive or -1"); 251Debug.Assert(sectionSize > 0); 277Debug.Assert(mutables != null); 278Debug.Assert(mutables._currentPositionInChunk >= mutables._currentChunkSize); 340Debug.Assert(data != null, "data must not be null"); 341Debug.Assert(partitionCount > 0, "partitionCount must be positive"); 342Debug.Assert(partitionIndex >= 0, "partitionIndex can't be negative"); 343Debug.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount"); 360Debug.Assert(_currentIndex == null, "Expected deferred allocation to ensure it happens on correct thread"); 409Debug.Assert(data != null, "data must not be null"); 410Debug.Assert(partitionCount > 0, "partitionCount must be positive"); 411Debug.Assert(partitionIndex >= 0, "partitionIndex can't be negative"); 412Debug.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount"); 413Debug.Assert(maxChunkSize > 0, "maxChunkSize must be positive or -1"); 422Debug.Assert(sectionSize > 0); 448Debug.Assert(mutables != null); 449Debug.Assert(mutables._currentPositionInChunk >= mutables._currentChunkSize); 511Debug.Assert(data != null, "data must not be null"); 512Debug.Assert(partitionCount > 0, "partitionCount must be positive"); 513Debug.Assert(partitionIndex >= 0, "partitionIndex can't be negative"); 514Debug.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount"); 531Debug.Assert(_currentIndex == null, "Expected deferred allocation to ensure it happens on correct thread"); 595Debug.Assert(source != null); 596Debug.Assert(sourceSyncLock != null); 597Debug.Assert(currentIndex != null); 614Debug.Assert(mutables._chunkBuffer != null); 624Debug.Assert(_source != null); 625Debug.Assert(chunkBuffer != null); 626Debug.Assert(mutables._currentChunkSize > 0); 627Debug.Assert(0 <= currentChunkIndex && currentChunkIndex < chunkBuffer.Length); 641Debug.Assert(0 <= mutables._nextChunkMaxSize && mutables._nextChunkMaxSize <= chunkBuffer.Length);
System\Linq\Parallel\Partitioning\PartitionedStream.cs (7)
40Debug.Assert(partitionCount > 0); 57Debug.Assert(_partitions != null); 58Debug.Assert(0 <= index && index < _partitions.Length, "index out of bounds"); 63Debug.Assert(_partitions != null); 64Debug.Assert(value != null); 65Debug.Assert(0 <= index && index < _partitions.Length, "index out of bounds"); 78Debug.Assert(_partitions != null);
System\Linq\Parallel\QueryOperators\AssociativeAggregationOperator.cs (16)
78Debug.Assert(child != null, "child data source cannot be null"); 79Debug.Assert(intermediateReduce != null, "need an intermediate reduce function"); 80Debug.Assert(finalReduce != null, "need a final reduce function"); 81Debug.Assert(resultSelector != null, "need a result selector function"); 82Debug.Assert(options.IsValidQueryAggregationOption(), "enum out of valid range"); 83Debug.Assert((options & QueryAggregationOptions.Associative) == QueryAggregationOptions.Associative, "expected an associative operator"); 84Debug.Assert(typeof(TIntermediate) == typeof(TInput) || seedIsSpecified, "seed must be specified if TIntermediate differs from TInput"); 105Debug.Assert(_finalReduce != null); 106Debug.Assert(_resultSelector != null); 204Debug.Fail("This method should never be called. Associative aggregation can always be parallelized."); 242Debug.Assert(source != null); 243Debug.Assert(reduceOperator != null); 261Debug.Assert(_reduceOperator != null); 262Debug.Assert(_reduceOperator._intermediateReduce != null, "expected a compiled operator"); 286Debug.Assert(typeof(TInput) == typeof(TIntermediate)); 319Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Binary\ConcatQueryOperator.cs (10)
42Debug.Assert(firstChild != null, "first child data source cannot be null"); 43Debug.Assert(secondChild != null, "second child data source cannot be null"); 90Debug.Assert(!ExchangeUtilities.IsWorseThan(leftStream.OrdinalIndexState, OrdinalIndexState.Increasing)); 109Debug.Assert(!ExchangeUtilities.IsWorseThan(rightStream.OrdinalIndexState, OrdinalIndexState.Increasing)); 172Debug.Assert(firstSource != null); 173Debug.Assert(secondSource != null); 189Debug.Assert(_firstSource != null); 190Debug.Assert(_secondSource != null); 257Debug.Assert(leftChildQueryResults.IsIndexible && rightChildQueryResults.IsIndexible); 272Debug.Assert(_leftChildCount >= 0 && _rightChildCount >= 0);
System\Linq\Parallel\QueryOperators\Binary\ExceptQueryOperator.cs (13)
34Debug.Assert(left != null && right != null, "child data sources cannot be null"); 56Debug.Assert(leftStream.PartitionCount == rightStream.PartitionCount); 156Debug.Assert(leftSource != null); 157Debug.Assert(rightSource != null); 171Debug.Assert(_leftSource != null); 172Debug.Assert(_rightSource != null); 199Debug.Assert(_outputLoopCount != null); 221Debug.Assert(_leftSource != null && _rightSource != null); 248Debug.Assert(leftSource != null); 249Debug.Assert(rightSource != null); 264Debug.Assert(_leftSource != null); 265Debug.Assert(_rightSource != null); 326Debug.Assert(_leftSource != null && _rightSource != null);
System\Linq\Parallel\QueryOperators\Binary\GroupJoinQueryOperator.cs (10)
44Debug.Assert(left != null && right != null, "child data sources cannot be null"); 45Debug.Assert(leftKeySelector != null, "left key selector must not be null"); 46Debug.Assert(rightKeySelector != null, "right key selector must not be null"); 47Debug.Assert(resultSelector != null, "need a result selector function"); 75Debug.Assert(rightStream.PartitionCount == leftStream.PartitionCount); 224Debug.Assert(dataSource != null); 250Debug.Assert(baseLookup != null); 314Debug.Assert(dataSource != null); 354Debug.Assert(baseLookup != null); 434Debug.Assert(baseLookup != null);
System\Linq\Parallel\QueryOperators\Binary\HashJoinQueryOperatorEnumerator.cs (13)
69Debug.Assert(leftSource != null); 70Debug.Assert(rightLookupBuilder != null); 71Debug.Assert(resultSelector != null); 72Debug.Assert(outputKeyBuilder != null); 95Debug.Assert(_resultSelector != null, "expected a compiled result selector"); 96Debug.Assert(_leftSource != null); 97Debug.Assert(_rightLookupBuilder != null); 133Debug.Assert(mutables._rightHashLookup != null); 139Debug.Assert(mutables._currentRightMatches == null || mutables._currentRightMatches.Count > 0, 164Debug.Assert(mutables._currentRightMatches != null); 165Debug.Assert(0 <= mutables._currentRightMatchesIndex && mutables._currentRightMatchesIndex < mutables._currentRightMatches.Count); 179Debug.Assert(_leftSource != null && _rightLookupBuilder != null); 241Debug.Assert(dataSource != null);
System\Linq\Parallel\QueryOperators\Binary\IntersectQueryOperator.cs (13)
33Debug.Assert(left != null && right != null, "child data sources cannot be null"); 58Debug.Assert(leftPartitionedStream.PartitionCount == rightPartitionedStream.PartitionCount); 144Debug.Assert(leftSource != null); 145Debug.Assert(rightSource != null); 159Debug.Assert(_leftSource != null); 160Debug.Assert(_rightSource != null); 188Debug.Assert(_outputLoopCount != null); 210Debug.Assert(_leftSource != null && _rightSource != null); 247Debug.Assert(leftSource != null); 248Debug.Assert(rightSource != null); 263Debug.Assert(_leftSource != null); 264Debug.Assert(_rightSource != null); 325Debug.Assert(_leftSource != null && _rightSource != null);
System\Linq\Parallel\QueryOperators\Binary\JoinQueryOperator.cs (9)
60Debug.Assert(left != null && right != null, "child data sources cannot be null"); 61Debug.Assert(leftKeySelector != null, "left key selector must not be null"); 62Debug.Assert(rightKeySelector != null, "right key selector must not be null"); 63Debug.Assert(resultSelector != null, "need a result selector function"); 78Debug.Assert(rightStream.PartitionCount == leftStream.PartitionCount); 201Debug.Assert(dataSource != null); 220Debug.Assert(_dataSource != null); 234Debug.Assert(baseLookup != null); 271Debug.Assert(baseLookup != null);
System\Linq\Parallel\QueryOperators\Binary\UnionQueryOperator.cs (11)
33Debug.Assert(left != null && right != null, "child data sources cannot be null"); 60Debug.Assert(leftStream.PartitionCount == rightStream.PartitionCount); 202Debug.Assert(leftSource != null); 203Debug.Assert(rightSource != null); 223Debug.Assert(_hashLookup != null); 263Debug.Assert(_outputLoopCount != null); 315Debug.Assert(leftSource != null); 316Debug.Assert(rightSource != null); 335Debug.Assert(_leftSource != null); 336Debug.Assert(_rightSource != null); 397Debug.Assert(_leftSource != null && _rightSource != null);
System\Linq\Parallel\QueryOperators\Binary\ZipQueryOperator.cs (7)
60Debug.Assert(resultSelector != null, "operator cannot be null"); 88Debug.Assert(settings.DegreeOfParallelism != null); 90Debug.Assert(settings.TaskScheduler != null); 97Debug.Assert(merger.MergeExecutor != null); 108Debug.Assert(merger.MergeExecutor != null); 181Debug.Assert(_leftChildResults.IsIndexible); 182Debug.Assert(_rightChildResults.IsIndexible);
System\Linq\Parallel\QueryOperators\BinaryQueryOperator.cs (5)
42Debug.Assert(leftChild != null && rightChild != null); 105Debug.Assert(IsIndexible == (_op.OrdinalIndexState == OrdinalIndexState.Indexable)); 106Debug.Assert(_settings.ExecutionMode != null); 110Debug.Assert(_settings.DegreeOfParallelism != null); 119Debug.Assert(_settings.DegreeOfParallelism != null);
System\Linq\Parallel\QueryOperators\Inlined\CountAggregationOperator.cs (2)
89Debug.Assert(source != null); 133Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DecimalAverageAggregationOperator.cs (2)
96Debug.Assert(source != null); 145Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DecimalMinMaxAggregationOperator.cs (3)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 114Debug.Assert(source != null); 175Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DecimalSumAggregationOperator.cs (2)
83Debug.Assert(source != null); 126Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DoubleAverageAggregationOperator.cs (2)
97Debug.Assert(source != null); 146Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DoubleMinMaxAggregationOperator.cs (3)
35Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 121Debug.Assert(source != null); 183Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DoubleSumAggregationOperator.cs (2)
83Debug.Assert(source != null); 125Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\FloatAverageAggregationOperator.cs (2)
97Debug.Assert(source != null); 146Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\FloatMinMaxAggregationOperator.cs (3)
34Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 119Debug.Assert(source != null); 180Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\FloatSumAggregationOperator.cs (2)
84Debug.Assert(source != null); 127Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\InlinedAggregationOperator.cs (2)
37Debug.Assert(child != null, "child data source cannot be null"); 140Debug.Fail("This method should never be called. Associative aggregation can always be parallelized.");
System\Linq\Parallel\QueryOperators\Inlined\IntAverageAggregationOperator.cs (2)
96Debug.Assert(source != null); 145Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\IntMinMaxAggregationOperator.cs (3)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 114Debug.Assert(source != null); 176Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\IntSumAggregationOperator.cs (2)
87Debug.Assert(source != null); 133Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\LongAverageAggregationOperator.cs (2)
96Debug.Assert(source != null); 145Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\LongCountAggregationOperator.cs (2)
87Debug.Assert(source != null); 132Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\LongMinMaxAggregationOperator.cs (3)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 115Debug.Assert(source != null); 177Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\LongSumAggregationOperator.cs (2)
86Debug.Assert(source != null); 132Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalAverageAggregationOperator.cs (2)
95Debug.Assert(source != null); 139Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalMinMaxAggregationOperator.cs (3)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 113Debug.Assert(source != null); 175Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalSumAggregationOperator.cs (2)
83Debug.Assert(source != null); 126Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleAverageAggregationOperator.cs (2)
95Debug.Assert(source != null); 139Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleMinMaxAggregationOperator.cs (3)
35Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 121Debug.Assert(source != null); 185Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleSumAggregationOperator.cs (2)
83Debug.Assert(source != null); 127Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableFloatAverageAggregationOperator.cs (2)
95Debug.Assert(source != null); 140Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableFloatMinMaxAggregationOperator.cs (3)
35Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 121Debug.Assert(source != null); 185Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableFloatSumAggregationOperator.cs (2)
83Debug.Assert(source != null); 126Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableIntAverageAggregationOperator.cs (2)
95Debug.Assert(source != null); 140Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableIntMinMaxAggregationOperator.cs (3)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 113Debug.Assert(source != null); 174Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableIntSumAggregationOperator.cs (2)
86Debug.Assert(source != null); 131Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableLongAverageAggregationOperator.cs (2)
96Debug.Assert(source != null); 140Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableLongMinMaxAggregationOperator.cs (3)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 114Debug.Assert(source != null); 176Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableLongSumAggregationOperator.cs (2)
87Debug.Assert(source != null); 133Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\PartitionedStreamMerger.cs (1)
38Debug.Assert(_received, "Cannot return the merge executor because Receive() has not been called yet.");
System\Linq\Parallel\QueryOperators\PartitionerQueryOperator.cs (3)
130Debug.Assert(_settings.DegreeOfParallelism.HasValue); 233Debug.Assert(_sourceEnumerator != null); 263Debug.Assert(_sourceEnumerator != null);
System\Linq\Parallel\QueryOperators\QueryOpeningEnumerator.cs (1)
50Debug.Assert(queryOperator != null);
System\Linq\Parallel\QueryOperators\QueryOperator.cs (14)
127Debug.Assert(querySettings.ExecutionMode != null); 138Debug.Assert(mergeOptions != null); 152Debug.Assert(querySettings.TaskScheduler != null); 166Debug.Assert(merger.MergeExecutor != null); 178Debug.Assert(querySettings.TaskScheduler != null); 179Debug.Assert(querySettings.DegreeOfParallelism.HasValue); 180Debug.Assert(querySettings.ExecutionMode.HasValue); 200Debug.Assert(querySettings.ExecutionMode != null); 233Debug.Assert(querySettings.TaskScheduler != null); 238Debug.Assert(merger.MergeExecutor != null); 241Debug.Assert(output != null); 287Debug.Assert(taskScheduler != null); 310Debug.Assert(source != null); 335Debug.Assert(sourceAsOperator != null);
System\Linq\Parallel\QueryOperators\QueryOperatorEnumerator.cs (1)
60Debug.Assert(operatorEnumerator != null);
System\Linq\Parallel\QueryOperators\QueryResults.cs (2)
63Debug.Fail("GetElement property is not supported by non-indexable query results"); 78Debug.Fail("ElementsCount property is not supported by non-indexable query results");
System\Linq\Parallel\QueryOperators\QuerySettings.cs (13)
40Debug.Assert(_cancellationState != null); 93Debug.Assert(_cancellationState != null); 149Debug.Assert(topLevelCancellationTokenSource != null, "There should always be a top-level cancellation signal specified."); 159Debug.Assert(settings.CancellationState.InternalCancellationTokenSource != null); 160Debug.Assert(settings.CancellationState.MergedCancellationToken.CanBeCanceled); 161Debug.Assert(settings.CancellationState.TopLevelDisposedFlag != null); 185Debug.Assert(settings.TaskScheduler != null); 186Debug.Assert(settings.DegreeOfParallelism.HasValue); 187Debug.Assert(settings.DegreeOfParallelism.Value >= 1 && settings.DegreeOfParallelism <= Scheduling.MAX_SUPPORTED_DOP); 188Debug.Assert(settings.ExecutionMode != null); 189Debug.Assert(settings.MergeOptions != null); 191Debug.Assert(settings.MergeOptions != ParallelMergeOptions.Default); 207Debug.Assert(_cancellationState.MergedCancellationTokenSource != null);
System\Linq\Parallel\QueryOperators\ScanQueryOperator.cs (3)
33Debug.Assert(data != null); 59Debug.Assert(settings.DegreeOfParallelism.HasValue); 131Debug.Assert(_settings.DegreeOfParallelism != null);
System\Linq\Parallel\QueryOperators\Unary\AnyAllSearchOperator.cs (8)
54Debug.Assert(child != null, "child data source cannot be null"); 55Debug.Assert(predicate != null, "need a predicate function"); 129Debug.Fail("This method should never be called as it is an ending operator with LimitsParallelism=false."); 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 (7)
40Debug.Assert(child != null, "child data source cannot be null"); 107Debug.Fail("This method should never be called as it is an ending operator with LimitsParallelism=false."); 144Debug.Assert(source != null); 145Debug.Assert(comparer != null); 146Debug.Assert(resultFoundFlag != null); 164Debug.Assert(_comparer != null); 211Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\DefaultIfEmptyQueryOperator.cs (8)
40Debug.Assert(child != null, "child data source cannot be null"); 62Debug.Assert(partitionCount == 1); 125Debug.Assert(source != null); 126Debug.Assert(0 <= partitionIndex && partitionIndex < partitionCount); 127Debug.Assert(partitionCount > 0); 128Debug.Assert(sharedEmptyCount != null); 129Debug.Assert(sharedLatch != null); 146Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\DistinctQueryOperator.cs (9)
34Debug.Assert(source != null, "child data source cannot be null"); 134Debug.Assert(source != null); 146Debug.Assert(_source != null); 147Debug.Assert(_hashLookup != null); 176Debug.Assert(_source != null); 210Debug.Assert(source != null); 226Debug.Assert(_source != null); 227Debug.Assert(_hashLookup != null); 272Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\ElementAtQueryOperator.cs (9)
40Debug.Assert(child != null, "child data source cannot be null"); 41Debug.Assert(index >= 0, "index can't be less than 0"); 75Debug.Assert(intKeyStream.OrdinalIndexState == OrdinalIndexState.Indexable); 103Debug.Fail("This method should never be called as fallback to sequential is handled in Aggregate()."); 152Debug.Assert(!e.MoveNext(), "expected enumerator to be empty"); 182Debug.Assert(source != null); 183Debug.Assert(index >= 0); 184Debug.Assert(resultFoundFlag != null); 225Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\FirstQueryOperator.cs (8)
39Debug.Assert(child != null, "child data source cannot be null"); 76Debug.Assert(partitionCount == 1); 103Debug.Fail("This method should never be called as fallback to sequential is handled in ParallelEnumerable.First()."); 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 (9)
35Debug.Assert(child != null, "child data source cannot be null"); 36Debug.Assert(elementAction != null, "need a function"); 47Debug.Assert(_elementAction != null); 65Debug.Assert(enumerator == null); 105Debug.Fail("AsSequentialQuery is not supported on ForAllOperator"); 136Debug.Assert(source != null); 137Debug.Assert(elementAction != null); 151Debug.Assert(_elementAction != null, "expected a compiled operator"); 173Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\GroupByQueryOperator.cs (25)
56Debug.Assert(child != null, "child data source cannot be null"); 57Debug.Assert(keySelector != null, "need a selector function"); 58Debug.Assert(elementSelector != null || 114Debug.Assert(typeof(TSource) == typeof(TElement)); 153Debug.Assert(typeof(TSource) == typeof(TElement)); 192Debug.Assert(typeof(TElement) == typeof(TSource)); 243Debug.Assert(source != null); 258Debug.Assert(_source != null); 271Debug.Assert(mutables._hashLookup != null); 345Debug.Assert(currentValue != null); 374Debug.Assert(elementSelector != null); 407Debug.Assert(currentValue != null); 446Debug.Assert(source != null); 447Debug.Assert(keySelector != null); 464Debug.Assert(_source != null); 465Debug.Assert(_keySelector != null); 478Debug.Assert(mutables._hashLookup != null); 582Debug.Assert(currentValue != null); 616Debug.Assert(elementSelector != null); 657Debug.Assert(currentValue != null); 689Debug.Assert(keyValues.Value != null); 711Debug.Assert(_keyValues.Value != null); 759Debug.Assert(_sortedValues != null); 774Debug.Assert(_values != null); 784Debug.Assert(_values != null);
System\Linq\Parallel\QueryOperators\Unary\IndexedSelectQueryOperator.cs (9)
47Debug.Assert(child != null, "child data source cannot be null"); 48Debug.Assert(selector != null, "need a selector function"); 71Debug.Assert(!ExchangeUtilities.IsWorseThan(indexState, OrdinalIndexState.Correct)); 103Debug.Assert(typeof(TKey) == typeof(int)); 145Debug.Assert(source != null); 146Debug.Assert(selector != null); 161Debug.Assert(_selector != null, "expected a compiled selection function"); 217Debug.Assert(_childQueryResults.IsIndexible); 226Debug.Assert(_childCount >= 0);
System\Linq\Parallel\QueryOperators\Unary\IndexedWhereQueryOperator.cs (7)
46Debug.Assert(child != null, "child data source cannot be null"); 47Debug.Assert(predicate != null, "need a filter function"); 97Debug.Assert(typeof(TKey) == typeof(int)); 152Debug.Assert(source != null); 153Debug.Assert(predicate != null); 165Debug.Assert(_predicate != null, "expected a compiled operator"); 188Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\LastQueryOperator.cs (8)
40Debug.Assert(child != null, "child data source cannot be null"); 76Debug.Assert(partitionCount == 1); 99Debug.Fail("This method should never be called as fallback to sequential is handled in ParallelEnumerable.First()."); 139Debug.Assert(source != null); 140Debug.Assert(operatorState != null); 141Debug.Assert(sharedBarrier != null); 142Debug.Assert(keyComparer != null); 159Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\ReverseQueryOperator.cs (9)
41Debug.Assert(child != null, "child data source cannot be null"); 56Debug.Assert(Child.OrdinalIndexState != OrdinalIndexState.Indexable, "Don't take this code path if the child is indexable."); 118Debug.Assert(source != null); 147Debug.Assert(_bufferIndex != null); 196Debug.Assert(_childQueryResults.IsIndexible); 209Debug.Assert(_count >= 0); 216Debug.Assert(_count >= 0); 217Debug.Assert(index >= 0); 218Debug.Assert(index < _count);
System\Linq\Parallel\QueryOperators\Unary\SelectManyQueryOperator.cs (21)
58Debug.Assert(leftChild != null, "left child data source cannot be null"); 59Debug.Assert(rightChildSelector != null || indexedRightChildSelector != null, 61Debug.Assert(rightChildSelector == null || indexedRightChildSelector == null, 63Debug.Assert(typeof(TRightInput) == typeof(TOutput) || resultSelector != null, 208Debug.Assert(_indexedRightChildSelector != null); 261Debug.Assert(leftSource != null); 262Debug.Assert(selectManyOperator != null); 294Debug.Assert(_selectManyOperator._indexedRightChildSelector != null); 299Debug.Assert(rightChild != null); 302Debug.Assert(_currentRightSource != null); 313Debug.Assert(_currentRightSourceAsOutput == _currentRightSource, 320Debug.Assert(_mutables != null); 333Debug.Assert(_currentRightSourceAsOutput != null); 390Debug.Assert(leftSource != null); 391Debug.Assert(selectManyOperator != null); 424Debug.Assert(_selectManyOperator._rightChildSelector != null); 428Debug.Assert(rightChild != null); 431Debug.Assert(_currentRightSource != null); 442Debug.Assert(_currentRightSourceAsOutput == _currentRightSource, 449Debug.Assert(_mutables != null); 462Debug.Assert(_currentRightSourceAsOutput != null);
System\Linq\Parallel\QueryOperators\Unary\SelectQueryOperator.cs (9)
42Debug.Assert(child != null, "child data source cannot be null"); 43Debug.Assert(selector != null, "need a selector function"); 104Debug.Assert(source != null); 105Debug.Assert(selector != null); 120Debug.Assert(_selector != null, "expected a compiled operator"); 163Debug.Assert(op._selector != null); 165Debug.Assert(_childQueryResults.IsIndexible); 181Debug.Assert(index >= 0); 182Debug.Assert(index < ElementsCount);
System\Linq\Parallel\QueryOperators\Unary\SingleQueryOperator.cs (5)
39Debug.Assert(child != null, "child data source cannot be null"); 78Debug.Fail("This method should never be called as it is an ending operator with LimitsParallelism=false."); 113Debug.Assert(source != null); 114Debug.Assert(totalElementCount != null); 127Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\SortQueryOperator.cs (5)
36Debug.Assert(keySelector != null, "key selector must not be null"); 180Debug.Assert(source != null); 181Debug.Assert(keySelector != null, "need a key comparer"); 195Debug.Assert(_source != null); 209Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipQueryOperator.cs (16)
51Debug.Assert(child != null, "child data source cannot be null"); 89Debug.Assert(Child.OrdinalIndexState != OrdinalIndexState.Indexable, "Don't take this code path if the child is indexable."); 112Debug.Assert(partitionCount == 1); 175Debug.Assert(source != null); 176Debug.Assert(sharedIndices != null); 177Debug.Assert(sharedBarrier != null); 178Debug.Assert(keyComparer != null); 195Debug.Assert(_sharedIndices != null); 243Debug.Assert(_buffer != null && _bufferIndex != null); 275Debug.Assert(_buffer != null && _bufferIndex != null); 298Debug.Assert(_count <= 0 || _keyComparer.Compare(currentKey, minKey) > 0, 360Debug.Assert(_childQueryResults.IsIndexible); 374Debug.Assert(_childCount >= 0); 388Debug.Assert(_childCount >= 0); 389Debug.Assert(index >= 0); 390Debug.Assert(index < ElementsCount);
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipWhileQueryOperator.cs (14)
71Debug.Assert(child != null, "child data source cannot be null"); 72Debug.Assert(predicate != null || indexedPredicate != null, "need a predicate function"); 131Debug.Assert(partitionCount == 1); 137Debug.Assert(_indexedPredicate == null || typeof(TKey) == typeof(int)); 176Debug.Assert(_predicate != null); 186Debug.Assert(_predicate != null); 232Debug.Assert(source != null); 233Debug.Assert(predicate != null || indexedPredicate != null); 234Debug.Assert(operatorState != null); 235Debug.Assert(sharedBarrier != null); 236Debug.Assert(keyComparer != null); 303Debug.Assert(_indexedPredicate != null); 342Debug.Assert(_bufferIndex != null); 390Debug.Assert(_keyComparer.Compare(currentKey, _operatorState._currentLowKey) > 0,
System\Linq\Parallel\QueryOperators\Unary\WhereQueryOperator.cs (6)
41Debug.Assert(child != null, "child data source cannot be null"); 42Debug.Assert(predicate != null, "need a filter function"); 116Debug.Assert(source != null); 117Debug.Assert(predicate != null); 130Debug.Assert(_predicate != null, "expected a compiled operator"); 152Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\UnaryQueryOperator.cs (2)
110Debug.Assert(IsIndexible == (_op.OrdinalIndexState == OrdinalIndexState.Indexable)); 112Debug.Assert(_settings.ExecutionMode != null && _settings.DegreeOfParallelism != null);
System\Linq\Parallel\Scheduling\OrderPreservingPipeliningSpoolingTask.cs (12)
67Debug.Assert(partition != null); 68Debug.Assert(taskGroupState != null); 69Debug.Assert(consumerWaiting != null); 70Debug.Assert(producerWaiting != null && producerWaiting.Length == consumerWaiting.Length); 71Debug.Assert(producerDone != null && producerDone.Length == consumerWaiting.Length); 72Debug.Assert(buffers != null && buffers.Length == consumerWaiting.Length); 73Debug.Assert(partitionIndex >= 0 && partitionIndex < consumerWaiting.Length); 153Debug.Assert(groupState != null); 154Debug.Assert(partitions != null); 155Debug.Assert(producerDone != null && producerDone.Length == partitions.PartitionCount); 156Debug.Assert(buffers != null && buffers.Length == partitions.PartitionCount); 157Debug.Assert(bufferLocks != null);
System\Linq\Parallel\Scheduling\OrderPreservingSpoolingTask.cs (9)
48Debug.Assert(groupState != null); 49Debug.Assert(results != null); 50Debug.Assert(sortHelper != null); 74Debug.Assert(groupState != null); 75Debug.Assert(partitions != null); 76Debug.Assert(results != null); 77Debug.Assert(results.Value == null); 131Debug.Assert(_sortHelper != null); 143Debug.Assert(sortedOutput != null);
System\Linq\Parallel\Scheduling\QueryTask.cs (6)
35Debug.Assert(groupState != null); 46Debug.Assert(o != null); 62Debug.Assert(taskScheduler == TaskScheduler.Default, "PLINQ queries can currently execute only on the default scheduler."); 75Debug.Assert(o != null); 81Debug.Assert(taskScheduler == TaskScheduler.Default, "PLINQ queries can currently execute only on the default scheduler."); 94Debug.Assert(unused == null);
System\Linq\Parallel\Scheduling\QueryTaskGroupState.cs (4)
73Debug.Assert(rootTask != null, "Expected a non-null task"); 74Debug.Assert(_rootTask == null, "Cannot begin a query more than once"); 86Debug.Assert(_rootTask != null); 158Debug.Assert(_cancellationState.TopLevelDisposedFlag.Value);
System\Linq\Parallel\Scheduling\Scheduling.cs (1)
88Debug.Assert((DEFAULT_BYTES_PER_CHUNK % IntPtr.Size) == 0, "bytes per chunk should be a multiple of pointer size");
System\Linq\Parallel\Scheduling\SpoolingTask.cs (8)
36Debug.Assert(partitions.PartitionCount == channels.Length); 37Debug.Assert(groupState != null); 92Debug.Assert(partitions.PartitionCount == channels.Length); 93Debug.Assert(groupState != null); 136Debug.Assert(groupState != null); 207Debug.Assert(source != null); 296Debug.Assert(source != null); 380Debug.Assert(source != null);
System\Linq\Parallel\Scheduling\SpoolingTaskBase.cs (1)
62Debug.Assert(_groupState.CancellationState.InternalCancellationTokenSource != null);
System\Linq\Parallel\Utils\ExchangeUtilities.cs (1)
71Debug.Assert(returnValue.PartitionCount == partitionCount);
System\Linq\Parallel\Utils\FixedMaxHeap.cs (3)
36Debug.Assert(comparer != null); 133Debug.Assert(_count > 0); 144Debug.Assert(_count > 0);
System\Linq\Parallel\Utils\GrowingArray.cs (1)
56Debug.Assert(newSize > _array.Length);
System\Linq\Parallel\Utils\ListChunk.cs (2)
31Debug.Assert(size > 0); 81Debug.Assert(curr._chunkCount == curr._chunk.Length || curr._nextChunk == null);
System\Linq\Parallel\Utils\Lookup.cs (2)
115Debug.Assert(_defaultKeyGrouping == null, "Cannot insert two groupings with the default key into a lookup."); 121Debug.Assert(!_dict.ContainsKey(grouping.Key));
System\Linq\Parallel\Utils\Sorting.cs (32)
62Debug.Assert(source != null); 63Debug.Assert(groupState != null); 64Debug.Assert(sharedIndices != null); 65Debug.Assert(sharedkeys != null); 66Debug.Assert(sharedValues != null); 67Debug.Assert(sharedBarriers != null); 68Debug.Assert(sharedIndices.Length <= sharedkeys.Length); 69Debug.Assert(sharedIndices.Length == sharedValues.Length); 86Debug.Assert(_sharedKeys.Length >= _sharedValues.Length); 194Debug.Assert(sourceValues != null, "values weren't populated"); 195Debug.Assert(sourceKeys != null, "keys weren't populated"); 203Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 267Debug.Assert(keys != null); 268Debug.Assert(values != null); 269Debug.Assert(keys.Count == values.Count); 425Debug.Assert(myKeysArr != null); 435Debug.Assert(myIndices != null); 451Debug.Assert(mergedIndices != null); 458Debug.Assert(rightIndices != null); 465Debug.Assert(mergedIndices != null); 499Debug.Assert(leftValues != null); 500Debug.Assert(leftKeys != null); 512Debug.Assert(myIndices != null); 522Debug.Assert(leftIndices != null); 529Debug.Assert(mergedIndices != null); 542Debug.Assert(mergedIndices != null); 584Debug.Assert(keys != null, "need a non-null keyset"); 585Debug.Assert(keys.Length >= indices.Length); 586Debug.Assert(left <= right); 587Debug.Assert(0 <= left && left < keys.Length); 588Debug.Assert(0 <= right && right < keys.Length); 608Debug.Assert(i >= left && j <= right, "(i>=left && j<=right) sort failed - bogus IComparer?");
System\Linq\Parallel\Utils\TraceHelpers.cs (1)
22Debug.WriteLine(string.Format(msg, args));
System\Linq\Parallel\Utils\WrapperEqualityComparer.cs (2)
29Debug.Assert(_comparer != null); 35Debug.Assert(_comparer != null);
System\Linq\ParallelEnumerable.cs (11)
1524Debug.Assert(source != null); 1525Debug.Assert(reduce != null); 1526Debug.Assert(options.IsValidQueryAggregationOption(), "enum is out of range"); 1547Debug.Assert(source != null); 1548Debug.Assert(func != null); 1549Debug.Assert(seedIsSpecified || typeof(TSource) == typeof(TAccumulate)); 4888Debug.Assert(input != null); 5150Debug.Assert(groupings is QueryOperator<IGrouping<TKey, TSource>>); 5237Debug.Assert(groupings is QueryOperator<IGrouping<TKey, TElement>>); 5334Debug.Assert(queryOp != null, "expected query operator"); 5353Debug.Assert(!e.MoveNext(), "expected only a single element");
System.Linq.Queryable (4)
System\Linq\EnumerableRewriter.cs (4)
227Debug.Assert(matchingMethods.Length > 0, "All static methods with arguments on Queryable have equivalents on Enumerable."); 247Debug.Assert(matchingMethods.Length > 1); 273Debug.Fail("Search should have found a maximal element"); 278Debug.Assert(left.Length == right.Length);
System.Memory (55)
src\libraries\Common\src\System\Buffers\ArrayBufferWriter.cs (5)
95Debug.Assert(_buffer.Length >= _index); 164Debug.Assert(_buffer.Length > _index); 195Debug.Assert(_buffer.Length > _index); 227Debug.Assert(needed > currentLength); 240Debug.Assert(FreeCapacity > 0 && FreeCapacity >= sizeHint);
System\Buffers\ReadOnlySequence.cs (9)
81Debug.Assert((startSegment != null && endSegment != null) || 205Debug.Assert(startObject != null); 230Debug.Assert(beginObject != null); 305Debug.Assert(sliceEndIndex >= 0 && startIndex >= 0 && endIndex >= 0); 334Debug.Assert(start <= int.MaxValue - startIndex); 387Debug.Assert(sliceStartIndex >= 0 && startIndex >= 0 && endIndex >= 0); 417Debug.Assert(length <= int.MaxValue - sliceStartIndex); 560Debug.Assert(positionSequenceObject != null); 578Debug.Assert(currentSegment!.RunningIndex + positionIndex >= 0);
System\Buffers\ReadOnlySequence.Helpers.cs (27)
32Debug.Assert(positionObject is ReadOnlySequenceSegment<T>); 58Debug.Assert(positionObject is T[]); 64Debug.Assert(positionObject is string); 70Debug.Assert(type == SequenceType.MemoryManager); 71Debug.Assert(positionObject is MemoryManager<T>); 130Debug.Assert(startIndex < 0 || endIndex < 0); 135Debug.Assert(endIndex < 0); 206Debug.Assert(startIndex < 0 || endIndex < 0); 211Debug.Assert(endIndex < 0); 244Debug.Assert(startObject != null); 260Debug.Assert(startObject == endObject); 280Debug.Assert(startObject != null); 296Debug.Assert(startObject == endObject); 309Debug.Assert(currentSegment != null); // currentSegment parameter is marked as nullable as the parameter is reused/reassigned in the body 310Debug.Assert(offset >= 0); 359Debug.Assert(position.GetObject() != null); 397Debug.Assert(sliceStartIndex >= 0 && startIndex >= 0 && endIndex >= 0); 530Debug.Assert(_endObject != null); 547Debug.Assert(_startObject != null); 564Debug.Assert(_startObject != null); 575Debug.Assert(start <= int.MaxValue); 576Debug.Assert(end <= int.MaxValue); 577Debug.Assert(start <= end); 601Debug.Assert(start <= long.MaxValue); 602Debug.Assert(end <= long.MaxValue); 603Debug.Assert(start <= end); 678Debug.Assert(startIndex < 0);
System\Buffers\SequenceReader.cs (7)
148Debug.Assert(CurrentSpanIndex + offset >= 0); 153Debug.Assert(offset <= int.MaxValue); 335Debug.Assert(count >= 0); 350Debug.Assert(count >= 0); 355Debug.Assert(CurrentSpanIndex < CurrentSpan.Length); 381Debug.Assert(count >= 0); 434Debug.Assert(firstSpan.Length < destination.Length);
System\Buffers\SequenceReader.Search.cs (4)
78Debug.Assert(sequence.Length > 0); 195Debug.Assert(skip >= 0); 439Debug.Assert(sequence.Length > 0); 809Debug.Assert(currentSpan.Length < next.Length);
System\Buffers\SequenceReaderExtensions.Binary.cs (1)
39Debug.Assert(reader.UnreadSpan.Length < sizeof(T));
System\Text\EncodingExtensions.cs (2)
209Debug.Assert(remainingBytes.IsEmpty, "Over-allocated the byte[] instance?"); 395Debug.Assert(span.IsEmpty, "Over-allocated the string instance?");
System.Net.Http (842)
src\libraries\Common\src\System\CharArrayHelpers.cs (4)
13Debug.Assert(array != null, "Null array"); 14Debug.Assert(startIndex >= 0, $"Expected {nameof(startIndex)} to be >= 0, got {startIndex}"); 15Debug.Assert(length >= 0, $"Expected {nameof(length)} to be >= 0, got {length}"); 16Debug.Assert(startIndex <= array.Length - length, $"Expected {startIndex} to be <= {array.Length} - {length}, got {startIndex}");
src\libraries\Common\src\System\Collections\Generic\BidirectionalDictionary.cs (2)
26Debug.Assert(_forward.Count == _backward.Count, "both the dictionaries must have the same number of elements"); 33Debug.Assert(!_backward.ContainsKey(item2), "No added item1 should ever have existing item2");
src\libraries\Common\src\System\HexConverter.cs (3)
165Debug.Assert(chars.Length >= bytes.Length * 2); 332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\IO\DelegatingStream.cs (1)
65Debug.Assert(innerStream != null);
src\libraries\Common\src\System\Net\ArrayBuffer.cs (10)
34Debug.Assert(initialSize > 0 || usePool); 46Debug.Assert(buffer.Length > 0); 71Debug.Assert(_usePool); 72Debug.Assert(_bytes is not null); 99Debug.Assert(byteCount <= ActiveLength, $"Expected {byteCount} <= {ActiveLength}"); 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\HPackDecoder.cs (4)
177Debug.Fail("HPACK decoder reach an invalid state"); 244Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 256Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 310Debug.Assert(_state == State.Ready, "Should be ready to parse a new header.");
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackEncoder.cs (19)
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); 603Debug.Assert(success, $"Stack-allocated space was too small for index '{index}'."); 615Debug.Assert(success, $"Stack-allocated space was too small for \"{name}\".");
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\IntegerDecoder.cs (2)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8); 40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\Frames\Http3Frame.cs (1)
43Debug.Assert(VariableLengthIntegerHelper.GetByteCount((long)frameType) == 1, $"{nameof(TryWriteFrameEnvelope)} assumes {nameof(frameType)} will fit within a single byte varint.");
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\Helpers\VariableLengthIntegerHelper.cs (9)
69Debug.Assert((firstByte & LengthMask) == InitialEightByteLengthMask); 73Debug.Assert(value >= 0 && value <= EightByteLimit, "Serialized values are within [0, 2^62)."); 118Debug.Assert(result); 119Debug.Assert(bytesRead == length); 149Debug.Assert(longToEncode >= 0); 150Debug.Assert(longToEncode <= EightByteLimit); 193Debug.Assert(res); 199Debug.Assert(value >= 0); 200Debug.Assert(value <= EightByteLimit);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\HeaderField.cs (1)
17Debug.Assert(name.Length > 0);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackDecoder.cs (3)
233Debug.Fail("QPACK decoder reach an invalid state"); 428Debug.Assert(_state == State.CompressedHeaders, "Should be ready to parse a new header."); 646Debug.Assert(_stringOctets != null, "String buffer should have a value.");
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackEncoder.cs (14)
42Debug.Assert(res); 97Debug.Assert(res); 106Debug.Assert(res); 167Debug.Assert(res); 177Debug.Assert(res); 204Debug.Assert(written == encodedStringLength); 235Debug.Assert(separator != null); 236Debug.Assert(Ascii.IsValid(separator)); 303Debug.Assert(buffer.Length >= s.Length); 312Debug.Assert(status == OperationStatus.Done); 313Debug.Assert(bytesWritten == s.Length); 318Debug.Assert(Ascii.IsValid(s)); 331Debug.Assert(status == OperationStatus.Done); 332Debug.Assert(valueBytesWritten == s.Length);
src\libraries\Common\src\System\Net\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\InternalException.cs (1)
16Debug.Fail($"InternalException thrown for unexpected value: {unexpectedValue}");
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 (40)
38Debug.Assert(initialBufferSize >= 0); 70Debug.Assert(byteCount >= 0); 71Debug.Assert(byteCount <= ActiveMemory.Length, $"MultiArrayBuffer.Discard: Expected byteCount={byteCount} <= {ActiveMemory.Length}"); 112Debug.Assert(toReturn is not null); 120Debug.Assert(byteCount >= 0); 121Debug.Assert(byteCount <= AvailableMemory.Length, $"MultiArrayBuffer.Commit: Expected byteCount={byteCount} <= {AvailableMemory.Length}"); 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); 220Debug.Assert(_activeStart / BlockSize == 0, $"Start is not in first block after move or resize?? _activeStart={_activeStart}"); 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); 257Debug.Assert(_allocatedEnd % BlockSize == 0, $"_allocatedEnd={_allocatedEnd} not at block boundary?"); 264Debug.Assert(_blocks[i] is null); 269Debug.Assert(_blocks[i] is not null); 274Debug.Assert(_blocks[i] is null); 279Debug.Assert(_activeStart == 0, $"No active bytes but _activeStart={_activeStart}"); 307Debug.Assert(blocks is not null); 308Debug.Assert(start <= int.MaxValue); 309Debug.Assert(length <= int.MaxValue); 310Debug.Assert(start + length <= blocks.Length * BlockSize); 349Debug.Assert(_length > 0, "Length should never be 0 here because BlockCount would be 0"); 350Debug.Assert(_blocks is not null); 355Debug.Assert(0 <= startInBlock, $"Invalid startInBlock={startInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}"); 356Debug.Assert(startInBlock < endInBlock, $"Invalid startInBlock={startInBlock}, endInBlock={endInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}"); 357Debug.Assert(endInBlock <= BlockSize, $"Invalid endInBlock={endInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}");
src\libraries\Common\src\System\Net\Security\SslClientAuthenticationOptionsExtensions.cs (6)
39Debug.Assert(properties.Length == 13); 48Debug.Assert(cloneEnumerable != null, $"{pi.Name}. Expected enumerable cloned value."); 58Debug.Assert(e2.MoveNext(), $"{pi.Name}. Cloned enumerator too short."); 59Debug.Assert(Equals(e1.Current, e2.Current), $"{pi.Name}. Cloned enumerator's values don't match."); 61Debug.Assert(!e2.MoveNext(), $"{pi.Name}. Cloned enumerator too long."); 75Debug.Assert(Equals(origValue, cloneValue), $"{pi.Name}. Expected: {origValue}, Actual: {cloneValue}");
src\libraries\Common\src\System\StrongToWeakReference.cs (2)
17Debug.Assert(obj != null, "Expected non-null obj"); 28Debug.Assert(_strongRef != null, $"Expected non-null {nameof(_strongRef)} after setting");
src\libraries\Common\src\System\Text\SimpleRegex.cs (1)
68Debug.Assert(patternPos <= pattern.Length);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0); 298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
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 (3)
27Debug.Assert(startIndex >= 0); 28Debug.Assert(startIndex < value.Length); 322Debug.Assert(value[startIndex] == '"' && value[startIndex + quotedLength - 1] == '"', $"{nameof(HttpRuleParser.GetQuotedStringLength)} should return {nameof(HttpParseResult.NotParsed)} if the opening/closing quotes are missing.");
System\Net\Http\Headers\AuthenticationHeaderValue.cs (4)
48Debug.Assert(source != null); 118Debug.Assert(startIndex >= 0); 236Debug.Assert(parseEndIndex < input.Length, "Expected string to have at least 1 char"); 237Debug.Assert(input[parseEndIndex] == ',');
System\Net\Http\Headers\ByteArrayHeaderParser.cs (1)
22Debug.Assert(value is byte[]);
System\Net\Http\Headers\CacheControlHeaderParser.cs (1)
48Debug.Assert(isInvalidValue || storeValue == null || temp != null, "'storeValue' is not of type CacheControlHeaderValue");
System\Net\Http\Headers\CacheControlHeaderValue.cs (5)
67Debug.Assert(sizeof(Flags) == sizeof(int)); 171Debug.Assert(source != null); 351Debug.Assert(startIndex >= 0); 371Debug.Assert(nameValue is not null); 491Debug.Assert(nameValue != null);
System\Net\Http\Headers\ContentDispositionHeaderValue.cs (5)
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 (8)
31Debug.Assert(customHeader || KnownHeaders.TryGetKnownHeader(headerName) is null, $"The {nameof(KnownHeader)} overload should be used for {headerName}"); 61Debug.Assert(!string.IsNullOrEmpty(headerName)); 83Debug.Assert(headerName.Length > 0); 104Debug.Assert(index >= 0); 108Debug.Assert(qpackStaticTable.Length == 99); 127Debug.Assert(_descriptor is KnownHeader); 128Debug.Assert(HeaderType != HttpHeaderType.Custom); 253Debug.Assert(candidate is null || candidate.Length == contentTypeValue.Length);
System\Net\Http\Headers\HeaderUtilities.cs (8)
32Debug.Assert(parameters != null); 124Debug.Assert(parameters != null); 210Debug.Assert(xItem != null); 237Debug.Assert(Array.TrueForAll(alreadyFound, value => value), 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 (66)
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); 307Debug.Assert(_count != 0 && entries is not null, "Caller should have validated the collection is not empty"); 327Debug.Assert(Contains(entry.Key)); 352Debug.Assert(value != null); 353Debug.Assert(descriptor.Parser != null, "Can't add parsed value if there is no parser available."); 359Debug.Assert(descriptor.Parser.SupportsMultipleValues, $"Header '{descriptor.Name}' doesn't support multiple values"); 366Debug.Assert(value != null); 367Debug.Assert(descriptor.Parser != null, "Can't add parsed value if there is no parser available."); 395Debug.Assert(value != null); 401Debug.Assert(descriptor.Parser != null, "Can't add parsed value if there is no parser available."); 402Debug.Assert(descriptor.Parser.SupportsMultipleValues, 420Debug.Assert(parsedValue.GetType() == value.GetType(), 436Debug.Assert(item.GetType() == value.GetType(), 462Debug.Assert(headerRemoved, $"Existing header '{descriptor.Name}' couldn't be removed."); 473Debug.Assert(value != null); 479Debug.Assert(descriptor.Parser != null, "Can't add parsed value if there is no parser available."); 480Debug.Assert(descriptor.Parser.SupportsMultipleValues, 498Debug.Assert(parsedValue.GetType() == value.GetType(), 510Debug.Assert(item.GetType() == value.GetType(), 529Debug.Assert(sourceHeaders != null); 530Debug.Assert(GetType() == sourceHeaders.GetType(), "Can only copy headers from an instance of the same type."); 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); 833Debug.Assert(index < value.Length, "Parser must return an index value within the string length."); 876Debug.Assert(value != null); 886Debug.Assert(!(value is List<object>), 919Debug.Assert(currentStoreValue is T); 923Debug.Assert(value is T); 967Debug.Assert(info != null); 1001Debug.Assert(index < value.Length, "Parser must return an index value within the string length."); 1091Debug.Assert(singleValue is not null ^ multiValue is not null); 1100Debug.Assert(sourceValues is string); 1119Debug.Assert(length > 1, "The header should have been removed when it became empty"); 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); 1239Debug.Assert(parser != null, "There should be no reason to call CanAddValue if there is no parser for the current header."); 1262Debug.Assert(item is not InvalidValue); 1267Debug.Assert(ParsedAndInvalidValues is not InvalidValue); 1311Debug.Assert(count == 1, "Only a single parsed value should be stored for this parser"); 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 (3)
43Debug.Assert(source != null); 133Debug.Assert(startIndex >= 0); 171Debug.Assert(current == input.Length, "GetRangeItemListLength() should consume the whole string or fail.");
System\Net\Http\Headers\RangeItemHeaderValue.cs (4)
46Debug.Assert(source != null); 82Debug.Assert(rangeCollection != null); 83Debug.Assert(startIndex >= 0); 129Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\RetryConditionHeaderValue.cs (2)
38Debug.Assert(source != null); 79Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\StringWithQualityHeaderValue.cs (2)
42Debug.Assert(source != null); 87Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\TimeSpanHeaderParser.cs (1)
20Debug.Assert(value is TimeSpan);
System\Net\Http\Headers\TransferCodingHeaderParser.cs (1)
25Debug.Assert(transferCodingCreator != null);
System\Net\Http\Headers\TransferCodingHeaderValue.cs (3)
28Debug.Assert(source != null); 63Debug.Assert(transferCodingCreator != null); 64Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\UriHeaderParser.cs (1)
90Debug.Assert(value is Uri);
System\Net\Http\Headers\ViaHeaderValue.cs (3)
71Debug.Assert(source != null); 158Debug.Assert(startIndex >= 0); 176Debug.Assert(protocolVersion != null);
System\Net\Http\Headers\WarningHeaderValue.cs (3)
53Debug.Assert(source != null); 123Debug.Assert(startIndex >= 0); 211Debug.Fail("Unable to parse value even though it was parsed as <=3 digits string. Input: '" +
System\Net\Http\HttpClient.cs (2)
129Debug.Assert(HttpContent.MaxBufferSize <= int.MaxValue); 612Debug.Assert(_timeout.TotalSeconds > 0);
System\Net\Http\HttpContent.cs (23)
80Debug.Assert(encoding != null); 81Debug.Assert(preamble != null); 83Debug.Assert(codePage == encoding.CodePage, 89Debug.Assert(preambleLength == actualPreamble.Length, 93Debug.Assert(actualPreamble.Length >= 2); 96Debug.Assert(first2Bytes == actualFirst2Bytes, 100Debug.Assert(preamble.Length == actualPreamble.Length, 106Debug.Assert(preamble[i] == actualPreamble[i], 150Debug.Assert(IsBuffered); 235Debug.Assert(_bufferedContent != null); 296Debug.Assert(_contentReadStream is Stream, $"Expected a Stream, got ${_contentReadStream}"); 325Debug.Assert(_contentReadStream is Task<Stream>, $"Expected a Task<Stream>, got ${_contentReadStream}"); 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 (13)
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)); 274Debug.Fail("'NotParsed' is unexpected: We started nested expression " + 284Debug.Fail("Unknown enum result: " + nestedResult);
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 (2)
156Debug.Assert(Enum.GetValues<HttpRequestError>().Length == 12, "We need to extend the mapping in case new values are added to HttpRequestError."); 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 (20)
25Debug.Assert(response != null, "The HttpResponseMessage cannot be null."); 71Debug.Assert(_connection.RemainingBuffer.Length == 0); 72Debug.Assert(buffer.Length != 0); 154Debug.Assert(_state == ParsingState.Done); 166Debug.Assert(_connection != null); 187Debug.Assert(_connection.RemainingBuffer.Length == 0); 188Debug.Assert(buffer.Length != 0); 296Debug.Assert(buffer.Length > 0); 305Debug.Assert(bytesRead.Length <= buffer.Length); 315Debug.Assert(_connection != null); 323Debug.Assert(_chunkBytesRemaining == 0, $"Expected {nameof(_chunkBytesRemaining)} == 0, got {_chunkBytesRemaining}"); 359Debug.Assert(_chunkBytesRemaining > 0); 368Debug.Assert(bytesToConsume > 0 || maxBytesToRead == 0); 380Debug.Assert(_chunkBytesRemaining == 0, $"Expected {nameof(_chunkBytesRemaining)} == 0, got {_chunkBytesRemaining}"); 396Debug.Assert(_chunkBytesRemaining == 0, $"Expected {nameof(_chunkBytesRemaining)} == 0, got {_chunkBytesRemaining}"); 421Debug.Fail($"Unexpected state: {_state}"); 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 (42)
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); 166Debug.Fail("Unknown HttpConnectionKind in HttpConnectionPool.ctor"); 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); 904Debug.Assert((_availableHttp2Connections?.Count ?? 0) == 0, $"Expected {nameof(_availableHttp2Connections)}.{nameof(_availableHttp2Connections.Count)} == 0");
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http1.cs (14)
105Debug.Assert(_associatedHttp11ConnectionCount >= connectionCount + _pendingHttp11ConnectionCount, 108Debug.Assert(_associatedHttp11ConnectionCount <= _maxHttp11Connections, 110Debug.Assert(_associatedHttp11ConnectionCount >= _pendingHttp11ConnectionCount, 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 (21)
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); 369Debug.Assert(isNewConnection || initialRequestWaiter is null, "Shouldn't have a request unless the connection is new"); 375Debug.Assert(_availableHttp2Connections is null || !_availableHttp2Connections.Contains(connection)); 376Debug.Assert(_associatedHttp2ConnectionCount > (_availableHttp2Connections?.Count ?? 0)); 394Debug.Assert(_availableHttp2Connections is null || !_availableHttp2Connections.Contains(connection), $"HTTP2 connection already in available list"); 395Debug.Assert(_associatedHttp2ConnectionCount > (_availableHttp2Connections?.Count ?? 0), 400Debug.Assert(_pendingHttp2Connection); 418Debug.Assert((_availableHttp2Connections?.Count ?? 0) == 0, $"With {(_availableHttp2Connections?.Count ?? 0)} available HTTP2 connections, we shouldn't have a waiter."); 437Debug.Assert(!added); 456Debug.Assert(_disposed); 467Debug.Assert(initialRequestWaiter is not null, "Expect request for a new connection"); 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 (3)
50Debug.Assert(_size > 0); 166Debug.Assert(_attemptedConnectionsOffset >= 0); 167Debug.Assert(_attemptedConnectionsOffset < _size, $"{_attemptedConnectionsOffset} < {_size}");
System\Net\Http\SocketsHttpHandler\ContentLengthReadStream.cs (12)
19Debug.Assert(contentLength > 0, "Caller should have checked for 0."); 31Debug.Assert(_contentBytesRemaining > 0); 44Debug.Assert((ulong)bytesRead <= _contentBytesRemaining); 67Debug.Assert(_contentBytesRemaining > 0); 106Debug.Assert((ulong)bytesRead <= _contentBytesRemaining); 146Debug.Assert(_connection != null); 174Debug.Assert(maxBytesToRead > 0); 175Debug.Assert(_contentBytesRemaining > 0); 176Debug.Assert(_connection != null); 185Debug.Assert(bytesToConsume > 0); 197Debug.Assert(_connection != null); 198Debug.Assert(_contentBytesRemaining > 0);
System\Net\Http\SocketsHttpHandler\ContentLengthWriteStream.cs (2)
32Debug.Assert(connection._currentRequest != null); 46Debug.Assert(connection._currentRequest != null);
System\Net\Http\SocketsHttpHandler\CookieHelper.cs (2)
18Debug.Assert(valuesArray.Length > 0, "No values for header??"); 19Debug.Assert(response.RequestMessage != null && response.RequestMessage.RequestUri != null);
System\Net\Http\SocketsHttpHandler\CreditManager.cs (7)
22Debug.Assert(owner != null); 23Debug.Assert(!string.IsNullOrWhiteSpace(name)); 97Debug.Assert(_current <= 0 || _waitersTail is null, "Shouldn't have waiters when credit is available"); 105Debug.Assert(waiter != null); 111Debug.Assert(_waitersTail == waiter); 161Debug.Assert(Monitor.IsEntered(SyncObject), "Shouldn't be called outside lock."); 167Debug.Assert(_waitersTail is null, "Shouldn't have waiters when credit is available");
System\Net\Http\SocketsHttpHandler\DecompressionHandler.cs (9)
28Debug.Assert(decompressionMethods != DecompressionMethods.None); 29Debug.Assert(innerHandler != null); 71Debug.Assert(response.Content != null); 157Debug.Assert(task.IsCompleted); 333Debug.Assert(_firstByteStatus == FirstByteStatus.None); 349Debug.Assert(_firstByteStatus == FirstByteStatus.None); 379Debug.Assert(_firstByteStatus == FirstByteStatus.Consumed); 397Debug.Assert(_firstByteStatus == FirstByteStatus.Consumed); 403Debug.Assert(_firstByteStatus != FirstByteStatus.None);
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (56)
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); 345Debug.Assert(_availableStreamsWaiter is null, "As used currently, shouldn't already have a waiter"); 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); 1139Debug.Assert(canceled, "Callback should have been unregistered if the operation was completing successfully."); 1186Debug.Assert(_shutdown && _streamsInUse == 0); 1266Debug.Fail($"Unexpected exception in {nameof(ProcessOutgoingFramesAsync)}: {e}"); 1291Debug.Assert(sizeof(long) == FrameHeader.PingLength); 1315Debug.Assert(!_pool.HasSyncObjLock); 1425Debug.Assert(headerValuesCount > 0, "No values for header??"); 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); 1857Debug.Assert(completed, "FinalTeardown was called twice"); 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); 2077Debug.Fail($"Stream {http2Stream.StreamId} not found in dictionary during RemoveStream???"); 2142Debug.Fail($"Unexpected keep alive state ({_keepAliveState})");
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (71)
170Debug.Assert(_response != null); 182Debug.Assert(_requestCompletionState == StreamCompletionState.Completed); 187Debug.Assert(_requestBodyCancellationSource != null); 245Debug.Assert(!Monitor.IsEntered(SyncObject)); 248Debug.Assert(_requestCompletionState == StreamCompletionState.InProgress, $"Request already completed with state={_requestCompletionState}"); 255Debug.Assert(_responseCompletionState == StreamCompletionState.Completed); 257Debug.Assert(!ConnectProtocolEstablished); 265Debug.Assert(!sendReset); 269Debug.Assert(!ConnectProtocolEstablished); 287Debug.Assert(!Monitor.IsEntered(SyncObject)); 291Debug.Assert(_requestCompletionState == StreamCompletionState.InProgress, $"Request already completed with state={_requestCompletionState}"); 322Debug.Assert(!ConnectProtocolEstablished); 335Debug.Assert(_request?.Content != null); 364Debug.Assert(Monitor.IsEntered(SyncObject)); 365Debug.Assert(_requestCompletionState != StreamCompletionState.InProgress); 366Debug.Assert(_responseCompletionState != StreamCompletionState.InProgress); 367Debug.Assert(_requestCompletionState == StreamCompletionState.Failed || _responseCompletionState == StreamCompletionState.Failed, 383Debug.Assert(Monitor.IsEntered(SyncObject)); 384Debug.Assert(_requestCompletionState != StreamCompletionState.InProgress); 385Debug.Assert(_responseCompletionState != StreamCompletionState.InProgress); 410Debug.Assert(!Monitor.IsEntered(SyncObject)); 416Debug.Assert(requestBodyCancellationSource != null); 453Debug.Assert(Monitor.IsEntered(SyncObject)); 555Debug.Assert(index >= FirstHPackRequestPseudoHeaderId && index <= LastHPackNormalHeaderId); 578Debug.Assert(index >= FirstHPackRequestPseudoHeaderId && index <= LastHPackNormalHeaderId); 619Debug.Assert(!Monitor.IsEntered(SyncObject)); 641Debug.Assert(_response != null); 683Debug.Assert(!Monitor.IsEntered(SyncObject)); 710Debug.Assert(_trailers != null); 716Debug.Assert(_response != null && _response.Content != null); 722Debug.Assert(_response != null); 731Debug.Assert(name.Length > 0); 763Debug.Assert(!Monitor.IsEntered(SyncObject)); 786Debug.Assert(!Monitor.IsEntered(SyncObject)); 827Debug.Assert(_responseCompletionState == StreamCompletionState.InProgress, $"Response already completed with state={_responseCompletionState}"); 850Debug.Assert(_requestCompletionState != StreamCompletionState.Failed); 869Debug.Assert(!Monitor.IsEntered(SyncObject)); 901Debug.Assert(_responseCompletionState == StreamCompletionState.InProgress, $"Response already completed with state={_responseCompletionState}"); 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 (21)
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); 537Debug.Fail($"Received unexpected frame type {frameType}."); 564Debug.Assert(_sendBuffer.ActiveLength == 0); 588Debug.Assert(request.RequestUri != null); 648Debug.Assert(actualHeadersLengthEncodedSize == headersLengthEncodedSize); 676Debug.Assert(headerValuesCount > 0, "No values for header??"); 898Debug.Assert(name.Length > 0); 980Debug.Fail(message); 1053Debug.Fail($"Unexpected {nameof(Http3RequestStream)}.{nameof(_headerState)} '{_headerState}'."); 1061Debug.Fail($"This has no use in HTTP/3 and should never be called by {nameof(QPackDecoder)}."); 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 (71)
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); 401Debug.Assert(headerValuesCount > 0, "No values for header??"); 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); 498Debug.Assert(_currentRequest == null, $"Expected null {nameof(_currentRequest)}."); 499Debug.Assert(_readBuffer.ActiveLength == 0, "Unexpected data in read buffer"); 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); 1729Debug.Assert(_readAheadTask == default, "Read ahead task should have been consumed as part of the headers."); 1747Debug.Assert(_readAheadTask == default, "Read ahead task should have been consumed as part of the headers."); 1768Debug.Assert(_readAheadTask == default, "Read ahead task should have been consumed as part of the headers."); 1775Debug.Assert(_readBuffer.AvailableLength == _readBuffer.Capacity); 1806Debug.Assert(_readAheadTask == default, "Read ahead task should have been consumed as part of the headers."); 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); 1896Debug.Assert(_readBuffer.ActiveLength == 0, "HttpConnection's buffer should have been empty."); 1946Debug.Assert(origReadBuffer.Length > 0); 1967Debug.Assert(_currentRequest == null); 1968Debug.Assert(!_inUse); 1975Debug.Assert(_inUse); 1993Debug.Assert(_inUse); 2000Debug.Assert(_currentRequest != null, "Expected the connection to be associated with a request."); 2001Debug.Assert(_writeBuffer.ActiveLength == 0, "Everything in write buffer should have been flushed."); 2031Debug.Assert(_inUse); 2038Debug.Assert(response.Content != null); 2042Debug.Assert(responseStream != null || stream is EmptyReadStream); 2046Debug.Assert(response.RequestMessage == _currentRequest); 2055Debug.Assert(_currentRequest == null); 2062Debug.Assert(_currentRequest == null, "Connection should no longer be associated with a request."); 2063Debug.Assert(_readAheadTask == default, "Expected a previous initial read to already be consumed."); 2064Debug.Assert(_readAheadTaskStatus == ReadAheadTask_NotStarted, "Expected SendAsync to reset the read-ahead task status."); 2065Debug.Assert(_readBuffer.ActiveLength == 0, "Unexpected data in connection read buffer."); 2082Debug.Assert(!_detachedFromPool, "Should not be detached from pool unless _connectionClose is true");
System\Net\Http\SocketsHttpHandler\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 (2)
44Debug.Fail($"DrainAsync should not be called for this response stream: {GetType()}"); 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 (9)
51Debug.Assert(failedProxyCache != null); 80Debug.Assert(failedProxyCache != null); 98Debug.Assert(_failedProxyCache != null); 115Debug.Assert(_failedProxyCache != null); 141Debug.Assert(uri != null); 155Debug.Assert(_uris != null || _proxyConfig != null, $"{nameof(ReadNext)} must not be called on a default-initialized {nameof(MultiProxy)}."); 171Debug.Assert(_proxyConfig != null); 177Debug.Assert(_currentIndex <= _proxyConfig.Length); 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 (7)
54Debug.Fail("Bad socks version."); 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 (46)
src\libraries\Common\src\System\HexConverter.cs (3)
165Debug.Assert(chars.Length >= bytes.Length * 2); 332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Net\CookieParser.cs (3)
539Debug.Assert(method != null, "We need to use an internal method named InternalSetName that is declared on Cookie."); 557Debug.Assert(field != null, "We need to use an internal field named IsQuotedDomain that is declared on Cookie."); 574Debug.Assert(field != null, "We need to use an internal field named IsQuotedVersion that is declared on Cookie.");
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (3)
261Debug.Assert(value != DBNull.Value, "Result can't be set to DBNull - it's a special internal value."); 263Debug.Assert(!InternalPeekCompleted, "Called on completed result."); 402Debug.Assert(state is LazyAsyncResult);
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.Associate.cs (1)
35Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\WebHeaderEncoding.cs (1)
23Debug.Assert(bytes != null && (uint)byteIndex <= (uint)bytes.Length && (uint)(byteIndex + byteCount) <= (uint)bytes.Length);
src\libraries\Common\src\System\Net\WebSockets\WebSocketValidate.cs (1)
121Debug.Assert(!string.IsNullOrEmpty(parameterName), "'parameterName' MUST NOT be NULL or string.Empty");
System\Net\HttpListener.cs (1)
210Debug.Assert(operationStatus == OperationStatus.Done);
System\Net\HttpListenerRequestUriBuilder.cs (16)
49Debug.Assert(!string.IsNullOrEmpty(rawUri), "Empty raw URL."); 50Debug.Assert(!string.IsNullOrEmpty(cookedUriScheme), "Empty cooked URL scheme."); 51Debug.Assert(!string.IsNullOrEmpty(cookedUriHost), "Empty cooked URL host."); 52Debug.Assert(!string.IsNullOrEmpty(cookedUriPath), "Empty cooked URL path."); 122Debug.Assert((type == EncodingType.Primary) || (type == EncodingType.Secondary), $"Unknown 'EncodingType' value: {type}"); 136Debug.Assert(encoding != null, "'encoding' must be assigned."); 137Debug.Assert(!string.IsNullOrEmpty(_rawPath), "'rawPath' must have at least one character."); 150Debug.Assert(_rawOctets.Count == 0, 172Debug.Assert(encoding != null, "'encoding' must be assigned."); 176Debug.Assert(_rawPath != null); 229Debug.Assert(_requestUriString != null); 288Debug.Assert(_rawOctets != null); 365Debug.Assert(uriString != null, "uriString must not be null"); 366Debug.Assert(uriString.Length > 0, "uriString must not be empty"); 408Debug.Assert((uriString.Length == 1) && (uriString[0] == '*'), "Unknown request Uri string format", 434Debug.Assert(path != null, "'path' must not be null");
System\Net\Managed\ChunkStream.cs (1)
137Debug.Assert(offset == 0);
System\Net\Managed\HttpListenerRequest.Managed.cs (1)
152Debug.Assert(_rawUrl != null);
System\Net\Managed\HttpRequestStream.Managed.cs (2)
122Debug.Assert(nread <= _remainingBody); 208Debug.Assert(nread <= _remainingBody);
System\Net\ServiceNameStore.cs (2)
137Debug.Assert(!string.IsNullOrEmpty(uriPrefix)); 166Debug.Assert(!string.IsNullOrEmpty(uriPrefix));
System\Net\WebSockets\HttpListenerWebSocketContext.cs (5)
42Debug.Assert(requestUri != null, "requestUri shouldn't be null"); 43Debug.Assert(headers != null, "headers shouldn't be null"); 44Debug.Assert(cookieCollection != null, "cookieCollection shouldn't be null"); 45Debug.Assert(secWebSocketProtocols != null, "secWebSocketProtocols shouldn't be null"); 46Debug.Assert(webSocket != null, "webSocket shouldn't be null");
System\Net\Windows\CookieExtensions.cs (4)
18Debug.Assert(s_toServerStringFunc != null, "Reflection failed for Cookie.ToServerString()."); 27Debug.Assert(s_cloneFunc != null, "Reflection failed for Cookie.Clone()."); 45Debug.Assert(s_getVariantFunc != null, "Reflection failed for Cookie.Variant."); 57Debug.Assert(s_internalAddFunc != null, "Reflection failed for CookieCollection.InternalAdd().");
System.Net.Mail (75)
src\libraries\Common\src\System\Collections\Generic\BidirectionalDictionary.cs (2)
26Debug.Assert(_forward.Count == _backward.Count, "both the dictionaries must have the same number of elements"); 33Debug.Assert(!_backward.ContainsKey(item2), "No added item1 should ever have existing item2");
src\libraries\Common\src\System\HexConverter.cs (3)
165Debug.Assert(chars.Length >= bytes.Length * 2); 332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Net\ContextAwareResult.cs (7)
133Debug.Assert((_flags & StateFlags.ThreadSafeContextCopy) != 0, "Called on completed result."); 144Debug.Assert(AsyncCallback != null || (_flags & StateFlags.CaptureContext) != 0, "No context captured - specify a callback or forceCaptureContext."); 150Debug.Assert(_lock != null, "Must lock (StartPostingAsyncOp()) { ... FinishPostingAsyncOp(); } when calling ContextCopy (unless it's only called after FinishPostingAsyncOp)."); 156Debug.Assert((_flags & StateFlags.ThreadSafeContextCopy) != 0, "Result became completed during call."); 186Debug.Assert(!InternalPeekCompleted, "Called on completed result."); 270Debug.Assert((_flags & StateFlags.PostBlockStarted) != 0, "Called without calling StartPostingAsyncOp."); 313Debug.Assert(AsyncCallback == null || CompletedSynchronously, "Didn't capture context, but didn't complete synchronously!");
src\libraries\Common\src\System\Net\InternalException.cs (1)
16Debug.Fail($"InternalException thrown for unexpected value: {unexpectedValue}");
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (3)
261Debug.Assert(value != DBNull.Value, "Result can't be set to DBNull - it's a special internal value."); 263Debug.Assert(!InternalPeekCompleted, "Called on completed result."); 402Debug.Assert(state is LazyAsyncResult);
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.Associate.cs (1)
35Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0); 298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Net\Base64Stream.cs (1)
61Debug.Assert(_writeState != null, "_writeState was null");
System\Net\Mail\DomainLiteralReader.cs (2)
34Debug.Assert(0 <= index && index < data.Length, $"index was outside the bounds of the string: {index}"); 35Debug.Assert(data[index] == MailBnfHelper.EndSquareBracket, "data did not end with a square bracket");
System\Net\Mail\DotAtomReader.cs (1)
40Debug.Assert(0 <= index && index < data.Length, $"index was outside the bounds of the string: {index}");
System\Net\Mail\MailAddress.cs (5)
34Debug.Assert(_host != null, 37Debug.Assert(userName != null, 40Debug.Assert(displayName != null, 76Debug.Assert(parseSuccess); 285Debug.Assert(Address != null, "address was null");
System\Net\Mail\MailAddressParser.cs (6)
30Debug.Assert(!parseSuccess || index == -1, $"The index indicates that part of the address was not parsed: {index}"); 45Debug.Assert(index == -1 || data[index] == MailBnfHelper.Comma, 69Debug.Assert(!string.IsNullOrEmpty(data)); 70Debug.Assert(index >= 0 && index < data.Length, $"Index out of range: {index}, {data.Length}"); 382Debug.Assert(data[index + 1] == MailBnfHelper.Quote, $"Mis-aligned index: {index}"); 421Debug.Assert(index < 0 || data[index] == MailBnfHelper.Comma, $"Mis-aligned index: {index}");
System\Net\Mail\MailBnfHelper.cs (2)
362Debug.Assert(index >= 0); 363Debug.Assert(index < data.Length);
System\Net\Mail\MailHeaderInfo.cs (1)
77Debug.Assert((int)s_headerInfo[i].ID == i, "Header info data structures are not in sync");
System\Net\Mail\MailPriority.cs (1)
492System.Diagnostics.Debug.Assert(_headersEncoding != null);
System\Net\Mail\MailWriter.cs (1)
55Diagnostics.Debug.Assert(_contentStream == sender);
System\Net\Mail\QuotedPairReader.cs (3)
37Debug.Assert(0 <= index && index < data.Length, $"Index out of range: {index}, {data.Length}"); 85Debug.Assert(index >= 0 && data[index] == MailBnfHelper.Backslash, $"index was not a backslash: {index}"); 96Debug.Assert(index < 0 || data[index] != MailBnfHelper.Backslash, $"index was a backslash: {index}");
System\Net\Mail\QuotedStringFormatReader.cs (3)
38Debug.Assert(0 <= index && index < data.Length, $"Index out of range: {index}, {data.Length}"); 40Debug.Assert(data[index] == MailBnfHelper.Quote, $"Initial char at index {index} was not a quote."); 129Debug.Assert(0 <= index && index < data.Length, $"Index out of range: {index}, {data.Length}");
System\Net\Mail\SmtpCommands.cs (1)
211System.Diagnostics.Debug.Assert(lines.Length == 1, "Did not expect more than one line response for auth command");
System\Net\Mail\SmtpConnection.cs (1)
302Debug.Assert(context == null || context.IdentityRequested, "Authentication required when it wasn't expected. (Maybe Credentials was changed on another thread?)");
System\Net\Mail\SmtpReplyReaderFactory.cs (2)
309System.Diagnostics.Debug.Assert(_readState == ReadState.Status0); 394System.Diagnostics.Debug.Assert(_parent._readState == ReadState.Status0);
System\Net\Mail\WhitespaceReader.cs (4)
34Debug.Assert(!string.IsNullOrEmpty(data), "data was null or empty"); 35Debug.Assert(index < data.Length, "index was outside the bounds of the string"); 117Debug.Assert(!string.IsNullOrEmpty(data), "data was null or empty"); 118Debug.Assert(index < data.Length, "index was outside the bounds of the string");
System\Net\Mime\Base64Encoder.cs (4)
22Debug.Assert(_writeState != null, "_writeState was null"); 74Debug.Fail("paddind was not in range [0,2]"); 115Debug.Fail("paddind was not in range [0,2]"); 141Debug.Fail("paddind was not in range [0,2]");
System\Net\Mime\ByteEncoder.cs (4)
56Debug.Assert(value != null, "value was null"); 57Debug.Assert(WriteState != null, "writestate was null"); 58Debug.Assert(WriteState.Buffer != null, "writestate.buffer was null"); 76Debug.Assert(codepointSize == 1 || codepointSize == 2, "codepointSize was not 1 or 2");
System\Net\Mime\SmtpDateTime.cs (7)
163Debug.Assert(timeZone.Seconds == 0, "Span had seconds value"); 164Debug.Assert(timeZone.Milliseconds == 0, "Span had milliseconds value"); 175Debug.Assert(!string.IsNullOrEmpty(offset), "violation of precondition: offset must not be null or empty"); 176Debug.Assert(offset != UnknownTimeZoneDefaultOffset, "Violation of precondition: do not pass an unknown offset"); 177Debug.Assert(offset.StartsWith('-') || offset.StartsWith('+'), "offset initial character was not a + or -"); 211Debug.Assert(!string.IsNullOrEmpty(value), "violation of precondition: offset must not be null or empty"); 268Debug.Assert(dateValue.Kind == DateTimeKind.Unspecified);
System\Net\TrackingValidationObjectDictionary.cs (1)
45Debug.Assert(key != null, "key was null");
System.Net.NameResolution (22)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetHostName.cs (1)
29Debug.Fail($"GetHostName failed with error {err}");
src\libraries\Common\src\System\Net\InternalException.cs (1)
16Debug.Fail($"InternalException thrown for unexpected value: {unexpectedValue}");
src\libraries\Common\src\System\Net\InteropIPAddressExtensions.Unix.cs (1)
16Debug.Assert(bytesWritten == sizeof(uint) || bytesWritten == Interop.Sys.IPv6AddressBytes, $"Unexpected length: {bytesWritten}");
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 (6)
27Debug.Assert(err == Interop.Error.SUCCESS, $"Unexpected err: {err}"); 28Debug.Assert(ipv4 > 0); 29Debug.Assert(ipv6 > 0); 30Debug.Assert(uds > 0); 31Debug.Assert(max >= ipv4 && max >= ipv6 && max >= uds); 55Debug.Fail("Unexpected failure in GetAddressFamily");
System\Net\Dns.cs (6)
28Debug.Fail("LogFailure should return false"); 399Debug.Fail("LogFailure should return false"); 435Debug.Assert(name != null); 439Debug.Fail("LogFailure should return false"); 469Debug.Fail("LogFailure should return false"); 670Debug.Assert(!Monitor.IsEntered(s_tasks));
System\Net\NameResolutionPal.Unix.cs (2)
43Debug.Fail($"Unexpected error: {error}"); 166Debug.Assert(bytesWritten == rawAddressLength);
System\Net\NameResolutionTelemetry.cs (3)
86Debug.Assert(startingTimestamp.HasValue); 119Debug.Assert(hostNameOrAddress is not null); 130Debug.Assert(host is not null, $"Unknown hostNameOrAddress type: {hostNameOrAddress.GetType().Name}");
System.Net.NetworkInformation (25)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetDomainName.cs (1)
30Debug.Fail($"{nameof(GetDomainName)} failed with error {err}");
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetHostName.cs (1)
29Debug.Fail($"GetHostName failed with error {err}");
src\libraries\Common\src\System\HexConverter.cs (3)
165Debug.Assert(chars.Length >= bytes.Length * 2); 332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\IO\RowConfigReader.cs (1)
66Debug.Assert(_buffer != null);
src\libraries\Common\src\System\IO\StringParser.cs (5)
177Debug.Assert(result == int.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 222Debug.Assert(result == long.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 253Debug.Assert(result == uint.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 280Debug.Assert(result == ulong.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 295Debug.Assert(result == char.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result");
System\Net\NetworkInformation\NetEventSource.NetworkInformation.cs (1)
24Debug.Assert(IsEnabled());
System\Net\NetworkInformation\NetworkAddressChange.Unix.cs (9)
24Debug.Assert(Monitor.IsEntered(s_gate)); 29Debug.Assert(Monitor.IsEntered(s_gate)); 74Debug.Assert(Socket == null, 125Debug.Assert(Socket == null, 152Debug.Assert(Monitor.IsEntered(s_gate)); 153Debug.Assert(Socket == null, "Socket is not null, must close existing socket before opening another."); 177Debug.Assert(Monitor.IsEntered(s_gate)); 178Debug.Assert(Socket != null, "Socket was null when CloseSocket was called."); 213Debug.Fail($"Unexpected error: {ex}");
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 (12)
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (1)
46Debug.Assert(written == IPAddressParserStatics.IPv6AddressBytes);
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (6)
27Debug.Assert(err == Interop.Error.SUCCESS, $"Unexpected err: {err}"); 28Debug.Assert(ipv4 > 0); 29Debug.Assert(ipv6 > 0); 30Debug.Assert(uds > 0); 31Debug.Assert(max >= ipv4 && max >= ipv6 && max >= uds); 55Debug.Fail("Unexpected failure in GetAddressFamily");
src\libraries\Common\src\System\Net\Sockets\SocketErrorPal.Unix.cs (2)
14Debug.Assert(s_nativeErrorToSocketError.Count == NativeErrorToSocketErrorCount, 17Debug.Assert(s_socketErrorToNativeError.Count == SocketErrorToNativeErrorCount,
System\Net\NetworkInformation\Ping.cs (2)
101Debug.Assert(currentStatus == Disposed, $"Expected currentStatus == Disposed, got {currentStatus}"); 121Debug.Assert(_status == InProgress, $"Invalid status: {_status}");
System\Net\NetworkInformation\Ping.RawSocket.cs (1)
378Debug.Assert(Marshal.SizeOf<IcmpHeader>() == 8, "The size of an ICMP Header must be 8 bytes.");
System.Net.Primitives (56)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetDomainName.cs (1)
30Debug.Fail($"{nameof(GetDomainName)} failed with error {err}");
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetHostName.cs (1)
29Debug.Fail($"GetHostName failed with error {err}");
src\libraries\Common\src\System\HexConverter.cs (3)
165Debug.Assert(chars.Length >= bytes.Length * 2); 332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Net\CookieParser.cs (2)
557Debug.Assert(field != null, "We need to use an internal field named IsQuotedDomain that is declared on Cookie."); 574Debug.Assert(field != null, "We need to use an internal field named IsQuotedVersion that is declared on Cookie.");
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 (6)
27Debug.Assert(err == Interop.Error.SUCCESS, $"Unexpected err: {err}"); 28Debug.Assert(ipv4 > 0); 29Debug.Assert(ipv6 > 0); 30Debug.Assert(uds > 0); 31Debug.Assert(max >= ipv4 && max >= ipv6 && max >= uds); 55Debug.Fail("Unexpected failure in GetAddressFamily");
src\libraries\Common\src\System\Net\Sockets\SocketErrorPal.Unix.cs (2)
14Debug.Assert(s_nativeErrorToSocketError.Count == NativeErrorToSocketErrorCount, 17Debug.Assert(s_socketErrorToNativeError.Count == SocketErrorToNativeErrorCount,
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 (110)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs (2)
72Debug.Assert(bytesNeeded != 0, "OBJ_obj2txt reported a zero-length response"); 92Debug.Assert(
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs (1)
135Debug.Assert(verifyTime.Kind != DateTimeKind.Utc, "UTC verifyTime should have been normalized to Local");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (1)
83Debug.Assert(error <= uint.MaxValue, "ErrGetError should only return error codes in the UInt32 range.");
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs (2)
50Debug.Assert(_parent == null, "Expected no existing parent"); 51Debug.Assert(parent != null && !parent.IsInvalid, "Expected new parent to be non-null and valid");
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (3)
41Debug.Assert(currentHandle.IsInvalid); 51Debug.Assert(handle != null); 53Debug.Assert(!isCachedInvalidHandle || handle.IsInvalid, "The cached invalid handle must still be invalid.");
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (1)
46Debug.Assert(addedRef);
src\libraries\Common\src\System\HexConverter.cs (3)
165Debug.Assert(chars.Length >= bytes.Length * 2); 332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Net\ArrayBuffer.cs (10)
34Debug.Assert(initialSize > 0 || usePool); 46Debug.Assert(buffer.Length > 0); 71Debug.Assert(_usePool); 72Debug.Assert(_bytes is not null); 99Debug.Assert(byteCount <= ActiveLength, $"Expected {byteCount} <= {ActiveLength}"); 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 (40)
38Debug.Assert(initialBufferSize >= 0); 70Debug.Assert(byteCount >= 0); 71Debug.Assert(byteCount <= ActiveMemory.Length, $"MultiArrayBuffer.Discard: Expected byteCount={byteCount} <= {ActiveMemory.Length}"); 112Debug.Assert(toReturn is not null); 120Debug.Assert(byteCount >= 0); 121Debug.Assert(byteCount <= AvailableMemory.Length, $"MultiArrayBuffer.Commit: Expected byteCount={byteCount} <= {AvailableMemory.Length}"); 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); 220Debug.Assert(_activeStart / BlockSize == 0, $"Start is not in first block after move or resize?? _activeStart={_activeStart}"); 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); 257Debug.Assert(_allocatedEnd % BlockSize == 0, $"_allocatedEnd={_allocatedEnd} not at block boundary?"); 264Debug.Assert(_blocks[i] is null); 269Debug.Assert(_blocks[i] is not null); 274Debug.Assert(_blocks[i] is null); 279Debug.Assert(_activeStart == 0, $"No active bytes but _activeStart={_activeStart}"); 307Debug.Assert(blocks is not null); 308Debug.Assert(start <= int.MaxValue); 309Debug.Assert(length <= int.MaxValue); 310Debug.Assert(start + length <= blocks.Length * BlockSize); 349Debug.Assert(_length > 0, "Length should never be 0 here because BlockCount would be 0"); 350Debug.Assert(_blocks is not null); 355Debug.Assert(0 <= startInBlock, $"Invalid startInBlock={startInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}"); 356Debug.Assert(startInBlock < endInBlock, $"Invalid startInBlock={startInBlock}, endInBlock={endInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}"); 357Debug.Assert(endInBlock <= BlockSize, $"Invalid endInBlock={endInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}");
src\libraries\Common\src\System\Net\Security\CertificateValidation.Unix.cs (1)
60Debug.Assert(hostNameMatch == 0 || hostNameMatch == 1, $"Expected 0 or 1 from CheckX509Hostname, got {hostNameMatch}");
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 (6)
27Debug.Assert(err == Interop.Error.SUCCESS, $"Unexpected err: {err}"); 28Debug.Assert(ipv4 > 0); 29Debug.Assert(ipv6 > 0); 30Debug.Assert(uds > 0); 31Debug.Assert(max >= ipv4 && max >= ipv6 && max >= uds); 55Debug.Fail("Unexpected failure in GetAddressFamily");
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 (29)
src\libraries\Common\src\System\Net\ContextAwareResult.cs (7)
133Debug.Assert((_flags & StateFlags.ThreadSafeContextCopy) != 0, "Called on completed result."); 144Debug.Assert(AsyncCallback != null || (_flags & StateFlags.CaptureContext) != 0, "No context captured - specify a callback or forceCaptureContext."); 150Debug.Assert(_lock != null, "Must lock (StartPostingAsyncOp()) { ... FinishPostingAsyncOp(); } when calling ContextCopy (unless it's only called after FinishPostingAsyncOp)."); 156Debug.Assert((_flags & StateFlags.ThreadSafeContextCopy) != 0, "Result became completed during call."); 186Debug.Assert(!InternalPeekCompleted, "Called on completed result."); 270Debug.Assert((_flags & StateFlags.PostBlockStarted) != 0, "Called without calling StartPostingAsyncOp."); 313Debug.Assert(AsyncCallback == null || CompletedSynchronously, "Didn't capture context, but didn't complete synchronously!");
src\libraries\Common\src\System\Net\InternalException.cs (1)
16Debug.Fail($"InternalException thrown for unexpected value: {unexpectedValue}");
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (3)
261Debug.Assert(value != DBNull.Value, "Result can't be set to DBNull - it's a special internal value."); 263Debug.Assert(!InternalPeekCompleted, "Called on completed result."); 402Debug.Assert(state is LazyAsyncResult);
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.Associate.cs (1)
35Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
System\Net\FtpControlStream.cs (1)
666Debug.Assert(port != -1, "'port' not set.");
System\Net\FtpWebRequest.cs (1)
1444Debug.Assert(stream is ICloseEx, "The _stream member is not CloseEx hence the risk of connection been orphaned.");
System\Net\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\TimerThread.cs (1)
200Debug.Assert(_timers.Prev!.Next == _timers, $"Tail corruption.");
System\Net\WebException.cs (1)
82Debug.Assert(exception != null);
System\Net\WebRequest.cs (1)
362Debug.Assert(prefixList.Count == Count, $"Expected {Count}, got {prefixList.Count}");
System.Net.Security (180)
src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssBuffer.cs (3)
21Debug.Assert(destination != null, "target destination cannot be null"); 22Debug.Assert((offset >= 0 && offset < destination.Length) || destination.Length == 0, $"invalid offset {offset}"); 74Debug.Assert(sizeof(GssBuffer) == 16);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs (2)
72Debug.Assert(bytesNeeded != 0, "OBJ_obj2txt reported a zero-length response"); 92Debug.Assert(
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs (1)
135Debug.Assert(verifyTime.Kind != DateTimeKind.Utc, "UTC verifyTime should have been normalized to Local");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (1)
83Debug.Assert(error <= uint.MaxValue, "ErrGetError should only return error codes in the UInt32 range.");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OCSP.cs (1)
76Debug.Assert(ret == 0, $"Unexpected response from X509DecodeOcspToExpiration: {ret}");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (20)
32Debug.Assert( 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); 329Debug.Assert(sslHandle != null, "Expected non-null return value from SafeSslHandle.Create"); 340Debug.Assert(Interop.Ssl.SslGetData(sslHandle) == IntPtr.Zero); 400Debug.Assert(certList != null, "certList != null"); 415Debug.Fail("Failed to add issuer to trusted CA list."); 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); 814Debug.Assert(certPtr != null && !certPtr.IsInvalid, "certPtr != null && !certPtr.IsInvalid"); 815Debug.Assert(keyPtr != null && !keyPtr.IsInvalid, "keyPtr != null && !keyPtr.IsInvalid");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (4)
209Debug.Assert(GetAlpnProtocolListSerializedLength(applicationProtocols) == buffer.Length, 258Debug.Assert(stapledResponse.Length > 0); 395Debug.Fail("Unexpected exception while transferring SafeBioHandle ownership to SafeSslHandle", exc.ToString()); 450Debug.Assert(!IsInvalid, "Expected a valid context in Disconnect");
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\GssSafeHandles.cs (2)
18Debug.Assert(!string.IsNullOrEmpty(name), "Invalid user name passed to SafeGssNameHandle create"); 35Debug.Assert(!string.IsNullOrEmpty(name), "Invalid target name passed to SafeGssNameHandle create");
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs (2)
50Debug.Assert(_parent == null, "Expected no existing parent"); 51Debug.Assert(parent != null && !parent.IsInvalid, "Expected new parent to be non-null and valid");
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (3)
41Debug.Assert(currentHandle.IsInvalid); 51Debug.Assert(handle != null); 53Debug.Assert(!isCachedInvalidHandle || handle.IsInvalid, "The cached invalid handle must still be invalid.");
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (1)
46Debug.Assert(addedRef);
src\libraries\Common\src\System\HexConverter.cs (3)
165Debug.Assert(chars.Length >= bytes.Length * 2); 332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Net\ArrayBuffer.cs (10)
34Debug.Assert(initialSize > 0 || usePool); 46Debug.Assert(buffer.Length > 0); 71Debug.Assert(_usePool); 72Debug.Assert(_bytes is not null); 99Debug.Assert(byteCount <= ActiveLength, $"Expected {byteCount} <= {ActiveLength}"); 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 (3)
31Debug.Assert(task.IsCompletedSuccessfully); 104Debug.Fail("Unable to load required type."); 133Debug.Fail("Unable to load required members.");
src\libraries\Common\src\System\Net\InternalException.cs (1)
16Debug.Fail($"InternalException thrown for unexpected value: {unexpectedValue}");
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\CertificateValidation.Unix.cs (1)
60Debug.Assert(hostNameMatch == 0 || hostNameMatch == 1, $"Expected 0 or 1 from CheckX509Hostname, got {hostNameMatch}");
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 (3)
22Debug.Fail($"Convert.TryToBase64 failed with {input.Length} bytes to a {base64.Length} buffer"); 26Debug.Assert(charsWritten == base64Len); 65Debug.Assert(source[0] == '=');
System\Net\CertificateValidationPal.cs (1)
76Debug.Fail($"Failed to open cert store, location: {storeLocation} exception: {exception}");
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 (11)
119Debug.Assert(_securityContext is not null && _isAuthenticated, "Trying to get the client SPN before handshaking is done!"); 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); 487Debug.Assert(username != null && password != null, "Username and Password can not be null"); 591Debug.Assert(appDataOffset < channelBinding.Size); 655Debug.Assert(resultBlob != null, "Unexpected null buffer returned by GssApi"); 709Debug.Assert(resultBlob != null, "Unexpected null buffer returned by GssApi");
System\Net\Security\CipherSuitesPolicyPal.Linux.cs (3)
92Debug.Assert( 109Debug.Assert( 184Debug.Fail($"Unknown EncryptionPolicy value ({policy})");
System\Net\Security\NegotiateAuthentication.cs (2)
173Debug.Assert(!OperatingSystem.IsTvOS(), "Server authentication is not supported on tvOS"); 406Debug.Assert(_extendedProtectionPolicy != null);
System\Net\Security\NegotiateStream.cs (10)
310Debug.Assert(vt.IsCompleted, "Should have completed synchroously with sync adapter"); 341Debug.Assert(_context is not null); 506Debug.Assert(_context is not null); 507Debug.Assert(_writeBuffer is not null); 724Debug.Assert(_context != null); 753Debug.Assert(_context != null); 782Debug.Fail("Unreachable"); 843Debug.Fail("Unreachable"); 862Debug.Assert(_framer != null); 888Debug.Assert(_context != null);
System\Net\Security\NetSecurityTelemetry.cs (4)
141Debug.Assert(sizeof(SslProtocols) == 4); 176Debug.Assert(Enum.GetValues<SslProtocols>()[^1] == SslProtocols.Tls13, "Make sure to add a counter for new SslProtocols"); 242Debug.Assert(count >= 0); 245Debug.Assert(count >= 0);
System\Net\Security\Pal.Managed\SafeChannelBindingHandle.cs (3)
23Debug.Assert(certHashBytes != null, "check certHashBytes is not null"); 24Debug.Assert(certHashBytes.Length <= CertHashMaxSize); 33Debug.Assert(kind == ChannelBindingKind.Endpoint || kind == ChannelBindingKind.Unique);
System\Net\Security\SslApplicationProtocol.cs (1)
29Debug.Assert(protocol != null);
System\Net\Security\SslConnectionInfo.Unix.cs (1)
33Debug.Assert(data != 0, $"No mapping found for cipherSuite {cipherSuite}");
System\Net\Security\SslSessionsCache.cs (1)
149Debug.Assert(creds != null, "creds == null");
System\Net\Security\SslStream.cs (11)
88Debug.Assert(length <= DecryptedLength, "length <= DecryptedLength"); 118Debug.Assert(byteCount <= _decryptedLength, "byteCount <= _decryptedBytes"); 135Debug.Assert(_decryptedLength == 0, "_decryptedBytes == 0"); 136Debug.Assert(_decryptedPadding == 0, "_encryptedOffset == 0"); 143Debug.Assert(_decryptedLength == 0, "_decryptedBytes == 0"); 144Debug.Assert(_decryptedPadding == 0, "_encryptedOffset == 0"); 767Debug.Assert(bytesRead == 0 || bytesRead == 1); 782Debug.Assert(vt.IsCompleted, "Sync operation must have completed synchronously"); 797Debug.Assert(vt.IsCompleted, "Sync operation must have completed synchronously"); 814Debug.Assert(vt.IsCompleted, "Sync operation must have completed synchronously"); 832Debug.Assert(vt.IsCompleted, "Sync operation must have completed synchronously");
System\Net\Security\SslStream.IO.cs (6)
42Debug.Assert(e != null, $"Expected non-null Exception to be passed to {nameof(SetException)}"); 278Debug.Assert(token.Payload != null); 726Debug.Assert(_buffer.AvailableLength > 0, "_buffer.AvailableBytes > 0"); 828Debug.Assert(_buffer.EncryptedLength == 0); 833Debug.Assert(_buffer.DecryptedLength == 0); 973Debug.Assert(_buffer.DecryptedLength > 0);
System\Net\Security\SslStream.Protocol.cs (8)
280Debug.Assert(certificate != null, "certificate != null"); 526Debug.Assert((object?)clientCertificate == (object?)selectedCert || clientCertificate!.Equals(selectedCert), "'selectedCert' does not match 'clientCertificate'."); 738Debug.Assert(localCertificate.Equals(selectedCert), "'selectedCert' does not match 'localCertificate'."); 742Debug.Assert(_sslAuthenticationOptions.CertificateContext != null); 963Debug.Assert(_securityContext != null); 985Debug.Assert(_maxDataSize > 0, "_maxDataSize > 0"); 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 (170)
src\libraries\Common\src\System\Net\InternalException.cs (1)
16Debug.Fail($"InternalException thrown for unexpected value: {unexpectedValue}");
src\libraries\Common\src\System\Net\InteropIPAddressExtensions.Unix.cs (1)
16Debug.Assert(bytesWritten == sizeof(uint) || bytesWritten == Interop.Sys.IPv6AddressBytes, $"Unexpected length: {bytesWritten}");
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 (6)
27Debug.Assert(err == Interop.Error.SUCCESS, $"Unexpected err: {err}"); 28Debug.Assert(ipv4 > 0); 29Debug.Assert(ipv6 > 0); 30Debug.Assert(uds > 0); 31Debug.Assert(max >= ipv4 && max >= ipv6 && max >= uds); 55Debug.Fail("Unexpected failure in GetAddressFamily");
src\libraries\Common\src\System\Net\Sockets\SocketErrorPal.Unix.cs (2)
14Debug.Assert(s_nativeErrorToSocketError.Count == NativeErrorToSocketErrorCount, 17Debug.Assert(s_socketErrorToNativeError.Count == SocketErrorToNativeErrorCount,
System\Net\Sockets\SafeSocketHandle.cs (4)
128Debug.Fail($"handle:{handle}, error:{exception}"); 159Debug.Assert(ExceptionCheck.IsFatal(exception), $"handle:{handle}, error:{exception}"); 167Debug.Assert(ret, $"ReleaseHandle failed. handle:{handle}"); 174Debug.Assert(!IsClosed);
System\Net\Sockets\SafeSocketHandle.Unix.cs (2)
141Debug.Assert(value == -1 || value > 0, $"Unexpected value: {value}"); 154Debug.Assert(value == -1 || value > 0, $"Unexpected value: {value}");
System\Net\Sockets\Socket.cs (11)
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); 3408Debug.Assert(boundAddress != null, "Not Bound"); 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 (4)
58Debug.Assert(!_handle.LastConnectFailed); 79Debug.Assert(e == Interop.Error.SUCCESS, e.ToString()); 99Debug.Assert(rv == 0 || blocking); // ignore failures 291Debug.Assert(Equals(origValue, cloneValue), $"{pi.Name}. Expected: {origValue}, Actual: {cloneValue}");
System\Net\Sockets\SocketAsyncContext.Unix.cs (62)
164Debug.Assert(oldState == (int)State.Waiting, $"Unexpected operation state: {(State)oldState}"); 169Debug.Assert((State)Volatile.Read(ref _state) is State.Running or State.RunningWithPendingCancellation, "Unexpected operation state"); 182Debug.Assert(state is (int)State.Running or (int)State.RunningWithPendingCancellation, $"Unexpected operation state: {(State)state}"); 246Debug.Assert(_state == (int)State.Canceled); 258Debug.Assert(Interlocked.CompareExchange(ref _callbackQueued, 1, 0) == 0, $"Unexpected _callbackQueued: {_callbackQueued}"); 285Debug.Assert(Event == null); 307Debug.Fail("Expected derived type to implement IThreadPoolWorkItem"); 471Debug.Assert(SocketAddress.Length == 0); 627Debug.Assert(ErrorCode == SocketError.Success || AcceptedFileDescriptor == (IntPtr)(-1), $"Unexpected values: ErrorCode={ErrorCode}, AcceptedFileDescriptor={AcceptedFileDescriptor}"); 695Debug.Assert(lockObject != null); 699Debug.Assert(!Monitor.IsEntered(_lockObject)); 703Debug.Assert(success, "Timed out waiting for queue lock"); 711Debug.Assert(Monitor.IsEntered(_lockObject)); 777Debug.Assert(_queueLock == null); 796Debug.Assert(sizeof(QueueState) == sizeof(int)); 836Debug.Assert(observedSequenceNumber - _sequenceNumber < 10000, "Very large sequence number increase???"); 848Debug.Assert(operation.Next == operation, "Expected operation.Next == operation"); 852Debug.Assert(!_isNextOperationSynchronous); 875Debug.Assert(_tail == null); 902Debug.Assert(error != Interop.Error.SUCCESS); 936Debug.Assert(_tail == null, "State == Ready but queue is not empty!"); 942Debug.Assert(_tail != null, "State == Waiting but queue is empty!"); 944Debug.Assert(_isNextOperationSynchronous == (op.Event != null)); 957Debug.Assert(_tail != null, "State == Processing but queue is empty!"); 963Debug.Assert(_tail == null); 983Debug.Assert(!skipAsyncEvents); 992Debug.Assert(op.Event == null, "Sync operation encountered in ProcessAsyncOperation"); 1019Debug.Assert(_tail == null); 1025Debug.Assert(_state == QueueState.Processing, $"_state={_state} while processing queue!"); 1026Debug.Assert(_tail != null, "Unexpected empty queue while processing I/O"); 1027Debug.Assert(op == _tail.Next, "Operation is not at head of queue???"); 1047Debug.Assert(_tail == null); 1053Debug.Assert(_state == QueueState.Processing, $"_state={_state} while processing queue!"); 1059Debug.Assert(observedSequenceNumber - _sequenceNumber < 10000, "Very large sequence number increase???"); 1079Debug.Assert(_tail == null); 1084Debug.Assert(_state == QueueState.Processing, $"_state={_state} while processing queue!"); 1085Debug.Assert(_tail.Next == op, "Queue modified while processing queue"); 1107Debug.Assert(result != OperationResult.Pending); 1114Debug.Assert(op.Event != null); 1123Debug.Assert(_tail == null); 1127Debug.Assert(_tail != null, "Unexpected empty queue in CancelAndContinueProcessing"); 1197Debug.Assert(_state != QueueState.Stopped); 1203Debug.Assert(_state != QueueState.Stopped); 1265Debug.Assert(_isHandleNonBlocking); 1344Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}"); 1419Debug.Assert(socketAddress.Length > 0, $"Unexpected socketAddressLen: {socketAddress.Length}"); 1426Debug.Assert(errorCode == SocketError.Success || acceptedFd == (IntPtr)(-1), $"Unexpected values: errorCode={errorCode}, acceptedFd={acceptedFd}"); 1444Debug.Assert(socketAddress.Length > 0, $"Unexpected socketAddressLen: {socketAddress.Length}"); 1445Debug.Assert(callback != null, "Expected non-null callback"); 1454Debug.Assert(errorCode == SocketError.Success || acceptedFd == (IntPtr)(-1), $"Unexpected values: errorCode={errorCode}, acceptedFd={acceptedFd}"); 1480Debug.Assert(socketAddress.Length > 0, $"Unexpected socketAddressLen: {socketAddress.Length}"); 1508Debug.Assert(socketAddress.Length > 0, $"Unexpected socketAddressLen: {socketAddress.Length}"); 1509Debug.Assert(callback != null, "Expected non-null callback"); 1556Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}"); 1697Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}"); 1764Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}"); 1799Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}"); 1888Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}"); 1918Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}"); 1996Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}"); 2064Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}"); 2184Debug.Assert((events & Interop.Sys.SocketEvents.Error) == 0);
System\Net\Sockets\SocketAsyncEngine.Unix.cs (1)
191Debug.Assert(numEvents > 0, $"Unexpected numEvents: {numEvents}");
System\Net\Sockets\SocketAsyncEventArgs.cs (6)
120Debug.Assert(success); 231Debug.Fail($"Callers should guard against calling this method for '{LastOperation}'"); 508Debug.Assert(status == InProgress || status == Configuring || status == Disposed, $"Unexpected status: {status}"); 651Debug.Assert(endPoint.AddressFamily == AddressFamily.Unspecified || 736Debug.Assert(existing.Port == port); 1003Debug.Assert(socketError != SocketError.IOPending);
System\Net\Sockets\SocketAsyncEventArgs.Unix.cs (5)
38Debug.Assert(socketAddress.Length > 0); 56Debug.Assert(acceptHandle == null, $"Unexpected acceptHandle: {acceptHandle}"); 183Debug.Assert(socketAddress.Length == socketAddressSize); 240Debug.Assert(_sendPacketsElements != null); 327Debug.Assert(NetEventSource.Log.IsEnabled());
System\Net\Sockets\SocketPal.Unix.cs (35)
66Debug.Assert(fd != (IntPtr)(-1), "fd should not be -1"); 86Debug.Assert(fd == (IntPtr)(-1), $"Unexpected fd: {fd}"); 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); 631Debug.Assert(fd != (IntPtr)(-1), "Expected fd != -1"); 652Debug.Assert(socketAddress.Length > 0, $"Unexpected socketAddressLen: {socketAddress.Length}"); 716Debug.Assert(err == Interop.Error.EBADF, $"Unexpected err: {err}"); 751Debug.Assert(flags == SocketFlags.None); 810Debug.Assert(flags == SocketFlags.None); 811Debug.Assert(buffers == null); 949Debug.Assert(flags == SocketFlags.None); 950Debug.Assert(buffers == null); 1489Debug.Assert(optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership, $"Unexpected optionName: {optionName}"); 1512Debug.Assert(optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership, $"Unexpected optionName={optionName}"); 1630Debug.Assert((uint)optionLength <= optionValue.Length); 1649Debug.Assert(optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership, $"Unexpected optionName={optionName}"); 1674Debug.Assert(optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership, $"Unexpected optionName={optionName}"); 1742Debug.Assert(count > 0, $"Expected at least one entry."); 1782Debug.Assert(eventsLength == checkReadInitialCount + checkWriteInitialCount + checkErrorInitialCount, "Invalid eventsLength"); 1792Debug.Assert(offset == eventsLength, $"Invalid adds. offset={offset}, eventsLength={eventsLength}."); 1793Debug.Assert(refsAdded == eventsLength, $"Invalid ref adds. refsAdded={refsAdded}, eventsLength={eventsLength}."); 1831Debug.Assert(refsAdded == 0); 1843Debug.Assert(arrOffset < arrLength, "IList.Count must have been faulty, returning a negative value and/or returning a different value across calls."); 1878Debug.Assert(arrEndOffset >= 0, "IList.Count must have been faulty, returning a negative value and/or returning a different value across calls."); 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\Sockets\UnixDomainSocketEndPoint.Unix.cs (3)
28Debug.Assert(s_nativePathOffset >= 0, "Expected path offset to be positive"); 29Debug.Assert(s_nativePathOffset + s_nativePathLength <= s_nativeAddressSize, "Expected address size to include all of the path length"); 30Debug.Assert(s_nativePathLength >= 92, "Expected max path length to be at least 92"); // per http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_un.h.html
System.Net.WebClient (24)
src\libraries\Common\src\System\HexConverter.cs (3)
165Debug.Assert(chars.Length >= bytes.Length * 2); 332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\IO\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 (9)
18private static readonly Action s_completionSentinel = static () => Debug.Fail("Completion sentinel should never be invoked"); 45Debug.Assert(c == null || c == s_completionSentinel); 55Debug.Assert(_continuation != null); 96Debug.Assert(exception != null); 109Debug.Assert(c != s_completionSentinel); 125Debug.Assert(continuation != null); 130Debug.Assert(c == s_completionSentinel); 145Debug.Assert(_resultSet ^ (_error != null)); 149Debug.Assert(!_resultSet && _error == null);
System\Net\WebClient.cs (5)
516Debug.Assert(conversionStatus == OperationStatus.Done); 871Debug.Assert(_progress != null, "ProgressData should have been initialized"); 872Debug.Assert(asyncOp != null); 1009Debug.Assert(asyncOp != null); 1010Debug.Assert(_progress != null, "ProgressData should have been initialized");
System.Net.WebHeaderCollection (1)
System\Net\HeaderInfoTable.cs (1)
142Debug.Assert(headers.Count == Items);
System.Net.WebProxy (1)
System\Net\WebProxy.cs (1)
182Debug.Assert(formatted);
System.Net.WebSockets (55)
src\libraries\Common\src\System\Net\WebSockets\WebSocketValidate.cs (1)
121Debug.Assert(!string.IsNullOrEmpty(parameterName), "'parameterName' MUST NOT be NULL or string.Empty");
System\Net\WebSockets\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 (10)
43Debug.Assert(_buffer is null, "Invalid state, ReleaseBuffer not called."); 60Debug.Assert(consumed == payload.Length); 95Debug.Assert(written == output.Length); 106Debug.Assert(output.Slice(written - WebSocketInflater.FlushMarkerLength, WebSocketInflater.FlushMarkerLength) 124Debug.Assert(_stream is not null); 155Debug.Assert(_stream is not null); 156Debug.Assert(_stream.AvailIn == 0); 157Debug.Assert(output.Length > 0); 171Debug.Assert(errorCode is ErrorCode.Ok or ErrorCode.BufError); 185Debug.Assert(errorCode == ErrorCode.Ok);
System\Net\WebSockets\Compression\WebSocketInflater.cs (6)
74Debug.Assert(_available > 0); 89Debug.Assert(totalBytesReceived == 0 || _buffer is not null, "Prepare must be called."); 98Debug.Assert(_available == 0); 166Debug.Assert(_stream is not null && _stream.AvailIn == 0); 167Debug.Assert(_available == 0); 230Debug.Assert(destination.Length > 0);
System\Net\WebSockets\ManagedWebSocket.cs (26)
145Debug.Assert(StateUpdateLock != null, $"Expected {nameof(StateUpdateLock)} to be non-null"); 146Debug.Assert(stream != null, $"Expected non-null {nameof(stream)}"); 147Debug.Assert(stream.CanRead, $"Expected readable {nameof(stream)}"); 148Debug.Assert(stream.CanWrite, $"Expected writeable {nameof(stream)}"); 149Debug.Assert(keepAliveInterval == Timeout.InfiniteTimeSpan || keepAliveInterval >= TimeSpan.Zero, $"Invalid {nameof(keepAliveInterval)}: {keepAliveInterval}"); 210Debug.Assert(Monitor.IsEntered(StateUpdateLock), $"Expected {nameof(StateUpdateLock)} to be held"); 379Debug.Assert(_sentCloseFrame); 432Debug.Assert(_sendMutex.IsHeld, $"Caller should hold the {nameof(_sendMutex)}"); 547Debug.Assert(_sendBuffer != null); 629Debug.Assert(sendBuffer.Length >= MaxMessageHeaderLength, $"Expected {nameof(sendBuffer)} to be at least {MaxMessageHeaderLength}, got {sendBuffer.Length}"); 796Debug.Assert(header.Opcode == MessageOpcode.Binary || header.Opcode == MessageOpcode.Text, $"Unexpected opcode {header.Opcode}"); 821Debug.Assert(_inflater is not null); 831Debug.Assert(receiveBufferBytesToCopy > 0); 1142Debug.Assert(_receiveBufferCount >= 2, "Expected to at least have the first two bytes of the header."); 1160Debug.Assert(_receiveBufferCount >= 2, "Expected to have two bytes for the payload length."); 1166Debug.Assert(_receiveBufferCount >= 8, "Expected to have eight bytes for the payload length."); 1279Debug.Assert( 1363Debug.Assert(count - 2 == encodedLength, $"{nameof(s_textEncoding.GetByteCount)} and {nameof(s_textEncoding.GetBytes)} encoded count didn't match"); 1401Debug.Assert(count >= 0, $"Expected non-negative {nameof(count)}, got {count}"); 1402Debug.Assert(count <= _receiveBufferCount, $"Trying to consume {count}, which is more than exists {_receiveBufferCount}"); 1410Debug.Assert(minimumRequiredBytes <= _receiveBuffer.Length, $"Requested number of bytes {minimumRequiredBytes} must not exceed {_receiveBuffer.Length}"); 1450Debug.Assert(_sendBuffer == null); // would only fail if had some catastrophic error previously that prevented cleaning up 1457Debug.Assert(_sendMutex.IsHeld, $"Caller should hold the {nameof(_sendMutex)}"); 1477Debug.Assert(maskOffsetIndex < MaskLength, $"Unexpected {nameof(maskOffsetIndex)}: {maskOffsetIndex}"); 1478Debug.Assert(mask.Length >= MaskLength + maskOffset, $"Unexpected inputs: {mask.Length}, {maskOffset}"); 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 (15)
src\libraries\Common\src\System\Net\WebSockets\WebSocketValidate.cs (1)
121Debug.Assert(!string.IsNullOrEmpty(parameterName), "'parameterName' MUST NOT be NULL or string.Empty");
System\Net\WebSockets\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\ClientWebSocketOptions.cs (1)
253Debug.Assert(!_isReadOnly, "Already set");
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 (321)
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\ReadOnlyTensorSpan.cs (2)
557Debug.Assert(copiedValues == _flattenedLength, "Didn't copy the right amount to the array."); 604Debug.Assert(copiedValues == _flattenedLength, "Didn't copy the right amount to the array.");
System\Numerics\Tensors\netcore\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\TensorSpan.cs (4)
538Debug.Assert(clearedValues == _flattenedLength, "Didn't clear the right amount"); 560Debug.Assert(filledValues == _flattenedLength, "Didn't copy the right amount to the array."); 603Debug.Assert(copiedValues == _flattenedLength, "Didn't copy the right amount to the array."); 646Debug.Assert(copiedValues == _flattenedLength, "Didn't copy the right amount to the array.");
System\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 (4)
System\Collections\ObjectModel\KeyedCollection.cs (2)
51Debug.Assert(base.Items is List<TItem>); 273Debug.Assert(key != null, "key shouldn't be null!");
System\Collections\ObjectModel\ObservableCollection.cs (1)
307Debug.Assert(collection != null);
System\Collections\Specialized\NotifyCollectionChangedEventArgs.cs (1)
282Debug.Assert(list != null);
System.Private.CoreLib (4099)
src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\ExceptionHandling.cs (14)
203Debug.Assert(false, "Unhandled exceptions should be processed by the native runtime only"); 655Debug.Assert(isValid, "Unwind and intercept failed unexpectedly"); 673Debug.Assert(false); 699Debug.Assert(false, "unreachable"); 727Debug.Assert(exInfo._passNumber == 1, "expected asm throw routine to set the pass"); 751Debug.Assert(isValid, "RhThrowEx called with an unexpected context"); 838Debug.Assert(pCatchHandler != null || pReversePInvokePropagationCallback != IntPtr.Zero || unwoundReversePInvoke || isExceptionIntercepted, "We should have a handler if we're starting the second pass"); 839Debug.Assert(!isExceptionIntercepted || (pCatchHandler == null), "No catch handler should be returned for intercepted exceptions in the first pass"); 863Debug.Assert(isValid, "second-pass EH unwind failed unexpectedly"); 878Debug.Assert(frameIter.SP == handlingFrameSP, "Encountered a different reverse P/Invoke frame in the second pass."); 931Debug.Assert(false, "unreachable"); 938Debug.Assert(ip != null, "IP address must not be null"); 944Debug.Assert(handlingFrameSP != MaxSP, "Handling frame must have an SP value"); 945Debug.Assert(((UIntPtr*)handlingFrameSP) > &handlingFrameSP,
src\libraries\Common\src\Interop\Interop.ICU.cs (2)
17Debug.Assert(icuuc != IntPtr.Zero); 18Debug.Assert(icuin != IntPtr.Zero);
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (3)
39Debug.Assert(!b || result.Pid == pid, "Expected process ID from status file to match supplied pid"); 104Debug.Assert(valueParsed); 119Debug.Assert(!string.IsNullOrEmpty(path));
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
13Debug.Assert(errorInfo.Error != Error.SUCCESS); 14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetHostName.cs (1)
29Debug.Fail($"GetHostName failed with error {err}");
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 (4)
38Debug.Assert(buffer.Length >= Encoding.UTF8.GetMaxCharCount(NameBufferSize - 1 - 1)); 40Debug.Assert(Name != null, "should not have a null name"); 47Debug.Assert(nameBytes.Length > 0, "we shouldn't have gotten a garbage value from the OS"); 51Debug.Assert(NameLength != -1 || !value.Contains('\0'), "should not have embedded nulls if we parsed the end of string");
src\libraries\Common\src\Interop\Unix\System.Native\Interop.UnixFileSystemTypes.cs (1)
159Debug.Assert(Enum.IsDefined(fileSystemType) || fstatfsResult == 0, $"GetFileSystemType returned {fstatfsResult}");
src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (13)
67Debug.Assert(InitialSegmentSize > 0, "Initial segment size must be > 0."); 68Debug.Assert((InitialSegmentSize & (InitialSegmentSize - 1)) == 0, "Initial segment size must be a power of 2"); 69Debug.Assert(InitialSegmentSize <= MaxSegmentSize, "Initial segment size should be <= maximum."); 70Debug.Assert(MaxSegmentSize < int.MaxValue / 2, "Max segment size * 2 must be < int.MaxValue, or else overflow could occur."); 102Debug.Assert(segment != null, "Expected a non-null segment."); 112Debug.Assert(newSegmentSize > 0, "The max size should always be small enough that we don't overflow."); 179Debug.Assert(segment != null, "Expected a non-null segment."); 180Debug.Assert(array != null, "Expected a non-null item array."); 253Debug.Assert(segment != null, "Expected a non-null segment."); 254Debug.Assert(array != null, "Expected a non-null item array."); 368Debug.Assert(syncObj != null, "The syncObj parameter is null."); 390Debug.Assert((size & (size - 1)) == 0, "Size must be a power of 2"); 429Debug.Assert(queue != null, "Expected a non-null queue.");
src\libraries\Common\src\System\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 (9)
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); 332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\IO\PathInternal.cs (1)
124Debug.Assert(rootLength > 0);
src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
31Debug.Assert(DirectorySeparatorChar == AltDirectorySeparatorChar);
src\libraries\Common\src\System\IO\StringParser.cs (5)
177Debug.Assert(result == int.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 222Debug.Assert(result == long.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 253Debug.Assert(result == uint.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 280Debug.Assert(result == ulong.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result"); 295Debug.Assert(result == char.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result");
src\libraries\Common\src\System\IO\Win32Marshal.cs (1)
29Debug.Assert(errorCode != Interop.Errors.ERROR_SUCCESS);
src\libraries\Common\src\System\Number.Formatting.Common.cs (12)
144Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 281Debug.Assert(format is 'G' or 'g'); 293Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 716Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 750Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 820Debug.Assert(p >= spanPtr - 1, "Underflow"); 865Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 886Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 913Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 935Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 959Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 1013Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte));
src\libraries\Common\src\System\Number.NumberBuffer.cs (7)
38Debug.Assert(digits != null); 46Debug.Assert(!digits.IsEmpty); 67Debug.Assert((Kind == NumberBufferKind.Integer) || (Kind == NumberBufferKind.Decimal) || (Kind == NumberBufferKind.FloatingPoint)); 68Debug.Assert(Digits[0] != '0', "Leading zeros should never be stored in a Number"); 80Debug.Assert(char.IsAsciiDigit((char)digit), $"Unexpected character found in Number: {digit}"); 83Debug.Assert(numDigits == DigitsCount, "Null terminator found in unexpected location in Number"); 84Debug.Assert(numDigits < Digits.Length, "Null terminator not found in Number");
src\libraries\Common\src\System\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 (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0); 298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
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 (4)
56Debug.Assert(op == Operation.None, $"An operation was queued before the previous {op}'s completion."); 82Debug.Assert(_operation >= Operation.Read && _operation <= Operation.WriteGather); 105Debug.Assert(_readScatterBuffers != null); 109Debug.Assert(_writeGatherBuffers != null);
src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeFileHandle.Unix.cs (9)
74Debug.Assert(value == false); // We should only use the setter to disable random access. 95Debug.Assert(path != null); 140Debug.Assert(_path is not null); 180Debug.Assert(fileLength >= 0); 347Debug.Assert(Interop.Sys.LSeek(this, 0, Interop.Sys.SeekWhence.SEEK_CUR) >= 0); 452Debug.Assert(mode == FileMode.Create || mode == FileMode.CreateNew); 467Debug.Assert(lockOperation == Interop.Sys.LockOperations.LOCK_EX || lockOperation == Interop.Sys.LockOperations.LOCK_SH); 515Debug.Assert(!IsClosed); 516Debug.Assert(!IsInvalid);
src\libraries\System.Private.CoreLib\src\System\AggregateException.cs (1)
175Debug.Assert(_innerExceptions[i] != null);
src\libraries\System.Private.CoreLib\src\System\AppContext.AnyOS.cs (1)
72Debug.Assert(s_dataStore is not null);
src\libraries\System.Private.CoreLib\src\System\AppContext.cs (1)
157Debug.Assert(s_dataStore == null, "s_dataStore is not expected to be inited before Setup is called");
src\libraries\System.Private.CoreLib\src\System\AppDomain.cs (1)
414Debug.Assert(mi != null);
src\libraries\System.Private.CoreLib\src\System\Array.cs (14)
71Debug.Assert(array != null); 614Debug.Assert(low <= hi); 615Debug.Assert(hi - low >= 0, "Length overflow!"); 951Debug.Fail("All primitive types should be handled above"); 1450Debug.Fail("All primitive types should be handled above"); 1680Debug.Fail("All primitive types should be handled above"); 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\SharedArrayPool.cs (2)
280Debug.Assert(t_tlsBuckets is null, $"Non-null {nameof(t_tlsBuckets)}"); 477Debug.Assert(array is not null, "No nulls should have been present in slots < _count.");
src\libraries\System.Private.CoreLib\src\System\Buffers\StandardFormat.cs (1)
160Debug.Assert(destination.Length == FormatStringLength);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64.cs (2)
21Debug.Fail($"Read for {typeof(TVector)} is not within safe bounds. srcIndex: {srcIndex}, srcLength: {srcLength}"); 35Debug.Fail($"Write for {typeof(TVector)} is not within safe bounds. destIndex: {destIndex}, destLength: {destLength}");
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 (3)
25Debug.Assert(log2ToPow10.Length == 64); 55Debug.Assert((index + 1) <= powersOf10.Length); 103Debug.Assert(table.Length == 32, "Every result of uint.Log2(value) needs a long entry in the table.");
src\libraries\System.Private.CoreLib\src\System\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\ParserHelpers.cs (1)
69Debug.Fail("Control should never reach this point.");
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 (2)
96Debug.Assert(IsLatin1(c), "char.GetLatin1UnicodeCategory(): c should be <= 00ff"); 362Debug.Assert(IsLatin1(c));
src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentQueue.cs (22)
240Debug.Assert(count == i); 335Debug.Assert(s._frozenForEnqueues, "Internal segment must be frozen as there's a following segment."); 369Debug.Assert(head._preservedForObservation); 370Debug.Assert(head._frozenForEnqueues); 371Debug.Assert(tail._preservedForObservation); 372Debug.Assert(tail._frozenForEnqueues); 403Debug.Assert(s._preservedForObservation); 404Debug.Assert(s._frozenForEnqueues); 469Debug.Assert(count == i - index); 499Debug.Assert(head != null); 500Debug.Assert(tail != null); 501Debug.Assert(tail._nextSegment == null); 509Debug.Assert(s._frozenForEnqueues); // any non-tail should already be marked 524Debug.Assert(segment._preservedForObservation); 544Debug.Assert(head._preservedForObservation); 545Debug.Assert(head._frozenForEnqueues); 546Debug.Assert(tail._preservedForObservation); 547Debug.Assert(tail._frozenForEnqueues); 577Debug.Assert(s._preservedForObservation, "Would have had to been preserved as a segment part of enumeration"); 578Debug.Assert(s._frozenForEnqueues, "Would have had to be frozen for enqueues as it's intermediate"); 719Debug.Assert(head._frozenForEnqueues); 782Debug.Assert(next == s._nextSegment);
src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentQueueSegment.cs (2)
48Debug.Assert(boundedLength >= 2, $"Must be >= 2, got {boundedLength}"); 49Debug.Assert(BitOperations.IsPow2(boundedLength), $"Must be a power of 2, got {boundedLength}");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ArraySortHelper.cs (46)
56Debug.Assert(comparer != null, "Check the arguments in the caller!"); 75Debug.Assert(array != null, "Check the arguments in the caller!"); 76Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 101Debug.Assert(i != j); 114Debug.Assert(i != j); 123Debug.Assert(comparer != null); 136Debug.Assert(!keys.IsEmpty); 137Debug.Assert(depthLimit >= 0); 138Debug.Assert(comparer != null); 181Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold); 182Debug.Assert(comparer != null); 219Debug.Assert(comparer != null); 220Debug.Assert(!keys.IsEmpty); 237Debug.Assert(comparer != null); 326Debug.Assert(array != null, "Check the arguments in the caller!"); 327Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 401Debug.Assert(!Unsafe.AreSame(ref i, ref j)); 413Debug.Assert(!keys.IsEmpty); 414Debug.Assert(depthLimit >= 0); 460Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold); 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 (34)
129Debug.Assert(source._entries is not null); 130Debug.Assert(_entries is not null); 131Debug.Assert(_entries.Length >= source.Count); 132Debug.Assert(_count == 0); 199Debug.Assert(_comparer is not null, "The comparer should never be null for a reference type."); 244Debug.Assert(modified); 251Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 285Debug.Assert(_buckets != null, "_buckets should be non-null"); 286Debug.Assert(_entries != null, "_entries should be non-null"); 407Debug.Assert(_entries != null, "expected entries to be != null"); 444Debug.Assert(comparer is not null); 519Debug.Assert(_buckets != null); 522Debug.Assert(entries != null, "expected entries to be non-null"); 525Debug.Assert(comparer is not null || typeof(TKey).IsValueType); 567Debug.Assert(comparer is not null); 602Debug.Assert((StartOfFreeList - entries[_freeList].next) >= -1, "shouldn't overflow because `next` cannot underflow"); 660Debug.Assert(dictionary._buckets != null); 663Debug.Assert(entries != null, "expected entries to be non-null"); 666Debug.Assert(comparer is not null || typeof(TKey).IsValueType); 699Debug.Assert(comparer is not null); 725Debug.Assert((StartOfFreeList - entries[dictionary._freeList].next) >= -1, "shouldn't overflow because `next` cannot underflow"); 764Debug.Assert(!Unsafe.IsNullRef(ref value), "the lookup result cannot be a null ref here"); 826Debug.Assert(!forceNewHashCodes || !typeof(TKey).IsValueType); 827Debug.Assert(_entries != null, "_entries should be non-null"); 828Debug.Assert(newSize >= _entries.Length); 837Debug.Assert(_comparer is NonRandomizedStringEqualityComparer); 880Debug.Assert(_entries != null, "entries should be non-null"); 884Debug.Assert(typeof(TKey).IsValueType || comparer is not null); 907Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 953Debug.Assert(_entries != null, "entries should be non-null"); 957Debug.Assert(typeof(TKey).IsValueType || comparer is not null); 982Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 1178Debug.Assert(oldEntries is not null); 1185Debug.Assert(_entries is not null);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (20)
184Debug.Assert(Count == source.Count); 199Debug.Assert(_buckets != null, "_buckets should be non-null"); 200Debug.Assert(_entries != null, "_entries should be non-null"); 222Debug.Assert(entries != null, "Expected _entries to be initialized"); 252Debug.Assert(comparer is not null); 294Debug.Assert(entries != null, "entries should be non-null"); 300Debug.Assert(typeof(T).IsValueType || comparer is not null); 324Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 927Debug.Assert(_comparer is not null, "The comparer should never be null for a reference type."); 966Debug.Assert(!forceNewHashCodes || !typeof(T).IsValueType); 967Debug.Assert(_entries != null, "_entries should be non-null"); 968Debug.Assert(newSize >= _entries.Length); 977Debug.Assert(_comparer is NonRandomizedStringEqualityComparer); 1094Debug.Assert(_buckets != null); 1097Debug.Assert(entries != null, "expected entries to be non-null"); 1133Debug.Assert(comparer is not null); 1161Debug.Assert((StartOfFreeList - entries![_freeList].Next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1194Debug.Assert(location >= 0); 1252Debug.Assert(_buckets != null, "_buckets shouldn't be null; callers should check first"); 1410Debug.Assert((_buckets != null) && (_count > 0), "_buckets was null but count greater than 0");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\List.cs (3)
216Debug.Assert(_size == _items.Length); 466Debug.Assert(insertionCount > 0); 490Debug.Assert(_items.Length < capacity);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\NonRandomizedStringEqualityComparer.cs (3)
30Debug.Assert(underlyingComparer != null); 87Debug.Assert(obj != null, "This implementation is only called from first-party collection types that guarantee non-null parameters."); 104Debug.Assert(obj != null, "This implementation is only called from first-party collection types that guarantee non-null parameters.");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Queue.cs (4)
312Debug.Assert(capacity >= _size); 349Debug.Assert(_size == 0); 397Debug.Assert(_array.Length < capacity); 495Debug.Assert(_index == -1 || _index == -2);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (6)
28Debug.Assert(value >= 0); 29Debug.Assert(value <= _span.Length); 38Debug.Assert(index < _pos); 91Debug.Assert(index == 0, "Implementation currently only supports index == 0"); 106Debug.Assert(length >= 0); 134Debug.Assert(_pos == _span.Length);
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (3)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
src\libraries\System.Private.CoreLib\src\System\Collections\Hashtable.cs (13)
281Debug.Assert(_loadsize < hashsize, "Invalid hashtable loadsize!"); 424Debug.Assert(!_isWriterInProgress, "Race condition detected in usages of Hashtable - multiple threads appear to be writing to a Hashtable instance simultaneously! Don't do that - use Hashtable.Synchronized."); 536Debug.Assert(array != null); 537Debug.Assert(array.Rank == 1); 555Debug.Assert(array != null); 556Debug.Assert(array.Rank == 1); 607Debug.Assert(array != null); 608Debug.Assert(array.Rank == 1); 743Debug.Assert(_loadsize < newsize, "Our current implementation means this is not possible."); 790Debug.Assert(key != null, "key can't be null here!"); 934Debug.Fail("hash table insert failed! Load factor too high, or our double hashing function is incorrect."); 940Debug.Assert(hashcode >= 0, "hashcode >= 0"); // make sure collision bit (sign bit) wasn't set. 972Debug.Assert(!_isWriterInProgress, "Race condition detected in usages of Hashtable - multiple threads appear to be writing to a Hashtable instance simultaneously! Don't do that - use Hashtable.Synchronized.");
src\libraries\System.Private.CoreLib\src\System\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\ComponentModel\DefaultValueAttribute.cs (1)
44Debug.Assert(IsSupported, "Runtime instantiation of this attribute is not allowed with trimming.");
src\libraries\System.Private.CoreLib\src\System\Convert.Base64.cs (1)
153Debug.Assert((consumed % 4) == 0);
src\libraries\System.Private.CoreLib\src\System\Convert.cs (18)
172Debug.Assert(value != null, "[Convert.DefaultToType]value!=null"); 2372Debug.Assert(result.Length == charsWritten, $"Expected {result.Length} == {charsWritten}"); 2422Debug.Assert(converted == charLengthRequired); 2461Debug.Assert(converted == charLengthRequired); 2477Debug.Assert(bytes.Length >= Base64VectorizationLengthThreshold); 2478Debug.Assert(chars.Length >= charLengthRequired); 2479Debug.Assert(charLengthRequired % 4 == 0); 2483Debug.Assert(status == OperationStatus.Done && charLengthRequired == bytesWritten); 2543Debug.Assert(Unsafe.AreSame(ref srcBeginning, ref src)); 2544Debug.Assert(Unsafe.AreSame(ref srcBeginning, ref Unsafe.As<ushort, byte>(ref dest)), 2688Debug.Assert(chars.Length != 0); // If TryDecodeFromUtf16() consumed the entire buffer, it could not have returned false. 2717Debug.Assert(chars.Length != 0 && !chars[0].IsSpace()); 2765Debug.Assert(tempBuffer.Length != 0); // We only bound-check after writing a character to the tempBuffer. 2828Debug.Assert(0 <= inputLength); 2843Debug.Assert(0 <= resultLength); 2873Debug.Assert(0 <= inputLength); 2896Debug.Assert(0 <= usefulInputLength); 2900Debug.Assert(0 <= padding);
src\libraries\System.Private.CoreLib\src\System\DateOnly.cs (5)
38Debug.Assert((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 (6)
218Debug.Assert(kind == DateTimeKind.Local, "Internal Constructor is for local times only"); 673Debug.Assert(newTicks <= MaxTicks); 819Debug.Assert(ticks <= MaxTicks, "Input parameters validated already"); 1149Debug.Assert(ticks <= MaxTicks, "Input parameters validated already"); 1162Debug.Assert(ticks <= MaxTicks, "Input parameters validated already"); 2053Debug.Assert(ticks <= MaxTicks, "Input parameters validated already");
src\libraries\System.Private.CoreLib\src\System\DateTimeOffset.cs (2)
344Debug.Assert(new DateTimeOffset(utcNow) == result); // ensure lack of verification does not break anything 994Debug.Assert(offset.Ticks >= MinOffset && offset.Ticks <= MaxOffset, "Offset not validated.");
src\libraries\System.Private.CoreLib\src\System\Decimal.cs (3)
382Debug.Assert((exponent >= 67) && (exponent <= 95)); 630Debug.Assert(buffer.Length >= 16, "buffer.Length >= 16"); 640Debug.Assert(span.Length >= 16, "span.Length >= 16");
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\DefaultBinder.cs (1)
1062Debug.Assert(cur1.IsStatic != cur2.IsStatic, "hierarchyDepth1 == hierarchyDepth2");
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Contracts\ContractFailedEventArgs.cs (1)
19Debug.Assert(originalException == null || failureKind == ContractFailureKind.PostconditionOnException);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Debug.cs (5)
277/// <summary>Provides an interpolated string handler for <see cref="Debug.Assert"/> that only performs formatting if the assert fails.</summary> 288/// <param name="condition">The condition Boolean passed to the <see cref="Debug"/> method.</param> 371/// <summary>Provides an interpolated string handler for <see cref="Debug.WriteIf"/> and <see cref="Debug.WriteLineIf"/> that only performs formatting if the condition applies.</summary> 382/// <param name="condition">The condition Boolean passed to the <see cref="Debug"/> method.</param>
src\libraries\System.Private.CoreLib\src\System\Diagnostics\DebugProvider.cs (2)
103int indentCount = Debug.IndentSize * Debug.IndentLevel;
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 (9)
68Debug.Assert(Monitor.IsEntered(m_dispatchControlLock)); 116Debug.Fail("GetSessionInfo returned false."); 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\EventPipePayloadDecoder.cs (1)
133Debug.Fail($"Unsupported type \"{parameterType}\" encountered.");
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventProvider.cs (4)
170Debug.Assert(!Monitor.IsEntered(EventListener.EventListenersLock)); 486Debug.Assert(EtwAPIMaxRefObjCount == 8, $"{nameof(EtwAPIMaxRefObjCount)} must equal the number of fields in {nameof(EightObjects)}"); 698Debug.Assert((EventOpcode)eventDescriptor.Opcode == EventOpcode.Send || 1376Debug.Assert(filterData != null);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (70)
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); 1872Debug.Assert(data->Size >= 0 && data->Size % 2 == 0, "String size should be even"); 1877Debug.Assert(*(charPointer + i) != 0, "String may not contain null chars"); 1879Debug.Assert(*(charPointer + charLength) == 0, "String must be null terminated"); 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); 2810Debug.Assert(EventListener.s_EventSources != null, "should be called within lock on EventListener.EventListenersLock which ensures s_EventSources to be initialized"); 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); 4329Debug.Fail("EventSource did not have a registered EventListener!"); 4361Debug.Assert(s_EventSources != null); 4378Debug.Assert(eventSource.m_id == id, "Unexpected event source ID."); 4384Debug.Assert(allListeners.ContainsKey(dispatcher.m_Listener), "EventSource has a listener not on the global list."); 4394Debug.Assert(dispatcher != null, "Listener is not on all eventSources."); 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\ArrayTypeInfo.cs (1)
46Debug.Assert(value != null, "null accepted only for some overrides");
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\DataCollector.cs (6)
98Debug.Assert(buffer != null); 133Debug.Assert(buffer != null); 172Debug.Assert(buffer != null); 213Debug.Assert(value != null && buffer != null); 238Debug.Assert(buffer != null); 271Debug.Assert(buffer != null);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\EnumerableTypeInfo.cs (1)
51Debug.Assert(value != null, "null accepted only for some overrides");
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\EventPayload.cs (1)
19Debug.Assert(payloadNames.Length == payloadValues.Length);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\FieldMetadata.cs (1)
214Debug.Assert(custom != null);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\PropertyValue.cs (3)
132Debug.Assert(_scalarLength == 0, "This ReflectedValue refers to an unboxed value type, not a reference type or boxed value type."); 141Debug.Assert(_scalarLength > 0, "This ReflectedValue refers to a reference type or boxed value type, not an unboxed value type"); 150Debug.Assert(_scalarLength > 0, "This ReflectedValue refers to a reference type or boxed value type, not an unboxed value type");
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\SimpleEventTypes.cs (1)
33Debug.Assert(instance != null);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\SimpleTypeInfos.cs (1)
319Debug.Assert(typeArgs.Length == 1);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingEventHandleTable.cs (1)
41Debug.Assert(Monitor.IsEntered(this));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingEventSource.cs (6)
420Debug.Assert(eventHandle != IntPtr.Zero); 530Debug.Assert(eventHandle != IntPtr.Zero); 598Debug.Assert(eventHandle != IntPtr.Zero); 632Debug.Assert(eventName != null, "GetOpcodeWithDefault should not returned Start when eventName is null"); 637Debug.Assert(eventName != null, "GetOpcodeWithDefault should not returned Stop when eventName is null"); 790Debug.Assert(ProviderMetadata.SequenceEqual(m_providerMetadata));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\XplatEventLogger.cs (1)
151Debug.Assert(byteArray != null);
src\libraries\System.Private.CoreLib\src\System\Double.cs (7)
295Debug.Assert(IsNaN(value)); 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 (27)
260Debug.Assert(enumType.IsActualEnum); 343Debug.Assert(enumType.IsActualEnum); 373Debug.Assert(enumType.IsActualEnum); 464Debug.Fail("Unknown enum underlying type"); 586Debug.Assert(success && result is not null); 606Debug.Assert(success && result is not null); 648Debug.Assert(success); 665Debug.Assert(success); 1247Debug.Fail("Unknown enum underlying type"); 1349Debug.Fail("Unknown enum underlying type"); 1547Debug.Assert(success); 1548Debug.Assert(charsWritten == Unsafe.SizeOf<TStorage>() * 2); 1807Debug.Assert(typeof(TEnum).IsEnum); 1808Debug.Assert(value is not null); 1899Debug.Assert(!format.IsEmpty); 1935Debug.Assert(names.Length == values.Length); 1966Debug.Assert(!isDestinationTooSmall); 1970Debug.Assert(names.Length == values.Length); 2016Debug.Assert(foundItemsCount >= 2 && foundItemsCount <= 64, $"{nameof(foundItemsCount)} == {foundItemsCount}"); 2111Debug.Assert(foundItems.Length >= 2, $"{nameof(foundItems)} == {foundItems.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 (7)
24Debug.Assert(path != null); 42Debug.Assert(option == SpecialFolderOption.Create); 72Debug.Fail($"Unable to get home directory: {exc}"); 164Debug.Assert(!string.IsNullOrEmpty(homeDir), $"Expected non-empty homeDir"); 165Debug.Assert(!string.IsNullOrEmpty(key), $"Expected non-empty key"); 166Debug.Assert(!string.IsNullOrEmpty(fallback), $"Expected non-empty fallback"); 242Debug.Fail($"Failed reading {userDirsPath}: {exc}");
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\Calendar.cs (2)
123Debug.Assert(BaseCalendarID != CalendarId.UNINITIALIZED_VALUE, "[Calendar.CurrentEraValue] Expected a real calendar ID"); 394Debug.Assert(offset >= 0, "Calendar.GetFirstDayWeekOfYear(): offset >= 0");
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.cs (1)
104Debug.Assert(!GlobalizationMode.Invariant);
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Icu.cs (11)
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); 331Debug.Assert(!unsupportedDateFieldSymbols.Contains(input[index]), 387Debug.Assert(calendarId == CalendarId.HEBREW && callbackContext.Results.Count == 14); 467Debug.Fail(e.ToString());
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 (8)
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); 210Debug.Fail("Not expected to come here"); 389Debug.Assert(day != upperBoundNewYearDay);
src\libraries\System.Private.CoreLib\src\System\Globalization\CharUnicodeInfo.cs (10)
56Debug.Assert(s != null, "s != null"); 57Debug.Assert(index >= 0 && index < s.Length, "index < s.Length"); 89Debug.Assert(bidiCategory == StrongBidiCategory.Other || bidiCategory == StrongBidiCategory.StrongLeftToRight || bidiCategory == StrongBidiCategory.StrongRightToLeft, "Unknown StrongBidiCategory value."); 365Debug.Assert(value != null, "value can not be null"); 366Debug.Assert(index < value.Length, "index < value.Length"); 377Debug.Assert(str != null, "str can not be null"); 378Debug.Assert(str.Length > 0, "str.Length > 0"); 379Debug.Assert(index >= 0 && index < str.Length, "index >= 0 && index < str.Length"); 411Debug.Assert(s != null, "s != null"); 412Debug.Assert((uint)index < (uint)s.Length, "index < s.Length");
src\libraries\System.Private.CoreLib\src\System\Globalization\CharUnicodeInfoData.cs (6)
17Debug.Assert(level1BitCount == 11, "Unexpected level 1 bit count."); 18Debug.Assert(level2BitCount == 5, "Unexpected level 2 bit count."); 19Debug.Assert(level3BitCount == 4, "Unexpected level 3 bit count."); 1436Debug.Assert(level1BitCount == 11, "Unexpected level 1 bit count."); 1437Debug.Assert(level2BitCount == 5, "Unexpected level 2 bit count."); 1438Debug.Assert(level3BitCount == 4, "Unexpected level 3 bit count.");
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.cs (6)
221Debug.Assert(m_name != null, "CompareInfo.OnSerializing - expected m_name to be set already"); 238Debug.Assert(m_name != null, "CompareInfo.Name Expected _name to be set"); 366Debug.Assert(!Unsafe.IsNullRef(ref MemoryMarshal.GetReference(span1))); 367Debug.Assert(!Unsafe.IsNullRef(ref MemoryMarshal.GetReference(span2))); 395Debug.Assert(offset2 > (string2 == null ? 0 : string2.Length) - length2); 1058Debug.Assert(matchLengthPtr != null);
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Icu.cs (50)
39Debug.Assert(!GlobalizationMode.UseNls); 40Debug.Assert(interopCultureName != null); 52Debug.Assert(!GlobalizationMode.Invariant); 53Debug.Assert(!GlobalizationMode.UseNls); 54Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 68Debug.Assert(!GlobalizationMode.Invariant); 69Debug.Assert(!GlobalizationMode.UseNls); 70Debug.Assert(target.Length != 0); 106Debug.Assert(!GlobalizationMode.Invariant); 108Debug.Assert(!target.IsEmpty); 109Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 222Debug.Assert(!GlobalizationMode.Invariant); 224Debug.Assert(!target.IsEmpty); 225Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 328Debug.Assert(!GlobalizationMode.Invariant); 329Debug.Assert(!GlobalizationMode.UseNls); 331Debug.Assert(!prefix.IsEmpty); 332Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 357Debug.Assert(!GlobalizationMode.Invariant); 359Debug.Assert(!prefix.IsEmpty); 360Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 439Debug.Assert(!GlobalizationMode.Invariant); 441Debug.Assert(!prefix.IsEmpty); 442Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 512Debug.Assert(!GlobalizationMode.Invariant); 513Debug.Assert(!GlobalizationMode.UseNls); 515Debug.Assert(!suffix.IsEmpty); 516Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 541Debug.Assert(!GlobalizationMode.Invariant); 543Debug.Assert(!suffix.IsEmpty); 544Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 624Debug.Assert(!GlobalizationMode.Invariant); 626Debug.Assert(!suffix.IsEmpty); 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); 843Debug.Assert(!text.IsEmpty); 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 (64)
14Debug.Assert(GlobalizationMode.UseNls); 50Debug.Assert(!GlobalizationMode.Invariant); 51Debug.Assert(!source.IsEmpty); 52Debug.Assert(!value.IsEmpty); 57Debug.Assert(pSource != null); 58Debug.Assert(pValue != null); 68Debug.Assert(ret >= -1 && ret <= source.Length); 71Debug.Assert(ret >= 0 || Marshal.GetLastPInvokeError() == Interop.Errors.ERROR_SUCCESS); 79Debug.Assert(!GlobalizationMode.Invariant); 80Debug.Assert(GlobalizationMode.UseNls); 82Debug.Assert(source.Length != 0); 83Debug.Assert(value.Length != 0); 91Debug.Assert(!GlobalizationMode.Invariant); 92Debug.Assert(GlobalizationMode.UseNls); 94Debug.Assert(source != null); 95Debug.Assert(value != null); 108Debug.Assert(!GlobalizationMode.Invariant); 109Debug.Assert(GlobalizationMode.UseNls); 110Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 186Debug.Assert(!GlobalizationMode.Invariant); 187Debug.Assert(GlobalizationMode.UseNls); 189Debug.Assert(count1 > 0); 190Debug.Assert(count2 > 0); 195Debug.Assert(char1 != null); 196Debug.Assert(char2 != null); 210Debug.Assert(!GlobalizationMode.Invariant); 211Debug.Assert(GlobalizationMode.UseNls); 212Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 234Debug.Assert(*pString1 >= 0); // assert that we can always dereference this 235Debug.Assert(*pString2 >= 0); // assert that we can always dereference this 264Debug.Assert(!GlobalizationMode.Invariant); 265Debug.Assert(!lpStringValue.IsEmpty); 286Debug.Assert(pSource != null && pValue != null); 300Debug.Assert(result >= -1 && result <= lpStringSource.Length); 303Debug.Assert(result >= 0 || Marshal.GetLastPInvokeError() == Interop.Errors.ERROR_SUCCESS); 311Debug.Assert(!GlobalizationMode.Invariant); 312Debug.Assert(GlobalizationMode.UseNls); 314Debug.Assert(target.Length != 0); 322Debug.Assert(!GlobalizationMode.Invariant); 323Debug.Assert(GlobalizationMode.UseNls); 325Debug.Assert(!prefix.IsEmpty); 326Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 343Debug.Assert(!GlobalizationMode.Invariant); 344Debug.Assert(GlobalizationMode.UseNls); 346Debug.Assert(!suffix.IsEmpty); 347Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 373Debug.Assert(!GlobalizationMode.Invariant); 374Debug.Assert(GlobalizationMode.UseNls); 425Debug.Assert(!GlobalizationMode.Invariant); 426Debug.Assert((options & ValidCompareMaskOffFlags) == 0); 467Debug.Assert(pSource != null); 468Debug.Assert(pSortKey != null); 503Debug.Assert(actualSortKeyLength == 0, "LCMapStringEx should never return a negative value."); 519Debug.Assert(actualSortKeyLength <= destination.Length); 525Debug.Assert(!GlobalizationMode.Invariant); 526Debug.Assert((options & ValidCompareMaskOffFlags) == 0); 545Debug.Assert(pSource != null); 555Debug.Assert(sortKeyLength == 0, "LCMapStringEx should never return a negative value."); 568Debug.Assert(!GlobalizationMode.Invariant); 569Debug.Assert(GlobalizationMode.UseNls); 570Debug.Assert(!text.IsEmpty); 605Debug.Assert(((options & ~(CompareOptions.IgnoreCase | 618Debug.Assert(!GlobalizationMode.Invariant); 619Debug.Assert(GlobalizationMode.UseNls);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.cs (20)
917Debug.Assert(_sRealName != null, "[CultureData.CultureName] Expected _sRealName to be populated by already"); 1104Debug.Assert(_sSpecificCulture != null, "[CultureData.SpecificCultureName] Expected this.sSpecificCulture to be populated by culture data initialization already"); 1683Debug.Assert(_sWindowsName != null, "[CultureData.CalendarIds] Expected _sWindowsName to be populated by already"); 1751Debug.Assert(calendarId > 0 && calendarId <= CalendarId.LAST_CALENDAR, 1767Debug.Assert(_sWindowsName != null, "[CultureData.GetCalendar] Expected _sWindowsName to be populated by already"); 1796Debug.Assert(_sRealName != null, "[CultureData.IsRightToLeft] Expected _sRealName to be populated by already"); 1820Debug.Assert(_sRealName != null, "[CultureData.TextInfoName] Expected _sRealName to be populated by already"); 1832Debug.Assert(_sRealName != null, "[CultureData.SortName] Expected _sRealName to be populated by already"); 1905Debug.Assert(_sRealName != null, "[CultureData.LCID] Expected this.sRealName to be populated already"); 1948Debug.Assert(calendarId > 0, "[CultureData.saEraNames] Expected Calendar.ID > 0"); 1954Debug.Assert(calendarId > 0, "[CultureData.saAbbrevEraNames] Expected Calendar.ID > 0"); 1960Debug.Assert(calendarId > 0, "[CultureData.saAbbrevEraNames] Expected Calendar.ID > 0"); 2042Debug.Assert(str != null); 2043Debug.Assert(start >= 0); 2044Debug.Assert(end >= 0); 2129Debug.Assert(startIndex >= 0, "startIndex cannot be negative"); 2130Debug.Assert(!timeParts.AsSpan().ContainsAny('\'', '\\'), "timeParts cannot include quote characters"); 2224Debug.Assert(index >= 10, $"Couldn't read native digits for '{_sWindowsName}' successfully."); 2250Debug.Assert(_sWindowsName != null, "[CultureData.GetNFIValues] Expected _sWindowsName to be populated by already"); 2270Debug.Assert(_sRealName != null);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Icu.cs (33)
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); 205Debug.Assert(_sWindowsName != null, "[CultureData.IcuGetLocaleInfo] Expected _sWindowsName to be populated already"); 219Debug.Assert(!GlobalizationMode.UseNls); 220Debug.Assert(localeName != null, "[CultureData.IcuGetLocaleInfo] Expected localeName to be not be null"); 235Debug.Fail("[CultureData.IcuGetLocaleInfo(LocaleStringData)] Failed"); 243Debug.Assert(!GlobalizationMode.UseNls); 245Debug.Assert(_sWindowsName != null, "[CultureData.IcuGetLocaleInfo(LocaleNumberData)] Expected _sWindowsName to be populated already"); 260Debug.Fail("[CultureData.IcuGetLocaleInfo(LocaleNumberData)] failed"); 268Debug.Assert(!GlobalizationMode.UseNls); 269Debug.Assert(_sWindowsName != null, "[CultureData.IcuGetLocaleInfo(LocaleGroupingData)] Expected _sWindowsName to be populated already"); 276Debug.Fail("[CultureData.IcuGetLocaleInfo(LocaleGroupingData type)] failed"); 291Debug.Assert(!GlobalizationMode.UseNls); 292Debug.Assert(_sWindowsName != null, "[CultureData.GetTimeFormatString(bool shortFormat)] Expected _sWindowsName to be populated already"); 300Debug.Fail("[CultureData.GetTimeFormatString(bool shortFormat)] Failed"); 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); 444Debug.Assert(false, "[CultureData.IcuGetListSeparator] Unexpected ListSeparator value."); 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 (25)
44Debug.Assert(!GlobalizationMode.Invariant); 51Debug.Assert(ShouldUseUserOverrideNlsData); 52Debug.Assert(_sRealName != null, "[CultureData.DoGetLocaleInfo] Expected _sRealName to be populated by already"); 60Debug.Assert(ShouldUseUserOverrideNlsData); 68Debug.Assert(IsWin32Installed); 79Debug.Assert(_sRealName != null, "[CultureData.DoGetLocaleInfoInt] Expected _sRealName to be populated by already"); 85Debug.Assert(ShouldUseUserOverrideNlsData); 86Debug.Assert(_sRealName != null, "[CultureData.DoGetLocaleInfoInt] Expected _sRealName to be populated by already"); 92Debug.Assert(GlobalizationMode.UseNls); 98Debug.Assert(ShouldUseUserOverrideNlsData); 99Debug.Assert(_sRealName != null, "[CultureData.DoGetLocaleInfoInt] Expected _sRealName to be populated by already"); 105Debug.Assert(ShouldUseUserOverrideNlsData); 106Debug.Assert(_sRealName != null, "[CultureData.DoGetLocaleInfoInt] Expected _sRealName to be populated by already"); 118Debug.Assert(!GlobalizationMode.Invariant); 119Debug.Assert(GlobalizationMode.UseNls); 120Debug.Assert(regionName != null); 142Debug.Assert(GlobalizationMode.UseNls); 162Debug.Assert(GlobalizationMode.UseNls); 178Debug.Assert(localeName != null, "[CultureData.GetLocaleInfoFromLCType] Expected localeName to be not be null"); 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 (6)
181Debug.Assert(cultureData != null); 189Debug.Assert(name != null); 465Debug.Assert(s_InvariantCultureInfo != null, "[CultureInfo.InvariantCulture] s_InvariantCultureInfo is null"); 587Debug.Assert(_name != null, "[CultureInfo.DisplayName] Always expect _name to be set"); 798Debug.Assert(!GlobalizationMode.Invariant); 814Debug.Assert(calType != CalendarId.GREGORIAN, "calType!=CalendarId.GREGORIAN");
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureInfo.Unix.cs (1)
18Debug.Assert(localeName != null);
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (23)
166Debug.Assert(value >= 0, "DateTimeFormat.FormatDigits(): value >= 0"); 167Debug.Assert(minimumLength <= 16); 209Debug.Assert(dayOfWeek >= 0 && dayOfWeek <= 6, "dayOfWeek >= 0 && dayOfWeek <= 6"); 221Debug.Assert(month >= 1 && month <= 12, "month >=1 && month <= 12"); 262Debug.Assert(repeatCount != 3 || repeatCount != 4, "repeateCount should be 3 or 4"); 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 (51)
172Debug.Assert(abbreviatedDayNames.Length == 7, "[DateTimeFormatInfo.GetAbbreviatedDayOfWeekNames] Expected 7 day names in a week"); 186Debug.Assert(m_superShortDayNames.Length == 7, "[DateTimeFormatInfo.InternalGetSuperShortDayNames] Expected 7 day names in a week"); 200Debug.Assert(dayNames.Length == 7, "[DateTimeFormatInfo.GetDayOfWeekNames] Expected 7 day names in a week"); 214Debug.Assert(abbreviatedMonthNames.Length == 12 || abbreviatedMonthNames.Length == 13, 229Debug.Assert(monthNames.Length == 12 || monthNames.Length == 13, 243Debug.Assert(cultureData != null); 244Debug.Assert(cal != null); 254Debug.Assert(cultureData != null); 255Debug.Assert(calendarId != CalendarId.UNINITIALIZED_VALUE, "[DateTimeFormatInfo.Populate] Expected initialized calendarId"); 272Debug.Assert(allLongTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long time patterns"); 275Debug.Assert(allShortTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short time patterns"); 278Debug.Assert(allLongDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long date patterns"); 281Debug.Assert(allShortDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short date patterns"); 284Debug.Assert(allYearMonthPatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some year month patterns"); 340Debug.Assert(amDesignator != null, "DateTimeFormatInfo.AMDesignator, amDesignator != null"); 359Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 369Debug.Assert(calendar != null, "DateTimeFormatInfo.Calendar: calendar != null"); 573Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.AbbreviatedEnglishEraNames] Expected Calendar.ID > 0"); 589Debug.Assert(dateSeparator != null, "DateTimeFormatInfo.DateSeparator, dateSeparator != null"); 608Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 622Debug.Assert(firstDayOfWeek != -1, "DateTimeFormatInfo.FirstDayOfWeek, firstDayOfWeek != -1"); 654Debug.Assert(calendarWeekRule != -1, "DateTimeFormatInfo.CalendarWeekRule, calendarWeekRule != -1"); 768Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.MonthDayPattern] Expected calID > 0"); 772Debug.Assert(monthDayPattern != null, "DateTimeFormatInfo.MonthDayPattern, monthDayPattern != null"); 792Debug.Assert(pmDesignator != null, "DateTimeFormatInfo.PMDesignator, pmDesignator != null"); 811Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 974Debug.Assert(timeSeparator != null, "DateTimeFormatInfo.TimeSeparator, timeSeparator != null"); 993Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1037Debug.Assert(values != null, "value != null"); 1038Debug.Assert(values.Length >= length); 1196Debug.Assert(m_genitiveAbbreviatedMonthNames.Length == 13, 1206Debug.Assert(genitiveMonthNames.Length == 13, 1222Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.InternalGetLeapYearMonthNames] Expected Calendar.ID > 0"); 1224Debug.Assert(leapYearMonthNames.Length == 13, 1263Debug.Assert(patterns1 != null); 1264Debug.Assert(patterns2 != null); 1405Debug.Assert(patterns != null && patterns.Length > 0, 1407Debug.Assert(defaultPattern != null, 1483Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.UnclonedYearMonthPatterns] Expected Calendar.ID > 0"); 1485Debug.Assert(allYearMonthPatterns.Length > 0, 1504Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.UnclonedShortDatePatterns] Expected Calendar.ID > 0"); 1506Debug.Assert(allShortDatePatterns.Length > 0, 1525Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.UnclonedLongDatePatterns] Expected Calendar.ID > 0"); 1527Debug.Assert(allLongDatePatterns.Length > 0, 1547Debug.Assert(allShortTimePatterns.Length > 0, 1567Debug.Assert(allLongTimePatterns.Length > 0, 1732Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2296Debug.Assert(state == HebrewNumberParsingState.ContinueParsing || state == HebrewNumberParsingState.FoundEndOfHebrewNumber, 2345Debug.Assert(str.Index < str.Value.Length, "DateTimeFormatInfo.Tokenize(): start < value.Length"); 2463Debug.Fail("The hashtable is full. This should not happen."); 2547Debug.Fail("The hashtable is full. This should not happen.");
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeParse.cs (23)
97Debug.Assert(dtfi != null, "dtfi == null"); 190Debug.Assert(dtfi != null, "dtfi == null"); 553Debug.Assert(hourOffset >= 0 && hourOffset <= 99, "hourOffset >= 0 && hourOffset <= 99"); 554Debug.Assert(minuteOffset >= 0 && minuteOffset <= 99, "minuteOffset >= 0 && minuteOffset <= 99"); 1054Debug.Fail("Should never be reached"); 1076Debug.Fail("Should never be reached"); 2069Debug.Assert(raw.numCount >= 2, "raw.numCount >= 2"); 2091Debug.Assert(raw.numCount >= 3, "raw.numCount >= 3"); 2513Debug.Assert(dtfi != null, "dtfi == null"); 2809Debug.Assert(result.parsedDate.Kind == DateTimeKind.Unspecified, "result.parsedDate.Kind == DateTimeKind.Unspecified"); 3145Debug.Assert(minDigitLen > 0, "minDigitLen > 0"); 3146Debug.Assert(maxDigitLen < 9, "maxDigitLen < 9"); 3147Debug.Assert(minDigitLen <= maxDigitLen, "minDigitLen <= maxDigitLen"); 3182Debug.Assert(maxDigitLen <= DateTimeFormat.MaxSecondsFractionDigits); 5211Debug.Fail("Unknown DateTimeParseFailure: " + result.failure.ToString()); 5390Debug.Assert(dtfi != null, "Expected non-null DateTimeFormatInfo"); 5429Debug.Assert(Index + count <= Length, "__DTString::Advance: Index + count <= len"); 5756Debug.Assert(Index >= 0 && Index < Length, "Index >= 0 && Index < len"); 5765Debug.Assert(Index >= 0 && Index < Length, "Index >= 0 && Index < len"); 5766Debug.Assert(char.IsAsciiDigit(Value[Index]), "IsDigit(Value[Index])"); 5918Debug.Assert(number >= 0 && number <= 9, "number >= 0 && number <= 9"); 5940Debug.Assert(sub.index == Index, "sub.index == Index"); 5941Debug.Assert(sub.index + sub.length <= Length, "sub.index + sub.length <= len");
src\libraries\System.Private.CoreLib\src\System\Globalization\HebrewCalendar.cs (2)
494Debug.Assert(numDays >= 1, "NumDays >= 1"); 659Debug.Assert(hebrewYearType >= 1 && hebrewYearType <= 6,
src\libraries\System.Private.CoreLib\src\System\Globalization\HebrewNumber.cs (3)
102Debug.Assert(Number > 0 && Number <= 999, "Number is out of range."); 213Debug.Assert(typeof(TChar) == typeof(byte)); 399Debug.Assert(s_numberPassingState.Length == HebrewTokenCount * ((int)HS.S9_DQ + 1));
src\libraries\System.Private.CoreLib\src\System\Globalization\IcuLocaleData.cs (3)
3779Debug.Assert(CulturesCount == (ThreeLetterWindowsLanguageName.Length / 3)); 3815Debug.Assert(ch <= 'z'); 3821Debug.Assert(CulturesCount * 2 == LocalesNamesIndexes.Length);
src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.cs (13)
157Debug.Assert(inputLength > 0); 201Debug.Assert(count >= 1, "[IdnMapping.GetAscii] Expected 0 length strings to fail before now."); 372Debug.Assert(!char.IsLowSurrogate(unicode, basicCount), "[IdnMapping.punycode_encode]Unexpected low surrogate"); 449Debug.Assert(delta > 0, "[IdnMapping.cs]1 punycode_encode - delta overflowed int"); 463Debug.Assert(delta > 0, "[IdnMapping.cs]2 punycode_encode - delta overflowed int"); 474Debug.Assert(c_punycodeBase != t, "[IdnMapping.punycode_encode]Expected c_punycodeBase (36) to be != t"); 493Debug.Assert(delta > 0, "[IdnMapping.cs]3 punycode_encode - delta overflowed int"); 693Debug.Assert(w > 0, "[IdnMapping.punycode_decode]Expected w > 0"); 701Debug.Assert(c_punycodeBase != t, "[IdnMapping.punycode_decode]Expected t != c_punycodeBase (36)"); 711Debug.Assert((output.Length - iOutputAfterLastDot - numSurrogatePairs) + 1 > 0, 835Debug.Assert(numpoints != 0, "[IdnMapping.adapt]Expected non-zero numpoints."); 843Debug.Assert(delta + c_skew != 0, "[IdnMapping.adapt]Expected non-zero delta+skew."); 868Debug.Assert(d >= 0 && d < c_punycodeBase, "[IdnMapping.encode_digit]Expected 0 <= d < punycodeBase");
src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.Icu.cs (9)
12Debug.Assert(!GlobalizationMode.Invariant); 13Debug.Assert(!GlobalizationMode.UseNls); 14Debug.Assert(unicodeString != null && unicodeString.Length >= count); 56Debug.Assert(!GlobalizationMode.Invariant); 57Debug.Assert(!GlobalizationMode.UseNls); 58Debug.Assert(asciiString != null && asciiString.Length >= count); 81Debug.Assert(!GlobalizationMode.Invariant); 82Debug.Assert(!GlobalizationMode.UseNls); 83Debug.Assert(asciiString != null && asciiString.Length >= count);
src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.Nls.cs (14)
14Debug.Assert(!GlobalizationMode.Invariant); 15Debug.Assert(GlobalizationMode.UseNls); 16Debug.Assert(unicodeString != null && unicodeString.Length >= count); 46Debug.Assert(!GlobalizationMode.Invariant); 47Debug.Assert(GlobalizationMode.UseNls); 48Debug.Assert(unicodeString != null && unicodeString.Length >= count); 55Debug.Assert(length == outputLength); 61Debug.Assert(!GlobalizationMode.Invariant); 62Debug.Assert(GlobalizationMode.UseNls); 63Debug.Assert(asciiString != null && asciiString.Length >= count); 93Debug.Assert(!GlobalizationMode.Invariant); 94Debug.Assert(GlobalizationMode.UseNls); 95Debug.Assert(asciiString != null && asciiString.Length >= count); 102Debug.Assert(length == outputLength);
src\libraries\System.Private.CoreLib\src\System\Globalization\InvariantModeCasing.cs (13)
113Debug.Assert(GlobalizationMode.Invariant); 114Debug.Assert(source.Length <= destination.Length); 139Debug.Assert(GlobalizationMode.Invariant); 140Debug.Assert(source.Length <= destination.Length); 183Debug.Assert(GlobalizationMode.Invariant); 199Debug.Assert(codePointLengthA == codePointLengthB); 211Debug.Assert(codePointLengthA == codePointLengthB); 226Debug.Assert(value.Length > 0); 227Debug.Assert(value.Length <= source.Length); 228Debug.Assert(GlobalizationMode.Invariant); 288Debug.Assert(value.Length > 0); 289Debug.Assert(value.Length <= source.Length); 290Debug.Assert(GlobalizationMode.Invariant);
src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseCalendar.Icu.cs (3)
20Debug.Assert(!GlobalizationMode.UseNls); 114Debug.Assert(abbrevEnglishEraNames == s_abbreviatedEnglishEraNames || eras.Count <= abbrevEnglishEraNames.Length); 141Debug.Assert(!GlobalizationMode.Invariant);
src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseCalendar.Nls.cs (1)
130Debug.Fail("Should never be called non-Windows platforms.");
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 (8)
15Debug.Assert(!GlobalizationMode.Invariant); 16Debug.Assert(GlobalizationMode.UseNls); 17Debug.Assert(strInput != null); 58Debug.Assert(!GlobalizationMode.Invariant); 59Debug.Assert(GlobalizationMode.UseNls); 60Debug.Assert(strInput != null); 100Debug.Assert(realLength > buffer.Length, "Buffer overflow should have iLength > cBuffer.Length"); 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\RegionInfo.cs (1)
112Debug.Assert(_name != null, "Expected RegionInfo._name to be populated already");
src\libraries\System.Private.CoreLib\src\System\Globalization\SortKey.cs (2)
54Debug.Assert(key1Data != null, "key1Data != null"); 55Debug.Assert(key2Data != null, "key2Data != null");
src\libraries\System.Private.CoreLib\src\System\Globalization\SurrogateCasing.cs (8)
15Debug.Assert(char.IsHighSurrogate(h)); 16Debug.Assert(char.IsLowSurrogate(l)); 20Debug.Assert(char.IsHighSurrogate(hr)); 21Debug.Assert(char.IsLowSurrogate(lr)); 27Debug.Assert(char.IsHighSurrogate(h)); 28Debug.Assert(char.IsLowSurrogate(l)); 32Debug.Assert(char.IsHighSurrogate(hr)); 33Debug.Assert(char.IsLowSurrogate(lr));
src\libraries\System.Private.CoreLib\src\System\Globalization\TextElementEnumerator.cs (2)
21Debug.Assert(str != null, "TextElementEnumerator(): str != null"); 22Debug.Assert(startIndex >= 0 && startIndex <= str.Length, "TextElementEnumerator(): startIndex >= 0 && startIndex <= str.Length");
src\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.cs (12)
186Debug.Assert(!GlobalizationMode.Invariant); 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); 631Debug.Assert(charLen == 1 || charLen == 2, "[TextInfo.AddNonLetter] CharUnicodeInfo.InternalGetUnicodeCategory returned an unexpected charLen!"); 647Debug.Assert(charLen == 1 || charLen == 2, "[TextInfo.AddTitlecaseLetter] CharUnicodeInfo.InternalGetUnicodeCategory returned an unexpected charLen!");
src\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.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 (8)
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); 42Debug.Assert(ret == pSourceLen, "Expected getting the same length of the original string");
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanFormat.cs (27)
53Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 111Debug.Assert(format == StandardFormat.C || format == StandardFormat.G || format == StandardFormat.g); 127Debug.Assert(ticks == long.MinValue /* -9223372036854775808 */); 144Debug.Assert(fraction < 10_000_000); 152Debug.Assert(decimalSeparator.IsEmpty); 167Debug.Assert(format == StandardFormat.g); 182Debug.Assert(seconds < 60); 190Debug.Assert(minutes < 60); 194Debug.Assert(totalHoursRemaining <= uint.MaxValue); 201Debug.Assert(hours < 24); 216Debug.Assert(dayDigits <= 8); 251Debug.Assert(hourDigits == 1 || hourDigits == 2); 289Debug.Assert(p - dest == requiredOutputLength); 299Debug.Assert(dtfi != null); 522Debug.Assert(field >= 0 && field <= 5); 539Debug.Fail("Unexpected special token '%', Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 551Debug.Assert((field == 0 && sb.Length == 0) || field == 1, "field == 0 || field == 1, Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 559Debug.Assert((field == 1 && sb.Length == 0) || field == 2, "field == 1 || field == 2, Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 567Debug.Assert((field == 2 && sb.Length == 0) || field == 3, "field == 2 || field == 3, Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 575Debug.Assert((field == 3 && sb.Length == 0) || field == 4, "field == 3 || field == 4, Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 584Debug.Assert((field == 4 && sb.Length == 0) || field == 5, "field == 4 || field == 5, Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 597Debug.Assert(field == 5); 600Debug.Assert(0 < dd && dd < 3, "0 < dd && dd < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 601Debug.Assert(0 < hh && hh < 3, "0 < hh && hh < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 602Debug.Assert(0 < mm && mm < 3, "0 < mm && mm < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 603Debug.Assert(0 < ss && ss < 3, "0 < ss && ss < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 604Debug.Assert(0 < ff && ff < 8, "0 < ff && ff < 8, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern");
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanParse.cs (19)
109Debug.Assert(_ttt == TTT.Num); 110Debug.Assert(_num > -1); 146Debug.Assert(_zeroes > 0); // Already validated that in the condition _zeroes == 0 && _num > MaxFraction 155Debug.Assert(totalDigitsCount - MaxFractionDigits <= MaxFractionDigits); 159Debug.Assert(_num < MaxFraction); 187Debug.Assert(pos > -1); 407Debug.Assert(dtfi != null); 447Debug.Assert(_tokenCount == (_sepCount + _numCount), "tokenCount == (SepCount + NumCount)"); 540Debug.Assert(argumentName != null); 591Debug.Assert(powersOfTen.Length == MaxFractionDigits + 1); 631Debug.Assert(success, "Should have thrown on failure"); 653Debug.Assert(success, "Should have thrown on failure"); 675Debug.Assert(success, "Should have thrown on failure"); 719Debug.Assert(tokenizer.EOL); 774Debug.Assert(raw._numCount == 5); 844Debug.Assert(raw._numCount == 4); 970Debug.Assert(raw._numCount == 3); 1096Debug.Assert(raw._numCount == 2); 1165Debug.Assert(raw._numCount == 1);
src\libraries\System.Private.CoreLib\src\System\Globalization\UmAlQuraCalendar.cs (6)
267Debug.Assert((HijriYear >= MinCalendarYear) && (HijriYear <= MaxCalendarYear), "Hijri year is out of range."); 268Debug.Assert(HijriMonth >= 1, "Hijri month is out of range."); 269Debug.Assert(HijriDay >= 1, "Hijri day is out of range."); 339Debug.Assert((time.Ticks >= s_minDate.Ticks) && (time.Ticks <= s_maxDate.Ticks), "Gregorian date is out of range."); 487Debug.Assert((year >= MinCalendarYear) && (year <= MaxCalendarYear), "Hijri year is out of range."); 497Debug.Assert((days == 354) || (days == 355), "Hijri year has to be 354 or 355 days.");
src\libraries\System.Private.CoreLib\src\System\Guid.cs (8)
259Debug.Assert(success, "GuidParseThrowStyle.All means throw on all failures"); 274Debug.Assert(success, "GuidParseThrowStyle.AllButOverflow means throw on all failures"); 333Debug.Assert(success, "GuidParseThrowStyle.AllButOverflow means throw on all failures"); 741Debug.Assert(lookup.Length == 256); 1172Debug.Assert(result && bytesWritten == guidString.Length, "Formatting guid should have succeeded."); 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 (7)
159Debug.Assert(numBytes is 1 or 2, "BinaryReader::ReadOneChar assumes it's reading one or two bytes only."); 178Debug.Assert(charsRead < 2, "BinaryReader::ReadOneChar - assuming we only got 0 or 1 char, not 2!"); 180Debug.Assert(charsRead > 0); 317Debug.Assert(!_disposed); 359Debug.Assert(_stream is MemoryStream); 458Debug.Assert(buffer.Length != 1, "length of 1 should use ReadByte."); 463Debug.Assert(_stream is MemoryStream);
src\libraries\System.Private.CoreLib\src\System\IO\BufferedStream.cs (83)
92Debug.Assert(_stream != null); 100Debug.Assert(_stream != null); 108Debug.Assert(_stream != null); 116Debug.Assert(_buffer != null); 117Debug.Assert(_bufferSize > 0); 132Debug.Assert(_bufferSize > 0); 199Debug.Assert(!(_writePos > 0 && _readPos != _readLen), "Read and Write buffers cannot both have data in them at the same time."); 270Debug.Assert(_writePos == 0 && _readPos == 0 && _readLen == 0); 292Debug.Assert(_writePos == 0 && (!_stream.CanSeek || (_readPos == 0 && _readLen == 0))); 315Debug.Assert(_stream != null); 323Debug.Assert(_writePos == 0 && _readPos == 0 && _readLen == 0); 344Debug.Assert(_writePos == 0 && (!_stream.CanSeek || (_readPos == 0 && _readLen == 0))); 353Debug.Assert(_writePos == 0 && _readPos == _readLen); 367Debug.Assert(_stream != null); 368Debug.Assert(_writePos == 0, "BufferedStream: Write buffer must be empty in FlushRead!"); 382Debug.Assert(_stream != null); 383Debug.Assert(_readPos <= _readLen, $"_readPos <= _readLen [{_readPos} <= {_readLen}]"); 393Debug.Assert(_readPos < _readLen); 406Debug.Assert(_stream != null); 407Debug.Assert(_readPos == 0 && _readLen == 0, 409Debug.Assert(_buffer != null && _bufferSize >= _writePos, 419Debug.Assert(_stream != null); 420Debug.Assert(_readPos == 0 && _readLen == 0, 422Debug.Assert(_buffer != null && _bufferSize >= _writePos, 433Debug.Assert(readbytes >= 0); 449Debug.Assert(readbytes >= 0); 477Debug.Assert(_stream != null); 499Debug.Assert(_readLen == _readPos, "The read buffer must now be empty"); 532Debug.Assert(_stream != null); 549Debug.Assert(_readLen == _readPos, "The read buffer must now be empty"); 675Debug.Assert(_stream != null); 676Debug.Assert(_stream.CanRead); 677Debug.Assert(_bufferSize > 0); 678Debug.Assert(_asyncActiveSemaphore != null); 679Debug.Assert(semaphoreLockTask != null); 699Debug.Assert(_readLen == _readPos); 742Debug.Assert(_readPos == _readLen); 751Debug.Assert(_stream != null); 798Debug.Assert(_stream != null); 863Debug.Assert(_writePos < _bufferSize); 880Debug.Assert(count == 0); 884Debug.Assert(count >= 0); 885Debug.Assert(_writePos == _bufferSize); 886Debug.Assert(_buffer != null); 893Debug.Assert(count == 0); 894Debug.Assert(_writePos < _bufferSize); 901Debug.Assert(_buffer != null); 902Debug.Assert(totalUserbytes >= _bufferSize); 927Debug.Assert(_stream != null); 933Debug.Assert(_writePos < _bufferSize, $"Expected {_writePos} < {_bufferSize}"); 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)); 1225Debug.Assert(newPos == Position, $"newPos (={newPos}) == Position (={Position})"); 1237Debug.Assert(_stream != null); 1248Debug.Assert(_stream != null); 1251Debug.Assert(readBytes >= 0, $"Expected a non-negative number of bytes in buffer, got {readBytes}"); 1256Debug.Assert(_writePos == 0, "Write buffer must be empty if there's data in the read buffer"); 1283Debug.Assert(_stream != null); 1290Debug.Assert(readBytes >= 0, $"Expected a non-negative number of bytes in buffer, got {readBytes}"); 1295Debug.Assert(_writePos == 0, "Write buffer must be empty if there's data in the read buffer");
src\libraries\System.Private.CoreLib\src\System\IO\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\Enumeration\FileSystemEntry.Unix.cs (2)
82Debug.Assert(Directory.Length + FileName.Length < _pathBuffer.Length, 85Debug.Assert(charsWritten > 0, "didn't write any chars to buffer");
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (11)
106Debug.Assert(path != null, "File.Exists: GetFullPath returned null"); 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\FileInfo.cs (1)
26Debug.Assert(!isNormalized || !PathInternal.IsPartiallyQualified(fullPath.AsSpan()), "should be fully qualified if normalized");
src\libraries\System.Private.CoreLib\src\System\IO\FileNotFoundException.cs (1)
53Debug.Assert(_message != null, "_message was null after calling SetMessageField");
src\libraries\System.Private.CoreLib\src\System\IO\FileStatus.Unix.cs (6)
42Debug.Assert(_state != Uninitialized); // Use this after EnsureCachesInitialized has been called. 53Debug.Assert(_state != Uninitialized); // Use this after EnsureCachesInitialized has been called. 136Debug.Assert(_state != Uninitialized); // Use this after EnsureCachesInitialized has been called. 195Debug.Assert(handle is not null || path.Length > 0); 500Debug.Assert(handle is not null || path.Length > 0); 522Debug.Assert(errorInfo.RawErrno > 0); // Expect a positive integer
src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.Unix.cs (7)
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\FileSystemInfo.Unix.cs (1)
24Debug.Assert(!PathInternal.IsPartiallyQualified(fullPath), $"'{fullPath}' should be fully qualified when constructed from directory enumeration");
src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (4)
243Debug.Assert(_position + n >= 0, "_position + n >= 0"); // len is less than 2^31 -1. 330Debug.Assert(_position + n >= 0, "_position + n >= 0"); // len is less than 2^31 -1. 533Debug.Assert(_position >= _origin, "_position >= _origin"); 555Debug.Assert(MemStreamMaxLength == int.MaxValue); // Check parameter validation logic in this method if this fails.
src\libraries\System.Private.CoreLib\src\System\IO\Path.cs (10)
640Debug.Assert(result, "should never fail joining first two paths"); 705Debug.Assert(first.Length > 0 && second.Length > 0, "should have dealt with empty paths"); 716Debug.Assert(first.Length > 0 && second.Length > 0 && third.Length > 0, "should have dealt with empty paths"); 732Debug.Assert(first.Length > 0 && second.Length > 0 && third.Length > 0 && fourth.Length > 0, "should have dealt with empty paths"); 782Debug.Assert(fourth.Length == destination.Length); 799Debug.Assert(bytes != null); 800Debug.Assert(byteCount == 8, $"Unexpected {nameof(byteCount)}"); 801Debug.Assert(chars.Length == 12, $"Unexpected {nameof(chars)}.Length"); 831Debug.Assert((b2 & 0xF8) == 0, "Unexpected set bits"); 871Debug.Assert(comparisonType == StringComparison.Ordinal || comparisonType == StringComparison.OrdinalIgnoreCase);
src\libraries\System.Private.CoreLib\src\System\IO\Path.Unix.cs (4)
56Debug.Assert(!string.IsNullOrEmpty(path)); 57Debug.Assert(!path.Contains('\0')); 68Debug.Assert(collapsedString.Length < path.Length || collapsedString.ToString() == path, 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\PinnedBufferMemoryStream.cs (1)
19Debug.Assert(array != null, "Array can't be null");
src\libraries\System.Private.CoreLib\src\System\IO\ReadLinesIterator.cs (4)
36Debug.Assert(path != null); 37Debug.Assert(path.Length > 0); 38Debug.Assert(encoding != null); 39Debug.Assert(reader != null);
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs (40)
28Debug.Assert(bufferSize > 1, "Buffering must not be enabled for smaller buffer sizes"); 62Debug.Assert(!(_writePos > 0 && _readPos != _readLen), "Read and Write buffers cannot both have data in them at the same time."); 162Debug.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), 233Debug.Assert(_readPos == _readLen, "Read buffer should be empty!"); 254Debug.Assert(_readPos == _readLen); 301Debug.Assert(!_strategy.IsClosed, "FileStream ensures that strategy is not closed"); 302Debug.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), 352Debug.Assert(!_strategy.CanSeek); 380Debug.Assert(_writePos == 0, "Win32FileStream must not have buffered write data here! Pipes should be unidirectional."); 393Debug.Assert(_asyncActiveSemaphore != null); 394Debug.Assert(_strategy.CanSeek); 427Debug.Assert(_readLen == _readPos, "The read buffer must now be empty"); 518Debug.Assert(_writePos == 0, "FlushWrite must set _writePos to 0"); 524Debug.Assert(_writePos == 0, "FileStream cannot have buffered data to write here! Your stream will be corrupted."); 575Debug.Assert(_writePos <= _bufferSize); 598Debug.Assert(!_strategy.IsClosed, "FileStream ensures that strategy is not closed"); 599Debug.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), 601Debug.Assert(_strategy.CanSeek || (_readPos == 0 && _readLen == 0), 660Debug.Assert(!_strategy.CanSeek); 676Debug.Assert(_asyncActiveSemaphore != null); 677Debug.Assert(_strategy.CanSeek); 721Debug.Assert(_writePos == 0, "FileStream cannot have buffered data to write here! Your stream will be corrupted."); 758Debug.Assert(!_strategy.IsClosed, "FileStream responsibility"); 759Debug.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), 780Debug.Assert(_writePos == 0 && (!_strategy.CanSeek || (_readPos == 0 && _readLen == 0))); 804Debug.Assert(_writePos == 0 && _readPos == 0 && _readLen == 0); 819Debug.Assert(_writePos == 0 && (!_strategy.CanSeek || (_readPos == 0 && _readLen == 0))); 824Debug.Assert(_writePos == 0 && _readPos == _readLen); 849Debug.Assert(readBytes >= 0, $"Expected a non-negative number of bytes in buffer, got {readBytes}"); 854Debug.Assert(_writePos == 0, "Write buffer must be empty if there's data in the read buffer"); 880Debug.Assert(readBytes >= 0, $"Expected a non-negative number of bytes in buffer, got {readBytes}"); 885Debug.Assert(_writePos == 0, "Write buffer must be empty if there's data in the read buffer"); 917Debug.Assert(oldPos == _strategy.Position + (_readPos - _readLen)); 939Debug.Assert(newPos == Position, $"newPos (={newPos}) == Position (={Position})"); 952Debug.Assert(_writePos == 0, "Write buffer must be empty in FlushRead!"); 965Debug.Assert(_readPos == 0 && _readLen == 0, "Read buffer must be empty in FlushWrite!"); 966Debug.Assert(_buffer != null && _bufferSize >= _writePos, "Write buffer must be allocated and write position must be in the bounds of the buffer in FlushWrite!"); 977Debug.Assert(_readPos <= _readLen, $"_readPos <= _readLen [{_readPos} <= {_readLen}]"); 987Debug.Assert(_readPos < _readLen); 1044Debug.Assert(!_strategy.IsClosed, "FileStream ensures that strategy is not closed");
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\OSFileStreamStrategy.cs (3)
189Debug.Assert(value >= 0, "value >= 0"); 192Debug.Assert(!_fileHandle.TryGetCachedLength(out _), "If length can be cached (file opened for reading, not shared for writing), it should be impossible to modify file length"); 221Debug.Assert(r >= 0, $"RandomAccess.ReadAtOffset returned {r}.");
src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (17)
238Debug.Assert(thisTask != null && thisTask._stream != null, 428Debug.Assert(minimumBytes <= buffer.Length); 520Debug.Assert(thisTask != null && thisTask._stream != null, 558Debug.Assert(readWriteTask != null); 559Debug.Assert(asyncWaiter != null); 564Debug.Assert(asyncWaiter.IsCompletedSuccessfully, "The semaphore wait should always complete successfully."); 571Debug.Assert(t.IsCompletedSuccessfully, "The semaphore wait should always complete successfully."); 573Debug.Assert(rwt._stream != null, "Validates that this code isn't run a second time."); 581Debug.Assert(readWriteTask != null); 593Debug.Assert(_asyncActiveSemaphore != null, "Must have been initialized in order to get here."); 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 (34)
99Debug.Assert(this is NullStreamReader); 463Debug.Assert(_byteLen >= n, "CompressBuffer was called with a number of bytes greater than the current buffer length. Are two threads using this StreamReader at the same time?"); 472Debug.Assert(_byteLen >= 2, "Caller should've validated that at least 2 bytes were available."); 550Debug.Assert(_checkPreamble); 553Debug.Assert(_bytePos < preamble.Length, "_compressPreamble was called with the current bytePos greater than the preamble buffer length. Are two threads using this StreamReader at the same time?"); 567Debug.Assert(_bytePos <= preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 598Debug.Assert(_bytePos <= _encoding.Preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 600Debug.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 612Debug.Assert(_bytePos == 0, "bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?"); 614Debug.Assert(_byteLen >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 643Debug.Assert(_charPos == 0 && _charLen == 0, "We shouldn't be trying to decode more data if we made progress in an earlier iteration."); 653Debug.Assert(_charPos == 0 && _charLen == 0, "We shouldn't be looking for EOF unless we have an empty char buffer."); 698Debug.Assert(charsRead == 0); 702Debug.Assert(_bytePos <= _encoding.Preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 704Debug.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 716Debug.Assert(_bytePos == 0, "bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?"); 718Debug.Assert(_byteLen >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 750Debug.Assert(charsRead == 0 && _charPos == 0 && _charLen == 0, "We shouldn't be trying to decode more data if we made progress in an earlier iteration."); 768Debug.Assert(charsRead == 0 && _charPos == 0 && _charLen == 0, "We shouldn't be looking for EOF unless we have an empty char buffer."); 813Debug.Assert(!charBufferSpan.IsEmpty, "ReadBuffer returned > 0 but didn't bump _charLen?"); 924Debug.Assert(charPos < charLen, "ReadBuffer returned > 0 but didn't bump _charLen?"); 1136Debug.Assert(n == 0); 1140Debug.Assert(_bytePos <= _encoding.Preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 1143Debug.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 1164Debug.Assert(n == 0); 1176Debug.Assert(_bytePos == 0, "_bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?"); 1180Debug.Assert(_byteLen >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 1212Debug.Assert(n == 0); 1335Debug.Assert(_bytePos <= _encoding.Preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 1338Debug.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 1350Debug.Assert(_bytePos == 0, "_bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?"); 1352Debug.Assert(_byteLen >= 0, "Stream.Read returned a negative number! Bug in stream class."); 1381Debug.Assert(_charPos == 0 && _charLen == 0, "We shouldn't be trying to decode more data if we made progress in an earlier iteration."); 1391Debug.Assert(_charPos == 0 && _charLen == 0, "We shouldn't be looking for EOF unless we have an empty char buffer.");
src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (3)
165Debug.Assert(GetType() == typeof(NullStreamWriter)); 254Debug.Assert(GetType() == typeof(StreamWriter)); 792Debug.Assert(n > 0, "StreamWriter::Write(char[], int, int) isn't making progress! This is most likely a race condition in user code.");
src\libraries\System.Private.CoreLib\src\System\IO\TextWriter.CreateBroadcasting.cs (1)
49Debug.Assert(writers is { Length: > 0 });
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryAccessor.cs (1)
465Debug.Assert(intsWritten == 4);
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStream.cs (3)
382Debug.Assert(pos + nInt >= 0, "_position + n >= 0"); // len is less than 2^63 -1. 435Debug.Assert(ex is not OperationCanceledException); 712Debug.Assert(!(ex is OperationCanceledException));
src\libraries\System.Private.CoreLib\src\System\Lazy.cs (3)
83Debug.Fail("internal constructor, this should never occur"); 93Debug.Assert(_exceptionDispatch != null, "execution path is invalid"); 119Debug.Fail("Invalid logic; State should always have a valid value");
src\libraries\System.Private.CoreLib\src\System\Marvin.cs (3)
48Debug.Assert(loopCount > 0, "Shouldn't reach this code path for small inputs."); 93Debug.Assert(count >= 4, "Only should've gotten here if the original count was >= 4."); 106Debug.Assert(count >= 4, "Only should've gotten here if the original count was >= 4.");
src\libraries\System.Private.CoreLib\src\System\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 (3)
861Debug.Assert(double.IsSubnormal(x)); 1555Debug.Assert(ret == result, $"Multiply overflow got: {ret}, expected: {result}"); 1598Debug.Assert(ret == left * right, $"Multiply overflow got: {ret}, expected: {left * right}");
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 (10)
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); 4590Debug.Assert(formatter != null, "An incorrectly written provider said it implemented ICustomFormatter, and then didn't"); 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 (9)
332Debug.Assert(offset < end && end <= originalBytes.Length); 340Debug.Assert(i >= pos); 661Debug.Assert(_numBytes > 0); 702Debug.Assert(_numChars > 0); 714Debug.Assert(s_lookupTable.Count == 253, $"There should be 253 HTML entities, but {nameof(s_lookupTable)} has {s_lookupTable.Count} of them."); 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 (93)
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); 2475Debug.Assert(Int128.IsNegative(value)); 2489Debug.Assert(p == buffer + sNegative.Length); 2495Debug.Assert(p == buffer); 2502Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2503Debug.Assert(Int128.IsNegative(value)); 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 (7)
118Debug.Assert(p != null); 226Debug.Assert((styles & ~NumberStyles.Integer) == 0, "Only handles subsets of Integer format"); 547Debug.Assert((styles & ~TParser.AllowedStyles) == 0, $"Only handles subsets of {TParser.AllowedStyles} format"); 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\OperatingSystem.cs (1)
104Debug.Fail($"Unknown platform {_platform}");
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 (4)
50Debug.Assert(isThreadSafeRandom); 345Debug.Assert(result >= minInclusive && result < maxExclusive, $"Expected {minInclusive} <= {result} < {maxExclusive}"); 349Debug.Assert(result == minInclusive, $"Expected {minInclusive} == {result}"); 356Debug.Assert(result >= 0.0 && result < 1.0, $"Expected 0.0 <= {result} < 1.0");
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 (6)
93Debug.Assert(maxValue >= 0); 100Debug.Assert(minValue <= maxValue); 122Debug.Assert(maxValue >= 0); 129Debug.Assert(minValue <= maxValue); 162Debug.Assert(buffer.Length < sizeof(ulong)); 199Debug.Fail("Not used or called for this implementation.");
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\DynamicMethod.cs (4)
255Debug.Assert(owner == null && m == null, "owner and m cannot be set for transparent methods"); 261Debug.Assert(m != null || owner != null, "Constructor should ensure that either m or owner is set"); 262Debug.Assert(m == null || !m.Equals(s_anonymouslyHostedDynamicMethodsModule), "The user cannot explicitly use this assembly"); 263Debug.Assert(m == null || owner == null, "m and owner cannot both be set");
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeBuilderInstantiation.cs (1)
34Debug.Assert(type != null, "this is only called from RuntimeType.MakeGenericType and TypeBuilder.MakeGenericType so 'type' cannot be null");
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeNameBuilder.cs (6)
37Debug.Assert(_instNesting != 0); 53Debug.Assert(_instNesting != 0); 69Debug.Assert(_instNesting != 0); 81Debug.Assert(name != null); 93Debug.Assert(rank > 0); 134Debug.Assert(_instNesting == 0);
src\libraries\System.Private.CoreLib\src\System\Reflection\FieldAccessor.cs (12)
21Debug.Assert(_fieldInfo.m_declaringType != null); 125Debug.Assert(obj != null); 134Debug.Assert(obj != null); 141Debug.Assert(obj != null); 200Debug.Assert(false, "Unknown enum value"); 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 (5)
25Debug.Fail($"Unexpected CorElementType: {dstElementType}. Not a valid widening target."); 103Debug.Fail($"Unexpected CorElementType: {dstElementType}. Not a valid widening target."); 107Debug.Assert(dstObject != null); 108Debug.Assert(dstObject.GetType() == dstType); 121Debug.Assert(srcObject is not Pointer);
src\libraries\System.Private.CoreLib\src\System\Reflection\LocalVariableInfo.cs (1)
10public virtual Type LocalType { get { Debug.Fail("type must be set!"); return null!; } }
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs (9)
48Debug.Assert(_argCount == 0); 72Debug.Assert(_argCount == 1); 118Debug.Assert(_argCount <= MaxStackAllocArgCount); 155Debug.Assert(_argCount <= MaxStackAllocArgCount); 193Debug.Assert(_argCount > MaxStackAllocArgCount); 295Debug.Assert(_argCount == 1); 338Debug.Assert(copyOfParameters[i] != null); 339Debug.Assert(((RuntimeType)copyOfParameters[i]!.GetType()).IsNullableOfT); 405Debug.Assert(!sigElementType.IsNullableOfT, "A true boxed Nullable<T> should never be here.");
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInvoker.cs (4)
292Debug.Assert(_method is RuntimeConstructorInfo); 298Debug.Assert(_argCount <= MaxStackAllocArgCount); 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\Reflection\TypeNameResolver.cs (2)
21Debug.Fail("Expected to be unreachable"); 65Debug.Fail("Expected to be unreachable");
src\libraries\System.Private.CoreLib\src\System\Resources\FastResourceComparer.cs (5)
75Debug.Assert(a != null && bytes != null, "FastResourceComparer::CompareOrdinal must have non-null params"); 76Debug.Assert(bCharLength * 2 <= bytes.Length, "FastResourceComparer::CompareOrdinal - numChars is too big!"); 111Debug.Assert((byteLen & 1) == 0, "CompareOrdinal is expecting a UTF-16 string length, which must be even!"); 112Debug.Assert(a != null && b != null, "Null args not allowed."); 113Debug.Assert(byteLen >= 0, "byteLen must be non-negative.");
src\libraries\System.Private.CoreLib\src\System\Resources\FileBasedResourceGroveler.cs (5)
20Debug.Assert(mediator != null, "mediator shouldn't be null; check caller"); 29Debug.Assert(culture != null, "culture shouldn't be null; check caller"); 64Debug.Assert(culture != null, "culture shouldn't be null; check caller"); 65Debug.Assert(fileName != null, "fileName shouldn't be null; check caller"); 88Debug.Assert(file != null, "file shouldn't be null; check caller");
src\libraries\System.Private.CoreLib\src\System\Resources\ManifestBasedResourceGroveler.cs (24)
31Debug.Assert(mediator != null, "mediator shouldn't be null; check caller"); 37Debug.Assert(culture != null, "culture shouldn't be null; check caller"); 38Debug.Assert(localResourceSets != null, "localResourceSets shouldn't be null; check caller"); 90Debug.Assert(satellite != null, "satellite should not be null when stream is set"); 112Debug.Assert(_mediator.NeutralResourcesCulture != null); 128Debug.Assert(a != null, "assembly != null"); 154Debug.Fail(CoreLib.Name + "'s NeutralResourcesLanguageAttribute is a malformed culture name! name: \"" + attr.CultureName + "\" Exception: " + e); 168Debug.Assert(store != null, "I need a Stream!"); 208Debug.Assert(_mediator.MainAssembly != null); 225Debug.Assert(readerTypeName != null, "Reader Type name should be set"); 226Debug.Assert(resSetTypeName != null, "ResourceSet Type name should be set"); 305Debug.Assert(resSetTypeName != null, "We should have a ResourceSet type name from the custom resource file here."); 320Debug.Assert(satellite != null, "satellite shouldn't be null; check caller"); 321Debug.Assert(fileName != null, "fileName shouldn't be null; check caller"); 333Debug.Assert(satellite != null, "satellite shouldn't be null; check caller"); 334Debug.Assert(name != null, "name shouldn't be null; check caller"); 362Debug.Assert(_mediator.MainAssembly != null); 397Debug.Assert(readerTypeName != null, "readerTypeName shouldn't be null; check caller"); 398Debug.Assert(resSetTypeName != null, "resSetTypeName shouldn't be null; check caller"); 424Debug.Assert(_mediator.MainAssembly != null); 432Debug.Assert(_mediator.NeutralResourcesCulture != null); 467Debug.Assert(_mediator.BaseName != null); 472Debug.Fail("Couldn't get " + CoreLib.Name + ResourceManager.ResFileExtension + " from " + CoreLib.Name + "'s assembly" + Environment.NewLineConst + Environment.NewLineConst + "Are you building the runtime on your machine? Chances are the BCL directory didn't build correctly. Type 'build -c' in the BCL directory. If you get build errors, look at buildd.log. If you then can't figure out what's wrong (and you aren't changing the assembly-related metadata code), ask a BCL dev.\n\nIf you did NOT build the runtime, you shouldn't be seeing this and you've found a bug."); 478Debug.Assert(_mediator.MainAssembly != null);
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceManager.cs (7)
252Debug.Assert(MainAssembly != null); 289Debug.Assert(_resourceSets != null); 410Debug.Assert(MainAssembly != null); 415Debug.Assert(localResourceSets != null); 430Debug.Assert(culture != null, "culture != null"); 431Debug.Assert(_resourceSets != null); 556Debug.Assert(asmTypeName != null, "asmTypeName was unexpectedly null");
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.Core.cs (5)
34Debug.Assert(stream != null, "Need a stream!"); 35Debug.Assert(stream.CanRead, "Stream should be readable!"); 36Debug.Assert(resCache != null, "Need a Dictionary!"); 178Debug.Assert(index >= 0 && index < _numResources, "Couldn't find data position within sorted data positions array!"); 181Debug.Assert(len >= 0 && len <= (int)_store.BaseStream.Length - dataPos + _dataSectionOffset, "Length was negative or outside the bounds of the file!");
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (32)
46Debug.Assert(value >= 0, "negative ResourceTypeCode. What?"); 197Debug.Assert(index >= 0 && index < _numResources, $"Bad index into hash array. index: {index}"); 201Debug.Assert(_nameHashes != null && _nameHashesPtr == null, "Internal state mangled."); 206Debug.Assert(_nameHashes == null && _nameHashesPtr != null, "Internal state mangled."); 213Debug.Assert(index >= 0 && index < _numResources, $"Bad index into name position array. index: {index}"); 217Debug.Assert(_namePositions != null && _namePositionsPtr == null, "Internal state mangled."); 222Debug.Assert(_namePositions == null && _namePositionsPtr != null, "Internal state mangled."); 258Debug.Assert(_store != null, "ResourceReader is closed!"); 339Debug.Assert(_store != null, "ResourceReader is closed!"); 340Debug.Assert(Monitor.IsEntered(this)); // uses _store 382Debug.Assert(_store != null, "ResourceReader is closed!"); 453Debug.Assert(_store != null, "ResourceReader is closed!"); 477Debug.Assert(_store != null, "ResourceReader is closed!"); 539Debug.Assert(_store != null, "ResourceReader is closed!"); 540Debug.Assert(_version == 1, ".resources file was not a V1 .resources file!"); 541Debug.Assert(Monitor.IsEntered(this)); // uses _store 561Debug.Assert(Monitor.IsEntered(this)); // uses _store 621Debug.Assert(_store != null, "ResourceReader is closed!"); 622Debug.Assert(_version >= 2, ".resources file was not a V2 (or higher) .resources file!"); 623Debug.Assert(Monitor.IsEntered(this)); // uses _store 643Debug.Assert(Monitor.IsEntered(this)); // uses _store 729Debug.Assert(r == len, "ResourceReader needs to use a blocking read here. (Call _store.ReadBytes(len)?)"); 781Debug.Assert(!Monitor.IsEntered(this)); // only called during init 782Debug.Assert(_store != null, "ResourceReader is closed!"); 804Debug.Assert(!Monitor.IsEntered(this)); // only called during init 993Debug.Assert(Monitor.IsEntered(this)); // uses _store 1001Debug.Assert(_typeTable[typeIndex] != null, "Should have found a type!"); 1032Debug.Assert(typeCode >= 0, "can't be negative"); 1033Debug.Assert(Monitor.IsEntered(this)); // uses _store 1037Debug.Assert(!string.Equals(typeCode.ToString(), "LastPrimitive"), "Change ResourceTypeCode metadata order so LastPrimitive isn't what Enum.ToString prefers."); 1043Debug.Assert(typeIndex >= 0 && typeIndex < _typeTable.Length, "TypeCode is broken or corrupted!"); 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 (5)
72Debug.Fail("SetStateMachine should not be used."); 91Debug.Assert(stateMachine != null); 146Debug.Assert(continuation != null, "Expected non-null continuation"); 147Debug.Assert(invokeAction != null, "Expected non-null invokeAction"); 148Debug.Assert(innerTask != null, "Expected non-null innerTask");
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilder.cs (1)
86Debug.Assert(m_task == null);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilderT.cs (9)
290Debug.Assert(s is AsyncStateMachineBox<TStateMachine>); 302Debug.Assert((m_stateFlags & (int)InternalTaskOptions.PromiseTask) != 0, "Expected state flags to already be configured."); 303Debug.Assert(m_stateObject is null, "Expected to be able to use the state object field for ExecutionContext."); 342Debug.Assert(m_stateObject is null or ExecutionContext, $"Expected {nameof(m_stateObject)} to be null or an ExecutionContext but was {(m_stateObject is object o ? o.GetType().ToString() : "(null)")}."); 354Debug.Assert(!IsCompleted); 365Debug.Assert(StateMachine != null); 395Debug.Assert(IsCompleted); 442Debug.Assert(m_task == null); 487Debug.Assert(task != null, "Expected non-null task");
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncVoidMethodBuilder.cs (1)
152Debug.Assert(context != null, "Must only be used with a non-null context.");
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\CastCache.cs (4)
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 (24)
294Debug.Assert(table != null, "Must provide a valid table"); 295Debug.Assert(Monitor.IsEntered(table._lock), "Must hold the _lock lock to construct the enumerator"); 296Debug.Assert(table._container != null, "Should not be used on a finalized table"); 297Debug.Assert(table._container.FirstFreeEntry > 0, "Should have returned an empty enumerator instead"); 301Debug.Assert(table._activeEnumeratorRefCount >= 0, "Should never have a negative ref count before incrementing"); 328Debug.Assert(table._activeEnumeratorRefCount >= 0, "Should never have a negative ref count after decrementing"); 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\ContractHelper.cs (1)
95Debug.ContractFailure(displayMessage, string.Empty, GetFailureMessage(kind, null));
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\DefaultInterpolatedStringHandler.cs (8)
504Debug.Assert(provider is not null); 505Debug.Assert(provider is not CultureInfo || provider.GetFormat(typeof(ICustomFormatter)) is null, "Expected CultureInfo to not provide a custom formatter"); 522Debug.Assert(_hasCustomFormatter); 523Debug.Assert(_provider != null); 526Debug.Assert(formatter != null, "An incorrectly written provider said it implemented ICustomFormatter, and then didn't"); 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\PoolingAsyncValueTaskMethodBuilderT.cs (4)
358Debug.Assert(s_perCoreCache.Length == Environment.ProcessorCount, $"{s_perCoreCache.Length} != {Environment.ProcessorCount}"); 367Debug.Assert(transientValue is null || transientValue is StateMachineBox<TStateMachine>, 391Debug.Assert(s is StateMachineBox<TStateMachine>, $"Expected {nameof(StateMachineBox<TStateMachine>)}, got '{s}'"); 408Debug.Assert(StateMachine is not null, $"Null {nameof(StateMachine)}");
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs (16)
32Debug.Assert(task != null, "Constructing an awaiter requires a task to await."); 107Debug.Assert(taskCompleted, "With an infinite timeout, the task should have always completed."); 129Debug.Assert(task.IsCompleted, "Task must have been completed by now."); 130Debug.Assert(task.Status != TaskStatus.RanToCompletion, "Task should not be completed successfully."); 144Debug.Fail("Throw() should have thrown"); 155Debug.Fail("Throw() should have thrown"); 160Debug.Fail("There should be exceptions if we're Faulted."); 195Debug.Assert(stateMachineBox != null); 217Debug.Assert(task != null, "Need a task to wait on"); 218Debug.Assert(continuation != null, "Need a continuation to invoke when the wait completes"); 298Debug.Assert(task != null, "Constructing an awaiter requires a task to await."); 366Debug.Assert(task != null, "Constructing an awaitable requires a task to await."); 394Debug.Assert(task != null, "Constructing an awaiter requires a task to await."); 395Debug.Assert((options & ~(ConfigureAwaitOptions.ContinueOnCapturedContext | ConfigureAwaitOptions.SuppressThrowing | ConfigureAwaitOptions.ForceYielding)) == 0); 476Debug.Assert(task != null, "Constructing an awaiter requires a task to await."); 477Debug.Assert((options & ~(ConfigureAwaitOptions.ContinueOnCapturedContext | ConfigureAwaitOptions.ForceYielding)) == 0);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\Unsafe.cs (2)
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\GCSettings.cs (1)
49Debug.Assert(status == SetLatencyModeStatus.Succeeded, $"Unexpected return value '{status}' from {nameof(SetGCLatencyMode)}.");
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\CollectionsMarshal.cs (2)
29Debug.Assert(items is not null, "Implementation depends on List<T> always having an array."); 37Debug.Assert(typeof(T[]) == list._items.GetType(), "Implementation depends on List<T> always using a T[] and not U[] where U : T.");
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\GCHandle.cs (1)
138Debug.Assert(target is Array);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.Unix.cs (1)
37Debug.Assert(bufferLength >= (s.Length + 1) * SystemMaxDBCSCharSize, "Insufficient buffer length passed to StringToAnsiString");
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\BStrStringMarshaller.cs (1)
96Debug.Assert(lengthInBytes == Marshal.SysStringByteLen((IntPtr)ptrToFirstChar));
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ComVariant.cs (3)
29Debug.Assert(variantSize == (4 * IntPtr.Size)); 33Debug.Assert(IntPtr.Size == 8); 34Debug.Assert(variantSize == (3 * IntPtr.Size));
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\MemoryMarshal.cs (4)
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 (4)
121Debug.Assert(IsCollectible); 123Debug.Assert(_state != InternalState.Unloading); 279Debug.Assert(allContexts != null, "Creating the default context should have initialized the contexts collection."); 766Debug.Assert(assemblyName.CultureName?.Length > 0);
src\libraries\System.Private.CoreLib\src\System\Runtime\MemoryFailPoint.cs (2)
270Debug.Fail("Fell through switch statement!"); 337Debug.Assert(Volatile.Read(ref s_failPointReservedMemory) >= 0, "Process-wide MemoryFailPoint reserved memory was negative!");
src\libraries\System.Private.CoreLib\src\System\Runtime\Serialization\SerializationInfo.cs (14)
105Debug.Assert(_names.Length == _count, "[SerializationInfo.ExpandArrays]_names.Length == _count"); 267Debug.Assert(null != name, "[SerializationInfo.UpdateValue]name!=null"); 268Debug.Assert(null != value, "[SerializationInfo.UpdateValue]value!=null"); 269Debug.Assert(type is not null, "[SerializationInfo.UpdateValue]type!=null"); 310Debug.Assert(index < _values.Length, "[SerializationInfo.GetElement]index<_values.Length"); 311Debug.Assert(index < _types.Length, "[SerializationInfo.GetElement]index<_types.Length"); 314Debug.Assert(foundType is not null, "[SerializationInfo.GetElement]foundType!=null"); 327Debug.Assert(index < _values.Length, "[SerializationInfo.GetElement]index<_values.Length"); 328Debug.Assert(index < _types.Length, "[SerializationInfo.GetElement]index<_types.Length"); 331Debug.Assert(foundType is not null, "[SerializationInfo.GetElement]foundType!=null"); 349Debug.Assert(_converter != null, "[SerializationInfo.GetValue]_converter!=null"); 355Debug.Assert(type is not null, "[SerializationInfo.GetValue]type ==null"); 356Debug.Assert(type is RuntimeType, "[SerializationInfo.GetValue]type is not a runtime type"); 367Debug.Assert(_converter != null, "[SerializationInfo.GetValue]_converter!=null");
src\libraries\System.Private.CoreLib\src\System\Runtime\Serialization\SerializationInfo.SerializationGuard.cs (1)
46Debug.Assert(!string.IsNullOrWhiteSpace(switchSuffix));
src\libraries\System.Private.CoreLib\src\System\Runtime\Serialization\SerializationInfoEnumerator.cs (7)
38Debug.Assert(members != null, "[SerializationInfoEnumerator.ctor]members!=null"); 39Debug.Assert(info != null, "[SerializationInfoEnumerator.ctor]info!=null"); 40Debug.Assert(types != null, "[SerializationInfoEnumerator.ctor]types!=null"); 41Debug.Assert(numItems >= 0, "[SerializationInfoEnumerator.ctor]numItems>=0"); 42Debug.Assert(members.Length >= numItems, "[SerializationInfoEnumerator.ctor]members.Length>=numItems"); 43Debug.Assert(info.Length >= numItems, "[SerializationInfoEnumerator.ctor]info.Length>=numItems"); 44Debug.Assert(types.Length >= numItems, "[SerializationInfoEnumerator.ctor]types.Length>=numItems");
src\libraries\System.Private.CoreLib\src\System\Runtime\Versioning\FrameworkName.cs (4)
26Debug.Assert(_identifier != null); 35Debug.Assert(_version != null); 44Debug.Assert(_profile != null); 57Debug.Assert(_fullName != null);
src\libraries\System.Private.CoreLib\src\System\Runtime\Versioning\VersioningHelper.cs (1)
166Debug.Assert(requires == SxSRequirements.None, "Computed a strange set of required resource scoping. It's probably wrong.");
src\libraries\System.Private.CoreLib\src\System\RuntimeType.cs (18)
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); 809Debug.Fail("Error result not expected"); 823Debug.Assert(!IsGenericParameter); 847Debug.Assert(value != null); 880Debug.Fail("Error result not expected"); 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 (15)
70Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(char)); 139Debug.Assert(searchSpaceLength >= Vector128<short>.Count); 166Debug.Assert(searchSpaceLength >= Vector128<short>.Count); 270Debug.Assert(searchSpaceLength >= Vector256<short>.Count, "We expect that the input is long enough for us to load a whole vector."); 323Debug.Assert(searchSpaceLength >= Vector128<short>.Count, "We expect that the input is long enough for us to load a whole vector."); 401Debug.Assert(searchSpaceLength >= Vector256<short>.Count, "We expect that the input is long enough for us to load a whole vector."); 452Debug.Assert(searchSpaceLength >= Vector128<short>.Count, "We expect that the input is long enough for us to load a whole vector."); 548Debug.Assert(searchSpaceLength >= Vector128<byte>.Count, "We expect that the input is long enough for us to load a Vector128."); 597Debug.Assert(searchSpaceLength >= sizeof(ulong), "We expect that the input is long enough for us to load a ulong."); 672Debug.Assert(searchSpaceLength >= Vector128<byte>.Count, "We expect that the input is long enough for us to load a Vector128."); 721Debug.Assert(searchSpaceLength >= sizeof(ulong), "We expect that the input is long enough for us to load a ulong."); 819Debug.Assert(searchSpaceLength >= Vector128<byte>.Count, "We expect that the input is long enough for us to load a Vector128."); 871Debug.Assert(searchSpaceLength >= sizeof(ulong), "We expect that the input is long enough for us to load a ulong."); 947Debug.Assert(searchSpaceLength >= Vector128<byte>.Count, "We expect that the input is long enough for us to load a Vector128."); 999Debug.Assert(searchSpaceLength >= sizeof(ulong), "We expect that the input is long enough for us to load a ulong.");
src\libraries\System.Private.CoreLib\src\System\SearchValues\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 (18)
37Debug.Assert(!values.IsEmpty); 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 (8)
22Debug.Assert(IndexOfAnyAsciiSearcher.IsVectorizationSupported); 23Debug.Assert(values.ContainsAnyInRange((char)0, (char)127)); 53Debug.Assert(_asciiState.Lookup.Contains(0) != _inverseAsciiState.Lookup.Contains(0)); 57Debug.Assert(_inverseAsciiState.Lookup.Contains(0), "The inverse bitmap did not contain a 0."); 66Debug.Assert(!(Ssse3.IsSupported || PackedSimd.IsSupported) || !_inverseAsciiState.Lookup.Contains(0), 150Debug.Assert(_asciiState.Lookup.Contains(0) != _inverseAsciiState.Lookup.Contains(0)); 156Debug.Assert(_inverseAsciiState.Lookup.Contains(0), "The inverse bitmap did not contain a 0."); 165Debug.Assert(!(Ssse3.IsSupported || PackedSimd.IsSupported) || !_inverseAsciiState.Lookup.Contains(0),
src\libraries\System.Private.CoreLib\src\System\SearchValues\SearchValues.cs (1)
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 (4)
24Debug.Assert(!values.IsEmpty); 25Debug.Assert(!string.IsNullOrEmpty(values[0])); 31Debug.Assert(values[i - 1].Length <= values[i].Length); 44Debug.Assert(_nodes[0].MatchLength == 0, "The root node shouldn't have a match.");
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasickNode.cs (3)
40Debug.Assert(children is int[] || children is Dictionary<char, int>); 96Debug.Assert(ReferenceEquals(_children, EmptyChildrenSentinel)); 139Debug.Assert(children.Count > 0);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\CharacterFrequencyHelper.cs (5)
34Debug.Assert(value.Length > 1); 35Debug.Assert(!ignoreCase || char.IsAscii(value[0])); 43Debug.Assert(!ignoreCase); 74Debug.Assert(ch2Offset != 0); 75Debug.Assert(ch2Offset != ch3Offset);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\RabinKarp.cs (7)
42Debug.Assert(values.Length <= MaxValues); 50Debug.Assert(minimumLength > 1); 111Debug.Assert(typeof(TCaseSensitivity) != typeof(CaseInsensitiveUnicode)); 112Debug.Assert(span.Length <= MaxInputLength, "Teddy should have handled short inputs."); 128Debug.Assert(_buckets is not null); 164Debug.Assert(span.Length <= MaxInputLength, "Teddy should have handled long inputs."); 175Debug.Assert(charsWritten == upperCase.Length);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\StringSearchValuesHelper.cs (11)
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); 147Debug.Assert(matchStart == candidate[0], "This should only be called after the first character has been checked"); 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 (9)
17Debug.Assert(values.Length <= 8); 29Debug.Assert(char.IsAscii(c)); 50Debug.Assert(valueBuckets.Length <= 8); 62Debug.Assert(char.IsAscii(c)); 84Debug.Assert(bucketCount == 8, "This may change if we end up supporting the 'fat Teddy' variant."); 85Debug.Assert(values.Length > bucketCount, "Should be using a non-bucketized implementation."); 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 (13)
64Debug.Assert(i == normalizedValues.Length); 91Debug.Assert(charsWritten == upperCase.Length); 109Debug.Assert(newCount <= values.Length - unreachableValues.Count); 110Debug.Assert(newCount > 0); 252Debug.Assert(!(asciiStartLettersOnly && asciiStartUnaffectedByCaseConversion)); 292Debug.Assert(typeof(TStartCaseSensitivity) != typeof(CaseInsensitiveUnicode)); 293Debug.Assert(values.Length > 1); 294Debug.Assert(n is 2 or 3); 317Debug.Assert(n is 2 or 3); 318Debug.Assert(values.Length < maxValues); 329Debug.Assert(char.IsAscii(c)); 340Debug.Assert(newValuesCount > values.Length, "Shouldn't have been called if there were no letters present"); 373Debug.Assert(newValuesCount == newValues.Length);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValuesBase.cs (2)
30Debug.Assert(_uniqueValues is not null, "ContainsCore should be overridden if uniqueValues weren't provided."); 36Debug.Assert(_uniqueValues is not null, "GetValues should be overridden if uniqueValues weren't provided.");
src\libraries\System.Private.CoreLib\src\System\Security\SecureString.cs (10)
55Debug.Assert(str._buffer != null, "Expected other SecureString's buffer to be non-null"); 56Debug.Assert(str._encrypted, "Expected to be used only on encrypted SecureStrings"); 59Debug.Assert(_buffer != null); 82Debug.Assert(_buffer != null); 102Debug.Assert(_buffer != null); 132Debug.Assert(_buffer != null); 183Debug.Assert(_buffer != null); 230Debug.Assert(_buffer != null); 262Debug.Assert(_buffer != null); 427Debug.Assert(byteLength >= 0);
src\libraries\System.Private.CoreLib\src\System\Security\SecurityElement.cs (8)
87Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 176Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 237Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 306Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 317Debug.Fail("Unable to find escape sequence for this character"); 346Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 421Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 485Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly");
src\libraries\System.Private.CoreLib\src\System\Single.cs (7)
294Debug.Assert(IsNaN(value)); 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 (9)
17Debug.Assert(Unsafe.IsOpportunisticallyAligned(ref ip, (uint)sizeof(IntPtr)), "Should've been aligned on natural word boundary."); 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 (63)
72Debug.Fail("Vector<T> isn't 128 or 256 bits in size?"); 84Debug.Fail("Vector<T> isn't 256 bits in size?"); 90Debug.Fail("Vector<T> is greater than 256 bits in size?"); 193Debug.Assert(searchSpaceLength >= 0); 194Debug.Assert(valueLength >= 0); 206Debug.Assert(0 <= index && index <= searchSpaceLength); // Ensures no deceptive underflows in the computation of "remainingSearchSpaceLength". 229Debug.Assert(length >= 0); 235Debug.Assert(value is not null); 301Debug.Assert(length >= 0); 306Debug.Assert(value is not null); 390Debug.Assert(length >= 0); 396Debug.Assert(value0 is not null && value1 is not null); 496Debug.Assert(length >= 0); 502Debug.Assert(value0 is not null && value1 is not null && value2 is not null); 601Debug.Assert(searchSpaceLength >= 0); 602Debug.Assert(valueLength >= 0); 672Debug.Assert(searchSpaceLength >= 0); 673Debug.Assert(valueLength >= 0); 691Debug.Assert(0 <= index && index <= searchSpaceLength); // Ensures no deceptive underflows in the computation of "remainingSearchSpaceLength". 712Debug.Assert(length >= 0); 716Debug.Assert(value is not null); 795Debug.Assert(length >= 0); 800Debug.Assert(value0 is not null && value1 is not null); 900Debug.Assert(length >= 0); 905Debug.Assert(value0 is not null && value1 is not null && value2 is not null); 1005Debug.Assert(searchSpaceLength >= 0); 1006Debug.Assert(valueLength >= 0); 1061Debug.Assert(length >= 0, "Expected non-negative length"); 1076Debug.Assert(length >= 0, "Expected non-negative length"); 1091Debug.Assert(length >= 0, "Expected non-negative length"); 1107Debug.Assert(length >= 0, "Expected non-negative length"); 1123Debug.Assert(length >= 0, "Expected non-negative length"); 1141Debug.Assert(length >= 0, "Expected non-negative length"); 1159Debug.Assert(length >= 0, "Expected non-negative length"); 1178Debug.Assert(length >= 0, "Expected non-negative length"); 1197Debug.Assert(length >= 0); 1289Debug.Assert(firstLength >= 0); 1290Debug.Assert(secondLength >= 0); 1318Debug.Assert(length >= 0, "Expected non-negative length"); 1319Debug.Assert(value is byte or short or int or long, "Expected caller to normalize to one of these types"); 1498Debug.Assert(length >= 0, "Expected non-negative length"); 1499Debug.Assert(value is byte or short or int or long, "Expected caller to normalize to one of these types"); 1704Debug.Assert(length >= 0, "Expected non-negative length"); 1705Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 1911Debug.Assert(length >= 0, "Expected non-negative length"); 1912Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 2103Debug.Assert(length >= 0, "Expected non-negative length"); 2104Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 2265Debug.Assert(length >= 0, "Expected non-negative length"); 2266Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 2431Debug.Assert(length >= 0, "Expected non-negative length"); 2432Debug.Assert(value is byte or short or int or long, "Expected caller to normalize to one of these types"); 2551Debug.Assert(length >= 0, "Expected non-negative length"); 2552Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 2736Debug.Assert(length >= 0, "Expected non-negative length"); 2737Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 2922Debug.Assert(length >= 0, "Expected non-negative length"); 2923Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 3064Debug.Assert(oldValue is not null); 3094Debug.Assert(Vector128.IsHardwareAccelerated && Vector128<T>.IsSupported, "Vector128 is not HW-accelerated or not supported"); 3151Debug.Assert(Vector512.IsHardwareAccelerated && Vector512<T>.IsSupported, "Vector512 is not HW-accelerated or not supported"); 3189Debug.Assert(length >= 0, "Expected non-negative length"); 3190Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types");
src\libraries\System.Private.CoreLib\src\System\SR.cs (2)
26Debug.Fail("SR::GetResourceString with empty resourceKey. Bug in caller, or weird recursive loading problem?"); 97Debug.Assert(s != null, $"Looking up resource '{key}' failed. Was your resource name misspelled? Did you rebuild after adding a resource?");
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 (22)
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); 82Debug.Assert(strA._firstChar == strB._firstChar, 189Debug.Assert(*(a + 1) != *(b + 1), "This char must be different if we reach here!"); 419Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); // CheckStringComparison validated these earlier 802Debug.Fail("Should not reach this point."); 820Debug.Assert(src[this.Length] == '\0', "src[this.Length] == '\\0'"); 821Debug.Assert(((int)src) % 4 == 0, "Managed string should start at 4 bytes boundary"); 855Debug.Assert(src[this.Length] == '\0', "src[this.Length] == '\\0'"); 856Debug.Assert(((int) src) % 4 == 0, "Managed string should start at 4 bytes boundary"); 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 (6)
228Debug.Assert(numBytes >= 0); 229Debug.Assert(pb <= (pb + numBytes)); 531Debug.Assert(bytes != null); 532Debug.Assert(byteLength >= 0); 536Debug.Assert(stringLength >= 0, "stringLength >= 0"); 547Debug.Assert(stringLength == doubleCheck,
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (22)
43Debug.Assert(dest != null); 44Debug.Assert(src != null); 45Debug.Assert(src.Length <= dest.Length - destPos); 123Debug.Assert(s != null); 124Debug.Assert(position <= totalLength - s.Length, "We didn't allocate enough space for the result string!"); 669Debug.Assert(index > 2); 1220Debug.Assert(!oldValue.IsEmpty); 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); 2151Debug.Assert(!separator.IsEmpty, "Empty separator"); 2179Debug.Assert(!separators.IsEmpty, "Zero separators"); 2258Debug.Assert(startIndex == 0); 2282Debug.Assert(startIndex >= 0 && startIndex <= this.Length, "StartIndex is out of range!"); 2283Debug.Assert(length >= 0 && startIndex <= this.Length - length, "length is out of range!"); 2500Debug.Assert(trimChars != null); 2501Debug.Assert(trimCharsLength > 0);
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.CaseConversion.cs (10)
185Debug.Assert(numElementsActuallyConverted <= numElementsToConvert); 199Debug.Assert(numElementsActuallyConverted <= (nuint)buffer.Length); 211Debug.Assert(typeof(TFrom) == typeof(byte) || typeof(TFrom) == typeof(ushort)); 212Debug.Assert(typeof(TTo) == typeof(byte) || typeof(TTo) == typeof(ushort)); 213Debug.Assert(typeof(TCasing) == typeof(ToUpperConversion) || typeof(TCasing) == typeof(ToLowerConversion)); 268Debug.Assert((nuint)(&pDest[i]) % expectedWriteAlignment == 0, "Destination buffer wasn't properly aligned!"); 275Debug.Assert(i <= elementCount, "We overran a buffer somewhere."); 346Debug.Assert(Vector128.IsHardwareAccelerated); 405Debug.Assert(Vector128.IsHardwareAccelerated); 498Debug.Fail("Unknown types.");
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 (87)
48Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort)); 74Debug.Assert((mask != 0) ? index < 16 : index >= 16); 143Debug.Assert(0 < numBytesRead && numBytesRead <= Vector512.Size, "We should've made forward progress of at least one byte."); 144Debug.Assert((nuint)numBytesRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 147Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 151Debug.Assert((nuint)pBuffer % Vector512.Size == 0, "Vector read should be aligned."); 179Debug.Assert(0 < numBytesRead && numBytesRead <= Vector256.Size, "We should've made forward progress of at least one byte."); 180Debug.Assert((nuint)numBytesRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 183Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 187Debug.Assert((nuint)pBuffer % Vector256.Size == 0, "Vector read should be aligned."); 215Debug.Assert(0 < numBytesRead && numBytesRead <= Vector128.Size, "We should've made forward progress of at least one byte."); 216Debug.Assert((nuint)numBytesRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 219Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 223Debug.Assert((nuint)pBuffer % Vector128.Size == 0, "Vector read should be aligned."); 323Debug.Assert(!AllBytesInUInt32AreAscii(currentUInt32), "Shouldn't have reached this point if we have an all-ASCII input."); 337Debug.Assert(sseMask != uint.MaxValue); 338Debug.Assert(Sse2.IsSupported); 345Debug.Assert(advSimdIndex != uint.MaxValue); 346Debug.Assert(AdvSimd.IsSupported); 357Debug.Assert(Sse2.IsSupported || AdvSimd.Arm64.IsSupported, "Sse2 or AdvSimd64 required."); 358Debug.Assert(BitConverter.IsLittleEndian, "This SSE2/Arm64 implementation assumes little-endian."); 415Debug.Assert(0 < numBytesRead && numBytesRead <= SizeOfVector128, "We should've made forward progress of at least one byte."); 416Debug.Assert((nuint)numBytesRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 582Debug.Assert(ContainsNonAsciiByte_Sse2(currentSseMask), "Shouldn't be here unless we see non-ASCII data."); 587Debug.Assert(ContainsNonAsciiByte_AdvSimd(currentAdvSimdIndex), "Shouldn't be here unless we see non-ASCII data."); 600Debug.Assert(!AllBytesInUInt32AreAscii(currentDWord), "Shouldn't be here unless we see non-ASCII data."); 611Debug.Assert(bufferLength < SizeOfVector128); 739Debug.Assert(bufferLength <= nuint.MaxValue / sizeof(char)); 759Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector512InChars, "We should've made forward progress of at least one char."); 760Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 763Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 767Debug.Assert((nuint)pBuffer % Vector512.Size == 0, "Vector read should be aligned."); 795Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector256InChars, "We should've made forward progress of at least one char."); 796Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 799Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 803Debug.Assert((nuint)pBuffer % Vector256.Size == 0, "Vector read should be aligned."); 830Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector128InChars, "We should've made forward progress of at least one char."); 831Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 834Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 838Debug.Assert((nuint)pBuffer % Vector128.Size == 0, "Vector read should be aligned."); 917Debug.Assert(totalNumBytesRead % sizeof(char) == 0, "Total number of bytes read should be even since we're working with chars."); 922Debug.Assert(!AllCharsInUInt32AreAscii(currentUInt32), "Shouldn't have reached this point if we have an all-ASCII input."); 950Debug.Assert(Sse2.IsSupported || AdvSimd.Arm64.IsSupported, "Should've been checked by caller."); 951Debug.Assert(BitConverter.IsLittleEndian, "This SSE2/Arm64 assumes little-endian."); 967Debug.Assert(bufferLength <= nuint.MaxValue / sizeof(char)); 997Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector128InChars, "We should've made forward progress of at least one char."); 998Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 1076Debug.Assert(((nuint)pBuffer - (nuint)pOriginalBuffer) % 2 == 0, "Shouldn't have incremented any pointer by an odd byte count."); 1119Debug.Assert(currentMask != 0, "Shouldn't be here unless we see non-ASCII data."); 1144Debug.Assert(!AllCharsInUInt32AreAscii(currentDWord), "Shouldn't be here unless we see non-ASCII data."); 1162Debug.Assert(bufferLength < SizeOfVector128InChars); 1246Debug.Assert(AllCharsInUInt64AreAscii(value)); 1300Debug.Assert(AllCharsInUInt32AreAscii(value)); 1364Debug.Assert(currentOffset <= elementCount); 1480Debug.Assert(!AllCharsInUInt32AreAscii(utf16Data32BitsHigh), "Shouldn't have reached this point if we have an all-ASCII input."); 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)); 1689Debug.Assert(Vector128.IsHardwareAccelerated, "Vector128 is required."); 1690Debug.Assert(BitConverter.IsLittleEndian, "This implementation assumes little-endian."); 1691Debug.Assert(elementCount >= 2 * SizeOfVector128); 1742Debug.Assert(0 < currentOffsetInElements && currentOffsetInElements <= SizeOfVector128, "We wrote at least 1 byte but no more than a whole vector."); 1743Debug.Assert(currentOffsetInElements <= elementCount, "Shouldn't have overrun the destination buffer."); 1744Debug.Assert(elementCount - currentOffsetInElements >= SizeOfVector128, "We should be able to run at least one whole vector."); 1762Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % SizeOfVector128 == 0, "Write should be aligned."); 1785Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % sizeof(ulong) == 0, "Destination should be ulong-aligned."); 1807Debug.Assert(Vector256.IsHardwareAccelerated, "Vector256 is required."); 1808Debug.Assert(BitConverter.IsLittleEndian, "This implementation assumes little-endian."); 1809Debug.Assert(elementCount >= 2 * Vector256.Size); 1859Debug.Assert(0 < currentOffsetInElements && currentOffsetInElements <= Vector256.Size, "We wrote at least 1 byte but no more than a whole vector."); 1860Debug.Assert(currentOffsetInElements <= elementCount, "Shouldn't have overrun the destination buffer."); 1861Debug.Assert(elementCount - currentOffsetInElements >= Vector256.Size, "We should be able to run at least one whole vector."); 1879Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % Vector256.Size == 0, "Write should be aligned."); 1902Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % Vector128.Size == 0, "Destination should be 128-bit-aligned."); 1924Debug.Assert(Vector512.IsHardwareAccelerated, "Vector512 is required."); 1925Debug.Assert(BitConverter.IsLittleEndian, "This implementation assumes little-endian."); 1926Debug.Assert(elementCount >= 2 * Vector512.Size); 1977Debug.Assert(0 < currentOffsetInElements && currentOffsetInElements <= Vector512.Size, "We wrote at least 1 byte but no more than a whole vector."); 1978Debug.Assert(currentOffsetInElements <= elementCount, "Shouldn't have overrun the destination buffer."); 1979Debug.Assert(elementCount - currentOffsetInElements >= Vector512.Size, "We should be able to run at least one whole vector."); 1997Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % Vector512.Size == 0, "Write should be aligned."); 2020Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % Vector256.Size == 0, "Destination should be 256-bit-aligned."); 2055Debug.Assert(currentOffset <= elementCount); 2127Debug.Assert(!AllBytesInUInt32AreAscii(asciiData), "Shouldn't have reached this point if we have an all-ASCII input."); 2225Debug.Assert(typeof(TVectorByte) == typeof(Vector128<byte>)); 2239Debug.Assert(AllBytesInUInt32AreAscii(value));
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Utility.Helpers.cs (1)
43Debug.Assert(!AllBytesInUInt32AreAscii(value), "Caller shouldn't provide an all-ASCII value.");
src\libraries\System.Private.CoreLib\src\System\Text\ASCIIEncoding.cs (14)
156Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 157Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 349Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 350Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 351Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 352Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 408Debug.Assert(idx <= numElementsToConvert, "Somehow went beyond bounds of source or destination buffer?"); 498Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 499Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 640Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 641Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 642Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 643Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 696Debug.Assert(idx <= numElementsToConvert, "Somehow went beyond bounds of source or destination buffer?");
src\libraries\System.Private.CoreLib\src\System\Text\CompositeFormat.cs (9)
35Debug.Assert(format is not null); 39Debug.Assert(segments is not null); 46Debug.Assert((segment.Literal is not null) ^ (segment.ArgIndex >= 0), "The segment should represent a literal or a format hole, but not both."); 60Debug.Assert(literalLength >= 0); 61Debug.Assert(formattedCount >= 0); 62Debug.Assert(formattedCount == 0 || argsRequired > 0); 184Debug.Assert(format[pos - 1] == '{'); 185Debug.Assert(ch != '{'); 316Debug.Assert(format[pos] == '}');
src\libraries\System.Private.CoreLib\src\System\Text\Decoder.cs (1)
178Debug.Assert(result <= charCount, "Returned more chars than we have space for");
src\libraries\System.Private.CoreLib\src\System\Text\DecoderFallback.cs (2)
109Debug.Assert(byteStart != null, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize"); 164Debug.Assert(byteStart != null, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize");
src\libraries\System.Private.CoreLib\src\System\Text\DecoderNLS.cs (13)
76Debug.Assert(_encoding is not null); 127Debug.Assert(_encoding is not null); 183Debug.Assert(_encoding is not null); 227Debug.Assert(_fallbackBuffer is null || _fallbackBuffer.Remaining == 0, "Should have no data remaining in the fallback buffer."); 228Debug.Assert(HasLeftoverData, "Caller shouldn't invoke this routine unless there's leftover data in the decoder."); 237Debug.Assert(_encoding is not null); 258Debug.Fail("Unexpected OperationStatus return value."); 268Debug.Assert(charCount >= 0, "Fallback buffer shouldn't have returned a negative char count."); 283Debug.Assert(_fallbackBuffer is null || _fallbackBuffer.Remaining == 0, "Should have no data remaining in the fallback buffer."); 284Debug.Assert(HasLeftoverData, "Caller shouldn't invoke this routine unless there's leftover data in the decoder."); 295Debug.Assert(_encoding is not null); 323Debug.Fail("Unexpected OperationStatus return value."); 351Debug.Assert(combinedBufferBytesConsumed == combinedBuffer.Length, "We should be asked to persist the entire combined buffer.");
src\libraries\System.Private.CoreLib\src\System\Text\DecoderReplacementFallback.cs (1)
132Debug.Assert(_fallbackIndex < _strDefault.Length && _fallbackIndex >= 0,
src\libraries\System.Private.CoreLib\src\System\Text\Encoder.cs (1)
176Debug.Assert(result <= byteCount, "Returned more bytes than we have space for");
src\libraries\System.Private.CoreLib\src\System\Text\EncoderFallback.cs (6)
124Debug.Assert(!chars.IsEmpty, "Caller shouldn't invoke this if there's no data to fall back."); 197Debug.Assert(encoding != null); 234Debug.Fail("Unexpected return value."); 247Debug.Assert(encoding != null); 262Debug.Assert(byteCountThisIteration >= 0, "Encoding shouldn't have returned a negative byte count."); 299Debug.Assert(charStart != null,
src\libraries\System.Private.CoreLib\src\System\Text\EncoderLatin1BestFitFallback.cs (4)
42Debug.Assert(_iCount < 1, $"[EncoderLatin1BestFitFallbackBuffer.Fallback(non surrogate)] Fallback char {(int)_cBestFit:X4} caused recursive fallback"); 68Debug.Assert(_iCount < 1, $"[EncoderLatin1BestFitFallbackBuffer.Fallback(surrogate)] Fallback char {(int)_cBestFit:X4} caused recursive fallback"); 142Debug.Assert(index + 1 < ArrayCharBestFit.Length, 163Debug.Assert(index + 1 < ArrayCharBestFit.Length,
src\libraries\System.Private.CoreLib\src\System\Text\EncoderNLS.cs (9)
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); 288Debug.Assert(byteCount >= 0, "Encoding shouldn't have returned a negative byte count."); 308Debug.Assert(_fallbackBuffer is not null); 359Debug.Assert(_encoding is not null); 374Debug.Fail("Unknown return value.");
src\libraries\System.Private.CoreLib\src\System\Text\EncoderReplacementFallback.cs (1)
160Debug.Assert(_fallbackIndex < _strDefault.Length && _fallbackIndex >= 0,
src\libraries\System.Private.CoreLib\src\System\Text\Encoding.cs (8)
631Debug.Assert(byteCount == bytesReceived); 657Debug.Assert(byteCount == bytesReceived); 711Debug.Assert(result <= byteCount, "[Encoding.GetBytes]Returned more bytes than we have space for"); 860Debug.Assert(result <= charCount, "[Encoding.GetChars]Returned more chars than we have space for"); 1287Debug.Assert(_fallbackBuffer.Remaining == 0, 1339Debug.Assert(_bytes < _byteEnd, "[EncodingCharBuffer.GetNextByte]Expected more date"); 1446Debug.Assert(moreBytesExpected >= 0, "[EncodingByteBuffer.AddByte]expected non-negative moreBytesExpected"); 1488Debug.Assert(_chars > _charStart ||
src\libraries\System.Private.CoreLib\src\System\Text\Encoding.Internal.cs (73)
75Debug.Fail("This should be overridden by a subclassed type."); 81Debug.Fail("This should be overridden by a subclassed type."); 113Debug.Fail("This should be overridden by a subclassed type."); 123Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS."); 124Debug.Assert(charCount >= 0, "Caller should've checked this condition."); 125Debug.Assert(pChars != null || charCount == 0, "Cannot provide a null pointer and a non-zero count."); 206Debug.Fail("This should be overridden by a subclassed type."); 231Debug.Assert(0 <= charsConsumedSoFar && charsConsumedSoFar < originalCharCount, "Invalid arguments provided to method."); 257Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS."); 258Debug.Assert(0 <= charsConsumedSoFar && charsConsumedSoFar <= originalCharCount, "Caller should've checked this condition."); 312Debug.Assert(!chars.IsEmpty, "Caller shouldn't invoke this method with an empty input buffer."); 313Debug.Assert(originalCharsLength >= 0, "Caller provided invalid parameter."); 347Debug.Assert(byteCountThisIteration >= 0, "Fallback shouldn't have returned a negative value."); 348Debug.Assert(charsConsumedThisIteration >= 0, "Fallback shouldn't have returned a negative value."); 370Debug.Assert(byteCountThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 371Debug.Assert(charsConsumedThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 385Debug.Assert(fallbackBuffer.Remaining == 0, "There should be no data in the fallback buffer after GetByteCount."); 400Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS."); 401Debug.Assert(charCount >= 0, "Caller should've checked this condition."); 402Debug.Assert(pChars != null || charCount == 0, "Cannot provide a null pointer and a non-zero count."); 403Debug.Assert(byteCount >= 0, "Caller should've checked this condition."); 404Debug.Assert(pBytes != null || byteCount == 0, "Cannot provide a null pointer and a non-zero count."); 469Debug.Fail("This should be overridden by a subclassed type."); 494Debug.Assert(0 <= charsConsumedSoFar && charsConsumedSoFar < originalCharCount, "Invalid arguments provided to method."); 495Debug.Assert(0 <= bytesWrittenSoFar && bytesWrittenSoFar <= originalByteCount, "Invalid arguments provided to method."); 524Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS."); 525Debug.Assert(0 <= charsConsumedSoFar && charsConsumedSoFar <= originalCharCount, "Caller should've checked this condition."); 526Debug.Assert(0 <= bytesWrittenSoFar && bytesWrittenSoFar <= originalByteCount, "Caller should've checked this condition."); 588Debug.Assert(!chars.IsEmpty, "Caller shouldn't invoke this method with an empty input buffer."); 589Debug.Assert(originalCharsLength >= 0, "Caller provided invalid parameter."); 590Debug.Assert(originalBytesLength >= 0, "Caller provided invalid parameter."); 608Debug.Assert(charsConsumedThisIteration == chars.Length, "If returning NeedMoreData, should out the entire buffer length as chars consumed."); 658Debug.Assert(bytesWrittenThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 659Debug.Assert(charsConsumedThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 688Debug.Assert(encoder is null); 697Debug.Assert(originalCharsLength >= chars.Length, "About to report a negative number of chars used?"); 701Debug.Assert(fallbackBuffer.Remaining == 0 || encoder != null, "Shouldn't have any leftover data in fallback buffer unless an EncoderNLS is in use."); 716Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS."); 717Debug.Assert(byteCount >= 0, "Caller should've checked this condition."); 718Debug.Assert(pBytes != null || byteCount == 0, "Cannot provide a null pointer and a non-zero count."); 725Debug.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, "Fallback buffer can't hold data between GetChars invocations."); 800Debug.Fail("This should be overridden by a subclassed type."); 825Debug.Assert(0 <= bytesConsumedSoFar && bytesConsumedSoFar < originalByteCount, "Invalid arguments provided to method."); 851Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS."); 852Debug.Assert(0 <= bytesConsumedSoFar && bytesConsumedSoFar <= originalByteCount, "Caller should've checked this condition."); 912Debug.Assert(!bytes.IsEmpty, "Caller shouldn't invoke this method with an empty input buffer."); 913Debug.Assert(originalBytesLength >= 0, "Caller provided invalid parameter."); 944Debug.Assert(charCountThisIteration >= 0, "Fallback shouldn't have returned a negative value."); 966Debug.Assert(charCountThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 967Debug.Assert(bytesConsumedThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 981Debug.Assert(fallbackBuffer.Remaining == 0, "There should be no data in the fallback buffer after GetCharCount."); 996Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS."); 997Debug.Assert(byteCount >= 0, "Caller should've checked this condition."); 998Debug.Assert(pBytes != null || byteCount == 0, "Cannot provide a null pointer and a non-zero count."); 999Debug.Assert(charCount >= 0, "Caller should've checked this condition."); 1000Debug.Assert(pChars != null || charCount == 0, "Cannot provide a null pointer and a non-zero count."); 1065Debug.Fail("This should be overridden by a subclassed type."); 1090Debug.Assert(0 <= bytesConsumedSoFar && bytesConsumedSoFar < originalByteCount, "Invalid arguments provided to method."); 1091Debug.Assert(0 <= charsWrittenSoFar && charsWrittenSoFar <= originalCharCount, "Invalid arguments provided to method."); 1120Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS."); 1121Debug.Assert(0 <= bytesConsumedSoFar && bytesConsumedSoFar <= originalByteCount, "Caller should've checked this condition."); 1122Debug.Assert(0 <= charsWrittenSoFar && charsWrittenSoFar <= originalCharCount, "Caller should've checked this condition."); 1146Debug.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, "Should be no remaining fallback data at this point."); 1189Debug.Assert(!bytes.IsEmpty, "Caller shouldn't invoke this method with an empty input buffer."); 1190Debug.Assert(originalBytesLength >= 0, "Caller provided invalid parameter."); 1191Debug.Assert(originalCharsLength >= 0, "Caller provided invalid parameter."); 1210Debug.Assert(bytesConsumedThisIteration == bytes.Length, "If returning NeedMoreData, should out the entire buffer length as bytes consumed."); 1227Debug.Assert(charsWrittenThisIteration >= 0, "Fallback shouldn't have returned a negative value."); 1258Debug.Assert(charsWrittenThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 1259Debug.Assert(bytesConsumedThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 1272Debug.Assert(fallbackBuffer.Remaining == 0); 1285Debug.Assert(decoder is null); 1294Debug.Assert(originalBytesLength >= bytes.Length, "About to report a negative number of bytes used?");
src\libraries\System.Private.CoreLib\src\System\Text\EncodingTable.cs (7)
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); 252Debug.Fail("Unexpected code page");
src\libraries\System.Private.CoreLib\src\System\Text\Latin1Encoding.cs (10)
108Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 109Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 295Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 296Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 297Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 298Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 601Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 602Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 603Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 604Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified.");
src\libraries\System.Private.CoreLib\src\System\Text\Latin1Utility.cs (33)
40Debug.Assert(bufferLength <= nuint.MaxValue / sizeof(char)); 63Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVectorInChars, "We should've made forward progress of at least one char."); 64Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 67Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 71Debug.Assert((nuint)pBuffer % SizeOfVectorInChars == 0, "Vector read should be aligned."); 149Debug.Assert(totalNumBytesRead % sizeof(char) == 0, "Total number of bytes read should be even since we're working with chars."); 154Debug.Assert(!AllCharsInUInt32AreLatin1(currentUInt32), "Shouldn't have reached this point if we have an all-Latin-1 input."); 184Debug.Assert(Sse2.IsSupported, "Should've been checked by caller."); 185Debug.Assert(BitConverter.IsLittleEndian, "SSE2 assumes little-endian."); 204Debug.Assert(bufferLength <= nuint.MaxValue / sizeof(char)); 240Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector128InChars, "We should've made forward progress of at least one char."); 241Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 370Debug.Assert(((nuint)pBuffer - (nuint)pOriginalBuffer) % 2 == 0, "Shouldn't have incremented any pointer by an odd byte count."); 425Debug.Assert(currentMask != 0, "Shouldn't be here unless we see non-Latin-1 data."); 433Debug.Assert(!AllCharsInUInt32AreLatin1(currentDWord), "Shouldn't be here unless we see non-Latin-1 data."); 451Debug.Assert(bufferLength < SizeOfVector128InChars); 550Debug.Assert(BitConverter.IsLittleEndian, "Assume little endian if SSE2 is supported."); 630Debug.Assert(currentOffset <= elementCount); 746Debug.Assert(!AllCharsInUInt32AreLatin1(utf16Data32BitsHigh), "Shouldn't have reached this point if we have an all-Latin-1 input."); 779Debug.Assert(Sse2.IsSupported); 780Debug.Assert(BitConverter.IsLittleEndian); 781Debug.Assert(elementCount >= 2 * SizeOfVector128); 862Debug.Assert(0 < currentOffsetInElements && currentOffsetInElements <= SizeOfVector128, "We wrote at least 1 byte but no more than a whole vector."); 864Debug.Assert(currentOffsetInElements <= elementCount, "Shouldn't have overrun the destination buffer."); 865Debug.Assert(elementCount - currentOffsetInElements >= SizeOfVector128, "We should be able to run at least one whole vector."); 898Debug.Assert(((nuint)pLatin1Buffer + currentOffsetInElements) % SizeOfVector128 == 0, "Write should be aligned."); 933Debug.Assert(((nuint)pLatin1Buffer + currentOffsetInElements) % sizeof(ulong) == 0, "Destination should be ulong-aligned."); 971Debug.Assert(Sse2.IsSupported); 972Debug.Assert(BitConverter.IsLittleEndian); 997Debug.Assert(0 < currentOffset && currentOffset <= SizeOfVector128 / sizeof(char)); 1027Debug.Assert(elementCount - currentOffset < SizeOfVector128, "Case where 2 vectors remained should've been in the hot loop."); 1071Debug.Assert(!Sse2.IsSupported); 1098Debug.Assert(elementCount - currentOffset < SizeOfVector, "Vectorized logic should result in less than a vector's length of data remaining.");
src\libraries\System.Private.CoreLib\src\System\Text\Latin1Utility.Helpers.cs (2)
51Debug.Assert(AllCharsInUInt64AreLatin1(value)); 95Debug.Assert(AllCharsInUInt32AreLatin1(value));
src\libraries\System.Private.CoreLib\src\System\Text\Rune.cs (11)
180Debug.Assert(codeUnitCount > 0 && codeUnitCount <= MaxUtf16CharsPerRune); 197Debug.Assert(codeUnitCount > 0 && codeUnitCount <= MaxUtf8BytesPerRune); 210Debug.Assert(!GlobalizationMode.Invariant, "This should've been checked by the caller."); 211Debug.Assert(textInfo != null, "This should've been checked by the caller."); 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 694Debug.Assert(!source.IsEmpty, "Shouldn't reach this for empty inputs."); 1199Debug.Assert(!value.IsAscii, "Shouldn't use this non-optimized code path for ASCII characters.");
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (63)
238Debug.Assert(m_ChunkOffset + m_ChunkChars.Length >= m_ChunkOffset, "The length of the string is greater than int.MaxValue."); 245Debug.Assert(currentBlock.m_MaxCapacity == maxCapacity); 246Debug.Assert(currentBlock.m_ChunkChars != null); 248Debug.Assert(currentBlock.m_ChunkLength <= currentBlock.m_ChunkChars.Length); 249Debug.Assert(currentBlock.m_ChunkLength >= 0); 250Debug.Assert(currentBlock.m_ChunkOffset >= 0); 255Debug.Assert(currentBlock.m_ChunkOffset == 0); 259Debug.Assert(currentBlock.m_ChunkOffset == prevBlock.m_ChunkOffset + prevBlock.m_ChunkLength); 431Debug.Assert(newLen == chunk.m_ChunkChars.Length, "The new chunk should be larger or equal to the one it is replacing."); 441Debug.Assert(Length == value, "Something went wrong setting Length."); 559Debug.Assert(next.m_ChunkPrevious != null); 585Debug.Assert(stringBuilder != null); 638Debug.Assert(stringBuilder != null); 684Debug.Assert(repeatCount > 0, "Invalid length; should have been validated by caller."); 706Debug.Assert(m_ChunkLength == 0, "A new block was not created."); 904Debug.Assert(chunk != null); 956Debug.Assert(insertingChars + this.Length < int.MaxValue); 1024Debug.Assert(m_ChunkLength == 0, "A new block was not created."); 1057Debug.Assert(typeof(T).Assembly.Equals(typeof(object).Assembly), "Implementation trusts the results of TryFormat because T is expected to be something known"); 1070Debug.Assert(typeof(T).Assembly.Equals(typeof(object).Assembly), "Implementation trusts the results of TryFormat because T is expected to be something known"); 1236Debug.Assert(values != null); 1237Debug.Assert(!Unsafe.IsNullRef(ref separator)); 1238Debug.Assert(separatorLength >= 0); 1413Debug.Assert(typeof(T).Assembly.Equals(typeof(object).Assembly), "Implementation trusts the results of TryFormat because T is expected to be something known"); 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); 2102Debug.Assert(chunk != null, "chunk was null in replace"); 2126Debug.Assert(count >= 0, "count should never go negative"); 2144Debug.Assert(oldValue.Length > Math.Min(count, chunk.m_ChunkLength - indexInChunk), 2164Debug.Assert(indexInChunk >= chunk.m_ChunkLength || count == 0, 2182Debug.Assert(chunk != null || count == 0, "Chunks ended prematurely!"); 2242Debug.Assert(chunk.m_ChunkPrevious != null); 2268Debug.Assert(valueCount >= 0, "Invalid length; should have been validated by caller."); 2320Debug.Assert(m_ChunkLength == 0, "A new block was not created."); 2337Debug.Assert((uint)index <= (uint)Length, "Callers should check that index is a legal value."); 2358Debug.Assert(!replacements.IsEmpty); 2391Debug.Assert(gapStart < sourceChunk.m_ChunkChars.Length, "gap starts at end of buffer. Should not happen"); 2392Debug.Assert(gapStart <= gapEnd, "negative gap size"); 2393Debug.Assert(gapEnd <= sourceChunk.m_ChunkLength, "gap too big"); 2402Debug.Assert(targetIndexInChunk <= targetChunk.m_ChunkLength, "gap not in chunk"); 2471Debug.Assert(chunk != null, "chunk should not be null at this point"); 2473Debug.Assert(lengthInChunk >= 0, "Index isn't in the chunk."); 2505Debug.Assert(0 <= index && index <= Length); 2510Debug.Assert(result.m_ChunkPrevious != null); 2514Debug.Assert(result != null); 2547Debug.Assert(Capacity == Length, nameof(ExpandByABlock) + " should only be called when there is no space left."); 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); 2764Debug.Assert(chunk != null, "We fell off the beginning of the string!"); 2796Debug.Assert(chunk != null, "We fell off the beginning of the string!"); 3134Debug.Assert(_hasCustomFormatter); 3135Debug.Assert(_provider != null); 3138Debug.Assert(formatter != null, "An incorrectly written provider said it implemented ICustomFormatter, and then didn't");
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.Debug.cs (3)
24Debug.Assert(head.m_ChunkPrevious != null); 35Debug.Assert(current.m_ChunkPrevious != null); 39Debug.WriteLine('|' + string.Join('|', chunks) + '|');
src\libraries\System.Private.CoreLib\src\System\Text\TranscodingStream.cs (5)
55Debug.Assert(innerStream != null); 56Debug.Assert(innerEncoding != null); 57Debug.Assert(thisEncoding != null); 93Debug.Assert(disposing, "This type isn't finalizable."); 150Debug.Assert(pendingData.Count != 0);
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf16Utility.cs (10)
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 (8)
26Debug.Assert(inputLength >= 0, "Input length must not be negative."); 27Debug.Assert(pInputBuffer != null || inputLength == 0, "Input length must be zero if input buffer pointer is null."); 33Debug.Assert(0 <= numAsciiCharsConsumedJustNow && numAsciiCharsConsumedJustNow <= inputLength); 75Debug.Assert(pHighestAddressWhereCanReadOneVector >= pInputBuffer); 91Debug.Assert((debugMask & 0b_1010_1010_1010_1010) == 0, "Shouldn't have set the 0x8000 bit of any element in 'charIsNonAscii'."); 193Debug.Assert((highSurrogatesMask & lowSurrogatesMask) == 0, 196Debug.Assert(((highSurrogatesMask | lowSurrogatesMask) & 0b_1010_1010_1010_1010u) == 0, 271Debug.Assert(pHighestAddressWhereCanReadOneVector >= pInputBuffer);
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8.cs (11)
201Debug.Assert(!source.IsEmpty, "Expected 'Done' if source is fully consumed."); 287Debug.Assert(!source.IsEmpty, "Expected 'Done' if source is fully consumed."); 654Debug.Assert(_hasCustomFormatter); 655Debug.Assert(_provider is not null); 658Debug.Assert(formatter is not null, "An incorrectly written provider said it implemented ICustomFormatter, and then didn't"); 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 (12)
20Debug.Assert(UInt32BeginsWithUtf8ThreeByteMask(value)); 45Debug.Assert(UInt32BeginsWithUtf8TwoByteMask(value) && !UInt32BeginsWithOverlongUtf8TwoByteSequence(value)); 108Debug.Assert(IsWellFormedUtf16SurrogatePair(value)); 186Debug.Assert(IsFirstCharTwoUtf8Bytes(value) && IsSecondCharTwoUtf8Bytes(value)); 214Debug.Assert(IsFirstCharTwoUtf8Bytes(value)); 456Debug.Assert(UInt32BeginsWithUtf8TwoByteMask(value)); 575Debug.Assert(UInt32EndsWithUtf8TwoByteMask(value)); 639Debug.Assert(BitConverter.IsLittleEndian); 658Debug.Assert(BitConverter.IsLittleEndian); 726Debug.Assert(IsFirstCharAtLeastThreeUtf8Bytes(value) && !IsFirstCharSurrogate(value), "First half of value should've been 0800..D7FF or E000..FFFF"); 727Debug.Assert(IsSecondCharAtLeastThreeUtf8Bytes(value) && !IsSecondCharSurrogate(value), "Second half of value should've been 0800..D7FF or E000..FFFF"); 761Debug.Assert(IsFirstCharAtLeastThreeUtf8Bytes(value) && !IsFirstCharSurrogate(value), "First half of value should've been 0800..D7FF or E000..FFFF");
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.Transcoding.cs (18)
22Debug.Assert(inputLength >= 0, "Input length must not be negative."); 23Debug.Assert(pInputBuffer != null || inputLength == 0, "Input length must be zero if input buffer pointer is null."); 25Debug.Assert(outputCharsRemaining >= 0, "Destination length must not be negative."); 26Debug.Assert(pOutputBuffer != null || outputCharsRemaining == 0, "Destination length must be zero if destination buffer pointer is null."); 62Debug.Assert(pInputBuffer <= pFinalPosWhereCanReadDWordFromInputBuffer); 72Debug.Assert(pLastBufferPosProcessed < pInputBuffer, "Algorithm should've made forward progress since last read."); 132Debug.Assert(!Ascii.AllBytesInUInt32AreAscii(secondDWord)); 150Debug.Assert(!Ascii.AllBytesInUInt32AreAscii(thisDWord)); // this should have been handled earlier 222Debug.Assert(outputCharsRemaining == 1); 842Debug.Assert(inputLength >= 0, "Input length must not be negative."); 843Debug.Assert(pInputBuffer != null || inputLength == 0, "Input length must be zero if input buffer pointer is null."); 845Debug.Assert(outputBytesRemaining >= 0, "Destination length must not be negative."); 846Debug.Assert(pOutputBuffer != null || outputBytesRemaining == 0, "Destination length must be zero if destination buffer pointer is null."); 896Debug.Assert(pInputBuffer <= pFinalPosWhereCanReadDWordFromInputBuffer); 906Debug.Assert(pLastBufferPosProcessed < pInputBuffer, "Algorithm should've made forward progress since last read."); 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 (9)
26Debug.Assert(inputLength >= 0, "Input length must not be negative."); 27Debug.Assert(pInputBuffer != null || inputLength == 0, "Input length must be zero if input buffer pointer is null."); 77Debug.Assert(pLastBufferPosProcessed < pInputBuffer, "Algorithm should've made forward progress since last read."); 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); 729Debug.Assert(pOriginalInputBuffer + originalInputLength == pInputBuffer, "About to return an unexpected value.");
src\libraries\System.Private.CoreLib\src\System\Text\UnicodeDebug.cs (6)
15Debug.Fail($"The value {ToHexString(codePoint)} is not a valid BMP code point."); 24Debug.Fail($"The value {ToHexString(codePoint)} is not a valid UTF-16 high surrogate code point."); 33Debug.Fail($"The value {ToHexString(codePoint)} is not a valid UTF-16 low surrogate code point."); 42Debug.Fail($"The value {ToHexString(codePoint)} is not a valid Unicode code point."); 51Debug.Fail($"The value {ToHexString(scalarValue)} is not a valid Unicode scalar value."); 60Debug.Fail($"The value {ToHexString(scalarValue)} is not a valid supplementary plane Unicode scalar value.");
src\libraries\System.Private.CoreLib\src\System\Text\UnicodeEncoding.cs (32)
338Debug.Assert(chars is not null, "[UnicodeEncoding.GetByteCount]chars!=null"); 339Debug.Assert(count >= 0, "[UnicodeEncoding.GetByteCount]count >=0"); 482Debug.Assert(chars > charStart, 550Debug.Assert(chars > charStart, 617Debug.Assert(fallbackBuffer is null || fallbackBuffer.Remaining == 0, 627Debug.Assert(chars is not null, "[UnicodeEncoding.GetBytes]chars!=null"); 628Debug.Assert(byteCount >= 0, "[UnicodeEncoding.GetBytes]byteCount >=0"); 629Debug.Assert(charCount >= 0, "[UnicodeEncoding.GetBytes]charCount >=0"); 630Debug.Assert(bytes is not null, "[UnicodeEncoding.GetBytes]bytes!=null"); 767Debug.Assert(chars > charStart, 835Debug.Assert(chars > charStart + 1 || bytes == byteStart, 864Debug.Assert(chars > charStart, 899Debug.Assert(chars > charStart, 966Debug.Assert((encoder is not null && !encoder.MustFlush) || charLeftOver == (char)0, 969Debug.Assert(fallbackBuffer is null || fallbackBuffer.Remaining == 0 || 978Debug.Assert(bytes is not null, "[UnicodeEncoding.GetCharCount]bytes!=null"); 979Debug.Assert(count >= 0, "[UnicodeEncoding.GetCharCount]count >=0"); 1013Debug.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, 1292Debug.Assert(fallbackBuffer is null || fallbackBuffer.Remaining == 0, 1301Debug.Assert(chars is not null, "[UnicodeEncoding.GetChars]chars!=null"); 1302Debug.Assert(byteCount >= 0, "[UnicodeEncoding.GetChars]byteCount >=0"); 1303Debug.Assert(charCount >= 0, "[UnicodeEncoding.GetChars]charCount >=0"); 1304Debug.Assert(bytes is not null, "[UnicodeEncoding.GetChars]bytes!=null"); 1320Debug.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, 1474Debug.Assert(bytes >= byteStart + 2 || chars == charStart, 1525Debug.Assert(bytes >= byteStart + 2 || chars == charStart, 1542Debug.Assert(bytes >= byteStart + 2 || chars == charStart, 1586Debug.Assert(bytes >= byteStart + 2 || chars == charStart, 1603Debug.Assert(bytes >= byteStart + 2 || chars == charStart, 1650Debug.Assert(bytes >= byteStart + 2 || chars == charStart, 1706Debug.Assert(!decoder.MustFlush || ((lastChar == (char)0) && (lastByte == -1)), 1716Debug.Assert(fallbackBuffer is null || fallbackBuffer.Remaining == 0,
src\libraries\System.Private.CoreLib\src\System\Text\UTF32Encoding.cs (26)
346Debug.Assert(chars is not null, "[UTF32Encoding.GetByteCount]chars!=null"); 347Debug.Assert(count >= 0, "[UTF32Encoding.GetByteCount]count >=0"); 410Debug.Assert(chars > charStart, 468Debug.Assert(fallbackBuffer.Remaining == 0, 478Debug.Assert(chars is not null, "[UTF32Encoding.GetBytes]chars!=null"); 479Debug.Assert(bytes is not null, "[UTF32Encoding.GetBytes]bytes!=null"); 480Debug.Assert(byteCount >= 0, "[UTF32Encoding.GetBytes]byteCount >=0"); 481Debug.Assert(charCount >= 0, "[UTF32Encoding.GetBytes]charCount >=0"); 551Debug.Assert(chars > charStart + 1 || bytes == byteStart, 579Debug.Assert(chars > charStart, 624Debug.Assert(chars > charStart, 661Debug.Assert(highSurrogate == 0 || (encoder is not null && !encoder.MustFlush), 679Debug.Assert(bytes is not null, "[UTF32Encoding.GetCharCount]bytes!=null"); 680Debug.Assert(count >= 0, "[UTF32Encoding.GetCharCount]count >=0"); 705Debug.Assert(fallbackBuffer.Remaining == 0, 812Debug.Assert(fallbackBuffer.Remaining == 0, 822Debug.Assert(chars is not null, "[UTF32Encoding.GetChars]chars!=null"); 823Debug.Assert(bytes is not null, "[UTF32Encoding.GetChars]bytes!=null"); 824Debug.Assert(byteCount >= 0, "[UTF32Encoding.GetChars]byteCount >=0"); 825Debug.Assert(charCount >= 0, "[UTF32Encoding.GetChars]charCount >=0"); 849Debug.Assert(baseDecoder is not null); 854Debug.Assert(fallbackBuffer.Remaining == 0, 919Debug.Assert(bytes >= byteStart + 4 || chars == charStart, 942Debug.Assert(bytes >= byteStart + 4 || chars == charStart, 959Debug.Assert(bytes >= byteStart + 4 || chars == charStart, 1027Debug.Assert(fallbackBuffer.Remaining == 0,
src\libraries\System.Private.CoreLib\src\System\Text\UTF7Encoding.cs (15)
62Debug.Assert(_base64Bytes.Length == 64); 382Debug.Assert(chars is not null, "[UTF7Encoding.GetByteCount]chars!=null"); 383Debug.Assert(count >= 0, "[UTF7Encoding.GetByteCount]count >=0"); 392Debug.Assert(byteCount >= 0, "[UTF7Encoding.GetBytes]byteCount >=0"); 393Debug.Assert(chars is not null, "[UTF7Encoding.GetBytes]chars!=null"); 394Debug.Assert(charCount >= 0, "[UTF7Encoding.GetBytes]charCount >=0"); 531Debug.Assert(count >= 0, "[UTF7Encoding.GetCharCount]count >=0"); 532Debug.Assert(bytes is not null, "[UTF7Encoding.GetCharCount]bytes!=null"); 541Debug.Assert(byteCount >= 0, "[UTF7Encoding.GetChars]byteCount >=0"); 542Debug.Assert(bytes is not null, "[UTF7Encoding.GetChars]bytes!=null"); 543Debug.Assert(charCount >= 0, "[UTF7Encoding.GetChars]charCount >=0"); 562Debug.Assert(!firstByte || decoder.bitCount <= 0, 840Debug.Assert(iCount < 0, "[DecoderUTF7FallbackBuffer.Fallback] Can't have recursive fallbacks"); 841Debug.Assert(bytesUnknown.Length == 1, "[DecoderUTF7FallbackBuffer.Fallback] Only possible fallback case should be 1 unknown byte"); 893Debug.Assert(iCount < 0, "[DecoderUTF7FallbackBuffer.InternalFallback] Can't have recursive fallbacks");
src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.cs (12)
206Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 207Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 396Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 397Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 398Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 399Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 598Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 599Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 600Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 601Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 716Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 717Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified.");
src\libraries\System.Private.CoreLib\src\System\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 (22)
323Debug.Assert(IsCancellationRequested); 342Debug.Assert(IsCancellationCompleted, "Expected cancellation to have finished"); 585Debug.Assert(this != s_neverCanceledSource, "This source should never be exposed via a CancellationToken."); 586Debug.Assert(callback is Action<object?> || callback is Action<object?, CancellationToken>); 621Debug.Assert(node.Prev == null, "Nodes in the free list should all have a null Prev"); 679Debug.Assert(id != 0, "IDs should never be the reserved value 0."); 697Debug.Assert(IsCancellationCompleted, "Expected cancellation to have finished"); 733Debug.Assert(IsCancellationRequested, "ExecuteCallbackHandlers should only be called after setting IsCancellationRequested->true"); 770Debug.Assert(node.Registrations.Source == this); 771Debug.Assert(node.Prev == null); 834Debug.Assert(exceptionList.Count > 0, $"Expected {exceptionList.Count} > 0"); 943Debug.Assert(s is CancellationTokenSource, $"Expected {typeof(CancellationTokenSource)}, got {s}"); 987Debug.Assert(d is Action<object?> || d is Action<object?, CancellationToken>); 1033Debug.Assert(_lock == 1); 1055Debug.Assert(node != null, "Expected non-null node"); 1056Debug.Assert(node.Registrations == this, "Expected node to come from this registrations instance"); 1084Debug.Assert(node.Prev == null); 1089Debug.Assert(node.Prev != null); 1183Debug.Assert(_lock == 1); 1203Debug.Assert(registrations != null, "Expected non-null parent registrations"); 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\EventWaitHandle.cs (1)
43Debug.Assert(result != null, "result should be non-null on success");
src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs (23)
84Debug.Assert(isFlowSuppressed != m_isFlowSuppressed); 250Debug.Assert(threadPoolThread == Thread.CurrentThread); 298Debug.Assert(executionContext != null && !executionContext.m_isDefault, "ExecutionContext argument is Default."); 314Debug.Assert(currentThread == Thread.CurrentThread); 315Debug.Assert(contextToRestore != currentContext); 350Debug.Assert(!Thread.IsThreadStartSupported || Thread.CurrentThread.IsThreadPoolThread); // there are no dedicated threadpool threads on runtimes where we can't start threads 351Debug.Assert(Thread.CurrentThread._executionContext == null, "ThreadPool thread not on Default ExecutionContext."); 352Debug.Assert(Thread.CurrentThread._synchronizationContext == null, "ThreadPool thread not on Default SynchronizationContext."); 357Debug.Assert(previousExecutionCtx != nextExecutionCtx); 364Debug.Assert(previousChangeNotifications != null || nextChangeNotifications != null); 372Debug.Assert(previousExecutionCtx!.m_localValues != null); 373Debug.Assert(nextExecutionCtx!.m_localValues != null); 407Debug.Assert(previousExecutionCtx!.m_localValues != null); 421Debug.Assert(nextExecutionCtx!.m_localValues != null); 456Debug.Assert(!current.IsDefault); 457Debug.Assert(current.m_localValues != null, "Only the default context should have null, and we shouldn't be here on the default context"); 470Debug.Assert(!current.IsDefault); 471Debug.Assert(current.m_localValues != null, "Only the default context should have null, and we shouldn't be here on the default context"); 493Debug.Assert(!current.IsDefault); 494Debug.Assert(current.m_localValues != null, "Only the default context should have null, and we shouldn't be here on the default context"); 513Debug.Assert(newChangeNotifications != null); 514Debug.Assert(Array.IndexOf(newChangeNotifications, local) >= 0); 556Debug.Assert(currentThread == Thread.CurrentThread);
src\libraries\System.Private.CoreLib\src\System\Threading\IOCompletionCallbackHelper.cs (3)
28Debug.Assert(helper != null, "IOCompletionCallbackHelper cannot be null"); 34Debug.Assert(pNativeOverlapped != null); 52Debug.Assert(callback is IOCompletionCallbackHelper);
src\libraries\System.Private.CoreLib\src\System\Threading\LazyInitializer.cs (3)
70Debug.Assert(target != null); 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 (11)
86Debug.Assert(m_eventObj != null); 111Debug.Assert(value >= 0, "SpinCount is a restricted-width integer. The value supplied is outside the legal range."); 112Debug.Assert(value <= SpinCountState_MaxValue, "SpinCount is a restricted-width integer. The value supplied is outside the legal range."); 127Debug.Assert(value >= 0, "NumWaiters should never be less than zero. This indicates an internal error."); 194Debug.Assert(DEFAULT_SPIN_SP >= 0, "Internal error - DEFAULT_SPIN_SP is outside the legal range."); 195Debug.Assert(DEFAULT_SPIN_SP <= SpinCountState_MaxValue, "Internal error - DEFAULT_SPIN_SP is outside the legal range."); 240Debug.Assert(currentIsSet, 280Debug.Assert(m_lock != null); // if waiters>0, then m_lock has already been created. 650Debug.Assert(obj is ManualResetEventSlim, "Expected a ManualResetEventSlim"); 652Debug.Assert(mre.m_lock != null); // the lock should have been created before this callback is registered for use. 672Debug.Assert((newBits | updateBitsMask) == updateBitsMask, "newBits do not fall within the updateBitsMask.");
src\libraries\System.Private.CoreLib\src\System\Threading\Mutex.cs (1)
53Debug.Assert(result != null, "result should be non-null on success");
src\libraries\System.Private.CoreLib\src\System\Threading\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 (2)
218Debug.Assert(!_stopped, "Unexpectedly stopped without _signaled being true."); 258Debug.Assert(!Monitor.IsEntered(this));
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.Blocking.cs (5)
44Debug.Assert(_numBlockedThreads > 0); 70Debug.Assert(BlockingConfig.IsCooperativeBlockingEnabled); 71Debug.Assert(Thread.CurrentThread.IsThreadPoolThread); 77Debug.Assert(_numBlockedThreads > 0); 123Debug.Assert(_pendingBlockingAdjustment != PendingBlockingAdjustment.None);
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.cs (2)
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 (13)
127Debug.Assert(current != null, "The wait thread to remove was not found in the list of thread pool wait threads."); 220Debug.Assert(registeredWait != null); 250Debug.Assert(signaledHandleIndex != WaitHandle.WaitAbandoned); // the first wait handle is an event 262Debug.Assert(signaledHandle != null); 276Debug.Assert(registeredHandle != null); 295Debug.Assert(_numPendingRemoves >= 0); 296Debug.Assert(_numPendingRemoves <= _pendingRemoves.Length); 297Debug.Assert(_numUserWaits >= 0); 298Debug.Assert(_numUserWaits <= _registeredWaits.Length); 299Debug.Assert(_numPendingRemoves <= _numUserWaits, $"Num removals {_numPendingRemoves} should be less than or equal to num user waits {_numUserWaits}"); 317Debug.Assert(j < numUserWaits); 354Debug.Assert(originalNumUserWaits - originalNumPendingRemoves == _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 (30)
149Debug.Assert(_spinLock.IsHeld); 157Debug.Assert(_spinLock.IsHeld); 553Debug.Assert(_fIsReentrant); 554Debug.Assert(_fUpgradeThreadHoldingRead); 587Debug.Assert(_numWriteUpgradeWaiters == 0, "There can be at most one thread with the upgrade lock held."); 611Debug.Assert((_owners & WRITER_HELD) > 0); 615Debug.Assert(lrwc != null, "Initialized based on _fIsReentrant earlier in the method"); 692Debug.Assert((_owners & WRITER_HELD) > 0); 756Debug.Assert(lrwc != null, "Initialized based on _fIsReentrant earlier in the method"); 795Debug.Assert(_owners > 0, "ReleasingReaderLock: releasing lock and no read lock taken"); 799Debug.Assert(lrwc.readercount == 1); 843Debug.Assert((_owners & WRITER_HELD) > 0, "Calling ReleaseWriterLock when no write lock is held"); 907Debug.Assert(_spinLock.IsHeld); 908Debug.Assert(waitEvent == null); 931Debug.Assert(enterLockType == EnterLockType.UpgradeToWrite); 954Debug.Assert(_spinLock.IsHeld); 975Debug.Assert(enterLockType == EnterLockType.UpgradeToWrite); 1067Debug.Assert(_spinLock.IsHeld); 1129Debug.Assert(_spinLock.IsHeld); 1138Debug.Assert(_numReadWaiters != 0 || _numUpgradeWaiters != 0); 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( 1609Debug.Assert(_isLocked != 0, "Exiting spin lock that is not held");
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.cs (1)
45Debug.Assert(result != null, "result should be non-null on success");
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 (14)
352Debug.Assert(m_asyncTail is not null, "tail should not be null if head isn't"); 384Debug.Assert(!waitSuccessful || m_currentCount > 0, 631Debug.Assert(m_currentCount == 0, "m_currentCount should never be negative"); 644Debug.Assert(Monitor.IsEntered(m_lockObjAndDisposed), "Requires the lock be held"); 652Debug.Assert(m_asyncTail is null, "If head is null, so too should be tail"); 658Debug.Assert(m_asyncTail is not null, "If head is not null, neither should be tail"); 673Debug.Assert(task is not null, "Expected non-null task"); 674Debug.Assert(Monitor.IsEntered(m_lockObjAndDisposed), "Requires the lock be held"); 684Debug.Assert((m_asyncHead is null) == (m_asyncTail is null), "Head is null iff tail is null"); 700Debug.Assert(asyncWaiter is not null, "Waiter should have been constructed"); 701Debug.Assert(Monitor.IsEntered(m_lockObjAndDisposed), "Requires the lock be held"); 790Debug.Assert(m_countOfWaitersPulsedToWake <= waitCount); 818Debug.Assert(m_asyncTail is not null, "tail should not be null if head isn't null"); 892Debug.Assert(obj is SemaphoreSlim, "Expected a SemaphoreSlim");
src\libraries\System.Private.CoreLib\src\System\Threading\SpinLock.cs (4)
117Debug.Assert(!IsThreadOwnerTrackingEnabled, "property should be false by now"); 365Debug.Assert((newOwner & WAITERS_MASK) >= 0); 397Debug.Assert(!IsThreadOwnerTrackingEnabled); // Make sure the waiters never be negative which will cause the thread tracking bit to be flipped 409Debug.Assert(IsThreadOwnerTrackingEnabled);
src\libraries\System.Private.CoreLib\src\System\Threading\SpinWait.cs (4)
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\CachedCompletedInt32Task.cs (1)
26Debug.Assert(task.IsCompletedSuccessfully, "Expected that a stored last task completed successfully");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (26)
200Debug.Assert(ReadyToComplete, "The block must be ready to complete to be here."); 211Debug.Assert(state is ConcurrentExclusiveSchedulerPair); 213Debug.Assert(!localThis.m_completionState!.IsCompleted, "Completion should only happen once."); 219Debug.Assert(success, "Expected to complete completion task."); 230Debug.Assert(faultedTask != null && faultedTask.IsFaulted && faultedTask.Exception!.InnerExceptionCount > 0, 340else Debug.Assert(m_processingCount == EXCLUSIVE_PROCESSING_SENTINEL, "The processing count must be the sentinel if it's not >= 0."); 364Debug.Assert(m_processingCount == EXCLUSIVE_PROCESSING_SENTINEL, "Processing exclusive tasks requires being in exclusive mode."); 365Debug.Assert(!m_exclusiveTaskScheduler.m_tasks.IsEmpty, "Processing exclusive tasks requires tasks to be processed."); 370Debug.Assert(m_threadProcessingMode.Value == ProcessingMode.NotCurrentlyProcessing, 388Debug.Assert(m_threadProcessingMode.Value == ProcessingMode.ProcessingExclusiveTask, 399Debug.Assert(m_processingCount == EXCLUSIVE_PROCESSING_SENTINEL, "The processing mode should not have deviated from exclusive."); 412Debug.Assert(m_processingCount > 0, "Processing concurrent tasks requires us to be in concurrent mode."); 417Debug.Assert(m_threadProcessingMode.Value == ProcessingMode.NotCurrentlyProcessing, 446Debug.Assert(m_threadProcessingMode.Value == ProcessingMode.ProcessingConcurrentTasks, 457Debug.Assert(m_processingCount > 0, "The procesing mode should not have deviated from concurrent."); 524Debug.Assert(pair != null, "Scheduler must be associated with a valid pair."); 525Debug.Assert(processingMode == ProcessingMode.ProcessingConcurrentTasks || processingMode == ProcessingMode.ProcessingExclusiveTask, 527Debug.Assert( 547Debug.Assert(task != null, "Infrastructure should have provided a non-null task."); 563Debug.Assert(task != null, "Infrastructure should have provided a non-null task."); 573Debug.Assert(task != null, "Infrastructure should have provided a non-null task."); 647Debug.Assert(t.IsFaulted, "Task should be faulted due to the scheduler faulting it and throwing the exception."); 671Debug.Assert(scheduler != null, "Need a scheduler with which to construct the debug view."); 694Debug.Assert(pair != null, "Need a pair with which to construct the debug view."); 734Debug.Assert(syncObj != null, "The monitor object to check must be provided."); 735Debug.Assert(Monitor.IsEntered(syncObj) == held, "The locking scheme was not correctly followed.");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Future.cs (7)
402Debug.Assert(!IsCompleted, "The promise must not yet be completed."); 410Debug.Assert(success); 444Debug.Assert(!IsWaitNotificationEnabledOrNotRanToCompletion, 463Debug.Assert(IsCompletedSuccessfully, "Task<T>.Result getter: Expected result to have been set."); 487Debug.Assert(m_action != null); 499Debug.Fail("Invalid m_action in Task<TResult>"); 1422Debug.Assert(task != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\FutureFactory.cs (31)
497Debug.Assert((endFunction != null) != (endAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 641Debug.Assert((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 761Debug.Assert((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 783Debug.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 878Debug.Assert((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 900Debug.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 1003Debug.Assert((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 1025Debug.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 1136Debug.Assert((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 1158Debug.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 1197Debug.Assert(thisRef != null, "Expected a non-null thisRef"); 1198Debug.Assert(beginMethod != null, "Expected a non-null beginMethod"); 1199Debug.Assert(endMethod != null, "Expected a non-null endMethod"); 1212Debug.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 1240Debug.Assert(thisRef != null, "Expected a non-null thisRef"); 1241Debug.Assert(endMethod != null, "Expected a non-null endMethod"); 1270Debug.Assert(thisRef != null); 1287Debug.Assert(!IsCompleted, "The task should not have been completed yet."); 1316Debug.Assert(successfullySet, "Expected the task to not yet be completed"); 1608Debug.Assert((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 1634Debug.Assert(continuationAction != null); 1655Debug.Assert((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 1679Debug.Assert(state is Func<Task[], TResult>); 1686Debug.Assert(continuationAction != null); 1691Debug.Assert(state is Action<Task[]>); 1979Debug.Assert((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 1999Debug.Assert(state is Func<Task, TResult>); 2006Debug.Assert(continuationAction != null); 2010Debug.Assert(state is Action<Task>); 2029Debug.Assert((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 2052Debug.Assert(continuationAction != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Sources\ManualResetValueTaskSourceCore.cs (10)
176Debug.Assert(storedContinuation is not null, $"{nameof(storedContinuation)} is null"); 224Debug.Assert(continuation is not null, $"{nameof(continuation)} is null"); 244Debug.Assert(context is TaskScheduler or SynchronizationContext, $"context is {context}"); 259Debug.Assert(scheduler is SynchronizationContext or TaskScheduler, $"{nameof(scheduler)} is {scheduler}"); 260Debug.Assert(executionContext is not null, $"{nameof(executionContext)} is null"); 273Debug.Fail("The sentinel delegate should never be invoked."); 279Debug.Assert( 301Debug.Assert(cc._scheduler is TaskScheduler, $"{nameof(cc._scheduler)} is {cc._scheduler}"); 319Debug.Assert(continuation is not null, $"{nameof(continuation)} is null"); 320Debug.Assert(capturedContext is ExecutionContext or CapturedSchedulerAndExecutionContext, $"{nameof(capturedContext)} is {capturedContext}");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (124)
187Debug.Assert(task != null, "Null Task objects can't be added to the ActiveTasks collection"); 328Debug.Assert(promiseStyle, "Promise CTOR: promiseStyle was false"); 521Debug.Assert(m_contingentProperties == null || m_contingentProperties.m_capturedContext == null, 565Debug.Assert(illegalInternalOptions == 0, "TaskConstructorCore: Illegal internal options"); 569Debug.Assert(m_stateFlags == 0, "TaskConstructorCore: non-zero m_stateFlags"); 570Debug.Assert((((int)creationOptions) | (int)TaskStateFlags.OptionsMask) == (int)TaskStateFlags.OptionsMask, "TaskConstructorCore: options take too many bits"); 597Debug.Assert((internalOptions & InternalTaskOptions.ContinuationTask) == 0, "TaskConstructorCore: Did not expect to see cancelable token for continuation task."); 639Debug.Assert(continuation != null); 685Debug.Assert(((int)TaskStateFlags.OptionsMask & 1) == 1, "OptionsMask needs a shift in Options.get"); 740Debug.Assert((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) != 0, 748Debug.Assert(success, "Tried to set enabled on completed Task"); 778Debug.Assert(tasks != null, "Expected non-null array of tasks"); 815Debug.Assert(isWaitNotificationEnabled, "Should only be called if the wait completion bit is set."); 833Debug.Assert(IsWaitNotificationEnabled, "Should only be called if the wait completion bit is set."); 874Debug.Assert(InternalCurrent == this, "Task.AddNewChild(): Called from an external context"); 895Debug.Assert(InternalCurrent == this, "Task.DisregardChild(): Called from an external context"); 898Debug.Assert(props.m_completionCountdown >= 2, "Task.DisregardChild(): Expected parent count to be >= 2"); 1043Debug.Assert(scheduler != null, "Task.InternalRunSynchronously(): null TaskScheduler"); 1113Debug.Assert( 1130Debug.Assert((m_stateFlags & (int)TaskStateFlags.Canceled) != 0, "Task.RunSynchronously: expected TaskStateFlags.Canceled to be set"); 1260Debug.Assert((e == null) || IsFaulted, "Task.Exception_get(): returning non-null value when not Faulted"); 1660Debug.Assert(m_taskScheduler != null, "expected a task scheduler to have been selected"); 1661Debug.Assert((m_stateFlags & (int)TaskStateFlags.Started) == 0, "task has already started"); 1683Debug.Assert(m_action != null, "Must have a delegate to be in ScheduleAndStart"); 1708Debug.Assert( 1728Debug.Assert(exceptionObject != null, "Task.AddException: Expected a non-null exception object"); 1739Debug.Assert(exceptionObject != null, "Task.AddException: Expected a non-null exception object"); 1747Debug.Assert( 1753Debug.Assert( 1845Debug.Assert(m_contingentProperties != null && m_contingentProperties.m_exceptionsHolder != null, "ExceptionRecorded should imply this"); 1863Debug.Assert(IsFaulted && ExceptionRecorded, "Must only be used when the task has faulted with exceptions."); 1871Debug.Assert(IsCanceled, "Must only be used when the task has canceled."); 1886Debug.Assert(IsCompleted, "ThrowIfExceptional(): Expected IsCompleted == true"); 1991Debug.Assert(userDelegateExecute || m_contingentProperties != null); 2153Debug.Assert(childTask != null); 2154Debug.Assert(childTask.IsCompleted, "ProcessChildCompletion was called for an uncompleted task"); 2156Debug.Assert(childTask.m_contingentProperties?.m_parent == this, "ProcessChildCompletion should only be called for a child of this task"); 2198Debug.Assert(props != null); 2216Debug.Assert(task.IsCompleted, "Expected all tasks in list to be completed"); 2220Debug.Assert(exceptionHolder != null); 2382Debug.Assert(obj is Task); 2393Debug.Assert(m_action != null, "Null action in InnerInvoke()"); 2405Debug.Fail("Invalid m_action in Task"); 2415Debug.Assert(unhandledException != null); 2485Debug.Assert(continuationAction != null); 2530Debug.Assert(!flowExecutionContext, "We already determined we're not required to flow context."); 2556Debug.Assert(stateMachineBox != null); 2629Debug.Assert(waitResult, "expected wait to succeed"); 2785Debug.Assert((m_stateFlags & (int)TaskStateFlags.Faulted) == 0, "Task.Wait() completing when in Faulted state."); 2862Debug.Assert(source != null); 2863Debug.Assert(millisecondsDelay != 0); 2917Debug.Assert(completingTask.IsCompleted); 3007Debug.Assert(IsCompleted || millisecondsTimeout != Timeout.Infinite); 3147Debug.Assert((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) == 0, "Task.InternalCancel() did not expect promise-style task"); 3219Debug.Assert((m_stateFlags & IllegalFlags) == 0, "The continuation was in an invalid state."); 3220Debug.Assert((m_stateFlags & (int)TaskStateFlags.WaitingForActivation) != 0, "Expected continuation to be waiting for activation"); 3221Debug.Assert(m_contingentProperties is null || m_contingentProperties.m_cancellationToken == default); 3239Debug.Assert((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) != 0, "Task.RecordInternalCancellationRequest(CancellationToken) only valid for promise-style task"); 3242Debug.Assert(m_contingentProperties!.m_cancellationToken == default); 3259Debug.Assert(edi != null, "Expected either an OCE or an EDI"); 3261Debug.Assert(oce != null, "Expected EDI to contain an OCE"); 3263Debug.Assert(oce.CancellationToken == tokenToRecord, 3274Debug.Assert((m_stateFlags & ((int)TaskStateFlags.Canceled | (int)TaskStateFlags.CompletionReserved)) != 0, "Task.CancellationCleanupLogic(): Task not canceled or reserved."); 3306Debug.Assert(this == InternalCurrent, "SetCancellationAcknowledged() should only be called while this is still the current task"); 3307Debug.Assert(IsCancellationRequested, "SetCancellationAcknowledged() should not be called if the task's CT wasn't signaled"); 3344Debug.Assert(exceptionObject != null, "Expected non-null exceptionObject argument"); 3347Debug.Assert( 3389Debug.Assert( 3435Debug.Assert(continuationObject != null); 3537Debug.Assert(currentContinuation is TaskContinuation); 3574Debug.Assert(currentContinuation is ITaskCompletionAction); 4433Debug.Assert(continuationTask != null, "Task.ContinueWithCore(): null continuationTask"); 4434Debug.Assert(scheduler != null, "Task.ContinueWithCore(): null scheduler"); 4435Debug.Assert(!continuationTask.IsCompleted, "Did not expect continuationTask to be completed"); 4517Debug.Assert(tc != null, "Expected non-null tc object in AddTaskContinuationComplex"); 4520Debug.Assert(oldValue is not null, "Expected non-null m_continuationObject object"); 4556Debug.Assert(oldValue == s_taskCompletionSentinel, "Expected m_continuationObject to be list or sentinel"); 4594Debug.Assert(tc != null); 4690Debug.Assert(waitResult, "expected wait to succeed"); 4710Debug.Assert(waitResult, "expected wait to succeed"); 5014Debug.Assert(exceptions != null, "Should have seen at least one exception"); 5040Debug.Assert(tasks != null, "Expected a non-null list of tasks"); 5041Debug.Assert(tasks.Count > 0, "Expected at least one task"); 5087Debug.Assert(count > 0, "Expected count > 0"); 5094Debug.Assert(_count >= 0, "Count should never go below 0"); 5137Debug.Assert(tasks.Length == 0 || waitResult != -1, "expected wait to succeed"); 5312Debug.Assert(firstCompleted.Status == TaskStatus.RanToCompletion); 5314Debug.Assert(signaledTaskIndex >= 0); 5401Debug.Assert(succeeded, "This should always succeed on a new task."); 5415Debug.Assert(succeeded, "This should always succeed on a new task."); 5445Debug.Assert(exception != null); 5449Debug.Assert(succeeded, "This should always succeed on a new task."); 5459Debug.Assert(exception != null); 5463Debug.Assert(succeeded, "This should always succeed on a new task."); 5752Debug.Assert(millisecondsDelay != 0); 5811Debug.Assert(token.CanBeCanceled); 5987Debug.Assert(tasks.Length != 0, "Expected a non-zero length task array"); 5988Debug.Assert(m_stateObject is null, "Expected to be able to use the state object field for faulted/canceled tasks."); 6063Debug.Assert(failedOrCanceled is Task, $"Expected Task, got {failedOrCanceled}"); 6072Debug.Assert(failedOrCanceled is List<Task>); 6095Debug.Assert(completed); 6127Debug.Assert(failedOrCanceled is Task); 6133Debug.Assert(observedExceptions.Count > 0, "Expected at least one exception"); 6145Debug.Assert(IsCompleted); 6148Debug.Assert(_remainingToComplete >= 0, "Count should never go below 0"); 6339Debug.Assert(tasks != null, "Expected a non-null task array"); 6340Debug.Assert(tasks.Length > 0, "Expected a non-zero length task array"); 6378Debug.Assert(task != null, "Constituent task in WhenAll should never be null"); 6391Debug.Assert(task.Status == TaskStatus.RanToCompletion); 6403Debug.Assert(observedExceptions.Count > 0, "Expected at least one exception"); 6424Debug.Assert(m_count >= 0, "Count should never go below 0"); 6565Debug.Assert(task1 != null && task2 != null); 6601Debug.Assert(task1 != null && task2 != null); 6602Debug.Assert(task1.IsCompleted || task2.IsCompleted); 6625Debug.Assert(success, "Only one task should have gotten to this point, and thus this must be successful."); 6860Debug.Assert(_waitForNextCompletedTask.GetStatus(_waitForNextCompletedTask.Version) == ValueTaskSourceStatus.Pending); 6981Debug.Assert(outerTask != null); 7324Debug.Assert(outerTask != null, "Expected non-null outerTask"); 7378Debug.Assert(result, "Expected TrySetFromTask from inner task to succeed"); 7381Debug.Fail("UnwrapPromise in illegal state"); 7405Debug.Assert(task != null && task.IsCompleted, "Expected non-null, completed outer task"); 7406Debug.Assert(_state == STATE_WAITING_ON_OUTER_TASK, "We're in the wrong state!"); 7418Debug.Assert(result, "Expected TrySetFromTask from outer task to succeed"); 7435Debug.Assert(task != null && task.IsCompleted, "TrySetFromTask: Expected task to have completed.");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskAsyncEnumerableExtensions.ToBlockingEnumerable.cs (2)
45Debug.Assert(moveNextTask.IsCompleted); 63Debug.Assert(disposeTask.IsCompleted);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskCache.cs (1)
33Debug.Assert(ExclusiveInt32Max >= InclusiveInt32Min, "Expected max to be at least min");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskContinuation.cs (34)
18Debug.Assert(action is Action<Task> || action is Action<Task, object?>, 31Debug.Assert(antecedent != null, 39Debug.Assert(m_action != null); 51Debug.Fail("Invalid m_action in ContinuationTaskFromTask"); 64Debug.Assert(function is Func<Task, TResult> || function is Func<Task, object?, TResult>, 77Debug.Assert(antecedent != null, 85Debug.Assert(m_action != null); 97Debug.Fail("Invalid m_action in ContinuationResultTaskFromTask"); 110Debug.Assert(action is Action<Task<TAntecedentResult>> || action is Action<Task<TAntecedentResult>, object?>, 123Debug.Assert(antecedent != null, 131Debug.Assert(m_action != null); 143Debug.Fail("Invalid m_action in ContinuationTaskFromResultTask"); 156Debug.Assert(function is Func<Task<TAntecedentResult>, TResult> || function is Func<Task<TAntecedentResult>, object?, TResult>, 169Debug.Assert(antecedent != null, 177Debug.Assert(m_action != null); 189Debug.Fail("Invalid m_action in ContinuationResultTaskFromResultTask"); 216Debug.Assert(task != null); 217Debug.Assert(task.m_taskScheduler != null); 274Debug.Assert(task != null, "TaskContinuation ctor: task is null"); 275Debug.Assert(scheduler != null, "TaskContinuation ctor: scheduler is null"); 291Debug.Assert(completedTask != null); 292Debug.Assert(completedTask.IsCompleted, "ContinuationTask.Run(): completedTask not completed"); 295Debug.Assert(continuationTask != null); 369Debug.Assert(state is Action); 385Debug.Assert(context != null); 418Debug.Assert(state is SynchronizationContextAwaitTaskContinuation); 466Debug.Assert(scheduler != null); 534Debug.Assert(action != null); 549Debug.Assert(action != null); 550Debug.Assert(scheduler != null); 669Debug.Assert(state is Action); 683Debug.Assert(callback != null); 684Debug.Assert(currentTask == Task.t_currentTask); 826Debug.Assert(m_action != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskExceptionHolder.cs (17)
47Debug.Assert(task != null, "Expected a non-null task."); 92Debug.Assert(exceptionObject != null, "TaskExceptionHolder.Add(): Expected a non-null exceptionObject"); 93Debug.Assert( 109Debug.Assert(exceptionObject != null, "Expected exceptionObject to be non-null."); 111Debug.Assert(m_cancellationException == null, 116Debug.Assert(m_faultExceptions == null, 129Debug.Assert(edi != null && edi.SourceException is OperationCanceledException, 145Debug.Assert(exceptionObject != null, "AddFaultException(): Expected a non-null exceptionObject"); 173Debug.Assert(exc != null, "No exceptions should be null"); 179Debug.Assert(numExceptions > 0, "Collection should contain at least one exception."); 189Debug.Assert(exceptions.Count > 0, "There should be at least one dispatch info."); 192Debug.Assert(tmp != null, "No dispatch infos should be null"); 255Debug.Assert(exceptions != null, "Expected an initialized list."); 256Debug.Assert(exceptions.Count > 0, "Expected at least one exception."); 284Debug.Assert(exceptions != null, "Expected an initialized list."); 285Debug.Assert(exceptions.Count > 0, "Expected at least one exception."); 300Debug.Assert(edi == null || edi.SourceException is OperationCanceledException,
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskFactory.cs (10)
1554Debug.Assert((tasksCopy != null) && (tasksCopy.Length > 0), "Expected non-null task array with at least one element in it"); 1581Debug.Assert(_count >= 0, "Count should never go below 0"); 1598Debug.Assert(tasksCopy != null); 1624Debug.Assert((tasksCopy != null) && (tasksCopy.Length > 0), "Expected non-null task array with at least one element in it"); 1651Debug.Assert(_count >= 0, "Count should never go below 0"); 1668Debug.Assert(tasksCopy != null); 2274Debug.Assert(tasks != null, "Expected non-null collection of tasks"); 2309Debug.Assert(success, "Only one task should have gotten to this point, and thus this must be successful."); 2317Debug.Assert(tasks != null, "Should not have been nulled out yet."); 2338Debug.Assert(tasks != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskScheduler.cs (3)
232Debug.Assert(task != null); 512Debug.Assert(scheduler != null, "Table returned an incorrect Count or CopyTo failed"); 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 (13)
175Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 301Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 324Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 346Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 373Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 394Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 416Debug.Assert(valueTask._obj is null or Task or IValueTaskSource, "If the ValueTask<>'s backing object is an IValueTaskSource<TResult>, it must also be IValueTaskSource."); 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 (8)
175Debug.Assert(id >= 0 || !_initialized, "expected id >= 0 if initialized"); 182Debug.Assert(_linkedSlot != null, "Should be non-null if not yet disposed"); 350Debug.Assert(ts_finalizationHelper != null, "Should have been initialized when this thread's slot array was created."); 393Debug.Assert(_linkedSlot != null, "Should only be null if disposed"); 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 (35)
31Debug.Assert(queue != null); 35Debug.Assert(Array.IndexOf(oldQueues, queue) < 0); 49Debug.Assert(queue != null); 61Debug.Fail("Should have found the queue"); 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)); 699Debug.Assert(c > 0, "There must at least be a queue for this thread."); 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); 1169Debug.Assert( 1178Debug.Assert( 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); 1335Debug.Assert(helper != null, "Null state passed to PerformWaitOrTimerCallback!"); 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 (10)
203Debug.Assert(timer._dueTime != Timeout.UnsignedInfinite, "A timer in the list must have a valid due time."); 373Debug.Assert(timer._dueTime != Timeout.UnsignedInfinite, "Expected timer to be on a list."); 374Debug.Assert(timer._short != shortList, "Unnecessary if timer is already on the right list."); 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 (6)
109Debug.Assert(dataArray![dataIndex] == data); 117Debug.Assert(callback != null); 189Debug.Assert(!data._completed); 194Debug.Assert(data._callback != null, "Does CompleteWithCallback called after Reset?"); 219Debug.Assert(state != null); 231Debug.Assert(data._callback != null, "Does OnExecutionContextCallback called after Reset?");
src\libraries\System.Private.CoreLib\src\System\Threading\Win32ThreadPoolNativeOverlapped.OverlappedData.cs (1)
23Debug.Assert(_boundHandle == null); //not in use
src\libraries\System.Private.CoreLib\src\System\ThrowHelper.cs (3)
720Debug.Assert(array.Length - offset < count); 1068Debug.Fail("The enum value is not defined, please check the ExceptionArgument Enum."); 1248Debug.Fail("The enum value is not defined, please check the ExceptionResource Enum.");
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.AdjustmentRule.cs (1)
243Diagnostics.Debug.Assert(daylightDelta <= MaxDaylightDelta && daylightDelta >= -MaxDaylightDelta,
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.cs (7)
312Debug.Assert(rule.NoDaylightTransitions, "GetPreviousAdjustmentRule should only be used with NoDaylightTransitions rules."); 313Debug.Assert(_adjustmentRules != null); 612Debug.Assert(e is InvalidTimeZoneException, 1173Debug.Assert(result == null || ruleIndex.HasValue, "If an AdjustmentRule was found, ruleIndex should also be set."); 1895Debug.Assert(rule == null || ruleIndex.HasValue, 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 (5)
281Debug.Assert(Monitor.IsEntered(cachedData)); 297Debug.Assert(Monitor.IsEntered(cachedData)); 907Debug.Assert(!date.IsEmpty); 908Debug.Assert(date[0] == 'J'); 939Debug.Assert(i > 0 && i < days.Length);
src\libraries\System.Private.CoreLib\src\System\Tuple.cs (1)
1248Debug.Fail("Missed all cases for computing Tuple hash code");
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\ValueTuple.cs (2)
2079Debug.Fail("Missed all cases for computing ValueTuple hash code"); 2154Debug.Fail("Missed all cases for computing ValueTuple hash code");
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.Private.CoreLib\src\System\WeakReference.T.cs (1)
169Debug.Assert(false, " WeakReference<T> finalizer should never run");
src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeName.cs (1)
145Debug.Fail("Pre-allocated full name should have been provided in the ctor");
src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeNameParser.cs (1)
240Debug.Assert(nestedNameLength > 0, "TryGetTypeNameInfo should return error on zero lengths");
src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeNameParserHelpers.cs (7)
24Debug.Assert(genericArgs.Length > 0); 183Debug.Assert(rankOrModifier >= 2); 343Debug.Fail("Expected to be unreachable"); 354Debug.Fail("Expected to be unreachable"); 365Debug.Fail("Expected to be unreachable"); 376Debug.Fail("Expected to be unreachable"); 387Debug.Fail("Expected to be unreachable");
src\System\Array.CoreCLR.cs (22)
101Debug.Assert(sourceArray.Rank == destinationArray.Rank); 131Debug.Fail("Fell through switch in Array.Copy!"); 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); 272Debug.Fail("Array.Copy from U1 to another type hit unsupported widening conversion"); break; 290Debug.Fail("Array.Copy from I1 to another type hit unsupported widening conversion"); break; 313Debug.Fail("Array.Copy from U2 to another type hit unsupported widening conversion"); break; 329Debug.Fail("Array.Copy from I2 to another type hit unsupported widening conversion"); break; 344Debug.Fail("Array.Copy from U4 to another type hit unsupported widening conversion"); break; 358Debug.Fail("Array.Copy from I4 to another type hit unsupported widening conversion"); break; 370Debug.Fail("Array.Copy from U8 to another type hit unsupported widening conversion"); break; 382Debug.Fail("Array.Copy from I8 to another type hit unsupported widening conversion"); break; 387Debug.Assert(destElType == CorElementType.ELEMENT_TYPE_R8); 391Debug.Fail("Fell through outer switch in PrimitiveWiden! Unknown primitive type for source array!"); break; 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); 705Debug.Fail("Hey! How'd I get here?");
src\System\Attribute.CoreCLR.cs (14)
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); 598Debug.Fail("Invalid type for ParameterInfo member in Attribute class");
src\System\Buffer.CoreCLR.cs (3)
24Debug.Assert(len >= 0, "Negative length in memcpy!"); 31Debug.Assert((srcIndex >= 0) && (destIndex >= 0) && (len >= 0), "Index and length must be non-negative!"); 32Debug.Assert(src.Length - srcIndex >= len, "not enough bytes in src");
src\System\Collections\Generic\ComparerHelpers.cs (2)
30Debug.Assert(type != null && type is RuntimeType); 64Debug.Assert(type != null && type is RuntimeType);
src\System\Collections\Generic\EqualityComparer.CoreCLR.cs (2)
150Debug.Fail("Should not get here."); 156Debug.Fail("Should not get here.");
src\System\Delegate.CoreCLR.cs (1)
197Debug.Assert(currentType != null || _target.GetType().IsCOMObject, "The class hierarchy should declare the method");
src\System\Enum.CoreCLR.cs (6)
23Debug.Assert(rt.IsActualEnum); 72Debug.Assert(s_underlyingTypes[(int)CorElementType.ELEMENT_TYPE_U] == typeof(nuint)); 77Debug.Assert(underlyingType != null); 85Debug.Assert( 106Debug.Assert(values!.GetType() == typeof(TStorage[])); 107Debug.Assert(!getNames || names!.GetType() == typeof(string[]));
src\System\Exception.CoreCLR.cs (1)
63Debug.Assert(_stackTrace != null, "_stackTrace shouldn't be null when this method is called");
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 (7)
56Debug.Assert(obj is MulticastDelegate, "Shouldn't have failed here since we already checked the types are the same!"); 94Debug.Assert(_invocationList is object[], "empty invocation list on multicast delegate"); 125Debug.Assert(d != null); 126Debug.Assert(_invocationList is object[]); 135Debug.Assert(invocationList[i] is Delegate); 200Debug.Assert(!IsUnmanagedFunctionPtr(), "dynamic method and unmanaged fntptr delegate combined"); 297Debug.Assert(_invocationList is object[]);
src\System\Object.CoreCLR.cs (1)
25Debug.Assert(clone != this);
src\System\Reflection\Associates.cs (3)
48Debug.Assert(declaredType != null); 49Debug.Assert(reflectedType != null); 67Debug.Assert(!associateMethodHandle.IsNullHandle(), "Failed to resolve associateRecord methodDef token");
src\System\Reflection\Emit\CustomAttributeBuilder.cs (3)
335Debug.Fail("Invalid primitive type"); 415Debug.Fail("Invalid enum base type"); 492Debug.Fail("Invalid primitive type");
src\System\Reflection\Emit\DynamicILGenerator.cs (2)
308Debug.Assert(opcode.Equals(OpCodes.Calli), 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 (22)
30Debug.Assert(incoming != null); 87Debug.Assert(methodBuilder != null); 88Debug.Assert(methodBuilder is MethodBuilder || methodBuilder is DynamicMethod); 158Debug.Assert(m_depthAdjustment >= 0); 159Debug.Assert(m_curDepth >= 0); 317Debug.Assert(depth >= -1); 318Debug.Assert(targetDepth >= -1); 332Debug.Assert(m_depthAdjustment >= 0); 362Debug.Assert(m_RelocFixupList == null); 653Debug.Assert(opcode.Equals(OpCodes.Calli), 683Debug.Assert(opcode.Equals(OpCodes.Call) || 691Debug.Assert(opcode.Equals(OpCodes.Call) || 1099Debug.Assert(depth >= -1); 1309Debug.Assert(m_catchEndAddr[currentCatch - 1] == -1, "m_catchEndAddr[m_currentCatch-1] == -1"); 1326Debug.Assert(m_catchEndAddr[currentCatch - 1] == -1, "m_catchEndAddr[m_currentCatch-1] == -1"); 1372Debug.Assert(m_currentCatch > 0, "m_currentCatch > 0"); 1373Debug.Assert(m_catchAddr[m_currentCatch - 1] > 0, "m_catchAddr[m_currentCatch-1] > 0"); 1374Debug.Assert(m_catchEndAddr[m_currentCatch - 1] == -1, "m_catchEndAddr[m_currentCatch-1] == -1"); 1449Debug.Assert(exc != null); 1450Debug.Assert(m_currentCatch > 0, "m_currentCatch > 0"); 1451Debug.Assert(exc.m_currentCatch > 0, "exc.m_currentCatch > 0"); 1461Debug.Assert(exc.GetEndAddress() != GetEndAddress(),
src\System\Reflection\Emit\RuntimeMethodBuilder.cs (11)
254Debug.Fail("We should never get here!"); 586Debug.Assert(currentMethod == this, "We should have found this method in m_containingType.m_listMethods"); 587Debug.Assert(currentToken != 0, "The token should not be 0"); 594Debug.Assert(m_token == 0, "m_token should not have been initialized"); 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 (9)
129Debug.Assert(method != null); 139Debug.Assert(method != null); 152Debug.Assert(runtimeField != null); 216Debug.Assert(!type.IsByRef, "Must not be ByRef. Get token from TypeSpec."); 217Debug.Assert(!type.IsGenericType || type.IsGenericTypeDefinition, "Must not have generic arguments."); 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 (5)
47Debug.Assert(m_con != null); 234Debug.Assert(destType is RuntimeType, "destType is not a runtime type, an EnumBuilder, or a TypeBuilder."); 360Debug.Assert(declMeth != null); 374Debug.Assert(declType != null); 1474Debug.Assert(m_isHiddenGlobalType || typeInfo != null);
src\System\Reflection\Emit\SignatureHelper.cs (6)
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 (72)
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); 1457Debug.Assert(!MetadataToken.IsNullToken(attributeCtorToken)); 1708Debug.Assert(decoratedToken.IsModule || decoratedToken.IsAssembly, 1985Debug.Assert(pca.BaseType == typeof(Attribute), "Pseudo CA Error - Incorrect base type"); 1987Debug.Assert(!usage.Inherited, "Pseudo CA Error - Unexpected Inherited value"); 1990Debug.Assert(usage.AllowMultiple, "Pseudo CA Error - Unexpected AllowMultiple value"); 1994Debug.Assert(!usage.AllowMultiple, "Pseudo CA Error - Unexpected AllowMultiple value"); 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); 2292default: Debug.Fail("Unreachable code"); break; 2301default: Debug.Fail("Unreachable code"); break;
src\System\Reflection\RuntimeEventInfo.cs (3)
30Debug.Assert(declaredType != null); 31Debug.Assert(reflectedTypeCache != null); 32Debug.Assert(!reflectedTypeCache.IsGlobal);
src\System\Reflection\RuntimeLocalVariableInfo.cs (1)
16public override Type LocalType { get { Debug.Assert(_type != null, "type must be set!"); return _type; } }
src\System\Reflection\RuntimeMethodInfo.CoreCLR.cs (3)
38Debug.Assert((flags & InvocationFlags.Initialized) == InvocationFlags.Initialized); 59Debug.Assert(!handle.IsNullHandle()); 60Debug.Assert(methodAttributes == RuntimeMethodHandle.GetAttributes(handle));
src\System\Reflection\RuntimeParameterInfo.cs (15)
16Debug.Assert(method is RuntimeMethodInfo || method is RuntimeConstructorInfo); 23Debug.Assert(method is RuntimeMethodInfo || method is RuntimeConstructorInfo); 35Debug.Assert(ReferenceEquals(methodHandle, member)); 130Debug.Assert(result != null); 164Debug.Assert(m_originalMember != null); 183Debug.Assert(member != null); 184Debug.Assert(MdToken.IsNullToken(tkParamDef) == scope.Equals((MetadataImport)default)); 185Debug.Assert(MdToken.IsNullToken(tkParamDef) || MdToken.IsTokenOfType(tkParamDef, MetadataTokenType.ParamDef)); 221Debug.Assert(m_signature != null); 229Debug.Assert(parameterType != null); 335Debug.Assert(!m_noMetadata); 376Debug.Assert(attr.Constructor.DeclaringType == typeof(DecimalConstantAttribute)); 378Debug.Assert(args.Count == 5); 397Debug.Assert(attr.Constructor.DeclaringType == typeof(DateTimeConstantAttribute)); 398Debug.Assert(attr.ConstructorArguments.Count == 1);
src\System\Reflection\RuntimePropertyInfo.cs (6)
34Debug.Assert(declaredType != null); 35Debug.Assert(reflectedTypeCache != null); 36Debug.Assert(!reflectedTypeCache.IsGlobal); 106Debug.Assert(Name.Equals(target.Name)); 107Debug.Assert(this != target); 108Debug.Assert(this.ReflectedType == target.ReflectedType);
src\System\Reflection\TypeNameResolver.CoreCLR.cs (1)
122Debug.Assert(type != null);
src\System\Runtime\CompilerServices\CastHelpers.cs (6)
171Debug.Assert(!((MethodTable*)toTypeHnd)->HasTypeEquivalence); 224Debug.Assert(result != CastResult.CannotCast); 325Debug.Assert(mt != toTypeHnd, "The check for the trivial cases should be inlined by the JIT"); 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 (4)
210Debug.Assert(type.GetConstructor(Type.EmptyTypes) is ConstructorInfo c && c.IsPublic, 234Debug.Assert(type.GetConstructor(Type.EmptyTypes) is ConstructorInfo c && c.IsPublic, 276Debug.Assert(rt != null); 884Debug.Assert(method != null);
src\System\RuntimeType.ActivatorCache.cs (4)
35Debug.Assert(rt != null); 77Debug.Assert(Nullable.GetUnderlyingType(rt) != null, 95Debug.Assert(_ctorIsPublic); // implicit parameterless ctor is always considered public 139Debug.Fail("Caller passed the wrong RuntimeType to this routine."
src\System\RuntimeType.CoreCLR.cs (58)
76Debug.Assert(index < Count); 175Debug.Assert(retVal || RequiresStringComparison()); 402Debug.Fail("Invalid CacheType"); 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()); 1988Debug.Fail("Unreachable code"); 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) == 4300Debug.Assert(!hit.Equals(key), "Key was already in CerHashtable! Potential race condition (or bug) in the Reflection cache?");
src\System\RuntimeType.CreateUninitializedCache.CoreCLR.cs (3)
27Debug.Assert(rt != null); 41Debug.Fail("Caller passed the wrong RuntimeType to this routine." 60Debug.Assert(rt != null);
src\System\StubHelpers.cs (8)
33Debug.Assert(cbLength > 0, "Zero bytes returned from DoAnsiConversion in AnsiCharMarshaler.ConvertToNative"); 252Debug.Assert(length >= lengthInBytes + 6, "BSTR localloc'ed buffer is too small"); 361Debug.Assert(nbytesused >= 0 && nbytesused < nbytes, "Insufficient buffer allocated in VBByValStrMarshaler.ConvertToNative"); 904Debug.Assert(pvArrayMarshaler != IntPtr.Zero, "pvArrayMarshaler must not be null"); 1061Debug.Assert(length < allocSize, "Expected a length less than the allocated size"); 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 (6)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (6)
28Debug.Assert(value >= 0); 29Debug.Assert(value <= _span.Length); 38Debug.Assert(index < _pos); 91Debug.Assert(index == 0, "Implementation currently only supports index == 0"); 106Debug.Assert(length >= 0); 134Debug.Assert(_pos == _span.Length);
System.Private.DataContractSerialization (374)
src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (1)
254Debug.Assert(q.Count == 1, "We should have one and only one in the rank queue.");
src\libraries\Common\src\System\HexConverter.cs (3)
165Debug.Assert(chars.Length >= bytes.Length * 2); 332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
System\Runtime\Serialization\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 (9)
25Debug.Assert(s_getTypeFromHandle != null); 39Debug.Assert(s_objectEquals != null); 53Debug.Assert(s_arraySetValue != null); 67Debug.Assert(s_objectToString != null); 81Debug.Assert(s_stringFormat != null); 91Debug.Assert(typeof(Delegate).IsAssignableFrom(delegateType)); 362Debug.Assert(cmp == Cmp.GreaterThanOrEqualTo, "Unexpected cmp"); 695Debug.Fail("Data can only be stored into ArgBuilder or LocalBuilder."); 818Debug.Fail("Char is not a valid schema primitive and should be treated as int in DataContract");
System\Runtime\Serialization\CollectionDataContract.cs (10)
617Debug.Assert(KeyName != null); 618Debug.Assert(ValueName != null); 843Debug.Assert(Kind != CollectionKind.Array, "GetCollectionElementType should not be called on Arrays"); 844Debug.Assert(GetEnumeratorMethod != null, "GetEnumeratorMethod should be non-null for non-Arrays"); 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 (4)
410Debug.Fail("DataContract cache overflow"); 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 (16)
340Debug.Fail("ExtensionDataReader in invalid state"); 355Debug.Fail("ExtensionDataReader Name property should only be called for IXmlSerializable"); 368Debug.Fail("ExtensionDataReader HasValue property should only be called for IXmlSerializable"); 381Debug.Fail("ExtensionDataReader BaseURI property should only be called for IXmlSerializable"); 394Debug.Fail("ExtensionDataReader NameTable property should only be called for IXmlSerializable"); 405Debug.Fail("ExtensionDataReader GetAttribute method should only be called for IXmlSerializable"); 415Debug.Fail("ExtensionDataReader GetAttribute method should only be called for IXmlSerializable"); 425Debug.Fail("ExtensionDataReader MoveToAttribute method should only be called for IXmlSerializable"); 437Debug.Fail("ExtensionDataReader ResolveEntity method should only be called for IXmlSerializable"); 447Debug.Fail("ExtensionDataReader ReadAttributeValue method should only be called for IXmlSerializable"); 474Debug.Fail("Encountered invalid data node when deserializing unknown data"); 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 (3)
133Debug.Assert(context != null); 142Debug.Assert(context != null); 204Debug.Fail("DataContract cache overflow");
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 (4)
685Debug.Assert(growingCollection != null); 993Debug.Fail("Failed to create contract for KeyValuePair type"); 1010Debug.Assert(collectionContract.AddMethod != null); 1020Debug.Assert(collectionContract.AddMethod != null);
System\Runtime\Serialization\Json\JsonFormatWriterGenerator.cs (3)
339Debug.Assert(collectionContract.GetEnumeratorMethod != null); 426Debug.Assert(keyValueTypes != null); 437Debug.Assert(keyValueTypes != null);
System\Runtime\Serialization\Json\ReflectionJsonFormatReader.cs (7)
25Debug.Assert(classDataContract != null); 34Debug.Assert(_classContract != null); 65Debug.Assert(jsonContext != null); 120Debug.Assert(jsonContext != null); 121Debug.Assert(collectionContract.Kind == CollectionKind.Dictionary || collectionContract.Kind == CollectionKind.GenericDictionary); 133Debug.Assert(jsonContext != null); 240Debug.Assert(dictionary != null);
System\Runtime\Serialization\Json\ReflectionJsonFormatWriter.cs (1)
204Debug.Assert(memberNames != null);
System\Runtime\Serialization\Json\XmlJsonReader.cs (2)
418Debug.Assert(_charactersToSkipOnNextRead != null); 1570Debug.Assert(i < val.Length, "Found that an '\' was the last character in a string. ReadServerTypeAttriute validates that the escape sequence is valid when it calls ReadQuotedText and ReadEscapedCharacter");
System\Runtime\Serialization\Json\XmlJsonWriter.cs (2)
434Debug.Assert(!(_isWritingDataTypeAttribute && _isWritingServerTypeAttribute), 603Debug.Assert((_nodeType == JsonNodeType.StandaloneText) || (_nodeType == JsonNodeType.EndElement),
System\Runtime\Serialization\KnownTypeDataContractResolver.cs (1)
17Debug.Assert(context != null, "KnownTypeDataContractResolver should not be instantiated with a null context");
System\Runtime\Serialization\ObjectReferenceStack.cs (2)
51Debug.Fail("Object reference stack in invalid state"); 78Debug.Fail("Object reference stack in invalid state");
System\Runtime\Serialization\ObjectToIdCache.cs (2)
92Debug.Fail("Object table overflow"); 131Debug.Fail("Object table overflow");
System\Runtime\Serialization\ReflectionClassWriter.cs (1)
53Debug.Assert(memberValue != null);
System\Runtime\Serialization\ReflectionReader.cs (4)
37Debug.Assert(context != null); 49Debug.Assert(memberNames != null); 229Debug.Assert(dataMember != null); 241Debug.Assert(memberInfo != null);
System\Runtime\Serialization\ReflectionXmlFormatReader.cs (4)
25Debug.Assert(classDataContract != null); 63Debug.Assert(memberNamespaces != null); 74Debug.Assert(reflectedMemberCount == memberCount, "The value returned by ReflectionGetMembers() should equal to memberCount."); 126Debug.Assert(collectionContract.Kind == CollectionKind.Dictionary || collectionContract.Kind == CollectionKind.GenericDictionary);
System\Runtime\Serialization\SchemaExporter.cs (2)
309Debug.Assert(genericArgumentCounts != null); 519Debug.Fail("XML data contract type name does not match schema name");
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 (13)
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); 922Debug.Fail("Failed to create contract for KeyValuePair type");
System\Runtime\Serialization\XmlFormatWriterGenerator.cs (1)
418Debug.Assert(collectionContract.GetEnumeratorMethod != null);
System\Runtime\Serialization\XmlObjectSerializer.cs (4)
142Debug.Fail("XmlObjectSerializer.InternalWriteStartObject should never get called"); 149Debug.Fail("XmlObjectSerializer.InternalWriteObjectContent should never get called"); 156Debug.Fail("XmlObjectSerializer.InternalWriteEndObject should never get called"); 337Debug.Fail("XmlObjectSerializer.InternalIsStartObject should never get called");
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (10)
153Debug.Assert(attributes != null); 296Debug.Assert(attributes != null); 327Debug.Assert(attributes != null); 339Debug.Assert(attributes != null); 592Debug.Assert(attributes != null); 713Debug.Assert(attributes != null); 767Debug.Assert(attributes != null); 809Debug.Assert(attributes != null); 866Debug.Assert(attributes != null); 1099Debug.Assert(attributes != null);
System\Runtime\Serialization\XmlObjectSerializerReadContextComplex.cs (2)
63Debug.Assert(_serializationSurrogateProvider != null); 123Debug.Assert(attributes != null);
System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (2)
146Debug.Assert(rootTypeDataContract != null); 602Debug.Assert(DataContractResolver != null);
System\Text\Base64Encoding.cs (5)
73Debug.Assert(pch + 4 <= pchMax); 133Debug.Assert(pch + 4 <= pchMax); 206Debug.Assert(pch + 4 <= pchMax); 331Debug.Assert(pb - pbMax == 3); 416Debug.Assert(pb - pbMax == 3);
System\Xml\EncodingStreamWrapper.cs (5)
596Debug.Assert(_bytes != null); 597Debug.Assert(_chars != null); 633Debug.Assert(_bytes != null); 695Debug.Assert(_bytes != null); 696Debug.Assert(_chars != null);
System\Xml\PrefixHandle.cs (4)
37Debug.Assert(type != PrefixHandleType.Buffer); 121Debug.Assert(type != PrefixHandleType.Buffer); 127Debug.Assert(index >= 0 && index < 26); 133Debug.Assert(type != PrefixHandleType.Buffer);
System\Xml\StringHandle.cs (9)
103Debug.Assert(_type == StringHandleType.UTF8); 117Debug.Assert(type == StringHandleType.EscapedUTF8, "Should be EscapedUTF8"); 131Debug.Assert(type == StringHandleType.EscapedUTF8, "Should be EscapedUTF8"); 160Debug.Assert(type == StringHandleType.EscapedUTF8); 197Debug.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString); 208Debug.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString); 219Debug.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString); 230Debug.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString); 243Debug.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString);
System\Xml\ValueHandle.cs (21)
511Debug.Assert(bytes != null); 542Debug.Assert(str[i] < 128); 690Debug.Assert(offset + count <= chars.Length, string.Format("offset '{0}' + count '{1}' MUST BE <= chars.Length '{2}'", offset, count, chars.Length)); 772Debug.Assert(byteOffset + actualByteCount < bytes.Length, 844Debug.Assert(_type == ValueHandleType.UTF8); 852Debug.Assert(_type == ValueHandleType.Unicode); 858Debug.Assert(_type == ValueHandleType.EscapedUTF8); 876Debug.Assert(_type == ValueHandleType.Char); 882Debug.Assert(_type == ValueHandleType.Int8); 888Debug.Assert(_type == ValueHandleType.Int16); 894Debug.Assert(_type == ValueHandleType.Int32); 900Debug.Assert(_type == ValueHandleType.Int64 || _type == ValueHandleType.TimeSpan || _type == ValueHandleType.DateTime); 906Debug.Assert(_type == ValueHandleType.UInt64); 912Debug.Assert(_type == ValueHandleType.Single); 918Debug.Assert(_type == ValueHandleType.Double); 924Debug.Assert(_type == ValueHandleType.Decimal); 930Debug.Assert(_type == ValueHandleType.UniqueId); 936Debug.Assert(_type == ValueHandleType.Guid); 942Debug.Assert(_type == ValueHandleType.Base64); 948Debug.Assert(_type == ValueHandleType.Dictionary); 954Debug.Assert(_type == ValueHandleType.QName);
System\Xml\XmlBaseReader.cs (23)
661Debug.Assert(qnameType == QNameType.Xmlns); 749Debug.Assert(qnameType == QNameType.Xmlns); 892Debug.Assert(qnameType == QNameType.Xmlns); 1068Debug.Assert(qnameType == QNameType.Xmlns); 1109Debug.Assert(qnameType == QNameType.Xmlns); 1423Debug.Assert(_trailBytes != null); 1930Debug.Assert(qnameType == QNameType.Xmlns); 2104public StringHandle LocalName { get { Debug.Assert(_qnameType != QNameType.Xmlns); return _localName; } } 2105public PrefixHandle Prefix { get { Debug.Assert(_qnameType != QNameType.Xmlns); return _prefix; } } 2110public ValueHandle Value { get { Debug.Assert(_qnameType != QNameType.Xmlns); return _value; } } 2206Debug.Assert(_qnameType == QNameType.Xmlns); 2219Debug.Assert(_qnameType == QNameType.Xmlns); 2232Debug.Assert(_qnameType == QNameType.Xmlns); 2245Debug.Assert(_qnameType == QNameType.Xmlns); 2258Debug.Assert(_qnameType == QNameType.Xmlns); 2271Debug.Assert(_qnameType == QNameType.Xmlns); 2284Debug.Assert(_qnameType == QNameType.Xmlns); 2297Debug.Assert(_qnameType == QNameType.Xmlns); 2311Debug.Assert(_qnameType == QNameType.Xmlns); 2325Debug.Assert(_qnameType == QNameType.Xmlns); 2340Debug.Assert(_qnameType == QNameType.Xmlns); 2681Debug.Assert(qnameType == QNameType.Xmlns); 3067Debug.Assert(s != null);
System\Xml\XmlBaseWriter.cs (3)
1745Debug.Assert(_trailBytes != null); 1761Debug.Assert(_trailBytes != null); 2373Debug.Assert(nsCount >= 1 && _namespaces![0].Prefix!.Length == 0 && _namespaces[0].Uri!.Length == 0);
System\Xml\XmlBinaryReader.cs (1)
415Debug.Assert(_arrayState == ArrayState.Element);
System\Xml\XmlBinaryWriter.cs (16)
38Debug.Assert(XmlBinaryNodeType.MaxAttribute < XmlBinaryNodeType.MinElement && 71Debug.Assert(nodeType >= XmlBinaryNodeType.MinText && nodeType <= XmlBinaryNodeType.MaxText && ((byte)nodeType & 1) == 0, "Invalid nodeType"); 87Debug.Assert(nodeType == XmlBinaryNodeType.Chars8Text || nodeType == XmlBinaryNodeType.Bytes8Text || nodeType == XmlBinaryNodeType.UnicodeChars8Text); 109Debug.Assert(offset >= 0 && offset + 1 + Unsafe.SizeOf<T>() <= buffer.Length, "WriteTextNodeRaw"); 124Debug.Assert(offset >= 0 && offset + Unsafe.SizeOf<T>() <= buffer.Length, "WriteRaw"); 228Debug.Assert(nodeType >= XmlBinaryNodeType.MinText && nodeType <= XmlBinaryNodeType.MaxText && ((byte)nodeType & 1) == 0); 357Debug.Assert(t.Dictionary == _dictionary); 406Debug.Assert(length < 128); 630Debug.Assert(charCount > 0); 666Debug.Assert(length <= byte.MaxValue); 779Debug.Assert(intsWritten == 4); 826Debug.Assert(!_inList); 837Debug.Assert(_inList); 962Debug.Assert(intsWritten == 4); 1066Debug.Assert(result); 1136Debug.Assert(result);
System\Xml\XmlBufferReader.cs (19)
193Debug.Assert(_offsetMax < _windowOffsetMax); 214Debug.Assert(_offset <= int.MaxValue - count); 225Debug.Assert(newOffsetMax <= _windowOffsetMax); 235Debug.Assert(needed > 0); 248Debug.Assert(_offset + count <= _offsetMax); 254Debug.Assert(_stream != null); 295Debug.Assert(value >= _offsetMin && value <= _offsetMax); 302Debug.Assert(count >= 0); 706Debug.Assert(buffer[offset + 0] == '&'); 707Debug.Assert(buffer[offset + 1] == '#'); 708Debug.Assert(buffer[offset + length - 1] == ';'); 725Debug.Assert(buffer[offset + 0] == '&'); 726Debug.Assert(buffer[offset + 1] == '#'); 727Debug.Assert(buffer[offset + 2] == 'x'); 728Debug.Assert(buffer[offset + length - 1] == ';'); 736Debug.Assert(digit >= 0 && digit < 16); 749Debug.Assert(buffer[offset] == '&'); 750Debug.Assert(buffer[offset + length - 1] == ';'); 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 (2)
879Debug.Assert(buffer[offset] == 0xEF, "buffer[offset] MUST be 0xEF."); 1088Debug.Assert(BufferReader.GetByte() == '&');
System.Private.Uri (95)
src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (7)
25Debug.Assert(capacity >= 0); 54Debug.Assert(index >= 0 && index < _count); 78Debug.Assert(_count > 0); 87Debug.Assert(_count > 0); 104Debug.Assert(_array != null); // Nonzero _count should imply this 134Debug.Assert(_count < Capacity); 141Debug.Assert(minimum > Capacity);
src\libraries\Common\src\System\HexConverter.cs (3)
165Debug.Assert(chars.Length >= bytes.Length * 2); 332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (1)
114Debug.Assert(start < end);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0); 298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\DomainNameHelper.cs (4)
61Debug.Assert(!str.AsSpan(start, index).Contains(':'), 75Debug.Assert(index == -1 || char.IsAsciiLetterUpper(str[start + index])); 212Debug.Assert(ReferenceEquals(hostname, UriHelper.StripBidiControlCharacters(hostname, hostname))); 269Debug.Assert(charsWritten == label.Length);
System\IPv4AddressHelper.cs (1)
48Debug.Assert(result != Invalid, $"Failed to parse after already validated: {name}");
System\IPv6AddressHelper.cs (5)
38Debug.Assert(success); 43Debug.Assert(success); 48Debug.Assert(success); 53Debug.Assert(success); 82Debug.Assert(success);
System\IriHelper.cs (3)
32Debug.Assert(char.IsHighSurrogate(highSurr)); 118Debug.Assert(ch < 0xFF, "Expecting ASCII character."); 134Debug.Assert(charactersRead > 0);
System\PercentEncodingHelper.cs (16)
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); 90Debug.Assert(bytesConsumed >= 2, $"Rune.DecodeFromUtf8 consumed {bytesConsumed} bytes, likely indicating input was modified concurrently during UnescapePercentEncodedUTF8Sequence's execution"); 106Debug.Assert(bytesConsumed > 0, $"Rune.DecodeFromUtf8 consumed {bytesConsumed} bytes when decoding {bytesLeftInBuffer} bytes"); 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 (8)
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); 782Debug.Assert(!syntax!.IsSimple, "A UriPraser threw on InitializeAndValidate."); 796Debug.Assert(!baseUri.IsNotAbsoluteUri && !baseUri.UserDrivenParsing, "Uri::ResolveHelper()|baseUri is not Absolute or is controlled by User Parser."); 1057Debug.Fail("Uri failed to locate custom port at index: " + portIndex);
System\UriHelper.cs (13)
19Debug.Assert(charsWritten == buffer.Length); 157Debug.Assert(newLength > charsToEscape.Length); 172Debug.Assert(vsb.RawChars.Overlaps(destination)); 193Debug.Assert(!noEscape.Contains('%'), "Need to treat % specially; it should be part of any escaped set"); 194Debug.Assert(backingString is null || backingString.Length == charsToEscape.Length); 220Debug.Assert(!noEscape.Contains('%'), "Need to treat % specially; it should be part of any escaped set"); 240Debug.Assert(!stringToEscape.IsEmpty && !noEscape.Contains(stringToEscape[0])); 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 (3179)
src\libraries\Common\src\System\HexConverter.cs (3)
165Debug.Assert(chars.Length >= bytes.Length * 2); 332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0); 298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Xml\Base64Decoder.cs (5)
86Debug.Assert(buffer != null); 87Debug.Assert(count >= 0); 88Debug.Assert(index >= 0); 89Debug.Assert(buffer.Length - index >= count); 90Debug.Assert((buffer as byte[]) != null);
System\Xml\BinaryXml\SqlUtils.cs (17)
85Debug.Assert(rgulU.Length == s_cNumeMax); 92Debug.Assert(iulD != 0, "iulD != 0", "Divided by zero!"); 93Debug.Assert(iulD > 0, "iulD > 0", "Invalid data: less than zero"); 94Debug.Assert(ciulU > 0, "ciulU > 0", "No data in the array"); 130Debug.Assert(bPrec <= s_maxPrecision && bPrec > 0, "bPrec <= MaxPrecision && bPrec > 0", "Invalid numeric precision"); 136Debug.Assert(uiDigit < 10); 250Debug.Assert(m_bScale <= s_NUMERIC_MAX_PRECISION, "m_bScale <= NUMERIC_MAX_PRECISION", "In AssertValid"); 251Debug.Assert(m_bScale <= m_bPrec, "m_bScale <= m_bPrec", "In AssertValid"); 252Debug.Assert(m_bScale >= 0, "m_bScale >= 0", "In AssertValid"); 253Debug.Assert(m_bPrec > 0, "m_bPrec > 0", "In AssertValid"); 254Debug.Assert(CLenFromPrec(m_bPrec) >= m_bLen, "CLenFromPrec(m_bPrec) >= m_bLen", "In AssertValid"); 255Debug.Assert(m_bLen <= s_cNumeMax, "m_bLen <= x_cNumeMax", "In AssertValid"); 262Debug.Assert(m_bLen == 1, "m_bLen == 1", "In AssertValid"); 267Debug.Assert(rglData[iulData] == 0, "rglData[iulData] == 0", "In AssertValid"); 323Debug.Assert(val >= 0 && val < 100); 329Debug.Assert(val > -10000 && val < 10000); 341Debug.Assert(val >= 0 && val < 1000);
System\Xml\BinaryXml\XmlBinaryReader.cs (50)
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); 809Debug.Fail("Unexpected parent NodeType"); 817Debug.Assert(_textXmlReader != null); 866Debug.Assert(_textXmlReader != null); 904Debug.Assert(_textXmlReader != null); 911Debug.Assert(decl != null); 943Debug.Assert(_textXmlReader != null); 1124Debug.Fail("should never happen"); 1214Debug.Fail("should never happen"); 1309Debug.Fail("should never happen"); 1404Debug.Fail("should never happen"); 1499Debug.Fail("should never happen"); 1594Debug.Fail("should never happen"); 1689Debug.Fail("should never happen"); 1810Debug.Assert(_textXmlReader != null); 1850Debug.Assert(_textXmlReader != null); 2004Debug.Assert(_mark <= _end, "Mark should never be past End"); 2005Debug.Assert(_mark <= _pos, "Mark should never be after Pos"); 2025Debug.Assert((_attributes[i].contentPos >= 0) && (_attributes[i].contentPos <= (end))); 2032Debug.Assert(_attrCount == 0); 2049Debug.Assert((_pos + require) >= _end); 2089Debug.Assert(0 != (b & 0x80)); 2322Debug.Assert(pos >= 0 && cch >= 0); 2756Debug.Assert(_stringValue == null, "this.stringValue == null"); 2757Debug.Assert(_token == BinXmlToken.CData, "this.token == BinXmlToken.CData"); 2950Debug.Assert(_mark < 0); 3075Debug.Assert(_pos >= 3); 3080Debug.Assert(_pos >= 1); 3086Debug.Assert(_pos >= 2); 3182Debug.Assert(_prevNameInfo != null); 3234Debug.Assert(_textXmlReader != null); 3488Debug.Assert(_checkCharacters, "this.checkCharacters"); 3494Debug.Assert(data.Length % 2 == 0, "Data size should not be odd"); 3543Debug.Assert(!_checkCharacters, "!this.checkCharacters"); 3546Debug.Assert(0 == ((_pos - _tokDataPos) & 1), "Data size should not be odd"); 4396System.Diagnostics.Debug.WriteLine($"Unhandled token: {token}");
System\Xml\BinHexDecoder.cs (5)
90Debug.Assert(buffer != null); 91Debug.Assert(count >= 0); 92Debug.Assert(index >= 0); 93Debug.Assert(buffer.Length - index >= count); 94Debug.Assert((buffer as byte[]) != null);
System\Xml\BitStack.cs (2)
50Debug.Assert(_curr != 0x1, "Stack empty"); 71Debug.Assert(_curr != 0x1, "Stack empty");
System\Xml\Cache\XPathDocumentBuilder.cs (29)
153Debug.Assert(prefix != null && localName != null && ns != null && localName.Length != 0 && baseUri != null); 214Debug.Assert(_pageParent != null && _pageParent[_idxParent].NodeType == XPathNodeType.Element); 288Debug.Assert(namespaceName != null); 289Debug.Assert(prefix != null && !prefix.Equals("xmlns")); 290Debug.Assert(_idxParent == 0 || (_pageParent != null && _pageParent[_idxParent].NodeType == XPathNodeType.Element)); 291Debug.Assert(_idxSibling == 0 || (_pageSibling != null && _pageSibling[_idxSibling].NodeType == XPathNodeType.Attribute)); 308Debug.Assert(_pageSibling != null); 309Debug.Assert(_pageSibling[_idxSibling].NodeType == XPathNodeType.Attribute); 320Debug.Assert(_idxParent != 0 && _pageParent != null, "ID attribute must have an element parent"); 322Debug.Assert(id != null); 482Debug.Assert(_pageParent != null && _pageParent[_idxParent].NodeType == XPathNodeType.Element); 494Debug.Assert(_idxSibling == 0 || (_pageSibling != null && _pageSibling[_idxSibling].NodeType == XPathNodeType.Attribute)); 495Debug.Assert(!prefix.Equals("xmlns") && !namespaceName.Equals(XmlReservedNs.NsXmlNs)); 496Debug.Assert(_idxParent == 0 || _idxNmsp != 0); 497Debug.Assert(_idxParent == 0 || (_pageParent != null && _pageParent[_idxParent].NodeType == XPathNodeType.Element)); 530Debug.Assert(pageOrig != null); 554Debug.Assert(prefix.Equals("xml"), "xmlns:xml namespace declaration should always be present in the list."); 569Debug.Assert(_pageParent != null); 632Debug.Assert(pageElem == null || pageElem[idxElem].NodeType == XPathNodeType.Element); 662Debug.Assert(xptyp != XPathNodeType.Namespace); 705Debug.Assert(_lineInfo.HasLineInfo(), "HasLineInfo should have been checked before this."); 734Debug.Assert(xptyp != XPathNodeType.Root && xptyp != XPathNodeType.Namespace); 744Debug.Assert(_pageParent != null); 751Debug.Assert(_idxParent + 1 == idxNew || idxNew == 1); 755Debug.Assert(_pageSibling != null); 773Debug.Assert(_textBldr.HasText || (_idxSibling == 0 && _idxParent == 0), "Cannot create empty text node unless it's a top-level text node."); 774Debug.Assert(_idxSibling == 0 || (_pageSibling != null && !_pageSibling[_idxSibling].IsText), "Cannot create adjacent text nodes."); 903Debug.Assert((int)XPathNodeType.Text < (int)XPathNodeType.SignificantWhitespace); 904Debug.Assert((int)XPathNodeType.SignificantWhitespace < (int)XPathNodeType.Whitespace);
System\Xml\Cache\XPathDocumentNavigator.cs (18)
36Debug.Assert(pageCurrent != null && idxCurrent != 0); 37Debug.Assert((pageParent == null) == (idxParent == 0)); 84Debug.Fail("ReadStringValue() should have taken care of these node types."); 88Debug.Assert(_idxParent != 0 && _pageParent![_idxParent].HasCollapsedText, 97Debug.Assert(_pageCurrent[_idxCurrent].NodeType == XPathNodeType.Text); 100Debug.Assert(value != null); 120Debug.Assert(page[idx].NodeType == XPathNodeType.Element || page[idx].IsText); 122Debug.Assert(value != null); 373Debug.Assert(page != null); 434Debug.Assert(_pageCurrent != null); 454Debug.Assert(_pageParent != null); 494Debug.Assert(page != null); 496Debug.Assert(page[idx].NodeType == XPathNodeType.Element); 584Debug.Assert(_pageCurrent != null); 663Debug.Assert(_pageCurrent != null); 695Debug.Assert(page[idx].HasCollapsedText); 697Debug.Assert(_pageCurrent != null); 704Debug.Assert(page[idx].IsText);
System\Xml\Cache\XPathNode.cs (14)
154Debug.Assert(HasCollapsedText, "Do not call CollapsedLinePosition unless HasCollapsedText is true."); 173Debug.Assert(pageNode != null); 211Debug.Assert(localName == null || (object?)Document.NameTable.Get(localName) == (object)localName, "localName must be atomized."); 223Debug.Assert(localName == null || (object?)Document.NameTable.Get(localName) == (object)localName, "localName must be atomized."); 361Debug.Assert(info != null && idxParent <= ushort.MaxValue); 372Debug.Assert(lineNumOffset >= 0 && lineNumOffset <= MaxLineNumberOffset, $"Line number offset too large or small: {lineNumOffset}"); 373Debug.Assert(linePosOffset >= 0 && linePosOffset <= MaxLinePositionOffset, $"Line position offset too large or small: {linePosOffset}"); 383Debug.Assert(posOffset >= 0 && posOffset <= MaxCollapsedPositionOffset, $"Collapsed text line position offset too large or small: {posOffset}"); 400Debug.Assert(NodeType == XPathNodeType.Element); 411Debug.Assert(NodeType == XPathNodeType.Element); 439Debug.Assert(pageSibling != null && idxSibling != 0 && idxSibling <= ushort.MaxValue, "Bad argument"); 440Debug.Assert(_idxSibling == 0, "SetSibling should not be called more than once."); 458Debug.Assert(pageSimilar != null && idxSimilar != 0 && idxSimilar <= ushort.MaxValue, "Bad argument"); 459Debug.Assert(_idxSimilar == 0, "SetSimilarElement should not be called more than once.");
System\Xml\Cache\XPathNodeHelper.cs (34)
26Debug.Assert(pageElem[idxElem].NodeType == XPathNodeType.Element); 70Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 75Debug.Assert(pageNode[idxNode].NodeType == XPathNodeType.Attribute); 89Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 109Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 119Debug.Assert(idx != 0); 120Debug.Assert(page != null); 138Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 161Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 179Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 180Debug.Assert(idxNode <= ushort.MaxValue); 181Debug.Assert(pageNode[0].PageInfo!.PageNumber <= short.MaxValue); 194Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 200Debug.Assert(idx != 0); 228Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 261Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 299Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 312Debug.Assert(typ != XPathNodeType.Attribute && typ != XPathNodeType.Namespace); 331Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 332Debug.Assert(pageNode[idxNode].NodeType != XPathNodeType.Attribute); 348Debug.Assert(pagePrec != null); 369Debug.Assert(idxAnc != 0 && pageAnc != null); 394Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 428Debug.Assert(pageCurrent != null && idxCurrent != 0, "Cannot pass null argument(s)"); 454Debug.Assert(page != null); 527Debug.Assert(pageCurrent != null && idxCurrent != 0, "Cannot pass null argument(s)"); 528Debug.Assert(typ != XPathNodeType.Text, "Text should be handled by GetTextFollowing in order to take into account collapsed text."); 529Debug.Assert(page[idx].NodeType != XPathNodeType.Attribute, "Current node should never be an attribute or namespace--caller should handle this case."); 566Debug.Assert(!page[idx].IsAttrNmsp, "GetContentFollowing should never return attributes or namespaces."); 585Debug.Assert(pageCurrent != null && idxCurrent != 0, "Cannot pass null argument(s)"); 586Debug.Assert(!page[idx].IsAttrNmsp, "Current node should never be an attribute or namespace--caller should handle this case."); 662Debug.Assert(pageNode[idxNode].HasAttribute || pageNode[idxNode].HasContentChild, "Caller must check HasAttribute/HasContentChild on parent before calling GetChild."); 663Debug.Assert(pageNode[idxNode].HasAttribute || !pageNode[idxNode].HasCollapsedText, "Text child is virtualized and therefore is not present in the physical node page."); 669Debug.Assert(pageNode != null);
System\Xml\Cache\XPathNodeInfoAtom.cs (6)
123Debug.Assert(localName != null && namespaceUri != null && prefix != null && doc != null); 291Debug.Assert(other != null); 292Debug.Assert((object?)_doc == (object?)other._doc); 293Debug.Assert(_pageInfo == null); 326Debug.Assert(_localName != null); 333Debug.Assert(_prefix != null);
System\Xml\Core\CharEntityEncoderFallback.cs (3)
35Debug.Assert(_textContentMarks != null); 128Debug.Assert(_charEntityIndex < _charEntity.Length); 141Debug.Assert(_charEntityIndex <= _charEntity.Length);
System\Xml\Core\HtmlEncodedRawTextWriter.cs (21)
50Debug.Assert(name != null && name.Length > 0); 97Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 103Debug.Assert(prefix.Length == 0); 143Debug.Assert(prefix.Length == 0); 168Debug.Assert(prefix.Length == 0); 288Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 292Debug.Assert(prefix.Length == 0); 356Debug.Assert(!string.IsNullOrEmpty(target) && text != null); 378Debug.Assert(text != null); 413Debug.Assert(buffer != null); 414Debug.Assert(index >= 0); 415Debug.Assert(count >= 0 && index + count <= buffer.Length); 440Debug.Assert((int)ElementProperties.URI_PARENT == (int)AttributeProperties.URI); 441Debug.Assert((int)ElementProperties.BOOL_PARENT == (int)AttributeProperties.BOOLEAN); 442Debug.Assert((int)ElementProperties.NAME_PARENT == (int)AttributeProperties.NAME); 564Debug.Assert(pSrc <= pSrcEnd); 652Debug.Assert(pSrc <= pSrcEnd); 702Debug.Assert(_uriEscapingBuffer?.Length > 0); 816Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 824Debug.Assert(prefix.Length == 0); 880Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null);
System\Xml\Core\HtmlUtf8RawTextWriter.cs (21)
45Debug.Assert(name != null && name.Length > 0); 90Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 96Debug.Assert(prefix.Length == 0); 134Debug.Assert(prefix.Length == 0); 157Debug.Assert(prefix.Length == 0); 275Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 279Debug.Assert(prefix.Length == 0); 339Debug.Assert(!string.IsNullOrEmpty(target) && text != null); 359Debug.Assert(text != null); 392Debug.Assert(buffer != null); 393Debug.Assert(index >= 0); 394Debug.Assert(count >= 0 && index + count <= buffer.Length); 417Debug.Assert((int)ElementProperties.URI_PARENT == (int)AttributeProperties.URI); 418Debug.Assert((int)ElementProperties.BOOL_PARENT == (int)AttributeProperties.BOOLEAN); 419Debug.Assert((int)ElementProperties.NAME_PARENT == (int)AttributeProperties.NAME); 541Debug.Assert(pSrc <= pSrcEnd); 629Debug.Assert(pSrc <= pSrcEnd); 679Debug.Assert(_uriEscapingBuffer?.Length > 0); 788Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 794Debug.Assert(prefix.Length == 0); 850Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null);
System\Xml\Core\IncrementalReadDecoders.cs (17)
63Debug.Assert(_buffer != null); 64Debug.Assert(chars != null); 65Debug.Assert(len >= 0); 66Debug.Assert(startPos >= 0); 67Debug.Assert(chars.Length - startPos >= len); 69Debug.Assert(len > 0); 85Debug.Assert(_buffer != null); 86Debug.Assert(str != null); 87Debug.Assert(len >= 0); 88Debug.Assert(startPos >= 0); 89Debug.Assert(str.Length - startPos >= len); 91Debug.Assert(len > 0); 111Debug.Assert(buffer != null); 112Debug.Assert(count >= 0); 113Debug.Assert(index >= 0); 114Debug.Assert(buffer.Length - index >= count); 116Debug.Assert((buffer as char[]) != null);
System\Xml\Core\QueryOutputWriter.cs (2)
138Debug.Assert(!_outputDocType); 351Debug.Assert(!_inCDataSection);
System\Xml\Core\QueryOutputWriterV1.cs (6)
128Debug.Assert(!_outputDocType); 161Debug.Assert(_qnameCData != null); 162Debug.Assert(_bitsCData != null); 178Debug.Assert(_bitsCData != null); 191Debug.Assert(_bitsCData != null); 319Debug.Assert(!_inCDataSection);
System\Xml\Core\ReadContentAsBinaryHelper.cs (11)
93Debug.Fail($"Unexpected state {_state}"); 97Debug.Assert(_state == State.InReadContent); 136Debug.Fail($"Unexpected state {_state}"); 140Debug.Assert(_state == State.InReadContent); 179Debug.Fail($"Unexpected state {_state}"); 183Debug.Assert(_state == State.InReadElementContent); 222Debug.Fail($"Unexpected state {_state}"); 226Debug.Assert(_state == State.InReadElementContent); 276Debug.Assert(_reader.NodeType == XmlNodeType.Element); 330Debug.Assert(_decoder != null); 355Debug.Assert(_valueOffset == _valueChunkLength);
System\Xml\Core\ReadContentAsBinaryHelperAsync.cs (11)
44Debug.Fail($"Unexpected state {_state}"); 48Debug.Assert(_state == State.InReadContent); 88Debug.Fail($"Unexpected state {_state}"); 92Debug.Assert(_state == State.InReadContent); 132Debug.Fail($"Unexpected state {_state}"); 136Debug.Assert(_state == State.InReadElementContent); 176Debug.Fail($"Unexpected state {_state}"); 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 (3)
51Debug.Assert(checkCharacters || ignoreWhitespace || ignoreComments || ignorePis || (int)dtdProcessing != -1); 188Debug.Fail($"Unexpected state {_state}"); 643Debug.Assert(readerAsNSResolver != null);
System\Xml\Core\XmlCharCheckingReaderAsync.cs (1)
50Debug.Fail($"Unexpected state {_state}");
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 (5)
125Debug.Assert(idxPage + 1 == _pages.Count); 241Debug.Fail($"Unknown event: {page[idxEvent].EventType}"); 247Debug.Fail("Unknown event should be added to end of event sequence."); 279Debug.Assert(idxPage + 1 == _pages.Count); 304Debug.Fail("Unknown event should be added to end of event sequence.");
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 (51)
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); 533Debug.Fail($"Unexpected state {_state}"); 550Debug.Assert(reader.Depth >= _initialDepth); 587Debug.Assert(reader.Depth >= _initialDepth); 601Debug.Assert(reader.NodeType == XmlNodeType.EndElement || 616Debug.Assert(reader.Depth >= _initialDepth); 652Debug.Fail($"Unexpected state {_state}"); 868Debug.Assert(_binDecoder != null); 875Debug.Assert(AttributeCount > 0); 878Debug.Fail($"Unexpected state {_state}"); 901Debug.Fail($"Unexpected state {_state}"); 958Debug.Fail($"Unexpected state {_state}"); 1006Debug.Assert(_binDecoder != null); 1013Debug.Assert(AttributeCount > 0); 1016Debug.Fail($"Unexpected state {_state}"); 1039Debug.Fail($"Unexpected state {_state}"); 1095Debug.Fail($"Unexpected state {_state}"); 1154Debug.Fail($"Unexpected state {_state}"); 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); 1552Debug.Fail($"Unexpected state {_state}"); 1560Debug.Assert(_state == State.Interactive ||
System\Xml\Core\XmlSubtreeReaderAsync.cs (21)
42Debug.Assert(reader.Depth >= _initialDepth); 52Debug.Assert(reader.NodeType == XmlNodeType.Element && !reader.IsEmptyElement); 96Debug.Fail($"Unexpected state {_state}"); 113Debug.Assert(reader.Depth >= _initialDepth); 127Debug.Assert(reader.NodeType == XmlNodeType.EndElement || 142Debug.Assert(reader.Depth >= _initialDepth); 178Debug.Fail($"Unexpected state {_state}"); 274Debug.Assert(_binDecoder != null); 281Debug.Assert(AttributeCount > 0); 284Debug.Fail($"Unexpected state {_state}"); 307Debug.Fail($"Unexpected state {_state}"); 364Debug.Fail($"Unexpected state {_state}"); 412Debug.Assert(_binDecoder != null); 419Debug.Assert(AttributeCount > 0); 422Debug.Fail($"Unexpected state {_state}"); 445Debug.Fail($"Unexpected state {_state}"); 501Debug.Fail($"Unexpected state {_state}"); 552Debug.Fail($"Unexpected state {_state}"); 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 (294)
317Debug.Assert(nt != null); 330Debug.Assert(_index == 0); 371Debug.Assert(_nameTableFromSettings == false); 393Debug.Assert(_index == 0); 442Debug.Fail($"Unexpected conformance level {settings.ConformanceLevel}"); 601Debug.Assert(baseUri == null); 629Debug.Assert(_laterInitParam != null); 630Debug.Assert(_laterInitParam.inputUriResolver != null); 631Debug.Assert(_laterInitParam.inputbaseUri != null); 632Debug.Assert(_reportedBaseUri != null); 699Debug.Assert(baseUri == null); 730Debug.Assert(_laterInitParam != null); 731Debug.Assert(_laterInitParam.inputStream != null); 732Debug.Assert(_reportedBaseUri != null); 763Debug.Assert(baseUriStr == string.Empty, "BaseURI can come either from XmlParserContext or from the constructor argument, not from both"); 789Debug.Assert(_laterInitParam != null); 790Debug.Assert(_laterInitParam.inputTextReader != null); 791Debug.Assert(_reportedBaseUri != null); 812Debug.Assert(xmlFragment != null); 838default: Debug.Fail($"Unexpected fragment type {_fragmentType}"); goto case XmlNodeType.None; 1195Debug.Assert(_laterInitParam != null); 1210Debug.Fail("Invalid InitInputType"); 1234Debug.Assert(_nextParsingFunction == ParsingFunction.DocumentContent); 1237Debug.Assert(!_ps.appendMode); 1265Debug.Assert(_parsingFunction == ParsingFunction.ElementContent || 1270Debug.Assert(_curNode.type == XmlNodeType.Element); 1334Debug.Fail($"Unexpected parsing function {_parsingFunction}"); 1362Debug.Fail($"Unexpected parsing function {_parsingFunction}"); 1394Debug.Assert(_curNode.type == XmlNodeType.EndElement); 1395Debug.Assert(_parsingFunction != ParsingFunction.Eof); 1415Debug.Assert(_namespaceManager != null); 1498Debug.Assert(_parsingMode == ParsingMode.Full); 1517Debug.Fail("Unexpected entity type"); 1543Debug.Fail("Unexpected entity type"); 1559Debug.Assert(value is XmlTextReader); 1578Debug.Assert(_outerReader is XmlTextReaderImpl); 1867Debug.Assert(_ps.chars != null); 1891Debug.Assert(_ps.chars != null); 1944Debug.Assert(_namespaceManager != null); 1952Debug.Assert(_namespaceManager != null); 1988Debug.Assert(_namespaceManager != null); 2008Debug.Assert(_v1Compat, "XmlTextReaderImpl.Normalization property cannot be accessed on reader created via XmlReader.Create."); 2013Debug.Assert(_v1Compat, "XmlTextReaderImpl.Normalization property cannot be changed on reader created via XmlReader.Create."); 2041Debug.Assert(_v1Compat, "XmlTextReaderImpl.WhitespaceHandling property cannot be accessed on reader created via XmlReader.Create."); 2046Debug.Assert(_v1Compat, "XmlTextReaderImpl.WhitespaceHandling property cannot be changed on reader created via XmlReader.Create."); 2066Debug.Assert(_v1Compat, "XmlTextReaderImpl.DtdProcessing property cannot be accessed on reader created via XmlReader.Create."); 2071Debug.Assert(_v1Compat, "XmlTextReaderImpl.DtdProcessing property cannot be changed on reader created via XmlReader.Create."); 2123Debug.Assert(_v1Compat, "XmlTextReaderImpl.ResetState cannot be called on reader created via XmlReader.Create."); 2137Debug.Assert(_namespaceManager != null); 2165Debug.Assert(_v1Compat, "XmlTextReaderImpl.GetRemainder cannot be called on reader created via XmlReader.Create."); 2166Debug.Assert(_stringBuilder.Length == 0); 2206Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadChars cannot be called on reader created via XmlReader.Create."); 2207Debug.Assert(_outerReader is XmlTextReader); 2242Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadBase64 cannot be called on reader created via XmlReader.Create."); 2243Debug.Assert(_outerReader is XmlTextReader); 2276Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadBinHex cannot be called on reader created via XmlReader.Create."); 2277Debug.Assert(_outerReader is XmlTextReader); 2404Debug.Assert(value >= 0 && value <= _ps.charsUsed); 2490Debug.Assert(_parsingMode == ParsingMode.Full); 2578Debug.Assert(_parsingStatesStackTop == -1); 2579Debug.Assert((systemId != null && systemId.Length > 0) || (publicId != null && publicId.Length > 0)); 2586Debug.Assert(_xmlResolver != null); 2598Debug.Assert(_ps.appendMode); 2614Debug.Assert(_parsingStatesStackTop == -1); 2615Debug.Assert(internalDtd != null); 2788Debug.Assert(InAttributeValueIterator); 2825Debug.Assert(baseUriStr != null); 2831Debug.Assert(baseUri != null); 2842Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0 && _ps.textReader == null); 2843Debug.Assert(baseUriStr != null); 2844Debug.Assert(baseUri == null || (baseUri.ToString().Equals(baseUriStr))); 2917Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0 && _ps.stream == null); 2918Debug.Assert(baseUriStr != null); 2946Debug.Assert(_ps.stream == null && _ps.textReader == null); 2947Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0); 2948Debug.Assert(baseUriStr != null); 2949Debug.Assert(str != null); 3004Debug.Assert(_parsingFunction == ParsingFunction.SwitchToInteractiveXmlDecl); 3008Debug.Assert(_parsingFunction == ParsingFunction.SwitchToInteractiveXmlDecl); 3009Debug.Assert(_nextParsingFunction == ParsingFunction.DocumentContent); 3034Debug.Assert(context != null && context.HasDtdInfo); 3048Debug.Fail("Unhandled DtdProcessing enumeration value."); 3056Debug.Assert(_url != null && _url.Length > 0); 3081Debug.Assert(_ps.stream != null); 3089Debug.Assert(_ps.bytes != null); 3090Debug.Assert(_ps.bytePos == 0); 3176Debug.Assert(_ps.charPos == 0); 3194Debug.Assert(_ps.encoding != null); 3195Debug.Assert(_ps.bytes != null); 3206Debug.Assert(_ps.encoding != null); 3209Debug.Assert(_ps.stream != null); 3221Debug.Assert(_ps.encoding != null); 3270Debug.Assert(newEncoding != null); 3271Debug.Assert(newEncoding.EncodingName != "UTF-8"); 3285Debug.Assert(_ps.stream != null && _ps.decoder != null && _ps.bytes != null); 3286Debug.Assert(_ps.appendMode, "UnDecodeChars cannot be called after ps.appendMode has been changed to false"); 3288Debug.Assert(_ps.charsUsed >= _ps.charPos, "The current position must be in the valid character range."); 3296Debug.Assert(_charactersInDocument >= _ps.charsUsed - _ps.charPos, 3305Debug.Assert(_charactersFromEntities >= _ps.charsUsed - _ps.charPos, 3314Debug.Assert(_ps.encoding != null); 3315Debug.Assert(_ps.chars != null); 3341Debug.Assert(_ps.chars != null); 3364Debug.Assert(_ps.bytes != null); 3423Debug.Assert(_ps.bytes != null); 3438Debug.Assert(_ps.bytes != null); 3477Debug.Assert(_ps.charsUsed < _ps.chars.Length); 3488Debug.Assert(_ps.stream != null && _ps.decoder != null && _ps.bytes != null); 3489Debug.Assert(_ps.chars != null); 3490Debug.Assert(maxCharsCount <= _ps.chars.Length - _ps.charsUsed - 1); 3514Debug.Assert(maxCharsCount >= charsCount); 3529Debug.Assert(_ps.decoder != null); 3530Debug.Assert(_ps.bytes != null); 3531Debug.Assert(_ps.chars != null); 3537Debug.Fail("We should get an exception again."); 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); 3831Debug.Fail($"Unexpected xmlDeclState {xmlDeclState}"); 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); 4625Debug.Fail("We should never get to this point."); 4634Debug.Assert(_index > 0); 4639Debug.Assert(_curNode == startTagNode); 4656Debug.Assert(_ps.chars != null); 4666Debug.Assert(startTag.type == XmlNodeType.EntityReference); 4675Debug.Assert(_ps.chars != null); 4679Debug.Assert(_attrCount == 0); 4728Debug.Assert(_curNode.type == XmlNodeType.Element); 4736Debug.Assert(_curNode.type == XmlNodeType.Element); 4840Debug.Assert(attrNameLineNo == _ps.LineNo); 4887Debug.Assert(val == XmlComplianceUtil.CDataNormalize(val), "The attribute value is not CDATA normalized!"); 4962Debug.Assert(_curNode.type == XmlNodeType.Element); 5096Debug.Assert(_ps.chars != null); 5103Debug.Assert(_stringBuilder.Length == 0); 5258Debug.Assert(_ps.entity != null); 5312Debug.Fail("We should never get to this point."); 5315Debug.Assert(_ps.isEof); 5333Debug.Fail("no EndEntity reporting while parsing attributes"); 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); 6122Debug.Fail($"Unexpected parsing states stack top {_parsingStatesStackTop}"); 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); 7045Debug.Fail("We should never get to this point."); 7048Debug.Assert(_ps.isEof); 7064Debug.Assert(_ps.chars != null); 7146Debug.Fail("We should never get to this point."); 7149Debug.Assert(_ps.isEof); 7158Debug.Assert(_ps.chars != null); 7159Debug.Assert(_ps.chars[startPos] == '&'); 7192Debug.Assert(_ps.chars != null); 7193Debug.Assert(_ps.chars[_ps.charPos] == '&'); 7213Debug.Assert(_ps.chars != null); 7214Debug.Assert(_ps.chars[startPos] == '&' && _ps.chars[startPos + 1] == '#'); 7269Debug.Assert(badDigitExceptionString != null); 7321Debug.Assert(pos > 0); 7355Debug.Assert(_ps.chars != null); 7356Debug.Assert(_ps.chars[_ps.charPos] == '&'); 7376Debug.Assert(startPos < _ps.charsUsed); 7377Debug.Assert(_ps.chars != null); 7378Debug.Assert(_ps.chars[startPos] == '&'); 7379Debug.Assert(_ps.chars[startPos + 1] != '#'); 7487Debug.Assert(pos > 0); 7512Debug.Assert(_ps.chars != null); 7575Debug.Assert(_ps.chars != null); 7608Debug.Assert(_ps.chars != null); 7623Debug.Assert(nodeIndex < _nodes.Length); 7624Debug.Assert(_nodes[_nodes.Length - 1] == null); 7637Debug.Assert(nodeIndex < _nodes.Length); 7644Debug.Assert(nodeIndex < _nodes.Length); 7661Debug.Assert(_ps.chars != null); 7714Debug.Assert(attr.type == XmlNodeType.Attribute); 7730Debug.Assert(_namespaceManager != null); 7749Debug.Assert(_ps.isEof); 7762Debug.Assert(_namespaceManager != null); 7800Debug.Assert(_namespaceManager != null); 7813Debug.Assert(_xmlContext.defaultNamespace == uri); 7850Debug.Assert(_curNode.xmlContextPushed); 7892Debug.Assert(_xmlResolver != null); 7950Debug.Assert(_xmlResolver != null); 7967Debug.Assert(_xmlResolver.SupportsType(uri, typeof(Stream)), "Stream must always be a supported type in XmlResolver"); 7987Debug.Assert(entity.IsExternal); 7991Debug.Assert(_xmlResolver != null); 8002Debug.Assert(_ps.appendMode); 8033Debug.Assert(!entity.IsExternal); 8099Debug.Assert(_parsingStatesStackTop == -1); 8115Debug.Assert(_parsingStatesStackTop >= 0); 8116Debug.Assert(_parsingStatesStack != null); 8163Debug.Assert(_incReadDecoder != null); 8173Debug.Assert(_incReadDecoder != null); 8174Debug.Assert(_ps.chars != null); 8223Debug.Assert(_ps.chars.AsSpan(_ps.charPos - 2).StartsWith("?>")); 8231Debug.Assert(_ps.chars.AsSpan(_ps.charPos - 3).StartsWith("-->")); 8239Debug.Assert(_ps.chars.AsSpan(_ps.charPos - 3).StartsWith("]]>")); 8261Debug.Fail($"Unexpected read state {_incReadState}"); 8264Debug.Assert(_incReadState == IncrementalReadState.Text || 8373Debug.Assert(_ps.charPos - pos == 0); 8374Debug.Assert(_ps.charPos - startPos == 0); 8413Debug.Assert(_ps.charPos - pos == 0); 8414Debug.Assert(_ps.charPos - startPos == 0); 8511Debug.Assert(count == charsParsed || _incReadDecoder.IsFull, "Check if decoded consumed all characters unless it's full."); 8528Debug.Assert(IncrementalRead() == 0, "Previous call of IncrementalRead should eat up all characters!"); 8534Debug.Assert(_fragmentType == XmlNodeType.Attribute); 8551Debug.Assert(_parsingFunction == ParsingFunction.InReadAttributeValue); 8564Debug.Assert(_ps.chars != null); 8579Debug.Assert(_stringBuilder.Length == 0); 8590Debug.Assert(_ps.eolNormalized, "Entity replacement text for attribute values should be EOL-normalized!"); 8645Debug.Fail("We should never get to this point."); 8703Debug.Fail("We should never get to this point."); 8783Debug.Assert(_ps.chars != null); 8796Debug.Assert(_ps.charPos < _ps.charsUsed); 8861Debug.Assert(_ps.chars != null); 8874Debug.Assert(_dtdInfo == null && _fragmentParserContext != null && _fragmentParserContext.HasDtdInfo); 8890Debug.Assert(_parsingFunction != ParsingFunction.InReadContentAsBinary); 8917Debug.Assert(_parsingFunction != ParsingFunction.InReadElementContentAsBinary); 8918Debug.Assert(_curNode.type == XmlNodeType.Element); 9001Debug.Assert(context != null); 9022Debug.Assert(nt != null); 9023Debug.Assert(context.NameTable == null || context.NameTable == nt, "This check should have been done in XmlParserContext constructor."); 9039Debug.Assert(_nameTableFromSettings == false); 9064Debug.Assert(_dtdInfo == null); 9122Debug.Assert(_curNode.type == XmlNodeType.Whitespace && newNodeType == XmlNodeType.SignificantWhitespace, "Incorrect node type change!"); 9224Debug.Assert(attr != null); 9245Debug.Assert(_namespaceManager != null); 9248Debug.Assert(prefix != null); 9266Debug.Assert(attr != null); 9298Debug.Assert(_nodes[_index].type == XmlNodeType.Element); 9316Debug.Assert(_nodes[_index].type == XmlNodeType.Element); 9317Debug.Assert(_namespaceManager != null); 9351Debug.Assert(_incReadDecoder != null); 9385Debug.Assert(_ps.chars != null); 9464Debug.Assert(_parsingFunction != ParsingFunction.InReadElementContentAsBinary); 9520Debug.Assert(characters >= 0); 9562Debug.Assert(startPos >= 0); 9563Debug.Assert(endPos < chars.Length); 9564Debug.Assert(startPos <= endPos); 9571Debug.Assert(startPos >= 0); 9572Debug.Assert(endPos < str.Length); 9573Debug.Assert(startPos <= endPos);
System\Xml\Core\XmlTextReaderImplAsync.cs (85)
69Debug.Fail("Invalid InitInputType"); 94Debug.Assert(_reportedBaseUri != null); 125Debug.Assert(_reportedBaseUri != null); 175Debug.Fail($"Unexpected parsing function {_parsingFunction}"); 178Debug.Assert(!_ps.appendMode); 198Debug.Assert(_parsingFunction == ParsingFunction.ElementContent || 203Debug.Assert(_curNode.type == XmlNodeType.Element); 264Debug.Fail($"Unexpected parsing function {_parsingFunction}"); 323Debug.Fail($"Unexpected parsing function {_parsingFunction}"); 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); 991Debug.Fail("Unhandled DtdProcessing enumeration value."); 1003Debug.Assert(_ps.stream != null); 1161Debug.Assert(_ps.charsUsed < _ps.chars.Length); 1193Debug.Assert(_stringBuilder.Length == 0 || isTextDecl); 1399Debug.Assert(!isTextDecl); 1410Debug.Fail($"Unexpected xmlDeclState {xmlDeclState}"); 1597Debug.Assert(pos == _ps.charsUsed && !_ps.isEof); 1712Debug.Assert(_index == 0); 2249Debug.Fail("We should never get to this point."); 2252Debug.Assert(_index > 0); 2257Debug.Assert(_curNode == startTagNode); 2299Debug.Assert(startTag.type == XmlNodeType.EntityReference); 2311Debug.Assert(_attrCount == 0); 2361Debug.Assert(_curNode.type == XmlNodeType.Element); 2369Debug.Assert(_curNode.type == XmlNodeType.Element); 2483Debug.Assert(attrNameLineNo == _ps.LineNo); 2530Debug.Assert(val == XmlComplianceUtil.CDataNormalize(val), "The attribute value is not CDATA normalized!"); 2613Debug.Assert(_stringBuilder.Length == 0); 2827Debug.Fail("We should never get to this point."); 2830Debug.Assert(_ps.isEof); 2849Debug.Fail("no EndEntity reporting while parsing attributes"); 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); 4788Debug.Fail("We should never get to this point."); 4791Debug.Assert(_ps.isEof); 4888Debug.Fail("We should never get to this point."); 4891Debug.Assert(_ps.isEof); 4920Debug.Assert(_ps.chars[_ps.charPos] == '&'); 4954Debug.Assert(_ps.chars[_ps.charPos] == '&'); 5161Debug.Assert(_xmlResolver != null); 5178Debug.Assert(_xmlResolver.SupportsType(uri, typeof(Stream)), "Stream must always be a supported type in XmlResolver"); 5197Debug.Assert(entity.IsExternal); 5211Debug.Assert(_ps.appendMode); 5255Debug.Assert(_dtdInfo == null && _fragmentParserContext != null && _fragmentParserContext.HasDtdInfo); 5270Debug.Assert(_parsingFunction != ParsingFunction.InReadContentAsBinary); 5296Debug.Assert(_parsingFunction != ParsingFunction.InReadElementContentAsBinary); 5297Debug.Assert(_curNode.type == XmlNodeType.Element); 5359Debug.Assert(_incReadDecoder != null); 5473Debug.Assert(_parsingFunction != ParsingFunction.InReadElementContentAsBinary);
System\Xml\Core\XmlTextReaderImplHelpers.cs (24)
284Debug.Assert(internalDtd != null); 417Debug.Assert(type == XmlNodeType.Element); 430Debug.Assert(type == XmlNodeType.Attribute); 447Debug.Assert(_valueStartPos >= 0 || _value != null, "Value not ready."); 451Debug.Assert(_chars != null); 462Debug.Assert(_chars != null); 467Debug.Assert(_value != null); 511Debug.Assert(value != null); 537Debug.Assert(localName != null); 538Debug.Assert(localName.Length > 0); 567Debug.Assert(_valueStartPos != -1); 568Debug.Assert(_chars != null); 578Debug.Assert(_valueStartPos != -1); 579Debug.Assert(_chars != null); 599Debug.Assert(_valueStartPos != -1); 600Debug.Assert(_chars != null); 625Debug.Assert(_valueStartPos != -1); 626Debug.Assert(_chars != null); 643Debug.Assert(_chars != null); 648Debug.Assert(_value != null); 668Debug.Assert(nameWPrefix == null); 703Debug.Fail("We should never get to this point."); 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 (10)
1008Debug.Fail($"Unexpected state {_currentState}"); 1471Debug.Assert(declared, "Unexpected situation!!"); 1481Debug.Fail("Should have never come here"); 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 (5)
580Debug.Fail($"Unexpected parsing function {_parsingFunction}"); 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 (4)
68Debug.Fail($"Unexpected parsing function {_parsingFunction}"); 175Debug.Assert(_parserContext != null); 176Debug.Assert(_coreReaderImpl.DtdInfo == null); 193Debug.Assert(_coreReader.NodeType == XmlNodeType.EntityReference);
System\Xml\Core\XmlWellFormedWriter.cs (25)
240Debug.Assert(writer != null); 241Debug.Assert(settings != null); 242Debug.Assert(MaxNamespacesWalkCount <= 3); 298Debug.Fail("Expected currentState <= State.Error "); 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); 1537Debug.Fail("State.Attribute == currentState || State.RootLevelAttr == currentState"); 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)); 1951Debug.Fail("We should not get to this point."); 1978Debug.Fail($"We should never get to this point. State = {state}"); 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 (4)
229Debug.Assert(prefix.Length == 0); 645Debug.Assert(_attrValueCache != null); 690Debug.Assert(_curDeclPrefix != null); 1368Debug.Fail("We should not get to this point.");
System\Xml\Core\XmlWellFormedWriterHelpers.cs (4)
96Debug.Assert(kind == NamespaceKind.NeedToWrite); 388Debug.Fail("Unexpected ItemType value."); 505Debug.Assert(_singleStringValue != null); 506Debug.Assert(_lastItem == -1);
System\Xml\Core\XmlWellFormedWriterHelpersAsync.cs (2)
31Debug.Assert(kind == NamespaceKind.NeedToWrite); 99Debug.Fail("Unexpected ItemType value.");
System\Xml\Core\XmlWrappingReader.cs (1)
25Debug.Assert(baseReader != null);
System\Xml\Core\XmlWrappingWriter.cs (1)
23Debug.Assert(baseWriter != null);
System\Xml\Core\XmlWriter.cs (1)
488Debug.Fail($"Unexpected node type {nodeType}");
System\Xml\Core\XmlWriterAsync.cs (1)
488Debug.Fail($"Unexpected node type {nodeType}");
System\Xml\Core\XmlWriterSettings.cs (5)
367Debug.Assert(Encoding.UTF8.WebName == "utf-8"); 386Debug.Fail("Invalid XmlOutputMethod setting."); 408Debug.Fail("Invalid XmlOutputMethod setting."); 457Debug.Fail("Invalid XmlOutputMethod setting."); 603Debug.Assert(Encoding.Equals(Encoding.GetEncoding(Encoding.CodePage)), "Cannot serialize encoding correctly");
System\Xml\Core\XsdCachingReader.cs (8)
483Debug.Assert(_coreReader.NodeType == XmlNodeType.EndElement || (_coreReader.NodeType == XmlNodeType.Element && _coreReader.IsEmptyElement)); 488Debug.Assert(endElementNode.NodeType == XmlNodeType.EndElement); 496Debug.Assert(_coreReader.NodeType == XmlNodeType.EndElement || (_coreReader.NodeType == XmlNodeType.Element && _coreReader.IsEmptyElement)); 561Debug.Assert(_cacheState == CachingReaderState.Replay); 591Debug.Assert(_cacheState == CachingReaderState.Replay); 653Debug.Assert(attIndex < _attributeEvents.Length); 671Debug.Assert(_contentIndex <= _contentEvents.Length); 692Debug.Assert(_coreReader.NodeType == XmlNodeType.Element);
System\Xml\Core\XsdCachingReaderAsync.cs (1)
127Debug.Assert(_cacheState == CachingReaderState.Replay);
System\Xml\Core\XsdValidatingReader.cs (50)
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); 2598Debug.Fail("Should not happen as the caching reader does not cache elements in simple content"); 2626Debug.Assert(_cachingReader != null); 2646Debug.Assert(_cachingReader != null); 2659Debug.Fail("Should not happen as the caching reader does not cache elements in simple content"); 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 (20)
24Debug.Assert(_cachedNode != null); 156Debug.Assert(false, $"{nameof(typedValue)} should never be 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 (40)
179Debug.Assert(_source.Value != null); 220Debug.Assert(value != null); 519Debug.Fail($"Unexpected scope {scope}"); 527Debug.Assert(attributes != null); 547Debug.Assert(attributes != null && attributes.parent != null); 578Debug.Assert(_namespaceParent != null); 632Debug.Fail($"Unexpected scope {scope}"); 640Debug.Assert(attributes != null); 641Debug.Assert(0 <= index && index < attributes.Count); 661Debug.Assert(attributes != null && attributes.parent != null); 724Debug.Assert(parent != null); 760Debug.Assert(parent != null); 788Debug.Assert(sibling != null); 1271Debug.Assert(ownerDocument != null); 1307Debug.Assert(node1 != null); 1308Debug.Assert(node2 != null); 1309Debug.Assert(node1 != node2, "Should be handled by ComparePosition()"); 1311Debug.Assert(OwnerNode(node1) == OwnerNode(node2)); 1317Debug.Assert(element != null); 1393Debug.Assert(node1 != node2); 1412Debug.Assert(node2 != null); 1427Debug.Assert(node1 != null); 1436Debug.Assert(node1 != node2); 1456Debug.Assert(this.NodeType != XPathNodeType.Attribute && this.NodeType != XPathNodeType.Namespace && this.NodeType != XPathNodeType.All); 1791Debug.Assert(node != null, "This method needs to be called with the beforehand check of NextSibling being not null from node to end"); 1833Debug.Assert(node != null, "Undefined navigator position"); 1834Debug.Assert(node == _document || node.OwnerDocument == _document, "Navigator switched documents"); 2257Debug.Assert(((XmlNode)nav.UnderlyingObject).NodeType != XmlNodeType.Attribute); 2270Debug.Assert(node != null); 2311Debug.Assert(((XmlNode)nav.UnderlyingObject).NodeType != XmlNodeType.Attribute); 2312Debug.Assert(Ref.Equal(nav.NameTable.Get(nsAtom), nsAtom)); 2326Debug.Assert(node != null); 2327Debug.Assert(node.NodeType == XmlNodeType.Element); 2369Debug.Assert(((XmlNode)nav.UnderlyingObject).NodeType != XmlNodeType.Attribute); 2370Debug.Assert(Ref.Equal(nav.NameTable.Get(localNameAtom), localNameAtom)); 2371Debug.Assert(Ref.Equal(nav.NameTable.Get(nsAtom), nsAtom)); 2372Debug.Assert(localNameAtom.Length > 0); // Use DocumentXPathNodeIterator_ElemChildren_NoLocalName class for special magic value of localNameAtom 2391Debug.Assert(node != null); 2392Debug.Assert(node.NodeType == XmlNodeType.Element); 2402Debug.Assert(localNameAtom.Length > 0); // Use DocumentXPathNodeIterator_ElemChildren_AndSelf_NoLocalName if localName == String.Empty
System\Xml\Dom\DomNameTable.cs (1)
26Debug.Assert((_entries.Length & _mask) == 0); // entries.Length must be a power of two
System\Xml\Dom\XmlAttribute.cs (3)
21Debug.Assert(name != null); 22Debug.Assert(doc != null); 54Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlAttributeCollection.cs (10)
194Debug.Assert(offset != -1); // the if statement above guarantees that the ref node is in the collection 223Debug.Assert(offset != -1); // the if statement above guarantees that the ref node is in the collection 303Debug.Assert(retNode is XmlAttribute); 319Debug.Assert(retNode is XmlAttribute); 386Debug.Assert(parentElem != null); 388Debug.Assert(doc != null); 403Debug.Assert(parentElem != null); 405Debug.Assert(doc != null); 418Debug.Assert(-1 == FindNodeOffset(node)); 421Debug.Assert(retNode is XmlAttribute);
System\Xml\Dom\XmlCDataSection.cs (1)
72Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlCharacterData.cs (1)
201Debug.Assert(XmlDocument.IsTextNode(n.NodeType) || (n.ParentNode != null && n.ParentNode.NodeType == XmlNodeType.EntityReference));
System\Xml\Dom\XmlComment.cs (1)
37Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlDeclaration.cs (1)
160Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlDocument.cs (12)
217Debug.Assert((prefix == null) ? (n.Prefix.Length == 0) : (prefix == n.Prefix)); 218Debug.Assert(n.LocalName == localName); 219Debug.Assert((namespaceURI == null) ? (n.NamespaceURI.Length == 0) : (n.NamespaceURI == namespaceURI)); 226Debug.Assert(n == null || ((prefix == null) ? (n.Prefix.Length == 0) : (prefix == n.Prefix))); 227Debug.Assert(n == null || n.LocalName == localName); 228Debug.Assert(n == null || ((namespaceURI == null) ? (n.NamespaceURI.Length == 0) : (n.NamespaceURI == namespaceURI))); 235Debug.Assert((prefix == null) ? (xmlName.Prefix.Length == 0) : (prefix == xmlName.Prefix)); 236Debug.Assert(xmlName.LocalName == localName); 237Debug.Assert((namespaceURI == null) ? (xmlName.NamespaceURI.Length == 0) : (xmlName.NamespaceURI == namespaceURI)); 977Debug.Assert(((XmlAttribute)node).Specified); 1042Debug.Assert(toNode.NodeType != XmlNodeType.EntityReference); 1772Debug.Assert(doc == this);
System\Xml\Dom\XmlDocumentFragment.cs (3)
109Debug.Assert(OwnerDocument != null); 155Debug.Assert(newChild != null); //should be checked that newChild is not null before this function call 171Debug.Assert(newChild != null); //should be checked that newChild is not null before this function call
System\Xml\Dom\XmlDocumentType.cs (2)
30Debug.Assert(doc != null); 61Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlElement.cs (5)
23Debug.Assert(name != null); 54Debug.Assert(OwnerDocument != null); 481Debug.Assert(n != null); 495Debug.Assert(n != null); 503Debug.Assert(n != null);
System\Xml\Dom\XmlElementList.cs (11)
29Debug.Assert(parent != null); 30Debug.Assert(parent.NodeType == XmlNodeType.Element || parent.NodeType == XmlNodeType.Document); 32Debug.Assert(parent.Document != null); 72Debug.Assert(parent.Document != null); 74Debug.Assert(nt != null); 83Debug.Assert(parent.Document != null); 85Debug.Assert(nt != null); 108Debug.Assert(curNode != null); 135Debug.Assert(curNode != null); 183Debug.Assert(n != null); 197Debug.Assert(n != null);
System\Xml\Dom\XmlEntityReference.cs (1)
84Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlLoader.cs (18)
57Debug.Assert(_reader != null); 58Debug.Assert(parentDoc != null); 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); 404Debug.Fail("Unknown reader name"); 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\XmlNamedNodeMap.SmallXmlNodeList.cs (1)
60Debug.Fail("Null was added to the collection which didn't expect it");
System\Xml\Dom\XmlNode.cs (10)
44Debug.Assert(doc != null); 56Debug.Assert(nodeIterator.Current != null); 128Debug.Assert(parentNode != null); 187Debug.Assert(parentNode != null); 791Debug.Assert(firstNode.NodeType == XmlNodeType.Text 809Debug.Assert(true, "shouldn't have fall through here."); 1433Debug.Assert(prevNode.IsText); 1434Debug.Assert(nextNode.IsText); 1441Debug.Assert(prevNode.IsText); 1442Debug.Assert(nextNode.IsText);
System\Xml\Dom\XmlNodeReader.cs (11)
110Debug.Assert(nt == XmlNodeType.XmlDeclaration || nt == XmlNodeType.DocumentType); 131Debug.Assert(_curNode.NodeType == XmlNodeType.XmlDeclaration || _curNode.NodeType == XmlNodeType.DocumentType); 136Debug.Assert(_nAttrInd >= 0 && _nAttrInd < AttributeCount); 214Debug.Assert(_curNode.NodeType == XmlNodeType.XmlDeclaration || _curNode.NodeType == XmlNodeType.DocumentType); 215Debug.Assert(_nAttrInd >= 0 && _nAttrInd < AttributeCount); 235Debug.Assert(nt == XmlNodeType.XmlDeclaration || nt == XmlNodeType.DocumentType); 236Debug.Assert(_nAttrInd >= 0 && _nAttrInd < AttributeCount); 608Debug.Assert(IsOnDeclOrDocType); 1053Debug.Assert(_curNode.NodeType == XmlNodeType.XmlDeclaration || _curNode.NodeType == XmlNodeType.DocumentType); 1082Debug.Assert(_curNode != null); 1627Debug.Assert(_curDepth == 0);
System\Xml\Dom\XmlProcessingInstruction.cs (1)
82Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlSignificantWhiteSpace.cs (1)
72Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlText.cs (1)
76Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlWhitespace.cs (1)
88Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XPathNodeList.cs (1)
49Debug.Assert(_nodeIterator.Current != null);
System\Xml\Ref.cs (1)
17Debug.Fail("Ref.Equal: Object comparison used for non-atomized string '" + strA + "'");
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 (6)
211Debug.Assert(_dstruct != null); 219Debug.Assert(_dstruct != null); 363Debug.Assert(arr1 != null); 378Debug.Assert(arr2 != null); 398Debug.Assert(dim > 0); 506Debug.Fail($"{nameof(other)} is not of type {nameof(KeySequence)}");
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 (37)
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 || 621Debug.Fail($"Unexpected token {token}"); 625Debug.Assert(_scanningFunction == ScanningFunction.SubsetContent); 1494Debug.Assert(idTokenType == Token.PUBLIC); 1656Debug.Fail($"Unexpected scanning function {_scanningFunction}"); 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); 3447Debug.Fail("This is an unexpected error that should have been handled in the ScanXXX methods."); 3528Debug.Assert(startPos < _charsUsed);
System\Xml\Schema\DtdParserAsync.cs (17)
136Debug.Assert(ParsingInternalSubset); 142Debug.Assert(_externalEntitiesDepth == 0); 163Debug.Assert(_readerAdapter.EntityStackLength == 0 || 233Debug.Assert(_curPos > 0 && _chars[_curPos - 1] == ']'); 245Debug.Assert(_readerAdapter.EntityStackLength == 0 || 265Debug.Fail($"Unexpected token {token}"); 269Debug.Assert(_scanningFunction == ScanningFunction.SubsetContent); 993Debug.Assert(_internalSubsetValueSb != null); 1021Debug.Assert(_internalSubsetValueSb != null); 1119Debug.Assert(idTokenType == Token.PUBLIC); 1283Debug.Fail($"Unexpected scanning function {_scanningFunction}"); 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 (6)
464Debug.Fail($"Unexpected facet type {facet.FacetType}"); 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 (10)
253Debug.Assert(_rootSchema != null, "rootSchema is null"); 278Debug.Assert(compiledAttributes != null); //AttributeUses is never null 483Debug.Assert(targetNS == null || targetNS.Length > 0, "targetns for schema is empty"); 1003Debug.Assert(elem.ElementDecl == null); 1202Debug.Assert(_xtr!.NodeType == XmlNodeType.Attribute); 1242Debug.Assert(ct != null); 1253Debug.Assert(ct != null); //either the user-defined type itself is a complex type or we switched from a simple type to a complex type 1257Debug.Assert(sce != null); 1733Debug.Fail("Expected type not matched"); 2379Debug.Fail("Expected date, time or dateTime");
System\Xml\Schema\NamespaceList.cs (7)
29Debug.Assert(targetNamespace != null); 69Debug.Assert(_set != null); 112Debug.Fail($"Unexpected type {_type}"); 157Debug.Fail($"Unexpected type {_type}"); 179Debug.Assert(super._type == ListType.Set); 197Debug.Assert(o1 != o2); 315Debug.Assert(o1 != o2); //clause 1
System\Xml\Schema\Parser.cs (8)
89Debug.Assert(_schemaType == SchemaType.XDR); 137Debug.Fail($"Unexpected root type {rootType}"); 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 (4)
304Debug.Assert(import != null); 704Debug.Fail($"Unexpected compositor {external.Compositor}"); 823Debug.Assert(_currentSchema != null); 977Debug.Assert((currentSchemaObject as XmlSchema) == null); // The current object should not be schema
System\Xml\Schema\SchemaCollectionCompiler.cs (9)
54Debug.Assert(!members.Contains(element)); 514Debug.Assert(group.CanonicalParticle != null); 1030Debug.Assert(baseType.ElementDecl.ContentValidator != null); 1403Debug.Fail("Unexpected particle"); 1859Debug.Assert(attribute.Use != XmlSchemaUse.Prohibited); 2252Debug.Assert(xe.ElementSchemaType != null); 2486Debug.Assert(particle == XmlSchemaParticle.Empty); 2531Debug.Assert(!p.IsEmpty); 2550Debug.Fail("Unexpected particle");
System\Xml\Schema\SchemaInfo.cs (1)
282Debug.Fail($"Unexpected match state {attributeMatchState}");
System\Xml\Schema\SchemaSetCompiler.cs (12)
128Debug.Assert(_schemaForSchema != null); 499Debug.Assert(examplar != null); //Headelement presence is checked while building subst groups 596Debug.Assert(group.CanonicalParticle != null); 1646Debug.Fail("Unexpected particle"); 2224Debug.Assert(attribute.Use != XmlSchemaUse.Prohibited); 2711Debug.Assert(xe.ElementSchemaType != null); 2730Debug.Assert(decl != null); 2912Debug.Assert(!((XmlSchemaParticle)particles[i]).IsEmpty); 2931Debug.Fail("Unexpected particle"); 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 (9)
169Debug.Assert(qname != null); //string representation is handled in a different overload 231default: Debug.Fail("Should never get here"); break; 253default: Debug.Fail("Should never get here"); break; 276default: Debug.Fail("Should never get here"); break; 300default: Debug.Fail("Should never get here"); break; 323default: Debug.Fail("Should never get here"); break; 346default: Debug.Fail("Should never get here"); break; 370default: Debug.Fail("Should never get here"); break; 392default: Debug.Fail("Should never get here"); break;
System\Xml\Schema\XmlSchema.cs (2)
226Debug.Assert(_isPreprocessed); 523Debug.Assert(extList != null && schema != null);
System\Xml\Schema\XmlSchemaComplexType.cs (1)
318System.Diagnostics.Debug.Fail("Should never call Clone() on XmlSchemaComplexType. Call Clone(XmlSchema) instead.");
System\Xml\Schema\XmlSchemaElement.cs (1)
273System.Diagnostics.Debug.Fail("Should never call Clone() on XmlSchemaElement. Call Clone(XmlSchema) instead.");
System\Xml\Schema\XmlSchemaException.cs (1)
83Debug.Assert(message == null || !message.StartsWith("Sch_", StringComparison.Ordinal), "Do not pass a resource here!");
System\Xml\Schema\XmlSchemaGroup.cs (1)
74System.Diagnostics.Debug.Fail("Should never call Clone() on XmlSchemaGroup. Call Clone(XmlSchema) instead.");
System\Xml\Schema\XmlSchemaObject.cs (4)
62get { Debug.Fail("Should not use base property"); return null; } 63set { Debug.Fail("Should not use base property"); } 72get { Debug.Fail("Should not use base property"); return null; } 73set { Debug.Fail("Should not use base property"); }
System\Xml\Schema\XmlSchemaObjectTable.cs (11)
21Debug.Assert(!_table.ContainsKey(name), "XmlSchemaObjectTable.Add: entry already exists"); 32Debug.Assert(oldValue != null); 34Debug.Assert(matchedIndex >= 0); 36Debug.Assert(_entries[matchedIndex].qname == name); 51Debug.Assert(oldValue != null); 53Debug.Assert(_entries[matchedIndex].qname == name); 71Debug.Assert(matchedIndex >= 0); 72Debug.Assert(_entries[matchedIndex].qname == name); 94Debug.Assert(_table.Count == _entries.Count); 195Debug.Assert(array.Length >= _size, "array is not big enough to hold all the items in the ICollection"); 248Debug.Assert(array.Length >= _size, "array is not big enough to hold all the items in the ICollection");
System\Xml\Schema\XmlSchemaSet.cs (2)
869Debug.Assert(ns != null); 880Debug.Assert(schema.BaseUri!.Equals(schemaUri));
System\Xml\Schema\XmlSchemaSimpleType.cs (1)
15Debug.Assert(SchemaContentType == XmlSchemaContentType.TextOnly);
System\Xml\Schema\XmlSchemaValidator.cs (40)
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); 2228Debug.WriteLine("Selector Match!"); 2229Debug.WriteLine($"Name: {localName}\t|\tURI: {namespaceUri}\n"); 2243Debug.WriteLine("Element Field Match!"); 2287Debug.WriteLine("Attribute Field Match!"); 2290Debug.WriteLine("Attribute Field Filling Value!"); 2291Debug.WriteLine($"Name: {name}\t|\tURI: {ns}\t|\tValue: {obj}\n"); 2300Debug.Assert(datatype != null); 2335Debug.WriteLine("Element Field Filling Value!"); 2336Debug.WriteLine($"Name: {localName}\t|\tURI: {namespaceUri}\t|\tValue: {typedValue}\n"); 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 (9)
235Debug.Assert(schemaType != null && datatype != null, "schemaType or schemaType.Datatype may not be null"); 242Debug.Assert(schemaType.Datatype!.Variety != XmlSchemaDatatypeVariety.List, "schemaType must be list's item type, not list itself"); 270Debug.Fail($"Type code {typeCode} is not supported."); 282Debug.Assert(_clrTypeDefault!.IsArray); 435Debug.Assert(_typeCode == XmlTypeCode.Item, "If SchemaType is null, then TypeCode may only be Item, Node, or AnyAtomicType"); 2919Debug.Assert(!(atomicConverter is XmlListConverter) || ((XmlListConverter)atomicConverter).atomicConverter == null, 3051Debug.Assert(enumSrc != null, "Value passed to ToArray must implement IEnumerable"); 3079Debug.Assert(enumSrc != null, "Value passed to ToArray must implement IEnumerable"); 3146Debug.Assert(schemaType.DerivedBy == XmlSchemaDerivationMethod.Union);
System\Xml\Schema\XsdBuilder.cs (7)
705Debug.Assert(_currentEntry.InitFunc != null); 708Debug.Assert(_xso != null); 967Debug.Fail($"State is {state}"); 1092Debug.Fail($"State is {state}"); 1333Debug.Fail($"Unexpected parent element {builder.ParentElement}"); 2376Debug.Fail($"Unexpected parent element {this.ParentElement}"); 2425Debug.Fail($"Unexpected parent element {this.ParentElement}");
System\Xml\Schema\XsdDateTime.cs (4)
180Debug.Assert(BitOperations.IsPow2((uint)kinds), "One and only one DateTime type code can be set."); 195Debug.Assert(dateTime.Kind == DateTimeKind.Local, $"Unknown DateTimeKind: {dateTime.Kind}"); 224Debug.Assert(BitOperations.IsPow2((uint)kinds), "Only one DateTime type code can be set."); 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 (9)
494Debug.Assert(attnDef.SchemaType != null); 926Debug.WriteLine("Selector Match!"); 927Debug.WriteLine($"Name: {reader.LocalName}\t|\tURI: {reader.NamespaceURI}\n"); 940Debug.WriteLine("Element Field Match!"); 985Debug.WriteLine("Attribute Field Match!"); 988Debug.WriteLine("Attribute Field Filling Value!"); 989Debug.WriteLine($"Name: {name}\t|\tURI: {ns}\t|\tValue: {obj}\n"); 1040Debug.WriteLine("Element Field Filling Value!"); 1041Debug.WriteLine($"Name: {reader.LocalName}\t|\tURI: {reader.NamespaceURI}\t|\tValue: {reader.TypedValueObject}\n");
System\Xml\Serialization\CodeGenerator.cs (36)
46System.Diagnostics.Debug.Assert(typeBuilder != null); 60Debug.Assert(iType.IsInterface); 66Debug.Fail("Interface not found"); 131System.Diagnostics.Debug.Assert(_argList != null && _argList.ContainsKey(name)); 137System.Diagnostics.Debug.Assert(_currentScope != null && _currentScope.ContainsKey(name)); 176System.Diagnostics.Debug.Fail("Variable not found"); 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); 787Debug.Fail("Char is not a valid schema primitive and should be treated as int in DataContract"); 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\Globals.cs (1)
16System.Diagnostics.Debug.Fail(msg);
System\Xml\Serialization\Mappings.cs (4)
754Debug.Assert(a1 != null); 755Debug.Assert(a2 != null); 867Debug.Assert(m1 != null); 868Debug.Assert(m2 != null);
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (5)
625Debug.Assert(o != null, "Object o should not be null"); 626Debug.Assert(!string.IsNullOrEmpty(memberName), "memberName must have a value"); 637Debug.Assert(memberInfo != null, "memberInfo could not be retrieved"); 1269Debug.Assert(!mapping.IsSoap, "mapping.IsSoap was true. Use WriteEnumMethodSoap for reading SOAP encoded enum value."); 1918Debug.Assert(xmlnsMember.XmlnsSource != null, "Xmlns member's source was not set.");
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (6)
172Debug.Assert(a != null); 296Debug.Assert(o is byte[]); 813Debug.Assert(ai is byte[]); 1034Debug.Fail("https://github.com/dotnet/runtime/issues/18037: Add More Tests for Serialization Code"); 1053Debug.Fail("https://github.com/dotnet/runtime/issues/18037: Add More Tests for Serialization Code"); 1058Debug.Fail("https://github.com/dotnet/runtime/issues/18037: Add More Tests for Serialization Code");
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\XmlSerializationWriter.cs (2)
410Debug.Assert(tryFormatResult.Value, "Something goes wrong with formatting primitives to the buffer."); 414Debug.Assert(!span.Slice(0, charsWritten).ContainsAny(escapeChars), "Primitive value contains illegal xml char.");
System\Xml\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 (5)
92Debug.Assert(message == null || !message.StartsWith("Xml_", StringComparison.Ordinal), "Do not pass a resource here!"); 227Debug.Assert(invCharIndex < data.Length); 228Debug.Assert(invCharIndex < length); 229Debug.Assert(length <= data.Length); 294Debug.Assert(e != null, "Unexpected null exception");
System\Xml\XmlNamespacemanager.cs (18)
102Debug.Assert(_nsdecls != null); 108Debug.Assert(_hashTable != null); 113Debug.Assert(decl >= 2); 126Debug.Assert(_nameTable != null); 127Debug.Assert(_nsdecls != null); 170Debug.Assert(_hashTable != null); 177Debug.Assert(_hashTable == null); 193Debug.Assert(_nsdecls != null); 208Debug.Assert(_nsdecls != null); 226Debug.Assert(_nsdecls != null); 242Debug.Assert(i >= 2); 253Debug.Assert(prefix != null); 274Debug.Assert(_nsdecls != null); 281Debug.Assert(_nsdecls != null); 285Debug.Assert(_hashTable != null); 322Debug.Assert(_nsdecls != null); 341Debug.Assert(_nsdecls != null); 367Debug.Assert(_nsdecls != null);
System\Xml\XPath\Internal\AbsoluteQuery.cs (1)
16Debug.Assert(context.Current != null);
System\Xml\XPath\Internal\AttributeQuery.cs (2)
42Debug.Assert(currentNode != null); 48Debug.Assert(!currentNode.NamespaceURI.Equals(XmlReservedNs.NsXmlNs));
System\Xml\XPath\Internal\Axis.cs (2)
39Debug.Assert(prefix != null); 40Debug.Assert(name != null);
System\Xml\XPath\Internal\BaseAxisQuery.cs (4)
34Debug.Assert(qyInput != null); 64Debug.Assert(context != null); 89Debug.Assert(_nsUri != null); 120Debug.Assert(this is AttributeQuery || this is ChildrenQuery);
System\Xml\XPath\Internal\BooleanExpr.cs (2)
19Debug.Assert(op == Operator.Op.AND || op == Operator.Op.OR); 20Debug.Assert(opnd1 != null && opnd2 != null);
System\Xml\XPath\Internal\BooleanFunctions.cs (2)
65Debug.Assert(result is XPathNavigator, "Unknown value type"); 79Debug.Assert(nodeIterator.Current != null);
System\Xml\XPath\Internal\CacheAxisQuery.cs (2)
40Debug.Assert(0 <= count && count <= outputBuffer.Count); 52Debug.Assert(0 <= count && count <= outputBuffer.Count);
System\Xml\XPath\Internal\CacheOutputQuery.cs (2)
51Debug.Assert(0 <= count && count <= outputBuffer.Count); 63Debug.Assert(0 <= count && count <= outputBuffer.Count);
System\Xml\XPath\Internal\CompiledXPathExpr.cs (2)
46Debug.Assert(_query != null, "In case of error in XPath we create ErrorXPathExpression"); 124Debug.Assert(prefix != null);
System\Xml\XPath\Internal\DescendantoverDescendantQuery.cs (4)
63Debug.Assert(currentNode != null); 75Debug.Assert(currentNode != null); 86Debug.Assert(currentNode != null); 95Debug.Assert(result, "Algorithm error, We always should be able to move up if level > 0");
System\Xml\XPath\Internal\FilterQuery.cs (1)
71Debug.Assert(value is XPathNavigator, "Unknown value type");
System\Xml\XPath\Internal\ForwardPositionQuery.cs (1)
13Debug.Assert(input != null);
System\Xml\XPath\Internal\FunctionQuery.cs (3)
77Debug.Assert(nodeIterator.Current != null); 83Debug.Assert(_function != null); 87Debug.Assert(retVal != null);
System\Xml\XPath\Internal\IdQuery.cs (1)
18Debug.Assert(context.Current != null);
System\Xml\XPath\Internal\IteratorFilter.cs (1)
36Debug.Assert(_innerIterator.Current != null);
System\Xml\XPath\Internal\LogicalExpr.cs (8)
19Debug.Assert( 70Debug.Assert(cmp != null); 97Debug.Assert(op == Operator.Op.EQ || op == Operator.Op.NE); 130Debug.Assert( 254Debug.Assert(op == Operator.Op.EQ || op == Operator.Op.NE, 328Debug.Fail("Unexpected Operator.op code in cmpNumberNumber()"); 340Debug.Fail("Unexpected Operator.op code in cmpNumberNumber()"); 366Debug.Assert(op == Operator.Op.EQ || op == Operator.Op.NE,
System\Xml\XPath\Internal\MergeFilterQuery.cs (1)
62Debug.Assert(current != null);
System\Xml\XPath\Internal\NamespaceQuery.cs (2)
58Debug.Assert(e.NodeType == XPathNodeType.Namespace); 61Debug.Assert(e.LocalName.Length == 0, "Only xmlns='' can have empty string as a value");
System\Xml\XPath\Internal\NumberFunctions.cs (5)
58Debug.Assert(nodeIterator!.Current != null); 86Debug.Assert(_arg != null); 98Debug.Assert(_arg != null); 104Debug.Assert(_arg != null); 110Debug.Assert(_arg != null);
System\Xml\XPath\Internal\NumericExpr.cs (3)
19Debug.Assert( 24Debug.Assert(opnd1 != null && opnd2 != null); 59Debug.Assert(op == Operator.Op.PLUS || op == Operator.Op.MINUS || op == Operator.Op.MOD || op == Operator.Op.DIV || op == Operator.Op.MUL);
System\Xml\XPath\Internal\Operator.cs (1)
49Debug.Assert(Op.EQ <= op && op <= Op.GE);
System\Xml\XPath\Internal\PrecedingQuery.cs (2)
85Debug.Assert(qyInput.Advance() == null, "we read all qyInput.Advance() already"); 96Debug.Fail("Algorithm error: we missed the sentinel node");
System\Xml\XPath\Internal\PreSiblingQuery.cs (2)
67Debug.Assert(test, "We just moved to parent, how we can not have first child?"); 76Debug.Fail("We managed to miss sentinel node (input)");
System\Xml\XPath\Internal\Query.cs (2)
147Debug.Assert(0 <= l && l < r); 191Debug.Assert(value is XPathNavigator, "Unknown value type");
System\Xml\XPath\Internal\QueryBuilder.cs (4)
420Debug.Assert(root.Prefix != null); 421Debug.Assert(root.Name != null); 464Debug.Assert(root != null, "root != null"); 494Debug.Fail("Unknown QueryType encountered!!");
System\Xml\XPath\Internal\SortQuery.cs (9)
22Debug.Assert(qyInput != null, "Sort Query needs an input query tree to work on"); 54Debug.Assert(numSorts > 0, "Why was the sort query created?"); 82Debug.Assert(0 <= count && count <= _results.Count); 94Debug.Assert(0 <= count && count <= _results.Count); 159Debug.Assert(_expressions.Length == _comparers.Length); 160Debug.Assert(0 < _expressions.Length); 161Debug.Assert(0 <= _numSorts && _numSorts <= _expressions.Length); 175Debug.Assert(_numSorts < _expressions.Length); 197Debug.Assert(x != null && y != null, "Oops!! what happened?");
System\Xml\XPath\Internal\StringFunctions.cs (11)
22Debug.Assert(argList != null, "Use 'new Query[]{}' instead."); 91Debug.Assert(GetXPathType(argVal) == XPathResultType.Number); 95Debug.Assert(nodeIterator.Current != null); 131Debug.Assert(_argList.Count > 1); 139Debug.Assert(_argList.Count > 1); 147Debug.Assert(_argList.Count > 1); 157Debug.Assert(_argList.Count > 1); 167Debug.Assert(_argList.Count > 0); 212Debug.Assert(nodeIterator!.Current != null); 225Debug.Assert(nodeIterator!.Current != null); 257Debug.Assert(_argList.Count > 2);
System\Xml\XPath\Internal\VariableQuery.cs (2)
48Debug.Assert(_variable != null); 52Debug.Assert(retVal != null);
System\Xml\XPath\Internal\XPathArrayIterator.cs (3)
35Debug.Assert(nodeIterator.Current != null); 54Debug.Assert(index <= list.Count); 69Debug.Assert(index <= list.Count);
System\Xml\XPath\Internal\XPathMultyIterator.cs (5)
26Debug.Assert(iterator != null); 69Debug.Assert(firstNotEmpty <= item && item < arr.Length); 74Debug.Assert(it.Current != null && itNext.Current != null); 127Debug.Assert(position != 0, "MoveNext() wasn't called"); 128Debug.Assert(firstNotEmpty < arr.Length, "MoveNext() returned false");
System\Xml\XPath\Internal\XPathParser.cs (5)
415Debug.Assert(nodeType != XPathNodeType.Root); 464Debug.Assert(IsPrimaryExpr); 498Debug.Assert(opnd != null, "IsPrimaryExpr() was true. We should recognize this lex."); 655Debug.Assert(_scanner.CanBeFunction); 867Debug.Assert(_scanner.Kind == XPathScanner.LexKind.Axe);
System\Xml\XPath\Internal\XPathScanner.cs (19)
43Debug.Assert(0 <= _xpathExprIndex && _xpathExprIndex <= _xpathExpr.Length); 64Debug.Assert(_kind == LexKind.Name || _kind == LexKind.Axe); 65Debug.Assert(_name != null); 74Debug.Assert(_kind == LexKind.Name); 75Debug.Assert(_prefix != null); 84Debug.Assert(_kind == LexKind.String); 85Debug.Assert(_stringValue != null); 94Debug.Assert(_kind == LexKind.Number); 95Debug.Assert(!double.IsNaN(_numberValue)); 106Debug.Assert(_kind == LexKind.Name); 122Debug.Assert(XmlCharType.IsWhiteSpace(CurrentChar)); 277Debug.Assert(CurrentChar == '.' || char.IsAsciiDigit(CurrentChar)); 297Debug.Assert(char.IsAsciiDigit(CurrentChar)); 299Debug.Assert(0 <= start && _xpathExpr[start] == '.'); 322Debug.Assert(CurrentChar == endChar); 331Debug.Assert(!span.IsEmpty); 332Debug.Assert(span[0] == CurrentChar); 333Debug.Assert(XmlCharType.IsStartNCNameSingleChar(span[0])); 334Debug.Assert(XmlCharType.IsNCNameSingleChar(span[0]));
System\Xml\XPath\Internal\XPathSingletonIterator.cs (1)
16Debug.Assert(nav != null);
System\Xml\XPath\XPathDocument.cs (5)
178Debug.Assert((object?)_nameTable.Get(string.Empty) == (object)string.Empty, "NameTable must contain atomized string.Empty"); 210Debug.Assert(reader.LocalName == "xmlns"); 215Debug.Assert(reader.Prefix == "xmlns"); 385Debug.Assert(pageElem[idxElem].NodeType == XPathNodeType.Element && pageNmsp[idxNmsp].NodeType == XPathNodeType.Namespace); 398Debug.Assert(pageElem[idxElem].NodeType == XPathNodeType.Element);
System\Xml\XPath\XPathNavigator.cs (11)
970Debug.Assert(CompareSiblings(n1.Clone(), n2.Clone()) != CompareSiblings(n2.Clone(), n1.Clone()), "IsSamePosition() on custom navigator returns inconsistent results"); 1039Debug.Assert(schemaType != null || this.NodeType == XPathNodeType.Root, "schemaType != null || this.NodeType == XPathNodeType.Root"); 1067Debug.Assert(schemas != null, "schemas != null"); 1091Debug.Assert(args != null); 1191Debug.Assert(context.Current != null); 1821Debug.Assert(!n1.IsSamePosition(n2)); 1823Debug.Assert(p1.MoveToParent() && p2.MoveToParent() && p1.IsSamePosition(p2)); 2055Debug.Assert(reader.LocalName == "xmlns"); 2060Debug.Assert(reader.Prefix == "xmlns"); 2116Debug.Assert(reader.LocalName == "xmlns"); 2121Debug.Assert(reader.Prefix == "xmlns");
System\Xml\XPath\XPathNavigatorReader.cs (6)
515Debug.Assert(value == null); 641Debug.Assert(XPathNodeType.Namespace == _nav.NodeType); 664Debug.Fail("Couldn't find Namespace Node! Should not happen!"); 1028Debug.Assert(_nav.NodeType == XPathNodeType.Element, $"{_nav.NodeType} == XPathNodeType.Element"); 1266Debug.Fail("This shouldn't be called."); 1277Debug.Fail("This shouldn't be called.");
System\Xml\XPath\XPathNodeIterator.cs (1)
66Debug.Assert(_current.Current != null);
System\Xml\Xsl\IlGen\GenerateHelper.cs (27)
116Debug.Assert(seqEmpty != null, "Field `Empty` could not be found"); 879Debug.Fail("Shouldn't be called"); 896Debug.Assert(clrTypeDst == typeof(object), "Invalid cast, since value types do not allow inheritance."); 902Debug.Assert(clrTypeSrc == typeof(object), "Invalid cast, since value types do not allow inheritance."); 910Debug.Assert(clrTypeSrc.IsAssignableFrom(clrTypeDst) || clrTypeDst.IsAssignableFrom(clrTypeSrc), 967default: Debug.Fail($"{opType} must be an arithmetic operation."); break; 980default: Debug.Fail($"{opType} must be an arithmetic operation."); break; 987Debug.Fail($"The {opType} arithmetic operation cannot be performed on values of type {code}."); 1002Debug.Fail($"Type {code} does not support the equals operation."); 1018Debug.Fail($"Type {code} does not support the equals operation."); 1098Debug.Assert(nameType == GenerateNameType.TagNameAndNamespace); 1134Debug.Assert(_locXOut != null); 1197default: Debug.Fail($"{nameType} is invalid here."); break; 1207default: Debug.Fail($"{nameType} is invalid here."); break; 1231default: Debug.Fail($"{nameType} is invalid here."); break; 1260default: Debug.Fail($"{nameType} is invalid here."); break; 1270default: Debug.Fail($"{nameType} is invalid here."); break; 1411Debug.Assert(keyType.IsAtomicValue, "Sort key must have atomic value type."); 1430Debug.Fail("Heterogenous sort key is not allowed."); 1434Debug.Fail($"Sorting over datatype {keyType.TypeCode} is not allowed."); 1468Debug.Assert(_isDebug && _lastSourceInfo != null); 1469Debug.Assert(sourceInfo != null); 1501Debug.Assert(_module.EmitSymbols); 1613Debug.Assert(opcode.OperandType == OperandType.InlineI || opcode.OperandType == OperandType.InlineVar); 1623Debug.Assert(opcode.OperandType == OperandType.InlineI8); 1633Debug.Assert(!opcode.Equals(OpCodes.Br) && !opcode.Equals(OpCodes.Br_S), "Use EmitUnconditionalBranch and be careful not to emit unverifiable code."); 1734Debug.Assert(opcode.Equals(OpCodes.Brtrue) || opcode.Equals(OpCodes.Brtrue_S) ||
System\Xml\Xsl\IlGen\IteratorDescriptor.cs (10)
99Debug.Assert(loc.LocalType == itemStorageType || 116Debug.Assert(currentMethod.ReturnType == itemStorageType, 131Debug.Assert(methGlobal.ReturnType == itemStorageType || 334Debug.Assert(_hasNext); 403Debug.Assert(_storage.IsCached); 476Debug.Assert(brctxt != BranchingContext.None); 545Debug.Fail($"Invalid location: {_storage.Location}"); 574Debug.Fail($"Invalid location: {_storage.Location}"); 678Debug.Assert(_storage.ItemStorageType == typeof(XPathItem) || storageTypeDest == typeof(XPathItem), 722Debug.Assert(storageTypeDest == typeof(XPathItem), "Must be converting from XPathNavigator to XPathItem");
System\Xml\Xsl\IlGen\OptimizerPatterns.cs (7)
209Debug.Assert(!_isReadOnly, "This OptimizerPatterns instance is read-only."); 217Debug.Fail("Cannot handle more than 2 arguments."); 236Debug.Assert(arg != null, $"There is no '{argNum}' argument."); 245Debug.Assert(Enum.IsDefined(pattern)); 246Debug.Assert((int)pattern < 32); 247Debug.Assert(!_isReadOnly, "This OptimizerPatterns instance is read-only."); 256Debug.Assert(Enum.IsDefined(pattern));
System\Xml\Xsl\IlGen\StaticDataManager.cs (2)
119Debug.Assert(ndNmspDecl != null); 120Debug.Assert(ndNmspDecl.Left is QilLiteral && ndNmspDecl.Right is QilLiteral);
System\Xml\Xsl\IlGen\TailCallAnalyzer.cs (1)
36Debug.Assert(XmlILConstructInfo.Read(nd).PushToWriterLast,
System\Xml\Xsl\IlGen\XmlILConstructAnalyzer.cs (30)
130Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 143Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 156Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 169Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 182Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 195Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 196Debug.Assert(value); 219Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 220Debug.Assert(value); 243Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 244Debug.Assert(value); 268Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 297Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 311Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 325Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 339Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 353Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 442Debug.Assert(ndContent != null); 491case QilNodeType.NamespaceDecl: Debug.Assert(ndContent == null); break; 492case QilNodeType.TextCtor: Debug.Assert(ndContent == null); break; 493case QilNodeType.RawTextCtor: Debug.Assert(ndContent == null); break; 497case QilNodeType.XsltCopyOf: Debug.Assert(ndContent == null); break; 501default: Debug.Fail($"{ndConstr.NodeType} is not handled by XmlILStateAnalyzer."); break; 715Debug.Assert(!typ.IsSingleton); 751Debug.Assert(!typ.IsSingleton); 801Debug.Assert(ndElem!.NodeType == QilNodeType.ElementCtor); 839Debug.Assert(binaryNode != null); 858Debug.Assert(ndName != null); 1059Debug.Assert(nd.NodeType == QilNodeType.NamespaceDecl); 1095Debug.Assert(nd.NodeType != QilNodeType.NamespaceDecl || !_nsmgr.HasNamespace(prefix) || _nsmgr.LookupNamespace(prefix) == ns,
System\Xml\Xsl\IlGen\XmlILModule.cs (4)
79Debug.Assert(!(useLRE && emitSymbols)); 211Debug.Assert(!_useLRE, "Cannot create initialized data for an LRE module"); 220Debug.Assert(!_useLRE, "Cannot create field for an LRE module"); 229Debug.Assert(!_useLRE, "Cannot create type initializer for an LRE module");
System\Xml\Xsl\IlGen\XmlILOptimizerVisitor.cs (6)
5297Debug.Assert(nd is QilLiteral, "All literals except True, False, and QName must use QilLiteral"); 5432Debug.Assert(left.XmlType == right.XmlType, $"Comparison is not defined between {left.XmlType} and {right.XmlType}"); 5469Debug.Fail($"Cannot fold this comparison operation: {opType}"); 5489Debug.Assert(left.NodeType == right.NodeType); 5581Debug.Fail($"Cannot fold this arithmetic operation: {opType}"); 5639Debug.Assert(nd.NodeType == QilNodeType.Let || nd.NodeType == QilNodeType.Parameter, "Unexpected type of a global");
System\Xml\Xsl\IlGen\XmlIlVisitor.cs (90)
76Debug.Assert(_iterCurr.Storage.Location == ItemLocation.None, "Root expression should have been pushed to the writer."); 93Debug.Assert(iter.NodeType == QilNodeType.Let || iter.NodeType == QilNodeType.Parameter); 97Debug.Assert(methGlobal != null, "Metadata for global value should have already been computed"); 149Debug.Assert(iter.XmlType == TypeFactory.ItemS, "IlGen currently only supports parameters of type item*."); 193Debug.Assert(iter.NodeType == QilNodeType.Parameter, "Only parameters may not have a default value"); 223Debug.Assert(iter.NodeType == QilNodeType.Parameter); 253Debug.Assert(iter.XmlType == TypeFactory.ItemS, "IlGen currently only supports default values in parameters of type item*."); 318Debug.Assert(nd.XmlType!.IsSingleton || CachesResult(nd) || _iterCurr.HasLabelNext, 336Debug.Fail($"Visit{parent.NodeType} should never be called"); 758Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None); 843Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None); 909Debug.Assert(info.ConstructMethod == XmlILConstructMethod.Iterator); 912Debug.Assert(ndCond.Left.XmlType!.TypeCode == XmlTypeCode.Boolean); 949Debug.Assert(!ndCond.Center.XmlType!.IsSingleton || !ndCond.Right.XmlType!.IsSingleton); 981Debug.Assert(ndBranch.XmlType!.IsSingleton, "Conditional must produce a singleton"); 986Debug.Assert(itemStorageType == typeof(bool)); 1012Debug.Assert(XmlILConstructInfo.Read(ndChoice).PushToWriterFirst); 1144Debug.Assert(XmlILConstructInfo.Read(nd).PullFromIteratorFirst, "VisitEmpty should only be called if items are iterated"); 1165Debug.Assert(XmlILConstructInfo.Read(ndSeq).ConstructMethod == XmlILConstructMethod.Iterator, "This method should only be called if items in list are pulled from a code iterator."); 1509Debug.Assert(!ndStrConcat.Values.XmlType!.IsSingleton, "Optimizer should have folded StrConcat of a singleton value"); 1630Debug.Assert(ndParsedTagName.Right.XmlType.IsSingleton); 1713Debug.Assert(ndComp.Left.XmlType!.IsAtomicValue && ndComp.Right.XmlType!.IsAtomicValue, "Operands to compare must be atomic values."); 1714Debug.Assert(ndComp.Left.XmlType.IsSingleton && ndComp.Right.XmlType.IsSingleton, "Operands to compare must be cardinality one."); 1715Debug.Assert(ndComp.Left.XmlType == ndComp.Right.XmlType, "Operands to compare may not be heterogenous."); 1753Debug.Assert(code != XmlTypeCode.QName, $"QName values do not support the {relOp} operation"); 1772Debug.Fail($"Comparisons for datatype {code} are invalid."); 2030Debug.Fail($"Pattern {step.NodeType} should have been handled."); 2110Debug.Assert(ndIter != null); 2123Debug.Assert(ndIter.NodeType == QilNodeType.Let || ndIter.NodeType == QilNodeType.Parameter); 2124Debug.Assert(!patt.MatchesPattern(OptimizerPatternName.IsPositional)); 2141Debug.Assert(ndFor.XmlType!.IsSingleton); 2203Debug.Assert(!ndLet.XmlType!.IsSingleton); 2234Debug.Assert(ndIter != null); 2248Debug.Assert(ndIter.NodeType == QilNodeType.For); 2251Debug.Assert(locPos != null); 2265Debug.Assert(ndSort.Variable.NodeType == QilNodeType.For); 2286Debug.Assert(!_iterNested!.Storage.IsCached); 2330Debug.Assert(ndKey.Key.XmlType!.IsAtomicValue, "Sort key must be an atomic value."); 2437Debug.Assert(pattStep.MatchesPattern(OptimizerPatternName.Axis), "Dod patterns should only match if step is FilterElements or FilterKindTest or Axis"); 2474Debug.Fail($"Pattern {step.NodeType} should have been handled."); 2500Debug.Fail($"Pattern {step.NodeType} should have been handled."); 2523Debug.Assert(_iterCurr.Storage.IsCached, "DodMerge pattern should only be matched when cached sequences are returned from loop"); 2552Debug.Assert(!XmlILConstructInfo.Read(ndInvoke).PushToWriterFirst || useWriter); 2600Debug.Assert(ndName != null, "Attribute node must have a literal QName as its second argument"); 2780Debug.Assert(XmlILConstructInfo.Read(ndElem).PushToWriterFirst, "Element construction should always be pushed to writer."); 2830Debug.Assert(XmlILConstructInfo.Read(ndAttr).PushToWriterFirst, "Attribute construction should always be pushed to writer."); 2864Debug.Assert(XmlILConstructInfo.Read(ndComment).PushToWriterFirst, "Comment construction should always be pushed to writer."); 2884Debug.Assert(XmlILConstructInfo.Read(ndPI).PushToWriterFirst, "PI construction should always be pushed to writer."); 2924Debug.Assert(info.PushToWriterFirst, "Text construction should always be pushed to writer."); 2984Debug.Assert(XmlILConstructInfo.Read(ndDoc).PushToWriterFirst, "Document root construction should always be pushed to writer."); 3007Debug.Assert(info.PushToWriterFirst, "Namespace construction should always be pushed to writer."); 3137Debug.Fail($"Unexpected node type {ndProp.NodeType}"); 3181Debug.Assert(!typDerived!.NeverSubtypeOf(typBase), "Normalizer should have eliminated IsType where source can never be a subtype of destination type."); 3187Debug.Assert(_iterCurr.Storage.ItemStorageType == typeof(XPathItem), "If !IsNode, then storage type should be Item"); 3263Debug.Assert((typDerived.NodeKinds & kinds) != XmlNodeKindFlags.None, "Normalizer should have taken care of case where node kinds are disjoint."); 3375Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None); 3439Debug.Assert(ndVal.Child.XmlType!.IsNode, "XPathNodeValue node may only be applied to a sequence of Nodes."); 3562Debug.Assert(XmlILConstructInfo.Read(ndInvoke).ConstructMethod != XmlILConstructMethod.Writer); 3649Debug.Assert(ndActualArg.XmlType!.IsSubtypeOf(xmlTypeFormalArg), "Xml type of actual arg must be a subtype of the Xml type of the formal arg"); 3681Debug.Fail($"Internal Xslt library may not use parameters of type {clrTypeFormalArg}"); 3745Debug.Assert(XmlILConstructInfo.Read(ndCopy).PushToWriterFirst); 3751Debug.Assert(ndCopy.Left.XmlType!.IsNode); 3763Debug.Assert(ndCopy.Left.XmlType.IsNode); 3779Debug.Assert(XmlILConstructInfo.Read(ndCopyOf).PushToWriterFirst, "XsltCopyOf should always be pushed to writer."); 3811Debug.Fail($"Conversion from {ndConv.Source.XmlType} to {ndConv.TargetType} is not supported."); 3988Debug.Assert(ndDod.NodeType == QilNodeType.DocOrderDistinct && ndLoop != null); 4105Debug.Assert(ndName.XmlType!.TypeCode == XmlTypeCode.QName, "Element or attribute name must have QName type."); 4124Debug.Assert(ValidateNames.ValidateName(prefix, localName, ns, nodeType, ValidateNames.Flags.AllExceptPrefixMapping)); 4201Debug.Assert(relOp == QilNodeType.Eq || relOp == QilNodeType.Ne); 4240Debug.Assert(relOp == QilNodeType.Eq || relOp == QilNodeType.Ne); 4267Debug.Assert(ndSecond.NodeType == QilNodeType.NameOf); 4309default: Debug.Fail($"Unexpected rel op {relOp}"); opcode = OpCodes.Nop; break; 4322default: Debug.Fail($"Unexpected rel op {relOp}"); opcode = OpCodes.Nop; break; 4338default: Debug.Fail($"Unexpected rel op {relOp}"); opcode = OpCodes.Nop; break; 4345Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None); 4357default: Debug.Fail($"Unexpected rel op {relOp}"); opcode = OpCodes.Nop; break; 4378Debug.Assert(relOp == QilNodeType.Eq || relOp == QilNodeType.Ne); 4398Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None); 4583Debug.Assert(xmlTypes == XmlNodeKindFlags.PI); 4604Debug.Fail($"Cannot map QilNodeType {typ} to an XPathNodeType"); 4616Debug.Assert(xmlTypes == XmlNodeKindFlags.Element); 4623Debug.Assert(!isXmlTypeUnion || (xmlTypes & XmlNodeKindFlags.Content) == XmlNodeKindFlags.Content); 4694Debug.Assert(_iterCurr.Storage.Location == ItemLocation.None || 4772Debug.Assert(!XmlILConstructInfo.Read(nd).PushToWriterLast); 4786Debug.Assert(!XmlILConstructInfo.Read(nd).PushToWriterLast); 4805Debug.Assert(!XmlILConstructInfo.Read(nd).PushToWriterLast); 4815Debug.Assert(!XmlILConstructInfo.Read(nd).PushToWriterLast); 4825Debug.Assert(nd.XmlType!.IsSingleton && !XmlILConstructInfo.Read(nd).PushToWriterLast); 4839Debug.Assert(!XmlILConstructInfo.Read(nd).PushToWriterLast); 4853Debug.Assert(_iterCurr.Storage.IsCached, "Expression result should be cached. CachesResult() might have a bug in it.");
System\Xml\Xsl\QIL\QilList.cs (1)
58Debug.Assert(!xt.IsDod, "Sequences do not preserve DocOrderDistinct");
System\Xml\Xsl\QIL\QilPatternFactory.cs (8)
26Debug.Assert(f != null); 228Debug.Assert(arg != null, "Argument shouldn't be null"); 229Debug.Assert(arg.XmlType!.TypeCode == XmlTypeCode.Boolean && arg.XmlType.IsSingleton, 595Debug.Assert(args.NodeType == QilNodeType.FormalParameterList); 600Debug.Assert(args.NodeType == QilNodeType.FormalParameterList); 606Debug.Assert(args.NodeType == QilNodeType.ActualParameterList); 607Debug.Assert(func.Arguments.Count == args.Count); 770Debug.Assert(t != null, "Type can't be null");
System\Xml\Xsl\QIL\QilReplaceVisitor.cs (1)
81Debug.Assert(newType.IsSubtypeOf(XmlQueryTypeFactory.AtMost(oldType, oldType.Cardinality)), "Replace shouldn't relax original type");
System\Xml\Xsl\QIL\QilValidationVisitor.cs (2)
36Debug.Assert(node != null); 185Debug.Fail(message);
System\Xml\Xsl\QIL\SubstitutionList.cs (1)
51Debug.Assert(_s.Count % 2 == 0);
System\Xml\Xsl\QIL\WhitespaceRule.cs (1)
77Debug.Assert(this.GetType() == typeof(WhitespaceRule), "Serialization of WhitespaceRule subclasses is not implemented");
System\Xml\Xsl\QueryReaderSettings.cs (1)
26Debug.Assert(xmlNameTable != null);
System\Xml\Xsl\Runtime\ContentIterators.cs (3)
116Debug.Assert(nodeType != XPathNodeType.Attribute && nodeType != XPathNodeType.Namespace); 418Debug.Fail($"Invalid IteratorState {_state}"); 440Debug.Assert(_state == IteratorState.HaveCurrentHaveNext);
System\Xml\Xsl\Runtime\DecimalFormatter.cs (3)
43Debug.Assert(formatPicture != null && decimalFormat != null); 266Debug.Assert(i + 1 < result.Length); 268Debug.Assert(char.IsAsciiDigit(ch) || ch == EscChar);
System\Xml\Xsl\Runtime\DocumentOrderComparer.cs (1)
40Debug.Assert(GetDocumentIndex(navThis) != GetDocumentIndex(navThat!));
System\Xml\Xsl\Runtime\DodSequenceMerge.cs (1)
94Debug.Assert(_sequencesToMerge.Count == 1, "While loop should terminate when count == 1");
System\Xml\Xsl\Runtime\EarlyBoundInfo.cs (2)
22Debug.Assert(namespaceUri != null && ebType != null); 28Debug.Assert(_constrInfo != null, $"The early bound object type {ebType.FullName} must have a public default constructor");
System\Xml\Xsl\Runtime\NumberFormatter.cs (3)
81Debug.Assert(1 <= val && val <= MaxAlphabeticValue); 82Debug.Assert(Math.Pow(totalChars, MaxAlphabeticLength) >= MaxAlphabeticValue); 104Debug.Assert(1 <= val && val <= MaxRomanValue);
System\Xml\Xsl\Runtime\SetIterators.cs (2)
213Debug.Assert(nestedNavigator == null, "null is passed to MoveNext after IteratorState.HaveCurrent has been returned."); 313Debug.Assert(nestedNavigator == null, "null is passed to MoveNext after IteratorState.HaveCurrent has been returned.");
System\Xml\Xsl\Runtime\StringConcat.cs (1)
55Debug.Assert(value != null);
System\Xml\Xsl\Runtime\TreeIterators.cs (4)
498Debug.Assert(_state == IteratorState.HaveCurrentHaveNext || _state == IteratorState.HaveCurrentNoNext); 523Debug.Assert(_state == IteratorState.HaveCurrentHaveNext || _state == IteratorState.HaveCurrentNoNext); 834Debug.Assert(_state == IteratorState.HaveCurrentHaveNext || _state == IteratorState.HaveCurrentNoNext); 930Debug.Assert(_state == IteratorState.NoNext, $"Illegal state: {_state}");
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 (13)
87Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 96Debug.Assert(_numEntries != 0); 144Debug.Assert(text != null); 145Debug.Assert(_arrAttrs != null && _numEntries != 0); 156Debug.Assert(value is XmlAtomicValue, "value should always be an XmlAtomicValue, as XmlAttributeCache is only used by XmlQueryOutput"); 157Debug.Assert(_arrAttrs != null && _numEntries != 0); 176Debug.Fail("Should never be called on XmlAttributeCache."); 180Debug.Fail("Should never be called on XmlAttributeCache."); 184Debug.Fail("Should never be called on XmlAttributeCache."); 188Debug.Fail("Should never be called on XmlAttributeCache."); 192Debug.Fail("Should never be called on XmlAttributeCache."); 197Debug.Fail("Should never be called on XmlAttributeCache."); 361Debug.Assert(_numEntries == _arrAttrs.Length);
System\Xml\Xsl\Runtime\XmlCollation.cs (3)
104Debug.Assert(((int)value & Mask) == 0); 156Debug.Assert(collationLiteral != null, "collation literal should not be null"); 379Debug.Assert(_cultInfo == null || _cultInfo.Equals(new CultureInfo(_cultInfo.Name)),
System\Xml\Xsl\Runtime\XmlExtensionFunction.cs (4)
221Debug.Assert(methMatch.ContainsGenericParameters == false); 281Debug.Assert(_meth != null, "Must call Bind() before calling Invoke."); 282Debug.Assert(args.Length == _argClrTypes!.Length, "Mismatched number of actual and formal arguments."); 308Debug.Assert(that != null);
System\Xml\Xsl\Runtime\XmlILIndex.cs (1)
45Debug.Assert(navigator.ComparePosition(seq[seq.Count - 1]) >= 0, "Index nodes must be added in document order");
System\Xml\Xsl\Runtime\XmlNavigatorFilter.cs (2)
159Debug.Assert(s_typeFilters[(int)nodeType] != null); 168Debug.Assert(nodeType != XPathNodeType.Attribute && nodeType != XPathNodeType.Namespace);
System\Xml\Xsl\Runtime\XmlNavigatorStack.cs (2)
53Debug.Assert(!IsEmpty); 62Debug.Assert(!IsEmpty);
System\Xml\Xsl\Runtime\XmlQueryContext.cs (3)
167Debug.Assert(dataSource != null, "GetType() below assumes dataSource is not null"); 199Debug.Assert(uriRelative != null, "Relative URI should not be null"); 301Debug.Fail($"This XmlTypeCode should never be inferred from a Clr type: {xmlTypeFormalArg.TypeCode}");
System\Xml\Xsl\Runtime\XmlQueryOutput.cs (47)
162Debug.Assert(prefix != null && !string.IsNullOrEmpty(localName) && ns != null, "Invalid argument"); 163Debug.Assert(ValidateNames.ValidateName(prefix, localName, ns, XPathNodeType.Element, ValidateNames.Flags.All), "Name validation failed"); 221Debug.Assert(prefix != null && localName != null && ns != null, "Invalid argument"); 231Debug.Assert(ValidateNames.ValidateName(prefix, localName, ns, XPathNodeType.Attribute, ValidateNames.Flags.All)); 419Debug.Assert(_xstate == XmlState.WithinSequence, $"StartTree cannot be called in the {_xstate} state."); 430Debug.Assert(_xstate == XmlState.EnumAttrs || _xstate == XmlState.WithinContent, $"EndTree cannot be called in the {_xstate} state."); 446Debug.Assert(_xstate == XmlState.WithinContent, $"WriteStartElement cannot be called in the {_xstate} state."); 469Debug.Assert(_xstate == XmlState.EnumAttrs, $"StartElementContent cannot be called in the {_xstate} state."); 484Debug.Assert(_xstate == XmlState.EnumAttrs || _xstate == XmlState.WithinContent, $"WriteEndElement cannot be called in the {_xstate} state."); 504Debug.Assert(_xstate == XmlState.EnumAttrs, $"WriteStartAttribute cannot be called in the {_xstate} state."); 523Debug.Assert(_xstate == XmlState.WithinAttr, $"WriteEndAttribute cannot be called in the {_xstate} state."); 538Debug.Assert(prefix != null && ns != null); 539Debug.Assert(_xstate == XmlState.EnumAttrs, $"WriteNamespaceDeclaration cannot be called in the {_xstate} state."); 542Debug.Assert(prefix.Length == 0 || ns.Length != 0); 572Debug.Assert(_xstate != XmlState.WithinSequence && _xstate != XmlState.EnumAttrs, $"WriteTextBlock cannot be called in the {_xstate} state."); 581Debug.Assert(_xstate != XmlState.WithinSequence && _xstate != XmlState.EnumAttrs, $"WriteTextBlockNoEntities cannot be called in the {_xstate} state."); 595Debug.Assert(_depth == 0, "Root node can only be constructed at top-level."); 608Debug.Assert(_depth == 1, "Root node can only be constructed at top-level."); 699Debug.Assert(prefix != null && ns != null); 746Debug.Assert(prefix != null, "Invalid argument"); 762Debug.Assert(_xstate == XmlState.WithinNmsp, $"WriteNamespaceString cannot be called in the {_xstate} state."); 771Debug.Assert(_xstate == XmlState.WithinNmsp, $"WriteEndNamespace cannot be called in the {_xstate} state."); 801Debug.Assert(_xstate == XmlState.WithinComment, $"WriteCommentString cannot be called in the {_xstate} state."); 810Debug.Assert(_xstate == XmlState.WithinComment, $"WriteEndComment cannot be called in the {_xstate} state."); 844Debug.Assert(_xstate == XmlState.WithinPI, $"WriteProcessingInstructionString cannot be called in the {_xstate} state."); 853Debug.Assert(_xstate == XmlState.WithinPI, $"WriteEndProcessingInstruction cannot be called in the {_xstate} state."); 884Debug.Assert(_xstate == XmlState.WithinSequence, "Values can only be written at the top-level."); 938Debug.Assert(navigator.NodeType == XPathNodeType.Element, "StartCopy should return true only for Element nodes."); 957Debug.Assert(navigator.NodeType == XPathNodeType.Root, "EndCopy should only be called for Element and Document nodes."); 980Debug.Assert(text != null, "Invalid argument"); 1021Debug.Fail($"Text cannot be output in the {_xstate} state."); 1037Debug.Assert(navigator != null); 1044Debug.Assert(nodeType == XPathNodeType.Element, "StartCopy should return true only for Element nodes."); 1175Debug.Assert(_xstate != XmlState.WithinSequence, "StartCopy should not called if state is WithinSequence"); 1192Debug.Fail($"Unexpected node type {navigator.NodeType}"); 1205Debug.Assert(navigator.NodeType == XPathNodeType.Element); 1206Debug.Assert(_xstate == XmlState.WithinContent, $"EndCopy cannot be called in the {_xstate} state."); 1219Debug.Assert(navigator.NodeType == XPathNodeType.Element, "Only elements have namespaces to copy"); 1224Debug.Assert(navigator.LocalName.Length != 0, "xmlns:foo='' isn't allowed"); 1257Debug.Assert(rootType == XPathNodeType.Element || rootType == XPathNodeType.Comment || rootType == XPathNodeType.ProcessingInstruction); 1288Debug.Assert(rootType == XPathNodeType.Attribute || rootType == XPathNodeType.Namespace); 1319Debug.Assert(_nsmgr != null); 1340Debug.Fail($"{xstate} is not a valid XmlState."); 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 (22)
72Debug.Assert(data != null); 174Debug.Assert(IsGlobalComputed(idx), "Cannot get the value of a global value until it has been computed."); 175Debug.Assert(_globalValues![idx] is IList<XPathItem>, "Only debugger should call this method, and all global values should have type item* in debugging scenarios."); 191Debug.Assert(IsGlobalComputed(idx), "Cannot get the value of a global value until it has been computed."); 192Debug.Assert(_globalValues![idx] is IList<XPathItem>, "Only debugger should call this method, and all global values should have type item* in debugging scenarios."); 250Debug.Assert(_earlyObjects != null && index < _earlyObjects.Length, "Early bound object does not exist"); 300Debug.Assert(IsGlobalComputed(index), "Cannot get the value of a global value until it has been computed."); 310Debug.Assert(!IsGlobalComputed(index), "Global value should only be set once."); 332Debug.Assert(_atomizedNames != null); 341Debug.Assert(_filters != null); 395Debug.Assert(_prefixMappingsList != null); 462Debug.Assert(_types != null); 480Debug.Assert(XmlILTypeHelper.GetStorageType(xmlType).IsAssignableFrom(value.GetType()), 483Debug.Assert(destinationType == typeof(object) || !destinationType.IsAssignableFrom(value.GetType()), 499Debug.Assert(xmlType != XmlQueryTypeFactory.Node && xmlType != XmlQueryTypeFactory.NodeS, 558Debug.Assert(destinationType.IsAssignableFrom(value.GetType()), $"ChangeType from type {value.GetType().Name} to type {destinationType.Name} failed"); 680Debug.Assert(XmlILTypeHelper.GetStorageType(xmlType).IsAssignableFrom(value.GetType()), $"Xml type {xmlType} is not represented in ILGen as {value.GetType().Name}"); 778Debug.Fail($"XmlTypeCode {code} was not fully handled."); 829Debug.Assert(_collations != null); 890Debug.Assert(context != null); 927Debug.Assert(context != null); 1078Debug.Assert(node.NodeType == XPathNodeType.Namespace);
System\Xml\Xsl\Runtime\XmlQuerySequence.cs (2)
387Debug.Assert(keys.Length >= _size, "Number of keys must be >= number of items."); 582Debug.Assert(cmp == XmlNodeOrder.Before || cmp == XmlNodeOrder.Unknown);
System\Xml\Xsl\Runtime\XmlQueryStaticData.cs (2)
41Debug.Assert(defaultWriterSettings != null && staticData != null); 184Debug.Assert(formatVersion != CurrentFormatVersion || dataReader.Read() == -1, "Extra data at the end of the stream");
System\Xml\Xsl\Runtime\XmlSequenceWriter.cs (1)
319Debug.Fail($"Unexpected node type {nav.NodeType}");
System\Xml\Xsl\Runtime\XmlSortKey.cs (8)
70Debug.Assert(_nextKey != null && that._nextKey != null); 74Debug.Assert(_priority != that._priority); 85Debug.Assert(that != null && !(this is XmlEmptySortKey)); 125Debug.Assert(obj is XmlSortKey); 252Debug.Assert(that._sortKey != null, "Both keys must have non-null sortKey field"); 257Debug.Assert(_sortKeyBytes != null && that._sortKeyBytes != null, "Both keys must have non-null sortKeyBytes field"); 342Debug.Assert(_dblVal == double.NegativeInfinity || _dblVal == double.PositiveInfinity); 348Debug.Assert(that._dblVal == double.NegativeInfinity || that._dblVal == double.PositiveInfinity);
System\Xml\Xsl\Runtime\XslNumber.cs (10)
27Debug.Assert(isSeparator == (formatString != null), "AssertSeparator"); 33Debug.Assert(startIdx >= 0 && tokLen > 0); 50Debug.Assert(startIdx >= 0 && tokLen > 0); 128Debug.Assert(groupingSeparator.Length <= 1); 270Debug.Assert(item.ValueType == typeof(double), "Item must be either of type int, or double"); 274Debug.Assert(1 <= dblVal && dblVal < double.PositiveInfinity); 298Debug.Assert(CharUtil.IsDecimalDigitOne(startChar), $"Unexpected startChar: {startChar}"); 308Debug.Assert(val >= 0 && val == Math.Round(val), "ConvertToArabic operates on non-negative integer numbers only"); 319Debug.Assert(groupSeparator.Length == 1); 360Debug.Assert(pNewEnd >= result, "Separator cannot be the first character");
System\Xml\Xsl\Runtime\XsltConvert.cs (4)
49Debug.Assert(itemType == typeof(bool), $"Unexpected type of atomic sequence {itemType}"); 93Debug.Assert(itemType == typeof(bool), $"Unexpected type of atomic sequence {itemType}"); 252Debug.Assert(destinationType.IsStrict && destinationType.IsAtomicValue, "Can only convert to strict atomic type."); 314Debug.Fail($"Conversion from {value.XmlType.QualifiedName.Name} to {destinationType} is not supported.");
System\Xml\Xsl\Runtime\XsltFunctions.cs (8)
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); 302Debug.Fail($"Unexpected type: {o.GetType()}"); 340Debug.Assert(itemType == typeof(bool), $"Unexpected type of atomic value {itemType}"); 345Debug.Assert(stringValue != null); 531Debug.Assert(lang != null);
System\Xml\Xsl\Runtime\XsltLibrary.cs (13)
196Debug.Assert(_decimalFormatters != null && 0 <= idx && idx < _decimalFormatters.Count, "Value of decimalFormatterIndex is out of range"); 341Debug.Assert(!item.IsNode, "Atomic value expected"); 353Debug.Assert(itemType == typeof(bool), $"Unexpected type of atomic value {itemType}"); 361Debug.Assert(TypeCode.Boolean < TypeCode.Double && TypeCode.Double < TypeCode.String, "Cannot use the smallest TypeCode as a weakest one"); 384Debug.Assert(op == ComparisonOperator.Eq || op == ComparisonOperator.Ne); 391Debug.Assert(compType == TypeCode.Boolean); 399Debug.Assert(compType == TypeCode.Boolean || compType == TypeCode.Double || compType == TypeCode.String); 439Debug.Assert(op == ComparisonOperator.Eq || op == ComparisonOperator.Ne); 487Debug.Assert(ComparisonOperator.Lt <= op && op <= ComparisonOperator.Ge); 526Debug.Assert(XPathNodeType.SignificantWhitespace == XPathNodeType.Text + 1); 527Debug.Assert(XPathNodeType.Whitespace == XPathNodeType.Text + 2); 539Debug.Assert((object)nav1.NameTable == (object)nav2.NameTable, "Ref.Equal cannot be used if navigators have different name tables"); 573Debug.Fail("Invalid XSLT value");
System\Xml\Xsl\SourceLineInfo.cs (6)
70Debug.Assert(lineInfo.Start.Line == lineInfo.End.Line); 71Debug.Assert(lineInfo.Start.Pos == 0 && lineInfo.End.Pos == 0); 75Debug.Assert(0 < lineInfo.Start.Line && 0 < lineInfo.Start.Pos, "0 < start"); 76Debug.Assert(0 < lineInfo.End.Line && 0 < lineInfo.End.Pos, "0 < end"); 77Debug.Assert(lineInfo.Start.LessOrEqual(lineInfo.End), "start <= end"); 84Debug.Assert(uriString != null);
System\Xml\Xsl\XmlILCommand.cs (2)
29Debug.Assert(delExec != null && staticData != null); 83Debug.Assert(results != null);
System\Xml\Xsl\XmlIlGenerator.cs (3)
136Debug.Assert(_qil.Root != null); 210Debug.Assert(ndParam.NodeType == QilNodeType.Parameter); 341Debug.Assert(methInfo != null, "MethodInfo for global value should have been created previously.");
System\Xml\Xsl\XmlQueryCardinality.cs (1)
24Debug.Assert(0x00 <= value && value <= 0x07);
System\Xml\Xsl\XmlQueryType.cs (11)
487Debug.Assert(Count == 1 && IsSingleton, "This method should only be called for item types."); 488Debug.Assert(baseType.Count == 1 && baseType.IsSingleton, "This method should only be called for item types."); 489Debug.Assert(!IsDod && !baseType.IsDod, "Singleton types may not have DocOrderDistinct property"); 509Debug.Assert(IsAtomicValue && baseType.IsAtomicValue); 528Debug.Assert(this.Count == 1 && this.IsSingleton, "this should be an item"); 529Debug.Assert(other.Count == 1 && other.IsSingleton, "other should be an item"); 562Debug.Assert(Count == 1, "Do not pass a Union type to this method."); 563Debug.Assert(IsSingleton, "Do not pass a Sequence type to this method."); 885Debug.Assert(count < 64, "BitMatrix currently only handles up to 64x64 matrix."); 903Debug.Assert(index1 < _bits.Length && index2 < _bits.Length, "Index out of range."); 908Debug.Assert(index1 < _bits.Length && index2 < _bits.Length, "Index out of range.");
System\Xml\Xsl\XmlQueryTypeFactory.cs (15)
63Debug.Assert(schemaType.DerivedBy == XmlSchemaDerivationMethod.Union); 265Debug.Assert(itemType.IsSingleton, "All types should be prime."); 351Debug.Assert(arrEnum[arrEnum.Length - 1] == XmlTypeCode.DayTimeDuration, 437Debug.Assert(schemaType.Datatype!.Variety == XmlSchemaDatatypeVariety.Atomic, "List or Union Xsd types should have been handled by caller."); 470Debug.Assert(!isNillable); 504Debug.Assert(nameTest != null, "nameTest cannot be null"); 505Debug.Assert(schemaType != null, "schemaType cannot be null"); 513Debug.Assert(!IsAtomicValue || schemaType.Datatype!.Variety == XmlSchemaDatatypeVariety.Atomic); 554Debug.Assert((object)this == (object)Create(_code, _isStrict), "Unknown type"); 741Debug.Assert(members != null && members.Count != 1, "ChoiceType must contain a list with 0 or >1 types."); 749Debug.Assert(t.Cardinality == XmlQueryCardinality.One, "ChoiceType member types must be prime types."); 972Debug.Assert(prime != null, "SequenceType can only modify the cardinality of a non-null XmlQueryType."); 973Debug.Assert(prime.IsSingleton, "Prime type must have cardinality one."); 1182Debug.Fail($"Don't know how to serialize {type.GetType()}"); 1201Debug.Fail("Unexpected XmlQueryType's subtype id");
System\Xml\Xsl\XPath\XPathBuilder.cs (32)
46Debug.Fail("Must not be called"); 67Debug.Assert(!_inTheBuild, "XPathBuilder is busy!"); 80Debug.Assert(_inTheBuild, "StartBuild() wasn't called"); 92Debug.Assert(numFixupCurrent >= 0, "Context fixup error"); 93Debug.Assert(numFixupPosition >= 0, "Context fixup error"); 94Debug.Assert(numFixupLast >= 0, "Context fixup error"); 115Debug.Assert(op != XPathOperator.Unknown); 118Debug.Assert((opGroup != XPathOperatorGroup.Negate && right != null) || (opGroup == XPathOperatorGroup.Negate && right == null)); 129Debug.Fail($"{op} is not a valid XPathOperator"); 136Debug.Assert(op == XPathOperator.Or || op == XPathOperator.And); 147Debug.Assert(compType == XmlTypeCode.Boolean || compType == XmlTypeCode.Double || compType == XmlTypeCode.String); 148Debug.Assert(compType == XmlTypeCode.Boolean || left.XmlType!.IsSingleton && right.XmlType!.IsSingleton, "Both comparison operands must be singletons"); 161Debug.Fail("Wrong operator type"); 169Debug.Assert(val.XmlType!.IsSingleton); 170Debug.Assert(compType == XmlTypeCode.Boolean || compType == XmlTypeCode.Double || compType == XmlTypeCode.String, "I don't know what to do with RTF here"); 214Debug.Assert(op == XPathOperator.Eq || op == XPathOperator.Ne); 247Debug.Assert(op == XPathOperator.Lt || op == XPathOperator.Le || op == XPathOperator.Gt || op == XPathOperator.Ge); 278Debug.Assert(op == XPathOperator.UnaryMinus); 294Debug.Fail("Wrong operator type"); 301Debug.Assert(op == XPathOperator.Union); 414Debug.Fail("Invalid EnumValue 'XPathAxis'"); 457Debug.Assert(nodeset.NodeType == QilNodeType.DocOrderDistinct, 561Debug.Assert(!args.IsReadOnly, "Writable collection expected"); 602Debug.Fail($"{func.id} is present in the function table, but absent from the switch"); 853Debug.Assert(current != null); 866Debug.Assert(environment != null); 890Debug.Assert(unknown.NodeType == QilNodeType.Unknown); 933Debug.Assert(_last != null); 938Debug.Assert(unknown != null); 988Debug.Assert(maxArgs == 0 || maxArgs == Infinity || argTypes != null && argTypes.Length == maxArgs); 1024Debug.Assert(numArgs > maxArgs); 1046Debug.Assert(args.Count == 0 || argTypes != null);
System\Xml\Xsl\XPath\XPathParser.cs (6)
26Debug.Assert(_scanner == null && _builder == null); 27Debug.Assert(scanner != null && builder != null); 57Debug.Assert(_posInfo.Count == 0, "PushPosInfo() and PopPosInfo() calls have been unbalanced"); 262Debug.Assert(scanner.Name == "processing-instruction"); 509Debug.Assert(IsPrimaryExpr()); 536Debug.Assert(
System\Xml\Xsl\XPath\XPathQilFactory.cs (12)
41Debug.Assert(result == (xt.TypeCode == XmlTypeCode.Item || xt.TypeCode == XmlTypeCode.AnyAtomicType), "What else can it be?"); 48Debug.Assert(n != null && n.XmlType!.IsSingleton && n.XmlType.IsNode, "Must be a singleton node"); 54Debug.Assert(n != null && n.XmlType!.IsNode, "Must be a node-set"); 60Debug.Assert(n != null && n.XmlType!.IsSingleton && n.XmlType.IsNode && n.XmlType.IsNotRtf, "Must be a singleton node and not an Rtf"); 66Debug.Assert(n != null && n.XmlType!.IsSubtypeOf(T.StringX), "Must be a singleton string"); 72Debug.Assert(n != null && n.XmlType!.IsSubtypeOf(T.StringXS), "Must be a sequence of strings"); 78Debug.Assert(n != null && n.XmlType!.IsSubtypeOf(T.DoubleX), "Must be a singleton Double"); 84Debug.Assert(n != null && n.XmlType!.IsSubtypeOf(T.BooleanX), "Must be a singleton Bool"); 133Debug.Assert(op == QilNodeType.Eq || op == QilNodeType.Ne); 149Debug.Assert(op == QilNodeType.Lt || op == QilNodeType.Le || op == QilNodeType.Gt || op == QilNodeType.Ge); 170Debug.Assert(IsAnyType(n), $"Unexpected expression type: {n.XmlType}"); 182default: Debug.Fail($"Unexpected XmlTypeCode: {requiredType}"); return null;
System\Xml\Xsl\XPath\XPathScanner.cs (21)
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)); 585Debug.Fail($"Unexpected LexKind: {t}");
System\Xml\Xsl\XPathConvert.cs (119)
163Debug.Assert(0 != (u & 0x80000000)); 224Debug.Assert(dec.MantissaSize > 0); 235Debug.Assert(dec[ib] > 0 && dec[ib] <= 9); 246Debug.Assert(dec[ib] >= 0 && dec[ib] <= 9); 279Debug.Assert(exponent > 0 && exponent < 512); 296Debug.Assert(digit <= 9); 297Debug.Assert(0 != (_u2 & 0x80000000)); 301Debug.Assert(_exp >= 4); 351Debug.Assert(1 == rgu[4]); 378Debug.Assert(this.IsZero); 444Debug.Assert(0 != (_u2 & 0x80000000)); 445Debug.Assert(0 != (numOp._u2 & 0x80000000)); 459Debug.Assert(uHi < 0xFFFFFFFF); 464Debug.Assert(uHi < 0xFFFFFFFF); 472Debug.Assert(uHi < 0xFFFFFFFF); 480Debug.Assert(uHi < 0xFFFFFFFF); 488Debug.Assert(uHi < 0xFFFFFFFF); 494Debug.Assert(0 != uT); 496Debug.Assert(uHi < 0xFFFFFFFF); 504Debug.Assert(uHi < 0xFFFFFFFF); 512Debug.Assert(uHi < 0xFFFFFFFF); 521Debug.Assert(_error <= 2 || numOp._error <= 2); 545Debug.Assert(0 != (rgu5 & 0x40000000)); 568Debug.Assert(0 == rgu3); 569Debug.Assert(0 == rgu4); 570Debug.Assert(0 == rgu5); 596Debug.Assert(0 != (bn._u2 & 0x80000000)); 618Debug.Assert(wT >= 12 && wT < 32); 635Debug.Assert(wT > 0 && wT < 32); 673Debug.Assert(_exp <= 32); 683Debug.Assert(_error < 0xFFFFFFFF); 688Debug.Assert(0 == _u2 && 0 == _u1); 699Debug.Assert(_error < 0xFFFFFFFF); 735Debug.Assert(!IsSpecial(dbl)); 736Debug.Assert(0 < dbl); 813Debug.Assert(iT >= 0 && iT < 16); 817Debug.Assert(numHH._exp + tenPower._exp > 1); 826Debug.Assert(iT > 0 && iT <= 32); 828Debug.Assert(numHH._exp + tenPower._exp > 1); 837Debug.Assert(iT >= 0 && iT < 16); 841Debug.Assert(numHH._exp + tenPower._exp <= 32); 850Debug.Assert(iT > 0 && iT <= 32); 852Debug.Assert(numHH._exp + tenPower._exp <= 32); 859Debug.Assert(numHH._exp > 0 && numHH._exp < 32); 872Debug.Assert(uLL <= uLH && uLH <= uHL && uHL <= uHH); 900Debug.Assert(uHH >= uScale && uHH / uScale < 10); 904Debug.Assert(uLL <= uHH); 915Debug.Assert(0 != uHH || !numHH.IsZero); 948Debug.Assert(0 <= bLL && bLL < bHH && bHH <= 9); 992Debug.Assert(dblInt == Math.Floor(dblInt) && 1 <= dblInt && dblInt <= 9007199254740991.0d); 1011Debug.Assert(iT >= 0 && iT <= 15); 1012Debug.Assert(dblInt >= C10toN[iT] && dblInt < C10toN[iT + 1]); 1017Debug.Assert(iT >= 0); 1020Debug.Assert(dblInt == Math.Floor(dblInt) && 0 <= dblInt && dblInt < C10toN[iT]); 1035Debug.Assert(exponent == exponentPrec && mantissaSize == mantissaSizePrec); 1045Debug.Assert(equal, "DblToRgbFast and DblToRgbPrecise should give the same result"); 1083Debug.Assert(!IsSpecial(dbl)); 1084Debug.Assert(0 < dbl); 1098Debug.Assert(0 == (dblHi & 0x7FF00000)); 1108Debug.Assert(0 != (DblHi(dblT) & 0x7FF00000)); 1150Debug.Assert(1 <= dblT && dblT < 2); 1196Debug.Assert(0 == c5Den); 1217Debug.Assert(cu <= 2); 1234Debug.Assert(c2Num > 0 && c2Den > 0); 1241Debug.Assert(0 == (biDen[biDen.Length - 1] & 0xF0000000)); 1242Debug.Assert(0 != (biDen[biDen.Length - 1] & 0x08000000)); 1714Debug.Assert(0 <= idx && idx < _length); 1722Debug.Assert(_capacity >= InitCapacity); 1723Debug.Assert(_length >= 0 && _length <= _capacity); 1730Debug.Assert(0 == _length || 0 != _digits[_length - 1]); 1759Debug.Assert(cu >= 0); 1779Debug.Assert(2 <= _capacity); 1796Debug.Assert((object)this != (object)biSrc); 1810Debug.Assert(dec.MantissaSize >= 0); 1823Debug.Assert(dec[ib] >= 0 && dec[ib] <= 9); 1833Debug.Assert(1 < uMul); 1843Debug.Assert(0 != uMul); 1867Debug.Assert(c5 >= 0); 1899Debug.Assert(cbit >= 0); 1966Debug.Assert(cu >= 0); 1987Debug.Assert(cbit >= 0); 2023Debug.Assert(obj != null); 2050Debug.Assert(idx >= 0 && idx < _length); 2051Debug.Assert(_digits[idx] != bi._digits[idx]); 2060Debug.Assert((object)this != (object)bi); 2114Debug.Assert((object)this != (object)bi); 2127Debug.Assert(0 == wCarry || 1 == wCarry); 2165Debug.Fail("Who's subtracting to negative?"); 2174Debug.Assert((object)this != (object)bi); 2182Debug.Assert(_length <= cu); 2190Debug.Assert(uQuo >= 0 && uQuo <= 9); 2205Debug.Assert(0 == wCarry || 1 == wCarry); 2217Debug.Assert(1 == wCarry); 2218Debug.Assert(idx == cu); 2241Debug.Assert(CompareTo(bi) < 0); 2342Debug.Assert(value <= MaxDigits); 2351Debug.Assert(0 <= ib && ib < _mantissaSize); 2370Debug.Assert(dbl == (double)this); 2375Debug.Assert(!this.Equals(decAfter)); 2380Debug.Assert(!this.Equals(decBefore)); 2472Debug.Assert(0 != mantissaSize && 0 != dec[0] && 0 != dec[mantissaSize - 1]); 2485Debug.Assert(dec[ib] >= 0 && dec[ib] <= 9); 2496Debug.Assert(dec[ib] >= 0 && dec[ib] <= 9); 2561Debug.Assert(dbl == dblLo); 2579Debug.Assert(dbl == (double)num); 2581Debug.Assert(dbl == dblLo || double.IsNaN(dblLo)); 2600Debug.Assert(double.IsNaN(dblLowPrec) || dblLowPrec == dbl); 2719Debug.Assert(c2Dbl < 32 || 0 != biDec[0]); 2737Debug.Assert(0 == c2Dbl || 0 == c2Dec); 2738Debug.Assert(0 == c5Dbl || 0 == c5Dec); 2857Debug.Assert(('0' & 0xF) == 0, "We use (char)(d |'0') to convert digit to char"); 2874Debug.Assert(double.IsInfinity(dbl)); 2880Debug.Assert(0 != dec.MantissaSize); 2921Debug.Assert(dec[ib] >= 0 && dec[ib] <= 9); 2939Debug.Assert(0 != cntDigits); 2940Debug.Assert(sizeFract == cntDigits || sizeFract > cntDigits && pch[-1] == '0'); 2950Debug.Assert(sizeFract == cntDigits); 2954Debug.Assert(dec[ib] >= 0 && dec[ib] <= 9); 2960Debug.Assert(0 == sizeInt && 0 == cntDigits);
System\Xml\Xsl\XslException.cs (2)
62Debug.Fail($"Resource string '{res}' was not found"); 164Debug.Assert(lineInfo == null || lineInfo.Uri != null);
System\Xml\Xsl\Xslt\Compiler.cs (14)
63Debug.Assert(CompilerErrorColl == null, "Compiler cannot be reused"); 75Debug.Assert(stylesheet != null); 76Debug.Assert(Root == null, "Compiler cannot be reused"); 119Debug.Assert(importPrecedence <= oldNsAlias.ImportPrecedence, "Stylesheets must be processed in the order of decreasing import precedence"); 163Debug.Assert(var.NodeType == XslNodeType.Variable || var.NodeType == XslNodeType.Param); 201Debug.Assert(qname != null); 218Debug.Assert(nameTest != null); 235Debug.Assert(name != null); 279Debug.Assert(value <= ErrorCount); 291Debug.Assert(_savedErrorCount == -1, "Nested EnterForwardsCompatible calls"); 298Debug.Assert(_savedErrorCount != -1, "ExitForwardsCompatible without EnterForwardsCompatible"); 302Debug.Assert((_savedErrorCount = -1) < 0); 305Debug.Assert((_savedErrorCount = -1) < 0); 452Debug.Assert(characters.Length == 8);
System\Xml\Xsl\Xslt\CompilerScopeManager.cs (13)
97Debug.Assert(_lastRecord == 0 && _lastScopes == 0, "PushScope() and PopScope() calls are unbalanced"); 111Debug.Assert(nsDecl.Prefix == null, "NS may be null only when prefix is null where it is used for extension-element-prefixes='#all'"); 149Debug.Assert(flag == (flag & ScopeFlags.ExclusiveFlags) && BitOperations.IsPow2((uint)flag), "One exclusive flag"); 150Debug.Assert(uri != null || ncName == null, "null, null means exclude '#all'"); 168Debug.Assert(flag == (flag & ScopeFlags.InheritedFlags) && BitOperations.IsPow2((uint)flag), "one inherited flag"); 193Debug.Assert((_records[_lastRecord].flags & ScopeFlags.CompatibilityFlags) != ScopeFlags.CompatibilityFlags, 201Debug.Assert(varName.LocalName != null && varName.NamespaceUri != null); 209Debug.Assert(prefix != null); 249Debug.Assert(nsUri != null); 257Debug.Assert(recPrefix == null); 301Debug.Assert(localName != null); 414Debug.Assert(LastPredefRecord <= _currentRecord && _currentRecord <= _scope._lastRecord, "MoveNext() either was not called or returned false"); 415Debug.Assert(_scope._records[_currentRecord].IsNamespace);
System\Xml\Xsl\Xslt\Focus.cs (11)
47Debug.Assert(focusType != SingletonFocusType.Iterator); 68Debug.Assert(_focusType != SingletonFocusType.None, "Focus is not set, call SetFocus first"); 79Debug.Assert(_focusType == SingletonFocusType.Iterator && _current != null, "Unexpected singleton focus type"); 104Debug.Assert(!IsFocusSet, "Focus was already set"); 109Debug.Assert(_current.Name!.NamespaceUri == XmlReservedNs.NsXslDebug && _current.Name.LocalName == "current"); 114Debug.Assert(_position.Name!.NamespaceUri == XmlReservedNs.NsXslDebug && _position.Name.LocalName == "position"); 119Debug.Assert(_last.Name!.NamespaceUri == XmlReservedNs.NsXslDebug && _last.Name.LocalName == "last"); 125Debug.Assert(IsFocusSet, "Focus was not set"); 136Debug.Assert(_current != null, "Naked current() is not expected in this function"); 142Debug.Assert(_position != null, "Naked position() is not expected in this function"); 148Debug.Assert(_last != null, "Naked last() is not expected in this function");
System\Xml\Xsl\Xslt\InvokeGenerator.cs (8)
60Debug.Assert(formalArg.Name.LocalName == "namespaces", "Cur,Pos,Last don't have default values and should be always added to by caller in AddImplicitArgs()"); 61Debug.Assert(formalArg.DefaultValue != null, "PrecompileProtoTemplatesHeaders() set it"); 71Debug.Assert(formalArg.Name!.NamespaceUri != XmlReservedNs.NsXslDebug, "Cur,Pos,Last don't have default values and should be always added to by caller in AddImplicitArgs(). We don't have $namespaces in !debug."); 86Debug.Assert(invokeType == T.ItemS, "Actual argument type is not a subtype of formal argument type"); 104Debug.Assert(argName != null); 132Debug.Assert(_formalArgs![prevArg] != null, "formalArg must be in the list"); 133Debug.Assert(_invokeArgs![prevArg] != null, "This arg should be compiled already"); 151Debug.Assert(_invokeArgs[prevArg] is QilIterator);
System\Xml\Xsl\Xslt\KeyMatchBuilder.cs (7)
29Debug.Assert(0 <= _depth && _depth <= 1, "this shouldn't happen"); 41Debug.Assert(0 <= _depth && _depth <= 1, "this shouldn't happen"); 48Debug.Assert(base.numFixupLast == 0); 49Debug.Assert(base.numFixupPosition == 0); 77Debug.Assert(node != null); 78Debug.Assert(fixup != null); 110Debug.Assert(content.Child == _fixup, "Unexpected content node");
System\Xml\Xsl\Xslt\MatcherBuilder.cs (7)
135Debug.Assert( 234Debug.Assert(!double.IsNaN(x!._priority)); 235Debug.Assert(!double.IsNaN(y!._priority)); 398Debug.Assert(patternList.Count > 0); 423Debug.Assert((int)(QilLiteral)matcher == NoMatch); 450Debug.Assert(pattern.Priority > lastPriority); 522Debug.Assert(priority == branches.Length - 1);
System\Xml\Xsl\Xslt\OutputScopeManager.cs (4)
60Debug.Assert(prefix != null); 61Debug.Assert(uri != null); 142Debug.Assert(prefix != null); 149Debug.Assert(0 < record, "first record is lookup barrier, so we don't need to check this condition runtime");
System\Xml\Xsl\Xslt\QilGenerator.cs (56)
136Debug.Assert(compiler != null); 227Debug.Assert(IsDebug && _curLoop.IsFocusSet); 234Debug.Assert(!_curLoop.IsFocusSet && !_funcFocus.IsFocusSet, "Must be compiled using singleton focus"); 432Debug.Assert(IsDebug, "This is debug only logic"); 436Debug.Assert(var.XmlType!.IsSubtypeOf(T.NamespaceS)); 437Debug.Assert(var.Binding is QilList); 446Debug.Assert(nsList[i].NodeType == QilNodeType.NamespaceDecl); 447Debug.Assert(varList[i].NodeType == QilNodeType.NamespaceDecl); 478Debug.Assert(tmpl != null && tmpl.Function == null); 479Debug.Assert(tmpl.NodeType == XslNodeType.AttributeSet || tmpl.NodeType == XslNodeType.Template); 508Debug.Assert(tmpl.NodeType == XslNodeType.Template); 602Debug.Assert((template != null) == (tmpl.SourceLine != null), "Templates must have line information, and attribute sets must not"); 610Debug.Assert(!IsDebug, "In debug mode we don't generate parumWithCalls functions. Otherwise focus flags should be adjusted"); 643Debug.Assert(tmpl != null && tmpl.Function != null && tmpl.Function.Definition.NodeType == QilNodeType.Unknown); 653Debug.Assert(tmpl is Template, "Only templates can have explicit arguments"); 656Debug.Assert(arg.DefaultValue == null, "Argument must not be compiled yet"); 700Debug.Assert(instructions != null); 743default: Debug.Fail($"Unexpected type of AST node: {nodeType}"); result = null; break; 747Debug.Assert(result != null, "Result of compilation should not be null"); 983Debug.Assert(pos < source.Length); 1019Debug.Assert(i == source.Length || source[i] == '{'); 1073Debug.Assert(avt != null); 1125Debug.Assert(_curLoop.IsFocusSet); 1179Debug.Assert(withParam.NodeType == XslNodeType.WithParam); 1215Debug.Assert(node.NodeType == XslNodeType.ApplyImports); 1216Debug.Assert(!_curLoop.IsFocusSet, "xsl:apply-imports cannot be inside of xsl:for-each"); 1246Debug.Assert(tmpl.Function != null, "All templates should be already compiled"); 1281Debug.Assert(attSet.Function != null, "All templates should be already compiled"); 1417Debug.Assert(when.NodeType == XslNodeType.If || when.NodeType == XslNodeType.Otherwise); 1421Debug.Assert(result == null, "xsl:otherwise must be the last child of xsl:choose"); 1460Debug.Assert(node.NodeType == XslNodeType.Variable); 1470Debug.Assert(node.NodeType == XslNodeType.Variable || node.NodeType == XslNodeType.Param || node.NodeType == XslNodeType.WithParam); 1502Debug.Assert(varValue.SourceLine == null); 1508Debug.Assert(withParam.NodeType == XslNodeType.WithParam); 1718Debug.Assert(result.XmlType == T.StringX); 1726Debug.Assert(sort.NodeType == XslNodeType.Sort); 1818Debug.Assert(0 < list.Count, "Pattern should have at least one filter"); 1873Debug.Fail($"Unexpected NodeKind: {nodeKinds}"); 2119Debug.Assert(num.Level == NumberLevel.Any); 2139Debug.Assert(sheet.TemplateMatches.Count == 0); 2223Debug.Assert(varPar.NodeType == XslNodeType.Variable || varPar.NodeType == XslNodeType.Param); 2259Debug.Assert(varPar.NodeType == XslNodeType.Variable || varPar.NodeType == XslNodeType.Param); 2346Debug.Assert(expr != null); 2375Debug.Assert(pttrn != null); 2401Debug.Assert(pttrn != null); 2515Debug.Assert( 2581Debug.Assert(actualArgs[actArg].NodeType == XslNodeType.WithParam, "All Sorts was removed in CompileSorts()"); 2662Debug.Assert(actualArgs[i].NodeType == XslNodeType.WithParam, "All Sorts was removed in CompileSorts()"); 2689Debug.Assert(actualArgs[0].Name == _nameCurrent, "Caller should always pass $current as a first argument to apply-* calls."); 2753Debug.Assert( 2794Debug.Assert(!IsDebug, "Attempt to override SourceLineInfo in debug mode"); 2800Debug.Assert(n.SourceLine == null); 2824Debug.Assert(nsVar.XmlType!.IsSubtypeOf(T.NamespaceS)); 2869Debug.Assert(let.NodeType == QilNodeType.Let); 2875Debug.Assert(0 <= varScope && varScope <= _vars.Count); 2886Debug.Assert(_vars.Count == 0, "Accumulated variables left unclaimed");
System\Xml\Xsl\Xslt\QilGeneratorEnv.cs (11)
26Debug.Assert(args == null || args.Length == 0, "Error message must already be composed in res"); 32Debug.Fail("Should never get here"); 76Debug.Assert(ns != null); 103Debug.Assert(!args.IsReadOnly, "Writable collection expected"); 134Debug.Fail($"{func.id} is present in the function table, but absent from the switch"); 146Debug.Assert(ns != null); 251default: Debug.Fail($"This XmlTypeCode should never be inferred from a Clr type: {xmlTypeFormalArg.TypeCode}"); break; 409Debug.Assert(name.XmlType == T.StringX && key.XmlType == T.StringX); 439Debug.Assert(defList != null && defList.Count > 0); 456Debug.Assert(defList != null && defList.Count > 0); 667Debug.Assert(propValue.ValueType == typeof(double));
System\Xml\Xsl\Xslt\QilStrConcatenator.cs (6)
28Debug.Assert(!_inUse); 46Debug.Assert(_inUse, "Reset() wasn't called"); 52Debug.Assert(_inUse, "Reset() wasn't called"); 58Debug.Assert(_inUse, "Reset() wasn't called"); 61Debug.Assert(value.XmlType!.TypeCode == XmlTypeCode.String); 76Debug.Assert(_inUse); // If we want allow multiple calls to ToQil() this logic should be changed
System\Xml\Xsl\Xslt\Stylesheet.cs (4)
86Debug.Assert(var.NodeType == XslNodeType.Variable || var.NodeType == XslNodeType.Param); 87Debug.Assert(var.Name!.NamespaceUri != null, "Name must be resolved in XsltLoader"); 104Debug.Assert(template.ImportPrecedence == 0); 120Debug.Assert(template.ImportPrecedence <= old.ImportPrecedence, "Global objects are processed in order of decreasing import precedence");
System\Xml\Xsl\Xslt\XPathPatternBuilder.cs (36)
28Debug.Assert(environment != null); 44Debug.Assert(!_inTheBuild, "XPathBuilder is busy!"); 52Debug.Assert(filter.NodeType == QilNodeType.Filter, "XPathPatternBuilder expected to generate list of Filters on top level"); 53Debug.Assert(filter.Variable.XmlType!.IsSubtypeOf(T.NodeNotRtf)); 54Debug.Assert(filter.Variable.Binding!.NodeType == QilNodeType.Unknown); // fixupNode 55Debug.Assert(filter.Body.XmlType!.IsSubtypeOf(T.Boolean)); 67Debug.Assert(_inTheBuild, "StartBuild() wasn't called"); 71Debug.Assert(_predicateEnvironment.numFixupCurrent >= 0, "Context fixup error"); 72Debug.Assert(_predicateEnvironment.numFixupPosition >= 0, "Context fixup error"); 73Debug.Assert(_predicateEnvironment.numFixupLast >= 0, "Context fixup error"); 80Debug.Assert(op == XPathOperator.Union); 81Debug.Assert(left != null); 82Debug.Assert(right != null); 84Debug.Assert(right.NodeType == QilNodeType.Filter, "LocationPathPattern must be compiled into a filter"); 92Debug.Assert(left.NodeType == QilNodeType.Filter, "LocationPathPattern must be compiled into a filter"); 122Debug.Assert( 133Debug.Assert(nodeType == XPathNodeType.All && prefix == null && name == null, " // is the only d-o-s axes that we can have in pattern"); 190Debug.Assert(left != null); 191Debug.Assert(right != null); 195Debug.Assert(nop.Child == _fixupNode); 199Debug.Assert(GetLastParent(left) == left, "Left is always single axis and never the step"); 200Debug.Assert(left.NodeType == QilNodeType.Filter); 209Debug.Assert(nop.Child != null); 213Debug.Assert(right.NodeType == QilNodeType.Filter); 215Debug.Assert(lastParent != null); 226Debug.Fail("Should not call to this function."); 291Debug.Assert(prefix.Length == 0); 297Debug.Assert( 305Debug.Assert(name == "key", "Unexpected function"); 306Debug.Assert( 355Debug.Assert(parent.NodeType == QilNodeType.Filter); 376Debug.Assert(context != null, "Predicate always has step so it can't have context == null"); 377Debug.Assert(context.Variable.NodeType == QilNodeType.For, "It shouldn't be Let, becaus predicates in PatternBuilder don't produce cached tuples."); 430Debug.Assert(current != null); 444Debug.Fail("GetPosition() must not be called"); 450Debug.Fail("GetLast() must not be called");
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 (19)
113Debug.Assert((v.Flags & XslFlags.Stop) == 0, "Already visited this vertex"); 121Debug.Assert((u.Flags & flag) == flag, "Flag was not set on an adjacent vertex"); 286Debug.Assert(tmpl.Match != null); 311Debug.Assert( 347Debug.Assert(_forEachDepth == 0, "xsl:apply-imports cannot be inside of xsl:for-each"); 348Debug.Assert(_currentTemplate is Template, "xsl:apply-imports can only occur within xsl:template"); 356Debug.Assert(node.Select != null, "Absent @select should be replaced with 'node()' in XsltLoader"); 408Debug.Assert(target != null); 429Debug.Assert(instr.NodeType == XslNodeType.WithParam); 807Debug.Assert((t.Flags & XslFlags.Stop) == 0, "Already visited this vertex"); 816Debug.Assert((u.Flags & XslFlags.SideEffects) == XslFlags.SideEffects, "Flag was not set on an adjacent vertex"); 824Debug.Assert((u.Flags & XslFlags.SideEffects) == XslFlags.SideEffects, "Flag was not set on an adjacent vertex"); 839Debug.Assert((u.Flags & XslFlags.SideEffects) == XslFlags.SideEffects, "Flag was not set on an adjacent vertex"); 1014Debug.Assert(op != XPathOperator.Unknown); 1173Debug.Fail($"Unexpected XmlQueryType for script function: {xt}"); 1407Debug.Assert(split > 0); 1436Debug.Assert(scoperecord.IsNamespace || scoperecord.ncName == null); 1437Debug.Assert(!Compiler.IsPhantomNamespace(scoperecord.nsUri!)); 1478Debug.Assert(parent.Content.Count == split + 1);
System\Xml\Xsl\Xslt\XsltInput.cs (37)
43Debug.Assert(reader != null); 44Debug.Assert(atoms != null); 77Debug.Assert(tr.Settings == null, "XmlReader created with XmlReader.Create should always expand entities."); 201Debug.Assert( 244Debug.Assert(_reader.NodeType == XmlNodeType.EntityReference); 246Debug.Assert(local[0] == '#' || local == "lt" || local == "gt" || local == "quot" || local == "apos"); 258Debug.Assert(_reader.NodeType == XmlNodeType.Text || _reader.NodeType == XmlNodeType.Whitespace || _reader.NodeType == XmlNodeType.SignificantWhitespace); 261Debug.Assert(_reader.NodeType == XmlNodeType.EndEntity); 273Debug.Assert(_reader.NodeType == XmlNodeType.Attribute, "reader.NodeType == XmlNodeType.Attribute"); 323Debug.Assert(_reader.NodeType == XmlNodeType.Text, "Unexpected node type inside attribute value"); 332Debug.Assert(_reader.NodeType != XmlNodeType.EntityReference); 348Debug.Assert(_nodeType == XmlNodeType.Element, "To call MoveToFirstChild() XsltInut should be positioned on an Element."); 358Debug.Assert(_nodeType != XmlNodeType.Element || IsEmptyElement, "On non-empty elements we should call MoveToFirstChild()"); 441Debug.Assert(_nodeType == XmlNodeType.Text || _nodeType == XmlNodeType.Whitespace || _nodeType == XmlNodeType.SignificantWhitespace); 488Debug.Assert(_reader.NodeType == XmlNodeType.Element); 518Debug.Assert(_nodeType == XmlNodeType.Element, "For MoveToElement() we should be positioned on Element or Attribute"); 524Debug.Assert(_nodeType == XmlNodeType.Element, "For MoveToLiteralAttribute() we should be positioned on Element or Attribute"); 539Debug.Assert(_nodeType == XmlNodeType.Element, "For MoveToLiteralAttribute() we should be positioned on Element or Attribute"); 554Debug.Assert(_attributes != null && _attributes[attNum].name == attName, "Attribute numbering error."); 566Debug.Assert(_attributes != null && _attributes[attNum].name == attName, "Attribute numbering error."); 589Debug.Assert(_nodeType == XmlNodeType.Element || _nodeType == XmlNodeType.EndElement, "Input is positioned on element or attribute"); 620Debug.Assert(_nodeType != XmlNodeType.Element || _attributesRead, "Should first read attributes"); 628Debug.Assert(_nodeType != XmlNodeType.Element || _attributesRead, "Should first read attributes"); 637Debug.Assert(_nodeType != XmlNodeType.Element || _attributesRead, "Should first read attributes"); 650Debug.Assert(IsKeyword(_atoms.Version)); 714Debug.Assert(NodeType == XmlNodeType.Element); 715Debug.Assert(attributes.Length <= _xsltAttributeNumber.Length); 750Debug.Assert(SS, "First we parse xsl:stylesheet element"); 843Debug.Assert(NodeType == XmlNodeType.Element); 921Debug.Assert(NodeType == XmlNodeType.Element && IsXsltNamespace()); 948Debug.Assert(extensions ? IsKeyword(_atoms.ExtensionElementPrefixes) : IsKeyword(_atoms.ExcludeResultPrefixes)); 1001Debug.Assert(IsKeyword(_atoms.XPathDefaultNamespace)); 1013Debug.Assert(IsKeyword(_atoms.DefaultCollation)); 1095Debug.Assert(prefix != null); 1099Debug.Assert(Ref.Equal(_atoms.NameTable.Get(nsUri), nsUri), "Namespaces must be atomized"); 1179Debug.Assert(input.NodeType == XmlNodeType.EndElement); 1184Debug.Assert(input.NodeType == XmlNodeType.Element || input.NodeType == XmlNodeType.Attribute);
System\Xml\Xsl\Xslt\XsltLoader.cs (42)
43Debug.Assert(compiler != null); 98Debug.Fail("Should never get here"); 102Debug.Assert(compiler.Root != null); 177Debug.Assert(_compiler.Version != 0, "Version should be already decided at this point"); 236Debug.Assert(!_documentUriInUse.Contains(baseUri), "Circular references must be checked while processing xsl:include and xsl:import"); 298Debug.Assert(_input.NodeType == XmlNodeType.Element); 323Debug.Assert(!_input.IsXsltNamespace()); 324Debug.Assert(_curTemplate == null); 341Debug.Fail("AddTemplate() returned false for simplified stylesheet"); 355Debug.Assert(_input.IsXsltNamespace() && (_input.IsKeyword(_atoms.Stylesheet) || _input.IsKeyword(_atoms.Transform))); 468Debug.Assert(_input.NodeType == XmlNodeType.Text); 825Debug.Assert(attSet != null); 836Debug.Assert(attSet.CycleCheck == CycleCheck.Processing); 837Debug.Assert(attSet.Content[0].SourceLine != null); 957Debug.Assert(NumCharAttrs == DefaultValues.Length); 973Debug.Assert(dummy, "One of the attrs should have lineInfo. If both are default they can't conflict."); 993Debug.Assert(name.Equals(format.Name)); 1067Debug.Assert(setName != null, "Required attribute always != null"); 1112Debug.Assert(_input.NodeType == XmlNodeType.Text); 1123Debug.Assert(_curTemplate == null); 1124Debug.Assert(_input.CanHaveApplyImports == false); 1141Debug.Assert(_curTemplate == null); 1455Debug.Assert(_input.NodeType == XmlNodeType.Text); 1503Debug.Assert(_input.NodeType == XmlNodeType.Text); 1716Debug.Assert(_input.NodeType == XmlNodeType.Text); 1921Debug.Assert(nodeType != XslNodeType.Unknown); 2034Debug.Assert(_input.NodeType == XmlNodeType.Element); 2480Debug.Assert(_input.NodeType == XmlNodeType.Element); 2523Debug.Assert(content != null && withParam != null); 2524Debug.Assert(withParam.NodeType == XslNodeType.WithParam); 2537Debug.Assert(content != null); 2546Debug.Assert(content != null); 2800Debug.Assert(_input.IsRequiredAttribute(attNum), "It happened that @name as NCName is always required attribute"); 2890Debug.Assert(_input.LocalName == "use-attribute-sets", "we are positioned on this attribute"); 2891Debug.Assert(list != null && list.Count == 0, "It happened that we always add use-attribute-sets first. Otherwise we can't call list.Clear()"); 2954Debug.Assert(!_input.IsRequiredAttribute(attNum), "All Yes/No attributes are optional."); 2974Debug.Assert(!_input.IsRequiredAttribute(attNum), "All 'type' attributes are optional."); 2983Debug.Assert(!_input.IsRequiredAttribute(attNum), "All 'validation' attributes are optional."); 3009Debug.Assert(!_input.IsRequiredAttribute(attNum), "All 'input-type-validation' attributes are optional."); 3073Debug.Assert(node != null); 3080Debug.Assert(node != null); 3090Debug.Assert(to != null);
System\Xml\Xsl\Xslt\XsltQilFactory.cs (7)
28Debug.Assert(xt.IsSingleton && xt.IsStrict, "Xslt assumes that these types will always be singleton and strict"); 34Debug.Assert(IsDebug, "QName is reserved as the marker for missing values"); 37Debug.Assert(xt.IsNode, $"Unexpected expression type: {xt}"); 45Debug.Assert(n != null && n.XmlType!.IsSubtypeOf(T.QNameX), "Must be a singleton QName"); 121Debug.Assert(value != null && ( 140Debug.Assert(format != null); 153Debug.Assert(format != null);
System\Xml\Xsl\XsltOld\ActionFrame.cs (10)
100Debug.Assert(_variables != null && index < _variables.Length); 106Debug.Assert(_variables != null && index < _variables.Length); 113Debug.Assert(!_withParams.Contains(name), "We should check duplicate params at compile time"); 129Debug.Assert(nodeSet != null); 136Debug.Assert(nodeSet != null); 143Debug.Assert(0 < sortarray.Count); 155Debug.Assert(proc.ActionStack.Peek() == this, "the trick we are doing with proc.Current will work only if this is topmost frame"); 184Debug.Assert(parent != null); 221Debug.Assert(_action is ContainerAction); 327Debug.Assert(index > 0, "MoveNext() wasn't called");
System\Xml\Xsl\XsltOld\ApplyImportsAction.cs (1)
29Debug.Assert(processor != null && frame != null);
System\Xml\Xsl\XsltOld\ApplyTemplatesAction.cs (8)
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); 196Debug.Fail("Invalid ApplyTemplatesAction execution state");
System\Xml\Xsl\XsltOld\AttributeAction.cs (2)
118Debug.Assert(processor != null && frame != null); 165Debug.Fail("Invalid ElementAction execution state");
System\Xml\Xsl\XsltOld\AttributeSetAction.cs (1)
34Debug.Assert(this.name == null);
System\Xml\Xsl\XsltOld\Avt.cs (6)
21Debug.Assert(constAvt != null); 27Debug.Assert(eventList != null); 45Debug.Assert(_constAvt != null); 50Debug.Assert(processor != null && frame != null); 65Debug.Assert(compiler != null); 66Debug.Assert(avtText != null);
System\Xml\Xsl\XsltOld\AvtEvent.cs (2)
18Debug.Assert(key != Compiler.InvalidQueryKey); 24Debug.Assert(_key != Compiler.InvalidQueryKey);
System\Xml\Xsl\XsltOld\BeginEvent.cs (3)
26Debug.Assert(input != null); 27Debug.Assert(input.NodeType != XPathNodeType.Namespace); 46Debug.Assert(!_replaceNSAliasesDone, "Second attempt to replace NS aliases!. This bad.");
System\Xml\Xsl\XsltOld\BuilderInfo.cs (1)
85Debug.Assert(info.NodeType != XmlNodeType.Text || XmlCharType.IsOnlyWhitespace(info.Value));
System\Xml\Xsl\XsltOld\CallTemplateAction.cs (3)
30Debug.Assert(_name == null); 84Debug.Assert(processor != null && frame != null); 112Debug.Fail("Invalid CallTemplateAction execution state");
System\Xml\Xsl\XsltOld\CommentAction.cs (2)
26Debug.Assert(processor != null && frame != null); 51Debug.Fail("Invalid IfAction execution state");
System\Xml\Xsl\XsltOld\Compiler.cs (42)
100Debug.Assert(_atoms != null); 123Debug.Assert(Document != null); 129Debug.Assert(Document != null); 135Debug.Assert(Document != null); 149Debug.Assert(_rootAction == null); 151Debug.Assert(_currentTemplate == null); 172Debug.Assert(input != null); 173Debug.Assert(xmlResolver != null); 174Debug.Assert(_input == null && _atoms == null); 186Debug.Assert(_input != null && _atoms != null); 216Debug.Assert(_rootAction != null); 217Debug.Assert(this.stylesheet != null); 218Debug.Assert(_queryStore != null); 219Debug.Assert(_input == null && _atoms == null); 321Debug.Assert(_rootAction != null); 326Debug.Assert(_currentTemplate != null); 327Debug.Assert(variable.VarType == VariableType.LocalVariable || variable.VarType == VariableType.LocalParameter || variable.VarType == VariableType.WithParameter); 464Debug.Assert(value != null); 465Debug.Assert((object)value == (object)Input!.Value); // this is always true. Why we passing value to this function. 551Debug.Assert(!_documentURIs.Contains(href), "Circular references must be checked while processing xsl:include and xsl:import"); 557Debug.Assert(_documentURIs.Contains(href), "Attempt to remove href that was not added"); 568Debug.Assert(_xmlResolver != null); 580Debug.Assert(_xmlResolver != null); 605Debug.Assert(newInput != null); 618Debug.Assert(_input != null); 619Debug.Assert(_input.Atoms == _atoms); 654Debug.Assert(this.stylesheet == _stylesheets!.Peek()); 666Debug.Assert(this.stylesheet == _stylesheets!.Peek()); 676Debug.Assert(this.stylesheet == _stylesheets!.Peek()); 682Debug.Assert(_currentTemplate != null); 690Debug.Assert(_currentTemplate != null); 709Debug.Assert(_queryStore != null); 781Debug.Assert( 805Debug.Assert(avt.Length != start, "Empty string not supposed here"); 806Debug.Assert(lex.Length == 0, "Builder should to be reset here"); 845Debug.Assert(avt.Length != start, "Empty string not supposed here"); 846Debug.Assert(lex.Length == 0, "Builder should to be reset here"); 847Debug.Assert(avt[start] == '{', "We calling getXPathLex() only after we really meet {"); 898Debug.Assert(start <= avt.Length); 915Debug.Assert(saveStart < start, "We have to read something. Otherwise it's dead loop."); 922Debug.Assert(avtText != null); 944Debug.Assert(!constant || list.Count <= 1, "We can't have more then 1 text event if now {avt} found");
System\Xml\Xsl\XsltOld\ContainerAction.cs (9)
168Debug.Assert(compiler.Input.NodeType == XPathNodeType.Element); 230Debug.Assert(uri != null); 674Debug.Assert(Ref.Equal(input.NamespaceURI, input.Atoms.UriXsl)); 758Debug.Assert(action != null); 792Debug.Fail("Unexpected node type."); 854Debug.Assert((object)this == (object)compiler.RootAction); 953Debug.Assert(processor != null && frame != null); 974Debug.Fail("Invalid Container action execution state"); 981Debug.Assert(actionIndex == 0 || this.containedActions != null);
System\Xml\Xsl\XsltOld\CopyAction.cs (2)
52Debug.Assert(processor != null && frame != null); 116Debug.Fail("Invalid CopyAction execution state");
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 (6)
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); 78Debug.Fail("Invalid CopyCodeAction execution state");
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 (3)
70Debug.Assert(_empty == false); 103Debug.Assert(processor != null && frame != null); 152Debug.Fail("Invalid ElementAction execution state");
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 (4)
65Debug.Assert(processor != null && frame != null); 72Debug.Assert(_testKey != Compiler.InvalidQueryKey); 88Debug.Assert(frame.Container != null); 96Debug.Fail("Invalid IfAction execution state");
System\Xml\Xsl\XsltOld\InputScope.cs (1)
92Debug.Assert(variable != null);
System\Xml\Xsl\XsltOld\InputScopeManager.cs (16)
32Debug.Assert(_scopeStack != null); 33Debug.Assert(_scopeStack.Parent != null); 59Debug.Assert(_scopeStack != null, "Push/Pop disbalance"); 75Debug.Assert(_scopeStack != null, "PushScope wasn't called"); 76Debug.Assert(prefix != null); 77Debug.Assert(nspace != null); 95Debug.Assert(_scopeStack != null, "PushScope wasn't called"); 96Debug.Assert(!string.IsNullOrEmpty(prefix)); 119Debug.Assert(prefix != null); 129Debug.Assert(prefix != null); 139Debug.Assert(_scopeStack != null, "PushScope wasn't called"); 140Debug.Assert(nsList != null); 149Debug.Assert(_scopeStack != null, "PushScope wasn't called"); 162Debug.Assert(_scopeStack != null, "PushScope wasn't called"); 163Debug.Assert(nsList != null); 172Debug.Assert(_scopeStack != null, "PushScope wasn't called");
System\Xml\Xsl\XsltOld\MessageAction.cs (3)
46Debug.Assert(processor != null && frame != null); 58Debug.Assert(recOutput != null); 68Debug.Fail("Invalid MessageAction execution state");
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 (3)
28Debug.Assert(record != null); 40Debug.Assert(record.AttributeList[attrib] is BuilderInfo); 86Debug.Fail($"Invalid NodeType on output: {mainNode.NodeType}");
System\Xml\Xsl\XsltOld\newinstructionaction.cs (2)
51Debug.Assert(processor != null && frame != null); 72Debug.Fail("Invalid Container action execution state");
System\Xml\Xsl\XsltOld\NumberAction.cs (14)
84Debug.Assert(dblVal >= 1); 256Debug.Assert( 342Debug.Assert(nav.NodeType != XPathNodeType.Attribute && nav.NodeType != XPathNodeType.Namespace); 343Debug.Assert(MatchCountKey(processor, contextNode, nav)); 357Debug.Fail("We implementing preceding-sibling::node() and some how miss context node '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); 454Debug.Fail("Invalid Number Action execution state"); 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 (3)
61Debug.Assert(processor != null && frame != null); 88Debug.Assert(frame.StoredOutput != null); 108Debug.Fail("Invalid ElementAction execution state");
System\Xml\Xsl\XsltOld\Processor.cs (45)
128Debug.Assert(_execResult == ExecResult.Continue); 142Debug.Assert(_resolver != null, "Constructor should create it if null passed"); 151Debug.Assert(_sortArray != null, "InitSortArray() wasn't called"); 202Debug.Assert(_sortArray != null, "InitSortArray() wasn't called"); 280Debug.Assert(!_stringBuilderLocked); 437Debug.Assert(_actionStack != null); 445Debug.Assert(_builder != null); 477Debug.Assert(frame != null); 506Debug.Assert(_templateLookup != null); 513Debug.Assert(key != Compiler.InvalidQueryKey); 519Debug.Assert(key != Compiler.InvalidQueryKey); 534Debug.Assert(key != Compiler.InvalidQueryKey); 603Debug.Assert(nav.NodeType == XPathNodeType.Element); 722Debug.Assert(_builder != null); 732Debug.Assert(_xsm != null); 746Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State); 747Debug.Assert(ExecutionResult == ExecResult.Continue); 751Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State); 763Debug.Fail("Unexpected result of RecordBuilder.BeginEvent()"); 775Debug.Assert(_xsm != null); 788Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State); 789Debug.Assert(ExecutionResult == ExecResult.Continue); 793Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State); 803Debug.Fail("Unexpected result of RecordBuilder.TextEvent()"); 810Debug.Assert(_xsm != null); 824Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State); 828Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State, 838Debug.Fail("Unexpected result of RecordBuilder.TextEvent()"); 866Debug.Fail("Invalid XPathNodeType in CopyBeginEvent"); 895Debug.Fail("Invalid XPathNodeType in CopyTextEvent"); 925Debug.Fail("Invalid XPathNodeType in CopyEndEvent"); 934Debug.Assert(navigator != null); 957Debug.Assert(output != null); 968Debug.Assert(_builder != null); 1017Debug.Assert(saveStackSize == _actionStack.Length); 1019Debug.Assert(result != null, "Variable was just calculated and result can't be null"); 1030Debug.Assert(1 < _actionStack.Length); 1043Debug.Assert(2 < _actionStack.Length); 1058Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger"); 1070Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger"); 1076Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger"); 1078Debug.Assert(dbgFrame != null, "PushDebuggerStack() wasn't ever called"); 1085Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger"); 1086Debug.Assert(2 <= _debuggerStack!.Length); 1092Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger");
System\Xml\Xsl\XsltOld\ReaderOutput.cs (29)
43Debug.Assert(processor != null); 44Debug.Assert(processor.NameTable != null); 190Debug.Assert(ordinal >= 0); 195Debug.Assert(ordinal == -1); 205Debug.Assert(ordinal >= 0); 210Debug.Assert(ordinal == -1); 236Debug.Assert(ordinal >= 0); 242Debug.Assert(ordinal == -1); 252Debug.Assert(ordinal >= 0); 258Debug.Assert(ordinal == -1); 274Debug.Assert(_attributeCount == 0); 308Debug.Assert(_processor != null || _state == ReadState.Closed); 344Debug.Assert(Value.Length != 0, "It whould be Whitespace in this case"); 360Debug.Assert(_processor.ExecutionDone); 446Debug.Assert(_builder != null); 450Debug.Assert(NodeType == XmlNodeType.EndElement); 484Debug.Assert(_builder != null); 518Debug.Assert(_nameTable != null); 536Debug.Assert(NodeType != XmlNodeType.EntityReference); 604Debug.Assert(0 <= attrib && attrib < _attributeCount); 605Debug.Assert(0 <= attrib && attrib < _attributeList!.Count); 606Debug.Assert(_attributeList[attrib] is BuilderInfo); 617Debug.Assert(_attributeList![attrib] is BuilderInfo); 629Debug.Assert(_attributeList![index] is BuilderInfo); 649Debug.Assert(_attributeList![index] is BuilderInfo); 676Debug.Assert(_currentInfo != null); 677Debug.Assert(_attributeCount == 0 || _attributeList != null); 678Debug.Assert((_currentIndex == -1) == (_currentInfo == _mainNode)); 679Debug.Assert((_currentIndex == -1) || (_currentInfo == _attributeValue || _attributeList![_currentIndex] is BuilderInfo && _attributeList[_currentIndex] == _currentInfo));
System\Xml\Xsl\XsltOld\RecordBuilder.cs (24)
55Debug.Assert(output != null); 110Debug.Assert(_recordState != HaveRecord); 134Debug.Assert(_recordState == NoRecord || (state & StateMachine.BeginRecord) == 0); 186Debug.Assert(_recordState == NoRecord || (state & StateMachine.BeginRecord) == 0); 257Debug.Assert(_attributeCount <= _attributeList.Count); 261Debug.Assert(_attributeList[attrib] != null && _attributeList[attrib] is BuilderInfo); 284Debug.Assert(_attributeCount == 0); 298Debug.Assert(_attributeCount == 0); 312Debug.Assert(_attributeCount == _attributeList.Count); 327Debug.Assert(_attributeList[attrib] != null && _attributeList[attrib] is BuilderInfo); 413Debug.Assert(_recordState == NoRecord || _recordState == SomeRecord); 440Debug.Assert(_recordState == NoRecord || _recordState == SomeRecord); 458Debug.Assert(_recordState == NoRecord || _recordState == SomeRecord); 476Debug.Assert(_mainNode != null); 487Debug.Assert(_mainNode.NodeType == XmlNodeType.Element); 491Debug.Assert(_attributeList[attr] is BuilderInfo); 512Debug.Assert(_mainNode.NodeType == XmlNodeType.Element); 562Debug.Assert(_attributeList[attr] is BuilderInfo); 614Debug.Assert(_mainNode.NodeType == XmlNodeType.Comment); 615Debug.Assert((object?)_currentInfo == (object)_mainNode); 667Debug.Assert(_mainNode.NodeType == XmlNodeType.ProcessingInstruction || _mainNode.NodeType == XmlNodeType.XmlDeclaration); 740Debug.Assert(_namespaceCount == _namespaceList.Count); 750Debug.Assert(_namespaceList[index] != null && _namespaceList[index] is BuilderInfo); 781Debug.Assert(prefix != null && prefix.Length > 0);
System\Xml\Xsl\XsltOld\RootAction.cs (6)
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); 288Debug.Fail("Invalid RootAction execution state");
System\Xml\Xsl\XsltOld\SequentialOutput.cs (22)
109Debug.Assert(record.MainNode.NodeType == XmlNodeType.Element); 162Debug.Assert(!_isHtmlOutput || mainNode.Prefix != null, "Html can't have abbreviated elements"); 213Debug.Assert(i < node.TextInfoCount, "disableEscaping marker can't be last TextInfo record"); 232Debug.Assert(_outputDoctype, "It supposed to check this condition before actual call"); 233Debug.Assert(_output.DoctypeSystem != null || (_isHtmlOutput && _output.DoctypePublic != null), "We set outputDoctype == true only if"); 267Debug.Assert(_outputXmlDecl, "It supposed to check this condition before actual call"); 268Debug.Assert(_isXmlOutput && !_output.OmitXmlDeclaration, "We set outputXmlDecl == true only if"); 407Debug.Assert(_outputCache[record] is BuilderInfo); 436Debug.Fail("Should never get here"); 477Debug.Fail("Should never get here"); 485Debug.Fail("Should never get here"); 506Debug.Fail("Should never get here"); 536Debug.Assert(value != null); 542Debug.Assert(value != null); 574Debug.Assert(value != null); 575Debug.Assert(_isHtmlOutput); 630Debug.Assert(value != null); 631Debug.Assert(find.Length == replace.Length); 660Debug.Assert(0 <= i, "find char wasn't really find"); 681Debug.Assert(value != null); 687Debug.Assert(count <= list.Count); 690Debug.Assert(list[attrib] is BuilderInfo);
System\Xml\Xsl\XsltOld\SortAction.cs (2)
174Debug.Assert(processor != null && frame != null); 175Debug.Assert(frame.State == Initialized);
System\Xml\Xsl\XsltOld\StateMachine.cs (4)
100Debug.Assert(newState != Assrt); 107Debug.Assert(newState != Assrt); 119Debug.Assert(newState != Assrt); 126Debug.Assert(newState != Assrt);
System\Xml\Xsl\XsltOld\Stylesheet.cs (18)
150Debug.Assert(attributeSet.Name != null); 172Debug.Assert(_templateNameTable != null); 202Debug.Assert(_templates == null); 206Debug.Assert(manager != null); 220Debug.Assert(enumerator.Value is TemplateManager); 230Debug.Assert(_imports[importIndex] is Stylesheet); 232Debug.Assert(stylesheet != null); 283Debug.Assert(processor != null && navigator != null); 284Debug.Assert(mode != null); 296Debug.Assert(manager.Mode.Equals(mode)); 320Debug.Assert(_imports[importIndex] is Stylesheet); 322Debug.Assert(stylesheet != null); 342Debug.Assert(processor != null && navigator != null); 343Debug.Assert(_templates == null && _modeManagers == null || _templates == _modeManagers![XmlQualifiedName.Empty]); 388Debug.Assert(_imports[importIndex] is Stylesheet); 390Debug.Assert(stylesheet != null); 420Debug.Assert(_imports[importIndex] is Stylesheet); 422Debug.Assert(stylesheet != null);
System\Xml\Xsl\XsltOld\TemplateAction.cs (8)
48Debug.Assert(_templateId == 0); 96Debug.Assert(_matchKey == Compiler.InvalidQueryKey); 101Debug.Assert(_name == null); 106Debug.Assert(double.IsNaN(_priority)); 115Debug.Assert(_mode == null); 139Debug.Assert(!(union.qy2 is UnionExpr), "only qy1 can be union"); 225Debug.Assert(processor != null && frame != null); 248Debug.Fail("Invalid Container action execution state");
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 (2)
69Debug.Assert(processor != null && frame != null); 81Debug.Fail("Invalid execution state in TextAction");
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 (3)
26Debug.Assert(Ref.Equal(compiler.Input.LocalName, compiler.Atoms.UseAttributeSets)); 29Debug.Assert(_useAttributeSets == null); 85Debug.Fail("Invalid Container action execution state");
System\Xml\Xsl\XsltOld\ValueOfAction.cs (11)
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); 84Debug.Fail("Invalid ValueOfAction execution state"); 95Debug.Assert(processor != null && frame != null); 100Debug.Assert(frame != null); 101Debug.Assert(frame.NodeSet != null); 117Debug.Assert(frame.StoredOutput != null); 123Debug.Fail("Invalid BuiltInRuleTextAction execution state");
System\Xml\Xsl\XsltOld\VariableAction.cs (5)
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); 180Debug.Fail("Invalid execution state inside VariableAction.Execute");
System\Xml\Xsl\XsltOld\WithParamAction.cs (3)
34Debug.Assert(processor != null && frame != null); 61Debug.Assert(recOutput is NavigatorOutput); 66Debug.Fail("Invalid execution state inside VariableAction.Execute");
System\Xml\Xsl\XsltOld\WriterOutput.cs (4)
46Debug.Fail("XSLT never gives us CDATA"); 75Debug.Fail($"Invalid NodeType on output: {mainNode.NodeType}"); 91Debug.Assert(list.Count >= count); 94Debug.Assert(list[attrib] is BuilderInfo);
System\Xml\Xsl\XsltOld\XsltCompileContext.cs (11)
255Debug.Assert(thisUri != null && baseUri != null); 329Debug.Assert( 344Debug.Assert( 656Debug.Assert(it != null); 736Debug.Fail("unexpected XPath type"); 920Debug.Assert(resultCollection.Count != 0); 921Debug.Assert(newList.Count != 0); 925Debug.Assert(resultCollection[0] is XPathNavigator); 962Debug.Assert(extension != null); 963Debug.Assert(method != null); 995Debug.Assert(args.Length <= this.Minargs, "We are checking this on resolve time");
System\Xml\Xsl\XsltOld\XsltOutput.cs (2)
147Debug.Assert(_encoding != null); 219Debug.Fail("Override invoked");
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 (32)
System\Xml\Linq\XContainer.cs (4)
8using Debug = System.Diagnostics.Debug; 1059Debug.Assert(e != null, "EndElement received but the current container is not an element."); 1175Debug.Assert(e != null, "EndElement received but the current container is not an element."); 1247Debug.Assert(content != null);
System\Xml\Linq\XElement.cs (1)
1982Debug.Assert(e != null);
System\Xml\Linq\XHashtable.cs (6)
7using Debug = System.Diagnostics.Debug; 147Debug.Assert(BitOperations.IsPow2(capacity), "capacity must be a power of 2"); 148Debug.Assert(extractKey != null, "extractKey may not be null"); 200Debug.Assert(entryIdx == EndOfList, "Resize() should only be called by one thread"); 232Debug.Assert(entryIdx == FullList, "Linked list should have been closed when it was counted"); 398Debug.Assert(key != null, "key should have been checked previously for null");
System\Xml\Linq\XHelper.cs (2)
5using Debug = System.Diagnostics.Debug; 13Debug.Assert(type != null);
System\Xml\Linq\XNamespace.cs (6)
5using Debug = System.Diagnostics.Debug; 217Debug.Assert(index >= 0 && index <= localName.Length, "Caller should have checked that index was in bounds"); 218Debug.Assert(count >= 0 && index + count <= localName.Length, "Caller should have checked that count was in bounds"); 235Debug.Assert(index >= 0 && index <= namespaceName.Length, "Caller should have checked that index was in bounds"); 236Debug.Assert(count >= 0 && index + count <= namespaceName.Length, "Caller should have checked that count was in bounds"); 274Debug.Assert(n != null, "Null name should never exist here");
System\Xml\Linq\XNode.cs (1)
65Debug.Assert(parent.content != null);
System\Xml\Linq\XNodeReader.cs (2)
4using Debug = System.Diagnostics.Debug; 1386Debug.Assert(_omitDuplicateNamespaces, "This method should only be called if we're omitting duplicate namespace attribute. For perf reason it's better to test this flag in the caller method.");
System\Xml\Linq\XObject.cs (2)
6using Debug = System.Diagnostics.Debug; 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 (2)
883Debug.Assert(navigator.UnderlyingObject != null); 1032System.Diagnostics.Debug.Fail("Parent node doesn't contain itself.");
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 (30)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeNameBuilder.cs (6)
37Debug.Assert(_instNesting != 0); 53Debug.Assert(_instNesting != 0); 69Debug.Assert(_instNesting != 0); 81Debug.Assert(name != null); 93Debug.Assert(rank > 0); 134Debug.Assert(_instNesting == 0);
System\Reflection\Emit\FieldBuilderImpl.cs (1)
127Debug.Assert(binaryAttribute.Length >= 6);
System\Reflection\Emit\ILGeneratorImpl.cs (5)
407Debug.Assert(opcode.Equals(OpCodes.Call) || 416Debug.Assert(opcode.Equals(OpCodes.Call) || 455Debug.Assert(labelStartDepth >= -1); 456Debug.Assert(targetDepth >= -1); 552Debug.Assert(opcode.Equals(OpCodes.Calli), "Unexpected opcode encountered for StackBehaviour VarPop.");
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 (382)
src\libraries\Common\src\System\HexConverter.cs (3)
165Debug.Assert(chars.Length >= bytes.Length * 2); 332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\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 (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0); 298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Reflection\Internal\MemoryBlocks\ByteArrayMemoryProvider.cs (2)
19Debug.Assert(!array.IsDefault); 25Debug.Assert(disposing);
System\Reflection\Internal\MemoryBlocks\ExternalMemoryBlockProvider.cs (1)
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 (4)
40Debug.Assert(block.Length >= 0 && (block.Pointer != null || block.Length == 0)); 137Debug.Assert((alignment & (alignment - 1)) == 0, "Alignment must be a power of two."); 138Debug.Assert(remainder >= 0 && remainder < alignment); 514Debug.Assert(bytesRead == 4);
System\Reflection\Metadata\BlobWriter.cs (5)
40Debug.Assert(buffer != null); 41Debug.Assert(count >= 0); 42Debug.Assert(count <= buffer.Length - start); 109Debug.Assert(value >= 0); 359Debug.Assert(unchecked((ushort)reference) == reference);
System\Reflection\Metadata\BlobWriterImpl.cs (1)
18Debug.Assert(value <= MaxCompressedIntegerValue);
System\Reflection\Metadata\Ecma335\BlobDictionary.cs (1)
58Debug.Assert(immutableKey.AsSpan().SequenceEqual(key));
System\Reflection\Metadata\Ecma335\Encoding\ControlFlowBuilder.cs (9)
119Debug.Assert(operandOffset >= 0); 120Debug.Assert(_branches.Count == 0 || operandOffset > _branches[_branches.Count - 1].OperandOffset); 126Debug.Assert(opCode.GetBranchOperandSize() == 1); 129Debug.Assert(opCode == ILOpCode.Switch || opCode.GetBranchOperandSize() == 4); 132Debug.Assert(instructionEndDisplacement > 4 && instructionEndDisplacement % 4 == 0 && opCode == ILOpCode.Switch); 141Debug.Assert(ilOffset >= 0); 295Debug.Assert( 319Debug.Assert( 414Debug.Assert(_lazyExceptionHandlers != null);
System\Reflection\Metadata\Ecma335\Encoding\ExceptionRegionEncoder.cs (2)
82Debug.Assert(exceptionRegionCount > 0); 99Debug.Assert(dataSize <= 0x00ffffff);
System\Reflection\Metadata\Ecma335\Encoding\LabelHandle.cs (1)
18Debug.Assert(id >= 1);
System\Reflection\Metadata\Ecma335\Encoding\SwitchInstructionEncoder.cs (1)
22Debug.Assert(encoder.ControlFlowBuilder is not null);
System\Reflection\Metadata\Ecma335\MetadataAggregator.cs (3)
67Debug.Assert(baseTableRowCounts != null); 271Debug.Assert(sizes[generation] == size); 304Debug.Assert(sizes[generation].AggregateInserts == rowId);
System\Reflection\Metadata\Ecma335\MetadataBuilder.cs (5)
17Debug.Assert(HeapIndex.UserString == 0); 18Debug.Assert((int)HeapIndex.String == 1); 19Debug.Assert((int)HeapIndex.Blob == 2); 20Debug.Assert((int)HeapIndex.Guid == 3); 97Debug.Assert(endOffset - startOffset == sizes.MetadataHeaderSize);
System\Reflection\Metadata\Ecma335\MetadataBuilder.Tables.cs (2)
1872Debug.Assert(metadataSizes.MetadataTableStreamSize == endPosition - startPosition); 1919Debug.Assert(metadataSizes.CalculateTableStreamHeaderSize() == endPosition - startPosition);
System\Reflection\Metadata\Ecma335\MetadataReaderExtensions.cs (2)
126Debug.Assert(reader != null); 227Debug.Assert(reader != null);
System\Reflection\Metadata\Ecma335\MetadataRootBuilder.cs (1)
61Debug.Assert(BlobUtilities.GetUTF8ByteCount(DefaultMetadataVersionString) == DefaultMetadataVersionString.Length);
System\Reflection\Metadata\Ecma335\MetadataSizes.cs (18)
127Debug.Assert(rowCounts.Length == MetadataTokens.TableCount); 128Debug.Assert(externalRowCounts.Length == MetadataTokens.TableCount); 129Debug.Assert(heapSizes.Length == MetadataTokens.HeapCount); 155Debug.Assert((PresentTablesMask & ExternalTablesMask) == 0); 275Debug.Assert(rowCounts[(int)TableIndex.FieldPtr] == 0); 277Debug.Assert(rowCounts[(int)TableIndex.MethodPtr] == 0); 279Debug.Assert(rowCounts[(int)TableIndex.ParamPtr] == 0); 291Debug.Assert(rowCounts[(int)TableIndex.EventPtr] == 0); 294Debug.Assert(rowCounts[(int)TableIndex.PropertyPtr] == 0); 305Debug.Assert(rowCounts[(int)TableIndex.AssemblyProcessor] == 0); 306Debug.Assert(rowCounts[(int)TableIndex.AssemblyOS] == 0); 308Debug.Assert(rowCounts[(int)TableIndex.AssemblyRefProcessor] == 0); 309Debug.Assert(rowCounts[(int)TableIndex.AssemblyRefOS] == 0); 362Debug.Assert(RegularStreamHeaderSizes == 369Debug.Assert(EncDeltaMarkerStreamHeaderSize == GetMetadataStreamHeaderSize("#JTD")); 370Debug.Assert(StandalonePdbStreamHeaderSize == GetMetadataStreamHeaderSize("#Pdb")); 445Debug.Assert(result % StreamAlignment == 0); 480Debug.Assert(RowCounts[(int)table] == 0 || ExternalRowCounts[(int)table] == 0);
System\Reflection\Metadata\Ecma335\PortablePdbBuilder.cs (3)
63Debug.Assert(BlobUtilities.GetUTF8ByteCount(MetadataVersion) == MetadataVersion.Length); 116Debug.Assert(_serializedMetadata.Sizes.CalculateStandalonePdbStreamSize() == endPosition - startPosition); 150Debug.Assert(idWriter.RemainingBytes == 0);
System\Reflection\Metadata\Ecma335\SignatureDecoder.cs (1)
323Debug.Assert(handle.IsNil); // will fall through to throw in release.
System\Reflection\Metadata\EntityHandle.cs (1)
93Debug.Assert(!IsVirtual);
System\Reflection\Metadata\Handle.cs (9)
38Debug.Assert(value >= 0); 45Debug.Assert(IsHeapHandle && value <= HeapHandleType.OffsetMask || 54Debug.Assert(!IsHeapHandle); 64Debug.Assert(IsHeapHandle); 92Debug.Assert((_value & TokenTypeIds.RIDMask) == _value); 104Debug.Assert((_value & TokenTypeIds.RIDMask) == _value); 155Debug.Assert(IsEntityOrUserStringHandle); 156Debug.Assert(!IsVirtual); 157Debug.Assert((_value & TokenTypeIds.RIDMask) == _value);
System\Reflection\Metadata\IL\MethodBodyBlock.cs (1)
29Debug.Assert(!exceptionRegions.IsDefault);
System\Reflection\Metadata\Internal\MetadataWriterUtilities.cs (1)
19Debug.Assert(!value.GetType().GetTypeInfo().IsEnum);
System\Reflection\Metadata\Internal\NamespaceCache.cs (14)
21Debug.Assert(reader != null); 36Debug.Assert(!handle.HasFullName); // we should not hit the cache in this case. 44Debug.Assert(_rootNamespace != null); 78Debug.Assert(!handleContainingSegment.IsVirtual); 93Debug.Assert(lastFoundIndex >= 0 || currentSegment == 0); 178Debug.Assert(data.Namespaces!.Count == 0); 208Debug.Assert(realChild.HasFullName); 233Debug.Assert(child != null && parent != null); 234Debug.Assert(!child.Handle.IsNil); 247Debug.Assert(realChild.Handle.HasFullName); 327Debug.Assert(table != null); 359Debug.Assert(table != null); 377Debug.Assert(namespaceHandle.HasFullName); 397Debug.Assert(_namespaceTable != null);
System\Reflection\Metadata\Internal\StringHeap.cs (15)
116Debug.Assert(s_virtualValues[i] != null, $"Missing virtual value for StringHandle.VirtualIndex.{(StringHandle.VirtualIndex)i}"); 164Debug.Assert(handle.StringKind != StringKind.Virtual); 172Debug.Assert(handle.StringKind != StringKind.Virtual); 183Debug.Assert(handle.StringKind != StringKind.Virtual); 194Debug.Assert(handle.IsVirtual); 206Debug.Assert(handle.IsVirtual); 249Debug.Assert(value != null); 268Debug.Assert(value != null); 290Debug.Assert(!rawHandle.IsVirtual); 291Debug.Assert(rawHandle.StringKind != StringKind.DotTerminated, "Not supported"); 300Debug.Assert(asciiChar != 0 && asciiChar <= 0x7f); 309Debug.Assert(!rawHandle.IsVirtual); 310Debug.Assert(rawHandle.StringKind != StringKind.DotTerminated, "Not supported"); 319Debug.Assert(!rawHandle.IsVirtual); 320Debug.Assert(rawHandle.StringKind != StringKind.DotTerminated, "Not supported");
System\Reflection\Metadata\Internal\Tables.cs (11)
44Debug.Assert(NumberOfRows > 0); 50Debug.Assert(NumberOfRows > 0); 56Debug.Assert(NumberOfRows > 0); 62Debug.Assert(NumberOfRows > 0); 68Debug.Assert(NumberOfRows > 0); 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\TypeName.cs (1)
145Debug.Fail("Pre-allocated full name should have been provided in the ctor");
System\Reflection\Metadata\TypeNameParser.cs (1)
240Debug.Assert(nestedNameLength > 0, "TryGetTypeNameInfo should return error on zero lengths");
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 (4)
20Debug.Assert(reader != null); 21Debug.Assert(treatmentAndRowId != 0); 24Debug.Assert((treatmentAndRowId & ~(TokenTypeIds.VirtualBit | TokenTypeIds.RIDMask)) == 0); 175Debug.Assert(false, "Unexpected virtual index value");
System\Reflection\Metadata\TypeSystem\Constant.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(rowId != 0);
System\Reflection\Metadata\TypeSystem\CustomAttribute.cs (3)
18Debug.Assert(reader != null); 19Debug.Assert(treatmentAndRowId != 0); 141Debug.Assert(false, $"Unexpected treatment {treatment}");
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 (4)
18Debug.Assert(reader != null); 19Debug.Assert(treatmentAndRowId != 0); 112Debug.Assert(false, "Unknown TypeRef treatment"); 140Debug.Assert(false, "Unknown TypeRef treatment");
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 (154)
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 (2)
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. 53Debug.Fail("This code path should be unreachable.");
System\Reflection\Runtime\BindingFlagSupport\MemberPolicies.cs (1)
221Debug.Fail("Unknown MemberInfo type.");
System\Reflection\Runtime\BindingFlagSupport\NestedTypePolicies.cs (1)
28Debug.Assert(reflectedType.Equals(type)); // NestedType queries are always performed as if BindingFlags.DeclaredOnly are set so the reflectedType should always be the declaring type.
System\Reflection\Runtime\BindingFlagSupport\QueriedMemberList.cs (6)
70Debug.Assert(index >= 0 && index < _totalCount); 78Debug.Assert(index >= 0 && index < _totalCount); 174Debug.Assert((allFlagsThatMustMatch & ~validBits) == 0); 175Debug.Assert(((allFlagsThatMustMatch & BindingFlags.Public) == 0) != ((allFlagsThatMustMatch & BindingFlags.NonPublic) == 0)); 176Debug.Assert(((allFlagsThatMustMatch & BindingFlags.Instance) == 0) != ((allFlagsThatMustMatch & BindingFlags.Static) == 0)); 177Debug.Assert((allFlagsThatMustMatch & BindingFlags.FlattenHierarchy) == 0 || (allFlagsThatMustMatch & BindingFlags.Static) != 0);
System\Reflection\Runtime\BindingFlagSupport\Shared.cs (2)
25Debug.Assert(methodBase != null); 26Debug.Assert(argumentTypes != null);
System\Reflection\Runtime\General\ListBuilder.cs (2)
28Debug.Assert(index < Count); 38Debug.Assert(!_toArrayAlreadyCalled, "Cannot call ListBuilder.ToArray() a second time. Copy the one you already got.");
System\Reflection\Runtime\SignatureTypeExtensions.cs (3)
35Debug.Assert(pattern.IsSignatureType()); 107Debug.Assert(signatureType.IsSignatureType()); 113Debug.Assert(signatureType.IsSignatureType());
System\Reflection\TypeLoading\Assemblies\AssemblyFileInfo.cs (1)
16Debug.Assert(name != null);
System\Reflection\TypeLoading\Assemblies\Ecma\EcmaAssembly.cs (4)
22Debug.Assert(loader != null); 23Debug.Assert(peReader != null); 24Debug.Assert(reader != null); 25Debug.Assert(location != null);
System\Reflection\TypeLoading\Assemblies\RoAssembly.GetForwardedTypes.cs (1)
38Debug.Assert((type != null) != (exception != null)); // Exactly one of these must be non-null.
System\Reflection\TypeLoading\Assemblies\RoAssembly.Modules.cs (1)
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\CustomAttributes\Ecma\EcmaCustomAttributeHelpers.cs (1)
166Debug.Fail("Invalid CustomAttributeNamedArgumentKind value: " + cang.Kind);
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\CoreType.cs (1)
133Debug.Fail("Unexpected coreType passed to GetCoreTypeFullName: " + coreType);
System\Reflection\TypeLoading\General\Ecma\EcmaHelpers.cs (1)
54Debug.Fail("Unexpected PrimitiveTypeCode: " + typeCode);
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 (3)
21Debug.Assert(!handle.IsNil); 22Debug.Assert(reader != null); 37Debug.Fail($"Invalid handle passed to ToTypeString: 0x{handle.GetToken():x8}");
System\Reflection\TypeLoading\General\Ecma\GuardedPEReader.cs (3)
29Debug.Assert(loader != null); 30Debug.Assert(peReader != null); 31Debug.Assert(reader != null);
System\Reflection\TypeLoading\General\Ecma\MetadataTable.cs (2)
31Debug.Assert(!handle.IsNil); 32Debug.Assert(factory != null);
System\Reflection\TypeLoading\General\Helpers.cs (5)
92Debug.Assert(rank == 1 || multiDim); 209Debug.Assert(fullName != null); 232Debug.Assert(ns != null, "For top level types, the namespace must be string.Empty, not null"); 233Debug.Assert(name != null); 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 (7)
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); 197Debug.Fail("Bucket " + bucket + " has a cycle in its linked list."); 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 (48)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (7)
152Debug.Assert(_resourceList != null); 294Debug.Assert(resMgrHeaderBlob.Length > 0, "ResourceWriter: Expected non empty header"); 388Debug.Assert((bw.BaseStream.Position & 7) == 0, "ResourceWriter: Name hashes array won't be 8 byte aligned! Ack!"); 399Debug.Assert((bw.BaseStream.Position & 3) == 0, "ResourceWriter: Name positions array won't be 4 byte aligned! Ack!"); 425Debug.Assert(startOfDataSection == bw.Seek(0, SeekOrigin.Current), "ResourceWriter::Generate - start of data section is wrong!"); 517Debug.Assert(writer != null); 635Debug.Assert(typeCode >= ResourceTypeCode.StartOfUserTypes, $"ResourceReader: Unsupported ResourceTypeCode in .resources file! {typeCode}");
src\libraries\System.Private.CoreLib\src\System\IO\PinnedBufferMemoryStream.cs (1)
19Debug.Assert(array != null, "Array can't be null");
src\libraries\System.Private.CoreLib\src\System\Resources\FastResourceComparer.cs (5)
75Debug.Assert(a != null && bytes != null, "FastResourceComparer::CompareOrdinal must have non-null params"); 76Debug.Assert(bCharLength * 2 <= bytes.Length, "FastResourceComparer::CompareOrdinal - numChars is too big!"); 111Debug.Assert((byteLen & 1) == 0, "CompareOrdinal is expecting a UTF-16 string length, which must be even!"); 112Debug.Assert(a != null && b != null, "Null args not allowed."); 113Debug.Assert(byteLen >= 0, "byteLen must be non-negative.");
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (32)
46Debug.Assert(value >= 0, "negative ResourceTypeCode. What?"); 197Debug.Assert(index >= 0 && index < _numResources, $"Bad index into hash array. index: {index}"); 201Debug.Assert(_nameHashes != null && _nameHashesPtr == null, "Internal state mangled."); 206Debug.Assert(_nameHashes == null && _nameHashesPtr != null, "Internal state mangled."); 213Debug.Assert(index >= 0 && index < _numResources, $"Bad index into name position array. index: {index}"); 217Debug.Assert(_namePositions != null && _namePositionsPtr == null, "Internal state mangled."); 222Debug.Assert(_namePositions == null && _namePositionsPtr != null, "Internal state mangled."); 258Debug.Assert(_store != null, "ResourceReader is closed!"); 339Debug.Assert(_store != null, "ResourceReader is closed!"); 340Debug.Assert(Monitor.IsEntered(this)); // uses _store 382Debug.Assert(_store != null, "ResourceReader is closed!"); 453Debug.Assert(_store != null, "ResourceReader is closed!"); 477Debug.Assert(_store != null, "ResourceReader is closed!"); 539Debug.Assert(_store != null, "ResourceReader is closed!"); 540Debug.Assert(_version == 1, ".resources file was not a V1 .resources file!"); 541Debug.Assert(Monitor.IsEntered(this)); // uses _store 561Debug.Assert(Monitor.IsEntered(this)); // uses _store 621Debug.Assert(_store != null, "ResourceReader is closed!"); 622Debug.Assert(_version >= 2, ".resources file was not a V2 (or higher) .resources file!"); 623Debug.Assert(Monitor.IsEntered(this)); // uses _store 643Debug.Assert(Monitor.IsEntered(this)); // uses _store 729Debug.Assert(r == len, "ResourceReader needs to use a blocking read here. (Call _store.ReadBytes(len)?)"); 781Debug.Assert(!Monitor.IsEntered(this)); // only called during init 782Debug.Assert(_store != null, "ResourceReader is closed!"); 804Debug.Assert(!Monitor.IsEntered(this)); // only called during init 993Debug.Assert(Monitor.IsEntered(this)); // uses _store 1001Debug.Assert(_typeTable[typeIndex] != null, "Should have found a type!"); 1032Debug.Assert(typeCode >= 0, "can't be negative"); 1033Debug.Assert(Monitor.IsEntered(this)); // uses _store 1037Debug.Assert(!string.Equals(typeCode.ToString(), "LastPrimitive"), "Change ResourceTypeCode metadata order so LastPrimitive isn't what Enum.ToString prefers."); 1043Debug.Assert(typeIndex >= 0 && typeIndex < _typeTable.Length, "TypeCode is broken or corrupted!"); 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 (8)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (7)
152Debug.Assert(_resourceList != null); 294Debug.Assert(resMgrHeaderBlob.Length > 0, "ResourceWriter: Expected non empty header"); 388Debug.Assert((bw.BaseStream.Position & 7) == 0, "ResourceWriter: Name hashes array won't be 8 byte aligned! Ack!"); 399Debug.Assert((bw.BaseStream.Position & 3) == 0, "ResourceWriter: Name positions array won't be 4 byte aligned! Ack!"); 425Debug.Assert(startOfDataSection == bw.Seek(0, SeekOrigin.Current), "ResourceWriter::Generate - start of data section is wrong!"); 517Debug.Assert(writer != null); 635Debug.Assert(typeCode >= ResourceTypeCode.StartOfUserTypes, $"ResourceReader: Unsupported ResourceTypeCode in .resources file! {typeCode}");
System\Resources\ResourceWriter.core.cs (1)
51Debug.Assert(data != null);
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net9.0\System.Runtime.Forwards.cs (1)
154[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.Debug))]
System.Runtime.Caching (126)
System\Runtime\Caching\CacheExpires.cs (50)
27Debug.Assert((pageIndex & 0x00ffffff) == pageIndex, "(pageIndex & 0x00ffffff) == pageIndex"); 28Debug.Assert((entryIndex & ENTRY_MASK) == entryIndex, "(entryIndex & ENTRY_MASK) == entryIndex"); 29Debug.Assert(entryIndex != 0 || pageIndex == 0, "entryIndex != 0 || pageIndex == 0"); 118Debug.Assert(_cPagesInUse == 0, "_cPagesInUse == 0"); 119Debug.Assert(_cEntriesInUse == 0, "_cEntriesInUse == 0"); 120Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0"); 182Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)"); 188Debug.Assert((_pages[(list._head)]._pagePrev) == -1, "PagePrev(list._head) == -1"); 201Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)"); 207Debug.Assert((_pages[(list._tail)]._pageNext) == -1, "PageNext(list._tail) == -1"); 220Debug.Assert(list._head != -1, "list._head != -1"); 229Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)"); 233Debug.Assert((_pages[((_pages[(pageIndex)]._pagePrev))]._pageNext) == pageIndex, "PageNext(PagePrev(pageIndex)) == pageIndex"); 238Debug.Assert(list._head == pageIndex, "list._head == pageIndex"); 244Debug.Assert((_pages[((_pages[(pageIndex)]._pageNext))]._pagePrev) == pageIndex, "PagePrev(PageNext(pageIndex)) == pageIndex"); 249Debug.Assert(list._tail == pageIndex, "list._tail == pageIndex"); 259Debug.Assert(list._head != -1, "list._head != -1"); 260Debug.Assert(list._tail != -1, "list._tail != -1"); 272Debug.Assert(list._head != -1, "list._head != -1"); 273Debug.Assert(list._tail != -1, "list._tail != -1"); 293Debug.Assert(capacity > 0, "capacity > 0"); 294Debug.Assert(MIN_LOAD_FACTOR < 1.0, "MIN_LOAD_FACTOR < 1.0"); 307Debug.Assert((((_pages[(pageIndex)]._entries))[0]._cFree) == NUM_ENTRIES, "FreeEntryCount(EntriesI(pageIndex)) == NUM_ENTRIES"); 312Debug.Assert((_pages[(pageIndex)]._entries) != null, "EntriesI(pageIndex) != null"); 328Debug.Assert(_freeEntryList._head >= 0, "_freeEntryList._head >= 0"); 338Debug.Assert(((entries)[0]._next).IsInvalid, "FreeEntryHead(entries).IsInvalid"); 349Debug.Assert(entries[entryIndex]._cacheEntry == null, "entries[entryIndex]._cacheEntry == null"); 370Debug.Assert(_cPagesInUse * NUM_ENTRIES == _cEntriesInUse, "_cPagesInUse * NUM_ENTRIES == _cEntriesInUse"); 371Debug.Assert(_freeEntryList._head == -1, "_freeEntryList._head == -1"); 372Debug.Assert(_freeEntryList._tail == -1, "_freeEntryList._tail == -1"); 386Debug.Assert(_cPagesInUse == oldLength, "_cPagesInUse == oldLength"); 387Debug.Assert(_cEntriesInUse == oldLength * NUM_ENTRIES, "_cEntriesInUse == oldLength * ExpiresEntryRef.NUM_ENTRIES"); 392Debug.Assert(newLength > oldLength, "newLength > oldLength"); 439Debug.Assert(_freeEntryList._head != -1, "_freeEntryList._head != -1"); 440Debug.Assert(_freeEntryList._tail != -1, "_freeEntryList._tail != -1"); 441Debug.Assert(_freeEntryList._head != _freeEntryList._tail, "_freeEntryList._head != _freeEntryList._tail"); 476Debug.Assert(((entries)[0]._cFree) > 0, "FreeEntryCount(entries) > 0"); 486Debug.Assert(_freeEntryList._head != _freeEntryList._tail, "_freeEntryList._head != _freeEntryList._tail"); 488Debug.Assert(newRef.PageIndex != _freeEntryList._tail, "newRef.PageIndex != _freeEntryList._tail"); 512Debug.Assert((cacheEntry.ExpiresBucket == 0xff) == entryRef.IsInvalid, "(cacheEntry.ExpiresBucket == 0xff) == entryRef.IsInvalid"); 522Debug.Assert(cacheEntry.ExpiresBucket == 0xff, "cacheEntry.ExpiresBucket == 0xff"); 523Debug.Assert(cacheEntry.ExpiresEntryRef.IsInvalid, "cacheEntry.ExpiresEntryRef.IsInvalid"); 567Debug.WriteLine("CacheExpiresRemove", 594Debug.Assert(cacheEntry == entries[entryIndex]._cacheEntry); 610Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0"); 628Debug.Assert(_blockReduce == false, "_blockReduce == false"); 695Debug.Assert(!inFlushHead.IsInvalid, "!inFlushHead.IsInvalid"); 709Debug.Assert(cacheEntry.ExpiresEntryRef.IsInvalid, "cacheEntry.ExpiresEntryRef.IsInvalid"); 738Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0"); 775Debug.Assert(NUMBUCKETS < byte.MaxValue);
System\Runtime\Caching\CacheMemoryMonitor.cs (1)
173Debug.Assert(SAMPLE_COUNT == 2);
System\Runtime\Caching\CacheUsage.cs (60)
27Debug.Assert((pageIndex & 0x00ffffff) == pageIndex, "(pageIndex & 0x00ffffff) == pageIndex"); 28Debug.Assert((Math.Abs(entryIndex) & ENTRY_MASK) == (Math.Abs(entryIndex)), "(Math.Abs(entryIndex) & ENTRY_MASK) == Math.Abs(entryIndex)"); 29Debug.Assert(entryIndex != 0 || pageIndex == 0, "entryIndex != 0 || pageIndex == 0"); 52Debug.Assert(result > 0, "result > 0"); 62Debug.Assert(result < 0, "result < 0"); 148Debug.Assert(_cPagesInUse == 0, "_cPagesInUse == 0"); 149Debug.Assert(_cEntriesInUse == 0, "_cEntriesInUse == 0"); 150Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0"); 151Debug.Assert(_lastRefHead.IsInvalid, "_lastRefHead.IsInvalid"); 152Debug.Assert(_lastRefTail.IsInvalid, "_lastRefTail.IsInvalid"); 153Debug.Assert(_addRef2Head.IsInvalid, "_addRef2Head.IsInvalid"); 165Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)"); 171Debug.Assert((_pages[(list._head)]._pagePrev) == -1, "PagePrev(list._head) == -1"); 184Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)"); 190Debug.Assert((_pages[(list._tail)]._pageNext) == -1, "PageNext(list._tail) == -1"); 203Debug.Assert(list._head != -1, "list._head != -1"); 212Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)"); 216Debug.Assert((_pages[((_pages[(pageIndex)]._pagePrev))]._pageNext) == pageIndex, "PageNext(PagePrev(pageIndex)) == pageIndex"); 221Debug.Assert(list._head == pageIndex, "list._head == pageIndex"); 227Debug.Assert((_pages[((_pages[(pageIndex)]._pageNext))]._pagePrev) == pageIndex, "PagePrev(PageNext(pageIndex)) == pageIndex"); 232Debug.Assert(list._tail == pageIndex, "list._tail == pageIndex"); 242Debug.Assert(list._head != -1, "list._head != -1"); 243Debug.Assert(list._tail != -1, "list._tail != -1"); 254Debug.Assert(list._head != -1, "list._head != -1"); 255Debug.Assert(list._tail != -1, "list._tail != -1"); 273Debug.Assert(capacity > 0, "capacity > 0"); 274Debug.Assert(MIN_LOAD_FACTOR < 1.0, "MIN_LOAD_FACTOR < 1.0"); 287Debug.Assert((((_pages[(pageIndex)]._entries))[0]._cFree) == NUM_ENTRIES, "FreeEntryCount(EntriesI(pageIndex)) == NUM_ENTRIES"); 292Debug.Assert((_pages[(pageIndex)]._entries) != null, "EntriesI(pageIndex) != null"); 308Debug.Assert(_freeEntryList._head >= 0, "_freeEntryList._head >= 0"); 318Debug.Assert(((entries)[0]._ref1._next).IsInvalid, "FreeEntryHead(entries).IsInvalid"); 326Debug.Assert(entryRef.IsRef1, "entryRef.IsRef1"); 331Debug.Assert(entries[entryIndex]._cacheEntry == null, "entries[entryIndex]._cacheEntry == null"); 355Debug.Assert(_cPagesInUse * NUM_ENTRIES == _cEntriesInUse, "_cPagesInUse * NUM_ENTRIES == _cEntriesInUse"); 356Debug.Assert(_freeEntryList._head == -1, "_freeEntryList._head == -1"); 357Debug.Assert(_freeEntryList._tail == -1, "_freeEntryList._tail == -1"); 371Debug.Assert(_cPagesInUse == oldLength, "_cPagesInUse == oldLength"); 372Debug.Assert(_cEntriesInUse == oldLength * NUM_ENTRIES, "_cEntriesInUse == oldLength * ExpiresEntryRef.NUM_ENTRIES"); 377Debug.Assert(newLength > oldLength, "newLength > oldLength"); 424Debug.Assert(_freeEntryList._head != -1, "_freeEntryList._head != -1"); 425Debug.Assert(_freeEntryList._tail != -1, "_freeEntryList._tail != -1"); 426Debug.Assert(_freeEntryList._head != _freeEntryList._tail, "_freeEntryList._head != _freeEntryList._tail"); 459Debug.Assert(((entries)[0]._cFree) > 0, "FreeEntryCount(entries) > 0"); 469Debug.Assert(_freeEntryList._head != _freeEntryList._tail, "_freeEntryList._head != _freeEntryList._tail"); 472Debug.Assert(newRef1.PageIndex != _freeEntryList._tail, "newRef1.PageIndex != _freeEntryList._tail"); 478Debug.Assert(cacheEntry.UsageEntryRef == oldRef1, "cacheEntry.UsageEntryRef == oldRef1"); 487Debug.Assert(prev != oldRef2, "prev != oldRef2"); 505Debug.Assert(next != oldRef1, "next != oldRef1"); 531Debug.Assert(cacheEntry.UsageEntryRef.IsInvalid, "cacheEntry.UsageEntryRef.IsInvalid"); 583Debug.Assert(entryRef.IsRef1, "entryRef.IsRef1"); 682Debug.Assert(maxFlush > 0, $"maxFlush is not greater than 0, instead is {maxFlush}"); 683Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0"); 700Debug.Assert(_blockReduce == false, "_blockReduce == false"); 709Debug.Assert(_cEntriesInUse > 0, "_cEntriesInUse > 0"); 723Debug.Assert(utcDate != DateTime.MinValue, "utcDate != DateTime.MinValue"); 731Debug.Assert(cacheEntry.UsageEntryRef == prev1, "cacheEntry.UsageEntryRef == prev1"); 761Debug.Assert(!inFlushHead.IsInvalid, "!inFlushHead.IsInvalid"); 775Debug.Assert(cacheEntry.UsageEntryRef.IsInvalid, "cacheEntry.UsageEntryRef.IsInvalid"); 801Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0"); 851Debug.Assert(bucket != 0xff, "bucket != 0xff");
System\Runtime\Caching\ChangeMonitor.cs (3)
145Debug.Assert(_flags[INITIALIZED], "It is critical that INITIALIZED is set before CHANGED is checked below"); 162Debug.Assert(_flags[CHANGED], "It is critical that CHANGED is set before INITIALIZED is checked below."); 208Debug.Assert(_flags[CHANGED], "It is critical that CHANGED is set before INITIALIZED is checked below.");
System\Runtime\Caching\Dbg.cs (1)
44Debug.WriteLine(output);
System\Runtime\Caching\MemoryCache.cs (1)
137Debug.Fail("Reason should never be CacheEntryRemovedReason.Evicted since the entry was inserted as NotRemovable.");
System\Runtime\Caching\MemoryCacheEntry.cs (1)
257Debug.Assert(_fields._dependents == null, "_fields._dependents == null");
System\Runtime\Caching\MemoryCacheEntryChangeMonitor.cs (1)
136Debug.Assert(keys != null && keys.Count > 0, "keys != null && keys.Count > 0");
System\Runtime\Caching\MemoryCacheKeyEqualityComparer.cs (2)
13Debug.Assert(x != null && x is MemoryCacheKey); 14Debug.Assert(y != null && y is MemoryCacheKey);
System\Runtime\Caching\MemoryCacheStore.cs (3)
111Debug.Assert(entry.State == EntryState.RemovingFromCache, "entry.State = EntryState.RemovingFromCache"); 281Debug.Assert(_useInsertBlock == false, "_useInsertBlock == false"); 375Debug.Assert(percent <= 100, "percent <= 100");
System\Runtime\Caching\MemoryMonitor.cs (3)
61Debug.Assert(_pressureHigh > 0, "_pressureHigh > 0"); 62Debug.Assert(_pressureLow > 0, "_pressureLow > 0"); 63Debug.Assert(_pressureLow <= _pressureHigh, "_pressureLow <= _pressureHigh");
System.Runtime.InteropServices (3)
System\Runtime\InteropServices\Marshalling\ComObject.cs (3)
45Debug.Assert(Marshal.IsComObject(_runtimeCallableWrapper)); 142Debug.Assert(found); 163Debug.Assert(_runtimeCallableWrapper != null);
System.Runtime.Numerics (239)
src\libraries\Common\src\System\HexConverter.cs (3)
165Debug.Assert(chars.Length >= bytes.Length * 2); 332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Number.Formatting.Common.cs (12)
144Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 281Debug.Assert(format is 'G' or 'g'); 293Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 716Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 750Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 820Debug.Assert(p >= spanPtr - 1, "Underflow"); 865Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 886Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 913Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 935Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 959Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 1013Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte));
src\libraries\Common\src\System\Number.NumberBuffer.cs (7)
38Debug.Assert(digits != null); 46Debug.Assert(!digits.IsEmpty); 67Debug.Assert((Kind == NumberBufferKind.Integer) || (Kind == NumberBufferKind.Decimal) || (Kind == NumberBufferKind.FloatingPoint)); 68Debug.Assert(Digits[0] != '0', "Leading zeros should never be stored in a Number"); 80Debug.Assert(char.IsAsciiDigit((char)digit), $"Unexpected character found in Number: {digit}"); 83Debug.Assert(numDigits == DigitsCount, "Null terminator found in unexpected location in Number"); 84Debug.Assert(numDigits < Digits.Length, "Null terminator not found in Number");
src\libraries\Common\src\System\Number.Parsing.Common.cs (11)
16Debug.Assert(str != null); 17Debug.Assert(strEnd != null); 18Debug.Assert(str <= strEnd); 19Debug.Assert((styles & (NumberStyles.AllowHexSpecifier | NumberStyles.AllowBinarySpecifier)) == 0); 28Debug.Assert(number.DigitsCount == 0); 29Debug.Assert(number.Scale == 0); 30Debug.Assert(!number.IsNegative); 31Debug.Assert(!number.HasNonZeroTail); 228Debug.Assert(numberOfTrailingZeros >= 0); 283Debug.Assert(info != null); 339Debug.Assert((p != null) && (pEnd != null) && (p <= pEnd));
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0); 298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\FormattingHelpers.CountDigits.cs (3)
25Debug.Assert(log2ToPow10.Length == 64); 55Debug.Assert((index + 1) <= powersOf10.Length); 103Debug.Assert(table.Length == 32, "Every result of uint.Log2(value) needs a long entry in the table.");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (6)
28Debug.Assert(value >= 0); 29Debug.Assert(value <= _span.Length); 38Debug.Assert(index < _pos); 91Debug.Assert(index == 0, "Implementation currently only supports index == 0"); 106Debug.Assert(length >= 0); 134Debug.Assert(_pos == _span.Length);
System\Number.BigInteger.cs (22)
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); 1036Debug.Assert(base1E9Value[^1] != 0, "Leading zeros should be trimmed by caller."); 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 (49)
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); 1318Debug.Assert(mode == GetBytesMode.AllocateArray || mode == GetBytesMode.Count || mode == GetBytesMode.Span, $"Unexpected mode {mode}."); 1319Debug.Assert(mode == GetBytesMode.Span || destination.IsEmpty, $"If we're not in span mode, we shouldn't have been passed a destination."); 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); 1639Debug.Assert(!(trivialLeft && trivialRight), "Trivial cases should be handled on the caller operator"); 1646Debug.Assert(!rightBits.IsEmpty); 1658Debug.Assert(!leftBits.IsEmpty); 1670Debug.Assert(!leftBits.IsEmpty && !rightBits.IsEmpty); 1682Debug.Assert(!leftBits.IsEmpty && !rightBits.IsEmpty); 1717Debug.Assert(!(trivialLeft && trivialRight), "Trivial cases should be handled on the caller operator"); 1724Debug.Assert(!rightBits.IsEmpty); 1736Debug.Assert(!leftBits.IsEmpty); 1758Debug.Assert(!leftBits.IsEmpty && !rightBits.IsEmpty); 2692Debug.Assert(!(trivialLeft && trivialRight), "Trivial cases should be handled on the caller operator"); 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 (144)
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (3)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
System\Runtime\Serialization\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 (31)
116Debug.Assert(_objectManager != null); 156Debug.Assert(_crossAppDomainArray != null); 157Debug.Assert(index < _crossAppDomainArray.Length, "[System.Runtime.Serialization.Formatters.BinaryObjectReader index out of range for CrossAppDomainArray]"); 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 (10)
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); 879Debug.Assert((pr._newObj != null), "[BinaryParser expected a Primitive Array]"); 926Debug.Assert(objectOp != null); 954Debug.Assert(objectOp != null); 982Debug.Assert(objectOp != null);
System\Runtime\Serialization\Formatters\Binary\BinaryTypeConverter.cs (5)
59Debug.Assert(assembly != null); 68Debug.Assert(objectInfo != null, "[BinaryConverter.GetBinaryTypeInfo]objectInfo null for user object"); 140Debug.Assert(typeInformation != null, "[BinaryConverter.WriteTypeInfo]typeInformation!=null"); 149Debug.Assert(typeInformation != null, "[BinaryConverter.WriteTypeInfo]typeInformation!=null"); 153Debug.Assert(typeInformation != null, "[BinaryConverter.WriteTypeInfo]typeInformation!=null");
System\Runtime\Serialization\Formatters\Binary\BinaryUtilClasses.cs (2)
410Debug.Assert(_objectInfo!._objectManager != null); 478Debug.Assert(_type != null);
System\Runtime\Serialization\Formatters\Binary\Converter.cs (1)
329Debug.Assert((code != InternalPrimitiveTypeE.Invalid), "[Converter.FromString]!InternalPrimitiveTypeE.Invalid ");
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 (41)
89Debug.Assert(holder != null, "holder!=null"); 90Debug.Assert(holder._id >= 0, "holder.m_id>=0"); 176Debug.Assert(holder.RequiresSerInfoFixup, "[ObjectManager.FixupSpecialObject]holder.HasSurrogate||holder.HasISerializable"); 180Debug.Assert(surrogate != null, "surrogate!=null"); 181Debug.Assert(holder.SerializationInfo != null); 197Debug.Assert(holder.ObjectValue is ISerializable, "holder.m_object is ISerializable"); 224Debug.Assert(holder.IsIncompleteObjectReference, "holder.IsIncompleteObjectReference"); 243Debug.Assert(holder.ObjectValue != null); 284Debug.Assert(holder != null, "[TypedReferenceBuilder.ctor]holder!=null"); 285Debug.Assert(holder.RequiresValueTypeFixup, "[TypedReferenceBuilder.ctor]holder.RequiresValueTypeFixup"); 313Debug.Assert(tempHolder != null); 333Debug.Assert(currFixup.ParentIndex != null, "[ObjectManager.DoValueTypeFixup]currFixup.ParentIndex!=null"); 346Debug.Assert(fixupObj != null, "[ObjectManager.DoValueTypeFixup]FixupObj!=null"); 362Debug.Assert(fixupObj != null, "[ObjectManager.DoValueTypeFixup]fixupObj!=null"); 408Debug.Assert(holder != null, "[ObjectManager.CompleteObject]holder.m_object!=null"); 437Debug.Assert(fixups._values[i]!._fixupType == FixupHolder.DelayedFixup, "fixups.m_values[i].m_fixupType==FixupHolder.DelayedFixup"); 443Debug.Assert(holderValue != null); 499Debug.Assert(holder.ObjectValue is Array, "holder.ObjectValue is Array"); 510Debug.Assert(fixupInfo is MemberInfo, "fixupInfo is MemberInfo"); 596Debug.Assert(temp != null); 597Debug.Assert(temp.DirectlyDependentObjects > 0, "temp.m_missingElementsRemaining>0"); 654Debug.Assert(member == null || member is FieldInfo, "RegisterString - member is FieldInfo"); 859Debug.Assert(_fixupCount >= 0, "[ObjectManager.DoFixups]m_fixupCount>=0"); 1044Debug.Assert(objID >= 0, "objID>=0"); 1081Debug.Assert(objID >= 0, "objID>=0"); 1127Debug.Assert(_dependentObjects != null, "[ObjectHolder.RemoveDependency]m_dependentObjects!=null"); 1128Debug.Assert(id >= 0, "[ObjectHolder.RemoveDependency]id>=0"); 1168Debug.Assert(holder != null, "[ObjectHolder.UpdateTotalDependencyChain]holder!=null"); 1203Debug.Assert(obj != null, "obj!=null"); 1204Debug.Assert(_id > 0, "m_id>0"); 1390Debug.Assert(id > 0, "id>0"); 1391Debug.Assert(fixupInfo != null, "fixupInfo!=null"); 1392Debug.Assert(fixupType == ArrayFixup || fixupType == MemberFixup || fixupType == DelayedFixup, "fixupType==ArrayFixup || fixupType == MemberFixup || fixupType==DelayedFixup"); 1486Debug.Assert(_currentItem != -1, "[LongList.Current]m_currentItem!=-1"); 1487Debug.Assert(_values[_currentItem] != -1, "[LongList.Current]m_values[m_currentItem]!=-1"); 1537Debug.Assert(startingSize > 0 && startingSize < 0x1000, "startingSize>0 && startingSize<0x1000"); 1580Debug.Assert(list != null, "[ObjectHolderListEnumerator.ctor]list!=null"); 1589Debug.Assert(_startingVersion == _list.Version, "[ObjectHolderListEnumerator.MoveNext]m_startingVersion==m_list.Version"); 1606Debug.Assert(_currPos != -1, "[ObjectHolderListEnumerator.Current]m_currPos!=-1"); 1607Debug.Assert(_currPos < _list.Count, "[ObjectHolderListEnumerator.Current]m_currPos<m_list.Count"); 1608Debug.Assert(_startingVersion == _list.Version, "[ObjectHolderListEnumerator.Current]m_startingVersion==m_list.Version");
System\Runtime\Serialization\SerializationEventsCache.cs (1)
77Debug.Assert(obj != null, "object should have been initialized");
System\Runtime\Serialization\SerializationFieldInfo.cs (2)
17Debug.Assert(field != null); 18Debug.Assert(namePrefix != null);
System\Runtime\Serialization\SurrogateSelector.cs (3)
26Debug.Assert(selector != null, "[HasCycle]selector!=null"); 122Debug.Assert(tempPrev != null); 182Debug.Assert(type != null);
System.Security.Cryptography (609)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
69Debug.Assert(passwd.Name != null);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs (2)
72Debug.Assert(bytesNeeded != 0, "OBJ_obj2txt reported a zero-length response"); 92Debug.Assert(
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.Nid.cs (1)
32Debug.Fail($"NID Lookup for {oid} failed, only well-known types should be queried.");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs (1)
135Debug.Assert(verifyTime.Kind != DateTimeKind.Utc, "UTC verifyTime should have been normalized to Local");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Dsa.cs (5)
46Debug.Assert(size * 2 < DsaEncodedSignatureSize(dsa)); 92Debug.Assert( 181Debug.Assert(i >= 0); 194Debug.Assert(value1 >= 0); 195Debug.Assert(value2 >= 0);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EcDsa.ImportExport.cs (1)
147Debug.Assert(
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EcKey.cs (1)
61Debug.Fail("Key is invalid or doesn't have a curve");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Encode.cs (4)
35Debug.Fail( 43Debug.Assert(size == size2); 66Debug.Fail( 79Debug.Assert(size == size2);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (1)
83Debug.Assert(error <= uint.MaxValue, "ErrGetError should only return error codes in the UInt32 range.");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EVP.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 (7)
125Debug.Fail($"Unexpected return '{ret}' value from {nameof(CryptoNative_GetPkcs8PrivateKeySize)}."); 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.OCSP.Chain.cs (3)
27Debug.Fail($"Unexpected response from X509ChainGetCachedOcspSuccess: {response}"); 46Debug.Assert(resp == 0, $"Unexpected response from X509ChainHasStapledOcsp: {resp}"); 69Debug.Fail($"Unexpected response from X509ChainGetCachedOcspSuccess: {response}");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OCSP.cs (1)
76Debug.Assert(ret == 0, $"Unexpected response from X509DecodeOcspToExpiration: {ret}");
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.RAND.cs (1)
13Debug.Assert(count >= 0);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs (2)
50Debug.Assert(_parent == null, "Expected no existing parent"); 51Debug.Assert(parent != null && !parent.IsInvalid, "Expected new parent to be non-null and valid");
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeDsaHandle.Unix.cs (1)
32Debug.Assert(handle != IntPtr.Zero);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeEcKeyHandle.Unix.cs (1)
32Debug.Assert(handle != IntPtr.Zero);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (3)
41Debug.Assert(currentHandle.IsInvalid); 51Debug.Assert(handle != null); 53Debug.Assert(!isCachedInvalidHandle || handle.IsInvalid, "The cached invalid handle must still be invalid.");
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (1)
46Debug.Assert(addedRef);
src\libraries\Common\src\System\HexConverter.cs (3)
165Debug.Assert(chars.Length >= bytes.Length * 2); 332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (3)
31Debug.Assert(task.IsCompletedSuccessfully); 104Debug.Fail("Unable to load required type."); 133Debug.Fail("Unable to load required members.");
src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs12\PfxAsn.manual.cs (3)
27Debug.Assert(MacData.HasValue); 67Debug.Assert(expectedOutputSize <= 64); // SHA512 is the largest digest size we know about 90Debug.Fail($"TryGetHashAndReset wrote {bytesWritten} bytes when {expectedOutputSize} was expected");
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\DSAKeyFormatHelper.cs (1)
227Debug.Fail("TryEncode failed with a pre-allocated buffer");
src\libraries\Common\src\System\Security\Cryptography\DSAOpenSsl.cs (6)
246Debug.Assert(bytesWritten == p1363SignatureSize); 257Debug.Fail($"Stack-based signDestination is insufficient ({maxSignatureSize} needed)"); 274Debug.Fail($"Missing internal implementation handler for signature format {signatureFormat}"); 289Debug.Fail($"Stack-based signDestination is insufficient ({signatureLength} needed)"); 298Debug.Assert( 339Debug.Fail($"Missing internal implementation handler for signature format {signatureFormat}");
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 (5)
132Debug.Assert(bytesWritten == encodedSize); 143Debug.Fail($"Stack-based signDestination is insufficient ({signatureLength} needed)"); 172Debug.Fail($"Stack-based signDestination is insufficient ({signatureLength} needed)"); 181Debug.Assert( 239Debug.Fail($"Missing internal implementation handler for signature format {signatureFormat}");
src\libraries\Common\src\System\Security\Cryptography\ECOpenSsl.cs (4)
48Debug.Assert(currentKey != null, "null TODO"); 73Debug.Assert(key != null, "key != null"); 74Debug.Assert(!key.IsInvalid, "!key.IsInvalid"); 75Debug.Assert(!key.IsClosed, "!key.IsClosed");
src\libraries\Common\src\System\Security\Cryptography\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\KdfWorkLimiter.cs (2)
17Debug.Assert(t_state == null, "This method is not intended to be called recursively."); 25Debug.Assert(t_state != null, "This method should only be called within a protected block.");
src\libraries\Common\src\System\Security\Cryptography\KeyBlobHelpers.cs (1)
71Debug.Assert(!integer.IsEmpty);
src\libraries\Common\src\System\Security\Cryptography\KeyFormatHelper.cs (2)
170Debug.Assert(algorithmIdentifierLength > 0, "algorithmIdentifier was empty"); 171Debug.Assert(privateKeyLength > 0, "privateKey was empty");
src\libraries\Common\src\System\Security\Cryptography\KeyFormatHelper.Encrypted.cs (1)
195Debug.Assert(cipher.BlockSize <= 128, $"Encountered unexpected block size: {cipher.BlockSize}");
src\libraries\Common\src\System\Security\Cryptography\Oids.Shared.cs (3)
82Debug.Assert(oidValue != null); 119Debug.Assert( 163Debug.Assert(oid is not null);
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (22)
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); 387Debug.Fail($"UTF-8 encoding size changed between GetByteCount and GetBytes"); 393Debug.Assert(pwdTmpBytes!.Length == 0); 411Debug.Assert(encryptor.CanTransformMultipleBlocks); 421Debug.Fail("TryEncode failed with a pre-allocated buffer"); 491Debug.Assert(written == buf.Length); 601Debug.Fail("Key-sized OID included in the if, but not the switch"); 749Debug.Fail($"No Specified Salt value is present, indicating a new choice was unhandled"); 879Debug.Fail( 945Debug.Assert(decryptor.CanTransformMultipleBlocks); 1000Debug.Fail("TryGetHashAndReset failed with pre-allocated input"); 1013Debug.Fail("TryGetHashAndReset failed with pre-allocated input");
src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (8)
86Debug.Assert(iterationCount >= 1); 104Debug.Assert(v <= 1024); 186Debug.Fail($"Hash output wrote {bytesWritten} bytes when {hashBuf.Length} was expected"); 239Debug.Assert(into.Length == addend.Length); 253Debug.Assert(bytes.Length > 0); 274Debug.Assert(destination.Length % 2 == 0); 284Debug.Fail($"Unexpected written byte count ({count} vs {fullCopyLen})"); 301Debug.Fail($"Partial copy wrote {count} bytes of {destination.Length} expected");
src\libraries\Common\src\System\Security\Cryptography\RSAKeyFormatHelper.cs (2)
195Debug.Fail("TryEncode failed with a presized buffer"); 210Debug.Assert(copyFrom == null || pkcs1PrivateKey.IsEmpty);
src\libraries\Common\src\System\Security\Cryptography\RSAOpenSsl.cs (22)
175Debug.Assert(!key.IsInvalid); 186Debug.Fail("Caller is responsible for temporary decryption buffer creation"); 194Debug.Assert(padding.OaepHashAlgorithm.Name != null); 225Debug.Fail($"TryEncrypt behaved unexpectedly: {nameof(encrypted)}=={encrypted}, {nameof(bytesWritten)}=={bytesWritten}, {nameof(buf.Length)}=={buf.Length}"); 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); 743Debug.Fail("TrySignHash should not return false in allocation mode"); 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 (16)
102Debug.Fail("Unknown digest algorithm"); 182Debug.Assert(source.Length > 11); 206Debug.Assert(lenIfBad < 0); 234Debug.Assert((selector | (selector - 1)) == -1); 321Debug.Assert(hasher.HashLengthInBytes == hLen); 332Debug.Fail("TryGetHashAndReset failed with exact-size destination"); 369Debug.Fail("Bad exception produced from OAEP padding: " + e); 425Debug.Assert(hasher.HashLengthInBytes == hLen); 439Debug.Fail("TryGetHashAndReset failed with exact-size destination"); 484Debug.Assert(em.Length >= emLen); 524Debug.Assert(hasher.HashLengthInBytes == hLen); 566Debug.Fail("TryGetHashAndReset failed with exact-size destination"); 602Debug.Fail($"TryGetHashAndReset failed with sufficient space"); 606Debug.Assert(bytesWritten == hLen); 615Debug.Fail($"TryGetHashAndReset failed with sufficient space"); 619Debug.Assert(bytesWritten == hLen);
src\libraries\Common\src\System\Security\Cryptography\SP800108HmacCounterKdfImplementationManaged.cs (2)
81Debug.Assert(current > 0); 94Debug.Assert(newReferenceCount >= 0, newReferenceCount.ToString());
src\libraries\Common\src\System\Text\UrlBase64Encoding.cs (3)
22Debug.Fail($"Convert.TryToBase64 failed with {input.Length} bytes to a {base64.Length} buffer"); 26Debug.Assert(charsWritten == base64Len); 65Debug.Assert(source[0] == '=');
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0); 298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (1)
101Debug.Assert(passwd.HomeDirectory != null);
System\Security\Cryptography\AesCcm.OpenSsl.cs (4)
22Debug.Assert(_keyBox is null); 79Debug.Fail($"CCM encrypt wrote {ciphertextBytesWritten} of {ciphertext.Length} bytes."); 136Debug.Fail($"CCM decrypt wrote {plaintextBytesWritten} of {plaintext.Length} bytes."); 161Debug.Fail("Key size should already be validated");
System\Security\Cryptography\AesGcm.cs (1)
160Debug.Assert(tagSizeInBytes.IsLegalSize(TagByteSizes));
System\Security\Cryptography\AesGcm.OpenSsl.cs (3)
69Debug.Fail($"GCM encrypt wrote {ciphertextBytesWritten} of {ciphertext.Length} bytes."); 117Debug.Fail($"GCM decrypt wrote {plaintextBytesWritten} of {plaintext.Length} bytes."); 130Debug.Fail("Key size should already be validated");
System\Security\Cryptography\AsnFormatter.cs (2)
21Debug.Assert(sArray != null && sArray.Length != 0); 41Debug.Assert(j == hexOrder.Length);
System\Security\Cryptography\AsymmetricAlgorithmHelpers.Der.cs (5)
35Debug.Assert(input.Length % 2 == 0); 36Debug.Assert(input.Length > 1); 68Debug.Assert(destination.Length >= encodedSize); 127Debug.Assert(payloadLength >= 0); 199Debug.Fail($"A signature field was longer ({signatureField.Length}) than expected ({response.Length})");
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\ChaCha20Poly1305.OpenSsl.cs (3)
68Debug.Fail($"ChaCha20Poly1305 encrypt wrote {ciphertextBytesWritten} of {ciphertext.Length} bytes."); 116Debug.Fail($"ChaCha20Poly1305 decrypt wrote {plaintextBytesWritten} of {plaintext.Length} bytes."); 127Debug.Fail("Key size should already be validated");
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 (4)
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. 405Debug.Fail("Unsupported Dictionary value:" + retvalObj.ToString()); 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 (11)
144Debug.Assert(_outputBufferIndex == 0, "The output index can only ever be non-zero when in read mode."); 265Debug.Assert(_outputBuffer != null); 296Debug.Assert(completedValueTask.IsCompleted); 328Debug.Assert(_outputBufferIndex == 0); 331Debug.Assert(_inputBufferIndex == 0); 543Debug.Assert(_inputBuffer != null); 563Debug.Assert(_outputBufferIndex == 0, "The output index can only ever be non-zero when in read mode."); 569Debug.Assert(_inputBuffer != null && _outputBuffer != null); 624Debug.Assert(_outputBuffer != null); 639Debug.Assert(_inputBuffer != null); 654Debug.Assert(segment.Array is not null);
System\Security\Cryptography\CspParameters.cs (1)
31Debug.Assert((CspProviderFlags.UseMachineKeyStore |
System\Security\Cryptography\DSA.cs (1)
883Debug.Assert(tmp.Length == HashBufferStackSize);
System\Security\Cryptography\DSA.Xml.cs (1)
106Debug.Assert(keyParameters.P != null);
System\Security\Cryptography\DSAWrapper.cs (1)
16Debug.Assert(wrapped != null);
System\Security\Cryptography\ECCurve.cs (1)
242Debug.Assert(CurveType == ECCurveType.Implicit);
System\Security\Cryptography\ECDiffieHellmanWrapper.cs (2)
14Debug.Assert(wrapped != null); 179Debug.Assert(wrapped != null);
System\Security\Cryptography\ECDsa.cs (3)
158Debug.Fail($"GetMaxSignatureSize returned insufficient size for format {signatureFormat}"); 440Debug.Fail($"GetMaxSignatureSize returned insufficient size for format {signatureFormat}"); 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 (6)
41Debug.Assert(evpType != IntPtr.Zero); 47Debug.Fail("Destination length or hash size not valid."); 52Debug.Assert(written == hashSize); 59Debug.Assert(evpType != IntPtr.Zero); 75Debug.Assert(ret == 0); 79Debug.Assert(length == hashSize);
System\Security\Cryptography\Helpers.cs (4)
122Debug.Assert(index < cbHex, "index < cbHex"); 133Debug.Assert(index == cbHex, "index == cbHex"); 175Debug.Fail("input.Overlaps(primitive) failed after TryReadPrimitiveOctetString succeeded"); 241Debug.Fail($"Missing match criteria for curve type {aCurve.CurveType}");
System\Security\Cryptography\HKDF.cs (8)
68Debug.Assert(HashLength(hashAlgorithmName) == hashLength); 70Debug.Assert(written == prk.Length, $"Bytes written is {written} bytes which does not match output length ({prk.Length} bytes)"); 129Debug.Assert(HashLength(hashAlgorithmName) == hashLength); 180Debug.Assert(hashLength <= 512 / 8, "hashLength is larger than expected, consider increasing this value or using regular allocation"); 215Debug.Assert(hashLength <= 512 / 8, "hashLength is larger than expected, consider increasing this value or using regular allocation"); 253Debug.Assert(hashLength <= 512 / 8, "hashLength is larger than expected, consider increasing this value or using regular allocation"); 264Debug.Assert(false, "HMAC operation failed unexpectedly"); 268Debug.Assert(bytesWritten == output.Length, $"Bytes written is {bytesWritten} bytes which does not match output length ({output.Length} bytes)");
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 (2)
24Debug.Fail("Platform should have previously checked support for algorithm."); 40Debug.Assert(!algorithm.IsInvalid);
System\Security\Cryptography\LiteHash.Unix.cs (15)
40Debug.Assert(algorithm != IntPtr.Zero); 102Debug.Assert(result == 0); 118Debug.Assert(algorithm != IntPtr.Zero); 125Debug.Fail($"Unexpected hash '{_hashSizeInBytes}' size from {nameof(Interop.Crypto.EvpMdSize)}."); 145Debug.Assert(destination.Length >= _hashSizeInBytes); 150Debug.Assert(length == _hashSizeInBytes); 163Debug.Assert(length == _hashSizeInBytes); 178Debug.Assert(result == 0); 193Debug.Assert(algorithm != IntPtr.Zero); 198Debug.Fail($"Unexpected hash '{_hashSizeInBytes}' size from {nameof(Interop.Crypto.EvpMdSize)}."); 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\MD5CryptoServiceProvider.cs (1)
30Debug.Fail("Reset expected a properly sized buffer.");
System\Security\Cryptography\Oid.cs (2)
140Debug.Assert(value != null); 141Debug.Assert(friendlyName != null);
System\Security\Cryptography\OidCollection.cs (1)
21Debug.Assert(initialCapacity >= 0);
System\Security\Cryptography\OidLookup.cs (2)
125Debug.Assert(s_friendlyNameToOid.Count == FriendlyNameToOidCount, 127Debug.Assert(s_oidToFriendlyName.Count == OidToFriendlyNameCount,
System\Security\Cryptography\OidLookup.OpenSsl.cs (2)
26Debug.Assert(friendlyNamePtr != IntPtr.Zero, "friendlyNamePtr != IntPtr.Zero"); 33Debug.Assert(result == 0, $"LookupFriendlyNameByOid returned unexpected result {result}");
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 (3)
32Debug.Assert(algorithm != IntPtr.Zero); 55Debug.Fail("Cipher was reused without being reset."); 98Debug.Fail("Cipher was reused without being reset.");
System\Security\Cryptography\PasswordDeriveBytes.cs (1)
201Debug.Assert(_hash != null);
System\Security\Cryptography\Pbkdf2Implementation.OpenSsl.cs (3)
17Debug.Assert(!destination.IsEmpty); 18Debug.Assert(hashAlgorithmName.Name is not null); 25Debug.Assert(result == 0, $"Unexpected result {result}");
System\Security\Cryptography\PemEncoding.cs (7)
171Debug.Assert(destination.Length >= size); 181Debug.Assert(startPosition <= str.Length); 391Debug.Assert(encodedSize == charsWritten); 409Debug.Fail("Convert.TryToBase64Chars failed with a pre-sized buffer"); 433Debug.Assert(remainingData.Length < BytesPerLine); 487Debug.Assert(charsWritten == encodedSize); 541Debug.Fail("WriteCore wrote the wrong amount of data");
System\Security\Cryptography\PemKeyHelpers.cs (4)
146Debug.Fail("Base64 decoding failed on already validated contents."); 150Debug.Assert(bytesWritten == base64size); 232Debug.Fail("Base64 decoding failed on already validated contents."); 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 (5)
182Debug.Assert(_blockSize > 0); 204Debug.Assert(_startIndex == 0 && _endIndex == 0, "Invalid start or end index in the internal buffer."); 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\SafeEvpPKeyHandle.OpenSsl.cs (1)
64Debug.Fail("Called UpRefEvpPkey on a key which was already marked for destruction");
System\Security\Cryptography\SHA1.cs (2)
68Debug.Assert(written == buffer.Length); 112Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\SHA1CryptoServiceProvider.cs (1)
33Debug.Fail("Reset expected a properly sized buffer.");
System\Security\Cryptography\SHA256.cs (2)
67Debug.Assert(written == buffer.Length); 112Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\SHA256CryptoServiceProvider.cs (1)
33Debug.Fail("Reset expected a properly sized buffer.");
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\SHA384CryptoServiceProvider.cs (1)
33Debug.Fail("Reset expected a properly sized buffer.");
System\Security\Cryptography\SHA512.cs (2)
67Debug.Assert(written == buffer.Length); 111Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\SHA512CryptoServiceProvider.cs (1)
33Debug.Fail("Reset expected a properly sized buffer.");
System\Security\Cryptography\SP800108HmacCounterKdfImplementationManaged.cs (2)
33Debug.Assert(destination.Length <= 0x1FFFFFFF); 68Debug.Assert(hmacBufferWritten > destination.Length);
System\Security\Cryptography\SymmetricPadding.cs (3)
13Debug.Assert(plaintextLength >= 0); 31Debug.Fail($"Unknown padding mode {paddingMode}."); 145Debug.Fail($"Unknown padding mode {padding}.");
System\Security\Cryptography\TripleDES.cs (4)
81Debug.Assert(start1 >= 0); 82Debug.Assert(start2 >= 0); 83Debug.Assert((start1 + count) <= rgbKey.Length); 84Debug.Assert((start2 + count) <= rgbKey.Length);
System\Security\Cryptography\UniversalCryptoDecryptor.cs (3)
54Debug.Assert(inputBuffer.Length >= _heldoverCipher.Length, "inputBuffer.Length >= _heldoverCipher.Length"); 57Debug.Assert(inputBuffer.Length % InputBlockSize == 0, "Did not remove whole blocks for depadding"); 157Debug.Assert(written == buffer.Length);
System\Security\Cryptography\UniversalCryptoEncryptor.cs (3)
35Debug.Assert(!inputBuffer.Overlaps(outputBuffer)); 42Debug.Assert(padWritten == transformWritten); 52Debug.Assert(written == buffer.Length);
System\Security\Cryptography\UniversalCryptoOneShot.cs (4)
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\CertificateExtensionsCommon.cs (2)
42Debug.Fail("Expected GetExpectedOidValue() to have thrown before we got here."); 72Debug.Fail("Expected GetExpectedOidValue() to have thrown before we got here.");
System\Security\Cryptography\X509Certificates\CertificateRequest.cs (2)
503Debug.Assert(_generator != null); 530Debug.Fail($"Key was of no known type: {_key?.GetType().FullName ?? "null"}");
System\Security\Cryptography\X509Certificates\CertificateRequest.Load.cs (2)
55Debug.Fail("Base64Decode failed, but PemEncoding said it was legal"); 375Debug.Fail(
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.cs (1)
31Debug.Assert(revoked != null);
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.Load.cs (2)
276Debug.Fail("Base64Decode failed, but PemEncoding said it was legal"); 285Debug.Assert(bytesConsumed == bytesWritten);
System\Security\Cryptography\X509Certificates\ChainPal.OpenSsl.cs (2)
196Debug.Assert(reportedLeaf != null, "reportedLeaf != null"); 197Debug.Assert(!ReferenceEquals(cert, reportedLeaf.Pal), "!ReferenceEquals(cert, reportedLeaf.Pal)");
System\Security\Cryptography\X509Certificates\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 (3)
55Debug.Fail("Presized hash buffer was not the correct size."); 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 (7)
105Debug.Assert(ret != null); 111Debug.Assert( 141Debug.Assert( 163Debug.Assert(s_rootStoreDirectories is not null); 164Debug.Assert(s_directoryLastWrite is not null); 306Debug.Assert( 361Debug.Assert(set.Count == 0);
System\Security\Cryptography\X509Certificates\OpenSslCrlCache.cs (3)
153Debug.Fail("Failed to get the last write time of the CRL file"); 164Debug.Assert( 286Debug.Fail("HashData failed or produced an incorrect length output");
System\Security\Cryptography\X509Certificates\OpenSslDirectoryBasedStoreProvider.cs (4)
34Debug.Assert( 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 (9)
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); 793Debug.Assert( 796Debug.Assert( 835Debug.Assert(exported != null);
System\Security\Cryptography\X509Certificates\OpenSslX509ChainProcessor.cs (13)
381Debug.Assert(revocationFlag == X509RevocationFlag.EntireChain); 484Debug.Assert(refErrors.HasRevocationUnknown()); 520Debug.Assert(chainSize == 1 || revocationFlag != X509RevocationFlag.EndCertificateOnly); 568Debug.Assert(workingChain.LastError <= start - 1); 678Debug.Assert(!verify, "verify should have returned false for signature error"); 692Debug.Assert(verify, "verify should have returned true"); 832Debug.Assert(baseUri.Length > 0); 833Debug.Assert(resource.Length > 0); 1005Debug.Assert( 1171Debug.Fail("Unrecognized X509VerifyStatusCode:" + code.Code30); 1183Debug.Fail("Unrecognized X509VerifyStatusCode:" + code.Code102); 1195Debug.Fail("Unrecognized X509VerifyStatusCode:" + code.Code111); 1561Debug.Fail($"Out of range X509VerifyStatusCode returned {val} >= {OverflowValue}");
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\UnixChainVerifier.cs (1)
38Debug.Assert(
System\Security\Cryptography\X509Certificates\UnixExportProvider.cs (11)
49Debug.Assert(password != null); 91Debug.Assert(_certs != null); 291Debug.Assert(tmpWriter.GetEncodedLength() == 0); 306Debug.Fail("TryEncode failed with a pre-allocated buffer"); 328Debug.Assert(tmpWriter.GetEncodedLength() == 0); 340Debug.Assert(certContentsIv.Length * 8 == cipher.BlockSize); 389Debug.Assert(encryptedLength <= requestedSize); 406Debug.Assert(tmpWriter.GetEncodedLength() == 0); 470Debug.Fail("TryEncode failed with a pre-allocated buffer"); 501Debug.Fail($"HMACSHA1.HashData wrote {bytesWritten} of {HMACSHA1.HashSizeInBytes} bytes"); 514Debug.Assert(tmpWriter.GetEncodedLength() == 0);
System\Security\Cryptography\X509Certificates\UnixPkcs12Reader.cs (5)
82Debug.Assert(certs != null); 184Debug.Fail("Couldn't unpack decrypted buffer."); 259Debug.Assert(_pfxAsn.MacData.HasValue); 803Debug.Assert(safeBag.BagId == Oids.Pkcs12KeyBag); 840Debug.Assert(_rented == null);
System\Security\Cryptography\X509Certificates\X500DistinguishedName.cs (1)
144Debug.Fail("AsnValueReader produced a span outside of the original bounds");
System\Security\Cryptography\X509Certificates\X500DistinguishedNameBuilder.cs (1)
231Debug.Assert(written == 2);
System\Security\Cryptography\X509Certificates\X500NameEncoder.cs (11)
102Debug.Assert(dnSeparators.Length != 0); 276Debug.Assert(tagStart >= 0); 378Debug.Assert(hasTagOid); 379Debug.Assert(valueEnd != -1); 380Debug.Assert(valueStart != -1); 399Debug.Fail($"Invalid parser state. Position {pos}, State {state}, Character {c}, String \"{stringForm}\""); 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 (2)
151Debug.Assert(tavReader.RuleSet == AsnEncodingRules.DER); 178Debug.Fail("TryReadPrimitiveOctetString should either succeed or throw with DER.");
System\Security\Cryptography\X509Certificates\X500RelativeDistinguishedName.cs (2)
64Debug.Assert(overlaps, "AsnValueReader.ReadEncodedValue returns a slice of the source"); 65Debug.Assert(offset > 0);
System\Security\Cryptography\X509Certificates\X509AuthorityInformationAccessExtension.cs (1)
179Debug.Assert(_decoded is not null);
System\Security\Cryptography\X509Certificates\X509Certificate.cs (1)
139Debug.Assert(pal != null);
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (3)
1091Debug.Fail("The contents should have already been validated by the PEM reader."); 1297Debug.Assert(rawSAN.GetType() == typeof(X509Extension)); 1333Debug.Assert(firstDot != 0, "Leading periods should have been rejected.");
System\Security\Cryptography\X509Certificates\X509Certificate2Collection.cs (3)
384Debug.Fail("The contents should have already been validated by the PEM reader."); 498Debug.Fail("Pre-allocated buffer was not the correct size."); 553Debug.Fail("Presized buffer is too small or did not write the correct amount.");
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\X509ChainElementCollection.cs (1)
21Debug.Assert(chainElements != null, "chainElements != null");
System\Security\Cryptography\X509Certificates\X509Store.cs (1)
82Debug.Assert(_storePal != null);
System\Security\Cryptography\X509Certificates\X509SubjectAlternativeNameExtension.cs (1)
72Debug.Assert(value.Length is 4 or 16);
System\Security\Cryptography\X509Certificates\X509SubjectKeyIdentifierExtension.cs (2)
174Debug.Assert(written == SHA1.HashSizeInBytes); 211Debug.Assert(written >= TruncateSize);
System\Security\Cryptography\XmlKeyHelper.cs (6)
79Debug.Assert(buf != null); 124Debug.Assert(name.Length > 0); 125Debug.Assert(value.Length > 0); 126Debug.Assert(builder != null); 148Debug.Fail($"Convert.TryToBase64Chars failed with {localLength} bytes to {StackChars} chars"); 247Debug.Fail("Original enumerator had elements, new one does not");
System.Security.Cryptography.Cose (46)
src\libraries\System.Formats.Cbor\src\System\Formats\Cbor\CborInitialByte.cs (2)
47Debug.Assert((byte)majorType < 8, "CBOR Major Type is out of range"); 48Debug.Assert((byte)additionalInfo < 32, "CBOR initial byte additional info is out of range");
System\Security\Cryptography\Cose\CoseHeaderMap.cs (2)
353Debug.Assert(!map.ContainsKey(CoseHeaderLabel.Algorithm)); 377Debug.Assert(bytesWritten == ComputeEncodedSize(map, algHeaderValueToSlip));
System\Security\Cryptography\Cose\CoseHelpers.cs (10)
118Debug.Assert(keyType == KeyType.RSA); 119Debug.Assert(signer.RSASignaturePadding != null); 131Debug.Assert(hasher.HashLengthInBytes <= 512 / 8); // largest hash we can get (SHA512). 137Debug.Fail("TrySignData failed with a pre-calculated destination"); 152Debug.Assert(hasher.HashLengthInBytes <= 512 / 8); // largest hash we can get (SHA512). 158Debug.Fail("TrySignData failed with a pre-calculated destination"); 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 (4)
157Debug.Assert(alg.HasValue, "Algorithm (alg) is a known header and should have been validated in Set[Encoded]Value()"); 189Debug.Assert(_keyType == KeyType.RSA); 190Debug.Assert(RSASignaturePadding != null); 203Debug.Assert(RSASignaturePadding == RSASignaturePadding.Pkcs1);
System.Text.Encoding.CodePages (186)
System\Text\BaseCodePageEncoding.cs (12)
105Debug.Assert(stream is UnmanagedMemoryStream, "UnmanagedMemoryStream will read a full buffer on one call to Read."); 107Debug.Assert(bytesRead == codePageDataFileHeader.Length); 143Debug.Assert(stream is UnmanagedMemoryStream, "UnmanagedMemoryStream will read a full buffer on one call to Read."); 145Debug.Assert(bytesRead == codePageIndex.Length); 189Debug.Assert(stream is UnmanagedMemoryStream, "UnmanagedMemoryStream will read a full buffer on one call to Read."); 191Debug.Assert(bytesRead == codePageHeader.Length); 230Debug.Assert(tableName != null, "table name can not be null"); 266Debug.Assert(m_codePageHeader != null && m_codePageHeader.Length == CODEPAGE_HEADER_SIZE, "m_codePageHeader expected to match in size the struct CodePageHeader"); 348Debug.Assert(pCodePageIndex->ByteCount == 1 || pCodePageIndex->ByteCount == 2, 370Debug.Assert(pNativeMemory != null); 385Debug.Assert(arrayUnicodeBestFit != null, "[BaseCodePageEncoding.GetBestFitUnicodeToBytesData]Expected non-null arrayUnicodeBestFit"); 396Debug.Assert(arrayBytesBestFit != null, "[BaseCodePageEncoding.GetBestFitBytesToUnicodeData]Expected non-null arrayBytesBestFit");
System\Text\BaseCodePageEncoding.netcoreapp.cs (2)
16Debug.Assert(stream is UnmanagedMemoryStream, "UnmanagedMemoryStream will read a full buffer on one call to Read."); 18Debug.Assert(bytesRead == codePageIndex.Length);
System\Text\DBCSCodePageEncoding.cs (39)
87Debug.Assert(m_codePageHeader?.Length > 0); 94Debug.Assert(pCodePage->CodePage == dataTableCodePage, 116Debug.Assert(_bytesUnknown == 0x3f, 139Debug.Assert(bytesRead == m_dataSize, "s_codePagesEncodingDataStream.Read should have read a full buffer."); 179Debug.Assert(bytePosition < 0x100, "[DBCSCodePageEncoding.LoadManagedCodePage]expected lead byte to be < 0x100"); 262Debug.Assert(bytesRead == m_dataSize, "s_codePagesEncodingDataStream.Read should have read a full buffer."); 403Debug.Assert((arrayTemp.Length / 2) < 20, 525Debug.Assert(count >= 0, "[DBCSCodePageEncoding.GetByteCount]count is negative"); 526Debug.Assert(chars != null, "[DBCSCodePageEncoding.GetByteCount]chars is null"); 529Debug.Assert(EncoderFallback != null, "[DBCSCodePageEncoding.GetByteCount]Attempting to use null fallback"); 556Debug.Assert(char.IsHighSurrogate(charLeftOver), "[DBCSCodePageEncoding.GetByteCount]leftover character should be high surrogate"); 557Debug.Assert(encoder != null, 621Debug.Assert(bytes != null, "[DBCSCodePageEncoding.GetBytes]bytes is null"); 622Debug.Assert(byteCount >= 0, "[DBCSCodePageEncoding.GetBytes]byteCount is negative"); 623Debug.Assert(chars != null, "[DBCSCodePageEncoding.GetBytes]chars is null"); 624Debug.Assert(charCount >= 0, "[DBCSCodePageEncoding.GetBytes]charCount is negative"); 627Debug.Assert(EncoderFallback != null, "[DBCSCodePageEncoding.GetBytes]Attempting to use null encoder fallback"); 647Debug.Assert(charLeftOver == 0 || char.IsHighSurrogate(charLeftOver), 662Debug.Assert(encoder != null, 695Debug.Assert(encoder == null, 718Debug.Assert(chars > charStart, 737Debug.Assert(chars > charStart, 770Debug.Assert(bytes != null, "[DBCSCodePageEncoding.GetCharCount]bytes is null"); 771Debug.Assert(count >= 0, "[DBCSCodePageEncoding.GetCharCount]byteCount is negative"); 787Debug.Assert(decoder == null || 807Debug.Assert(fallbackBuffer == null, 832Debug.Assert(fallbackBuffer == null, 907Debug.Assert(decoder == null || !decoder.m_throwOnOverflow || 919Debug.Assert(bytes != null, "[DBCSCodePageEncoding.GetChars]bytes is null"); 920Debug.Assert(byteCount >= 0, "[DBCSCodePageEncoding.GetChars]byteCount is negative"); 921Debug.Assert(chars != null, "[DBCSCodePageEncoding.GetChars]chars is null"); 922Debug.Assert(charCount >= 0, "[DBCSCodePageEncoding.GetChars]charCount is negative"); 940Debug.Assert(decoder == null || !decoder.m_throwOnOverflow || 961Debug.Assert(fallbackBuffer == null, 987Debug.Assert(fallbackBuffer == null, 1065Debug.Assert(bytes >= byteStart + byteBuffer.Length, 1079Debug.Assert(bytes > byteStart, 1084Debug.Assert(bytes > byteStart, 1110Debug.Assert(decoder == null || !decoder.m_throwOnOverflow ||
System\Text\DecoderBestFitFallback.cs (3)
84Debug.Assert(iCount < 1, "[DecoderReplacementFallbackBuffer.Fallback] Calling fallback without a previously empty buffer"); 182Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length, 203Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length,
System\Text\DecoderFallbackBufferHelper.cs (5)
25Debug.Assert(_fallbackBuffer != null); 46Debug.Assert(byteStart != null, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize"); 47Debug.Assert(_fallbackBuffer != null); 102Debug.Assert(byteStart != null, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize"); 103Debug.Assert(_fallbackBuffer != null);
System\Text\EncoderBestFitFallback.cs (4)
86Debug.Assert(_iCount < 1, $"[InternalEncoderBestFitFallbackBuffer.Fallback(non surrogate)] Fallback char {(int)_cBestFit:X4} caused recursive fallback"); 108Debug.Assert(_iCount < 1, $"[InternalEncoderBestFitFallbackBuffer.Fallback(surrogate)] Fallback char {(int)_cBestFit:X4} caused recursive fallback"); 187Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length, 208Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length,
System\Text\EncoderFallbackBufferHelper.cs (4)
34Debug.Assert(_fallbackBuffer != null); 56Debug.Assert(_fallbackBuffer != null); 74Debug.Assert(charStart != null, "[EncoderFallback.InternalFallbackBuffer]Fallback buffer is not initialized"); 75Debug.Assert(_fallbackBuffer != null);
System\Text\EncodingByteBuffer.cs (2)
50Debug.Assert(moreBytesExpected >= 0, "[EncodingByteBuffer.AddByte]expected non-negative moreBytesExpected"); 107Debug.Assert(_chars > _charStart || (bThrow && (_bytes == _byteStart)),
System\Text\EncodingCharBuffer.cs (2)
42Debug.Assert(_fallbackBuffer.Remaining == 0, 108Debug.Assert(_bytes < _byteEnd, "[EncodingCharBuffer.GetNextByte]Expected more date");
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\GB18030Encoding.cs (13)
166Debug.Assert(count4Byte <= GBLast4ByteCode, 186Debug.Assert(unicodeCount == 0, 190Debug.Assert(count4Byte == GBLast4ByteCode + 1, 217Debug.Assert(byteCount >= 0, "[GB18030Encoding.GetBytes]byteCount is negative"); 218Debug.Assert(chars != null, "[GB18030Encoding.GetBytes]chars is null"); 219Debug.Assert(charCount >= 0, "[GB18030Encoding.GetBytes]charCount is negative"); 222Debug.Assert(EncoderFallback != null, "[GB18030Encoding.GetBytes]Attempting to use null encoder fallback"); 244Debug.Assert(char.IsHighSurrogate(charLeftOver), 274Debug.Assert(offset < 0x6f, 324Debug.Assert(iBytes < 0x7e, 402Debug.Assert(bytes != null, "[GB18030Encoding.GetChars]bytes is null"); 403Debug.Assert(byteCount >= 0, "[GB18030Encoding.GetChars]byteCount is negative"); 405Debug.Assert(charCount >= 0, "[GB18030Encoding.GetChars]charCount is negative");
System\Text\ISCIIEncoding.cs (32)
60Debug.Assert(_defaultCodePage >= CodeDevanagari && _defaultCodePage <= CodePunjabi, 129Debug.Assert(chars != null, "[ISCIIEncoding.GetBytes]chars!=null"); 131Debug.Assert(charCount >= 0, "[ISCIIEncoding.GetBytes]charCount >=0"); 132Debug.Assert(byteCount >= 0, "[ISCIIEncoding.GetBytes]byteCount >=0"); 228Debug.Assert(indicScript != 0, "[ISCIIEncoding.GetBytes]expected an indic script value"); 239Debug.Assert(currentCodePage >= CodeDevanagari && currentCodePage <= CodePunjabi, 254Debug.Assert((indicTwoBytes >> 12) > 0 && (indicTwoBytes >> 12) <= 3, 318Debug.Assert(bytes != null, "[ISCIIEncoding.GetChars]bytes is null"); 319Debug.Assert(byteCount >= 0, "[ISCIIEncoding.GetChars]byteCount is negative"); 321Debug.Assert(charCount >= 0, "[ISCIIEncoding.GetChars]charCount is negative"); 352Debug.Assert(currentCodePage >= CodeDevanagari && currentCodePage <= CodePunjabi, 372Debug.Assert(((bLastVirama ? 1 : 0) + (bLastATR ? 1 : 0) + 431Debug.Assert(bLastVirama == false, "[ISCIIEncoding.GetChars] Expected no bLastVirama in bLastATR mode"); 432Debug.Assert(bLastDevenagariStressAbbr == false, "[ISCIIEncoding.GetChars] Expected no bLastDevenagariStressAbbr in bLastATR mode"); 433Debug.Assert(cLastCharForNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNextNukta in bLastATR mode"); 434Debug.Assert(cLastCharForNoNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNoNextNukta in bLastATR mode"); 462Debug.Assert(bLastATR == false, "[ISCIIEncoding.GetChars] Expected no bLastATR in bLastVirama mode"); 463Debug.Assert(bLastDevenagariStressAbbr == false, "[ISCIIEncoding.GetChars] Expected no bLastDevenagariStressAbbr in bLastVirama mode"); 464Debug.Assert(cLastCharForNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNextNukta in bLastVirama mode"); 465Debug.Assert(cLastCharForNoNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNoNextNukta in bLastVirama mode"); 498Debug.Assert(bLastATR == false, "[ISCIIEncoding.GetChars] Expected no bLastATR in bLastDevenagariStressAbbr mode"); 499Debug.Assert(bLastVirama == false, "[ISCIIEncoding.GetChars] Expected no bLastVirama in bLastDevenagariStressAbbr mode"); 500Debug.Assert(cLastCharForNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNextNukta in bLastDevenagariStressAbbr mode"); 501Debug.Assert(cLastCharForNoNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNoNextNukta in bLastDevenagariStressAbbr mode"); 506Debug.Assert(cLastCharForNextNukta > 0 && cLastCharForNoNextNukta > 0, 528Debug.Assert(bLastATR == false, "[ISCIIEncoding.GetChars] Expected no bLastATR in cLastCharForNextNukta mode"); 529Debug.Assert(bLastVirama == false, "[ISCIIEncoding.GetChars] Expected no bLastVirama in cLastCharForNextNukta mode"); 530Debug.Assert(bLastDevenagariStressAbbr == false, "[ISCIIEncoding.GetChars] Expected no bLastDevenagariStressAbbr in cLastCharForNextNukta mode"); 535Debug.Assert(!bLastSpecial && !bLastDevenagariStressAbbr && !bLastVirama && !bLastATR && 554Debug.Assert(currentCodePageIndex != -1, "[ISCIIEncoding.GetChars]Expected valid currentCodePageIndex != -1"); 600Debug.Assert(currentCodePage == CodeDevanagari && b == DevenagariExt, 652Debug.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow,
System\Text\ISO2022Encoding.cs (24)
226Debug.Assert(count >= 0, "[ISO2022Encoding.GetByteCount]count is negative"); 227Debug.Assert(chars != null, "[ISO2022Encoding.GetByteCount]chars is null"); 237Debug.Assert(chars != null, "[ISO2022Encoding.GetBytes]chars is null"); 238Debug.Assert(byteCount >= 0, "[ISO2022Encoding.GetBytes]byteCount is negative"); 239Debug.Assert(charCount >= 0, "[ISO2022Encoding.GetBytes]charCount is negative"); 242Debug.Assert(EncoderFallback != null, "[ISO2022Encoding.GetBytes]Attempting to use null encoder fallback"); 277Debug.Assert(bytes != null, "[ISO2022Encoding.GetCharCount]bytes is null"); 278Debug.Assert(count >= 0, "[ISO2022Encoding.GetCharCount]byteCount is negative"); 288Debug.Assert(bytes != null, "[ISO2022Encoding.GetChars]bytes is null"); 289Debug.Assert(byteCount >= 0, "[ISO2022Encoding.GetChars]byteCount is negative"); 290Debug.Assert(charCount >= 0, "[ISO2022Encoding.GetChars]charCount is negative"); 314Debug.Fail("[ISO2022Encoding.GetChars] had unexpected code page"); 376Debug.Assert(char.IsHighSurrogate(charLeftOver), "[ISO2022Encoding.GetBytesCP5022xJP]leftover character should be high surrogate"); 437Debug.Assert(CodePage == 50221, "[ISO2022Encoding.GetBytesCP5022xJP]Expected Code Page 50221"); 617Debug.Assert(char.IsHighSurrogate(charLeftOver), "[ISO2022Encoding.GetBytesCP50225KR]leftover character should be high surrogate"); 717Debug.Assert(!encoder.MustFlush || !encoder.m_throwOnOverflow, 763Debug.Assert(char.IsHighSurrogate(charLeftOver), "[ISO2022Encoding.GetBytesCP52936]leftover character should be high surrogate"); 1086Debug.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow, 1180Debug.Assert(count > 0, "[ISO2022Encoding.DecrementEscapeBytes]count > 0"); 1385Debug.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow, 1443Debug.Assert(byteCount >= 0, "[ISO2022Encoding.GetCharsCP52936]count >=0"); 1444Debug.Assert(bytes != null, "[ISO2022Encoding.GetCharsCP52936]bytes!=null"); 1553Debug.Assert(currentMode == ISO2022Modes.ModeHZ, "[ISO2022Encoding.GetCharsCP52936]Expected ModeHZ"); 1677Debug.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow,
System\Text\SBCSCodePageEncoding.cs (37)
62Debug.Assert(m_codePageHeader?.Length > 0); 68Debug.Assert(pCodePage->CodePage == dataTableCodePage, 103Debug.Assert(bytesRead == buffer.Length, "s_codePagesEncodingDataStream.Read should have read a full buffer."); 167Debug.Assert(bytesRead == buffer.Length, "s_codePagesEncodingDataStream.Read should have read a full buffer."); 182Debug.Assert(arrayTemp[byteTemp] == UNKNOWN_CHAR, $"[SBCSCodePageEncoding::ReadBestFitTable] Expected unallocated byte (not 0x{(int)arrayTemp[byteTemp]:X2}) for best fit byte at 0x{byteTemp:X2} for code page {CodePage}"); 281Debug.Assert(arrayTemp[iBestFitCount - 1] != (char)0, 301Debug.Assert(count >= 0, "[SBCSCodePageEncoding.GetByteCount]count is negative"); 302Debug.Assert(chars != null, "[SBCSCodePageEncoding.GetByteCount]chars is null"); 305Debug.Assert(EncoderFallback != null, "[SBCSCodePageEncoding.GetByteCount]Attempting to use null fallback"); 317Debug.Assert(charLeftOver == 0 || char.IsHighSurrogate(charLeftOver), 322Debug.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer || 363Debug.Assert(encoder != null, "[SBCSCodePageEncoding.GetByteCount]Expect to have encoder if we have a charLeftOver"); 416Debug.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 426Debug.Assert(bytes != null, "[SBCSCodePageEncoding.GetBytes]bytes is null"); 427Debug.Assert(byteCount >= 0, "[SBCSCodePageEncoding.GetBytes]byteCount is negative"); 428Debug.Assert(chars != null, "[SBCSCodePageEncoding.GetBytes]chars is null"); 429Debug.Assert(charCount >= 0, "[SBCSCodePageEncoding.GetBytes]charCount is negative"); 432Debug.Assert(EncoderFallback != null, "[SBCSCodePageEncoding.GetBytes]Attempting to use null encoder fallback"); 444Debug.Assert(charLeftOver == 0 || char.IsHighSurrogate(charLeftOver), 449Debug.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer || 548Debug.Assert(encoder != null, "[SBCSCodePageEncoding.GetBytes]Expect to have encoder if we have a charLeftOver"); 607Debug.Assert(chars > charStart, "[SBCSCodePageEncoding.GetBytes]Expected chars to have advanced (fallback)"); 623Debug.Assert(fallbackBuffer == null || fallbackHelper.bFallingBack == false, "[SBCSCodePageEncoding.GetBytes]Expected to NOT be falling back"); 626Debug.Assert(chars > charStart, "[SBCSCodePageEncoding.GetBytes]Expected chars to have advanced (normal)"); 651Debug.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, "[SBCSEncoding.GetBytes]Expected Empty fallback buffer at end"); 660Debug.Assert(bytes != null, "[SBCSCodePageEncoding.GetCharCount]bytes is null"); 661Debug.Assert(count >= 0, "[SBCSCodePageEncoding.GetCharCount]byteCount is negative"); 680Debug.Assert(!decoder.m_throwOnOverflow || !decoder.InternalHasFallbackBuffer || 738Debug.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 749Debug.Assert(bytes != null, "[SBCSCodePageEncoding.GetChars]bytes is null"); 750Debug.Assert(byteCount >= 0, "[SBCSCodePageEncoding.GetChars]byteCount is negative"); 751Debug.Assert(chars != null, "[SBCSCodePageEncoding.GetChars]chars is null"); 752Debug.Assert(charCount >= 0, "[SBCSCodePageEncoding.GetChars]charCount is negative"); 776Debug.Assert(!decoder.m_throwOnOverflow || !decoder.InternalHasFallbackBuffer || 861Debug.Assert(bytes > byteStart, 880Debug.Assert(bytes > byteStart, 897Debug.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0,
System.Text.Encodings.Web (64)
src\libraries\Common\src\System\HexConverter.cs (3)
165Debug.Assert(chars.Length >= bytes.Length * 2); 332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0); 298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\libraries\System.Private.CoreLib\src\System\Text\UnicodeDebug.cs (6)
15Debug.Fail($"The value {ToHexString(codePoint)} is not a valid BMP code point."); 24Debug.Fail($"The value {ToHexString(codePoint)} is not a valid UTF-16 high surrogate code point."); 33Debug.Fail($"The value {ToHexString(codePoint)} is not a valid UTF-16 low surrogate code point."); 42Debug.Fail($"The value {ToHexString(codePoint)} is not a valid Unicode code point."); 51Debug.Fail($"The value {ToHexString(scalarValue)} is not a valid Unicode scalar value."); 60Debug.Fail($"The value {ToHexString(scalarValue)} is not a valid supplementary plane Unicode scalar value.");
System\IO\TextWriterExtensions.cs (2)
19Debug.Assert(writer != null); 20Debug.Assert(value != null);
System\Text\Encodings\Web\AllowedBmpCodePointsBitmap.cs (2)
70Debug.Assert(definedCharsBitmapAsLittleEndian.Length == thisAllowedCharactersBitmap.Length * sizeof(uint)); 81Debug.Assert(thisAllowedCharactersBitmap.IsEmpty, "Both vectors should've been fully consumed.");
System\Text\Encodings\Web\AsciiByteMap.cs (2)
20Debug.Assert(key < BufferSize); 21Debug.Assert(value != 0);
System\Text\Encodings\Web\DefaultHtmlEncoder.cs (4)
107Debug.Assert(4 <= idxOfSemicolon && idxOfSemicolon <= 9, "Expected '&#x0;'..'&#x10FFFF;'."); 114Debug.Fail("We should've had enough room to write 4 bytes."); 182Debug.Assert(4 <= idxOfSemicolon && idxOfSemicolon <= 9, "Expected '&#x0;'..'&#x10FFFF;'."); 191Debug.Fail("We should've had enough room to write 4 chars.");
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.Ascii.cs (2)
105Debug.Assert(encodedCharCount > 0 && encodedCharCount <= 6, "Inner encoder returned bad length."); 112Debug.Assert(thisChar <= 0x7F, "Inner encoder returned non-ASCII data.");
System\Text\Encodings\Web\OptimizedInboxTextEncoder.cs (10)
39Debug.Assert(scalarEscaper != null); 103Debug.Assert(innerCharsWritten <= bufferLength, "Mustn't overflow the buffer."); 104Debug.Assert(innerCharsWritten != 0, "Inner escaper succeeded with 0-char output?"); 296Debug.Assert(scalarValue == Rune.ReplacementChar); // DecodeFromUtfXX should've set replacement character on failure 365Debug.Assert(Ssse3.IsSupported, "#ifdef was ill-formed."); 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 (6)
345Debug.Assert(scalarValue == Rune.ReplacementChar); // DecodeFromUtf8 should've performed substitution 467Debug.Assert(scalarValue == Rune.ReplacementChar); // should be replacement char 514Debug.Assert(output != null); 515Debug.Assert(!value.IsEmpty, "Caller should've special-cased 'no encoding needed'."); 578Debug.Assert(!string.IsNullOrEmpty(source)); 598Debug.Assert(unicodeScalar < ushort.MaxValue);
System\Text\Encodings\Web\ThrowHelper.cs (1)
25Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument),
System\Text\Unicode\UnicodeHelpers.cs (2)
29Debug.Assert(0x10000 <= scalar && scalar <= UNICODE_LAST_CODEPOINT); 45Debug.Assert(scalar <= UNICODE_LAST_CODEPOINT);
System.Text.Json (1339)
src\libraries\Common\src\System\HexConverter.cs (3)
165Debug.Assert(chars.Length >= bytes.Length * 2); 332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\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 (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0); 298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\libraries\System.Text.Json\Common\JsonHelpers.cs (2)
144Debug.Assert(childlessQueue.Count > 0, "The graph contains cycles."); 172Debug.Assert(idx == 0, "should have populated the entire sortedNodes array.");
src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (2)
18Debug.Assert(char.IsPunctuation(separator)); 85Debug.Fail($"Unexpected state {state}");
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 (13)
67Debug.Assert(index >= 0, $"Set - Negative - index: {index}, arrayLength: {_array.Length}"); 70Debug.Assert(_array.Length <= int.MaxValue / 32 + 1, $"index: {index}, arrayLength: {_array.Length}"); 79Debug.Assert(index >= 0 && index > (int)((uint)_array.Length * 32 - 1), $"Only grow when necessary - index: {index}, arrayLength: {_array.Length}"); 83Debug.Assert(elementIndex < _array.Length, $"Set - index: {index}, elementIndex: {elementIndex}, arrayLength: {_array.Length}, extraBits: {extraBits}"); 122Debug.Assert(_array != null); 123Debug.Assert(index >= 0, $"Get - Negative - index: {index}, arrayLength: {_array.Length}"); 127Debug.Assert(elementIndex < _array.Length, $"Get - index: {index}, elementIndex: {elementIndex}, arrayLength: {_array.Length}, extraBits: {extraBits}"); 134Debug.Assert(_array != null); 135Debug.Assert(_array.Length < int.MaxValue / 2, $"Array too large - arrayLength: {_array.Length}"); 136Debug.Assert(minSize >= 0 && minSize >= _array.Length); 139Debug.Assert(nextDouble > minSize); 146Debug.Assert(_currentDepth == 0, "Only call SetFirstBit when depth is 0"); 153Debug.Assert(_currentDepth == 0, "Only call ResetFirstBit when depth is 0");
System\Text\Json\Document\JsonDocument.cs (23)
44Debug.Assert(!utf8Json.IsEmpty); 47Debug.Assert(isDisposable || 51Debug.Assert(extraRentedArrayPoolBytes == null || extraPooledByteBufferWriter == null); 175Debug.Fail( 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); 799Debug.Fail($"Unexpected encounter with JsonTokenType {row.TokenType}"); 845Debug.Fail($"Unexpected encounter with JsonTokenType {row.TokenType}"); 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 (18)
159Debug.Assert(!_isLocked, "Dispose called on a locked database"); 178Debug.Assert(_data != null); 219Debug.Assert( 235Debug.Assert(!_isLocked, "Appending to a locked database"); 244Debug.Assert(MaxArrayLength == Array.MaxLength); 269Debug.Assert(index >= 0); 270Debug.Assert(index <= Length - DbRow.Size, $"index {index} is out of bounds"); 271Debug.Assert(index % DbRow.Size == 0, $"index {index} is not at a record start position"); 277Debug.Assert(length >= 0); 285Debug.Assert(numberOfRows >= 1 && numberOfRows <= 0x0FFFFFFF); 309Debug.Assert(lookupType == JsonTokenType.StartObject || lookupType == JsonTokenType.StartArray); 328Debug.Fail($"Unable to find expected {lookupType} token"); 348Debug.Assert( 353Debug.Assert(endIndex <= Length); 361Debug.Assert( 367Debug.Assert( 373Debug.Assert( 395Debug.Assert(newDbInts[i] >= locationOffset);
System\Text\Json\Document\JsonDocument.Parse.cs (21)
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); 422Debug.Assert(ret, "TryParseValue returned false with shouldThrow: true."); 423Debug.Assert(document != null, "null document returned with shouldThrow: true."); 508Debug.Assert( 559Debug.Assert(payloadLength > 1); 563Debug.Assert( 567Debug.Assert( 587Debug.Assert( 591Debug.Assert( 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 (3)
26Debug.Assert(idx >= 0); 1429Debug.Assert(_parent != null); 1438Debug.Fail($"No handler for {nameof(JsonTokenType)}.{TokenType}");
System\Text\Json\Document\JsonElement.ObjectEnumerator.cs (1)
27Debug.Assert(target.TokenType == JsonTokenType.StartObject);
System\Text\Json\Document\JsonElement.Parse.cs (2)
51Debug.Assert(ret, "TryParseValue returned false with shouldThrow: true."); 52Debug.Assert(document != null, "null document returned with shouldThrow: true.");
System\Text\Json\JsonEncodedText.cs (2)
34Debug.Assert(utf8Value != null); 94Debug.Assert(expectedByteCount == utf8Bytes.Length);
System\Text\Json\JsonHelpers.cs (4)
21Debug.Assert(reader.TokenType is JsonTokenType.String or JsonTokenType.PropertyName); 72Debug.Assert(tokenType == reader.TokenType); 142Debug.Assert(result); 152Debug.Assert(success, "The skipped value should have already been buffered.");
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 (5)
124Debug.Fail("Impossible case"); 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 (3)
72Debug.Assert(element.ValueKind == JsonValueKind.Object); 192Debug.Fail("Impossible case"); 243Debug.Assert(_dictionary != null, "Cannot have detachable nodes without a materialized dictionary.");
System\Text\Json\Nodes\JsonValue.cs (1)
95Debug.Assert(child == null);
System\Text\Json\Nodes\JsonValueOfT.cs (6)
17Debug.Assert(value != null); 18Debug.Assert(value is not JsonElement or JsonElement { ValueKind: not JsonValueKind.Null }); 114Debug.Fail("Object and Array JsonElements cannot be contained in JsonValue."); 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 (10)
68Debug.Fail($"No mapping for token type {tokenType}"); 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 (36)
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); 484Debug.Assert(source[idx] == 'u', "invalid escape sequences must have already been caught by Utf8JsonReader.Read()"); 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 (16)
46Debug.Assert(span.IndexOf(JsonConstants.BackSlash) == -1); 81Debug.Assert(_tokenType is JsonTokenType.String or JsonTokenType.PropertyName or JsonTokenType.Number); 82Debug.Assert(_tokenType != JsonTokenType.Number || !ValueIsEscaped, "Numbers can't contain escape characters."); 145Debug.Assert(_tokenType is JsonTokenType.String or JsonTokenType.PropertyName or JsonTokenType.Number); 146Debug.Assert(_tokenType != JsonTokenType.Number || !ValueIsEscaped, "Numbers can't contain escape characters."); 161Debug.Assert(success); 197Debug.Assert(_tokenType is JsonTokenType.String or JsonTokenType.PropertyName); 198Debug.Assert(ValueIsEscaped); 228Debug.Assert(bytesWritten < source.Length, "source buffer must contain at least one escape sequence"); 262Debug.Assert((HasValueSequence ? ValueSequence.ToArray() : ValueSpan).Length == 4); 268Debug.Fail("Throw helper should have thrown an exception."); 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 (2)
24Debug.Assert(typeof(T).IsInSubtypeRelationshipWith(sourceConverter.Type!)); 25Debug.Assert(sourceConverter.SourceConverterForCastingConverter is null, "casting converters should not be layered.");
System\Text\Json\Serialization\Converters\Collection\IAsyncEnumerableConverterFactory.cs (1)
25Debug.Assert(asyncEnumerableInterface is not null, $"{typeToConvert} not supported by converter.");
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 (10)
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); 262Debug.Assert(JsonSerializer.IsMetadataPropertyName(reader.GetUnescapedSpan(), (state.Current.BaseJsonTypeInfo ?? jsonTypeInfo).PolymorphicTypeResolver), "should only be hit if metadata property."); 264Debug.Assert(result, "Metadata reader must have buffered all contents."); 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 (3)
31Debug.Assert(CanConvert(typeToConvert)); 66Debug.Assert(objectFactory.CanConvert(typeToConvert)); 71Debug.Fail("Unrecognized F# type.");
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 (15)
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); 292Debug.Assert(!isAlreadyReadMetadataProperty, "Only possible for types that can read metadata, which do not call into the fast-path method."); 348Debug.Assert(success); 363Debug.Assert(success); 397Debug.Assert(jsonPropertyInfo.EffectiveConverter.ConverterStrategy != ConverterStrategy.Value); 475Debug.Assert(success, "Serializer should guarantee sufficient read-ahead has been done.");
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.cs (19)
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); 325Debug.Assert(success, "Serializer should guarantee sufficient read-ahead has been done."); 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 (5)
30Debug.Assert(state.Current.CtorArgumentState!.Arguments != null); 50Debug.Fail("More than 4 params: we should be in override for LargeObjectWithParameterizedConstructorConverter."); 63Debug.Assert(jsonParameterInfo.ShouldDeserialize); 85Debug.Assert(typeInfo.CreateObjectWithArgs != null); 108Debug.Fail("More than 4 params: we should be in override for LargeObjectWithParameterizedConstructorConverter.");
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 (4)
71Debug.Assert(names.Length == values.Length); 211Debug.Assert(original.Contains(ValueSeparator)); 418Debug.Assert(_nameCacheForReading != null, "Enum value cache should be instantiated if a naming policy is specified."); 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 (3)
102Debug.Fail("Should not be reachable."); 109Debug.Fail("Should not be reachable."); 116Debug.Assert(this is not JsonConverterFactory);
System\Text\Json\Serialization\JsonConverter.MetadataHandling.cs (26)
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); 59Debug.Fail("Unexpected PolymorphicSerializationState."); 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); 131Debug.Fail("Unexpected PolymorphicSerializationState."); 140Debug.Assert(!IsValueType); 141Debug.Assert(!state.IsContinuation); 142Debug.Assert(value != null); 171Debug.Fail("Unexpected ReferenceHandlingStrategy.");
System\Text\Json\Serialization\JsonConverterFactory.cs (13)
41Debug.Assert(CanConvert(typeToConvert)); 59Debug.Fail("We should never get here."); 71Debug.Fail("We should never get here."); 83Debug.Fail("We should never get here."); 90Debug.Fail("We should never get here."); 97Debug.Fail("We should never get here."); 104Debug.Fail("We should never get here."); 111Debug.Fail("We should never get here."); 122Debug.Fail("We should never get here."); 133Debug.Fail("We should never get here."); 140Debug.Fail("We should never get here."); 154Debug.Fail("We should never get here."); 161Debug.Fail("We should never get here.");
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 (16)
27Debug.Assert(state.Current.ObjectState == StackFrameObjectState.StartToken); 28Debug.Assert(state.Current.CanContainMetadata); 58Debug.Assert(!allowOutOfOrderMetadata, "Object must have already been buffered in this mode."); 74Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 161Debug.Assert(state.Current.LatestMetadataPropertyName == MetadataPropertyName.None); 202Debug.Assert(!allowOutOfOrderMetadata, "Object must have already been buffered in this mode."); 209Debug.Assert(state.Current.PropertyState == StackFramePropertyState.ReadValue); 242Debug.Assert(state.PolymorphicTypeDiscriminator == null); 270Debug.Assert(!isReadingAheadOfNonMetadataProperties, "must have already verified if non-metadata properties precede $values"); 285Debug.Assert(state.Current.LatestMetadataPropertyName == MetadataPropertyName.None); 286Debug.Assert(allowOutOfOrderMetadata, "should only be reached if reading ahead is required."); 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 (9)
32Debug.Fail($"obj.GetType() => {objTypeName}; {jsonTypeInfo.GetPropertyDebugInfo(unescapedPropertyName)}"); 54Debug.Assert(jsonTypeInfo.ExtensionDataProperty is null, "jsonTypeInfo.Configure() should have caught conflicting configuration."); 66Debug.Assert(obj != null, "obj is null"); 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 (9)
287Debug.Assert(jsonTypeInfo.IsConfigured); 312Debug.Assert(jsonTypeInfo.IsConfigured); 389Debug.Assert(reader.TokenType is JsonTokenType.EndObject or JsonTokenType.EndArray); 417Debug.Assert(payloadLength > 1); 421Debug.Assert( 425Debug.Assert( 438Debug.Assert( 442Debug.Assert( 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 (11)
27Debug.Assert(IsReadOnly); 112Debug.Assert(!fallBackToNearestAncestorType || IsReadOnly, "ancestor resolution should only be invoked in read-only options."); 113Debug.Assert(ensureNotNull is null or true, "Explicitly passing false will result in invalid result annotation."); 167Debug.Assert(rootValue != null); 193Debug.Assert(IsReadOnly); 280Debug.Assert(!entry.HasResult); 305Debug.Assert(!entry.HasResult); 407Debug.Assert(options.IsReadOnly, "Cannot create caching contexts for mutable JsonSerializerOptions instances"); 408Debug.Assert(options._typeInfoResolver != null); 442Debug.Assert(weakRef.TryGetTarget(out _) is false); 492Debug.Assert(left != null && right != null);
System\Text\Json\Serialization\JsonSerializerOptions.cs (6)
641Debug.Assert(value >= 0); 790Debug.Assert(IsReadOnly); 791Debug.Assert(TypeInfoResolver != null); 861Debug.Assert(IsReadOnly); 910Debug.Assert(_typeInfoResolver != null); 951Debug.Assert(_effectiveJsonTypeInfoResolver is null, "an effective resolver always returns metadata");
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 (13)
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); 349Debug.Fail("Only FieldInfo and PropertyInfo members are supported."); 415Debug.Assert(memberInfo is FieldInfo or PropertyInfo); 435Debug.Assert(fieldInfo.IsPublic || useNonPublicAccessors); 447Debug.Fail($"Invalid MemberInfo type: {memberInfo.MemberType}");
System\Text\Json\Serialization\Metadata\FSharpCoreReflectionProxy.cs (9)
90Debug.Assert(s_singletonInstance is not null, "should be initialized via a successful IsFSharpType call."); 99Debug.Assert(fsharpCoreAssembly.GetName().Name == "FSharp.Core"); 149Debug.Assert(typeof(TFSharpOption).GetGenericTypeDefinition() == _fsharpOptionType); 158Debug.Assert(typeof(TFSharpOption).GetGenericTypeDefinition() == _fsharpOptionType); 168Debug.Assert(typeof(TFSharpValueOption).GetGenericTypeDefinition() == _fsharpValueOptionType); 177Debug.Assert(typeof(TFSharpOption).GetGenericTypeDefinition() == _fsharpValueOptionType); 186Debug.Assert(typeof(TFSharpList).GetGenericTypeDefinition() == _fsharpListType); 194Debug.Assert(typeof(TFSharpSet).GetGenericTypeDefinition() == _fsharpSetType); 202Debug.Assert(typeof(TFSharpMap).GetGenericTypeDefinition() == _fsharpMapType);
System\Text\Json\Serialization\Metadata\JsonDerivedType.cs (1)
47Debug.Assert(typeDiscriminator is null or int or string);
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Helpers.cs (8)
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); 148Debug.Assert(jsonPropertyInfo.MemberName != null, "MemberName is not set by source gen");
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 (36)
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); 428Debug.Assert(EffectiveConverter != null, "Must have calculated the effective converter."); 432Debug.Assert(MemberType is 0 or MemberTypes.Field or MemberTypes.Property); 465Debug.Assert(ParentTypeInfo != null, "We should have ensured parent is assigned in JsonTypeInfo"); 466Debug.Assert(!ParentTypeInfo.IsConfigured); 493Debug.Assert(ParentTypeInfo != null, "We should have ensured parent is assigned in JsonTypeInfo"); 494Debug.Assert(!IsConfigured, "Should not be called post-configuration."); 495Debug.Assert(_jsonTypeInfo != null, "Must have already been determined on configuration."); 520Debug.Assert(EffectiveConverter != null, "Must have calculated the effective converter."); 521Debug.Assert(ParentTypeInfo != null, "We should have ensured parent is assigned in JsonTypeInfo"); 522Debug.Assert(!IsConfigured, "Should not be called post-configuration."); 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); 864Debug.Assert(EffectiveConverter.CanPopulate, "Property is marked with Populate but converter cannot populate. This should have been validated in Configure"); 865Debug.Assert(state.Parent.ReturnValue != null, "Parent object is null"); 866Debug.Assert(!state.Current.IsPopulating, "We've called TryGetPrePopulatedValue more than once"); 879Debug.Assert(_jsonTypeInfo?.IsConfigurationStarted == true); 978Debug.Assert(IsConfigured); 979Debug.Assert(IsRequired); 984Debug.Assert(!IsConfigured);
System\Text\Json\Serialization\Metadata\JsonPropertyInfoOfT.cs (16)
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); 289Debug.Assert(EffectiveObjectCreationHandling != JsonObjectCreationHandling.Populate, "Populating should not be possible for simple types"); 351Debug.Assert(!state.IsContinuation); 399Debug.Fail($"Unknown value of JsonIgnoreCondition '{ignoreCondition}'");
System\Text\Json\Serialization\Metadata\JsonTypeInfo.Cache.cs (17)
42Debug.Assert(IsConfigured); 81Debug.Assert(jsonPropertyInfo.PropertyType == propertyType); 163Debug.Fail($"Property cache is null. {GetPropertyDebugInfo(propertyName)}"); 169Debug.Assert(info != null, "PropertyCache contains null JsonPropertyInfo"); 180Debug.Fail($"key {key} [propertyName={propertyNameStr}] does not match re-computed value {recomputedKey} for the same sequence (case-insensitive). {info.GetDebugInfo()}"); 200Debug.Fail($"key {key} [propertyName={propertyNameStr}] does not match re-computed value {recomputedKey} for the same sequence (case-sensitive). {info.GetDebugInfo()}"); 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); 451Debug.Assert( 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 (40)
250Debug.Assert(!IsReadOnly); 251Debug.Assert(_properties is null, "must not be set if a property list has been initialized."); 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); 673Debug.Assert(Monitor.IsEntered(Options.CacheContext), "Configure called directly, use EnsureConfigured which synchronizes access to this method"); 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); 1121Debug.Assert(DetermineUsesParameterizedConstructor()); 1122Debug.Assert(PropertyCache is not null); 1123Debug.Assert(ParameterCache is null); 1168Debug.Assert(matchingEntry.JsonPropertyInfo != null); 1177Debug.Assert(ExtensionDataProperty.MemberName != null, "Custom property info cannot be data extension property"); 1202Debug.Assert(!IsReadOnly); 1214Debug.Assert(!IsReadOnly); 1244Debug.Assert(!IsReadOnly); 1283Debug.Assert(IsConfigurationStarted); 1306Debug.Assert(converter is ObjectConverter); 1317Debug.Assert(converter is JsonConverterFactory); 1321Debug.Fail($"Unexpected class type: {converter.ConverterStrategy}"); 1364Debug.Assert(!_jsonTypeInfo.IsConfigured); 1365Debug.Assert(jsonPropertyInfo.MemberName != null, "MemberName can be null in custom JsonPropertyInfo instances and should never be passed in this method");
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.cs (7)
60Debug.Assert(createObject is null or Func<object> or Func<T>); 66Debug.Assert(_createObject == null); 67Debug.Assert(_typedCreateObject == null); 73Debug.Assert(_createObject is null); 74Debug.Assert(_typedCreateObject == null); 93Debug.Assert(createObject is Func<object>); 116Debug.Assert(!IsReadOnly, "We should not mutate read-only JsonTypeInfo");
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 (8)
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); 108Debug.Fail("We shouldn't be here if there are more than 4 parameters.");
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 (3)
107Debug.Assert(bytesConsumed <= _count); 108Debug.Assert(!_isFinalBlock || _count == bytesConsumed, "The reader should have thrown if we have remaining bytes."); 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 (14)
34Debug.Assert(_count - _indexOffset > 0); 35Debug.Assert(_stack is not null); 147Debug.Assert(!supportAsync || supportContinuation, "supportAsync must imply supportContinuation"); 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 (12)
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); 471Debug.Fail($"The ExceptionResource enum value: {resource} is not part of the switch. Add the appropriate case and exception message."); 576Debug.Assert(token == JsonConstants.CloseBracket || token == JsonConstants.CloseBrace); 602Debug.Fail($"The ExceptionResource enum value: {resource} is not part of the switch. Add the appropriate case and exception message."); 664Debug.Fail($"The NumericType enum value: {numericType} is not part of the switch. Add the appropriate case and exception message."); 692Debug.Fail($"The DataType enum value: {dataType} is not part of the switch. Add the appropriate case and exception message.");
System\Text\Json\ThrowHelper.Serialization.cs (12)
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: ")); 761Debug.Assert(propertyInfo.ParentTypeInfo != null, "We should not throw this exception when ParentTypeInfo is null");
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 (37)
154Debug.Assert(options.NewLine is "\n" or "\r\n", "Invalid NewLine string."); 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); 1030Debug.Assert(_newLineLength is 1 or 2, "Invalid new line length."); 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 (56)
Helpers\RoslynExtensions.cs (7)
23Debug.Assert(!type.IsArray, "Resolution logic only capable of handling named types."); 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); 268Debug.Fail("unexpected syntax kind");
JsonSourceGenerator.Emitter.cs (16)
96Debug.Assert(_typeIndex.Count == 0); 97Debug.Assert(_propertyNames.Count == 0); 98Debug.Assert(!_emitGetConverterForNullablePropertyMethod); 153Debug.Assert(contextClasses.Count > 0); 218Debug.Fail($"Unexpected class type {typeGenerationSpec.ClassType}"); 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 (28)
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); 483Debug.Assert(IsSymbolAccessibleWithin(typeToGenerate.Type, within: contextType), "should not generate metadata for inaccessible types."); 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)); 763Debug.Assert(arraySymbol.Rank == 1, "multi-dimensional arrays should have been handled earlier."); 1098Debug.Assert(memberInfo is IFieldSymbol or IPropertySymbol); 1203Debug.Assert(memberInfo is IFieldSymbol or IPropertySymbol); 1385Debug.Fail("Method given an invalid symbol type."); 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\JsonHelpers.cs (2)
144Debug.Assert(childlessQueue.Count > 0, "The graph contains cycles."); 172Debug.Assert(idx == 0, "should have populated the entire sortedNodes array.");
src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (2)
18Debug.Assert(char.IsPunctuation(separator)); 85Debug.Fail($"Unexpected state {state}");
System.Text.RegularExpressions (572)
src\libraries\Common\src\System\HexConverter.cs (3)
165Debug.Assert(chars.Length >= bytes.Length * 2); 332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0); 298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (6)
28Debug.Assert(value >= 0); 29Debug.Assert(value <= _span.Length); 38Debug.Assert(index < _pos); 91Debug.Assert(index == 0, "Implementation currently only supports index == 0"); 106Debug.Assert(length >= 0); 134Debug.Assert(_pos == _span.Length);
System\Text\RegularExpressions\CaptureCollection.cs (2)
58Debug.Assert(_captures != null); 187Debug.Assert(collection != null, "collection cannot be null.");
System\Text\RegularExpressions\GroupCollection.cs (1)
241Debug.Assert(collection != null, "collection cannot be null.");
System\Text\RegularExpressions\Match.cs (4)
101Debug.Assert(Text != null); 267Debug.Assert(mode != RegexRunnerMode.ExistenceRequired); 275Debug.Assert(_textbeg == 0); 296Debug.Assert(!_balancing);
System\Text\RegularExpressions\MatchCollection.cs (2)
77Debug.Assert(i >= 0, "i cannot be negative."); 200Debug.Assert(collection != null, "collection cannot be null.");
System\Text\RegularExpressions\Regex.Cache.cs (8)
76Debug.Assert(value >= 0); 104Debug.Assert(s_cacheList.Count == value); 105Debug.Assert(s_cacheDictionary.Count == value); 199Debug.Assert(s_cacheList.Count == s_cacheDictionary.Count); 262Debug.Assert(s_cacheList.Count <= s_maxCacheSize); 263Debug.Assert(s_cacheList.Count == s_cacheDictionary.Count); 277Debug.Assert(pattern != null, "Pattern must be provided"); 278Debug.Assert(culture != null, "Culture must be provided");
System\Text\RegularExpressions\Regex.cs (6)
463Debug.Assert(mode <= RegexRunnerMode.BoundsRequired); 467Debug.Assert(startat <= input.Length); 529Debug.Assert(inputString is null || inputSpan.SequenceEqual(inputString)); 530Debug.Assert((uint)startat <= (uint)inputSpan.Length); 547Debug.Assert(match is not null); 612Debug.Assert(match is not null);
System\Text\RegularExpressions\RegexCaseEquivalences.cs (4)
81Debug.Assert(cultureName[0] is >= 'a' and <= 'z'); 82Debug.Assert(cultureName[1] is >= 'a' and <= 'z'); 133Debug.Assert((c / CharactersPerRange) < 0xFF); 145Debug.Assert(((c % CharactersPerRange) + firstLevelLookupValue) < 0xFFFF);
System\Text\RegularExpressions\RegexCharClass.cs (22)
324Debug.Assert( 331Debug.Assert(string.Compare(s_propTable[i][0], s_propTable[i + 1][0], StringComparison.Ordinal) < 0, $"RegexCharClass s_propTable is out of order at ({s_propTable[i][0]}, {s_propTable[i + 1][0]})"); 337Debug.Assert(whitespaceSet.Contains((char)i) == char.IsWhiteSpace((char)i)); 371Debug.Assert(cc.CanMerge && CanMerge, "Both character classes added together must be able to merge"); 409Debug.Assert(!set.IsEmpty); 427Debug.Assert(_subtractor == null, "Can't add two subtractions to a char class. "); 601Debug.Assert(IsSingleton(set) || IsSingletonInverse(set), "Tried to get the singleton char out of a non singleton character class"); 701Debug.Assert(c != 0); 869Debug.Assert(count <= evaluated); 913Debug.Assert(set1Negated == set2Negated); 947Debug.Assert(!IsNegated(set1) && !IsNegated(set2)); 998Debug.Assert((uint)comparison <= char.MaxValue); 1063Debug.Assert(twoChars.Length >= 2); 1149Debug.Assert(!hasSubtraction); 1270Debug.Assert(asciiLazyCache is null || asciiLazyCache.Length == CacheArrayLength, "set lookup should be able to store two bits for each of the first 128 characters"); 1278Debug.Assert(ch < 128); 1296Debug.Assert(ch < 128); 1377Debug.Assert((SetStartIndex & 0x1) == 1, "If SetStartIndex is not odd, the calculation below this will be reversed"); 1467Debug.Assert(curcat < 0); 1552Debug.Assert(chars[index] < chars[index + 1]); 1617Debug.Assert(i == span.Length); 1842Debug.Assert(!string.IsNullOrEmpty(set), "Found a null/empty element in RegexCharClass prop table");
System\Text\RegularExpressions\RegexCompiler.cs (95)
377Debug.Assert(_pool != null); 378Debug.Assert(_local != null); 379Debug.Assert(!_pool.Contains(_local)); 388Debug.Assert(_regexTree != null); 409Debug.Assert(minRequiredLength >= 0); 487Debug.Fail($"Unexpected mode: {_regexTree.FindOptimizations.FindMode}"); 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); 1179Debug.Assert(!set.Negated); 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); 1429Debug.Assert(node.Kind == RegexNodeKind.Capture, "Every generated tree should begin with a capture node"); 1430Debug.Assert(node.ChildCount() == 1, "Capture nodes should have one child"); 1611Debug.Assert(requiredLength > 0); 1645Debug.Assert(node.Kind is RegexNodeKind.Alternate, $"Unexpected type: {node.Kind}"); 1646Debug.Assert(node.ChildCount() >= 2, $"Expected at least 2 children, found {node.ChildCount()}"); 1649Debug.Assert(childCount >= 2); 1656Debug.Assert(node.Parent is not null); 1844Debug.Assert(sliceStaticPos == 0); 1850Debug.Assert(node.Kind is RegexNodeKind.Backreference, $"Unexpected type: {node.Kind}"); 2025Debug.Assert(node.Kind is RegexNodeKind.BackreferenceConditional, $"Unexpected type: {node.Kind}"); 2026Debug.Assert(node.ChildCount() == 2, $"Expected 2 children, found {node.ChildCount()}"); 2124Debug.Assert(needsEndConditional); 2184Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.Kind}"); 2185Debug.Assert(node.ChildCount() == 3, $"Expected 3 children, found {node.ChildCount()}"); 2330Debug.Assert(resumeAt is not null); 2384Debug.Assert(node.Kind is RegexNodeKind.Capture, $"Unexpected type: {node.Kind}"); 2385Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 2492Debug.Assert(startingCapturePos != null); 2514Debug.Assert(node.Kind is RegexNodeKind.PositiveLookaround, $"Unexpected type: {node.Kind}"); 2515Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 2565Debug.Assert(node.Kind is RegexNodeKind.NegativeLookaround, $"Unexpected type: {node.Kind}"); 2566Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 2695Debug.Assert(sliceStaticPos == 0, "This should be the first node and thus static position shouldn't have advanced."); 2824Debug.Fail($"Unexpected node type: {node.Kind}"); 2830Debug.Assert(node.Kind is RegexNodeKind.Atomic or RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround or RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.Kind}"); 2831Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional ? node.ChildCount() >= 1 : node.ChildCount() == 1, $"Unexpected number of children: {node.ChildCount()}"); 2872Debug.Assert(node.Kind is RegexNodeKind.UpdateBumpalong, $"Unexpected type: {node.Kind}"); 2892Debug.Assert(node.Kind is RegexNodeKind.Concatenate, $"Unexpected type: {node.Kind}"); 2893Debug.Assert(node.ChildCount() >= 2, $"Expected at least 2 children, found {node.ChildCount()}"); 2963Debug.Assert(node.IsOneFamily || node.IsNotoneFamily || node.IsSetFamily, $"Unexpected type: {node.Kind}"); 2966Debug.Assert(!rtl || offset is null); 3038Debug.Assert(node.Kind is RegexNodeKind.Boundary or RegexNodeKind.NonBoundary or RegexNodeKind.ECMABoundary or RegexNodeKind.NonECMABoundary, $"Unexpected type: {node.Kind}"); 3072Debug.Assert(node.Kind == RegexNodeKind.NonECMABoundary); 3082Debug.Assert(node.Kind is RegexNodeKind.Beginning or RegexNodeKind.Start or RegexNodeKind.Bol or RegexNodeKind.End or RegexNodeKind.EndZ or RegexNodeKind.Eol, $"Unexpected type: {node.Kind}"); 3083Debug.Assert((node.Options & RegexOptions.RightToLeft) == 0 || sliceStaticPos == 0); 3084Debug.Assert(sliceStaticPos >= 0); 3086Debug.Assert(sliceStaticPos >= 0); 3220Debug.Assert(node.Kind is RegexNodeKind.Multi, $"Unexpected type: {node.Kind}"); 3226Debug.Assert(str.Length >= 2); 3230Debug.Assert(emitLengthCheck); 3272Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Notoneloop or RegexNodeKind.Setloop, $"Unexpected type: {node.Kind}"); 3292Debug.Assert(node.M < node.N); 3488Debug.Assert(node.Kind is RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy or RegexNodeKind.Setlazy, $"Unexpected type: {node.Kind}"); 3505Debug.Assert(node.M < node.N); 3835Debug.Assert(node.Kind is RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 3836Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}"); 3837Debug.Assert(node.N >= node.M, $"Unexpected M={node.M}, N={node.N}"); 3838Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 3861Debug.Assert(!isAtomic, "An atomic lazy should have had its upper bound lowered to its lower bound."); 3954Debug.Assert(sliceStaticPos == 0); 4034Debug.Assert(entriesPerIteration >= 1); 4208Debug.Assert(node.IsOneFamily || node.IsNotoneFamily || node.IsSetFamily, $"Unexpected type: {node.Kind}"); 4357Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic, $"Unexpected type: {node.Kind}"); 4373Debug.Assert(node.N > node.M); 4612Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic, $"Unexpected type: {node.Kind}"); 4613Debug.Assert(node.M == 0 && node.N == 1); 4701Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 4702Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}"); 4703Debug.Assert(node.M == node.N, $"Unexpected M={node.M} == N={node.N}"); 4704Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 4705Debug.Assert(!analysis.MayBacktrack(node.Child(0)), $"Expected non-backtracking node {node.Kind}"); 4739Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 4740Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}"); 4741Debug.Assert(node.N >= node.M, $"Unexpected M={node.M}, N={node.N}"); 4742Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 4864Debug.Assert(sliceStaticPos == 0); 5018Debug.Assert(startingStackpos is not null); 5173Debug.Assert(!negate, "Negation isn't appropriate for a multi"); 5272Debug.Fail("We should never get here. This method should only be called if CanEmitIndexOf returned true, and all of the same cases should be covered."); 5294Debug.Assert(count >= 1); 5713Debug.Assert(rangeLower.LowInclusive != rangeUpper.LowInclusive); 6165Debug.Assert(chars.Length > 3, $"chars.Length == {chars.Length}"); 6204Debug.Assert(values is char[] or string[]); 6205Debug.Assert(comparison is StringComparison.Ordinal || values is string[]);
System\Text\RegularExpressions\RegexFindOptimizations.cs (13)
55Debug.Assert(maxLength >= MinRequiredLength, $"{maxLength} should have been greater than {MinRequiredLength} minimum"); 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 }); 367Debug.Assert(LeadingAnchor != RegexNodeKind.Bol, "BOL isn't enabled for RTL"); 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); 812Debug.Assert(FindMode == FindNextStartingPositionMode.NoSearch, $"Unexpected FindMode {FindMode}");
System\Text\RegularExpressions\RegexInterpreter.cs (8)
39Debug.Assert(code != null, "code must not be null."); 300Debug.Assert(_culture != null, "If the pattern has backreferences and is IgnoreCase, then _culture must not be null."); 326Debug.Assert(runregex is not null); 327Debug.Assert(runtrack is not null); 328Debug.Assert(runstack is not null); 329Debug.Assert(runcrawl is not null); 1131Debug.Assert(!_rightToLeft, "UpdateBumpalongs aren't added for RTL"); 1142Debug.Fail($"Unimplemented state: {_operator:X8}");
System\Text\RegularExpressions\RegexInterpreterCode.cs (1)
117Debug.Fail($"Unknown opcode: {opcode}");
System\Text\RegularExpressions\RegexNode.cs (82)
89Debug.Assert(Kind is RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or 92Debug.Assert(M > 0); 115Debug.Assert(culture is not null); 193Debug.Fail($"Unexpected type: {Kind}"); 203Debug.Assert(Kind == RegexNodeKind.Capture, "Every generated tree should begin with a capture node"); 216Debug.Assert(child.Parent == node, $"{child.Describe()} missing reference to parent {node.Describe()}"); 222Debug.Assert(Kind != RegexNodeKind.Group, "All Group nodes should have been removed."); 228Debug.Fail("All Group nodes should have been removed."); 258Debug.Assert(childCount == 0, $"Expected zero children for {node.Kind}, got {childCount}."); 267Debug.Assert(childCount == 1, $"Expected one and only one child for {node.Kind}, got {childCount}."); 271Debug.Assert(childCount == 2, $"Expected two children for {node.Kind}, got {childCount}"); 275Debug.Assert(childCount == 3, $"Expected three children for {node.Kind}, got {childCount}"); 280Debug.Assert(childCount >= 2, $"Expected at least two children for {node.Kind}, got {childCount}."); 284Debug.Fail($"Unexpected node type: {node.Kind}"); 292Debug.Assert(node.Str is not null, "Expect non-null multi string"); 293Debug.Assert(node.Str.Length >= 2, $"Expected {node.Str} to be at least two characters"); 300Debug.Assert(!string.IsNullOrEmpty(node.Str), $"Expected non-null, non-empty string for {node.Kind}."); 304Debug.Assert(node.Str is null, $"Expected null string for {node.Kind}, got \"{node.Str}\"."); 315Debug.Assert((node.Options & RegexOptions.IgnoreCase) == 0, $"{node.Kind} node should not have RegexOptions.IgnoreCase"); 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); 1795Debug.Assert((Options & RegexOptions.NonBacktracking) == 0, "Atomic groups aren't supported and don't help performance with NonBacktracking"); 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); 2217Debug.Assert(currentIndex >= 0, "Node should have been in its parent's child list"); 2290Debug.Assert(childCount >= 2); 2323Debug.Assert(ChildCount() == 1); 2352Debug.Fail($"Unknown node: {Kind}"); 2407Debug.Assert(childCount >= 2); 2461Debug.Assert(ChildCount() == 1); 2489Debug.Fail($"Unknown node: {Kind}"); 2513Debug.Assert(Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {Kind}"); 2629Debug.Assert(Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {Kind}"); 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\RegexParser.cs (7)
57Debug.Assert(pattern != null, "Pattern must be set"); 58Debug.Assert(culture != null, "Culture must be set"); 421Debug.Fail($"Unexpected char {ch}"); 479Debug.Fail($"Unexpected char {ch}"); 1078Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern"); 1153Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern"); 1976Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern");
System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (8)
247Debug.Assert(childCount >= 2); // otherwise it would have been optimized out 266Debug.Assert(alternateBranchResults.Count > 0); 521results.ForEach(r => Debug.Assert( 773Debug.Assert(sameDistance.HasValue); 813Debug.Assert(!s2Negated); 1094Debug.Fail($"Unexpected node {node.Kind}"); 1129Debug.Assert(node.ChildCount() >= 2); 1175Debug.Assert(
System\Text\RegularExpressions\RegexReplacement.cs (6)
39Debug.Assert(concat.Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {concat.Kind}"); 80Debug.Fail($"Unexpected child kind {child.Kind}"); 218Debug.Assert(_rules.Length <= 1); 219Debug.Assert(_rules.Length == 0 || (_rules[0] == 0 && _strings.Length == 1)); 262Debug.Assert(state.offsetAndCounts.Count % 2 == 0, $"{state.offsetAndCounts.Count}"); 263Debug.Assert(state.offsetAndCounts.Count >= 4, $"{state.offsetAndCounts.Count}");
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 (3)
31Debug.Assert(!Enum.IsDefined(BeforeChild)); 32Debug.Assert(!Enum.IsDefined(AfterChild)); 447Debug.Fail($"Unexpected node: {nodeType}");
System\Text\RegularExpressions\Symbolic\BDD.cs (13)
68Debug.Assert((one is null) == (zero is null), "Neither or both children should be null."); 90Debug.Assert((One is null) == (Zero is null)); 112Debug.Assert(!set.IsEmpty); 174Debug.Assert(nodes[nodes.Length - 1] == this); 175Debug.Assert(nodes.Length <= (1 << 24)); 224Debug.Assert(v >= 0); 315Debug.Assert(serialized[i] > 0); 344Debug.Assert(bytes.Length > 1, "All inputs are expected to be larger than a single byte, which would map to False or True."); 353Debug.Assert((bytes.Length - 1) % bytesPerLong == 0); 381Debug.Assert(oneId < i && zeroId < i); 382Debug.Assert(nodes[oneId] is not null); 383Debug.Assert(nodes[zeroId] is not null); 502Debug.Assert(leaf is not null, "this should never happen because there must exist another leaf besides False");
System\Text\RegularExpressions\Symbolic\BDDRangeConverter.cs (1)
101Debug.Assert(!set.IsLeaf);
System\Text\RegularExpressions\Symbolic\BitVector.cs (7)
32Debug.Assert(length > 0); 42Debug.Assert(length > 0); 73Debug.Assert(i >= 0 && i < Length); 81Debug.Assert(i >= 0 && i < Length); 89Debug.Assert(x.Length == y.Length); 106Debug.Assert(x.Length == y.Length); 123Debug.Assert(!bitVectors.IsEmpty);
System\Text\RegularExpressions\Symbolic\CharSetSolver.cs (5)
207Debug.Assert(!set.IsLeaf, "Did not expect multi-terminal"); 223Debug.Assert(op is BooleanOperation.Or or BooleanOperation.And or BooleanOperation.Xor); 257Debug.Assert(!set1.IsLeaf || !set2.IsLeaf, "Did not expect multi-terminal case"); 264Debug.Assert(!set2.IsLeaf); 364Debug.Assert(terminal >= 0);
System\Text\RegularExpressions\Symbolic\DoublyLinkedList.cs (6)
44Debug.Assert(_first is not null); 54Debug.Assert(other != this, "self append not allowed to avoid circularity"); 74Debug.Assert(_last is not null); 141Debug.Assert(_first is null && _last is null, "empty list"); 145Debug.Assert(_size > 0, "_size < 0 means that the list has been invalidated after Append"); 146Debug.Assert(_first is not null && _last is not null && _first.Prev is null && _last.Next is null, "non-empty list");
System\Text\RegularExpressions\Symbolic\MatchingState.cs (3)
57Debug.Assert(IsNullableFor(nextCharKind)); 58Debug.Assert(CharKind.IsValidCharKind(nextCharKind)); 101Debug.Assert(CharKind.IsValidCharKind(nextCharKind));
System\Text\RegularExpressions\Symbolic\MintermClassifier.cs (1)
40Debug.Assert(minterms.Length > 0, "Requires at least");
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 (20)
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); 196Debug.Fail(description); 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)); 428Debug.Assert(cat >= 0 && cat < categoryCodes.Length, $"Expected {cat} to be in range [0, {categoryCodes.Length})."); 516Debug.Assert(result is not null); 523Debug.Assert(Enum.IsDefined(code) || code == (UnicodeCategory)(RegexCharClass.SpaceConst - 1), $"Unknown category: {code}");
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 (7)
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); 360Debug.Fail($"{nameof(Transform)}:{node._kind}");
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 (31)
154Debug.Assert(builder._solver is UInt64Solver or BitVectorSolver, $"Unsupported solver: {builder._solver}"); 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); 327Debug.Assert(startat >= 0 && startat <= input.Length, $"{nameof(startat)} == {startat}, {nameof(input.Length)} == {input.Length}"); 328Debug.Assert(perThreadData is not null); 384Debug.Assert(matchEnd >= startat - 1); 596Debug.Assert(i >= 0, $"{nameof(i)} == {i}"); 597Debug.Assert(matchStartBoundary >= 0 && matchStartBoundary <= input.Length, $"{nameof(matchStartBoundary)} == {matchStartBoundary}"); 598Debug.Assert(i >= matchStartBoundary, $"Expected {i} >= {matchStartBoundary}."); 623Debug.Assert(i >= matchStartBoundary); 629Debug.Assert(lastStart != -1, "We expected to find a starting position but didn't."); 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); 783Debug.Fail("No nullable state found in the set of end states"); 840Debug.Assert(CaptureStarts.Length == other.CaptureStarts.Length); 841Debug.Assert(CaptureEnds.Length == other.CaptureEnds.Length); 966Debug.Assert(state.DfaStateId > 0, $"Expected non-zero {nameof(state.DfaStateId)}."); 967Debug.Assert(state.NfaState is null, $"Expected null {nameof(state.NfaState)}."); 1049Debug.Fail("ExtractNullableCoreStateId should only be called in nullable state/context."); 1065Debug.Fail("FixedLength should only be called in nullable state/context."); 1072Debug.Assert(state.DfaStateId < 0, $"Expected negative {nameof(state.DfaStateId)}."); 1073Debug.Assert(state.NfaState is not null, $"Expected non-null {nameof(state.NfaState)}."); 1177Debug.Assert(state.DfaStateId < 0, $"Expected negative {nameof(state.DfaStateId)}."); 1178Debug.Assert(state.NfaState is not null, $"Expected non-null {nameof(state.NfaState)}."); 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 (140)
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); 1345Debug.Fail($"{nameof(CreateDerivative)}:{_kind}"); 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); 1406Debug.Fail($"{nameof(StripEffects)}:{_kind}"); 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); 1516Debug.Fail($"{nameof(StripAndMapEffects)}:{_kind}"); 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); 1764Debug.Fail($"{nameof(ToStringHelper)}:{_kind}"); 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); 1892Debug.Fail($"{nameof(CollectSets)}:{_kind}"); 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); 1965Debug.Fail("Should only happen if a reversed regex is reversed again, which isn't expected"); 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); 2053Debug.Fail($"{nameof(ComputeStartSet)}:{kind}"); 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 (252)
RegexGenerator.cs (1)
92Debug.Assert(state is DiagnosticData);
RegexGenerator.Emitter.cs (95)
394Debug.Assert(chars.Length > 3); 703Debug.Assert(minRequiredLength >= 0); 757Debug.Fail($"Unexpected mode: {regexTree.FindOptimizations.FindMode}"); 976Debug.Assert(!string.IsNullOrEmpty(substring)); 983Debug.Assert(!string.IsNullOrEmpty(substring)); 987Debug.Assert(!string.IsNullOrEmpty(regexTree.FindOptimizations.FixedDistanceLiteral.String)); 997Debug.Fail($"Unexpected mode: {opts.FindMode}"); 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); 1300Debug.Assert(!set.Negated); 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); 1448Debug.Assert(node.Kind == RegexNodeKind.Capture, "Every generated tree should begin with a capture node"); 1449Debug.Assert(node.ChildCount() == 1, "Capture nodes should have one child"); 1598Debug.Assert(requiredLength > 0); 1630Debug.Assert(node.Kind is RegexNodeKind.Alternate, $"Unexpected type: {node.Kind}"); 1631Debug.Assert(node.ChildCount() >= 2, $"Expected at least 2 children, found {node.ChildCount()}"); 1634Debug.Assert(childCount >= 2); 1641Debug.Assert(node.Parent is not null); 1703Debug.Assert(startingLiteralNode.IsSetFamily); 1768Debug.Assert(startingLiteralNode is not null, "Unexpectedly couldn't find the branch starting node."); 1774Debug.Assert(numChars != 0); 1816Debug.Assert(remainder is null); 2063Debug.Assert(sliceStaticPos == 0); 2070Debug.Assert(node.Kind is RegexNodeKind.Backreference, $"Unexpected type: {node.Kind}"); 2139Debug.Assert(node.Kind is RegexNodeKind.BackreferenceConditional, $"Unexpected type: {node.Kind}"); 2140Debug.Assert(node.ChildCount() == 2, $"Expected 2 children, found {node.ChildCount()}"); 2312Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.Kind}"); 2313Debug.Assert(node.ChildCount() == 3, $"Expected 3 children, found {node.ChildCount()}"); 2499Debug.Assert(node.Kind is RegexNodeKind.Capture, $"Unexpected type: {node.Kind}"); 2500Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 2596Debug.Assert(node.Kind is RegexNodeKind.PositiveLookaround, $"Unexpected type: {node.Kind}"); 2597Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 2644Debug.Assert(node.Kind is RegexNodeKind.NegativeLookaround, $"Unexpected type: {node.Kind}"); 2645Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 2755Debug.Assert(sliceStaticPos == 0, "This should be the first node and thus static position shouldn't have advanced."); 2894Debug.Assert(rm.Analysis.MayBacktrack(node.Child(0))); 2913Debug.Fail($"Unexpected node type: {node.Kind}"); 2919Debug.Assert(node.Kind is RegexNodeKind.Atomic or RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround or RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.Kind}"); 2920Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional ? node.ChildCount() >= 1 : node.ChildCount() == 1, $"Unexpected number of children: {node.ChildCount()}"); 2921Debug.Assert(rm.Analysis.MayBacktrack(node.Child(0)), "Expected child to potentially backtrack"); 2948Debug.Assert(node.Kind is RegexNodeKind.UpdateBumpalong, $"Unexpected type: {node.Kind}"); 2960Debug.Assert(node.Kind is RegexNodeKind.Concatenate, $"Unexpected type: {node.Kind}"); 2961Debug.Assert(node.ChildCount() >= 2, $"Expected at least 2 children, found {node.ChildCount()}"); 3090Debug.Assert(node.IsOneFamily || node.IsNotoneFamily || node.IsSetFamily, $"Unexpected type: {node.Kind}"); 3093Debug.Assert(!rtl || offset is null); 3094Debug.Assert(!rtl || !clauseOnly); 3134Debug.Assert(node.Kind is RegexNodeKind.Boundary or RegexNodeKind.NonBoundary or RegexNodeKind.ECMABoundary or RegexNodeKind.NonECMABoundary, $"Unexpected kind: {node.Kind}"); 3161Debug.Assert(node.Kind is RegexNodeKind.Beginning or RegexNodeKind.Start or RegexNodeKind.Bol or RegexNodeKind.End or RegexNodeKind.EndZ or RegexNodeKind.Eol, $"Unexpected type: {node.Kind}"); 3162Debug.Assert((node.Options & RegexOptions.RightToLeft) == 0 || sliceStaticPos == 0); 3163Debug.Assert(sliceStaticPos >= 0); 3227Debug.Assert(node.Kind is RegexNodeKind.Multi, $"Unexpected type: {node.Kind}"); 3228Debug.Assert(node.Str is not null); 3234Debug.Assert(str.Length >= 2); 3235Debug.Assert(!clauseOnly || (!emitLengthCheck && !rightToLeft)); 3239Debug.Assert(emitLengthCheck); 3276Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Notoneloop or RegexNodeKind.Setloop, $"Unexpected type: {node.Kind}"); 3296Debug.Assert(node.M < node.N); 3414Debug.Assert(node.Kind is RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy or RegexNodeKind.Setlazy, $"Unexpected type: {node.Kind}"); 3437Debug.Assert(node.M < node.N); 3660Debug.Assert(node.Kind is RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 3661Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}"); 3662Debug.Assert(node.N >= node.M, $"Unexpected M={node.M}, N={node.N}"); 3663Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 3686Debug.Assert(!isAtomic, "An atomic lazy should have had its upper bound lowered to its lower bound."); 3764Debug.Assert(sliceStaticPos == 0); 3830Debug.Assert(entriesPerIteration >= 1); 3970Debug.Assert(node.IsOneFamily || node.IsNotoneFamily || node.IsSetFamily, $"Unexpected type: {node.Kind}"); 4082Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic, $"Unexpected type: {node.Kind}"); 4098Debug.Assert(node.N > node.M); 4149Debug.Assert(maxIterations > 1); 4223Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic, $"Unexpected type: {node.Kind}"); 4224Debug.Assert(node.M == 0 && node.N == 1); 4261Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 4262Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}"); 4263Debug.Assert(node.M == node.N, $"Unexpected M={node.M} == N={node.N}"); 4264Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 4265Debug.Assert(!rm.Analysis.MayBacktrack(node.Child(0)), $"Expected non-backtracking node {node.Kind}"); 4281Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 4282Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}"); 4283Debug.Assert(node.N >= node.M, $"Unexpected M={node.M}, N={node.N}"); 4284Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 4399Debug.Assert(sliceStaticPos == 0); 4532Debug.Assert(startingStackpos is not null); 4663Debug.Assert(args.Length is >= 1); 4715Debug.Assert(args.Length is >= 1); 4905Debug.Assert(!negate, "Negation isn't appropriate for a multi"); 5151Debug.Assert(rangeLower.LowInclusive != rangeUpper.LowInclusive); 5398Debug.Fail("This shouldn't happen, as we should only get to the point of emitting code if RegexOptions was valid.");
src\libraries\Common\src\System\HexConverter.cs (3)
165Debug.Assert(chars.Length >= bytes.Length * 2); 332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0); 298Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (6)
28Debug.Assert(value >= 0); 29Debug.Assert(value <= _span.Length); 38Debug.Assert(index < _pos); 91Debug.Assert(index == 0, "Implementation currently only supports index == 0"); 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 (22)
324Debug.Assert( 331Debug.Assert(string.Compare(s_propTable[i][0], s_propTable[i + 1][0], StringComparison.Ordinal) < 0, $"RegexCharClass s_propTable is out of order at ({s_propTable[i][0]}, {s_propTable[i + 1][0]})"); 337Debug.Assert(whitespaceSet.Contains((char)i) == char.IsWhiteSpace((char)i)); 371Debug.Assert(cc.CanMerge && CanMerge, "Both character classes added together must be able to merge"); 409Debug.Assert(!set.IsEmpty); 427Debug.Assert(_subtractor == null, "Can't add two subtractions to a char class. "); 601Debug.Assert(IsSingleton(set) || IsSingletonInverse(set), "Tried to get the singleton char out of a non singleton character class"); 701Debug.Assert(c != 0); 869Debug.Assert(count <= evaluated); 913Debug.Assert(set1Negated == set2Negated); 947Debug.Assert(!IsNegated(set1) && !IsNegated(set2)); 998Debug.Assert((uint)comparison <= char.MaxValue); 1063Debug.Assert(twoChars.Length >= 2); 1149Debug.Assert(!hasSubtraction); 1270Debug.Assert(asciiLazyCache is null || asciiLazyCache.Length == CacheArrayLength, "set lookup should be able to store two bits for each of the first 128 characters"); 1278Debug.Assert(ch < 128); 1296Debug.Assert(ch < 128); 1377Debug.Assert((SetStartIndex & 0x1) == 1, "If SetStartIndex is not odd, the calculation below this will be reversed"); 1467Debug.Assert(curcat < 0); 1552Debug.Assert(chars[index] < chars[index + 1]); 1617Debug.Assert(i == span.Length); 1842Debug.Assert(!string.IsNullOrEmpty(set), "Found a null/empty element in RegexCharClass prop table");
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexFindOptimizations.cs (5)
55Debug.Assert(maxLength >= MinRequiredLength, $"{maxLength} should have been greater than {MinRequiredLength} minimum"); 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 (82)
89Debug.Assert(Kind is RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or 92Debug.Assert(M > 0); 115Debug.Assert(culture is not null); 193Debug.Fail($"Unexpected type: {Kind}"); 203Debug.Assert(Kind == RegexNodeKind.Capture, "Every generated tree should begin with a capture node"); 216Debug.Assert(child.Parent == node, $"{child.Describe()} missing reference to parent {node.Describe()}"); 222Debug.Assert(Kind != RegexNodeKind.Group, "All Group nodes should have been removed."); 228Debug.Fail("All Group nodes should have been removed."); 258Debug.Assert(childCount == 0, $"Expected zero children for {node.Kind}, got {childCount}."); 267Debug.Assert(childCount == 1, $"Expected one and only one child for {node.Kind}, got {childCount}."); 271Debug.Assert(childCount == 2, $"Expected two children for {node.Kind}, got {childCount}"); 275Debug.Assert(childCount == 3, $"Expected three children for {node.Kind}, got {childCount}"); 280Debug.Assert(childCount >= 2, $"Expected at least two children for {node.Kind}, got {childCount}."); 284Debug.Fail($"Unexpected node type: {node.Kind}"); 292Debug.Assert(node.Str is not null, "Expect non-null multi string"); 293Debug.Assert(node.Str.Length >= 2, $"Expected {node.Str} to be at least two characters"); 300Debug.Assert(!string.IsNullOrEmpty(node.Str), $"Expected non-null, non-empty string for {node.Kind}."); 304Debug.Assert(node.Str is null, $"Expected null string for {node.Kind}, got \"{node.Str}\"."); 315Debug.Assert((node.Options & RegexOptions.IgnoreCase) == 0, $"{node.Kind} node should not have RegexOptions.IgnoreCase"); 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); 1795Debug.Assert((Options & RegexOptions.NonBacktracking) == 0, "Atomic groups aren't supported and don't help performance with NonBacktracking"); 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); 2217Debug.Assert(currentIndex >= 0, "Node should have been in its parent's child list"); 2290Debug.Assert(childCount >= 2); 2323Debug.Assert(ChildCount() == 1); 2352Debug.Fail($"Unknown node: {Kind}"); 2407Debug.Assert(childCount >= 2); 2461Debug.Assert(ChildCount() == 1); 2489Debug.Fail($"Unknown node: {Kind}"); 2513Debug.Assert(Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {Kind}"); 2629Debug.Assert(Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {Kind}"); 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\RegexParser.cs (7)
57Debug.Assert(pattern != null, "Pattern must be set"); 58Debug.Assert(culture != null, "Culture must be set"); 421Debug.Fail($"Unexpected char {ch}"); 479Debug.Fail($"Unexpected char {ch}"); 1078Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern"); 1153Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern"); 1976Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern");
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (8)
247Debug.Assert(childCount >= 2); // otherwise it would have been optimized out 266Debug.Assert(alternateBranchResults.Count > 0); 521results.ForEach(r => Debug.Assert( 773Debug.Assert(sameDistance.HasValue); 813Debug.Assert(!s2Negated); 1094Debug.Fail($"Unexpected node {node.Kind}"); 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 (77)
System\Threading\Barrier.cs (2)
511Debug.Assert(result); 735Debug.Assert(phase < CurrentPhaseNumber);
System\Threading\CountdownEvent.cs (3)
176Debug.Assert(_event != null); 219Debug.Assert(_event != null); 249Debug.Assert(_currentCount >= 0, "latch was decremented below zero");
System\Threading\ReaderWriterLock.cs (72)
87Debug.Assert(threadLocalLockEntry._readerLevel == 0); 92Debug.Assert((_state & LockStates.ReadersMask) != 0); 105Debug.Assert(threadLocalLockEntry.IsFree); 202Debug.Assert(threadLocalLockEntry.HasLockID(_lockID)); 207Debug.Assert((_state & LockStates.ReaderSignaled) != 0); 208Debug.Assert((_state & LockStates.ReadersMask) < LockStates.ReadersMask); 231Debug.Assert(readerEvent != null); 237Debug.Assert((_state & LockStates.ReadersMask) < LockStates.ReadersMask); 248Debug.Assert(threadLocalLockEntry.IsFree); 258Debug.Assert((knownState & LockStates.ReaderSignaled) != 0); 259Debug.Assert((knownState & LockStates.ReadersMask) < LockStates.ReadersMask); 272Debug.Assert((_state & LockStates.Writer) == 0); 273Debug.Assert((_state & LockStates.ReadersMask) != 0); 289Debug.Assert((_state & LockStates.ReadersMask) == 0); 373Debug.Assert((_state & LockStates.WriterSignaled) != 0); 389Debug.Assert(writerEvent != null); 408Debug.Assert((knownState & LockStates.WriterSignaled) != 0); 409Debug.Assert((knownState & LockStates.Writer) == 0); 413Debug.Assert(_writerLevel == 0); 430Debug.Assert((_state & LockStates.Writer) != 0); 431Debug.Assert((_state & LockStates.ReadersMask) == 0); 432Debug.Assert(_writerID == InvalidThreadID); 458Debug.Assert((_state & LockStates.Writer) == 0); 459Debug.Assert((_state & LockStates.ReadersMask) != 0); 460Debug.Assert(threadLocalLockEntry._readerLevel > 0); 494Debug.Assert(currentState != knownState); 519Debug.Assert(currentState != knownState); 531Debug.Assert((knownState & LockStates.Writer) == 0); 532Debug.Assert((knownState & LockStates.ReadersMask) != 0); 542Debug.Assert((_state & LockStates.WriterSignaled) != 0); 543Debug.Assert(writerEvent != null); 549Debug.Assert((_state & LockStates.ReaderSignaled) != 0); 550Debug.Assert(readerEvent != null); 560Debug.Assert(threadLocalLockEntry.IsFree); 570Debug.Assert((_state & LockStates.ReadersMask) == 0); 571Debug.Assert((_state & LockStates.Writer) != 0); 572Debug.Assert(_writerLevel > 0); 614Debug.Assert(currentState != knownState); 628Debug.Assert(currentState != knownState); 639Debug.Assert((knownState & LockStates.ReadersMask) == 0); 640Debug.Assert((knownState & LockStates.Writer) != 0); 647Debug.Assert((_state & LockStates.ReaderSignaled) != 0); 648Debug.Assert(readerEvent != null); 654Debug.Assert((_state & LockStates.WriterSignaled) != 0); 655Debug.Assert(writerEvent != null); 694Debug.Assert((_state & LockStates.ReadersMask) != 0); 695Debug.Assert(threadLocalLockEntry._readerLevel > 0); 707Debug.Assert(threadLocalLockEntry.IsFree); 770Debug.Assert(_writerLevel > 0); 804Debug.Assert(currentState != knownState); 810Debug.Assert((knownState & LockStates.ReadersMask) == 0); 817Debug.Assert((_state & LockStates.ReaderSignaled) != 0); 818Debug.Assert(readerEvent != null); 851Debug.Assert(_writerLevel > 0); 852Debug.Assert(_writerLevel > requestedWriterLevel); 865Debug.Assert((flags & LockCookieFlags.OwnedWriter) != 0 || _writerID != threadID); 897Debug.Assert((_state & LockStates.ReadersMask) != 0); 898Debug.Assert(threadLocalLockEntry._readerLevel > 0); 954Debug.Assert(threadLocalLockEntry.IsFree); 995Debug.Assert(threadLocalLockEntry != null); 1003Debug.Assert(threadID != InvalidThreadID); 1090Debug.Assert((_state & LockStates.CachingEvents) == LockStates.CachingEvents); 1225Debug.Assert(lockID != 0); 1226Debug.Assert(afterEntry != null); 1232Debug.Assert(currentEntry._lockID != lockID || currentEntry.IsFree); 1238Debug.Assert(lockID != 0); 1257Debug.Assert(lockID != 0); 1271Debug.Assert(lockID != 0); 1272Debug.Assert(headEntry == t_lockEntryHead); 1273Debug.Assert(headEntry == null || headEntry._lockID != lockID); 1319Debug.Assert(emptyEntry == headEntry); 1332Debug.Assert(entry._lockID == lockID);
System.Threading.Channels (62)
src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (13)
67Debug.Assert(InitialSegmentSize > 0, "Initial segment size must be > 0."); 68Debug.Assert((InitialSegmentSize & (InitialSegmentSize - 1)) == 0, "Initial segment size must be a power of 2"); 69Debug.Assert(InitialSegmentSize <= MaxSegmentSize, "Initial segment size should be <= maximum."); 70Debug.Assert(MaxSegmentSize < int.MaxValue / 2, "Max segment size * 2 must be < int.MaxValue, or else overflow could occur."); 102Debug.Assert(segment != null, "Expected a non-null segment."); 112Debug.Assert(newSegmentSize > 0, "The max size should always be small enough that we don't overflow."); 179Debug.Assert(segment != null, "Expected a non-null segment."); 180Debug.Assert(array != null, "Expected a non-null item array."); 253Debug.Assert(segment != null, "Expected a non-null segment."); 254Debug.Assert(array != null, "Expected a non-null item array."); 368Debug.Assert(syncObj != null, "The syncObj parameter is null."); 390Debug.Assert((size & (size - 1)) == 0, "Size must be a power of 2"); 429Debug.Assert(queue != null, "Expected a non-null queue.");
src\libraries\Common\src\System\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 (13)
17private static void AvailableSentinel(object? s) => Debug.Fail($"{nameof(AsyncOperation)}.{nameof(AvailableSentinel)} invoked with {s}"); 21private static void CompletedSentinel(object? s) => Debug.Fail($"{nameof(AsyncOperation)}.{nameof(CompletedSentinel)} invoked with {s}"); 90Debug.Assert(!_pooled, "Cancelable operations can't be pooled"); 184Debug.Assert(_pooled, "Should only be used for pooled objects"); 221Debug.Assert(_executionContext == null); 228Debug.Assert(_schedulingContext == null); 260Debug.Assert(IsCompleted, $"Expected IsCompleted"); 263Debug.Assert(prevContinuation != s_availableSentinel, "Continuation was the available sentinel."); 291Debug.Assert(ts != null); 317Debug.Assert(_registration == default); 385Debug.Assert(_continuation != s_completedSentinel, $"The continuation was the completion sentinel."); 386Debug.Assert(_continuation != s_availableSentinel, $"The continuation was the available sentinel."); 415Debug.Assert(ts != null, "Expected a TaskScheduler");
System\Threading\Channels\BoundedChannel.cs (16)
48Debug.Assert(bufferedCapacity > 0); 246Debug.Assert(Monitor.IsEntered(parent.SyncObj)); 458Debug.Assert(waitingReadersTail == null, "Shouldn't have any waiters to wake up"); 462Debug.Assert(success, "We should always be able to complete the reader."); 651Debug.Assert(success, "We should always be able to complete the reader."); 678Debug.Assert(SyncObj != null, "The sync obj must not be null."); 679Debug.Assert(Monitor.IsEntered(SyncObj), "Invariants can only be validated while holding the lock."); 683Debug.Assert(_blockedReaders.IsEmpty, "There are items available, so there shouldn't be any blocked readers."); 684Debug.Assert(_waitingReadersTail == null, "There are items available, so there shouldn't be any waiting readers."); 688Debug.Assert(_blockedWriters.IsEmpty, "There's space available, so there shouldn't be any blocked writers."); 689Debug.Assert(_waitingWritersTail == null, "There's space available, so there shouldn't be any waiting writers."); 693Debug.Assert(_items.IsEmpty, "There shouldn't be queued items if there's a blocked reader."); 694Debug.Assert(_blockedWriters.IsEmpty, "There shouldn't be any blocked writer if there's a blocked reader."); 698Debug.Assert(_items.Count == _bufferedCapacity, "We should have a full buffer if there's a blocked writer."); 699Debug.Assert(_blockedReaders.IsEmpty, "There shouldn't be any blocked readers if there's a blocked writer."); 703Debug.Assert(_doneWriting != null, "We can only complete if we're done writing.");
System\Threading\Channels\ChannelUtilities.cs (3)
59Debug.Assert(error != null); 99Debug.Assert(completed || c.CancellationToken.CanBeCanceled); 112Debug.Assert(error != null);
System\Threading\Channels\SingleConsumerUnboundedChannel.cs (3)
254Debug.Assert(blockedReader == null || waitingReader == null, "There should only ever be at most one reader."); 318Debug.Assert((blockedReader != null) ^ (waitingReader != null), "Expected either a blocked or waiting reader, but not both"); 332Debug.Assert(blockedReader != null);
System\Threading\Channels\UnboundedChannel.cs (8)
169Debug.Assert(parent._items.IsThreadSafe || Monitor.IsEntered(parent.SyncObj)); 367Debug.Assert(SyncObj != null, "The sync obj must not be null."); 368Debug.Assert(Monitor.IsEntered(SyncObj), "Invariants can only be validated while holding the lock."); 374Debug.Assert(_blockedReaders.IsEmpty, "There's data available, so there shouldn't be any blocked readers."); 375Debug.Assert(_waitingReadersTail == null, "There's data available, so there shouldn't be any waiting readers."); 377Debug.Assert(!_completion.Task.IsCompleted, "We still have data available, so shouldn't be completed."); 381Debug.Assert(_items.IsEmpty, "There are blocked/waiting readers, so there shouldn't be any data available."); 385Debug.Assert(_doneWriting != null, "We're completed, so we must be done writing.");
System.Threading.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 (414)
Base\DataflowBlock.cs (53)
126Debug.Assert(source != null, "Filtered link requires a source to filter on."); 127Debug.Assert(target != null, "Filtered link requires a target to filter to."); 128Debug.Assert(predicate != null, "Filtered link requires a predicate to filter with."); 141Debug.Assert(_userProvidedPredicate != null, "User-provided predicate is required."); 173Debug.Assert(messageHeader.IsValid, "Only valid messages may be consumed."); 182Debug.Assert(messageHeader.IsValid, "Only valid messages may be consumed."); 191Debug.Assert(messageHeader.IsValid, "Only valid messages may be consumed."); 228Debug.Assert(filter != null, "Need a filter with which to construct the debug view."); 336Debug.Assert(false, "A message should never be postponed when no source has been provided"); 340Debug.Assert(false, "The message should never be missed, as it's offered to only this one target"); 358Debug.Assert(source != null, "The SendAsyncSource instance must have been constructed."); 414Debug.Assert(target != null, "A valid target to send to is required."); 518Debug.Assert(completionAction != null, "Completion action to run is required."); 527Debug.Assert(_cancellationRegistration != default(CancellationTokenRegistration), 567Debug.Assert(source._cancellationState != CANCELLATION_STATE_NONE, 608Debug.Assert(_cancellationState == CANCELLATION_STATE_COMPLETING, 620Debug.Assert(false, "The message should never be missed, as it's offered to only this one target"); 663Debug.Assert( 764Debug.Assert(source != null, "Need a source with which to construct the debug view."); 1007Debug.Assert(source != null, "Need a source from which to receive."); 1261Debug.Assert(Volatile.Read(ref _cleanupReserved), "Should only be called once by whomever reserved the right."); 1343Debug.Assert(false, "Invalid linking cleanup reason specified."); 1569Debug.Assert(target != null, "The target should never be null; this should be checked by all internal usage."); 1570Debug.Assert(source != null, "The source should never be null; this should be checked by all internal usage."); 1667Debug.Assert(propagator != null, "Need a block with which to construct the debug view."); 1906Debug.Assert(source1 != null && action1 != null, "The first source and action should not be null."); 1907Debug.Assert(source2 != null && action2 != null, "The second source and action should not be null."); 1908Debug.Assert((source3 == null) == (action3 == null), "The third action should be null iff the third source is null."); 1909Debug.Assert(dataflowBlockOptions != null, "Options are required."); 1953Debug.Assert(source != null, "Expected a non-null source"); 1954Debug.Assert(action != null, "Expected a non-null action"); 1955Debug.Assert(branchId >= 0, "Expected a valid branch ID (> 0)"); 1956Debug.Assert(scheduler != null, "Expected a non-null scheduler"); 1991Debug.Assert(source1 != null && action1 != null, "The first source and action should not be null."); 1992Debug.Assert(source2 != null && action2 != null, "The second source and action should not be null."); 1993Debug.Assert((source3 == null) == (action3 == null), "The third action should be null iff the third source is null."); 1994Debug.Assert(dataflowBlockOptions != null, "Options are required."); 2040Debug.Assert(resultBranchId < tasks.Length, "Expected a valid branch ID"); 2041Debug.Assert(successfulBranchId == -1, "There should be at most one successful branch."); 2044else Debug.Assert(resultBranchId == -1, "Expected -1 as a signal of a non-successful branch"); 2166Debug.Assert(completed != null, "Requires a shared target to complete."); 2266Debug.Assert(source != null, "Requires a source for which to retrieve the observable."); 2284Debug.Assert(source != null, "The observable requires a source to wrap."); 2333Debug.Assert(_observersState.Unlinker == null, "The source should not be linked to the target."); 2358Debug.Assert(observer != null, "Expected an observer."); 2364Debug.Assert(currentState != null, "Observer state should never be null."); 2392Debug.Assert(currentState != null, "Observer state should never be null."); 2393Debug.Assert(currentState.Unlinker != null, "The target should be linked."); 2394Debug.Assert(currentState.Canceler != null, "The target should have set up continuations."); 2426Debug.Assert(observable != null, "Need a block with which to construct the debug view."); 2461Debug.Assert(observable != null, "Observe state must be mapped to a source observable."); 2555Debug.Assert(Target.Completion.IsCompleted, "The target must have already completed in order to notify of completion."); 2627Debug.Assert(target != null, "A target to observe is required.");
Base\DataflowBlockOptions.cs (9)
113Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 125Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 136Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 156Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 175Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 291Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 314Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 423Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 434Debug.Assert(this != Default, "Default instance is supposed to be immutable.");
Base\DataflowLinkOptions.cs (3)
85Debug.Assert(this != Default && this != UnlinkAfterOneAndPropagateCompletion, "Default and UnlinkAfterOneAndPropagateCompletion instances are supposed to be immutable."); 96Debug.Assert(this != Default && this != UnlinkAfterOneAndPropagateCompletion, "Default and UnlinkAfterOneAndPropagateCompletion instances are supposed to be immutable."); 108Debug.Assert(this != Default && this != UnlinkAfterOneAndPropagateCompletion, "Default and UnlinkAfterOneAndPropagateCompletion instances are supposed to be immutable.");
Blocks\ActionBlock.cs (11)
112Debug.Assert(asyncAction != null, "action is of incorrect delegate type"); 128Debug.Assert((_spscTarget != null) ^ (_defaultTarget != null), "One and only one of the two targets must be non-null after construction"); 136Debug.Assert(_defaultTarget != null); 159Debug.Assert(action != null, "action needed for processing"); 160Debug.Assert(_defaultTarget != null); 204Debug.Assert(completed != null, "Need completed task for processing"); 205Debug.Assert(completed.IsCompleted, "The task to be processed must be completed by now."); 206Debug.Assert(_defaultTarget != null); 232Debug.Assert(_spscTarget != null); 251Debug.Assert(_spscTarget != null); 336Debug.Assert(actionBlock != null, "Need a block with which to construct the debug view.");
Blocks\BatchBlock.cs (34)
84Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 202Debug.Assert(batchBlock != null, "Need a block with which to construct the debug view"); 293Debug.Assert(batchSize > 0, "A positive batch size is required"); 309Debug.Assert(owningBatch != null, "This batch target core must be associated with a batch block."); 310Debug.Assert(batchSize >= 1, "Batch sizes must be positive."); 311Debug.Assert(batchCompletedAction != null, "Completion action must be specified."); 312Debug.Assert(dataflowBlockOptions != null, "Options required to configure the block."); 381Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 409Debug.Assert(_nonGreedyState != null, "_nonGreedyState must have been initialized during construction in non-greedy mode."); 461Debug.Assert(_nonGreedyState != null && _nonGreedyState.TaskForInputProcessing != null, 622Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 637Debug.Assert(BatchesNeedProcessing, "There must be a batch that needs processing."); 666Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 755Debug.Assert(!_dataflowBlockOptions.Greedy, "This method may only be used in non-greedy mode."); 756Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 773Debug.Assert(_messages.Count == 0, "The queue must be empty between batches in non-greedy mode"); 785Debug.Assert(allowFewerThanBatchSize ? poppedInitially > 0 : poppedInitially == _batchSize, 819Debug.Assert(reserved.Count <= _batchSize, "Expected the number of reserved sources to be <= the number needed for a batch."); 872Debug.Assert(_dataflowBlockOptions.Greedy, "This method may only be used in greedy mode."); 873Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 874Debug.Assert(_boundingState != null, "Bounding state is required when in bounded mode."); 902Debug.Assert(poppedInitially > 0, "We received fewer than we expected based on the previous check."); 931Debug.Assert(reserved.Count <= itemCountNeededToCompleteBatch, "Expected the number of reserved sources to be <= the number needed for a batch."); 981Debug.Assert(!_dataflowBlockOptions.Greedy, "This method may only be used in non-greedy mode."); 982Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 983Debug.Assert(_nonGreedyState.ReservedSourcesTemp != null, "ReservedSourcesTemp should have been initialized."); 1031Debug.Assert(_dataflowBlockOptions.Greedy, "This method may only be used in greedy mode."); 1032Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 1033Debug.Assert(_nonGreedyState.ReservedSourcesTemp != null, "ReservedSourcesTemp should have been initialized."); 1034Debug.Assert(_boundingState != null, "Bounded state is required for bounded mode."); 1086Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 1087Debug.Assert(_nonGreedyState.ReservedSourcesTemp != null, "Should have been initialized"); 1117Debug.Assert(numItemsRemoved > 0, "Should only be called for a positive number of items removed."); 1128Debug.Assert(_boundingState.CurrentCount - numItemsRemoved >= 0,
Blocks\BatchedJoinBlock.cs (21)
102Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 149Debug.Assert(_target1 != null, "_target1 not initialized"); 150Debug.Assert(_target2 != null, "_target2 not initialized"); 164Debug.Assert(_sharedResources != null, "_sharedResources not initialized"); 165Debug.Assert(_sharedResources._incomingLock != null, "_sharedResources._incomingLock not initialized"); 166Debug.Assert(_source != null, "_source not initialized"); 230Debug.Assert(batchedJoinBlock != null, "Need a block with which to construct the debug view."); 354Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 404Debug.Assert(_target1 != null, "_target1 not initialized"); 405Debug.Assert(_target2 != null, "_target2 not initialized"); 406Debug.Assert(_target3 != null, "_target3 not initialized"); 421Debug.Assert(_sharedResources != null, "_sharedResources not initialized"); 422Debug.Assert(_sharedResources._incomingLock != null, "_sharedResources._incomingLock not initialized"); 423Debug.Assert(_source != null, "_source not initialized"); 488Debug.Assert(batchedJoinBlock != null, "Need a block with which to construct the debug view."); 546Debug.Assert(sharedResources != null, "Targets require a shared resources through which to communicate."); 586Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 652Debug.Assert(batchedJoinBlockTarget != null, "Need a block with which to construct the debug view."); 685Debug.Assert(batchSize >= 1, "A positive batch size is required."); 686Debug.Assert(batchSizeReachedAction != null, "Need an action to invoke for each batch."); 687Debug.Assert(allTargetsDecliningAction != null, "Need an action to invoke when all targets have declined.");
Blocks\BroadcastBlock.cs (26)
79Debug.Assert(dataflowBlockOptions.BoundedCapacity > 0, "Positive bounding count expected; should have been verified by options ctor"); 94Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 127Debug.Assert(storeExceptionEvenIfAlreadyCompleting || !revertProcessingState, 142Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 194Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 209Debug.Assert(_boundingState != null && _boundingState.PostponedMessages != null, 224Debug.Assert(numItemsRemoved > 0, "Should only be called for a positive number of items removed."); 235Debug.Assert(_boundingState.CurrentCount - numItemsRemoved >= 0, 250Debug.Assert(_boundingState != null, "Must be in bounded mode."); 285Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 287Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 331Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 333Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 464Debug.Assert(broadcastBlock != null, "Need a block with which to construct the debug view."); 553Debug.Assert(owningSource != null, "Must be associated with a broadcast block."); 554Debug.Assert(dataflowBlockOptions != null, "Options are required to configure this block."); 674Debug.Assert(target != null, "Target required to offer messages to."); 711else Debug.Assert(result != DataflowMessageStatus.NotAvailable, "Messages from a Broadcast should never be missed."); 744Debug.Assert(_messages.Count > 0, "There must be at least one message to dequeue."); 816Debug.Assert(false, "Messages from a Broadcast should never be missed."); 944Debug.Assert(_taskForOutputProcessing == null, "There must be no processing tasks."); 945Debug.Assert( 1162Debug.Assert(exception != null, "An exception to add is required."); 1163Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions."); 1174Debug.Assert(exceptions != null, "A list of exceptions to add is required."); 1175Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions.");
Blocks\BufferBlock.cs (13)
76Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 119Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 135Debug.Assert(_boundingState != null && _boundingState.PostponedMessages != null, 162Debug.Assert(storeExceptionEvenIfAlreadyCompleting || !revertProcessingState, 177Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 225Debug.Assert(numItemsRemoved > 0, "A positive number of items to remove is required."); 236Debug.Assert(_boundingState.CurrentCount - numItemsRemoved >= 0, 251Debug.Assert(_boundingState != null, "Must be in bounded mode."); 287Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 289Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 333Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 335Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 448Debug.Assert(bufferBlock != null, "Need a block with which to construct the debug view.");
Blocks\JoinBlock.cs (42)
98Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 136Debug.Assert(_target1 != null, "_target1 not initialized"); 137Debug.Assert(_target2 != null, "_target2 not initialized"); 151Debug.Assert(_sharedResources != null, "_sharedResources not initialized"); 152Debug.Assert(_sharedResources._exceptionAction != null, "_sharedResources._exceptionAction not initialized"); 211Debug.Assert(joinBlock != null, "Need a block with which to construct the debug view."); 323Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 361Debug.Assert(_target1 != null, "_target1 not initialized"); 362Debug.Assert(_target2 != null, "_target2 not initialized"); 363Debug.Assert(_target3 != null, "_target3 not initialized"); 378Debug.Assert(_sharedResources != null, "_sharedResources not initialized"); 379Debug.Assert(_sharedResources._exceptionAction != null, "_sharedResources._exceptionAction not initialized"); 441Debug.Assert(joinBlock != null, "Need a block with which to construct the debug view."); 514Debug.Assert(sharedResources != null, "Targets need shared resources through which to communicate."); 530Debug.Assert(_messages != null, "_messages must have been initialized in greedy mode"); 531Debug.Assert(_messages.Count >= 0, "A message must have been consumed by this point."); 536Debug.Assert(_nonGreedy!.ConsumedMessage.Key, "A message must have been consumed by this point."); 561Debug.Assert(_messages != null, "_messages must have been initialized in greedy mode"); 596Debug.Assert(_sharedResources._dataflowBlockOptions.Greedy, "This is only valid in greedy mode"); 613Debug.Assert(!_sharedResources._dataflowBlockOptions.Greedy, "This is only used in non-greedy mode"); 620Debug.Assert(!HasAtLeastOneMessageAvailable, "The queue must be empty between joins in non-greedy mode"); 653Debug.Assert(!_sharedResources._dataflowBlockOptions.Greedy, "This is only used in non-greedy mode"); 654Debug.Assert(_nonGreedy!.ReservedMessage.Key != null, "This target must have a reserved message"); 680Debug.Assert(!_nonGreedy.ConsumedMessage.Key, "There must be no other consumed message"); 695Debug.Assert(_sharedResources._dataflowBlockOptions.Greedy, "This is only used in greedy mode"); 696Debug.Assert(_sharedResources._boundingState != null, "This is only used in bounding mode"); 780Debug.Assert(_nonGreedy != null, "Only valid in non-greedy mode."); 791Debug.Assert(_nonGreedy == null || _nonGreedy.ReservedMessage.Key == null, 855Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 879Debug.Assert(_nonGreedy != null, "_nonGreedy must have been initialized during construction in non-greedy mode."); 910Debug.Assert(_messages != null, "_messages must be initialized in greedy mode."); 977Debug.Assert(joinBlockTarget != null, "Need a target with which to construct the debug view."); 1043Debug.Assert(ownerJoin != null, "Resources must be associated with a join."); 1044Debug.Assert(targets != null, "Resources must be shared between multiple targets."); 1045Debug.Assert(joinFilledAction != null, "An action to invoke when a join is created must be provided."); 1046Debug.Assert(exceptionAction != null, "An action to invoke for faults must be provided."); 1047Debug.Assert(dataflowBlockOptions != null, "Options must be provided to configure the resources."); 1277Debug.Assert(JoinNeedsProcessing, "There must be a join that needs processing."); 1358Debug.Assert(!_dataflowBlockOptions.Greedy || _boundingState != null, "This only makes sense in non-greedy or bounding mode"); 1397Debug.Assert(_targets.Length > 0, "A join must have targets."); 1424Debug.Assert(numItemsRemoved > 0, "Number of items removed needs to be positive."); 1435Debug.Assert(_boundingState.CurrentCount - numItemsRemoved >= 0,
Blocks\TransformBlock.cs (7)
101Debug.Assert(transformSync == null ^ transformAsync == null, "Exactly one of transformSync and transformAsync must be null."); 132Debug.Assert(transformAsync != null, "Incorrect delegate type."); 157Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 228Debug.Assert(transform != null, "Function to invoke is required."); 273Debug.Assert(completed != null, "Completed task is required."); 274Debug.Assert(completed.IsCompleted, "Task must be completed to be here."); 423Debug.Assert(transformBlock != null, "Need a block with which to construct the debug view.");
Blocks\TransformManyBlock.cs (11)
153Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 256Debug.Assert(completed != null, "A task should have been provided."); 257Debug.Assert(completed.IsCompleted, "The task should have been in a final state."); 295Debug.Assert(false, "The task should have been in a final state."); 350Debug.Assert(_reorderingBuffer != null, "Expected a reordering buffer"); 351Debug.Assert(id != Common.INVALID_REORDERING_ID, "This ID should never have been handed out."); 438Debug.Assert(_reorderingBuffer == null, "Expected not to have a reordering buffer"); 439Debug.Assert(outputItems is TOutput[] || outputItems is List<TOutput>, "outputItems must be a list we've already vetted as trusted"); 538Debug.Assert(_target.IsBounded, "Expected to be in bounding mode."); 541else Debug.Assert(count == 1, "Count shouldn't be negative."); 629Debug.Assert(transformManyBlock != null, "Need a block with which to construct the debug view.");
Blocks\TransformManyBlock.IAsyncEnumerable.cs (3)
43t.ContinueWith(static t => Debug.Assert(t.IsCompletedSuccessfully), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default); 122Debug.Assert(_reorderingBuffer is not null, "Expected a reordering buffer"); 123Debug.Assert(id != Common.INVALID_REORDERING_ID, "This ID should never have been handed out.");
Blocks\WriteOnceBlock.cs (6)
114Debug.Assert(_decliningPermanently, "We may get here only after we have started to decline permanently."); 115Debug.Assert(_completionReserved, "We may get here only after we have reserved completion."); 173Debug.Assert(_lazyCompletionTaskSource == null || !_lazyCompletionTaskSource.Task.IsCompleted, "The task completion source must not be completed. This must be the only thread that ever completes the block."); 227Debug.Assert(exception != null || !storeExceptionEvenIfAlreadyCompleting, 437Debug.Assert(_header.IsValid, "A valid header is required."); 534Debug.Assert(writeOnceBlock != null, "Need a block with which to construct the debug view.");
Internal\ActionOnDispose.cs (4)
33Debug.Assert(action != null, "Non-null disposer action required."); 48Debug.Assert(action != null, "Non-null disposer action required."); 76Debug.Assert(action != null, "Non-null action needed for disposable"); 117Debug.Assert(action != null, "Non-null action needed for disposable");
Internal\Common.cs (40)
48Debug.Assert(syncObj != null, "The monitor object to check must be provided."); 49Debug.Assert(Monitor.IsEntered(syncObj) == held, "The locking scheme was not correctly followed."); 71Debug.Assert(predicate != null, "Non-null predicate to execute is required."); 95Debug.Assert(wr != null, "Expected a WeakReference<T> as the state argument"); 104Debug.Assert(block != null, "Block required to extract an Id."); 120Debug.Assert(block != null, "Should only be used with valid objects being displayed in the debugger."); 121Debug.Assert(options == null || options.NameFormat != null, "If options are provided, NameFormat must be valid."); 152Debug.Assert(exception != null, "An exception to check for cancellation must be provided."); 178Debug.Assert(completionTask != null, "A task to wire up for completion is needed."); 179Debug.Assert(completeAction != null, "An action to invoke upon cancellation is required."); 214Debug.Assert(exception != null && exception.StackTrace == null, 230Debug.Assert(exc != null, "The exception into which data should be stored must be provided."); 274Debug.Assert(exception != null, "An exception is needed to store the data into."); 275Debug.Assert(key != null, "A key into the exception's data collection is needed."); 276Debug.Assert(value != null, "The value to store must be provided."); 313Debug.Assert(exception != null, "An exception to add is required."); 314Debug.Assert(!unwrapInnerExceptions || exception.InnerException != null, 374Debug.Assert(cancellationToken.IsCancellationRequested, 377Debug.Assert(t.IsCanceled, "Task's constructor should cancel the task synchronously in the ctor."); 386Debug.Assert(block != null, "We need a block from which to retrieve a cancellation task."); 407Debug.Assert(outgoingLock != null, "Monitor object needed to protect the operation."); 408Debug.Assert(targetRegistry != null, "Registry from which to remove is required."); 409Debug.Assert(targetBlock != null, "Target block to unlink is required."); 454Debug.Assert(task != null, "Task to start is required."); 455Debug.Assert(scheduler != null, "Scheduler on which to start the task is required."); 472Debug.Assert(task != null, "Task to start is needed."); 473Debug.Assert(scheduler != null, "Scheduler on which to start the task is required."); 484Debug.Assert(task.IsFaulted, "The task should have been faulted if it failed to start."); 501Debug.Assert(target != null, "There must be a subject target."); 502Debug.Assert(postponedMessages != null, "The stacked map of postponed messages must exist."); 519Debug.Assert(sourceAndMessage.Key != null, "Postponed messages must have an associated source."); 533Debug.Assert(processedCount == initialCount, 548Debug.Assert(sourceCompletionTask != null, "sourceCompletionTask may not be null."); 549Debug.Assert(target != null, "The target where completion is to be propagated may not be null."); 550Debug.Assert(sourceCompletionTask.IsCompleted, "sourceCompletionTask must be completed in order to propagate its completion."); 571Debug.Assert(sourceCompletionTask != null, "sourceCompletionTask may not be null."); 572Debug.Assert(target != null, "The target where completion is to be propagated may not be null."); 582Debug.Assert(sourceCompletionTask != null, "sourceCompletionTask may not be null."); 583Debug.Assert(target != null, "The target where completion is to be propagated may not be null."); 628Debug.Assert(boundedCapacity > 0, "Bounded is only supported with positive values.");
Internal\DataflowEtwProvider.cs (11)
66Debug.Assert(block != null, "Block needed for the ETW event."); 67Debug.Assert(dataflowBlockOptions != null, "Options needed for the ETW event."); 94Debug.Assert(block != null, "Block needed for the ETW event."); 95Debug.Assert(task != null, "Task needed for the ETW event."); 96Debug.Assert(reason == TaskLaunchedReason.ProcessingInputMessages || reason == TaskLaunchedReason.OfferingOutputMessages, 130Debug.Assert(block != null, "Block needed for the ETW event."); 135Debug.Assert(blockIsCompleted, "Block must be completed for this event to be valid."); 181Debug.Assert(source != null, "Source needed for the ETW event."); 182Debug.Assert(target != null, "Target needed for the ETW event."); 203Debug.Assert(source != null, "Source needed for the ETW event."); 204Debug.Assert(target != null, "Target needed for the ETW event.");
Internal\EnumerableDebugView.cs (1)
29Debug.Assert(enumerable != null, "Expected a non-null enumerable.");
Internal\ImmutableArray.cs (1)
41Debug.Assert(elements != null, "Requires an array to wrap.");
Internal\QueuedMap.cs (11)
78Debug.Assert(0 <= _freeIndex && _freeIndex < _storage.Count, "Index is out of range."); 93Debug.Assert(_tailIndex == TERMINATOR_INDEX, "If head indicates empty, so too should tail."); 99Debug.Assert(_tailIndex != TERMINATOR_INDEX, "If head does not indicate empty, neither should tail."); 116Debug.Assert(_tailIndex == TERMINATOR_INDEX, "If head indicates empty, so too should tail."); 122Debug.Assert(0 <= _headIndex && _headIndex < _storage.Count, "Head is out of range."); 140Debug.Assert(0 <= index && index < _storage.Count, "Index is out of range."); 144Debug.Assert(idx != index, "Index should not belong to the list of free slots."); 211Debug.Assert(items != null, "Requires non-null array to store into."); 212Debug.Assert(count >= 0 && arrayOffset >= 0, "Count and offset must be non-negative"); 213Debug.Assert(arrayOffset + count >= 0, "Offset plus count overflowed"); 214Debug.Assert(arrayOffset + count <= items.Length, "Range must be within array size");
Internal\ReorderingBuffer.cs (7)
59Debug.Assert(owningSource != null, "Buffer must be associated with a source."); 60Debug.Assert(outputAction != null, "Action required for when items are to be released."); 71Debug.Assert(id != Common.INVALID_REORDERING_ID, "This ID should never have been handed out."); 86Debug.Assert((ulong)id > (ulong)_nextReorderedIdToOutput, "Duplicate id."); 97Debug.Assert(id != Common.INVALID_REORDERING_ID, "This ID should never have been handed out."); 123Debug.Assert(id != Common.INVALID_REORDERING_ID, "This ID should never have been handed out."); 188Debug.Assert(buffer != null, "Need a buffer with which to construct the debug view.");
Internal\SourceCore.cs (21)
108Debug.Assert(owningSource != null, "Core must be associated with a source."); 109Debug.Assert(dataflowBlockOptions != null, "Options must be provided to configure the core."); 110Debug.Assert(completeAction != null, "Action to invoke on completion is required."); 264Debug.Assert(!_enableOffering, "Offering should have been disabled if there was a valid reservation"); 371Debug.Assert(items != null); 412Debug.Assert(items != null, "Items list must be valid."); 462Debug.Assert(exception != null, "Valid exception must be provided to be added."); 463Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions."); 474Debug.Assert(exceptions != null, "Valid exceptions must be provided to be added."); 475Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions."); 489Debug.Assert(aggregateException != null && aggregateException.InnerExceptions.Count > 0, "Aggregate must be valid and contain inner exceptions to unwrap."); 490Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions."); 579Debug.Assert(linkToTarget != null, "Must have a valid target to offer to."); 628Debug.Assert(false, "The target did not follow the protocol."); 673Debug.Assert(target != null, "Valid target to offer to is required."); 678Debug.Assert(result != DataflowMessageStatus.NotAvailable, "Messages are not being offered concurrently, so nothing should be missed."); 696Debug.Assert(result == DataflowMessageStatus.Postponed, 741Debug.Assert(_taskForOutputProcessing == null && _enableOffering && !_messages.IsEmpty, 800Debug.Assert(_taskForOutputProcessing != null && _taskForOutputProcessing.Id == Task.CurrentId, 858Debug.Assert(_taskForOutputProcessing != null && _taskForOutputProcessing.Id == Task.CurrentId, 912Debug.Assert(
Internal\SpscTargetCore.cs (7)
77Debug.Assert(owningTarget != null, "Expected non-null owningTarget"); 78Debug.Assert(action != null, "Expected non-null action"); 79Debug.Assert(dataflowBlockOptions != null, "Expected non-null dataflowBlockOptions"); 193Debug.Assert( 256Debug.Assert(previousConsumer != null && previousConsumer.Id == Task.CurrentId, 324Debug.Assert(_completionReserved, "Should only invoke once completion has been reserved."); 341Debug.Assert(result, "Expected completion task to not yet be completed");
Internal\TargetCore.cs (30)
114Debug.Assert(owningTarget != null, "Core must be associated with a target block."); 115Debug.Assert(dataflowBlockOptions != null, "Options must be provided to configure the core."); 116Debug.Assert(callAction != null, "Action to invoke for each item is required."); 129Debug.Assert(_dataflowBlockOptions.BoundedCapacity > 0, "Positive bounding count expected; should have been verified by options ctor"); 143Debug.Assert(storeExceptionEvenIfAlreadyCompleting || !revertProcessingState, 153Debug.Assert(_numberOfOutstandingOperations > 0 || !storeExceptionEvenIfAlreadyCompleting, 168Debug.Assert(_numberOfOutstandingOperations > 0 && (!UsesAsyncCompletion || _numberOfOutstandingServiceTasks > 0), 208Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 218Debug.Assert(messageId != Common.INVALID_REORDERING_ID, "The assigned message ID is invalid."); 227Debug.Assert(_boundingState != null && _boundingState.PostponedMessages != null, 259Debug.Assert(_numberOfOutstandingOperations > 0, "Operations may only be completed if any are outstanding."); 265Debug.Assert(boundingCountChange <= 0 && _boundingState.CurrentCount + boundingCountChange >= 0, 295Debug.Assert(_numberOfOutstandingOperations >= 0, "Number of outstanding operations should never be negative."); 296Debug.Assert(_numberOfOutstandingServiceTasks >= 0, "Number of outstanding service tasks should never be negative."); 297Debug.Assert(_numberOfOutstandingOperations >= _numberOfOutstandingServiceTasks, "Number of outstanding service tasks should never exceed the number of outstanding operations."); 311Debug.Assert(_numberOfOutstandingOperations >= 0, "Number of outstanding operations should never be negative."); 312Debug.Assert(_numberOfOutstandingServiceTasks >= 0, "Number of outstanding service tasks should never be negative."); 313Debug.Assert(_numberOfOutstandingOperations >= _numberOfOutstandingServiceTasks, "Number of outstanding service tasks should never exceed the number of outstanding operations."); 354Debug.Assert(HasRoomForMoreServiceTasks, "There must be room to process asynchronously."); 424Debug.Assert( 495Debug.Assert(_numberOfOutstandingOperations > 0, "Expected a positive number of outstanding operations, since we're completing one here."); 502Debug.Assert(_numberOfOutstandingServiceTasks > 0, "Expected a positive number of outstanding service tasks, since we're completing one here."); 523Debug.Assert(UsesAsyncCompletion, "Only valid to use when in async mode."); 615Debug.Assert( 660Debug.Assert(messageId != Common.INVALID_REORDERING_ID, "The assigned message ID is invalid."); 664Debug.Assert(_boundingState.OutstandingTransfers >= 0, "Expected TryConsumePostponedMessage to not be negative."); 730Debug.Assert((_decliningPermanently && _messages.IsEmpty) || CanceledOrFaulted, "There must be no more messages."); 758lock (IncomingLock) Debug.Assert(_numberOfOutstandingOperations == 0, "Everything must be done by now."); 811Debug.Assert(count != 0, "Should only be called when the count is actually changing."); 817Debug.Assert(count > 0 || (count < 0 && _boundingState.CurrentCount + count >= 0),
Internal\TargetRegistry.cs (29)
37Debug.Assert(target != null, "The target that is supposed to be linked must not be null."); 38Debug.Assert(linkOptions != null, "The linkOptions must not be null."); 74Debug.Assert(owningSource != null, "The TargetRegistry instance must be owned by a source block."); 85Debug.Assert(target != null, "The target that is supposed to be linked must not be null."); 86Debug.Assert(linkOptions != null, "The link options must not be null."); 97Debug.Assert(_linksWithRemainingMessages >= 0, "_linksWithRemainingMessages must be non-negative at any time."); 121Debug.Assert(target != null, "Target to remove is required."); 124Debug.Assert(_linksWithRemainingMessages >= 0, "_linksWithRemainingMessages must be non-negative at any time."); 138Debug.Assert(target != null, "Target to remove is required."); 141Debug.Assert(_linksWithRemainingMessages >= 0, "_linksWithRemainingMessages must be non-negative at any time."); 142Debug.Assert(!onlyIfReachedMaxMessages || _linksWithRemainingMessages > 0, "We shouldn't have ended on the slow path."); 148Debug.Assert(node != null, "The LinkedTargetInfo node referenced in the Dictionary must be non-null."); 159Debug.Assert(_linksWithRemainingMessages >= 0, "_linksWithRemainingMessages must be non-negative at any time."); 169Debug.Assert(node.RemainingMessages > 1, "The target should have been removed, because there are no remaining messages."); 184Debug.Assert(_linksWithRemainingMessages >= 0, "_linksWithRemainingMessages must be non-negative at any time."); 194Debug.Assert(_owningSource.Completion.IsCompleted, "The owning source must have completed before propagating completion."); 214Debug.Assert(node != null, "Requires a node to be added."); 223Debug.Assert(_firstTarget != null && _lastTarget != null, "Both first and last node must either be null or non-null."); 224Debug.Assert(_lastTarget.Next == null, "The last node must not have a successor."); 225Debug.Assert(_firstTarget.Previous == null, "The first node must not have a predecessor."); 243Debug.Assert(_firstTarget != null && _lastTarget != null, "Both first and last node must be non-null after AddToList."); 250Debug.Assert(node != null, "Node to remove is required."); 251Debug.Assert(_firstTarget != null && _lastTarget != null, "Both first and last node must be non-null before RemoveFromList."); 273Debug.Assert((_firstTarget != null) == (_lastTarget != null), "Both first and last node must either be null or non-null after RemoveFromList."); 312Debug.Assert(owningSource != null, "Propagator must be associated with a source."); 313Debug.Assert(target != null, "Target to propagate to is required."); 323Debug.Assert(source == _owningSource, "Only valid to be used with the source for which it was created."); 378Debug.Assert(passthrough != null, "Need a propagator with which to construct the debug view."); 398Debug.Assert(registry != null, "Need a registry with which to construct the debug view.");
src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (13)
67Debug.Assert(InitialSegmentSize > 0, "Initial segment size must be > 0."); 68Debug.Assert((InitialSegmentSize & (InitialSegmentSize - 1)) == 0, "Initial segment size must be a power of 2"); 69Debug.Assert(InitialSegmentSize <= MaxSegmentSize, "Initial segment size should be <= maximum."); 70Debug.Assert(MaxSegmentSize < int.MaxValue / 2, "Max segment size * 2 must be < int.MaxValue, or else overflow could occur."); 102Debug.Assert(segment != null, "Expected a non-null segment."); 112Debug.Assert(newSegmentSize > 0, "The max size should always be small enough that we don't overflow."); 179Debug.Assert(segment != null, "Expected a non-null segment."); 180Debug.Assert(array != null, "Expected a non-null item array."); 253Debug.Assert(segment != null, "Expected a non-null segment."); 254Debug.Assert(array != null, "Expected a non-null item array."); 368Debug.Assert(syncObj != null, "The syncObj parameter is null."); 390Debug.Assert((size & (size - 1)) == 0, "Size must be a power of 2"); 429Debug.Assert(queue != null, "Expected a non-null queue.");
System.Threading.Tasks.Parallel (44)
System\Threading\Tasks\Parallel.cs (17)
923Debug.Assert(typeof(TInt) == typeof(int) || typeof(TInt) == typeof(long)); 924Debug.Assert(((body == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) + (bodyWithLocal == null ? 0 : 1)) == 1, 926Debug.Assert(bodyWithLocal != null || (localInit == null && localFinally == null), 1024Debug.Assert(sharedPStateFlags != null); 1029Debug.Assert(sharedPStateFlags != null); 1645Debug.Assert(((body == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) + 1648Debug.Assert((bodyWithStateAndLocal != null) || (bodyWithEverything != null) || (localInit == null && localFinally == null), 1703Debug.Assert(array != null); 1704Debug.Assert(parallelOptions != null, "ForEachWorker(array): parallelOptions is null"); 1762Debug.Assert(list != null); 1763Debug.Assert(parallelOptions != null, "ForEachWorker(list): parallelOptions is null"); 2517Debug.Assert(((simpleBody == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) + 2520Debug.Assert((bodyWithStateAndLocal != null) || (bodyWithEverything != null) || (localInit == null && localFinally == null), 2524Debug.Assert((orderedSource != null) || (bodyWithStateAndIndex == null && bodyWithEverything == null), 2706Debug.Fail("PartitionerForEach: illegal body type in Partitioner handler"); 2821Debug.Assert(exObj is Exception); 2833Debug.Assert(first is OperationCanceledException);
System\Threading\Tasks\Parallel.ForEachAsync.cs (16)
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); 625Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 632Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 665Debug.Assert(_completionRefCount == 0, $"Expected {nameof(_completionRefCount)} == 0, got {_completionRefCount}"); 677Debug.Assert(!Cancellation.IsCancellationRequested); 689Debug.Assert(taskSet, "Complete should only be called once."); 695Debug.Assert(_scheduler == TaskScheduler.Default, $"Expected {nameof(_scheduler)} == TaskScheduler.Default, got {_scheduler}");
System\Threading\Tasks\ParallelLoopState.cs (6)
43Debug.Fail(SR.ParallelState_NotSupportedException_UnsupportedMethod); 100Debug.Fail(SR.ParallelState_NotSupportedException_UnsupportedMethod); 148Debug.Fail(SR.ParallelState_NotSupportedException_UnsupportedMethod); 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 (170)
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 (13)
93Debug.Assert(this is RecoveringInternalEnlistment, "this is RecoveringInternalEnlistment"); 103Debug.Assert(this is PromotableInternalEnlistment, "this is PromotableInternalEnlistment"); 142Debug.Assert(_twoPhaseState != null); 164Debug.Assert(_transaction != null, "this.transaction != null"); 177Debug.Fail("PromotableSinglePhaseNotification called for a non promotable enlistment."); 234Debug.Assert(Transaction._phase0Volatiles._preparedVolatileEnlistments <= 249Debug.Fail("ResourceManagerIdentifier called for non durable enlistment"); 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 (15)
59Debug.Fail($"Invalid Event for InternalEnlistment State; Current State: {GetType()}"); 65Debug.Fail($"Invalid Event for InternalEnlistment State; Current State: {GetType()}"); 71Debug.Fail($"Invalid Event for InternalEnlistment State; Current State: {GetType()}"); 77Debug.Fail($"Invalid Event for InternalEnlistment State; Current State: {GetType()}"); 83Debug.Fail($"Invalid Event for InternalEnlistment State; Current State: {GetType()}"); 89Debug.Fail($"Invalid Event for InternalEnlistment State; Current State: {GetType()}"); 95Debug.Fail($"Invalid Event for InternalEnlistment State; Current State: {GetType()}"); 101Debug.Fail($"Invalid Event for InternalEnlistment State; Current State: {GetType()}"); 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 (5)
129Debug.Assert(_promotedTransaction == null, "A transaction can only be promoted once!"); 300Debug.Assert(tx.PromotedTransaction != null); 304Debug.Assert(tx.State! != null); 327Debug.Fail("InternalTransaction.DistributedTransactionOutcome - Unexpected TransactionStatus"); 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 (8)
538Debug.Assert(_threadContextData != null); 559Debug.Assert(rollbackTransaction != null); 792Debug.Assert(rollbackTransaction != null); 804Debug.Assert(null != _dependentTransaction, "null != this.dependentTransaction"); 818Debug.Assert(_expectedCurrent != null); 938Debug.Assert(ContextKey != null); 985Debug.Assert(_savedCurrentScope.ContextKey != null); 1027Debug.Assert(_threadContextData != null);
System\Transactions\TransactionsEtwProvider.cs (7)
271Debug.Assert(transaction != null, "Transaction needed for the ETW event."); 595Debug.Assert(enlistment != null, "Enlistment needed for the ETW event."); 620Debug.Assert(enlistment != null, "Enlistment needed for the ETW event."); 645Debug.Assert(enlistment != null, "Enlistment needed for the ETW event."); 670Debug.Assert(enlistment != null, "Enlistment needed for the ETW event."); 696Debug.Assert(enlistment != null, "Enlistment needed for the ETW event."); 721Debug.Assert(enlistment != null, "Enlistment needed for the ETW event.");
System\Transactions\TransactionState.cs (70)
163Debug.Assert(tx.State != this, "Changing to the same state."); 185Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 299Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 311Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 323Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 335Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 347Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 359Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 371Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 383Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 395Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 411Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 417Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 423Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 615Debug.Assert(tx._phase0Volatiles._dependentClones >= 0); 618Debug.Assert(tx._phase0Volatiles._preparedVolatileEnlistments <= 636Debug.Assert(tx._phase1Volatiles._dependentClones >= 0); 664Debug.Assert(tx.promotedToken != null); 788Debug.Assert(tx._promoterType != Guid.Empty, "InternalTransaction.PromoterType was not set in PSPEInitialize"); 835Debug.Assert(tx._promoter != null, "Transaction Promoter is Null entering SubordinateActive"); 845Debug.Assert(tx._promoter != null); 1077Debug.Assert(tx._promoterType != Guid.Empty, "InternalTransaction.PromoterType was not set in Phase0PSPEInitialize"); 1183Debug.Assert(tx._committableTransaction != null); 1266Debug.Assert(tx._phase1Volatiles._volatileEnlistmentCount == 1, 1668Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 1697Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 1727Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 1768Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 1803Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 1879Debug.Assert(tx._phase0Volatiles._preparedVolatileEnlistments <= 1893Debug.Assert(tx._phase0WaveDependentCloneCount >= 0); 1927Debug.Assert(tx._phase1Volatiles._dependentClones >= 0); 1934Debug.Assert(0 <= tx._abortingDependentCloneCount); 1969Debug.Assert(tx.PromotedTransaction != null); 1991Debug.Assert(tx.PromotedTransaction != null); 2007Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 2065Debug.Assert(tx.PromotedTransaction != null); 2101Debug.Assert(tx.promotedToken != null, "InternalTransaction.promotedToken is null in TransactionStateDelegatedNonMSDTCBase or one of its derived classes."); 2131Debug.Assert(tx.PromotedTransaction != null && tx.PromotedTransaction.RealTransaction != null); 2145Debug.Assert((tx._promoterType == Guid.Empty) || (tx._promoterType == TransactionInterop.PromoterTypeDtc), "Promoted to MSTC but PromoterType is not TransactionInterop.PromoterTypeDtc"); 2255Debug.Assert(tx.PromotedTransaction != null); 2271Debug.Assert(tx.PromotedTransaction != null); 2296Debug.Assert(tx.PromotedTransaction != null && tx.PromotedTransaction.RealTransaction != null); 2300Debug.Assert(tx.State != null); 2536Debug.Assert(tx._phase0Volatiles.VolatileDemux != null, "Volatile Demux must exist for VolatilePrepareDone when promoted."); 2541Debug.Assert(tx._phase0Volatiles.VolatileDemux._promotedEnlistment != null); 2644Debug.Assert(tx._phase1Volatiles.VolatileDemux != null, "Volatile Demux must exist for VolatilePrepareDone when promoted."); 2649Debug.Assert(tx._phase1Volatiles.VolatileDemux._promotedEnlistment != null); 2766Debug.Assert(tx._phase0Volatiles.VolatileDemux._promotedEnlistment != null); 2777Debug.Assert(tx.PromotedTransaction != null); 2801Debug.Assert(tx._phase1Volatiles.VolatileDemux != null, "Volatile Demux must exist."); 2808Debug.Assert(tx._phase1Volatiles.VolatileDemux._promotedEnlistment != null); 2864Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 2894Debug.Assert(tx.PromotedTransaction != null); 3364Debug.Assert(tx._durableEnlistment != null); 3494Debug.Assert(tx._durableEnlistment != null, "PromotedNonMSDTC state is not valid for transaction"); 3535Debug.Assert(tx._phase0Volatiles._preparedVolatileEnlistments <= 3554Debug.Assert(tx._phase1Volatiles._dependentClones >= 0); 3633Debug.Assert(tx.promotedToken != null, "InternalTransaction.promotedToken is null in TransactionStateDelegatedNonMSDTCBase or one of its derived classes."); 3746Debug.Assert(tx._committableTransaction != null); 3847Debug.Assert(tx._durableEnlistment != null); 4265Debug.Assert((distributedTx == null), "PSPEPromote for non-MSDTC promotion returned a distributed transaction."); 4266Debug.Assert((tx.promotedToken != null), "PSPEPromote for non-MSDTC promotion did not set InternalTransaction.PromotedToken."); 4307Debug.Assert(tx.PromotedTransaction != null); 4351Debug.Assert(tx.State == TransactionStateActive, "PSPEPromote called from state other than TransactionStateActive"); 4378Debug.Assert(tx.State == TransactionStatePhase0, "Phase0PSPEInitialize called from state other than TransactionStatePhase0"); 4401Debug.Assert(returnState == TransactionStateDelegated || 4422Debug.Assert(tx._promoter != null); 4616Debug.Assert(tx._durableEnlistment != null); 4652Debug.Assert(tx._durableEnlistment != null);
System\Transactions\TransactionTable.cs (3)
332Debug.Assert(lastBucketSet != null); 377Debug.Assert(tx._tableBucket != null); 671Debug.Assert(transactionCount == _index, "Index changed timing out transactions");
System\Transactions\VolatileEnlistmentMultiplexing.cs (9)
258Debug.Assert(_promotedEnlistment != null && _transaction.State != null); 285Debug.Assert(_promotedEnlistment != null && _transaction.State != null); 295Debug.Assert(_promotedEnlistment != null && _transaction.State != null); 305Debug.Assert(_transaction.State != null); 349Debug.Assert(_promotedEnlistment != null && _transaction.State != null); 377Debug.Assert(_promotedEnlistment != null && _transaction.State != null); 388Debug.Assert(_promotedEnlistment != null && _transaction.State != null); 399Debug.Assert(_transaction.State != null); 454Debug.Assert(_volatileDemux == null, "volatileDemux can only be set once.");
System\Transactions\VolatileEnlistmentState.cs (10)
147Debug.Assert(enlistment.EnlistmentNotification != null); 179Debug.Assert(enlistment.Transaction.State != null); 222Debug.Assert(enlistment.SinglePhaseNotification != null); 241Debug.Assert(enlistment.Transaction.State != null); 248Debug.Assert(enlistment.Transaction.State != null); 256Debug.Assert(enlistment.Transaction.State != null); 266Debug.Assert(enlistment.Transaction.State != null); 372Debug.Assert(enlistment.EnlistmentNotification != null); 415Debug.Assert(enlistment.EnlistmentNotification != null); 449Debug.Assert(enlistment.EnlistmentNotification != null);
System.Web.HttpUtility (6)
src\libraries\Common\src\System\HexConverter.cs (3)
165Debug.Assert(chars.Length >= bytes.Length * 2); 332Debug.Assert(chars.Length % 2 == 0, "Un-even number of characters provided"); 333Debug.Assert(chars.Length / 2 == bytes.Length, "Target buffer not right-sized for provided characters");
System\Web\Util\HttpEncoder.cs (3)
471Debug.Assert(!string.IsNullOrEmpty(str)); 472Debug.Assert(e != null); 648Debug.Assert(_byteBuffer != null);
System.Windows.Controls.Ribbon (79)
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\RibbonQuickAccessToolBarOverflowPanel.cs (2)
29Debug.Assert(child != null, "child not expected to be null"); 30Debug.Assert(RibbonQuickAccessToolBar.GetIsOverflowItem(child) == true, "child expected to have IsOverflowItem == true");
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonQuickAccessToolBarPanel.cs (16)
190Debug.Assert(generatedChild != null); 229Debug.Assert(overflowPanel.Children.Count >= overflowIndex, "overflowIndex should never get above overflowPanel.Children.Count"); 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\Primitives\RibbonWindowSmallIconConverter.cs (2)
91Debug.Assert(size.Width != 0, "input param width should not be zero"); 92Debug.Assert(size.Height != 0, "input param height should not be zero");
Microsoft\Windows\Controls\Ribbon\Ribbon.cs (1)
1674Debug.Assert(ItemContainerGenerator.Status == GeneratorStatus.ContainersGenerated, "Expected: containers should be generated before calling this method.");
Microsoft\Windows\Controls\Ribbon\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 (10)
106Debug.Assert(_filterMenuButton.ItemContainerGenerator != null); 114Debug.Assert(_filterMenuButton.ItemContainerGenerator != null); 1040Debug.Assert(selectedItem != null, "Must have a selectedItem to synchronize with."); 1081Debug.Assert(IsSynchronizedWithCurrentItemInternal, "We should add currency change listeners only when IsSynchronizedWithCurrentItemInternal is true"); 1159Debug.Assert(IsSynchronizedWithCurrentItemInternal, "We shouldn't be listening for currency changes if IsSynchronizedWithCurrentItemInternal is false"); 1182Debug.Assert(IsSynchronizedWithCurrentItemInternal, "We shouldn't be listening for currency changes if IsSynchronizedWithCurrentItemInternal is false"); 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\RibbonGalleryCategory.cs (1)
516Debug.Assert(RibbonGallery == null || RibbonGallery.IsSynchronizedWithCurrentItemInternal, "We shouldn't be listening for currency changes if IsSynchronizedWithCurrentItemInternal is false");
Microsoft\Windows\Controls\Ribbon\RibbonGroup.cs (1)
1179Debug.Assert(groupSizeDefinition != null && groupSizeDefinition.IsCollapsed);
Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs (16)
208Debug.Assert(property != null); 214Debug.Assert(d != null); 215Debug.Assert(property != null); 216Debug.Assert(v != null); 781Debug.Assert(category.RibbonGallery == gallery, "The reference RibbongalleryItem and the RibbonGallery must be related."); 944Debug.Assert(element != null, "Element must not be null"); 945Debug.Assert(routedEvent != null, "RoutedEvent must not be null"); 972Debug.Assert(element != null, "Element must not be null"); 973Debug.Assert(routedEvent != null, "RoutedEvent must not be null"); 1004Debug.Assert(element != null); 1381Debug.Assert(starLayoutProvider != null); 2139Debug.Assert(clone is ButtonBase, 2172Debug.Assert(clone is ButtonBase || clone is RibbonMenuButton, 2210Debug.Assert(clone is ButtonBase || clone is RibbonMenuButton, 2230Debug.Assert(clone is RibbonMenuButton, 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\RibbonMenuItem.cs (2)
1177Debug.Assert(timer != null, "timer should not be null."); 1178Debug.Assert(!timer.IsEnabled, "timer should not be running.");
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 (115)
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 (42)
319Debug.Assert(!result, "Complete method is supposed to raise Completed event."); 352Debug.Fail("Unsupported parameters"); 364Debug.Assert(!IsRunning); 417Debug.Assert(handler != null); 615Debug.Assert(double.IsNaN(this.desiredDeceleration), "desiredDisplacement and desiredDeceleration are mutually exclusive."); 626Debug.Assert(double.IsNaN(this.desiredDisplacement), "desiredDisplacement and desiredDeceleration are mutually exclusive."); 672Debug.Assert( 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); 762Debug.WriteLine("Too long extrapolation, stop it."); 795Debug.Assert(this.expansion.InitialValue > 0 && 840Debug.Assert(this.expansion.InitialValue > 0 && 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); 958Debug.Assert(!double.IsNaN(resultValue) && !double.IsInfinity(resultValue), "Calculation error, value should be a finite number."); 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\Manipulation2DCompletedEventArgs.cs (4)
38Debug.Assert(Validations.IsFinite(originX), "originX should be finite"); 39Debug.Assert(Validations.IsFinite(originY), "originY should be finite"); 40Debug.Assert(velocities != null, "velocities should not be null"); 41Debug.Assert(total != null, "total should not be null");
System\Windows\Input\Manipulations\Manipulation2DDeltaEventArgs.cs (5)
41Debug.Assert(Validations.IsFinite(originX), "originX should be finite"); 42Debug.Assert(Validations.IsFinite(originY), "originY should be finite"); 43Debug.Assert(velocities != null, "velocities should not be null"); 44Debug.Assert(delta != null, "delta should not be null"); 45Debug.Assert(cumulative != null, "cumulative should not be null");
System\Windows\Input\Manipulations\Manipulation2DStartedEventArgs.cs (2)
43Debug.Assert(Validations.IsFinite(originX)); 44Debug.Assert(Validations.IsFinite(originY));
System\Windows\Input\Manipulations\ManipulationDelta2D.cs (7)
105Debug.Assert(Validations.IsFinite(translationX), "translationX should be finite"); 106Debug.Assert(Validations.IsFinite(translationY), "translationY should be finite"); 107Debug.Assert(Validations.IsFinite(rotation), "rotation should be finite"); 108Debug.Assert(Validations.IsFiniteNonNegative(scaleX), "scaleX should be finite and not negative"); 109Debug.Assert(Validations.IsFiniteNonNegative(scaleY), "scaleY should be finite and not negative"); 110Debug.Assert(Validations.IsFinite(expansionX), "expansionX should be finite"); 111Debug.Assert(Validations.IsFinite(expansionY), "expansionY should be finite");
System\Windows\Input\Manipulations\ManipulationPivot2D.cs (1)
142Debug.Assert(processor != null);
System\Windows\Input\Manipulations\ManipulationProcessor2D.cs (4)
330Debug.Assert(sender != null); 331Debug.Assert(this.currentManipulation == null, "Manipulation was already in progress"); 353Debug.Assert(object.ReferenceEquals(sender, this.currentManipulation)); 367Debug.Assert(object.ReferenceEquals(sender, this.currentManipulation));
System\Windows\Input\Manipulations\ManipulationSequence.cs (24)
279Debug.Assert(!float.IsNaN(result) && !float.IsInfinity(result)); 432Debug.Assert(this.processorState == ProcessorState.Manipulating, "Wrong state."); 514Debug.Assert(Started != null, "Processor hasn't registered for Started event"); 521Debug.Assert(Delta != null, "Processor hasn't registered for Delta event"); 581Debug.Assert(Completed != null, "Processor hasn't registered for Completed event"); 599Debug.Assert(this.log.Length > 0); // makes a good breakpoint to read the log 667Debug.Assert(this.processorState == ProcessorState.Manipulating, "Invalid state."); 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)); 949Debug.Assert(settings.Pivot != null, "don't call unless we have a settings.Pivot"); 950Debug.Assert(settings.Pivot.HasPosition, "don't call unless there's a settings.Pivot location"); 1017Debug.Assert(this.manipulatorStates != null && this.manipulatorStates.Count > 0); 1038Debug.Assert(this.manipulatorStates != null && this.manipulatorStates.Count > 0); 1077Debug.Assert(queue != null); 1101Debug.Assert(timeDelta >= ManipulationProcessor2D.TimestampTicksPerMillisecond, 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 (8)
88Debug.Assert(Validations.IsFinite(linearVelocityX)); 89Debug.Assert(Validations.IsFinite(linearVelocityY)); 90Debug.Assert(Validations.IsFinite(angularVelocity)); 91Debug.Assert(Validations.IsFinite(expansionVelocity)); 112Debug.Assert(getLinearVelocityX != null, "getLinearVelocityX should not be null"); 113Debug.Assert(getLinearVelocityY != null, "getLinearVelocityX should not be null"); 114Debug.Assert(getAngularVelocity != null, "getLinearVelocityX should not be null"); 115Debug.Assert(getExpansionVelocity != null, "getLinearVelocityX should not be null");
System\Windows\Input\Manipulations\Validations.cs (2)
31Debug.Assert(paramName != null); 55Debug.Assert(paramName != null);
System.Xaml (185)
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\Internal\Xaml\Context\XamlFrame.cs (1)
46Debug.Assert(_depth != -1, "Context Frame is uninitialized");
src\Microsoft.DotNet.Wpf\src\Shared\MS\Utility\FrugalList.cs (4)
188Debug.Assert(start >= _previousEnd, "Arguments out of order during Compact"); 189Debug.Assert(_validItemCount + end - start <= _newCount, "Too many items copied during Compact"); 1279Debug.Assert(collection is not null); 1287Debug.Assert(collection is not null);
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (3)
133Debug.Assert(null != type, "Type passed to IsInternalType is null"); 154Debug.Assert(null != type, "Type passed to IsPublicType is null"); 449Debug.Assert(!assemblyPath.EndsWith(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal), "the assembly path should be a full file path containing file extension");
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\TypeConverterHelper.cs (1)
120Debug.Assert(null != type, "Null passed for type to GetConverterType");
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 (7)
78Debug.Assert(rootNameScope == null, "Cannot pass a new namescope in to a reparse context"); 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 (3)
259Debug.Assert(typeName != null, "typeName cannot be null and should have been checked before now"); 260Debug.Assert(typeName.Name != null, "typeName.Name cannot be null and should have been checked before now"); 261Debug.Assert(typeName.Namespace != null);
System\Xaml\InfosetObjects\DeferredWriter.cs (2)
148Debug.Assert(!property.IsDirective && !property.IsUnknown); 199Debug.Assert(_deferredTreeDepth == 0);
System\Xaml\InfosetObjects\XamlNodes.cs (7)
53Debug.Assert(false, "XamlNode Ctor missing data argument"); 68Debug.Assert(data is XamlType, "XamlNode ctor, StartObject data is not a XamlType"); 72Debug.Assert(data is XamlMember, "XamlNode ctor, StartMember data is not a XamlMember"); 76Debug.Assert(data is NamespaceDeclaration, "XamlNode ctor, NamespaceDeclaration data is not a NamespaceDeclaration"); 86Debug.Assert(data == null, "XamlNode ctor, Internal XamlNode data must be null for this Node type"); 90Debug.Assert(false, "XamlNode ctor, incorrect ctor called."); 101Debug.Assert(internalNodeType == InternalNodeType.EndOfAttributes ||
System\Xaml\InfosetObjects\XamlObjectWriter.cs (22)
151Debug.Assert(_context.SourceBamlUri == null || _context.BaseUri == null || _context.SourceBamlUri == _context.BaseUri, 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); 1816Debug.Assert(ctx.ParentType.IsCollection, "Logic_WillParentCollectionAdd called on a non-collection"); 1862Debug.WriteLine(SR.Format(SR.DictionaryFirstChanceException, ctx.ParentType, key, ctx.ParentType.KeyType)); 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\InfosetObjects\XamlXmlReader.cs (1)
258Debug.Assert(_current.IsEof, "Xaml Parser returned an illegal internal XamlNode");
System\Xaml\MS\Impl\XmlNsInfo.cs (1)
125Debug.Assert(Assembly != null, "RefOnly assemblies shouldn't be GCed");
System\Xaml\Parser\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 (6)
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); 641Debug.Assert(false, "Missing End Object in node sorter"); 655Debug.Assert(length1 > 0 && length2 > 0);
System\Xaml\Parser\XamlScanner.cs (5)
248Debug.Assert(_xmlReader.NodeType == XmlNodeType.Element); 284Debug.Assert(_xmlReader.NodeType == XmlNodeType.Element); 426Debug.Assert(_xmlReader.NodeType == XmlNodeType.Element); 773Debug.Assert(prop.IsUnknown); 829Debug.Assert(_accumulatedText != null, "Creating unnecessary XamlText objects");
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 (9)
108Debug.Fail("Unexpected attribute type requested: " + attributeType.Name); 152Debug.Fail("Unexpected attribute type requested: " + attributeType.Name); 183Debug.Fail("Unexpected attribute type requested: " + attributeType.Name); 224Debug.Fail("Unexpected attribute type requested: " + attributeType.Name); 252Debug.Assert(attributeType == typeof(XamlDeferLoadAttribute)); 253Debug.Assert(count == 2); 304Debug.Fail("Unexpected attribute type requested: " + attributeType.Name); 349Debug.Assert((flagMask & 0xFFFF) == flagMask, "flagMask should only use lower 16 bits of int"); 358Debug.Assert(value || (bitMask & bitToSet) == 0);
System\Xaml\Schema\TypeReflector.cs (13)
306Debug.Assert(_positionalParameterTypes != null, "TryGetPositionalParameters should have been called first"); 347Debug.Assert(!IsUnknown); 428Debug.Assert(UnderlyingType != null, "Caller should check for UnderlyingType == null"); 439Debug.Assert(UnderlyingType != null, "Caller should check for UnderlyingType == null"); 452Debug.Assert(UnderlyingType != null, "Caller should check for UnderlyingType == null"); 453Debug.Assert(_nonAttachableMemberCache != null, "Members property should have been invoked before this"); 465Debug.Assert(UnderlyingType != null, "Caller should check for UnderlyingType == null"); 466Debug.Assert(_nonAttachableMemberCache != null, "Members property should have been invoked before this"); 685Debug.Assert(UnderlyingType != null, "Caller should check for UnderlyingType == null"); 702Debug.Assert(UnderlyingType != null, "Caller should check for UnderlyingType == null"); 952Debug.Assert(UnderlyingType != null, "Caller should check for UnderlyingType == null"); 953Debug.Assert(_attachableMemberCache != null, "AttachableMembers property should have been invoked before this"); 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 (4)
99Debug.Assert(typeArgs.Length > 0, "This method should only be called for generic types."); 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 (4)
341Debug.Assert(_declaringType != null, "XamlDirective should not call base.ToString"); 937Debug.Fail("Enum out of range"); 993Debug.Assert(DeclaringType != null, "XamlDirective should not call into base.GetHashCode"); 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 (3)
301Debug.Assert(false); //should never reach here 1766Debug.Assert(Object != null); 3278Debug.Fail("Invalid enum value");
System\Xaml\XamlType.cs (26)
199Debug.Assert(_reflector != null, "_reflector should have been initialized by IsDictionary"); 216Debug.Assert(_reflector != null, "_reflector should have been initialized by GetCollectionKind"); 235Debug.Assert(_reflector != null, "_reflector should have been initialized by GetCollectionKind"); 253Debug.Assert(_reflector != null, "_reflector should have been initialized by IsCollection"); 323Debug.Assert(_reflector != null, "_reflector should have been initialized by IsMarkupExtension"); 498Debug.Assert(_reflector != null, "_reflector should have been initialized by ItemType"); 566Debug.Assert(_reflector != null, "_reflector should have been initialized by GetCollectionKind"); 775Debug.Assert(_reflector != null, "_reflector should have been initialized by AreAttributesAvailable"); 812Debug.Assert(_reflector != null, "_reflector should have been initialized by AreAttributesAvailable"); 897Debug.Assert(_reflector != null, "_reflector should have been initialized by AreAttributesAvailable"); 909Debug.Assert(_reflector != null, "_reflector should have been initialized by AreAttributesAvailable"); 967Debug.Assert(_reflector != null, "_reflector should have been initialized by AreAttributesAvailable"); 1131Debug.Assert(_reflector != null, "_reflector should have been initialized by AreAttributesAvailable"); 1143Debug.Assert(_reflector != null, "_reflector should have been initialized by AreAttributesAvailable"); 1153Debug.Assert(_reflector != null, "_reflector should have been initialized by AreAttributesAvailable"); 1185Debug.Assert(typeArgs.Length == 1); 1197Debug.Assert(_reflector != null, "_reflector should have been initialized by AreAttributesAvailable"); 1225Debug.Assert(typeArgs.Length == 1); 1239Debug.Assert(_reflector != null, "_reflector should have been initialized by AreAttributesAvailable"); 1256Debug.Assert(_reflector != null, "_reflector should have been initialized by AreAttributesAvailable"); 1328Debug.Assert(UnderlyingTypeInternal.IsSet, "EnsureReflector should have caused UnderlyingType to be initialized"); 1560Debug.Assert(GetType() != typeof(XamlType), "Default GetAllMembers logic should have already captured all writeable properties"); 1664Debug.Fail("Enum out of range"); 1691Debug.Assert(_reflector != null, "_reflector should have been initialized by AreAttributesAvailable"); 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 (38)
MS\Internal\Automation\Accessible.cs (1)
23Debug.Assert(acc != null, "null IAccessible");
MS\Internal\Automation\CacheHelper.cs (4)
75Debug.Assert(response.RequestedData == null, "both RequestedData and TreeStructure should be null or non-null"); 105Debug.Assert(false, "Internal error: got malformed tree description string (extra chars at end)"); 111Debug.Assert(false, "Internal error: mismatch between count of property buckets and nodes claiming them"); 231Debug.Assert(false, "Internal error: Got malformed tree description string, missing closing paren");
MS\Internal\Automation\ClientEventManager.cs (1)
470Debug.Assert(false, "GetNewRootTracker internal error: Unexpected Tracker value!");
MS\Internal\Automation\FocusTracker.cs (1)
83Debug.Assert(acc != null, "HandleFocusChange got hwnd and null IAccessible");
MS\Internal\Automation\HwndProxyElementProvider.cs (5)
48Debug.Assert( hwnd != NativeMethods.HWND.NULL ); 385Debug.Assert(false,"unexpected switch() case:"); 1434Debug.Assert(false, "too many children or inf loop?"); 1894Debug.Assert(false, "too many children or inf loop?"); 2136Debug.Assert(provider is IRawElementProviderFragment, "Expecting a fragment provider");
MS\Internal\Automation\MenuTracker.cs (1)
76Debug.Assert(handlers.Length <= 1, "handlers.Length");
MS\Internal\Automation\Misc.cs (1)
159Debug.Assert(false, "missing client-side pattern wrapper");
MS\Internal\Automation\ProxyManager.cs (1)
689Debug.Assert(false, "unexpected switch() case:");
MS\Internal\Automation\QueueProcessor.cs (3)
82Debug.Assert(!_quitting, "Can't add items to queue when quitting"); 92Debug.Assert(!_quitting, "Can't add items to queue when quitting"); 147Debug.Assert(_quitting, "MsgWaitForMultipleObjects failed while WaitForWork");
MS\Internal\Automation\Schema.cs (3)
67Debug.Assert( false, "GetPropertyInfo failed " + id ); 79Debug.Assert(false, "GetDefaultValue was passed an unknown property"); 115Debug.Assert( false, "GetAttributeInfo failed " + id );
MS\Internal\Automation\SelectionPatternProviderSideWrapper.cs (1)
28Debug.Assert(target != null);
MS\Internal\Automation\UiaCoreApi.cs (6)
245Debug.Assert(false, "unsupported property should not have made it this far"); 456Debug.Assert(offsets == null && treeStructures == null, "if nothin found, all out params shoud be null"); 460Debug.Assert(offsets.Length == treeStructures.Length); 648Debug.Assert(false, "Got unknown eventId from core: " + args._eventId); 666Debug.Assert(false, "Got unknown propertyId from core: " + pcargs._propertyId); 707Debug.Assert(false, "Unknown event type from core:" + args._type);
MS\Internal\Automation\WindowHideOrCloseTracker.cs (1)
90Debug.Assert(handlers.Length <= 1, "handlers.Length");
MS\Internal\Automation\WindowShowOrOpenTracker.cs (1)
88Debug.Assert(handlers.Length <= 1, "handlers.Length");
MS\Internal\Automation\WinEventWrap.cs (1)
37Debug.Assert(eventIds != null && eventIds.Length > 0, "eventIds is invalid");
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 (95)
MS\Internal\AutomationProxies\Accessible.cs (14)
151Debug.Assert(acc != null, "null IAccessible"); 324Debug.Assert(parent != null); 335Debug.Assert(false); 351Debug.Assert(parent != null); 362Debug.Assert(false); 706Debug.Assert( false, "Need to handle Accessible.accFocus case!" ); 752Debug.Assert(_idChild == NativeMethods.CHILD_SELF); 799Debug.Assert(false); 945System.Diagnostics.Debug.Assert(false, "Call to AccessibleChildren() returned E_INVALIDARG."); 1011Debug.Assert(_accessibleChildrenIndex < 0); 1190Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Unexpected exception thrown for AccessibleChildren: {0}", e)); 1198Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Unexpected hresult from AccessibleChildren: {0} count is {1} and actualCount is {2}", hr, count, actualCount)); 1402Debug.Assert(false, string.Format(CultureInfo.CurrentCulture, "MsaaNativeProvider: IAccessible threw a COMException: {0}", e.Message)); 1419Debug.Assert(false, string.Format(CultureInfo.CurrentCulture, "Unexpected IAccessible exception: {0}", e));
MS\Internal\AutomationProxies\CommonGetThemePartSize.cs (1)
99System.Diagnostics.Debug.Assert (false, "Unsupport Type");
MS\Internal\AutomationProxies\CommonXSendMessage.cs (1)
96System.Diagnostics.Debug.Assert(remoteTextArea.ToInt32() == remoteTextArea.ToInt64());
MS\Internal\AutomationProxies\EventManager.cs (1)
126System.Diagnostics.Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Unexpected idProp {0} for idOject 0x{1:x8} on element {2} for event {3}", idProp, idObject, el, eventId));
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 (4)
127Debug.Assert(refcount >= 0); 154Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "ERROR: AdviseEventRemoved called for {0} and event/property {1} without matching AdviseEventAdded.", hwnd, key), "NativeMsaaProxy"); 160Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "ERROR: AdviseEventRemoved called for {0} without matching AdviseEventAdded.", hwnd), "NativeMsaaProxy"); 364Debug.Assert(eventId == NativeMethods.EVENT_OBJECT_REORDER);
MS\Internal\AutomationProxies\MSAANativeProvider.cs (6)
57Debug.Assert(acc != null, "acc"); 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\NonClientArea.cs (1)
119System.Diagnostics.Debug.Assert(idChild == 0, string.Format(CultureInfo.CurrentCulture, "Invalid Child Id, idChild == {2}\n\rClassName: \"{0}\"\n\rhwnd = 0x{1:x8}", Misc.ProxyGetClassName(hwnd), hwnd.ToInt32(), idChild));
MS\Internal\AutomationProxies\ProxyFragment.cs (3)
126System.Diagnostics.Debug.Assert(this is ProxyHwnd, "Invalid method called ElementProviderFromPoint"); 213System.Diagnostics.Debug.Assert(fragment != null, "DrillDownFragment: starting point is null"); 218System.Diagnostics.Debug.Assert(fromPoint != null, @"DrillDownFragment: calling ElementProviderFromPoint on Fragment should not return null");
MS\Internal\AutomationProxies\ProxySimple.cs (2)
255System.Diagnostics.Debug.Assert(_sAutomationId != null, "_sAutomationId is null!"); 454System.Diagnostics.Debug.Assert(_parent != null, "Navigate: Leaf element does not have parent");
MS\Internal\AutomationProxies\QueueProcessor.cs (1)
129Debug.Assert(false, "MsgWaitForMultipleObjects failed while WaitForWork");
MS\Internal\AutomationProxies\WindowsEditBox.cs (17)
441Debug.Assert(point.x >= 0 && point.x < 65536, "WindowsEditBox.CharFromPos() x coordinate out of range."); 442Debug.Assert(point.y >= 0 && point.y < 65536, "WindowsEditBox.CharFromPos() y coordinate out of range."); 519Debug.Assert(!IsMultiline); 526Debug.Assert(IsMultiline); 556Debug.Assert(hfont != IntPtr.Zero, "WindowsEditBox.GetLogfont got null HFONT"); 561Debug.Assert(false, "WindowsEditBox.GetObject unexpected return value"); 682Debug.Assert(index >= 0, "WindowsEditBox.LineFromChar negative index."); 683Debug.Assert(index <= GetTextLength(), "WindowsEditBox.LineFromChar index out of range."); 742Debug.Assert(index >= 0, "WindowsEditBox.PosFromChar negative index."); 743Debug.Assert(index < GetTextLength(), "WindowsEditBox.PosFromChar index out of range."); 746Debug.Assert(result!=-1, "WindowsEditBox.PosFromChar index out of bounds."); 801Debug.Assert(start >= 0, "WindowsEditBox.SetSel negative start."); 802Debug.Assert(start <= GetTextLength(), "WindowsEditBox.SetSel start out of range."); 803Debug.Assert(end >= 0, "WindowsEditBox.SetSel negative end."); 804Debug.Assert(end <= GetTextLength(), "WindowsEditBox.SetSel end out of range."); 964Debug.Assert(floor >= 0); 975Debug.Assert(i >= floor);
MS\Internal\AutomationProxies\WindowsEditBoxRange.cs (1)
46Debug.Assert(provider != null);
MS\Internal\AutomationProxies\WindowsIPAddress.cs (1)
107System.Diagnostics.Debug.Assert (index != -1, "GetOverrideProviderForHwnd: cannot find child hwnd index");
MS\Internal\AutomationProxies\WindowsListBox.cs (3)
608System.Diagnostics.Debug.Assert (IsMultipleSelection (), "Calling ClearAll on single-selected listbox"); 924System.Diagnostics.Debug.Assert (_parent is WindowsListBox, "Invalid Parent for a Listbox Item"); 1192System.Diagnostics.Debug.Assert (_listBox.IsMultipleSelection (), "Calling UnSelect on single-selected listbox");
MS\Internal\AutomationProxies\WindowsListView.cs (1)
1965System.Diagnostics.Debug.Assert(el is ListViewItemCheckbox);
MS\Internal\AutomationProxies\WindowsListViewGroup.cs (2)
554System.Diagnostics.Debug.Assert (!WindowsListView.IsDetailMode (hwnd), "GetColumnCountExternal: called when lv is in Detail mode"); 804System.Diagnostics.Debug.Assert (false, "GetCountOfItemsInDimension: failed to get item rect");
MS\Internal\AutomationProxies\WindowsListViewGroupHelper.cs (3)
413System.Diagnostics.Debug.Assert(false, "Cannot add item to the needed group"); 438System.Diagnostics.Debug.Assert(false, "Cannot add item to the needed group"); 802System.Diagnostics.Debug.Assert(min <= _items.Length, "EnsureCapacity: min is > _items.Length");
MS\Internal\AutomationProxies\WindowsListViewItem.cs (2)
504System.Diagnostics.Debug.Assert (parent != null, "Hit null while looking for the SelectionContainer"); 732System.Diagnostics.Debug.Assert (WindowsListView.IsGroupViewEnabled (hwnd), "GetGroupID: called when lv does not have groups");
MS\Internal\AutomationProxies\WindowsListViewItemStartMenu.cs (2)
52System.Diagnostics.Debug.Assert(false, "The listview item on the Start Menu has an unexpected IAccessible role!"); 90System.Diagnostics.Debug.Assert(AccessibleObject != null, "Failed to get a valid IAccessible!");
MS\Internal\AutomationProxies\WindowsMenu.cs (3)
121System.Diagnostics.Debug.Assert(idObject == NativeMethods.OBJID_MENU || idObject == NativeMethods.OBJID_SYSMENU, "Unexpected idObject"); 1359System.Diagnostics.Debug.Assert(false, "Cannot find back the accelerator in the menu!"); 2704System.Diagnostics.Debug.Assert (name.Length > hotKeyStart + 1, "Unexpected end of string");
MS\Internal\AutomationProxies\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);
MS\Internal\AutomationProxies\WindowsTab.cs (2)
1185System.Diagnostics.Debug.Assert(false, "XSendMessage.GetItem() failed!"); 1199System.Diagnostics.Debug.Assert(_parent is WindowsTab, "Invalid Parent for a Tab Item");
MS\Internal\AutomationProxies\WindowsToolbarAsMenu.cs (1)
49System.Diagnostics.Debug.Assert(false, "Unexpected role " + role);
MS\Internal\AutomationProxies\WindowsToolbarItemAsMenuItem.cs (1)
42System.Diagnostics.Debug.Assert(false, "Unexpected role " + role);
MS\Internal\AutomationProxies\WindowsTreeView.cs (1)
1065System.Diagnostics.Debug.Assert (topLevelParent is WindowsTreeView, "Invalid Parent for a TreeView Item");
MS\Internal\AutomationProxies\WinEventTracker.cs (3)
272Debug.Assert(false, "Exception raising event " + eventId + " for prop " + ecp._idProp + " on hwnd " + hwnd + "\n" + e.Message); 317Debug.Assert(false, "Exception raising event " + eventId + " for prop " + ecp._idProp + " on hwnd " + hwnd + "\n" + e.Message); 461Debug.Assert (hwnd == IntPtr.Zero, @"BuildEventsList: event is global but hwnd is not null");
MS\Win32\UnsafeNativeMethods.cs (1)
402Debug.WriteLine("GetWindowLong failed. Error = " + error);
UIAutomationTypes (14)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\NativeMethodsOther.cs (1)
41Debug.Assert((0xFFFF0000 & errorCode) == 0);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\UnsafeNativeMethodsCLR.cs (9)
136Debug.WriteLine("DeleteObject failed. Error = " + error); 345Debug.WriteLine("CloseHandle failed. Error = " + error); 395Debug.WriteLine("UnmapViewOfFile failed. Error = " + error); 456System.Diagnostics.Debug.WriteLine("GetCursorPos failed!"); 1079Debug.WriteLine("DestroyIcon failed. Error = " + error); 1100Debug.WriteLine("DeleteObject failed. Error = " + error); 1139Debug.WriteLine("CreateBitmap failed. Error = " + error); 1156Debug.WriteLine("DestroyIcon failed. Error = " + error); 1171Debug.WriteLine("CreateIconIndirect failed. Error = " + error);
System\Windows\Automation\AutomationIdentifier.cs (4)
49Debug.Assert(id != 0); 127Debug.Assert(obj != null, "Null obj!"); 131Debug.Assert(obj is AutomationIdentifier, "CompareTo called with unexpected type"); 171default: Debug.Assert(false, "Invalid type specified for AutomationIdentifier");
WindowsFormsIntegration (26)
System\Windows\Integration\ApplicationInterop.cs (2)
147Debug.Assert(processedState == SWF.PreProcessControlState.MessageNotNeeded, "invalid state"); 219Debug.Assert(windowFilter != null);
System\Windows\Integration\ElementHost.cs (16)
123Debug.WriteLineIf(_traceLayout.TraceInfo, String.Format(CultureInfo.CurrentCulture, "AvalonAdapter({0}): MeasureOverride (constraint={1},result={2})", this.Name, proposedSize, prefSize)); 644Debug.WriteLineIf(HostUtils.ImeMode.Level >= TraceLevel.Info, "Inside SyncHwndSrcImeStatus(), this = " + this); 645Debug.Indent(); 664Debug.Unindent(); 681Debug.WriteLineIf(HostUtils.ImeMode.Level >= TraceLevel.Verbose, "SetChildElementsIsImeEnabled, element = " + element); 702Debug.WriteLineIf(HostUtils.ImeMode.Level >= TraceLevel.Info, "Inside OnHwndSrcWmInputLangChange(), this = " + this); 703Debug.Indent(); 722Debug.Unindent(); 731Debug.WriteLineIf(HostUtils.ImeMode.Level >= TraceLevel.Info, "Inside OnHwndSrcWmImeNotify(), this = " + this); 732Debug.Indent(); 754Debug.Unindent(); 762Debug.WriteLineIf(HostUtils.ImeMode.Level >= TraceLevel.Verbose, "Inside OnHwndSourceMsgNotifyElementHost()"); 763Debug.Indent(); 767Debug.Unindent(); 1596Debug.Assert(request != null, "request was null!"); 1615Debug.Assert(false, "Unknown FocusNavigationDirection");
System\Windows\Integration\WindowsFormsHost.cs (8)
92Debug.WriteLineIf(HostUtils.ImeMode.Level >= TraceLevel.Info, "Inside SyncChildImeEnabledContext(), this = " + this); 93Debug.Indent(); 111Debug.Unindent(); 485Debug.WriteLineIf(_traceHandle.TraceVerbose, String.Format(CultureInfo.CurrentCulture, "WindowsFormsHost({0}): BuildWindowCore (parent=0x{1:x8})", this.Name, hwndParent.Handle.ToInt32())); 893Debug.Assert(false, "Unknown FocusNavigationDirection"); 991Debug.Assert(uiAction == NativeMethods.UIS_INITIALIZE || uiAction == NativeMethods.UIS_SET, "Unexpected uiAction"); 1056Debug.WriteLineIf(WindowsFormsHost._traceLayout.TraceInfo, String.Format(CultureInfo.CurrentCulture, "WindowsFormsHost({0}): Layout invalidated (control='{1}',property='{2}')", _host.Name, compName, e.AffectedProperty)); 1118Debug.Assert(methodInfo != null, "Couldn't find OnParentRightToLeftChanged method!");
xunit.console (1)
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\DependencyContextLoader.cs (1)
97Debug.Assert(_fileSystem.File.Exists(location));